lua-users home
lua-l archive

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

I have C++ function
void f(Foo **arg);
that I'm exposing to Lua using toLua.

tolua produces .cpp file that expects Foo *, not Foo**.
Generated file looks like

!tolua_isusertype(tolua_S,5,"Foo",0,&tolua_err) ||

and then

arg = (Foo *)tolua_tousertype(...)

C++ function is designed to store something into pointer "arg". But
tolua fails to understand it.

Moreover, if I am using triple pointer:
void f(Foo ***arg);

tolua generates something like that:

Foo**arg = ((Foo*)  tolua_tousertype(...);

that could not compile due to type mismatch in left hand side and
right hand side.

Or maybe I am doing something wrong? Thanks in advance.