How to wrap a C function whose parameters are pointer to structs, so that it can be called from Lua?
- by pierr
I have the follwing C function. How should I wrap it so it can be called from a Lua script?
typedef struct tagT{
int a ;
int b ;
} type_t;
int lib_a_f_4(type_t *t)
{
return t->a * t->b ;
}
I know how to wrapr it if the function parameter type were int or char *. Should I use table type for a C structure?
EDIT: I am using…