diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-12-11 08:43:28 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-12-11 08:43:28 (GMT) |
commit | 189e7fe97b73e736c71c8bfd54f3cb3121697f41 (patch) | |
tree | bfc0f3a27a8025e03daf6da5eeb79a13f33e1e55 /generic | |
parent | d2fb846f98f47e4199b988b558b8bde42e7b1923 (diff) | |
download | tcl-189e7fe97b73e736c71c8bfd54f3cb3121697f41.zip tcl-189e7fe97b73e736c71c8bfd54f3cb3121697f41.tar.gz tcl-189e7fe97b73e736c71c8bfd54f3cb3121697f41.tar.bz2 |
Experiments with [http://semver.org/|Semantic Versioning] in Tcl. (Don't look!)
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tcl.decls | 58 | ||||
-rw-r--r-- | generic/tcl.h | 10 | ||||
-rw-r--r-- | generic/tclBasic.c | 4 | ||||
-rw-r--r-- | generic/tclInterp.c | 5 | ||||
-rw-r--r-- | generic/tclPkg.c | 48 | ||||
-rw-r--r-- | generic/tclTest.c | 2 | ||||
-rw-r--r-- | generic/tclTomMathInterface.c | 2 |
7 files changed, 74 insertions, 55 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls index 574b49b..cf2394f 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -254,8 +254,8 @@ declare 66 { void Tcl_AddErrorInfo(Tcl_Interp *interp, const char *message) } declare 67 { - void Tcl_AddObjErrorInfo(Tcl_Interp *interp, const char *message, - int length) + TCL_DEPRECATED void Tcl_AddObjErrorInfo(Tcl_Interp *interp, + const char *message, int length) } declare 68 { void Tcl_AllowExceptions(Tcl_Interp *interp) @@ -286,7 +286,7 @@ declare 76 { void Tcl_BackgroundError(Tcl_Interp *interp) } declare 77 { - char Tcl_Backslash(const char *src, int *readPtr) + TCL_DEPRECATE char Tcl_Backslash(const char *src, int *readPtr) } declare 78 { int Tcl_BadChannelOption(Tcl_Interp *interp, const char *optionName, @@ -353,8 +353,8 @@ declare 94 { Tcl_Interp *Tcl_CreateInterp(void) } declare 95 { - void Tcl_CreateMathFunc(Tcl_Interp *interp, const char *name, - int numArgs, Tcl_ValueType *argTypes, + TCL_DEPRECATED void Tcl_CreateMathFunc(Tcl_Interp *interp, + const char *name, int numArgs, Tcl_ValueType *argTypes, Tcl_MathProc *proc, ClientData clientData) } declare 96 { @@ -467,14 +467,14 @@ declare 128 { CONST84_RETURN char *Tcl_ErrnoMsg(int err) } declare 129 { - int Tcl_Eval(Tcl_Interp *interp, const char *script) + TCL_DEPRECATED int Tcl_Eval(Tcl_Interp *interp, const char *script) } # This is obsolete, use Tcl_FSEvalFile declare 130 { - int Tcl_EvalFile(Tcl_Interp *interp, const char *fileName) + TCL_DEPRECATED int Tcl_EvalFile(Tcl_Interp *interp, const char *fileName) } declare 131 { - int Tcl_EvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr) + TCL_DEPRECATED int Tcl_EvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr) } declare 132 { void Tcl_EventuallyFree(ClientData clientData, Tcl_FreeProc *freeProc) @@ -626,7 +626,7 @@ declare 174 { CONST84_RETURN char *Tcl_GetStringResult(Tcl_Interp *interp) } declare 175 { - CONST84_RETURN char *Tcl_GetVar(Tcl_Interp *interp, const char *varName, + TCL_DEPRECATED CONST84_RETURN char *Tcl_GetVar(Tcl_Interp *interp, const char *varName, int flags) } declare 176 { @@ -634,10 +634,10 @@ declare 176 { const char *part2, int flags) } declare 177 { - int Tcl_GlobalEval(Tcl_Interp *interp, const char *command) + TCL_DEPRECATED int Tcl_GlobalEval(Tcl_Interp *interp, const char *command) } declare 178 { - int Tcl_GlobalEvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr) + TCL_DEPRECATED int Tcl_GlobalEvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr) } declare 179 { int Tcl_HideCommand(Tcl_Interp *interp, const char *cmdName, @@ -782,7 +782,7 @@ declare 219 { } # Obsolete declare 220 { - int Tcl_SeekOld(Tcl_Channel chan, int offset, int mode) + TCL_DEPRECATED int Tcl_SeekOld(Tcl_Channel chan, int offset, int mode) } declare 221 { int Tcl_ServiceAll(void) @@ -837,7 +837,7 @@ declare 236 { void Tcl_SetStdChannel(Tcl_Channel channel, int type) } declare 237 { - CONST84_RETURN char *Tcl_SetVar(Tcl_Interp *interp, const char *varName, + TCL_DEPRECATED CONST84_RETURN char *Tcl_SetVar(Tcl_Interp *interp, const char *varName, const char *newValue, int flags) } declare 238 { @@ -870,10 +870,10 @@ declare 245 { } # Obsolete declare 246 { - int Tcl_TellOld(Tcl_Channel chan) + TCL_DEPRECATED int Tcl_TellOld(Tcl_Channel chan) } declare 247 { - int Tcl_TraceVar(Tcl_Interp *interp, const char *varName, int flags, + TCL_DEPRECATED int Tcl_TraceVar(Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData) } declare 248 { @@ -894,14 +894,14 @@ declare 252 { int Tcl_UnregisterChannel(Tcl_Interp *interp, Tcl_Channel chan) } declare 253 { - int Tcl_UnsetVar(Tcl_Interp *interp, const char *varName, int flags) + TCL_DEPRECATED int Tcl_UnsetVar(Tcl_Interp *interp, const char *varName, int flags) } declare 254 { int Tcl_UnsetVar2(Tcl_Interp *interp, const char *part1, const char *part2, int flags) } declare 255 { - void Tcl_UntraceVar(Tcl_Interp *interp, const char *varName, int flags, + TCL_DEPRECATED void Tcl_UntraceVar(Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData) } declare 256 { @@ -913,7 +913,7 @@ declare 257 { void Tcl_UpdateLinkedVar(Tcl_Interp *interp, const char *varName) } declare 258 { - int Tcl_UpVar(Tcl_Interp *interp, const char *frameName, + TCL_DEPRECATED int Tcl_UpVar(Tcl_Interp *interp, const char *frameName, const char *varName, const char *localName, int flags) } declare 259 { @@ -921,10 +921,10 @@ declare 259 { const char *part2, const char *localName, int flags) } declare 260 { - int Tcl_VarEval(Tcl_Interp *interp, ...) + TCL_DEPRECATED int Tcl_VarEval(Tcl_Interp *interp, ...) } declare 261 { - ClientData Tcl_VarTraceInfo(Tcl_Interp *interp, const char *varName, + TCL_DEPRECATED ClientData Tcl_VarTraceInfo(Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData) } declare 262 { @@ -980,7 +980,7 @@ declare 275 { void Tcl_SetErrorCodeVA(Tcl_Interp *interp, va_list argList) } declare 276 { - int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList) + TCL_DEPRECATED int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList) } declare 277 { Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options) @@ -1045,7 +1045,7 @@ declare 289 { void Tcl_DeleteThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData) } declare 290 { - void Tcl_DiscardResult(Tcl_SavedResult *statePtr) + TCL_DEPRECATED void Tcl_DiscardResult(Tcl_SavedResult *statePtr) } declare 291 { int Tcl_EvalEx(Tcl_Interp *interp, const char *script, int numBytes, @@ -1128,10 +1128,10 @@ declare 313 { int appendFlag) } declare 314 { - void Tcl_RestoreResult(Tcl_Interp *interp, Tcl_SavedResult *statePtr) + TCL_DEPRECATED void Tcl_RestoreResult(Tcl_Interp *interp, Tcl_SavedResult *statePtr) } declare 315 { - void Tcl_SaveResult(Tcl_Interp *interp, Tcl_SavedResult *statePtr) + TCL_DEPRECATED void Tcl_SaveResult(Tcl_Interp *interp, Tcl_SavedResult *statePtr) } declare 316 { int Tcl_SetSystemEncoding(Tcl_Interp *interp, const char *name) @@ -1215,10 +1215,10 @@ declare 340 { char *Tcl_GetString(Tcl_Obj *objPtr) } declare 341 { - CONST84_RETURN char *Tcl_GetDefaultEncodingDir(void) + TCL_DEPRECATED CONST84_RETURN char *Tcl_GetDefaultEncodingDir(void) } declare 342 { - void Tcl_SetDefaultEncodingDir(const char *path) + TCL_DEPRECATED void Tcl_SetDefaultEncodingDir(const char *path) } declare 343 { void Tcl_AlertNotifier(ClientData clientData) @@ -1267,7 +1267,7 @@ declare 356 { int flags) } declare 357 { - Tcl_Obj *Tcl_EvalTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr, + TCL_DEPRECATED Tcl_Obj *Tcl_EvalTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr, int count) } declare 358 { @@ -1549,12 +1549,12 @@ declare 434 { # TIP#15 (math function introspection) dkf declare 435 { - int Tcl_GetMathFuncInfo(Tcl_Interp *interp, const char *name, + TCL_DEPRECATED 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) + TCL_DEPRECATED Tcl_Obj *Tcl_ListMathFuncs(Tcl_Interp *interp, const char *pattern) } # TIP#36 (better access to 'subst') dkf diff --git a/generic/tcl.h b/generic/tcl.h index a08edde..aaf0ce7 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -54,12 +54,12 @@ extern "C" { */ #define TCL_MAJOR_VERSION 8 -#define TCL_MINOR_VERSION 6 -#define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TCL_RELEASE_SERIAL 4 +#define TCL_MINOR_VERSION 7 +#define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE +#define TCL_RELEASE_SERIAL 0 -#define TCL_VERSION "8.6" -#define TCL_PATCH_LEVEL "8.6.4" +#define TCL_VERSION "8.7" +#define TCL_PATCH_LEVEL "8.7-alpha.0" /* *---------------------------------------------------------------------------- diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 5c5bc64..4f10702 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -935,7 +935,7 @@ Tcl_CreateInterp(void) * Set up other variables such as tcl_version and tcl_library */ - Tcl_SetVar(interp, "tcl_patchLevel", TCL_PATCH_LEVEL, TCL_GLOBAL_ONLY); + Tcl_SetVar(interp, "tcl_patchLevel", TCL_PATCH_LEVEL "+foo", TCL_GLOBAL_ONLY); Tcl_SetVar(interp, "tcl_version", TCL_VERSION, TCL_GLOBAL_ONLY); Tcl_TraceVar2(interp, "tcl_precision", NULL, TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, @@ -958,7 +958,7 @@ Tcl_CreateInterp(void) * TIP #268: Full patchlevel instead of just major.minor */ - Tcl_PkgProvideEx(interp, "Tcl", TCL_PATCH_LEVEL, &tclStubs); + Tcl_PkgProvideEx(interp, "Tcl", TCL_PATCH_LEVEL "+foo", &tclStubs); if (TclTommath_Init(interp) != TCL_OK) { Tcl_Panic("%s", Tcl_GetString(Tcl_GetObjResult(interp))); diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 0da5d47..9f94420 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -406,10 +406,11 @@ Tcl_Init( " lappend scripts {\n" "set parentDir [file dirname [file dirname [info nameofexecutable]]]\n" "set grandParentDir [file dirname $parentDir]\n" -"file join $parentDir lib tcl[info tclversion]} \\\n" -" {file join $grandParentDir lib tcl[info tclversion]} \\\n" +"file join $parentDir share tcl8} \\\n" +" {file join $grandParentDir share tcl8} \\\n" " {file join $parentDir library} \\\n" " {file join $grandParentDir library} \\\n" +" {file join $grandParentDir tcl[info tclversion] library} \\\n" " {file join $grandParentDir tcl[info patchlevel] library} \\\n" " {\n" "file join [file dirname $grandParentDir] tcl[info patchlevel] library}\n" diff --git a/generic/tclPkg.c b/generic/tclPkg.c index f6e8b20..9e4fb74 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -1278,7 +1278,7 @@ CheckVersionAndConvert( int *stable) /* Flag: Version is (un)stable. */ { const char *p = string; - char prevChar; + char prevChar = 0; int hasunstable = 0; /* * 4* assuming that each char is a separator (a,b become ' -x '). @@ -1299,6 +1299,10 @@ CheckVersionAndConvert( * (3) s.a. * (4) Only one of 'a' or 'b' may occur. * (5) Neither 'a', nor 'b' may occur before or after a '.' + * + * TIP ???, Modified rules + * In stead of "a" and "b" in the above rules, the longer + * forms "-alpha." and "-beta." are accepted as well */ if (!isdigit(UCHAR(*p))) { /* INTL: digit */ @@ -1307,36 +1311,44 @@ CheckVersionAndConvert( *ip++ = *p; - for (prevChar = *p, p++; *p != 0; p++) { + for (prevChar = *p, p++; (*p != 0) && (*p != '+'); p++) { if (!isdigit(UCHAR(*p)) && /* INTL: digit */ - ((*p!='.' && *p!='a' && *p!='b') || - ((hasunstable && (*p=='a' || *p=='b')) || + ((*p!='.' && *p!='a' && *p!='b' && *p!='-') || + ((hasunstable && (*p=='a' || *p=='b'|| *p=='-')) || ((prevChar=='a' || prevChar=='b' || prevChar=='.') && (*p=='.')) || ((*p=='a' || *p=='b' || *p=='.') && prevChar=='.')))) { goto error; } - if (*p == 'a' || *p == 'b') { - hasunstable = 1; - } - /* * Translation to the internal rep. Regular version chars are copied * as is. The separators are translated to numerics. The new separator * for all parts is space. */ - if (*p == '.') { + prevChar = *p; + if (*p == '-') { + if (!strncmp(p+1, "alpha.", 6)) { + p += 6; + prevChar = 'a'; + } else if (!strncmp(p+1, "beta.", 5)) { + p += 5; + prevChar = 'b'; + } + } + if (prevChar == '.') { *ip++ = ' '; *ip++ = '0'; *ip++ = ' '; - } else if (*p == 'a') { + } else if (prevChar == 'a') { + hasunstable = 1; *ip++ = ' '; *ip++ = '-'; *ip++ = '2'; *ip++ = ' '; - } else if (*p == 'b') { + } else if (prevChar == 'b') { + hasunstable = 1; *ip++ = ' '; *ip++ = '-'; *ip++ = '1'; @@ -1345,7 +1357,6 @@ CheckVersionAndConvert( *ip++ = *p; } - prevChar = *p; } if (prevChar!='.' && prevChar!='a' && prevChar!='b') { *ip = '\0'; @@ -1612,7 +1623,10 @@ CheckRequirement( char *dash = NULL, *buf; dash = strchr(string, '-'); - if (dash == NULL) { + if ((dash != NULL) && (dash[1]=='a' || dash[1]=='b')) { + dash = strchr(dash+1, '-'); + } + if ((dash == NULL) || dash[1]=='a' || dash[1]=='b') { /* * No dash found, has to be a simple version. */ @@ -1620,7 +1634,8 @@ CheckRequirement( return CheckVersionAndConvert(interp, string, NULL, NULL); } - if (strchr(dash+1, '-') != NULL) { + buf = strchr(dash+1, '-'); + if ((buf != NULL) && isdigit(UCHAR(dash[1]))) { /* * More dashes found after the first. This is wrong. */ @@ -1800,7 +1815,10 @@ RequirementSatisfied( char *dash = NULL, *buf, *min, *max; dash = strchr(req, '-'); - if (dash == NULL) { + if ((dash != NULL) && (dash[1]=='a' || dash[1]=='b')) { + dash = strchr(dash+1, '-'); + } + if ((dash == NULL) || dash[1]=='a' || dash[1]=='b') { /* * No dash found, is a simple version, fallback to regular check. The * 'CheckVersionAndConvert' cannot fail. We pad the requirement with diff --git a/generic/tclTest.c b/generic/tclTest.c index 600f5ec..83d147d 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -552,7 +552,7 @@ Tcltest_Init( } /* TIP #268: Full patchlevel instead of just major.minor */ - if (Tcl_PkgProvide(interp, "Tcltest", TCL_PATCH_LEVEL) == TCL_ERROR) { + if (Tcl_PkgProvide(interp, "Tcltest", TCL_PATCH_LEVEL "+foo") == TCL_ERROR) { return TCL_ERROR; } diff --git a/generic/tclTomMathInterface.c b/generic/tclTomMathInterface.c index 48db8c3..f278986 100644 --- a/generic/tclTomMathInterface.c +++ b/generic/tclTomMathInterface.c @@ -41,7 +41,7 @@ TclTommath_Init( { /* TIP #268: Full patchlevel instead of just major.minor */ - if (Tcl_PkgProvideEx(interp, "tcl::tommath", TCL_PATCH_LEVEL, + if (Tcl_PkgProvideEx(interp, "tcl::tommath", TCL_PATCH_LEVEL "+foo", &tclTomMathStubs) != TCL_OK) { return TCL_ERROR; } |