lua-users home
lua-l archive

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


Mark Hamburg wrote:
> If worrying about speed, [...]

... then you'll probably use LuaJIT, anyway. And the FFI already
has support for automatic string -> enum conversions:

ffi.cdef[[
typedef enum { FOO = 11, BAR = 22 } MyEnum;
void mycall(MyEnum x);
]]

ffi.C.mycall("BAR") --> is automatically turned into mycall(22)

--Mike