lua-users home
lua-l archive

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


Is there any interest in a library that can take advantage of libffi
or ffcall [2] to enable access to arbitrary functions?  Of course
there would be limitations to what sort of arguments are passed (but
from my looks @ ffcall, it can handle pretty detailed struct
parameters)

libffi, being part of GCC looks to be a good option due to platform
support (any statistics on this?), however documentation/examples are
nowhere to be seen.  ffcall supports many archs, is available separate
from GCC, and has pretty reasonable documentation, examples, and
tests.

Also to note about ffcall: it supports some neat stuff, such as a
simpler stdcall-type interface and which I think is the best feature
besides the FFI-type stuff, is the ability to create native C
closures... useful for creating augmented callbacks that can be passed
to other frameworks (ex: fltk).

I'd be happy to collaborate to create a Lua 5.1 compatible module for
such functionality.
In the near future I may throw together an example using one of these
libraries...  I'd hope that the complete library could use either of
these libraries (or both) to open the library to handling the most
features while allowing for customization and platform accessibility.
For example... ffcall may support creating callbacks that can be used
by fltk .. but for a simpler program that is only supported by libffi,
the module would be the same, just supporting a different feature
subset.)


1 : http://www.haible.de/bruno/packages-ffcall.html
--
Thomas Harning Jr.