Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-17
04:45 • Ticket [218563ffff] TclSetPreInitScript function missing status still Closed... artifact: 56f688d9f4 user: dgp
2000-10-26
08:24 • Closed ticket [218563ffff]. artifact: cb74c5ade5 user: welch
01:02 • New ticket [218563ffff]. artifact: 13f0da0427 user: nobody

TclSetPreInitScript function missing

Closed / Fixed218563ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:02:20
OriginalBugID: 1128 Bug
Version: 8.1b1
SubmitDate: '1999-01-29'
LastModified: '1999-04-05'
Severity: SER
Status: Released
Submitter: welch
ChangedBy: stanton
OS: Windows NT
Machine: X86
FixedDate: '1999-04-05'
FixedInVersion: 8.1b3
ClosedDate: '2000-10-25'


Name:

Jan Nijtmans


DesiredBehavior:

The 'secret' TclSetPreInitScript() function from Tcl8.0.4, which

is a key function for TclPro wrapper, is not implemented

yet in Tcl8.1b1.


Patch:

*** generic/tclInitScript.h.origTue Jan 19 23:03:24 1999

--- generic/tclInitScript.hTue Jan 19 23:05:58 1999

***************

*** 45,47 ****

--- 45,81 ----

  }\n\

  tclInit";


+ /*

+  * A pointer to a string that holds an initialization script that if non-NULL

+  * is evaluated in Tcl_Init() prior to the the built-in initialization script

+  * above.  This variable can be modified by the procedure below.

+  */

+  

+ static char *          tclPreInitScript = NULL;

+ 

+ 

+ /*

+  *----------------------------------------------------------------------

+  *

+  * TclSetPreInitScript --

+  *

+  *This routine is used to change the value of the internal

+  *variable, tclPreInitScript.

+  *

+  * Results:

+  *Returns the current value of tclPreInitScript.

+  *

+  * Side effects:

+  *Changes the way Tcl_Init() routine behaves.

+  *

+  *----------------------------------------------------------------------

+  */

+ 

+ char *

+ TclSetPreInitScript (string)

+     char *string;/* Pointer to a script. */

+ {

+     char *prevString = tclPreInitScript;

+     tclPreInitScript = string;

+     return(prevString);

+ }

*** unix/tclUnixInit.c.origTue Jan 19 23:08:15 1999

--- unix/tclUnixInit.cTue Jan 19 23:12:25 1999

***************

*** 515,521 ****

  pathPtr = Tcl_NewObj();

      }

      Tcl_SetObjVar2(interp, "tcl_libPath", NULL, pathPtr, TCL_GLOBAL_ONLY);

!     return Tcl_Eval(interp, initScript);

  }

  

  /*

--- 515,530 ----

  pathPtr = Tcl_NewObj();

      }

      Tcl_SetObjVar2(interp, "tcl_libPath", NULL, pathPtr, TCL_GLOBAL_ONLY);

! 

!     if (tclPreInitScript != NULL) {

! if (Tcl_Eval(interp, tclPreInitScript) == TCL_ERROR) {

!     return (TCL_ERROR);

! };

!     }

!     if (Tcl_Eval(interp, initScript) == TCL_ERROR) {

! return TCL_ERROR;

!     }

!     return TCL_OK;

  }

  

  /*

*** win/tclWinInit.c.origTue Jan 19 23:12:47 1999

--- win/tclWinInit.cTue Jan 19 23:15:20 1999

***************

*** 586,592 ****

  pathPtr = Tcl_NewObj();

      }

      Tcl_SetObjVar2(interp, "tcl_libPath", NULL, pathPtr, TCL_GLOBAL_ONLY);

!     return Tcl_Eval(interp, initScript);

  }

  

  /*

--- 586,600 ----

  pathPtr = Tcl_NewObj();

      }

      Tcl_SetObjVar2(interp, "tcl_libPath", NULL, pathPtr, TCL_GLOBAL_ONLY);

!     if (tclPreInitScript != NULL) {

! if (Tcl_Eval(interp, tclPreInitScript) == TCL_ERROR) {

!     return (TCL_ERROR);

! };

!     }

!     if (Tcl_Eval(interp, initScript) == TCL_ERROR) {

! return TCL_ERROR;

!     }

!     return TCL_OK;

  }

  

  /*


PatchFiles:

tclInitScript.h tclUnixInit.c tclWinInit.c




The above implementation of TclSetPreInitScript() is copied from Tcl8.0.4
welch Closed ticket [218563ffff]. [History diff]2000-10-26 08:24:15
dgp Ticket [218563ffff]: 3 changes [History diff]2001-04-17 04:45:55
Log in (anonymous is fine) to add a comment.