Ffi Reflect Save

LuaJIT FFI reflection library

Project README

LuaJIT FFI reflection library

Quick examples:

local ffi = require "ffi"
local reflect = require "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/.

Open Source Agenda is not affiliated with "Ffi Reflect" Project. README Source: corsix/ffi-reflect
Stars
98
Open Issues
5
Last Commit
2 months ago
Repository

Open Source Agenda Badge

Open Source Agenda Rating