Skip to content

New VAPI: gnu.vapi binds GNU APIs (WIP)

Reuben Thomas requested to merge rrt/vala:gnu-vapi into master

This initial version of gnu.vapi binds:

  • GNU’s regex.h (POSIX, GNU and BSD APIs)
  • getopt_long (and getopt_long_only)
  • memmem

There are some questions/problems that need to be resolved:

  • getopt_long_fix.h workaround for a bug in valac with naming; for now, I added a typedef.
  • the regex offset types have different sizes depending on whether you’re using glibc or not. I made this conditional on _REGEX_LARGE_OFFSETS. It might be better for Vala to assume the larger size, but then valac would not be able to warn about integer conversions. Since the type involved is unsigned, implicit type conversion in C would do the right thing, so the only risk would be unexpectedly losing precision for strings > 4GB in length.
Edited by Rico Tzschichholz

Merge request reports