sq_call

Squirrel 3.0

sq_call

SQRESULT sq_call(HSQUIRRELVM v, SQInteger params, SQBool retval, SQBool raiseerror);

calls a closure or a native closure.

parameters:
HSQUIRRELVM v

the target VM

SQInteger params

number of parameters of the function

SQBool retval

if true the function will push the return value in the stack

SQBool raiseerror

if true, if a runtime error occurs during the execution of the call, the vm will invoke the error handler.

return:

a SQRESULT

remarks:

the function pops all the parameters and leave the closure in the stack; if retval is true the return value of the closure is pushed. If the execution of the function is suspended through sq_suspendvm(), the closure and the arguments will not be automatically popped from the stack.