sq_getfunctioninfo

Squirrel 3.0

sq_getfunctioninfo

SQRESULT sq_getfunctioninfo(HSQUIRRELVM v, SQInteger level, SQFunctionInfo * fi);

parameters:
HSQUIRRELVM v

the target VM

SQInteger level

calls stack level

SQFunctionInfo * fi

pointer to the SQFunctionInfo structure that will store the closure informations

return:

a SQRESULT.

remarks:

the member 'funcid' of the returned SQFunctionInfo structure is a unique identifier of the function; this can be useful to identify a specific piece of squirrel code in an application like for instance a profiler. this method will fail if the closure in the stack is a native C closure.

eg.
        
typedef struct tagSQFunctionInfo {
	SQUserPointer funcid; //unique idetifier for a function (all it's closures will share the same funcid)
	const SQChar *name; //function name
	const SQChar *source; //function source file name
}SQFunctionInfo;