Skip to content
Tcl Source Code Artifact [6719441afc]
Login

Artifact [6719441afc]

Artifact 6719441afcd2d1d36a3f27fad88dc0113544f914:


'\"
'\" 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
.SH ARGUMENTS
.AS Tcl_PanicProc *panicProc
.AP Tcl_PanicProc *panicProc in
Desired panic function, for error reporting. The value NULL is used
when the default panicProc is desired, which normally writes the
message to stderr.
.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 \fBTcl_InitSubsystems\fR is only meant to be
called once by Tcl embedders. Tcl_SetPanicProc is in the stub
table, meant for Tcl extenders, and can be called at any time
later to change the panic proc.
.PP
\fBTcl_InitSubsystems\fR can be used in stead of
\fBTcl_FindExecutable\fR when Tcl is used as utility library
only, and no other encodings than utf8, iso8859-1 or unicode
are used. The system encoding will not be determined
correctly but being set to iso8859-1.
.PP
The return value is the Tcl version.
.PP
If \fBTcl_InitSubsystems()\fR is called in code where 
\fBUSE_TCL_STUBS\fR 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(NULL);
/* At this point, Tcl C API calls without interp are ready for use */
int major, minor, patch;
Tcl_GetVersion(&major, &minor, &patch);
.CE
This will work as expected, both with and without stubs. When
using stubs, this code must be linked with both the normal
Tcl library (static or shared) and the stub library.
.SH KEYWORDS
binary, executable file