Created
January 12, 2012 20:23
-
-
Save malkia/1602892 to your computer and use it in GitHub Desktop.
idea: extend luajit's ffi.cdef so that it can return introspection information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Something like (ZeroMQ in this case) | |
return { | |
typedefs = { | |
functions = { | |
zmq_free_fn = { "void", "data", "hint" }, | |
}, | |
structs = { | |
zmq_pollitem_t = "zmq_pollitem_t" | |
}, | |
}, | |
functions = { | |
zmq_version = { [0]="", "int*", "int*", "int*" } | |
zmq_errno = { "int" } | |
} | |
unions = { | |
}, | |
structs = { | |
zmq_msg_t = { | |
}, | |
}, | |
enums = { | |
ZMQ_VERSION_MAJOR = 2, | |
}, | |
} | |
-- The table above would be returned by ffi.cdef() if asked for it (could be ffi.cdefx, as in extended info) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment