TIP 414: Add (back) Tcl_InitSubsystems as Public API

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.
Author:         Brian Griffin <[email protected]>
Author:         Jan Nijtmans <[email protected]>
State:          Draft
Type:           Project
Vote:           Pending
Created:        15-Oct-2012
Post-History:   
Tcl-Version:    8.7
Tcl-Branch:     initsubsystems
Keywords:       Tcl, library initialisation

Abstract

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.

Rationale

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.

Proposed Change

A new function Tcl_InitSubsystems, being a renamed TclInitSubsystems, should be exposed as alternative to Tcl_FindExecutable in Tcl's C API. This will not be a part of the Stub API; it is not intended to ever be used from an initialized stubbed environment, as it is meant to be used prior to the stub table being available. The full signature is:

void Tcl_InitSubsystems(void);

Reference Implementation

A reference implementation is available in the initsubsystems branch.

Copyright

This document has been placed in the public domain.