diff options
-rw-r--r-- | doc/InitSubSyst.3 | 22 | ||||
-rw-r--r-- | generic/tcl.h | 3 | ||||
-rw-r--r-- | generic/tclEncoding.c | 10 |
3 files changed, 18 insertions, 17 deletions
diff --git a/doc/InitSubSyst.3 b/doc/InitSubSyst.3 index 4fd99c7..2d5c2bc 100644 --- a/doc/InitSubSyst.3 +++ b/doc/InitSubSyst.3 @@ -5,7 +5,7 @@ '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .so man.macros -.TH Tcl_InitSubsystems 3 8.7 Tcl "Tcl Library Procedures" +.TH Tcl_InitSubsystems 3 8.6.1 Tcl "Tcl Library Procedures" .BS .SH NAME Tcl_InitSubsystems \- initialize the Tcl library. @@ -19,9 +19,8 @@ const char * .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. +Desired panic function, for error reporting. If NULL, the default +panicProc is used, which normally writes the message to stderr. .BE .SH DESCRIPTION @@ -35,11 +34,12 @@ 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. +\fBTcl_InitSubsystems\fR is very similar to +\fBTcl_FindExecutable\fR as well. It can be used when Tcl is +used as utility library, no other encodings than utf8, +iso8859-1 or unicode are used, and no interest exists in the +value of \fBinfo nameofexecutable\fR. The system encoding will not +be extracted from the environment, but falls back to iso8859-1. .PP The return value is the Tcl version. .PP @@ -53,8 +53,6 @@ const char *version = Tcl_InitSubSystems(NULL); 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. +This will work as expected, both with and without stubs. .SH KEYWORDS binary, executable file diff --git a/generic/tcl.h b/generic/tcl.h index 051e2a1..543b2a6 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2413,7 +2413,8 @@ const char * TclTomMathInitializeStubs(Tcl_Interp *interp, #ifdef USE_TCL_STUBS EXTERN Tcl_Interp *Tcl_InitSubsystems(Tcl_PanicProc *panicProc); -#define Tcl_InitSubsystems(panicProc) Tcl_InitStubs((Tcl_InitSubsystems)(panicProc), NULL, 0) +#define Tcl_InitSubsystems(panicProc) \ + Tcl_InitStubs((Tcl_InitSubsystems)(panicProc), NULL, 0) #else EXTERN const char *Tcl_InitSubsystems(Tcl_PanicProc *panicProc); #endif diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index e57272f..a83a6b0 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -1428,10 +1428,12 @@ Tcl_UtfToExternal( */ MODULE_SCOPE const TclStubs tclStubs; -/* Dummy const structure returned by Tcl_InitSubsystems, - * which looks like an Tcl_Interp, but in reality is not. - * It contains just enough for Tcl_InitStubs to be able - * to initialize the stub table. */ +/* Dummy const structure returned by Tcl_InitSubsystems when + * using stubs, which looks like an Tcl_Interp, but in reality + * is not. It contains just enough for Tcl_InitStubs to be able + * to initialize the stub table. The first bytes of this structure + * are filled with the Tcl version string, so it can be cast to a + * "const char *" holding the Tcl version as well. */ static const struct { /* A real interpreter has interp->result/freeProc here: */ const char version[sizeof(struct {char *r; void (*f)(void);})]; |