'\"
'\" Copyright (c) 2013 Tcl Core Team
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.so man.macros
.TH Tcl_InitSubsystems 3 8.7 Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_InitSubsystems \- initialize the Tcl library.
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
const char *
\fBTcl_InitSubsystems\fR(\fIpanicProc\fR)
.SH ARGUMENTS
.AS "Tcl_PanicProc *" panicProc
.AP "Tcl_PanicProc *" panicProc
PanicProc. The value NULL is used when the default panicProc is
desired.
.BE
.SH DESCRIPTION
.PP
The \fBTcl_InitSubsystems\fR procedure initializes the Tcl
library. This procedure is typically invoked as the very
first thing in the application's main program.
This function is almost the same as Tcl_SetPanicProc, except
that Tcl_SetPanicProc is in the stub table, meant for Tcl
extenders, and can be called at any time to change the
panic proc. \fBTcl_InitSubsystems\fR is only meant to be
called once, and does all initializations necessary such
that Tcl_CreateInterp() can be called.
.PP
The return value is the Tcl version.
.PP
If \fBTcl_InitSubsystems()\fR is called while -DUSE_TCL_STUBS
is set, it does one additional thing: initialize the Stub
table for using Tcl as utility library, without needing
a Tcl interpreter. For example:
.CS
const char *version = Tcl_InitSubSystems(0);
/* At this point, Tcl C API calls without interp are ready for use */
Tcl_Interp *interp = Tcl_CreateInterp(); /* Now we have a real interpreter */
Tcl_InitStubs(interp, version, 0); /* Initialize the stub table again */
.CE
This will work as expected even when -DUSE_TCL_STUBS is set.
.SH KEYWORDS
binary, executable file