Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix travis build (.travis.yml), and merge 8.7 |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | tip-549 |
Files: | files | file ages | folders |
SHA3-256: |
ed3800e114e500c9b08ab38c27d189cb |
User & Date: | jan.nijtmans 2019-06-14 14:04:22.909 |
Context
2019-06-14
| ||
14:04 | Fix travis build (.travis.yml), and merge 8.7 Closed-Leaf check-in: ed3800e114 user: jan.nijtmans tags: tip-549 | |
2019-06-12
| ||
15:26 | Eliminate (internal) TclOffset() usage, just use offsetof() in stead. check-in: f0c76dd6a8 user: jan.nijtmans tags: core-8-branch | |
2019-06-07
| ||
16:54 | New TIP implementation: Make configure --enable-64bit the default check-in: 93a999f923 user: jan.nijtmans tags: tip-549 | |
Changes
Changes to .travis.yml.
︙ | |||
140 141 142 143 144 145 146 | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | - + | - binutils-mingw-w64-i686 - gcc-mingw-w64-i686 - gcc-mingw-w64 - gcc-multilib - wine env: - BUILD_DIR=win |
︙ |
Changes to doc/expr.n.
︙ | |||
93 94 95 96 97 98 99 | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | - + | \fBTcl\fR. .PP Below are some examples of simple expressions where the value of \fBa\fR is 3 and the value of \fBb\fR is 6. The command on the left side of each line produces the value on the right side. .PP .CS |
︙ | |||
186 187 188 189 190 191 192 | 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | - + + + + + + - + + + | \fB|\fR . Bit-wise OR. Valid for integer operands. .TP 20 \fB&&\fR . Logical AND. If both operands are true, the result is 1, or 0 otherwise. |
︙ | |||
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 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 405 406 407 408 | - - + + + + + + + - - + - + + + + + + + + + + + + + + + + + + + + + + + | substitutions on, enclosing an expression in braces or otherwise quoting it so that it's a static value allows the Tcl compiler to generate bytecode for the expression, resulting in better speed and smaller storage requirements. This also avoids issues that can arise if Tcl is allowed to perform substitution on the value before \fBexpr\fR is called. .PP In the following example, the value of the expression is 11 because the Tcl parser first |
︙ |
Changes to generic/tclAssembly.c.
︙ | |||
513 514 515 516 517 518 519 520 521 522 523 524 525 526 | 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | + | * The instructions must be in ascending order by numeric operation code. */ static const unsigned char NonThrowingByteCodes[] = { INST_PUSH1, INST_PUSH4, INST_POP, INST_DUP, /* 1-4 */ INST_JUMP1, INST_JUMP4, /* 34-35 */ INST_END_CATCH, INST_PUSH_RESULT, INST_PUSH_RETURN_CODE, /* 70-72 */ INST_STR_EQ, INST_STR_NEQ, INST_STR_CMP, INST_STR_LEN, /* 73-76 */ INST_LIST, /* 79 */ INST_OVER, /* 95 */ INST_PUSH_RETURN_OPTIONS, /* 108 */ INST_REVERSE, /* 126 */ INST_NOP, /* 132 */ INST_STR_MAP, /* 143 */ INST_STR_FIND, /* 144 */ |
︙ |
Changes to generic/tclBasic.c.
︙ | |||
596 597 598 599 600 601 602 | 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 | - - + + | } #if defined(_WIN32) && !defined(_WIN64) if (sizeof(time_t) != 4) { /*NOTREACHED*/ Tcl_Panic("<time.h> is not compatible with MSVC"); } |
︙ |
Changes to generic/tclBinary.c.
︙ | |||
155 156 157 158 159 160 161 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | - - - - + + + + - - - + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - + + + + + + - - - - - - + + + + + - - - + + + - - - - - - - - + + + + + + + - - + + - - + + - - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + | { "hex", BinaryDecodeHex, TclCompileBasic1Or2ArgCmd, NULL, NULL, 0 }, { "uuencode", BinaryDecodeUu, TclCompileBasic1Or2ArgCmd, NULL, NULL, 0 }, { "base64", BinaryDecode64, TclCompileBasic1Or2ArgCmd, NULL, NULL, 0 }, { NULL, NULL, NULL, NULL, NULL, 0 } }; /* |
︙ | |||
278 279 280 281 282 283 284 | 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | - + | * minus 1 byte. */ unsigned char bytes[1]; /* The array of bytes. The actual size of this * field depends on the 'allocated' field * above. */ } ByteArray; #define BYTEARRAY_SIZE(len) \ |
︙ | |||
396 397 398 399 400 401 402 | 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | - - + + - + | * *---------------------------------------------------------------------- */ void Tcl_SetByteArrayObj( Tcl_Obj *objPtr, /* Object to initialize as a ByteArray. */ |
︙ | |||
719 720 721 722 723 724 725 726 727 728 729 730 731 732 | 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 | + + - + | } if (size > INT_MAX) { Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX); } if (size == length) { char *dst = Tcl_InitStringRep(objPtr, (char *)src, size); TclOOM(dst, size); } else { char *dst = Tcl_InitStringRep(objPtr, NULL, size); TclOOM(dst, size); for (i = 0; i < length; i++) { dst += Tcl_UniCharToUtf(src[i], dst); } |
︙ | |||
774 775 776 777 778 779 780 | 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 | - + | /* * Append zero bytes is a no-op. */ return; } |
︙ | |||
803 804 805 806 807 808 809 | 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 | + - + + + + - + + + + - + + + | */ if (needed > byteArrayPtr->allocated) { ByteArray *ptr = NULL; unsigned int attempt; if (needed <= INT_MAX/2) { /* |
︙ | |||
892 893 894 895 896 897 898 | 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 | - + | int arg; /* Index of next argument to consume. */ int value = 0; /* Current integer value to be packed. * Initialized to avoid compiler warning. */ char cmd; /* Current format character. */ int count; /* Count associated with current format * character. */ int flags; /* Format field flags */ |
︙ | |||
1078 1079 1080 1081 1082 1083 1084 | 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 | - - - + + + | */ resultPtr = Tcl_NewObj(); buffer = Tcl_SetByteArrayLength(resultPtr, length); memset(buffer, 0, length); /* |
︙ | |||
1293 1294 1295 1296 1297 1298 1299 | 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 | - + | TclListObjGetElements(interp, objv[arg], &listc, &listv); if (count == BINARY_ALL) { count = listc; } } arg++; for (i = 0; i < count; i++) { |
︙ | |||
1397 1398 1399 1400 1401 1402 1403 | 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 | - + | int arg; /* Index of next argument to consume. */ int value = 0; /* Current integer value to be packed. * Initialized to avoid compiler warning. */ char cmd; /* Current format character. */ int count; /* Count associated with current format * character. */ int flags; /* Format field flags */ |
︙ | |||
1456 1457 1458 1459 1460 1461 1462 | 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 | - + | /* * Trim trailing nulls and spaces, if necessary. */ if (cmd == 'A') { while (size > 0) { |
︙ | |||
2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 | 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 | + - + | * Single-precision floating point values. Tcl_GetDoubleFromObj * returns TCL_ERROR for NaN, but we can check by comparing the * object's type pointer. */ if (Tcl_GetDoubleFromObj(interp, src, &dvalue) != TCL_OK) { const Tcl_ObjIntRep *irPtr = TclFetchIntRep(src, &tclDoubleType); if (irPtr == NULL) { return TCL_ERROR; } dvalue = irPtr->doubleValue; } /* * Because some compilers will generate floating point exceptions on * an overflow cast (e.g. Borland), we restrict the values to the * valid range for float. */ |
︙ | |||
2184 2185 2186 2187 2188 2189 2190 | 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 | - - - + + + | static Tcl_Obj * ScanNumber( unsigned char *buffer, /* Buffer to scan number from. */ int type, /* Format character from "binary scan" */ int flags, /* Format field flags */ Tcl_HashTable **numberCachePtrPtr) |
︙ | |||
2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 | 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 | + - - - + + + | + (buffer[1] << 16) + (((long) buffer[0]) << 24)); } /* * Check to see if the value was sign extended properly on systems * where an int is more than 32-bits. * * We avoid caching unsigned integers as we cannot distinguish between * 32bit signed and unsigned in the hash (short and char are ok). */ if (flags & BINARY_UNSIGNED) { return Tcl_NewWideIntObj((Tcl_WideInt)(unsigned long)value); } |
︙ | |||
2469 2470 2471 2472 2473 2474 2475 | 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 | - - + + | return TCL_ERROR; } TclNewObj(resultObj); data = Tcl_GetByteArrayFromObj(objv[1], &count); cursor = Tcl_SetByteArrayLength(resultObj, count * 2); for (offset = 0; offset < count; ++offset) { |
︙ | |||
2510 2511 2512 2513 2514 2515 2516 | 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 | - + - + - + | enum {OPT_STRICT }; static const char *const optStrings[] = { "-strict", NULL }; if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?options? data"); return TCL_ERROR; } |
︙ | |||
2553 2554 2555 2556 2557 2558 2559 | 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 | - + | c -= '0'; if (c > 9) { c += ('0' - 'A') + 10; } if (c > 16) { c += ('A' - 'a'); } |
︙ | |||
2624 2625 2626 2627 2628 2629 2630 | 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 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 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 | - + - + - + - + - + - + - + - + - + - + | { Tcl_Obj *resultObj; unsigned char *data, *cursor, *limit; int maxlen = 0; const char *wrapchar = "\n"; int wrapcharlen = 1; int offset, i, index, size, outindex = 0, count = 0; |
︙ | |||
2734 2735 2736 2737 2738 2739 2740 | 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 | - + - + - + + - + - + - + - + - + - + | int lineLength = 61; const unsigned char SingleNewline[] = { (unsigned char) '\n' }; const unsigned char *wrapchar = SingleNewline; int wrapcharlen = sizeof(SingleNewline); enum { OPT_MAXLEN, OPT_WRAPCHAR }; static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL }; |
︙ | |||
2845 2846 2847 2848 2849 2850 2851 | 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 | - + - + - + | Tcl_Obj *const objv[]) { Tcl_Obj *resultObj = NULL; unsigned char *data, *datastart, *dataend; unsigned char *begin, *cursor; int i, index, size, count = 0, strict = 0, lineLen; unsigned char c; |
︙ | |||
2898 2899 2900 2901 2902 2903 2904 | 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 | - + | lineLen = (c - 32) & 0x3f; } /* * Now we read a four-character grouping. */ |
︙ | |||
3016 3017 3018 3019 3020 3021 3022 | 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 | - + - + | enum { OPT_STRICT }; static const char *const optStrings[] = { "-strict", NULL }; if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?options? data"); return TCL_ERROR; } |
︙ | |||
3058 3059 3060 3061 3062 3063 3064 | 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 | + - - + + + + - - + + - + - - - + + + + + - + + + | if (data < dataend) { c = *data++; } else if (i > 1) { c = '='; } else { if (strict && i <= 1) { /* |
︙ | |||
3143 3144 3145 3146 3147 3148 3149 | 3159 3160 3161 3162 3163 3164 3165 | - | /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ |
Changes to generic/tclCkalloc.c.
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | - + | size_t refCount; /* Number of mem_headers referencing this * tag. */ char string[1]; /* Actual size of string will be as large as * needed for actual tag. This must be the * last field in the structure. */ } MemTag; |
︙ |
Changes to generic/tclCompile.c.
︙ | |||
3026 3027 3028 3029 3030 3031 3032 | 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 | - + | /* * Create a new variable if appropriate. */ if (create || (name == NULL)) { localVar = procPtr->numCompiledLocals; |
︙ |
Changes to generic/tclExecute.c.
︙ | |||
207 208 209 210 211 212 213 | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | - + | } while (0) /* * These variable-access macros have to coincide with those in tclVar.c */ #define VarHashGetValue(hPtr) \ |
︙ |
Changes to generic/tclHash.c.
︙ | |||
805 806 807 808 809 810 811 | 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 | - + | Tcl_HashEntry *hPtr; unsigned int size, allocsize; allocsize = size = strlen(string) + 1; if (size < sizeof(hPtr->key)) { allocsize = sizeof(hPtr->key); } |
︙ |
Changes to generic/tclIO.h.
︙ | |||
46 47 48 49 50 51 52 | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | - + | /* Next buffer in chain. */ char buf[1]; /* Placeholder for real buffer. The real * buffer occuppies this space + bufSize-1 * bytes. This must be the last field in the * structure. */ } ChannelBuffer; |
︙ |
Changes to generic/tclInt.h.
︙ | |||
75 76 77 78 79 80 81 | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | - + | #endif #ifdef NO_STRING_H #include "../compat/string.h" #else #include <string.h> #endif #if defined(STDC_HEADERS) || defined(__STDC__) || defined(__C99__FUNC__) \ |
︙ | |||
4025 4026 4027 4028 4029 4030 4031 | 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 | - - - - - - - - - - - - - - - - - - | struct CompileEnv *envPtr); MODULE_SCOPE int TclDivOpCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); MODULE_SCOPE int TclCompileDivOpCmd(Tcl_Interp *interp, Tcl_Parse *parsePtr, Command *cmdPtr, struct CompileEnv *envPtr); |
︙ | |||
4882 4883 4884 4885 4886 4887 4888 | 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 | - - - + + - - - - + + + + + + | # define TclIsNaN(d) ((d) != (d)) # else # define TclIsNaN(d) (isnan(d)) # endif #endif /* |
︙ |
Changes to generic/tclOOMethod.c.
︙ | |||
117 118 119 120 121 122 123 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | - + | /* * Helper macros (derived from things private to tclVar.c) */ #define TclVarTable(contextNs) \ ((Tcl_HashTable *) (&((Namespace *) (contextNs))->varTable)) #define TclVarHashGetValue(hPtr) \ |
︙ |
Changes to generic/tclProc.c.
︙ | |||
630 631 632 633 634 635 636 | 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 | - + | localPtr = localPtr->nextPtr; } else { /* * Allocate an entry in the runtime procedure frame's array of * local variables for the argument. */ |
︙ |
Changes to generic/tclTest.c.
︙ | |||
7706 7707 7708 7709 7710 7711 7712 | 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 | - + | if (resVarInfo->var) { HashVarFree(resVarInfo->var); } ckfree(vInfoPtr); } #define TclVarHashGetValue(hPtr) \ |
︙ |
Changes to generic/tclTrace.c.
︙ | |||
466 467 468 469 470 471 472 | 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | - + | break; } } command = TclGetStringFromObj(objv[5], &commandLength); length = (size_t) commandLength; if ((enum traceOptions) optionIndex == TRACE_ADD) { TraceCommandInfo *tcmdPtr = ckalloc( |
︙ | |||
703 704 705 706 707 708 709 | 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 | - + | } } command = TclGetStringFromObj(objv[5], &commandLength); length = (size_t) commandLength; if ((enum traceOptions) optionIndex == TRACE_ADD) { TraceCommandInfo *tcmdPtr = ckalloc( |
︙ | |||
906 907 908 909 910 911 912 | 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 | - + | break; } } command = TclGetStringFromObj(objv[5], &commandLength); length = (size_t) commandLength; if ((enum traceOptions) optionIndex == TRACE_ADD) { CombinedTraceVarInfo *ctvarPtr = ckalloc( |
︙ |
Changes to generic/tclVar.c.
︙ | |||
41 42 43 44 45 46 47 | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | - + | Tcl_Obj *key, int *newPtr); static inline Var * VarHashFirstVar(TclVarHashTable *tablePtr, Tcl_HashSearch *searchPtr); static inline Var * VarHashNextVar(Tcl_HashSearch *searchPtr); static inline void CleanupVar(Var *varPtr, Var *arrayPtr); #define VarHashGetValue(hPtr) \ |
︙ |
Changes to tools/tcltk-man2html-utils.tcl.
︙ | |||
1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 | 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 | + + + + | # set manual(toc-$manual(wing-file)-$manual(name)) \ [concat <DL> $manual(section-toc) </DL>] } if {!$verbose} { puts stderr "" } if {![llength $manual(wing-toc)]} { fatal "not table of contents." } # # make the wing table of contents for the section # set width 0 foreach name $manual(wing-toc) { if {[string length $name] > $width} { |
︙ |
Changes to tools/tcltk-man2html.tcl.
︙ | |||
27 28 29 30 31 32 33 34 35 36 37 38 39 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 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 | + + + + + + + + + + + + + + + + + + + + + + + - + - - + - - - - - + - - - - - - - - - - + + + + + + + + - - | ## ## Source the utility functions that provide most of the ## implementation of the transformation from nroff to html. ## source [file join [file dirname [info script]] tcltk-man2html-utils.tcl] proc getversion {tclh {name {}}} { if {[file exists $tclh]} { set chan [open $tclh] set data [read $chan] close $chan if {$name eq ""} { set name [string toupper [file root [file tail $tclh]]] } # backslash isn't required in front of quote, but it keeps syntax # highlighting straight in some editors if {[regexp -lineanchor \ [string map [list @name@ $name] \ {^#define\s+@name@_VERSION\s+\"([^.])+\.([^.\"]+)}] \ $data -> major minor]} { return [list $major $minor] } } } proc findversion {top name useversion} { # Default search version is a glob pattern, switch it for string match: if {$useversion eq {{,[8-9].[0-9]{,[.ab][0-9]{,[0-9]}}}}} { set useversion {[8-9].[0-9]} } # Search: set upper [string toupper $name] foreach top1 [list $top $top/..] sub {{} generic} { foreach dirname [ glob -nocomplain -tails -type d -directory $top1 *] { |
︙ | |||
146 147 148 149 150 151 152 153 154 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | + + + - - + + + + + + + + + - - + + + + + + + + + + + + - + + + + | } } if {!$build_tcl && !$build_tk} { set build_tcl 1; set build_tk 1 } set major "" set minor "" if {$build_tcl} { |
︙ |