Is it possible to load more than one library at same time with LuaJIT's ffi.load?
Can something like this works?
local ffi = require("ffi")
local bor = require("bit").bor
ffi.cdef([[
// C bindings from each library!
]])
return ffi.load(bor("lib1", "lib2", "lib3"))
You can't really import multiples libraries to a single userdata due to the way LuaJIT FFI library works. The only thing you can easily do is to call userdata getter in a protected call as LuaJIT FFI throw an error on undefined symbol, and loop each library you want to fetch.