lua-users home
lua-l archive

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


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

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