So first I load in a DLL I need
local ffi = require("ffi")
local theDLL = ffi.load("thisDLL")
in the ffi cdef I have this struct
ffi.cdef [[
typedef struct {
/*
* begin_proj callback
*/
bool (__cdecl *begin_proj)(char *proj);
/*
* save_proj_state
*/
bool (__cdecl *save_proj_state)(unsigned char **buffer, int *len);
} StructCallbacks;
I also have this function in the cdef
__declspec(dllexport) int __cdecl start_session(StructCallbacks *cb);
Now I would like to call this function
print(theDLL.start_session(myCallbacks))
the question is how can I pass the structs the function needs (how do I make myCallbacks a struct of callbacks to Lua functions)?