diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tcl.decls | 16 | ||||
-rw-r--r-- | generic/tclBasic.c | 80 | ||||
-rw-r--r-- | generic/tclDecls.h | 16 | ||||
-rw-r--r-- | generic/tclIOCmd.c | 14 | ||||
-rw-r--r-- | generic/tclStubInit.c | 4 |
5 files changed, 26 insertions, 104 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls index 76d5298..fe1d763 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -635,7 +635,7 @@ declare 176 { const char *Tcl_GetVar2(Tcl_Interp *interp, const char *part1, const char *part2, int flags) } -# Removed in Tcl 9.0 +# Removed in 9.0 #declare 177 { # int Tcl_GlobalEval(Tcl_Interp *interp, const char *command) #} @@ -923,9 +923,10 @@ declare 259 { int Tcl_UpVar2(Tcl_Interp *interp, const char *frameName, const char *part1, const char *part2, const char *localName, int flags) } -declare 260 { - int Tcl_VarEval(Tcl_Interp *interp, ...) -} +# Removed in 9.0 +#declare 260 { +# int Tcl_VarEval(Tcl_Interp *interp, ...) +#} declare 261 { ClientData Tcl_VarTraceInfo(Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData) @@ -983,9 +984,10 @@ declare 274 { declare 275 { void Tcl_SetErrorCodeVA(Tcl_Interp *interp, va_list argList) } -declare 276 { - int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList) -} +# Removed in 9.0 +#declare 276 { +# int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList) +#} declare 277 { Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options) } diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 7202184..4f70cee 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -6357,86 +6357,6 @@ Tcl_AddObjErrorInfo( } /* - *--------------------------------------------------------------------------- - * - * Tcl_VarEvalVA -- - * - * Given a variable number of string arguments, concatenate them all - * together and execute the result as a Tcl command. - * - * Results: - * A standard Tcl return result. An error message or other result may be - * left in the interp's result. - * - * Side effects: - * Depends on what was done by the command. - * - *--------------------------------------------------------------------------- - */ - -int -Tcl_VarEvalVA( - Tcl_Interp *interp, /* Interpreter in which to evaluate command */ - va_list argList) /* Variable argument list. */ -{ - Tcl_DString buf; - char *string; - int result; - - /* - * Copy the strings one after the other into a single larger string. Use - * stack-allocated space for small commands, but if the command gets too - * large than call ckalloc to create the space. - */ - - Tcl_DStringInit(&buf); - while (1) { - string = va_arg(argList, char *); - if (string == NULL) { - break; - } - Tcl_DStringAppend(&buf, string, -1); - } - - result = Tcl_Eval(interp, Tcl_DStringValue(&buf)); - Tcl_DStringFree(&buf); - return result; -} - -/* - *---------------------------------------------------------------------- - * - * Tcl_VarEval -- - * - * Given a variable number of string arguments, concatenate them all - * together and execute the result as a Tcl command. - * - * Results: - * A standard Tcl return result. An error message or other result may be - * left in the interp. - * - * Side effects: - * Depends on what was done by the command. - * - *---------------------------------------------------------------------- - */ - /* ARGSUSED */ -int -Tcl_VarEval( - Tcl_Interp *interp, - ...) -{ - va_list argList; - int result; - - va_start(argList, interp); - result = Tcl_VarEvalVA(interp, argList); - va_end(argList); - - return result; -} - -/* *---------------------------------------------------------------------- * * Tcl_SetRecursionLimit -- diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 5c206aa..0770e98 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -747,8 +747,7 @@ TCLAPI int Tcl_UpVar(Tcl_Interp *interp, const char *frameName, TCLAPI int Tcl_UpVar2(Tcl_Interp *interp, const char *frameName, const char *part1, const char *part2, const char *localName, int flags); -/* 260 */ -TCLAPI int Tcl_VarEval(Tcl_Interp *interp, ...); +/* Slot 260 is reserved */ /* 261 */ TCLAPI ClientData Tcl_VarTraceInfo(Tcl_Interp *interp, const char *varName, int flags, @@ -795,8 +794,7 @@ TCLAPI const char * Tcl_PkgRequire(Tcl_Interp *interp, const char *name, /* 275 */ TCLAPI void Tcl_SetErrorCodeVA(Tcl_Interp *interp, va_list argList); -/* 276 */ -TCLAPI int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList); +/* Slot 276 is reserved */ /* 277 */ TCLAPI Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options); /* 278 */ @@ -2063,7 +2061,7 @@ typedef struct TclStubs { void (*tcl_UpdateLinkedVar) (Tcl_Interp *interp, const char *varName); /* 257 */ int (*tcl_UpVar) (Tcl_Interp *interp, const char *frameName, const char *varName, const char *localName, int flags); /* 258 */ int (*tcl_UpVar2) (Tcl_Interp *interp, const char *frameName, const char *part1, const char *part2, const char *localName, int flags); /* 259 */ - int (*tcl_VarEval) (Tcl_Interp *interp, ...); /* 260 */ + void (*reserved260)(void); ClientData (*tcl_VarTraceInfo) (Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData); /* 261 */ ClientData (*tcl_VarTraceInfo2) (Tcl_Interp *interp, const char *part1, const char *part2, int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData); /* 262 */ int (*tcl_Write) (Tcl_Channel chan, const char *s, int slen); /* 263 */ @@ -2079,7 +2077,7 @@ typedef struct TclStubs { int (*tclPkgProvide) (Tcl_Interp *interp, const char *name, const char *version); /* 273 */ const char * (*tcl_PkgRequire) (Tcl_Interp *interp, const char *name, const char *version, int exact); /* 274 */ void (*tcl_SetErrorCodeVA) (Tcl_Interp *interp, va_list argList); /* 275 */ - int (*tcl_VarEvalVA) (Tcl_Interp *interp, va_list argList); /* 276 */ + void (*reserved276)(void); Tcl_Pid (*tcl_WaitPid) (Tcl_Pid pid, int *statPtr, int options); /* 277 */ void (*tcl_PanicVA) (const char *format, va_list argList); /* 278 */ void (*tcl_GetVersion) (int *major, int *minor, int *patchLevel, int *type); /* 279 */ @@ -2979,8 +2977,7 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_UpVar) /* 258 */ #define Tcl_UpVar2 \ (tclStubsPtr->tcl_UpVar2) /* 259 */ -#define Tcl_VarEval \ - (tclStubsPtr->tcl_VarEval) /* 260 */ +/* Slot 260 is reserved */ #define Tcl_VarTraceInfo \ (tclStubsPtr->tcl_VarTraceInfo) /* 261 */ #define Tcl_VarTraceInfo2 \ @@ -3011,8 +3008,7 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_PkgRequire) /* 274 */ #define Tcl_SetErrorCodeVA \ (tclStubsPtr->tcl_SetErrorCodeVA) /* 275 */ -#define Tcl_VarEvalVA \ - (tclStubsPtr->tcl_VarEvalVA) /* 276 */ +/* Slot 276 is reserved */ #define Tcl_WaitPid \ (tclStubsPtr->tcl_WaitPid) /* 277 */ #define Tcl_PanicVA \ diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index f738b1a..27f156f 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -1324,11 +1324,11 @@ AcceptCallbackProc( if (acceptCallbackPtr->interp != NULL) { char portBuf[TCL_INTEGER_SPACE]; - char *script = acceptCallbackPtr->script; + Tcl_Obj *script = Tcl_NewStringObj(acceptCallbackPtr->script, -1); Tcl_Interp *interp = acceptCallbackPtr->interp; int result; - Tcl_Preserve(script); + Tcl_IncrRefCount(script); Tcl_Preserve(interp); TclFormatInt(portBuf, port); @@ -1341,8 +1341,12 @@ AcceptCallbackProc( Tcl_RegisterChannel(NULL, chan); - result = Tcl_VarEval(interp, script, " ", Tcl_GetChannelName(chan), - " ", address, " ", portBuf, NULL); + result = Tcl_ListObjAppendElement(interp, script, Tcl_NewStringObj(Tcl_GetChannelName(chan), -1)); + if (result == TCL_OK) { + Tcl_ListObjAppendElement(NULL, script, Tcl_NewStringObj(address, -1)); + Tcl_ListObjAppendElement(NULL, script, Tcl_NewStringObj(portBuf, -1)); + result = Tcl_EvalObjEx(interp, script, 0); + } if (result != TCL_OK) { Tcl_BackgroundException(interp, result); Tcl_UnregisterChannel(interp, chan); @@ -1356,7 +1360,7 @@ AcceptCallbackProc( Tcl_UnregisterChannel(NULL, chan); Tcl_Release(interp); - Tcl_Release(script); + Tcl_DecrRefCount(script); } else { /* * The interpreter has been deleted, so there is no useful way to use diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 30c2b76..50fc6de 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -930,7 +930,7 @@ const TclStubs tclStubs = { Tcl_UpdateLinkedVar, /* 257 */ Tcl_UpVar, /* 258 */ Tcl_UpVar2, /* 259 */ - Tcl_VarEval, /* 260 */ + 0, /* 260 */ Tcl_VarTraceInfo, /* 261 */ Tcl_VarTraceInfo2, /* 262 */ Tcl_Write, /* 263 */ @@ -946,7 +946,7 @@ const TclStubs tclStubs = { TclPkgProvide, /* 273 */ Tcl_PkgRequire, /* 274 */ Tcl_SetErrorCodeVA, /* 275 */ - Tcl_VarEvalVA, /* 276 */ + 0, /* 276 */ Tcl_WaitPid, /* 277 */ Tcl_PanicVA, /* 278 */ Tcl_GetVersion, /* 279 */ |