sq_compile

Squirrel 3.0

sq_compile

SQRESULT sq_compile(HSQUIRRELVM v, HSQLEXREADFUNC read, SQUserPointer p, const SQChar * sourcename, SQBool raiseerror);

compiles a squirrel program; if it succeeds, push the compiled script as function in the stack.

parameters:
HSQUIRRELVM v

the target VM

HSQLEXREADFUNC read

a pointer to a read function that will feed the compiler with the program.

SQUserPointer p

a user defined pointer that will be passed by the compiler to the read function at each invocation.

const SQChar * sourcename

the symbolic name of the program (used only for more meaningful runtime errors)

SQBool raiseerror

if this value is true the compiler error handler will be called in case of an error

return:

a SQRESULT. If the sq_compile fails nothing is pushed in the stack.

remarks:

in case of an error the function will call the function set by sq_setcompilererrorhandler().