lua_call

Function lua_call 

Source
pub fn lua_call(l: LuaState, nargs: c_int, nresults: c_int) -> c_int
Expand description

Calls a function. To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, the arguments to the function are pushed in direct order – that is, the first argument is pushed first.

Finally you call lua_call.

§Params

  • l - The lua state.
  • nargs - The number of arguments that you pushed onto the stack.
  • nresults - Number of expected results to push onto the stack, or MULTRET to push all results.

§Stack Behavior

All arguments and the function value are popped from the stack when the function is called. The function results are pushed onto the stack when the function returns in direct order, so the last result is on the top of the stack.