Tcl_Canceled (3) Linux Manual Page
Tcl_CancelEval, Tcl_Canceled – cancel Tcl scripts
Synopsis
#include <tcl.h>intTcl_CancelEval(interp, clientData, flags) intTcl_Canceled(interp, flags)
Arguments
- Tcl_Interp *interp (in) Interpreter in which to cancel the script.
- int flags (in) ORed combination of flag bits that specify additional options. For
Tcl_CancelEval, onlyTCL_CANCEL_UNWINDis currently supported. ForTcl_Canceled, onlyTCL_LEAVE_ERR_MSGandTCL_CANCEL_UNWINDare currently supported.- ClientData clientData (in) Currently, reserved for future use. It should be set to NULL.
- int flags (in) ORed combination of flag bits that specify additional options. For
Description
Tcl_CancelEval cancels or unwinds the script in progress soon after the next invocation of asynchronous handlers, causing TCL_ERROR to be the return code for that script. This function is thread-safe and may be called from any thread in the process.
Tcl_Canceled checks if the script in progress has been canceled and returns TCL_ERROR if it has. Otherwise, TCL_OK is returned. Extensions can use this function to check to see if they should abort a long running command. This function is thread sensitive and may only be called from the thread the interpreter was created in.
Flag Bits
Any ORed combination of the following values may be used for the flags argument to procedures such as Tcl_CancelEval:
TCL_CANCEL_UNWIND- This flag is used by
Tcl_CancelEvalandTcl_Canceled. ForTcl_CancelEval, if this flag is set, the script in progress is canceled and the evaluation stack for the interpreter is unwound. ForTcl_Canceled, if this flag is set, the script in progress is considered to be canceled only if the evaluation stack for the interpreter is being unwound. TCL_LEAVE_ERR_MSG- This flag is only used by
Tcl_Canceled; it is ignored by other procedures. If an error is returned and this bit is set in flags, then an error message will be left in the interpreter’s result, where it can be retrieved withTcl_GetObjResultorTcl_GetStringResult. If this flag bit is not set then no error message is left and the interpreter’s result will not be modified.
See Also
TIP 285
Keywords
cancel, unwind
