Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch regexp-api-64bit Excluding Merge-Ins
This is equivalent to a diff from 02588757a0 to f0009090a2
2019-05-31
| ||
12:50 | TIP 537 implementation: Enable 64-bit indexes in regexp matching check-in: 6e8aae14c1 user: jan.nijtmans tags: trunk | |
2019-05-11
| ||
12:58 | merge 8.7 check-in: 28bee6ebed user: dgp tags: trunk | |
2019-05-10
| ||
15:03 | merge trunk check-in: b516dcc426 user: dgp tags: dgp-refactor | |
15:02 | merge trunk check-in: 80416841b2 user: dgp tags: dgp-properbytearray | |
07:50 | Merge trunk Closed-Leaf check-in: f0009090a2 user: jan.nijtmans tags: regexp-api-64bit | |
2019-05-09
| ||
22:22 | Merge trunk check-in: c4e0e90764 user: jan.nijtmans tags: novem | |
20:42 | Merge 8.7. Define Tcl_GetStringResult() as macro. check-in: 02588757a0 user: jan.nijtmans tags: trunk | |
20:06 | If compiling with -DTCL_NO_DEPRECATED, make Tcl_GetStringResult() a macro. This opens up one more si... check-in: 0dd1983bb0 user: jan.nijtmans tags: core-8-branch | |
15:54 | Merge 8.7 check-in: ae930f1386 user: jan.nijtmans tags: trunk | |
2019-04-02
| ||
20:09 | Merge trunk check-in: 85c116565b user: jan.nijtmans tags: regexp-api-64bit | |
Changes to doc/RegExp.3.
︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | - + - + - + - + | by \fBTcl_GetRegExpFromObj\fR or \fBTcl_RegExpCompile\fR. .AP char *start in If \fItext\fR is just a portion of some other string, this argument identifies the beginning of the larger string. If it is not the same as \fItext\fR, then no .QW \fB^\fR matches will be allowed. |
︙ | |||
333 334 335 336 337 338 339 | 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | - + - + - - + + | \fBTcl_RegExpGetInfo\fR retrieves information about the last match performed with a given regular expression \fIregexp\fR. The \fIinfoPtr\fR argument contains a pointer to a structure that is defined as follows: .PP .CS typedef struct Tcl_RegExpInfo { |
︙ |
Changes to doc/Utf.3.
︙ | |||
240 241 242 243 244 245 246 | 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | - + | specified character (not byte) \fIindex\fR in the UTF-8 string \fIsrc\fR. The source string must contain at least \fIindex\fR characters. .PP \fBTcl_UtfAtIndex\fR returns a pointer to the specified character (not byte) \fIindex\fR in the UTF-8 string \fIsrc\fR. The source string must contain at least \fIindex\fR characters. This is equivalent to calling |
︙ |
Changes to generic/regcomp.c.
︙ | |||
334 335 336 337 338 339 340 | 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | - | v->cv = NULL; v->cv2 = NULL; v->lacons = NULL; v->nlacons = 0; v->spaceused = 0; re->re_magic = REMAGIC; re->re_info = 0; /* bits get set during parse */ |
︙ | |||
2081 2082 2083 2084 2085 2086 2087 | 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 | - - + + | g = (struct guts *) re->re_guts; if (g->magic != GUTSMAGIC) { fprintf(f, "bad guts magic number (0x%x not 0x%x)\n", g->magic, GUTSMAGIC); } fprintf(f, "\n\n\n========= DUMP ==========\n"); |
︙ |
Changes to generic/regex.h.
︙ | |||
113 114 115 116 117 118 119 | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | - + - - - + + | /* * other interface types */ /* the biggie, a compiled RE (or rather, a front end to same) */ typedef struct { int re_magic; /* magic number */ |
︙ |
Changes to generic/regexec.c.
︙ | |||
183 184 185 186 187 188 189 | 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | - - - - | * Sanity checks. */ if (re == NULL || string == NULL || re->re_magic != REMAGIC) { FreeVars(v); return REG_INVARG; } |
︙ | |||
885 886 887 888 889 890 891 | 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 | - + | assert(t->op == 'b'); assert(n >= 0); assert((size_t)n < v->nmatch); MDEBUG(("cbackref n%d %d{%d-%d}\n", t->id, n, min, max)); /* get the backreferenced string */ |
︙ |
Changes to generic/tcl.h.
︙ | |||
455 456 457 458 459 460 461 | 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | - + - + - + - + - | /* * Structures filled in by Tcl_RegExpInfo. Note that all offset values are * relative to the start of the match string, not the beginning of the entire * string. */ typedef struct Tcl_RegExpIndices { |
︙ | |||
2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 | 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 | + | /* * Constants for special size_t-typed values, see TIP #494 */ #define TCL_IO_FAILURE ((size_t)-1) #define TCL_AUTO_LENGTH ((size_t)-1) #define TCL_INDEX_NONE ((size_t)-1) /* *---------------------------------------------------------------------------- * Single public declaration for NRE. */ typedef int (Tcl_NRPostProc) (void *data[], Tcl_Interp *interp, |
︙ |
Changes to generic/tclCmdMZ.c.
︙ | |||
123 124 125 126 127 128 129 | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | - + - | int Tcl_RegexpObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { |
︙ | |||
305 306 307 308 309 310 311 | 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | - + | * considered the start of the line. If for example the pattern {^} is * passed and -start is positive, then the pattern will not match the * start of the string unless the previous character is a newline. */ if (offset == TCL_INDEX_START) { eflags = 0; |
︙ | |||
361 362 363 364 365 366 367 | 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | - + - + - + - - + + - - + + - + | resultPtr = Tcl_NewObj(); } } for (i = 0; i < objc; i++) { Tcl_Obj *newPtr; if (indices) { |
︙ | |||
441 442 443 444 445 446 447 | 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | - + | * these cases we always want to bump the index up one. */ if (matchLength == 0) { offset++; } all++; |
︙ | |||
484 485 486 487 488 489 490 | 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | - - - + + + | int Tcl_RegsubObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { |
︙ | |||
509 510 511 512 513 514 515 | 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | - + | cflags = TCL_REG_ADVANCED; all = 0; offset = TCL_INDEX_START; command = 0; resultPtr = NULL; |
︙ | |||
545 546 547 548 549 550 551 | 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 | - + - + | cflags |= TCL_REG_NLSTOP; break; case REGSUB_LINEANCHOR: cflags |= TCL_REG_NLANCH; break; case REGSUB_START: { size_t temp; |
︙ | |||
1265 1266 1267 1268 1269 1270 1271 | 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 | - + | Tcl_ListObjAppendElement(NULL, listPtr, objPtr); stringPtr = p + 1; } TclNewStringObj(objPtr, stringPtr, end - stringPtr); Tcl_ListObjAppendElement(NULL, listPtr, objPtr); } else { const char *element, *p, *splitEnd; |
︙ | |||
1978 1979 1980 1981 1982 1983 1984 | 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 | - + - | static int StringMapCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { |
︙ | |||
2020 2021 2022 2023 2024 2025 2026 | 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 | - - + + - + - - + + + - + + | Tcl_DictSearch search; /* * We know the type exactly, so all dict operations will succeed for * sure. This shortens this code quite a bit. */ |
︙ | |||
3480 3481 3482 3483 3484 3485 3486 | 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 | - + - + | int TclNRSwitchObjCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { |
︙ | |||
3793 3794 3795 3796 3797 3798 3799 | 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 | - - - + + + | TclNewObj(indicesObj); } for (j=0 ; j<=info.nsubs ; j++) { if (indexVarObj != NULL) { Tcl_Obj *rangeObjAry[2]; |
︙ | |||
3912 3913 3914 3915 3916 3917 3918 | 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 | - + | for (k=0; k < objc; k++) { ctxPtr->line[k] = -1; } } } for (j = i + 1; ; j += 2) { |
︙ |
Changes to generic/tclEnv.c.
︙ | |||
226 227 228 229 230 231 232 | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | - + | * exist, enlarge the array if necessary to make room. If the name exists, * free its old entry. */ Tcl_MutexLock(&envMutex); index = TclpFindVariable(name, &length); |
︙ | |||
310 311 312 313 314 315 316 | 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | - + | /* * Watch out for versions of putenv that copy the string (e.g. VC++). In * this case we need to free the string immediately. Otherwise update the * string in the cache. */ |
︙ |
Changes to generic/tclInt.decls.
︙ | |||
610 611 612 613 614 615 616 | 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 | - - + + | # Added for Tcl 8.2 declare 150 { int TclRegAbout(Tcl_Interp *interp, Tcl_RegExp re) } declare 151 { |
︙ |
Changes to generic/tclInt.h.
︙ | |||
4123 4124 4125 4126 4127 4128 4129 | 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 | - | MODULE_SCOPE int TclIndexEncode(Tcl_Interp *interp, Tcl_Obj *objPtr, size_t before, size_t after, int *indexPtr); MODULE_SCOPE size_t TclIndexDecode(int encoded, size_t endValue); /* Constants used in index value encoding routines. */ #define TCL_INDEX_END ((size_t)-2) |
︙ | |||
4967 4968 4969 4970 4971 4972 4973 | 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 | - + | */ #if (!defined(TCL_WIDE_INT_IS_LONG) || (LONG_MAX > UINT_MAX)) && (SIZE_MAX <= UINT_MAX) # define TclWideIntFromSize(value) (((Tcl_WideInt)(((size_t)(value))+1))-1) # define TclNewWideIntObjFromSize(value) \ Tcl_NewWideIntObj(TclWideIntFromSize(value)) #else |
︙ |
Changes to generic/tclIntDecls.h.
︙ | |||
333 334 335 336 337 338 339 | 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | - + | EXTERN TclHandle TclHandlePreserve(TclHandle handle); /* 149 */ EXTERN void TclHandleRelease(TclHandle handle); /* 150 */ EXTERN int TclRegAbout(Tcl_Interp *interp, Tcl_RegExp re); /* 151 */ EXTERN void TclRegExpRangeUniChar(Tcl_RegExp re, size_t index, |
︙ | |||
735 736 737 738 739 740 741 | 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 | - + | void (*tclHideLiteral) (Tcl_Interp *interp, struct CompileEnv *envPtr, int index); /* 144 */ const struct AuxDataType * (*tclGetAuxDataType) (const char *typeName); /* 145 */ TclHandle (*tclHandleCreate) (void *ptr); /* 146 */ void (*tclHandleFree) (TclHandle handle); /* 147 */ TclHandle (*tclHandlePreserve) (TclHandle handle); /* 148 */ void (*tclHandleRelease) (TclHandle handle); /* 149 */ int (*tclRegAbout) (Tcl_Interp *interp, Tcl_RegExp re); /* 150 */ |
︙ |
Changes to generic/tclRegexp.c.
︙ | |||
260 261 262 263 264 265 266 | 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | - + | * in (sub-)range here. */ { TclRegexp *regexpPtr = (TclRegexp *) re; const char *string; if (index > regexpPtr->re.re_nsub) { *startPtr = *endPtr = NULL; |
︙ | |||
359 360 361 362 363 364 365 | 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 | - + - + - + - + - - - + + + | void TclRegExpRangeUniChar( Tcl_RegExp re, /* Compiled regular expression that has been * passed to Tcl_RegExpExec. */ size_t index, /* 0 means give the range of the entire match, * > 0 means give the range of a matching |
︙ | |||
673 674 675 676 677 678 679 | 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 | - + | * Assume that there will never be more than INT_MAX subexpressions. This * is a pretty reasonable assumption; the RE engine doesn't scale _that_ * well and Tcl has other limits that constrain things as well... */ resultObj = Tcl_NewObj(); Tcl_ListObjAppendElement(NULL, resultObj, |
︙ |
Changes to generic/tclStringObj.c.
︙ | |||
1400 1401 1402 1403 1404 1405 1406 | 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 | - + - + - - + + | * "TCL STRING GROWTH ALGORITHM" comment at the top of this file for an * explanation of this growth algorithm. */ numChars = stringPtr->numChars + appendNumChars; if (numChars > stringPtr->maxChars) { |
︙ |
Changes to generic/tclTest.c.
︙ | |||
341 342 343 344 345 346 347 | 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | - + | static int TestregexpObjCmd(void *dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int TestreturnObjCmd(void *dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static void TestregexpXflags(const char *string, |
︙ | |||
4006 4007 4008 4009 4010 4011 4012 | 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 | - + - + - + - + - - - + + + - + - - + + - + | * value 0. */ Tcl_SetIntObj(Tcl_GetObjResult(interp), 0); if (objc > 2 && (cflags®_EXPECT) && indices) { const char *varName; const char *value; |
︙ | |||
4122 4123 4124 4125 4126 4127 4128 | 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 | - + + - + | * *---------------------------------------------------------------------- */ static void TestregexpXflags( const char *string, /* The string of flags. */ |
︙ |
Changes to generic/tclUtf.c.
︙ | |||
1023 1024 1025 1026 1027 1028 1029 | 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 | - + | register size_t index) /* The position of the desired character. */ { Tcl_UniChar ch = 0; #if TCL_UTF_MAX <= 4 size_t len = 0; #endif |
︙ |
Changes to generic/tclUtil.c.
︙ | |||
2633 2634 2635 2636 2637 2638 2639 | 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 | - - + + - + | * *---------------------------------------------------------------------- */ char * Tcl_DStringAppend( Tcl_DString *dsPtr, /* Structure describing dynamic string. */ |
︙ | |||
2660 2661 2662 2663 2664 2665 2666 | 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 | - + - + - - + + | dsPtr->spaceAvl = newSize * 2; if (dsPtr->string == dsPtr->staticSpace) { char *newString = Tcl_Alloc(dsPtr->spaceAvl); memcpy(newString, dsPtr->string, dsPtr->length); dsPtr->string = newString; } else { |
︙ |