Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | More simplifications, taking deprecations into account |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | utf-max |
Files: | files | file ages | folders |
SHA3-256: |
b95de9a62582a9dbc82f4840e4bbd20d |
User & Date: | jan.nijtmans 2019-05-22 21:50:14.195 |
Context
2019-05-31
| ||
23:35 | Merge tip-547 check-in: 9265001ec1 user: jan.nijtmans tags: utf-max | |
2019-05-22
| ||
21:50 | More simplifications, taking deprecations into account check-in: b95de9a625 user: jan.nijtmans tags: utf-max | |
07:33 | Merge 8.7 check-in: 94403689d1 user: jan.nijtmans tags: utf-max | |
Changes
Changes to generic/tcl.decls.
︙ | ︙ | |||
1244 1245 1246 1247 1248 1249 1250 | } declare 351 { int Tcl_UniCharIsWordChar(int ch) } declare 352 {deprecated {Use Tcl_GetCharLength}} { int Tcl_UniCharLen(const unsigned short *uniStr) } | | | | 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 | } declare 351 { int Tcl_UniCharIsWordChar(int ch) } declare 352 {deprecated {Use Tcl_GetCharLength}} { int Tcl_UniCharLen(const unsigned short *uniStr) } declare 353 {deprecated {Use Tcl_UtfNcmp}} { int Tcl_UniCharNcmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars) } declare 354 { char *Tcl_Utf16ToUtfDString(const unsigned short *uniStr, int uniLength, Tcl_DString *dsPtr) } declare 355 { |
︙ | ︙ | |||
1479 1480 1481 1482 1483 1484 1485 | } declare 417 { void Tcl_ClearChannelHandlers(Tcl_Channel channel) } declare 418 { int Tcl_IsChannelExisting(const char *channelName) } | | | | | | | 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 | } declare 417 { void Tcl_ClearChannelHandlers(Tcl_Channel channel) } declare 418 { int Tcl_IsChannelExisting(const char *channelName) } declare 419 {deprecated {Use Tcl_UtfNcasecmp}} { int Tcl_UniCharNcasecmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars) } declare 420 {deprecated {Use Tcl_StringCaseMatch}} { int Tcl_UniCharCaseMatch(const Tcl_UniChar *uniStr, const Tcl_UniChar *uniPattern, int nocase) } declare 421 { Tcl_HashEntry *Tcl_FindHashEntry(Tcl_HashTable *tablePtr, const void *key) } declare 422 { Tcl_HashEntry *Tcl_CreateHashEntry(Tcl_HashTable *tablePtr, const void *key, int *newPtr) |
︙ | ︙ | |||
2407 2408 2409 2410 2411 2412 2413 | declare 651 { int *TclGetUnicodeFromObj(Tcl_Obj *objPtr, int *lengthPtr) } declare 652 { void TclAppendUnicodeToObj(Tcl_Obj *objPtr, const int *unicode, int length) } | < < < < < < < < < < < < < | 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 | declare 651 { int *TclGetUnicodeFromObj(Tcl_Obj *objPtr, int *lengthPtr) } declare 652 { void TclAppendUnicodeToObj(Tcl_Obj *objPtr, const int *unicode, int length) } # ----- BASELINE -- FOR -- 8.7.0 ----- # ############################################################################## # Define the platform specific public Tcl interface. These functions are only # available on the designated platform. |
︙ | ︙ |
Changes to generic/tcl.h.
︙ | ︙ | |||
2140 2141 2142 2143 2144 2145 2146 | * then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If 6, * then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UCS-2 mode * is the default and recommended mode. UCS-4 is experimental and not * recommended. It works for the core, but most extensions expect UCS-2. */ #ifndef TCL_UTF_MAX | | | 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 | * then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If 6, * then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UCS-2 mode * is the default and recommended mode. UCS-4 is experimental and not * recommended. It works for the core, but most extensions expect UCS-2. */ #ifndef TCL_UTF_MAX #define TCL_UTF_MAX 3 #endif /* * This represents a Unicode character. Any changes to this should also be * reflected in regcustom.h. */ |
︙ | ︙ |
Changes to generic/tclCmdMZ.c.
︙ | ︙ | |||
600 601 602 603 604 605 606 | int slen, nocase, wsrclc; int (*strCmpFn)(const Tcl_UniChar*,const Tcl_UniChar*,unsigned long); Tcl_UniChar *p; numMatches = 0; nocase = (cflags & TCL_REG_NOCASE); | | | 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 | int slen, nocase, wsrclc; int (*strCmpFn)(const Tcl_UniChar*,const Tcl_UniChar*,unsigned long); Tcl_UniChar *p; numMatches = 0; nocase = (cflags & TCL_REG_NOCASE); strCmpFn = nocase ? Tcl_UniCharNcasecmp : Tcl_UniCharNcmp; wsrc = TclGetUnicodeFromObj(objv[0], &slen); wstring = TclGetUnicodeFromObj(objv[1], &wlen); wsubspec = TclGetUnicodeFromObj(objv[2], &wsublen); wend = wstring + wlen - (slen ? slen - 1 : 0); result = TCL_OK; |
︙ | ︙ | |||
2086 2087 2088 2089 2090 2091 2092 | * Empty input string, just stop now. */ goto done; } end = ustring1 + length1; | | | 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 | * Empty input string, just stop now. */ goto done; } end = ustring1 + length1; strCmpFn = (nocase ? Tcl_UniCharNcasecmp : Tcl_UniCharNcmp); /* * Force result to be Unicode */ resultPtr = TclNewUnicodeObj(ustring1, 0); |
︙ | ︙ |
Changes to generic/tclDecls.h.
︙ | ︙ | |||
1062 1063 1064 1065 1066 1067 1068 | EXTERN int Tcl_UniCharIsUpper(int ch); /* 351 */ EXTERN int Tcl_UniCharIsWordChar(int ch); /* 352 */ TCL_DEPRECATED("Use Tcl_GetCharLength") int Tcl_UniCharLen(const unsigned short *uniStr); /* 353 */ | > | | | 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 | EXTERN int Tcl_UniCharIsUpper(int ch); /* 351 */ EXTERN int Tcl_UniCharIsWordChar(int ch); /* 352 */ TCL_DEPRECATED("Use Tcl_GetCharLength") int Tcl_UniCharLen(const unsigned short *uniStr); /* 353 */ TCL_DEPRECATED("Use Tcl_UtfNcmp") int Tcl_UniCharNcmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 354 */ EXTERN char * Tcl_Utf16ToUtfDString(const unsigned short *uniStr, int uniLength, Tcl_DString *dsPtr); /* 355 */ EXTERN unsigned short * Tcl_UtfToUtf16DString(const char *src, int length, Tcl_DString *dsPtr); |
︙ | ︙ | |||
1247 1248 1249 1250 1251 1252 1253 | /* 416 */ EXTERN void Tcl_SpliceChannel(Tcl_Channel channel); /* 417 */ EXTERN void Tcl_ClearChannelHandlers(Tcl_Channel channel); /* 418 */ EXTERN int Tcl_IsChannelExisting(const char *channelName); /* 419 */ | > | | > | | | 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 | /* 416 */ EXTERN void Tcl_SpliceChannel(Tcl_Channel channel); /* 417 */ EXTERN void Tcl_ClearChannelHandlers(Tcl_Channel channel); /* 418 */ EXTERN int Tcl_IsChannelExisting(const char *channelName); /* 419 */ TCL_DEPRECATED("Use Tcl_UtfNcasecmp") int Tcl_UniCharNcasecmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 420 */ TCL_DEPRECATED("Use Tcl_StringCaseMatch") int Tcl_UniCharCaseMatch(const Tcl_UniChar *uniStr, const Tcl_UniChar *uniPattern, int nocase); /* 421 */ EXTERN Tcl_HashEntry * Tcl_FindHashEntry(Tcl_HashTable *tablePtr, const void *key); /* 422 */ EXTERN Tcl_HashEntry * Tcl_CreateHashEntry(Tcl_HashTable *tablePtr, const void *key, int *newPtr); /* 423 */ |
︙ | ︙ | |||
1918 1919 1920 1921 1922 1923 1924 | /* 650 */ EXTERN Tcl_Obj * TclNewUnicodeObj(const int *unicode, int numChars); /* 651 */ EXTERN int * TclGetUnicodeFromObj(Tcl_Obj *objPtr, int *lengthPtr); /* 652 */ EXTERN void TclAppendUnicodeToObj(Tcl_Obj *objPtr, const int *unicode, int length); | < < < < < < < < < | 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 | /* 650 */ EXTERN Tcl_Obj * TclNewUnicodeObj(const int *unicode, int numChars); /* 651 */ EXTERN int * TclGetUnicodeFromObj(Tcl_Obj *objPtr, int *lengthPtr); /* 652 */ EXTERN void TclAppendUnicodeToObj(Tcl_Obj *objPtr, const int *unicode, int length); typedef struct { const struct TclPlatStubs *tclPlatStubs; const struct TclIntStubs *tclIntStubs; const struct TclIntPlatStubs *tclIntPlatStubs; } TclStubHooks; |
︙ | ︙ | |||
2315 2316 2317 2318 2319 2320 2321 | int (*tcl_UniCharIsAlpha) (int ch); /* 346 */ int (*tcl_UniCharIsDigit) (int ch); /* 347 */ int (*tcl_UniCharIsLower) (int ch); /* 348 */ int (*tcl_UniCharIsSpace) (int ch); /* 349 */ int (*tcl_UniCharIsUpper) (int ch); /* 350 */ int (*tcl_UniCharIsWordChar) (int ch); /* 351 */ TCL_DEPRECATED_API("Use Tcl_GetCharLength") int (*tcl_UniCharLen) (const unsigned short *uniStr); /* 352 */ | | | 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 | int (*tcl_UniCharIsAlpha) (int ch); /* 346 */ int (*tcl_UniCharIsDigit) (int ch); /* 347 */ int (*tcl_UniCharIsLower) (int ch); /* 348 */ int (*tcl_UniCharIsSpace) (int ch); /* 349 */ int (*tcl_UniCharIsUpper) (int ch); /* 350 */ int (*tcl_UniCharIsWordChar) (int ch); /* 351 */ TCL_DEPRECATED_API("Use Tcl_GetCharLength") int (*tcl_UniCharLen) (const unsigned short *uniStr); /* 352 */ TCL_DEPRECATED_API("Use Tcl_UtfNcmp") int (*tcl_UniCharNcmp) (const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 353 */ char * (*tcl_Utf16ToUtfDString) (const unsigned short *uniStr, int uniLength, Tcl_DString *dsPtr); /* 354 */ unsigned short * (*tcl_UtfToUtf16DString) (const char *src, int length, Tcl_DString *dsPtr); /* 355 */ Tcl_RegExp (*tcl_GetRegExpFromObj) (Tcl_Interp *interp, Tcl_Obj *patObj, int flags); /* 356 */ TCL_DEPRECATED_API("Use Tcl_EvalTokensStandard") 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 */ |
︙ | ︙ | |||
2381 2382 2383 2384 2385 2386 2387 | int (*tcl_JoinThread) (Tcl_ThreadId threadId, int *result); /* 412 */ int (*tcl_IsChannelShared) (Tcl_Channel channel); /* 413 */ int (*tcl_IsChannelRegistered) (Tcl_Interp *interp, Tcl_Channel channel); /* 414 */ void (*tcl_CutChannel) (Tcl_Channel channel); /* 415 */ void (*tcl_SpliceChannel) (Tcl_Channel channel); /* 416 */ void (*tcl_ClearChannelHandlers) (Tcl_Channel channel); /* 417 */ int (*tcl_IsChannelExisting) (const char *channelName); /* 418 */ | | | | 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 | int (*tcl_JoinThread) (Tcl_ThreadId threadId, int *result); /* 412 */ int (*tcl_IsChannelShared) (Tcl_Channel channel); /* 413 */ int (*tcl_IsChannelRegistered) (Tcl_Interp *interp, Tcl_Channel channel); /* 414 */ void (*tcl_CutChannel) (Tcl_Channel channel); /* 415 */ void (*tcl_SpliceChannel) (Tcl_Channel channel); /* 416 */ void (*tcl_ClearChannelHandlers) (Tcl_Channel channel); /* 417 */ int (*tcl_IsChannelExisting) (const char *channelName); /* 418 */ TCL_DEPRECATED_API("Use Tcl_UtfNcasecmp") int (*tcl_UniCharNcasecmp) (const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 419 */ TCL_DEPRECATED_API("Use Tcl_StringCaseMatch") int (*tcl_UniCharCaseMatch) (const Tcl_UniChar *uniStr, const Tcl_UniChar *uniPattern, int nocase); /* 420 */ Tcl_HashEntry * (*tcl_FindHashEntry) (Tcl_HashTable *tablePtr, const void *key); /* 421 */ Tcl_HashEntry * (*tcl_CreateHashEntry) (Tcl_HashTable *tablePtr, const void *key, int *newPtr); /* 422 */ void (*tcl_InitCustomHashTable) (Tcl_HashTable *tablePtr, int keyType, const Tcl_HashKeyType *typePtr); /* 423 */ void (*tcl_InitObjHashTable) (Tcl_HashTable *tablePtr); /* 424 */ ClientData (*tcl_CommandTraceInfo) (Tcl_Interp *interp, const char *varName, int flags, Tcl_CommandTraceProc *procPtr, ClientData prevClientData); /* 425 */ int (*tcl_TraceCommand) (Tcl_Interp *interp, const char *varName, int flags, Tcl_CommandTraceProc *proc, ClientData clientData); /* 426 */ void (*tcl_UntraceCommand) (Tcl_Interp *interp, const char *varName, int flags, Tcl_CommandTraceProc *proc, ClientData clientData); /* 427 */ |
︙ | ︙ | |||
2615 2616 2617 2618 2619 2620 2621 | int (*tcl_UtfToUniChar) (const char *src, int *chPtr); /* 646 */ char * (*tcl_UniCharToUtfDString) (const int *uniStr, int uniLength, Tcl_DString *dsPtr); /* 647 */ int * (*tcl_UtfToUniCharDString) (const char *src, int length, Tcl_DString *dsPtr); /* 648 */ void (*tclSetUnicodeObj) (Tcl_Obj *objPtr, const int *unicode, int numChars); /* 649 */ Tcl_Obj * (*tclNewUnicodeObj) (const int *unicode, int numChars); /* 650 */ int * (*tclGetUnicodeFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 651 */ void (*tclAppendUnicodeToObj) (Tcl_Obj *objPtr, const int *unicode, int length); /* 652 */ | < < < | 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 | int (*tcl_UtfToUniChar) (const char *src, int *chPtr); /* 646 */ char * (*tcl_UniCharToUtfDString) (const int *uniStr, int uniLength, Tcl_DString *dsPtr); /* 647 */ int * (*tcl_UtfToUniCharDString) (const char *src, int length, Tcl_DString *dsPtr); /* 648 */ void (*tclSetUnicodeObj) (Tcl_Obj *objPtr, const int *unicode, int numChars); /* 649 */ Tcl_Obj * (*tclNewUnicodeObj) (const int *unicode, int numChars); /* 650 */ int * (*tclGetUnicodeFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 651 */ void (*tclAppendUnicodeToObj) (Tcl_Obj *objPtr, const int *unicode, int length); /* 652 */ } TclStubs; extern const TclStubs *tclStubsPtr; #ifdef __cplusplus } #endif |
︙ | ︙ | |||
3953 3954 3955 3956 3957 3958 3959 | (tclStubsPtr->tclSetUnicodeObj) /* 649 */ #define TclNewUnicodeObj \ (tclStubsPtr->tclNewUnicodeObj) /* 650 */ #define TclGetUnicodeFromObj \ (tclStubsPtr->tclGetUnicodeFromObj) /* 651 */ #define TclAppendUnicodeToObj \ (tclStubsPtr->tclAppendUnicodeToObj) /* 652 */ | < < < < < < | 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 | (tclStubsPtr->tclSetUnicodeObj) /* 649 */ #define TclNewUnicodeObj \ (tclStubsPtr->tclNewUnicodeObj) /* 650 */ #define TclGetUnicodeFromObj \ (tclStubsPtr->tclGetUnicodeFromObj) /* 651 */ #define TclAppendUnicodeToObj \ (tclStubsPtr->tclAppendUnicodeToObj) /* 652 */ #endif /* defined(USE_TCL_STUBS) */ /* !END!: Do not edit above this line. */ #if defined(USE_TCL_STUBS) # undef Tcl_CreateInterp |
︙ | ︙ | |||
4097 4098 4099 4100 4101 4102 4103 | * entries any more, they should use the 64-bit alternatives where * possible. Tcl 9 must find a better solution, but that cannot be done * without introducing a binary incompatibility. */ # undef Tcl_GetLongFromObj # undef Tcl_ExprLong # undef Tcl_ExprLongObj | | | | | | 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 | * entries any more, they should use the 64-bit alternatives where * possible. Tcl 9 must find a better solution, but that cannot be done * without introducing a binary incompatibility. */ # undef Tcl_GetLongFromObj # undef Tcl_ExprLong # undef Tcl_ExprLongObj # undef Tcl_UniCharNcmp # undef Tcl_UtfNcmp # undef Tcl_UtfNcasecmp # undef Tcl_UniCharNcasecmp # define Tcl_GetLongFromObj ((int(*)(Tcl_Interp*,Tcl_Obj*,long*))Tcl_GetWideIntFromObj) # define Tcl_ExprLong TclExprLong static inline int TclExprLong(Tcl_Interp *interp, const char *string, long *ptr){ int intValue; int result = tclStubsPtr->tcl_ExprLong(interp, string, (long *)&intValue); if (result == TCL_OK) *ptr = (long)intValue; return result; } # define Tcl_ExprLongObj TclExprLongObj static inline int TclExprLongObj(Tcl_Interp *interp, Tcl_Obj *obj, long *ptr){ int intValue; int result = tclStubsPtr->tcl_ExprLongObj(interp, obj, (long *)&intValue); if (result == TCL_OK) *ptr = (long)intValue; return result; } # define Tcl_UniCharNcmp(ucs,uct,n) \ ((int(*)(const Tcl_UniChar*,const Tcl_UniChar*,unsigned int))tclStubsPtr->tcl_UniCharNcmp)(ucs,uct,(unsigned int)(n)) # define Tcl_UtfNcmp(s1,s2,n) \ ((int(*)(const char*,const char*,unsigned int))tclStubsPtr->tcl_UtfNcmp)(s1,s2,(unsigned int)(n)) # define Tcl_UtfNcasecmp(s1,s2,n) \ ((int(*)(const char*,const char*,unsigned int))tclStubsPtr->tcl_UtfNcasecmp)(s1,s2,(unsigned int)(n)) # define Tcl_UniCharNcasecmp(ucs,uct,n) \ ((int(*)(const Tcl_UniChar*,const Tcl_UniChar*,unsigned int))tclStubsPtr->tcl_UniCharNcasecmp)(ucs,uct,(unsigned int)(n)) # endif #endif #undef Tcl_NewLongObj #define Tcl_NewLongObj(value) Tcl_NewWideIntObj((long)(value)) #undef Tcl_NewIntObj |
︙ | ︙ | |||
4159 4160 4161 4162 4163 4164 4165 | # define TclAppendUnicodeToObj Tcl_AppendUnicodeToObj # undef Tcl_UniCharToUtfDString # define Tcl_UniCharToUtfDString Tcl_Utf16ToUtfDString # undef Tcl_UtfToUniCharDString # define Tcl_UtfToUniCharDString Tcl_UtfToUtf16DString # undef Tcl_UtfToUniChar # define Tcl_UtfToUniChar Tcl_UtfToUtf16 | < < < < < < | 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 | # define TclAppendUnicodeToObj Tcl_AppendUnicodeToObj # undef Tcl_UniCharToUtfDString # define Tcl_UniCharToUtfDString Tcl_Utf16ToUtfDString # undef Tcl_UtfToUniCharDString # define Tcl_UtfToUniCharDString Tcl_UtfToUtf16DString # undef Tcl_UtfToUniChar # define Tcl_UtfToUniChar Tcl_UtfToUtf16 #endif #if TCL_UTF_MAX > 3 || defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8 # undef Tcl_UniCharLen #endif /* |
︙ | ︙ |
Changes to generic/tclInt.h.
︙ | ︙ | |||
4683 4684 4685 4686 4687 4688 4689 | * const Tcl_UniChar *ct, unsigned long n); *---------------------------------------------------------------- */ #ifdef WORDS_BIGENDIAN # define TclUniCharNcmp(cs,ct,n) memcmp((cs),(ct),(n)*sizeof(Tcl_UniChar)) #else /* !WORDS_BIGENDIAN */ | | | 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 | * const Tcl_UniChar *ct, unsigned long n); *---------------------------------------------------------------- */ #ifdef WORDS_BIGENDIAN # define TclUniCharNcmp(cs,ct,n) memcmp((cs),(ct),(n)*sizeof(Tcl_UniChar)) #else /* !WORDS_BIGENDIAN */ # define TclUniCharNcmp Tcl_UniCharNcmp #endif /* WORDS_BIGENDIAN */ /* *---------------------------------------------------------------- * Macro used by the Tcl core to increment a namespace's export epoch * counter. The ANSI C "prototype" for this macro is: * |
︙ | ︙ |
Changes to generic/tclStringObj.c.
︙ | ︙ | |||
3398 3399 3400 3401 3402 3403 3404 | * memcmp. In benchmark testing this proved the most efficient * check between the unicode and string comparison operations. */ if (nocase) { s1 = (char *) TclGetUnicodeFromObj(value1Ptr, &s1len); s2 = (char *) TclGetUnicodeFromObj(value2Ptr, &s2len); | | | 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 | * memcmp. In benchmark testing this proved the most efficient * check between the unicode and string comparison operations. */ if (nocase) { s1 = (char *) TclGetUnicodeFromObj(value1Ptr, &s1len); s2 = (char *) TclGetUnicodeFromObj(value2Ptr, &s2len); memCmpFn = (memCmpFn_t)Tcl_UniCharNcasecmp; } else { s1len = Tcl_GetCharLength(value1Ptr); s2len = Tcl_GetCharLength(value2Ptr); if ((s1len == value1Ptr->length) && (value1Ptr->bytes != NULL) && (s2len == value2Ptr->length) && (value2Ptr->bytes != NULL)) { |
︙ | ︙ | |||
3423 3424 3425 3426 3427 3428 3429 | checkEq #endif ) { memCmpFn = memcmp; s1len *= sizeof(Tcl_UniChar); s2len *= sizeof(Tcl_UniChar); } else { | | | 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 | checkEq #endif ) { memCmpFn = memcmp; s1len *= sizeof(Tcl_UniChar); s2len *= sizeof(Tcl_UniChar); } else { memCmpFn = (memCmpFn_t) Tcl_UniCharNcmp; } } } } else { empty = TclCheckEmptyString(value1Ptr); if (empty > 0) { switch (TclCheckEmptyString(value2Ptr)) { |
︙ | ︙ |
Changes to generic/tclStubInit.c.
︙ | ︙ | |||
62 63 64 65 66 67 68 | #define TclStaticPackage Tcl_StaticPackage #undef TclGetUnicodeFromObj #undef TclNewUnicodeObj #undef TclSetUnicodeObj #undef Tcl_UniCharToUtfDString #undef Tcl_UtfToUniCharDString #undef Tcl_UtfToUniChar | < < < < < < | 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 | #define TclStaticPackage Tcl_StaticPackage #undef TclGetUnicodeFromObj #undef TclNewUnicodeObj #undef TclSetUnicodeObj #undef Tcl_UniCharToUtfDString #undef Tcl_UtfToUniCharDString #undef Tcl_UtfToUniChar #undef TclAppendUnicodeToObj static void uniCodePanic() { #if TCL_UTF_MAX == 3 Tcl_Panic("This extension is compiled with -DTCL_UTF_MAX>3, but Tcl is compiled with -DTCL_UTF_MAX==3"); #else Tcl_Panic("This extension is compiled with -DTCL_UTF_MAX==3, but Tcl is compiled with -DTCL_UTF_MAX>3"); #endif } #if TCL_UTF_MAX == 3 # define TclGetUnicodeFromObj (int *(*)(Tcl_Obj *, int *)) uniCodePanic # define TclNewUnicodeObj (Tcl_Obj *(*)(const int *, int)) uniCodePanic # define TclSetUnicodeObj (void (*)(Tcl_Obj *,const int *, int)) uniCodePanic # define TclAppendUnicodeToObj (void (*)(Tcl_Obj *, const int *, int)) uniCodePanic # define Tcl_UtfToUniChar (int (*)(const char *, int *)) uniCodePanic # define Tcl_UniCharToUtfDString (char *(*)(const int *, int, Tcl_DString *)) uniCodePanic # define Tcl_UtfToUniCharDString (int *(*)(const char *, int, Tcl_DString *)) uniCodePanic #else #if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 # define Tcl_GetUnicode (unsigned short *(*)(Tcl_Obj *)) uniCodePanic # endif # define Tcl_GetUnicodeFromObj (unsigned short *(*)(Tcl_Obj *, int *)) uniCodePanic # define Tcl_NewUnicodeObj (Tcl_Obj *(*)(const unsigned short *, int)) uniCodePanic # define Tcl_SetUnicodeObj (void(*)(Tcl_Obj *, const unsigned short *, int)) uniCodePanic |
︙ | ︙ | |||
352 353 354 355 356 357 358 | #define Tcl_UtfNcmp (int(*)(const char*,const char*,unsigned long))utfNcmp static int utfNcasecmp(const char *s1, const char *s2, unsigned int n){ return Tcl_UtfNcasecmp(s1, s2, (unsigned long)n); } #define Tcl_UtfNcasecmp (int(*)(const char*,const char*,unsigned long))utfNcasecmp #if TCL_UTF_MAX > 3 static int uniCharNcmp(const int *ucs, const int *uct, unsigned int n){ | | | | | | 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | #define Tcl_UtfNcmp (int(*)(const char*,const char*,unsigned long))utfNcmp static int utfNcasecmp(const char *s1, const char *s2, unsigned int n){ return Tcl_UtfNcasecmp(s1, s2, (unsigned long)n); } #define Tcl_UtfNcasecmp (int(*)(const char*,const char*,unsigned long))utfNcasecmp #if TCL_UTF_MAX > 3 static int uniCharNcmp(const int *ucs, const int *uct, unsigned int n){ return Tcl_UniCharNcmp(ucs, uct, (unsigned long)n); } #define Tcl_UniCharNcmp (int(*)(const int*,const int*,unsigned long))uniCharNcmp static int uniCharNcasecmp(const int *ucs, const int *uct, unsigned int n){ return Tcl_UniCharNcasecmp(ucs, uct, (unsigned long)n); } #define Tcl_UniCharNcasecmp (int(*)(const int*,const int*,unsigned long))uniCharNcasecmp #else static int utf16Ncmp(const unsigned short *ucs, const unsigned short *uct, unsigned int n){ return Tcl_UniCharNcmp(ucs, uct, (unsigned long)n); } #define Tcl_UniCharNcmp (int(*)(const unsigned short*,const unsigned short*,unsigned long))utf16Ncmp static int utf16Ncasecmp(const unsigned short *ucs, const unsigned short *uct, unsigned int n){ return Tcl_UniCharNcasecmp(ucs, uct, (unsigned long)n); |
︙ | ︙ | |||
516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | Tcl_Channel chan) /* The channel to return pos for. */ { return Tcl_Tell(chan); } #endif /* !TCL_NO_DEPRECATED */ #if TCL_UTF_MAX > 3 || defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8 # define Tcl_UniCharLen 0 #endif /* * WARNING: The contents of this file is automatically generated by the * tools/genStubs.tcl script. Any modifications to the function declarations * below should be made in the generic/tcl.decls script. */ | > > > | 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | Tcl_Channel chan) /* The channel to return pos for. */ { return Tcl_Tell(chan); } #endif /* !TCL_NO_DEPRECATED */ #if TCL_UTF_MAX > 3 || defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8 # define Tcl_UniCharCaseMatch 0 # define Tcl_UniCharLen 0 # define XTcl_UniCharNcmp 0 # define XTcl_UniCharNcasecmp 0 #endif /* * WARNING: The contents of this file is automatically generated by the * tools/genStubs.tcl script. Any modifications to the function declarations * below should be made in the generic/tcl.decls script. */ |
︙ | ︙ | |||
1688 1689 1690 1691 1692 1693 1694 | Tcl_UtfToUniChar, /* 646 */ Tcl_UniCharToUtfDString, /* 647 */ Tcl_UtfToUniCharDString, /* 648 */ TclSetUnicodeObj, /* 649 */ TclNewUnicodeObj, /* 650 */ TclGetUnicodeFromObj, /* 651 */ TclAppendUnicodeToObj, /* 652 */ | < < < | 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 | Tcl_UtfToUniChar, /* 646 */ Tcl_UniCharToUtfDString, /* 647 */ Tcl_UtfToUniCharDString, /* 648 */ TclSetUnicodeObj, /* 649 */ TclNewUnicodeObj, /* 650 */ TclGetUnicodeFromObj, /* 651 */ TclAppendUnicodeToObj, /* 652 */ }; /* !END!: Do not edit above this line. */ |
Changes to generic/tclUtf.c.
︙ | ︙ | |||
1676 1677 1678 1679 1680 1681 1682 | * * Side effects: * None. * *---------------------------------------------------------------------- */ | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 | * * Side effects: * None. * *---------------------------------------------------------------------- */ int Tcl_UniCharNcmp( const Tcl_UniChar *ucs, /* Unicode string to compare to uct. */ const Tcl_UniChar *uct, /* Unicode string ucs is compared to. */ unsigned long numChars) /* Number of unichars to compare. */ { #ifdef WORDS_BIGENDIAN /* * We are definitely on a big-endian machine; memcmp() is safe */ |
︙ | ︙ | |||
1750 1751 1752 1753 1754 1755 1756 | * * Side effects: * None. * *---------------------------------------------------------------------- */ | < < < < < < < < < < < < < < < < < < < < < | | | 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 | * * Side effects: * None. * *---------------------------------------------------------------------- */ int Tcl_UniCharNcasecmp( const Tcl_UniChar *ucs, /* Utf16 string to compare to uct. */ const Tcl_UniChar *uct, /* Utf16 string ucs is compared to. */ unsigned long numChars) /* Number of Utf16 characters to compare. */ { for ( ; numChars != 0; numChars--, ucs++, uct++) { if (*ucs != *uct) { int lcs = Tcl_UniCharToLower(*ucs); int lct = Tcl_UniCharToLower(*uct); |
︙ | ︙ | |||
2122 2123 2124 2125 2126 2127 2128 | * * Side effects: * None. * *---------------------------------------------------------------------- */ | | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < | 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 | * * Side effects: * None. * *---------------------------------------------------------------------- */ #if !defined(TCL_NO_DEPRECATED) && TCL_UTF_MAX == 3 && TCL_MAJOR_VERSION < 9 int Tcl_UniCharCaseMatch( const Tcl_UniChar *uniStr, /* Unicode String. */ const Tcl_UniChar *uniPattern, /* Pattern, which may contain special * characters. */ int nocase) /* 0 for case sensitive, 1 for insensitive */ { Tcl_UniChar ch1 = 0, p; while (1) { p = *uniPattern; /* * See if we're at the end of both the pattern and the string. If so, * we succeeded. If we're at the end of the pattern but not at the end |
︙ | ︙ | |||
2387 2388 2389 2390 2391 2392 2393 | /* * Check for a "[" as the next pattern character. It is followed by a * list of characters that are acceptable, or by a range (two * characters separated by "-"). */ if (p == '[') { | | | 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 | /* * Check for a "[" as the next pattern character. It is followed by a * list of characters that are acceptable, or by a range (two * characters separated by "-"). */ if (p == '[') { Tcl_UniChar startChar, endChar; uniPattern++; ch1 = (nocase ? Tcl_UniCharToLower(*uniStr) : *uniStr); uniStr++; while (1) { if ((*uniPattern == ']') || (*uniPattern == 0)) { return 0; |
︙ | ︙ | |||
2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 | } else if (*uniStr != *uniPattern) { return 0; } uniStr++; uniPattern++; } } /* *---------------------------------------------------------------------- * * TclUniCharMatch -- * * See if a particular Unicode string matches a particular pattern. | > | 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 | } else if (*uniStr != *uniPattern) { return 0; } uniStr++; uniPattern++; } } #endif /* defined(TCL_NO_DEPRECATED) */ /* *---------------------------------------------------------------------- * * TclUniCharMatch -- * * See if a particular Unicode string matches a particular pattern. |
︙ | ︙ |