\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#414: Add (back) Tcl\_InitSubsystems as Public API}
\date{October 15, 2012}
\author{Brian Griffin, Jan Nijtmans}
\urlstyle{sf}
\setlength{\parskip}{1ex}
\setlength{\parindent}{0pt}
\def\tipversion$#1${\texttt{\$#1\$}}
\def\tiplangle#1{\ensuremath{<}}
\def\tiprangle#1{\ensuremath{>}}
\def\tipbar#1{\ensuremath{|}}
\def\tipmail#1#2{\(\langle\){\small\expandafter\url{#1@#2}}\(\rangle\)}
\ifx\pdfoutput\undefined
\newcommand{\tipimage}[2]{\typeout{Make sure you download #1.eps}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.eps}}{\includegraphics[width=0.8\textwidth]{#1.eps}}}
\newcommand{\tipxref}[1]{}
\newcommand{\tipxrefend}{}
\else
\newcommand{\tipimage}[2]{\typeout{Make sure you create #1.pdf}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.pdf}}{\includegraphics[width=0.8\textwidth]{#1.pdf}}}
\pdfcatalog{/PageMode /UseOutlines}
\newcommand{\tipxref}[1]{\pdfannotlink attr {/C [0.5 0.5 1.0] /Border [0 0 1]} goto name {#1}}
\newcommand{\tipxrefend}{\pdfendlink}
\fi
\newenvironment{tipabstract}{\begin{abstract}}{\end{abstract}}
\begin{document}\maketitle
\begin{center}\begin{tabularx}{\linewidth}{|r@{: }X|}\hline
\textbf{TIP \#414}&\textbf{Add (back) Tcl\_InitSubsystems as Public API}\\\hline
Author&

Brian Griffin \tipmail{brian_griffin}{mentor.com}
\par
Jan Nijtmans \tipmail{jan.nijtmans}{gmail.com}
\\
Created&Monday, \(\text{15}^{\text{th}}\) October 2012\\
Type&Project\\
Tcl Version&\(8.7\)\\
State&Draft\\
Vote&Pending\\
Version&\tipversion$Revision: 1.25 $\\
Post History&\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

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.
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{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 \textit{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.

\section{Proposed Change}

A new function Tcl\_InitSubsystems, similar to the internal TclInitSubsystems, should be exposed as alternative to Tcl\_FindExecutable in Tcl's C API. This will \textit{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. It has a single argument, \textit{panicProc}. When NULL, the default panic function is used. The full signature is:

\begin{quote}
EXTERN const char * \textbf{Tcl\_InitSubsystems}( Tcl\_PanicProc *\textit{panicProc});
\end{quote}

The return value of \textit{Tcl\_InitSubsystems} is the Tcl version.

\section{Reference Implementation}

A reference implementation is available in the \textbf{initsubsystems} branch. [\url{http://core.tcl.tk/tcl/info/3c9828933f}]

\section{Copyright}

This document has been placed in the public domain.

\section{Colophon}

\textit{TIP AutoGenerator --- written by Donal K. Fellows}
\end{document}
