I have a C application that can execute TCL scripts, and many custom TCL commands that are implemented in C and registered with Tcl_CreateObjCommand.
In the implementation of a command I want to find out a filename of the TCL script that has called my command. I.e. something like "info script
" but called from C (I don't need a full path, just the filename would be sufficient). The only parameters that I have in my command are
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]
clientData is NULL.
So is there a C function where I can pass just Tcl_Interp*
and get the filename of the TCL script? Or if it doesn't exist, is it safe to call Tcl_Eval*
functions from an implementation of a TCL command, and thus it will be an indirectly recursive call.