lua-users home
lua-l archive

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


Xavier Wang wrote:
> I see, maybe providing another function to lookup symbols is better ?
> 
> ffi.lookup("C", "foobar") -- nil, "no such symbol"

Easy enough to add this yourself:

  local function plookup(ns, sym) return ns[sym] end
  function ffi.lookup(ns, sym) return pcall(plookup, ns, sym) end

print(ffi.lookup(ffi.C, "foobar"))

--Mike