From e51f88c164f863f53bb520cfdc89f5555bf4daab Mon Sep 17 00:00:00 2001 From: mig Date: Mon, 14 Jan 2013 19:11:55 +0000 Subject: backout novem - merges are noisy enough as it is --- README | 2 +- generic/regc_locale.c | 2 +- generic/regcustom.h | 4 + generic/regex.h | 42 +- generic/tcl.decls | 204 +++--- generic/tcl.h | 234 +++++-- generic/tclBasic.c | 615 ++++++++++++++++- generic/tclBinary.c | 2 +- generic/tclCkalloc.c | 2 +- generic/tclClock.c | 4 +- generic/tclCmdIL.c | 2 +- generic/tclCompExpr.c | 2 +- generic/tclCompile.h | 4 +- generic/tclConfig.c | 2 +- generic/tclDecls.h | 1503 ++++++++++++++++++++++-------------------- generic/tclEncoding.c | 70 +- generic/tclEvent.c | 2 +- generic/tclExecute.c | 150 ++++- generic/tclFileName.c | 51 +- generic/tclHistory.c | 7 + generic/tclIO.c | 55 +- generic/tclIOCmd.c | 45 +- generic/tclIORChan.c | 8 +- generic/tclIORTrans.c | 8 +- generic/tclIOUtil.c | 20 +- generic/tclInt.decls | 89 ++- generic/tclInt.h | 123 ++-- generic/tclIntDecls.h | 368 ++++++----- generic/tclIntPlatDecls.h | 180 ++--- generic/tclInterp.c | 16 +- generic/tclLink.c | 2 +- generic/tclListObj.c | 4 + generic/tclLoad.c | 12 +- generic/tclMain.c | 28 +- generic/tclNamesp.c | 4 +- generic/tclObj.c | 6 +- generic/tclPathObj.c | 2 +- generic/tclPkg.c | 12 +- generic/tclPlatDecls.h | 22 +- generic/tclPreserve.c | 2 +- generic/tclRegexp.c | 2 +- generic/tclResult.c | 365 +++++++++- generic/tclScan.c | 2 +- generic/tclStrToD.c | 72 +- generic/tclStringObj.c | 2 +- generic/tclStubInit.c | 87 ++- generic/tclStubLib.c | 23 +- generic/tclTest.c | 204 +++++- generic/tclTestObj.c | 2 +- generic/tclTestProcBodyObj.c | 2 +- generic/tclThreadStorage.c | 2 +- generic/tclThreadTest.c | 10 +- generic/tclTimer.c | 2 +- generic/tclTomMath.decls | 2 +- generic/tclTomMathDecls.h | 142 ++-- generic/tclTrace.c | 2 +- generic/tclUtf.c | 4 +- generic/tclUtil.c | 203 +++++- generic/tclVar.c | 3 + library/http/http.tcl | 2 +- library/http/pkgIndex.tcl | 2 +- library/init.tcl | 2 +- library/msgcat/msgcat.tcl | 2 +- library/msgcat/pkgIndex.tcl | 2 +- library/opt/optparse.tcl | 2 +- library/opt/pkgIndex.tcl | 2 +- library/package.tcl | 3 - library/tcltest/pkgIndex.tcl | 2 +- library/tcltest/tcltest.tcl | 2 +- library/tm.tcl | 22 - macosx/Tcl-Common.xcconfig | 2 +- tests/all.tcl | 2 +- tests/cmdAH.test | 2 + tests/compExpr-old.test | 46 +- tests/compExpr.test | 13 + tests/compile.test | 2 +- tests/execute.test | 22 +- tests/expr-old.test | 80 ++- tests/expr.test | 86 ++- tests/fCmd.test | 8 +- tests/fileName.test | 14 +- tests/httpd11.tcl | 2 +- tests/lindex.test | 16 +- tests/main.test | 2 +- tests/mathop.test | 194 +++--- tests/msgcat.test | 2 +- tests/parseExpr.test | 5 +- tests/safe.test | 2 +- tests/string.test | 4 +- tests/stringComp.test | 4 +- tests/tm.test | 7 +- tests/while-old.test | 2 +- tests/while.test | 4 +- tools/genStubs.tcl | 3 +- tools/man2html.tcl | 2 +- tools/man2html1.tcl | 2 +- tools/man2html2.tcl | 2 +- tools/tcl.hpj.in | 4 +- tools/tclZIC.tcl | 2 +- tools/tcltk-man2html.tcl | 2 +- unix/configure | 26 +- unix/configure.in | 10 +- unix/dltest/pkga.c | 11 +- unix/dltest/pkgb.c | 5 + unix/dltest/pkgc.c | 13 +- unix/dltest/pkgd.c | 13 +- unix/dltest/pkge.c | 11 +- unix/dltest/pkgua.c | 17 +- unix/tcl.spec | 2 +- unix/tclAppInit.c | 4 +- unix/tclUnixChan.c | 4 +- unix/tclUnixCompat.c | 2 +- unix/tclUnixInit.c | 8 +- unix/tclUnixNotfy.c | 4 +- unix/tclUnixPipe.c | 2 +- unix/tclUnixTest.c | 50 +- unix/tclUnixThrd.c | 8 +- unix/tclUnixTime.c | 120 ++++ win/README | 4 +- win/configure | 8 +- win/configure.in | 8 +- win/makefile.bc | 4 +- win/tcl.rc | 2 +- win/tclAppInit.c | 2 +- win/tclWinChan.c | 4 +- win/tclWinConsole.c | 6 +- win/tclWinDde.c | 40 +- win/tclWinInt.h | 14 - win/tclWinNotify.c | 2 +- win/tclWinPipe.c | 6 +- win/tclWinReg.c | 15 +- win/tclWinSerial.c | 4 +- win/tclWinThrd.c | 8 +- win/tclWinTime.c | 308 ++++++++- win/tclsh.rc | 2 +- 135 files changed, 4451 insertions(+), 1918 deletions(-) diff --git a/README b/README index 6207d76..f8965b4 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ README: Tcl - This is the Tcl 9.0a0 source distribution. + This is the Tcl 8.6.0 source distribution. http://tcl.sourceforge.net/ You can get any source release of Tcl from the file distributions link at the above URL. diff --git a/generic/regc_locale.c b/generic/regc_locale.c index 2426750..f3db471 100644 --- a/generic/regc_locale.c +++ b/generic/regc_locale.c @@ -118,7 +118,7 @@ static const struct cname { * Unicode character-class tables. */ -typedef struct { +typedef struct crange { chr start; chr end; } crange; diff --git a/generic/regcustom.h b/generic/regcustom.h index 309203a..1c970ea 100644 --- a/generic/regcustom.h +++ b/generic/regcustom.h @@ -63,6 +63,9 @@ #ifdef __REG_VOID_T #undef __REG_VOID_T #endif +#ifdef __REG_CONST +#undef __REG_CONST +#endif #ifdef __REG_NOFRONT #undef __REG_NOFRONT #endif @@ -73,6 +76,7 @@ #define __REG_WIDE_T Tcl_UniChar #define __REG_REGOFF_T long /* Not really right, but good enough... */ #define __REG_VOID_T void +#define __REG_CONST const /* Names and declarations */ #define __REG_WIDE_COMPILE TclReComp #define __REG_WIDE_EXEC TclReExec diff --git a/generic/regex.h b/generic/regex.h index d09857c..d6d46ce 100644 --- a/generic/regex.h +++ b/generic/regex.h @@ -95,6 +95,9 @@ extern "C" { #ifdef __REG_VOID_T #undef __REG_VOID_T #endif +#ifdef __REG_CONST +#undef __REG_CONST +#endif #ifdef __REG_NOFRONT #undef __REG_NOFRONT #endif @@ -105,6 +108,7 @@ extern "C" { #define __REG_WIDE_T Tcl_UniChar #define __REG_REGOFF_T long /* not really right, but good enough... */ #define __REG_VOID_T void +#define __REG_CONST const /* names and declarations */ #define __REG_WIDE_COMPILE TclReComp #define __REG_WIDE_EXEC TclReExec @@ -140,6 +144,16 @@ typedef void re_void; #endif /* + * Also for benefit of old compilers, can supply a macro which + * expands to a substitute for `const'. + */ +#ifndef __REG_CONST +#define __REG_CONST const +#endif + + + +/* * other interface types */ @@ -183,13 +197,13 @@ typedef struct { /* * compilation ^ #ifndef __REG_NOCHAR - ^ int re_comp(regex_t *, const char *, size_t, int); + ^ int re_comp(regex_t *, __REG_CONST char *, size_t, int); ^ #endif ^ #ifndef __REG_NOFRONT - ^ int regcomp(regex_t *, const char *, int); + ^ int regcomp(regex_t *, __REG_CONST char *, int); ^ #endif ^ #ifdef __REG_WIDE_T - ^ int __REG_WIDE_COMPILE(regex_t *, const __REG_WIDE_T *, size_t, int); + ^ int __REG_WIDE_COMPILE(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int); ^ #endif */ #define REG_BASIC 000000 /* BREs (convenience) */ @@ -214,14 +228,14 @@ typedef struct { /* * execution ^ #ifndef __REG_NOCHAR - ^ int re_exec(regex_t *, const char *, size_t, + ^ int re_exec(regex_t *, __REG_CONST char *, size_t, ^ rm_detail_t *, size_t, regmatch_t [], int); ^ #endif ^ #ifndef __REG_NOFRONT - ^ int regexec(regex_t *, const char *, size_t, regmatch_t [], int); + ^ int regexec(regex_t *, __REG_CONST char *, size_t, regmatch_t [], int); ^ #endif ^ #ifdef __REG_WIDE_T - ^ int __REG_WIDE_EXEC(regex_t *, const __REG_WIDE_T *, size_t, + ^ int __REG_WIDE_EXEC(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, ^ rm_detail_t *, size_t, regmatch_t [], int); ^ #endif */ @@ -246,7 +260,7 @@ typedef struct { * of character is used for error reports is independent of what kind is used * in matching. * - ^ extern size_t regerror(int, const regex_t *, char *, size_t); + ^ extern size_t regerror(int, __REG_CONST regex_t *, char *, size_t); */ #define REG_OKAY 0 /* no errors detected */ #define REG_NOMATCH 1 /* failed to match */ @@ -278,25 +292,25 @@ typedef struct { /* automatically gathered by fwd; do not hand-edit */ /* === regproto.h === */ #ifndef __REG_NOCHAR -int re_comp(regex_t *, const char *, size_t, int); +int re_comp(regex_t *, __REG_CONST char *, size_t, int); #endif #ifndef __REG_NOFRONT -int regcomp(regex_t *, const char *, int); +int regcomp(regex_t *, __REG_CONST char *, int); #endif #ifdef __REG_WIDE_T -MODULE_SCOPE int __REG_WIDE_COMPILE(regex_t *, const __REG_WIDE_T *, size_t, int); +MODULE_SCOPE int __REG_WIDE_COMPILE(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int); #endif #ifndef __REG_NOCHAR -int re_exec(regex_t *, const char *, size_t, rm_detail_t *, size_t, regmatch_t [], int); +int re_exec(regex_t *, __REG_CONST char *, size_t, rm_detail_t *, size_t, regmatch_t [], int); #endif #ifndef __REG_NOFRONT -int regexec(regex_t *, const char *, size_t, regmatch_t [], int); +int regexec(regex_t *, __REG_CONST char *, size_t, regmatch_t [], int); #endif #ifdef __REG_WIDE_T -MODULE_SCOPE int __REG_WIDE_EXEC(regex_t *, const __REG_WIDE_T *, size_t, rm_detail_t *, size_t, regmatch_t [], int); +MODULE_SCOPE int __REG_WIDE_EXEC(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, rm_detail_t *, size_t, regmatch_t [], int); #endif MODULE_SCOPE re_void regfree(regex_t *); -MODULE_SCOPE size_t regerror(int, const regex_t *, char *, size_t); +MODULE_SCOPE size_t regerror(int, __REG_CONST regex_t *, char *, size_t); /* automatically gathered by fwd; do not hand-edit */ /* =====^!^===== end forwards =====^!^===== */ diff --git a/generic/tcl.decls b/generic/tcl.decls index 0c2408e..2d41134 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -21,7 +21,7 @@ library tcl interface tcl hooks {tclPlat tclInt tclIntPlat} -scspec TCLAPI +scspec EXTERN # Declare each of the functions in the public Tcl interface. Note that # the an index should never be reused for a different function in order @@ -32,7 +32,7 @@ declare 0 { const char *version, const void *clientData) } declare 1 { - const char *Tcl_PkgRequireEx(Tcl_Interp *interp, + CONST84_RETURN char *Tcl_PkgRequireEx(Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr) } @@ -154,7 +154,7 @@ declare 35 { } declare 36 { int Tcl_GetIndexFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, - const char *const *tablePtr, const char *msg, int flags, int *indexPtr) + CONST84 char *const *tablePtr, const char *msg, int flags, int *indexPtr) } declare 37 { int Tcl_GetInt(Tcl_Interp *interp, const char *src, int *intPtr) @@ -166,7 +166,7 @@ declare 39 { int Tcl_GetLongFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, long *longPtr) } declare 40 { - const Tcl_ObjType *Tcl_GetObjType(const char *typeName) + CONST86 Tcl_ObjType *Tcl_GetObjType(const char *typeName) } declare 41 { char *Tcl_GetStringFromObj(Tcl_Obj *objPtr, int *lengthPtr) @@ -285,10 +285,9 @@ declare 75 { declare 76 { void Tcl_BackgroundError(Tcl_Interp *interp) } -# Removed in 9.0 -#declare 77 { -# char Tcl_Backslash(const char *src, int *readPtr) -#} +declare 77 { + char Tcl_Backslash(const char *src, int *readPtr) +} declare 78 { int Tcl_BadChannelOption(Tcl_Interp *interp, const char *optionName, const char *optionList) @@ -307,7 +306,7 @@ declare 82 { int Tcl_CommandComplete(const char *cmd) } declare 83 { - char *Tcl_Concat(int argc, const char *const *argv) + char *Tcl_Concat(int argc, CONST84 char *const *argv) } declare 84 { int Tcl_ConvertElement(const char *src, char *dst, int flags) @@ -319,7 +318,7 @@ declare 85 { declare 86 { int Tcl_CreateAlias(Tcl_Interp *slave, const char *slaveCmd, Tcl_Interp *target, const char *targetCmd, int argc, - const char *const *argv) + CONST84 char *const *argv) } declare 87 { int Tcl_CreateAliasObj(Tcl_Interp *slave, const char *slaveCmd, @@ -353,11 +352,11 @@ declare 93 { declare 94 { Tcl_Interp *Tcl_CreateInterp(void) } -#declare 95 { -# void Tcl_CreateMathFunc(Tcl_Interp *interp, const char *name, -# int numArgs, Tcl_ValueType *argTypes, -# Tcl_MathProc *proc, ClientData clientData) -#} +declare 95 { + void Tcl_CreateMathFunc(Tcl_Interp *interp, const char *name, + int numArgs, Tcl_ValueType *argTypes, + Tcl_MathProc *proc, ClientData clientData) +} declare 96 { Tcl_Command Tcl_CreateObjCommand(Tcl_Interp *interp, const char *cmdName, @@ -462,18 +461,18 @@ declare 126 { int Tcl_Eof(Tcl_Channel chan) } declare 127 { - const char *Tcl_ErrnoId(void) + CONST84_RETURN char *Tcl_ErrnoId(void) } declare 128 { - const char *Tcl_ErrnoMsg(int err) + CONST84_RETURN char *Tcl_ErrnoMsg(int err) } declare 129 { int Tcl_Eval(Tcl_Interp *interp, const char *script) } -# Removed in 9.0: -#declare 130 { -# int Tcl_EvalFile(Tcl_Interp *interp, const char *fileName) -#} +# This is obsolete, use Tcl_FSEvalFile +declare 130 { + int Tcl_EvalFile(Tcl_Interp *interp, const char *fileName) +} #declare 131 { # int Tcl_EvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr) #} @@ -515,10 +514,9 @@ declare 142 { declare 143 { void Tcl_Finalize(void) } -# Removed (from stubtable only) in 9.0: -#declare 144 { -# void Tcl_FindExecutable(const char *argv0) -#} +declare 144 { + void Tcl_FindExecutable(const char *argv0) +} declare 145 { Tcl_HashEntry *Tcl_FirstHashEntry(Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr) @@ -531,12 +529,12 @@ declare 147 { } declare 148 { int Tcl_GetAlias(Tcl_Interp *interp, const char *slaveCmd, - Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, - int *argcPtr, const char ***argvPtr) + Tcl_Interp **targetInterpPtr, CONST84 char **targetCmdPtr, + int *argcPtr, CONST84 char ***argvPtr) } declare 149 { int Tcl_GetAliasObj(Tcl_Interp *interp, const char *slaveCmd, - Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, + Tcl_Interp **targetInterpPtr, CONST84 char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv) } declare 150 { @@ -561,28 +559,28 @@ declare 155 { int Tcl_GetChannelMode(Tcl_Channel chan) } declare 156 { - const char *Tcl_GetChannelName(Tcl_Channel chan) + CONST84_RETURN char *Tcl_GetChannelName(Tcl_Channel chan) } declare 157 { int Tcl_GetChannelOption(Tcl_Interp *interp, Tcl_Channel chan, const char *optionName, Tcl_DString *dsPtr) } declare 158 { - const Tcl_ChannelType *Tcl_GetChannelType(Tcl_Channel chan) + CONST86 Tcl_ChannelType *Tcl_GetChannelType(Tcl_Channel chan) } #declare 159 { # int Tcl_GetCommandInfo(Tcl_Interp *interp, const char *cmdName, # Tcl_CmdInfo *infoPtr) #} declare 160 { - const char *Tcl_GetCommandName(Tcl_Interp *interp, + CONST84_RETURN char *Tcl_GetCommandName(Tcl_Interp *interp, Tcl_Command command) } declare 161 { int Tcl_GetErrno(void) } declare 162 { - const char *Tcl_GetHostName(void) + CONST84_RETURN char *Tcl_GetHostName(void) } declare 163 { int Tcl_GetInterpPath(Tcl_Interp *askInterp, Tcl_Interp *slaveInterp) @@ -625,20 +623,19 @@ declare 173 { Tcl_Channel Tcl_GetStdChannel(int type) } declare 174 { - const char *Tcl_GetStringResult(Tcl_Interp *interp) + CONST84_RETURN char *Tcl_GetStringResult(Tcl_Interp *interp) } declare 175 { - const char *Tcl_GetVar(Tcl_Interp *interp, const char *varName, + CONST84_RETURN char *Tcl_GetVar(Tcl_Interp *interp, const char *varName, int flags) } declare 176 { - const char *Tcl_GetVar2(Tcl_Interp *interp, const char *part1, + CONST84_RETURN char *Tcl_GetVar2(Tcl_Interp *interp, const char *part1, const char *part2, int flags) } -# Removed in 9.0 -#declare 177 { -# int Tcl_GlobalEval(Tcl_Interp *interp, const char *command) -#} +declare 177 { + int Tcl_GlobalEval(Tcl_Interp *interp, const char *command) +} #declare 178 { # int Tcl_GlobalEvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr) #} @@ -666,7 +663,7 @@ declare 185 { } # Obsolete, use Tcl_FSJoinPath declare 186 { - char *Tcl_JoinPath(int argc, const char *const *argv, + char *Tcl_JoinPath(int argc, CONST84 char *const *argv, Tcl_DString *resultPtr) } declare 187 { @@ -689,7 +686,7 @@ declare 191 { Tcl_Channel Tcl_MakeTcpClientChannel(ClientData tcpSocket) } declare 192 { - char *Tcl_Merge(int argc, const char *const *argv) + char *Tcl_Merge(int argc, CONST84 char *const *argv) } declare 193 { Tcl_HashEntry *Tcl_NextHashEntry(Tcl_HashSearch *searchPtr) @@ -707,7 +704,7 @@ declare 196 { } declare 197 { Tcl_Channel Tcl_OpenCommandChannel(Tcl_Interp *interp, int argc, - const char **argv, int flags) + CONST84 char **argv, int flags) } # This is obsolete, use Tcl_FSOpenFileChannel declare 198 { @@ -733,7 +730,7 @@ declare 203 { int Tcl_PutEnv(const char *assignment) } declare 204 { - const char *Tcl_PosixError(Tcl_Interp *interp) + CONST84_RETURN char *Tcl_PosixError(Tcl_Interp *interp) } declare 205 { void Tcl_QueueEvent(Tcl_Event *evPtr, Tcl_QueuePosition position) @@ -769,7 +766,7 @@ declare 214 { } declare 215 { void Tcl_RegExpRange(Tcl_RegExp regexp, int index, - const char **startPtr, const char **endPtr) + CONST84 char **startPtr, CONST84 char **endPtr) } declare 216 { void Tcl_Release(ClientData clientData) @@ -783,10 +780,10 @@ declare 218 { declare 219 { int Tcl_ScanCountedElement(const char *src, int length, int *flagPtr) } -# Removed in Tcl 9 -#declare 220 { -# int Tcl_SeekOld(Tcl_Channel chan, int offset, int mode) -#} +# Obsolete +declare 220 { + int Tcl_SeekOld(Tcl_Channel chan, int offset, int mode) +} declare 221 { int Tcl_ServiceAll(void) } @@ -840,29 +837,29 @@ declare 236 { void Tcl_SetStdChannel(Tcl_Channel channel, int type) } declare 237 { - const char *Tcl_SetVar(Tcl_Interp *interp, const char *varName, + CONST84_RETURN char *Tcl_SetVar(Tcl_Interp *interp, const char *varName, const char *newValue, int flags) } declare 238 { - const char *Tcl_SetVar2(Tcl_Interp *interp, const char *part1, + CONST84_RETURN char *Tcl_SetVar2(Tcl_Interp *interp, const char *part1, const char *part2, const char *newValue, int flags) } declare 239 { - const char *Tcl_SignalId(int sig) + CONST84_RETURN char *Tcl_SignalId(int sig) } declare 240 { - const char *Tcl_SignalMsg(int sig) + CONST84_RETURN char *Tcl_SignalMsg(int sig) } declare 241 { void Tcl_SourceRCFile(Tcl_Interp *interp) } declare 242 { int Tcl_SplitList(Tcl_Interp *interp, const char *listStr, int *argcPtr, - const char ***argvPtr) + CONST84 char ***argvPtr) } # Obsolete, use Tcl_FSSplitPath declare 243 { - void Tcl_SplitPath(const char *path, int *argcPtr, const char ***argvPtr) + void Tcl_SplitPath(const char *path, int *argcPtr, CONST84 char ***argvPtr) } declare 244 { void Tcl_StaticPackage(Tcl_Interp *interp, const char *pkgName, @@ -871,10 +868,10 @@ declare 244 { declare 245 { int Tcl_StringMatch(const char *str, const char *pattern) } -# Removed in Tcl 9 -#declare 246 { -# int Tcl_TellOld(Tcl_Channel chan) -#} +# Obsolete +declare 246 { + int Tcl_TellOld(Tcl_Channel chan) +} declare 247 { int Tcl_TraceVar(Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData) @@ -923,10 +920,9 @@ declare 259 { int Tcl_UpVar2(Tcl_Interp *interp, const char *frameName, const char *part1, const char *part2, const char *localName, int flags) } -# Removed in 9.0 -#declare 260 { -# int Tcl_VarEval(Tcl_Interp *interp, ...) -#} +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) @@ -959,35 +955,33 @@ declare 269 { char *Tcl_HashStats(Tcl_HashTable *tablePtr) } declare 270 { - const char *Tcl_ParseVar(Tcl_Interp *interp, const char *start, - const char **termPtr) + CONST84_RETURN char *Tcl_ParseVar(Tcl_Interp *interp, const char *start, + CONST84 char **termPtr) } declare 271 { - const char *Tcl_PkgPresent(Tcl_Interp *interp, const char *name, + CONST84_RETURN char *Tcl_PkgPresent(Tcl_Interp *interp, const char *name, const char *version, int exact) } declare 272 { - const char *Tcl_PkgPresentEx(Tcl_Interp *interp, + CONST84_RETURN char *Tcl_PkgPresentEx(Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr) } -# Changed to a macro, only (internally) exposed for legacy protection. declare 273 { - int TclPkgProvide(Tcl_Interp *interp, const char *name, + int Tcl_PkgProvide(Tcl_Interp *interp, const char *name, const char *version) } # TIP #268: The internally used new Require function is in slot 573. declare 274 { - const char *Tcl_PkgRequire(Tcl_Interp *interp, const char *name, + CONST84_RETURN char *Tcl_PkgRequire(Tcl_Interp *interp, const char *name, const char *version, int exact) } declare 275 { void Tcl_SetErrorCodeVA(Tcl_Interp *interp, va_list argList) } -# Removed in 9.0 -#declare 276 { -# int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList) -#} +declare 276 { + int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList) +} declare 277 { Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options) } @@ -1093,7 +1087,7 @@ declare 301 { Tcl_Encoding Tcl_GetEncoding(Tcl_Interp *interp, const char *name) } declare 302 { - const char *Tcl_GetEncodingName(Tcl_Encoding encoding) + CONST84_RETURN char *Tcl_GetEncodingName(Tcl_Encoding encoding) } declare 303 { void Tcl_GetEncodingNames(Tcl_Interp *interp) @@ -1169,7 +1163,7 @@ declare 324 { int Tcl_UniCharToUtf(int ch, char *buf) } declare 325 { - const char *Tcl_UtfAtIndex(const char *src, int index) + CONST84_RETURN char *Tcl_UtfAtIndex(const char *src, int index) } declare 326 { int Tcl_UtfCharComplete(const char *src, int length) @@ -1178,16 +1172,16 @@ declare 327 { int Tcl_UtfBackslash(const char *src, int *readPtr, char *dst) } declare 328 { - const char *Tcl_UtfFindFirst(const char *src, int ch) + CONST84_RETURN char *Tcl_UtfFindFirst(const char *src, int ch) } declare 329 { - const char *Tcl_UtfFindLast(const char *src, int ch) + CONST84_RETURN char *Tcl_UtfFindLast(const char *src, int ch) } declare 330 { - const char *Tcl_UtfNext(const char *src) + CONST84_RETURN char *Tcl_UtfNext(const char *src) } declare 331 { - const char *Tcl_UtfPrev(const char *src, const char *start) + CONST84_RETURN char *Tcl_UtfPrev(const char *src, const char *start) } declare 332 { int Tcl_UtfToExternal(Tcl_Interp *interp, Tcl_Encoding encoding, @@ -1220,14 +1214,12 @@ declare 339 { declare 340 { char *Tcl_GetString(Tcl_Obj *objPtr) } -# Removed in 9.0 -#declare 341 { -# const char *Tcl_GetDefaultEncodingDir(void) -#} -# Removed in 9.0 -#declare 342 { -# void Tcl_SetDefaultEncodingDir(const char *path) -#} +declare 341 { + CONST84_RETURN char *Tcl_GetDefaultEncodingDir(void) +} +declare 342 { + void Tcl_SetDefaultEncodingDir(const char *path) +} declare 343 { void Tcl_AlertNotifier(ClientData clientData) } @@ -1274,11 +1266,10 @@ declare 356 { Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp, Tcl_Obj *patObj, int flags) } -# Removed in 9.0: -#declare 357 { -# Tcl_Obj *Tcl_EvalTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr, -# int count) -#} +declare 357 { + Tcl_Obj *Tcl_EvalTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr, + int count) +} declare 358 { void Tcl_FreeParse(Tcl_Parse *parsePtr) } @@ -1288,7 +1279,7 @@ declare 359 { } declare 360 { int Tcl_ParseBraces(Tcl_Interp *interp, const char *start, int numBytes, - Tcl_Parse *parsePtr, int append, const char **termPtr) + Tcl_Parse *parsePtr, int append, CONST84 char **termPtr) } declare 361 { int Tcl_ParseCommand(Tcl_Interp *interp, const char *start, int numBytes, @@ -1301,7 +1292,7 @@ declare 362 { declare 363 { int Tcl_ParseQuotedString(Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr, int append, - const char **termPtr) + CONST84 char **termPtr) } declare 364 { int Tcl_ParseVarName(Tcl_Interp *interp, const char *start, int numBytes, @@ -1417,7 +1408,7 @@ declare 397 { int Tcl_ChannelBuffered(Tcl_Channel chan) } declare 398 { - const char *Tcl_ChannelName(const Tcl_ChannelType *chanTypePtr) + CONST84_RETURN char *Tcl_ChannelName(const Tcl_ChannelType *chanTypePtr) } declare 399 { Tcl_ChannelTypeVersion Tcl_ChannelVersion( @@ -1557,14 +1548,14 @@ declare 434 { } # TIP#15 (math function introspection) dkf -#declare 435 { -# int Tcl_GetMathFuncInfo(Tcl_Interp *interp, const char *name, -# int *numArgsPtr, Tcl_ValueType **argTypesPtr, -# Tcl_MathProc **procPtr, ClientData *clientDataPtr) -#} -#declare 436 { -# Tcl_Obj *Tcl_ListMathFuncs(Tcl_Interp *interp, const char *pattern) -#} +declare 435 { + int Tcl_GetMathFuncInfo(Tcl_Interp *interp, const char *name, + int *numArgsPtr, Tcl_ValueType **argTypesPtr, + Tcl_MathProc **procPtr, ClientData *clientDataPtr) +} +declare 436 { + Tcl_Obj *Tcl_ListMathFuncs(Tcl_Interp *interp, const char *pattern) +} # TIP#36 (better access to 'subst') dkf declare 437 { @@ -1626,7 +1617,7 @@ declare 452 { int index, Tcl_Obj *pathPtr, Tcl_Obj *objPtr) } declare 453 { - const char *const *Tcl_FSFileAttrStrings(Tcl_Obj *pathPtr, + const char *CONST86 *Tcl_FSFileAttrStrings(Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef) } declare 454 { @@ -1704,7 +1695,7 @@ declare 476 { Tcl_Obj *pathPtr) } declare 477 { - const Tcl_Filesystem *Tcl_FSGetFileSystemForPath(Tcl_Obj *pathPtr) + CONST86 Tcl_Filesystem *Tcl_FSGetFileSystemForPath(Tcl_Obj *pathPtr) } declare 478 { Tcl_PathType Tcl_FSGetPathType(Tcl_Obj *pathPtr) @@ -2377,6 +2368,9 @@ declare 1 macosx { # Public functions that are not accessible via the stubs table. export { + void Tcl_Main(int argc, char **argv, Tcl_AppInitProc *appInitProc) +} +export { const char *Tcl_InitStubs(Tcl_Interp *interp, const char *version, int exact) } diff --git a/generic/tcl.h b/generic/tcl.h index e715da2..226ef72 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -53,13 +53,13 @@ extern "C" { * tools/tcl.hpj.in (not patchlevel, for windows installer) */ -#define TCL_MAJOR_VERSION 9 -#define TCL_MINOR_VERSION 0 -#define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE +#define TCL_MAJOR_VERSION 8 +#define TCL_MINOR_VERSION 6 +#define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE #define TCL_RELEASE_SERIAL 0 -#define TCL_VERSION "9.0" -#define TCL_PATCH_LEVEL "9.0a0" +#define TCL_VERSION "8.6" +#define TCL_PATCH_LEVEL "8.6.0" /* *---------------------------------------------------------------------------- @@ -90,6 +90,20 @@ extern "C" { #endif /* __WIN32__ */ /* + * Utility macros: STRINGIFY takes an argument and wraps it in "" (double + * quotation marks), JOIN joins two arguments. + */ + +#ifndef STRINGIFY +# define STRINGIFY(x) STRINGIFY1(x) +# define STRINGIFY1(x) #x +#endif +#ifndef JOIN +# define JOIN(a,b) JOIN1(a,b) +# define JOIN1(a,b) a##b +#endif + +/* * A special definition used to allow this header file to be included from * windows resource files so that they can obtain version information. * RC_INVOKED is defined by default by the windows RC tool. @@ -209,17 +223,108 @@ extern "C" { * be reset to DLLIMPORT. */ +#undef TCL_STORAGE_CLASS #ifdef BUILD_tcl -# define TCLAPI DLLEXPORT +# define TCL_STORAGE_CLASS DLLEXPORT +#else +# ifdef USE_TCL_STUBS +# define TCL_STORAGE_CLASS +# else +# define TCL_STORAGE_CLASS DLLIMPORT +# endif +#endif + +/* + * Definitions that allow this header file to be used either with or without + * ANSI C features. + */ + +#ifndef INLINE +# define INLINE +#endif + +#ifdef NO_CONST +# ifndef const +# define const +# endif +#endif +#ifndef CONST +# define CONST const +#endif + +#ifdef USE_NON_CONST +# ifdef USE_COMPAT_CONST +# error define at most one of USE_NON_CONST and USE_COMPAT_CONST +# endif +# define CONST84 +# define CONST84_RETURN #else -# define TCLAPI DLLIMPORT +# ifdef USE_COMPAT_CONST +# define CONST84 +# define CONST84_RETURN const +# else +# define CONST84 const +# define CONST84_RETURN const +# endif +#endif + +#ifndef CONST86 +# define CONST86 CONST84 +#endif + +/* + * Make sure EXTERN isn't defined elsewhere. + */ + +#ifdef EXTERN +# undef EXTERN +#endif /* EXTERN */ + +#ifdef __cplusplus +# define EXTERN extern "C" TCL_STORAGE_CLASS +#else +# define EXTERN extern TCL_STORAGE_CLASS +#endif + +/* + *---------------------------------------------------------------------------- + * The following code is copied from winnt.h. If we don't replicate it here, + * then can't be included after tcl.h, since tcl.h also defines + * VOID. This block is skipped under Cygwin and Mingw. + */ + +#if defined(__WIN32__) && !defined(HAVE_WINNT_IGNORE_VOID) +#ifndef VOID +#define VOID void +typedef char CHAR; +typedef short SHORT; +typedef long LONG; +#endif +#endif /* __WIN32__ && !HAVE_WINNT_IGNORE_VOID */ + +/* + * Macro to use instead of "void" for arguments that must have type "void *" + * in ANSI C; maps them to type "char *" in non-ANSI systems. + */ + +#ifndef NO_VOID +# define VOID void +#else +# define VOID char #endif /* * Miscellaneous declarations. */ -typedef void *ClientData; +#ifndef _CLIENTDATA +# ifndef NO_VOID + typedef void *ClientData; +# else + typedef int *ClientData; +# endif +# define _CLIENTDATA +#endif /* * Darwin specific configure overrides (to support fat compiles, where @@ -329,7 +434,7 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt; typedef struct _stat32i64 Tcl_StatBuf; # endif /* _MSC_VER < 1400 */ #elif defined(__CYGWIN__) - typedef struct { + typedef struct _stat32i64 { dev_t st_dev; unsigned short st_ino; unsigned short st_mode; @@ -513,6 +618,8 @@ typedef struct stat *Tcl_OldStat_; #define TCL_BREAK 3 #define TCL_CONTINUE 4 +#define TCL_RESULT_SIZE 200 + /* *---------------------------------------------------------------------------- * Flags to control what substitutions are performed by Tcl_SubstObj(): @@ -524,14 +631,28 @@ typedef struct stat *Tcl_OldStat_; #define TCL_SUBST_ALL 007 /* + * Argument descriptors for math function callbacks in expressions: + */ + +typedef enum { + TCL_INT, TCL_DOUBLE, TCL_EITHER, TCL_WIDE_INT +} Tcl_ValueType; + +typedef struct Tcl_Value { + Tcl_ValueType type; /* Indicates intValue or doubleValue is valid, + * or both. */ + long intValue; /* Integer value. */ + double doubleValue; /* Double-precision floating value. */ + Tcl_WideInt wideValue; /* Wide (min. 64-bit) integer value. */ +} Tcl_Value; + +/* * Forward declaration of Tcl_Obj to prevent an error when the forward * reference to Tcl_Obj is encountered in the function types declared below. */ struct Tcl_Obj; -typedef struct Tcl_Obj Tcl_Value; - /* *---------------------------------------------------------------------------- * Function types defined by Tcl: @@ -544,10 +665,10 @@ typedef void (Tcl_ChannelProc) (ClientData clientData, int mask); typedef void (Tcl_CloseProc) (ClientData data); typedef void (Tcl_CmdDeleteProc) (ClientData clientData); typedef int (Tcl_CmdProc) (ClientData clientData, Tcl_Interp *interp, - int argc, const char *argv[]); + int argc, CONST84 char *argv[]); typedef void (Tcl_CmdTraceProc) (ClientData clientData, Tcl_Interp *interp, int level, char *command, Tcl_CmdProc *proc, - ClientData cmdClientData, int argc, const char *argv[]); + ClientData cmdClientData, int argc, CONST84 char *argv[]); typedef int (Tcl_CmdObjTraceProc) (ClientData clientData, Tcl_Interp *interp, int level, const char *command, Tcl_Command commandInfo, int objc, struct Tcl_Obj *const *objv); @@ -570,6 +691,8 @@ typedef void (Tcl_FreeProc) (char *blockPtr); typedef void (Tcl_IdleProc) (ClientData clientData); typedef void (Tcl_InterpDeleteProc) (ClientData clientData, Tcl_Interp *interp); +typedef int (Tcl_MathProc) (ClientData clientData, Tcl_Interp *interp, + Tcl_Value *args, Tcl_Value *resultPtr); typedef void (Tcl_NamespaceDeleteProc) (ClientData clientData); typedef int (Tcl_ObjCmdProc) (ClientData clientData, Tcl_Interp *interp, int objc, struct Tcl_Obj *const *objv); @@ -582,7 +705,7 @@ typedef void (Tcl_TimerProc) (ClientData clientData); typedef int (Tcl_SetFromAnyProc) (Tcl_Interp *interp, struct Tcl_Obj *objPtr); typedef void (Tcl_UpdateStringProc) (struct Tcl_Obj *objPtr); typedef char * (Tcl_VarTraceProc) (ClientData clientData, Tcl_Interp *interp, - const char *part1, const char *part2, int flags); + CONST84 char *part1, CONST84 char *part2, int flags); typedef void (Tcl_CommandTraceProc) (ClientData clientData, Tcl_Interp *interp, const char *oldName, const char *newName, int flags); typedef void (Tcl_CreateFileHandlerProc) (int fd, int mask, Tcl_FileProc *proc, @@ -685,7 +808,13 @@ int Tcl_IsShared(Tcl_Obj *objPtr); */ typedef struct Tcl_SavedResult { + char *result; + Tcl_FreeProc *freeProc; Tcl_Obj *objResultPtr; + char *appendResult; + int appendAvl; + int appendUsed; + char resultSpace[TCL_RESULT_SIZE+1]; } Tcl_SavedResult; /* @@ -745,6 +874,7 @@ typedef struct Tcl_DString { #define Tcl_DStringLength(dsPtr) ((dsPtr)->length) #define Tcl_DStringValue(dsPtr) ((dsPtr)->string) +#define Tcl_DStringTrunc Tcl_DStringSetLength /* * Definitions for the maximum number of digits of precision that may be @@ -864,6 +994,13 @@ typedef struct Tcl_DString { #define TCL_ALLOW_INLINE_COMPILATION 0x20000 /* + * The TCL_PARSE_PART1 flag is deprecated and has no effect. The part1 is now + * always parsed whenever the part2 is NULL. (This is to avoid a common error + * when converting code to use the new object based APIs and forgetting to + * give the flag) + */ + +/* * Types for linked variables: */ @@ -1146,8 +1283,8 @@ typedef struct Tcl_Time { long usec; /* Microseconds. */ } Tcl_Time; -typedef void (Tcl_SetTimerProc) (const Tcl_Time *timePtr); -typedef int (Tcl_WaitForEventProc) (const Tcl_Time *timePtr); +typedef void (Tcl_SetTimerProc) (CONST86 Tcl_Time *timePtr); +typedef int (Tcl_WaitForEventProc) (CONST86 Tcl_Time *timePtr); /* * TIP #233 (Virtualized Time) @@ -1221,14 +1358,14 @@ typedef int (Tcl_DriverClose2Proc) (ClientData instanceData, typedef int (Tcl_DriverInputProc) (ClientData instanceData, char *buf, int toRead, int *errorCodePtr); typedef int (Tcl_DriverOutputProc) (ClientData instanceData, - const char *buf, int toWrite, int *errorCodePtr); + CONST84 char *buf, int toWrite, int *errorCodePtr); typedef int (Tcl_DriverSeekProc) (ClientData instanceData, long offset, int mode, int *errorCodePtr); typedef int (Tcl_DriverSetOptionProc) (ClientData instanceData, Tcl_Interp *interp, const char *optionName, const char *value); typedef int (Tcl_DriverGetOptionProc) (ClientData instanceData, - Tcl_Interp *interp, const char *optionName, + Tcl_Interp *interp, CONST84 char *optionName, Tcl_DString *dsPtr); typedef void (Tcl_DriverWatchProc) (ClientData instanceData, int mask); typedef int (Tcl_DriverGetHandleProc) (ClientData instanceData, @@ -1419,7 +1556,7 @@ typedef int (Tcl_FSNormalizePathProc) (Tcl_Interp *interp, Tcl_Obj *pathPtr, int nextCheckpoint); typedef int (Tcl_FSFileAttrsGetProc) (Tcl_Interp *interp, int index, Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef); -typedef const char *const * (Tcl_FSFileAttrStringsProc) (Tcl_Obj *pathPtr, +typedef const char *CONST86 * (Tcl_FSFileAttrStringsProc) (Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef); typedef int (Tcl_FSFileAttrsSetProc) (Tcl_Interp *interp, int index, Tcl_Obj *pathPtr, Tcl_Obj *objPtr); @@ -2109,6 +2246,9 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp, *---------------------------------------------------------------------------- * The following constant is used to test for older versions of Tcl in the * stubs tables. + * + * Jan Nijtman's plus patch uses 0xFCA1BACF, so we need to pick a different + * value since the stubs tables don't match. */ #define TCL_STUB_MAGIC ((int) 0xFCA3BACF) @@ -2120,8 +2260,8 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp, * main library in case an extension is statically linked into an application. */ -const char * TclInitStubs(Tcl_Interp *interp, const char *version, - int exact, const char *tclversion, int magic); +const char * Tcl_InitStubs(Tcl_Interp *interp, const char *version, + int exact); const char * TclTomMathInitializeStubs(Tcl_Interp *interp, const char *version, int epoch, int revision); @@ -2129,28 +2269,28 @@ const char * TclTomMathInitializeStubs(Tcl_Interp *interp, * When not using stubs, make it a macro. */ -#ifdef USE_TCL_STUBS -#define Tcl_InitStubs(interp, version, exact) \ - TclInitStubs(interp, version, exact, TCL_VERSION, TCL_STUB_MAGIC) -#else +#ifndef USE_TCL_STUBS #define Tcl_InitStubs(interp, version, exact) \ Tcl_PkgInitStubsCheck(interp, version, exact) #endif /* + * TODO - tommath stubs export goes here! + */ + +/* * Public functions that are not accessible via the stubs table. * Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171] */ #define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \ (Tcl_FindExecutable(argv[0]), (Tcl_CreateInterp)())) -TCLAPI void Tcl_FindExecutable(const char *argv0); -TCLAPI void Tcl_MainEx(int argc, char **argv, +EXTERN void Tcl_MainEx(int argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); -TCLAPI const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp, +EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp, const char *version, int exact); #if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) -TCLAPI void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); +EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); #endif /* @@ -2178,15 +2318,15 @@ TCLAPI void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); #ifdef TCL_MEM_DEBUG # define ckalloc(x) \ - ((void *) Tcl_DbCkalloc((unsigned)(x), __FILE__, __LINE__)) + ((VOID *) Tcl_DbCkalloc((unsigned)(x), __FILE__, __LINE__)) # define ckfree(x) \ Tcl_DbCkfree((char *)(x), __FILE__, __LINE__) # define ckrealloc(x,y) \ - ((void *) Tcl_DbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__)) + ((VOID *) Tcl_DbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__)) # define attemptckalloc(x) \ - ((void *) Tcl_AttemptDbCkalloc((unsigned)(x), __FILE__, __LINE__)) + ((VOID *) Tcl_AttemptDbCkalloc((unsigned)(x), __FILE__, __LINE__)) # define attemptckrealloc(x,y) \ - ((void *) Tcl_AttemptDbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__)) + ((VOID *) Tcl_AttemptDbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__)) #else /* !TCL_MEM_DEBUG */ @@ -2197,15 +2337,15 @@ TCLAPI void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); */ # define ckalloc(x) \ - ((void *) Tcl_Alloc((unsigned)(x))) + ((VOID *) Tcl_Alloc((unsigned)(x))) # define ckfree(x) \ Tcl_Free((char *)(x)) # define ckrealloc(x,y) \ - ((void *) Tcl_Realloc((char *)(x), (unsigned)(y))) + ((VOID *) Tcl_Realloc((char *)(x), (unsigned)(y))) # define attemptckalloc(x) \ - ((void *) Tcl_AttemptAlloc((unsigned)(x))) + ((VOID *) Tcl_AttemptAlloc((unsigned)(x))) # define attemptckrealloc(x,y) \ - ((void *) Tcl_AttemptRealloc((char *)(x), (unsigned)(y))) + ((VOID *) Tcl_AttemptRealloc((char *)(x), (unsigned)(y))) # undef Tcl_InitMemory # define Tcl_InitMemory(x) # undef Tcl_DumpActiveMemory @@ -2228,15 +2368,11 @@ TCLAPI void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); /* * Use do/while0 idiom for optimum correctness without compiler warnings. * http://c2.com/cgi/wiki?TrivialDoWhileLoop - * - * Decrement refCount AFTER checking it for 0 or 1 (<2), because - * we cannot assume anymore that refCount is a signed type; In - * Tcl8 it was but in Tcl9 it is subject to change. */ # define Tcl_DecrRefCount(objPtr) \ do { \ Tcl_Obj *_objPtr = (objPtr); \ - if (_objPtr->refCount-- < 2) { \ + if (--(_objPtr)->refCount <= 0) { \ TclFreeObj(_objPtr); \ } \ } while(0) @@ -2329,6 +2465,20 @@ TCLAPI void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); #define Tcl_ConditionFinalize(condPtr) #endif /* TCL_THREADS */ +/* + *---------------------------------------------------------------------------- + * Deprecated Tcl functions: + */ + +/* + *---------------------------------------------------------------------------- + * Convenience declaration of Tcl_AppInit for backwards compatibility. This + * function is not *implemented* by the tcl library, so the storage class is + * neither DLLEXPORT nor DLLIMPORT. + */ + +extern Tcl_AppInitProc Tcl_AppInit; + #endif /* RC_INVOKED */ /* diff --git a/generic/tclBasic.c b/generic/tclBasic.c index ae99835..aee0c99 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -38,6 +38,18 @@ #endif /* + * The following structure defines the client data for a math function + * registered with Tcl_CreateMathFunc + */ + +typedef struct OldMathFuncData { + Tcl_MathProc *proc; /* Handler function */ + int numArgs; /* Number of args expected */ + Tcl_ValueType *argTypes; /* Types of the args */ + ClientData clientData; /* Client data for the handler function */ +} OldMathFuncData; + +/* * This is the script cancellation struct and hash table. The hash table is * used to keep track of the information necessary to process script * cancellation requests, including the original interp, asynchronous handler @@ -121,6 +133,8 @@ static Tcl_NRPostProc NRStackBottom; #endif static Tcl_NRPostProc NRRunObjProc; +static Tcl_ObjCmdProc OldMathFuncProc; +static void OldMathFuncDeleteProc(ClientData clientData); static void ProcessUnexpectedResult(Tcl_Interp *interp, int returnCode); static int RewindCoroutine(CoroutineData *corPtr, int result); @@ -493,12 +507,9 @@ Tcl_CreateInterp(void) iPtr = ckalloc(sizeof(Interp)); interp = (Tcl_Interp *) iPtr; - iPtr->legacyResult = NULL; - /* Special invalid value: Any attempt to free the legacy result - * will cause a crash. */ - iPtr->legacyFreeProc = (void (*) (void))-1; + iPtr->result = iPtr->resultSpace; + iPtr->freeProc = NULL; iPtr->errorLine = 0; - iPtr->stubTable = &tclStubs; iPtr->objResultPtr = Tcl_NewObj(); Tcl_IncrRefCount(iPtr->objResultPtr); iPtr->handle = TclHandleCreate(iPtr); @@ -526,6 +537,10 @@ Tcl_CreateInterp(void) iPtr->rootFramePtr = NULL; /* Initialise as soon as :: is available */ iPtr->lookupNsPtr = NULL; + iPtr->appendResult = NULL; + iPtr->appendAvl = 0; + iPtr->appendUsed = 0; + Tcl_InitHashTable(&iPtr->packageTable, TCL_STRING_KEYS); iPtr->packageUnknown = NULL; @@ -553,6 +568,7 @@ Tcl_CreateInterp(void) iPtr->emptyObjPtr = Tcl_NewObj(); /* Another empty object. */ Tcl_IncrRefCount(iPtr->emptyObjPtr); + iPtr->resultSpace[0] = 0; iPtr->threadId = Tcl_GetCurrentThread(); /* TIP #378 */ @@ -664,6 +680,12 @@ Tcl_CreateInterp(void) #endif /* TCL_COMPILE_STATS */ /* + * Initialise the stub table pointer. + */ + + iPtr->stubTable = &tclStubs; + + /* * Initialize the ensemble error message rewriting support. */ @@ -1413,6 +1435,7 @@ DeleteInterpProc( */ Tcl_FreeResult(interp); + iPtr->result = NULL; Tcl_DecrRefCount(iPtr->objResultPtr); iPtr->objResultPtr = NULL; Tcl_DecrRefCount(iPtr->ecVar); @@ -1428,6 +1451,10 @@ DeleteInterpProc( if (iPtr->returnOpts) { Tcl_DecrRefCount(iPtr->returnOpts); } + if (iPtr->appendResult != NULL) { + ckfree(iPtr->appendResult); + iPtr->appendResult = NULL; + } TclFreePackageInfo(iPtr); while (iPtr->tracePtr != NULL) { Tcl_DeleteTrace((Tcl_Interp *) iPtr, (Tcl_Trace) iPtr->tracePtr); @@ -2214,7 +2241,7 @@ TclInvokeStringCommand( * in the Command structure. * * Results: - * A standard Tcl result value. + * A standard Tcl string result value. * * Side effects: * Besides those side effects of the called Tcl_CmdProc, @@ -2250,6 +2277,13 @@ TclInvokeObjectCommand( cmdPtr->objClientData, argc, objv); /* + * Move the interpreter's object result to the string result, then reset + * the object result. + */ + + (void) Tcl_GetStringResult(interp); + + /* * Decrement the ref counts for the argument objects created above, then * free the objv array if malloc'ed storage was used. */ @@ -3063,6 +3097,360 @@ TclCleanupCommand( /* *---------------------------------------------------------------------- * + * Tcl_CreateMathFunc -- + * + * Creates a new math function for expressions in a given interpreter. + * + * Results: + * None. + * + * Side effects: + * The Tcl function defined by "name" is created or redefined. If the + * function already exists then its definition is replaced; this includes + * the builtin functions. Redefining a builtin function forces all + * existing code to be invalidated since that code may be compiled using + * an instruction specific to the replaced function. In addition, + * redefioning a non-builtin function will force existing code to be + * invalidated if the number of arguments has changed. + * + *---------------------------------------------------------------------- + */ + +void +Tcl_CreateMathFunc( + Tcl_Interp *interp, /* Interpreter in which function is to be + * available. */ + const char *name, /* Name of function (e.g. "sin"). */ + int numArgs, /* Nnumber of arguments required by + * function. */ + Tcl_ValueType *argTypes, /* Array of types acceptable for each + * argument. */ + Tcl_MathProc *proc, /* C function that implements the math + * function. */ + ClientData clientData) /* Additional value to pass to the + * function. */ +{ + Tcl_DString bigName; + OldMathFuncData *data = ckalloc(sizeof(OldMathFuncData)); + + data->proc = proc; + data->numArgs = numArgs; + data->argTypes = ckalloc(numArgs * sizeof(Tcl_ValueType)); + memcpy(data->argTypes, argTypes, numArgs * sizeof(Tcl_ValueType)); + data->clientData = clientData; + + Tcl_DStringInit(&bigName); + TclDStringAppendLiteral(&bigName, "::tcl::mathfunc::"); + Tcl_DStringAppend(&bigName, name, -1); + + Tcl_CreateObjCommand(interp, Tcl_DStringValue(&bigName), + OldMathFuncProc, data, OldMathFuncDeleteProc); + Tcl_DStringFree(&bigName); +} + +/* + *---------------------------------------------------------------------- + * + * OldMathFuncProc -- + * + * Dispatch to a math function created with Tcl_CreateMathFunc + * + * Results: + * Returns a standard Tcl result. + * + * Side effects: + * Whatever the math function does. + * + *---------------------------------------------------------------------- + */ + +static int +OldMathFuncProc( + ClientData clientData, /* Ponter to OldMathFuncData describing the + * function being called */ + Tcl_Interp *interp, /* Tcl interpreter */ + int objc, /* Actual parameter count */ + Tcl_Obj *const *objv) /* Parameter vector */ +{ + Tcl_Obj *valuePtr; + OldMathFuncData *dataPtr = clientData; + Tcl_Value funcResult, *args; + int result; + int j, k; + double d; + + /* + * Check argument count. + */ + + if (objc != dataPtr->numArgs + 1) { + MathFuncWrongNumArgs(interp, dataPtr->numArgs+1, objc, objv); + return TCL_ERROR; + } + + /* + * Convert arguments from Tcl_Obj's to Tcl_Value's. + */ + + args = ckalloc(dataPtr->numArgs * sizeof(Tcl_Value)); + for (j = 1, k = 0; j < objc; ++j, ++k) { + /* TODO: Convert to TclGetNumberFromObj? */ + valuePtr = objv[j]; + result = Tcl_GetDoubleFromObj(NULL, valuePtr, &d); +#ifdef ACCEPT_NAN + if ((result != TCL_OK) && (valuePtr->typePtr == &tclDoubleType)) { + d = valuePtr->internalRep.doubleValue; + result = TCL_OK; + } +#endif + if (result != TCL_OK) { + /* + * We have a non-numeric argument. + */ + + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "argument to math function didn't have numeric value", + -1)); + TclCheckBadOctal(interp, Tcl_GetString(valuePtr)); + ckfree(args); + return TCL_ERROR; + } + + /* + * Copy the object's numeric value to the argument record, converting + * it if necessary. + * + * NOTE: no bignum support; use the new mathfunc interface for that. + */ + + args[k].type = dataPtr->argTypes[k]; + switch (args[k].type) { + case TCL_EITHER: + if (Tcl_GetLongFromObj(NULL, valuePtr, &args[k].intValue) + == TCL_OK) { + args[k].type = TCL_INT; + break; + } + if (Tcl_GetWideIntFromObj(interp, valuePtr, &args[k].wideValue) + == TCL_OK) { + args[k].type = TCL_WIDE_INT; + break; + } + args[k].type = TCL_DOUBLE; + /* FALLTHROUGH */ + + case TCL_DOUBLE: + args[k].doubleValue = d; + break; + case TCL_INT: + if (ExprIntFunc(NULL, interp, 2, &objv[j-1]) != TCL_OK) { + ckfree(args); + return TCL_ERROR; + } + valuePtr = Tcl_GetObjResult(interp); + Tcl_GetLongFromObj(NULL, valuePtr, &args[k].intValue); + Tcl_ResetResult(interp); + break; + case TCL_WIDE_INT: + if (ExprWideFunc(NULL, interp, 2, &objv[j-1]) != TCL_OK) { + ckfree(args); + return TCL_ERROR; + } + valuePtr = Tcl_GetObjResult(interp); + Tcl_GetWideIntFromObj(NULL, valuePtr, &args[k].wideValue); + Tcl_ResetResult(interp); + break; + } + } + + /* + * Call the function. + */ + + errno = 0; + result = dataPtr->proc(dataPtr->clientData, interp, args, &funcResult); + ckfree(args); + if (result != TCL_OK) { + return result; + } + + /* + * Return the result of the call. + */ + + if (funcResult.type == TCL_INT) { + TclNewLongObj(valuePtr, funcResult.intValue); + } else if (funcResult.type == TCL_WIDE_INT) { + valuePtr = Tcl_NewWideIntObj(funcResult.wideValue); + } else { + return CheckDoubleResult(interp, funcResult.doubleValue); + } + Tcl_SetObjResult(interp, valuePtr); + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * OldMathFuncDeleteProc -- + * + * Cleans up after deleting a math function registered with + * Tcl_CreateMathFunc + * + * Results: + * None. + * + * Side effects: + * Frees allocated memory. + * + *---------------------------------------------------------------------- + */ + +static void +OldMathFuncDeleteProc( + ClientData clientData) +{ + OldMathFuncData *dataPtr = clientData; + + ckfree(dataPtr->argTypes); + ckfree(dataPtr); +} + +/* + *---------------------------------------------------------------------- + * + * Tcl_GetMathFuncInfo -- + * + * Discovers how a particular math function was created in a given + * interpreter. + * + * Results: + * TCL_OK if it succeeds, TCL_ERROR else (leaving an error message in the + * interpreter result if that happens.) + * + * Side effects: + * If this function succeeds, the variables pointed to by the numArgsPtr + * and argTypePtr arguments will be updated to detail the arguments + * allowed by the function. The variable pointed to by the procPtr + * argument will be set to NULL if the function is a builtin function, + * and will be set to the address of the C function used to implement the + * math function otherwise (in which case the variable pointed to by the + * clientDataPtr argument will also be updated.) + * + *---------------------------------------------------------------------- + */ + +int +Tcl_GetMathFuncInfo( + Tcl_Interp *interp, + const char *name, + int *numArgsPtr, + Tcl_ValueType **argTypesPtr, + Tcl_MathProc **procPtr, + ClientData *clientDataPtr) +{ + Tcl_Obj *cmdNameObj; + Command *cmdPtr; + + /* + * Get the command that implements the math function. + */ + + TclNewLiteralStringObj(cmdNameObj, "tcl::mathfunc::"); + Tcl_AppendToObj(cmdNameObj, name, -1); + Tcl_IncrRefCount(cmdNameObj); + cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, cmdNameObj); + Tcl_DecrRefCount(cmdNameObj); + + /* + * Report unknown functions. + */ + + if (cmdPtr == NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "unknown math function \"%s\"", name)); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "MATHFUNC", name, NULL); + *numArgsPtr = -1; + *argTypesPtr = NULL; + *procPtr = NULL; + *clientDataPtr = NULL; + return TCL_ERROR; + } + + /* + * Retrieve function info for user defined functions; return dummy + * information for builtins. + */ + + if (cmdPtr->objProc == &OldMathFuncProc) { + OldMathFuncData *dataPtr = cmdPtr->clientData; + + *procPtr = dataPtr->proc; + *numArgsPtr = dataPtr->numArgs; + *argTypesPtr = dataPtr->argTypes; + *clientDataPtr = dataPtr->clientData; + } else { + *procPtr = NULL; + *numArgsPtr = -1; + *argTypesPtr = NULL; + *procPtr = NULL; + *clientDataPtr = NULL; + } + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * Tcl_ListMathFuncs -- + * + * Produces a list of all the math functions defined in a given + * interpreter. + * + * Results: + * A pointer to a Tcl_Obj structure with a reference count of zero, or + * NULL in the case of an error (in which case a suitable error message + * will be left in the interpreter result.) + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Tcl_Obj * +Tcl_ListMathFuncs( + Tcl_Interp *interp, + const char *pattern) +{ + Tcl_Obj *script = Tcl_NewStringObj("::info functions ", -1); + Tcl_Obj *result; + Tcl_InterpState state; + + if (pattern) { + Tcl_Obj *patternObj = Tcl_NewStringObj(pattern, -1); + Tcl_Obj *arg = Tcl_NewListObj(1, &patternObj); + + Tcl_AppendObjToObj(script, arg); + Tcl_DecrRefCount(arg); /* Should tear down patternObj too */ + } + + state = Tcl_SaveInterpState(interp, TCL_OK); + Tcl_IncrRefCount(script); + if (TCL_OK == Tcl_EvalObjEx(interp, script, 0)) { + result = Tcl_DuplicateObj(Tcl_GetObjResult(interp)); + } else { + result = Tcl_NewObj(); + } + Tcl_DecrRefCount(script); + Tcl_RestoreInterpState(interp, state); + + return result; +} + +/* + *---------------------------------------------------------------------- + * * TclInterpReady -- * * Check if an interpreter is ready to eval commands or scripts, i.e., if @@ -3073,7 +3461,7 @@ TclCleanupCommand( * otherwise. * * Side effects: - * The interpreter's result is cleared. + * The interpreters object and string results are cleared. * *---------------------------------------------------------------------- */ @@ -3085,8 +3473,8 @@ TclInterpReady( register Interp *iPtr = (Interp *) interp; /* - * Reset the interpreter's result and clear out any previous error - * information. + * Reset both the interpreter's string and object results and clear out + * any previous error information. */ Tcl_ResetResult(interp); @@ -4105,6 +4493,54 @@ Tcl_EvalTokensStandard( /* *---------------------------------------------------------------------- * + * Tcl_EvalTokens -- + * + * Given an array of tokens parsed from a Tcl command (e.g., the tokens + * that make up a word or the index for an array variable) this function + * evaluates the tokens and concatenates their values to form a single + * result value. + * + * Results: + * The return value is a pointer to a newly allocated Tcl_Obj containing + * the value of the array of tokens. The reference count of the returned + * object has been incremented. If an error occurs in evaluating the + * tokens then a NULL value is returned and an error message is left in + * interp's result. + * + * Side effects: + * A new object is allocated to hold the result. + * + *---------------------------------------------------------------------- + * + * This uses a non-standard return convention; its use is now deprecated. It + * is a wrapper for the new function Tcl_EvalTokensStandard, and is not used + * in the core any longer. It is only kept for backward compatibility. + */ + +Tcl_Obj * +Tcl_EvalTokens( + Tcl_Interp *interp, /* Interpreter in which to lookup variables, + * execute nested commands, and report + * errors. */ + Tcl_Token *tokenPtr, /* Pointer to first in an array of tokens to + * evaluate and concatenate. */ + int count) /* Number of tokens to consider at tokenPtr. + * Must be at least 1. */ +{ + Tcl_Obj *resPtr; + + if (Tcl_EvalTokensStandard(interp, tokenPtr, count) != TCL_OK) { + return NULL; + } + resPtr = Tcl_GetObjResult(interp); + Tcl_IncrRefCount(resPtr); + Tcl_ResetResult(interp); + return resPtr; +} + +/* + *---------------------------------------------------------------------- + * * Tcl_EvalEx, TclEvalEx -- * * This function evaluates a Tcl script without using the compiler or @@ -4415,7 +4851,16 @@ Tcl_Eval( * previous call to Tcl_CreateInterp). */ const char *script) /* Pointer to TCL command to execute. */ { - return Tcl_EvalEx(interp, script, -1, 0); + int code = Tcl_EvalEx(interp, script, -1, 0); + + /* + * For backwards compatibility with old C code that predates the object + * system in Tcl 8.0, we have to mirror the object result back into the + * string result (some callers may expect it there). + */ + + (void) Tcl_GetStringResult(interp); + return code; } /* @@ -4685,6 +5130,9 @@ Tcl_ExprLong( Tcl_IncrRefCount(exprPtr); result = Tcl_ExprLongObj(interp, exprPtr, ptr); Tcl_DecrRefCount(exprPtr); + if (result != TCL_OK) { + (void) Tcl_GetStringResult(interp); + } } return result; } @@ -4711,6 +5159,9 @@ Tcl_ExprDouble( result = Tcl_ExprDoubleObj(interp, exprPtr, ptr); Tcl_DecrRefCount(exprPtr); /* Discard the expression object. */ + if (result != TCL_OK) { + (void) Tcl_GetStringResult(interp); + } } return result; } @@ -4736,6 +5187,14 @@ Tcl_ExprBoolean( Tcl_IncrRefCount(exprPtr); result = Tcl_ExprBooleanObj(interp, exprPtr, ptr); Tcl_DecrRefCount(exprPtr); + if (result != TCL_OK) { + /* + * Move the interpreter's object result to the string result, then + * reset the object result. + */ + + (void) Tcl_GetStringResult(interp); + } return result; } } @@ -5057,6 +5516,12 @@ Tcl_ExprString( Tcl_DecrRefCount(resultPtr); } } + + /* + * Force the string rep of the interp result. + */ + + (void) Tcl_GetStringResult(interp); return code; } @@ -5160,7 +5625,19 @@ Tcl_AddObjErrorInfo( iPtr->flags |= ERR_LEGACY_COPY; if (iPtr->errorInfo == NULL) { - iPtr->errorInfo = iPtr->objResultPtr; + if (iPtr->result[0] != 0) { + /* + * The interp's string result is set, apparently by some extension + * making a deprecated direct write to it. That extension may + * expect interp->result to continue to be set, so we'll take + * special pains to avoid clearing it, until we drop support for + * interp->result completely. + */ + + iPtr->errorInfo = Tcl_NewStringObj(iPtr->result, -1); + } else { + iPtr->errorInfo = iPtr->objResultPtr; + } Tcl_IncrRefCount(iPtr->errorInfo); if (!iPtr->errorCode) { Tcl_SetErrorCode(interp, "NONE", NULL); @@ -5182,6 +5659,122 @@ 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 interp->result. + * + * 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_GlobalEval -- + * + * Evaluate a command at global level in an interpreter. + * + * Results: + * A standard Tcl result is returned, and the interp's result is modified + * accordingly. + * + * Side effects: + * The command string is executed in interp, and the execution is carried + * out in the variable context of global level (no functions active), + * just as if an "uplevel #0" command were being executed. + * + *---------------------------------------------------------------------- + */ + +int +Tcl_GlobalEval( + Tcl_Interp *interp, /* Interpreter in which to evaluate + * command. */ + const char *command) /* Command to evaluate. */ +{ + register Interp *iPtr = (Interp *) interp; + int result; + CallFrame *savedVarFramePtr; + + savedVarFramePtr = iPtr->varFramePtr; + iPtr->varFramePtr = iPtr->rootFramePtr; + result = Tcl_Eval(interp, command); + iPtr->varFramePtr = savedVarFramePtr; + return result; +} + +/* *---------------------------------------------------------------------- * * Tcl_SetRecursionLimit -- diff --git a/generic/tclBinary.c b/generic/tclBinary.c index a504f79..3f0f246 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -191,7 +191,7 @@ const Tcl_ObjType tclByteArrayType = { * fewer mallocs. */ -typedef struct { +typedef struct ByteArray { int used; /* The number of bytes used in the byte * array. */ int allocated; /* The amount of space actually allocated diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index 2fdba67..2973678 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -33,7 +33,7 @@ * "memory tag" command is invoked, to hold the current tag. */ -typedef struct { +typedef struct MemTag { int refCount; /* Number of mem_headers referencing this * tag. */ char string[1]; /* Actual size of string will be as large as diff --git a/generic/tclClock.c b/generic/tclClock.c index 1257231..6d2976d 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -91,7 +91,7 @@ static const char *const literals[] = { * Structure containing the client data for [clock] */ -typedef struct { +typedef struct ClockClientData { int refCount; /* Number of live references. */ Tcl_Obj **literals; /* Pool of object literals. */ } ClockClientData; @@ -100,7 +100,7 @@ typedef struct { * Structure containing the fields used in [clock format] and [clock scan] */ -typedef struct { +typedef struct TclDateFields { Tcl_WideInt seconds; /* Time expressed in seconds from the Posix * epoch */ Tcl_WideInt localSeconds; /* Local time expressed in nominal seconds diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index e3f93bf..2c41ada 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -56,7 +56,7 @@ typedef int (*SortMemCmpFn_t) (const void *, const void *, size_t); * The following structure is used to pass this information. */ -typedef struct { +typedef struct SortInfo { int isIncreasing; /* Nonzero means sort in increasing order. */ int sortMode; /* The sort mode. One of SORTMODE_* values * defined below. */ diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 976346f..d93cd77 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -22,7 +22,7 @@ * The tree is composed of OpNodes. */ -typedef struct { +typedef struct OpNode { int left; /* "Pointer" to the left operand. */ int right; /* "Pointer" to the right operand. */ union { diff --git a/generic/tclCompile.h b/generic/tclCompile.h index a2de831..cedd638 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -80,7 +80,7 @@ typedef enum { * to a catch PC offset. */ } ExceptionRangeType; -typedef struct { +typedef struct ExceptionRange { ExceptionRangeType type; /* The kind of ExceptionRange. */ int nestingLevel; /* Static depth of the exception range. Used * to find the most deeply-nested range @@ -107,7 +107,7 @@ typedef struct { * source offset is not monotonic. */ -typedef struct { +typedef struct CmdLocation { int codeOffset; /* Offset of first byte of command code. */ int numCodeBytes; /* Number of bytes for command's code. */ int srcOffset; /* Offset of first char of the command. */ diff --git a/generic/tclConfig.c b/generic/tclConfig.c index fe99bbb..a4ba71a 100644 --- a/generic/tclConfig.c +++ b/generic/tclConfig.c @@ -31,7 +31,7 @@ * and the (Tcl_Interp *) in which it is stored. */ -typedef struct { +typedef struct QCCD { Tcl_Obj *pkg; Tcl_Interp *interp; } QCCD; diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 4393157..53dae93 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -12,6 +12,17 @@ #ifndef _TCLDECLS #define _TCLDECLS +#undef TCL_STORAGE_CLASS +#ifdef BUILD_tcl +# define TCL_STORAGE_CLASS DLLEXPORT +#else +# ifdef USE_TCL_STUBS +# define TCL_STORAGE_CLASS +# else +# define TCL_STORAGE_CLASS DLLIMPORT +# endif +#endif + /* * WARNING: This file is automatically generated by the tools/genStubs.tcl * script. Any modifications to the function declarations below should be made @@ -25,1730 +36,1762 @@ */ /* 0 */ -TCLAPI int Tcl_PkgProvideEx(Tcl_Interp *interp, +EXTERN int Tcl_PkgProvideEx(Tcl_Interp *interp, const char *name, const char *version, const void *clientData); /* 1 */ -TCLAPI const char * Tcl_PkgRequireEx(Tcl_Interp *interp, +EXTERN CONST84_RETURN char * Tcl_PkgRequireEx(Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr); /* 2 */ -TCLAPI void Tcl_Panic(const char *format, ...) TCL_FORMAT_PRINTF(1, 2); +EXTERN void Tcl_Panic(const char *format, ...) TCL_FORMAT_PRINTF(1, 2); /* 3 */ -TCLAPI char * Tcl_Alloc(unsigned int size); +EXTERN char * Tcl_Alloc(unsigned int size); /* 4 */ -TCLAPI void Tcl_Free(char *ptr); +EXTERN void Tcl_Free(char *ptr); /* 5 */ -TCLAPI char * Tcl_Realloc(char *ptr, unsigned int size); +EXTERN char * Tcl_Realloc(char *ptr, unsigned int size); /* 6 */ -TCLAPI char * Tcl_DbCkalloc(unsigned int size, const char *file, +EXTERN char * Tcl_DbCkalloc(unsigned int size, const char *file, int line); /* 7 */ -TCLAPI void Tcl_DbCkfree(char *ptr, const char *file, int line); +EXTERN void Tcl_DbCkfree(char *ptr, const char *file, int line); /* 8 */ -TCLAPI char * Tcl_DbCkrealloc(char *ptr, unsigned int size, +EXTERN char * Tcl_DbCkrealloc(char *ptr, unsigned int size, const char *file, int line); #if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ /* 9 */ -TCLAPI void Tcl_CreateFileHandler(int fd, int mask, +EXTERN void Tcl_CreateFileHandler(int fd, int mask, Tcl_FileProc *proc, ClientData clientData); #endif /* UNIX */ #ifdef MAC_OSX_TCL /* MACOSX */ /* 9 */ -TCLAPI void Tcl_CreateFileHandler(int fd, int mask, +EXTERN void Tcl_CreateFileHandler(int fd, int mask, Tcl_FileProc *proc, ClientData clientData); #endif /* MACOSX */ #if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ /* 10 */ -TCLAPI void Tcl_DeleteFileHandler(int fd); +EXTERN void Tcl_DeleteFileHandler(int fd); #endif /* UNIX */ #ifdef MAC_OSX_TCL /* MACOSX */ /* 10 */ -TCLAPI void Tcl_DeleteFileHandler(int fd); +EXTERN void Tcl_DeleteFileHandler(int fd); #endif /* MACOSX */ /* 11 */ -TCLAPI void Tcl_SetTimer(const Tcl_Time *timePtr); +EXTERN void Tcl_SetTimer(const Tcl_Time *timePtr); /* 12 */ -TCLAPI void Tcl_Sleep(int ms); +EXTERN void Tcl_Sleep(int ms); /* 13 */ -TCLAPI int Tcl_WaitForEvent(const Tcl_Time *timePtr); +EXTERN int Tcl_WaitForEvent(const Tcl_Time *timePtr); /* 14 */ -TCLAPI int Tcl_AppendAllObjTypes(Tcl_Interp *interp, +EXTERN int Tcl_AppendAllObjTypes(Tcl_Interp *interp, Tcl_Obj *objPtr); /* 15 */ -TCLAPI void Tcl_AppendStringsToObj(Tcl_Obj *objPtr, ...); +EXTERN void Tcl_AppendStringsToObj(Tcl_Obj *objPtr, ...); /* 16 */ -TCLAPI void Tcl_AppendToObj(Tcl_Obj *objPtr, const char *bytes, +EXTERN void Tcl_AppendToObj(Tcl_Obj *objPtr, const char *bytes, int length); /* 17 */ -TCLAPI Tcl_Obj * Tcl_ConcatObj(int objc, Tcl_Obj *const objv[]); +EXTERN Tcl_Obj * Tcl_ConcatObj(int objc, Tcl_Obj *const objv[]); /* 18 */ -TCLAPI int Tcl_ConvertToType(Tcl_Interp *interp, +EXTERN int Tcl_ConvertToType(Tcl_Interp *interp, Tcl_Obj *objPtr, const Tcl_ObjType *typePtr); /* 19 */ -TCLAPI void Tcl_DbDecrRefCount(Tcl_Obj *objPtr, const char *file, +EXTERN void Tcl_DbDecrRefCount(Tcl_Obj *objPtr, const char *file, int line); /* 20 */ -TCLAPI void Tcl_DbIncrRefCount(Tcl_Obj *objPtr, const char *file, +EXTERN void Tcl_DbIncrRefCount(Tcl_Obj *objPtr, const char *file, int line); /* 21 */ -TCLAPI int Tcl_DbIsShared(Tcl_Obj *objPtr, const char *file, +EXTERN int Tcl_DbIsShared(Tcl_Obj *objPtr, const char *file, int line); /* 22 */ -TCLAPI Tcl_Obj * Tcl_DbNewBooleanObj(int boolValue, const char *file, +EXTERN Tcl_Obj * Tcl_DbNewBooleanObj(int boolValue, const char *file, int line); /* 23 */ -TCLAPI Tcl_Obj * Tcl_DbNewByteArrayObj(const unsigned char *bytes, +EXTERN Tcl_Obj * Tcl_DbNewByteArrayObj(const unsigned char *bytes, int length, const char *file, int line); /* 24 */ -TCLAPI Tcl_Obj * Tcl_DbNewDoubleObj(double doubleValue, +EXTERN Tcl_Obj * Tcl_DbNewDoubleObj(double doubleValue, const char *file, int line); /* 25 */ -TCLAPI Tcl_Obj * Tcl_DbNewListObj(int objc, Tcl_Obj *const *objv, +EXTERN Tcl_Obj * Tcl_DbNewListObj(int objc, Tcl_Obj *const *objv, const char *file, int line); /* 26 */ -TCLAPI Tcl_Obj * Tcl_DbNewLongObj(long longValue, const char *file, +EXTERN Tcl_Obj * Tcl_DbNewLongObj(long longValue, const char *file, int line); /* 27 */ -TCLAPI Tcl_Obj * Tcl_DbNewObj(const char *file, int line); +EXTERN Tcl_Obj * Tcl_DbNewObj(const char *file, int line); /* 28 */ -TCLAPI Tcl_Obj * Tcl_DbNewStringObj(const char *bytes, int length, +EXTERN Tcl_Obj * Tcl_DbNewStringObj(const char *bytes, int length, const char *file, int line); /* 29 */ -TCLAPI Tcl_Obj * Tcl_DuplicateObj(Tcl_Obj *objPtr); +EXTERN Tcl_Obj * Tcl_DuplicateObj(Tcl_Obj *objPtr); /* 30 */ -TCLAPI void TclFreeObj(Tcl_Obj *objPtr); +EXTERN void TclFreeObj(Tcl_Obj *objPtr); /* 31 */ -TCLAPI int Tcl_GetBoolean(Tcl_Interp *interp, const char *src, +EXTERN int Tcl_GetBoolean(Tcl_Interp *interp, const char *src, int *boolPtr); /* 32 */ -TCLAPI int Tcl_GetBooleanFromObj(Tcl_Interp *interp, +EXTERN int Tcl_GetBooleanFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *boolPtr); /* 33 */ -TCLAPI unsigned char * Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, +EXTERN unsigned char * Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, int *lengthPtr); /* 34 */ -TCLAPI int Tcl_GetDouble(Tcl_Interp *interp, const char *src, +EXTERN int Tcl_GetDouble(Tcl_Interp *interp, const char *src, double *doublePtr); /* 35 */ -TCLAPI int Tcl_GetDoubleFromObj(Tcl_Interp *interp, +EXTERN int Tcl_GetDoubleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, double *doublePtr); /* 36 */ -TCLAPI int Tcl_GetIndexFromObj(Tcl_Interp *interp, - Tcl_Obj *objPtr, const char *const *tablePtr, +EXTERN int Tcl_GetIndexFromObj(Tcl_Interp *interp, + Tcl_Obj *objPtr, + CONST84 char *const *tablePtr, const char *msg, int flags, int *indexPtr); /* 37 */ -TCLAPI int Tcl_GetInt(Tcl_Interp *interp, const char *src, +EXTERN int Tcl_GetInt(Tcl_Interp *interp, const char *src, int *intPtr); /* 38 */ -TCLAPI int Tcl_GetIntFromObj(Tcl_Interp *interp, +EXTERN int Tcl_GetIntFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *intPtr); /* 39 */ -TCLAPI int Tcl_GetLongFromObj(Tcl_Interp *interp, +EXTERN int Tcl_GetLongFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, long *longPtr); /* 40 */ -TCLAPI const Tcl_ObjType * Tcl_GetObjType(const char *typeName); +EXTERN CONST86 Tcl_ObjType * Tcl_GetObjType(const char *typeName); /* 41 */ -TCLAPI char * Tcl_GetStringFromObj(Tcl_Obj *objPtr, int *lengthPtr); +EXTERN char * Tcl_GetStringFromObj(Tcl_Obj *objPtr, int *lengthPtr); /* 42 */ -TCLAPI void Tcl_InvalidateStringRep(Tcl_Obj *objPtr); +EXTERN void Tcl_InvalidateStringRep(Tcl_Obj *objPtr); /* 43 */ -TCLAPI int Tcl_ListObjAppendList(Tcl_Interp *interp, +EXTERN int Tcl_ListObjAppendList(Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *elemListPtr); /* 44 */ -TCLAPI int Tcl_ListObjAppendElement(Tcl_Interp *interp, +EXTERN int Tcl_ListObjAppendElement(Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *objPtr); /* 45 */ -TCLAPI int Tcl_ListObjGetElements(Tcl_Interp *interp, +EXTERN int Tcl_ListObjGetElements(Tcl_Interp *interp, Tcl_Obj *listPtr, int *objcPtr, Tcl_Obj ***objvPtr); /* 46 */ -TCLAPI int Tcl_ListObjIndex(Tcl_Interp *interp, +EXTERN int Tcl_ListObjIndex(Tcl_Interp *interp, Tcl_Obj *listPtr, int index, Tcl_Obj **objPtrPtr); /* 47 */ -TCLAPI int Tcl_ListObjLength(Tcl_Interp *interp, +EXTERN int Tcl_ListObjLength(Tcl_Interp *interp, Tcl_Obj *listPtr, int *lengthPtr); /* 48 */ -TCLAPI int Tcl_ListObjReplace(Tcl_Interp *interp, +EXTERN int Tcl_ListObjReplace(Tcl_Interp *interp, Tcl_Obj *listPtr, int first, int count, int objc, Tcl_Obj *const objv[]); /* 49 */ -TCLAPI Tcl_Obj * Tcl_NewBooleanObj(int boolValue); +EXTERN Tcl_Obj * Tcl_NewBooleanObj(int boolValue); /* 50 */ -TCLAPI Tcl_Obj * Tcl_NewByteArrayObj(const unsigned char *bytes, +EXTERN Tcl_Obj * Tcl_NewByteArrayObj(const unsigned char *bytes, int length); /* 51 */ -TCLAPI Tcl_Obj * Tcl_NewDoubleObj(double doubleValue); +EXTERN Tcl_Obj * Tcl_NewDoubleObj(double doubleValue); /* 52 */ -TCLAPI Tcl_Obj * Tcl_NewIntObj(int intValue); +EXTERN Tcl_Obj * Tcl_NewIntObj(int intValue); /* 53 */ -TCLAPI Tcl_Obj * Tcl_NewListObj(int objc, Tcl_Obj *const objv[]); +EXTERN Tcl_Obj * Tcl_NewListObj(int objc, Tcl_Obj *const objv[]); /* 54 */ -TCLAPI Tcl_Obj * Tcl_NewLongObj(long longValue); +EXTERN Tcl_Obj * Tcl_NewLongObj(long longValue); /* 55 */ -TCLAPI Tcl_Obj * Tcl_NewObj(void); +EXTERN Tcl_Obj * Tcl_NewObj(void); /* 56 */ -TCLAPI Tcl_Obj * Tcl_NewStringObj(const char *bytes, int length); +EXTERN Tcl_Obj * Tcl_NewStringObj(const char *bytes, int length); /* 57 */ -TCLAPI void Tcl_SetBooleanObj(Tcl_Obj *objPtr, int boolValue); +EXTERN void Tcl_SetBooleanObj(Tcl_Obj *objPtr, int boolValue); /* 58 */ -TCLAPI unsigned char * Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int length); +EXTERN unsigned char * Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int length); /* 59 */ -TCLAPI void Tcl_SetByteArrayObj(Tcl_Obj *objPtr, +EXTERN void Tcl_SetByteArrayObj(Tcl_Obj *objPtr, const unsigned char *bytes, int length); /* 60 */ -TCLAPI void Tcl_SetDoubleObj(Tcl_Obj *objPtr, double doubleValue); +EXTERN void Tcl_SetDoubleObj(Tcl_Obj *objPtr, double doubleValue); /* 61 */ -TCLAPI void Tcl_SetIntObj(Tcl_Obj *objPtr, int intValue); +EXTERN void Tcl_SetIntObj(Tcl_Obj *objPtr, int intValue); /* 62 */ -TCLAPI void Tcl_SetListObj(Tcl_Obj *objPtr, int objc, +EXTERN void Tcl_SetListObj(Tcl_Obj *objPtr, int objc, Tcl_Obj *const objv[]); /* 63 */ -TCLAPI void Tcl_SetLongObj(Tcl_Obj *objPtr, long longValue); +EXTERN void Tcl_SetLongObj(Tcl_Obj *objPtr, long longValue); /* 64 */ -TCLAPI void Tcl_SetObjLength(Tcl_Obj *objPtr, int length); +EXTERN void Tcl_SetObjLength(Tcl_Obj *objPtr, int length); /* 65 */ -TCLAPI void Tcl_SetStringObj(Tcl_Obj *objPtr, const char *bytes, +EXTERN void Tcl_SetStringObj(Tcl_Obj *objPtr, const char *bytes, int length); /* 66 */ -TCLAPI void Tcl_AddErrorInfo(Tcl_Interp *interp, +EXTERN void Tcl_AddErrorInfo(Tcl_Interp *interp, const char *message); /* 67 */ -TCLAPI void Tcl_AddObjErrorInfo(Tcl_Interp *interp, +EXTERN void Tcl_AddObjErrorInfo(Tcl_Interp *interp, const char *message, int length); /* 68 */ -TCLAPI void Tcl_AllowExceptions(Tcl_Interp *interp); +EXTERN void Tcl_AllowExceptions(Tcl_Interp *interp); /* 69 */ -TCLAPI void Tcl_AppendElement(Tcl_Interp *interp, +EXTERN void Tcl_AppendElement(Tcl_Interp *interp, const char *element); /* 70 */ -TCLAPI void Tcl_AppendResult(Tcl_Interp *interp, ...); +EXTERN void Tcl_AppendResult(Tcl_Interp *interp, ...); /* 71 */ -TCLAPI Tcl_AsyncHandler Tcl_AsyncCreate(Tcl_AsyncProc *proc, +EXTERN Tcl_AsyncHandler Tcl_AsyncCreate(Tcl_AsyncProc *proc, ClientData clientData); /* 72 */ -TCLAPI void Tcl_AsyncDelete(Tcl_AsyncHandler async); +EXTERN void Tcl_AsyncDelete(Tcl_AsyncHandler async); /* 73 */ -TCLAPI int Tcl_AsyncInvoke(Tcl_Interp *interp, int code); +EXTERN int Tcl_AsyncInvoke(Tcl_Interp *interp, int code); /* 74 */ -TCLAPI void Tcl_AsyncMark(Tcl_AsyncHandler async); +EXTERN void Tcl_AsyncMark(Tcl_AsyncHandler async); /* 75 */ -TCLAPI int Tcl_AsyncReady(void); +EXTERN int Tcl_AsyncReady(void); /* 76 */ -TCLAPI void Tcl_BackgroundError(Tcl_Interp *interp); -/* Slot 77 is reserved */ +EXTERN void Tcl_BackgroundError(Tcl_Interp *interp); +/* 77 */ +EXTERN char Tcl_Backslash(const char *src, int *readPtr); /* 78 */ -TCLAPI int Tcl_BadChannelOption(Tcl_Interp *interp, +EXTERN int Tcl_BadChannelOption(Tcl_Interp *interp, const char *optionName, const char *optionList); /* 79 */ -TCLAPI void Tcl_CallWhenDeleted(Tcl_Interp *interp, +EXTERN void Tcl_CallWhenDeleted(Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, ClientData clientData); /* 80 */ -TCLAPI void Tcl_CancelIdleCall(Tcl_IdleProc *idleProc, +EXTERN void Tcl_CancelIdleCall(Tcl_IdleProc *idleProc, ClientData clientData); /* 81 */ -TCLAPI int Tcl_Close(Tcl_Interp *interp, Tcl_Channel chan); +EXTERN int Tcl_Close(Tcl_Interp *interp, Tcl_Channel chan); /* 82 */ -TCLAPI int Tcl_CommandComplete(const char *cmd); +EXTERN int Tcl_CommandComplete(const char *cmd); /* 83 */ -TCLAPI char * Tcl_Concat(int argc, const char *const *argv); +EXTERN char * Tcl_Concat(int argc, CONST84 char *const *argv); /* 84 */ -TCLAPI int Tcl_ConvertElement(const char *src, char *dst, +EXTERN int Tcl_ConvertElement(const char *src, char *dst, int flags); /* 85 */ -TCLAPI int Tcl_ConvertCountedElement(const char *src, +EXTERN int Tcl_ConvertCountedElement(const char *src, int length, char *dst, int flags); /* 86 */ -TCLAPI int Tcl_CreateAlias(Tcl_Interp *slave, +EXTERN int Tcl_CreateAlias(Tcl_Interp *slave, const char *slaveCmd, Tcl_Interp *target, const char *targetCmd, int argc, - const char *const *argv); + CONST84 char *const *argv); /* 87 */ -TCLAPI int Tcl_CreateAliasObj(Tcl_Interp *slave, +EXTERN int Tcl_CreateAliasObj(Tcl_Interp *slave, const char *slaveCmd, Tcl_Interp *target, const char *targetCmd, int objc, Tcl_Obj *const objv[]); /* 88 */ -TCLAPI Tcl_Channel Tcl_CreateChannel(const Tcl_ChannelType *typePtr, +EXTERN Tcl_Channel Tcl_CreateChannel(const Tcl_ChannelType *typePtr, const char *chanName, ClientData instanceData, int mask); /* 89 */ -TCLAPI void Tcl_CreateChannelHandler(Tcl_Channel chan, int mask, +EXTERN void Tcl_CreateChannelHandler(Tcl_Channel chan, int mask, Tcl_ChannelProc *proc, ClientData clientData); /* 90 */ -TCLAPI void Tcl_CreateCloseHandler(Tcl_Channel chan, +EXTERN void Tcl_CreateCloseHandler(Tcl_Channel chan, Tcl_CloseProc *proc, ClientData clientData); /* 91 */ -TCLAPI Tcl_Command Tcl_CreateCommand(Tcl_Interp *interp, +EXTERN Tcl_Command Tcl_CreateCommand(Tcl_Interp *interp, const char *cmdName, Tcl_CmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc); /* 92 */ -TCLAPI void Tcl_CreateEventSource(Tcl_EventSetupProc *setupProc, +EXTERN void Tcl_CreateEventSource(Tcl_EventSetupProc *setupProc, Tcl_EventCheckProc *checkProc, ClientData clientData); /* 93 */ -TCLAPI void Tcl_CreateExitHandler(Tcl_ExitProc *proc, +EXTERN void Tcl_CreateExitHandler(Tcl_ExitProc *proc, ClientData clientData); /* 94 */ -TCLAPI Tcl_Interp * Tcl_CreateInterp(void); -/* Slot 95 is reserved */ +EXTERN Tcl_Interp * Tcl_CreateInterp(void); +/* 95 */ +EXTERN void Tcl_CreateMathFunc(Tcl_Interp *interp, + const char *name, int numArgs, + Tcl_ValueType *argTypes, Tcl_MathProc *proc, + ClientData clientData); /* 96 */ -TCLAPI Tcl_Command Tcl_CreateObjCommand(Tcl_Interp *interp, +EXTERN Tcl_Command Tcl_CreateObjCommand(Tcl_Interp *interp, const char *cmdName, Tcl_ObjCmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc); /* 97 */ -TCLAPI Tcl_Interp * Tcl_CreateSlave(Tcl_Interp *interp, +EXTERN Tcl_Interp * Tcl_CreateSlave(Tcl_Interp *interp, const char *slaveName, int isSafe); /* 98 */ -TCLAPI Tcl_TimerToken Tcl_CreateTimerHandler(int milliseconds, +EXTERN Tcl_TimerToken Tcl_CreateTimerHandler(int milliseconds, Tcl_TimerProc *proc, ClientData clientData); /* 99 */ -TCLAPI Tcl_Trace Tcl_CreateTrace(Tcl_Interp *interp, int level, +EXTERN Tcl_Trace Tcl_CreateTrace(Tcl_Interp *interp, int level, Tcl_CmdTraceProc *proc, ClientData clientData); /* 100 */ -TCLAPI void Tcl_DeleteAssocData(Tcl_Interp *interp, +EXTERN void Tcl_DeleteAssocData(Tcl_Interp *interp, const char *name); /* 101 */ -TCLAPI void Tcl_DeleteChannelHandler(Tcl_Channel chan, +EXTERN void Tcl_DeleteChannelHandler(Tcl_Channel chan, Tcl_ChannelProc *proc, ClientData clientData); /* 102 */ -TCLAPI void Tcl_DeleteCloseHandler(Tcl_Channel chan, +EXTERN void Tcl_DeleteCloseHandler(Tcl_Channel chan, Tcl_CloseProc *proc, ClientData clientData); /* 103 */ -TCLAPI int Tcl_DeleteCommand(Tcl_Interp *interp, +EXTERN int Tcl_DeleteCommand(Tcl_Interp *interp, const char *cmdName); /* 104 */ -TCLAPI int Tcl_DeleteCommandFromToken(Tcl_Interp *interp, +EXTERN int Tcl_DeleteCommandFromToken(Tcl_Interp *interp, Tcl_Command command); /* 105 */ -TCLAPI void Tcl_DeleteEvents(Tcl_EventDeleteProc *proc, +EXTERN void Tcl_DeleteEvents(Tcl_EventDeleteProc *proc, ClientData clientData); /* 106 */ -TCLAPI void Tcl_DeleteEventSource(Tcl_EventSetupProc *setupProc, +EXTERN void Tcl_DeleteEventSource(Tcl_EventSetupProc *setupProc, Tcl_EventCheckProc *checkProc, ClientData clientData); /* 107 */ -TCLAPI void Tcl_DeleteExitHandler(Tcl_ExitProc *proc, +EXTERN void Tcl_DeleteExitHandler(Tcl_ExitProc *proc, ClientData clientData); /* 108 */ -TCLAPI void Tcl_DeleteHashEntry(Tcl_HashEntry *entryPtr); +EXTERN void Tcl_DeleteHashEntry(Tcl_HashEntry *entryPtr); /* 109 */ -TCLAPI void Tcl_DeleteHashTable(Tcl_HashTable *tablePtr); +EXTERN void Tcl_DeleteHashTable(Tcl_HashTable *tablePtr); /* 110 */ -TCLAPI void Tcl_DeleteInterp(Tcl_Interp *interp); +EXTERN void Tcl_DeleteInterp(Tcl_Interp *interp); /* 111 */ -TCLAPI void Tcl_DetachPids(int numPids, Tcl_Pid *pidPtr); +EXTERN void Tcl_DetachPids(int numPids, Tcl_Pid *pidPtr); /* 112 */ -TCLAPI void Tcl_DeleteTimerHandler(Tcl_TimerToken token); +EXTERN void Tcl_DeleteTimerHandler(Tcl_TimerToken token); /* 113 */ -TCLAPI void Tcl_DeleteTrace(Tcl_Interp *interp, Tcl_Trace trace); +EXTERN void Tcl_DeleteTrace(Tcl_Interp *interp, Tcl_Trace trace); /* 114 */ -TCLAPI void Tcl_DontCallWhenDeleted(Tcl_Interp *interp, +EXTERN void Tcl_DontCallWhenDeleted(Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, ClientData clientData); /* 115 */ -TCLAPI int Tcl_DoOneEvent(int flags); +EXTERN int Tcl_DoOneEvent(int flags); /* 116 */ -TCLAPI void Tcl_DoWhenIdle(Tcl_IdleProc *proc, +EXTERN void Tcl_DoWhenIdle(Tcl_IdleProc *proc, ClientData clientData); /* 117 */ -TCLAPI char * Tcl_DStringAppend(Tcl_DString *dsPtr, +EXTERN char * Tcl_DStringAppend(Tcl_DString *dsPtr, const char *bytes, int length); /* 118 */ -TCLAPI char * Tcl_DStringAppendElement(Tcl_DString *dsPtr, +EXTERN char * Tcl_DStringAppendElement(Tcl_DString *dsPtr, const char *element); /* 119 */ -TCLAPI void Tcl_DStringEndSublist(Tcl_DString *dsPtr); +EXTERN void Tcl_DStringEndSublist(Tcl_DString *dsPtr); /* 120 */ -TCLAPI void Tcl_DStringFree(Tcl_DString *dsPtr); +EXTERN void Tcl_DStringFree(Tcl_DString *dsPtr); /* 121 */ -TCLAPI void Tcl_DStringGetResult(Tcl_Interp *interp, +EXTERN void Tcl_DStringGetResult(Tcl_Interp *interp, Tcl_DString *dsPtr); /* 122 */ -TCLAPI void Tcl_DStringInit(Tcl_DString *dsPtr); +EXTERN void Tcl_DStringInit(Tcl_DString *dsPtr); /* 123 */ -TCLAPI void Tcl_DStringResult(Tcl_Interp *interp, +EXTERN void Tcl_DStringResult(Tcl_Interp *interp, Tcl_DString *dsPtr); /* 124 */ -TCLAPI void Tcl_DStringSetLength(Tcl_DString *dsPtr, int length); +EXTERN void Tcl_DStringSetLength(Tcl_DString *dsPtr, int length); /* 125 */ -TCLAPI void Tcl_DStringStartSublist(Tcl_DString *dsPtr); +EXTERN void Tcl_DStringStartSublist(Tcl_DString *dsPtr); /* 126 */ -TCLAPI int Tcl_Eof(Tcl_Channel chan); +EXTERN int Tcl_Eof(Tcl_Channel chan); /* 127 */ -TCLAPI const char * Tcl_ErrnoId(void); +EXTERN CONST84_RETURN char * Tcl_ErrnoId(void); /* 128 */ -TCLAPI const char * Tcl_ErrnoMsg(int err); +EXTERN CONST84_RETURN char * Tcl_ErrnoMsg(int err); /* 129 */ -TCLAPI int Tcl_Eval(Tcl_Interp *interp, const char *script); -/* Slot 130 is reserved */ +EXTERN int Tcl_Eval(Tcl_Interp *interp, const char *script); +/* 130 */ +EXTERN int Tcl_EvalFile(Tcl_Interp *interp, + const char *fileName); /* Slot 131 is reserved */ /* 132 */ -TCLAPI void Tcl_EventuallyFree(ClientData clientData, +EXTERN void Tcl_EventuallyFree(ClientData clientData, Tcl_FreeProc *freeProc); /* 133 */ -TCLAPI void Tcl_Exit(int status); +EXTERN void Tcl_Exit(int status); /* 134 */ -TCLAPI int Tcl_ExposeCommand(Tcl_Interp *interp, +EXTERN int Tcl_ExposeCommand(Tcl_Interp *interp, const char *hiddenCmdToken, const char *cmdName); /* 135 */ -TCLAPI int Tcl_ExprBoolean(Tcl_Interp *interp, const char *expr, +EXTERN int Tcl_ExprBoolean(Tcl_Interp *interp, const char *expr, int *ptr); /* 136 */ -TCLAPI int Tcl_ExprBooleanObj(Tcl_Interp *interp, +EXTERN int Tcl_ExprBooleanObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *ptr); /* 137 */ -TCLAPI int Tcl_ExprDouble(Tcl_Interp *interp, const char *expr, +EXTERN int Tcl_ExprDouble(Tcl_Interp *interp, const char *expr, double *ptr); /* 138 */ -TCLAPI int Tcl_ExprDoubleObj(Tcl_Interp *interp, +EXTERN int Tcl_ExprDoubleObj(Tcl_Interp *interp, Tcl_Obj *objPtr, double *ptr); /* 139 */ -TCLAPI int Tcl_ExprLong(Tcl_Interp *interp, const char *expr, +EXTERN int Tcl_ExprLong(Tcl_Interp *interp, const char *expr, long *ptr); /* 140 */ -TCLAPI int Tcl_ExprLongObj(Tcl_Interp *interp, Tcl_Obj *objPtr, +EXTERN int Tcl_ExprLongObj(Tcl_Interp *interp, Tcl_Obj *objPtr, long *ptr); /* 141 */ -TCLAPI int Tcl_ExprObj(Tcl_Interp *interp, Tcl_Obj *objPtr, +EXTERN int Tcl_ExprObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Obj **resultPtrPtr); /* 142 */ -TCLAPI int Tcl_ExprString(Tcl_Interp *interp, const char *expr); +EXTERN int Tcl_ExprString(Tcl_Interp *interp, const char *expr); /* 143 */ -TCLAPI void Tcl_Finalize(void); -/* Slot 144 is reserved */ +EXTERN void Tcl_Finalize(void); +/* 144 */ +EXTERN void Tcl_FindExecutable(const char *argv0); /* 145 */ -TCLAPI Tcl_HashEntry * Tcl_FirstHashEntry(Tcl_HashTable *tablePtr, +EXTERN Tcl_HashEntry * Tcl_FirstHashEntry(Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 146 */ -TCLAPI int Tcl_Flush(Tcl_Channel chan); +EXTERN int Tcl_Flush(Tcl_Channel chan); /* 147 */ -TCLAPI void Tcl_FreeResult(Tcl_Interp *interp); +EXTERN void Tcl_FreeResult(Tcl_Interp *interp); /* 148 */ -TCLAPI int Tcl_GetAlias(Tcl_Interp *interp, +EXTERN int Tcl_GetAlias(Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, - const char **targetCmdPtr, int *argcPtr, - const char ***argvPtr); + CONST84 char **targetCmdPtr, int *argcPtr, + CONST84 char ***argvPtr); /* 149 */ -TCLAPI int Tcl_GetAliasObj(Tcl_Interp *interp, +EXTERN int Tcl_GetAliasObj(Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, - const char **targetCmdPtr, int *objcPtr, + CONST84 char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 150 */ -TCLAPI ClientData Tcl_GetAssocData(Tcl_Interp *interp, +EXTERN ClientData Tcl_GetAssocData(Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc **procPtr); /* 151 */ -TCLAPI Tcl_Channel Tcl_GetChannel(Tcl_Interp *interp, +EXTERN Tcl_Channel Tcl_GetChannel(Tcl_Interp *interp, const char *chanName, int *modePtr); /* 152 */ -TCLAPI int Tcl_GetChannelBufferSize(Tcl_Channel chan); +EXTERN int Tcl_GetChannelBufferSize(Tcl_Channel chan); /* 153 */ -TCLAPI int Tcl_GetChannelHandle(Tcl_Channel chan, int direction, +EXTERN int Tcl_GetChannelHandle(Tcl_Channel chan, int direction, ClientData *handlePtr); /* 154 */ -TCLAPI ClientData Tcl_GetChannelInstanceData(Tcl_Channel chan); +EXTERN ClientData Tcl_GetChannelInstanceData(Tcl_Channel chan); /* 155 */ -TCLAPI int Tcl_GetChannelMode(Tcl_Channel chan); +EXTERN int Tcl_GetChannelMode(Tcl_Channel chan); /* 156 */ -TCLAPI const char * Tcl_GetChannelName(Tcl_Channel chan); +EXTERN CONST84_RETURN char * Tcl_GetChannelName(Tcl_Channel chan); /* 157 */ -TCLAPI int Tcl_GetChannelOption(Tcl_Interp *interp, +EXTERN int Tcl_GetChannelOption(Tcl_Interp *interp, Tcl_Channel chan, const char *optionName, Tcl_DString *dsPtr); /* 158 */ -TCLAPI const Tcl_ChannelType * Tcl_GetChannelType(Tcl_Channel chan); +EXTERN CONST86 Tcl_ChannelType * Tcl_GetChannelType(Tcl_Channel chan); /* Slot 159 is reserved */ /* 160 */ -TCLAPI const char * Tcl_GetCommandName(Tcl_Interp *interp, +EXTERN CONST84_RETURN char * Tcl_GetCommandName(Tcl_Interp *interp, Tcl_Command command); /* 161 */ -TCLAPI int Tcl_GetErrno(void); +EXTERN int Tcl_GetErrno(void); /* 162 */ -TCLAPI const char * Tcl_GetHostName(void); +EXTERN CONST84_RETURN char * Tcl_GetHostName(void); /* 163 */ -TCLAPI int Tcl_GetInterpPath(Tcl_Interp *askInterp, +EXTERN int Tcl_GetInterpPath(Tcl_Interp *askInterp, Tcl_Interp *slaveInterp); /* 164 */ -TCLAPI Tcl_Interp * Tcl_GetMaster(Tcl_Interp *interp); +EXTERN Tcl_Interp * Tcl_GetMaster(Tcl_Interp *interp); /* 165 */ -TCLAPI const char * Tcl_GetNameOfExecutable(void); +EXTERN const char * Tcl_GetNameOfExecutable(void); /* 166 */ -TCLAPI Tcl_Obj * Tcl_GetObjResult(Tcl_Interp *interp); +EXTERN Tcl_Obj * Tcl_GetObjResult(Tcl_Interp *interp); #if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ /* 167 */ -TCLAPI int Tcl_GetOpenFile(Tcl_Interp *interp, +EXTERN int Tcl_GetOpenFile(Tcl_Interp *interp, const char *chanID, int forWriting, int checkUsage, ClientData *filePtr); #endif /* UNIX */ #ifdef MAC_OSX_TCL /* MACOSX */ /* 167 */ -TCLAPI int Tcl_GetOpenFile(Tcl_Interp *interp, +EXTERN int Tcl_GetOpenFile(Tcl_Interp *interp, const char *chanID, int forWriting, int checkUsage, ClientData *filePtr); #endif /* MACOSX */ /* 168 */ -TCLAPI Tcl_PathType Tcl_GetPathType(const char *path); +EXTERN Tcl_PathType Tcl_GetPathType(const char *path); /* 169 */ -TCLAPI int Tcl_Gets(Tcl_Channel chan, Tcl_DString *dsPtr); +EXTERN int Tcl_Gets(Tcl_Channel chan, Tcl_DString *dsPtr); /* 170 */ -TCLAPI int Tcl_GetsObj(Tcl_Channel chan, Tcl_Obj *objPtr); +EXTERN int Tcl_GetsObj(Tcl_Channel chan, Tcl_Obj *objPtr); /* 171 */ -TCLAPI int Tcl_GetServiceMode(void); +EXTERN int Tcl_GetServiceMode(void); /* 172 */ -TCLAPI Tcl_Interp * Tcl_GetSlave(Tcl_Interp *interp, +EXTERN Tcl_Interp * Tcl_GetSlave(Tcl_Interp *interp, const char *slaveName); /* 173 */ -TCLAPI Tcl_Channel Tcl_GetStdChannel(int type); +EXTERN Tcl_Channel Tcl_GetStdChannel(int type); /* 174 */ -TCLAPI const char * Tcl_GetStringResult(Tcl_Interp *interp); +EXTERN CONST84_RETURN char * Tcl_GetStringResult(Tcl_Interp *interp); /* 175 */ -TCLAPI const char * Tcl_GetVar(Tcl_Interp *interp, const char *varName, - int flags); +EXTERN CONST84_RETURN char * Tcl_GetVar(Tcl_Interp *interp, + const char *varName, int flags); /* 176 */ -TCLAPI const char * Tcl_GetVar2(Tcl_Interp *interp, const char *part1, - const char *part2, int flags); -/* Slot 177 is reserved */ +EXTERN CONST84_RETURN char * Tcl_GetVar2(Tcl_Interp *interp, + const char *part1, const char *part2, + int flags); +/* 177 */ +EXTERN int Tcl_GlobalEval(Tcl_Interp *interp, + const char *command); /* Slot 178 is reserved */ /* 179 */ -TCLAPI int Tcl_HideCommand(Tcl_Interp *interp, +EXTERN int Tcl_HideCommand(Tcl_Interp *interp, const char *cmdName, const char *hiddenCmdToken); /* 180 */ -TCLAPI int Tcl_Init(Tcl_Interp *interp); +EXTERN int Tcl_Init(Tcl_Interp *interp); /* 181 */ -TCLAPI void Tcl_InitHashTable(Tcl_HashTable *tablePtr, +EXTERN void Tcl_InitHashTable(Tcl_HashTable *tablePtr, int keyType); /* 182 */ -TCLAPI int Tcl_InputBlocked(Tcl_Channel chan); +EXTERN int Tcl_InputBlocked(Tcl_Channel chan); /* 183 */ -TCLAPI int Tcl_InputBuffered(Tcl_Channel chan); +EXTERN int Tcl_InputBuffered(Tcl_Channel chan); /* 184 */ -TCLAPI int Tcl_InterpDeleted(Tcl_Interp *interp); +EXTERN int Tcl_InterpDeleted(Tcl_Interp *interp); /* 185 */ -TCLAPI int Tcl_IsSafe(Tcl_Interp *interp); +EXTERN int Tcl_IsSafe(Tcl_Interp *interp); /* 186 */ -TCLAPI char * Tcl_JoinPath(int argc, const char *const *argv, +EXTERN char * Tcl_JoinPath(int argc, CONST84 char *const *argv, Tcl_DString *resultPtr); /* 187 */ -TCLAPI int Tcl_LinkVar(Tcl_Interp *interp, const char *varName, +EXTERN int Tcl_LinkVar(Tcl_Interp *interp, const char *varName, char *addr, int type); /* Slot 188 is reserved */ /* 189 */ -TCLAPI Tcl_Channel Tcl_MakeFileChannel(ClientData handle, int mode); +EXTERN Tcl_Channel Tcl_MakeFileChannel(ClientData handle, int mode); /* 190 */ -TCLAPI int Tcl_MakeSafe(Tcl_Interp *interp); +EXTERN int Tcl_MakeSafe(Tcl_Interp *interp); /* 191 */ -TCLAPI Tcl_Channel Tcl_MakeTcpClientChannel(ClientData tcpSocket); +EXTERN Tcl_Channel Tcl_MakeTcpClientChannel(ClientData tcpSocket); /* 192 */ -TCLAPI char * Tcl_Merge(int argc, const char *const *argv); +EXTERN char * Tcl_Merge(int argc, CONST84 char *const *argv); /* 193 */ -TCLAPI Tcl_HashEntry * Tcl_NextHashEntry(Tcl_HashSearch *searchPtr); +EXTERN Tcl_HashEntry * Tcl_NextHashEntry(Tcl_HashSearch *searchPtr); /* 194 */ -TCLAPI void Tcl_NotifyChannel(Tcl_Channel channel, int mask); +EXTERN void Tcl_NotifyChannel(Tcl_Channel channel, int mask); /* 195 */ -TCLAPI Tcl_Obj * Tcl_ObjGetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, +EXTERN Tcl_Obj * Tcl_ObjGetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags); /* 196 */ -TCLAPI Tcl_Obj * Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, +EXTERN Tcl_Obj * Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, int flags); /* 197 */ -TCLAPI Tcl_Channel Tcl_OpenCommandChannel(Tcl_Interp *interp, int argc, - const char **argv, int flags); +EXTERN Tcl_Channel Tcl_OpenCommandChannel(Tcl_Interp *interp, int argc, + CONST84 char **argv, int flags); /* 198 */ -TCLAPI Tcl_Channel Tcl_OpenFileChannel(Tcl_Interp *interp, +EXTERN Tcl_Channel Tcl_OpenFileChannel(Tcl_Interp *interp, const char *fileName, const char *modeString, int permissions); /* 199 */ -TCLAPI Tcl_Channel Tcl_OpenTcpClient(Tcl_Interp *interp, int port, +EXTERN Tcl_Channel Tcl_OpenTcpClient(Tcl_Interp *interp, int port, const char *address, const char *myaddr, int myport, int async); /* 200 */ -TCLAPI Tcl_Channel Tcl_OpenTcpServer(Tcl_Interp *interp, int port, +EXTERN Tcl_Channel Tcl_OpenTcpServer(Tcl_Interp *interp, int port, const char *host, Tcl_TcpAcceptProc *acceptProc, ClientData callbackData); /* 201 */ -TCLAPI void Tcl_Preserve(ClientData data); +EXTERN void Tcl_Preserve(ClientData data); /* 202 */ -TCLAPI void Tcl_PrintDouble(Tcl_Interp *interp, double value, +EXTERN void Tcl_PrintDouble(Tcl_Interp *interp, double value, char *dst); /* 203 */ -TCLAPI int Tcl_PutEnv(const char *assignment); +EXTERN int Tcl_PutEnv(const char *assignment); /* 204 */ -TCLAPI const char * Tcl_PosixError(Tcl_Interp *interp); +EXTERN CONST84_RETURN char * Tcl_PosixError(Tcl_Interp *interp); /* 205 */ -TCLAPI void Tcl_QueueEvent(Tcl_Event *evPtr, +EXTERN void Tcl_QueueEvent(Tcl_Event *evPtr, Tcl_QueuePosition position); /* 206 */ -TCLAPI int Tcl_Read(Tcl_Channel chan, char *bufPtr, int toRead); +EXTERN int Tcl_Read(Tcl_Channel chan, char *bufPtr, int toRead); /* 207 */ -TCLAPI void Tcl_ReapDetachedProcs(void); +EXTERN void Tcl_ReapDetachedProcs(void); /* 208 */ -TCLAPI int Tcl_RecordAndEval(Tcl_Interp *interp, +EXTERN int Tcl_RecordAndEval(Tcl_Interp *interp, const char *cmd, int flags); /* 209 */ -TCLAPI int Tcl_RecordAndEvalObj(Tcl_Interp *interp, +EXTERN int Tcl_RecordAndEvalObj(Tcl_Interp *interp, Tcl_Obj *cmdPtr, int flags); /* 210 */ -TCLAPI void Tcl_RegisterChannel(Tcl_Interp *interp, +EXTERN void Tcl_RegisterChannel(Tcl_Interp *interp, Tcl_Channel chan); /* 211 */ -TCLAPI void Tcl_RegisterObjType(const Tcl_ObjType *typePtr); +EXTERN void Tcl_RegisterObjType(const Tcl_ObjType *typePtr); /* 212 */ -TCLAPI Tcl_RegExp Tcl_RegExpCompile(Tcl_Interp *interp, +EXTERN Tcl_RegExp Tcl_RegExpCompile(Tcl_Interp *interp, const char *pattern); /* 213 */ -TCLAPI int Tcl_RegExpExec(Tcl_Interp *interp, Tcl_RegExp regexp, +EXTERN int Tcl_RegExpExec(Tcl_Interp *interp, Tcl_RegExp regexp, const char *text, const char *start); /* 214 */ -TCLAPI int Tcl_RegExpMatch(Tcl_Interp *interp, const char *text, +EXTERN int Tcl_RegExpMatch(Tcl_Interp *interp, const char *text, const char *pattern); /* 215 */ -TCLAPI void Tcl_RegExpRange(Tcl_RegExp regexp, int index, - const char **startPtr, const char **endPtr); +EXTERN void Tcl_RegExpRange(Tcl_RegExp regexp, int index, + CONST84 char **startPtr, + CONST84 char **endPtr); /* 216 */ -TCLAPI void Tcl_Release(ClientData clientData); +EXTERN void Tcl_Release(ClientData clientData); /* 217 */ -TCLAPI void Tcl_ResetResult(Tcl_Interp *interp); +EXTERN void Tcl_ResetResult(Tcl_Interp *interp); /* 218 */ -TCLAPI int Tcl_ScanElement(const char *src, int *flagPtr); +EXTERN int Tcl_ScanElement(const char *src, int *flagPtr); /* 219 */ -TCLAPI int Tcl_ScanCountedElement(const char *src, int length, +EXTERN int Tcl_ScanCountedElement(const char *src, int length, int *flagPtr); -/* Slot 220 is reserved */ +/* 220 */ +EXTERN int Tcl_SeekOld(Tcl_Channel chan, int offset, int mode); /* 221 */ -TCLAPI int Tcl_ServiceAll(void); +EXTERN int Tcl_ServiceAll(void); /* 222 */ -TCLAPI int Tcl_ServiceEvent(int flags); +EXTERN int Tcl_ServiceEvent(int flags); /* 223 */ -TCLAPI void Tcl_SetAssocData(Tcl_Interp *interp, +EXTERN void Tcl_SetAssocData(Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc *proc, ClientData clientData); /* 224 */ -TCLAPI void Tcl_SetChannelBufferSize(Tcl_Channel chan, int sz); +EXTERN void Tcl_SetChannelBufferSize(Tcl_Channel chan, int sz); /* 225 */ -TCLAPI int Tcl_SetChannelOption(Tcl_Interp *interp, +EXTERN int Tcl_SetChannelOption(Tcl_Interp *interp, Tcl_Channel chan, const char *optionName, const char *newValue); /* Slot 226 is reserved */ /* 227 */ -TCLAPI void Tcl_SetErrno(int err); +EXTERN void Tcl_SetErrno(int err); /* 228 */ -TCLAPI void Tcl_SetErrorCode(Tcl_Interp *interp, ...); +EXTERN void Tcl_SetErrorCode(Tcl_Interp *interp, ...); /* 229 */ -TCLAPI void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr); +EXTERN void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr); /* 230 */ -TCLAPI void Tcl_SetPanicProc(Tcl_PanicProc *panicProc); +EXTERN void Tcl_SetPanicProc(Tcl_PanicProc *panicProc); /* 231 */ -TCLAPI int Tcl_SetRecursionLimit(Tcl_Interp *interp, int depth); +EXTERN int Tcl_SetRecursionLimit(Tcl_Interp *interp, int depth); /* 232 */ -TCLAPI void Tcl_SetResult(Tcl_Interp *interp, char *result, +EXTERN void Tcl_SetResult(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc); /* 233 */ -TCLAPI int Tcl_SetServiceMode(int mode); +EXTERN int Tcl_SetServiceMode(int mode); /* 234 */ -TCLAPI void Tcl_SetObjErrorCode(Tcl_Interp *interp, +EXTERN void Tcl_SetObjErrorCode(Tcl_Interp *interp, Tcl_Obj *errorObjPtr); /* 235 */ -TCLAPI void Tcl_SetObjResult(Tcl_Interp *interp, +EXTERN void Tcl_SetObjResult(Tcl_Interp *interp, Tcl_Obj *resultObjPtr); /* 236 */ -TCLAPI void Tcl_SetStdChannel(Tcl_Channel channel, int type); +EXTERN void Tcl_SetStdChannel(Tcl_Channel channel, int type); /* 237 */ -TCLAPI const char * Tcl_SetVar(Tcl_Interp *interp, const char *varName, - const char *newValue, int flags); -/* 238 */ -TCLAPI const char * Tcl_SetVar2(Tcl_Interp *interp, const char *part1, - const char *part2, const char *newValue, +EXTERN CONST84_RETURN char * Tcl_SetVar(Tcl_Interp *interp, + const char *varName, const char *newValue, int flags); +/* 238 */ +EXTERN CONST84_RETURN char * Tcl_SetVar2(Tcl_Interp *interp, + const char *part1, const char *part2, + const char *newValue, int flags); /* 239 */ -TCLAPI const char * Tcl_SignalId(int sig); +EXTERN CONST84_RETURN char * Tcl_SignalId(int sig); /* 240 */ -TCLAPI const char * Tcl_SignalMsg(int sig); +EXTERN CONST84_RETURN char * Tcl_SignalMsg(int sig); /* 241 */ -TCLAPI void Tcl_SourceRCFile(Tcl_Interp *interp); +EXTERN void Tcl_SourceRCFile(Tcl_Interp *interp); /* 242 */ -TCLAPI int Tcl_SplitList(Tcl_Interp *interp, +EXTERN int Tcl_SplitList(Tcl_Interp *interp, const char *listStr, int *argcPtr, - const char ***argvPtr); + CONST84 char ***argvPtr); /* 243 */ -TCLAPI void Tcl_SplitPath(const char *path, int *argcPtr, - const char ***argvPtr); +EXTERN void Tcl_SplitPath(const char *path, int *argcPtr, + CONST84 char ***argvPtr); /* 244 */ -TCLAPI void Tcl_StaticPackage(Tcl_Interp *interp, +EXTERN void Tcl_StaticPackage(Tcl_Interp *interp, const char *pkgName, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc); /* 245 */ -TCLAPI int Tcl_StringMatch(const char *str, const char *pattern); -/* Slot 246 is reserved */ +EXTERN int Tcl_StringMatch(const char *str, const char *pattern); +/* 246 */ +EXTERN int Tcl_TellOld(Tcl_Channel chan); /* 247 */ -TCLAPI int Tcl_TraceVar(Tcl_Interp *interp, const char *varName, +EXTERN int Tcl_TraceVar(Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData); /* 248 */ -TCLAPI int Tcl_TraceVar2(Tcl_Interp *interp, const char *part1, +EXTERN int Tcl_TraceVar2(Tcl_Interp *interp, const char *part1, const char *part2, int flags, Tcl_VarTraceProc *proc, ClientData clientData); /* 249 */ -TCLAPI char * Tcl_TranslateFileName(Tcl_Interp *interp, +EXTERN char * Tcl_TranslateFileName(Tcl_Interp *interp, const char *name, Tcl_DString *bufferPtr); /* 250 */ -TCLAPI int Tcl_Ungets(Tcl_Channel chan, const char *str, +EXTERN int Tcl_Ungets(Tcl_Channel chan, const char *str, int len, int atHead); /* 251 */ -TCLAPI void Tcl_UnlinkVar(Tcl_Interp *interp, +EXTERN void Tcl_UnlinkVar(Tcl_Interp *interp, const char *varName); /* 252 */ -TCLAPI int Tcl_UnregisterChannel(Tcl_Interp *interp, +EXTERN int Tcl_UnregisterChannel(Tcl_Interp *interp, Tcl_Channel chan); /* 253 */ -TCLAPI int Tcl_UnsetVar(Tcl_Interp *interp, const char *varName, +EXTERN int Tcl_UnsetVar(Tcl_Interp *interp, const char *varName, int flags); /* 254 */ -TCLAPI int Tcl_UnsetVar2(Tcl_Interp *interp, const char *part1, +EXTERN int Tcl_UnsetVar2(Tcl_Interp *interp, const char *part1, const char *part2, int flags); /* 255 */ -TCLAPI void Tcl_UntraceVar(Tcl_Interp *interp, +EXTERN void Tcl_UntraceVar(Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData); /* 256 */ -TCLAPI void Tcl_UntraceVar2(Tcl_Interp *interp, +EXTERN void Tcl_UntraceVar2(Tcl_Interp *interp, const char *part1, const char *part2, int flags, Tcl_VarTraceProc *proc, ClientData clientData); /* 257 */ -TCLAPI void Tcl_UpdateLinkedVar(Tcl_Interp *interp, +EXTERN void Tcl_UpdateLinkedVar(Tcl_Interp *interp, const char *varName); /* 258 */ -TCLAPI int Tcl_UpVar(Tcl_Interp *interp, const char *frameName, +EXTERN int Tcl_UpVar(Tcl_Interp *interp, const char *frameName, const char *varName, const char *localName, int flags); /* 259 */ -TCLAPI int Tcl_UpVar2(Tcl_Interp *interp, const char *frameName, +EXTERN int Tcl_UpVar2(Tcl_Interp *interp, const char *frameName, const char *part1, const char *part2, const char *localName, int flags); -/* Slot 260 is reserved */ +/* 260 */ +EXTERN int Tcl_VarEval(Tcl_Interp *interp, ...); /* 261 */ -TCLAPI ClientData Tcl_VarTraceInfo(Tcl_Interp *interp, +EXTERN ClientData Tcl_VarTraceInfo(Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData); /* 262 */ -TCLAPI ClientData Tcl_VarTraceInfo2(Tcl_Interp *interp, +EXTERN ClientData Tcl_VarTraceInfo2(Tcl_Interp *interp, const char *part1, const char *part2, int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData); /* 263 */ -TCLAPI int Tcl_Write(Tcl_Channel chan, const char *s, int slen); +EXTERN int Tcl_Write(Tcl_Channel chan, const char *s, int slen); /* 264 */ -TCLAPI void Tcl_WrongNumArgs(Tcl_Interp *interp, int objc, +EXTERN void Tcl_WrongNumArgs(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], const char *message); /* 265 */ -TCLAPI int Tcl_DumpActiveMemory(const char *fileName); +EXTERN int Tcl_DumpActiveMemory(const char *fileName); /* 266 */ -TCLAPI void Tcl_ValidateAllMemory(const char *file, int line); +EXTERN void Tcl_ValidateAllMemory(const char *file, int line); /* 267 */ -TCLAPI void Tcl_AppendResultVA(Tcl_Interp *interp, +EXTERN void Tcl_AppendResultVA(Tcl_Interp *interp, va_list argList); /* 268 */ -TCLAPI void Tcl_AppendStringsToObjVA(Tcl_Obj *objPtr, +EXTERN void Tcl_AppendStringsToObjVA(Tcl_Obj *objPtr, va_list argList); /* 269 */ -TCLAPI char * Tcl_HashStats(Tcl_HashTable *tablePtr); +EXTERN char * Tcl_HashStats(Tcl_HashTable *tablePtr); /* 270 */ -TCLAPI const char * Tcl_ParseVar(Tcl_Interp *interp, const char *start, - const char **termPtr); +EXTERN CONST84_RETURN char * Tcl_ParseVar(Tcl_Interp *interp, + const char *start, CONST84 char **termPtr); /* 271 */ -TCLAPI const char * Tcl_PkgPresent(Tcl_Interp *interp, const char *name, - const char *version, int exact); +EXTERN CONST84_RETURN char * Tcl_PkgPresent(Tcl_Interp *interp, + const char *name, const char *version, + int exact); /* 272 */ -TCLAPI const char * Tcl_PkgPresentEx(Tcl_Interp *interp, +EXTERN CONST84_RETURN char * Tcl_PkgPresentEx(Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr); /* 273 */ -TCLAPI int TclPkgProvide(Tcl_Interp *interp, const char *name, +EXTERN int Tcl_PkgProvide(Tcl_Interp *interp, const char *name, const char *version); /* 274 */ -TCLAPI const char * Tcl_PkgRequire(Tcl_Interp *interp, const char *name, - const char *version, int exact); +EXTERN CONST84_RETURN char * Tcl_PkgRequire(Tcl_Interp *interp, + const char *name, const char *version, + int exact); /* 275 */ -TCLAPI void Tcl_SetErrorCodeVA(Tcl_Interp *interp, +EXTERN void Tcl_SetErrorCodeVA(Tcl_Interp *interp, va_list argList); -/* Slot 276 is reserved */ +/* 276 */ +EXTERN int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList); /* 277 */ -TCLAPI Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options); +EXTERN Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options); /* 278 */ -TCLAPI void Tcl_PanicVA(const char *format, va_list argList); +EXTERN void Tcl_PanicVA(const char *format, va_list argList); /* 279 */ -TCLAPI void Tcl_GetVersion(int *major, int *minor, +EXTERN void Tcl_GetVersion(int *major, int *minor, int *patchLevel, int *type); /* 280 */ -TCLAPI void Tcl_InitMemory(Tcl_Interp *interp); +EXTERN void Tcl_InitMemory(Tcl_Interp *interp); /* 281 */ -TCLAPI Tcl_Channel Tcl_StackChannel(Tcl_Interp *interp, +EXTERN Tcl_Channel Tcl_StackChannel(Tcl_Interp *interp, const Tcl_ChannelType *typePtr, ClientData instanceData, int mask, Tcl_Channel prevChan); /* 282 */ -TCLAPI int Tcl_UnstackChannel(Tcl_Interp *interp, +EXTERN int Tcl_UnstackChannel(Tcl_Interp *interp, Tcl_Channel chan); /* 283 */ -TCLAPI Tcl_Channel Tcl_GetStackedChannel(Tcl_Channel chan); +EXTERN Tcl_Channel Tcl_GetStackedChannel(Tcl_Channel chan); /* 284 */ -TCLAPI void Tcl_SetMainLoop(Tcl_MainLoopProc *proc); +EXTERN void Tcl_SetMainLoop(Tcl_MainLoopProc *proc); /* Slot 285 is reserved */ /* 286 */ -TCLAPI void Tcl_AppendObjToObj(Tcl_Obj *objPtr, +EXTERN void Tcl_AppendObjToObj(Tcl_Obj *objPtr, Tcl_Obj *appendObjPtr); /* 287 */ -TCLAPI Tcl_Encoding Tcl_CreateEncoding(const Tcl_EncodingType *typePtr); +EXTERN Tcl_Encoding Tcl_CreateEncoding(const Tcl_EncodingType *typePtr); /* 288 */ -TCLAPI void Tcl_CreateThreadExitHandler(Tcl_ExitProc *proc, +EXTERN void Tcl_CreateThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData); /* 289 */ -TCLAPI void Tcl_DeleteThreadExitHandler(Tcl_ExitProc *proc, +EXTERN void Tcl_DeleteThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData); /* 290 */ -TCLAPI void Tcl_DiscardResult(Tcl_SavedResult *statePtr); +EXTERN void Tcl_DiscardResult(Tcl_SavedResult *statePtr); /* 291 */ -TCLAPI int Tcl_EvalEx(Tcl_Interp *interp, const char *script, +EXTERN int Tcl_EvalEx(Tcl_Interp *interp, const char *script, int numBytes, int flags); /* 292 */ -TCLAPI int Tcl_EvalObjv(Tcl_Interp *interp, int objc, +EXTERN int Tcl_EvalObjv(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags); /* 293 */ -TCLAPI int Tcl_EvalObjEx(Tcl_Interp *interp, Tcl_Obj *objPtr, +EXTERN int Tcl_EvalObjEx(Tcl_Interp *interp, Tcl_Obj *objPtr, int flags); /* 294 */ -TCLAPI void Tcl_ExitThread(int status); +EXTERN void Tcl_ExitThread(int status); /* 295 */ -TCLAPI int Tcl_ExternalToUtf(Tcl_Interp *interp, +EXTERN int Tcl_ExternalToUtf(Tcl_Interp *interp, Tcl_Encoding encoding, const char *src, int srcLen, int flags, Tcl_EncodingState *statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); /* 296 */ -TCLAPI char * Tcl_ExternalToUtfDString(Tcl_Encoding encoding, +EXTERN char * Tcl_ExternalToUtfDString(Tcl_Encoding encoding, const char *src, int srcLen, Tcl_DString *dsPtr); /* 297 */ -TCLAPI void Tcl_FinalizeThread(void); +EXTERN void Tcl_FinalizeThread(void); /* 298 */ -TCLAPI void Tcl_FinalizeNotifier(ClientData clientData); +EXTERN void Tcl_FinalizeNotifier(ClientData clientData); /* 299 */ -TCLAPI void Tcl_FreeEncoding(Tcl_Encoding encoding); +EXTERN void Tcl_FreeEncoding(Tcl_Encoding encoding); /* 300 */ -TCLAPI Tcl_ThreadId Tcl_GetCurrentThread(void); +EXTERN Tcl_ThreadId Tcl_GetCurrentThread(void); /* 301 */ -TCLAPI Tcl_Encoding Tcl_GetEncoding(Tcl_Interp *interp, const char *name); +EXTERN Tcl_Encoding Tcl_GetEncoding(Tcl_Interp *interp, const char *name); /* 302 */ -TCLAPI const char * Tcl_GetEncodingName(Tcl_Encoding encoding); +EXTERN CONST84_RETURN char * Tcl_GetEncodingName(Tcl_Encoding encoding); /* 303 */ -TCLAPI void Tcl_GetEncodingNames(Tcl_Interp *interp); +EXTERN void Tcl_GetEncodingNames(Tcl_Interp *interp); /* 304 */ -TCLAPI int Tcl_GetIndexFromObjStruct(Tcl_Interp *interp, +EXTERN int Tcl_GetIndexFromObjStruct(Tcl_Interp *interp, Tcl_Obj *objPtr, const void *tablePtr, int offset, const char *msg, int flags, int *indexPtr); /* 305 */ -TCLAPI void * Tcl_GetThreadData(Tcl_ThreadDataKey *keyPtr, +EXTERN void * Tcl_GetThreadData(Tcl_ThreadDataKey *keyPtr, int size); /* 306 */ -TCLAPI Tcl_Obj * Tcl_GetVar2Ex(Tcl_Interp *interp, const char *part1, +EXTERN Tcl_Obj * Tcl_GetVar2Ex(Tcl_Interp *interp, const char *part1, const char *part2, int flags); /* 307 */ -TCLAPI ClientData Tcl_InitNotifier(void); +EXTERN ClientData Tcl_InitNotifier(void); /* 308 */ -TCLAPI void Tcl_MutexLock(Tcl_Mutex *mutexPtr); +EXTERN void Tcl_MutexLock(Tcl_Mutex *mutexPtr); /* 309 */ -TCLAPI void Tcl_MutexUnlock(Tcl_Mutex *mutexPtr); +EXTERN void Tcl_MutexUnlock(Tcl_Mutex *mutexPtr); /* 310 */ -TCLAPI void Tcl_ConditionNotify(Tcl_Condition *condPtr); +EXTERN void Tcl_ConditionNotify(Tcl_Condition *condPtr); /* 311 */ -TCLAPI void Tcl_ConditionWait(Tcl_Condition *condPtr, +EXTERN void Tcl_ConditionWait(Tcl_Condition *condPtr, Tcl_Mutex *mutexPtr, const Tcl_Time *timePtr); /* 312 */ -TCLAPI int Tcl_NumUtfChars(const char *src, int length); +EXTERN int Tcl_NumUtfChars(const char *src, int length); /* 313 */ -TCLAPI int Tcl_ReadChars(Tcl_Channel channel, Tcl_Obj *objPtr, +EXTERN int Tcl_ReadChars(Tcl_Channel channel, Tcl_Obj *objPtr, int charsToRead, int appendFlag); /* 314 */ -TCLAPI void Tcl_RestoreResult(Tcl_Interp *interp, +EXTERN void Tcl_RestoreResult(Tcl_Interp *interp, Tcl_SavedResult *statePtr); /* 315 */ -TCLAPI void Tcl_SaveResult(Tcl_Interp *interp, +EXTERN void Tcl_SaveResult(Tcl_Interp *interp, Tcl_SavedResult *statePtr); /* 316 */ -TCLAPI int Tcl_SetSystemEncoding(Tcl_Interp *interp, +EXTERN int Tcl_SetSystemEncoding(Tcl_Interp *interp, const char *name); /* 317 */ -TCLAPI Tcl_Obj * Tcl_SetVar2Ex(Tcl_Interp *interp, const char *part1, +EXTERN Tcl_Obj * Tcl_SetVar2Ex(Tcl_Interp *interp, const char *part1, const char *part2, Tcl_Obj *newValuePtr, int flags); /* 318 */ -TCLAPI void Tcl_ThreadAlert(Tcl_ThreadId threadId); +EXTERN void Tcl_ThreadAlert(Tcl_ThreadId threadId); /* 319 */ -TCLAPI void Tcl_ThreadQueueEvent(Tcl_ThreadId threadId, +EXTERN void Tcl_ThreadQueueEvent(Tcl_ThreadId threadId, Tcl_Event *evPtr, Tcl_QueuePosition position); /* 320 */ -TCLAPI Tcl_UniChar Tcl_UniCharAtIndex(const char *src, int index); +EXTERN Tcl_UniChar Tcl_UniCharAtIndex(const char *src, int index); /* 321 */ -TCLAPI Tcl_UniChar Tcl_UniCharToLower(int ch); +EXTERN Tcl_UniChar Tcl_UniCharToLower(int ch); /* 322 */ -TCLAPI Tcl_UniChar Tcl_UniCharToTitle(int ch); +EXTERN Tcl_UniChar Tcl_UniCharToTitle(int ch); /* 323 */ -TCLAPI Tcl_UniChar Tcl_UniCharToUpper(int ch); +EXTERN Tcl_UniChar Tcl_UniCharToUpper(int ch); /* 324 */ -TCLAPI int Tcl_UniCharToUtf(int ch, char *buf); +EXTERN int Tcl_UniCharToUtf(int ch, char *buf); /* 325 */ -TCLAPI const char * Tcl_UtfAtIndex(const char *src, int index); +EXTERN CONST84_RETURN char * Tcl_UtfAtIndex(const char *src, int index); /* 326 */ -TCLAPI int Tcl_UtfCharComplete(const char *src, int length); +EXTERN int Tcl_UtfCharComplete(const char *src, int length); /* 327 */ -TCLAPI int Tcl_UtfBackslash(const char *src, int *readPtr, +EXTERN int Tcl_UtfBackslash(const char *src, int *readPtr, char *dst); /* 328 */ -TCLAPI const char * Tcl_UtfFindFirst(const char *src, int ch); +EXTERN CONST84_RETURN char * Tcl_UtfFindFirst(const char *src, int ch); /* 329 */ -TCLAPI const char * Tcl_UtfFindLast(const char *src, int ch); +EXTERN CONST84_RETURN char * Tcl_UtfFindLast(const char *src, int ch); /* 330 */ -TCLAPI const char * Tcl_UtfNext(const char *src); +EXTERN CONST84_RETURN char * Tcl_UtfNext(const char *src); /* 331 */ -TCLAPI const char * Tcl_UtfPrev(const char *src, const char *start); +EXTERN CONST84_RETURN char * Tcl_UtfPrev(const char *src, const char *start); /* 332 */ -TCLAPI int Tcl_UtfToExternal(Tcl_Interp *interp, +EXTERN int Tcl_UtfToExternal(Tcl_Interp *interp, Tcl_Encoding encoding, const char *src, int srcLen, int flags, Tcl_EncodingState *statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); /* 333 */ -TCLAPI char * Tcl_UtfToExternalDString(Tcl_Encoding encoding, +EXTERN char * Tcl_UtfToExternalDString(Tcl_Encoding encoding, const char *src, int srcLen, Tcl_DString *dsPtr); /* 334 */ -TCLAPI int Tcl_UtfToLower(char *src); +EXTERN int Tcl_UtfToLower(char *src); /* 335 */ -TCLAPI int Tcl_UtfToTitle(char *src); +EXTERN int Tcl_UtfToTitle(char *src); /* 336 */ -TCLAPI int Tcl_UtfToUniChar(const char *src, Tcl_UniChar *chPtr); +EXTERN int Tcl_UtfToUniChar(const char *src, Tcl_UniChar *chPtr); /* 337 */ -TCLAPI int Tcl_UtfToUpper(char *src); +EXTERN int Tcl_UtfToUpper(char *src); /* 338 */ -TCLAPI int Tcl_WriteChars(Tcl_Channel chan, const char *src, +EXTERN int Tcl_WriteChars(Tcl_Channel chan, const char *src, int srcLen); /* 339 */ -TCLAPI int Tcl_WriteObj(Tcl_Channel chan, Tcl_Obj *objPtr); +EXTERN int Tcl_WriteObj(Tcl_Channel chan, Tcl_Obj *objPtr); /* 340 */ -TCLAPI char * Tcl_GetString(Tcl_Obj *objPtr); -/* Slot 341 is reserved */ -/* Slot 342 is reserved */ +EXTERN char * Tcl_GetString(Tcl_Obj *objPtr); +/* 341 */ +EXTERN CONST84_RETURN char * Tcl_GetDefaultEncodingDir(void); +/* 342 */ +EXTERN void Tcl_SetDefaultEncodingDir(const char *path); /* 343 */ -TCLAPI void Tcl_AlertNotifier(ClientData clientData); +EXTERN void Tcl_AlertNotifier(ClientData clientData); /* 344 */ -TCLAPI void Tcl_ServiceModeHook(int mode); +EXTERN void Tcl_ServiceModeHook(int mode); /* 345 */ -TCLAPI int Tcl_UniCharIsAlnum(int ch); +EXTERN int Tcl_UniCharIsAlnum(int ch); /* 346 */ -TCLAPI int Tcl_UniCharIsAlpha(int ch); +EXTERN int Tcl_UniCharIsAlpha(int ch); /* 347 */ -TCLAPI int Tcl_UniCharIsDigit(int ch); +EXTERN int Tcl_UniCharIsDigit(int ch); /* 348 */ -TCLAPI int Tcl_UniCharIsLower(int ch); +EXTERN int Tcl_UniCharIsLower(int ch); /* 349 */ -TCLAPI int Tcl_UniCharIsSpace(int ch); +EXTERN int Tcl_UniCharIsSpace(int ch); /* 350 */ -TCLAPI int Tcl_UniCharIsUpper(int ch); +EXTERN int Tcl_UniCharIsUpper(int ch); /* 351 */ -TCLAPI int Tcl_UniCharIsWordChar(int ch); +EXTERN int Tcl_UniCharIsWordChar(int ch); /* 352 */ -TCLAPI int Tcl_UniCharLen(const Tcl_UniChar *uniStr); +EXTERN int Tcl_UniCharLen(const Tcl_UniChar *uniStr); /* 353 */ -TCLAPI int Tcl_UniCharNcmp(const Tcl_UniChar *ucs, +EXTERN int Tcl_UniCharNcmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 354 */ -TCLAPI char * Tcl_UniCharToUtfDString(const Tcl_UniChar *uniStr, +EXTERN char * Tcl_UniCharToUtfDString(const Tcl_UniChar *uniStr, int uniLength, Tcl_DString *dsPtr); /* 355 */ -TCLAPI Tcl_UniChar * Tcl_UtfToUniCharDString(const char *src, int length, +EXTERN Tcl_UniChar * Tcl_UtfToUniCharDString(const char *src, int length, Tcl_DString *dsPtr); /* 356 */ -TCLAPI Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp, +EXTERN Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp, Tcl_Obj *patObj, int flags); -/* Slot 357 is reserved */ +/* 357 */ +EXTERN Tcl_Obj * Tcl_EvalTokens(Tcl_Interp *interp, + Tcl_Token *tokenPtr, int count); /* 358 */ -TCLAPI void Tcl_FreeParse(Tcl_Parse *parsePtr); +EXTERN void Tcl_FreeParse(Tcl_Parse *parsePtr); /* 359 */ -TCLAPI void Tcl_LogCommandInfo(Tcl_Interp *interp, +EXTERN void Tcl_LogCommandInfo(Tcl_Interp *interp, const char *script, const char *command, int length); /* 360 */ -TCLAPI int Tcl_ParseBraces(Tcl_Interp *interp, +EXTERN int Tcl_ParseBraces(Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr, int append, - const char **termPtr); + CONST84 char **termPtr); /* 361 */ -TCLAPI int Tcl_ParseCommand(Tcl_Interp *interp, +EXTERN int Tcl_ParseCommand(Tcl_Interp *interp, const char *start, int numBytes, int nested, Tcl_Parse *parsePtr); /* 362 */ -TCLAPI int Tcl_ParseExpr(Tcl_Interp *interp, const char *start, +EXTERN int Tcl_ParseExpr(Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr); /* 363 */ -TCLAPI int Tcl_ParseQuotedString(Tcl_Interp *interp, +EXTERN int Tcl_ParseQuotedString(Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr, int append, - const char **termPtr); + CONST84 char **termPtr); /* 364 */ -TCLAPI int Tcl_ParseVarName(Tcl_Interp *interp, +EXTERN int Tcl_ParseVarName(Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr, int append); /* 365 */ -TCLAPI char * Tcl_GetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr); +EXTERN char * Tcl_GetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr); /* 366 */ -TCLAPI int Tcl_Chdir(const char *dirName); +EXTERN int Tcl_Chdir(const char *dirName); /* 367 */ -TCLAPI int Tcl_Access(const char *path, int mode); +EXTERN int Tcl_Access(const char *path, int mode); /* 368 */ -TCLAPI int Tcl_Stat(const char *path, struct stat *bufPtr); +EXTERN int Tcl_Stat(const char *path, struct stat *bufPtr); /* 369 */ -TCLAPI int Tcl_UtfNcmp(const char *s1, const char *s2, +EXTERN int Tcl_UtfNcmp(const char *s1, const char *s2, unsigned long n); /* 370 */ -TCLAPI int Tcl_UtfNcasecmp(const char *s1, const char *s2, +EXTERN int Tcl_UtfNcasecmp(const char *s1, const char *s2, unsigned long n); /* 371 */ -TCLAPI int Tcl_StringCaseMatch(const char *str, +EXTERN int Tcl_StringCaseMatch(const char *str, const char *pattern, int nocase); /* 372 */ -TCLAPI int Tcl_UniCharIsControl(int ch); +EXTERN int Tcl_UniCharIsControl(int ch); /* 373 */ -TCLAPI int Tcl_UniCharIsGraph(int ch); +EXTERN int Tcl_UniCharIsGraph(int ch); /* 374 */ -TCLAPI int Tcl_UniCharIsPrint(int ch); +EXTERN int Tcl_UniCharIsPrint(int ch); /* 375 */ -TCLAPI int Tcl_UniCharIsPunct(int ch); +EXTERN int Tcl_UniCharIsPunct(int ch); /* 376 */ -TCLAPI int Tcl_RegExpExecObj(Tcl_Interp *interp, +EXTERN int Tcl_RegExpExecObj(Tcl_Interp *interp, Tcl_RegExp regexp, Tcl_Obj *textObj, int offset, int nmatches, int flags); /* 377 */ -TCLAPI void Tcl_RegExpGetInfo(Tcl_RegExp regexp, +EXTERN void Tcl_RegExpGetInfo(Tcl_RegExp regexp, Tcl_RegExpInfo *infoPtr); /* 378 */ -TCLAPI Tcl_Obj * Tcl_NewUnicodeObj(const Tcl_UniChar *unicode, +EXTERN Tcl_Obj * Tcl_NewUnicodeObj(const Tcl_UniChar *unicode, int numChars); /* 379 */ -TCLAPI void Tcl_SetUnicodeObj(Tcl_Obj *objPtr, +EXTERN void Tcl_SetUnicodeObj(Tcl_Obj *objPtr, const Tcl_UniChar *unicode, int numChars); /* 380 */ -TCLAPI int Tcl_GetCharLength(Tcl_Obj *objPtr); +EXTERN int Tcl_GetCharLength(Tcl_Obj *objPtr); /* 381 */ -TCLAPI Tcl_UniChar Tcl_GetUniChar(Tcl_Obj *objPtr, int index); +EXTERN Tcl_UniChar Tcl_GetUniChar(Tcl_Obj *objPtr, int index); /* 382 */ -TCLAPI Tcl_UniChar * Tcl_GetUnicode(Tcl_Obj *objPtr); +EXTERN Tcl_UniChar * Tcl_GetUnicode(Tcl_Obj *objPtr); /* 383 */ -TCLAPI Tcl_Obj * Tcl_GetRange(Tcl_Obj *objPtr, int first, int last); +EXTERN Tcl_Obj * Tcl_GetRange(Tcl_Obj *objPtr, int first, int last); /* 384 */ -TCLAPI void Tcl_AppendUnicodeToObj(Tcl_Obj *objPtr, +EXTERN void Tcl_AppendUnicodeToObj(Tcl_Obj *objPtr, const Tcl_UniChar *unicode, int length); /* 385 */ -TCLAPI int Tcl_RegExpMatchObj(Tcl_Interp *interp, +EXTERN int Tcl_RegExpMatchObj(Tcl_Interp *interp, Tcl_Obj *textObj, Tcl_Obj *patternObj); /* 386 */ -TCLAPI void Tcl_SetNotifier(Tcl_NotifierProcs *notifierProcPtr); +EXTERN void Tcl_SetNotifier(Tcl_NotifierProcs *notifierProcPtr); /* 387 */ -TCLAPI Tcl_Mutex * Tcl_GetAllocMutex(void); +EXTERN Tcl_Mutex * Tcl_GetAllocMutex(void); /* 388 */ -TCLAPI int Tcl_GetChannelNames(Tcl_Interp *interp); +EXTERN int Tcl_GetChannelNames(Tcl_Interp *interp); /* 389 */ -TCLAPI int Tcl_GetChannelNamesEx(Tcl_Interp *interp, +EXTERN int Tcl_GetChannelNamesEx(Tcl_Interp *interp, const char *pattern); /* 390 */ -TCLAPI int Tcl_ProcObjCmd(ClientData clientData, +EXTERN int Tcl_ProcObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 391 */ -TCLAPI void Tcl_ConditionFinalize(Tcl_Condition *condPtr); +EXTERN void Tcl_ConditionFinalize(Tcl_Condition *condPtr); /* 392 */ -TCLAPI void Tcl_MutexFinalize(Tcl_Mutex *mutex); +EXTERN void Tcl_MutexFinalize(Tcl_Mutex *mutex); /* 393 */ -TCLAPI int Tcl_CreateThread(Tcl_ThreadId *idPtr, +EXTERN int Tcl_CreateThread(Tcl_ThreadId *idPtr, Tcl_ThreadCreateProc *proc, ClientData clientData, int stackSize, int flags); /* 394 */ -TCLAPI int Tcl_ReadRaw(Tcl_Channel chan, char *dst, +EXTERN int Tcl_ReadRaw(Tcl_Channel chan, char *dst, int bytesToRead); /* 395 */ -TCLAPI int Tcl_WriteRaw(Tcl_Channel chan, const char *src, +EXTERN int Tcl_WriteRaw(Tcl_Channel chan, const char *src, int srcLen); /* 396 */ -TCLAPI Tcl_Channel Tcl_GetTopChannel(Tcl_Channel chan); +EXTERN Tcl_Channel Tcl_GetTopChannel(Tcl_Channel chan); /* 397 */ -TCLAPI int Tcl_ChannelBuffered(Tcl_Channel chan); +EXTERN int Tcl_ChannelBuffered(Tcl_Channel chan); /* 398 */ -TCLAPI const char * Tcl_ChannelName(const Tcl_ChannelType *chanTypePtr); +EXTERN CONST84_RETURN char * Tcl_ChannelName( + const Tcl_ChannelType *chanTypePtr); /* 399 */ -TCLAPI Tcl_ChannelTypeVersion Tcl_ChannelVersion( +EXTERN Tcl_ChannelTypeVersion Tcl_ChannelVersion( const Tcl_ChannelType *chanTypePtr); /* 400 */ -TCLAPI Tcl_DriverBlockModeProc * Tcl_ChannelBlockModeProc( +EXTERN Tcl_DriverBlockModeProc * Tcl_ChannelBlockModeProc( const Tcl_ChannelType *chanTypePtr); /* 401 */ -TCLAPI Tcl_DriverCloseProc * Tcl_ChannelCloseProc( +EXTERN Tcl_DriverCloseProc * Tcl_ChannelCloseProc( const Tcl_ChannelType *chanTypePtr); /* 402 */ -TCLAPI Tcl_DriverClose2Proc * Tcl_ChannelClose2Proc( +EXTERN Tcl_DriverClose2Proc * Tcl_ChannelClose2Proc( const Tcl_ChannelType *chanTypePtr); /* 403 */ -TCLAPI Tcl_DriverInputProc * Tcl_ChannelInputProc( +EXTERN Tcl_DriverInputProc * Tcl_ChannelInputProc( const Tcl_ChannelType *chanTypePtr); /* 404 */ -TCLAPI Tcl_DriverOutputProc * Tcl_ChannelOutputProc( +EXTERN Tcl_DriverOutputProc * Tcl_ChannelOutputProc( const Tcl_ChannelType *chanTypePtr); /* 405 */ -TCLAPI Tcl_DriverSeekProc * Tcl_ChannelSeekProc( +EXTERN Tcl_DriverSeekProc * Tcl_ChannelSeekProc( const Tcl_ChannelType *chanTypePtr); /* 406 */ -TCLAPI Tcl_DriverSetOptionProc * Tcl_ChannelSetOptionProc( +EXTERN Tcl_DriverSetOptionProc * Tcl_ChannelSetOptionProc( const Tcl_ChannelType *chanTypePtr); /* 407 */ -TCLAPI Tcl_DriverGetOptionProc * Tcl_ChannelGetOptionProc( +EXTERN Tcl_DriverGetOptionProc * Tcl_ChannelGetOptionProc( const Tcl_ChannelType *chanTypePtr); /* 408 */ -TCLAPI Tcl_DriverWatchProc * Tcl_ChannelWatchProc( +EXTERN Tcl_DriverWatchProc * Tcl_ChannelWatchProc( const Tcl_ChannelType *chanTypePtr); /* 409 */ -TCLAPI Tcl_DriverGetHandleProc * Tcl_ChannelGetHandleProc( +EXTERN Tcl_DriverGetHandleProc * Tcl_ChannelGetHandleProc( const Tcl_ChannelType *chanTypePtr); /* 410 */ -TCLAPI Tcl_DriverFlushProc * Tcl_ChannelFlushProc( +EXTERN Tcl_DriverFlushProc * Tcl_ChannelFlushProc( const Tcl_ChannelType *chanTypePtr); /* 411 */ -TCLAPI Tcl_DriverHandlerProc * Tcl_ChannelHandlerProc( +EXTERN Tcl_DriverHandlerProc * Tcl_ChannelHandlerProc( const Tcl_ChannelType *chanTypePtr); /* 412 */ -TCLAPI int Tcl_JoinThread(Tcl_ThreadId threadId, int *result); +EXTERN int Tcl_JoinThread(Tcl_ThreadId threadId, int *result); /* 413 */ -TCLAPI int Tcl_IsChannelShared(Tcl_Channel channel); +EXTERN int Tcl_IsChannelShared(Tcl_Channel channel); /* 414 */ -TCLAPI int Tcl_IsChannelRegistered(Tcl_Interp *interp, +EXTERN int Tcl_IsChannelRegistered(Tcl_Interp *interp, Tcl_Channel channel); /* 415 */ -TCLAPI void Tcl_CutChannel(Tcl_Channel channel); +EXTERN void Tcl_CutChannel(Tcl_Channel channel); /* 416 */ -TCLAPI void Tcl_SpliceChannel(Tcl_Channel channel); +EXTERN void Tcl_SpliceChannel(Tcl_Channel channel); /* 417 */ -TCLAPI void Tcl_ClearChannelHandlers(Tcl_Channel channel); +EXTERN void Tcl_ClearChannelHandlers(Tcl_Channel channel); /* 418 */ -TCLAPI int Tcl_IsChannelExisting(const char *channelName); +EXTERN int Tcl_IsChannelExisting(const char *channelName); /* 419 */ -TCLAPI int Tcl_UniCharNcasecmp(const Tcl_UniChar *ucs, +EXTERN int Tcl_UniCharNcasecmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 420 */ -TCLAPI int Tcl_UniCharCaseMatch(const Tcl_UniChar *uniStr, +EXTERN int Tcl_UniCharCaseMatch(const Tcl_UniChar *uniStr, const Tcl_UniChar *uniPattern, int nocase); /* 421 */ -TCLAPI Tcl_HashEntry * Tcl_FindHashEntry(Tcl_HashTable *tablePtr, +EXTERN Tcl_HashEntry * Tcl_FindHashEntry(Tcl_HashTable *tablePtr, const void *key); /* 422 */ -TCLAPI Tcl_HashEntry * Tcl_CreateHashEntry(Tcl_HashTable *tablePtr, +EXTERN Tcl_HashEntry * Tcl_CreateHashEntry(Tcl_HashTable *tablePtr, const void *key, int *newPtr); /* 423 */ -TCLAPI void Tcl_InitCustomHashTable(Tcl_HashTable *tablePtr, +EXTERN void Tcl_InitCustomHashTable(Tcl_HashTable *tablePtr, int keyType, const Tcl_HashKeyType *typePtr); /* 424 */ -TCLAPI void Tcl_InitObjHashTable(Tcl_HashTable *tablePtr); +EXTERN void Tcl_InitObjHashTable(Tcl_HashTable *tablePtr); /* 425 */ -TCLAPI ClientData Tcl_CommandTraceInfo(Tcl_Interp *interp, +EXTERN ClientData Tcl_CommandTraceInfo(Tcl_Interp *interp, const char *varName, int flags, Tcl_CommandTraceProc *procPtr, ClientData prevClientData); /* 426 */ -TCLAPI int Tcl_TraceCommand(Tcl_Interp *interp, +EXTERN int Tcl_TraceCommand(Tcl_Interp *interp, const char *varName, int flags, Tcl_CommandTraceProc *proc, ClientData clientData); /* 427 */ -TCLAPI void Tcl_UntraceCommand(Tcl_Interp *interp, +EXTERN void Tcl_UntraceCommand(Tcl_Interp *interp, const char *varName, int flags, Tcl_CommandTraceProc *proc, ClientData clientData); /* 428 */ -TCLAPI char * Tcl_AttemptAlloc(unsigned int size); +EXTERN char * Tcl_AttemptAlloc(unsigned int size); /* 429 */ -TCLAPI char * Tcl_AttemptDbCkalloc(unsigned int size, +EXTERN char * Tcl_AttemptDbCkalloc(unsigned int size, const char *file, int line); /* 430 */ -TCLAPI char * Tcl_AttemptRealloc(char *ptr, unsigned int size); +EXTERN char * Tcl_AttemptRealloc(char *ptr, unsigned int size); /* 431 */ -TCLAPI char * Tcl_AttemptDbCkrealloc(char *ptr, unsigned int size, +EXTERN char * Tcl_AttemptDbCkrealloc(char *ptr, unsigned int size, const char *file, int line); /* 432 */ -TCLAPI int Tcl_AttemptSetObjLength(Tcl_Obj *objPtr, int length); +EXTERN int Tcl_AttemptSetObjLength(Tcl_Obj *objPtr, int length); /* 433 */ -TCLAPI Tcl_ThreadId Tcl_GetChannelThread(Tcl_Channel channel); +EXTERN Tcl_ThreadId Tcl_GetChannelThread(Tcl_Channel channel); /* 434 */ -TCLAPI Tcl_UniChar * Tcl_GetUnicodeFromObj(Tcl_Obj *objPtr, +EXTERN Tcl_UniChar * Tcl_GetUnicodeFromObj(Tcl_Obj *objPtr, int *lengthPtr); -/* Slot 435 is reserved */ -/* Slot 436 is reserved */ +/* 435 */ +EXTERN int Tcl_GetMathFuncInfo(Tcl_Interp *interp, + const char *name, int *numArgsPtr, + Tcl_ValueType **argTypesPtr, + Tcl_MathProc **procPtr, + ClientData *clientDataPtr); +/* 436 */ +EXTERN Tcl_Obj * Tcl_ListMathFuncs(Tcl_Interp *interp, + const char *pattern); /* 437 */ -TCLAPI Tcl_Obj * Tcl_SubstObj(Tcl_Interp *interp, Tcl_Obj *objPtr, +EXTERN Tcl_Obj * Tcl_SubstObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int flags); /* 438 */ -TCLAPI int Tcl_DetachChannel(Tcl_Interp *interp, +EXTERN int Tcl_DetachChannel(Tcl_Interp *interp, Tcl_Channel channel); /* 439 */ -TCLAPI int Tcl_IsStandardChannel(Tcl_Channel channel); +EXTERN int Tcl_IsStandardChannel(Tcl_Channel channel); /* 440 */ -TCLAPI int Tcl_FSCopyFile(Tcl_Obj *srcPathPtr, +EXTERN int Tcl_FSCopyFile(Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr); /* 441 */ -TCLAPI int Tcl_FSCopyDirectory(Tcl_Obj *srcPathPtr, +EXTERN int Tcl_FSCopyDirectory(Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr, Tcl_Obj **errorPtr); /* 442 */ -TCLAPI int Tcl_FSCreateDirectory(Tcl_Obj *pathPtr); +EXTERN int Tcl_FSCreateDirectory(Tcl_Obj *pathPtr); /* 443 */ -TCLAPI int Tcl_FSDeleteFile(Tcl_Obj *pathPtr); +EXTERN int Tcl_FSDeleteFile(Tcl_Obj *pathPtr); /* 444 */ -TCLAPI int Tcl_FSLoadFile(Tcl_Interp *interp, Tcl_Obj *pathPtr, +EXTERN int Tcl_FSLoadFile(Tcl_Interp *interp, Tcl_Obj *pathPtr, const char *sym1, const char *sym2, Tcl_PackageInitProc **proc1Ptr, Tcl_PackageInitProc **proc2Ptr, Tcl_LoadHandle *handlePtr, Tcl_FSUnloadFileProc **unloadProcPtr); /* 445 */ -TCLAPI int Tcl_FSMatchInDirectory(Tcl_Interp *interp, +EXTERN int Tcl_FSMatchInDirectory(Tcl_Interp *interp, Tcl_Obj *result, Tcl_Obj *pathPtr, const char *pattern, Tcl_GlobTypeData *types); /* 446 */ -TCLAPI Tcl_Obj * Tcl_FSLink(Tcl_Obj *pathPtr, Tcl_Obj *toPtr, +EXTERN Tcl_Obj * Tcl_FSLink(Tcl_Obj *pathPtr, Tcl_Obj *toPtr, int linkAction); /* 447 */ -TCLAPI int Tcl_FSRemoveDirectory(Tcl_Obj *pathPtr, +EXTERN int Tcl_FSRemoveDirectory(Tcl_Obj *pathPtr, int recursive, Tcl_Obj **errorPtr); /* 448 */ -TCLAPI int Tcl_FSRenameFile(Tcl_Obj *srcPathPtr, +EXTERN int Tcl_FSRenameFile(Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr); /* 449 */ -TCLAPI int Tcl_FSLstat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf); +EXTERN int Tcl_FSLstat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf); /* 450 */ -TCLAPI int Tcl_FSUtime(Tcl_Obj *pathPtr, struct utimbuf *tval); +EXTERN int Tcl_FSUtime(Tcl_Obj *pathPtr, struct utimbuf *tval); /* 451 */ -TCLAPI int Tcl_FSFileAttrsGet(Tcl_Interp *interp, int index, +EXTERN int Tcl_FSFileAttrsGet(Tcl_Interp *interp, int index, Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef); /* 452 */ -TCLAPI int Tcl_FSFileAttrsSet(Tcl_Interp *interp, int index, +EXTERN int Tcl_FSFileAttrsSet(Tcl_Interp *interp, int index, Tcl_Obj *pathPtr, Tcl_Obj *objPtr); /* 453 */ -TCLAPI const char *const * Tcl_FSFileAttrStrings(Tcl_Obj *pathPtr, +EXTERN const char *CONST86 * Tcl_FSFileAttrStrings(Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef); /* 454 */ -TCLAPI int Tcl_FSStat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf); +EXTERN int Tcl_FSStat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf); /* 455 */ -TCLAPI int Tcl_FSAccess(Tcl_Obj *pathPtr, int mode); +EXTERN int Tcl_FSAccess(Tcl_Obj *pathPtr, int mode); /* 456 */ -TCLAPI Tcl_Channel Tcl_FSOpenFileChannel(Tcl_Interp *interp, +EXTERN Tcl_Channel Tcl_FSOpenFileChannel(Tcl_Interp *interp, Tcl_Obj *pathPtr, const char *modeString, int permissions); /* 457 */ -TCLAPI Tcl_Obj * Tcl_FSGetCwd(Tcl_Interp *interp); +EXTERN Tcl_Obj * Tcl_FSGetCwd(Tcl_Interp *interp); /* 458 */ -TCLAPI int Tcl_FSChdir(Tcl_Obj *pathPtr); +EXTERN int Tcl_FSChdir(Tcl_Obj *pathPtr); /* 459 */ -TCLAPI int Tcl_FSConvertToPathType(Tcl_Interp *interp, +EXTERN int Tcl_FSConvertToPathType(Tcl_Interp *interp, Tcl_Obj *pathPtr); /* 460 */ -TCLAPI Tcl_Obj * Tcl_FSJoinPath(Tcl_Obj *listObj, int elements); +EXTERN Tcl_Obj * Tcl_FSJoinPath(Tcl_Obj *listObj, int elements); /* 461 */ -TCLAPI Tcl_Obj * Tcl_FSSplitPath(Tcl_Obj *pathPtr, int *lenPtr); +EXTERN Tcl_Obj * Tcl_FSSplitPath(Tcl_Obj *pathPtr, int *lenPtr); /* 462 */ -TCLAPI int Tcl_FSEqualPaths(Tcl_Obj *firstPtr, +EXTERN int Tcl_FSEqualPaths(Tcl_Obj *firstPtr, Tcl_Obj *secondPtr); /* 463 */ -TCLAPI Tcl_Obj * Tcl_FSGetNormalizedPath(Tcl_Interp *interp, +EXTERN Tcl_Obj * Tcl_FSGetNormalizedPath(Tcl_Interp *interp, Tcl_Obj *pathPtr); /* 464 */ -TCLAPI Tcl_Obj * Tcl_FSJoinToPath(Tcl_Obj *pathPtr, int objc, +EXTERN Tcl_Obj * Tcl_FSJoinToPath(Tcl_Obj *pathPtr, int objc, Tcl_Obj *const objv[]); /* 465 */ -TCLAPI ClientData Tcl_FSGetInternalRep(Tcl_Obj *pathPtr, +EXTERN ClientData Tcl_FSGetInternalRep(Tcl_Obj *pathPtr, const Tcl_Filesystem *fsPtr); /* 466 */ -TCLAPI Tcl_Obj * Tcl_FSGetTranslatedPath(Tcl_Interp *interp, +EXTERN Tcl_Obj * Tcl_FSGetTranslatedPath(Tcl_Interp *interp, Tcl_Obj *pathPtr); /* 467 */ -TCLAPI int Tcl_FSEvalFile(Tcl_Interp *interp, Tcl_Obj *fileName); +EXTERN int Tcl_FSEvalFile(Tcl_Interp *interp, Tcl_Obj *fileName); /* 468 */ -TCLAPI Tcl_Obj * Tcl_FSNewNativePath( +EXTERN Tcl_Obj * Tcl_FSNewNativePath( const Tcl_Filesystem *fromFilesystem, ClientData clientData); /* 469 */ -TCLAPI const void * Tcl_FSGetNativePath(Tcl_Obj *pathPtr); +EXTERN const void * Tcl_FSGetNativePath(Tcl_Obj *pathPtr); /* 470 */ -TCLAPI Tcl_Obj * Tcl_FSFileSystemInfo(Tcl_Obj *pathPtr); +EXTERN Tcl_Obj * Tcl_FSFileSystemInfo(Tcl_Obj *pathPtr); /* 471 */ -TCLAPI Tcl_Obj * Tcl_FSPathSeparator(Tcl_Obj *pathPtr); +EXTERN Tcl_Obj * Tcl_FSPathSeparator(Tcl_Obj *pathPtr); /* 472 */ -TCLAPI Tcl_Obj * Tcl_FSListVolumes(void); +EXTERN Tcl_Obj * Tcl_FSListVolumes(void); /* 473 */ -TCLAPI int Tcl_FSRegister(ClientData clientData, +EXTERN int Tcl_FSRegister(ClientData clientData, const Tcl_Filesystem *fsPtr); /* 474 */ -TCLAPI int Tcl_FSUnregister(const Tcl_Filesystem *fsPtr); +EXTERN int Tcl_FSUnregister(const Tcl_Filesystem *fsPtr); /* 475 */ -TCLAPI ClientData Tcl_FSData(const Tcl_Filesystem *fsPtr); +EXTERN ClientData Tcl_FSData(const Tcl_Filesystem *fsPtr); /* 476 */ -TCLAPI const char * Tcl_FSGetTranslatedStringPath(Tcl_Interp *interp, +EXTERN const char * Tcl_FSGetTranslatedStringPath(Tcl_Interp *interp, Tcl_Obj *pathPtr); /* 477 */ -TCLAPI const Tcl_Filesystem * Tcl_FSGetFileSystemForPath(Tcl_Obj *pathPtr); +EXTERN CONST86 Tcl_Filesystem * Tcl_FSGetFileSystemForPath(Tcl_Obj *pathPtr); /* 478 */ -TCLAPI Tcl_PathType Tcl_FSGetPathType(Tcl_Obj *pathPtr); +EXTERN Tcl_PathType Tcl_FSGetPathType(Tcl_Obj *pathPtr); /* 479 */ -TCLAPI int Tcl_OutputBuffered(Tcl_Channel chan); +EXTERN int Tcl_OutputBuffered(Tcl_Channel chan); /* 480 */ -TCLAPI void Tcl_FSMountsChanged(const Tcl_Filesystem *fsPtr); +EXTERN void Tcl_FSMountsChanged(const Tcl_Filesystem *fsPtr); /* 481 */ -TCLAPI int Tcl_EvalTokensStandard(Tcl_Interp *interp, +EXTERN int Tcl_EvalTokensStandard(Tcl_Interp *interp, Tcl_Token *tokenPtr, int count); /* 482 */ -TCLAPI void Tcl_GetTime(Tcl_Time *timeBuf); +EXTERN void Tcl_GetTime(Tcl_Time *timeBuf); /* 483 */ -TCLAPI Tcl_Trace Tcl_CreateObjTrace(Tcl_Interp *interp, int level, +EXTERN Tcl_Trace Tcl_CreateObjTrace(Tcl_Interp *interp, int level, int flags, Tcl_CmdObjTraceProc *objProc, ClientData clientData, Tcl_CmdObjTraceDeleteProc *delProc); /* Slot 484 is reserved */ /* Slot 485 is reserved */ /* 486 */ -TCLAPI Tcl_Obj * Tcl_DbNewWideIntObj(Tcl_WideInt wideValue, +EXTERN Tcl_Obj * Tcl_DbNewWideIntObj(Tcl_WideInt wideValue, const char *file, int line); /* 487 */ -TCLAPI int Tcl_GetWideIntFromObj(Tcl_Interp *interp, +EXTERN int Tcl_GetWideIntFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_WideInt *widePtr); /* 488 */ -TCLAPI Tcl_Obj * Tcl_NewWideIntObj(Tcl_WideInt wideValue); +EXTERN Tcl_Obj * Tcl_NewWideIntObj(Tcl_WideInt wideValue); /* 489 */ -TCLAPI void Tcl_SetWideIntObj(Tcl_Obj *objPtr, +EXTERN void Tcl_SetWideIntObj(Tcl_Obj *objPtr, Tcl_WideInt wideValue); /* 490 */ -TCLAPI Tcl_StatBuf * Tcl_AllocStatBuf(void); +EXTERN Tcl_StatBuf * Tcl_AllocStatBuf(void); /* 491 */ -TCLAPI Tcl_WideInt Tcl_Seek(Tcl_Channel chan, Tcl_WideInt offset, +EXTERN Tcl_WideInt Tcl_Seek(Tcl_Channel chan, Tcl_WideInt offset, int mode); /* 492 */ -TCLAPI Tcl_WideInt Tcl_Tell(Tcl_Channel chan); +EXTERN Tcl_WideInt Tcl_Tell(Tcl_Channel chan); /* 493 */ -TCLAPI Tcl_DriverWideSeekProc * Tcl_ChannelWideSeekProc( +EXTERN Tcl_DriverWideSeekProc * Tcl_ChannelWideSeekProc( const Tcl_ChannelType *chanTypePtr); /* 494 */ -TCLAPI int Tcl_DictObjPut(Tcl_Interp *interp, Tcl_Obj *dictPtr, +EXTERN int Tcl_DictObjPut(Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Obj *keyPtr, Tcl_Obj *valuePtr); /* 495 */ -TCLAPI int Tcl_DictObjGet(Tcl_Interp *interp, Tcl_Obj *dictPtr, +EXTERN int Tcl_DictObjGet(Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Obj *keyPtr, Tcl_Obj **valuePtrPtr); /* 496 */ -TCLAPI int Tcl_DictObjRemove(Tcl_Interp *interp, +EXTERN int Tcl_DictObjRemove(Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Obj *keyPtr); /* 497 */ -TCLAPI int Tcl_DictObjSize(Tcl_Interp *interp, Tcl_Obj *dictPtr, +EXTERN int Tcl_DictObjSize(Tcl_Interp *interp, Tcl_Obj *dictPtr, int *sizePtr); /* 498 */ -TCLAPI int Tcl_DictObjFirst(Tcl_Interp *interp, +EXTERN int Tcl_DictObjFirst(Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_DictSearch *searchPtr, Tcl_Obj **keyPtrPtr, Tcl_Obj **valuePtrPtr, int *donePtr); /* 499 */ -TCLAPI void Tcl_DictObjNext(Tcl_DictSearch *searchPtr, +EXTERN void Tcl_DictObjNext(Tcl_DictSearch *searchPtr, Tcl_Obj **keyPtrPtr, Tcl_Obj **valuePtrPtr, int *donePtr); /* 500 */ -TCLAPI void Tcl_DictObjDone(Tcl_DictSearch *searchPtr); +EXTERN void Tcl_DictObjDone(Tcl_DictSearch *searchPtr); /* 501 */ -TCLAPI int Tcl_DictObjPutKeyList(Tcl_Interp *interp, +EXTERN int Tcl_DictObjPutKeyList(Tcl_Interp *interp, Tcl_Obj *dictPtr, int keyc, Tcl_Obj *const *keyv, Tcl_Obj *valuePtr); /* 502 */ -TCLAPI int Tcl_DictObjRemoveKeyList(Tcl_Interp *interp, +EXTERN int Tcl_DictObjRemoveKeyList(Tcl_Interp *interp, Tcl_Obj *dictPtr, int keyc, Tcl_Obj *const *keyv); /* 503 */ -TCLAPI Tcl_Obj * Tcl_NewDictObj(void); +EXTERN Tcl_Obj * Tcl_NewDictObj(void); /* 504 */ -TCLAPI Tcl_Obj * Tcl_DbNewDictObj(const char *file, int line); +EXTERN Tcl_Obj * Tcl_DbNewDictObj(const char *file, int line); /* 505 */ -TCLAPI void Tcl_RegisterConfig(Tcl_Interp *interp, +EXTERN void Tcl_RegisterConfig(Tcl_Interp *interp, const char *pkgName, const Tcl_Config *configuration, const char *valEncoding); /* 506 */ -TCLAPI Tcl_Namespace * Tcl_CreateNamespace(Tcl_Interp *interp, +EXTERN Tcl_Namespace * Tcl_CreateNamespace(Tcl_Interp *interp, const char *name, ClientData clientData, Tcl_NamespaceDeleteProc *deleteProc); /* 507 */ -TCLAPI void Tcl_DeleteNamespace(Tcl_Namespace *nsPtr); +EXTERN void Tcl_DeleteNamespace(Tcl_Namespace *nsPtr); /* 508 */ -TCLAPI int Tcl_AppendExportList(Tcl_Interp *interp, +EXTERN int Tcl_AppendExportList(Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *objPtr); /* 509 */ -TCLAPI int Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr, +EXTERN int Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int resetListFirst); /* 510 */ -TCLAPI int Tcl_Import(Tcl_Interp *interp, Tcl_Namespace *nsPtr, +EXTERN int Tcl_Import(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int allowOverwrite); /* 511 */ -TCLAPI int Tcl_ForgetImport(Tcl_Interp *interp, +EXTERN int Tcl_ForgetImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern); /* 512 */ -TCLAPI Tcl_Namespace * Tcl_GetCurrentNamespace(Tcl_Interp *interp); +EXTERN Tcl_Namespace * Tcl_GetCurrentNamespace(Tcl_Interp *interp); /* 513 */ -TCLAPI Tcl_Namespace * Tcl_GetGlobalNamespace(Tcl_Interp *interp); +EXTERN Tcl_Namespace * Tcl_GetGlobalNamespace(Tcl_Interp *interp); /* 514 */ -TCLAPI Tcl_Namespace * Tcl_FindNamespace(Tcl_Interp *interp, +EXTERN Tcl_Namespace * Tcl_FindNamespace(Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 515 */ -TCLAPI Tcl_Command Tcl_FindCommand(Tcl_Interp *interp, const char *name, +EXTERN Tcl_Command Tcl_FindCommand(Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 516 */ -TCLAPI Tcl_Command Tcl_GetCommandFromObj(Tcl_Interp *interp, +EXTERN Tcl_Command Tcl_GetCommandFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr); /* 517 */ -TCLAPI void Tcl_GetCommandFullName(Tcl_Interp *interp, +EXTERN void Tcl_GetCommandFullName(Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 518 */ -TCLAPI int Tcl_FSEvalFileEx(Tcl_Interp *interp, +EXTERN int Tcl_FSEvalFileEx(Tcl_Interp *interp, Tcl_Obj *fileName, const char *encodingName); /* 519 */ -TCLAPI Tcl_ExitProc * Tcl_SetExitProc(Tcl_ExitProc *proc); +EXTERN Tcl_ExitProc * Tcl_SetExitProc(Tcl_ExitProc *proc); /* 520 */ -TCLAPI void Tcl_LimitAddHandler(Tcl_Interp *interp, int type, +EXTERN void Tcl_LimitAddHandler(Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData, Tcl_LimitHandlerDeleteProc *deleteProc); /* 521 */ -TCLAPI void Tcl_LimitRemoveHandler(Tcl_Interp *interp, int type, +EXTERN void Tcl_LimitRemoveHandler(Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData); /* 522 */ -TCLAPI int Tcl_LimitReady(Tcl_Interp *interp); +EXTERN int Tcl_LimitReady(Tcl_Interp *interp); /* 523 */ -TCLAPI int Tcl_LimitCheck(Tcl_Interp *interp); +EXTERN int Tcl_LimitCheck(Tcl_Interp *interp); /* 524 */ -TCLAPI int Tcl_LimitExceeded(Tcl_Interp *interp); +EXTERN int Tcl_LimitExceeded(Tcl_Interp *interp); /* 525 */ -TCLAPI void Tcl_LimitSetCommands(Tcl_Interp *interp, +EXTERN void Tcl_LimitSetCommands(Tcl_Interp *interp, int commandLimit); /* 526 */ -TCLAPI void Tcl_LimitSetTime(Tcl_Interp *interp, +EXTERN void Tcl_LimitSetTime(Tcl_Interp *interp, Tcl_Time *timeLimitPtr); /* 527 */ -TCLAPI void Tcl_LimitSetGranularity(Tcl_Interp *interp, int type, +EXTERN void Tcl_LimitSetGranularity(Tcl_Interp *interp, int type, int granularity); /* 528 */ -TCLAPI int Tcl_LimitTypeEnabled(Tcl_Interp *interp, int type); +EXTERN int Tcl_LimitTypeEnabled(Tcl_Interp *interp, int type); /* 529 */ -TCLAPI int Tcl_LimitTypeExceeded(Tcl_Interp *interp, int type); +EXTERN int Tcl_LimitTypeExceeded(Tcl_Interp *interp, int type); /* 530 */ -TCLAPI void Tcl_LimitTypeSet(Tcl_Interp *interp, int type); +EXTERN void Tcl_LimitTypeSet(Tcl_Interp *interp, int type); /* 531 */ -TCLAPI void Tcl_LimitTypeReset(Tcl_Interp *interp, int type); +EXTERN void Tcl_LimitTypeReset(Tcl_Interp *interp, int type); /* 532 */ -TCLAPI int Tcl_LimitGetCommands(Tcl_Interp *interp); +EXTERN int Tcl_LimitGetCommands(Tcl_Interp *interp); /* 533 */ -TCLAPI void Tcl_LimitGetTime(Tcl_Interp *interp, +EXTERN void Tcl_LimitGetTime(Tcl_Interp *interp, Tcl_Time *timeLimitPtr); /* 534 */ -TCLAPI int Tcl_LimitGetGranularity(Tcl_Interp *interp, int type); +EXTERN int Tcl_LimitGetGranularity(Tcl_Interp *interp, int type); /* 535 */ -TCLAPI Tcl_InterpState Tcl_SaveInterpState(Tcl_Interp *interp, int status); +EXTERN Tcl_InterpState Tcl_SaveInterpState(Tcl_Interp *interp, int status); /* 536 */ -TCLAPI int Tcl_RestoreInterpState(Tcl_Interp *interp, +EXTERN int Tcl_RestoreInterpState(Tcl_Interp *interp, Tcl_InterpState state); /* 537 */ -TCLAPI void Tcl_DiscardInterpState(Tcl_InterpState state); +EXTERN void Tcl_DiscardInterpState(Tcl_InterpState state); /* 538 */ -TCLAPI int Tcl_SetReturnOptions(Tcl_Interp *interp, +EXTERN int Tcl_SetReturnOptions(Tcl_Interp *interp, Tcl_Obj *options); /* 539 */ -TCLAPI Tcl_Obj * Tcl_GetReturnOptions(Tcl_Interp *interp, int result); +EXTERN Tcl_Obj * Tcl_GetReturnOptions(Tcl_Interp *interp, int result); /* 540 */ -TCLAPI int Tcl_IsEnsemble(Tcl_Command token); +EXTERN int Tcl_IsEnsemble(Tcl_Command token); /* 541 */ -TCLAPI Tcl_Command Tcl_CreateEnsemble(Tcl_Interp *interp, +EXTERN Tcl_Command Tcl_CreateEnsemble(Tcl_Interp *interp, const char *name, Tcl_Namespace *namespacePtr, int flags); /* 542 */ -TCLAPI Tcl_Command Tcl_FindEnsemble(Tcl_Interp *interp, +EXTERN Tcl_Command Tcl_FindEnsemble(Tcl_Interp *interp, Tcl_Obj *cmdNameObj, int flags); /* 543 */ -TCLAPI int Tcl_SetEnsembleSubcommandList(Tcl_Interp *interp, +EXTERN int Tcl_SetEnsembleSubcommandList(Tcl_Interp *interp, Tcl_Command token, Tcl_Obj *subcmdList); /* 544 */ -TCLAPI int Tcl_SetEnsembleMappingDict(Tcl_Interp *interp, +EXTERN int Tcl_SetEnsembleMappingDict(Tcl_Interp *interp, Tcl_Command token, Tcl_Obj *mapDict); /* 545 */ -TCLAPI int Tcl_SetEnsembleUnknownHandler(Tcl_Interp *interp, +EXTERN int Tcl_SetEnsembleUnknownHandler(Tcl_Interp *interp, Tcl_Command token, Tcl_Obj *unknownList); /* 546 */ -TCLAPI int Tcl_SetEnsembleFlags(Tcl_Interp *interp, +EXTERN int Tcl_SetEnsembleFlags(Tcl_Interp *interp, Tcl_Command token, int flags); /* 547 */ -TCLAPI int Tcl_GetEnsembleSubcommandList(Tcl_Interp *interp, +EXTERN int Tcl_GetEnsembleSubcommandList(Tcl_Interp *interp, Tcl_Command token, Tcl_Obj **subcmdListPtr); /* 548 */ -TCLAPI int Tcl_GetEnsembleMappingDict(Tcl_Interp *interp, +EXTERN int Tcl_GetEnsembleMappingDict(Tcl_Interp *interp, Tcl_Command token, Tcl_Obj **mapDictPtr); /* 549 */ -TCLAPI int Tcl_GetEnsembleUnknownHandler(Tcl_Interp *interp, +EXTERN int Tcl_GetEnsembleUnknownHandler(Tcl_Interp *interp, Tcl_Command token, Tcl_Obj **unknownListPtr); /* 550 */ -TCLAPI int Tcl_GetEnsembleFlags(Tcl_Interp *interp, +EXTERN int Tcl_GetEnsembleFlags(Tcl_Interp *interp, Tcl_Command token, int *flagsPtr); /* 551 */ -TCLAPI int Tcl_GetEnsembleNamespace(Tcl_Interp *interp, +EXTERN int Tcl_GetEnsembleNamespace(Tcl_Interp *interp, Tcl_Command token, Tcl_Namespace **namespacePtrPtr); /* 552 */ -TCLAPI void Tcl_SetTimeProc(Tcl_GetTimeProc *getProc, +EXTERN void Tcl_SetTimeProc(Tcl_GetTimeProc *getProc, Tcl_ScaleTimeProc *scaleProc, ClientData clientData); /* 553 */ -TCLAPI void Tcl_QueryTimeProc(Tcl_GetTimeProc **getProc, +EXTERN void Tcl_QueryTimeProc(Tcl_GetTimeProc **getProc, Tcl_ScaleTimeProc **scaleProc, ClientData *clientData); /* 554 */ -TCLAPI Tcl_DriverThreadActionProc * Tcl_ChannelThreadActionProc( +EXTERN Tcl_DriverThreadActionProc * Tcl_ChannelThreadActionProc( const Tcl_ChannelType *chanTypePtr); /* 555 */ -TCLAPI Tcl_Obj * Tcl_NewBignumObj(mp_int *value); +EXTERN Tcl_Obj * Tcl_NewBignumObj(mp_int *value); /* 556 */ -TCLAPI Tcl_Obj * Tcl_DbNewBignumObj(mp_int *value, const char *file, +EXTERN Tcl_Obj * Tcl_DbNewBignumObj(mp_int *value, const char *file, int line); /* 557 */ -TCLAPI void Tcl_SetBignumObj(Tcl_Obj *obj, mp_int *value); +EXTERN void Tcl_SetBignumObj(Tcl_Obj *obj, mp_int *value); /* 558 */ -TCLAPI int Tcl_GetBignumFromObj(Tcl_Interp *interp, +EXTERN int Tcl_GetBignumFromObj(Tcl_Interp *interp, Tcl_Obj *obj, mp_int *value); /* 559 */ -TCLAPI int Tcl_TakeBignumFromObj(Tcl_Interp *interp, +EXTERN int Tcl_TakeBignumFromObj(Tcl_Interp *interp, Tcl_Obj *obj, mp_int *value); /* 560 */ -TCLAPI int Tcl_TruncateChannel(Tcl_Channel chan, +EXTERN int Tcl_TruncateChannel(Tcl_Channel chan, Tcl_WideInt length); /* 561 */ -TCLAPI Tcl_DriverTruncateProc * Tcl_ChannelTruncateProc( +EXTERN Tcl_DriverTruncateProc * Tcl_ChannelTruncateProc( const Tcl_ChannelType *chanTypePtr); /* 562 */ -TCLAPI void Tcl_SetChannelErrorInterp(Tcl_Interp *interp, +EXTERN void Tcl_SetChannelErrorInterp(Tcl_Interp *interp, Tcl_Obj *msg); /* 563 */ -TCLAPI void Tcl_GetChannelErrorInterp(Tcl_Interp *interp, +EXTERN void Tcl_GetChannelErrorInterp(Tcl_Interp *interp, Tcl_Obj **msg); /* 564 */ -TCLAPI void Tcl_SetChannelError(Tcl_Channel chan, Tcl_Obj *msg); +EXTERN void Tcl_SetChannelError(Tcl_Channel chan, Tcl_Obj *msg); /* 565 */ -TCLAPI void Tcl_GetChannelError(Tcl_Channel chan, Tcl_Obj **msg); +EXTERN void Tcl_GetChannelError(Tcl_Channel chan, Tcl_Obj **msg); /* 566 */ -TCLAPI int Tcl_InitBignumFromDouble(Tcl_Interp *interp, +EXTERN int Tcl_InitBignumFromDouble(Tcl_Interp *interp, double initval, mp_int *toInit); /* 567 */ -TCLAPI Tcl_Obj * Tcl_GetNamespaceUnknownHandler(Tcl_Interp *interp, +EXTERN Tcl_Obj * Tcl_GetNamespaceUnknownHandler(Tcl_Interp *interp, Tcl_Namespace *nsPtr); /* 568 */ -TCLAPI int Tcl_SetNamespaceUnknownHandler(Tcl_Interp *interp, +EXTERN int Tcl_SetNamespaceUnknownHandler(Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *handlerPtr); /* 569 */ -TCLAPI int Tcl_GetEncodingFromObj(Tcl_Interp *interp, +EXTERN int Tcl_GetEncodingFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Encoding *encodingPtr); /* 570 */ -TCLAPI Tcl_Obj * Tcl_GetEncodingSearchPath(void); +EXTERN Tcl_Obj * Tcl_GetEncodingSearchPath(void); /* 571 */ -TCLAPI int Tcl_SetEncodingSearchPath(Tcl_Obj *searchPath); +EXTERN int Tcl_SetEncodingSearchPath(Tcl_Obj *searchPath); /* 572 */ -TCLAPI const char * Tcl_GetEncodingNameFromEnvironment( +EXTERN const char * Tcl_GetEncodingNameFromEnvironment( Tcl_DString *bufPtr); /* 573 */ -TCLAPI int Tcl_PkgRequireProc(Tcl_Interp *interp, +EXTERN int Tcl_PkgRequireProc(Tcl_Interp *interp, const char *name, int objc, Tcl_Obj *const objv[], void *clientDataPtr); /* 574 */ -TCLAPI void Tcl_AppendObjToErrorInfo(Tcl_Interp *interp, +EXTERN void Tcl_AppendObjToErrorInfo(Tcl_Interp *interp, Tcl_Obj *objPtr); /* 575 */ -TCLAPI void Tcl_AppendLimitedToObj(Tcl_Obj *objPtr, +EXTERN void Tcl_AppendLimitedToObj(Tcl_Obj *objPtr, const char *bytes, int length, int limit, const char *ellipsis); /* 576 */ -TCLAPI Tcl_Obj * Tcl_Format(Tcl_Interp *interp, const char *format, +EXTERN Tcl_Obj * Tcl_Format(Tcl_Interp *interp, const char *format, int objc, Tcl_Obj *const objv[]); /* 577 */ -TCLAPI int Tcl_AppendFormatToObj(Tcl_Interp *interp, +EXTERN int Tcl_AppendFormatToObj(Tcl_Interp *interp, Tcl_Obj *objPtr, const char *format, int objc, Tcl_Obj *const objv[]); /* 578 */ -TCLAPI Tcl_Obj * Tcl_ObjPrintf(const char *format, ...) TCL_FORMAT_PRINTF(1, 2); +EXTERN Tcl_Obj * Tcl_ObjPrintf(const char *format, ...) TCL_FORMAT_PRINTF(1, 2); /* 579 */ -TCLAPI void Tcl_AppendPrintfToObj(Tcl_Obj *objPtr, +EXTERN void Tcl_AppendPrintfToObj(Tcl_Obj *objPtr, const char *format, ...) TCL_FORMAT_PRINTF(2, 3); /* 580 */ -TCLAPI int Tcl_CancelEval(Tcl_Interp *interp, +EXTERN int Tcl_CancelEval(Tcl_Interp *interp, Tcl_Obj *resultObjPtr, ClientData clientData, int flags); /* 581 */ -TCLAPI int Tcl_Canceled(Tcl_Interp *interp, int flags); +EXTERN int Tcl_Canceled(Tcl_Interp *interp, int flags); /* 582 */ -TCLAPI int Tcl_CreatePipe(Tcl_Interp *interp, +EXTERN int Tcl_CreatePipe(Tcl_Interp *interp, Tcl_Channel *rchan, Tcl_Channel *wchan, int flags); /* Slot 583 is reserved */ /* 584 */ -TCLAPI int Tcl_NREvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr, +EXTERN int Tcl_NREvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int flags); /* 585 */ -TCLAPI int Tcl_NREvalObjv(Tcl_Interp *interp, int objc, +EXTERN int Tcl_NREvalObjv(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags); /* 586 */ -TCLAPI int Tcl_NRCmdSwap(Tcl_Interp *interp, Tcl_Command cmd, +EXTERN int Tcl_NRCmdSwap(Tcl_Interp *interp, Tcl_Command cmd, int objc, Tcl_Obj *const objv[], int flags); /* 587 */ -TCLAPI void Tcl_NRAddCallback(Tcl_Interp *interp, +EXTERN void Tcl_NRAddCallback(Tcl_Interp *interp, Tcl_NRPostProc *postProcPtr, ClientData data0, ClientData data1, ClientData data2, ClientData data3); /* 588 */ -TCLAPI int Tcl_NRCallObjProc(Tcl_Interp *interp, +EXTERN int Tcl_NRCallObjProc(Tcl_Interp *interp, Tcl_ObjCmdProc *objProc, ClientData clientData, int objc, Tcl_Obj *const objv[]); /* 589 */ -TCLAPI unsigned Tcl_GetFSDeviceFromStat(const Tcl_StatBuf *statPtr); +EXTERN unsigned Tcl_GetFSDeviceFromStat(const Tcl_StatBuf *statPtr); /* 590 */ -TCLAPI unsigned Tcl_GetFSInodeFromStat(const Tcl_StatBuf *statPtr); +EXTERN unsigned Tcl_GetFSInodeFromStat(const Tcl_StatBuf *statPtr); /* 591 */ -TCLAPI unsigned Tcl_GetModeFromStat(const Tcl_StatBuf *statPtr); +EXTERN unsigned Tcl_GetModeFromStat(const Tcl_StatBuf *statPtr); /* 592 */ -TCLAPI int Tcl_GetLinkCountFromStat(const Tcl_StatBuf *statPtr); +EXTERN int Tcl_GetLinkCountFromStat(const Tcl_StatBuf *statPtr); /* 593 */ -TCLAPI int Tcl_GetUserIdFromStat(const Tcl_StatBuf *statPtr); +EXTERN int Tcl_GetUserIdFromStat(const Tcl_StatBuf *statPtr); /* 594 */ -TCLAPI int Tcl_GetGroupIdFromStat(const Tcl_StatBuf *statPtr); +EXTERN int Tcl_GetGroupIdFromStat(const Tcl_StatBuf *statPtr); /* 595 */ -TCLAPI int Tcl_GetDeviceTypeFromStat(const Tcl_StatBuf *statPtr); +EXTERN int Tcl_GetDeviceTypeFromStat(const Tcl_StatBuf *statPtr); /* 596 */ -TCLAPI Tcl_WideInt Tcl_GetAccessTimeFromStat(const Tcl_StatBuf *statPtr); +EXTERN Tcl_WideInt Tcl_GetAccessTimeFromStat(const Tcl_StatBuf *statPtr); /* 597 */ -TCLAPI Tcl_WideInt Tcl_GetModificationTimeFromStat( +EXTERN Tcl_WideInt Tcl_GetModificationTimeFromStat( const Tcl_StatBuf *statPtr); /* 598 */ -TCLAPI Tcl_WideInt Tcl_GetChangeTimeFromStat(const Tcl_StatBuf *statPtr); +EXTERN Tcl_WideInt Tcl_GetChangeTimeFromStat(const Tcl_StatBuf *statPtr); /* 599 */ -TCLAPI Tcl_WideUInt Tcl_GetSizeFromStat(const Tcl_StatBuf *statPtr); +EXTERN Tcl_WideUInt Tcl_GetSizeFromStat(const Tcl_StatBuf *statPtr); /* 600 */ -TCLAPI Tcl_WideUInt Tcl_GetBlocksFromStat(const Tcl_StatBuf *statPtr); +EXTERN Tcl_WideUInt Tcl_GetBlocksFromStat(const Tcl_StatBuf *statPtr); /* 601 */ -TCLAPI unsigned Tcl_GetBlockSizeFromStat(const Tcl_StatBuf *statPtr); +EXTERN unsigned Tcl_GetBlockSizeFromStat(const Tcl_StatBuf *statPtr); /* 602 */ -TCLAPI int Tcl_SetEnsembleParameterList(Tcl_Interp *interp, +EXTERN int Tcl_SetEnsembleParameterList(Tcl_Interp *interp, Tcl_Command token, Tcl_Obj *paramList); /* 603 */ -TCLAPI int Tcl_GetEnsembleParameterList(Tcl_Interp *interp, +EXTERN int Tcl_GetEnsembleParameterList(Tcl_Interp *interp, Tcl_Command token, Tcl_Obj **paramListPtr); /* 604 */ -TCLAPI int Tcl_ParseArgsObjv(Tcl_Interp *interp, +EXTERN int Tcl_ParseArgsObjv(Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, int *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv); /* 605 */ -TCLAPI int Tcl_GetErrorLine(Tcl_Interp *interp); +EXTERN int Tcl_GetErrorLine(Tcl_Interp *interp); /* 606 */ -TCLAPI void Tcl_SetErrorLine(Tcl_Interp *interp, int lineNum); +EXTERN void Tcl_SetErrorLine(Tcl_Interp *interp, int lineNum); /* 607 */ -TCLAPI void Tcl_TransferResult(Tcl_Interp *sourceInterp, +EXTERN void Tcl_TransferResult(Tcl_Interp *sourceInterp, int result, Tcl_Interp *targetInterp); /* 608 */ -TCLAPI int Tcl_InterpActive(Tcl_Interp *interp); +EXTERN int Tcl_InterpActive(Tcl_Interp *interp); /* 609 */ -TCLAPI void Tcl_BackgroundException(Tcl_Interp *interp, int code); +EXTERN void Tcl_BackgroundException(Tcl_Interp *interp, int code); /* 610 */ -TCLAPI int Tcl_ZlibDeflate(Tcl_Interp *interp, int format, +EXTERN int Tcl_ZlibDeflate(Tcl_Interp *interp, int format, Tcl_Obj *data, int level, Tcl_Obj *gzipHeaderDictObj); /* 611 */ -TCLAPI int Tcl_ZlibInflate(Tcl_Interp *interp, int format, +EXTERN int Tcl_ZlibInflate(Tcl_Interp *interp, int format, Tcl_Obj *data, int buffersize, Tcl_Obj *gzipHeaderDictObj); /* 612 */ -TCLAPI unsigned int Tcl_ZlibCRC32(unsigned int crc, +EXTERN unsigned int Tcl_ZlibCRC32(unsigned int crc, const unsigned char *buf, int len); /* 613 */ -TCLAPI unsigned int Tcl_ZlibAdler32(unsigned int adler, +EXTERN unsigned int Tcl_ZlibAdler32(unsigned int adler, const unsigned char *buf, int len); /* 614 */ -TCLAPI int Tcl_ZlibStreamInit(Tcl_Interp *interp, int mode, +EXTERN int Tcl_ZlibStreamInit(Tcl_Interp *interp, int mode, int format, int level, Tcl_Obj *dictObj, Tcl_ZlibStream *zshandle); /* 615 */ -TCLAPI Tcl_Obj * Tcl_ZlibStreamGetCommandName(Tcl_ZlibStream zshandle); +EXTERN Tcl_Obj * Tcl_ZlibStreamGetCommandName(Tcl_ZlibStream zshandle); /* 616 */ -TCLAPI int Tcl_ZlibStreamEof(Tcl_ZlibStream zshandle); +EXTERN int Tcl_ZlibStreamEof(Tcl_ZlibStream zshandle); /* 617 */ -TCLAPI int Tcl_ZlibStreamChecksum(Tcl_ZlibStream zshandle); +EXTERN int Tcl_ZlibStreamChecksum(Tcl_ZlibStream zshandle); /* 618 */ -TCLAPI int Tcl_ZlibStreamPut(Tcl_ZlibStream zshandle, +EXTERN int Tcl_ZlibStreamPut(Tcl_ZlibStream zshandle, Tcl_Obj *data, int flush); /* 619 */ -TCLAPI int Tcl_ZlibStreamGet(Tcl_ZlibStream zshandle, +EXTERN int Tcl_ZlibStreamGet(Tcl_ZlibStream zshandle, Tcl_Obj *data, int count); /* 620 */ -TCLAPI int Tcl_ZlibStreamClose(Tcl_ZlibStream zshandle); +EXTERN int Tcl_ZlibStreamClose(Tcl_ZlibStream zshandle); /* 621 */ -TCLAPI int Tcl_ZlibStreamReset(Tcl_ZlibStream zshandle); +EXTERN int Tcl_ZlibStreamReset(Tcl_ZlibStream zshandle); /* 622 */ -TCLAPI void Tcl_SetStartupScript(Tcl_Obj *path, +EXTERN void Tcl_SetStartupScript(Tcl_Obj *path, const char *encoding); /* 623 */ -TCLAPI Tcl_Obj * Tcl_GetStartupScript(const char **encodingPtr); +EXTERN Tcl_Obj * Tcl_GetStartupScript(const char **encodingPtr); /* 624 */ -TCLAPI int Tcl_CloseEx(Tcl_Interp *interp, Tcl_Channel chan, +EXTERN int Tcl_CloseEx(Tcl_Interp *interp, Tcl_Channel chan, int flags); /* 625 */ -TCLAPI int Tcl_NRExprObj(Tcl_Interp *interp, Tcl_Obj *objPtr, +EXTERN int Tcl_NRExprObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Obj *resultPtr); /* 626 */ -TCLAPI int Tcl_NRSubstObj(Tcl_Interp *interp, Tcl_Obj *objPtr, +EXTERN int Tcl_NRSubstObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int flags); /* 627 */ -TCLAPI int Tcl_LoadFile(Tcl_Interp *interp, Tcl_Obj *pathPtr, +EXTERN int Tcl_LoadFile(Tcl_Interp *interp, Tcl_Obj *pathPtr, const char *const symv[], int flags, void *procPtrs, Tcl_LoadHandle *handlePtr); /* 628 */ -TCLAPI void * Tcl_FindSymbol(Tcl_Interp *interp, +EXTERN void * Tcl_FindSymbol(Tcl_Interp *interp, Tcl_LoadHandle handle, const char *symbol); /* 629 */ -TCLAPI int Tcl_FSUnloadFile(Tcl_Interp *interp, +EXTERN int Tcl_FSUnloadFile(Tcl_Interp *interp, Tcl_LoadHandle handlePtr); /* 630 */ -TCLAPI void Tcl_ZlibStreamSetCompressionDictionary( +EXTERN void Tcl_ZlibStreamSetCompressionDictionary( Tcl_ZlibStream zhandle, Tcl_Obj *compressionDictionaryObj); @@ -1763,7 +1806,7 @@ typedef struct TclStubs { const TclStubHooks *hooks; int (*tcl_PkgProvideEx) (Tcl_Interp *interp, const char *name, const char *version, const void *clientData); /* 0 */ - const char * (*tcl_PkgRequireEx) (Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr); /* 1 */ + CONST84_RETURN char * (*tcl_PkgRequireEx) (Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr); /* 1 */ void (*tcl_Panic) (const char *format, ...) TCL_FORMAT_PRINTF(1, 2); /* 2 */ char * (*tcl_Alloc) (unsigned int size); /* 3 */ void (*tcl_Free) (char *ptr); /* 4 */ @@ -1814,11 +1857,11 @@ typedef struct TclStubs { unsigned char * (*tcl_GetByteArrayFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 33 */ int (*tcl_GetDouble) (Tcl_Interp *interp, const char *src, double *doublePtr); /* 34 */ int (*tcl_GetDoubleFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, double *doublePtr); /* 35 */ - int (*tcl_GetIndexFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, const char *const *tablePtr, const char *msg, int flags, int *indexPtr); /* 36 */ + int (*tcl_GetIndexFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, CONST84 char *const *tablePtr, const char *msg, int flags, int *indexPtr); /* 36 */ int (*tcl_GetInt) (Tcl_Interp *interp, const char *src, int *intPtr); /* 37 */ int (*tcl_GetIntFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *intPtr); /* 38 */ int (*tcl_GetLongFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, long *longPtr); /* 39 */ - const Tcl_ObjType * (*tcl_GetObjType) (const char *typeName); /* 40 */ + CONST86 Tcl_ObjType * (*tcl_GetObjType) (const char *typeName); /* 40 */ char * (*tcl_GetStringFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 41 */ void (*tcl_InvalidateStringRep) (Tcl_Obj *objPtr); /* 42 */ int (*tcl_ListObjAppendList) (Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *elemListPtr); /* 43 */ @@ -1855,16 +1898,16 @@ typedef struct TclStubs { void (*tcl_AsyncMark) (Tcl_AsyncHandler async); /* 74 */ int (*tcl_AsyncReady) (void); /* 75 */ void (*tcl_BackgroundError) (Tcl_Interp *interp); /* 76 */ - void (*reserved77)(void); + char (*tcl_Backslash) (const char *src, int *readPtr); /* 77 */ int (*tcl_BadChannelOption) (Tcl_Interp *interp, const char *optionName, const char *optionList); /* 78 */ void (*tcl_CallWhenDeleted) (Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, ClientData clientData); /* 79 */ void (*tcl_CancelIdleCall) (Tcl_IdleProc *idleProc, ClientData clientData); /* 80 */ int (*tcl_Close) (Tcl_Interp *interp, Tcl_Channel chan); /* 81 */ int (*tcl_CommandComplete) (const char *cmd); /* 82 */ - char * (*tcl_Concat) (int argc, const char *const *argv); /* 83 */ + char * (*tcl_Concat) (int argc, CONST84 char *const *argv); /* 83 */ int (*tcl_ConvertElement) (const char *src, char *dst, int flags); /* 84 */ int (*tcl_ConvertCountedElement) (const char *src, int length, char *dst, int flags); /* 85 */ - int (*tcl_CreateAlias) (Tcl_Interp *slave, const char *slaveCmd, Tcl_Interp *target, const char *targetCmd, int argc, const char *const *argv); /* 86 */ + int (*tcl_CreateAlias) (Tcl_Interp *slave, const char *slaveCmd, Tcl_Interp *target, const char *targetCmd, int argc, CONST84 char *const *argv); /* 86 */ int (*tcl_CreateAliasObj) (Tcl_Interp *slave, const char *slaveCmd, Tcl_Interp *target, const char *targetCmd, int objc, Tcl_Obj *const objv[]); /* 87 */ Tcl_Channel (*tcl_CreateChannel) (const Tcl_ChannelType *typePtr, const char *chanName, ClientData instanceData, int mask); /* 88 */ void (*tcl_CreateChannelHandler) (Tcl_Channel chan, int mask, Tcl_ChannelProc *proc, ClientData clientData); /* 89 */ @@ -1873,7 +1916,7 @@ typedef struct TclStubs { void (*tcl_CreateEventSource) (Tcl_EventSetupProc *setupProc, Tcl_EventCheckProc *checkProc, ClientData clientData); /* 92 */ void (*tcl_CreateExitHandler) (Tcl_ExitProc *proc, ClientData clientData); /* 93 */ Tcl_Interp * (*tcl_CreateInterp) (void); /* 94 */ - void (*reserved95)(void); + void (*tcl_CreateMathFunc) (Tcl_Interp *interp, const char *name, int numArgs, Tcl_ValueType *argTypes, Tcl_MathProc *proc, ClientData clientData); /* 95 */ Tcl_Command (*tcl_CreateObjCommand) (Tcl_Interp *interp, const char *cmdName, Tcl_ObjCmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc); /* 96 */ Tcl_Interp * (*tcl_CreateSlave) (Tcl_Interp *interp, const char *slaveName, int isSafe); /* 97 */ Tcl_TimerToken (*tcl_CreateTimerHandler) (int milliseconds, Tcl_TimerProc *proc, ClientData clientData); /* 98 */ @@ -1905,10 +1948,10 @@ typedef struct TclStubs { void (*tcl_DStringSetLength) (Tcl_DString *dsPtr, int length); /* 124 */ void (*tcl_DStringStartSublist) (Tcl_DString *dsPtr); /* 125 */ int (*tcl_Eof) (Tcl_Channel chan); /* 126 */ - const char * (*tcl_ErrnoId) (void); /* 127 */ - const char * (*tcl_ErrnoMsg) (int err); /* 128 */ + CONST84_RETURN char * (*tcl_ErrnoId) (void); /* 127 */ + CONST84_RETURN char * (*tcl_ErrnoMsg) (int err); /* 128 */ int (*tcl_Eval) (Tcl_Interp *interp, const char *script); /* 129 */ - void (*reserved130)(void); + int (*tcl_EvalFile) (Tcl_Interp *interp, const char *fileName); /* 130 */ void (*reserved131)(void); void (*tcl_EventuallyFree) (ClientData clientData, Tcl_FreeProc *freeProc); /* 132 */ void (*tcl_Exit) (int status); /* 133 */ @@ -1922,25 +1965,25 @@ typedef struct TclStubs { int (*tcl_ExprObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Obj **resultPtrPtr); /* 141 */ int (*tcl_ExprString) (Tcl_Interp *interp, const char *expr); /* 142 */ void (*tcl_Finalize) (void); /* 143 */ - void (*reserved144)(void); + void (*tcl_FindExecutable) (const char *argv0); /* 144 */ Tcl_HashEntry * (*tcl_FirstHashEntry) (Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 145 */ int (*tcl_Flush) (Tcl_Channel chan); /* 146 */ void (*tcl_FreeResult) (Tcl_Interp *interp); /* 147 */ - int (*tcl_GetAlias) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *argcPtr, const char ***argvPtr); /* 148 */ - int (*tcl_GetAliasObj) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 149 */ + int (*tcl_GetAlias) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, CONST84 char **targetCmdPtr, int *argcPtr, CONST84 char ***argvPtr); /* 148 */ + int (*tcl_GetAliasObj) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, CONST84 char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 149 */ ClientData (*tcl_GetAssocData) (Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc **procPtr); /* 150 */ Tcl_Channel (*tcl_GetChannel) (Tcl_Interp *interp, const char *chanName, int *modePtr); /* 151 */ int (*tcl_GetChannelBufferSize) (Tcl_Channel chan); /* 152 */ int (*tcl_GetChannelHandle) (Tcl_Channel chan, int direction, ClientData *handlePtr); /* 153 */ ClientData (*tcl_GetChannelInstanceData) (Tcl_Channel chan); /* 154 */ int (*tcl_GetChannelMode) (Tcl_Channel chan); /* 155 */ - const char * (*tcl_GetChannelName) (Tcl_Channel chan); /* 156 */ + CONST84_RETURN char * (*tcl_GetChannelName) (Tcl_Channel chan); /* 156 */ int (*tcl_GetChannelOption) (Tcl_Interp *interp, Tcl_Channel chan, const char *optionName, Tcl_DString *dsPtr); /* 157 */ - const Tcl_ChannelType * (*tcl_GetChannelType) (Tcl_Channel chan); /* 158 */ + CONST86 Tcl_ChannelType * (*tcl_GetChannelType) (Tcl_Channel chan); /* 158 */ void (*reserved159)(void); - const char * (*tcl_GetCommandName) (Tcl_Interp *interp, Tcl_Command command); /* 160 */ + CONST84_RETURN char * (*tcl_GetCommandName) (Tcl_Interp *interp, Tcl_Command command); /* 160 */ int (*tcl_GetErrno) (void); /* 161 */ - const char * (*tcl_GetHostName) (void); /* 162 */ + CONST84_RETURN char * (*tcl_GetHostName) (void); /* 162 */ int (*tcl_GetInterpPath) (Tcl_Interp *askInterp, Tcl_Interp *slaveInterp); /* 163 */ Tcl_Interp * (*tcl_GetMaster) (Tcl_Interp *interp); /* 164 */ const char * (*tcl_GetNameOfExecutable) (void); /* 165 */ @@ -1960,10 +2003,10 @@ typedef struct TclStubs { int (*tcl_GetServiceMode) (void); /* 171 */ Tcl_Interp * (*tcl_GetSlave) (Tcl_Interp *interp, const char *slaveName); /* 172 */ Tcl_Channel (*tcl_GetStdChannel) (int type); /* 173 */ - const char * (*tcl_GetStringResult) (Tcl_Interp *interp); /* 174 */ - const char * (*tcl_GetVar) (Tcl_Interp *interp, const char *varName, int flags); /* 175 */ - const char * (*tcl_GetVar2) (Tcl_Interp *interp, const char *part1, const char *part2, int flags); /* 176 */ - void (*reserved177)(void); + CONST84_RETURN char * (*tcl_GetStringResult) (Tcl_Interp *interp); /* 174 */ + CONST84_RETURN char * (*tcl_GetVar) (Tcl_Interp *interp, const char *varName, int flags); /* 175 */ + CONST84_RETURN char * (*tcl_GetVar2) (Tcl_Interp *interp, const char *part1, const char *part2, int flags); /* 176 */ + int (*tcl_GlobalEval) (Tcl_Interp *interp, const char *command); /* 177 */ void (*reserved178)(void); int (*tcl_HideCommand) (Tcl_Interp *interp, const char *cmdName, const char *hiddenCmdToken); /* 179 */ int (*tcl_Init) (Tcl_Interp *interp); /* 180 */ @@ -1972,25 +2015,25 @@ typedef struct TclStubs { int (*tcl_InputBuffered) (Tcl_Channel chan); /* 183 */ int (*tcl_InterpDeleted) (Tcl_Interp *interp); /* 184 */ int (*tcl_IsSafe) (Tcl_Interp *interp); /* 185 */ - char * (*tcl_JoinPath) (int argc, const char *const *argv, Tcl_DString *resultPtr); /* 186 */ + char * (*tcl_JoinPath) (int argc, CONST84 char *const *argv, Tcl_DString *resultPtr); /* 186 */ int (*tcl_LinkVar) (Tcl_Interp *interp, const char *varName, char *addr, int type); /* 187 */ void (*reserved188)(void); Tcl_Channel (*tcl_MakeFileChannel) (ClientData handle, int mode); /* 189 */ int (*tcl_MakeSafe) (Tcl_Interp *interp); /* 190 */ Tcl_Channel (*tcl_MakeTcpClientChannel) (ClientData tcpSocket); /* 191 */ - char * (*tcl_Merge) (int argc, const char *const *argv); /* 192 */ + char * (*tcl_Merge) (int argc, CONST84 char *const *argv); /* 192 */ Tcl_HashEntry * (*tcl_NextHashEntry) (Tcl_HashSearch *searchPtr); /* 193 */ void (*tcl_NotifyChannel) (Tcl_Channel channel, int mask); /* 194 */ Tcl_Obj * (*tcl_ObjGetVar2) (Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags); /* 195 */ Tcl_Obj * (*tcl_ObjSetVar2) (Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, int flags); /* 196 */ - Tcl_Channel (*tcl_OpenCommandChannel) (Tcl_Interp *interp, int argc, const char **argv, int flags); /* 197 */ + Tcl_Channel (*tcl_OpenCommandChannel) (Tcl_Interp *interp, int argc, CONST84 char **argv, int flags); /* 197 */ Tcl_Channel (*tcl_OpenFileChannel) (Tcl_Interp *interp, const char *fileName, const char *modeString, int permissions); /* 198 */ Tcl_Channel (*tcl_OpenTcpClient) (Tcl_Interp *interp, int port, const char *address, const char *myaddr, int myport, int async); /* 199 */ Tcl_Channel (*tcl_OpenTcpServer) (Tcl_Interp *interp, int port, const char *host, Tcl_TcpAcceptProc *acceptProc, ClientData callbackData); /* 200 */ void (*tcl_Preserve) (ClientData data); /* 201 */ void (*tcl_PrintDouble) (Tcl_Interp *interp, double value, char *dst); /* 202 */ int (*tcl_PutEnv) (const char *assignment); /* 203 */ - const char * (*tcl_PosixError) (Tcl_Interp *interp); /* 204 */ + CONST84_RETURN char * (*tcl_PosixError) (Tcl_Interp *interp); /* 204 */ void (*tcl_QueueEvent) (Tcl_Event *evPtr, Tcl_QueuePosition position); /* 205 */ int (*tcl_Read) (Tcl_Channel chan, char *bufPtr, int toRead); /* 206 */ void (*tcl_ReapDetachedProcs) (void); /* 207 */ @@ -2001,12 +2044,12 @@ typedef struct TclStubs { Tcl_RegExp (*tcl_RegExpCompile) (Tcl_Interp *interp, const char *pattern); /* 212 */ int (*tcl_RegExpExec) (Tcl_Interp *interp, Tcl_RegExp regexp, const char *text, const char *start); /* 213 */ int (*tcl_RegExpMatch) (Tcl_Interp *interp, const char *text, const char *pattern); /* 214 */ - void (*tcl_RegExpRange) (Tcl_RegExp regexp, int index, const char **startPtr, const char **endPtr); /* 215 */ + void (*tcl_RegExpRange) (Tcl_RegExp regexp, int index, CONST84 char **startPtr, CONST84 char **endPtr); /* 215 */ void (*tcl_Release) (ClientData clientData); /* 216 */ void (*tcl_ResetResult) (Tcl_Interp *interp); /* 217 */ int (*tcl_ScanElement) (const char *src, int *flagPtr); /* 218 */ int (*tcl_ScanCountedElement) (const char *src, int length, int *flagPtr); /* 219 */ - void (*reserved220)(void); + int (*tcl_SeekOld) (Tcl_Channel chan, int offset, int mode); /* 220 */ int (*tcl_ServiceAll) (void); /* 221 */ int (*tcl_ServiceEvent) (int flags); /* 222 */ void (*tcl_SetAssocData) (Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc *proc, ClientData clientData); /* 223 */ @@ -2023,16 +2066,16 @@ typedef struct TclStubs { void (*tcl_SetObjErrorCode) (Tcl_Interp *interp, Tcl_Obj *errorObjPtr); /* 234 */ void (*tcl_SetObjResult) (Tcl_Interp *interp, Tcl_Obj *resultObjPtr); /* 235 */ void (*tcl_SetStdChannel) (Tcl_Channel channel, int type); /* 236 */ - const char * (*tcl_SetVar) (Tcl_Interp *interp, const char *varName, const char *newValue, int flags); /* 237 */ - const char * (*tcl_SetVar2) (Tcl_Interp *interp, const char *part1, const char *part2, const char *newValue, int flags); /* 238 */ - const char * (*tcl_SignalId) (int sig); /* 239 */ - const char * (*tcl_SignalMsg) (int sig); /* 240 */ + CONST84_RETURN char * (*tcl_SetVar) (Tcl_Interp *interp, const char *varName, const char *newValue, int flags); /* 237 */ + CONST84_RETURN char * (*tcl_SetVar2) (Tcl_Interp *interp, const char *part1, const char *part2, const char *newValue, int flags); /* 238 */ + CONST84_RETURN char * (*tcl_SignalId) (int sig); /* 239 */ + CONST84_RETURN char * (*tcl_SignalMsg) (int sig); /* 240 */ void (*tcl_SourceRCFile) (Tcl_Interp *interp); /* 241 */ - int (*tcl_SplitList) (Tcl_Interp *interp, const char *listStr, int *argcPtr, const char ***argvPtr); /* 242 */ - void (*tcl_SplitPath) (const char *path, int *argcPtr, const char ***argvPtr); /* 243 */ + int (*tcl_SplitList) (Tcl_Interp *interp, const char *listStr, int *argcPtr, CONST84 char ***argvPtr); /* 242 */ + void (*tcl_SplitPath) (const char *path, int *argcPtr, CONST84 char ***argvPtr); /* 243 */ void (*tcl_StaticPackage) (Tcl_Interp *interp, const char *pkgName, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc); /* 244 */ int (*tcl_StringMatch) (const char *str, const char *pattern); /* 245 */ - void (*reserved246)(void); + int (*tcl_TellOld) (Tcl_Channel chan); /* 246 */ int (*tcl_TraceVar) (Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData); /* 247 */ int (*tcl_TraceVar2) (Tcl_Interp *interp, const char *part1, const char *part2, int flags, Tcl_VarTraceProc *proc, ClientData clientData); /* 248 */ char * (*tcl_TranslateFileName) (Tcl_Interp *interp, const char *name, Tcl_DString *bufferPtr); /* 249 */ @@ -2046,7 +2089,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 */ - void (*reserved260)(void); + int (*tcl_VarEval) (Tcl_Interp *interp, ...); /* 260 */ 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 */ @@ -2056,13 +2099,13 @@ typedef struct TclStubs { void (*tcl_AppendResultVA) (Tcl_Interp *interp, va_list argList); /* 267 */ void (*tcl_AppendStringsToObjVA) (Tcl_Obj *objPtr, va_list argList); /* 268 */ char * (*tcl_HashStats) (Tcl_HashTable *tablePtr); /* 269 */ - const char * (*tcl_ParseVar) (Tcl_Interp *interp, const char *start, const char **termPtr); /* 270 */ - const char * (*tcl_PkgPresent) (Tcl_Interp *interp, const char *name, const char *version, int exact); /* 271 */ - const char * (*tcl_PkgPresentEx) (Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr); /* 272 */ - 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 */ + CONST84_RETURN char * (*tcl_ParseVar) (Tcl_Interp *interp, const char *start, CONST84 char **termPtr); /* 270 */ + CONST84_RETURN char * (*tcl_PkgPresent) (Tcl_Interp *interp, const char *name, const char *version, int exact); /* 271 */ + CONST84_RETURN char * (*tcl_PkgPresentEx) (Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr); /* 272 */ + int (*tcl_PkgProvide) (Tcl_Interp *interp, const char *name, const char *version); /* 273 */ + CONST84_RETURN 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 */ - void (*reserved276)(void); + int (*tcl_VarEvalVA) (Tcl_Interp *interp, va_list argList); /* 276 */ 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 */ @@ -2088,7 +2131,7 @@ typedef struct TclStubs { void (*tcl_FreeEncoding) (Tcl_Encoding encoding); /* 299 */ Tcl_ThreadId (*tcl_GetCurrentThread) (void); /* 300 */ Tcl_Encoding (*tcl_GetEncoding) (Tcl_Interp *interp, const char *name); /* 301 */ - const char * (*tcl_GetEncodingName) (Tcl_Encoding encoding); /* 302 */ + CONST84_RETURN char * (*tcl_GetEncodingName) (Tcl_Encoding encoding); /* 302 */ void (*tcl_GetEncodingNames) (Tcl_Interp *interp); /* 303 */ int (*tcl_GetIndexFromObjStruct) (Tcl_Interp *interp, Tcl_Obj *objPtr, const void *tablePtr, int offset, const char *msg, int flags, int *indexPtr); /* 304 */ void * (*tcl_GetThreadData) (Tcl_ThreadDataKey *keyPtr, int size); /* 305 */ @@ -2111,13 +2154,13 @@ typedef struct TclStubs { Tcl_UniChar (*tcl_UniCharToTitle) (int ch); /* 322 */ Tcl_UniChar (*tcl_UniCharToUpper) (int ch); /* 323 */ int (*tcl_UniCharToUtf) (int ch, char *buf); /* 324 */ - const char * (*tcl_UtfAtIndex) (const char *src, int index); /* 325 */ + CONST84_RETURN char * (*tcl_UtfAtIndex) (const char *src, int index); /* 325 */ int (*tcl_UtfCharComplete) (const char *src, int length); /* 326 */ int (*tcl_UtfBackslash) (const char *src, int *readPtr, char *dst); /* 327 */ - const char * (*tcl_UtfFindFirst) (const char *src, int ch); /* 328 */ - const char * (*tcl_UtfFindLast) (const char *src, int ch); /* 329 */ - const char * (*tcl_UtfNext) (const char *src); /* 330 */ - const char * (*tcl_UtfPrev) (const char *src, const char *start); /* 331 */ + CONST84_RETURN char * (*tcl_UtfFindFirst) (const char *src, int ch); /* 328 */ + CONST84_RETURN char * (*tcl_UtfFindLast) (const char *src, int ch); /* 329 */ + CONST84_RETURN char * (*tcl_UtfNext) (const char *src); /* 330 */ + CONST84_RETURN char * (*tcl_UtfPrev) (const char *src, const char *start); /* 331 */ int (*tcl_UtfToExternal) (Tcl_Interp *interp, Tcl_Encoding encoding, const char *src, int srcLen, int flags, Tcl_EncodingState *statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); /* 332 */ char * (*tcl_UtfToExternalDString) (Tcl_Encoding encoding, const char *src, int srcLen, Tcl_DString *dsPtr); /* 333 */ int (*tcl_UtfToLower) (char *src); /* 334 */ @@ -2127,8 +2170,8 @@ typedef struct TclStubs { int (*tcl_WriteChars) (Tcl_Channel chan, const char *src, int srcLen); /* 338 */ int (*tcl_WriteObj) (Tcl_Channel chan, Tcl_Obj *objPtr); /* 339 */ char * (*tcl_GetString) (Tcl_Obj *objPtr); /* 340 */ - void (*reserved341)(void); - void (*reserved342)(void); + CONST84_RETURN char * (*tcl_GetDefaultEncodingDir) (void); /* 341 */ + void (*tcl_SetDefaultEncodingDir) (const char *path); /* 342 */ void (*tcl_AlertNotifier) (ClientData clientData); /* 343 */ void (*tcl_ServiceModeHook) (int mode); /* 344 */ int (*tcl_UniCharIsAlnum) (int ch); /* 345 */ @@ -2143,13 +2186,13 @@ typedef struct TclStubs { char * (*tcl_UniCharToUtfDString) (const Tcl_UniChar *uniStr, int uniLength, Tcl_DString *dsPtr); /* 354 */ Tcl_UniChar * (*tcl_UtfToUniCharDString) (const char *src, int length, Tcl_DString *dsPtr); /* 355 */ Tcl_RegExp (*tcl_GetRegExpFromObj) (Tcl_Interp *interp, Tcl_Obj *patObj, int flags); /* 356 */ - void (*reserved357)(void); + Tcl_Obj * (*tcl_EvalTokens) (Tcl_Interp *interp, Tcl_Token *tokenPtr, int count); /* 357 */ void (*tcl_FreeParse) (Tcl_Parse *parsePtr); /* 358 */ void (*tcl_LogCommandInfo) (Tcl_Interp *interp, const char *script, const char *command, int length); /* 359 */ - int (*tcl_ParseBraces) (Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr, int append, const char **termPtr); /* 360 */ + int (*tcl_ParseBraces) (Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr, int append, CONST84 char **termPtr); /* 360 */ int (*tcl_ParseCommand) (Tcl_Interp *interp, const char *start, int numBytes, int nested, Tcl_Parse *parsePtr); /* 361 */ int (*tcl_ParseExpr) (Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr); /* 362 */ - int (*tcl_ParseQuotedString) (Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr, int append, const char **termPtr); /* 363 */ + int (*tcl_ParseQuotedString) (Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr, int append, CONST84 char **termPtr); /* 363 */ int (*tcl_ParseVarName) (Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr, int append); /* 364 */ char * (*tcl_GetCwd) (Tcl_Interp *interp, Tcl_DString *cwdPtr); /* 365 */ int (*tcl_Chdir) (const char *dirName); /* 366 */ @@ -2184,7 +2227,7 @@ typedef struct TclStubs { int (*tcl_WriteRaw) (Tcl_Channel chan, const char *src, int srcLen); /* 395 */ Tcl_Channel (*tcl_GetTopChannel) (Tcl_Channel chan); /* 396 */ int (*tcl_ChannelBuffered) (Tcl_Channel chan); /* 397 */ - const char * (*tcl_ChannelName) (const Tcl_ChannelType *chanTypePtr); /* 398 */ + CONST84_RETURN char * (*tcl_ChannelName) (const Tcl_ChannelType *chanTypePtr); /* 398 */ Tcl_ChannelTypeVersion (*tcl_ChannelVersion) (const Tcl_ChannelType *chanTypePtr); /* 399 */ Tcl_DriverBlockModeProc * (*tcl_ChannelBlockModeProc) (const Tcl_ChannelType *chanTypePtr); /* 400 */ Tcl_DriverCloseProc * (*tcl_ChannelCloseProc) (const Tcl_ChannelType *chanTypePtr); /* 401 */ @@ -2221,8 +2264,8 @@ typedef struct TclStubs { int (*tcl_AttemptSetObjLength) (Tcl_Obj *objPtr, int length); /* 432 */ Tcl_ThreadId (*tcl_GetChannelThread) (Tcl_Channel channel); /* 433 */ Tcl_UniChar * (*tcl_GetUnicodeFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 434 */ - void (*reserved435)(void); - void (*reserved436)(void); + int (*tcl_GetMathFuncInfo) (Tcl_Interp *interp, const char *name, int *numArgsPtr, Tcl_ValueType **argTypesPtr, Tcl_MathProc **procPtr, ClientData *clientDataPtr); /* 435 */ + Tcl_Obj * (*tcl_ListMathFuncs) (Tcl_Interp *interp, const char *pattern); /* 436 */ Tcl_Obj * (*tcl_SubstObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags); /* 437 */ int (*tcl_DetachChannel) (Tcl_Interp *interp, Tcl_Channel channel); /* 438 */ int (*tcl_IsStandardChannel) (Tcl_Channel channel); /* 439 */ @@ -2239,7 +2282,7 @@ typedef struct TclStubs { int (*tcl_FSUtime) (Tcl_Obj *pathPtr, struct utimbuf *tval); /* 450 */ int (*tcl_FSFileAttrsGet) (Tcl_Interp *interp, int index, Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef); /* 451 */ int (*tcl_FSFileAttrsSet) (Tcl_Interp *interp, int index, Tcl_Obj *pathPtr, Tcl_Obj *objPtr); /* 452 */ - const char *const * (*tcl_FSFileAttrStrings) (Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef); /* 453 */ + const char *CONST86 * (*tcl_FSFileAttrStrings) (Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef); /* 453 */ int (*tcl_FSStat) (Tcl_Obj *pathPtr, Tcl_StatBuf *buf); /* 454 */ int (*tcl_FSAccess) (Tcl_Obj *pathPtr, int mode); /* 455 */ Tcl_Channel (*tcl_FSOpenFileChannel) (Tcl_Interp *interp, Tcl_Obj *pathPtr, const char *modeString, int permissions); /* 456 */ @@ -2263,7 +2306,7 @@ typedef struct TclStubs { int (*tcl_FSUnregister) (const Tcl_Filesystem *fsPtr); /* 474 */ ClientData (*tcl_FSData) (const Tcl_Filesystem *fsPtr); /* 475 */ const char * (*tcl_FSGetTranslatedStringPath) (Tcl_Interp *interp, Tcl_Obj *pathPtr); /* 476 */ - const Tcl_Filesystem * (*tcl_FSGetFileSystemForPath) (Tcl_Obj *pathPtr); /* 477 */ + CONST86 Tcl_Filesystem * (*tcl_FSGetFileSystemForPath) (Tcl_Obj *pathPtr); /* 477 */ Tcl_PathType (*tcl_FSGetPathType) (Tcl_Obj *pathPtr); /* 478 */ int (*tcl_OutputBuffered) (Tcl_Channel chan); /* 479 */ void (*tcl_FSMountsChanged) (const Tcl_Filesystem *fsPtr); /* 480 */ @@ -2599,7 +2642,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_AsyncReady) /* 75 */ #define Tcl_BackgroundError \ (tclStubsPtr->tcl_BackgroundError) /* 76 */ -/* Slot 77 is reserved */ +#define Tcl_Backslash \ + (tclStubsPtr->tcl_Backslash) /* 77 */ #define Tcl_BadChannelOption \ (tclStubsPtr->tcl_BadChannelOption) /* 78 */ #define Tcl_CallWhenDeleted \ @@ -2634,7 +2678,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_CreateExitHandler) /* 93 */ #define Tcl_CreateInterp \ (tclStubsPtr->tcl_CreateInterp) /* 94 */ -/* Slot 95 is reserved */ +#define Tcl_CreateMathFunc \ + (tclStubsPtr->tcl_CreateMathFunc) /* 95 */ #define Tcl_CreateObjCommand \ (tclStubsPtr->tcl_CreateObjCommand) /* 96 */ #define Tcl_CreateSlave \ @@ -2703,7 +2748,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_ErrnoMsg) /* 128 */ #define Tcl_Eval \ (tclStubsPtr->tcl_Eval) /* 129 */ -/* Slot 130 is reserved */ +#define Tcl_EvalFile \ + (tclStubsPtr->tcl_EvalFile) /* 130 */ /* Slot 131 is reserved */ #define Tcl_EventuallyFree \ (tclStubsPtr->tcl_EventuallyFree) /* 132 */ @@ -2729,7 +2775,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_ExprString) /* 142 */ #define Tcl_Finalize \ (tclStubsPtr->tcl_Finalize) /* 143 */ -/* Slot 144 is reserved */ +#define Tcl_FindExecutable \ + (tclStubsPtr->tcl_FindExecutable) /* 144 */ #define Tcl_FirstHashEntry \ (tclStubsPtr->tcl_FirstHashEntry) /* 145 */ #define Tcl_Flush \ @@ -2799,7 +2846,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_GetVar) /* 175 */ #define Tcl_GetVar2 \ (tclStubsPtr->tcl_GetVar2) /* 176 */ -/* Slot 177 is reserved */ +#define Tcl_GlobalEval \ + (tclStubsPtr->tcl_GlobalEval) /* 177 */ /* Slot 178 is reserved */ #define Tcl_HideCommand \ (tclStubsPtr->tcl_HideCommand) /* 179 */ @@ -2882,7 +2930,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_ScanElement) /* 218 */ #define Tcl_ScanCountedElement \ (tclStubsPtr->tcl_ScanCountedElement) /* 219 */ -/* Slot 220 is reserved */ +#define Tcl_SeekOld \ + (tclStubsPtr->tcl_SeekOld) /* 220 */ #define Tcl_ServiceAll \ (tclStubsPtr->tcl_ServiceAll) /* 221 */ #define Tcl_ServiceEvent \ @@ -2932,7 +2981,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_StaticPackage) /* 244 */ #define Tcl_StringMatch \ (tclStubsPtr->tcl_StringMatch) /* 245 */ -/* Slot 246 is reserved */ +#define Tcl_TellOld \ + (tclStubsPtr->tcl_TellOld) /* 246 */ #define Tcl_TraceVar \ (tclStubsPtr->tcl_TraceVar) /* 247 */ #define Tcl_TraceVar2 \ @@ -2959,7 +3009,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_UpVar) /* 258 */ #define Tcl_UpVar2 \ (tclStubsPtr->tcl_UpVar2) /* 259 */ -/* Slot 260 is reserved */ +#define Tcl_VarEval \ + (tclStubsPtr->tcl_VarEval) /* 260 */ #define Tcl_VarTraceInfo \ (tclStubsPtr->tcl_VarTraceInfo) /* 261 */ #define Tcl_VarTraceInfo2 \ @@ -2984,13 +3035,14 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_PkgPresent) /* 271 */ #define Tcl_PkgPresentEx \ (tclStubsPtr->tcl_PkgPresentEx) /* 272 */ -#define TclPkgProvide \ - (tclStubsPtr->tclPkgProvide) /* 273 */ +#define Tcl_PkgProvide \ + (tclStubsPtr->tcl_PkgProvide) /* 273 */ #define Tcl_PkgRequire \ (tclStubsPtr->tcl_PkgRequire) /* 274 */ #define Tcl_SetErrorCodeVA \ (tclStubsPtr->tcl_SetErrorCodeVA) /* 275 */ -/* Slot 276 is reserved */ +#define Tcl_VarEvalVA \ + (tclStubsPtr->tcl_VarEvalVA) /* 276 */ #define Tcl_WaitPid \ (tclStubsPtr->tcl_WaitPid) /* 277 */ #define Tcl_PanicVA \ @@ -3118,8 +3170,10 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_WriteObj) /* 339 */ #define Tcl_GetString \ (tclStubsPtr->tcl_GetString) /* 340 */ -/* Slot 341 is reserved */ -/* Slot 342 is reserved */ +#define Tcl_GetDefaultEncodingDir \ + (tclStubsPtr->tcl_GetDefaultEncodingDir) /* 341 */ +#define Tcl_SetDefaultEncodingDir \ + (tclStubsPtr->tcl_SetDefaultEncodingDir) /* 342 */ #define Tcl_AlertNotifier \ (tclStubsPtr->tcl_AlertNotifier) /* 343 */ #define Tcl_ServiceModeHook \ @@ -3148,7 +3202,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_UtfToUniCharDString) /* 355 */ #define Tcl_GetRegExpFromObj \ (tclStubsPtr->tcl_GetRegExpFromObj) /* 356 */ -/* Slot 357 is reserved */ +#define Tcl_EvalTokens \ + (tclStubsPtr->tcl_EvalTokens) /* 357 */ #define Tcl_FreeParse \ (tclStubsPtr->tcl_FreeParse) /* 358 */ #define Tcl_LogCommandInfo \ @@ -3303,8 +3358,10 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_GetChannelThread) /* 433 */ #define Tcl_GetUnicodeFromObj \ (tclStubsPtr->tcl_GetUnicodeFromObj) /* 434 */ -/* Slot 435 is reserved */ -/* Slot 436 is reserved */ +#define Tcl_GetMathFuncInfo \ + (tclStubsPtr->tcl_GetMathFuncInfo) /* 435 */ +#define Tcl_ListMathFuncs \ + (tclStubsPtr->tcl_ListMathFuncs) /* 436 */ #define Tcl_SubstObj \ (tclStubsPtr->tcl_SubstObj) /* 437 */ #define Tcl_DetachChannel \ @@ -3701,25 +3758,25 @@ extern const TclStubs *tclStubsPtr; # undef Tcl_GetStringResult # undef Tcl_Init # undef Tcl_SetPanicProc -# undef Tcl_SetVar2 +# undef Tcl_SetVar # undef Tcl_StaticPackage # undef TclFSGetNativePath # define Tcl_CreateInterp() (tclStubsPtr->tcl_CreateInterp()) # define Tcl_GetStringResult(interp) (tclStubsPtr->tcl_GetStringResult(interp)) # define Tcl_Init(interp) (tclStubsPtr->tcl_Init(interp)) # define Tcl_SetPanicProc(proc) (tclStubsPtr->tcl_SetPanicProc(proc)) -# define Tcl_SetVar2(interp, part1, part2, newValue, flags) \ - (tclStubsPtr->tcl_SetVar2(interp, part1, part2, newValue, flags)) +# define Tcl_SetVar(interp, varName, newValue, flags) \ + (tclStubsPtr->tcl_SetVar(interp, varName, newValue, flags)) #endif #if defined(_WIN32) && defined(UNICODE) # define Tcl_FindExecutable(arg) ((Tcl_FindExecutable)((const char *)(arg))) # define Tcl_MainEx Tcl_MainExW -TCLAPI void Tcl_MainExW(int argc, wchar_t **argv, + EXTERN void Tcl_MainExW(int argc, wchar_t **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); #endif -#define Tcl_PkgProvide(interp, name, version) \ - Tcl_PkgProvideEx(interp, name, version, NULL) +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLIMPORT #endif /* _TCLDECLS */ diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 757f771..7a55724 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -18,7 +18,7 @@ typedef size_t (LengthProc)(const char *src); * convert between various character sets and UTF-8. */ -typedef struct { +typedef struct Encoding { char *name; /* Name of encoding. Malloced because (1) hash * table entry that owns this encoding may be * freed prior to this encoding being freed, @@ -57,7 +57,7 @@ typedef struct { * encoding. */ -typedef struct { +typedef struct TableEncodingData { int fallback; /* Character (in this encoding) to substitute * when this encoding cannot represent a UTF-8 * character. */ @@ -91,7 +91,7 @@ typedef struct { * for switching character sets. */ -typedef struct { +typedef struct EscapeSubTable { unsigned sequenceLen; /* Length of following string. */ char sequence[16]; /* Escape code that marks this encoding. */ char name[32]; /* Name for encoding. */ @@ -100,7 +100,7 @@ typedef struct { * yet. */ } EscapeSubTable; -typedef struct { +typedef struct EscapeEncodingData { int fallback; /* Character (in this encoding) to substitute * when this encoding cannot represent a UTF-8 * character. */ @@ -672,6 +672,68 @@ TclFinalizeEncodingSubsystem(void) /* *------------------------------------------------------------------------- * + * Tcl_GetDefaultEncodingDir -- + * + * Legacy public interface to retrieve first directory in the encoding + * searchPath. + * + * Results: + * The directory pathname, as a string, or NULL for an empty encoding + * search path. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------- + */ + +const char * +Tcl_GetDefaultEncodingDir(void) +{ + int numDirs; + Tcl_Obj *first, *searchPath = Tcl_GetEncodingSearchPath(); + + Tcl_ListObjLength(NULL, searchPath, &numDirs); + if (numDirs == 0) { + return NULL; + } + Tcl_ListObjIndex(NULL, searchPath, 0, &first); + + return Tcl_GetString(first); +} + +/* + *------------------------------------------------------------------------- + * + * Tcl_SetDefaultEncodingDir -- + * + * Legacy public interface to set the first directory in the encoding + * search path. + * + * Results: + * None. + * + * Side effects: + * Modifies the encoding search path. + * + *------------------------------------------------------------------------- + */ + +void +Tcl_SetDefaultEncodingDir( + const char *path) +{ + Tcl_Obj *searchPath = Tcl_GetEncodingSearchPath(); + Tcl_Obj *directory = Tcl_NewStringObj(path, -1); + + searchPath = Tcl_DuplicateObj(searchPath); + Tcl_ListObjReplace(NULL, searchPath, 0, 0, 1, &directory); + Tcl_SetEncodingSearchPath(searchPath); +} + +/* + *------------------------------------------------------------------------- + * * Tcl_GetEncoding -- * * Given the name of a encoding, find the corresponding Tcl_Encoding diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 590e4f8..5f8fbee 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -37,7 +37,7 @@ typedef struct BgError { * pending background errors for the interpreter. */ -typedef struct { +typedef struct ErrAssocData { Tcl_Interp *interp; /* Interpreter in which error occurred. */ Tcl_Obj *cmdPrefix; /* First word(s) of the handler command */ BgError *firstBgPtr; /* First in list of all background errors diff --git a/generic/tclExecute.c b/generic/tclExecute.c index e4afcb1..4ebeeb8 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -103,6 +103,63 @@ long tclObjsFreed = 0; long tclObjsShared[TCL_MAX_SHARED_OBJ_STATS] = { 0, 0, 0, 0, 0 }; #endif /* TCL_COMPILE_STATS */ +/* + * Support pre-8.5 bytecodes unless specifically requested otherwise. + */ + +#ifndef TCL_SUPPORT_84_BYTECODE +#define TCL_SUPPORT_84_BYTECODE 1 +#endif + +#if TCL_SUPPORT_84_BYTECODE +/* + * We need to know the tclBuiltinFuncTable to support translation of pre-8.5 + * math functions to the namespace-based ::tcl::mathfunc::op in 8.5+. + */ + +typedef struct { + const char *name; /* Name of function. */ + int numArgs; /* Number of arguments for function. */ +} BuiltinFunc; + +/* + * Table describing the built-in math functions. Entries in this table are + * indexed by the values of the INST_CALL_BUILTIN_FUNC instruction's + * operand byte. + */ + +static BuiltinFunc const tclBuiltinFuncTable[] = { + {"acos", 1}, + {"asin", 1}, + {"atan", 1}, + {"atan2", 2}, + {"ceil", 1}, + {"cos", 1}, + {"cosh", 1}, + {"exp", 1}, + {"floor", 1}, + {"fmod", 2}, + {"hypot", 2}, + {"log", 1}, + {"log10", 1}, + {"pow", 2}, + {"sin", 1}, + {"sinh", 1}, + {"sqrt", 1}, + {"tan", 1}, + {"tanh", 1}, + {"abs", 1}, + {"double", 1}, + {"int", 1}, + {"rand", 0}, + {"round", 1}, + {"srand", 1}, + {"wide", 1}, + {NULL, 0}, +}; + +#define LAST_BUILTIN_FUNC 25 +#endif /* * NR_TEBC @@ -110,7 +167,7 @@ long tclObjsShared[TCL_MAX_SHARED_OBJ_STATS] = { 0, 0, 0, 0, 0 }; * Minimal data required to fully reconstruct the execution state. */ -typedef struct { +typedef struct TEBCdata { ByteCode *codePtr; /* Constant until the BC returns */ /* -----------------------------------------*/ Tcl_Obj **tosPtr; @@ -2316,15 +2373,90 @@ TEBCresume( return TclNREvalObjv(interp, objc, objv, TCL_EVAL_NOERR, NULL); +#if TCL_SUPPORT_84_BYTECODE + case INST_CALL_BUILTIN_FUNC1: + /* + * Call one of the built-in pre-8.5 Tcl math functions. This + * translates to INST_INVOKE_STK1 with the first argument of + * ::tcl::mathfunc::$objv[0]. We need to insert the named math + * function into the stack. + */ + + opnd = TclGetUInt1AtPtr(pc+1); + if ((opnd < 0) || (opnd > LAST_BUILTIN_FUNC)) { + TRACE(("UNRECOGNIZED BUILTIN FUNC CODE %d\n", opnd)); + Tcl_Panic("TclNRExecuteByteCode: unrecognized builtin function code %d", opnd); + } + + TclNewLiteralStringObj(objPtr, "::tcl::mathfunc::"); + Tcl_AppendToObj(objPtr, tclBuiltinFuncTable[opnd].name, -1); + + /* + * Only 0, 1 or 2 args. + */ + + { + int numArgs = tclBuiltinFuncTable[opnd].numArgs; + Tcl_Obj *tmpPtr1, *tmpPtr2; + + if (numArgs == 0) { + PUSH_OBJECT(objPtr); + } else if (numArgs == 1) { + tmpPtr1 = POP_OBJECT(); + PUSH_OBJECT(objPtr); + PUSH_OBJECT(tmpPtr1); + Tcl_DecrRefCount(tmpPtr1); + } else { + tmpPtr2 = POP_OBJECT(); + tmpPtr1 = POP_OBJECT(); + PUSH_OBJECT(objPtr); + PUSH_OBJECT(tmpPtr1); + PUSH_OBJECT(tmpPtr2); + Tcl_DecrRefCount(tmpPtr1); + Tcl_DecrRefCount(tmpPtr2); + } + objc = numArgs + 1; + } + pcAdjustment = 2; + goto doInvocation; + + case INST_CALL_FUNC1: + /* + * Call a non-builtin Tcl math function previously registered by a + * call to Tcl_CreateMathFunc pre-8.5. This is essentially + * INST_INVOKE_STK1 converting the first arg to + * ::tcl::mathfunc::$objv[0]. + */ + + objc = TclGetUInt1AtPtr(pc+1); /* Number of arguments. The function + * name is the 0-th argument. */ + + objPtr = OBJ_AT_DEPTH(objc-1); + TclNewLiteralStringObj(tmpPtr, "::tcl::mathfunc::"); + Tcl_AppendObjToObj(tmpPtr, objPtr); + Tcl_DecrRefCount(objPtr); + + /* + * Variation of PUSH_OBJECT. + */ + + OBJ_AT_DEPTH(objc-1) = tmpPtr; + Tcl_IncrRefCount(tmpPtr); + + pcAdjustment = 2; + goto doInvocation; +#else /* * INST_CALL_BUILTIN_FUNC1 and INST_CALL_FUNC1 were made obsolete by the - * changes to add a ::tcl::mathfunc namespace in 8.5. + * changes to add a ::tcl::mathfunc namespace in 8.5. Optional support + * remains for existing bytecode precompiled files. */ case INST_CALL_BUILTIN_FUNC1: Tcl_Panic("TclNRExecuteByteCode: obsolete INST_CALL_BUILTIN_FUNC1 found"); case INST_CALL_FUNC1: Tcl_Panic("TclNRExecuteByteCode: obsolete INST_CALL_FUNC1 found"); +#endif case INST_INVOKE_REPLACE: objc = TclGetUInt4AtPtr(pc+1); @@ -7922,7 +8054,16 @@ IllegalExprOperandType( } if (GetNumberFromObj(NULL, opndPtr, &ptr, &type) != TCL_OK) { - description = "non-numeric string"; + int numBytes; + const char *bytes = Tcl_GetStringFromObj(opndPtr, &numBytes); + + if (numBytes == 0) { + description = "empty string"; + } else if (TclCheckBadOctal(NULL, bytes)) { + description = "invalid octal number"; + } else { + description = "non-numeric string"; + } } else if (type == TCL_NUMBER_NAN) { description = "non-numeric floating-point value"; } else if (type == TCL_NUMBER_DOUBLE) { @@ -7933,8 +8074,7 @@ IllegalExprOperandType( } Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "can't use %s \"%s\" as operand of \"%s\"", description, - Tcl_GetString(opndPtr), operator)); + "can't use %s as operand of \"%s\"", description, operator)); Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", description, NULL); } diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 69de997..c8dc3d3 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -37,15 +37,6 @@ static Tcl_Obj * SplitUnixPath(const char *path); static int DoGlob(Tcl_Interp *interp, Tcl_Obj *resultPtr, const char *separators, Tcl_Obj *pathPtr, int flags, char *pattern, Tcl_GlobTypeData *types); -static int TclGlob(Tcl_Interp *interp, char *pattern, - Tcl_Obj *pathPrefix, int globFlags, - Tcl_GlobTypeData *types); - -/* Flag values used by TclGlob() */ - -#define TCL_GLOBMODE_JOIN 2 -#define TCL_GLOBMODE_DIR 4 -#define TCL_GLOBMODE_TAILS 8 /* * When there is no support for getting the block size of a file in a stat() @@ -1279,10 +1270,7 @@ Tcl_GlobObjCmd( switch (index) { case GLOB_NOCOMPLAIN: /* -nocomplain */ - /* - * Do nothing; This is normal operations in Tcl 9. - * Keep accepting as a no-op option to accommodate old scripts. - */ + globFlags |= TCL_GLOBMODE_NO_COMPLAIN; break; case GLOB_DIR: /* -dir */ if (i == (objc-1)) { @@ -1632,6 +1620,41 @@ Tcl_GlobObjCmd( } } + if ((globFlags & TCL_GLOBMODE_NO_COMPLAIN) == 0) { + if (Tcl_ListObjLength(interp, Tcl_GetObjResult(interp), + &length) != TCL_OK) { + /* + * This should never happen. Maybe we should be more dramatic. + */ + + result = TCL_ERROR; + goto endOfGlob; + } + + if (length == 0) { + Tcl_Obj *errorMsg = + Tcl_ObjPrintf("no files matched glob pattern%s \"", + (join || (objc == 1)) ? "" : "s"); + + if (join) { + Tcl_AppendToObj(errorMsg, Tcl_DStringValue(&prefix), -1); + } else { + const char *sep = ""; + + for (i = 0; i < objc; i++) { + Tcl_AppendPrintfToObj(errorMsg, "%s%s", + sep, Tcl_GetString(objv[i])); + sep = " "; + } + } + Tcl_AppendToObj(errorMsg, "\"", -1); + Tcl_SetObjResult(interp, errorMsg); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", "NOMATCH", + NULL); + result = TCL_ERROR; + } + } + endOfGlob: if (join || (dir == PATH_GENERAL)) { Tcl_DStringFree(&prefix); @@ -1682,7 +1705,7 @@ Tcl_GlobObjCmd( */ /* ARGSUSED */ -static int +int TclGlob( Tcl_Interp *interp, /* Interpreter for returning error message or * appending list of matching file names. */ diff --git a/generic/tclHistory.c b/generic/tclHistory.c index 010b6cc..5e70b6a 100644 --- a/generic/tclHistory.c +++ b/generic/tclHistory.c @@ -75,6 +75,13 @@ Tcl_RecordAndEval( result = Tcl_RecordAndEvalObj(interp, cmdPtr, flags); /* + * Move the interpreter's object result to the string result, then + * reset the object result. + */ + + (void) Tcl_GetStringResult(interp); + + /* * Discard the Tcl object created to hold the command. */ diff --git a/generic/tclIO.c b/generic/tclIO.c index c9842df..715c1ef 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -24,7 +24,7 @@ * The structure defined below is used in this file only. */ -typedef struct { +typedef struct ThreadSpecificData { NextChannelHandler *nestedHandlerPtr; /* This variable holds the list of nested * ChannelHandlerEventProc invocations. */ @@ -7059,6 +7059,47 @@ Tcl_Tell( /* *--------------------------------------------------------------------------- * + * Tcl_SeekOld, Tcl_TellOld -- + * + * Backward-compatability versions of the seek/tell interface that do not + * support 64-bit offsets. This interface is not documented or expected + * to be supported indefinitely. + * + * Results: + * As for Tcl_Seek and Tcl_Tell respectively, except truncated to + * whatever value will fit in an 'int'. + * + * Side effects: + * As for Tcl_Seek and Tcl_Tell respectively. + * + *--------------------------------------------------------------------------- + */ + +int +Tcl_SeekOld( + Tcl_Channel chan, /* The channel on which to seek. */ + int offset, /* Offset to seek to. */ + int mode) /* Relative to which location to seek? */ +{ + Tcl_WideInt wOffset, wResult; + + wOffset = Tcl_LongAsWide((long) offset); + wResult = Tcl_Seek(chan, wOffset, mode); + return (int) Tcl_WideAsLong(wResult); +} + +int +Tcl_TellOld( + Tcl_Channel chan) /* The channel to return pos for. */ +{ + Tcl_WideInt wResult = Tcl_Tell(chan); + + return (int) Tcl_WideAsLong(wResult); +} + +/* + *--------------------------------------------------------------------------- + * * Tcl_TruncateChannel -- * * Truncate a channel to the given length. @@ -8965,6 +9006,18 @@ ZeroTransferTimerProc( */ int +TclCopyChannelOld( + Tcl_Interp *interp, /* Current interpreter. */ + Tcl_Channel inChan, /* Channel to read from. */ + Tcl_Channel outChan, /* Channel to write to. */ + int toRead, /* Amount of data to copy, or -1 for all. */ + Tcl_Obj *cmdPtr) /* Pointer to script to execute or NULL. */ +{ + return TclCopyChannel(interp, inChan, outChan, (Tcl_WideInt) toRead, + cmdPtr); +} + +int TclCopyChannel( Tcl_Interp *interp, /* Current interpreter. */ Tcl_Channel inChan, /* Channel to read from. */ diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 09b09be..eb195ab 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -15,7 +15,7 @@ * Callback structure for accept callback in a TCP server. */ -typedef struct { +typedef struct AcceptCallback { char *script; /* Script to invoke. */ Tcl_Interp *interp; /* Interpreter in which to run it. */ } AcceptCallback; @@ -25,7 +25,7 @@ typedef struct { * It must be per-thread because of std channel limitations. */ -typedef struct { +typedef struct ThreadSpecificData { int initialized; /* Set to 1 when the module is initialized. */ Tcl_Obj *stdoutObjPtr; /* Cached stdout channel Tcl_Obj */ } ThreadSpecificData; @@ -139,6 +139,19 @@ Tcl_PutsObjCmd( chanObjPtr = objv[2]; string = objv[3]; break; +#if TCL_MAJOR_VERSION < 9 + } else if (strcmp(TclGetString(objv[3]), "nonewline") == 0) { + /* + * The code below provides backwards compatibility with an old + * form of the command that is no longer recommended or + * documented. See also [Bug #3151675]. Will be removed in Tcl 9, + * maybe even earlier. + */ + + chanObjPtr = objv[1]; + string = objv[2]; + break; +#endif } /* Fall through */ default: /* [puts] or @@ -416,11 +429,25 @@ Tcl_ReadObjCmd( if (i < objc) { if ((TclGetIntFromObj(interp, objv[i], &toRead) != TCL_OK) || (toRead < 0)) { +#if TCL_MAJOR_VERSION < 9 + /* + * The code below provides backwards compatibility with an old + * form of the command that is no longer recommended or + * documented. See also [Bug #3151675]. Will be removed in Tcl 9, + * maybe even earlier. + */ + + if (strcmp(TclGetString(objv[i]), "nonewline") != 0) { +#endif Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected non-negative integer but got \"%s\"", TclGetString(objv[i]))); Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", NULL); return TCL_ERROR; +#if TCL_MAJOR_VERSION < 9 + } + newline = 1; +#endif } } @@ -1324,11 +1351,11 @@ AcceptCallbackProc( if (acceptCallbackPtr->interp != NULL) { char portBuf[TCL_INTEGER_SPACE]; - Tcl_Obj *script = Tcl_NewStringObj(acceptCallbackPtr->script, -1); + char *script = acceptCallbackPtr->script; Tcl_Interp *interp = acceptCallbackPtr->interp; int result; - Tcl_IncrRefCount(script); + Tcl_Preserve(script); Tcl_Preserve(interp); TclFormatInt(portBuf, port); @@ -1341,12 +1368,8 @@ AcceptCallbackProc( Tcl_RegisterChannel(NULL, chan); - 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); - } + result = Tcl_VarEval(interp, script, " ", Tcl_GetChannelName(chan), + " ", address, " ", portBuf, NULL); if (result != TCL_OK) { Tcl_BackgroundException(interp, result); Tcl_UnregisterChannel(interp, chan); @@ -1360,7 +1383,7 @@ AcceptCallbackProc( Tcl_UnregisterChannel(NULL, chan); Tcl_Release(interp); - Tcl_DecrRefCount(script); + Tcl_Release(script); } else { /* * The interpreter has been deleted, so there is no useful way to use diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 4b61538..cb0282a 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -256,7 +256,7 @@ typedef enum { * sharing problems. */ -typedef struct { +typedef struct ForwardParamBase { int code; /* O: Ok/Fail of the cmd handler */ char *msgStr; /* O: Error message for handler failure */ int mustFree; /* O: True if msgStr is allocated, false if @@ -331,7 +331,7 @@ typedef struct ForwardingResult ForwardingResult; * General event structure, with reference to operation specific data. */ -typedef struct { +typedef struct ForwardingEvent { Tcl_Event event; /* Basic event data, has to be first item */ ForwardingResult *resultPtr; ForwardedOperation op; /* Forwarded driver operation */ @@ -368,7 +368,7 @@ struct ForwardingResult { * results. */ }; -typedef struct { +typedef struct ThreadSpecificData { /* * Table of all reflected channels owned by this thread. This is the * per-thread version of the per-interpreter map. @@ -774,7 +774,7 @@ TclChanCreateObjCmd( *---------------------------------------------------------------------- */ -typedef struct { +typedef struct ReflectEvent { Tcl_Event header; ReflectedChannel *rcPtr; int events; diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index a4fa9a4..1de635f 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -87,7 +87,7 @@ static const Tcl_ChannelType tclRTransformType = { * layers upon reading from the channel, plus the functions to manage such. */ -typedef struct { +typedef struct _ResultBuffer_ { unsigned char *buf; /* Reference to the buffer area. */ int allocated; /* Allocated size of the buffer area. */ int used; /* Number of bytes in the buffer, @@ -252,7 +252,7 @@ typedef enum { * sharing problems. */ -typedef struct { +typedef struct ForwardParamBase { int code; /* O: Ok/Fail of the cmd handler */ char *msgStr; /* O: Error message for handler failure */ int mustFree; /* O: True if msgStr is allocated, false if @@ -297,7 +297,7 @@ typedef struct ForwardingResult ForwardingResult; * General event structure, with reference to operation specific data. */ -typedef struct { +typedef struct ForwardingEvent { Tcl_Event event; /* Basic event data, has to be first item */ ForwardingResult *resultPtr; ForwardedOperation op; /* Forwarded driver operation */ @@ -328,7 +328,7 @@ struct ForwardingResult { * results. */ }; -typedef struct { +typedef struct ThreadSpecificData { /* * Table of all reflected transformations owned by this thread. */ diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 5e86713..19b04e5 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -54,7 +54,7 @@ typedef struct FilesystemRecord { * this information each time the corresponding epoch counter changes. */ -typedef struct { +typedef struct ThreadSpecificData { int initialized; int cwdPathEpoch; int filesystemEpoch; @@ -243,7 +243,7 @@ static Tcl_ThreadDataKey fsDataKey; * code. */ -typedef struct { +typedef struct FsDivertLoad { Tcl_LoadHandle loadHandle; Tcl_FSUnloadFileProc *unloadProcPtr; Tcl_Obj *divertedFile; @@ -410,6 +410,22 @@ Tcl_GetCwd( return Tcl_DStringValue(cwdPtr); } +/* Obsolete */ +int +Tcl_EvalFile( + Tcl_Interp *interp, /* Interpreter in which to process file. */ + const char *fileName) /* Name of file to process. Tilde-substitution + * will be performed on this name. */ +{ + int ret; + Tcl_Obj *pathPtr = Tcl_NewStringObj(fileName,-1); + + Tcl_IncrRefCount(pathPtr); + ret = Tcl_FSEvalFile(interp, pathPtr); + Tcl_DecrRefCount(pathPtr); + return ret; +} + /* * Now move on to the basic filesystem implementation. */ diff --git a/generic/tclInt.decls b/generic/tclInt.decls index a72d223..fe20112 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -51,11 +51,10 @@ declare 6 { declare 7 { int TclCopyAndCollapse(int count, const char *src, char *dst) } -# Removed in Tcl 9 -#declare 8 { -# int TclCopyChannelOld(Tcl_Interp *interp, Tcl_Channel inChan, -# Tcl_Channel outChan, int toRead, Tcl_Obj *cmdPtr) -#} +declare 8 { + int TclCopyChannelOld(Tcl_Interp *interp, Tcl_Channel inChan, + Tcl_Channel outChan, int toRead, Tcl_Obj *cmdPtr) +} # TclCreatePipeline unofficially exported for use by BLT. @@ -185,11 +184,11 @@ declare 41 { Tcl_Command TclGetOriginalCommand(Tcl_Command command) } declare 42 { - const char *TclpGetUserHome(const char *name, Tcl_DString *bufferPtr) + CONST86 char *TclpGetUserHome(const char *name, Tcl_DString *bufferPtr) } # Removed in Tcl 8.5a2 #declare 43 { -# int TclGlobalInvoke(Tcl_Interp *interp, int argc, const char **argv, +# int TclGlobalInvoke(Tcl_Interp *interp, int argc, CONST84 char **argv, # int flags) #} declare 44 { @@ -224,12 +223,12 @@ declare 51 { } # Removed in Tcl 8.5a2 #declare 52 { -# int TclInvoke(Tcl_Interp *interp, int argc, const char **argv, +# int TclInvoke(Tcl_Interp *interp, int argc, CONST84 char **argv, # int flags) #} declare 53 { int TclInvokeObjectCommand(ClientData clientData, Tcl_Interp *interp, - int argc, const char **argv) + int argc, CONST84 char **argv) } declare 54 { int TclInvokeStringCommand(ClientData clientData, Tcl_Interp *interp, @@ -316,10 +315,10 @@ declare 76 { unsigned long TclpGetSeconds(void) } -# Removed in 9.0: -#declare 77 { -# void TclpGetTime(Tcl_Time *time) -#} +# deprecated +declare 77 { + void TclpGetTime(Tcl_Time *time) +} # Removed in 8.6: #declare 78 { # int TclpGetTimeZone(unsigned long time) @@ -412,7 +411,7 @@ declare 98 { # Tcl_Obj *objPtr, int flags) #} declare 101 { - const char *TclSetPreInitScript(const char *string) + CONST86 char *TclSetPreInitScript(const char *string) } declare 102 { void TclSetupEnv(Tcl_Interp *interp) @@ -421,10 +420,9 @@ declare 103 { int TclSockGetPort(Tcl_Interp *interp, const char *str, const char *proto, int *portPtr) } -# Removed in Tcl 9 -#declare 104 { -# int TclSockMinimumBuffersOld(int sock, int size) -#} +declare 104 { + int TclSockMinimumBuffersOld(int sock, int size) +} # Replaced by Tcl_FSStat in 8.4: #declare 105 { # int TclStat(const char *path, Tcl_StatBuf *buf) @@ -535,10 +533,9 @@ declare 131 { declare 132 { int TclpHasSockets(Tcl_Interp *interp) } -# Removed in 9.0 -#declare 133 { -# struct tm *TclpGetDate(const time_t *time, int useGMT) -#} +declare 133 { + struct tm *TclpGetDate(const time_t *time, int useGMT) +} # Removed in 8.5 #declare 134 { # size_t TclpStrftime(char *s, size_t maxsize, const char *format, @@ -554,7 +551,7 @@ declare 132 { # int TclpChdir(const char *dirName) #} declare 138 { - const char *TclGetEnv(const char *name, Tcl_DString *valuePtr) + CONST84_RETURN char *TclGetEnv(const char *name, Tcl_DString *valuePtr) } #declare 139 { # int TclpLoadFile(Tcl_Interp *interp, char *fileName, char *sym1, @@ -566,7 +563,7 @@ declare 138 { #} # This is used by TclX, but should otherwise be considered private declare 141 { - const char *TclpGetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr) + CONST84_RETURN char *TclpGetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr) } declare 142 { int TclSetByteCodeFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr, @@ -752,14 +749,14 @@ declare 177 { # const char *file, int line) #} -# Removed in 9.0 -#declare 182 { -# struct tm *TclpLocaltime(const time_t *clock) -#} -# Removed in 9.0 -#declare 183 { -# struct tm *TclpGmtime(const time_t *clock) -#} +# TclpGmtime and TclpLocaltime promoted to the generic interface from unix + +declare 182 { + struct tm *TclpLocaltime(const time_t *clock) +} +declare 183 { + struct tm *TclpGmtime(const time_t *clock) +} # For the new "Thread Storage" subsystem. @@ -944,9 +941,9 @@ declare 235 { # TIP 337 made this one public -declare 236 { - void TclBackgroundException(Tcl_Interp *interp, int code) -} +#declare 236 { +# void TclBackgroundException(Tcl_Interp *interp, int code) +#} # TIP #285: Script cancellation support. declare 237 { @@ -1021,10 +1018,9 @@ interface tclIntPlat declare 0 win { void TclWinConvertError(DWORD errCode) } -# Removed in Tcl 9.0 -#declare 1 win { -# void TclWinConvertWSAError(DWORD errCode) -#} +declare 1 win { + void TclWinConvertWSAError(DWORD errCode) +} declare 2 win { struct servent *TclWinGetServByName(const char *nm, const char *proto) @@ -1199,13 +1195,14 @@ declare 9 unix { declare 10 unix { Tcl_DirEntry *TclpReaddir(DIR *dir) } -# Removed in Tcl 9.0 -#declare 11 unix { -# struct tm *TclpLocaltime_unix(const time_t *clock) -#} -#declare 12 unix { -# struct tm *TclpGmtime_unix(const time_t *clock) -#} +# Slots 11 and 12 are forwarders for functions that were promoted to +# generic Stubs +declare 11 unix { + struct tm *TclpLocaltime_unix(const time_t *clock) +} +declare 12 unix { + struct tm *TclpGmtime_unix(const time_t *clock) +} declare 13 unix { char *TclpInetNtoa(struct in_addr addr) } diff --git a/generic/tclInt.h b/generic/tclInt.h index 15621c6..f45746e 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -152,13 +152,13 @@ typedef struct Tcl_ResolvedVarInfo { } Tcl_ResolvedVarInfo; typedef int (Tcl_ResolveCompiledVarProc)(Tcl_Interp *interp, - const char *name, int length, Tcl_Namespace *context, + CONST84 char *name, int length, Tcl_Namespace *context, Tcl_ResolvedVarInfo **rPtr); -typedef int (Tcl_ResolveVarProc)(Tcl_Interp *interp, const char *name, +typedef int (Tcl_ResolveVarProc)(Tcl_Interp *interp, CONST84 char *name, Tcl_Namespace *context, int flags, Tcl_Var *rPtr); -typedef int (Tcl_ResolveCmdProc)(Tcl_Interp *interp, const char *name, +typedef int (Tcl_ResolveCmdProc)(Tcl_Interp *interp, CONST84 char *name, Tcl_Namespace *context, int flags, Tcl_Command *rPtr); typedef struct Tcl_ResolverInfo { @@ -1567,33 +1567,42 @@ enum PkgPreferOptions { */ typedef struct Interp { - /* - * The first two fields were named "result" and "freeProc" in earlier - * versions of Tcl. They are no longer used within Tcl, and are no - * longer available to be accessed by extensions. However, they cannot - * be removed. Why? There is a deployed base of stub-enabled extensions - * that query the value of iPtr->stubTable. For them to continue to work, - * the location of the field "stubTable" within the Interp struct cannot - * change. The most robust way to assure that is to leave all fields up to - * that one undisturbed. + * Note: the first three fields must match exactly the fields in a + * Tcl_Interp struct (see tcl.h). If you change one, be sure to change the + * other. + * + * The interpreter's result is held in both the string and the + * objResultPtr fields. These fields hold, respectively, the result's + * string or object value. The interpreter's result is always in the + * result field if that is non-empty, otherwise it is in objResultPtr. + * The two fields are kept consistent unless some C code sets + * interp->result directly. Programs should not access result and + * objResultPtr directly; instead, they should always get and set the + * result using procedures such as Tcl_SetObjResult, Tcl_GetObjResult, and + * Tcl_GetStringResult. See the SetResult man page for details. */ - const char *legacyResult; - void (*legacyFreeProc) (void); + char *result; /* If the last command returned a string + * result, this points to it. Should not be + * accessed directly; see comment above. */ + Tcl_FreeProc *freeProc; /* Zero means a string result is statically + * allocated. TCL_DYNAMIC means string result + * was allocated with ckalloc and should be + * freed with ckfree. Other values give + * address of procedure to invoke to free the + * string result. Tcl_Eval must free it before + * executing next command. */ int errorLine; /* When TCL_ERROR is returned, this gives the * line number in the command where the error * occurred (1 means first line). */ const struct TclStubs *stubTable; - /* Pointer to the exported Tcl stub table. In - * ancient pre-8.1 versions of Tcl this was a - * pointer to the objResultPtr or a pointer to a - * buckets array in a hash table. Deployed stubs - * enabled extensions check for a NULL pointer value - * and for a TCL_STUBS_MAGIC value to verify they - * are not [load]ing into one of those pre-stubs - * interps. - */ + /* Pointer to the exported Tcl stub table. On + * previous versions of Tcl this is a pointer + * to the objResultPtr or a pointer to a + * buckets array in a hash table. We therefore + * have to do some careful checking before we + * can use this. */ TclHandle handle; /* Handle used to keep track of when this * interp is deleted. */ @@ -1606,6 +1615,8 @@ typedef struct Interp { ClientData interpInfo; /* Information used by tclInterp.c to keep * track of master/slave interps on a * per-interp basis. */ + Tcl_HashTable unused2; /* No longer used (was mathFuncTable) */ + /* * Information related to procedures and variables. See tclProc.c and * tclVar.c for usage. @@ -1635,6 +1646,19 @@ typedef struct Interp { * TCL_EVAL_INVOKE call to Tcl_EvalObjv. */ /* + * Information used by Tcl_AppendResult to keep track of partial results. + * See Tcl_AppendResult code for details. + */ + + char *appendResult; /* Storage space for results generated by + * Tcl_AppendResult. Ckalloc-ed. NULL means + * not yet allocated. */ + int appendAvl; /* Total amount of space available at + * partialResult. */ + int appendUsed; /* Number of non-null bytes currently stored + * at partialResult. */ + + /* * Information about packages. Used only in tclPkg.c. */ @@ -1656,6 +1680,7 @@ typedef struct Interp { * Normally zero, but may be set before * calling Tcl_Eval. See below for valid * values. */ + int unused1; /* No longer used (was termOffset) */ LiteralTable literalTable; /* Contains LiteralEntry's describing all Tcl * objects holding literals of scripts * compiled by the interpreter. Indexed by the @@ -1693,6 +1718,8 @@ typedef struct Interp { * string. Returned by Tcl_ObjSetVar2 when * variable traces change a variable in a * gross way. */ + char resultSpace[TCL_RESULT_SIZE+1]; + /* Static space holding small results. */ Tcl_Obj *objResultPtr; /* If the last command returned an object * result, this points to it. Should not be * accessed directly; see comment above. */ @@ -2256,6 +2283,16 @@ typedef struct TclFileAttrProcs { typedef struct TclFile_ *TclFile; +/* + * The "globParameters" argument of the function TclGlob is an or'ed + * combination of the following values: + */ + +#define TCL_GLOBMODE_NO_COMPLAIN 1 +#define TCL_GLOBMODE_JOIN 2 +#define TCL_GLOBMODE_DIR 4 +#define TCL_GLOBMODE_TAILS 8 + typedef enum Tcl_PathPart { TCL_PATH_DIRNAME, TCL_PATH_TAIL, @@ -2523,6 +2560,8 @@ MODULE_SCOPE int TclByteArrayMatch(const unsigned char *string, int strLen, const unsigned char *pattern, int ptnLen, int flags); MODULE_SCOPE double TclCeil(const mp_int *a); +MODULE_SCOPE int TclCheckBadOctal(Tcl_Interp *interp, + const char *value); MODULE_SCOPE int TclChanCaughtErrorBypass(Tcl_Interp *interp, Tcl_Channel chan); MODULE_SCOPE Tcl_ObjCmdProc TclChannelNamesCmd; @@ -2587,6 +2626,9 @@ MODULE_SCOPE int TclGetOpenModeEx(Tcl_Interp *interp, const char *modeString, int *seekFlagPtr, int *binaryPtr); MODULE_SCOPE Tcl_Obj * TclGetProcessGlobalValue(ProcessGlobalValue *pgvPtr); +MODULE_SCOPE int TclGlob(Tcl_Interp *interp, char *pattern, + Tcl_Obj *unquotedPrefix, int globFlags, + Tcl_GlobTypeData *types); MODULE_SCOPE int TclIncrObj(Tcl_Interp *interp, Tcl_Obj *valuePtr, Tcl_Obj *incrPtr); MODULE_SCOPE Tcl_Obj * TclIncrObjVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, @@ -3594,33 +3636,24 @@ typedef const char *TclDTraceStr; * Invalidate the string rep first so we can use the bytes value for our * pointer chain, and signal an obj deletion (as opposed to shimmering) with * 'length == -1'. - * - * Use do/while0 idiom for optimum correctness without compiler warnings. - * http://c2.com/cgi/wiki?TrivialDoWhileLoop - * - * Decrement refCount AFTER checking it for 0 or 1 (<2), because - * we cannot assume anymore that refCount is a signed type; In - * Tcl8 it was but in Tcl9 it is subject to change. + * Use empty 'if ; else' to handle use in unbraced outer if/else conditions. */ # define TclDecrRefCount(objPtr) \ - do { \ - Tcl_Obj *_objPtr = (objPtr); \ - if (_objPtr->refCount-- < 2) { \ - if (!_objPtr->typePtr || !_objPtr->typePtr->freeIntRepProc) { \ - TCL_DTRACE_OBJ_FREE(_objPtr); \ - if (_objPtr->bytes \ - && (_objPtr->bytes != tclEmptyStringRep)) { \ - ckfree((char *) _objPtr->bytes); \ - } \ - _objPtr->length = -1; \ - TclFreeObjStorage(_objPtr); \ - TclIncrObjsFreed(); \ - } else { \ - TclFreeObj(_objPtr); \ + if (--(objPtr)->refCount > 0) ; else { \ + if (!(objPtr)->typePtr || !(objPtr)->typePtr->freeIntRepProc) { \ + TCL_DTRACE_OBJ_FREE(objPtr); \ + if ((objPtr)->bytes \ + && ((objPtr)->bytes != tclEmptyStringRep)) { \ + ckfree((char *) (objPtr)->bytes); \ } \ + (objPtr)->length = -1; \ + TclFreeObjStorage(objPtr); \ + TclIncrObjsFreed(); \ + } else { \ + TclFreeObj(objPtr); \ } \ - } while(0) + } #else /* TCL_MEM_DEBUG */ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index f9171ef..077c231 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -17,6 +17,17 @@ #include "tclPort.h" +#undef TCL_STORAGE_CLASS +#ifdef BUILD_tcl +# define TCL_STORAGE_CLASS DLLEXPORT +#else +# ifdef USE_TCL_STUBS +# define TCL_STORAGE_CLASS +# else +# define TCL_STORAGE_CLASS DLLIMPORT +# endif +#endif + /* [Bug #803489] Tcl_FindNamespace problem in the Stubs table */ #undef Tcl_CreateNamespace #undef Tcl_DeleteNamespace @@ -49,136 +60,139 @@ /* Slot 3 is reserved */ /* Slot 4 is reserved */ /* 5 */ -TCLAPI int TclCleanupChildren(Tcl_Interp *interp, int numPids, +EXTERN int TclCleanupChildren(Tcl_Interp *interp, int numPids, Tcl_Pid *pidPtr, Tcl_Channel errorChan); /* 6 */ -TCLAPI void TclCleanupCommand(Command *cmdPtr); +EXTERN void TclCleanupCommand(Command *cmdPtr); /* 7 */ -TCLAPI int TclCopyAndCollapse(int count, const char *src, +EXTERN int TclCopyAndCollapse(int count, const char *src, char *dst); -/* Slot 8 is reserved */ +/* 8 */ +EXTERN int TclCopyChannelOld(Tcl_Interp *interp, + Tcl_Channel inChan, Tcl_Channel outChan, + int toRead, Tcl_Obj *cmdPtr); /* 9 */ -TCLAPI int TclCreatePipeline(Tcl_Interp *interp, int argc, +EXTERN int TclCreatePipeline(Tcl_Interp *interp, int argc, const char **argv, Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr, TclFile *errFilePtr); /* 10 */ -TCLAPI int TclCreateProc(Tcl_Interp *interp, Namespace *nsPtr, +EXTERN int TclCreateProc(Tcl_Interp *interp, Namespace *nsPtr, const char *procName, Tcl_Obj *argsPtr, Tcl_Obj *bodyPtr, Proc **procPtrPtr); /* 11 */ -TCLAPI void TclDeleteCompiledLocalVars(Interp *iPtr, +EXTERN void TclDeleteCompiledLocalVars(Interp *iPtr, CallFrame *framePtr); /* 12 */ -TCLAPI void TclDeleteVars(Interp *iPtr, +EXTERN void TclDeleteVars(Interp *iPtr, TclVarHashTable *tablePtr); /* Slot 13 is reserved */ /* 14 */ -TCLAPI int TclDumpMemoryInfo(ClientData clientData, int flags); +EXTERN int TclDumpMemoryInfo(ClientData clientData, int flags); /* Slot 15 is reserved */ /* 16 */ -TCLAPI void TclExprFloatError(Tcl_Interp *interp, double value); +EXTERN void TclExprFloatError(Tcl_Interp *interp, double value); /* Slot 17 is reserved */ /* Slot 18 is reserved */ /* Slot 19 is reserved */ /* Slot 20 is reserved */ /* Slot 21 is reserved */ /* 22 */ -TCLAPI int TclFindElement(Tcl_Interp *interp, +EXTERN int TclFindElement(Tcl_Interp *interp, const char *listStr, int listLength, const char **elementPtr, const char **nextPtr, int *sizePtr, int *bracePtr); /* 23 */ -TCLAPI Proc * TclFindProc(Interp *iPtr, const char *procName); +EXTERN Proc * TclFindProc(Interp *iPtr, const char *procName); /* 24 */ -TCLAPI int TclFormatInt(char *buffer, long n); +EXTERN int TclFormatInt(char *buffer, long n); /* 25 */ -TCLAPI void TclFreePackageInfo(Interp *iPtr); +EXTERN void TclFreePackageInfo(Interp *iPtr); /* Slot 26 is reserved */ /* Slot 27 is reserved */ /* 28 */ -TCLAPI Tcl_Channel TclpGetDefaultStdChannel(int type); +EXTERN Tcl_Channel TclpGetDefaultStdChannel(int type); /* Slot 29 is reserved */ /* Slot 30 is reserved */ /* 31 */ -TCLAPI const char * TclGetExtension(const char *name); +EXTERN const char * TclGetExtension(const char *name); /* 32 */ -TCLAPI int TclGetFrame(Tcl_Interp *interp, const char *str, +EXTERN int TclGetFrame(Tcl_Interp *interp, const char *str, CallFrame **framePtrPtr); /* Slot 33 is reserved */ /* 34 */ -TCLAPI int TclGetIntForIndex(Tcl_Interp *interp, +EXTERN int TclGetIntForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr, int endValue, int *indexPtr); /* Slot 35 is reserved */ /* Slot 36 is reserved */ /* 37 */ -TCLAPI int TclGetLoadedPackages(Tcl_Interp *interp, +EXTERN int TclGetLoadedPackages(Tcl_Interp *interp, const char *targetName); /* 38 */ -TCLAPI int TclGetNamespaceForQualName(Tcl_Interp *interp, +EXTERN int TclGetNamespaceForQualName(Tcl_Interp *interp, const char *qualName, Namespace *cxtNsPtr, int flags, Namespace **nsPtrPtr, Namespace **altNsPtrPtr, Namespace **actualCxtPtrPtr, const char **simpleNamePtr); /* 39 */ -TCLAPI TclObjCmdProcType TclGetObjInterpProc(void); +EXTERN TclObjCmdProcType TclGetObjInterpProc(void); /* 40 */ -TCLAPI int TclGetOpenMode(Tcl_Interp *interp, const char *str, +EXTERN int TclGetOpenMode(Tcl_Interp *interp, const char *str, int *seekFlagPtr); /* 41 */ -TCLAPI Tcl_Command TclGetOriginalCommand(Tcl_Command command); +EXTERN Tcl_Command TclGetOriginalCommand(Tcl_Command command); /* 42 */ -TCLAPI const char * TclpGetUserHome(const char *name, +EXTERN CONST86 char * TclpGetUserHome(const char *name, Tcl_DString *bufferPtr); /* Slot 43 is reserved */ /* 44 */ -TCLAPI int TclGuessPackageName(const char *fileName, +EXTERN int TclGuessPackageName(const char *fileName, Tcl_DString *bufPtr); /* 45 */ -TCLAPI int TclHideUnsafeCommands(Tcl_Interp *interp); +EXTERN int TclHideUnsafeCommands(Tcl_Interp *interp); /* 46 */ -TCLAPI int TclInExit(void); +EXTERN int TclInExit(void); /* Slot 47 is reserved */ /* Slot 48 is reserved */ /* Slot 49 is reserved */ /* 50 */ -TCLAPI void TclInitCompiledLocals(Tcl_Interp *interp, +EXTERN void TclInitCompiledLocals(Tcl_Interp *interp, CallFrame *framePtr, Namespace *nsPtr); /* 51 */ -TCLAPI int TclInterpInit(Tcl_Interp *interp); +EXTERN int TclInterpInit(Tcl_Interp *interp); /* Slot 52 is reserved */ /* 53 */ -TCLAPI int TclInvokeObjectCommand(ClientData clientData, +EXTERN int TclInvokeObjectCommand(ClientData clientData, Tcl_Interp *interp, int argc, - const char **argv); + CONST84 char **argv); /* 54 */ -TCLAPI int TclInvokeStringCommand(ClientData clientData, +EXTERN int TclInvokeStringCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 55 */ -TCLAPI Proc * TclIsProc(Command *cmdPtr); +EXTERN Proc * TclIsProc(Command *cmdPtr); /* Slot 56 is reserved */ /* Slot 57 is reserved */ /* 58 */ -TCLAPI Var * TclLookupVar(Tcl_Interp *interp, const char *part1, +EXTERN Var * TclLookupVar(Tcl_Interp *interp, const char *part1, const char *part2, int flags, const char *msg, int createPart1, int createPart2, Var **arrayPtrPtr); /* Slot 59 is reserved */ /* 60 */ -TCLAPI int TclNeedSpace(const char *start, const char *end); +EXTERN int TclNeedSpace(const char *start, const char *end); /* 61 */ -TCLAPI Tcl_Obj * TclNewProcBodyObj(Proc *procPtr); +EXTERN Tcl_Obj * TclNewProcBodyObj(Proc *procPtr); /* 62 */ -TCLAPI int TclObjCommandComplete(Tcl_Obj *cmdPtr); +EXTERN int TclObjCommandComplete(Tcl_Obj *cmdPtr); /* 63 */ -TCLAPI int TclObjInterpProc(ClientData clientData, +EXTERN int TclObjInterpProc(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 64 */ -TCLAPI int TclObjInvoke(Tcl_Interp *interp, int objc, +EXTERN int TclObjInvoke(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags); /* Slot 65 is reserved */ /* Slot 66 is reserved */ @@ -191,10 +205,11 @@ TCLAPI int TclObjInvoke(Tcl_Interp *interp, int objc, /* Slot 73 is reserved */ /* Slot 74 is reserved */ /* 75 */ -TCLAPI unsigned long TclpGetClicks(void); +EXTERN unsigned long TclpGetClicks(void); /* 76 */ -TCLAPI unsigned long TclpGetSeconds(void); -/* Slot 77 is reserved */ +EXTERN unsigned long TclpGetSeconds(void); +/* 77 */ +EXTERN void TclpGetTime(Tcl_Time *time); /* Slot 78 is reserved */ /* Slot 79 is reserved */ /* Slot 80 is reserved */ @@ -206,229 +221,235 @@ TCLAPI unsigned long TclpGetSeconds(void); /* Slot 86 is reserved */ /* Slot 87 is reserved */ /* 88 */ -TCLAPI char * TclPrecTraceProc(ClientData clientData, +EXTERN char * TclPrecTraceProc(ClientData clientData, Tcl_Interp *interp, const char *name1, const char *name2, int flags); /* 89 */ -TCLAPI int TclPreventAliasLoop(Tcl_Interp *interp, +EXTERN int TclPreventAliasLoop(Tcl_Interp *interp, Tcl_Interp *cmdInterp, Tcl_Command cmd); /* Slot 90 is reserved */ /* 91 */ -TCLAPI void TclProcCleanupProc(Proc *procPtr); +EXTERN void TclProcCleanupProc(Proc *procPtr); /* 92 */ -TCLAPI int TclProcCompileProc(Tcl_Interp *interp, Proc *procPtr, +EXTERN int TclProcCompileProc(Tcl_Interp *interp, Proc *procPtr, Tcl_Obj *bodyPtr, Namespace *nsPtr, const char *description, const char *procName); /* 93 */ -TCLAPI void TclProcDeleteProc(ClientData clientData); +EXTERN void TclProcDeleteProc(ClientData clientData); /* Slot 94 is reserved */ /* Slot 95 is reserved */ /* 96 */ -TCLAPI int TclRenameCommand(Tcl_Interp *interp, +EXTERN int TclRenameCommand(Tcl_Interp *interp, const char *oldName, const char *newName); /* 97 */ -TCLAPI void TclResetShadowedCmdRefs(Tcl_Interp *interp, +EXTERN void TclResetShadowedCmdRefs(Tcl_Interp *interp, Command *newCmdPtr); /* 98 */ -TCLAPI int TclServiceIdle(void); +EXTERN int TclServiceIdle(void); /* Slot 99 is reserved */ /* Slot 100 is reserved */ /* 101 */ -TCLAPI const char * TclSetPreInitScript(const char *string); +EXTERN CONST86 char * TclSetPreInitScript(const char *string); /* 102 */ -TCLAPI void TclSetupEnv(Tcl_Interp *interp); +EXTERN void TclSetupEnv(Tcl_Interp *interp); /* 103 */ -TCLAPI int TclSockGetPort(Tcl_Interp *interp, const char *str, +EXTERN int TclSockGetPort(Tcl_Interp *interp, const char *str, const char *proto, int *portPtr); -/* Slot 104 is reserved */ +/* 104 */ +EXTERN int TclSockMinimumBuffersOld(int sock, int size); /* Slot 105 is reserved */ /* Slot 106 is reserved */ /* Slot 107 is reserved */ /* 108 */ -TCLAPI void TclTeardownNamespace(Namespace *nsPtr); +EXTERN void TclTeardownNamespace(Namespace *nsPtr); /* 109 */ -TCLAPI int TclUpdateReturnInfo(Interp *iPtr); +EXTERN int TclUpdateReturnInfo(Interp *iPtr); /* 110 */ -TCLAPI int TclSockMinimumBuffers(void *sock, int size); +EXTERN int TclSockMinimumBuffers(void *sock, int size); /* 111 */ -TCLAPI void Tcl_AddInterpResolvers(Tcl_Interp *interp, +EXTERN void Tcl_AddInterpResolvers(Tcl_Interp *interp, const char *name, Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, Tcl_ResolveCompiledVarProc *compiledVarProc); /* 112 */ -TCLAPI int Tcl_AppendExportList(Tcl_Interp *interp, +EXTERN int Tcl_AppendExportList(Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *objPtr); /* 113 */ -TCLAPI Tcl_Namespace * Tcl_CreateNamespace(Tcl_Interp *interp, +EXTERN Tcl_Namespace * Tcl_CreateNamespace(Tcl_Interp *interp, const char *name, ClientData clientData, Tcl_NamespaceDeleteProc *deleteProc); /* 114 */ -TCLAPI void Tcl_DeleteNamespace(Tcl_Namespace *nsPtr); +EXTERN void Tcl_DeleteNamespace(Tcl_Namespace *nsPtr); /* 115 */ -TCLAPI int Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr, +EXTERN int Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int resetListFirst); /* 116 */ -TCLAPI Tcl_Command Tcl_FindCommand(Tcl_Interp *interp, const char *name, +EXTERN Tcl_Command Tcl_FindCommand(Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 117 */ -TCLAPI Tcl_Namespace * Tcl_FindNamespace(Tcl_Interp *interp, +EXTERN Tcl_Namespace * Tcl_FindNamespace(Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 118 */ -TCLAPI int Tcl_GetInterpResolvers(Tcl_Interp *interp, +EXTERN int Tcl_GetInterpResolvers(Tcl_Interp *interp, const char *name, Tcl_ResolverInfo *resInfo); /* 119 */ -TCLAPI int Tcl_GetNamespaceResolvers( +EXTERN int Tcl_GetNamespaceResolvers( Tcl_Namespace *namespacePtr, Tcl_ResolverInfo *resInfo); /* 120 */ -TCLAPI Tcl_Var Tcl_FindNamespaceVar(Tcl_Interp *interp, +EXTERN Tcl_Var Tcl_FindNamespaceVar(Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 121 */ -TCLAPI int Tcl_ForgetImport(Tcl_Interp *interp, +EXTERN int Tcl_ForgetImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern); /* 122 */ -TCLAPI Tcl_Command Tcl_GetCommandFromObj(Tcl_Interp *interp, +EXTERN Tcl_Command Tcl_GetCommandFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr); /* 123 */ -TCLAPI void Tcl_GetCommandFullName(Tcl_Interp *interp, +EXTERN void Tcl_GetCommandFullName(Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 124 */ -TCLAPI Tcl_Namespace * Tcl_GetCurrentNamespace(Tcl_Interp *interp); +EXTERN Tcl_Namespace * Tcl_GetCurrentNamespace(Tcl_Interp *interp); /* 125 */ -TCLAPI Tcl_Namespace * Tcl_GetGlobalNamespace(Tcl_Interp *interp); +EXTERN Tcl_Namespace * Tcl_GetGlobalNamespace(Tcl_Interp *interp); /* 126 */ -TCLAPI void Tcl_GetVariableFullName(Tcl_Interp *interp, +EXTERN void Tcl_GetVariableFullName(Tcl_Interp *interp, Tcl_Var variable, Tcl_Obj *objPtr); /* 127 */ -TCLAPI int Tcl_Import(Tcl_Interp *interp, Tcl_Namespace *nsPtr, +EXTERN int Tcl_Import(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int allowOverwrite); /* 128 */ -TCLAPI void Tcl_PopCallFrame(Tcl_Interp *interp); +EXTERN void Tcl_PopCallFrame(Tcl_Interp *interp); /* 129 */ -TCLAPI int Tcl_PushCallFrame(Tcl_Interp *interp, +EXTERN int Tcl_PushCallFrame(Tcl_Interp *interp, CallFrame *framePtr, Tcl_Namespace *nsPtr, int isProcCallFrame); /* 130 */ -TCLAPI int Tcl_RemoveInterpResolvers(Tcl_Interp *interp, +EXTERN int Tcl_RemoveInterpResolvers(Tcl_Interp *interp, const char *name); /* 131 */ -TCLAPI void Tcl_SetNamespaceResolvers( +EXTERN void Tcl_SetNamespaceResolvers( Tcl_Namespace *namespacePtr, Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, Tcl_ResolveCompiledVarProc *compiledVarProc); /* 132 */ -TCLAPI int TclpHasSockets(Tcl_Interp *interp); -/* Slot 133 is reserved */ +EXTERN int TclpHasSockets(Tcl_Interp *interp); +/* 133 */ +EXTERN struct tm * TclpGetDate(const time_t *time, int useGMT); /* Slot 134 is reserved */ /* Slot 135 is reserved */ /* Slot 136 is reserved */ /* Slot 137 is reserved */ /* 138 */ -TCLAPI const char * TclGetEnv(const char *name, Tcl_DString *valuePtr); +EXTERN CONST84_RETURN char * TclGetEnv(const char *name, + Tcl_DString *valuePtr); /* Slot 139 is reserved */ /* Slot 140 is reserved */ /* 141 */ -TCLAPI const char * TclpGetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr); +EXTERN CONST84_RETURN char * TclpGetCwd(Tcl_Interp *interp, + Tcl_DString *cwdPtr); /* 142 */ -TCLAPI int TclSetByteCodeFromAny(Tcl_Interp *interp, +EXTERN int TclSetByteCodeFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr, CompileHookProc *hookProc, ClientData clientData); /* 143 */ -TCLAPI int TclAddLiteralObj(struct CompileEnv *envPtr, +EXTERN int TclAddLiteralObj(struct CompileEnv *envPtr, Tcl_Obj *objPtr, LiteralEntry **litPtrPtr); /* 144 */ -TCLAPI void TclHideLiteral(Tcl_Interp *interp, +EXTERN void TclHideLiteral(Tcl_Interp *interp, struct CompileEnv *envPtr, int index); /* 145 */ -TCLAPI const struct AuxDataType * TclGetAuxDataType(const char *typeName); +EXTERN const struct AuxDataType * TclGetAuxDataType(const char *typeName); /* 146 */ -TCLAPI TclHandle TclHandleCreate(void *ptr); +EXTERN TclHandle TclHandleCreate(void *ptr); /* 147 */ -TCLAPI void TclHandleFree(TclHandle handle); +EXTERN void TclHandleFree(TclHandle handle); /* 148 */ -TCLAPI TclHandle TclHandlePreserve(TclHandle handle); +EXTERN TclHandle TclHandlePreserve(TclHandle handle); /* 149 */ -TCLAPI void TclHandleRelease(TclHandle handle); +EXTERN void TclHandleRelease(TclHandle handle); /* 150 */ -TCLAPI int TclRegAbout(Tcl_Interp *interp, Tcl_RegExp re); +EXTERN int TclRegAbout(Tcl_Interp *interp, Tcl_RegExp re); /* 151 */ -TCLAPI void TclRegExpRangeUniChar(Tcl_RegExp re, int index, +EXTERN void TclRegExpRangeUniChar(Tcl_RegExp re, int index, int *startPtr, int *endPtr); /* 152 */ -TCLAPI void TclSetLibraryPath(Tcl_Obj *pathPtr); +EXTERN void TclSetLibraryPath(Tcl_Obj *pathPtr); /* 153 */ -TCLAPI Tcl_Obj * TclGetLibraryPath(void); +EXTERN Tcl_Obj * TclGetLibraryPath(void); /* Slot 154 is reserved */ /* Slot 155 is reserved */ /* 156 */ -TCLAPI void TclRegError(Tcl_Interp *interp, const char *msg, +EXTERN void TclRegError(Tcl_Interp *interp, const char *msg, int status); /* 157 */ -TCLAPI Var * TclVarTraceExists(Tcl_Interp *interp, +EXTERN Var * TclVarTraceExists(Tcl_Interp *interp, const char *varName); /* Slot 158 is reserved */ /* Slot 159 is reserved */ /* Slot 160 is reserved */ /* 161 */ -TCLAPI int TclChannelTransform(Tcl_Interp *interp, +EXTERN int TclChannelTransform(Tcl_Interp *interp, Tcl_Channel chan, Tcl_Obj *cmdObjPtr); /* 162 */ -TCLAPI void TclChannelEventScriptInvoker(ClientData clientData, +EXTERN void TclChannelEventScriptInvoker(ClientData clientData, int flags); /* 163 */ -TCLAPI const void * TclGetInstructionTable(void); +EXTERN const void * TclGetInstructionTable(void); /* 164 */ -TCLAPI void TclExpandCodeArray(void *envPtr); +EXTERN void TclExpandCodeArray(void *envPtr); /* 165 */ -TCLAPI void TclpSetInitialEncodings(void); +EXTERN void TclpSetInitialEncodings(void); /* 166 */ -TCLAPI int TclListObjSetElement(Tcl_Interp *interp, +EXTERN int TclListObjSetElement(Tcl_Interp *interp, Tcl_Obj *listPtr, int index, Tcl_Obj *valuePtr); /* Slot 167 is reserved */ /* Slot 168 is reserved */ /* 169 */ -TCLAPI int TclpUtfNcmp2(const char *s1, const char *s2, +EXTERN int TclpUtfNcmp2(const char *s1, const char *s2, unsigned long n); /* 170 */ -TCLAPI int TclCheckInterpTraces(Tcl_Interp *interp, +EXTERN int TclCheckInterpTraces(Tcl_Interp *interp, const char *command, int numChars, Command *cmdPtr, int result, int traceFlags, int objc, Tcl_Obj *const objv[]); /* 171 */ -TCLAPI int TclCheckExecutionTraces(Tcl_Interp *interp, +EXTERN int TclCheckExecutionTraces(Tcl_Interp *interp, const char *command, int numChars, Command *cmdPtr, int result, int traceFlags, int objc, Tcl_Obj *const objv[]); /* 172 */ -TCLAPI int TclInThreadExit(void); +EXTERN int TclInThreadExit(void); /* 173 */ -TCLAPI int TclUniCharMatch(const Tcl_UniChar *string, +EXTERN int TclUniCharMatch(const Tcl_UniChar *string, int strLen, const Tcl_UniChar *pattern, int ptnLen, int flags); /* Slot 174 is reserved */ /* 175 */ -TCLAPI int TclCallVarTraces(Interp *iPtr, Var *arrayPtr, +EXTERN int TclCallVarTraces(Interp *iPtr, Var *arrayPtr, Var *varPtr, const char *part1, const char *part2, int flags, int leaveErrMsg); /* 176 */ -TCLAPI void TclCleanupVar(Var *varPtr, Var *arrayPtr); +EXTERN void TclCleanupVar(Var *varPtr, Var *arrayPtr); /* 177 */ -TCLAPI void TclVarErrMsg(Tcl_Interp *interp, const char *part1, +EXTERN void TclVarErrMsg(Tcl_Interp *interp, const char *part1, const char *part2, const char *operation, const char *reason); /* Slot 178 is reserved */ /* Slot 179 is reserved */ /* Slot 180 is reserved */ /* Slot 181 is reserved */ -/* Slot 182 is reserved */ -/* Slot 183 is reserved */ +/* 182 */ +EXTERN struct tm * TclpLocaltime(const time_t *clock); +/* 183 */ +EXTERN struct tm * TclpGmtime(const time_t *clock); /* Slot 184 is reserved */ /* Slot 185 is reserved */ /* Slot 186 is reserved */ @@ -444,127 +465,126 @@ TCLAPI void TclVarErrMsg(Tcl_Interp *interp, const char *part1, /* Slot 196 is reserved */ /* Slot 197 is reserved */ /* 198 */ -TCLAPI int TclObjGetFrame(Tcl_Interp *interp, Tcl_Obj *objPtr, +EXTERN int TclObjGetFrame(Tcl_Interp *interp, Tcl_Obj *objPtr, CallFrame **framePtrPtr); /* Slot 199 is reserved */ /* 200 */ -TCLAPI int TclpObjRemoveDirectory(Tcl_Obj *pathPtr, +EXTERN int TclpObjRemoveDirectory(Tcl_Obj *pathPtr, int recursive, Tcl_Obj **errorPtr); /* 201 */ -TCLAPI int TclpObjCopyDirectory(Tcl_Obj *srcPathPtr, +EXTERN int TclpObjCopyDirectory(Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr, Tcl_Obj **errorPtr); /* 202 */ -TCLAPI int TclpObjCreateDirectory(Tcl_Obj *pathPtr); +EXTERN int TclpObjCreateDirectory(Tcl_Obj *pathPtr); /* 203 */ -TCLAPI int TclpObjDeleteFile(Tcl_Obj *pathPtr); +EXTERN int TclpObjDeleteFile(Tcl_Obj *pathPtr); /* 204 */ -TCLAPI int TclpObjCopyFile(Tcl_Obj *srcPathPtr, +EXTERN int TclpObjCopyFile(Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr); /* 205 */ -TCLAPI int TclpObjRenameFile(Tcl_Obj *srcPathPtr, +EXTERN int TclpObjRenameFile(Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr); /* 206 */ -TCLAPI int TclpObjStat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf); +EXTERN int TclpObjStat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf); /* 207 */ -TCLAPI int TclpObjAccess(Tcl_Obj *pathPtr, int mode); +EXTERN int TclpObjAccess(Tcl_Obj *pathPtr, int mode); /* 208 */ -TCLAPI Tcl_Channel TclpOpenFileChannel(Tcl_Interp *interp, +EXTERN Tcl_Channel TclpOpenFileChannel(Tcl_Interp *interp, Tcl_Obj *pathPtr, int mode, int permissions); /* Slot 209 is reserved */ /* Slot 210 is reserved */ /* Slot 211 is reserved */ /* 212 */ -TCLAPI void TclpFindExecutable(const char *argv0); +EXTERN void TclpFindExecutable(const char *argv0); /* 213 */ -TCLAPI Tcl_Obj * TclGetObjNameOfExecutable(void); +EXTERN Tcl_Obj * TclGetObjNameOfExecutable(void); /* 214 */ -TCLAPI void TclSetObjNameOfExecutable(Tcl_Obj *name, +EXTERN void TclSetObjNameOfExecutable(Tcl_Obj *name, Tcl_Encoding encoding); /* Slot 215 is reserved */ /* Slot 216 is reserved */ /* 217 */ -TCLAPI int TclPushStackFrame(Tcl_Interp *interp, +EXTERN int TclPushStackFrame(Tcl_Interp *interp, CallFrame **framePtrPtr, Tcl_Namespace *namespacePtr, int isProcCallFrame); /* 218 */ -TCLAPI void TclPopStackFrame(Tcl_Interp *interp); +EXTERN void TclPopStackFrame(Tcl_Interp *interp); /* Slot 219 is reserved */ /* Slot 220 is reserved */ /* Slot 221 is reserved */ /* Slot 222 is reserved */ /* Slot 223 is reserved */ /* 224 */ -TCLAPI TclPlatformType * TclGetPlatform(void); +EXTERN TclPlatformType * TclGetPlatform(void); /* 225 */ -TCLAPI Tcl_Obj * TclTraceDictPath(Tcl_Interp *interp, +EXTERN Tcl_Obj * TclTraceDictPath(Tcl_Interp *interp, Tcl_Obj *rootPtr, int keyc, Tcl_Obj *const keyv[], int flags); /* Slot 226 is reserved */ /* 227 */ -TCLAPI void TclSetNsPath(Namespace *nsPtr, int pathLength, +EXTERN void TclSetNsPath(Namespace *nsPtr, int pathLength, Tcl_Namespace *pathAry[]); /* Slot 228 is reserved */ /* 229 */ -TCLAPI int TclPtrMakeUpvar(Tcl_Interp *interp, Var *otherP1Ptr, +EXTERN int TclPtrMakeUpvar(Tcl_Interp *interp, Var *otherP1Ptr, const char *myName, int myFlags, int index); /* 230 */ -TCLAPI Var * TclObjLookupVar(Tcl_Interp *interp, +EXTERN Var * TclObjLookupVar(Tcl_Interp *interp, Tcl_Obj *part1Ptr, const char *part2, int flags, const char *msg, const int createPart1, const int createPart2, Var **arrayPtrPtr); /* 231 */ -TCLAPI int TclGetNamespaceFromObj(Tcl_Interp *interp, +EXTERN int TclGetNamespaceFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Namespace **nsPtrPtr); /* Slot 232 is reserved */ /* Slot 233 is reserved */ /* 234 */ -TCLAPI Var * TclVarHashCreateVar(TclVarHashTable *tablePtr, +EXTERN Var * TclVarHashCreateVar(TclVarHashTable *tablePtr, const char *key, int *newPtr); /* 235 */ -TCLAPI void TclInitVarHashTable(TclVarHashTable *tablePtr, +EXTERN void TclInitVarHashTable(TclVarHashTable *tablePtr, Namespace *nsPtr); -/* 236 */ -TCLAPI void TclBackgroundException(Tcl_Interp *interp, int code); +/* Slot 236 is reserved */ /* 237 */ -TCLAPI int TclResetCancellation(Tcl_Interp *interp, int force); +EXTERN int TclResetCancellation(Tcl_Interp *interp, int force); /* Slot 238 is reserved */ /* 239 */ -TCLAPI int TclNRInterpProcCore(Tcl_Interp *interp, +EXTERN int TclNRInterpProcCore(Tcl_Interp *interp, Tcl_Obj *procNameObj, int skip, ProcErrorProc *errorProc); /* 240 */ -TCLAPI int TclNRRunCallbacks(Tcl_Interp *interp, int result); +EXTERN int TclNRRunCallbacks(Tcl_Interp *interp, int result); /* 241 */ -TCLAPI int TclNREvalObjEx(Tcl_Interp *interp, Tcl_Obj *objPtr, +EXTERN int TclNREvalObjEx(Tcl_Interp *interp, Tcl_Obj *objPtr, int flags); /* 242 */ -TCLAPI int TclNREvalObjv(Tcl_Interp *interp, int objc, +EXTERN int TclNREvalObjv(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int flags, Command *cmdPtr); /* 243 */ -TCLAPI void TclDbDumpActiveObjects(FILE *outFile); +EXTERN void TclDbDumpActiveObjects(FILE *outFile); /* 244 */ -TCLAPI Tcl_HashTable * TclGetNamespaceChildTable(Tcl_Namespace *nsPtr); +EXTERN Tcl_HashTable * TclGetNamespaceChildTable(Tcl_Namespace *nsPtr); /* 245 */ -TCLAPI Tcl_HashTable * TclGetNamespaceCommandTable(Tcl_Namespace *nsPtr); +EXTERN Tcl_HashTable * TclGetNamespaceCommandTable(Tcl_Namespace *nsPtr); /* 246 */ -TCLAPI int TclInitRewriteEnsemble(Tcl_Interp *interp, +EXTERN int TclInitRewriteEnsemble(Tcl_Interp *interp, int numRemoved, int numInserted, Tcl_Obj *const *objv); /* 247 */ -TCLAPI void TclResetRewriteEnsemble(Tcl_Interp *interp, +EXTERN void TclResetRewriteEnsemble(Tcl_Interp *interp, int isRootEnsemble); /* 248 */ -TCLAPI int TclCopyChannel(Tcl_Interp *interp, +EXTERN int TclCopyChannel(Tcl_Interp *interp, Tcl_Channel inChan, Tcl_Channel outChan, Tcl_WideInt toRead, Tcl_Obj *cmdPtr); /* 249 */ -TCLAPI char * TclDoubleDigits(double dv, int ndigits, int flags, +EXTERN char * TclDoubleDigits(double dv, int ndigits, int flags, int *decpt, int *signum, char **endPtr); /* 250 */ -TCLAPI void TclSetSlaveCancelFlags(Tcl_Interp *interp, int flags, +EXTERN void TclSetSlaveCancelFlags(Tcl_Interp *interp, int flags, int force); typedef struct TclIntStubs { @@ -579,7 +599,7 @@ typedef struct TclIntStubs { int (*tclCleanupChildren) (Tcl_Interp *interp, int numPids, Tcl_Pid *pidPtr, Tcl_Channel errorChan); /* 5 */ void (*tclCleanupCommand) (Command *cmdPtr); /* 6 */ int (*tclCopyAndCollapse) (int count, const char *src, char *dst); /* 7 */ - void (*reserved8)(void); + int (*tclCopyChannelOld) (Tcl_Interp *interp, Tcl_Channel inChan, Tcl_Channel outChan, int toRead, Tcl_Obj *cmdPtr); /* 8 */ int (*tclCreatePipeline) (Tcl_Interp *interp, int argc, const char **argv, Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr, TclFile *errFilePtr); /* 9 */ int (*tclCreateProc) (Tcl_Interp *interp, Namespace *nsPtr, const char *procName, Tcl_Obj *argsPtr, Tcl_Obj *bodyPtr, Proc **procPtrPtr); /* 10 */ void (*tclDeleteCompiledLocalVars) (Interp *iPtr, CallFrame *framePtr); /* 11 */ @@ -613,7 +633,7 @@ typedef struct TclIntStubs { TclObjCmdProcType (*tclGetObjInterpProc) (void); /* 39 */ int (*tclGetOpenMode) (Tcl_Interp *interp, const char *str, int *seekFlagPtr); /* 40 */ Tcl_Command (*tclGetOriginalCommand) (Tcl_Command command); /* 41 */ - const char * (*tclpGetUserHome) (const char *name, Tcl_DString *bufferPtr); /* 42 */ + CONST86 char * (*tclpGetUserHome) (const char *name, Tcl_DString *bufferPtr); /* 42 */ void (*reserved43)(void); int (*tclGuessPackageName) (const char *fileName, Tcl_DString *bufPtr); /* 44 */ int (*tclHideUnsafeCommands) (Tcl_Interp *interp); /* 45 */ @@ -624,7 +644,7 @@ typedef struct TclIntStubs { void (*tclInitCompiledLocals) (Tcl_Interp *interp, CallFrame *framePtr, Namespace *nsPtr); /* 50 */ int (*tclInterpInit) (Tcl_Interp *interp); /* 51 */ void (*reserved52)(void); - int (*tclInvokeObjectCommand) (ClientData clientData, Tcl_Interp *interp, int argc, const char **argv); /* 53 */ + int (*tclInvokeObjectCommand) (ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char **argv); /* 53 */ int (*tclInvokeStringCommand) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 54 */ Proc * (*tclIsProc) (Command *cmdPtr); /* 55 */ void (*reserved56)(void); @@ -648,7 +668,7 @@ typedef struct TclIntStubs { void (*reserved74)(void); unsigned long (*tclpGetClicks) (void); /* 75 */ unsigned long (*tclpGetSeconds) (void); /* 76 */ - void (*reserved77)(void); + void (*tclpGetTime) (Tcl_Time *time); /* 77 */ void (*reserved78)(void); void (*reserved79)(void); void (*reserved80)(void); @@ -672,10 +692,10 @@ typedef struct TclIntStubs { int (*tclServiceIdle) (void); /* 98 */ void (*reserved99)(void); void (*reserved100)(void); - const char * (*tclSetPreInitScript) (const char *string); /* 101 */ + CONST86 char * (*tclSetPreInitScript) (const char *string); /* 101 */ void (*tclSetupEnv) (Tcl_Interp *interp); /* 102 */ int (*tclSockGetPort) (Tcl_Interp *interp, const char *str, const char *proto, int *portPtr); /* 103 */ - void (*reserved104)(void); + int (*tclSockMinimumBuffersOld) (int sock, int size); /* 104 */ void (*reserved105)(void); void (*reserved106)(void); void (*reserved107)(void); @@ -704,15 +724,15 @@ typedef struct TclIntStubs { int (*tcl_RemoveInterpResolvers) (Tcl_Interp *interp, const char *name); /* 130 */ void (*tcl_SetNamespaceResolvers) (Tcl_Namespace *namespacePtr, Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, Tcl_ResolveCompiledVarProc *compiledVarProc); /* 131 */ int (*tclpHasSockets) (Tcl_Interp *interp); /* 132 */ - void (*reserved133)(void); + struct tm * (*tclpGetDate) (const time_t *time, int useGMT); /* 133 */ void (*reserved134)(void); void (*reserved135)(void); void (*reserved136)(void); void (*reserved137)(void); - const char * (*tclGetEnv) (const char *name, Tcl_DString *valuePtr); /* 138 */ + CONST84_RETURN char * (*tclGetEnv) (const char *name, Tcl_DString *valuePtr); /* 138 */ void (*reserved139)(void); void (*reserved140)(void); - const char * (*tclpGetCwd) (Tcl_Interp *interp, Tcl_DString *cwdPtr); /* 141 */ + CONST84_RETURN char * (*tclpGetCwd) (Tcl_Interp *interp, Tcl_DString *cwdPtr); /* 141 */ int (*tclSetByteCodeFromAny) (Tcl_Interp *interp, Tcl_Obj *objPtr, CompileHookProc *hookProc, ClientData clientData); /* 142 */ int (*tclAddLiteralObj) (struct CompileEnv *envPtr, Tcl_Obj *objPtr, LiteralEntry **litPtrPtr); /* 143 */ void (*tclHideLiteral) (Tcl_Interp *interp, struct CompileEnv *envPtr, int index); /* 144 */ @@ -753,8 +773,8 @@ typedef struct TclIntStubs { void (*reserved179)(void); void (*reserved180)(void); void (*reserved181)(void); - void (*reserved182)(void); - void (*reserved183)(void); + struct tm * (*tclpLocaltime) (const time_t *clock); /* 182 */ + struct tm * (*tclpGmtime) (const time_t *clock); /* 183 */ void (*reserved184)(void); void (*reserved185)(void); void (*reserved186)(void); @@ -807,7 +827,7 @@ typedef struct TclIntStubs { void (*reserved233)(void); Var * (*tclVarHashCreateVar) (TclVarHashTable *tablePtr, const char *key, int *newPtr); /* 234 */ void (*tclInitVarHashTable) (TclVarHashTable *tablePtr, Namespace *nsPtr); /* 235 */ - void (*tclBackgroundException) (Tcl_Interp *interp, int code); /* 236 */ + void (*reserved236)(void); int (*tclResetCancellation) (Tcl_Interp *interp, int force); /* 237 */ void (*reserved238)(void); int (*tclNRInterpProcCore) (Tcl_Interp *interp, Tcl_Obj *procNameObj, int skip, ProcErrorProc *errorProc); /* 239 */ @@ -849,7 +869,8 @@ extern const TclIntStubs *tclIntStubsPtr; (tclIntStubsPtr->tclCleanupCommand) /* 6 */ #define TclCopyAndCollapse \ (tclIntStubsPtr->tclCopyAndCollapse) /* 7 */ -/* Slot 8 is reserved */ +#define TclCopyChannelOld \ + (tclIntStubsPtr->tclCopyChannelOld) /* 8 */ #define TclCreatePipeline \ (tclIntStubsPtr->tclCreatePipeline) /* 9 */ #define TclCreateProc \ @@ -954,7 +975,8 @@ extern const TclIntStubs *tclIntStubsPtr; (tclIntStubsPtr->tclpGetClicks) /* 75 */ #define TclpGetSeconds \ (tclIntStubsPtr->tclpGetSeconds) /* 76 */ -/* Slot 77 is reserved */ +#define TclpGetTime \ + (tclIntStubsPtr->tclpGetTime) /* 77 */ /* Slot 78 is reserved */ /* Slot 79 is reserved */ /* Slot 80 is reserved */ @@ -992,7 +1014,8 @@ extern const TclIntStubs *tclIntStubsPtr; (tclIntStubsPtr->tclSetupEnv) /* 102 */ #define TclSockGetPort \ (tclIntStubsPtr->tclSockGetPort) /* 103 */ -/* Slot 104 is reserved */ +#define TclSockMinimumBuffersOld \ + (tclIntStubsPtr->tclSockMinimumBuffersOld) /* 104 */ /* Slot 105 is reserved */ /* Slot 106 is reserved */ /* Slot 107 is reserved */ @@ -1046,7 +1069,8 @@ extern const TclIntStubs *tclIntStubsPtr; (tclIntStubsPtr->tcl_SetNamespaceResolvers) /* 131 */ #define TclpHasSockets \ (tclIntStubsPtr->tclpHasSockets) /* 132 */ -/* Slot 133 is reserved */ +#define TclpGetDate \ + (tclIntStubsPtr->tclpGetDate) /* 133 */ /* Slot 134 is reserved */ /* Slot 135 is reserved */ /* Slot 136 is reserved */ @@ -1125,8 +1149,10 @@ extern const TclIntStubs *tclIntStubsPtr; /* Slot 179 is reserved */ /* Slot 180 is reserved */ /* Slot 181 is reserved */ -/* Slot 182 is reserved */ -/* Slot 183 is reserved */ +#define TclpLocaltime \ + (tclIntStubsPtr->tclpLocaltime) /* 182 */ +#define TclpGmtime \ + (tclIntStubsPtr->tclpGmtime) /* 183 */ /* Slot 184 is reserved */ /* Slot 185 is reserved */ /* Slot 186 is reserved */ @@ -1202,8 +1228,7 @@ extern const TclIntStubs *tclIntStubsPtr; (tclIntStubsPtr->tclVarHashCreateVar) /* 234 */ #define TclInitVarHashTable \ (tclIntStubsPtr->tclInitVarHashTable) /* 235 */ -#define TclBackgroundException \ - (tclIntStubsPtr->tclBackgroundException) /* 236 */ +/* Slot 236 is reserved */ #define TclResetCancellation \ (tclIntStubsPtr->tclResetCancellation) /* 237 */ /* Slot 238 is reserved */ @@ -1280,4 +1305,7 @@ extern const TclIntStubs *tclIntStubsPtr; (tclStubsPtr->tcl_GetCommandFullName) /* 517 */ #endif +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLIMPORT + #endif /* _TCLINTDECLS */ diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h index f7eb442..dcf1753 100644 --- a/generic/tclIntPlatDecls.h +++ b/generic/tclIntPlatDecls.h @@ -18,6 +18,17 @@ # define DIR void #endif +#undef TCL_STORAGE_CLASS +#ifdef BUILD_tcl +# define TCL_STORAGE_CLASS DLLEXPORT +#else +# ifdef USE_TCL_STUBS +# define TCL_STORAGE_CLASS +# else +# define TCL_STORAGE_CLASS DLLIMPORT +# endif +#endif + /* * WARNING: This file is automatically generated by the tools/genStubs.tcl * script. Any modifications to the function declarations below should be made @@ -32,38 +43,40 @@ #if !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */ /* 0 */ -TCLAPI void TclGetAndDetachPids(Tcl_Interp *interp, +EXTERN void TclGetAndDetachPids(Tcl_Interp *interp, Tcl_Channel chan); /* 1 */ -TCLAPI int TclpCloseFile(TclFile file); +EXTERN int TclpCloseFile(TclFile file); /* 2 */ -TCLAPI Tcl_Channel TclpCreateCommandChannel(TclFile readFile, +EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 3 */ -TCLAPI int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe); +EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe); /* 4 */ -TCLAPI int TclpCreateProcess(Tcl_Interp *interp, int argc, +EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* Slot 5 is reserved */ /* 6 */ -TCLAPI TclFile TclpMakeFile(Tcl_Channel channel, int direction); +EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction); /* 7 */ -TCLAPI TclFile TclpOpenFile(const char *fname, int mode); +EXTERN TclFile TclpOpenFile(const char *fname, int mode); /* 8 */ -TCLAPI int TclUnixWaitForFile(int fd, int mask, int timeout); +EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout); /* 9 */ -TCLAPI TclFile TclpCreateTempFile(const char *contents); +EXTERN TclFile TclpCreateTempFile(const char *contents); /* 10 */ -TCLAPI Tcl_DirEntry * TclpReaddir(DIR *dir); -/* Slot 11 is reserved */ -/* Slot 12 is reserved */ +EXTERN Tcl_DirEntry * TclpReaddir(DIR *dir); +/* 11 */ +EXTERN struct tm * TclpLocaltime_unix(const time_t *clock); +/* 12 */ +EXTERN struct tm * TclpGmtime_unix(const time_t *clock); /* 13 */ -TCLAPI char * TclpInetNtoa(struct in_addr addr); +EXTERN char * TclpInetNtoa(struct in_addr addr); /* 14 */ -TCLAPI int TclUnixCopyFile(const char *src, const char *dst, +EXTERN int TclUnixCopyFile(const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* Slot 15 is reserved */ @@ -81,141 +94,144 @@ TCLAPI int TclUnixCopyFile(const char *src, const char *dst, /* Slot 27 is reserved */ /* Slot 28 is reserved */ /* 29 */ -TCLAPI int TclWinCPUID(unsigned int index, unsigned int *regs); +EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs); /* 30 */ -TCLAPI int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj, +EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); #endif /* UNIX */ #if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ -TCLAPI void TclWinConvertError(DWORD errCode); -/* Slot 1 is reserved */ +EXTERN void TclWinConvertError(DWORD errCode); +/* 1 */ +EXTERN void TclWinConvertWSAError(DWORD errCode); /* 2 */ -TCLAPI struct servent * TclWinGetServByName(const char *nm, +EXTERN struct servent * TclWinGetServByName(const char *nm, const char *proto); /* 3 */ -TCLAPI int TclWinGetSockOpt(SOCKET s, int level, int optname, +EXTERN int TclWinGetSockOpt(SOCKET s, int level, int optname, char *optval, int *optlen); /* 4 */ -TCLAPI HINSTANCE TclWinGetTclInstance(void); +EXTERN HINSTANCE TclWinGetTclInstance(void); /* 5 */ -TCLAPI int TclUnixWaitForFile(int fd, int mask, int timeout); +EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout); /* 6 */ -TCLAPI unsigned short TclWinNToHS(unsigned short ns); +EXTERN unsigned short TclWinNToHS(unsigned short ns); /* 7 */ -TCLAPI int TclWinSetSockOpt(SOCKET s, int level, int optname, +EXTERN int TclWinSetSockOpt(SOCKET s, int level, int optname, const char *optval, int optlen); /* 8 */ -TCLAPI int TclpGetPid(Tcl_Pid pid); +EXTERN int TclpGetPid(Tcl_Pid pid); /* 9 */ -TCLAPI int TclWinGetPlatformId(void); +EXTERN int TclWinGetPlatformId(void); /* 10 */ -TCLAPI Tcl_DirEntry * TclpReaddir(DIR *dir); +EXTERN Tcl_DirEntry * TclpReaddir(DIR *dir); /* 11 */ -TCLAPI void TclGetAndDetachPids(Tcl_Interp *interp, +EXTERN void TclGetAndDetachPids(Tcl_Interp *interp, Tcl_Channel chan); /* 12 */ -TCLAPI int TclpCloseFile(TclFile file); +EXTERN int TclpCloseFile(TclFile file); /* 13 */ -TCLAPI Tcl_Channel TclpCreateCommandChannel(TclFile readFile, +EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 14 */ -TCLAPI int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe); +EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe); /* 15 */ -TCLAPI int TclpCreateProcess(Tcl_Interp *interp, int argc, +EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 16 */ -TCLAPI int TclpIsAtty(int fd); +EXTERN int TclpIsAtty(int fd); /* 17 */ -TCLAPI int TclUnixCopyFile(const char *src, const char *dst, +EXTERN int TclUnixCopyFile(const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 18 */ -TCLAPI TclFile TclpMakeFile(Tcl_Channel channel, int direction); +EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction); /* 19 */ -TCLAPI TclFile TclpOpenFile(const char *fname, int mode); +EXTERN TclFile TclpOpenFile(const char *fname, int mode); /* 20 */ -TCLAPI void TclWinAddProcess(HANDLE hProcess, DWORD id); +EXTERN void TclWinAddProcess(HANDLE hProcess, DWORD id); /* 21 */ -TCLAPI char * TclpInetNtoa(struct in_addr addr); +EXTERN char * TclpInetNtoa(struct in_addr addr); /* 22 */ -TCLAPI TclFile TclpCreateTempFile(const char *contents); +EXTERN TclFile TclpCreateTempFile(const char *contents); /* Slot 23 is reserved */ /* 24 */ -TCLAPI char * TclWinNoBackslash(char *path); +EXTERN char * TclWinNoBackslash(char *path); /* Slot 25 is reserved */ /* 26 */ -TCLAPI void TclWinSetInterfaces(int wide); +EXTERN void TclWinSetInterfaces(int wide); /* 27 */ -TCLAPI void TclWinFlushDirtyChannels(void); +EXTERN void TclWinFlushDirtyChannels(void); /* 28 */ -TCLAPI void TclWinResetInterfaces(void); +EXTERN void TclWinResetInterfaces(void); /* 29 */ -TCLAPI int TclWinCPUID(unsigned int index, unsigned int *regs); +EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs); /* 30 */ -TCLAPI int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj, +EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ /* 0 */ -TCLAPI void TclGetAndDetachPids(Tcl_Interp *interp, +EXTERN void TclGetAndDetachPids(Tcl_Interp *interp, Tcl_Channel chan); /* 1 */ -TCLAPI int TclpCloseFile(TclFile file); +EXTERN int TclpCloseFile(TclFile file); /* 2 */ -TCLAPI Tcl_Channel TclpCreateCommandChannel(TclFile readFile, +EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 3 */ -TCLAPI int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe); +EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe); /* 4 */ -TCLAPI int TclpCreateProcess(Tcl_Interp *interp, int argc, +EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* Slot 5 is reserved */ /* 6 */ -TCLAPI TclFile TclpMakeFile(Tcl_Channel channel, int direction); +EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction); /* 7 */ -TCLAPI TclFile TclpOpenFile(const char *fname, int mode); +EXTERN TclFile TclpOpenFile(const char *fname, int mode); /* 8 */ -TCLAPI int TclUnixWaitForFile(int fd, int mask, int timeout); +EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout); /* 9 */ -TCLAPI TclFile TclpCreateTempFile(const char *contents); +EXTERN TclFile TclpCreateTempFile(const char *contents); /* 10 */ -TCLAPI Tcl_DirEntry * TclpReaddir(DIR *dir); -/* Slot 11 is reserved */ -/* Slot 12 is reserved */ +EXTERN Tcl_DirEntry * TclpReaddir(DIR *dir); +/* 11 */ +EXTERN struct tm * TclpLocaltime_unix(const time_t *clock); +/* 12 */ +EXTERN struct tm * TclpGmtime_unix(const time_t *clock); /* 13 */ -TCLAPI char * TclpInetNtoa(struct in_addr addr); +EXTERN char * TclpInetNtoa(struct in_addr addr); /* 14 */ -TCLAPI int TclUnixCopyFile(const char *src, const char *dst, +EXTERN int TclUnixCopyFile(const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 15 */ -TCLAPI int TclMacOSXGetFileAttribute(Tcl_Interp *interp, +EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 16 */ -TCLAPI int TclMacOSXSetFileAttribute(Tcl_Interp *interp, +EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* 17 */ -TCLAPI int TclMacOSXCopyFileAttributes(const char *src, +EXTERN int TclMacOSXCopyFileAttributes(const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); /* 18 */ -TCLAPI int TclMacOSXMatchType(Tcl_Interp *interp, +EXTERN int TclMacOSXMatchType(Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 19 */ -TCLAPI void TclMacOSXNotifierAddRunLoopMode( +EXTERN void TclMacOSXNotifierAddRunLoopMode( const void *runLoopMode); /* Slot 20 is reserved */ /* Slot 21 is reserved */ @@ -227,9 +243,9 @@ TCLAPI void TclMacOSXNotifierAddRunLoopMode( /* Slot 27 is reserved */ /* Slot 28 is reserved */ /* 29 */ -TCLAPI int TclWinCPUID(unsigned int index, unsigned int *regs); +EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs); /* 30 */ -TCLAPI int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj, +EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); #endif /* MACOSX */ @@ -250,8 +266,8 @@ typedef struct TclIntPlatStubs { int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */ TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */ Tcl_DirEntry * (*tclpReaddir) (DIR *dir); /* 10 */ - void (*reserved11)(void); - void (*reserved12)(void); + struct tm * (*tclpLocaltime_unix) (const time_t *clock); /* 11 */ + struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */ char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */ int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */ void (*reserved15)(void); @@ -273,7 +289,7 @@ typedef struct TclIntPlatStubs { #endif /* UNIX */ #if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ void (*tclWinConvertError) (DWORD errCode); /* 0 */ - void (*reserved1)(void); + void (*tclWinConvertWSAError) (DWORD errCode); /* 1 */ struct servent * (*tclWinGetServByName) (const char *nm, const char *proto); /* 2 */ int (*tclWinGetSockOpt) (SOCKET s, int level, int optname, char *optval, int *optlen); /* 3 */ HINSTANCE (*tclWinGetTclInstance) (void); /* 4 */ @@ -316,8 +332,8 @@ typedef struct TclIntPlatStubs { int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */ TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */ Tcl_DirEntry * (*tclpReaddir) (DIR *dir); /* 10 */ - void (*reserved11)(void); - void (*reserved12)(void); + struct tm * (*tclpLocaltime_unix) (const time_t *clock); /* 11 */ + struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */ char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */ int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */ int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */ @@ -375,8 +391,10 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr; (tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */ #define TclpReaddir \ (tclIntPlatStubsPtr->tclpReaddir) /* 10 */ -/* Slot 11 is reserved */ -/* Slot 12 is reserved */ +#define TclpLocaltime_unix \ + (tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */ +#define TclpGmtime_unix \ + (tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */ #define TclpInetNtoa \ (tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */ #define TclUnixCopyFile \ @@ -403,7 +421,8 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr; #if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #define TclWinConvertError \ (tclIntPlatStubsPtr->tclWinConvertError) /* 0 */ -/* Slot 1 is reserved */ +#define TclWinConvertWSAError \ + (tclIntPlatStubsPtr->tclWinConvertWSAError) /* 1 */ #define TclWinGetServByName \ (tclIntPlatStubsPtr->tclWinGetServByName) /* 2 */ #define TclWinGetSockOpt \ @@ -483,8 +502,10 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr; (tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */ #define TclpReaddir \ (tclIntPlatStubsPtr->tclpReaddir) /* 10 */ -/* Slot 11 is reserved */ -/* Slot 12 is reserved */ +#define TclpLocaltime_unix \ + (tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */ +#define TclpGmtime_unix \ + (tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */ #define TclpInetNtoa \ (tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */ #define TclUnixCopyFile \ @@ -518,6 +539,13 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr; /* !END!: Do not edit above this line. */ +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLIMPORT +#undef TclpLocaltime_unix +#undef TclpGmtime_unix +#undef TclWinConvertWSAError +#define TclWinConvertWSAError TclWinConvertError + #if defined(__WIN32__) || defined(__CYGWIN__) # undef TclWinNToHS # define TclWinNToHS ntohs diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 2cc7a5c..41f9520 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -25,14 +25,14 @@ static const char *tclPreInitScript = NULL; struct Target; /* - * Alias: + * struct Alias: * * Stores information about an alias. Is stored in the slave interpreter and * used by the source command to find the target command in the master when * the source command is invoked. */ -typedef struct { +typedef struct Alias { Tcl_Obj *token; /* Token for the alias command in the slave * interp. This used to be the command name in * the slave when the alias was first @@ -73,7 +73,7 @@ typedef struct { * slave interpreter, e.g. what aliases are defined in it. */ -typedef struct { +typedef struct Slave { Tcl_Interp *masterInterp; /* Master interpreter for this slave. */ Tcl_HashEntry *slaveEntryPtr; /* Hash entry in masters slave table for this @@ -84,7 +84,7 @@ typedef struct { Tcl_Interp *slaveInterp; /* The slave interpreter. */ Tcl_Command interpCmd; /* Interpreter object command. */ Tcl_HashTable aliasTable; /* Table which maps from names of commands in - * slave interpreter to Alias defined + * slave interpreter to struct Alias defined * below. */ } Slave; @@ -127,7 +127,7 @@ typedef struct Target { * only load safe extensions. */ -typedef struct { +typedef struct Master { Tcl_HashTable slaveTable; /* Hash table for slave interpreters. Maps * from command names to Slave records. */ Target *targetsPtr; /* The head of a doubly-linked list of all the @@ -144,7 +144,7 @@ typedef struct { * on a per-interp basis. */ -typedef struct { +typedef struct InterpInfo { Master master; /* Keeps track of all interps for which this * interp is the Master. */ Slave slave; /* Information necessary for this interp to @@ -158,7 +158,7 @@ typedef struct { * likely to work properly on 64-bit architectures. */ -typedef struct { +typedef struct ScriptLimitCallback { Tcl_Interp *interp; /* The interpreter in which to execute the * callback. */ Tcl_Obj *scriptObj; /* The script to execute to perform the @@ -171,7 +171,7 @@ typedef struct { * table. */ } ScriptLimitCallback; -typedef struct { +typedef struct ScriptLimitCallbackKey { Tcl_Interp *interp; /* The interpreter that the limit callback was * attached to. This is not the interpreter * that the callback runs in! */ diff --git a/generic/tclLink.c b/generic/tclLink.c index b5e540b..a3b42bd 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.c @@ -21,7 +21,7 @@ * variable. */ -typedef struct { +typedef struct Link { Tcl_Interp *interp; /* Interpreter containing Tcl variable. */ Tcl_Obj *varName; /* Name of variable (must be global). This is * needed during trace callbacks, since the diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 85737d5..2d1defa 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -969,7 +969,11 @@ Tcl_ListObjReplace( if (listRepPtr == NULL) { for (i = 0; i < objc; i++) { /* See bug 3598580 */ +#if TCL_MAJOR_VERSION > 8 Tcl_DecrRefCount(objv[i]); +#else + objv[i]->refCount--; +#endif } return TCL_ERROR; } diff --git a/generic/tclLoad.c b/generic/tclLoad.c index 75e513d..5cacab1 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -463,23 +463,13 @@ Tcl_LoadObjCmd( } code = pkgPtr->initProc(target); } + /* * Test for whether the initialization failed. If so, transfer the error * from the target interpreter to the originating one. */ if (code != TCL_OK) { - Interp *iPtr = (Interp *) target; - if (iPtr->legacyResult && !iPtr->legacyFreeProc) { - /* - * A call to Tcl_InitStubs() determined the caller extension and - * this interp are incompatible in their stubs mechanisms, and - * recorded the error in the oldest legacy place we have to do so. - */ - Tcl_SetObjResult(target, Tcl_NewStringObj(iPtr->legacyResult, -1)); - iPtr->legacyResult = NULL; - iPtr->legacyFreeProc = (void (*) (void))-1; - } Tcl_TransferResult(target, code, interp); goto done; } diff --git a/generic/tclMain.c b/generic/tclMain.c index 1b15617..f445383 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -109,7 +109,7 @@ typedef enum { PROMPT_CONTINUE /* Print prompt for command continuation */ } PromptType; -typedef struct { +typedef struct InteractiveState { Tcl_Channel input; /* The standard input channel from which lines * are read. */ int tty; /* Non-zero means standard input is a @@ -243,7 +243,7 @@ Tcl_SourceRCFile( const char *fileName; Tcl_Channel chan; - fileName = Tcl_GetVar2(interp, "tcl_rcFileName", NULL, TCL_GLOBAL_ONLY); + fileName = Tcl_GetVar(interp, "tcl_rcFileName", TCL_GLOBAL_ONLY); if (fileName != NULL) { Tcl_Channel c; const char *fullName; @@ -263,18 +263,14 @@ Tcl_SourceRCFile( c = Tcl_OpenFileChannel(NULL, fullName, "r", 0); if (c != NULL) { - Tcl_Obj *fullNameObj = Tcl_NewStringObj(fullName, -1); - Tcl_Close(NULL, c); - Tcl_IncrRefCount(fullNameObj); - if (Tcl_FSEvalFileEx(interp, fullNameObj, NULL) != TCL_OK) { + if (Tcl_EvalFile(interp, fullName) != 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); @@ -284,7 +280,7 @@ Tcl_SourceRCFile( /*---------------------------------------------------------------------- * - * Tcl_MainEx -- + * Tcl_Main, Tcl_MainEx -- * * Main program for tclsh and most other Tcl-based applications. * @@ -632,6 +628,22 @@ Tcl_MainEx( Tcl_Exit(exitCode); } + +#if (TCL_MAJOR_VERSION == 8) && !defined(UNICODE) +#undef Tcl_Main +extern DLLEXPORT void +Tcl_Main( + int argc, /* Number of arguments. */ + char **argv, /* Array of argument strings. */ + Tcl_AppInitProc *appInitProc) + /* Application-specific initialization + * function to call after most initialization + * but before starting to execute commands. */ +{ + Tcl_FindExecutable(argv[0]); + Tcl_MainEx(argc, argv, appInitProc, Tcl_CreateInterp()); +} +#endif /* TCL_MAJOR_VERSION == 8 && !UNICODE */ #ifndef TCL_ASCII_MAIN diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 5930d33..0ccf02e 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -31,7 +31,7 @@ * limited to a single interpreter. */ -typedef struct { +typedef struct ThreadSpecificData { long numNsCreated; /* Count of the number of namespaces created * within the thread. This value is used as a * unique id for each namespace. Cannot be @@ -52,7 +52,7 @@ static Tcl_ThreadDataKey dataKey; * with some information that is used to check the cached pointer's validity. */ -typedef struct { +typedef struct ResolvedNsName { Namespace *nsPtr; /* A cached pointer to the Namespace that the * name resolved to. */ Namespace *refNsPtr; /* Points to the namespace context in which diff --git a/generic/tclObj.c b/generic/tclObj.c index 544a6f4..d4769fa 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -46,7 +46,7 @@ char *tclEmptyStringRep = &tclEmptyString; * for sanity checking purposes. */ -typedef struct { +typedef struct ObjData { Tcl_Obj *objPtr; /* The pointer to the allocated Tcl_Obj. */ const char *file; /* The name of the source file calling this * function; used for debugging. */ @@ -3278,7 +3278,7 @@ Tcl_DbDecrRefCount( * If the Tcl_Obj is going to be deleted, remove the entry. */ - if (objPtr->refCount < 2) { + if ((objPtr->refCount - 1) <= 0) { ObjData *objData = Tcl_GetHashValue(hPtr); if (objData != NULL) { @@ -3291,7 +3291,7 @@ Tcl_DbDecrRefCount( # endif /* TCL_THREADS */ #endif /* TCL_MEM_DEBUG */ - if ((objPtr)->refCount-- < 2) { + if (--(objPtr)->refCount <= 0) { TclFreeObj(objPtr); } } diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index f4d61f2..2b9ff87 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -71,7 +71,7 @@ static const Tcl_ObjType tclFsPathType = { * */ -typedef struct { +typedef struct FsPath { Tcl_Obj *translatedPathPtr; /* Name without any ~user sequences. If this * is NULL, then this is a pure normalized, * absolute path object, in which the parent diff --git a/generic/tclPkg.c b/generic/tclPkg.c index f67135d..5b09ddb 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -39,7 +39,7 @@ typedef struct PkgAvail { * "Tk" (no version number). */ -typedef struct { +typedef struct Package { char *version; /* Version that has been supplied in this * interpreter via "package provide" * (malloc'ed). NULL means the package doesn't @@ -107,6 +107,16 @@ static const char * PkgRequireCore(Tcl_Interp *interp, const char *name, */ int +Tcl_PkgProvide( + Tcl_Interp *interp, /* Interpreter in which package is now + * available. */ + const char *name, /* Name of package. */ + const char *version) /* Version string for package. */ +{ + return Tcl_PkgProvideEx(interp, name, version, NULL); +} + +int Tcl_PkgProvideEx( Tcl_Interp *interp, /* Interpreter in which package is now * available. */ diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h index 4e6f29fa..e9b92fe 100644 --- a/generic/tclPlatDecls.h +++ b/generic/tclPlatDecls.h @@ -10,6 +10,17 @@ #ifndef _TCLPLATDECLS #define _TCLPLATDECLS +#undef TCL_STORAGE_CLASS +#ifdef BUILD_tcl +# define TCL_STORAGE_CLASS DLLEXPORT +#else +# ifdef USE_TCL_STUBS +# define TCL_STORAGE_CLASS +# else +# define TCL_STORAGE_CLASS DLLIMPORT +# endif +#endif + /* * WARNING: This file is automatically generated by the tools/genStubs.tcl * script. Any modifications to the function declarations below should be made @@ -37,19 +48,19 @@ #if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ -TCLAPI TCHAR * Tcl_WinUtfToTChar(const char *str, int len, +EXTERN TCHAR * Tcl_WinUtfToTChar(const char *str, int len, Tcl_DString *dsPtr); /* 1 */ -TCLAPI char * Tcl_WinTCharToUtf(const TCHAR *str, int len, +EXTERN char * Tcl_WinTCharToUtf(const TCHAR *str, int len, Tcl_DString *dsPtr); #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ /* 0 */ -TCLAPI int Tcl_MacOSXOpenBundleResources(Tcl_Interp *interp, +EXTERN int Tcl_MacOSXOpenBundleResources(Tcl_Interp *interp, const char *bundleName, int hasResourceFile, int maxPathLen, char *libraryPath); /* 1 */ -TCLAPI int Tcl_MacOSXOpenVersionedBundleResources( +EXTERN int Tcl_MacOSXOpenVersionedBundleResources( Tcl_Interp *interp, const char *bundleName, const char *bundleVersion, int hasResourceFile, int maxPathLen, @@ -101,6 +112,9 @@ extern const TclPlatStubs *tclPlatStubsPtr; /* !END!: Do not edit above this line. */ +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLIMPORT + #endif /* _TCLPLATDECLS */ diff --git a/generic/tclPreserve.c b/generic/tclPreserve.c index 62c8de4..0bd8f93 100644 --- a/generic/tclPreserve.c +++ b/generic/tclPreserve.c @@ -53,7 +53,7 @@ TCL_DECLARE_MUTEX(preserveMutex)/* To protect the above statics */ * objects that we don't want to live any longer than necessary. */ -typedef struct { +typedef struct HandleStruct { void *ptr; /* Pointer to the memory block being tracked. * This field will become NULL when the memory * block is deleted. This field must be the diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index 4977934..6c1dc08 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -64,7 +64,7 @@ #define NUM_REGEXPS 30 -typedef struct { +typedef struct ThreadSpecificData { int initialized; /* Set to 1 when the module is initialized. */ char *patterns[NUM_REGEXPS];/* Strings corresponding to compiled regular * expression patterns. NULL means that this diff --git a/generic/tclResult.c b/generic/tclResult.c index d7d9e73..679fb19 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -27,6 +27,7 @@ enum returnKeys { static Tcl_Obj ** GetKeys(void); static void ReleaseKeys(ClientData clientData); static void ResetObjResult(Interp *iPtr); +static void SetupAppendBuffer(Interp *iPtr, int newSpace); /* * This structure is used to take a snapshot of the interpreter state in @@ -34,7 +35,7 @@ static void ResetObjResult(Interp *iPtr); * then back up to the result or the error that was previously in progress. */ -typedef struct { +typedef struct InterpState { int status; /* return code status */ int flags; /* Each remaining field saves the */ int returnLevel; /* corresponding field of the Interp */ @@ -227,6 +228,44 @@ Tcl_SaveResult( statePtr->objResultPtr = iPtr->objResultPtr; iPtr->objResultPtr = Tcl_NewObj(); Tcl_IncrRefCount(iPtr->objResultPtr); + + /* + * Save the string result. + */ + + statePtr->freeProc = iPtr->freeProc; + if (iPtr->result == iPtr->resultSpace) { + /* + * Copy the static string data out of the interp buffer. + */ + + statePtr->result = statePtr->resultSpace; + strcpy(statePtr->result, iPtr->result); + statePtr->appendResult = NULL; + } else if (iPtr->result == iPtr->appendResult) { + /* + * Move the append buffer out of the interp. + */ + + statePtr->appendResult = iPtr->appendResult; + statePtr->appendAvl = iPtr->appendAvl; + statePtr->appendUsed = iPtr->appendUsed; + statePtr->result = statePtr->appendResult; + iPtr->appendResult = NULL; + iPtr->appendAvl = 0; + iPtr->appendUsed = 0; + } else { + /* + * Move the dynamic or static string out of the interpreter. + */ + + statePtr->result = iPtr->result; + statePtr->appendResult = NULL; + } + + iPtr->result = iPtr->resultSpace; + iPtr->resultSpace[0] = 0; + iPtr->freeProc = 0; } /* @@ -257,6 +296,39 @@ Tcl_RestoreResult( Tcl_ResetResult(interp); /* + * Restore the string result. + */ + + iPtr->freeProc = statePtr->freeProc; + if (statePtr->result == statePtr->resultSpace) { + /* + * Copy the static string data into the interp buffer. + */ + + iPtr->result = iPtr->resultSpace; + strcpy(iPtr->result, statePtr->result); + } else if (statePtr->result == statePtr->appendResult) { + /* + * Move the append buffer back into the interp. + */ + + if (iPtr->appendResult != NULL) { + ckfree(iPtr->appendResult); + } + + iPtr->appendResult = statePtr->appendResult; + iPtr->appendAvl = statePtr->appendAvl; + iPtr->appendUsed = statePtr->appendUsed; + iPtr->result = iPtr->appendResult; + } else { + /* + * Move the dynamic or static string back into the interpreter. + */ + + iPtr->result = statePtr->result; + } + + /* * Restore the object result. */ @@ -287,6 +359,14 @@ Tcl_DiscardResult( Tcl_SavedResult *statePtr) /* State returned by Tcl_SaveResult. */ { TclDecrRefCount(statePtr->objResultPtr); + + if (statePtr->result == statePtr->appendResult) { + ckfree(statePtr->appendResult); + } else if (statePtr->freeProc == TCL_DYNAMIC) { + ckfree(statePtr->result); + } else if (statePtr->freeProc) { + statePtr->freeProc(statePtr->result); + } } /* @@ -316,15 +396,49 @@ Tcl_SetResult( * TCL_STATIC, TCL_VOLATILE, or the address of * a Tcl_FreeProc such as free. */ { - Tcl_SetObjResult(interp, Tcl_NewStringObj(result, -1)); - if (result == NULL || freeProc == NULL || freeProc == TCL_VOLATILE) { - return; - } - if (freeProc == TCL_DYNAMIC) { - ckfree(result); + Interp *iPtr = (Interp *) interp; + register Tcl_FreeProc *oldFreeProc = iPtr->freeProc; + char *oldResult = iPtr->result; + + if (result == NULL) { + iPtr->resultSpace[0] = 0; + iPtr->result = iPtr->resultSpace; + iPtr->freeProc = 0; + } else if (freeProc == TCL_VOLATILE) { + int length = strlen(result); + + if (length > TCL_RESULT_SIZE) { + iPtr->result = ckalloc(length + 1); + iPtr->freeProc = TCL_DYNAMIC; + } else { + iPtr->result = iPtr->resultSpace; + iPtr->freeProc = 0; + } + memcpy(iPtr->result, result, (unsigned) length+1); } else { - (*freeProc)(result); + iPtr->result = (char *) result; + iPtr->freeProc = freeProc; + } + + /* + * If the old result was dynamically-allocated, free it up. Do it here, + * rather than at the beginning, in case the new result value was part of + * the old result value. + */ + + if (oldFreeProc != 0) { + if (oldFreeProc == TCL_DYNAMIC) { + ckfree(oldResult); + } else { + oldFreeProc(oldResult); + } } + + /* + * Reset the object result since we just set the string result. + */ + + ResetObjResult(iPtr); } /* @@ -348,9 +462,18 @@ const char * Tcl_GetStringResult( register Tcl_Interp *interp)/* Interpreter whose result to return. */ { + /* + * If the string result is empty, move the object result to the string + * result, then reset the object result. + */ + Interp *iPtr = (Interp *) interp; - return Tcl_GetString(iPtr->objResultPtr); + if (*(iPtr->result) == 0) { + Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)), + TCL_VOLATILE); + } + return iPtr->result; } /* @@ -391,6 +514,21 @@ Tcl_SetObjResult( */ TclDecrRefCount(oldObjResult); + + /* + * Reset the string result since we just set the result object. + */ + + if (iPtr->freeProc != NULL) { + if (iPtr->freeProc == TCL_DYNAMIC) { + ckfree(iPtr->result); + } else { + iPtr->freeProc(iPtr->result); + } + iPtr->freeProc = 0; + } + iPtr->result = iPtr->resultSpace; + iPtr->resultSpace[0] = 0; } /* @@ -419,7 +557,32 @@ Tcl_GetObjResult( Tcl_Interp *interp) /* Interpreter whose result to return. */ { register Interp *iPtr = (Interp *) interp; + Tcl_Obj *objResultPtr; + int length; + + /* + * If the string result is non-empty, move the string result to the object + * result, then reset the string result. + */ + if (iPtr->result[0] != 0) { + ResetObjResult(iPtr); + + objResultPtr = iPtr->objResultPtr; + length = strlen(iPtr->result); + TclInitStringRep(objResultPtr, iPtr->result, length); + + if (iPtr->freeProc != NULL) { + if (iPtr->freeProc == TCL_DYNAMIC) { + ckfree(iPtr->result); + } else { + iPtr->freeProc(iPtr->result); + } + iPtr->freeProc = 0; + } + iPtr->result = iPtr->resultSpace; + iPtr->result[0] = 0; + } return iPtr->objResultPtr; } @@ -456,6 +619,23 @@ Tcl_AppendResultVA( } Tcl_AppendStringsToObjVA(objPtr, argList); Tcl_SetObjResult(interp, objPtr); + + /* + * Strictly we should call Tcl_GetStringResult(interp) here to make sure + * that interp->result is correct according to the old contract, but that + * makes the performance of much code (e.g. in Tk) absolutely awful. So we + * leave it out; code that really wants interp->result can just insert the + * calls to Tcl_GetStringResult() itself. [Patch 1041072 discussion] + */ + +#ifdef USE_INTERP_RESULT + /* + * Ensure that the interp->result is legal so old Tcl 7.* code still + * works. There's still embarrasingly much of it about... + */ + + (void) Tcl_GetStringResult(interp); +#endif /* USE_INTERP_RESULT */ } /* @@ -521,20 +701,129 @@ Tcl_AppendElement( * to result. */ { Interp *iPtr = (Interp *) interp; - Tcl_Obj *elementPtr = Tcl_NewStringObj(element, -1); - Tcl_Obj *listPtr = Tcl_NewListObj(1, &elementPtr); - int length; - const char *bytes; - - if (Tcl_IsShared(iPtr->objResultPtr)) { - Tcl_SetObjResult(interp, Tcl_DuplicateObj(iPtr->objResultPtr)); - } - bytes = Tcl_GetStringFromObj(iPtr->objResultPtr, &length); - if (TclNeedSpace(bytes, bytes+length)) { - Tcl_AppendToObj(iPtr->objResultPtr, " ", 1); + char *dst; + int size; + int flags; + + /* + * If the string result is empty, move the object result to the string + * result, then reset the object result. + */ + + (void) Tcl_GetStringResult(interp); + + /* + * See how much space is needed, and grow the append buffer if needed to + * accommodate the list element. + */ + + size = Tcl_ScanElement(element, &flags) + 1; + if ((iPtr->result != iPtr->appendResult) + || (iPtr->appendResult[iPtr->appendUsed] != 0) + || ((size + iPtr->appendUsed) >= iPtr->appendAvl)) { + SetupAppendBuffer(iPtr, size+iPtr->appendUsed); + } + + /* + * Convert the string into a list element and copy it to the buffer that's + * forming, with a space separator if needed. + */ + + dst = iPtr->appendResult + iPtr->appendUsed; + if (TclNeedSpace(iPtr->appendResult, dst)) { + iPtr->appendUsed++; + *dst = ' '; + dst++; + + /* + * If we need a space to separate this element from preceding stuff, + * then this element will not lead a list, and need not have it's + * leading '#' quoted. + */ + + flags |= TCL_DONT_QUOTE_HASH; + } + iPtr->appendUsed += Tcl_ConvertElement(element, dst, flags); +} + +/* + *---------------------------------------------------------------------- + * + * SetupAppendBuffer -- + * + * This function makes sure that there is an append buffer properly + * initialized, if necessary, from the interpreter's result, and that it + * has at least enough room to accommodate newSpace new bytes of + * information. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static void +SetupAppendBuffer( + Interp *iPtr, /* Interpreter whose result is being set up. */ + int newSpace) /* Make sure that at least this many bytes of + * new information may be added. */ +{ + int totalSpace; + + /* + * Make the append buffer larger, if that's necessary, then copy the + * result into the append buffer and make the append buffer the official + * Tcl result. + */ + + if (iPtr->result != iPtr->appendResult) { + /* + * If an oversized buffer was used recently, then free it up so we go + * back to a smaller buffer. This avoids tying up memory forever after + * a large operation. + */ + + if (iPtr->appendAvl > 500) { + ckfree(iPtr->appendResult); + iPtr->appendResult = NULL; + iPtr->appendAvl = 0; + } + iPtr->appendUsed = strlen(iPtr->result); + } else if (iPtr->result[iPtr->appendUsed] != 0) { + /* + * Most likely someone has modified a result created by + * Tcl_AppendResult et al. so that it has a different size. Just + * recompute the size. + */ + + iPtr->appendUsed = strlen(iPtr->result); + } + + totalSpace = newSpace + iPtr->appendUsed; + if (totalSpace >= iPtr->appendAvl) { + char *new; + + if (totalSpace < 100) { + totalSpace = 200; + } else { + totalSpace *= 2; + } + new = ckalloc(totalSpace); + strcpy(new, iPtr->result); + if (iPtr->appendResult != NULL) { + ckfree(iPtr->appendResult); + } + iPtr->appendResult = new; + iPtr->appendAvl = totalSpace; + } else if (iPtr->result != iPtr->appendResult) { + strcpy(iPtr->appendResult, iPtr->result); } - Tcl_AppendObjToObj(iPtr->objResultPtr, listPtr); - Tcl_DecrRefCount(listPtr); + + Tcl_FreeResult((Tcl_Interp *) iPtr); + iPtr->result = iPtr->appendResult; } /* @@ -543,17 +832,18 @@ Tcl_AppendElement( * Tcl_FreeResult -- * * This function frees up the memory associated with an interpreter's - * result, resetting the interpreter's result object. Tcl_FreeResult is - * most commonly used when a function is about to replace one result - * value with another. + * string result. It also resets the interpreter's result object. + * Tcl_FreeResult is most commonly used when a function is about to + * replace one result value with another. * * Results: * None. * * Side effects: - * Frees the memory associated with interp's result but does not change - * any part of the error dictionary (i.e., the errorinfo and errorcode - * remain the same). + * Frees the memory associated with interp's string result and sets + * interp->freeProc to zero, but does not change interp->result or clear + * error state. Resets interp's result object to an unshared empty + * object. * *---------------------------------------------------------------------- */ @@ -564,6 +854,15 @@ Tcl_FreeResult( { register Interp *iPtr = (Interp *) interp; + if (iPtr->freeProc != NULL) { + if (iPtr->freeProc == TCL_DYNAMIC) { + ckfree(iPtr->result); + } else { + iPtr->freeProc(iPtr->result); + } + iPtr->freeProc = 0; + } + ResetObjResult(iPtr); } @@ -593,6 +892,16 @@ Tcl_ResetResult( register Interp *iPtr = (Interp *) interp; ResetObjResult(iPtr); + if (iPtr->freeProc != NULL) { + if (iPtr->freeProc == TCL_DYNAMIC) { + ckfree(iPtr->result); + } else { + iPtr->freeProc(iPtr->result); + } + iPtr->freeProc = 0; + } + iPtr->result = iPtr->resultSpace; + iPtr->resultSpace[0] = 0; if (iPtr->errorCode) { /* Legacy support */ if (iPtr->flags & ERR_LEGACY_COPY) { diff --git a/generic/tclScan.c b/generic/tclScan.c index 8f12aaa..9b1f40a 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -28,7 +28,7 @@ * character set. */ -typedef struct { +typedef struct CharSet { int exclude; /* 1 if this is an exclusion set. */ int nchars; Tcl_UniChar *chars; diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 2287a16..2d534a68 100755 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -18,6 +18,13 @@ #include /* + * Define KILL_OCTAL to suppress interpretation of numbers with leading zero + * as octal. (Ceterum censeo: numeros octonarios delendos esse.) + */ + +#undef KILL_OCTAL + +/* * This code supports (at least hypothetically), IBM, Cray, VAX and IEEE-754 * floating point; of these, only IEEE-754 can represent NaN. IEEE-754 can be * uniquely determined by radix and by the widths of significand and exponent. @@ -480,7 +487,7 @@ TclParseNumber( enum State { INITIAL, SIGNUM, ZERO, ZERO_X, ZERO_O, ZERO_B, BINARY, - HEXADECIMAL, OCTAL, DECIMAL, + HEXADECIMAL, OCTAL, BAD_OCTAL, DECIMAL, LEADING_RADIX_POINT, FRACTION, EXPONENT_START, EXPONENT_SIGNUM, EXPONENT, sI, sIN, sINF, sINFI, sINFIN, sINFINI, sINFINIT, sINFINITY @@ -525,6 +532,7 @@ TclParseNumber( char d = 0; /* Last hexadecimal digit scanned; initialized * to avoid a compiler warning. */ int shift = 0; /* Amount to shift when accumulating binary */ + int explicitOctal = 0; #define ALL_BITS (~(Tcl_WideUInt)0) #define MOST_BITS (ALL_BITS >> 1) @@ -636,10 +644,14 @@ TclParseNumber( goto zerob; } if (c == 'o' || c == 'O') { + explicitOctal = 1; state = ZERO_O; break; } +#ifdef KILL_OCTAL goto decimal; +#endif + /* FALLTHROUGH */ case OCTAL: /* @@ -702,6 +714,58 @@ TclParseNumber( state = OCTAL; break; } + /* FALLTHROUGH */ + + case BAD_OCTAL: + if (explicitOctal) { + /* + * No forgiveness for bad digits in explicitly octal numbers. + */ + + goto endgame; + } + if (flags & TCL_PARSE_INTEGER_ONLY) { + /* + * No seeking floating point when parsing only integer. + */ + + goto endgame; + } +#ifndef KILL_OCTAL + + /* + * Scanned a number with a leading zero that contains an 8, 9, + * radix point or E. This is an invalid octal number, but might + * still be floating point. + */ + + if (c == '0') { + numTrailZeros++; + state = BAD_OCTAL; + break; + } else if (isdigit(UCHAR(c))) { + if (objPtr != NULL) { + significandOverflow = AccumulateDecimalDigit( + (unsigned)(c-'0'), numTrailZeros, + &significandWide, &significandBig, + significandOverflow); + } + if (numSigDigs != 0) { + numSigDigs += (numTrailZeros + 1); + } else { + numSigDigs = 1; + } + numTrailZeros = 0; + state = BAD_OCTAL; + break; + } else if (c == '.') { + state = FRACTION; + break; + } else if (c == 'E' || c == 'e') { + state = EXPONENT_START; + break; + } +#endif goto endgame; /* @@ -806,7 +870,9 @@ TclParseNumber( * digits. */ +#ifdef KILL_OCTAL decimal: +#endif acceptState = state; acceptPoint = p; acceptLen = len; @@ -1090,6 +1156,7 @@ TclParseNumber( TclFreeIntRep(objPtr); switch (acceptState) { case SIGNUM: + case BAD_OCTAL: case ZERO_X: case ZERO_O: case ZERO_B: @@ -1314,6 +1381,9 @@ TclParseNumber( Tcl_AppendLimitedToObj(msg, bytes, numBytes, 50, ""); Tcl_AppendToObj(msg, "\"", -1); + if (state == BAD_OCTAL) { + Tcl_AppendToObj(msg, " (looks like invalid octal number)", -1); + } Tcl_SetObjResult(interp, msg); Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", NULL); } diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 64c661b..04cf4ee 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -104,7 +104,7 @@ const Tcl_ObjType tclStringType = { * tcl.h, but do not do that unless you are sure what you're doing! */ -typedef struct { +typedef struct String { int numChars; /* The number of chars in the string. -1 means * this value has not been calculated. >= 0 * means that there is a valid Unicode rep, or diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 9f1f328..e6c6bed 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -41,30 +41,18 @@ #undef Tcl_FindExecutable #undef TclpGetPid #undef TclSockMinimumBuffers -#define TclBackgroundException Tcl_BackgroundException -#define TclPkgProvide pkgProvide -static int TclPkgProvide( - Tcl_Interp *interp, /* Interpreter in which package is now - * available. */ - const char *name, /* Name of package. */ - const char *version) /* Version string for package. */ +/* See bug 510001: TclSockMinimumBuffers needs plat imp */ +#ifdef _WIN64 +# define TclSockMinimumBuffersOld 0 +#else +#define TclSockMinimumBuffersOld sockMinimumBuffersOld +static int TclSockMinimumBuffersOld(int sock, int size) { - /* In Tcl 9, Tcl_PkgProvide is a macro calling Tcl_PkgProvideEx. - * The only way this stub can be called is by an extension compiled - * against Tcl 8 headers. The Tcl_StubsInit() function already - * succeeded, so the extension author lied: It did something like: - * Tcl_StubsInit(interp, "8.6-", 0) - * or - * Tcl_StubsInit(interp, "8.6-9.1", 0) - * - * The best we can do is provide an error-message, as if the - * extension originally called: - * Tcl_StubsInit(interp, "8", 0) - */ - Tcl_PkgRequireEx(interp, "Tcl", "8", 0, NULL); - return TCL_ERROR; + return TclSockMinimumBuffers(INT2PTR(sock), size); } +#endif + #if defined(_WIN32) || defined(__CYGWIN__) #undef TclWinNToHS @@ -182,6 +170,9 @@ Tcl_WinTCharToUtf( string, len, dsPtr); } +#else /* UNIX and MAC */ +# define TclpLocaltime_unix TclpLocaltime +# define TclpGmtime_unix TclpGmtime #endif /* @@ -206,7 +197,7 @@ static const TclIntStubs tclIntStubs = { TclCleanupChildren, /* 5 */ TclCleanupCommand, /* 6 */ TclCopyAndCollapse, /* 7 */ - 0, /* 8 */ + TclCopyChannelOld, /* 8 */ TclCreatePipeline, /* 9 */ TclCreateProc, /* 10 */ TclDeleteCompiledLocalVars, /* 11 */ @@ -275,7 +266,7 @@ static const TclIntStubs tclIntStubs = { 0, /* 74 */ TclpGetClicks, /* 75 */ TclpGetSeconds, /* 76 */ - 0, /* 77 */ + TclpGetTime, /* 77 */ 0, /* 78 */ 0, /* 79 */ 0, /* 80 */ @@ -302,7 +293,7 @@ static const TclIntStubs tclIntStubs = { TclSetPreInitScript, /* 101 */ TclSetupEnv, /* 102 */ TclSockGetPort, /* 103 */ - 0, /* 104 */ + TclSockMinimumBuffersOld, /* 104 */ 0, /* 105 */ 0, /* 106 */ 0, /* 107 */ @@ -331,7 +322,7 @@ static const TclIntStubs tclIntStubs = { Tcl_RemoveInterpResolvers, /* 130 */ Tcl_SetNamespaceResolvers, /* 131 */ TclpHasSockets, /* 132 */ - 0, /* 133 */ + TclpGetDate, /* 133 */ 0, /* 134 */ 0, /* 135 */ 0, /* 136 */ @@ -380,8 +371,8 @@ static const TclIntStubs tclIntStubs = { 0, /* 179 */ 0, /* 180 */ 0, /* 181 */ - 0, /* 182 */ - 0, /* 183 */ + TclpLocaltime, /* 182 */ + TclpGmtime, /* 183 */ 0, /* 184 */ 0, /* 185 */ 0, /* 186 */ @@ -434,7 +425,7 @@ static const TclIntStubs tclIntStubs = { 0, /* 233 */ TclVarHashCreateVar, /* 234 */ TclInitVarHashTable, /* 235 */ - TclBackgroundException, /* 236 */ + 0, /* 236 */ TclResetCancellation, /* 237 */ 0, /* 238 */ TclNRInterpProcCore, /* 239 */ @@ -466,8 +457,8 @@ static const TclIntPlatStubs tclIntPlatStubs = { TclUnixWaitForFile, /* 8 */ TclpCreateTempFile, /* 9 */ TclpReaddir, /* 10 */ - 0, /* 11 */ - 0, /* 12 */ + TclpLocaltime_unix, /* 11 */ + TclpGmtime_unix, /* 12 */ TclpInetNtoa, /* 13 */ TclUnixCopyFile, /* 14 */ 0, /* 15 */ @@ -489,7 +480,7 @@ static const TclIntPlatStubs tclIntPlatStubs = { #endif /* UNIX */ #if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ TclWinConvertError, /* 0 */ - 0, /* 1 */ + TclWinConvertWSAError, /* 1 */ TclWinGetServByName, /* 2 */ TclWinGetSockOpt, /* 3 */ TclWinGetTclInstance, /* 4 */ @@ -532,8 +523,8 @@ static const TclIntPlatStubs tclIntPlatStubs = { TclUnixWaitForFile, /* 8 */ TclpCreateTempFile, /* 9 */ TclpReaddir, /* 10 */ - 0, /* 11 */ - 0, /* 12 */ + TclpLocaltime_unix, /* 11 */ + TclpGmtime_unix, /* 12 */ TclpInetNtoa, /* 13 */ TclUnixCopyFile, /* 14 */ TclMacOSXGetFileAttribute, /* 15 */ @@ -739,7 +730,7 @@ const TclStubs tclStubs = { Tcl_AsyncMark, /* 74 */ Tcl_AsyncReady, /* 75 */ Tcl_BackgroundError, /* 76 */ - 0, /* 77 */ + Tcl_Backslash, /* 77 */ Tcl_BadChannelOption, /* 78 */ Tcl_CallWhenDeleted, /* 79 */ Tcl_CancelIdleCall, /* 80 */ @@ -757,7 +748,7 @@ const TclStubs tclStubs = { Tcl_CreateEventSource, /* 92 */ Tcl_CreateExitHandler, /* 93 */ Tcl_CreateInterp, /* 94 */ - 0, /* 95 */ + Tcl_CreateMathFunc, /* 95 */ Tcl_CreateObjCommand, /* 96 */ Tcl_CreateSlave, /* 97 */ Tcl_CreateTimerHandler, /* 98 */ @@ -792,7 +783,7 @@ const TclStubs tclStubs = { Tcl_ErrnoId, /* 127 */ Tcl_ErrnoMsg, /* 128 */ Tcl_Eval, /* 129 */ - 0, /* 130 */ + Tcl_EvalFile, /* 130 */ 0, /* 131 */ Tcl_EventuallyFree, /* 132 */ Tcl_Exit, /* 133 */ @@ -806,7 +797,7 @@ const TclStubs tclStubs = { Tcl_ExprObj, /* 141 */ Tcl_ExprString, /* 142 */ Tcl_Finalize, /* 143 */ - 0, /* 144 */ + Tcl_FindExecutable, /* 144 */ Tcl_FirstHashEntry, /* 145 */ Tcl_Flush, /* 146 */ Tcl_FreeResult, /* 147 */ @@ -847,7 +838,7 @@ const TclStubs tclStubs = { Tcl_GetStringResult, /* 174 */ Tcl_GetVar, /* 175 */ Tcl_GetVar2, /* 176 */ - 0, /* 177 */ + Tcl_GlobalEval, /* 177 */ 0, /* 178 */ Tcl_HideCommand, /* 179 */ Tcl_Init, /* 180 */ @@ -890,7 +881,7 @@ const TclStubs tclStubs = { Tcl_ResetResult, /* 217 */ Tcl_ScanElement, /* 218 */ Tcl_ScanCountedElement, /* 219 */ - 0, /* 220 */ + Tcl_SeekOld, /* 220 */ Tcl_ServiceAll, /* 221 */ Tcl_ServiceEvent, /* 222 */ Tcl_SetAssocData, /* 223 */ @@ -916,7 +907,7 @@ const TclStubs tclStubs = { Tcl_SplitPath, /* 243 */ Tcl_StaticPackage, /* 244 */ Tcl_StringMatch, /* 245 */ - 0, /* 246 */ + Tcl_TellOld, /* 246 */ Tcl_TraceVar, /* 247 */ Tcl_TraceVar2, /* 248 */ Tcl_TranslateFileName, /* 249 */ @@ -930,7 +921,7 @@ const TclStubs tclStubs = { Tcl_UpdateLinkedVar, /* 257 */ Tcl_UpVar, /* 258 */ Tcl_UpVar2, /* 259 */ - 0, /* 260 */ + Tcl_VarEval, /* 260 */ Tcl_VarTraceInfo, /* 261 */ Tcl_VarTraceInfo2, /* 262 */ Tcl_Write, /* 263 */ @@ -943,10 +934,10 @@ const TclStubs tclStubs = { Tcl_ParseVar, /* 270 */ Tcl_PkgPresent, /* 271 */ Tcl_PkgPresentEx, /* 272 */ - TclPkgProvide, /* 273 */ + Tcl_PkgProvide, /* 273 */ Tcl_PkgRequire, /* 274 */ Tcl_SetErrorCodeVA, /* 275 */ - 0, /* 276 */ + Tcl_VarEvalVA, /* 276 */ Tcl_WaitPid, /* 277 */ Tcl_PanicVA, /* 278 */ Tcl_GetVersion, /* 279 */ @@ -1011,8 +1002,8 @@ const TclStubs tclStubs = { Tcl_WriteChars, /* 338 */ Tcl_WriteObj, /* 339 */ Tcl_GetString, /* 340 */ - 0, /* 341 */ - 0, /* 342 */ + Tcl_GetDefaultEncodingDir, /* 341 */ + Tcl_SetDefaultEncodingDir, /* 342 */ Tcl_AlertNotifier, /* 343 */ Tcl_ServiceModeHook, /* 344 */ Tcl_UniCharIsAlnum, /* 345 */ @@ -1027,7 +1018,7 @@ const TclStubs tclStubs = { Tcl_UniCharToUtfDString, /* 354 */ Tcl_UtfToUniCharDString, /* 355 */ Tcl_GetRegExpFromObj, /* 356 */ - 0, /* 357 */ + Tcl_EvalTokens, /* 357 */ Tcl_FreeParse, /* 358 */ Tcl_LogCommandInfo, /* 359 */ Tcl_ParseBraces, /* 360 */ @@ -1105,8 +1096,8 @@ const TclStubs tclStubs = { Tcl_AttemptSetObjLength, /* 432 */ Tcl_GetChannelThread, /* 433 */ Tcl_GetUnicodeFromObj, /* 434 */ - 0, /* 435 */ - 0, /* 436 */ + Tcl_GetMathFuncInfo, /* 435 */ + Tcl_ListMathFuncs, /* 436 */ Tcl_SubstObj, /* 437 */ Tcl_DetachChannel, /* 438 */ Tcl_IsStandardChannel, /* 439 */ diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c index eefa300..859cbf9 100644 --- a/generic/tclStubLib.c +++ b/generic/tclStubLib.c @@ -24,15 +24,18 @@ const TclIntStubs *tclIntStubsPtr = NULL; const TclIntPlatStubs *tclIntPlatStubsPtr = NULL; /* - * Use our own ISDIGIT to avoid linking to libc on windows + * Use our own isDigit to avoid linking to libc on windows */ -#define ISDIGIT(c) (((unsigned)((c)-'0')) <= 9) +static int isDigit(const int c) +{ + return (c >= '0' && c <= '9'); +} /* *---------------------------------------------------------------------- * - * TclInitStubs -- + * Tcl_InitStubs -- * * Tries to initialise the stub table pointers and ensures that the * correct version of Tcl is loaded. @@ -48,12 +51,10 @@ const TclIntPlatStubs *tclIntPlatStubsPtr = NULL; */ #undef Tcl_InitStubs MODULE_SCOPE const char * -TclInitStubs( +Tcl_InitStubs( Tcl_Interp *interp, const char *version, - int exact, - const char *tclversion, - int magic) + int exact) { Interp *iPtr = (Interp *) interp; const char *actualVersion = NULL; @@ -67,8 +68,8 @@ TclInitStubs( */ if (!stubsPtr || (stubsPtr->magic != TCL_STUB_MAGIC)) { - iPtr->legacyResult = "interpreter uses an incompatible stubs mechanism"; - iPtr->legacyFreeProc = 0; /* TCL_STATIC */ + iPtr->result = "interpreter uses an incompatible stubs mechanism"; + iPtr->freeProc = TCL_STATIC; return NULL; } @@ -81,7 +82,7 @@ TclInitStubs( int count = 0; while (*p) { - count += !ISDIGIT(*p++); + count += !isDigit(*p++); } if (count == 1) { const char *q = actualVersion; @@ -90,7 +91,7 @@ TclInitStubs( while (*p && (*p == *q)) { p++; q++; } - if (*p || ISDIGIT(*q)) { + if (*p || isDigit(*q)) { /* Construct error message */ stubsPtr->tcl_PkgRequireEx(interp, "Tcl", version, 1, NULL); return NULL; diff --git a/generic/tclTest.c b/generic/tclTest.c index 8e00b66..a1ca641 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -43,8 +43,16 @@ * Declare external functions used in Windows tests. */ -DLLEXPORT int Tcltest_Init(Tcl_Interp *interp); -DLLEXPORT int Tcltest_SafeInit(Tcl_Interp *interp); +/* + * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the + * Tcltest_Init declaration is in the source file itself, which is only + * accessed when we are building a library. + */ + +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT +EXTERN int Tcltest_Init(Tcl_Interp *interp); +EXTERN int Tcltest_SafeInit(Tcl_Interp *interp); /* * Dynamic string shared by TestdcallCmd and DelCallbackProc; used to collect @@ -91,7 +99,7 @@ static Tcl_Trace cmdTrace; * TestdelCmd: */ -typedef struct { +typedef struct DelCmd { Tcl_Interp *interp; /* Interpreter in which command exists. */ char *deleteCmd; /* Script to execute when command is deleted. * Malloc'ed. */ @@ -102,13 +110,20 @@ typedef struct { * command. */ -typedef struct { +typedef struct TclEncoding { Tcl_Interp *interp; char *toUtfCmd; char *fromUtfCmd; } TclEncoding; /* + * The counter below is used to determine if the TestsaveresultFree routine + * was called for a result. + */ + +static int freeCount; + +/* * Boolean flag used by the "testsetmainloop" and "testexitmainloop" commands. */ @@ -118,7 +133,7 @@ static int exitMainLoop = 0; * Event structure used in testing the event queue management procedures. */ -typedef struct { +typedef struct TestEvent { Tcl_Event header; /* Header common to all events */ Tcl_Interp *interp; /* Interpreter that will handle the event */ Tcl_Obj *command; /* Command to evaluate when the event occurs */ @@ -274,6 +289,12 @@ static int TestlinkCmd(ClientData dummy, static int TestlocaleCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); +static int TestMathFunc(ClientData clientData, + Tcl_Interp *interp, Tcl_Value *args, + Tcl_Value *resultPtr); +static int TestMathFunc2(ClientData clientData, + Tcl_Interp *interp, Tcl_Value *args, + Tcl_Value *resultPtr); static int TestmainthreadCmd(ClientData dummy, Tcl_Interp *interp, int argc, const char **argv); static int TestsetmainloopCmd(ClientData dummy, @@ -497,6 +518,8 @@ int Tcltest_Init( Tcl_Interp *interp) /* Interpreter for application. */ { + Tcl_ValueType t3ArgTypes[2]; + Tcl_Obj *listPtr; Tcl_Obj **objv; int objc, index; @@ -505,10 +528,10 @@ Tcltest_Init( "-appinitprocclosestderr", "-appinitprocsetrcfile", NULL }; - if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { + if (Tcl_InitStubs(interp, "8.5", 0) == NULL) { return TCL_ERROR; } - if (Tcl_TomMath_InitStubs(interp, TCL_VERSION) == NULL) { + if (Tcl_TomMath_InitStubs(interp, "8.5") == NULL) { return TCL_ERROR; } if (Tcl_OOInitStubs(interp) == NULL) { @@ -635,7 +658,8 @@ Tcltest_Init( Tcl_CreateCommand(interp, "testtranslatefilename", TesttranslatefilenameCmd, NULL, NULL); Tcl_CreateCommand(interp, "testupvar", TestupvarCmd, NULL, NULL); - + Tcl_CreateMathFunc(interp, "T1", 0, NULL, TestMathFunc, (ClientData) 123); + Tcl_CreateMathFunc(interp, "T2", 0, NULL, TestMathFunc, (ClientData) 345); Tcl_CreateCommand(interp, "testmainthread", TestmainthreadCmd, NULL, NULL); Tcl_CreateCommand(interp, "testsetmainloop", TestsetmainloopCmd, @@ -646,6 +670,10 @@ Tcltest_Init( Tcl_CreateObjCommand(interp, "testcpuid", TestcpuidCmd, (ClientData) 0, NULL); #endif + t3ArgTypes[0] = TCL_EITHER; + t3ArgTypes[1] = TCL_EITHER; + Tcl_CreateMathFunc(interp, "T3", 2, t3ArgTypes, TestMathFunc2, + NULL); Tcl_CreateObjCommand(interp, "testnrelevels", TestNRELevels, NULL, NULL); @@ -1691,7 +1719,7 @@ TestdstringCmd( if (Tcl_GetInt(interp, argv[2], &count) != TCL_OK) { return TCL_ERROR; } - Tcl_DStringSetLength(&dstring, count); + Tcl_DStringTrunc(&dstring, count); } else if (strcmp(argv[1], "start") == 0) { if (argc != 2) { goto wrongNumArgs; @@ -1817,7 +1845,7 @@ EncodingToUtfProc( TclEncoding *encodingPtr; encodingPtr = (TclEncoding *) clientData; - Tcl_EvalEx(encodingPtr->interp, encodingPtr->toUtfCmd, -1, TCL_EVAL_GLOBAL); + Tcl_GlobalEval(encodingPtr->interp, encodingPtr->toUtfCmd); len = strlen(Tcl_GetStringResult(encodingPtr->interp)); if (len > dstLen) { @@ -1849,7 +1877,7 @@ EncodingFromUtfProc( TclEncoding *encodingPtr; encodingPtr = (TclEncoding *) clientData; - Tcl_EvalEx(encodingPtr->interp, encodingPtr->fromUtfCmd, -1, TCL_EVAL_GLOBAL); + Tcl_GlobalEval(encodingPtr->interp, encodingPtr->fromUtfCmd); len = strlen(Tcl_GetStringResult(encodingPtr->interp)); if (len > dstLen) { @@ -3147,6 +3175,144 @@ TestlocaleCmd( /* *---------------------------------------------------------------------- * + * TestMathFunc -- + * + * This is a user-defined math procedure to test out math procedures + * with no arguments. + * + * Results: + * A normal Tcl completion code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + /* ARGSUSED */ +static int +TestMathFunc( + ClientData clientData, /* Integer value to return. */ + Tcl_Interp *interp, /* Not used. */ + Tcl_Value *args, /* Not used. */ + Tcl_Value *resultPtr) /* Where to store result. */ +{ + resultPtr->type = TCL_INT; + resultPtr->intValue = PTR2INT(clientData); + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * TestMathFunc2 -- + * + * This is a user-defined math procedure to test out math procedures + * that do have arguments, in this case 2. + * + * Results: + * A normal Tcl completion code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + /* ARGSUSED */ +static int +TestMathFunc2( + ClientData clientData, /* Integer value to return. */ + Tcl_Interp *interp, /* Used to report errors. */ + Tcl_Value *args, /* Points to an array of two Tcl_Value structs + * for the two arguments. */ + Tcl_Value *resultPtr) /* Where to store the result. */ +{ + int result = TCL_OK; + + /* + * Return the maximum of the two arguments with the correct type. + */ + + if (args[0].type == TCL_INT) { + int i0 = args[0].intValue; + + if (args[1].type == TCL_INT) { + int i1 = args[1].intValue; + + resultPtr->type = TCL_INT; + resultPtr->intValue = ((i0 > i1)? i0 : i1); + } else if (args[1].type == TCL_DOUBLE) { + double d0 = i0; + double d1 = args[1].doubleValue; + + resultPtr->type = TCL_DOUBLE; + resultPtr->doubleValue = ((d0 > d1)? d0 : d1); + } else if (args[1].type == TCL_WIDE_INT) { + Tcl_WideInt w0 = Tcl_LongAsWide(i0); + Tcl_WideInt w1 = args[1].wideValue; + + resultPtr->type = TCL_WIDE_INT; + resultPtr->wideValue = ((w0 > w1)? w0 : w1); + } else { + Tcl_SetResult(interp, "T3: wrong type for arg 2", TCL_STATIC); + result = TCL_ERROR; + } + } else if (args[0].type == TCL_DOUBLE) { + double d0 = args[0].doubleValue; + + if (args[1].type == TCL_INT) { + double d1 = args[1].intValue; + + resultPtr->type = TCL_DOUBLE; + resultPtr->doubleValue = ((d0 > d1)? d0 : d1); + } else if (args[1].type == TCL_DOUBLE) { + double d1 = args[1].doubleValue; + + resultPtr->type = TCL_DOUBLE; + resultPtr->doubleValue = ((d0 > d1)? d0 : d1); + } else if (args[1].type == TCL_WIDE_INT) { + double d1 = Tcl_WideAsDouble(args[1].wideValue); + + resultPtr->type = TCL_DOUBLE; + resultPtr->doubleValue = ((d0 > d1)? d0 : d1); + } else { + Tcl_SetResult(interp, "T3: wrong type for arg 2", TCL_STATIC); + result = TCL_ERROR; + } + } else if (args[0].type == TCL_WIDE_INT) { + Tcl_WideInt w0 = args[0].wideValue; + + if (args[1].type == TCL_INT) { + Tcl_WideInt w1 = Tcl_LongAsWide(args[1].intValue); + + resultPtr->type = TCL_WIDE_INT; + resultPtr->wideValue = ((w0 > w1)? w0 : w1); + } else if (args[1].type == TCL_DOUBLE) { + double d0 = Tcl_WideAsDouble(w0); + double d1 = args[1].doubleValue; + + resultPtr->type = TCL_DOUBLE; + resultPtr->doubleValue = ((d0 > d1)? d0 : d1); + } else if (args[1].type == TCL_WIDE_INT) { + Tcl_WideInt w1 = args[1].wideValue; + + resultPtr->type = TCL_WIDE_INT; + resultPtr->wideValue = ((w0 > w1)? w0 : w1); + } else { + Tcl_SetResult(interp, "T3: wrong type for arg 2", TCL_STATIC); + result = TCL_ERROR; + } + } else { + Tcl_SetResult(interp, "T3: wrong type for arg 1", TCL_STATIC); + result = TCL_ERROR; + } + return result; +} + +/* + *---------------------------------------------------------------------- + * * CleanupTestSetassocdataTests -- * * This function is called when an interpreter is deleted to clean @@ -4181,7 +4347,7 @@ TestfeventCmd( return TCL_ERROR; } if (interp2 != NULL) { - code = Tcl_EvalEx(interp2, argv[2], -1, TCL_EVAL_GLOBAL); + code = Tcl_GlobalEval(interp2, argv[2]); Tcl_SetObjResult(interp, Tcl_GetObjResult(interp2)); return code; } else { @@ -4735,6 +4901,7 @@ TestsaveresultCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* The argument objects. */ { + Interp* iPtr = (Interp*) interp; int discard, result, index; Tcl_SavedResult state; Tcl_Obj *objPtr; @@ -4785,6 +4952,7 @@ TestsaveresultCmd( break; } + freeCount = 0; Tcl_SaveResult(interp, &state); if (((enum options) index) == RESULT_OBJECT) { @@ -4801,10 +4969,14 @@ TestsaveresultCmd( } switch ((enum options) index) { - case RESULT_DYNAMIC: - Tcl_AppendElement(interp, discard ? "called" : "notCalled"); - Tcl_AppendElement(interp, !discard ? "present" : "missing"); + case RESULT_DYNAMIC: { + int present = iPtr->freeProc == TestsaveresultFree; + int called = freeCount; + + Tcl_AppendElement(interp, called ? "called" : "notCalled"); + Tcl_AppendElement(interp, present ? "present" : "missing"); break; + } case RESULT_OBJECT: Tcl_AppendElement(interp, Tcl_GetObjResult(interp) == objPtr ? "same" : "different"); @@ -4835,7 +5007,7 @@ static void TestsaveresultFree( char *blockPtr) { - /* empty... */ + freeCount++; } /* diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index e61f809..4bddc42 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -47,7 +47,7 @@ static int TestobjCmd(ClientData dummy, Tcl_Interp *interp, static int TeststringobjCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -typedef struct { +typedef struct TestString { int numChars; int allocated; int maxChars; diff --git a/generic/tclTestProcBodyObj.c b/generic/tclTestProcBodyObj.c index 3324b98..a3f89f6 100644 --- a/generic/tclTestProcBodyObj.c +++ b/generic/tclTestProcBodyObj.c @@ -34,7 +34,7 @@ static const char procCommand[] = "proc"; * procs */ -typedef struct { +typedef struct CmdTable { const char *cmdName; /* command name */ Tcl_ObjCmdProc *proc; /* command proc */ int exportIt; /* if 1, export the command */ diff --git a/generic/tclThreadStorage.c b/generic/tclThreadStorage.c index 36bf0a5..f24e334 100644 --- a/generic/tclThreadStorage.c +++ b/generic/tclThreadStorage.c @@ -47,7 +47,7 @@ static struct TSDMaster { * The type of the data held per thread in a system TSD. */ -typedef struct { +typedef struct TSDTable { ClientData *tablePtr; /* The table of Tcl TSDs. */ sig_atomic_t allocated; /* The size of the table in the current * thread. */ diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c index e718d34..b90e33d 100644 --- a/generic/tclThreadTest.c +++ b/generic/tclThreadTest.c @@ -62,7 +62,7 @@ static ThreadSpecificData *threadList = NULL; */ typedef struct ThreadCtrl { - const char *script; /* The Tcl command this thread should + const char *script; /* The Tcl command this thread should * execute */ int flags; /* Initial value of the "flags" field in the * ThreadSpecificData structure for the new @@ -229,8 +229,8 @@ ThreadObjCmd( Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } - if (Tcl_GetIndexFromObjStruct(interp, objv[1], threadOptions, - sizeof(char *), "option", 0, &option) != TCL_OK) { + if (Tcl_GetIndexFromObj(interp, objv[1], threadOptions, "option", 0, + &option) != TCL_OK) { return TCL_ERROR; } @@ -834,7 +834,7 @@ ThreadSend( if (threadId == Tcl_GetCurrentThread()) { Tcl_MutexUnlock(&threadMutex); - return Tcl_EvalEx(interp, script, -1, TCL_EVAL_GLOBAL); + return Tcl_GlobalEval(interp, script); } /* @@ -1028,7 +1028,7 @@ ThreadEventProc( Tcl_Preserve(interp); Tcl_ResetResult(interp); Tcl_CreateThreadExitHandler(ThreadFreeProc, threadEventPtr->script); - code = Tcl_EvalEx(interp, threadEventPtr->script, -1, TCL_EVAL_GLOBAL); + code = Tcl_GlobalEval(interp, threadEventPtr->script); Tcl_DeleteThreadExitHandler(ThreadFreeProc, threadEventPtr->script); if (code != TCL_OK) { errorCode = Tcl_GetVar(interp, "errorCode", TCL_GLOBAL_ONLY); diff --git a/generic/tclTimer.c b/generic/tclTimer.c index 735c54a..6b17825 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -91,7 +91,7 @@ typedef struct IdleHandler { * The structure defined below is used in this file only. */ -typedef struct { +typedef struct ThreadSpecificData { TimerHandler *firstTimerHandlerPtr; /* First event in queue. */ int lastTimerId; /* Timer identifier of most recently created * timer. */ diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls index 2124378..ea3abb1 100644 --- a/generic/tclTomMath.decls +++ b/generic/tclTomMath.decls @@ -19,7 +19,7 @@ library tcl interface tclTomMath # hooks {tclTomMathInt} -scspec TCLAPI +scspec EXTERN # Declare each of the functions in the Tcl tommath interface diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index b6dec32..ef22153 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -115,6 +115,17 @@ #define s_mp_sqr TclBN_s_mp_sqr #define s_mp_sub TclBN_s_mp_sub +#undef TCL_STORAGE_CLASS +#ifdef BUILD_tcl +# define TCL_STORAGE_CLASS DLLEXPORT +#else +# ifdef USE_TCL_STUBS +# define TCL_STORAGE_CLASS +# else +# define TCL_STORAGE_CLASS DLLIMPORT +# endif +#endif + /* * WARNING: This file is automatically generated by the tools/genStubs.tcl * script. Any modifications to the function declarations below should be made @@ -128,142 +139,142 @@ */ /* 0 */ -TCLAPI int TclBN_epoch(void); +EXTERN int TclBN_epoch(void); /* 1 */ -TCLAPI int TclBN_revision(void); +EXTERN int TclBN_revision(void); /* 2 */ -TCLAPI int TclBN_mp_add(mp_int *a, mp_int *b, mp_int *c); +EXTERN int TclBN_mp_add(mp_int *a, mp_int *b, mp_int *c); /* 3 */ -TCLAPI int TclBN_mp_add_d(mp_int *a, mp_digit b, mp_int *c); +EXTERN int TclBN_mp_add_d(mp_int *a, mp_digit b, mp_int *c); /* 4 */ -TCLAPI int TclBN_mp_and(mp_int *a, mp_int *b, mp_int *c); +EXTERN int TclBN_mp_and(mp_int *a, mp_int *b, mp_int *c); /* 5 */ -TCLAPI void TclBN_mp_clamp(mp_int *a); +EXTERN void TclBN_mp_clamp(mp_int *a); /* 6 */ -TCLAPI void TclBN_mp_clear(mp_int *a); +EXTERN void TclBN_mp_clear(mp_int *a); /* 7 */ -TCLAPI void TclBN_mp_clear_multi(mp_int *a, ...); +EXTERN void TclBN_mp_clear_multi(mp_int *a, ...); /* 8 */ -TCLAPI int TclBN_mp_cmp(const mp_int *a, const mp_int *b); +EXTERN int TclBN_mp_cmp(const mp_int *a, const mp_int *b); /* 9 */ -TCLAPI int TclBN_mp_cmp_d(const mp_int *a, mp_digit b); +EXTERN int TclBN_mp_cmp_d(const mp_int *a, mp_digit b); /* 10 */ -TCLAPI int TclBN_mp_cmp_mag(const mp_int *a, const mp_int *b); +EXTERN int TclBN_mp_cmp_mag(const mp_int *a, const mp_int *b); /* 11 */ -TCLAPI int TclBN_mp_copy(const mp_int *a, mp_int *b); +EXTERN int TclBN_mp_copy(const mp_int *a, mp_int *b); /* 12 */ -TCLAPI int TclBN_mp_count_bits(const mp_int *a); +EXTERN int TclBN_mp_count_bits(const mp_int *a); /* 13 */ -TCLAPI int TclBN_mp_div(mp_int *a, mp_int *b, mp_int *q, +EXTERN int TclBN_mp_div(mp_int *a, mp_int *b, mp_int *q, mp_int *r); /* 14 */ -TCLAPI int TclBN_mp_div_d(mp_int *a, mp_digit b, mp_int *q, +EXTERN int TclBN_mp_div_d(mp_int *a, mp_digit b, mp_int *q, mp_digit *r); /* 15 */ -TCLAPI int TclBN_mp_div_2(mp_int *a, mp_int *q); +EXTERN int TclBN_mp_div_2(mp_int *a, mp_int *q); /* 16 */ -TCLAPI int TclBN_mp_div_2d(const mp_int *a, int b, mp_int *q, +EXTERN int TclBN_mp_div_2d(const mp_int *a, int b, mp_int *q, mp_int *r); /* 17 */ -TCLAPI int TclBN_mp_div_3(mp_int *a, mp_int *q, mp_digit *r); +EXTERN int TclBN_mp_div_3(mp_int *a, mp_int *q, mp_digit *r); /* 18 */ -TCLAPI void TclBN_mp_exch(mp_int *a, mp_int *b); +EXTERN void TclBN_mp_exch(mp_int *a, mp_int *b); /* 19 */ -TCLAPI int TclBN_mp_expt_d(mp_int *a, mp_digit b, mp_int *c); +EXTERN int TclBN_mp_expt_d(mp_int *a, mp_digit b, mp_int *c); /* 20 */ -TCLAPI int TclBN_mp_grow(mp_int *a, int size); +EXTERN int TclBN_mp_grow(mp_int *a, int size); /* 21 */ -TCLAPI int TclBN_mp_init(mp_int *a); +EXTERN int TclBN_mp_init(mp_int *a); /* 22 */ -TCLAPI int TclBN_mp_init_copy(mp_int *a, mp_int *b); +EXTERN int TclBN_mp_init_copy(mp_int *a, mp_int *b); /* 23 */ -TCLAPI int TclBN_mp_init_multi(mp_int *a, ...); +EXTERN int TclBN_mp_init_multi(mp_int *a, ...); /* 24 */ -TCLAPI int TclBN_mp_init_set(mp_int *a, mp_digit b); +EXTERN int TclBN_mp_init_set(mp_int *a, mp_digit b); /* 25 */ -TCLAPI int TclBN_mp_init_size(mp_int *a, int size); +EXTERN int TclBN_mp_init_size(mp_int *a, int size); /* 26 */ -TCLAPI int TclBN_mp_lshd(mp_int *a, int shift); +EXTERN int TclBN_mp_lshd(mp_int *a, int shift); /* 27 */ -TCLAPI int TclBN_mp_mod(mp_int *a, mp_int *b, mp_int *r); +EXTERN int TclBN_mp_mod(mp_int *a, mp_int *b, mp_int *r); /* 28 */ -TCLAPI int TclBN_mp_mod_2d(const mp_int *a, int b, mp_int *r); +EXTERN int TclBN_mp_mod_2d(const mp_int *a, int b, mp_int *r); /* 29 */ -TCLAPI int TclBN_mp_mul(mp_int *a, mp_int *b, mp_int *p); +EXTERN int TclBN_mp_mul(mp_int *a, mp_int *b, mp_int *p); /* 30 */ -TCLAPI int TclBN_mp_mul_d(mp_int *a, mp_digit b, mp_int *p); +EXTERN int TclBN_mp_mul_d(mp_int *a, mp_digit b, mp_int *p); /* 31 */ -TCLAPI int TclBN_mp_mul_2(mp_int *a, mp_int *p); +EXTERN int TclBN_mp_mul_2(mp_int *a, mp_int *p); /* 32 */ -TCLAPI int TclBN_mp_mul_2d(const mp_int *a, int d, mp_int *p); +EXTERN int TclBN_mp_mul_2d(const mp_int *a, int d, mp_int *p); /* 33 */ -TCLAPI int TclBN_mp_neg(const mp_int *a, mp_int *b); +EXTERN int TclBN_mp_neg(const mp_int *a, mp_int *b); /* 34 */ -TCLAPI int TclBN_mp_or(mp_int *a, mp_int *b, mp_int *c); +EXTERN int TclBN_mp_or(mp_int *a, mp_int *b, mp_int *c); /* 35 */ -TCLAPI int TclBN_mp_radix_size(mp_int *a, int radix, int *size); +EXTERN int TclBN_mp_radix_size(mp_int *a, int radix, int *size); /* 36 */ -TCLAPI int TclBN_mp_read_radix(mp_int *a, const char *str, +EXTERN int TclBN_mp_read_radix(mp_int *a, const char *str, int radix); /* 37 */ -TCLAPI void TclBN_mp_rshd(mp_int *a, int shift); +EXTERN void TclBN_mp_rshd(mp_int *a, int shift); /* 38 */ -TCLAPI int TclBN_mp_shrink(mp_int *a); +EXTERN int TclBN_mp_shrink(mp_int *a); /* 39 */ -TCLAPI void TclBN_mp_set(mp_int *a, mp_digit b); +EXTERN void TclBN_mp_set(mp_int *a, mp_digit b); /* 40 */ -TCLAPI int TclBN_mp_sqr(mp_int *a, mp_int *b); +EXTERN int TclBN_mp_sqr(mp_int *a, mp_int *b); /* 41 */ -TCLAPI int TclBN_mp_sqrt(mp_int *a, mp_int *b); +EXTERN int TclBN_mp_sqrt(mp_int *a, mp_int *b); /* 42 */ -TCLAPI int TclBN_mp_sub(mp_int *a, mp_int *b, mp_int *c); +EXTERN int TclBN_mp_sub(mp_int *a, mp_int *b, mp_int *c); /* 43 */ -TCLAPI int TclBN_mp_sub_d(mp_int *a, mp_digit b, mp_int *c); +EXTERN int TclBN_mp_sub_d(mp_int *a, mp_digit b, mp_int *c); /* 44 */ -TCLAPI int TclBN_mp_to_unsigned_bin(mp_int *a, unsigned char *b); +EXTERN int TclBN_mp_to_unsigned_bin(mp_int *a, unsigned char *b); /* 45 */ -TCLAPI int TclBN_mp_to_unsigned_bin_n(mp_int *a, +EXTERN int TclBN_mp_to_unsigned_bin_n(mp_int *a, unsigned char *b, unsigned long *outlen); /* 46 */ -TCLAPI int TclBN_mp_toradix_n(mp_int *a, char *str, int radix, +EXTERN int TclBN_mp_toradix_n(mp_int *a, char *str, int radix, int maxlen); /* 47 */ -TCLAPI int TclBN_mp_unsigned_bin_size(mp_int *a); +EXTERN int TclBN_mp_unsigned_bin_size(mp_int *a); /* 48 */ -TCLAPI int TclBN_mp_xor(mp_int *a, mp_int *b, mp_int *c); +EXTERN int TclBN_mp_xor(mp_int *a, mp_int *b, mp_int *c); /* 49 */ -TCLAPI void TclBN_mp_zero(mp_int *a); +EXTERN void TclBN_mp_zero(mp_int *a); /* 50 */ -TCLAPI void TclBN_reverse(unsigned char *s, int len); +EXTERN void TclBN_reverse(unsigned char *s, int len); /* 51 */ -TCLAPI int TclBN_fast_s_mp_mul_digs(mp_int *a, mp_int *b, +EXTERN int TclBN_fast_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs); /* 52 */ -TCLAPI int TclBN_fast_s_mp_sqr(mp_int *a, mp_int *b); +EXTERN int TclBN_fast_s_mp_sqr(mp_int *a, mp_int *b); /* 53 */ -TCLAPI int TclBN_mp_karatsuba_mul(mp_int *a, mp_int *b, +EXTERN int TclBN_mp_karatsuba_mul(mp_int *a, mp_int *b, mp_int *c); /* 54 */ -TCLAPI int TclBN_mp_karatsuba_sqr(mp_int *a, mp_int *b); +EXTERN int TclBN_mp_karatsuba_sqr(mp_int *a, mp_int *b); /* 55 */ -TCLAPI int TclBN_mp_toom_mul(mp_int *a, mp_int *b, mp_int *c); +EXTERN int TclBN_mp_toom_mul(mp_int *a, mp_int *b, mp_int *c); /* 56 */ -TCLAPI int TclBN_mp_toom_sqr(mp_int *a, mp_int *b); +EXTERN int TclBN_mp_toom_sqr(mp_int *a, mp_int *b); /* 57 */ -TCLAPI int TclBN_s_mp_add(mp_int *a, mp_int *b, mp_int *c); +EXTERN int TclBN_s_mp_add(mp_int *a, mp_int *b, mp_int *c); /* 58 */ -TCLAPI int TclBN_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, +EXTERN int TclBN_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs); /* 59 */ -TCLAPI int TclBN_s_mp_sqr(mp_int *a, mp_int *b); +EXTERN int TclBN_s_mp_sqr(mp_int *a, mp_int *b); /* 60 */ -TCLAPI int TclBN_s_mp_sub(mp_int *a, mp_int *b, mp_int *c); +EXTERN int TclBN_s_mp_sub(mp_int *a, mp_int *b, mp_int *c); /* 61 */ -TCLAPI int TclBN_mp_init_set_int(mp_int *a, unsigned long i); +EXTERN int TclBN_mp_init_set_int(mp_int *a, unsigned long i); /* 62 */ -TCLAPI int TclBN_mp_set_int(mp_int *a, unsigned long i); +EXTERN int TclBN_mp_set_int(mp_int *a, unsigned long i); /* 63 */ -TCLAPI int TclBN_mp_cnt_lsb(const mp_int *a); +EXTERN int TclBN_mp_cnt_lsb(const mp_int *a); typedef struct TclTomMathStubs { int magic; @@ -482,4 +493,7 @@ extern const TclTomMathStubs *tclTomMathStubsPtr; /* !END!: Do not edit above this line. */ +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLIMPORT + #endif /* _TCLINTDECLS */ diff --git a/generic/tclTrace.c b/generic/tclTrace.c index f9621fc..61bac9b 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -143,7 +143,7 @@ static int TraceVarEx(Tcl_Interp *interp, const char *part1, * trace procs */ -typedef struct { +typedef struct StringTraceData { ClientData clientData; /* Client data from Tcl_CreateTrace */ Tcl_CmdTraceProc *proc; /* Trace function from Tcl_CreateTrace */ } StringTraceData; diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 93ab34b..4b5b37b 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -107,7 +107,7 @@ static int UtfCount(int ch); *--------------------------------------------------------------------------- */ -inline static int +INLINE static int UtfCount( int ch) /* The Tcl_UniChar whose size is returned. */ { @@ -152,7 +152,7 @@ UtfCount( *--------------------------------------------------------------------------- */ -inline int +INLINE int Tcl_UniCharToUtf( int ch, /* The Tcl_UniChar to be stored in the * buffer. */ diff --git a/generic/tclUtil.c b/generic/tclUtil.c index df257e8..27e2474 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -1556,6 +1556,40 @@ Tcl_Merge( /* *---------------------------------------------------------------------- * + * Tcl_Backslash -- + * + * Figure out how to handle a backslash sequence. + * + * Results: + * The return value is the character that should be substituted in place + * of the backslash sequence that starts at src. If readPtr isn't NULL + * then it is filled in with a count of the number of characters in the + * backslash sequence. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +char +Tcl_Backslash( + const char *src, /* Points to the backslash character of a + * backslash sequence. */ + int *readPtr) /* Fill in with number of characters read from + * src, unless NULL. */ +{ + char buf[TCL_UTF_MAX]; + Tcl_UniChar ch; + + Tcl_UtfBackslash(src, readPtr, buf); + TclUtfToUniChar(buf, &ch); + return (char) ch; +} + +/* + *---------------------------------------------------------------------- + * * TclTrimRight -- * * Takes two counted strings in the Tcl encoding which must both be null @@ -2762,6 +2796,7 @@ Tcl_DStringResult( Tcl_DString *dsPtr) /* Dynamic string that is to become the * result of interp. */ { + Tcl_ResetResult(interp); Tcl_SetObjResult(interp, TclDStringToObj(dsPtr)); } @@ -2791,12 +2826,77 @@ Tcl_DStringGetResult( Tcl_DString *dsPtr) /* Dynamic string that is to become the result * of interp. */ { - int length; - char *bytes = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &length); + Interp *iPtr = (Interp *) interp; - Tcl_DStringFree(dsPtr); - Tcl_DStringAppend(dsPtr, bytes, length); - Tcl_ResetResult(interp); + if (dsPtr->string != dsPtr->staticSpace) { + ckfree(dsPtr->string); + } + + /* + * Do more efficient transfer when we know the result is a Tcl_Obj. When + * there's no st`ring result, we only have to deal with two cases: + * + * 1. When the string rep is the empty string, when we don't copy but + * instead use the staticSpace in the DString to hold an empty string. + + * 2. When the string rep is not there or there's a real string rep, when + * we use Tcl_GetString to fetch (or generate) the string rep - which + * we know to have been allocated with ckalloc() - and use it to + * populate the DString space. Then, we free the internal rep. and set + * the object's string representation back to the canonical empty + * string. + */ + + if (!iPtr->result[0] && iPtr->objResultPtr + && !Tcl_IsShared(iPtr->objResultPtr)) { + if (iPtr->objResultPtr->bytes == tclEmptyStringRep) { + dsPtr->string = dsPtr->staticSpace; + dsPtr->string[0] = 0; + dsPtr->length = 0; + dsPtr->spaceAvl = TCL_DSTRING_STATIC_SIZE; + } else { + dsPtr->string = Tcl_GetString(iPtr->objResultPtr); + dsPtr->length = iPtr->objResultPtr->length; + dsPtr->spaceAvl = dsPtr->length + 1; + TclFreeIntRep(iPtr->objResultPtr); + iPtr->objResultPtr->bytes = tclEmptyStringRep; + iPtr->objResultPtr->length = 0; + } + return; + } + + /* + * If the string result is empty, move the object result to the string + * result, then reset the object result. + */ + + (void) Tcl_GetStringResult(interp); + + dsPtr->length = strlen(iPtr->result); + if (iPtr->freeProc != NULL) { + if (iPtr->freeProc == TCL_DYNAMIC) { + dsPtr->string = iPtr->result; + dsPtr->spaceAvl = dsPtr->length+1; + } else { + dsPtr->string = ckalloc(dsPtr->length+1); + memcpy(dsPtr->string, iPtr->result, (unsigned) dsPtr->length+1); + iPtr->freeProc(iPtr->result); + } + dsPtr->spaceAvl = dsPtr->length+1; + iPtr->freeProc = NULL; + } else { + if (dsPtr->length < TCL_DSTRING_STATIC_SIZE) { + dsPtr->string = dsPtr->staticSpace; + dsPtr->spaceAvl = TCL_DSTRING_STATIC_SIZE; + } else { + dsPtr->string = ckalloc(dsPtr->length+1); + dsPtr->spaceAvl = dsPtr->length + 1; + } + memcpy(dsPtr->string, iPtr->result, (unsigned) dsPtr->length+1); + } + + iPtr->result = iPtr->resultSpace; + iPtr->resultSpace[0] = 0; } /* @@ -3448,6 +3548,7 @@ TclGetIntForIndex( if (!strncmp(bytes, "end-", 4)) { bytes += 4; } + TclCheckBadOctal(interp, bytes); Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX", NULL); } @@ -3592,6 +3693,73 @@ SetEndOffsetFromAny( /* *---------------------------------------------------------------------- * + * TclCheckBadOctal -- + * + * This function checks for a bad octal value and appends a meaningful + * error to the interp's result. + * + * Results: + * 1 if the argument was a bad octal, else 0. + * + * Side effects: + * The interpreter's result is modified. + * + *---------------------------------------------------------------------- + */ + +int +TclCheckBadOctal( + Tcl_Interp *interp, /* Interpreter to use for error reporting. If + * NULL, then no error message is left after + * errors. */ + const char *value) /* String to check. */ +{ + register const char *p = value; + + /* + * A frequent mistake is invalid octal values due to an unwanted leading + * zero. Try to generate a meaningful error message. + */ + + while (TclIsSpaceProc(*p)) { + p++; + } + if (*p == '+' || *p == '-') { + p++; + } + if (*p == '0') { + if ((p[1] == 'o') || p[1] == 'O') { + p += 2; + } + while (isdigit(UCHAR(*p))) { /* INTL: digit. */ + p++; + } + while (TclIsSpaceProc(*p)) { + p++; + } + if (*p == '\0') { + /* + * Reached end of string. + */ + + if (interp != NULL) { + /* + * Don't reset the result here because we want this result to + * be added to an existing error message as extra info. + */ + + Tcl_AppendToObj(Tcl_GetObjResult(interp), + " (looks like invalid octal number)", -1); + } + return 1; + } + } + return 0; +} + +/* + *---------------------------------------------------------------------- + * * ClearHash -- * * Remove all the entries in the hash table *tablePtr. @@ -3942,6 +4110,31 @@ Tcl_GetNameOfExecutable(void) /* *---------------------------------------------------------------------- * + * TclpGetTime -- + * + * Deprecated synonym for Tcl_GetTime. This function is provided for the + * benefit of extensions written before Tcl_GetTime was exported from the + * library. + * + * Results: + * None. + * + * Side effects: + * Stores current time in the buffer designated by "timePtr" + * + *---------------------------------------------------------------------- + */ + +void +TclpGetTime( + Tcl_Time *timePtr) +{ + Tcl_GetTime(timePtr); +} + +/* + *---------------------------------------------------------------------- + * * TclGetPlatform -- * * This is a kludge that allows the test library to get access the diff --git a/generic/tclVar.c b/generic/tclVar.c index 90bfe06..cf33561 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -809,6 +809,9 @@ TclObjLookupVarEx( * - Bug #696893 - variable is either proc-local or in the current * namespace; never follow the second (global) resolution path * - Bug #631741 - do not use special namespace or interp resolvers + * + * It should also not collide with the (deprecated) TCL_PARSE_PART1 flag + * (Bug #835020) */ #define AVOID_RESOLVERS 0x40000 diff --git a/library/http/http.tcl b/library/http/http.tcl index 442cdc5..01bf772 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -8,7 +8,7 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. -package require Tcl 8.6- +package require Tcl 8.6 # Keep this in sync with pkgIndex.tcl and with the install directories in # Makefiles package provide http 2.8.6 diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl index e4c0e11..a8641e1 100644 --- a/library/http/pkgIndex.tcl +++ b/library/http/pkgIndex.tcl @@ -1,2 +1,2 @@ -if {![package vsatisfies [package provide Tcl] 8.6-]} {return} +if {![package vsatisfies [package provide Tcl] 8.6]} {return} package ifneeded http 2.8.6 [list tclPkgSetup $dir http 2.8.6 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] diff --git a/library/init.tcl b/library/init.tcl index 7eeb53b..e836df9 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -15,7 +15,7 @@ if {[info commands package] == ""} { error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" } -package require -exact Tcl 9.0a0 +package require -exact Tcl 8.6.0 # Compute the auto path to use in this interpreter. # The values on the path come from several locations: diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl index 5f8e1e9..112507a 100644 --- a/library/msgcat/msgcat.tcl +++ b/library/msgcat/msgcat.tcl @@ -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. -package require Tcl 8.5- +package require Tcl 8.5 # When the version number changes, be sure to update the pkgIndex.tcl file, # and the installation directory in the Makefiles. package provide msgcat 1.5.0 diff --git a/library/msgcat/pkgIndex.tcl b/library/msgcat/pkgIndex.tcl index a5b6499..832bf81 100644 --- a/library/msgcat/pkgIndex.tcl +++ b/library/msgcat/pkgIndex.tcl @@ -1,2 +1,2 @@ -if {![package vsatisfies [package provide Tcl] 8.5-]} {return} +if {![package vsatisfies [package provide Tcl] 8.5]} {return} package ifneeded msgcat 1.5.0 [list source [file join $dir msgcat.tcl]] diff --git a/library/opt/optparse.tcl b/library/opt/optparse.tcl index 163bc7d..fc77fa1 100644 --- a/library/opt/optparse.tcl +++ b/library/opt/optparse.tcl @@ -8,7 +8,7 @@ # on it. If your code does rely on this package you # may directly incorporate this code into your application. -package require Tcl 8.2- +package require Tcl 8.2 # When this version number changes, update the pkgIndex.tcl file # and the install directory in the Makefiles. package provide opt 0.4.6 diff --git a/library/opt/pkgIndex.tcl b/library/opt/pkgIndex.tcl index d96af94..107d4c6 100644 --- a/library/opt/pkgIndex.tcl +++ b/library/opt/pkgIndex.tcl @@ -8,5 +8,5 @@ # script is sourced, the variable $dir must contain the # full path name of this file's directory. -if {![package vsatisfies [package provide Tcl] 8.2-]} {return} +if {![package vsatisfies [package provide Tcl] 8.2]} {return} package ifneeded opt 0.4.6 [list source [file join $dir optparse.tcl]] diff --git a/library/package.tcl b/library/package.tcl index 5b99a69..c30431c 100644 --- a/library/package.tcl +++ b/library/package.tcl @@ -137,9 +137,6 @@ proc pkg_mkIndex {args} { } on error {msg opt} { return -options $opt $msg } - if {[llength $fileList] == 0} { - return -code error "no files matched glob pattern \"$patternList\"" - } foreach file $fileList { # For each file, figure out what commands and packages it provides. # To do this, create a child interpreter, load the file into the diff --git a/library/tcltest/pkgIndex.tcl b/library/tcltest/pkgIndex.tcl index fabddb0..4b0a9bc 100644 --- a/library/tcltest/pkgIndex.tcl +++ b/library/tcltest/pkgIndex.tcl @@ -8,5 +8,5 @@ # script is sourced, the variable $dir must contain the # full path name of this file's directory. -if {![package vsatisfies [package provide Tcl] 8.5-]} {return} +if {![package vsatisfies [package provide Tcl] 8.5]} {return} package ifneeded tcltest 2.3.5 [list source [file join $dir tcltest.tcl]] diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 07d0a51..83ec9d3 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -16,7 +16,7 @@ # Contributions from Don Porter, NIST, 2002. (not subject to US copyright) # All rights reserved. -package require Tcl 8.5- ;# -verbose line uses [info frame] +package require Tcl 8.5 ;# -verbose line uses [info frame] namespace eval tcltest { # When the version number changes, be sure to update the pkgIndex.tcl file, diff --git a/library/tm.tcl b/library/tm.tcl index 2eff644..ce8a013 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -330,18 +330,6 @@ proc ::tcl::tm::Defaults {} { } } } - if {$major == 8} return - for {set n 7} {$n >= 0} {incr n -1} { - foreach ev [::list \ - TCL8.${n}_TM_PATH \ - TCL8_${n}_TM_PATH \ - ] { - if {![info exists env($ev)]} continue - foreach p [split $env($ev) $sep] { - path add $p - } - } - } return } @@ -370,16 +358,6 @@ proc ::tcl::tm::roots {paths} { set px [file join $p site-tcl] if {![interp issafe]} {set px [file normalize $px]} path add $px - if {$major == 8} continue - set p [file join $pa tcl8] - for {set n 7} {$n >= 0} {incr n -1} { - set px [file join $p 8.${n}] - if {![interp issafe]} {set px [file normalize $px]} - path add $px - } - set px [file join $p site-tcl] - if {![interp issafe]} {set px [file normalize $px]} - path add $px } return } diff --git a/macosx/Tcl-Common.xcconfig b/macosx/Tcl-Common.xcconfig index 6ee8d58..9c47547 100644 --- a/macosx/Tcl-Common.xcconfig +++ b/macosx/Tcl-Common.xcconfig @@ -34,4 +34,4 @@ TCL_CONFIGURE_ARGS = --enable-threads --enable-dtrace TCL_LIBRARY = $(LIBDIR)/tcl$(VERSION) TCL_PACKAGE_PATH = "$(LIBDIR)" TCL_DEFS = HAVE_TCL_CONFIG_H -VERSION = 9.0 +VERSION = 8.6 diff --git a/tests/all.tcl b/tests/all.tcl index 5fd21ce..05d3024 100644 --- a/tests/all.tcl +++ b/tests/all.tcl @@ -11,7 +11,7 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. package prefer latest -package require Tcl 8.5- +package require Tcl 8.5 package require tcltest 2.2 namespace import tcltest::* configure {*}$argv -testdir [file dir [info script]] diff --git a/tests/cmdAH.test b/tests/cmdAH.test index 0517e5f..3051bfb 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -59,6 +59,8 @@ test cmdAH-0.2 {Tcl_BreakObjCmd, success} { list [catch {break} msg] $msg } {3 {}} +# Tcl_CaseObjCmd is tested in case.test + test cmdAH-1.1 {Tcl_CatchObjCmd, errors} -returnCodes error -body { catch } -result {wrong # args: should be "catch script ?resultVarName? ?optionVarName?"} diff --git a/tests/compExpr-old.test b/tests/compExpr-old.test index 774060d..bae26a0 100644 --- a/tests/compExpr-old.test +++ b/tests/compExpr-old.test @@ -18,6 +18,13 @@ if {[lsearch [namespace children] ::tcltest] == -1} { } ::tcltest::loadTestedCommands +catch [list package require -exact Tcltest [info patchlevel]] + +if {[catch {expr T1()} msg] && $msg eq {invalid command name "tcl::mathfunc::T1"}} { + testConstraint testmathfunctions 0 +} else { + testConstraint testmathfunctions 1 +} # Big test for correct ordering of data in [expr] @@ -278,10 +285,10 @@ test compExpr-old-6.8 {CompileBitXorExpr: error compiling bitxor arm} -body { } -returnCodes error -match glob -result * test compExpr-old-6.9 {CompileBitXorExpr: runtime error in bitxor arm} { list [catch {expr {24.0^3}} msg] $msg -} {1 {can't use floating-point value "24.0" as operand of "^"}} +} {1 {can't use floating-point value as operand of "^"}} test compExpr-old-6.10 {CompileBitXorExpr: runtime error in bitxor arm} { list [catch {expr {"a"^"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "^"}} +} {1 {can't use non-numeric string as operand of "^"}} test compExpr-old-7.1 {CompileBitAndExpr: just equality expr} {expr 3==2} 0 test compExpr-old-7.2 {CompileBitAndExpr: just equality expr} {expr 2.0==2} 1 @@ -302,10 +309,10 @@ test compExpr-old-7.11 {CompileBitAndExpr: error compiling bitand arm} -body { } -returnCodes error -match glob -result * test compExpr-old-7.12 {CompileBitAndExpr: runtime error in bitand arm} { list [catch {expr {24.0&3}} msg] $msg -} {1 {can't use floating-point value "24.0" as operand of "&"}} +} {1 {can't use floating-point value as operand of "&"}} test compExpr-old-7.13 {CompileBitAndExpr: runtime error in bitand arm} { list [catch {expr {"a"&"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "&"}} +} {1 {can't use non-numeric string as operand of "&"}} test compExpr-old-8.1 {CompileEqualityExpr: just relational expr} {expr 3>=2} 1 test compExpr-old-8.2 {CompileEqualityExpr: just relational expr} {expr 2<=2.1} 1 @@ -370,10 +377,10 @@ test compExpr-old-10.9 {CompileShiftExpr: error compiling shift arm} -body { } -returnCodes error -match glob -result * test compExpr-old-10.10 {CompileShiftExpr: runtime error} { list [catch {expr {24.0>>43}} msg] $msg -} {1 {can't use floating-point value "24.0" as operand of ">>"}} +} {1 {can't use floating-point value as operand of ">>"}} test compExpr-old-10.11 {CompileShiftExpr: runtime error} { list [catch {expr {"a"<<"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "<<"}} +} {1 {can't use non-numeric string as operand of "<<"}} test compExpr-old-11.1 {CompileAddExpr: just multiply expr} {expr 4*-2} -8 test compExpr-old-11.2 {CompileAddExpr: just multiply expr} {expr 0xff%2} 1 @@ -392,10 +399,10 @@ test compExpr-old-11.9 {CompileAddExpr: error compiling add arm} -body { } -returnCodes error -match glob -result * test compExpr-old-11.10 {CompileAddExpr: runtime error} { list [catch {expr {24.0+"xx"}} msg] $msg -} {1 {can't use non-numeric string "xx" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} test compExpr-old-11.11 {CompileAddExpr: runtime error} { list [catch {expr {"a"-"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "-"}} +} {1 {can't use non-numeric string as operand of "-"}} test compExpr-old-11.12 {CompileAddExpr: runtime error} { list [catch {expr {3/0}} msg] $msg } {1 {divide by zero}} @@ -423,10 +430,10 @@ test compExpr-old-12.9 {CompileMultiplyExpr: error compiling multiply arm} -body } -returnCodes error -match glob -result * test compExpr-old-12.10 {CompileMultiplyExpr: runtime error} { list [catch {expr {24.0*"xx"}} msg] $msg -} {1 {can't use non-numeric string "xx" as operand of "*"}} +} {1 {can't use non-numeric string as operand of "*"}} test compExpr-old-12.11 {CompileMultiplyExpr: runtime error} { list [catch {expr {"a"/"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "/"}} +} {1 {can't use non-numeric string as operand of "/"}} test compExpr-old-13.1 {CompileUnaryExpr: unary exprs} {expr -0xff} -255 test compExpr-old-13.2 {CompileUnaryExpr: unary exprs} {expr +0o00123} 83 @@ -444,10 +451,10 @@ test compExpr-old-13.9 {CompileUnaryExpr: error compiling unary expr} -body { } -returnCodes error -match glob -result * test compExpr-old-13.10 {CompileUnaryExpr: runtime error} { list [catch {expr {~"xx"}} msg] $msg -} {1 {can't use non-numeric string "xx" as operand of "~"}} +} {1 {can't use non-numeric string as operand of "~"}} test compExpr-old-13.11 {CompileUnaryExpr: runtime error} { list [catch {expr ~4.0} msg] $msg -} {1 {can't use floating-point value "4.0" as operand of "~"}} +} {1 {can't use floating-point value as operand of "~"}} test compExpr-old-13.12 {CompileUnaryExpr: just primary expr} {expr 0x123} 291 test compExpr-old-13.13 {CompileUnaryExpr: just primary expr} { set a 27 @@ -595,6 +602,21 @@ test compExpr-old-15.5 {CompileMathFuncCall: too few arguments} -body { test compExpr-old-15.6 {CompileMathFuncCall: missing ')'} -body { expr sin(1 } -returnCodes error -match glob -result * +test compExpr-old-15.7 {CompileMathFuncCall: call registered math function} testmathfunctions { + expr 2*T1() +} 246 +test compExpr-old-15.8 {CompileMathFuncCall: call registered math function} testmathfunctions { + expr T2()*3 +} 1035 +test compExpr-old-15.9 {CompileMathFuncCall: call registered math function} testmathfunctions { + expr T3(21, 37) +} 37 +test compExpr-old-15.10 {CompileMathFuncCall: call registered math function} testmathfunctions { + expr T3(21.2, 37) +} 37.0 +test compExpr-old-15.11 {CompileMathFuncCall: call registered math function} testmathfunctions { + expr T3(-21.2, -17.5) +} -17.5 test compExpr-old-16.1 {GetToken: checks whether integer token starting with "0x" (e.g., "0x$") is invalid} { catch {unset a} diff --git a/tests/compExpr.test b/tests/compExpr.test index a2a021e..14c875d 100644 --- a/tests/compExpr.test +++ b/tests/compExpr.test @@ -14,6 +14,13 @@ if {"::tcltest" ni [namespace children]} { } ::tcltest::loadTestedCommands +catch [list package require -exact Tcltest [info patchlevel]] + +if {[catch {expr T1()} msg] && $msg eq {invalid command name "tcl::mathfunc::T1"}} { + testConstraint testmathfunctions 0 +} else { + testConstraint testmathfunctions 1 +} # Constrain memory leak tests testConstraint memory [llength [info commands memory]] @@ -312,6 +319,12 @@ test compExpr-5.1 {CompileMathFuncCall procedure, math function found} { test compExpr-5.2 {CompileMathFuncCall procedure, math function not found} -body { expr {do_it()} } -returnCodes error -match glob -result {* "*do_it"} +test compExpr-5.3 {CompileMathFuncCall: call registered math function} testmathfunctions { + expr 3*T1()-1 +} 368 +test compExpr-5.4 {CompileMathFuncCall: call registered math function} testmathfunctions { + expr T2()*3 +} 1035 test compExpr-5.5 {CompileMathFuncCall procedure, too few arguments} -body { expr {atan2(1.0)} } -returnCodes error -match glob -result {too few arguments for math function*} diff --git a/tests/compile.test b/tests/compile.test index d276460..4d91940 100644 --- a/tests/compile.test +++ b/tests/compile.test @@ -282,7 +282,7 @@ test compile-11.2 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body { } -returnCodes error -result {bad index "bogus": must be integer?[+-]integer? or end?[+-]integer?} test compile-11.3 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body { apply {{} { set r [list foobar] ; string index a 0o9 }} -} -returnCodes error -match glob -result {*} +} -returnCodes error -match glob -result {*invalid octal number*} test compile-11.4 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body { apply {{} { set r [list foobar] ; array set var {one two many} }} } -returnCodes error -result {list must have an even number of elements} diff --git a/tests/execute.test b/tests/execute.test index 780db5d..2dde3f7 100644 --- a/tests/execute.test +++ b/tests/execute.test @@ -174,7 +174,7 @@ test execute-3.5 {TclExecuteByteCode, INST_ADD, op1 is string double} {testobj} test execute-3.6 {TclExecuteByteCode, INST_ADD, op1 is non-numeric} {testobj} { set x [teststringobj set 0 foo] list [catch {expr {$x + 1}} msg] $msg -} {1 {can't use non-numeric string "foo" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} test execute-3.7 {TclExecuteByteCode, INST_ADD, op2 is int} {testobj} { set x [testintobj set 0 1] expr {1 + $x} @@ -199,7 +199,7 @@ test execute-3.11 {TclExecuteByteCode, INST_ADD, op2 is string double} {testobj} test execute-3.12 {TclExecuteByteCode, INST_ADD, op2 is non-numeric} {testobj} { set x [teststringobj set 0 foo] list [catch {expr {1 + $x}} msg] $msg -} {1 {can't use non-numeric string "foo" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} # INST_SUB is partially tested: test execute-3.13 {TclExecuteByteCode, INST_SUB, op1 is int} {testobj} { @@ -226,7 +226,7 @@ test execute-3.17 {TclExecuteByteCode, INST_SUB, op1 is string double} {testobj} test execute-3.18 {TclExecuteByteCode, INST_SUB, op1 is non-numeric} {testobj} { set x [teststringobj set 0 foo] list [catch {expr {$x - 1}} msg] $msg -} {1 {can't use non-numeric string "foo" as operand of "-"}} +} {1 {can't use non-numeric string as operand of "-"}} test execute-3.19 {TclExecuteByteCode, INST_SUB, op2 is int} {testobj} { set x [testintobj set 0 1] expr {1 - $x} @@ -251,7 +251,7 @@ test execute-3.23 {TclExecuteByteCode, INST_SUB, op2 is string double} {testobj} test execute-3.24 {TclExecuteByteCode, INST_SUB, op2 is non-numeric} {testobj} { set x [teststringobj set 0 foo] list [catch {expr {1 - $x}} msg] $msg -} {1 {can't use non-numeric string "foo" as operand of "-"}} +} {1 {can't use non-numeric string as operand of "-"}} # INST_MULT is partially tested: test execute-3.25 {TclExecuteByteCode, INST_MULT, op1 is int} {testobj} { @@ -278,7 +278,7 @@ test execute-3.29 {TclExecuteByteCode, INST_MULT, op1 is string double} {testobj test execute-3.30 {TclExecuteByteCode, INST_MULT, op1 is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {$x * 1}} msg] $msg -} {1 {can't use non-numeric string "foo" as operand of "*"}} +} {1 {can't use non-numeric string as operand of "*"}} test execute-3.31 {TclExecuteByteCode, INST_MULT, op2 is int} {testobj} { set x [testintobj set 1 1] expr {1 * $x} @@ -303,7 +303,7 @@ test execute-3.35 {TclExecuteByteCode, INST_MULT, op2 is string double} {testobj test execute-3.36 {TclExecuteByteCode, INST_MULT, op2 is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {1 * $x}} msg] $msg -} {1 {can't use non-numeric string "foo" as operand of "*"}} +} {1 {can't use non-numeric string as operand of "*"}} # INST_DIV is partially tested: test execute-3.37 {TclExecuteByteCode, INST_DIV, op1 is int} {testobj} { @@ -330,7 +330,7 @@ test execute-3.41 {TclExecuteByteCode, INST_DIV, op1 is string double} {testobj} test execute-3.42 {TclExecuteByteCode, INST_DIV, op1 is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {$x / 1}} msg] $msg -} {1 {can't use non-numeric string "foo" as operand of "/"}} +} {1 {can't use non-numeric string as operand of "/"}} test execute-3.43 {TclExecuteByteCode, INST_DIV, op2 is int} {testobj} { set x [testintobj set 1 1] expr {2 / $x} @@ -355,7 +355,7 @@ test execute-3.47 {TclExecuteByteCode, INST_DIV, op2 is string double} {testobj} test execute-3.48 {TclExecuteByteCode, INST_DIV, op2 is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {1 / $x}} msg] $msg -} {1 {can't use non-numeric string "foo" as operand of "/"}} +} {1 {can't use non-numeric string as operand of "/"}} # INST_UPLUS is partially tested: test execute-3.49 {TclExecuteByteCode, INST_UPLUS, op is int} {testobj} { @@ -382,7 +382,7 @@ test execute-3.53 {TclExecuteByteCode, INST_UPLUS, op is string double} {testobj test execute-3.54 {TclExecuteByteCode, INST_UPLUS, op is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {+ $x}} msg] $msg -} {1 {can't use non-numeric string "foo" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} # INST_UMINUS is partially tested: test execute-3.55 {TclExecuteByteCode, INST_UMINUS, op is int} {testobj} { @@ -409,7 +409,7 @@ test execute-3.59 {TclExecuteByteCode, INST_UMINUS, op is string double} {testob test execute-3.60 {TclExecuteByteCode, INST_UMINUS, op is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {- $x}} msg] $msg -} {1 {can't use non-numeric string "foo" as operand of "-"}} +} {1 {can't use non-numeric string as operand of "-"}} # INST_LNOT is partially tested: test execute-3.61 {TclExecuteByteCode, INST_LNOT, op is int} {testobj} { @@ -457,7 +457,7 @@ test execute-3.70 {TclExecuteByteCode, INST_LNOT, op is string double} {testobj} test execute-3.71 {TclExecuteByteCode, INST_LNOT, op is non-numeric} {testobj} { set x [teststringobj set 1 foo] list [catch {expr {! $x}} msg] $msg -} {1 {can't use non-numeric string "foo" as operand of "!"}} +} {1 {can't use non-numeric string as operand of "!"}} # INST_BITNOT not tested # INST_CALL_BUILTIN_FUNC1 not tested diff --git a/tests/expr-old.test b/tests/expr-old.test index ed0f11f..4f3cb2e 100644 --- a/tests/expr-old.test +++ b/tests/expr-old.test @@ -26,6 +26,12 @@ testConstraint testexprdouble [llength [info commands testexprdouble]] testConstraint testexprstring [llength [info commands testexprstring]] testConstraint longIs32bit [expr {int(0x80000000) < 0}] +if {[catch {expr T1()} msg] && $msg eq {invalid command name "tcl::mathfunc::T1"}} { + testConstraint testmathfunctions 0 +} else { + testConstraint testmathfunctions 1 +} + # Big test for correct ordering of data in [expr] proc testIEEE {} { @@ -193,34 +199,34 @@ test expr-old-2.38 {floating-point operators} { test expr-old-3.1 {illegal floating-point operations} { list [catch {expr ~4.0} msg] $msg -} {1 {can't use floating-point value "4.0" as operand of "~"}} +} {1 {can't use floating-point value as operand of "~"}} test expr-old-3.2 {illegal floating-point operations} { list [catch {expr 27%4.0} msg] $msg -} {1 {can't use floating-point value "4.0" as operand of "%"}} +} {1 {can't use floating-point value as operand of "%"}} test expr-old-3.3 {illegal floating-point operations} { list [catch {expr 27.0%4} msg] $msg -} {1 {can't use floating-point value "27.0" as operand of "%"}} +} {1 {can't use floating-point value as operand of "%"}} test expr-old-3.4 {illegal floating-point operations} { list [catch {expr 1.0<<3} msg] $msg -} {1 {can't use floating-point value "1.0" as operand of "<<"}} +} {1 {can't use floating-point value as operand of "<<"}} test expr-old-3.5 {illegal floating-point operations} { list [catch {expr 3<<1.0} msg] $msg -} {1 {can't use floating-point value "1.0" as operand of "<<"}} +} {1 {can't use floating-point value as operand of "<<"}} test expr-old-3.6 {illegal floating-point operations} { list [catch {expr 24.0>>3} msg] $msg -} {1 {can't use floating-point value "24.0" as operand of ">>"}} +} {1 {can't use floating-point value as operand of ">>"}} test expr-old-3.7 {illegal floating-point operations} { list [catch {expr 24>>3.0} msg] $msg -} {1 {can't use floating-point value "3.0" as operand of ">>"}} +} {1 {can't use floating-point value as operand of ">>"}} test expr-old-3.8 {illegal floating-point operations} { list [catch {expr 24&3.0} msg] $msg -} {1 {can't use floating-point value "3.0" as operand of "&"}} +} {1 {can't use floating-point value as operand of "&"}} test expr-old-3.9 {illegal floating-point operations} { list [catch {expr 24.0|3} msg] $msg -} {1 {can't use floating-point value "24.0" as operand of "|"}} +} {1 {can't use floating-point value as operand of "|"}} test expr-old-3.10 {illegal floating-point operations} { list [catch {expr 24.0^3} msg] $msg -} {1 {can't use floating-point value "24.0" as operand of "^"}} +} {1 {can't use floating-point value as operand of "^"}} # Check the string operators individually. @@ -261,46 +267,46 @@ test expr-old-4.32 {string operators} {expr {0?"foo":"bar"}} bar test expr-old-5.1 {illegal string operations} { list [catch {expr {-"a"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "-"}} +} {1 {can't use non-numeric string as operand of "-"}} test expr-old-5.2 {illegal string operations} { list [catch {expr {+"a"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} test expr-old-5.3 {illegal string operations} { list [catch {expr {~"a"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "~"}} +} {1 {can't use non-numeric string as operand of "~"}} test expr-old-5.4 {illegal string operations} { list [catch {expr {!"a"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "!"}} +} {1 {can't use non-numeric string as operand of "!"}} test expr-old-5.5 {illegal string operations} { list [catch {expr {"a"*"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "*"}} +} {1 {can't use non-numeric string as operand of "*"}} test expr-old-5.6 {illegal string operations} { list [catch {expr {"a"/"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "/"}} +} {1 {can't use non-numeric string as operand of "/"}} test expr-old-5.7 {illegal string operations} { list [catch {expr {"a"%"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "%"}} +} {1 {can't use non-numeric string as operand of "%"}} test expr-old-5.8 {illegal string operations} { list [catch {expr {"a"+"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} test expr-old-5.9 {illegal string operations} { list [catch {expr {"a"-"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "-"}} +} {1 {can't use non-numeric string as operand of "-"}} test expr-old-5.10 {illegal string operations} { list [catch {expr {"a"<<"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "<<"}} +} {1 {can't use non-numeric string as operand of "<<"}} test expr-old-5.11 {illegal string operations} { list [catch {expr {"a">>"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of ">>"}} +} {1 {can't use non-numeric string as operand of ">>"}} test expr-old-5.12 {illegal string operations} { list [catch {expr {"a"&"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "&"}} +} {1 {can't use non-numeric string as operand of "&"}} test expr-old-5.13 {illegal string operations} { list [catch {expr {"a"^"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "^"}} +} {1 {can't use non-numeric string as operand of "^"}} test expr-old-5.14 {illegal string operations} { list [catch {expr {"a"|"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "|"}} +} {1 {can't use non-numeric string as operand of "|"}} test expr-old-5.15 {illegal string operations} { list [catch {expr {"a"&&"b"}} msg] $msg } {1 {expected boolean value but got "a"}} @@ -489,7 +495,7 @@ test expr-old-25.20 {type conversions} {expr 10.0} 10.0 test expr-old-26.1 {error conditions} { list [catch {expr 2+"a"} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} test expr-old-26.2 {error conditions} -body { expr 2+4* } -returnCodes error -match glob -result * @@ -503,10 +509,10 @@ test expr-old-26.4 {error conditions} { set a xx test expr-old-26.5 {error conditions} { list [catch {expr {2+$a}} msg] $msg -} {1 {can't use non-numeric string "xx" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} test expr-old-26.6 {error conditions} { list [catch {expr {2+[set a]}} msg] $msg -} {1 {can't use non-numeric string "xx" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} test expr-old-26.7 {error conditions} -body { expr {2+(4} } -returnCodes error -match glob -result * @@ -530,7 +536,7 @@ test expr-old-26.12 {error conditions} -body { } -returnCodes error -match glob -result * test expr-old-26.13 {error conditions} { list [catch {expr {"a"/"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "/"}} +} {1 {can't use non-numeric string as operand of "/"}} test expr-old-26.14 {error conditions} -body { expr 2:3 } -returnCodes error -match glob -result * @@ -843,6 +849,12 @@ test expr-old-32.41 {math functions in expressions} { test expr-old-32.42 {math functions in expressions} { list [catch {expr hypot(5*.8,3)} msg] $msg } {0 5.0} +test expr-old-32.43 {math functions in expressions} testmathfunctions { + expr 2*T1() +} 246 +test expr-old-32.44 {math functions in expressions} testmathfunctions { + expr T2()*3 +} 1035 test expr-old-32.45 {math functions in expressions} { expr (0 <= rand()) && (rand() < 1) } {1} @@ -942,6 +954,10 @@ test expr-old-34.15 {errors in math functions} { test expr-old-34.16 {errors in math functions} { expr round(-1.0e30) } -1000000000000000019884624838656 +test expr-old-34.17 {errors in math functions} -constraints testmathfunctions \ + -body { + list [catch {expr T1(4)} msg] $msg + } -match glob -result {1 {too many arguments for math function*}} test expr-old-36.1 {ExprLooksLikeInt procedure} -body { expr 0o289 @@ -949,7 +965,7 @@ test expr-old-36.1 {ExprLooksLikeInt procedure} -body { test expr-old-36.2 {ExprLooksLikeInt procedure} { set x 0o289 list [catch {expr {$x+1}} msg] $msg -} {1 {can't use non-numeric string "0o289" as operand of "+"}} +} {1 {can't use invalid octal number as operand of "+"}} test expr-old-36.3 {ExprLooksLikeInt procedure} { list [catch {expr 0289.1} msg] $msg } {0 289.1} @@ -989,11 +1005,11 @@ test expr-old-36.11 {ExprLooksLikeInt procedure} { test expr-old-36.12 {ExprLooksLikeInt procedure} { set x "10;" list [catch {expr {$x+1}} msg] $msg -} {1 {can't use non-numeric string "10;" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} test expr-old-36.13 {ExprLooksLikeInt procedure} { set x " +" list [catch {expr {$x+1}} msg] $msg -} {1 {can't use non-numeric string " +" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} test expr-old-36.14 {ExprLooksLikeInt procedure} { set x "123456789012345678901234567890 " expr {$x+1} @@ -1001,7 +1017,7 @@ test expr-old-36.14 {ExprLooksLikeInt procedure} { test expr-old-36.15 {ExprLooksLikeInt procedure} { set x "0o99 " list [catch {expr {$x+1}} msg] $msg -} {1 {can't use non-numeric string "0o99 " as operand of "+"}} +} {1 {can't use invalid octal number as operand of "+"}} test expr-old-36.16 {ExprLooksLikeInt procedure} { set x " 0xffffffffffffffffffffffffffffffffffffff " expr {$x+1} diff --git a/tests/expr.test b/tests/expr.test index 29fb967..6ad7208 100644 --- a/tests/expr.test +++ b/tests/expr.test @@ -16,6 +16,11 @@ if {[lsearch [namespace children] ::tcltest] == -1} { } ::tcltest::loadTestedCommands +catch [list package require -exact Tcltest [info patchlevel]] + +testConstraint testmathfunctions [expr { + ([catch {expr T1()} msg] != 1) || ($msg ne {invalid command name "tcl::mathfunc::T1"}) +}] # Determine if "long int" type is a 32 bit number and if the wide # type is a 64 bit number on this machine. @@ -252,7 +257,7 @@ test expr-4.9 {CompileLorExpr: long lor arm} { } 1 test expr-4.10 {CompileLorExpr: error compiling ! operand} { list [catch {expr {!"a"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "!"}} +} {1 {can't use non-numeric string as operand of "!"}} test expr-4.11 {CompileLorExpr: error compiling land arms} { list [catch {expr {"a"||0}} msg] $msg } {1 {expected boolean value but got "a"}} @@ -299,10 +304,10 @@ test expr-6.8 {CompileBitXorExpr: error compiling bitxor arm} -body { } -returnCodes error -match glob -result * test expr-6.9 {CompileBitXorExpr: runtime error in bitxor arm} { list [catch {expr {24.0^3}} msg] $msg -} {1 {can't use floating-point value "24.0" as operand of "^"}} +} {1 {can't use floating-point value as operand of "^"}} test expr-6.10 {CompileBitXorExpr: runtime error in bitxor arm} { list [catch {expr {"a"^"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "^"}} +} {1 {can't use non-numeric string as operand of "^"}} test expr-7.1 {CompileBitAndExpr: just equality expr} {expr 3==2} 0 test expr-7.2 {CompileBitAndExpr: just equality expr} {expr 2.0==2} 1 @@ -323,10 +328,10 @@ test expr-7.11 {CompileBitAndExpr: error compiling bitand arm} -body { } -returnCodes error -match glob -result * test expr-7.12 {CompileBitAndExpr: runtime error in bitand arm} { list [catch {expr {24.0&3}} msg] $msg -} {1 {can't use floating-point value "24.0" as operand of "&"}} +} {1 {can't use floating-point value as operand of "&"}} test expr-7.13 {CompileBitAndExpr: runtime error in bitand arm} { list [catch {expr {"a"&"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "&"}} +} {1 {can't use non-numeric string as operand of "&"}} test expr-7.14 {CompileBitAndExpr: equality expr} {expr 3eq2} 0 test expr-7.18 {CompileBitAndExpr: equality expr} {expr {"abc" eq "abd"}} 0 test expr-7.20 {CompileBitAndExpr: error in equality expr} -body { @@ -451,10 +456,10 @@ test expr-10.9 {CompileShiftExpr: error compiling shift arm} -body { } -returnCodes error -match glob -result * test expr-10.10 {CompileShiftExpr: runtime error} { list [catch {expr {24.0>>43}} msg] $msg -} {1 {can't use floating-point value "24.0" as operand of ">>"}} +} {1 {can't use floating-point value as operand of ">>"}} test expr-10.11 {CompileShiftExpr: runtime error} { list [catch {expr {"a"<<"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "<<"}} +} {1 {can't use non-numeric string as operand of "<<"}} test expr-11.1 {CompileAddExpr: just multiply expr} {expr 4*-2} -8 test expr-11.2 {CompileAddExpr: just multiply expr} {expr 0xff%2} 1 @@ -473,10 +478,10 @@ test expr-11.9 {CompileAddExpr: error compiling add arm} -body { } -returnCodes error -match glob -result * test expr-11.10 {CompileAddExpr: runtime error} { list [catch {expr {24.0+"xx"}} msg] $msg -} {1 {can't use non-numeric string "xx" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} test expr-11.11 {CompileAddExpr: runtime error} { list [catch {expr {"a"-"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "-"}} +} {1 {can't use non-numeric string as operand of "-"}} test expr-11.12 {CompileAddExpr: runtime error} { list [catch {expr {3/0}} msg] $msg } {1 {divide by zero}} @@ -504,10 +509,10 @@ test expr-12.9 {CompileMultiplyExpr: error compiling multiply arm} -body { } -returnCodes error -match glob -result * test expr-12.10 {CompileMultiplyExpr: runtime error} { list [catch {expr {24.0*"xx"}} msg] $msg -} {1 {can't use non-numeric string "xx" as operand of "*"}} +} {1 {can't use non-numeric string as operand of "*"}} test expr-12.11 {CompileMultiplyExpr: runtime error} { list [catch {expr {"a"/"b"}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "/"}} +} {1 {can't use non-numeric string as operand of "/"}} test expr-13.1 {CompileUnaryExpr: unary exprs} {expr -0xff} -255 test expr-13.2 {CompileUnaryExpr: unary exprs} {expr +0o00123} 83 @@ -524,10 +529,10 @@ test expr-13.9 {CompileUnaryExpr: error compiling unary expr} -body { } -returnCodes error -match glob -result * test expr-13.10 {CompileUnaryExpr: runtime error} { list [catch {expr {~"xx"}} msg] $msg -} {1 {can't use non-numeric string "xx" as operand of "~"}} +} {1 {can't use non-numeric string as operand of "~"}} test expr-13.11 {CompileUnaryExpr: runtime error} { list [catch {expr ~4.0} msg] $msg -} {1 {can't use floating-point value "4.0" as operand of "~"}} +} {1 {can't use floating-point value as operand of "~"}} test expr-13.12 {CompileUnaryExpr: just primary expr} {expr 0x123} 291 test expr-13.13 {CompileUnaryExpr: just primary expr} { set a 27 @@ -680,6 +685,41 @@ test expr-15.5 {CompileMathFuncCall: too few arguments} -body { test expr-15.6 {CompileMathFuncCall: missing ')'} -body { expr sin(1 } -returnCodes error -match glob -result * +test expr-15.7 {CompileMathFuncCall: call registered math function} {testmathfunctions} { + expr 2*T1() +} 246 +test expr-15.8 {CompileMathFuncCall: call registered math function} {testmathfunctions} { + expr T2()*3 +} 1035 +test expr-15.9 {CompileMathFuncCall: call registered math function} {testmathfunctions} { + expr T3(21, 37) +} 37 +test expr-15.10 {CompileMathFuncCall: call registered math function} {testmathfunctions} { + expr T3(21.2, 37) +} 37.0 +test expr-15.11 {CompileMathFuncCall: call registered math function} {testmathfunctions} { + expr T3(-21.2, -17.5) +} -17.5 +test expr-15.12 {ExprCallMathFunc: call registered math function} {testmathfunctions} { + expr T3(21, wide(37)) +} 37 +test expr=15.13 {ExprCallMathFunc: call registered math function} {testmathfunctions} { + expr T3(wide(21), 37) +} 37 +test expr=15.14 {ExprCallMathFunc: call registered math function} {testmathfunctions} { + expr T3(wide(21), wide(37)) +} 37 +test expr-15.15 {ExprCallMathFunc: call registered math function} {testmathfunctions} { + expr T3(21.0, wide(37)) +} 37.0 +test expr-15.16 {ExprCallMathFunc: call registered math function} {testmathfunctions} { + expr T3(wide(21), 37.0) +} 37.0 +test expr-15.17 {ExprCallMathFunc: non-numeric arg} -constraints { + testmathfunctions +} -body { + expr T3(0,"a") +} -returnCodes error -result {argument to math function didn't have numeric value} test expr-16.1 {GetToken: checks whether integer token starting with "0x" (e.g., "0x$") is invalid} { @@ -804,15 +844,15 @@ test expr-21.13 {non-numeric boolean literals} -body { } -returnCodes error -match glob -result * test expr-21.14 {non-numeric boolean literals} { list [catch {expr !"truef"} err] $err -} {1 {can't use non-numeric string "truef" as operand of "!"}} +} {1 {can't use non-numeric string as operand of "!"}} test expr-21.15 {non-numeric boolean variables} { set v truef list [catch {expr {!$v}} err] $err -} {1 {can't use non-numeric string "truef" as operand of "!"}} +} {1 {can't use non-numeric string as operand of "!"}} test expr-21.16 {non-numeric boolean variables} { set v "true " list [catch {expr {!$v}} err] $err -} {1 {can't use non-numeric string "true " as operand of "!"}} +} {1 {can't use non-numeric string as operand of "!"}} test expr-21.17 {non-numeric boolean variables} { set v "tru" list [catch {expr {!$v}} err] $err @@ -832,23 +872,23 @@ test expr-21.20 {non-numeric boolean variables} { test expr-21.21 {non-numeric boolean variables} { set v "o" list [catch {expr {!$v}} err] $err -} {1 {can't use non-numeric string "o" as operand of "!"}} +} {1 {can't use non-numeric string as operand of "!"}} test expr-21.22 {non-numeric boolean variables} { set v "" list [catch {expr {!$v}} err] $err -} {1 {can't use non-numeric string "" as operand of "!"}} +} {1 {can't use empty string as operand of "!"}} # Test for non-numeric float handling. test expr-22.1 {non-numeric floats} { list [catch {expr {NaN + 1}} msg] $msg -} {1 {can't use non-numeric floating-point value "NaN" as operand of "+"}} +} {1 {can't use non-numeric floating-point value as operand of "+"}} test expr-22.2 {non-numeric floats} !ieeeFloatingPoint { list [catch {expr {Inf + 1}} msg] $msg } {1 {can't use infinite floating-point value as operand of "+"}} test expr-22.3 {non-numeric floats} { set nan NaN list [catch {expr {$nan + 1}} msg] $msg -} {1 {can't use non-numeric floating-point value "NaN" as operand of "+"}} +} {1 {can't use non-numeric floating-point value as operand of "+"}} test expr-22.4 {non-numeric floats} !ieeeFloatingPoint { set inf Inf list [catch {expr {$inf + 1}} msg] $msg @@ -861,7 +901,7 @@ test expr-22.6 {non-numeric floats} !ieeeFloatingPoint { } {1 {floating-point value too large to represent}} test expr-22.7 {non-numeric floats} { list [catch {expr {1 / NaN}} msg] $msg -} {1 {can't use non-numeric floating-point value "NaN" as operand of "/"}} +} {1 {can't use non-numeric floating-point value as operand of "/"}} test expr-22.8 {non-numeric floats} !ieeeFloatingPoint { list [catch {expr {1 / Inf}} msg] $msg } {1 {can't use infinite floating-point value as operand of "/"}} @@ -888,10 +928,10 @@ test expr-23.8 {CompileExponentialExpr: error compiling expo arm} -body { } -returnCodes error -match glob -result * test expr-23.9 {CompileExponentialExpr: runtime error} { list [catch {expr {24.0**"xx"}} msg] $msg -} {1 {can't use non-numeric string "xx" as operand of "**"}} +} {1 {can't use non-numeric string as operand of "**"}} test expr-23.10 {CompileExponentialExpr: runtime error} { list [catch {expr {"a"**2}} msg] $msg -} {1 {can't use non-numeric string "a" as operand of "**"}} +} {1 {can't use non-numeric string as operand of "**"}} test expr-23.11 {CompileExponentialExpr: runtime error} { list [catch {expr {0**-1}} msg] $msg } {1 {exponentiation of zero by negative power}} diff --git a/tests/fCmd.test b/tests/fCmd.test index 9fae2c5..325b374 100644 --- a/tests/fCmd.test +++ b/tests/fCmd.test @@ -745,12 +745,12 @@ test fCmd-7.4 {FileForceOption: bad option} -constraints {notRoot} -setup { } -result {bad option "-tf1": must be -force or --} test fCmd-7.5 {FileForceOption: multiple times through loop} -setup { cleanup -} -constraints {notRoot} -body { +} -constraints {notRoot} -returnCodes error -body { createfile -- createfile -force file delete -force -force -- -- -force glob -- -- -force -} -result {} +} -result {no files matched glob patterns "-- -force"} test fCmd-8.1 {FileBasename: basename of ~user: argc == 1 && *path == ~} \ -constraints {unix notRoot knownBug} -body { @@ -938,9 +938,9 @@ test fCmd-9.10 {file rename: comprehensive: file to new name and dir} -setup { testchmod 444 tf2 file rename tf1 [file join td1 tf3] file rename tf2 [file join td1 tf4] - list [glob tf*] [lsort [glob -directory td1 t*]] \ + list [catch {glob tf*}] [lsort [glob -directory td1 t*]] \ [file writable [file join td1 tf3]] [file writable [file join td1 tf4]] -} -result [subst {{} {[file join td1 tf3] [file join td1 tf4]} 1 0}] +} -result [subst {1 {[file join td1 tf3] [file join td1 tf4]} 1 0}] test fCmd-9.11 {file rename: comprehensive: dir to new name and dir} -setup { cleanup } -constraints {notRoot testchmod} -body { diff --git a/tests/fileName.test b/tests/fileName.test index 2dac0df..51f00d1 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -696,9 +696,9 @@ test filename-10.24 {Tcl_TranslateFileName} -body { testtranslatefilename ~ouster/foo } -result {/home/ouster/foo} -constraints {nonPortable testtranslatefilename} -test filename-11.1 {Tcl_GlobCmd} -body { +test filename-11.1 {Tcl_GlobCmd} -returnCodes error -body { glob -} -result {} +} -result {no files matched glob patterns ""} test filename-11.2 {Tcl_GlobCmd} -returnCodes error -body { glob -gorp } -result {bad option "-gorp": must be -directory, -join, -nocomplain, -path, -tails, -types, or --} @@ -714,9 +714,9 @@ test filename-11.5 {Tcl_GlobCmd} -returnCodes error -body { test filename-11.6 {Tcl_GlobCmd} -returnCodes error -body { glob ~xyqrszzz } -result {user "xyqrszzz" doesn't exist} -test filename-11.7 {Tcl_GlobCmd} -body { +test filename-11.7 {Tcl_GlobCmd} -returnCodes error -body { glob -- -nocomplain -} -result {} +} -result {no files matched glob pattern "-nocomplain"} test filename-11.8 {Tcl_GlobCmd} -body { glob -nocomplain -- -nocomplain } -result {} @@ -1085,7 +1085,7 @@ test filename-12.1 {simple globbing} {unixOrPc} { } {.} test filename-12.1.1 {simple globbing} -constraints {unixOrPc} -body { glob -types f {} -} -result {} +} -returnCodes error -result {no files matched glob pattern ""} test filename-12.1.2 {simple globbing} {unixOrPc} { glob -types d {} } {.} @@ -1247,10 +1247,10 @@ test filename-14.20 {asterisks, question marks, and brackets} { } {} test filename-14.21 {asterisks, question marks, and brackets} -body { glob globTest/*/gorp -} -result {} +} -returnCodes error -result {no files matched glob pattern "globTest/*/gorp"} test filename-14.22 {asterisks, question marks, and brackets} -body { glob goo/* x*z foo?q -} -result {} +} -returnCodes error -result {no files matched glob patterns "goo/* x*z foo?q"} test filename-14.23 {slash globbing} {unix} { glob / } / diff --git a/tests/httpd11.tcl b/tests/httpd11.tcl index 9d0650e..9c543dc 100644 --- a/tests/httpd11.tcl +++ b/tests/httpd11.tcl @@ -8,7 +8,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -package require Tcl 8.6- +package require Tcl 8.6 proc ::tcl::dict::get? {dict key} { if {[dict exists $dict $key]} { diff --git a/tests/lindex.test b/tests/lindex.test index 81f5c40..b86e2e0 100644 --- a/tests/lindex.test +++ b/tests/lindex.test @@ -70,11 +70,11 @@ test lindex-3.4 {integer 3} testevalex { test lindex-3.5 {bad octal} -constraints testevalex -body { set x 0o8 list [catch { testevalex {lindex {a b c} $x} } result] $result -} -match glob -result {1 {*}} +} -match glob -result {1 {*invalid octal number*}} test lindex-3.6 {bad octal} -constraints testevalex -body { set x -0o9 list [catch { testevalex {lindex {a b c} $x} } result] $result -} -match glob -result {1 {*}} +} -match glob -result {1 {*invalid octal number*}} test lindex-3.7 {indexes don't shimmer wide ints} { set x [expr {(wide(1)<<31) - 2}] list $x [lindex {1 2 3} $x] [incr x] [incr x] @@ -105,11 +105,11 @@ test lindex-4.5 {index = end-3} testevalex { test lindex-4.6 {bad octal} -constraints testevalex -body { set x end-0o8 list [catch { testevalex {lindex {a b c} $x} } result] $result -} -match glob -result {1 {*}} +} -match glob -result {1 {*invalid octal number*}} test lindex-4.7 {bad octal} -constraints testevalex -body { set x end--0o9 list [catch { testevalex {lindex {a b c} $x} } result] $result -} -match glob -result {1 {*}} +} -match glob -result {1 {*invalid octal number*}} test lindex-4.8 {bad integer, not octal} testevalex { set x end-0a2 list [catch { testevalex {lindex {a b c} $x} } result] $result @@ -261,11 +261,11 @@ test lindex-11.4 {integer 3} { test lindex-11.5 {bad octal} -body { set x 0o8 list [catch { lindex {a b c} $x } result] $result -} -match glob -result {1 {*}} +} -match glob -result {1 {*invalid octal number*}} test lindex-11.6 {bad octal} -body { set x -0o9 list [catch { lindex {a b c} $x } result] $result -} -match glob -result {1 {*}} +} -match glob -result {1 {*invalid octal number*}} # Indices relative to end @@ -307,11 +307,11 @@ test lindex-12.5 {index = end-3} { test lindex-12.6 {bad octal} -body { set x end-0o8 list [catch { lindex {a b c} $x } result] $result -} -match glob -result {1 {*}} +} -match glob -result {1 {*invalid octal number*}} test lindex-12.7 {bad octal} -body { set x end--0o9 list [catch { lindex {a b c} $x } result] $result -} -match glob -result {1 {*}} +} -match glob -result {1 {*invalid octal number*}} test lindex-12.8 {bad integer, not octal} { set x end-0a2 list [catch { lindex {a b c} $x } result] $result diff --git a/tests/main.test b/tests/main.test index 7fd9d73..f1dc7fd 100644 --- a/tests/main.test +++ b/tests/main.test @@ -16,7 +16,7 @@ namespace eval ::tcl::test::main { # - tests use testing commands introduced in Tcltest 8.4 testConstraint Tcltest [expr { [llength [package provide Tcltest]] - && [package vsatisfies [package provide Tcltest] 8.4-]}] + && [package vsatisfies [package provide Tcltest] 8.4]}] # Procedure to simulate interactive typing of commands, line by line proc type {chan script} { diff --git a/tests/mathop.test b/tests/mathop.test index 0808d42..f122b7b 100644 --- a/tests/mathop.test +++ b/tests/mathop.test @@ -114,22 +114,22 @@ namespace eval ::testmathop { test mathop-1.10 {compiled +} { + 1 2 3000000000000000000000 } 3000000000000000000003 test mathop-1.11 {compiled +: errors} -returnCodes error -body { + x 0 - } -result {can't use non-numeric string "x" as operand of "+"} + } -result {can't use non-numeric string as operand of "+"} test mathop-1.12 {compiled +: errors} -returnCodes error -body { + nan 0 - } -result {can't use non-numeric floating-point value "nan" as operand of "+"} + } -result {can't use non-numeric floating-point value as operand of "+"} test mathop-1.13 {compiled +: errors} -returnCodes error -body { + 0 x - } -result {can't use non-numeric string "x" as operand of "+"} + } -result {can't use non-numeric string as operand of "+"} test mathop-1.14 {compiled +: errors} -returnCodes error -body { + 0 nan - } -result {can't use non-numeric floating-point value "nan" as operand of "+"} + } -result {can't use non-numeric floating-point value as operand of "+"} test mathop-1.15 {compiled +: errors} -returnCodes error -body { + 0o8 0 - } -result {can't use non-numeric string "0o8" as operand of "+"} + } -result {can't use invalid octal number as operand of "+"} test mathop-1.16 {compiled +: errors} -returnCodes error -body { + 0 0o8 - } -result {can't use non-numeric string "0o8" as operand of "+"} + } -result {can't use invalid octal number as operand of "+"} test mathop-1.17 {compiled +: errors} -returnCodes error -body { + 0 [error expectedError] } -result expectedError @@ -152,22 +152,22 @@ namespace eval ::testmathop { test mathop-1.28 {interpreted +} { $op 1 2 3000000000000000000000 } 3000000000000000000003 test mathop-1.29 {interpreted +: errors} -returnCodes error -body { $op x 0 - } -result {can't use non-numeric string "x" as operand of "+"} + } -result {can't use non-numeric string as operand of "+"} test mathop-1.30 {interpreted +: errors} -returnCodes error -body { $op nan 0 - } -result {can't use non-numeric floating-point value "nan" as operand of "+"} + } -result {can't use non-numeric floating-point value as operand of "+"} test mathop-1.31 {interpreted +: errors} -returnCodes error -body { $op 0 x - } -result {can't use non-numeric string "x" as operand of "+"} + } -result {can't use non-numeric string as operand of "+"} test mathop-1.32 {interpreted +: errors} -returnCodes error -body { $op 0 nan - } -result {can't use non-numeric floating-point value "nan" as operand of "+"} + } -result {can't use non-numeric floating-point value as operand of "+"} test mathop-1.33 {interpreted +: errors} -returnCodes error -body { $op 0o8 0 - } -result {can't use non-numeric string "0o8" as operand of "+"} + } -result {can't use invalid octal number as operand of "+"} test mathop-1.34 {interpreted +: errors} -returnCodes error -body { $op 0 0o8 - } -result {can't use non-numeric string "0o8" as operand of "+"} + } -result {can't use invalid octal number as operand of "+"} test mathop-1.35 {interpreted +: errors} -returnCodes error -body { $op 0 [error expectedError] } -result expectedError @@ -189,22 +189,22 @@ namespace eval ::testmathop { test mathop-2.10 {compiled *} { * 1 2 3000000000000000000000 } 6000000000000000000000 test mathop-2.11 {compiled *: errors} -returnCodes error -body { * x 0 - } -result {can't use non-numeric string "x" as operand of "*"} + } -result {can't use non-numeric string as operand of "*"} test mathop-2.12 {compiled *: errors} -returnCodes error -body { * nan 0 - } -result {can't use non-numeric floating-point value "nan" as operand of "*"} + } -result {can't use non-numeric floating-point value as operand of "*"} test mathop-2.13 {compiled *: errors} -returnCodes error -body { * 0 x - } -result {can't use non-numeric string "x" as operand of "*"} + } -result {can't use non-numeric string as operand of "*"} test mathop-2.14 {compiled *: errors} -returnCodes error -body { * 0 nan - } -result {can't use non-numeric floating-point value "nan" as operand of "*"} + } -result {can't use non-numeric floating-point value as operand of "*"} test mathop-2.15 {compiled *: errors} -returnCodes error -body { * 0o8 0 - } -result {can't use non-numeric string "0o8" as operand of "*"} + } -result {can't use invalid octal number as operand of "*"} test mathop-2.16 {compiled *: errors} -returnCodes error -body { * 0 0o8 - } -result {can't use non-numeric string "0o8" as operand of "*"} + } -result {can't use invalid octal number as operand of "*"} test mathop-2.17 {compiled *: errors} -returnCodes error -body { * 0 [error expectedError] } -result expectedError @@ -227,22 +227,22 @@ namespace eval ::testmathop { test mathop-2.28 {interpreted *} { $op 1 2 3000000000000000000000 } 6000000000000000000000 test mathop-2.29 {interpreted *: errors} -returnCodes error -body { $op x 0 - } -result {can't use non-numeric string "x" as operand of "*"} + } -result {can't use non-numeric string as operand of "*"} test mathop-2.30 {interpreted *: errors} -returnCodes error -body { $op nan 0 - } -result {can't use non-numeric floating-point value "nan" as operand of "*"} + } -result {can't use non-numeric floating-point value as operand of "*"} test mathop-2.31 {interpreted *: errors} -returnCodes error -body { $op 0 x - } -result {can't use non-numeric string "x" as operand of "*"} + } -result {can't use non-numeric string as operand of "*"} test mathop-2.32 {interpreted *: errors} -returnCodes error -body { $op 0 nan - } -result {can't use non-numeric floating-point value "nan" as operand of "*"} + } -result {can't use non-numeric floating-point value as operand of "*"} test mathop-2.33 {interpreted *: errors} -returnCodes error -body { $op 0o8 0 - } -result {can't use non-numeric string "0o8" as operand of "*"} + } -result {can't use invalid octal number as operand of "*"} test mathop-2.34 {interpreted *: errors} -returnCodes error -body { $op 0 0o8 - } -result {can't use non-numeric string "0o8" as operand of "*"} + } -result {can't use invalid octal number as operand of "*"} test mathop-2.35 {interpreted *: errors} -returnCodes error -body { $op 0 [error expectedError] } -result expectedError @@ -261,7 +261,7 @@ namespace eval ::testmathop { test mathop-3.7 {compiled !} {! 10000000000000000000000000} 0 test mathop-3.8 {compiled !: errors} -body { ! foobar - } -returnCodes error -result {can't use non-numeric string "foobar" as operand of "!"} + } -returnCodes error -result {can't use non-numeric string as operand of "!"} test mathop-3.9 {compiled !: errors} -body { ! 0 0 } -returnCodes error -result "wrong # args: should be \"! boolean\"" @@ -278,7 +278,7 @@ namespace eval ::testmathop { test mathop-3.17 {interpreted !} {$op 10000000000000000000000000} 0 test mathop-3.18 {interpreted !: errors} -body { $op foobar - } -returnCodes error -result {can't use non-numeric string "foobar" as operand of "!"} + } -returnCodes error -result {can't use non-numeric string as operand of "!"} test mathop-3.19 {interpreted !: errors} -body { $op 0 0 } -returnCodes error -result "wrong # args: should be \"! boolean\"" @@ -287,10 +287,10 @@ namespace eval ::testmathop { } -returnCodes error -result "wrong # args: should be \"! boolean\"" test mathop-3.21 {compiled !: error} -returnCodes error -body { ! NaN - } -result {can't use non-numeric floating-point value "NaN" as operand of "!"} + } -result {can't use non-numeric floating-point value as operand of "!"} test mathop-3.22 {interpreted !: error} -returnCodes error -body { $op NaN - } -result {can't use non-numeric floating-point value "NaN" as operand of "!"} + } -result {can't use non-numeric floating-point value as operand of "!"} test mathop-4.1 {compiled ~} {~ 0} -1 test mathop-4.2 {compiled ~} {~ 1} -2 @@ -301,7 +301,7 @@ namespace eval ::testmathop { test mathop-4.7 {compiled ~} {~ 10000000000000000000000000} -10000000000000000000000001 test mathop-4.8 {compiled ~: errors} -body { ~ foobar - } -returnCodes error -result {can't use non-numeric string "foobar" as operand of "~"} + } -returnCodes error -result {can't use non-numeric string as operand of "~"} test mathop-4.9 {compiled ~: errors} -body { ~ 0 0 } -returnCodes error -result "wrong # args: should be \"~ integer\"" @@ -310,10 +310,10 @@ namespace eval ::testmathop { } -returnCodes error -result "wrong # args: should be \"~ integer\"" test mathop-4.11 {compiled ~: errors} -returnCodes error -body { ~ 0.0 - } -result {can't use floating-point value "0.0" as operand of "~"} + } -result {can't use floating-point value as operand of "~"} test mathop-4.12 {compiled ~: errors} -returnCodes error -body { ~ NaN - } -result {can't use non-numeric floating-point value "NaN" as operand of "~"} + } -result {can't use non-numeric floating-point value as operand of "~"} set op ~ test mathop-4.13 {interpreted ~} {$op 0} -1 test mathop-4.14 {interpreted ~} {$op 1} -2 @@ -324,7 +324,7 @@ namespace eval ::testmathop { test mathop-4.19 {interpreted ~} {$op 10000000000000000000000000} -10000000000000000000000001 test mathop-4.20 {interpreted ~: errors} -body { $op foobar - } -returnCodes error -result {can't use non-numeric string "foobar" as operand of "~"} + } -returnCodes error -result {can't use non-numeric string as operand of "~"} test mathop-4.21 {interpreted ~: errors} -body { $op 0 0 } -returnCodes error -result "wrong # args: should be \"~ integer\"" @@ -333,10 +333,10 @@ namespace eval ::testmathop { } -returnCodes error -result "wrong # args: should be \"~ integer\"" test mathop-4.23 {interpreted ~: errors} -returnCodes error -body { $op 0.0 - } -result {can't use floating-point value "0.0" as operand of "~"} + } -result {can't use floating-point value as operand of "~"} test mathop-4.24 {interpreted ~: errors} -returnCodes error -body { $op NaN - } -result {can't use non-numeric floating-point value "NaN" as operand of "~"} + } -result {can't use non-numeric floating-point value as operand of "~"} test mathop-5.1 {compiled eq} {eq {} a} 0 test mathop-5.2 {compiled eq} {eq a a} 1 @@ -377,32 +377,32 @@ namespace eval ::testmathop { test mathop-6.4 {compiled &} { & 3 7 6 } 2 test mathop-6.5 {compiled &} -returnCodes error -body { & 1.0 2 3 - } -result {can't use floating-point value "1.0" as operand of "&"} + } -result {can't use floating-point value as operand of "&"} test mathop-6.6 {compiled &} -returnCodes error -body { & 1 2 3.0 - } -result {can't use floating-point value "3.0" as operand of "&"} + } -result {can't use floating-point value as operand of "&"} test mathop-6.7 {compiled &} { & 100000000002 18 -126 } 2 test mathop-6.8 {compiled &} { & 0xff 0o377 333333333333 } 85 test mathop-6.9 {compiled &} { & 1000000000000000000002 18 -126 } 2 test mathop-6.10 {compiled &} { & 0xff 0o377 3333333333333333333333 } 85 test mathop-6.11 {compiled &: errors} -returnCodes error -body { & x 0 - } -result {can't use non-numeric string "x" as operand of "&"} + } -result {can't use non-numeric string as operand of "&"} test mathop-6.12 {compiled &: errors} -returnCodes error -body { & nan 0 - } -result {can't use non-numeric floating-point value "nan" as operand of "&"} + } -result {can't use non-numeric floating-point value as operand of "&"} test mathop-6.13 {compiled &: errors} -returnCodes error -body { & 0 x - } -result {can't use non-numeric string "x" as operand of "&"} + } -result {can't use non-numeric string as operand of "&"} test mathop-6.14 {compiled &: errors} -returnCodes error -body { & 0 nan - } -result {can't use non-numeric floating-point value "nan" as operand of "&"} + } -result {can't use non-numeric floating-point value as operand of "&"} test mathop-6.15 {compiled &: errors} -returnCodes error -body { & 0o8 0 - } -result {can't use non-numeric string "0o8" as operand of "&"} + } -result {can't use invalid octal number as operand of "&"} test mathop-6.16 {compiled &: errors} -returnCodes error -body { & 0 0o8 - } -result {can't use non-numeric string "0o8" as operand of "&"} + } -result {can't use invalid octal number as operand of "&"} test mathop-6.17 {compiled &: errors} -returnCodes error -body { & 0 [error expectedError] } -result expectedError @@ -419,32 +419,32 @@ namespace eval ::testmathop { test mathop-6.22 {interpreted &} { $op 3 7 6 } 2 test mathop-6.23 {interpreted &} -returnCodes error -body { $op 1.0 2 3 - } -result {can't use floating-point value "1.0" as operand of "&"} + } -result {can't use floating-point value as operand of "&"} test mathop-6.24 {interpreted &} -returnCodes error -body { $op 1 2 3.0 - } -result {can't use floating-point value "3.0" as operand of "&"} + } -result {can't use floating-point value as operand of "&"} test mathop-6.25 {interpreted &} { $op 100000000002 18 -126 } 2 test mathop-6.26 {interpreted &} { $op 0xff 0o377 333333333333 } 85 test mathop-6.27 {interpreted &} { $op 1000000000000000000002 18 -126 } 2 test mathop-6.28 {interpreted &} { $op 0xff 0o377 3333333333333333333333 } 85 test mathop-6.29 {interpreted &: errors} -returnCodes error -body { $op x 0 - } -result {can't use non-numeric string "x" as operand of "&"} + } -result {can't use non-numeric string as operand of "&"} test mathop-6.30 {interpreted &: errors} -returnCodes error -body { $op nan 0 - } -result {can't use non-numeric floating-point value "nan" as operand of "&"} + } -result {can't use non-numeric floating-point value as operand of "&"} test mathop-6.31 {interpreted &: errors} -returnCodes error -body { $op 0 x - } -result {can't use non-numeric string "x" as operand of "&"} + } -result {can't use non-numeric string as operand of "&"} test mathop-6.32 {interpreted &: errors} -returnCodes error -body { $op 0 nan - } -result {can't use non-numeric floating-point value "nan" as operand of "&"} + } -result {can't use non-numeric floating-point value as operand of "&"} test mathop-6.33 {interpreted &: errors} -returnCodes error -body { $op 0o8 0 - } -result {can't use non-numeric string "0o8" as operand of "&"} + } -result {can't use invalid octal number as operand of "&"} test mathop-6.34 {interpreted &: errors} -returnCodes error -body { $op 0 0o8 - } -result {can't use non-numeric string "0o8" as operand of "&"} + } -result {can't use invalid octal number as operand of "&"} test mathop-6.35 {interpreted &: errors} -returnCodes error -body { $op 0 [error expectedError] } -result expectedError @@ -487,32 +487,32 @@ namespace eval ::testmathop { test mathop-7.4 {compiled |} { | 3 7 6 } 7 test mathop-7.5 {compiled |} -returnCodes error -body { | 1.0 2 3 - } -result {can't use floating-point value "1.0" as operand of "|"} + } -result {can't use floating-point value as operand of "|"} test mathop-7.6 {compiled |} -returnCodes error -body { | 1 2 3.0 - } -result {can't use floating-point value "3.0" as operand of "|"} + } -result {can't use floating-point value as operand of "|"} test mathop-7.7 {compiled |} { | 100000000002 18 -126 } -110 test mathop-7.8 {compiled |} { | 0xff 0o377 333333333333 } 333333333503 test mathop-7.9 {compiled |} { | 1000000000000000000002 18 -126 } -110 test mathop-7.10 {compiled |} { | 0xff 0o377 3333333333333333333333 } 3333333333333333333503 test mathop-7.11 {compiled |: errors} -returnCodes error -body { | x 0 - } -result {can't use non-numeric string "x" as operand of "|"} + } -result {can't use non-numeric string as operand of "|"} test mathop-7.12 {compiled |: errors} -returnCodes error -body { | nan 0 - } -result {can't use non-numeric floating-point value "nan" as operand of "|"} + } -result {can't use non-numeric floating-point value as operand of "|"} test mathop-7.13 {compiled |: errors} -returnCodes error -body { | 0 x - } -result {can't use non-numeric string "x" as operand of "|"} + } -result {can't use non-numeric string as operand of "|"} test mathop-7.14 {compiled |: errors} -returnCodes error -body { | 0 nan - } -result {can't use non-numeric floating-point value "nan" as operand of "|"} + } -result {can't use non-numeric floating-point value as operand of "|"} test mathop-7.15 {compiled |: errors} -returnCodes error -body { | 0o8 0 - } -result {can't use non-numeric string "0o8" as operand of "|"} + } -result {can't use invalid octal number as operand of "|"} test mathop-7.16 {compiled |: errors} -returnCodes error -body { | 0 0o8 - } -result {can't use non-numeric string "0o8" as operand of "|"} + } -result {can't use invalid octal number as operand of "|"} test mathop-7.17 {compiled |: errors} -returnCodes error -body { | 0 [error expectedError] } -result expectedError @@ -529,32 +529,32 @@ namespace eval ::testmathop { test mathop-7.22 {interpreted |} { $op 3 7 6 } 7 test mathop-7.23 {interpreted |} -returnCodes error -body { $op 1.0 2 3 - } -result {can't use floating-point value "1.0" as operand of "|"} + } -result {can't use floating-point value as operand of "|"} test mathop-7.24 {interpreted |} -returnCodes error -body { $op 1 2 3.0 - } -result {can't use floating-point value "3.0" as operand of "|"} + } -result {can't use floating-point value as operand of "|"} test mathop-7.25 {interpreted |} { $op 100000000002 18 -126 } -110 test mathop-7.26 {interpreted |} { $op 0xff 0o377 333333333333 } 333333333503 test mathop-7.27 {interpreted |} { $op 1000000000000000000002 18 -126 } -110 test mathop-7.28 {interpreted |} { $op 0xff 0o377 3333333333333333333333 } 3333333333333333333503 test mathop-7.29 {interpreted |: errors} -returnCodes error -body { $op x 0 - } -result {can't use non-numeric string "x" as operand of "|"} + } -result {can't use non-numeric string as operand of "|"} test mathop-7.30 {interpreted |: errors} -returnCodes error -body { $op nan 0 - } -result {can't use non-numeric floating-point value "nan" as operand of "|"} + } -result {can't use non-numeric floating-point value as operand of "|"} test mathop-7.31 {interpreted |: errors} -returnCodes error -body { $op 0 x - } -result {can't use non-numeric string "x" as operand of "|"} + } -result {can't use non-numeric string as operand of "|"} test mathop-7.32 {interpreted |: errors} -returnCodes error -body { $op 0 nan - } -result {can't use non-numeric floating-point value "nan" as operand of "|"} + } -result {can't use non-numeric floating-point value as operand of "|"} test mathop-7.33 {interpreted |: errors} -returnCodes error -body { $op 0o8 0 - } -result {can't use non-numeric string "0o8" as operand of "|"} + } -result {can't use invalid octal number as operand of "|"} test mathop-7.34 {interpreted |: errors} -returnCodes error -body { $op 0 0o8 - } -result {can't use non-numeric string "0o8" as operand of "|"} + } -result {can't use invalid octal number as operand of "|"} test mathop-7.35 {interpreted |: errors} -returnCodes error -body { $op 0 [error expectedError] } -result expectedError @@ -597,32 +597,32 @@ namespace eval ::testmathop { test mathop-8.4 {compiled ^} { ^ 3 7 6 } 2 test mathop-8.5 {compiled ^} -returnCodes error -body { ^ 1.0 2 3 - } -result {can't use floating-point value "1.0" as operand of "^"} + } -result {can't use floating-point value as operand of "^"} test mathop-8.6 {compiled ^} -returnCodes error -body { ^ 1 2 3.0 - } -result {can't use floating-point value "3.0" as operand of "^"} + } -result {can't use floating-point value as operand of "^"} test mathop-8.7 {compiled ^} { ^ 100000000002 18 -126 } -100000000110 test mathop-8.8 {compiled ^} { ^ 0xff 0o377 333333333333 } 333333333333 test mathop-8.9 {compiled ^} { ^ 1000000000000000000002 18 -126 } -1000000000000000000110 test mathop-8.10 {compiled ^} { ^ 0xff 0o377 3333333333333333333333 } 3333333333333333333333 test mathop-8.11 {compiled ^: errors} -returnCodes error -body { ^ x 0 - } -result {can't use non-numeric string "x" as operand of "^"} + } -result {can't use non-numeric string as operand of "^"} test mathop-8.12 {compiled ^: errors} -returnCodes error -body { ^ nan 0 - } -result {can't use non-numeric floating-point value "nan" as operand of "^"} + } -result {can't use non-numeric floating-point value as operand of "^"} test mathop-8.13 {compiled ^: errors} -returnCodes error -body { ^ 0 x - } -result {can't use non-numeric string "x" as operand of "^"} + } -result {can't use non-numeric string as operand of "^"} test mathop-8.14 {compiled ^: errors} -returnCodes error -body { ^ 0 nan - } -result {can't use non-numeric floating-point value "nan" as operand of "^"} + } -result {can't use non-numeric floating-point value as operand of "^"} test mathop-8.15 {compiled ^: errors} -returnCodes error -body { ^ 0o8 0 - } -result {can't use non-numeric string "0o8" as operand of "^"} + } -result {can't use invalid octal number as operand of "^"} test mathop-8.16 {compiled ^: errors} -returnCodes error -body { ^ 0 0o8 - } -result {can't use non-numeric string "0o8" as operand of "^"} + } -result {can't use invalid octal number as operand of "^"} test mathop-8.17 {compiled ^: errors} -returnCodes error -body { ^ 0 [error expectedError] } -result expectedError @@ -639,32 +639,32 @@ namespace eval ::testmathop { test mathop-8.22 {interpreted ^} { $op 3 7 6 } 2 test mathop-8.23 {interpreted ^} -returnCodes error -body { $op 1.0 2 3 - } -result {can't use floating-point value "1.0" as operand of "^"} + } -result {can't use floating-point value as operand of "^"} test mathop-8.24 {interpreted ^} -returnCodes error -body { $op 1 2 3.0 - } -result {can't use floating-point value "3.0" as operand of "^"} + } -result {can't use floating-point value as operand of "^"} test mathop-8.25 {interpreted ^} { $op 100000000002 18 -126 } -100000000110 test mathop-8.26 {interpreted ^} { $op 0xff 0o377 333333333333 } 333333333333 test mathop-8.27 {interpreted ^} { $op 1000000000000000000002 18 -126 } -1000000000000000000110 test mathop-8.28 {interpreted ^} { $op 0xff 0o377 3333333333333333333333 } 3333333333333333333333 test mathop-8.29 {interpreted ^: errors} -returnCodes error -body { $op x 0 - } -result {can't use non-numeric string "x" as operand of "^"} + } -result {can't use non-numeric string as operand of "^"} test mathop-8.30 {interpreted ^: errors} -returnCodes error -body { $op nan 0 - } -result {can't use non-numeric floating-point value "nan" as operand of "^"} + } -result {can't use non-numeric floating-point value as operand of "^"} test mathop-8.31 {interpreted ^: errors} -returnCodes error -body { $op 0 x - } -result {can't use non-numeric string "x" as operand of "^"} + } -result {can't use non-numeric string as operand of "^"} test mathop-8.32 {interpreted ^: errors} -returnCodes error -body { $op 0 nan - } -result {can't use non-numeric floating-point value "nan" as operand of "^"} + } -result {can't use non-numeric floating-point value as operand of "^"} test mathop-8.33 {interpreted ^: errors} -returnCodes error -body { $op 0o8 0 - } -result {can't use non-numeric string "0o8" as operand of "^"} + } -result {can't use invalid octal number as operand of "^"} test mathop-8.34 {interpreted ^: errors} -returnCodes error -body { $op 0 0o8 - } -result {can't use non-numeric string "0o8" as operand of "^"} + } -result {can't use invalid octal number as operand of "^"} test mathop-8.35 {interpreted ^: errors} -returnCodes error -body { $op 0 [error expectedError] } -result expectedError @@ -775,13 +775,13 @@ test mathop-20.6 { one arg, error } { # skipping - for now, knownbug... foreach op {+ * / & | ^ **} { lappend res [TestOp $op {*}$vals] - lappend exp "can't use non-numeric string \"x\" as operand of \"$op\"\ + lappend exp "can't use non-numeric string as operand of \"$op\"\ ARITH DOMAIN {non-numeric string}" } } foreach op {+ * / & | ^ **} { lappend res [TestOp $op NaN 1] - lappend exp "can't use non-numeric floating-point value \"NaN\" as operand of \"$op\"\ + lappend exp "can't use non-numeric floating-point value as operand of \"$op\"\ ARITH DOMAIN {non-numeric floating-point value}" } expr {$res eq $exp ? 0 : $res} @@ -850,15 +850,15 @@ test mathop-21.5 { unary ops, bad values } { set res {} set exp {} lappend res [TestOp / x] - lappend exp "can't use non-numeric string \"x\" as operand of \"/\" ARITH DOMAIN {non-numeric string}" + lappend exp "can't use non-numeric string as operand of \"/\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp - x] - lappend exp "can't use non-numeric string \"x\" as operand of \"-\" ARITH DOMAIN {non-numeric string}" + lappend exp "can't use non-numeric string as operand of \"-\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp ~ x] - lappend exp "can't use non-numeric string \"x\" as operand of \"~\" ARITH DOMAIN {non-numeric string}" + lappend exp "can't use non-numeric string as operand of \"~\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp ! x] - lappend exp "can't use non-numeric string \"x\" as operand of \"!\" ARITH DOMAIN {non-numeric string}" + lappend exp "can't use non-numeric string as operand of \"!\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp ~ 5.0] - lappend exp "can't use floating-point value \"5.0\" as operand of \"~\" ARITH DOMAIN {floating-point value}" + lappend exp "can't use floating-point value as operand of \"~\" ARITH DOMAIN {floating-point value}" expr {$res eq $exp ? 0 : $res} } 0 test mathop-21.6 { unary ops, too many } { @@ -965,9 +965,9 @@ test mathop-22.4 { unary ops, bad values } { set exp {} foreach op {& | ^} { lappend res [TestOp $op x 5] - lappend exp "can't use non-numeric string \"x\" as operand of \"$op\" ARITH DOMAIN {non-numeric string}" + lappend exp "can't use non-numeric string as operand of \"$op\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp $op 5 x] - lappend exp "can't use non-numeric string \"x\" as operand of \"$op\" ARITH DOMAIN {non-numeric string}" + lappend exp "can't use non-numeric string as operand of \"$op\" ARITH DOMAIN {non-numeric string}" } expr {$res eq $exp ? 0 : $res} } 0 @@ -1080,15 +1080,15 @@ test mathop-24.3 { binary ops, bad values } { set exp {} foreach op {% << >>} { lappend res [TestOp $op x 1] - lappend exp "can't use non-numeric string \"x\" as operand of \"$op\" ARITH DOMAIN {non-numeric string}" + lappend exp "can't use non-numeric string as operand of \"$op\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp $op 1 x] - lappend exp "can't use non-numeric string \"x\" as operand of \"$op\" ARITH DOMAIN {non-numeric string}" + lappend exp "can't use non-numeric string as operand of \"$op\" ARITH DOMAIN {non-numeric string}" } foreach op {% << >>} { lappend res [TestOp $op 5.0 1] - lappend exp "can't use floating-point value \"5.0\" as operand of \"$op\" ARITH DOMAIN {floating-point value}" + lappend exp "can't use floating-point value as operand of \"$op\" ARITH DOMAIN {floating-point value}" lappend res [TestOp $op 1 5.0] - lappend exp "can't use floating-point value \"5.0\" as operand of \"$op\" ARITH DOMAIN {floating-point value}" + lappend exp "can't use floating-point value as operand of \"$op\" ARITH DOMAIN {floating-point value}" } foreach op {in ni} { lappend res [TestOp $op 5 "a b \{ c"] @@ -1240,9 +1240,9 @@ test mathop-25.23 { exp operator errors } { lappend res [TestOp ** $huge 2.1] lappend exp "Inf" lappend res [TestOp ** 2 foo] - lappend exp "can't use non-numeric string \"foo\" as operand of \"**\" ARITH DOMAIN {non-numeric string}" + lappend exp "can't use non-numeric string as operand of \"**\" ARITH DOMAIN {non-numeric string}" lappend res [TestOp ** foo 2] - lappend exp "can't use non-numeric string \"foo\" as operand of \"**\" ARITH DOMAIN {non-numeric string}" + lappend exp "can't use non-numeric string as operand of \"**\" ARITH DOMAIN {non-numeric string}" expr {$res eq $exp ? 0 : $res} } 0 diff --git a/tests/msgcat.test b/tests/msgcat.test index 9fb565b..1522354 100644 --- a/tests/msgcat.test +++ b/tests/msgcat.test @@ -12,7 +12,7 @@ # Note that after running these tests, entries will be left behind in the # message catalogs for locales foo, foo_BAR, and foo_BAR_baz. -package require Tcl 8.2- +package require Tcl 8.2 if {[catch {package require tcltest 2}]} { puts stderr "Skipping tests in [info script]. tcltest 2 required." return diff --git a/tests/parseExpr.test b/tests/parseExpr.test index d667bf2..7910974 100644 --- a/tests/parseExpr.test +++ b/tests/parseExpr.test @@ -1045,8 +1045,9 @@ test parseExpr-22.13 {Bug 3401704} -constraints testexprparser -body { } -result {- {} 0 subexpr naner() 1 operator naner 0 {}} test parseExpr-22.14 {Bug 3401704} -constraints testexprparser -body { - testexprparser 08 -1 -} -result {- {} 0 subexpr 08 1 text 08 0 {}} + catch {testexprparser 08 -1} m o + dict get $o -errorcode +} -result {TCL PARSE EXPR BADNUMBER OCTAL} test parseExpr-22.15 {Bug 3401704} -constraints testexprparser -body { catch {testexprparser 0o8 -1} m o dict get $o -errorcode diff --git a/tests/safe.test b/tests/safe.test index 423e10e..4a2792e 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -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. -package require Tcl 8.5- +package require Tcl 8.5 if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 diff --git a/tests/string.test b/tests/string.test index e9e6e6d..f558d30 100644 --- a/tests/string.test +++ b/tests/string.test @@ -280,10 +280,10 @@ test string-5.16 {string index, bytearray object with string obj shimmering} { } 0 test string-5.17 {string index, bad integer} -body { list [catch {string index "abc" 0o8} msg] $msg -} -match glob -result {1 {*}} +} -match glob -result {1 {*invalid octal number*}} test string-5.18 {string index, bad integer} -body { list [catch {string index "abc" end-0o0289} msg] $msg -} -match glob -result {1 {*}} +} -match glob -result {1 {*invalid octal number*}} test string-5.19 {string index, bytearray object out of bounds} { string index [binary format I* {0x50515253 0x52}] -1 } {} diff --git a/tests/stringComp.test b/tests/stringComp.test index 210f431..9e00ce7 100644 --- a/tests/stringComp.test +++ b/tests/stringComp.test @@ -339,11 +339,11 @@ test stringComp-5.16 {string index, bytearray object with string obj shimmering} test stringComp-5.17 {string index, bad integer} -body { proc foo {} {string index "abc" 0o8} list [catch {foo} msg] $msg -} -match glob -result {1 {*}} +} -match glob -result {1 {*invalid octal number*}} test stringComp-5.18 {string index, bad integer} -body { proc foo {} {string index "abc" end-0o0289} list [catch {foo} msg] $msg -} -match glob -result {1 {*}} +} -match glob -result {1 {*invalid octal number*}} test stringComp-5.19 {string index, bytearray object out of bounds} { proc foo {} {string index [binary format I* {0x50515253 0x52}] -1} foo diff --git a/tests/tm.test b/tests/tm.test index 42352e9..149a65d 100644 --- a/tests/tm.test +++ b/tests/tm.test @@ -6,7 +6,7 @@ # Copyright (c) 2004 by Donal K. Fellows. # All rights reserved. -package require Tcl 8.5- +package require Tcl 8.5 if {"::tcltest" ni [namespace children]} { package require tcltest 2 namespace import -force ::tcltest::* @@ -202,11 +202,6 @@ proc genpaths {base} { set base [file normalize $base] foreach {major minor} [split [info tclversion] .] break set results {} - set base8 [file join $base tcl8] - lappend results [file join $base8 site-tcl] - for {set i 0} {$i <= 7} {incr i} { - lappend results [file join $base8 8.$i] - } set base [file join $base tcl$major] lappend results [file join $base site-tcl] for {set i 0} {$i <= $minor} {incr i} { diff --git a/tests/while-old.test b/tests/while-old.test index e33bd0b..ee17d0b 100644 --- a/tests/while-old.test +++ b/tests/while-old.test @@ -92,7 +92,7 @@ test while-old-4.3 {errors in while loops} { test while-old-4.4 {errors in while loops} { set err [catch {while {"a"+"b"} {error "loop aborted"}} msg] list $err $msg -} {1 {can't use non-numeric string "a" as operand of "+"}} +} {1 {can't use non-numeric string as operand of "+"}} test while-old-4.5 {errors in while loops} { catch {unset x} set x 1 diff --git a/tests/while.test b/tests/while.test index c25b404..642ec93 100644 --- a/tests/while.test +++ b/tests/while.test @@ -32,7 +32,7 @@ test while-1.2 {TclCompileWhileCmd: error in test expression} -body { } -match glob -result {*"while {$i<} break"} test while-1.3 {TclCompileWhileCmd: error in test expression} -body { while {"a"+"b"} {error "loop aborted"} -} -returnCodes error -result {can't use non-numeric string "a" as operand of "+"} +} -returnCodes error -result {can't use non-numeric string as operand of "+"} test while-1.4 {TclCompileWhileCmd: multiline test expr} -body { set value 1 while {($tcl_platform(platform) != "foobar1") && \ @@ -343,7 +343,7 @@ test while-4.3 {while (not compiled): error in test expression} -body { test while-4.4 {while (not compiled): error in test expression} -body { set z while $z {"a"+"b"} {error "loop aborted"} -} -returnCodes error -result {can't use non-numeric string "a" as operand of "+"} +} -returnCodes error -result {can't use non-numeric string as operand of "+"} test while-4.5 {while (not compiled): multiline test expr} -body { set value 1 set z while diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl index 6e49519..93e0a9a 100644 --- a/tools/genStubs.tcl +++ b/tools/genStubs.tcl @@ -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. -package require Tcl 8.4- +package require Tcl 8.4 namespace eval genStubs { # libraryName -- @@ -1135,7 +1135,6 @@ proc genStubs::init {} { variable outDir variable interfaces -variable scspec if {[llength $argv] < 2} { puts stderr "usage: $argv0 outDir declFile ?declFile...?" exit 1 diff --git a/tools/man2html.tcl b/tools/man2html.tcl index 124f631..fa57b03 100644 --- a/tools/man2html.tcl +++ b/tools/man2html.tcl @@ -2,7 +2,7 @@ # \ exec tclsh "$0" ${1+"$@"} -package require Tcl 8.4- +package require Tcl 8.4 # man2html.tcl -- # diff --git a/tools/man2html1.tcl b/tools/man2html1.tcl index 23a9e58..f2b2e43 100644 --- a/tools/man2html1.tcl +++ b/tools/man2html1.tcl @@ -5,7 +5,7 @@ # # Copyright (c) 1996 by Sun Microsystems, Inc. -package require Tcl 8.4- +package require Tcl 8.4 # Global variables used by these scripts: # diff --git a/tools/man2html2.tcl b/tools/man2html2.tcl index 753fde4..163196e 100644 --- a/tools/man2html2.tcl +++ b/tools/man2html2.tcl @@ -6,7 +6,7 @@ # # Copyright (c) 1996 by Sun Microsystems, Inc. -package require Tcl 8.4- +package require Tcl 8.4 # Global variables used by these scripts: # diff --git a/tools/tcl.hpj.in b/tools/tcl.hpj.in index 4641165..3bdccbe 100644 --- a/tools/tcl.hpj.in +++ b/tools/tcl.hpj.in @@ -5,9 +5,9 @@ HCW=0 LCID=0x409 0x0 0x0 ;English (United States) REPORT=Yes TITLE=Tcl/Tk Reference Manual -CNT=tcl90.cnt +CNT=tcl86.cnt COPYRIGHT=Copyright © 2000 Ajuba Solutions -HLP=tcl90.hlp +HLP=tcl86.hlp [FILES] tcl.rtf diff --git a/tools/tclZIC.tcl b/tools/tclZIC.tcl index d025d72..005919a 100755 --- a/tools/tclZIC.tcl +++ b/tools/tclZIC.tcl @@ -30,7 +30,7 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #---------------------------------------------------------------------- -package require Tcl 8.5- +package require Tcl 8.5 # Define the names of the Olson files that we need to load. # We avoid the solar time files and the leap seconds. diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl index f87f701..f392bce 100755 --- a/tools/tcltk-man2html.tcl +++ b/tools/tcltk-man2html.tcl @@ -1,6 +1,6 @@ #!/usr/bin/env tclsh -if {[catch {package require Tcl 8.6-} msg]} { +if {[catch {package require Tcl 8.6} msg]} { puts stderr "ERROR: $msg" puts stderr "If running this script from 'make html', set the\ NATIVE_TCLSH environment\nvariable to point to an installed\ diff --git a/unix/configure b/unix/configure index 82ca9df..f778a7b 100755 --- a/unix/configure +++ b/unix/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for tcl 9.0. +# Generated by GNU Autoconf 2.59 for tcl 8.6. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -267,8 +267,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='tcl' PACKAGE_TARNAME='tcl' -PACKAGE_VERSION='9.0' -PACKAGE_STRING='tcl 9.0' +PACKAGE_VERSION='8.6' +PACKAGE_STRING='tcl 8.6' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. @@ -777,7 +777,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tcl 9.0 to adapt to many kinds of systems. +\`configure' configures tcl 8.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -834,7 +834,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tcl 9.0:";; + short | recursive ) echo "Configuration of tcl 8.6:";; esac cat <<\_ACEOF @@ -978,7 +978,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -tcl configure 9.0 +tcl configure 8.6 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -992,7 +992,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tcl $as_me 9.0, which was +It was created by tcl $as_me 8.6, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1332,10 +1332,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -TCL_VERSION=9.0 -TCL_MAJOR_VERSION=9 -TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="a0" +TCL_VERSION=8.6 +TCL_MAJOR_VERSION=8 +TCL_MINOR_VERSION=6 +TCL_PATCH_LEVEL=".0" VERSION=${TCL_VERSION} #------------------------------------------------------------------------ @@ -19958,7 +19958,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by tcl $as_me 9.0, which was +This file was extended by tcl $as_me 8.6, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20016,7 +20016,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -tcl config.status 9.0 +tcl config.status 8.6 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" diff --git a/unix/configure.in b/unix/configure.in index 4ebf1af..087bb05 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. -AC_INIT([tcl],[9.0]) +AC_INIT([tcl],[8.6]) AC_PREREQ(2.59) dnl This is only used when included from macosx/configure.ac @@ -22,10 +22,10 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ #endif /* _TCLCONFIG */]) ]) -TCL_VERSION=9.0 -TCL_MAJOR_VERSION=9 -TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="a0" +TCL_VERSION=8.6 +TCL_MAJOR_VERSION=8 +TCL_MINOR_VERSION=6 +TCL_PATCH_LEVEL=".0" VERSION=${TCL_VERSION} #------------------------------------------------------------------------ diff --git a/unix/dltest/pkga.c b/unix/dltest/pkga.c index 7e5d7d3..c4d3f32 100644 --- a/unix/dltest/pkga.c +++ b/unix/dltest/pkga.c @@ -10,9 +10,18 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +#undef STATIC_BUILD #include "tcl.h" /* + * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the + * Pkga_Init declaration is in the source file itself, which is only + * accessed when we are building a library. + */ +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT + +/* * Prototypes for procedures defined later in this file: */ @@ -115,7 +124,7 @@ Pkga_QuoteObjCmd( *---------------------------------------------------------------------- */ -DLLEXPORT int +EXTERN int Pkga_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c index 35f691a..ad61d77 100644 --- a/unix/dltest/pkgb.c +++ b/unix/dltest/pkgb.c @@ -11,6 +11,7 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +#undef STATIC_BUILD #include "tcl.h" /* @@ -41,6 +42,10 @@ static int Pkgb_DemoObjCmd(ClientData clientData, *---------------------------------------------------------------------- */ +#ifndef Tcl_GetErrorLine +# define Tcl_GetErrorLine(interp) ((interp)->errorLine) +#endif + static int Pkgb_SubObjCmd( ClientData dummy, /* Not used. */ diff --git a/unix/dltest/pkgc.c b/unix/dltest/pkgc.c index 4e3e174..557f21b 100644 --- a/unix/dltest/pkgc.c +++ b/unix/dltest/pkgc.c @@ -11,9 +11,18 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +#undef STATIC_BUILD #include "tcl.h" /* + * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the + * Pkgc_Init declaration is in the source file itself, which is only + * accessed when we are building a library. + */ +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT + +/* * Prototypes for procedures defined later in this file: */ @@ -105,7 +114,7 @@ Pkgc_UnsafeObjCmd( *---------------------------------------------------------------------- */ -DLLEXPORT int +EXTERN int Pkgc_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ @@ -142,7 +151,7 @@ Pkgc_Init( *---------------------------------------------------------------------- */ -DLLEXPORT int +EXTERN int Pkgc_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ diff --git a/unix/dltest/pkgd.c b/unix/dltest/pkgd.c index 4a1defa..6e114e9 100644 --- a/unix/dltest/pkgd.c +++ b/unix/dltest/pkgd.c @@ -11,9 +11,18 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +#undef STATIC_BUILD #include "tcl.h" /* + * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the + * Pkgd_Init declaration is in the source file itself, which is only + * accessed when we are building a library. + */ +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT + +/* * Prototypes for procedures defined later in this file: */ @@ -105,7 +114,7 @@ Pkgd_UnsafeObjCmd( *---------------------------------------------------------------------- */ -DLLEXPORT int +EXTERN int Pkgd_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ @@ -142,7 +151,7 @@ Pkgd_Init( *---------------------------------------------------------------------- */ -DLLEXPORT int +EXTERN int Pkgd_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ diff --git a/unix/dltest/pkge.c b/unix/dltest/pkge.c index 36c8c1a..d616352 100644 --- a/unix/dltest/pkge.c +++ b/unix/dltest/pkge.c @@ -11,8 +11,17 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +#undef STATIC_BUILD #include "tcl.h" +/* + * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the + * Pkge_Init declaration is in the source file itself, which is only + * accessed when we are building a library. + */ +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT + /* *---------------------------------------------------------------------- @@ -31,7 +40,7 @@ *---------------------------------------------------------------------- */ -DLLEXPORT int +EXTERN int Pkge_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ diff --git a/unix/dltest/pkgua.c b/unix/dltest/pkgua.c index 2a38525..417bedb 100644 --- a/unix/dltest/pkgua.c +++ b/unix/dltest/pkgua.c @@ -11,9 +11,18 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +#undef STATIC_BUILD #include "tcl.h" /* + * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the + * Pkgua_Init declaration is in the source file itself, which is only + * accessed when we are building a library. + */ +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT + +/* * Prototypes for procedures defined later in this file: */ @@ -191,7 +200,7 @@ PkguaQuoteObjCmd( *---------------------------------------------------------------------- */ -DLLEXPORT int +EXTERN int Pkgua_Init( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ @@ -244,7 +253,7 @@ Pkgua_Init( *---------------------------------------------------------------------- */ -DLLEXPORT int +EXTERN int Pkgua_SafeInit( Tcl_Interp *interp) /* Interpreter in which the package is to be * made available. */ @@ -269,7 +278,7 @@ Pkgua_SafeInit( *---------------------------------------------------------------------- */ -DLLEXPORT int +EXTERN int Pkgua_Unload( Tcl_Interp *interp, /* Interpreter from which the package is to be * unloaded. */ @@ -322,7 +331,7 @@ Pkgua_Unload( *---------------------------------------------------------------------- */ -DLLEXPORT int +EXTERN int Pkgua_SafeUnload( Tcl_Interp *interp, /* Interpreter from which the package is to be * unloaded. */ diff --git a/unix/tcl.spec b/unix/tcl.spec index f4839ce..27f7189 100644 --- a/unix/tcl.spec +++ b/unix/tcl.spec @@ -4,7 +4,7 @@ Name: tcl Summary: Tcl scripting language development environment -Version: 9.0a0 +Version: 8.6.0 Release: 2 License: BSD Group: Development/Languages diff --git a/unix/tclAppInit.c b/unix/tclAppInit.c index 21dce71..159bbd8 100644 --- a/unix/tclAppInit.c +++ b/unix/tclAppInit.c @@ -150,9 +150,9 @@ Tcl_AppInit( */ #ifdef DJGPP - (Tcl_SetVar2)(interp, "tcl_rcFileName", NULL, "~/tclsh.rc", TCL_GLOBAL_ONLY); + (Tcl_SetVar)(interp, "tcl_rcFileName", "~/tclsh.rc", TCL_GLOBAL_ONLY); #else - (Tcl_SetVar2)(interp, "tcl_rcFileName", NULL, "~/.tclshrc", TCL_GLOBAL_ONLY); + (Tcl_SetVar)(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY); #endif return TCL_OK; diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 023e082..9ee37f1 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -99,7 +99,7 @@ * This structure describes per-instance state of a file based channel. */ -typedef struct { +typedef struct FileState { Tcl_Channel channel; /* Channel associated with this file. */ int fd; /* File handle. */ int validMask; /* OR'ed combination of TCL_READABLE, @@ -126,7 +126,7 @@ typedef struct TtyState { * a platform-independant manner. */ -typedef struct { +typedef struct TtyAttrs { int baud; int parity; int data; diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index 5cb35d2..e201018 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -49,7 +49,7 @@ #ifdef TCL_THREADS -typedef struct { +typedef struct ThreadSpecificData { struct passwd pwd; #if defined(HAVE_GETPWNAM_R_5) || defined(HAVE_GETPWUID_R_5) #define NEED_PW_CLEANER 1 diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 39be160..f07b123 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -42,12 +42,12 @@ static const char *const platforms[NUMPLATFORMS] = { }; #define NUMPROCESSORS 11 -static const char *const processors[NUMPROCESSORS] = { +static const char *const processors[NUMPROCESSORS] = { "intel", "mips", "alpha", "ppc", "shx", "arm", "ia64", "alpha64", "msil", "amd64", "ia32_on_win64" }; -typedef struct { +typedef struct _SYSTEM_INFO { union { DWORD dwOemId; struct { @@ -66,7 +66,7 @@ typedef struct { int wProcessorRevision; } SYSTEM_INFO; -typedef struct { +typedef struct _OSVERSIONINFOA { DWORD dwOSVersionInfoSize; DWORD dwMajorVersion; DWORD dwMinorVersion; @@ -112,7 +112,7 @@ static char pkgPath[sizeof(TCL_PACKAGE_PATH)+200] = TCL_PACKAGE_PATH; * first list checked for a mapping from env encoding to Tcl encoding name. */ -typedef struct { +typedef struct LocaleTable { const char *lang; const char *encoding; } LocaleTable; diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 5c03b79..b87af1b 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -39,7 +39,7 @@ typedef struct FileHandler { * handlers are ready to fire. */ -typedef struct { +typedef struct FileHandlerEvent { Tcl_Event header; /* Information that is standard for all * events. */ int fd; /* File descriptor that is ready. Used to find @@ -54,7 +54,7 @@ typedef struct { * writable, and exception conditions. */ -typedef struct { +typedef struct SelectMasks { fd_set readable; fd_set writable; fd_set exception; diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index a7dbccb..249a703 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -30,7 +30,7 @@ * This structure describes per-instance state of a pipe based channel. */ -typedef struct { +typedef struct PipeState { Tcl_Channel channel; /* Channel associated with this file. */ TclFile inFile; /* Output from pipe. */ TclFile outFile; /* Input to pipe. */ diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c index 35445d2..46fc972 100644 --- a/unix/tclUnixTest.c +++ b/unix/tclUnixTest.c @@ -37,7 +37,7 @@ * exercised by the "testfilehandler" command. */ -typedef struct { +typedef struct Pipe { TclFile readFile; /* File handle for reading from the pipe. NULL * means pipe doesn't exist yet. */ TclFile writeFile; /* File handle for writing from the pipe. */ @@ -67,10 +67,10 @@ static Tcl_CmdProc TestchmodCmd; static Tcl_CmdProc TestfilehandlerCmd; static Tcl_CmdProc TestfilewaitCmd; static Tcl_CmdProc TestfindexecutableCmd; -static Tcl_ObjCmdProc TestgetdefencdirCmd; +static Tcl_CmdProc TestgetdefencdirCmd; static Tcl_CmdProc TestgetopenfileCmd; static Tcl_CmdProc TestgotsigCmd; -static Tcl_ObjCmdProc TestsetdefencdirCmd; +static Tcl_CmdProc TestsetdefencdirCmd; static Tcl_FileProc TestFileHandlerProc; static void AlarmHandler(int signum); @@ -105,9 +105,9 @@ TclplatformtestInit( NULL, NULL); Tcl_CreateCommand(interp, "testgetopenfile", TestgetopenfileCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testgetdefenc", TestgetdefencdirCmd, + Tcl_CreateCommand(interp, "testgetdefenc", TestgetdefencdirCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testsetdefenc", TestsetdefencdirCmd, + Tcl_CreateCommand(interp, "testsetdefenc", TestsetdefencdirCmd, NULL, NULL); Tcl_CreateCommand(interp, "testalarm", TestalarmCmd, NULL, NULL); @@ -514,22 +514,16 @@ static int TestsetdefencdirCmd( ClientData clientData, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *const *objv) /* Argument strings. */ + int argc, /* Number of arguments. */ + const char **argv) /* Argument strings. */ { - Tcl_Obj *searchPath; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "defaultDir"); + if (argc != 2) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + " defaultDir\"", NULL); return TCL_ERROR; } - searchPath = Tcl_GetEncodingSearchPath(); - - searchPath = Tcl_DuplicateObj(searchPath); - Tcl_ListObjReplace(NULL, searchPath, 0, 0, 1, &objv[1]); - Tcl_SetEncodingSearchPath(searchPath); - + Tcl_SetDefaultEncodingDir(argv[1]); return TCL_OK; } @@ -554,25 +548,15 @@ static int TestgetdefencdirCmd( ClientData clientData, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *const *objv) /* Argument strings. */ + int argc, /* Number of arguments. */ + const char **argv) /* Argument strings. */ { - int numDirs; - Tcl_Obj *first, *searchPath; - - if (objc != 1) { - Tcl_WrongNumArgs(interp, 1, objv, NULL); - return TCL_ERROR; - } - - searchPath = Tcl_GetEncodingSearchPath(); - Tcl_ListObjLength(interp, searchPath, &numDirs); - if (numDirs == 0) { - return TCL_ERROR; + if (argc != 1) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], NULL); + return TCL_ERROR; } - Tcl_ListObjIndex(NULL, searchPath, 0, &first); - Tcl_SetObjResult(interp, first); + Tcl_AppendResult(interp, Tcl_GetDefaultEncodingDir(), NULL); return TCL_OK; } diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index 866d653..752795c 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -15,7 +15,7 @@ #ifdef TCL_THREADS -typedef struct { +typedef struct ThreadSpecificData { char nabuf[16]; } ThreadSpecificData; @@ -682,7 +682,7 @@ TclpInetNtoa( static volatile int initialized = 0; static pthread_key_t key; -typedef struct { +typedef struct allocMutex { Tcl_Mutex tlock; pthread_mutex_t plock; } allocMutex; @@ -690,10 +690,10 @@ typedef struct { Tcl_Mutex * TclpNewAllocMutex(void) { - allocMutex *lockPtr; + struct allocMutex *lockPtr; register pthread_mutex_t *plockPtr; - lockPtr = malloc(sizeof(allocMutex)); + lockPtr = malloc(sizeof(struct allocMutex)); if (lockPtr == NULL) { Tcl_Panic("could not allocate lock"); } diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index 6e8c5f4..c7921fe 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -20,6 +20,18 @@ #define IsLeapYear(x) (((x)%4 == 0) && ((x)%100 != 0 || (x)%400 == 0)) /* + * TclpGetDate is coded to return a pointer to a 'struct tm'. For thread + * safety, this structure must be in thread-specific data. The 'tmKey' + * variable is the key to this buffer. + */ + +static Tcl_ThreadDataKey tmKey; +typedef struct ThreadSpecificData { + struct tm gmtime_buf; + struct tm localtime_buf; +} ThreadSpecificData; + +/* * If we fall back on the thread-unsafe versions of gmtime and localtime, use * this mutex to try to protect them. */ @@ -239,6 +251,114 @@ Tcl_GetTime( /* *---------------------------------------------------------------------- * + * TclpGetDate -- + * + * This function converts between seconds and struct tm. If useGMT is + * true, then the returned date will be in Greenwich Mean Time (GMT). + * Otherwise, it will be in the local time zone. + * + * Results: + * Returns a static tm structure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +struct tm * +TclpGetDate( + const time_t *time, + int useGMT) +{ + if (useGMT) { + return TclpGmtime(time); + } else { + return TclpLocaltime(time); + } +} + +/* + *---------------------------------------------------------------------- + * + * TclpGmtime -- + * + * Wrapper around the 'gmtime' library function to make it thread safe. + * + * Results: + * Returns a pointer to a 'struct tm' in thread-specific data. + * + * Side effects: + * Invokes gmtime or gmtime_r as appropriate. + * + *---------------------------------------------------------------------- + */ + +struct tm * +TclpGmtime( + const time_t *timePtr) /* Pointer to the number of seconds since the + * local system's epoch */ +{ + /* + * Get a thread-local buffer to hold the returned time. + */ + + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&tmKey); + +#ifdef HAVE_GMTIME_R + gmtime_r(timePtr, &tsdPtr->gmtime_buf); +#else + Tcl_MutexLock(&tmMutex); + memcpy(&tsdPtr->gmtime_buf, gmtime(timePtr), sizeof(struct tm)); + Tcl_MutexUnlock(&tmMutex); +#endif + + return &tsdPtr->gmtime_buf; +} + +/* + *---------------------------------------------------------------------- + * + * TclpLocaltime -- + * + * Wrapper around the 'localtime' library function to make it thread + * safe. + * + * Results: + * Returns a pointer to a 'struct tm' in thread-specific data. + * + * Side effects: + * Invokes localtime or localtime_r as appropriate. + * + *---------------------------------------------------------------------- + */ + +struct tm * +TclpLocaltime( + const time_t *timePtr) /* Pointer to the number of seconds since the + * local system's epoch */ +{ + /* + * Get a thread-local buffer to hold the returned time. + */ + + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&tmKey); + + SetTZIfNecessary(); +#ifdef HAVE_LOCALTIME_R + localtime_r(timePtr, &tsdPtr->localtime_buf); +#else + Tcl_MutexLock(&tmMutex); + memcpy(&tsdPtr->localtime_buf, localtime(timePtr), sizeof(struct tm)); + Tcl_MutexUnlock(&tmMutex); +#endif + + return &tsdPtr->localtime_buf; +} + +/* + *---------------------------------------------------------------------- + * * Tcl_SetTimeProc -- * * TIP #233 (Virtualized Time): Registers two handlers for the diff --git a/win/README b/win/README index 4ecd9b3..8b257b1 100644 --- a/win/README +++ b/win/README @@ -1,4 +1,4 @@ -Tcl 9.0 for Windows +Tcl 8.6 for Windows 1. Introduction --------------- @@ -16,7 +16,7 @@ The information in this file is maintained on the web at: In order to compile Tcl for Windows, you need the following: - Tcl 9.0 Source Distribution (plus any patches) + Tcl 8.6 Source Distribution (plus any patches) and diff --git a/win/configure b/win/configure index ba10113..03a20b4 100755 --- a/win/configure +++ b/win/configure @@ -1308,10 +1308,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TCL_VERSION=9.0 -TCL_MAJOR_VERSION=9 -TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="a0" +TCL_VERSION=8.6 +TCL_MAJOR_VERSION=8 +TCL_MINOR_VERSION=6 +TCL_PATCH_LEVEL=".0" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 diff --git a/win/configure.in b/win/configure.in index e74a745..b0c007a 100644 --- a/win/configure.in +++ b/win/configure.in @@ -11,10 +11,10 @@ AC_PREREQ(2.59) # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TCL_VERSION=9.0 -TCL_MAJOR_VERSION=9 -TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="a0" +TCL_VERSION=8.6 +TCL_MAJOR_VERSION=8 +TCL_MINOR_VERSION=6 +TCL_PATCH_LEVEL=".0" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 diff --git a/win/makefile.bc b/win/makefile.bc index bd71169..18bfa28 100644 --- a/win/makefile.bc +++ b/win/makefile.bc @@ -123,8 +123,8 @@ CFG_ENCODING = \"cp1252\" NAMEPREFIX = tcl STUBPREFIX = $(NAMEPREFIX)stub -DOTVERSION = 9.0 -VERSION = 90 +DOTVERSION = 8.6 +VERSION = 86 DDEVERSION = 14 DDEDOTVERSION = 1.4 diff --git a/win/tcl.rc b/win/tcl.rc index 44b222a..d88ca0a 100644 --- a/win/tcl.rc +++ b/win/tcl.rc @@ -2,7 +2,7 @@ // #include -#include "tclWinInt.h" +#include // // build-up the name suffix that defines the type of build this is. diff --git a/win/tclAppInit.c b/win/tclAppInit.c index 5ecebea..56f45a0 100644 --- a/win/tclAppInit.c +++ b/win/tclAppInit.c @@ -193,7 +193,7 @@ Tcl_AppInit( * specific startup file will be run under any conditions. */ - (Tcl_SetVar2)(interp, "tcl_rcFileName", NULL, "~/tclshrc.tcl", TCL_GLOBAL_ONLY); + (Tcl_SetVar)(interp, "tcl_rcFileName", "~/tclshrc.tcl", TCL_GLOBAL_ONLY); return TCL_OK; } diff --git a/win/tclWinChan.c b/win/tclWinChan.c index e8f46ef..52b9e32 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -43,7 +43,7 @@ typedef struct FileInfo { * pending on the channel. */ } FileInfo; -typedef struct { +typedef struct ThreadSpecificData { /* * List of all file channels currently open. */ @@ -58,7 +58,7 @@ static Tcl_ThreadDataKey dataKey; * events are generated. */ -typedef struct { +typedef struct FileEvent { Tcl_Event header; /* Information that is standard for all * events. */ FileInfo *infoPtr; /* Pointer to file info structure. Note that diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index 094a5e9..5aab255 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -50,7 +50,7 @@ TCL_DECLARE_MUTEX(consoleMutex) * threads. */ -typedef struct { +typedef struct ConsoleThreadInfo { HANDLE thread; /* Handle to reader or writer thread. */ HANDLE readyEvent; /* Manual-reset event to signal _to_ the main * thread when the worker thread has finished @@ -113,7 +113,7 @@ typedef struct ConsoleInfo { /* Data consumed by reader thread. */ } ConsoleInfo; -typedef struct{ +typedef struct ThreadSpecificData { /* * The following pointer refers to the head of the list of consoles that * are being watched for file events. @@ -129,7 +129,7 @@ static Tcl_ThreadDataKey dataKey; * console events are generated. */ -typedef struct { +typedef struct ConsoleEvent { Tcl_Event header; /* Information that is standard for all * events. */ ConsoleInfo *infoPtr; /* Pointer to console info structure. Note diff --git a/win/tclWinDde.c b/win/tclWinDde.c index b4a4fde..d0600e6 100644 --- a/win/tclWinDde.c +++ b/win/tclWinDde.c @@ -33,6 +33,16 @@ #endif /* + * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the Dde_Init + * declaration is in the source file itself, which is only accessed when we + * are building a library. DO NOT MOVE BEFORE ANY #include LINES. ONLY USE + * EXTERN TO INDICATE EXPORTED FUNCTIONS FROM NOW ON. + */ + +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT + +/* * The following structure is used to keep track of the interpreters * registered by this process. */ @@ -58,7 +68,7 @@ typedef struct Conversation { Tcl_Obj *returnPackagePtr; /* The result package for this conversation. */ } Conversation; -typedef struct { +typedef struct DdeEnumServices { Tcl_Interp *interp; int result; ATOM service; @@ -66,7 +76,7 @@ typedef struct { HWND hwnd; } DdeEnumServices; -typedef struct { +typedef struct ThreadSpecificData { Conversation *currentConversations; /* A list of conversations currently being * processed. */ @@ -103,7 +113,7 @@ TCL_DECLARE_MUTEX(ddeMutex) static LRESULT CALLBACK DdeClientWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); -static int DdeCreateClient(DdeEnumServices *es); +static int DdeCreateClient(struct DdeEnumServices *es); static BOOL CALLBACK DdeEnumWindowsCallback(HWND hwndTarget, LPARAM lParam); static void DdeExitProc(ClientData clientData); @@ -124,8 +134,8 @@ static int DdeObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -DLLEXPORT int Dde_Init(Tcl_Interp *interp); -DLLEXPORT int Dde_SafeInit(Tcl_Interp *interp); +EXTERN int Dde_Init(Tcl_Interp *interp); +EXTERN int Dde_SafeInit(Tcl_Interp *interp); /* *---------------------------------------------------------------------- @@ -147,7 +157,7 @@ int Dde_Init( Tcl_Interp *interp) { - if (!Tcl_InitStubs(interp, TCL_VERSION, 0)) { + if (!Tcl_InitStubs(interp, "8.1", 0)) { return TCL_ERROR; } @@ -1028,7 +1038,7 @@ MakeDdeConnection( static int DdeCreateClient( - DdeEnumServices *es) + struct DdeEnumServices *es) { WNDCLASSEX wc; static const TCHAR *szDdeClientClassName = TEXT("TclEval client class"); @@ -1038,7 +1048,7 @@ DdeCreateClient( wc.cbSize = sizeof(wc); wc.lpfnWndProc = DdeClientWindowProc; wc.lpszClassName = szDdeClientClassName; - wc.cbWndExtra = sizeof(DdeEnumServices *); + wc.cbWndExtra = sizeof(struct DdeEnumServices *); /* * Register and create the callback window. @@ -1060,8 +1070,8 @@ DdeClientWindowProc( switch (uMsg) { case WM_CREATE: { LPCREATESTRUCT lpcs = (LPCREATESTRUCT) lParam; - DdeEnumServices *es = - (DdeEnumServices *) lpcs->lpCreateParams; + struct DdeEnumServices *es = + (struct DdeEnumServices *) lpcs->lpCreateParams; #ifdef _WIN64 SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) es); @@ -1086,14 +1096,14 @@ DdeServicesOnAck( HWND hwndRemote = (HWND)wParam; ATOM service = (ATOM)LOWORD(lParam); ATOM topic = (ATOM)HIWORD(lParam); - DdeEnumServices *es; + struct DdeEnumServices *es; TCHAR sz[255]; Tcl_DString dString; #ifdef _WIN64 - es = (DdeEnumServices *) GetWindowLongPtr(hwnd, GWLP_USERDATA); + es = (struct DdeEnumServices *) GetWindowLongPtr(hwnd, GWLP_USERDATA); #else - es = (DdeEnumServices *) GetWindowLong(hwnd, GWL_USERDATA); + es = (struct DdeEnumServices *) GetWindowLong(hwnd, GWL_USERDATA); #endif if ((es->service == (ATOM)0 || es->service == service) @@ -1144,7 +1154,7 @@ DdeEnumWindowsCallback( LPARAM lParam) { DWORD_PTR dwResult = 0; - DdeEnumServices *es = (DdeEnumServices *) lParam; + struct DdeEnumServices *es = (struct DdeEnumServices *) lParam; SendMessageTimeout(hwndTarget, WM_DDE_INITIATE, (WPARAM)es->hwnd, MAKELONG(es->service, es->topic), SMTO_ABORTIFHUNG, 1000, @@ -1158,7 +1168,7 @@ DdeGetServicesList( const TCHAR *serviceName, const TCHAR *topicName) { - DdeEnumServices es; + struct DdeEnumServices es; es.interp = interp; es.result = TCL_OK; diff --git a/win/tclWinInt.h b/win/tclWinInt.h index b3753f4..22ad8e9 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -15,20 +15,6 @@ #include "tclInt.h" /* - * Utility macros: STRINGIFY takes an argument and wraps it in "" (double - * quotation marks), JOIN joins two arguments. - */ - -#ifndef STRINGIFY -# define STRINGIFY(x) STRINGIFY1(x) -# define STRINGIFY1(x) #x -#endif -#ifndef JOIN -# define JOIN(a,b) JOIN1(a,b) -# define JOIN1(a,b) a##b -#endif - -/* * Some versions of Borland C have a define for the OSVERSIONINFO for * Win32s and for NT, but not for Windows 95. * Define VER_PLATFORM_WIN32_CE for those without newer headers. diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c index aaa5878..4543b02 100644 --- a/win/tclWinNotify.c +++ b/win/tclWinNotify.c @@ -27,7 +27,7 @@ * created for each thread that is using the notifier. */ -typedef struct { +typedef struct ThreadSpecificData { CRITICAL_SECTION crit; /* Monitor for this notifier. */ DWORD thread; /* Identifier for thread associated with this * notifier. */ diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index 3309858..36ae58a 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -52,7 +52,7 @@ TCL_DECLARE_MUTEX(pipeMutex) * used in a pipeline. */ -typedef struct { +typedef struct WinFile { int type; /* One of the file types defined above. */ HANDLE handle; /* Open file handle. */ } WinFile; @@ -144,7 +144,7 @@ typedef struct PipeInfo { * synchronized with the readable object. */ } PipeInfo; -typedef struct { +typedef struct ThreadSpecificData { /* * The following pointer refers to the head of the list of pipes that are * being watched for file events. @@ -160,7 +160,7 @@ static Tcl_ThreadDataKey dataKey; * events are generated. */ -typedef struct { +typedef struct PipeEvent { Tcl_Event header; /* Information that is standard for all * events. */ PipeInfo *infoPtr; /* Pointer to pipe info structure. Note that diff --git a/win/tclWinReg.c b/win/tclWinReg.c index 619d9df..6ac5caf 100644 --- a/win/tclWinReg.c +++ b/win/tclWinReg.c @@ -49,6 +49,15 @@ #endif /* + * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the + * Registry_Init declaration is in the source file itself, which is only + * accessed when we are building a library. + */ + +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT + +/* * The following macros convert between different endian ints. */ @@ -131,8 +140,8 @@ static int SetValue(Tcl_Interp *interp, Tcl_Obj *keyNameObj, Tcl_Obj *valueNameObj, Tcl_Obj *dataObj, Tcl_Obj *typeObj, REGSAM mode); -DLLEXPORT int Registry_Init(Tcl_Interp *interp); -DLLEXPORT int Registry_Unload(Tcl_Interp *interp, int flags); +EXTERN int Registry_Init(Tcl_Interp *interp); +EXTERN int Registry_Unload(Tcl_Interp *interp, int flags); /* *---------------------------------------------------------------------- @@ -156,7 +165,7 @@ Registry_Init( { Tcl_Command cmd; - if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { + if (Tcl_InitStubs(interp, "8.5", 0) == NULL) { return TCL_ERROR; } diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index 84d97bd..458b05b 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -122,7 +122,7 @@ typedef struct SerialInfo { * [fconfigure -queue] */ } SerialInfo; -typedef struct { +typedef struct ThreadSpecificData { /* * The following pointer refers to the head of the list of serials that * are being watched for file events. @@ -138,7 +138,7 @@ static Tcl_ThreadDataKey dataKey; * events are generated. */ -typedef struct { +typedef struct SerialEvent { Tcl_Event header; /* Information that is standard for all * events. */ SerialInfo *infoPtr; /* Pointer to serial info structure. Note that diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index b37eddf..7b0f6f8 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -111,7 +111,7 @@ static Tcl_ThreadDataKey dataKey; * the queue. */ -typedef struct { +typedef struct WinCondition { CRITICAL_SECTION condLock; /* Lock to serialize queuing on the * condition. */ struct ThreadSpecificData *firstPtr; /* Queue pointers */ @@ -126,7 +126,7 @@ typedef struct { static int once; static DWORD tlsKey; -typedef struct { +typedef struct allocMutex { Tcl_Mutex tlock; CRITICAL_SECTION wlock; } allocMutex; @@ -948,9 +948,9 @@ TclpFinalizeCondition( Tcl_Mutex * TclpNewAllocMutex(void) { - allocMutex *lockPtr; + struct allocMutex *lockPtr; - lockPtr = malloc(sizeof(allocMutex)); + lockPtr = malloc(sizeof(struct allocMutex)); if (lockPtr == NULL) { Tcl_Panic("could not allocate lock"); } diff --git a/win/tclWinTime.c b/win/tclWinTime.c index d69070b..daa229d 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -12,6 +12,10 @@ #include "tclInt.h" +#define SECSPERDAY (60L * 60L * 24L) +#define SECSPERYEAR (SECSPERDAY * 365L) +#define SECSPER4YEAR (SECSPERYEAR * 4L + SECSPERDAY) + /* * Number of samples over which to estimate the performance counter. */ @@ -19,10 +23,29 @@ #define SAMPLES 64 /* + * The following arrays contain the day of year for the last day of each + * month, where index 1 is January. + */ + +static const int normalDays[] = { + -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364 +}; + +static const int leapDays[] = { + -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 +}; + +typedef struct ThreadSpecificData { + char tzName[64]; /* Time zone name */ + struct tm tm; /* time information */ +} ThreadSpecificData; +static Tcl_ThreadDataKey dataKey; + +/* * Data for managing high-resolution timers. */ -typedef struct { +typedef struct TimeInfo { CRITICAL_SECTION cs; /* Mutex guarding this structure. */ int initialized; /* Flag == 1 if this structure is * initialized. */ @@ -90,6 +113,7 @@ static TimeInfo timeInfo = { * Declarations for functions defined later in this file. */ +static struct tm * ComputeGMT(const time_t *tp); static void StopCalibration(ClientData clientData); static DWORD WINAPI CalibrationThread(LPVOID arg); static void UpdateTimeEachSecond(void); @@ -465,6 +489,227 @@ StopCalibration( /* *---------------------------------------------------------------------- * + * TclpGetDate -- + * + * This function converts between seconds and struct tm. If useGMT is + * true, then the returned date will be in Greenwich Mean Time (GMT). + * Otherwise, it will be in the local time zone. + * + * Results: + * Returns a static tm structure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +struct tm * +TclpGetDate( + const time_t *t, + int useGMT) +{ + struct tm *tmPtr; + time_t time; + + if (!useGMT) { + tzset(); + + /* + * If we are in the valid range, let the C run-time library handle it. + * Otherwise we need to fake it. Note that this algorithm ignores + * daylight savings time before the epoch. + */ + + /* + * Hm, Borland's localtime manages to return NULL under certain + * circumstances (e.g. wintime.test, test 1.2). Nobody tests for this, + * since 'localtime' isn't supposed to do this, possibly leading to + * crashes. + * + * Patch: We only call this function if we are at least one day into + * the epoch, else we handle it ourselves (like we do for times < 0). + * H. Giese, June 2003 + */ + +#ifdef __BORLANDC__ +#define LOCALTIME_VALIDITY_BOUNDARY SECSPERDAY +#else +#define LOCALTIME_VALIDITY_BOUNDARY 0 +#endif + + if (*t >= LOCALTIME_VALIDITY_BOUNDARY) { + return TclpLocaltime(t); + } + + time = *t - timezone; + + /* + * If we aren't near to overflowing the long, just add the bias and + * use the normal calculation. Otherwise we will need to adjust the + * result at the end. + */ + + if (*t < (LONG_MAX - 2*SECSPERDAY) && *t > (LONG_MIN + 2*SECSPERDAY)) { + tmPtr = ComputeGMT(&time); + } else { + tmPtr = ComputeGMT(t); + + tzset(); + + /* + * Add the bias directly to the tm structure to avoid overflow. + * Propagate seconds overflow into minutes, hours and days. + */ + + time = tmPtr->tm_sec - timezone; + tmPtr->tm_sec = (int)(time % 60); + if (tmPtr->tm_sec < 0) { + tmPtr->tm_sec += 60; + time -= 60; + } + + time = tmPtr->tm_min + time/60; + tmPtr->tm_min = (int)(time % 60); + if (tmPtr->tm_min < 0) { + tmPtr->tm_min += 60; + time -= 60; + } + + time = tmPtr->tm_hour + time/60; + tmPtr->tm_hour = (int)(time % 24); + if (tmPtr->tm_hour < 0) { + tmPtr->tm_hour += 24; + time -= 24; + } + + time /= 24; + tmPtr->tm_mday += (int)time; + tmPtr->tm_yday += (int)time; + tmPtr->tm_wday = (tmPtr->tm_wday + (int)time) % 7; + } + } else { + tmPtr = ComputeGMT(t); + } + return tmPtr; +} + +/* + *---------------------------------------------------------------------- + * + * ComputeGMT -- + * + * This function computes GMT given the number of seconds since the epoch + * (midnight Jan 1 1970). + * + * Results: + * Returns a (per thread) statically allocated struct tm. + * + * Side effects: + * Updates the values of the static struct tm. + * + *---------------------------------------------------------------------- + */ + +static struct tm * +ComputeGMT( + const time_t *tp) +{ + struct tm *tmPtr; + long tmp, rem; + int isLeap; + const int *days; + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + + tmPtr = &tsdPtr->tm; + + /* + * Compute the 4 year span containing the specified time. + */ + + tmp = (long)(*tp / SECSPER4YEAR); + rem = (long)(*tp % SECSPER4YEAR); + + /* + * Correct for weird mod semantics so the remainder is always positive. + */ + + if (rem < 0) { + tmp--; + rem += SECSPER4YEAR; + } + + /* + * Compute the year after 1900 by taking the 4 year span and adjusting for + * the remainder. This works because 2000 is a leap year, and 1900/2100 + * are out of the range. + */ + + tmp = (tmp * 4) + 70; + isLeap = 0; + if (rem >= SECSPERYEAR) { /* 1971, etc. */ + tmp++; + rem -= SECSPERYEAR; + if (rem >= SECSPERYEAR) { /* 1972, etc. */ + tmp++; + rem -= SECSPERYEAR; + if (rem >= SECSPERYEAR + SECSPERDAY) { /* 1973, etc. */ + tmp++; + rem -= SECSPERYEAR + SECSPERDAY; + } else { + isLeap = 1; + } + } + } + tmPtr->tm_year = tmp; + + /* + * Compute the day of year and leave the seconds in the current day in the + * remainder. + */ + + tmPtr->tm_yday = rem / SECSPERDAY; + rem %= SECSPERDAY; + + /* + * Compute the time of day. + */ + + tmPtr->tm_hour = rem / 3600; + rem %= 3600; + tmPtr->tm_min = rem / 60; + tmPtr->tm_sec = rem % 60; + + /* + * Compute the month and day of month. + */ + + days = (isLeap) ? leapDays : normalDays; + for (tmp = 1; days[tmp] < tmPtr->tm_yday; tmp++) { + /* empty body */ + } + tmPtr->tm_mon = --tmp; + tmPtr->tm_mday = tmPtr->tm_yday - days[tmp]; + + /* + * Compute day of week. Epoch started on a Thursday. + */ + + tmPtr->tm_wday = (long)(*tp / SECSPERDAY) + 4; + if ((*tp % SECSPERDAY) < 0) { + tmPtr->tm_wday--; + } + tmPtr->tm_wday %= 7; + if (tmPtr->tm_wday < 0) { + tmPtr->tm_wday += 7; + } + + return tmPtr; +} + +/* + *---------------------------------------------------------------------- + * * CalibrationThread -- * * Thread that manages calibration of the hi-resolution time derived from @@ -792,6 +1037,67 @@ AccumulateSample( /* *---------------------------------------------------------------------- * + * TclpGmtime -- + * + * Wrapper around the 'gmtime' library function to make it thread safe. + * + * Results: + * Returns a pointer to a 'struct tm' in thread-specific data. + * + * Side effects: + * Invokes gmtime or gmtime_r as appropriate. + * + *---------------------------------------------------------------------- + */ + +struct tm * +TclpGmtime( + const time_t *timePtr) /* Pointer to the number of seconds since the + * local system's epoch */ +{ + /* + * The MS implementation of gmtime is thread safe because it returns the + * time in a block of thread-local storage, and Windows does not provide a + * Posix gmtime_r function. + */ + + return gmtime(timePtr); +} + +/* + *---------------------------------------------------------------------- + * + * TclpLocaltime -- + * + * Wrapper around the 'localtime' library function to make it thread + * safe. + * + * Results: + * Returns a pointer to a 'struct tm' in thread-specific data. + * + * Side effects: + * Invokes localtime or localtime_r as appropriate. + * + *---------------------------------------------------------------------- + */ + +struct tm * +TclpLocaltime( + const time_t *timePtr) /* Pointer to the number of seconds since the + * local system's epoch */ +{ + /* + * The MS implementation of localtime is thread safe because it returns + * the time in a block of thread-local storage, and Windows does not + * provide a Posix localtime_r function. + */ + + return localtime(timePtr); +} + +/* + *---------------------------------------------------------------------- + * * Tcl_SetTimeProc -- * * TIP #233 (Virtualized Time): Registers two handlers for the diff --git a/win/tclsh.rc b/win/tclsh.rc index 6e1114d..16eaf83 100644 --- a/win/tclsh.rc +++ b/win/tclsh.rc @@ -2,7 +2,7 @@ // #include -#include "tclWinInt.h" +#include // // build-up the name suffix that defines the type of build this is. -- cgit v0.12