Author: Brian Griffin <firstname.lastname@example.org> Author: Jan Nijtmans <email@example.com> State: Draft Type: Project Vote: Pending Created: 15-Oct-2012 Post-History: Tcl-Version: 8.7 Tcl-Branch: initsubsystems
The ability to initialize just the lower level Tcl subsystems used to be part of the public API, now it is no longer exposed. This TIP proposes that it be re-exposed through the existing function Tcl_SetPanicProc()
Some parts of Tcl's API are useful in portable applications even without creating a Tcl interpreter; examples of this include Tcl_Alloc and (most of) the Tcl_DString-related functions. In order to use these functions correctly, the Tcl library must be initialized, yet the function for doing so - Tcl_InitSubsystems (currently TclInitSubsystems) - was removed from Tcl's API; using Tcl_FindExecutable instead feels incorrect as we're not seeking to make the name of the executable available to Tcl scripts.
The functionality of the existing function Tcl_SetPanicProc is extended, such that it does the initialization of the lower level Tcl subsystem as well. It (still) has a single argument, panicProc. When NULL, the default panic function is used. The return value, which used to be void is changed to const char * and it returns the version of the Tcl library which was initialized. The full signature is:
EXTERN const char * Tcl_SetPanicProc( Tcl_PanicProc *panicProc);
A reference implementation is available in the initsubsystems branch. http://core.tcl.tk/tcl/info/initsubsystems
This document has been placed in the public domain.