From 7ee7c6586422e52f2088758fba43fa65a64c77ef Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 11 Jun 2004 21:33:41 +0000 Subject: Restored Eng. Manual Style --- generic/tclInterp.c | 132 ++++++++++++++++++++++++++-------------------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 54f0cbc..89c6593 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInterp.c,v 1.36 2004/06/11 21:30:07 dgp Exp $ + * RCS: @(#) $Id: tclInterp.c,v 1.37 2004/06/11 21:33:41 dgp Exp $ */ #include "tclInt.h" @@ -90,71 +90,6 @@ 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); -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_Init -- - * - * This procedure is typically invoked by Tcl_AppInit procedures - * to find and source the "init.tcl" script, which should exist - * somewhere on the Tcl library path. - * - * Results: - * Returns a standard Tcl completion code and sets the interp's - * result if there is an error. - * - * Side effects: - * Depends on what's in the init.tcl script. - * - *---------------------------------------------------------------------- - */ - -int -Tcl_Init(interp) - Tcl_Interp *interp; /* Interpreter to initialize. */ -{ - Tcl_Obj *pathPtr; - - if (tclPreInitScript != NULL) { - if (Tcl_Eval(interp, tclPreInitScript) == TCL_ERROR) { - return (TCL_ERROR); - }; - } - - pathPtr = TclGetLibraryPath(); - if (pathPtr == NULL) { - pathPtr = Tcl_NewObj(); - } - Tcl_SetVar2Ex(interp, "tcl_libPath", NULL, pathPtr, TCL_GLOBAL_ONLY); - return Tcl_Eval(interp, initScript); -} - -/* * Counter for how many aliases were created (global) */ @@ -375,6 +310,71 @@ static void RunLimitHandlers _ANSI_ARGS_((LimitHandler *handlerPtr, /* + *---------------------------------------------------------------------- + * + * 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); +} + +/* + *---------------------------------------------------------------------- + * + * Tcl_Init -- + * + * This procedure is typically invoked by Tcl_AppInit procedures + * to find and source the "init.tcl" script, which should exist + * somewhere on the Tcl library path. + * + * Results: + * Returns a standard Tcl completion code and sets the interp's + * result if there is an error. + * + * Side effects: + * Depends on what's in the init.tcl script. + * + *---------------------------------------------------------------------- + */ + +int +Tcl_Init(interp) + Tcl_Interp *interp; /* Interpreter to initialize. */ +{ + Tcl_Obj *pathPtr; + + if (tclPreInitScript != NULL) { + if (Tcl_Eval(interp, tclPreInitScript) == TCL_ERROR) { + return (TCL_ERROR); + }; + } + + pathPtr = TclGetLibraryPath(); + if (pathPtr == NULL) { + pathPtr = Tcl_NewObj(); + } + Tcl_SetVar2Ex(interp, "tcl_libPath", NULL, pathPtr, TCL_GLOBAL_ONLY); + return Tcl_Eval(interp, initScript); +} + +/* *--------------------------------------------------------------------------- * * TclInterpInit -- -- cgit v0.12