lua-users home
lua-l archive

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


Hallo,

Robert Kücken wrote:
Hi,
how can I register and call a self-written C-function in a Lua-Script?
thanks


You must write a C function with a specific signature (int ()(lua_State*)) that follows a protocol for using the stack, so you are better reading the Lua reference manual. What you should look for is the lua_pushcfunction() function and the lua_register() macro.

--
Alex Queiroz