lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Patrick Donnelly wrote:
> Would it be possible to load a C header file using FFI to get this
> debug info (along with constants such as the various errnos?). Then
> loading the *.so would "simply" mean looking for functions listed in
> the header files that have been loaded?

Sure, that's the plan. But note that when deploying to a user
system, you may need to ship the header file. Though you'd be
better off with the subset of declarations you really need and
simply embed them as a long string.

The parser is already able to grok <stdio.h> (no small feat). But
I'm not happy until it works on <windows.h> and <gtk.h>. :-)

And the C parser doesn't contain preprocessor functionality, yet.
You can pipe the header file through cc -E -P in the meantime. But
in the long term I'll need to add an internal preprocessor.
Otherwise you can't get constants from #defines (enums work fine).