dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.49k stars 112 forks source link

why not include ffi.c on the distribution ? #2584

Closed kascote closed 2 years ago

kascote commented 2 years ago

Is possible to include ffi.c on the library distribution? I'm using OSX and the brew version do not include it, but includeslibnotcurses-ffi.* ffi.c is handy to autogenerate the bindings. not sure why it not is ffi.h (c is not may main language) or must I ask to the person that bundle notcurses on brew ?

dankamongmen commented 2 years ago

hey there. you shouldn't need any of the *.c files installed; they're just compiled to build the objects. certainly you ought never be linking ffi.c into your programs. its purpose is to provide other languages with bindings to notcurses's static inline functions, which don't normally get compiled into the library as symbols.

essentially, these are very basic functions which are included directly in the headers. every one of the functions you see in ffi.c is (or at least ought be) present in notcurses.h, where a c program can include them.

so....

does that explain things for you? if not, feel free to ask further questions.

kascote commented 2 years ago

yes I understand. My issue is that the binding generator I use do not support inline functions on .h files, because as you mention these do not finish on the symbol table and assume that re unreachable. For that reason I was using ffi.c to get the definitions and resolving against libffi

dankamongmen commented 2 years ago

ahhh you want to link libnotcurses-ffi.so. it contains the generated functions.

dankamongmen commented 2 years ago

you'll need to supply -DBUILD_FFI_LIBRARY=on to cmake btw