lua-users home
lua-l archive

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


On 27.10.2011 01:43, Daurnimator wrote:

You can't do this with the FFI yet; there is no callback support.

Actually in theory you probably could but it's *very ugly*. See
proof of concept here:
http://www.corsix.org/content/callbacks-luajit-ffi

If you know what callback you have to pass you can also write
a small C companion library that implements a callback-less
function, eg.:

https://github.com/catwell/luajit-msgpack/blob/master/luajitmsgpack.c#L16

--
Pierre Chapuis