PK_THREAD_ask_function   

PK_ERROR_code_t    PK_THREAD_ask_function
(
--- received arguments ---
int                depth,       --- recursion depth

--- returned arguments ---
const char **const fn_name,     --- function name string (may be NULL)
int         *const total_depth  --- current total recursion depth (>= 0)
)


This function returns the name of the PK function being executed in the
calling thread and the total recursion depth of its current call stack.


If 'depth' is -1 this function will return the innermost PK function in the
call stack. If 'depth' is non-negative it will return the PK function at that
position in the call stack starting at 0 for the outermost. If 'depth' is
equal to or greater than the returned value of 'total_depth' then 'fn_name'
will be NULL.

The function may be invoked from within a PK registered application
callback function. The function will return the name of the PK function that
is responsible for invoking the callback function. The name of the function
is returned as a ASCII string which resides in read-only memory. The
application must not attempt to modify or free this string.

If this function is invoked whilst no PK function is being executed in the
calling thread then the function will return 'fn_name' value of NULL and a
'total_depth' value of 0.