diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-04-01 16:45:36 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-04-01 16:45:36 (GMT) |
commit | 9db6776dbe890df61746ecc0c41875ccf55e3539 (patch) | |
tree | f78994d4183d40373663c52ad867edc79d88ddc3 /doc | |
parent | a76ebfc825bd2bd389554f1fdaff3c48c3ee2011 (diff) | |
parent | 1c6a242b2e520aacca113e4189ebb0b95caf9844 (diff) | |
download | tcl-9db6776dbe890df61746ecc0c41875ccf55e3539.zip tcl-9db6776dbe890df61746ecc0c41875ccf55e3539.tar.gz tcl-9db6776dbe890df61746ecc0c41875ccf55e3539.tar.bz2 |
initsubsystems
Diffstat (limited to 'doc')
-rw-r--r-- | doc/InitSubSyst.3 | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/doc/InitSubSyst.3 b/doc/InitSubSyst.3 new file mode 100644 index 0000000..4fd99c7 --- /dev/null +++ b/doc/InitSubSyst.3 @@ -0,0 +1,60 @@ +'\" +'\" 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 |