lua-users home
lua-l archive

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


>I'm (still) a bit confused about 'loadlib' and dynamic C/Lua binding in
>general. The idea behind loadlib's "callfromlib" function seems to be that
>there's a Lua "wrapper" that takes care of declaring the function names
>within Lua and then calling C/C++ in its body.

I'm sorry, I was talking about my bare-bones loadlib, which only loads the
library and returns the init function to be called by the host.

>HOWEVER, the calling prototype within "callfromlib" is the normal "int
>func(lua_State* L)" which means the called function should do Lua stack
>handling itself. How can it do this? The normal lua code that it needs is on
>the other side of the dll/so barrier.

Like I said before, I think this is handled well by the likner, by simply
listing the Lua libraries as a dependency. Isn't that the easiest thing to do?
--lhf