#include <tcl.h> Tcl_Exit(status) Tcl_CreateExitHandler(proc, clientData) Tcl_DeleteExitHandler(proc, clientData)
Tcl_Exit is the procedure that is invoked to end a Tcl application. It is invoked by the exit command, as well as anyplace else that terminates the application. No-one should ever invoke the exit procedure directly; always invoke Tcl_Exit instead, so that it can invoke exit handlers.
Tcl_CreateExitHandler arranges for proc to be invoked by Tcl_Exit before it terminates the application. This provides a hook for cleanup operations such as flushing buffers and freeing global memory. Proc should have arguments and return value that match the type Tcl_ExitProc:
The clientData parameter to proc is a copy of the clientData argument given to Tcl_CreateExitHandler when the callback was created. Typically, clientData points to a data structure containing application-specific information about what to do in proc.typedef void Tcl_ExitProc(ClientData clientData);
Tcl_DeleteExitHandler may be called to delete a previously-created exit handler. It removes the handler indicated by proc and clientData so that no call to proc will be made. If no such handler exists then Tcl_DeleteExitHandler does nothing.
Copyright © 1989-1994 The Regents of the University of California.
Copyright © 1994-1996 Sun Microsystems, Inc.