Skip to content

tburmeister/ffi-reflect

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/.

About

LuaJIT FFI reflection library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 67.1%
  • Lua 31.6%
  • CSS 1.3%