summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-12-03 08:11:12 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-12-03 08:11:12 (GMT)
commit279358fa3f6fd886a5cf940ea9223c5a51d6f304 (patch)
treeaa87a2de6d07931a672fdafb6b3291610e298e8a
parent2d8aceecca2c639bafce1dd90900ba305128ac12 (diff)
parent888f7141151b5b085d0cdc0029121d67a06e7273 (diff)
downloadtcl-279358fa3f6fd886a5cf940ea9223c5a51d6f304.zip
tcl-279358fa3f6fd886a5cf940ea9223c5a51d6f304.tar.gz
tcl-279358fa3f6fd886a5cf940ea9223c5a51d6f304.tar.bz2
merge core-8-5-branch
eliminate more usage of to-be-deprecated functions
-rw-r--r--generic/tcl.h16
-rw-r--r--generic/tclBasic.c2
-rw-r--r--generic/tclBinary.c4
-rw-r--r--generic/tclClock.c16
-rw-r--r--generic/tclCmdAH.c12
-rw-r--r--generic/tclCmdIL.c8
-rw-r--r--generic/tclCmdMZ.c28
-rw-r--r--generic/tclConfig.c4
-rw-r--r--generic/tclDecls.h56
-rw-r--r--generic/tclDictObj.c4
-rw-r--r--generic/tclEvent.c4
-rw-r--r--generic/tclFCmd.c8
-rw-r--r--generic/tclFileName.c4
-rw-r--r--generic/tclIO.c1
-rw-r--r--generic/tclIOUtil.c1
-rw-r--r--generic/tclIndexObj.c6
-rw-r--r--generic/tclLoad.c4
-rw-r--r--generic/tclMain.c26
-rw-r--r--generic/tclNamesp.c24
-rw-r--r--generic/tclPkg.c13
-rw-r--r--generic/tclProc.c3
-rw-r--r--generic/tclResult.c4
-rw-r--r--generic/tclStubInit.c12
-rw-r--r--generic/tclTest.c6
-rw-r--r--generic/tclTestProcBodyObj.c2
-rw-r--r--generic/tclTrace.c2
-rw-r--r--generic/tclVar.c4
-rw-r--r--unix/dltest/pkga.c2
-rw-r--r--unix/dltest/pkgb.c4
-rw-r--r--unix/dltest/pkgc.c4
-rw-r--r--unix/dltest/pkgd.c4
-rw-r--r--unix/dltest/pkgua.c2
-rw-r--r--win/tclWinDde.c22
-rw-r--r--win/tclWinPort.h2
-rw-r--r--win/tclWinReg.c6
35 files changed, 199 insertions, 121 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 9c63b94..0738d09 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -2405,22 +2405,8 @@ EXTERN void Tcl_GetMemoryInfo _ANSI_ARGS_((Tcl_DString *dsPtr));
#ifndef TCL_NO_DEPRECATED
/*
- * Deprecated Tcl functions:
- */
-
-# undef Tcl_EvalObj
-# define Tcl_EvalObj(interp,objPtr) \
- Tcl_EvalObjEx((interp),(objPtr),0)
-# undef Tcl_GlobalEvalObj
-# define Tcl_GlobalEvalObj(interp,objPtr) \
- Tcl_EvalObjEx((interp),(objPtr),TCL_EVAL_GLOBAL)
-# undef Tcl_VarTraceInfo
-# define Tcl_VarTraceInfo(interp, varName, flags, proc, prevClientData) \
- Tcl_VarTraceInfo2(interp, varName, NULL, flags, proc, prevClientData)
-
- /*
* These function have been renamed. The old names are deprecated, but we
- * define these macros for backwards compatibilty.
+ * define these macros for backwards compatibility.
*/
# define Tcl_Ckalloc Tcl_Alloc
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index cfb5c43..651625e 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -4955,6 +4955,7 @@ TclArgumentGet(interp,obj,cfPtrPtr,wordPtr)
*----------------------------------------------------------------------
*/
+#undef Tcl_Eval
int
Tcl_Eval(
Tcl_Interp *interp, /* Token for command interpreter (returned by
@@ -5988,6 +5989,7 @@ Tcl_VarEval(
*----------------------------------------------------------------------
*/
+#undef Tcl_GlobalEval
int
Tcl_GlobalEval(
Tcl_Interp *interp, /* Interpreter in which to evaluate command. */
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 9ba06ee..f3b8bc6 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -598,8 +598,8 @@ Tcl_BinaryObjCmd(
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], options,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/generic/tclClock.c b/generic/tclClock.c
index 5b95ae6..082a7e5 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -548,8 +548,8 @@ ClockGetjuliandayfromerayearmonthdayObjCmd (
}
dict = objv[1];
if (Tcl_DictObjGet(interp, dict, literals[LIT_ERA], &fieldPtr) != TCL_OK
- || Tcl_GetIndexFromObj(interp, fieldPtr, eras, "era", TCL_EXACT,
- &era) != TCL_OK
+ || Tcl_GetIndexFromObjStruct(interp, fieldPtr, eras, sizeof(char *),
+ "era", TCL_EXACT, &era) != TCL_OK
|| Tcl_DictObjGet(interp, dict, literals[LIT_YEAR],
&fieldPtr) != TCL_OK
|| TclGetIntFromObj(interp, fieldPtr, &(fields.year)) != TCL_OK
@@ -639,8 +639,8 @@ ClockGetjuliandayfromerayearweekdayObjCmd (
}
dict = objv[1];
if (Tcl_DictObjGet(interp, dict, literals[LIT_ERA], &fieldPtr) != TCL_OK
- || Tcl_GetIndexFromObj(interp, fieldPtr, eras, "era", TCL_EXACT,
- &era) != TCL_OK
+ || Tcl_GetIndexFromObjStruct(interp, fieldPtr, eras, sizeof(char *),
+ "era", TCL_EXACT, &era) != TCL_OK
|| Tcl_DictObjGet(interp, dict, literals[LIT_ISO8601YEAR],
&fieldPtr) != TCL_OK
|| TclGetIntFromObj(interp, fieldPtr,
@@ -1708,8 +1708,8 @@ ClockClicksObjCmd(
case 1:
break;
case 2:
- if (Tcl_GetIndexFromObj(interp, objv[1], clicksSwitches, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], clicksSwitches, sizeof(char *),
+ "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
break;
@@ -1884,8 +1884,8 @@ ClockParseformatargsObjCmd(
localeObj = litPtr[LIT_C];
timezoneObj = litPtr[LIT__NIL];
for (i = 2; i < objc; i+=2) {
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "switch", 0,
- &optionIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "switch", 0, &optionIndex) != TCL_OK) {
Tcl_SetErrorCode(interp, "CLOCK", "badSwitch",
Tcl_GetString(objv[i]), NULL);
return TCL_ERROR;
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index 8e32389..948d257 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -445,8 +445,8 @@ Tcl_EncodingObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -855,8 +855,8 @@ Tcl_FileObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], fileOptions, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], fileOptions,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -1045,8 +1045,8 @@ Tcl_FileObjCmd(
static const char *linkTypes[] = {
"-symbolic", "-hard", NULL
};
- if (Tcl_GetIndexFromObj(interp, objv[2], linkTypes, "switch",
- 0, &linkAction) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[2], linkTypes,
+ sizeof(char *), "switch", 0, &linkAction) != TCL_OK) {
return TCL_ERROR;
}
if (linkAction == 0) {
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 152e61d..ce79e20 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -2766,8 +2766,8 @@ Tcl_LsearchObjCmd(
}
for (i = 1; i < objc-2; i++) {
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0, &index)
- != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
if (startPtr != NULL) {
Tcl_DecrRefCount(startPtr);
}
@@ -3501,8 +3501,8 @@ Tcl_LsortObjCmd(
cmdPtr = NULL;
indices = 0;
for (i = 1; i < objc-1; i++) {
- if (Tcl_GetIndexFromObj(interp, objv[i], switches, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], switches,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
if (sortInfo.indexc > 1) {
ckfree((char *) sortInfo.indexv);
}
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 0ad77aa..5bc6fd0 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -118,8 +118,8 @@ Tcl_RegexpObjCmd(
if (name[0] != '-') {
break;
}
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "switch", TCL_EXACT,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "switch", TCL_EXACT, &index) != TCL_OK) {
goto optionError;
}
switch ((enum options) index) {
@@ -478,8 +478,8 @@ Tcl_RegsubObjCmd(
if (name[0] != '-') {
break;
}
- if (Tcl_GetIndexFromObj(interp, objv[idx], options, "switch",
- TCL_EXACT, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[idx], options,
+ sizeof(char *), "switch", TCL_EXACT, &index) != TCL_OK) {
goto optionError;
}
switch ((enum options) index) {
@@ -955,8 +955,8 @@ Tcl_SourceObjCmd(
};
int index;
- if (TCL_ERROR == Tcl_GetIndexFromObj(interp, objv[1], options,
- "option", TCL_EXACT, &index)) {
+ if (TCL_ERROR == Tcl_GetIndexFromObjStruct(interp, objv[1], options,
+ sizeof(char *), "option", TCL_EXACT, &index)) {
return TCL_ERROR;
}
encodingName = TclGetString(objv[2]);
@@ -1437,8 +1437,8 @@ StringIsCmd(
"class ?-strict? ?-failindex var? str");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], isClasses, "class", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], isClasses,
+ sizeof(char *), "class", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -1446,8 +1446,8 @@ StringIsCmd(
for (i = 2; i < objc-1; i++) {
int idx2;
- if (Tcl_GetIndexFromObj(interp, objv[i], isOptions, "option", 0,
- &idx2) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], isOptions,
+ sizeof(char *), "option", 0, &idx2) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum isOptions) idx2) {
@@ -3323,8 +3323,8 @@ Tcl_SubstObjCmd(
for (i = 1; i < (objc-1); i++) {
int optionIndex;
- if (Tcl_GetIndexFromObj(interp, objv[i], substOptions, "switch", 0,
- &optionIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], substOptions,
+ sizeof(char *), "switch", 0, &optionIndex) != TCL_OK) {
return TCL_ERROR;
}
switch (optionIndex) {
@@ -3423,8 +3423,8 @@ Tcl_SwitchObjCmd(
if (TclGetString(objv[i])[0] != '-') {
break;
}
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum options) index) {
diff --git a/generic/tclConfig.c b/generic/tclConfig.c
index 28549ed..99a04f6 100644
--- a/generic/tclConfig.c
+++ b/generic/tclConfig.c
@@ -224,8 +224,8 @@ QueryConfigObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?argument?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], subcmdStrings, "subcommand", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], subcmdStrings,
+ sizeof(char *), "subcommand", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 4225c96..2c52ac8 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -6385,5 +6385,61 @@ extern TclStubs *tclStubsPtr;
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
+/*
+ * Deprecated Tcl functions:
+ */
+
+#undef Tcl_PkgProvide
+#define Tcl_PkgProvide(interp, name, version) \
+ Tcl_PkgProvideEx((interp), (name), (version), NULL)
+#undef Tcl_PkgRequire
+#define Tcl_PkgRequire(interp, name, version, exact) \
+ Tcl_PkgRequireEx((interp), (name), (version), (exact), NULL);
+#undef Tcl_PkgPresent
+#define Tcl_PkgPresent(interp, name, version, exact) \
+ Tcl_PkgPresentEx((interp), (name), (version), (exact), NULL);
+#undef Tcl_Eval
+#define Tcl_Eval(interp,command) \
+ Tcl_EvalEx((interp),(command),-1,0)
+#undef Tcl_GlobalEval
+#define Tcl_GlobalEval(interp,command) \
+ Tcl_EvalEx((interp),(command),-1,TCL_EVAL_GLOBAL)
+#undef Tcl_EvalObj
+#define Tcl_EvalObj(interp,objPtr) \
+ Tcl_EvalObjEx((interp),(objPtr),0)
+#undef Tcl_GlobalEvalObj
+#define Tcl_GlobalEvalObj(interp,objPtr) \
+ Tcl_EvalObjEx((interp),(objPtr),TCL_EVAL_GLOBAL)
+#undef Tcl_VarTraceInfo
+#define Tcl_VarTraceInfo(interp, varName, flags, proc, prevClientData) \
+ Tcl_VarTraceInfo2((interp), (varName), NULL, (flags), (proc), (prevClientData))
+#undef Tcl_GetVar
+#define Tcl_GetVar(interp, varName, flags) \
+ Tcl_GetVar2((interp), (varName), (NULL), (flags))
+#undef Tcl_SetVar
+#define Tcl_SetVar(interp, varName, newValue, flags) \
+ Tcl_SetVar2((interp), (varName), NULL, (newValue), (flags))
+#undef Tcl_GetChannelNames
+#define Tcl_GetChannelNames(interp) \
+ Tcl_GetChannelNamesEx((interp), NULL)
+#undef Tcl_FSEvalFile
+#define Tcl_FSEvalFile(interp, pathPtr) \
+ Tcl_FSEvalFileEx((interp), (pathPtr), NULL)
+#undef Tcl_TraceVar
+#define Tcl_TraceVar(interp, varName, flags, proc, clientData) \
+ Tcl_TraceVar2((interp), (varName), NULL, (flags), (proc), (clientData))
+#undef Tcl_UnsetVar
+#define Tcl_UnsetVar(interp, varName, flags) \
+ Tcl_UnsetVar2((interp), (varName), NULL, (flags))
+#undef Tcl_UntraceVar
+#define Tcl_UntraceVar(interp, varName, flags, proc, clientData) \
+ Tcl_UntraceVar2((interp), (varName), NULL, (flags), (proc), (clientData))
+#undef Tcl_UpVar
+#define Tcl_UpVar(interp, frameName, varName, localName, flags) \
+ Tcl_UpVar2((interp), (frameName), (varName), NULL, (localName), (flags))
+#undef Tcl_GetIndexFromObj
+#define Tcl_GetIndexFromObj(interp, objPtr, tablePtr, msg, flags, indexPtr) \
+ Tcl_GetIndexFromObjStruct((interp), (objPtr), (tablePtr), \
+ sizeof(char *), (msg), (flags), (indexPtr))
#endif /* _TCLDECLS */
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index b066d46..b48eca2 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -2604,8 +2604,8 @@ DictFilterCmd(
Tcl_WrongNumArgs(interp, 1, objv, "dictionary filterType ...");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[2], filters, "filterType",
- 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[2], filters,
+ sizeof(char *), "filterType", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index 7daa7bb..8266e54 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -1420,8 +1420,8 @@ Tcl_UpdateObjCmd(
if (objc == 1) {
flags = TCL_ALL_EVENTS|TCL_DONT_WAIT;
} else if (objc == 2) {
- if (Tcl_GetIndexFromObj(interp, objv[1], updateOptions,
- "option", 0, &optionIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], updateOptions,
+ sizeof(char *), "option", 0, &optionIndex) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum updateOptions) optionIndex) {
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c
index c57a4ff..83f8e5b 100644
--- a/generic/tclFCmd.c
+++ b/generic/tclFCmd.c
@@ -1073,8 +1073,8 @@ TclFileAttrsCmd(
goto end;
}
- if (Tcl_GetIndexFromObj(interp, objv[0], attributeStrings,
- "option", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[0], attributeStrings,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
goto end;
}
if (didAlloc) {
@@ -1101,8 +1101,8 @@ TclFileAttrsCmd(
}
for (i = 0; i < objc ; i += 2) {
- if (Tcl_GetIndexFromObj(interp, objv[i], attributeStrings,
- "option", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], attributeStrings,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
goto end;
}
if (didAlloc) {
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 07757d9..cdfaec8 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -1242,8 +1242,8 @@ Tcl_GlobObjCmd(
dir = PATH_NONE;
typePtr = NULL;
for (i = 1; i < objc; i++) {
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
string = Tcl_GetStringFromObj(objv[i], &length);
if (string[0] == '-') {
/*
diff --git a/generic/tclIO.c b/generic/tclIO.c
index e2415d8..2f76eb1 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -9703,6 +9703,7 @@ SetBlockMode(
*----------------------------------------------------------------------
*/
+#undef Tcl_GetChannelNames
int
Tcl_GetChannelNames(
Tcl_Interp *interp) /* Interp for error reporting. */
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index f90bf0d..32a1360 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -1734,6 +1734,7 @@ TclGetOpenModeEx(
* Tcl_FSEvalFile is Tcl_FSEvalFileEx without encoding argument.
*/
+#undef Tcl_FSEvalFile
int
Tcl_FSEvalFile(
Tcl_Interp *interp, /* Interpreter in which to process file. */
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index 2d87205..4583a20 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -85,6 +85,7 @@ typedef struct {
*----------------------------------------------------------------------
*/
+#undef Tcl_GetIndexFromObj
int
Tcl_GetIndexFromObj(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
@@ -170,6 +171,11 @@ Tcl_GetIndexFromObjStruct(
Tcl_Obj *resultPtr;
IndexRep *indexRep;
+ /* Protect against invalid offset value, such as -1 or 0. */
+ if (offset < sizeof(char *)) {
+ offset = sizeof(char *);
+ }
+
/*
* See if there is a valid cached result from a previous lookup.
*/
diff --git a/generic/tclLoad.c b/generic/tclLoad.c
index ac863b9..eaf6a70 100644
--- a/generic/tclLoad.c
+++ b/generic/tclLoad.c
@@ -521,8 +521,8 @@ Tcl_UnloadObjCmd(
};
for (i = 1; i < objc; i++) {
- if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], options,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
fullFileName = Tcl_GetString(objv[i]);
if (fullFileName[0] == '-') {
/*
diff --git a/generic/tclMain.c b/generic/tclMain.c
index 7a19a38..5736881 100644
--- a/generic/tclMain.c
+++ b/generic/tclMain.c
@@ -271,9 +271,9 @@ Tcl_SourceRCFile(
{
Tcl_DString temp;
CONST char *fileName;
- Tcl_Channel errChannel;
+ Tcl_Channel chan;
- fileName = Tcl_GetVar(interp, "tcl_rcFileName", TCL_GLOBAL_ONLY);
+ fileName = Tcl_GetVar2(interp, "tcl_rcFileName", NULL, TCL_GLOBAL_ONLY);
if (fileName != NULL) {
Tcl_Channel c;
CONST char *fullName;
@@ -291,17 +291,21 @@ Tcl_SourceRCFile(
* Test for the existence of the rc file before trying to read it.
*/
- c = Tcl_OpenFileChannel(NULL, fullName, "r", 0);
+ Tcl_Obj *fullNameObj = Tcl_NewStringObj(fullName, -1);
+ Tcl_IncrRefCount(fullNameObj);
+ c = Tcl_FSOpenFileChannel(NULL, fullNameObj, "r", 0);
if (c != (Tcl_Channel) NULL) {
+
Tcl_Close(NULL, c);
- if (Tcl_EvalFile(interp, fullName) != TCL_OK) {
- errChannel = Tcl_GetStdChannel(TCL_STDERR);
- if (errChannel) {
- Tcl_WriteObj(errChannel, Tcl_GetObjResult(interp));
- Tcl_WriteChars(errChannel, "\n", 1);
- }
- }
- }
+ if (Tcl_FSEvalFileEx(interp, fullNameObj, NULL) != TCL_OK) {
+ chan = Tcl_GetStdChannel(TCL_STDERR);
+ if (chan) {
+ Tcl_WriteObj(chan, Tcl_GetObjResult(interp));
+ Tcl_WriteChars(chan, "\n", 1);
+ }
+ }
+ Tcl_DecrRefCount(fullNameObj);
+ }
}
Tcl_DStringFree(&temp);
}
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 5dbffc6..e371aa0 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -2794,8 +2794,8 @@ Tcl_NamespaceObjCmd(
* Return an index reflecting the particular subcommand.
*/
- result = Tcl_GetIndexFromObj((Tcl_Interp *) interp, objv[1], subCmds,
- "option", /*flags*/ 0, (int *) &index);
+ result = Tcl_GetIndexFromObjStruct((Tcl_Interp *) interp, objv[1],
+ subCmds, sizeof(char *), "option", /*flags*/ 0, (int *) &index);
if (result != TCL_OK) {
return result;
}
@@ -4531,8 +4531,8 @@ NamespaceWhichCmd(
* Look for a flag controlling the lookup.
*/
- if (Tcl_GetIndexFromObj(interp, objv[2], opts, "option", 0,
- &lookupType) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[2], opts, sizeof(char *),
+ "option", 0, &lookupType) != TCL_OK) {
/*
* Preserve old style of error message!
*/
@@ -4790,8 +4790,8 @@ NamespaceEnsembleCmd(
Tcl_WrongNumArgs(interp, 2, objv, "subcommand ?arg ...?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[2], subcommands, "subcommand", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[2], subcommands,
+ sizeof(char *), "subcommand", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -4828,8 +4828,8 @@ NamespaceEnsembleCmd(
*/
for (; objc>1 ; objc-=2,objv+=2 ) {
- if (Tcl_GetIndexFromObj(interp, objv[0], createOptions, "option",
- 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[0], createOptions,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
if (allocatedMapFlag) {
Tcl_DecrRefCount(mapObj);
}
@@ -4988,8 +4988,8 @@ NamespaceEnsembleCmd(
if (objc == 5) {
Tcl_Obj *resultObj = NULL; /* silence gcc 4 warning */
- if (Tcl_GetIndexFromObj(interp, objv[4], configOptions, "option",
- 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[4], configOptions,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum EnsConfigOpts) index) {
@@ -5104,8 +5104,8 @@ NamespaceEnsembleCmd(
*/
for (; objc>0 ; objc-=2,objv+=2 ) {
- if (Tcl_GetIndexFromObj(interp, objv[0], configOptions,
- "option", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[0], configOptions,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
if (allocatedMapFlag) {
Tcl_DecrRefCount(mapObj);
}
diff --git a/generic/tclPkg.c b/generic/tclPkg.c
index aed80c0..1a8a021 100644
--- a/generic/tclPkg.c
+++ b/generic/tclPkg.c
@@ -106,6 +106,7 @@ static const char * PkgRequireCore(Tcl_Interp *interp, const char *name,
*----------------------------------------------------------------------
*/
+#undef Tcl_PkgProvide
int
Tcl_PkgProvide(
Tcl_Interp *interp, /* Interpreter in which package is now
@@ -186,6 +187,7 @@ Tcl_PkgProvideEx(
*----------------------------------------------------------------------
*/
+#undef Tcl_PkgRequire
const char *
Tcl_PkgRequire(
Tcl_Interp *interp, /* Interpreter in which package is now
@@ -651,6 +653,7 @@ PkgRequireCore(
*----------------------------------------------------------------------
*/
+#undef Tcl_PkgPresent
const char *
Tcl_PkgPresent(
Tcl_Interp *interp, /* Interpreter in which package is now
@@ -765,8 +768,8 @@ Tcl_PackageObjCmd(
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], pkgOptions, "option", 0,
- &optionIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], pkgOptions,
+ sizeof(char *), "option", 0, &optionIndex) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum pkgOptions) optionIndex) {
@@ -941,7 +944,7 @@ Tcl_PackageObjCmd(
if (CheckVersionAndConvert(interp, argv3, NULL, NULL) != TCL_OK) {
return TCL_ERROR;
}
- return Tcl_PkgProvide(interp, argv2, argv3);
+ return Tcl_PkgProvideEx(interp, argv2, argv3, NULL);
case PKG_REQUIRE:
require:
if (objc < 3) {
@@ -1031,8 +1034,8 @@ Tcl_PackageObjCmd(
int newPref;
- if (Tcl_GetIndexFromObj(interp, objv[2], pkgPreferOptions,
- "preference", 0, &newPref) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[2], pkgPreferOptions,
+ sizeof(char *), "preference", 0, &newPref) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 2c6d300..699f927 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -2815,7 +2815,8 @@ Tcl_DisassembleObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "type procName|lambdaTerm|script");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], types, "type", 0, &idx)!=TCL_OK){
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], types, sizeof(char *),
+ "type", 0, &idx) != TCL_OK){
return TCL_ERROR;
}
diff --git a/generic/tclResult.c b/generic/tclResult.c
index 7b58d44..778170f 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -1339,8 +1339,8 @@ TclMergeReturnOptions(
"ok", "error", "return", "break", "continue", NULL
};
- if (TCL_ERROR == Tcl_GetIndexFromObj(NULL, valuePtr, returnCodes,
- NULL, TCL_EXACT, &code)) {
+ if (TCL_ERROR == Tcl_GetIndexFromObjStruct(NULL, valuePtr, returnCodes,
+ sizeof(char *), NULL, TCL_EXACT, &code)) {
/*
* Value is not a legal return code.
*/
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 68c3cf2..3211af6 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -34,6 +34,18 @@
#undef TclpGetPid
#undef TclSockMinimumBuffers
#undef Tcl_VarTraceInfo
+#undef Tcl_PkgProvide
+#undef Tcl_PkgRequire
+#undef Tcl_PkgPresent
+#undef Tcl_GetVar
+#undef Tcl_SetVar
+#undef Tcl_GetChannelNames
+#undef Tcl_FSEvalFile
+#undef Tcl_TraceVar
+#undef Tcl_UnsetVar
+#undef Tcl_UntraceVar
+#undef Tcl_UpVar
+#undef Tcl_GetIndexFromObj
/*
* Keep a record of the original Notifier procedures, created in the
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 3c39a40..caf4b1a 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -576,7 +576,7 @@ Tcltest_Init(
/* TIP #268: Full patchlevel instead of just major.minor */
- if (Tcl_PkgProvide(interp, "Tcltest", TCL_PATCH_LEVEL) == TCL_ERROR) {
+ if (Tcl_PkgProvideEx(interp, "Tcltest", TCL_PATCH_LEVEL, NULL) == TCL_ERROR) {
return TCL_ERROR;
}
@@ -736,8 +736,8 @@ Tcltest_Init(
if (Tcl_ListObjGetElements(interp, listPtr, &objc, &objv) != TCL_OK) {
return TCL_ERROR;
}
- if (objc && (Tcl_GetIndexFromObj(NULL, objv[0], specialOptions, NULL,
- TCL_EXACT, &index) == TCL_OK)) {
+ if (objc && (Tcl_GetIndexFromObjStruct(NULL, objv[0], specialOptions,
+ sizeof(char *), NULL, TCL_EXACT, &index) == TCL_OK)) {
switch (index) {
case 0:
return TCL_ERROR;
diff --git a/generic/tclTestProcBodyObj.c b/generic/tclTestProcBodyObj.c
index 644179b..0fc3bb2 100644
--- a/generic/tclTestProcBodyObj.c
+++ b/generic/tclTestProcBodyObj.c
@@ -183,7 +183,7 @@ ProcBodyTestInitInternal(
}
}
- return Tcl_PkgProvide(interp, packageName, packageVersion);
+ return Tcl_PkgProvideEx(interp, packageName, packageVersion, NULL);
}
/*
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index cb8c674..37a1a23 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -2797,6 +2797,7 @@ DisposeTraceResult(
*----------------------------------------------------------------------
*/
+#undef Tcl_UntraceVar
void
Tcl_UntraceVar(
Tcl_Interp *interp, /* Interpreter containing variable. */
@@ -3078,6 +3079,7 @@ Tcl_VarTraceInfo2(
*----------------------------------------------------------------------
*/
+#undef Tcl_TraceVar
int
Tcl_TraceVar(
Tcl_Interp *interp, /* Interpreter in which variable is to be
diff --git a/generic/tclVar.c b/generic/tclVar.c
index aaf1cb9..9cebe83 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -1187,6 +1187,7 @@ TclLookupArrayElement(
*----------------------------------------------------------------------
*/
+#undef Tcl_GetVar
const char *
Tcl_GetVar(
Tcl_Interp *interp, /* Command interpreter in which varName is to
@@ -1511,6 +1512,7 @@ Tcl_SetObjCmd(
*----------------------------------------------------------------------
*/
+#undef Tcl_SetVar
const char *
Tcl_SetVar(
Tcl_Interp *interp, /* Command interpreter in which varName is to
@@ -2097,6 +2099,7 @@ TclPtrIncrObjVar(
*----------------------------------------------------------------------
*/
+#undef Tcl_UnsetVar
int
Tcl_UnsetVar(
Tcl_Interp *interp, /* Command interpreter in which varName is to
@@ -3736,6 +3739,7 @@ TclPtrObjMakeUpvar(
*----------------------------------------------------------------------
*/
+#undef Tcl_UpVar
int
Tcl_UpVar(
Tcl_Interp *interp, /* Command interpreter in which varName is to
diff --git a/unix/dltest/pkga.c b/unix/dltest/pkga.c
index f001cdf..e686680 100644
--- a/unix/dltest/pkga.c
+++ b/unix/dltest/pkga.c
@@ -125,7 +125,7 @@ Pkga_Init(
if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "Pkga", "1.0");
+ code = Tcl_PkgProvideEx(interp, "Pkga", "1.0", NULL);
if (code != TCL_OK) {
return code;
}
diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c
index 51c1bd9..116bffb 100644
--- a/unix/dltest/pkgb.c
+++ b/unix/dltest/pkgb.c
@@ -115,7 +115,7 @@ Pkgb_Init(
if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "Pkgb", "2.3");
+ code = Tcl_PkgProvideEx(interp, "Pkgb", "2.3", NULL);
if (code != TCL_OK) {
return code;
}
@@ -153,7 +153,7 @@ Pkgb_SafeInit(
if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "Pkgb", "2.3");
+ code = Tcl_PkgProvideEx(interp, "Pkgb", "2.3", NULL);
if (code != TCL_OK) {
return code;
}
diff --git a/unix/dltest/pkgc.c b/unix/dltest/pkgc.c
index 6ad5ab4..26b11ab 100644
--- a/unix/dltest/pkgc.c
+++ b/unix/dltest/pkgc.c
@@ -115,7 +115,7 @@ Pkgc_Init(
if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "Pkgc", "1.7.2");
+ code = Tcl_PkgProvideEx(interp, "Pkgc", "1.7.2", NULL);
if (code != TCL_OK) {
return code;
}
@@ -153,7 +153,7 @@ Pkgc_SafeInit(
if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "Pkgc", "1.7.2");
+ code = Tcl_PkgProvideEx(interp, "Pkgc", "1.7.2", NULL);
if (code != TCL_OK) {
return code;
}
diff --git a/unix/dltest/pkgd.c b/unix/dltest/pkgd.c
index 7fe7c49..27ac323 100644
--- a/unix/dltest/pkgd.c
+++ b/unix/dltest/pkgd.c
@@ -115,7 +115,7 @@ Pkgd_Init(
if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "Pkgd", "7.3");
+ code = Tcl_PkgProvideEx(interp, "Pkgd", "7.3", NULL);
if (code != TCL_OK) {
return code;
}
@@ -153,7 +153,7 @@ Pkgd_SafeInit(
if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "Pkgd", "7.3");
+ code = Tcl_PkgProvideEx(interp, "Pkgd", "7.3", NULL);
if (code != TCL_OK) {
return code;
}
diff --git a/unix/dltest/pkgua.c b/unix/dltest/pkgua.c
index 9c36e88..3da7dfc 100644
--- a/unix/dltest/pkgua.c
+++ b/unix/dltest/pkgua.c
@@ -210,7 +210,7 @@ Pkgua_Init(
PkguaInitTokensHashTable();
- code = Tcl_PkgProvide(interp, "Pkgua", "1.0");
+ code = Tcl_PkgProvideEx(interp, "Pkgua", "1.0", NULL);
if (code != TCL_OK) {
return code;
}
diff --git a/win/tclWinDde.c b/win/tclWinDde.c
index 5543732..0bcefa0 100644
--- a/win/tclWinDde.c
+++ b/win/tclWinDde.c
@@ -145,7 +145,7 @@ Dde_Init(
Tcl_CreateObjCommand(interp, "dde", DdeObjCmd, NULL, NULL);
Tcl_CreateExitHandler(DdeExitProc, NULL);
- return Tcl_PkgProvide(interp, TCL_DDE_PACKAGE_NAME, TCL_DDE_VERSION);
+ return Tcl_PkgProvideEx(interp, TCL_DDE_PACKAGE_NAME, TCL_DDE_VERSION, NULL);
}
/*
@@ -1205,16 +1205,16 @@ DdeObjCmd(
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], ddeCommands, "command", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], ddeCommands, sizeof(char *),
+ "command", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum DdeSubcommands) index) {
case DDE_SERVERNAME:
for (i = 2; i < objc; i++) {
- if (Tcl_GetIndexFromObj(interp, objv[i], ddeSrvOptions,
- "option", 0, &argIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], ddeSrvOptions,
+ sizeof(char *), "option", 0, &argIndex) != TCL_OK) {
/*
* If it is the last argument, it might be a server name
* instead of a bad argument.
@@ -1260,8 +1260,8 @@ DdeObjCmd(
firstArg = 2;
break;
} else if (objc == 6) {
- if (Tcl_GetIndexFromObj(NULL, objv[2], ddeExecOptions, "option", 0,
- &argIndex) == TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(NULL, objv[2], ddeExecOptions,
+ sizeof(char *), "option", 0, &argIndex) == TCL_OK) {
flags |= DDE_FLAG_ASYNC;
firstArg = 3;
break;
@@ -1285,8 +1285,8 @@ DdeObjCmd(
break;
} else if (objc == 6) {
int dummy;
- if (Tcl_GetIndexFromObj(NULL, objv[2], ddeReqOptions, "option", 0,
- &dummy) == TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(NULL, objv[2], ddeReqOptions,
+ sizeof(char *), "option", 0, &dummy) == TCL_OK) {
flags |= DDE_FLAG_BINARY;
firstArg = 3;
break;
@@ -1314,8 +1314,8 @@ DdeObjCmd(
return TCL_ERROR;
} else {
firstArg = 2;
- if (Tcl_GetIndexFromObj(NULL, objv[2], ddeExecOptions, "option",
- 0, &argIndex) == TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(NULL, objv[2], ddeExecOptions,
+ sizeof(char *), "option", 0, &argIndex) == TCL_OK) {
if (objc < 5) {
goto wrongDdeEvalArgs;
}
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index f58014c..74f8483 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -378,7 +378,7 @@ typedef DWORD_PTR * PDWORD_PTR;
/*
- * MSVC 8.0 started to mark many standard C library functions depreciated
+ * MSVC 8.0 started to mark many standard C library functions deprecated
* including the *printf family and others. Tell it to shut up.
* (_MSC_VER is 1200 for VC6, 1300 or 1310 for vc7.net, 1400 for 8.0)
*/
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index a6ce2ce..be884e1 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -236,7 +236,7 @@ Registry_Init(
cmd = Tcl_CreateObjCommand(interp, "registry", RegistryObjCmd,
(ClientData)interp, DeleteCmd);
Tcl_SetAssocData(interp, REGISTRY_ASSOC_KEY, NULL, (ClientData)cmd);
- return Tcl_PkgProvide(interp, "registry", "1.2.2");
+ return Tcl_PkgProvideEx(interp, "registry", "1.2.2", NULL);
}
/*
@@ -347,8 +347,8 @@ RegistryObjCmd(
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], subcommands, "option", 0, &index)
- != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], subcommands,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}