tlua::ffi

Function lua_pushcfunction

Source
pub unsafe fn lua_pushcfunction(state: *mut lua_State, f: lua_CFunction)
Expand description

Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function. [-0, +1, m]

Any function to be registered in Lua must follow the correct protocol to receive its parameters and return its results (see lua_CFunction).