From 969c2a47808f413a0176ba35f4df4ff3325e6feb Mon Sep 17 00:00:00 2001 From: suresh Date: Wed, 1 Jul 1998 14:54:47 +0000 Subject: Added definition of variable "tclAlternateInitScript" which is a globabl var- iable and if set to a non-NULL value, will be evaluated just before the built-in script given in the file (variable) "generic/tclInitScript.h" ("initScript"). --- unix/tclUnixInit.c | 12 ++++++++++++ win/tclWinInit.c | 15 +++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index baff098..7d71544 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -52,6 +52,15 @@ static int initialized = 0; #include "tclInitScript.h" /* + * A pointer to a string that holds an alternate initialization script to the + * built-in initialization script defined in the file "generic/tclInitScript.h". + * The Tcl_Init() routine will evaluate this script if it contains a non-NULL + * value. + */ + +char * tclAlternateInitScript = NULL; + +/* * Static routines in this file: */ @@ -211,6 +220,9 @@ int Tcl_Init(interp) Tcl_Interp *interp; /* Interpreter to initialize. */ { + if (tclAlternateInitScript != NULL) { + Tcl_Eval(interp, tclAlternateInitScript); + } return Tcl_Eval(interp, initScript); } diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 6f7425c..f64fa89 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -72,6 +72,15 @@ static char* processors[NUMPROCESSORS] = { #include "tclInitScript.h" +/* + * A pointer to a string that holds an alternate initialization script to the + * built-in initialization script defined in the file "generic/tclInitScript.h". + * The Tcl_Init() routine will evaluate this script if it contains a non-NULL + * value. + */ + +char * tclAlternateInitScript = NULL; + /* *---------------------------------------------------------------------- @@ -237,8 +246,10 @@ int Tcl_Init(interp) Tcl_Interp *interp; /* Interpreter to initialize. */ { - return Tcl_Eval(interp, initScript); - + if (tclAlternateInitScript != NULL) { + Tcl_Eval(interp, tclAlternateInitScript); + } + return(Tcl_Eval(interp, initScript)); } /* -- cgit v0.12