lights FAQ Forum github.com/luapower/ffi_reflect
ffi_reflect

Unsupported
syscall
bnet
lfs
lanes
mmap WIP
stdio WIP
vararg
nanojpeg
blur WIP
openvg WIP
hpdf
svg_parser WIP
ffi_reflect
struct
pmurhash
murmurhash3
md4
crc32
oo
ringbuffer
dlist
obj_parser
glut
fbclient WIP
portaudio
libssh2 WIP
minizip
terra
llvm
utf8 WIP
ucdn
libunibreak
harfbuzz
fribidi
chipmunk
libvlc WIP
libvorbis WIP
libpng WIP

ffi_reflect

luajit ffi reflection


NOTE: This is a fork of the reflect module by Peter Cawley, developed here.

Quick examples:

local ffi = require "ffi"
local reflect = require "ffi_reflect"

ffi.cdef 'int sc(const char*, const char*) __asm__("strcmp");'
print(reflect.typeof(ffi.C.sc).sym_name) --> "strcmp"

for refct in reflect.typeof"int(*)(int x, int y)".element_type:arguments() do
  print(refct.name)
end --> x, y

t = {}
assert(reflect.getmetatable(ffi.metatype("struct {}", t)) == t)

For the full API reference, see http://corsix.github.io/ffi-reflect/.


Last updated: 2 years ago | Edit on GitHub

Pkg type:Lua+ffi
Version: 4ee6eb7bd7-12-g9eeeb18
Last commit:
License: PD
Requires: luajit 
Required by: xlib 

Top