假设我有以下LuaJIT代码:
local ffi = require "ffi"
ffi.cdef[[
typedef struct { int num; } container;
]]
local a = ffi.new("container")
a.num = 10
library.doSomethingTo(a)
,假设library.doSomethingTo
由以下C代码定义:
int doSomethingDo(lua_State *L) {
//code here
}
要使//code here
打印10,需要什么代码library.doSomethingTo(a)
?