Compare commits

...
Author SHA1 Message Date
jan.nijtmans 656850e9a4 Always use UTF-8 when reading from the console (See also TIP #587) 2022-02-10 14:18:25 +00:00
jan.nijtmans 1f35ddfe62 Use Tcl_NewWideIntObj() for values that might be bigger than 32-bit 2022-02-10 14:16:00 +00:00
jan.nijtmans 110e6cae5e Merge 8.6 2022-02-10 09:37:55 +00:00
jan.nijtmans 8f805cf711 Use TclListObjLength/TclListObjGetElements in stead of Tcl_ListObjLength/Tcl_ListObjGetElements everywhere. This is slightly more efficient if the refered list already has the correct type 2022-02-10 09:26:16 +00:00
jan.nijtmans 805db9224e Merge 8.6 2022-02-09 22:10:44 +00:00
jan.nijtmans f608eb10d4 Put back '@' (lost in previous commit) 2022-02-09 22:09:07 +00:00
jan.nijtmans d60cf573c0 Merge 8.6 2022-02-09 11:58:07 +00:00
jan.nijtmans da0f6cf283 More steps, making it work for ARM64 2022-02-09 11:33:44 +00:00
jan.nijtmans 4e39a8e0b8 Accept aarch64 too (in stead of arm64) 2022-02-08 15:07:28 +00:00
jan.nijtmans d6d9d92060 Correct previous commit (Windows build error) 2022-02-08 14:23:39 +00:00
jan.nijtmans 2b26997c85 More changed for windows-arm (e.g. add zdll.lib for ARM64, although zlib1.dll still missing) 2022-02-08 10:54:45 +00:00
jan.nijtmans 94d7b078fa Merge 8.6 2022-02-08 10:04:08 +00:00
jan.nijtmans 72907faafe Fix [1fe745559a]: Conditional jump or move depends on uninitialised value in Tcl_UniCharToUtf 2022-02-07 22:16:34 +00:00
jan.nijtmans 962d2a8130 Fix [1fe745559a]: 8.7, 9.0: Conditional jump or move depends on uninitialised value in Tcl_UniCharToUtf 2022-02-07 15:35:09 +00:00
jan.nijtmans 387f9a6753 Merge 8.6 2022-02-07 14:55:06 +00:00
jan.nijtmans f48af06d66 Fix [bae42b3d24]: [d86e92fb33] et.al. eliminates cpuid when cross compiling for win32 2022-02-07 14:42:11 +00:00
jan.nijtmans e6b6fcc9d4 Merge 8.6 2022-02-07 08:48:01 +00:00
jan.nijtmans dbae7c51f1 Add support for windows-arm platform 2022-02-07 08:45:06 +00:00
jan.nijtmans 8f8b424c15 another try, rules.vc version 1.10 2022-02-06 12:47:54 +00:00
jan.nijtmans 8be8b50886 See [https://github.com/tcltk/tcl/pull/10] 2022-02-04 16:19:25 +00:00
jan.nijtmans 99678d70f7 Fix Tcl_UtfToWChar() typedef 2022-02-03 12:49:55 +00:00
jan.nijtmans fd9dbdd294 Merge 8.6 2022-02-02 16:46:10 +00:00
jan.nijtmans 7b1d345686 Change DEFAULT_PRIMARY_PROMPT from #define to static const string (saves a strlen() call) 2022-02-02 16:42:18 +00:00
jan.nijtmans 11cc37e818 Merge 8.6 2022-02-01 12:31:47 +00:00
jan.nijtmans 3311ca7d30 Code cleanup in tclMain.c and tclAppInit.c: Make them Tcl-8.7-aware, usable as more generic examples for extensions. 2022-02-01 12:03:54 +00:00
bch 95bcc53807 take advantage of what we know re: argv guarantees [https://www.iso-9899.info/n1570.html#5.1.2.2.1|argv spec] (per @cousteau on #tcl) 2022-01-28 23:52:10 +00:00
bch cc66f3601f rejig argv/argc handling in response to investigation prompted by [https://arstechnica.com/information-technology/2022/01/a-bug-lurking-for-
12-years-gives-attackers-root-on-every-major-linux-distro/|this "polkit issue"] and some experimenting w/ execve() (ab)use. Essentially port of [0e1d2702ab] and its parent; discussed at length on IRC
2022-01-28 23:28:24 +00:00
pooryorick 5c2bc08ea4 Add back a clarification to the documentation for [expr] that an operand is
interpreted as a number wherever possible, and rework text to be more compact.
2022-01-26 17:48:34 +00:00
jan.nijtmans 831e85b8f6 Merge 8.6 2022-01-24 15:40:34 +00:00
jan.nijtmans 5d9db7d9ac intPtr -> lengthPtr in Tcl_ListObjLength() documentation, so the documentation matches the signature in the header file 2022-01-24 15:29:36 +00:00
jan.nijtmans d46657f1f7 Don't document the size_t form of Tcl_GetStringFromObj() (yet), because it's only available if TCL_NO_DEPRECATED is defined 2022-01-24 11:15:39 +00:00
jan.nijtmans bc8c2ad47a Fix another bug in Tcl_GetIntForIndex() (demonstrated by the new testcases from the previous commit) 2022-01-24 11:01:07 +00:00
jan.nijtmans 511e85013a eol-spacing from previous commit 2022-01-23 16:21:42 +00:00
pooryorick 641cba82ec Rewrite of documentation for [chan] 2022-01-22 14:47:29 +00:00
jan.nijtmans 4d0a0d7dc2 Merge 8.6 2022-01-21 15:15:45 +00:00
jan.nijtmans d4e2ae119e Undo part of [26539e78a7]. Although Tcl_GetRange() does it's own parameter check, it's caller doesn't have to do it any more. However, put back these check, better not depend on the improved behavior of Tcl_GetRange (yet). This gives the freedom to bring back Tcl_GetRange() to how it was in Tcl 8.6.10, if desired 2022-01-21 14:44:58 +00:00
jan.nijtmans 65ca3bc25b Fix bug in Tcl_GetIntForIndex() (TIP #544), discovered when investigating [https://core.tcl-lang.org/tk/tktview?name=a9929f112a|a9929f112a] 2022-01-21 08:53:56 +00:00
jan.nijtmans e433c57158 Add test-cases for Tcl_GetIntForIndex(). This reveals a minor bug 2022-01-21 08:43:13 +00:00
jan.nijtmans b97786c85d (partial) fix for [https://core.tcl-lang.org/tk/tktview?name=a9929f112a|a9929f112a]. WIP 2022-01-19 14:21:38 +00:00
jan.nijtmans d0b2869273 Update documentation for Tcl_GetRange() 2022-01-18 23:26:20 +00:00
jan.nijtmans ae78b89233 Merge 8.6 2022-01-18 15:52:13 +00:00
jan.nijtmans f97560a949 Fix [e9a2715d91]: Incompatible Tcl_GetRange(). From now on (unofficially) the last function argument can be set to -1 (or any negative value) meaning 'end'. 2022-01-18 15:39:21 +00:00
jan.nijtmans c3bcd951b8 Possible fix for [e9a2715d91]: Tcl 8.6.11: Incompatible Tcl_GetRange() 2022-01-17 17:26:37 +00:00
jan.nijtmans b563c159d7 Fix merge conflict previous commit 2022-01-17 17:07:14 +00:00
jan.nijtmans b45bc74fab Merge 8.6 2022-01-17 17:02:57 +00:00
jan.nijtmans 01a48e2369 Tcl_NewObj() -> TclNewObj() 2022-01-17 16:44:44 +00:00
jan.nijtmans 92c6a70081 Merge 8.6 2022-01-17 11:21:08 +00:00
jan.nijtmans e5a2ebd71b Follow-up to [767e070d35]: Tcl_GetRange and Tcl_GetUniChar do not validate index inputs.
Now that Tcl_GetRange() checks its arguments, the callers of this function don't have to do that any more.
This also shows a off-by-one error in the Tcl_GetRange() check
2022-01-17 10:35:18 +00:00
jan.nijtmans 2f374ff67e Fix [6474fbd934]: Tcl 8.7a5: why utf-8 is different? 2022-01-15 17:02:29 +00:00
jan.nijtmans 9bcfb6703d Proposed fix for [6474fbd934]: Tcl 8.7a5: why utf-8 is different? 2022-01-14 22:34:06 +00:00
jan.nijtmans c513699e2c Fix [b241e4ccc0]: Error while building with Tcl 8.7a5... 2022-01-14 15:44:02 +00:00
jan.nijtmans f1b74b0757 Merge 8.6 2022-01-14 10:10:30 +00:00
jan.nijtmans a9eaf67651 Fix [816913a65e]: GrowStringBuffer(): signed integer overflow. And a few similar situations in other places 2022-01-14 09:54:48 +00:00
jan.nijtmans 2dd5df343a Fix [bca10e3790]: Undefined behavior in ResultAdd(). Make functions like ResultAdd() equal in tclIOGt.c and tclIOTrans.c 2022-01-14 09:53:14 +00:00
jan.nijtmans 8a90d26eaf Merge 8.6 2022-01-13 13:23:10 +00:00
jan.nijtmans be409f301e Fix [69218ab7b]: TEBCResume(): buffer over-read in INST_STR_MAP 2022-01-13 13:22:07 +00:00
jan.nijtmans 71c8acf7e6 Fix for [26f1328a86]: sizeof(int) < sizeof(void*) -> Crash 2022-01-13 13:20:53 +00:00
jan.nijtmans 1bc44ec32a Fix [816913a65e]: GrowStringBuffer(): signed integer overflow. And a few similar situations in other place 2022-01-13 12:22:51 +00:00
jan.nijtmans d679a49bc0 Fix [6cb3db4965]: pointer arithmetic using NULL in InitArgsAndLocals() 2022-01-13 11:46:50 +00:00
jan.nijtmans e874b759fc Suggested fix for [bca10e3790]: Undefined behavior in ResultAdd(). Make functions like ResultAdd() equal in tclIOGt.c and tclIOTrans.c 2022-01-13 11:12:40 +00:00
jan.nijtmans 99b53ecd55 Merge 8.6 2022-01-12 21:41:26 +00:00
jan.nijtmans 32ab46ae40 Fix [fba9c1fc12]: pointer arithmetic using NULL in PrintParse() 2022-01-12 21:39:40 +00:00
jan.nijtmans 6fb4e398d6 Merge 8.6 2022-01-12 21:09:28 +00:00
jan.nijtmans 05dc6d00c2 Fix [da6f155ca4]: STRING_SIZE() macro: parenthesize numChars usage. Fix more macro's like this. 2022-01-12 16:33:51 +00:00
jan.nijtmans 2171b321cf Fix [69218ab7b]: TEBCResume(): buffer over-read in INST_STR_MAP 2022-01-12 15:50:30 +00:00
jan.nijtmans 2fa8967c62 Proposed fix for [26f1328a86]: sizeof(int) < sizeof(void*) -> Crash 2022-01-12 14:19:04 +00:00
jan.nijtmans 2161463b5b Rename "testConstraint nodep" to "testConstraint deprecated", making it the same as in Tk 2022-01-09 16:54:08 +00:00
jan.nijtmans 9cd875fc6f Merge 8.6 2022-01-07 19:55:48 +00:00
jan.nijtmans 5608e51a46 tcltk-man2html-utils.tcl: Before doing a "string range", check if that makes sense at all 2022-01-07 19:52:34 +00:00
jan.nijtmans c220ae0d43 Fix [0386e9a967]: Bitrot in tclZlib.c 2022-01-07 17:17:09 +00:00
jan.nijtmans e3c67e0881 New macro TclNewIndexObj(). For Tcl 8.7 it's the same as TclNewIntObj(), but in Tcl 9.0 not any more.
Merge 8.6
2021-12-21 16:18:53 +00:00
oehhar fc5ef30f8c binary encode/decode hex: document upper/lower character use. 2021-12-20 14:38:13 +00:00
jan.nijtmans ead6c0d054 Unbreak windows build caused by [066a9b81b8|this] commit 2021-12-20 00:58:30 +00:00
jan.nijtmans b3d12a5e6d Merge 8.6 2021-12-18 19:02:13 +00:00
jan.nijtmans f60e164799 Make it impossible for the indexType object to cache negative index values. And - if it happens - at least don't crash on it. 2021-12-18 18:55:50 +00:00
jan.nijtmans 63b42715a8 Merge 8.6 2021-12-18 15:07:30 +00:00
jan.nijtmans a128b4d651 Fix [5507a9c096]: Small error on https://www.tcl.tk/man/tcl/TclCmd/try.html 2021-12-18 15:03:29 +00:00
jan.nijtmans 310292eedb Merge 8.6 2021-12-18 14:59:58 +00:00
jan.nijtmans c65c7c0a59 Fix [b0f84119c8]: TEBCresume(): undefined behavior for INST_LSHIFT 2021-12-18 14:46:45 +00:00
jan.nijtmans 46eeca1581 Merge 8.6 2021-12-16 21:26:39 +00:00
jan.nijtmans f3edde2f64 Fix [d1434179b5]: avoid signed integer overflow in AppendUtfToUtfRep() 2021-12-16 21:25:52 +00:00
jan.nijtmans 6a3a8ae8ff Suggested fix for [b0f84119c8]: TEBCresume(): undefined behavior for INST_LSHIFT 2021-12-16 21:02:15 +00:00
jan.nijtmans 72000228fc Merge 8.6 2021-12-16 14:01:45 +00:00
jan.nijtmans 22325d1e08 Add 2 new testcases, for Tcl_GetIndexFromObjStruct with TCL_EXACT flag and for Tcl_GetIndexFromObjStruct with NULL argument 2021-12-16 12:09:11 +00:00
jan.nijtmans c47479ba6c Merge 8.6 2021-12-16 09:14:33 +00:00
jan.nijtmans fcc9c57804 Fix [6ef312dcf5]: memcpy() with NULL source in Tcl_CreateMathFunc() 2021-12-16 09:02:59 +00:00
jan.nijtmans 76f73fbad9 Fix [31e302fcf7]: signed integer overflow in generic/tclHash.c 2021-12-16 08:35:37 +00:00
jan.nijtmans e99a84db0a Fix [90612089d8]: signed integer overflow in ExprRandFunc() 2021-12-16 08:20:53 +00:00
jan.nijtmans b95cae5898 Undo prevous commit. See [41b1406f51] for the reason 2021-12-16 08:03:39 +00:00
jan.nijtmans 187de15e2b Fix [90612089d8]: signed integer overflow in ExprRandFunc() 2021-12-15 17:03:03 +00:00
jan.nijtmans cacd6930cf Addendum to [41b1406f51]: change '<=' in range-check to '<' 2021-12-15 16:58:08 +00:00
jan.nijtmans 45a9461fda Merge 8.6 2021-12-13 12:59:46 +00:00
jan.nijtmans f171868256 Fix [41b1406f51]: AppendUtfToUtfRep(): undefined behavior involving pointers 2021-12-13 11:39:15 +00:00
jan.nijtmans adcaff51ac Merge 8.6 2021-12-13 10:57:09 +00:00
jan.nijtmans 4d561210e9 Prevent crash in Tcl_GetIndexFromObj*() when objPtr == NULL. Just let it produce a normal error-message then. Also add some more type-casts 2021-12-13 10:35:19 +00:00
jan.nijtmans f1752f51c9 Merge 8.6 2021-12-12 18:03:37 +00:00
jan.nijtmans 401b464a4d Fix [ac6792195d]: avoid signed integer overflow in BinaryEncodeUu() 2021-12-12 17:59:11 +00:00
jan.nijtmans bc22d501c0 merge-mark 2021-12-08 15:50:50 +00:00
jan.nijtmans 2d2b28f51a Update tcltest package to version 2.5.4 (backported from Tcl 8.7) 2021-12-08 15:49:24 +00:00
jan.nijtmans fec24f8b80 Merge 8.6 2021-12-08 15:28:55 +00:00
jan.nijtmans 5c70ebf5df Add more win/*.in files to "make dist". Generate tclUuid.h (not used yet). With nmake build, install "zlib1.dll" in bin-directory (just as when using make) 2021-12-08 15:07:11 +00:00
jan.nijtmans dc62ebb08b Merge 8.6 2021-12-07 18:15:26 +00:00
jan.nijtmans 3ad14e6b9a Fix [cea2c63928]: Address -fsanitize=shift-exponent complaints in TclParseNumber() 2021-12-07 18:05:04 +00:00
jan.nijtmans 4f1573ed0c merge-mark 2021-12-02 13:47:15 +00:00
jan.nijtmans 5bf0f34014 Fix winFCmd-19.5 testcase on GitHub actions: Tcl 8.5 is known not to be able to handle too long filenames (8.6 can!) 2021-12-01 09:58:10 +00:00
jan.nijtmans 6a5e34f9b7 windows-2016 will no longer be supported by GitHub actions 2021-11-30 21:46:16 +00:00
jan.nijtmans ef0be5183b Fix [97b8e1d54b]: -mdynamic-no-pic not supported on Apple Silicon 2021-11-28 21:53:34 +00:00
jan.nijtmans cdd06df9db Merge 8.6. Add win/*.in to "make dist" 2021-11-26 16:04:48 +00:00
jan.nijtmans 43b8bf6430 Add (missing) win/svnmanifest.in win/tclUuid.h.in (not really used yet) 2021-11-26 15:56:46 +00:00
jan.nijtmans 274e64c463 Unbreak build 2021-11-26 15:54:37 +00:00
jan.nijtmans 99180fcdaa Change TclInitSubsystems() signature, matching Tcl_InitSubsystems() in Tcl 8.7. Add more type-casts (better C++ compatibility) 2021-11-26 15:47:49 +00:00
jan.nijtmans b3e1ffc179 TIP #599 implementation: Extended build information 2021-11-26 11:59:09 +00:00
jan.nijtmans 21b68e66bf Add support for subversion too 2021-11-24 14:51:34 +00:00
jan.nijtmans 3261c033d2 Merge 8.7 2021-11-24 12:32:04 +00:00
jan.nijtmans c65fe541cc Merge 8.6 2021-11-24 12:22:08 +00:00
jan.nijtmans a4251af984 Add rule to generate manifest.uuid and tclUuid.h, if not present already. Not used yet 2021-11-24 12:12:49 +00:00
jan.nijtmans 9e52c62db6 2 minor improvements: Make sure tclUuid.h ends with newline; Fallback "unknown" if neither GIT, neither fossil is detected 2021-11-23 21:33:14 +00:00
jan.nijtmans 693c2744f3 Merge 8.7 2021-11-19 17:28:54 +00:00
jan.nijtmans bb2edf5377 Fix [46291ba24d]: win: install: bashism in Makefile.in 2021-11-17 10:08:35 +00:00
jan.nijtmans 6c20a6ff0d Starting with 8.7, don't bother Cygwin32 any more. Only Cygwin64 will be supported. 2021-11-12 21:29:06 +00:00
jan.nijtmans 52a3eade6b Merge 8.6 2021-11-11 16:13:56 +00:00
jan.nijtmans fdf25d3a1f Fix -fno-lto determination/add --enable-auto-image-base option to windows build (when available) 2021-11-11 16:12:24 +00:00
jan.nijtmans 6d8339e649 Merge 8.7 2021-11-10 08:24:30 +00:00
jan.nijtmans 36e74b9e8d Merge 8.6 2021-11-09 15:50:14 +00:00
jan.nijtmans 4d0be555a4 Use octal permissions in testcases 2021-11-09 11:28:19 +00:00
jan.nijtmans 5ad22cafaf Merge 8.7 2021-11-08 23:11:16 +00:00
jan.nijtmans fa56430c8b Merge 8.6. Some http:// -> https:// 2021-11-08 14:03:43 +00:00
jan.nijtmans fabf9b4e53 mingw-w64 website changed 2021-11-08 14:02:30 +00:00
jan.nijtmans 8bfcb2b80c Make "changes" file chronological (again) 2021-11-08 13:43:07 +00:00
dgp 411fc46d4f [9899c273ab] Rewrite Tcl_InitStringRep to account for all encounters with
the non-allocated empty string rep.
2021-11-08 00:06:27 +00:00
dgp a112105294 Update and clarify usage of the TclInitStringRep macro. 2021-11-07 22:39:40 +00:00
jan.nijtmans 3f060e9d6c Merge 8.6 2021-11-07 21:42:09 +00:00
jan.nijtmans 5eb33c5c7e Fix [15845d9fd8]: unix/tcl.m4: implicit declaration of exit() in timezone variable checks 2021-11-07 21:34:08 +00:00
dgp 6eceb08de2 Document the freedom to provide space of either type int or size_t. 2021-11-07 20:39:32 +00:00
dgp 84ac71183d More accurately describe the string rep invalidation performed
by Tcl_SetByteArrayLength()
2021-11-07 03:20:54 +00:00
dgp 370e151c69 typo 2021-11-06 22:45:26 +00:00
dgp c6b69a1fa5 merge 8.6 2021-11-06 20:33:36 +00:00
dgp 36909daded Doc fix. There is no endianness in the encoding of a single byte. 2021-11-06 20:33:09 +00:00
dgp dc9c511e43 merge 8.6 2021-11-06 15:41:54 +00:00
dgp c9f5f714b7 Missing static. 2021-11-06 15:37:14 +00:00
dgp 038dfd11b3 Make more use of the Tcl_ObjCmdProc typedef for tidier branch merging. 2021-11-06 15:35:39 +00:00
jan.nijtmans f096016a8e Eliminate unused variables/function-arguments 2021-11-06 08:02:01 +00:00
dgp 5bff482dcc Implement parts of TIP 568 in Tcl 8.7. 2021-11-05 22:39:45 +00:00
dgp 3ec9f64eb9 merge 8.6 2021-11-05 21:30:52 +00:00
dgp 28fb151fd7 merge release 2021-11-05 21:23:44 +00:00
dgp cf9ec4f29a Adapt documentation of the *ByteArray* routines to better match Tcl
library functioning post-TIP 568.
2021-11-05 19:47:03 +00:00
dgp 1a396e5b24 merge 8.7 2021-11-05 12:39:14 +00:00
griffin 0652bd43d5 Fix for bug [fc65ff1b66] - zipfs mkimg 2021-11-04 17:18:00 +00:00
dgp e648450fcd merge 8.7 2021-11-02 16:48:18 +00:00
dgp 88129d2c87 Revise the interface routines for byte arrays to use "numBytes" rather than
"length" as argument names.
2021-11-02 16:40:29 +00:00
dgp eea5dbac26 merge 8.6 2021-11-02 15:06:30 +00:00
jan.nijtmans 069ffa837b Merge 8.6 2021-11-01 13:38:39 +00:00
jan.nijtmans d9aca41432 Update DragonFly/FreeBSD configuration (requested by Pietro Cerutti) 2021-11-01 13:21:12 +00:00
dgp 4c9ef53c21 update changes 2021-10-30 19:49:33 +00:00
jan.nijtmans 8e166381ae Bump to 8.6.12 for release 2021-10-27 08:12:26 +00:00
jan.nijtmans fbe1e767e5 Merge 8.6 2021-10-27 07:05:32 +00:00
jan.nijtmans 570c870e93 Update platform version (1.0.17 -> 1.0.18) for MacOS Monterey support 2021-10-27 07:03:53 +00:00
jan.nijtmans dcb9d4c330 Update platform version (1.0.17 -> 1.0.18) for MacOS Monterey support 2021-10-27 07:00:53 +00:00
jan.nijtmans be69e67b9a Merge 8.6 2021-10-27 06:50:48 +00:00
jan.nijtmans b9c2728c64 Update TZ info to tzdata2021e 2021-10-27 06:49:45 +00:00
jan.nijtmans daf00857b8 Update TZ info to tzdata2021e 2021-10-27 06:48:14 +00:00
jan.nijtmans 3fd1eadede Merge 8.6 2021-10-25 21:35:22 +00:00
jan.nijtmans f1076e8f35 Merge 8.5 2021-10-25 21:32:24 +00:00
jan.nijtmans 4eaf0af8f2 Update platform extension for MaxOS Monterey 2021-10-25 21:27:04 +00:00
dgp e58d1a560f Revise outdated comments. 2021-10-25 15:34:06 +00:00
dgp a3fc5612c1 merge 8.7 2021-10-25 14:14:25 +00:00
griffin 13223fbc3f These record locations are not relative offsets, but rather absolute locations. 2021-10-24 18:19:16 +00:00
jan.nijtmans 7f8b256581 Code cleanup (comments, bracing) 2021-10-20 20:27:45 +00:00
jan.nijtmans 49260f096b Merge 8.6 2021-10-19 14:44:19 +00:00
jan.nijtmans 58583ac83f IntRep -> InternalRep. Internal changes only. 2021-10-19 14:42:56 +00:00
jan.nijtmans f3ce97fe14 Fix "nodep" constraint. Merge 8.7 2021-10-19 12:43:42 +00:00
jan.nijtmans 7fa6ef0e9c Merge-mark 2021-10-18 18:56:10 +00:00
jan.nijtmans 71c68757ce Update TZ info to tzdata2021d 2021-10-18 18:53:54 +00:00
José Ignacio Marín d75194b6b8 Update TZ info to tzdata2021d (via merge). 2021-10-18 18:24:55 +00:00
José Ignacio Marín 8ddc732425 Update TZ info to tzdata2021d. 2021-10-18 18:23:48 +00:00
dgp ebe3f974d6 merge 8.7 2021-10-18 14:44:29 +00:00
jan.nijtmans 83c50861c2 Merge 8.7 2021-10-18 09:51:05 +00:00
jan.nijtmans 43d72b8d8e separate "testConstraint nodep" in tcltests.tcl 2021-10-18 09:43:03 +00:00
jan.nijtmans d9f0f7a35d separate testConstraint nodep 2021-10-18 08:56:26 +00:00
jan.nijtmans aacc53e29a Merge 8.7 2021-10-18 07:51:23 +00:00
jan.nijtmans 8fbe8df970 RFE [cef426ff2c]: Encoding UTF-32 missing 2021-10-15 14:48:45 +00:00
jan.nijtmans 7e82249b7f Code/Comment cleanup 2021-10-14 14:32:39 +00:00
griffin 2812109f17 Remove unnecessary change 2021-10-13 16:34:46 +00:00
jan.nijtmans 82df0e7cc9 Oops 2021-10-13 13:51:26 +00:00
jan.nijtmans be9f231fda First shot at [cef426ff2c]: Encoding UTF-32 missing 2021-10-13 13:33:43 +00:00
griffin 34e7d9999e Corrected offset calculations 2021-10-13 00:22:20 +00:00
jan.nijtmans 5d1a856f7a Merge 8.6 2021-10-12 14:46:04 +00:00
jan.nijtmans ee2bdcdf6b Missing braces (just to be sure) 2021-10-12 14:27:31 +00:00
jan.nijtmans 473ebe84ef Fix build failure with --enable-symbols build on Windows: Some code makes assumptions on Tcl_Time structure ... 2021-10-12 14:18:18 +00:00
jan.nijtmans 918f0fe1aa Merge 8.7 2021-10-11 13:57:53 +00:00
jan.nijtmans f43dd68346 Better solution, in stead of [https://core.tcl-lang.org/tk/info/6ffcea9b093deb5a|6ffcea9b]: Handle 64-bit (Cygwin64) Tcl_GetTime(), when loading tk86.dll 2021-10-11 13:54:06 +00:00
pooryorick 4744055aa0 Fix for issue [a8579d906a28], "argument with no name". 2021-10-08 19:42:22 +00:00
jan.nijtmans a94a7ca7b7 Merge 8.7 2021-10-08 09:26:26 +00:00
jan.nijtmans 343851002d Change "IntRep" to "InternalRep", as discussed in the Tcl Core mailing list 2021-10-08 07:08:28 +00:00
jan.nijtmans 447dd177c9 Merge 8.6 2021-10-08 07:05:19 +00:00
jan.nijtmans 0ded79bd3a merge-mark 2021-10-08 07:04:20 +00:00
jan.nijtmans 2eb56b3c28 Update TZ info to tzdata2021c. 2021-10-07 14:58:32 +00:00
jan.nijtmans 0b1f6ed09a Change "IntRep" to "InternalRep", as discussed in the Tcl Core mailing list 2021-10-06 19:33:03 +00:00
jan.nijtmans fa2cb7883b Fix problem with application manifest, supporting UTF-8 console (it appears that mingw is stricter than msvc on this) 2021-10-06 14:00:44 +00:00
pooryorick 2e1d5a50d8 Rewrite comments for clarity and conciseness. 2021-10-04 21:09:02 +00:00
José Ignacio Marín 1ef5ff37cd Update TZ info to tzdata2021c. 2021-10-02 17:01:48 +00:00
jan.nijtmans 9a44b606e8 Merge 8.6 2021-09-30 08:03:06 +00:00
jan.nijtmans 01cdc3483c Fix [e0f728b381]: Manpage msgcat.n contains two write errors 2021-09-30 07:49:10 +00:00
jan.nijtmans 8cb8adf9b7 Set activeCodePage to UTF-8, for (Windows) systems that support it. 2021-09-29 13:46:51 +00:00
jan.nijtmans 469e69030b Merge 8.7 2021-09-29 12:29:05 +00:00
jan.nijtmans 4d029b8f63 TIP #605 implementation: Function to get class name from object 2021-09-27 13:01:37 +00:00
jan.nijtmans 4571430dc4 Merge 8.7 2021-09-26 20:56:01 +00:00
jan.nijtmans 448e5e0f2e Merge 8.6 2021-09-26 20:51:09 +00:00
jan.nijtmans 140023c551 Remove unix/config.status.lineno 2021-09-26 20:48:17 +00:00
jan.nijtmans f5df020920 Update TZ info to tzdata2021b. 2021-09-26 20:43:51 +00:00
José Ignacio Marín 22557de7f2 Update TZ info to tzdata2021b (via merge). 2021-09-25 09:01:40 +00:00
José Ignacio Marín ae23664336 Update TZ info to tzdata2021b. 2021-09-25 09:01:00 +00:00
jan.nijtmans 9dc50cfea3 Merge 8.7 2021-09-24 14:13:14 +00:00
jan.nijtmans 3d43898853 Merge 8.6 2021-09-14 13:35:11 +00:00
jan.nijtmans 8b26b82863 Update all tables to Unicode 14 2021-09-14 13:34:08 +00:00
jan.nijtmans b5a045b670 Update all tables to Unicode 14 2021-09-14 13:31:49 +00:00
dgp 297d150968 merge 8.7 2021-09-10 18:52:36 +00:00
jan.nijtmans 4dd741ab26 Merge 8.6 2021-09-08 14:26:02 +00:00
jan.nijtmans 8d0f9082f2 close fork 2021-09-08 14:24:13 +00:00
jan.nijtmans e26fa5de83 merge-mark 2021-09-03 06:43:42 +00:00
pooryorick dff41a451d Merge fixes for [ccc448a6bfd5], namespace ensemble subcommand name prefix
matching and a subsequent error results in a segmentation fault.
2021-09-02 23:03:07 +00:00
pooryorick 7687170880 Backport fixes for [ccc448a6bfd5], namespace ensemble subcommand name prefix
matching and a subsequent error results in a segmentation fault.
2021-09-02 22:38:32 +00:00
dgp d762e7fcd2 merge 8.7 2021-09-02 21:27:09 +00:00
jan.nijtmans 274f7dbfe0 Few more (c) -> © 2021-09-02 14:46:55 +00:00
jan.nijtmans 6fc4828aad (c) -> ©, now that TIP #587 is accepted 2021-09-02 14:41:53 +00:00
jan.nijtmans e882b751f3 Merge 8.7 2021-09-01 13:07:18 +00:00
griffin bc437743d5 Patch to fix zipfs mkimg bug. 2021-08-31 14:36:33 +00:00
dgp b649d5f2ef Work in progress updating the documentation to modern perspectives. 2021-08-27 18:46:10 +00:00
dgp 477d3c8e0d merge 8.7 2021-08-27 11:51:52 +00:00
jan.nijtmans fdf0eab428 Merge 8.6 2021-08-27 07:10:33 +00:00
jan.nijtmans 975416ffc0 Follow-up previous commit (thanks, Don!). Missing #undef 2021-08-27 07:09:25 +00:00
dgp c3d1d436bc repair broken build 2021-08-26 19:14:01 +00:00
dgp a0d2c4332f repair broken build 2021-08-26 19:12:39 +00:00
jan.nijtmans 3c6ee745c3 Merge 8.6 2021-08-26 15:27:05 +00:00
jan.nijtmans 9c9b2cacae Add a few spare unused stub entries in TclOO 2021-08-26 15:15:06 +00:00
dgp e8588ab026 merge 8.7 2021-08-23 17:03:17 +00:00
jan.nijtmans a5048e8dd9 Make everything compile warning-free when TCL_THREADS=0 2021-08-23 13:00:47 +00:00
jan.nijtmans a5448b6c8b Merge 8.5 2021-08-23 10:35:16 +00:00
jan.nijtmans 4c3b4b2a2b Add FALLTHRU markers, to help GCC emit less false warnings 2021-08-23 10:01:35 +00:00
jan.nijtmans d0288f61d3 Code formatting 2021-08-23 09:59:26 +00:00
jan.nijtmans 94b338844e TIP #511 implementation: Implement Tcl_AsyncMarkFromSignal() 2021-08-20 12:46:09 +00:00
jan.nijtmans c7dbd69076 Merge-mark 8.6. Update to autoconf-2.71 2021-08-19 08:51:29 +00:00
jan.nijtmans aee8e4fe56 Merge 8.5 2021-08-19 08:45:09 +00:00
jan.nijtmans 45a3da6414 Reserve a few more unused stub entries 2021-08-19 08:38:27 +00:00
jan.nijtmans d296d56f36 Apply macos-tip511.diff. Resolve conflict with TIP #601 2021-08-19 08:05:47 +00:00
jan.nijtmans f69a86b714 Fix use of TCL_THREADS macro: In Tcl 8.7, this is always defined, but can have value '1' or '0' 2021-08-18 14:31:55 +00:00
jan.nijtmans 5f83d31ece tip#511 proposed implementation 2021-08-17 16:16:29 +00:00
jan.nijtmans 58502bda0b Make TCL_MAC_EMPTY_FILE macro work with C++ compiler 2021-08-15 21:47:28 +00:00
jan.nijtmans 0a6f1e351d Make tclZipfs.c compilable with a C++ compiler 2021-08-15 21:37:09 +00:00
oehhar 774d9c6cf3 Refine 'string replace' documentation wording. Thanks to Ted Brown on clt. 2021-08-05 16:19:26 +00:00
jan.nijtmans 05631cdda6 Merge 8.7 2021-08-05 11:20:48 +00:00
jan.nijtmans 16105b9833 Merge 8.6 2021-08-05 11:20:10 +00:00
oehhar 1b1500534d Clarify description of corner case 'string replace "" 0 0 A' to return the empty string. 2021-08-05 07:30:15 +00:00
jan.nijtmans 74d70948ce Fix knownMsvcBug testConstraint 2021-08-04 14:52:32 +00:00
jan.nijtmans 7ac3bf2415 Found the problem with Visual Studio: somehow it doesn't handle empty brackets [] right .... 2021-08-03 10:26:10 +00:00
jan.nijtmans d03c57db7f merge-mark 2021-08-02 14:53:30 +00:00
jan.nijtmans 82ad00811c Bring over more from "build-info" branch 2021-08-02 14:52:39 +00:00
dkf 36dbbdbb72 Turn code snippets in TIP into a branch. 2021-08-01 11:47:23 +00:00
jan.nijtmans 6118cd549e merge-mark 2021-07-31 16:00:46 +00:00
jan.nijtmans e62d47d725 Backout last 2 commits: It appears that on Windows-2016 the GITHUB-installed version of msys works better than the official msys2 2021-07-31 15:59:11 +00:00
jan.nijtmans 393f3c5b48 Merge build-info-experiment 2021-07-30 12:53:32 +00:00
jan.nijtmans 92e1716af3 make it work for GIT too 2021-07-30 12:50:54 +00:00
jan.nijtmans 35f79cbdbf In "makefile.vc" add building new header-file tclUuid.h. Not used for anything yet. 2021-07-30 12:35:23 +00:00
jan.nijtmans 2002b28cbb try to update msys2 to latest version in GITHUB build 2021-07-30 08:08:30 +00:00
jan.nijtmans 2a56bd9e36 Experiment: Switch tclsh console to UTF-8 by default on Windows, if possible, using the manifest. 2021-07-29 14:03:30 +00:00
dgp 915aace29f merge 8.7 2021-07-26 16:43:31 +00:00
jan.nijtmans f107311e0a Use mingw-w64-ucrt-x86_64 toolchain for onfiledist build (starting with 8.7, since it needs Vista+) 2021-07-23 12:52:16 +00:00
jan.nijtmans 439e18d8d9 Merge 8.7. Re-implement testConstraint knownMsvcBug in terms of tcl::build-info 2021-07-23 10:03:15 +00:00
jan.nijtmans 95e8a2b516 Missing "env:" label in win-build.yml 2021-07-23 09:49:13 +00:00
jan.nijtmans 8c30acc36f Experiment: build onefiledist using the (experimental) UCRT64 mingw-w64 environment 2021-07-21 08:19:39 +00:00
jan.nijtmans 6cc9524fbb Merge 8.6 2021-07-21 08:12:33 +00:00
jan.nijtmans edf67bd765 Merge 8.5 2021-07-21 08:00:58 +00:00
jan.nijtmans 97e8fa6621 Use msys2/setup-msys2@v2 rule to install msys2, working around limitations in msys2 2021-07-20 15:32:15 +00:00
dgp 457a07a761 merge 8.7 2021-07-19 14:06:47 +00:00
jan.nijtmans b1f4ab80a0 Merge 8.6 2021-07-17 11:18:00 +00:00
jan.nijtmans 04619d69b8 Fix [592a25a505]: Tcl_PutEnv() crashes on Windows 2021-07-17 11:16:11 +00:00
jan.nijtmans 9804d03e1f Proposed fix for [592a25a505]: Tcl_PutEnv() crashes on Windows 2021-07-16 15:52:34 +00:00
jan.nijtmans 9b4bad2783 Merge 8.6 2021-07-16 06:58:45 +00:00
jan.nijtmans f58326fab5 Merge 8.5 2021-07-16 06:41:58 +00:00
jan.nijtmans c47c440be2 -eofchar should only be effective on input, not on output, since it could result in CTRL-Z be written when closing the file. (backported from 8.6) 2021-07-16 06:07:43 +00:00
jan.nijtmans 1523ce53c1 comment clean-up 2021-07-16 06:04:38 +00:00
jan.nijtmans 68dc740f26 Fix [1a89eba3761f62ee]: Add "exit" Windows shell built-in to auto_execok 2021-07-14 16:06:32 +00:00
jan.nijtmans 6e3371ad0a Fix build on Linux/Sparc with 32 bit userspace. See: [https://github.com/libtom/libtommath/issues/509] for the upstream libtommath fix 2021-07-14 15:54:56 +00:00
jan.nijtmans c39b5671ce Add support for ICC 2021-07-14 08:58:13 +00:00
jan.nijtmans bffdbce72e fullversion -> patchlevel 2021-07-13 16:14:35 +00:00
jan.nijtmans ce04bad35e More advanced tcl::build-info string parsing 2021-07-13 15:56:33 +00:00
jan.nijtmans 83e8931185 Merge-mark 2021-07-13 14:22:56 +00:00
jan.nijtmans 582fceb34d Remove tclPkg.c changes, instead implement new tcl::build-info command 2021-07-13 13:12:40 +00:00
jan.nijtmans e5bb3b3829 finally -> finallyIndex, preventing conflicts with Tru64 headers (reported by Jay K) 2021-07-13 07:56:44 +00:00
jan.nijtmans 957da2bc57 Eliminate clang warning 2021-07-09 22:11:03 +00:00
jan.nijtmans 6bdb76c461 merge 8.6 2021-07-08 12:28:56 +00:00
jan.nijtmans 3d82d5537c Add \DUSE_NMAKE=1 to C-flags when nmake is used 2021-07-08 12:17:30 +00:00
jan.nijtmans 259220cf73 Set -DUSE_NMAKE=1 when compiling under nmake. Update .gitattributes and (for Fossil) binary-glob and crlf-glob 2021-07-08 12:00:07 +00:00
jan.nijtmans a545cd5b47 "profiled" -> "profile" 2021-07-02 09:57:51 +00:00
jan.nijtmans 007417b8be "utf16" -> "utf-16" 2021-07-01 10:35:46 +00:00
jan.nijtmans 0c5ef0b57f Merge 8.7 2021-06-29 16:06:01 +00:00
jan.nijtmans 4df980c07b TCL_THREADS=0 means no threads too 2021-06-29 16:03:49 +00:00
jan.nijtmans eb4a617c51 TCL_THREADS=0 means no threads too .... 2021-06-29 15:59:19 +00:00
jan.nijtmans eb94deaf81 Merge 8.7. Minor signature fix in tcl.decls 2021-06-29 15:48:41 +00:00
jan.nijtmans f0048561b7 Use fstat64() in stead of fstat() on platforms which support it. 2021-06-29 14:52:29 +00:00
jan.nijtmans 7573820525 Merge 8.6 2021-06-28 14:38:11 +00:00
jan.nijtmans 5175765beb Update many tools/encoding/*.txt files to the latest version, but leave out character changes. Only add the new "cns11643" encoding, which belongs to the same group as big5 2021-06-28 14:33:00 +00:00
jan.nijtmans 35315e5c2e Update many tools/encoding/*.txt files to the latest version, but leave out character changes. Only add the new "cns11643" encoding, which belongs to the same group as big5 2021-06-28 14:22:00 +00:00
jan.nijtmans b37752f775 Merge 8.7 2021-06-28 12:36:06 +00:00
jan.nijtmans 25a30f2db0 Tweak TIP #590 impl on MacOS: Shared library could start with capital 2021-06-25 21:30:32 +00:00
jan.nijtmans ce4804bf2c Merge 8.7 2021-06-25 14:03:55 +00:00
pooryorick a6691785d8 fix typos in previous commit 2021-06-23 21:31:40 +00:00
pooryorick 458f106fdb possible fix for [dcb888ed85adeb86] with kevent() 2021-06-23 18:49:57 +00:00
jan.nijtmans 501954d5aa Merge 8.6 2021-06-23 12:26:39 +00:00
jan.nijtmans 814c9b57aa Now really merge [bug-f9800d52bd61f240] (previous commit contains test-cases only) 2021-06-23 12:20:59 +00:00
pooryorick d7d411426d merge [bug-f9800d52bd61f240] 2021-06-23 07:43:54 +00:00
pooryorick 76238b9ab7 possible fix for [dcb888ed85adeb86] with kevent() 2021-06-22 18:26:58 +00:00
jan.nijtmans 617e57260f Merge 8.5 2021-06-22 13:20:38 +00:00
jan.nijtmans ad4b60ef7c More code cleanup, eliminating various compiler warnings with stricter flags. No need to even use strmove at all. 2021-06-22 13:19:31 +00:00
jan.nijtmans 7403235131 Merge 8.5 2021-06-22 09:03:17 +00:00
jan.nijtmans 30db6ce78e Fix [bad6cc213d]: A format string vulnerability in Tcl nmakehelp.c allows code execution via a crated file.
Also change a memcpy() to a memmove(), because the range could be overlapping
2021-06-22 09:02:00 +00:00
pooryorick 6f34bcda8f Improve logic and cleanup for tests coroutine-7.13 and coroutine-7.14 2021-06-21 21:21:50 +00:00
jan.nijtmans cb849ffbeb Merge 8.6 2021-06-21 12:34:20 +00:00
jan.nijtmans a8e1d5aae3 Backport ISSUE_TEMPLATE and PULL_REQUEST_TEMPLATE from 8.7 2021-06-21 12:31:39 +00:00
jan.nijtmans b632599a22 Merge 8.6 2021-06-21 12:08:28 +00:00
jan.nijtmans 3f913d322f Change a lot of url's (as far as possible) from http:// to https:// 2021-06-21 12:00:29 +00:00
jan.nijtmans cdae95cf66 Backout merge of "bug-f9800d52bd61f240" branch, which is - apparently - not ready to be merged yet.
This is causing failures on all platforms: [https://github.com/tcltk/tcl/runs/2872891537?check_suite_focus=true]
2021-06-21 10:27:02 +00:00
jan.nijtmans f36b113b00 eol-spacing 2021-06-21 09:45:43 +00:00
jan.nijtmans 954fcc121d renumber testcases 2021-06-21 09:40:59 +00:00
jan.nijtmans c60ee515ee Fix [048dd20b4171c8da]: cesu-8 encoding fails on \u80 2021-06-21 09:29:18 +00:00
pooryorick 0008ef8d9b merge bug-f9800d52bd61f240 2021-06-21 05:47:02 +00:00
pooryorick 7357ee63c3 test for issue [5106fddd4400e5b9b], failure to yieldto is not the same thing as
not calling yieldto in the first place
2021-06-21 05:40:22 +00:00
pooryorick e0456ccfdf merge bug-f9800d52bd61f240 2021-06-20 22:57:40 +00:00
pooryorick 70c2b0e817 Fix for [f9800d52bd61f240], vwait is not NRE-enabled, and yieldto cannot find
the right splicing spot
2021-06-20 22:47:14 +00:00
jan.nijtmans 55076a6af2 Undo change in [b70eeebb0d196bb2]: It breaks the "make html" target in github actions. See also [1e10b17023] 2021-06-19 23:37:07 +00:00
jan.nijtmans ee4adbec91 Assume chan-io-41.6 and chan-io-41.8 are UNIX-only. See [9be2726881c41893], those are failing on Windows now 2021-06-19 23:32:03 +00:00
jan.nijtmans eff036def9 Fix windows build failure, caused by [f8608fc420] 2021-06-19 23:24:24 +00:00
jan.nijtmans d825807d46 Fix [f8608fc420]: linux : dynamic location of the tcl zipfs 2021-06-18 19:39:39 +00:00
dgp d94c2ac828 merge 8.7 2021-06-18 19:23:25 +00:00
dgp a444785129 Bump version number to distinguish from release. 2021-06-18 18:11:29 +00:00
dgp 9deb1f2b0a close fork 2021-06-18 17:38:27 +00:00
dgp a8606e7ce9 merge release 2021-06-18 17:37:05 +00:00
jan.nijtmans 7dd17bbcbf Merge 8.6 2021-06-18 14:22:23 +00:00
jan.nijtmans 8c5e1ee93f Update all "cp" and "iso8859-?" encodings to the latest version. This adds 3 new codepoints to iso8859-7, and adds a full new encoding iso8859-11 2021-06-18 12:46:32 +00:00
jan.nijtmans e809cadb0a Update all "cp" and "iso8859-?" encodings to the latest version. This adds 3 new codepoints to iso8859-7, and adds a full new encoding iso8859-11. 2021-06-18 12:24:06 +00:00
jan.nijtmans ce199db516 Hm. tcltk-man2html.tcl cannot handle $(PATCH_LEVEL). Don't bother for now. 2021-06-18 10:44:08 +00:00
jan.nijtmans cd814a13ac Fix "make html-tcl" target, broken by this commit: [b70eeebb0d196bb2] (in core-8-7-a5-rc branch only) 2021-06-18 10:15:01 +00:00
dgp a6a453f3b8 Revert to the code of RC2, so that only timestamps and changes file entries
are different.
2021-06-17 15:52:08 +00:00
dgp 8cfc027811 Add another ticket to the changes file, noting its incompatility. 2021-06-17 15:44:09 +00:00
pooryorick 06938f94df tests for [dcb888ed85adeb86] 2021-06-17 10:25:25 +00:00
pooryorick 597edf50b5 Fix for [dcb888ed85adeb86]: epoll, special files, directories, links, epoll_ctl operation not permitted, and abort 2021-06-17 08:53:04 +00:00
pooryorick 79b57974dc Re-apply fix for [67a5eabbd3d1]: refchan, coroutine, and postevent from the "watch" proc 2021-06-16 16:06:00 +00:00
dgp acfe572897 merge 8.7 2021-06-16 02:26:17 +00:00
jan.nijtmans 9b3ea0f675 Fix [18f4a94d03] by backing out [9bcec7cd880540c3] 2021-06-15 14:54:15 +00:00
jan.nijtmans 9251a05e68 Fix [18f4a94d03] by backing out [9bcec7cd880540c3] 2021-06-15 14:52:02 +00:00
jan.nijtmans 7413757522 Fix [18f4a94d03] by backout out [9bcec7cd880540c3] 2021-06-15 12:56:58 +00:00
jan.nijtmans 3fcf24bf05 Adapt iso8859-7.enc to latest version, and fix testcase 2021-06-15 08:50:23 +00:00
jan.nijtmans 693567f0d8 Add new encoding iso8859-11 2021-06-15 08:28:20 +00:00
jan.nijtmans 98f26e503e Update encodings (cp/iso) to latest version from unicode.org. *.enc-files not re-generated yet 2021-06-15 08:17:52 +00:00
dgp 1dfd77778e Change the arguments of the make html target to take the right default
actions for producing a Tcl/Tk release.
2021-06-13 17:01:00 +00:00
dgp 4b9ec1f4aa bump release date 2021-06-12 16:49:02 +00:00
dgp bd52e4af47 merge 8.7 2021-06-11 17:49:50 +00:00
jan.nijtmans 729c97255b Merge 8.6 2021-06-11 13:59:23 +00:00
jan.nijtmans 60abdd9b58 Fix [d6b10a9256]: Two files under compat/zlib/contrib/ are CRLF 2021-06-11 13:57:40 +00:00
jan.nijtmans 5b8c40a4b1 Somehow "zip -A" appears not to work in the github actions environment. Try to find out why. 2021-06-11 13:48:03 +00:00
jan.nijtmans 21904bcbde Ubuntu 16 is [https://github.com/actions/virtual-environments/issues/3287|deprecated] 2021-06-11 08:45:01 +00:00
jan.nijtmans 4427df1ae8 protect all usage of dladdr() with !defined(NO_DLFCN_H) 2021-06-11 06:59:13 +00:00
jan.nijtmans 19c1bb0cf6 Fix copying of public_suffix_list.dat.gz in win/Makefile.in. Thanks, Paul! 2021-06-11 06:33:33 +00:00
dgp b67894a411 merge 8.7 2021-06-10 15:56:43 +00:00
jan.nijtmans d1e77398a8 Experiment: use dladdr() on Linux to locate the shared library. Won't work on other platforms! WIP 2021-06-10 14:49:08 +00:00
jan.nijtmans 179a97b763 Merge 8.7 2021-06-10 10:59:50 +00:00
jan.nijtmans f271e62139 (cherry-pick): Update dist target to renamed file.
Also sync win/tcl.m4 with Tk (no change in generated win/configure)
2021-06-10 08:52:12 +00:00
dgp 4476f831f5 Update dist target to renamed file. 2021-06-09 20:32:46 +00:00
dgp 3618ecdad8 merge 8.7 2021-06-09 16:26:41 +00:00
jan.nijtmans ac2c528c36 Rename effective_tld_names.txt to public_suffix_list.dat, that's how it is named now. 2021-06-09 09:25:58 +00:00
jan.nijtmans 751750005b Update effective_tld_names.txt.gz to latest version (from https://publicsuffix.org/list/public_suffix_list.dat) 2021-06-09 09:13:53 +00:00
jan.nijtmans 5b7381172b Merge 8.6 2021-06-09 07:17:45 +00:00
jan.nijtmans 0d6faa1ccd Fix compiler warning seen with static builds (--disable-shared): "FLT_RADIX" is not defined, evaluates to 0 [-Wundef] 2021-06-09 07:16:18 +00:00
jan.nijtmans 4d31e6c26e Merge 8.6 2021-06-08 14:23:52 +00:00
jan.nijtmans 3b3080a9f6 Name TKSCRIPTZIPNAME the same way as TCLSCRIPTZIPNAME 2021-06-08 14:22:59 +00:00
jan.nijtmans 1b914f66bf Don't create a lot of empty directories any more while installing 2021-06-08 13:25:22 +00:00
jan.nijtmans 7951ebbd2e Merge 8.7 2021-06-08 12:14:25 +00:00
jan.nijtmans 9b86fa3762 HP_UX -> HP-UX and another apparent typo 2021-06-08 12:04:28 +00:00
jan.nijtmans 31de1a727a re-generate unix/configure with autoconf-2.59 2021-06-08 12:01:44 +00:00
jan.nijtmans f0316438a9 Use -fPIC by default on DragonFly/FreeBSD, but not on OSF1/HP-UX. Backported (with typo correct) from 8.7 2021-06-08 11:49:55 +00:00
jan.nijtmans 02c12ad919 Add full "libtommath" to "make dist" in stead of only the header-files and src-files. Reported by Harald Oehlmann. 2021-06-08 08:55:00 +00:00
jan.nijtmans a1f7ab6047 DragonFly/FreeBSD need -fPIC 2021-06-08 08:37:17 +00:00
jan.nijtmans 6c09446693 If the test suite needs a file, it needs to go in the distribution (cherry-pick) 2021-06-08 06:20:10 +00:00
dgp 9882c08b41 ....and with the right path. 2021-06-07 17:16:20 +00:00
dgp 1fb36494e2 If the test suite needs a file, it needs to go in the distribution. 2021-06-07 17:14:49 +00:00
dgp cb796d6e08 merge 8.7 2021-06-04 21:01:50 +00:00
dgp 557c437637 update changes 2021-06-04 21:01:37 +00:00
dgp c0ef486e3d Update docs to reflect http 2.10 2021-06-04 19:55:07 +00:00
dgp 7a14d36614 Revise http version number from unusual 2.10.0a1 to conventional 2.10a1 2021-06-04 19:43:08 +00:00
jan.nijtmans 05e623cbed Merge 8.7 2021-06-04 07:49:34 +00:00
jan.nijtmans 7e1bd9ece3 Add winspool library to LIBS_GUI on Windows. Not used yet (but most likely it will be used in 8.7 final) 2021-06-02 07:45:25 +00:00
dgp 4d0c2de9fe more changes 2021-05-28 18:12:51 +00:00
jan.nijtmans d2275e354d compete TIP list in "changes" 2021-05-28 10:09:04 +00:00
dgp 28821a3fc8 merge 8.7 2021-05-27 15:47:34 +00:00
jan.nijtmans 40e5a934ab Merge 8.6. Make c++ compile (with g++-11) warning-free 2021-05-27 12:13:41 +00:00
jan.nijtmans a5ee3631c3 Fix "possibly uninitialized variable" warning, seen with gcc-11 (however harmless) 2021-05-27 10:31:51 +00:00
jan.nijtmans 0c51650ae9 Fix [a73c79081e]: Doc fix in tcl.h. Recommend int32_t in stead of wchar_t 2021-05-26 11:23:19 +00:00
jan.nijtmans 6d2f85de20 Fix [a73c79081e]: Doc fix in tcl.h, by not suggesting wchar_t any more for Tcl_UniChar. 2021-05-26 10:47:20 +00:00
jan.nijtmans dbcca14632 Fix [a73c79081e]: Doc fix in tcl.h, by not suggesting wchar_t any more for Tcl_UniChar. 2021-05-26 10:45:17 +00:00
jan.nijtmans 0e90b5c0cf Merge 8.7. Add "ilp32" build flag 2021-05-26 10:28:11 +00:00
jan.nijtmans 9d13d5e64b One more macos-11.0 -> macos-11 2021-05-26 10:01:11 +00:00
jan.nijtmans 1233589701 Merge 8.6 2021-05-26 09:57:58 +00:00
jan.nijtmans cd326bf172 macos-11.0 -> macos-11 2021-05-26 09:56:44 +00:00
dgp cfeffbe151 merge 8.7 2021-05-25 13:16:16 +00:00
dgp b6d01a333a merge 8.7 2021-05-25 13:15:32 +00:00
jan.nijtmans 6ef2d21d52 Merge 8.6 2021-05-25 09:38:06 +00:00
jan.nijtmans e7ff6cacbc Fix [3f9b4e0c81]: CrtObjCmd.3, NRE.3, SplitList.3: constify cmdName, list
(actually quite a few more where the documentation didn't match the header files ....)
2021-05-25 09:30:20 +00:00
jan.nijtmans 08902d8a97 Fix [https://core.tcl-lang.org/tk/info/8b679f597b1d17ad|8b679f597b] for Tcl too: LIB_RUNTIME_DIR could contain multiple paths, DYLIB_INSTALL_DIR cannot handle that 2021-05-25 09:10:51 +00:00
jan.nijtmans a4006968d9 Fix [https://core.tcl-lang.org/tk/info/8b679f597b1d17ad|8b679f597b] for Tcl too: LIB_RUNTIME_DIR could contain mulitple paths, DYLIB_INSTALL_DIR cannot handle that 2021-05-25 08:59:15 +00:00
jan.nijtmans d6aac61b03 merge-mark 2021-05-21 07:19:11 +00:00
jan.nijtmans 703055871b Make all "pkg?" package names lowercase (was: ""Pkg?"), as we now recommend lowercase package names. Let's provide good examples then. 2021-05-21 07:07:21 +00:00
dgp db355c6ea7 merge 8.7 2021-05-20 19:17:43 +00:00
dgp 500d59bd30 merge 8.7 2021-05-20 19:08:47 +00:00
jan.nijtmans fd0aa4c0fc Merge 8.6, except [688fcc7082] because it gives a merge conflict 2021-05-20 12:35:19 +00:00
jan.nijtmans 3a1e408464 Make all "pkg?" package names lowercase (was: ""Pkg?"), as we now recommend lowercase package names. Let's provide good examples then. 2021-05-20 12:26:27 +00:00
jan.nijtmans d80a12f061 Fix [52cc90776c]: Warning when compile with gcc v9.3.0 2021-05-20 12:21:33 +00:00
dgp 1368d760bc merge 8.7 2021-05-19 14:57:55 +00:00
dgp 235cbf9e89 merge 8.7 2021-05-19 14:49:47 +00:00
pooryorick 9b49520dc2 fix for [e39cb3f462631a99], namespace is removed from other namespace paths
before deletion is complete
2021-05-19 10:46:54 +00:00
pooryorick 0f48a8bc92 update documentation and macro names 2021-05-19 10:44:18 +00:00
pooryorick 93e207f19d new test for issue [e39cb3f462631a99], namespace is removed from other
namespace paths before deletion is complete
2021-05-19 07:15:10 +00:00
pooryorick a201f0f383 Fix for issue [e39cb3f462631a99], namespace is removed from other namespace
paths before deletion is complete
2021-05-18 22:09:41 +00:00
jan.nijtmans 1c9f5c8741 Make pkgua package thread-safe 2021-05-18 12:23:32 +00:00
jan.nijtmans 39ef112133 Make Pkgua package thread-safe and properly clean up everything when being unloaded. Based on pyk-tclUnload branch, but extended for thread-safety (Thanks!) 2021-05-18 12:02:55 +00:00
pooryorick f14d3b58cf Fix [28027d8bb7745fb0], memory leaks in tclUnload.c . 2021-05-18 10:58:18 +00:00
pooryorick 0187ddfaf3 merge 8.7 2021-05-18 10:51:33 +00:00
pooryorick 9649c9074c Break TclDeleteNamespaceChildren out of TclTeardownNamespace. 2021-05-18 10:36:11 +00:00
pooryorick 05b875c564 Remove unneeded cmdPtr increment and decrement. 2021-05-18 10:25:47 +00:00
pooryorick d3e0d5789c Remove the refCount increment that accompanied the decrement removed in the
last commit.
2021-05-18 10:24:17 +00:00
pooryorick 11b101cd27 Additional test for [688fcc7082fa99a4], imported command trace memory error. 2021-05-18 06:03:40 +00:00
pooryorick 5bdefd0c25 Remove unnecessary refCount decrement. 2021-05-17 21:34:25 +00:00
pooryorick a8516aa629 Fix for [688fcc7082fa99a4], trace on imported alias deletes alias and then
calls import and triggers memory error.
2021-05-17 21:30:57 +00:00
pooryorick d9bbe48c46 Additional test for [688fcc7082fa99a4]. 2021-05-17 21:29:25 +00:00
jan.nijtmans 12502ae524 Eliminate "unused parameter" warning 2021-05-17 11:49:26 +00:00
jan.nijtmans 932e04d6db Merge 8.6 2021-05-17 11:35:43 +00:00
jan.nijtmans 962b2df00b Eliminate use of TCL_STORAGE_CLASS in pkg?.c: just use DLLEXPORT macro directly.
Fix gcc warnings (with stricter gcc flags) in pkg?.c
2021-05-17 11:28:51 +00:00
pooryorick d4d8fe187b use [info sharedlibextension] for instead of ".so" 2021-05-17 07:39:20 +00:00
pooryorick e4e1451d4a Break TclDeleteNamespaceChildren out of TclTeardownNamespace. 2021-05-16 19:09:47 +00:00
pooryorick 3634214bbb Eliminate compiler warnings about unused parameters. 2021-05-16 10:03:55 +00:00
pooryorick 7ee82af4aa Fix [28027d8bb7745fb0], memory leaks in tclUnload.c, 2021-05-15 21:56:03 +00:00
pooryorick e7d3979e0a Delete associated data after running Tcl_InterpDeleteProc instead of before. Remove redundant/cyclic call to Tcl_DeleteAssocData. 2021-05-15 19:04:09 +00:00
pooryorick 1134511a98 When deleting an interp, delete associated data after running the corresponding
Tcl_InterpDeleteProc instead of before to allow the Tcl_InterpDeleteProc to
make use of the data.

In TcltestObj.c/VarPtrDeleteProc, remove call to Tcl_DeleteAssocData that is
redundant and cylic.
2021-05-15 18:42:40 +00:00
pooryorick 71008a6aa8 Add valgrind option --keep-deguginfo=yes 2021-05-15 18:27:20 +00:00
pooryorick 0f818acbb7 Add valgrind option --keep-deguginfo=yes 2021-05-15 18:24:59 +00:00
pooryorick 4bd04113a8 merge core-8-branch 2021-05-15 10:10:04 +00:00
fvogel 6a484fdaef Fix errors in man pages build 2021-05-15 09:32:23 +00:00
fvogel 4c055148da Fix errors in man pages build 2021-05-15 09:31:45 +00:00
pooryorick 2174632a4b Fix for issue [463b7a93be0a2ddd], Tcl_Unload, make gdb-test, segmentation fault. 2021-05-15 09:09:42 +00:00
pooryorick 60a9b8775d Merge bug-fb2a411b91973d3b. 2021-05-15 09:07:08 +00:00
pooryorick 0d6bc7fc83 Separate library unloading routine from [unload] command processing. 2021-05-15 07:55:55 +00:00
pooryorick 7d899dfff0 Fix more leaks in tclZipfs.c. Valgrind now reports no more leaks in tclZipfs.c 2021-05-14 20:58:14 +00:00
pooryorick 2fea9a2bbd Fix more leaks in Zipfs finalization. 2021-05-14 20:49:34 +00:00
pooryorick 7987c596f2 Fix for issue [463b7a93be0a2ddd], Tcl_Unload, make gdb-test, segmentation fault 2021-05-14 18:50:33 +00:00
jan.nijtmans 9fecbcc106 Respect TIP #587 in dde test-cases. 2021-05-14 13:54:50 +00:00
jan.nijtmans ad6b4e6f8f Backout [217391dc7f] and [b05e314d7a]. For the reason, see: [https://github.com/tcltk/tcl/runs/2573477656?check_suite_focus=true]: Test file error: alloc: invalid block: 0x558a6e095990: 20 6e 2021-05-13 17:47:41 +00:00
pooryorick 737753205d Fix quoting issues in gdb-test and lldb targets. 2021-05-13 15:22:50 +00:00
pooryorick 7caa74e545 Fix remaining leaks in Zipfs finalization. 2021-05-13 12:49:23 +00:00
pooryorick f87cb71e7a On exit deallocate up some memory allocated in ZipFS. 2021-05-12 21:08:49 +00:00
dgp dc8cb018ad merge 8.7 2021-05-07 13:58:43 +00:00
dgp 65df3cd9fe Merge 8.7 2021-05-07 13:40:29 +00:00
jan.nijtmans 7cf2f6d102 Better error-message "illegal byte sequence" when trying to read from invalid/incomplete UTF-8 2021-05-07 12:27:27 +00:00
jan.nijtmans ed61282e22 Remove TODO comment which is already done 2021-05-07 11:01:49 +00:00
jan.nijtmans 75afeeeffa Merge 8.6 2021-05-06 15:06:50 +00:00
jan.nijtmans 6607e4e824 Handle POSIX error EILSEQ: "invalid byte sequence" 2021-05-06 15:04:40 +00:00
oehhar eb45f86b3f Ticket[535705]: encoding manpage example is about outdated source command. It is replaced by a simple example. 2021-05-06 12:53:52 +00:00
oehhar b72fcddfe2 Ticket[535705]: encoding manpage example is about outdated source command. It is replaced by a simple example. 2021-05-06 12:50:38 +00:00
dgp a40403b0ea merge 8.7 2021-05-03 20:44:07 +00:00
dgp d261590825 merge 8.7 2021-05-03 20:36:15 +00:00
dgp 713ea0845e Bump to version 8.7a5 for release. 2021-05-03 20:33:07 +00:00
jan.nijtmans e2a1c2f11c Merge 8.6 2021-05-03 19:44:49 +00:00
jan.nijtmans 6f6229ef6e Fix [24b9181478]: Fix unsafe buffer lifetime 2021-05-03 19:42:03 +00:00
jan.nijtmans 7476029a04 Fix [24b9181478]: Fix unsafe buffer lifetime 2021-05-03 19:36:22 +00:00
dgp c59734a3cb merge 8.7 2021-04-30 15:34:43 +00:00
jan.nijtmans 471313fea0 TIP #597: "string is unicode" and better utf-8/utf-16/cesu-8 encodings 2021-04-30 07:20:06 +00:00
jan.nijtmans a3201caebd unofficial -> snapshot 2021-04-29 12:30:30 +00:00
jan.nijtmans 15ba6741cf doc update 2021-04-29 11:28:50 +00:00
jan.nijtmans be928297ad Remove "testpurify" and "testdebug" test commands 2021-04-29 11:13:42 +00:00
jan.nijtmans dcd421e97b Merge 8.7 2021-04-29 10:04:25 +00:00
jan.nijtmans 9cf2b1031b Merge 8.7 2021-04-29 09:58:44 +00:00
jan.nijtmans c5e9409992 Prevent compiler warning 2021-04-29 09:58:08 +00:00
jan.nijtmans 2e4a20524c Merge 8.7 2021-04-29 09:54:42 +00:00
jan.nijtmans d4ed243e68 Unbreak build with -DTCL_NO_DEPRECATED 2021-04-29 09:51:54 +00:00
dgp 61a96cbf27 merge 8.7 2021-04-28 22:46:10 +00:00
jan.nijtmans d04f26fbb1 Merge 8.7 Signature change for Tcl_SetPanicProc() and Tcl_FindExecutable() 2021-04-28 15:53:59 +00:00
jan.nijtmans 4c5c001bc8 Merge 8.7 2021-04-28 14:30:11 +00:00
pooryorick 71dcf14194 Add test for upvar a linked variable to itself. 2021-04-28 14:01:22 +00:00
jan.nijtmans ce299372a0 CONST86 -> const 2021-04-28 13:04:27 +00:00
jan.nijtmans ef9154f143 Rename TclSetPreInitScript() to Tcl_SetPreInitScript(). Tiny part of TIP #596, the only part meant for 8.7. 2021-04-28 12:42:17 +00:00
pooryorick c7fcbf756c Make tcltests.tcl continue to function even if tclTest.c isn't available. 2021-04-27 10:48:58 +00:00
pooryorick 81d499ea31 Fix for io-28.6. 2021-04-26 23:06:14 +00:00
pooryorick 4de3a63efd Fix typo in tcltests.tcl. 2021-04-26 23:02:14 +00:00
pooryorick b6d1ba3fdb Fix typo in tcltests.tcl. 2021-04-26 23:01:03 +00:00
pooryorick 28437b46c3 Add io-28.6 an io-28.7 to test closing a channel within a channel event
handler.
2021-04-26 22:53:42 +00:00
pooryorick 4fa09fa5d6 merge pyk-tcltests 2021-04-26 22:52:22 +00:00
pooryorick f2e08d25db Add test constaints "debug", "purify", and "debugpurify" 2021-04-26 22:48:15 +00:00
dgp 4f23433b6f merge 8.7 2021-04-26 14:08:04 +00:00
dkf 42a77f7b4b Document our reference count management 2021-04-25 20:22:05 +00:00
dkf 9bf722e8da Documenting our reference count management 2021-04-25 20:21:07 +00:00
dkf 5003483b1d Documenting our reference count management 2021-04-25 15:24:14 +00:00
dkf c1cc3a7238 Documenting our reference count management 2021-04-25 13:58:22 +00:00
pooryorick 5a5cb4c044 Fix for issue [f6fbc71cd160d779], with "make valgrind", safe-zipfs-5.5 fails
with the error, 'can't set "path": variable is array'
2021-04-25 13:24:09 +00:00
dkf 4aa680d80d Documenting our reference count management 2021-04-25 12:01:10 +00:00
dkf b63d1213ed Documenting our reference count management 2021-04-25 11:20:35 +00:00
dkf 2453c29945 Documenting our reference count management 2021-04-25 10:56:32 +00:00
dkf 8a32e272a4 Documenting our reference count management 2021-04-25 07:44:59 +00:00
dkf c1a1d841e7 Documenting our reference count management 2021-04-24 20:07:57 +00:00
dkf ae32db3ffa Documenting our reference count management 2021-04-24 12:51:07 +00:00
dkf bd778f8dd4 Documenting our reference count management 2021-04-24 11:24:23 +00:00
dkf 103d88f85a Documenting our reference count management 2021-04-24 09:04:19 +00:00
dkf aa6c33b39d Start of documenting our reference count management 2021-04-23 20:24:00 +00:00
dgp 5e92a219dd merge 8.7 2021-04-23 19:24:39 +00:00
jan.nijtmans 52b58d0c7d Merge 8.6 2021-04-21 09:27:04 +00:00
jan.nijtmans 93b4c9bd6b Fix default-pkgindex rule in makefile.vc, for generation of TEA extensions for Tcl 9 (see: TIP #595) 2021-04-21 09:24:10 +00:00
jan.nijtmans cfdc6e47f4 Unbreak Windows build (windows 32-bit only, not checked by GITHUB actions) 2021-04-21 08:43:03 +00:00
pooryorick bc8789e840 Fix for [1f4af0a127369d4a1], tclZipfs storage cleanup issue. 2021-04-20 19:33:57 +00:00
pooryorick 14ead72e1a Fixes for Valgrind issues similar to [ec06d0db3225afca]. 2021-04-20 13:45:27 +00:00
pooryorick a6e0a802ec Fix for issue [ec06d0db3225afca]. 2021-04-20 10:29:16 +00:00
jan.nijtmans 830d7561f9 Merge 8.6 2021-04-19 16:34:54 +00:00
jan.nijtmans 6f8c6e12dd Complete TIP #595 for rules.vc 2021-04-19 16:27:30 +00:00
jan.nijtmans 6f23bf98b4 Remove unused testConstraint 2021-04-19 12:50:20 +00:00
jan.nijtmans 3bfe6dba24 More testcases (cesu-8) 2021-04-19 07:24:18 +00:00
jan.nijtmans 82d0339a65 renumber testcases 2021-04-16 20:45:56 +00:00
jan.nijtmans 3c9c7e0621 Remove wtf-8/wtf-16/tcl-8 encodings 2021-04-16 20:34:33 +00:00
dgp 4b225827c3 merge 8.7 2021-04-15 18:13:59 +00:00
dgp a72038b28b merge 8.7 2021-04-14 17:12:23 +00:00
jan.nijtmans 7f42387e71 Merge 8.7 2021-04-14 08:47:53 +00:00
jan.nijtmans e83fde690f Merge 8.7 2021-04-14 08:40:16 +00:00
jan.nijtmans 4ef5cbaad7 Merge 8.7 2021-04-13 10:18:40 +00:00
jan.nijtmans 85469e495c Merge 8.7 2021-04-13 08:08:23 +00:00
jan.nijtmans 05fa595fc5 Merge 8.7 2021-04-13 07:22:56 +00:00
jan.nijtmans 72fd932a99 Merge 8.7 2021-04-12 09:37:20 +00:00
jan.nijtmans 42b705be81 merge-mark 2021-04-09 15:34:45 +00:00
jan.nijtmans aa4f7bcd47 Deprecate/remove "string bytelength" 2021-04-09 15:19:51 +00:00
jan.nijtmans 1f4a8eb5d1 Merge 8.7 2021-04-09 14:43:34 +00:00
dgp b7eb7f182f merge 8.7 2021-04-08 19:46:28 +00:00
jan.nijtmans 2e7b2436f1 Add "tcl-8" encoding 2021-04-08 11:14:56 +00:00
jan.nijtmans c7711541ec Merge 8.7 2021-04-08 08:56:38 +00:00
jan.nijtmans c6799de46b Merge 8.7 2021-04-06 09:08:54 +00:00
dgp e7b7016312 merge 8.7 2021-04-05 15:42:01 +00:00
dgp 3acc6f036a merge 8.7 2021-04-03 20:31:20 +00:00
jan.nijtmans 4b405eefc8 Merge 8.7 2021-04-01 10:34:31 +00:00
jan.nijtmans 6b90b986b2 Fix testcase for TCL_UTF_MAX=4 2021-03-31 06:53:27 +00:00
jan.nijtmans 3175cb43a5 Re-use TCL_ENCODING_MODIFIED flag value for TCL_ENCODING_LE too, since they are used for different encoders. 2021-03-31 06:40:02 +00:00
jan.nijtmans 48a57e0116 Bugfix (backported from encodings-with-flags branch): Use correct byte/char positions in error-situation 2021-03-30 14:14:02 +00:00
jan.nijtmans 269722c410 Merge 8.7 2021-03-30 13:39:22 +00:00
jan.nijtmans 0b884f11fa Merge 8.7 2021-03-30 09:01:16 +00:00
jan.nijtmans 958892fdd0 Finish CESU-8 encoder/decoder 2021-03-29 09:51:54 +00:00
jan.nijtmans 1806e5755f Make a start with CESU-8 encoder/decoder. Not finished yet 2021-03-28 22:01:51 +00:00
jan.nijtmans ce82e0c22d Merge 8.7 2021-03-28 21:03:48 +00:00
dgp e938ad82aa merge 8.7 2021-03-22 22:22:24 +00:00
jan.nijtmans 74f570670c Add wtf-16 encodings to the set. With testcases 2021-03-17 12:46:31 +00:00
jan.nijtmans 9d25ea9cd7 Merge 8.7 2021-03-17 12:04:05 +00:00
dgp db2b6f6d62 merge 8.7 2021-03-15 13:47:24 +00:00
dgp 878d021fa0 merge 8.7 2021-03-15 13:32:50 +00:00
dgp 0786d600be merge 8.7 2021-03-15 11:53:35 +00:00
dgp 13da4f394b merge 8.7 2021-03-11 14:36:14 +00:00
jan.nijtmans b51e777fe9 Fix documentation 2021-03-10 15:00:44 +00:00
jan.nijtmans a5a30fa3e2 TIP #597 implementation: "string is unicode" and new wtf-8 encoding 2021-03-10 12:55:25 +00:00
dgp 2f9047786e merge 8.7 2021-03-09 15:37:42 +00:00
dgp 04e43741b0 merge 8.7 2021-03-08 17:15:51 +00:00
dgp c432456516 merge 8.7 2021-03-04 15:51:14 +00:00
jan.nijtmans 9ffcf83c49 Merge 8.7. Undo 2 unnecessary signature changes 2021-02-28 17:29:16 +00:00
jan.nijtmans 41d412e023 Merge 8.7 2021-02-26 15:58:15 +00:00
jan.nijtmans d044132580 Fix build with -DTCL_NO_DEPRECATED cflag 2021-02-25 11:54:10 +00:00
dgp a3914d29e0 merge 8.7 2021-02-24 15:22:24 +00:00
jan.nijtmans a8c5eb74e5 Merge 8.7 2021-02-24 13:09:44 +00:00
jan.nijtmans 5183eb3389 Merge 8.7. Change more functions signatures to return the Tcl full version number. 2021-02-24 08:43:28 +00:00
dgp f3da65e7a2 merge 8.7 2021-02-16 16:26:21 +00:00
jan.nijtmans 552e9c6542 Merge 8.7 2021-02-12 15:12:06 +00:00
jan.nijtmans a5f5cc7742 Replace Unicode 13 tables with Unicode 14 (still not finailized). Let's see how it goes so far. 2021-02-12 10:59:37 +00:00
jan.nijtmans 2dee9266c1 Merge 8.7 2021-02-10 11:42:14 +00:00
dgp 18de724391 merge 8.7 2021-02-05 18:20:54 +00:00
jan.nijtmans a7eae9c060 Add build tags for objective-c/cplusplus 2021-02-01 15:38:20 +00:00
jan.nijtmans eb3968cb61 Merge 8.7. Make "git rev-parse" work from any directory 2021-02-01 09:17:57 +00:00
jan.nijtmans fa3fc41362 Merge 8.7 2021-01-28 16:47:10 +00:00
jan.nijtmans 408e1c14d0 Merge 8.7 2021-01-28 15:31:11 +00:00
jan.nijtmans b373f35cc2 Make Tcl_GetBytesFromObj usable without TCL_NO_DEPRECATED too. Fix "testbytestring" test command, prevent stack smash (seen in github action build) 2021-01-26 11:13:11 +00:00
dgp 8a88828033 merge 8.7 2021-01-25 18:51:12 +00:00
dgp 656d39948f merge 8.7 2021-01-22 21:47:51 +00:00
jan.nijtmans 56938ac247 Make Tcl_GetBytesFromObj work with size_t length parameter (just as Tcl_GetByteArrayFromObj in TIP #481.
Add documentation for the new function
2021-01-18 15:59:11 +00:00
dgp 120e206269 merge 8.7 2021-01-15 22:01:20 +00:00
dgp 3d5d443c72 Merge TIP 481 (resolve conflicts) 2021-01-15 21:46:54 +00:00
dgp d56c554577 Merge pre-TIP 481 commits of 8.7 branch 2021-01-15 18:22:19 +00:00
dgp c36c170615 merge 8.7 2021-01-03 00:32:10 +00:00
dgp 47d47a0924 merge 8.7 2020-12-21 13:46:16 +00:00
jan.nijtmans 115a32cd6f Merge 8.7 2020-12-13 16:57:25 +00:00
dgp 573b4f4d3f merge 8.7 2020-12-10 18:58:29 +00:00
dgp 57a08cebbf merge 8.7 2020-12-07 16:31:22 +00:00
dgp fb566c5e57 merge 8.7 2020-11-10 16:44:48 +00:00
jan.nijtmans 9d07732ca0 Fix build/testcases on UNIX/Mac 2020-11-03 14:24:32 +00:00
jan.nijtmans e6def0aaaf Make everything work on Windows, using loaded tcl::test package 2020-11-03 12:14:25 +00:00
jan.nijtmans 9f5653ac08 Fix clang++ build 2020-11-03 11:25:57 +00:00
dgp 79bcff327b merge 8.7 2020-10-30 20:23:17 +00:00
jan.nijtmans 5495a08fcd Merge 8.7 2020-10-30 15:31:03 +00:00
dgp 368b8b8f1a merge 8.7 2020-10-29 21:08:22 +00:00
dgp 28c73f41f9 merge 8.7 2020-10-27 21:39:50 +00:00
jan.nijtmans 2367af6c1c Merge 8.7.
Enhance "load", being able to handle '::' in package names
2020-10-27 14:30:18 +00:00
jan.nijtmans ec73c61c78 Merge 8.7. Rename more "Tcltest" package-names into "tcl::test". Not sufficient to make the win32 travis build work. 2020-10-24 14:34:41 +00:00
dgp bb49902ff0 merge 8.7 2020-10-23 14:55:26 +00:00
jan.nijtmans 7471f961af Merge 8.7. More lowercase package names in test-suite 2020-10-22 07:35:24 +00:00
dgp 32e96f3ee3 merge 8.7 2020-10-19 14:50:23 +00:00
jan.nijtmans e0c00410d7 Merge 8.7 2020-10-19 13:10:16 +00:00
jan.nijtmans aeec23e585 Merge 8.7 2020-10-18 20:27:55 +00:00
jan.nijtmans 9503c006cc Merge 8.7 2020-10-16 16:34:29 +00:00
jan.nijtmans b4b10c1471 Merge 8.7 2020-10-14 09:41:35 +00:00
jan.nijtmans 741a599b04 Merge 8.7 2020-10-14 06:28:53 +00:00
dgp 55adac3d9d merge 8.7 2020-10-13 16:44:54 +00:00
dgp 7f61e687b0 merge 8.7 2020-10-13 16:42:51 +00:00
jan.nijtmans 63b5fd2631 Merge 8.7 2020-10-12 10:45:30 +00:00
dgp 2f9f72e1e9 merge 8.7 2020-10-09 14:13:27 +00:00
dgp 7d2e339b74 merge 8.7 2020-10-07 15:48:41 +00:00
jan.nijtmans 764371ff33 Merge 8.7 2020-10-05 08:50:29 +00:00
dgp c4f2bab01d merge 8.7 2020-10-03 19:52:31 +00:00
jan.nijtmans 6b8eaaf322 Merge 8.7. Fix 2 failing test-cases 2020-10-02 15:49:47 +00:00
jan.nijtmans 70c1d3d8c1 Merge 8.7. Internal package renaming 2020-10-01 08:17:48 +00:00
dgp c9bc1b9fe8 merge 8.7 2020-09-30 16:01:20 +00:00
dgp 5993d3c28c merge 8.7 2020-09-30 14:45:25 +00:00
jan.nijtmans 9e49093832 Fix testcase 2020-09-29 13:11:08 +00:00
jan.nijtmans 05301b57c5 Merge 8.7 2020-09-29 12:51:24 +00:00
dgp 0a7fbe0b21 merge 8.7 2020-09-28 14:04:52 +00:00
jan.nijtmans 2ea6a13c20 Merge 8.7 2020-09-27 16:24:20 +00:00
dgp 3167360c90 merge 8.7 2020-09-21 14:11:24 +00:00
dgp 23fe5a2694 merge 8.7 2020-09-20 16:00:16 +00:00
dgp 45d8b68e73 merge 8.7 2020-09-19 17:19:51 +00:00
dgp eaa9bca383 merge 8.7 2020-09-17 17:54:54 +00:00
jan.nijtmans 24bf495502 Merge 8.7 2020-09-17 09:34:26 +00:00
dgp 42d6d980e6 merge 8.7 2020-09-16 15:29:11 +00:00
dgp 163d31e623 merge 8.7 2020-09-15 18:04:02 +00:00
jan.nijtmans 8bfbf94fa1 Merge 8.7 2020-09-15 15:12:43 +00:00
jan.nijtmans 7a2fe89a7e Merge 8.7 2020-07-07 14:46:19 +00:00
jan.nijtmans 698d338b0f Merge 8.7. Provide both major and minor version number for gcc/clang/msvc 2020-07-06 12:00:35 +00:00
jan.nijtmans 11f905cd0a Add compiler information (gcc|clang|msvc) information 2020-06-30 16:36:27 +00:00
jan.nijtmans ef76e3161e Add buildinfo functionality to makefile.vc too 2020-06-30 14:36:48 +00:00
jan.nijtmans 288a283617 WIP: Store build info in package 2020-06-29 20:20:10 +00:00
dgp e36bada6ec merge 8.7 2020-04-27 14:27:01 +00:00
dgp e4c15393cc merge 8.7 2020-04-14 16:30:11 +00:00
jan.nijtmans 605adef3f6 Merge 8.7 2020-04-08 19:15:11 +00:00
dgp 15c9b22d18 merge 8.7 2020-04-02 23:19:55 +00:00
dgp fc04583c23 merge 8.7 2020-04-01 20:28:14 +00:00
jan.nijtmans f0082ebb73 Remove variable "properByteArrayType" from tclTest.c, because it isn't used any more. 2020-04-01 13:40:27 +00:00
dgp 4c38de4663 merge 8.7 2020-04-01 12:06:40 +00:00
dgp 7d00b9576c merge 8.7 2020-03-31 16:05:15 +00:00
dgp 11db05f8dc merge 8.7 2020-03-28 19:44:20 +00:00
dgp 5162052bef merge 8.7 2020-03-28 16:38:07 +00:00
dgp dc086d03e3 merge 8.7 2020-03-27 16:33:10 +00:00
jan.nijtmans 2c800cb378 Merge 8.7 2020-03-22 21:41:28 +00:00
dgp a8e3213d43 TIP 568 proposes new public routine Tcl_GetBytesFromObj. 2020-03-18 21:03:06 +00:00
343 changed files with 29557 additions and 7382 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
Important Note
==========
Please do not file issues with Tcl on Github. They are unlikely to be noticed in a timely fashion. Tcl issues are hosted in the [tcl fossil repository on core.tcl.tk](https://core.tcl.tk/tcl/tktnew); please post them there.
Please do not file issues with Tcl on Github. They are unlikely to be noticed in a timely fashion. Tcl issues are hosted in the [tcl fossil repository on core.tcl-lang.org](https://core.tcl-lang.org/tcl/tktnew); please post them there.
+1 -1
View File
@@ -1,3 +1,3 @@
Important Note
==========
Please do not file pull requests with Tcl on Github. They are unlikely to be noticed in a timely fashion. Tcl issues (including patches) are hosted in the [tcl fossil repository on core.tcl.tk](https://core.tcl.tk/tcl/tktnew); please post them there.
Please do not file pull requests with Tcl on Github. They are unlikely to be noticed in a timely fashion. Tcl issues (including patches) are hosted in the [tcl fossil repository on core.tcl-lang.org](https://core.tcl-lang.org/tcl/tktnew); please post them there.
+2 -2
View File
@@ -2,7 +2,7 @@ name: macOS
on: [push]
jobs:
xcode:
runs-on: macos-11.0
runs-on: macos-11
defaults:
run:
shell: bash
@@ -24,7 +24,7 @@ jobs:
ERROR_ON_FAILURES: 1
MAC_CI: 1
clang:
runs-on: macos-11.0
runs-on: macos-11
strategy:
matrix:
cfgopt:
+25 -19
View File
@@ -3,7 +3,7 @@ on: [push]
jobs:
linux:
name: Linux
runs-on: ubuntu-16.04
runs-on: ubuntu-18.04
defaults:
run:
shell: bash
@@ -27,18 +27,18 @@ jobs:
working-directory: unix
- name: Package
run: |
cp ../unix/tclsh tclsh${TCL_PATCHLEVEL}_unofficial
chmod +x tclsh${TCL_PATCHLEVEL}_unofficial
tar -cf tclsh${TCL_PATCHLEVEL}_unofficial.tar tclsh${TCL_PATCHLEVEL}_unofficial
cp ../unix/tclsh tclsh${TCL_PATCHLEVEL}_snapshot
chmod +x tclsh${TCL_PATCHLEVEL}_snapshot
tar -cf tclsh${TCL_PATCHLEVEL}_snapshot.tar tclsh${TCL_PATCHLEVEL}_snapshot
working-directory: 1dist
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Tclsh ${{ env.TCL_PATCHLEVEL }} Linux single-file build (unofficial)
name: Tclsh ${{ env.TCL_PATCHLEVEL }} Linux single-file build (snapshot)
path: 1dist/*.tar
macos:
name: macOS
runs-on: macos-11.0
runs-on: macos-11
defaults:
run:
shell: bash
@@ -74,8 +74,8 @@ jobs:
- name: Package
run: |
mkdir contents
cp $TCL_BIN contents/tclsh${TCL_PATCHLEVEL}_unofficial
chmod +x contents/tclsh${TCL_PATCHLEVEL}_unofficial
cp $TCL_BIN contents/tclsh${TCL_PATCHLEVEL}_snapshot
chmod +x contents/tclsh${TCL_PATCHLEVEL}_snapshot
cat > contents/README.txt <<EOF
This is a single-file executable developer preview of Tcl $TCL_PATCHLEVEL
@@ -83,32 +83,38 @@ jobs:
Use strictly at your own risk.
To run it, you need to copy the executable out and run:
xattr -d com.apple.quarantine tclsh${TCL_PATCHLEVEL}_unofficial
xattr -d com.apple.quarantine tclsh${TCL_PATCHLEVEL}_snapshot
to mark the executable as runnable on your machine.
EOF
$CREATE_DMG \
--volname "Tcl $TCL_PATCHLEVEL (unofficial)" \
--volname "Tcl $TCL_PATCHLEVEL (snapshot)" \
--window-pos 200 120 \
--window-size 800 400 \
"Tcl-$TCL_PATCHLEVEL-(unofficial).dmg" \
"Tcl-$TCL_PATCHLEVEL-(snapshot).dmg" \
"contents/"
working-directory: 1dist
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Tclsh ${{ env.TCL_PATCHLEVEL }} macOS single-file build (unofficial)
name: Tclsh ${{ env.TCL_PATCHLEVEL }} macOS single-file build (snapshot)
path: 1dist/*.dmg
win:
name: Windows
runs-on: windows-latest
defaults:
run:
shell: bash
shell: msys2 {0}
env:
CC: gcc
CFGOPT: --disable-symbols --disable-shared
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: git mingw-w64-ucrt-x86_64-toolchain make zip
- name: Checkout
uses: actions/checkout@v2
- name: Prepare
run: |
touch generic/tclStubInit.c generic/tclOOStubInit.c
@@ -116,7 +122,7 @@ jobs:
mkdir 1dist
working-directory: .
- name: Configure
run: ./configure --disable-symbols --disable-shared --enable-zipfs
run: ./configure $CFGOPT
working-directory: win
- name: Build
run: |
@@ -129,10 +135,10 @@ jobs:
working-directory: win
- name: Set Executable Name
run: |
cp ../win/tclsh*.exe tclsh${TCL_PATCHLEVEL}_unofficial.exe
cp ../win/tclsh*.exe tclsh${TCL_PATCHLEVEL}_snapshot.exe
working-directory: 1dist
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Tclsh ${{ env.TCL_PATCHLEVEL }} Windows single-file build (unofficial)
path: '1dist/*_unofficial.exe'
name: Tclsh ${{ env.TCL_PATCHLEVEL }} Windows single-file build (snapshot)
path: '1dist/*_snapshot.exe'
+8 -8
View File
@@ -1,5 +1,7 @@
name: Windows
on: [push]
env:
ERROR_ON_FAILURES: 1
jobs:
msvc:
runs-on: windows-latest
@@ -40,14 +42,11 @@ jobs:
if ($lastexitcode -ne 0) {
throw "nmake exit code: $lastexitcode"
}
env:
ERROR_ON_FAILURES: 1
CI_BUILD_WITH_MSVC: 1
gcc:
runs-on: windows-latest
defaults:
run:
shell: bash
shell: msys2 {0}
working-directory: win
strategy:
matrix:
@@ -60,10 +59,13 @@ jobs:
- "--enable-symbols=mem"
# Using powershell means we need to explicitly stop on failure
steps:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: git mingw-w64-x86_64-toolchain make
- name: Checkout
uses: actions/checkout@v2
- name: Install MSYS2 and Make
run: choco install msys2 make
- name: Prepare
run: |
touch tclStubInit.c tclOOStubInit.c tclOOScript.h
@@ -80,8 +82,6 @@ jobs:
run: make tcltest
- name: Run Tests
run: make test
env:
ERROR_ON_FAILURES: 1
# If you add builds with Wine, be sure to define the environment variable
# CI_USING_WINE when running them so that broken tests know not to run.
+1 -1
View File
@@ -8096,7 +8096,7 @@ a better first place to look now.
2009-03-25 Jan Nijtmans <nijtmans@users.sf.net>
* doc/tclsh.1: Bring doc and tools in line with
* tools/installData.tcl: http://wiki.tcl.tk/812
* tools/installData.tcl: https://wiki.tcl-lang.org/page/exec+magic
* tools/str2c
* tools/tcltk-man2html.tcl
+1 -1
View File
@@ -345,7 +345,7 @@
* library/clock.tcl: Corrected the regular expressions that match a
time zone to allow for time zones specified as +HH or -HH.
* tests/clock.test: Added regression test case for the above issue.
Thanks to Rolf Ade for reporting this issue [http://wiki.tcl.tk/13094]
Thanks to Rolf Ade for reporting this issue [https://wiki.tcl-lang.org/page/Parsing+ISO8601+dates+and+times]
* win/tclWinDde.c (Tcl_DdeObjCmd): Corrected a typo that caused a
compilation failure on VC++.
+1 -1
View File
@@ -5262,7 +5262,7 @@
* generic/tclStrToD.c: Added code to support the "middle endian"
floating point format used in the Nokia N770's software-based floating
point. Thanks to Bruce Johnson for reporting this bug, originally on
http://wiki.tcl.tk/15408.
https://wiki.tcl-lang.org/page/Nokia+770.
* library/clock.tcl: Fixed a bug with Daylight Saving Time and Posix
time zone specifiers reported by Martin Lemburg in
http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/9a8b15a4dfc0b7a0
+3 -3
View File
@@ -1,6 +1,6 @@
# README: Tcl
This is the **Tcl 8.7a4** source distribution.
This is the **Tcl 8.7a6** source distribution.
You can get any source release of Tcl from [our distribution
site](https://sourceforge.net/projects/tcl/files/Tcl/).
@@ -45,7 +45,7 @@ and selling it either in whole or in part. See the file
## <a id="doc">2.</a> Documentation
Extensive documentation is available on our website.
The home page for this release, including new features, is
[here](https://www.tcl.tk/software/tcltk/8.7.html).
[here](https://www.tcl-lang.org/software/tcltk/8.7.html).
Detailed release notes can be found at the
[file distributions page](https://sourceforge.net/projects/tcl/files/Tcl/)
by clicking on the relevant version.
@@ -96,7 +96,7 @@ Tcl Dev Kit builds on the earlier TclPro toolset and provides a debugger,
static code checker, single-file wrapping utility, bytecode compiler, and
more. More information can be found at
http://www.ActiveState.com/Tcl
https://www.activestate.com/products/tcl/
## <a id="complangtcl">5.</a> Tcl newsgroup
There is a USENET newsgroup, "`comp.lang.tcl`", intended for the exchange of
+254 -134
View File
@@ -8843,7 +8843,7 @@ in this changeset (new minor version) rather than bug fixes:
2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter)
--- Released 8.7a1, September 8, 2017 --- http://core.tcl.tk/tcl/ for details
--- Released 8.7a1, September 8, 2017 --- https://core.tcl-lang.org/tcl/ for details
2017-08-10 [array names -regexp] supports backrefs (goth)
@@ -8942,7 +8942,7 @@ in this changeset (new minor version) rather than bug fixes:
2018-11-16 (bug)[00d04c] Repair [binary encode base64] (sebres)
- Released 8.6.9, November 16, 2018 - details at http://core.tcl-lang.org/tcl/ -
- Released 8.6.9, November 16, 2018 - details at https://core.tcl-lang.org/tcl/ -
2018-11-22 (bug)[7a9dc5] [file normalize ~/~foo] segfault (sebres)
@@ -8990,7 +8990,142 @@ in this changeset (new minor version) rather than bug fixes:
2019-11-15 (bug)[135804] segfault in [next] after destroy (coulter,sebres)
- Released 8.6.10, Nov 21, 2019 - details at http://core.tcl-lang.org/tcl/ -
2019-11-18 (bug)[13657a] application/json us text, not binary (noe,nijtmans)
=> http 2.9.1
- Released 8.6.10, Nov 21, 2019 - details at https://core.tcl-lang.org/tcl/ -
Changes to 8.7a3 include all changes to the 8.6 line through 8.6.10,
plus the following, which focuses on the high-level feature changes
in this changeset (new minor version) rather than bug fixes:
2017-11-01 (bug)[3c32a3] crash deleting class mixed into instance (coulter)
2017-11-03 [TIP 345] eliminate the encoding 'identity' (porter)
2017-11-04 (bug)[0d902e] [string first] on ASCII stored as Unicode (fellows)
2017-11-17 [TIP 422] Mark all Tcl_*VA() routines deprecated. (nijtmans)
2017-11-20 (support) Ended use of the obsolete values.h header (culler)
2017-11-30 (bug)[8e1e31] [lsort] ordering of U+0000 (nijtmans)
2017-12-07 [TIP 487] Terminate support for pre-XP Windows (nijtmans)
2017-12-08 [TIP 477] Reform of nmake build (nadkarni)
2017-12-20 (bug)[ba1419] Crash: complex ensemble delete, namespace-7.8 (coulter)
2018-01-17 [TIP 485] Removal of many deprecated features (nijtmans)
2018-01-27 (bug) Crash in [join $l $l], join-4.1 (porter)
2018-02-06 [TIP 493] Cease Distribution of http 1.0 (porter)
2018-02-06 [TIP 484] internal rep for native ints are all 64-bit (nijtmans)
2018-02-14 [TIP 476] Scan/Printf consistency (nijtmans)
2018-03-05 [TIP 351] [lsearch] striding
2018-03-05 [TIPs 330,336] tighten access to Interp fields (porter)
2018-03-12 [TIP 462] [::tcl::process]
2018-03-12 [TIP 490] add oo support for msgcat => msgcat 1.7.0 (oehlmann)
2018-03-12 [TIP 499] custom locale preference list (oehlmann)
=> msgcat 1.7.0
2018-03-20 [TIP 503] End CONST84 support for Tcl 8.3 (porter)
2018-03-30 Refactored [lrange] (spjuth)
2018-04-20 [TIP 389] Unicode beyond BMP (nijtmans)
2018-04-20 [TIP 421] [array for]
2018-05-11 [TIP 425] Windows panic callback use of UTF-8
2018-05-17 [TIP 491] Phase out --disable-threads support
2018-06-03 [TIP 500] TclOO Private Methods and Variables
2018-07-26 (bug)[ba921a] [string cat] of bytearrays (coulter,porter)
2018-09-02 [TIP 478] Many new features in TclOO (lester,fellows)
2018-09-04 (bug)[540bed] [binary format w] from bignum (nijtmans)
2018-09-12 [TIP 430] zipfs and embedded script library (woods)
2018-09-26 [TIP 508] [array default] (bonnet,fellows)
2018-09-27 [TIP 515] level value reform (nijtmans)
2018-09-27 [TIP 516] More OO slot operations (fellows)
2018-09-27 [TIP 426] [info cmdtype] (fellows)
2018-09-28 [TIP 509] Cross platform reentrant mutex
2018-10-08 [TIP 514] native integers are 64-bit
2018-10-12 [TIP 502] index value reform (porter)
2018-11-06 [TIP 406] http cookies (fellows)
2018-11-06 [TIP 445] Tcl_ObjType utilities (migrate to Tcl 9) (porter)
2018-11-06 [TIP 501] [string is dict]
2018-11-06 [TIP 519] inline export/unexport option for [oo::define]
2018-11-06 [TIP 523] [lpop]
2018-11-06 [TIP 524] TclOO custom dialects
2018-11-06 [TIP 506] Tcl_(Incr|Decr)RefCount macros -> functions (porter)
2018-11-15 [TIP 512] No stub for Tcl_SetExitProc()
2019-04-08 (bug)[45b9fa] crash in [try] (coulter)
2019-04-14 [TIP 160] terminal and serial channel controls
2019-04-14 [TIP 312] more types for Tcl_LinkVar
2019-04-14 [TIP 367] [lremove]
2019-04-14 [TIP 504] [string insert]
2019-04-16 [TIP 342] [dict getwithdefault]
2019-04-23 (bug)[67a5ea] make [chan postevent] asynchronous
*** POTENTIAL INCOMPATIBILITY ***
2019-05-25 [TIP 431] [file tempdir]
2019-05-25 [TIP 383] [coroinject], [coroprobe]
2019-05-31 [TIP 544] Tcl_GetIntForIndex()
2019-06-12 Replace TclOffset() with offsetof()
2019-06-15 [TIP 461] string compare operators for [expr]
2019-06-16 [TIP 521] floating point classification functions for [expr]
2019-06-20 (bug)[6bdadf] crash multi-arg traced [lappend] (fellows)
2019-06-28 [TIP 547] New encodings utf-16, ucs-2
2019-09-14 [TIP 414] Tcl_InitSubsystems()
2019-09-14 [TIP 548] wchar_t conversion functions
- Released 8.7a3, Nov 21, 2019 --- https://core.tcl-lang.org/tcl/ for details -
2019-12-03 (bug)[3cd9be] Corner case in surrogate handling (nijtmans)
@@ -9119,139 +9254,124 @@ See RFC 2045
2020-12-23 tzdata updated to Olson's tzdata2020e (jima)
- Released 8.6.11, Dec 31, 2020 - details at http://core.tcl-lang.org/tcl/ -
Changes to 8.7a3 include all changes to the 8.6 line through 8.6.10,
plus the following, which focuses on the high-level feature changes
in this changeset (new minor version) rather than bug fixes:
2017-11-01 (bug)[3c32a3] crash deleting class mixed into instance (coulter)
2017-11-03 [TIP 345] eliminate the encoding 'identity' (porter)
2017-11-04 (bug)[0d902e] [string first] on ASCII stored as Unicode (fellows)
2017-11-17 [TIP 422] Mark all Tcl_*VA() routines deprecated. (nijtmans)
2017-11-20 (support) Ended use of the obsolete values.h header (culler)
2017-11-30 (bug)[8e1e31] [lsort] ordering of U+0000 (nijtmans)
2017-12-07 [TIP 487] Terminate support for pre-XP Windows (nijtmans)
2017-12-08 [TIP 477] Reform of nmake build (nadkarni)
2017-12-20 (bug)[ba1419] Crash: complex ensemble delete, namespace-7.8 (coulter)
2018-01-17 [TIP 485] Removal of many deprecated features (nijtmans)
2018-01-27 (bug) Crash in [join $l $l], join-4.1 (porter)
2018-02-06 [TIP 493] Cease Distribution of http 1.0 (porter)
2018-02-06 [TIP 484] internal rep for native ints are all 64-bit (nijtmans)
2018-02-14 [TIP 476] Scan/Printf consistency (nijtmans)
2018-03-05 [TIP 351] [lsearch] striding
2018-03-05 [TIPs 330,336] tighten access to Interp fields (porter)
2018-03-12 [TIP 462] [::tcl::process]
2018-03-12 [TIP 490] add oo support for msgcat => msgcat 1.7.0 (oehlmann)
2018-03-12 [TIP 499] custom locale preference list (oehlmann)
=> msgcat 1.7.0
2018-03-20 [TIP 503] End CONST84 support for Tcl 8.3 (porter)
2018-03-30 Refactored [lrange] (spjuth)
2018-04-20 [TIP 389] Unicode beyond BMP (nijtmans)
2018-04-20 [TIP 421] [array for]
2018-05-11 [TIP 425] Windows panic callback use of UTF-8
2018-05-17 [TIP 491] Phase out --disable-threads support
2018-06-03 [TIP 500] TclOO Private Methods and Variables
2018-07-26 (bug)[ba921a] [string cat] of bytearrays (coulter,porter)
2018-09-02 [TIP 478] Many new features in TclOO (lester,fellows)
2018-09-04 (bug)[540bed] [binary format w] from bignum (nijtmans)
2018-09-12 [TIP 430] zipfs and embedded script library (woods)
2018-09-26 [TIP 508] [array default] (bonnet,fellows)
2018-09-27 [TIP 515] level value reform (nijtmans)
2018-09-27 [TIP 516] More OO slot operations (fellows)
2018-09-27 [TIP 426] [info cmdtype] (fellows)
2018-09-28 [TIP 509] Cross platform reentrant mutex
2018-10-08 [TIP 514] native integers are 64-bit
2018-10-12 [TIP 502] index value reform (porter)
2018-11-06 [TIP 406] http cookies (fellows)
2018-11-06 [TIP 445] Tcl_ObjType utilities (migrate to Tcl 9) (porter)
2018-11-06 [TIP 501] [string is dict]
2018-11-06 [TIP 519] inline export/unexport option for [oo::define]
2018-11-06 [TIP 523] [lpop]
2018-11-06 [TIP 524] TclOO custom dialects
2018-11-06 [TIP 506] Tcl_(Incr|Decr)RefCount macros -> functions (porter)
2018-11-15 [TIP 512] No stub for Tcl_SetExitProc()
2019-04-08 (bug)[45b9fa] crash in [try] (coulter)
2019-04-14 [TIP 160] terminal and serial channel controls
2019-04-14 [TIP 312] more types for Tcl_LinkVar
2019-04-14 [TIP 367] [lremove]
2019-04-14 [TIP 504] [string insert]
2019-04-16 [TIP 342] [dict getwithdefault]
2019-05-25 [TIP 431] [file tempdir]
2019-05-25 [TIP 383] [coroinject], [coroprobe]
2019-05-31 [TIP 544] Tcl_GetIntForIndex()
2019-06-12 Replace TclOffset() with offsetof()
2019-06-15 [TIP 461] string compare operators for [expr]
2019-06-16 [TIP 521] floating point classification functions for [expr]
2019-06-20 (bug)[6bdadf] crash multi-arg traced [lappend] (fellows)
2019-06-28 [TIP 547] New encodings utf-16, ucs-2
2019-09-14 [TIP 414] Tcl_InitSubsystems()
2019-09-14 [TIP 548] wchar_t conversion functions
- Released 8.7a3, Nov 21, 2019 --- http://core.tcl-lang.org/tcl/ for details -
- Released 8.6.11, Dec 31, 2020 - details at https://core.tcl-lang.org/tcl/ -
Changes to 8.7a5 include all changes to the 8.6 line through 8.6.11,
plus the following, which focuses on the high-level feature changes
in this changeset (new minor version) rather than bug fixes:
- Released 8.7a5, Jan 21, 2021 --- http://core.tcl-lang.org/tcl/ for details -
2019-12-13 [TIP 538] Externalize libtommath
2020-01-20 [TIP 542] Support for switchable Full Unicode support
2020-01-21 [TIP 543] Eliminate `TCL_INTERP_DESTROYED` flag value
2020-01-24 [TIP 559] Eliminate public routine `Tcl_FreeResult
2020-01-31 (new) Implement 64-bit seek on Zip channels. (nijtmans)
2020-02-28 [TIP 557] C++ support for Tcl
2020-02-28 [TIP 562] Deprecate channel types 1-4
2020-03-11 (bug)[234d6c] Segfault in [set l {}; lpop l] (sebres)
2020-03-12 (bug) Crash in tests binary-79.[12] (porter)
2020-03-13 [TIP 569] Eliminate Comments That Serve Lint
2020-04-06 (bug)[dd010c] [string trim*] on astral characters (porter,nijtmans)
2020-05-30 [TIP 551] Permit underscore in numerical literals in source code
2020-07-03 [TIP 578] Death to TCL_DBGX
2020-08-11 (bug)[e87000] Win32 crash in [fconfigure stdout] (werner,nijtmans)
2020-09-06 (bug)[c1a376] deletion trace on imported ensemble (coulter)
2020-09-13 [TIP 585] Promote the INDEX_TEMP_TABLE flag of Tcl_GetIndexFromObj*() to the public interface
2020-09-15 (bug)[b5777d] crash in [string index abcd 0-0x10000000000000000]
2020-09-19 [b9ecf3] revised stork mgmt [uplevel [list $cmd ...]] (coulter)
2020-10-23 [TIP 587] Default utf-8 for source command
2020-10-27 (bug)[11229b] test string-31.26.* (porter)
2020-11-08 [TIP 582] Comments in Expressions
2020-11-16 [TIP 586] C String Parsing Support for binary scan
2020-12-07 [TIP 590] Recommend lowercase Package Names
2021-01-06 Bump to tcltest 2.5.4
2021-01-15 [TIP 481] `Tcl_GetStringFromObj()` with `size_t` length parameter
2021-01-15 [TIP 592] End support: Windows XP, Server 2003, Vista, Server 2008
2021-01-25 tzdata updated to Olson's tzdata2021a (nijtmans)
2021-01-29 (bug)[113be1] zipfs on mac
2021-03-15 [TIP 575] Switchable Tcl_UtfCharComplete()/Tcl_UtfNext()/Tcl_UtfPrev()
2021-03-19 (new)[0221b9] Drop TCL_WINDOW_EVENTS from Tcl's [update idletasks]
2021-03-30 (new)[4b4830] [chan truncate] for reflected channels
2021-04-30 [TIP 597] "string is unicode" and better utf-8/utf-16/cesu-8 encodings
2021-04-09 [TIP 598] export TclWinConvertError
2021-05-15 (bug)[463b7a] segfault from Tcl_Unload (coulter)
2021-05-15 (bug)[fb2a41] tclZipfs.c free all memory (coulter)
2021-05-18 (bug)[688fcc,28027d] namespace teardown reform (coulter)
- Released 8.7a5, Jun 18, 2021 --- https://core.tcl-lang.org/tcl/ for details -
2021-02-02 (new) support for MacOS Big Sur updates (nijtmans)
=> platform 1.0.17
2021-02-15 (bug)[d43f96] [string trim*] broken for Emoji (werner)
2021-02-16 (bug)[22324b] [string reverse] broken for Emoji (werner)
2021-02-19 (bug)[1dab71,7c64aa] BRE broken by uninitialized value use (lane)
2021-03-09 (bug)[8419c5] Unix tty channels tolerate EINTR (nijtmans)
*** POTENTIAL INCOMPATIBILITY ***
2021-03-10 (bug)[4c591f] [string compare] EIAS violation (nijtmans)
2021-04-08 (new) dde package installation compatible with Tcl 9 (nijtmans)
=> dde 1.4.4
2021-04-14 (bug)[266494] [concat foo [list #]] EIAS violation (porter)
2021-05-03 (bug)[24b918] Save IO buffers from modern optimizers (rupprecht)
2021-05-06 (new) support for POSIX error EILSEQ (nijtmans)
2021-05-17 (bug)[688fcc] segfault during traced delete of alias (coulter)
2021-06-22 (bug)[bad6cc] More secure build tool. CVE-2021-35331 (nijtmans)
2021-07-17 (bug)[592a25] Win: segfault in Tcl_PutEnv() (danckaert,nijtmans)
2021-09-02 (bug)[ccc448] segfault in ensemble rewrite machinery (coulter)
2021-09-14 (new) Update to Unicode-14 (nijtmans)
2021-10-08 (bug)[a8579d] failed proc argument spec processing (russell,coulter)
2021-10-27 (new) support for MacOS Monterey (nijtmans)
=> platform 1.0.18
2021-10-27 tzdata updated to Olson's tzdata2021e (nijtmans)
- Released 8.6.12, Nov 5, 2021 - details at https://core.tcl-lang.org/tcl/ -
+186 -186
View File
@@ -1,186 +1,186 @@
/* inffas8664.c is a hand tuned assembler version of inffast.c - fast decoding
* version for AMD64 on Windows using Microsoft C compiler
*
* Copyright (C) 1995-2003 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*
* Copyright (C) 2003 Chris Anderson <christop@charm.net>
* Please use the copyright conditions above.
*
* 2005 - Adaptation to Microsoft C Compiler for AMD64 by Gilles Vollant
*
* inffas8664.c call function inffas8664fnc in inffasx64.asm
* inffasx64.asm is automatically convert from AMD64 portion of inffas86.c
*
* Dec-29-2003 -- I added AMD64 inflate asm support. This version is also
* slightly quicker on x86 systems because, instead of using rep movsb to copy
* data, it uses rep movsw, which moves data in 2-byte chunks instead of single
* bytes. I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates
* from http://fedora.linux.duke.edu/fc1_x86_64
* which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with
* 1GB ram. The 64-bit version is about 4% faster than the 32-bit version,
* when decompressing mozilla-source-1.3.tar.gz.
*
* Mar-13-2003 -- Most of this is derived from inffast.S which is derived from
* the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at
* the moment. I have successfully compiled and tested this code with gcc2.96,
* gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S
* compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX
* enabled. I will attempt to merge the MMX code into this version. Newer
* versions of this and inffast.S can be found at
* http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
*
*/
#include <stdio.h>
#include "zutil.h"
#include "inftrees.h"
#include "inflate.h"
#include "inffast.h"
/* Mark Adler's comments from inffast.c: */
/*
Decode literal, length, and distance codes and write out the resulting
literal and match bytes until either not enough input or output is
available, an end-of-block is encountered, or a data error is encountered.
When large enough input and output buffers are supplied to inflate(), for
example, a 16K input buffer and a 64K output buffer, more than 95% of the
inflate execution time is spent in this routine.
Entry assumptions:
state->mode == LEN
strm->avail_in >= 6
strm->avail_out >= 258
start >= strm->avail_out
state->bits < 8
On return, state->mode is one of:
LEN -- ran out of enough output space or enough available input
TYPE -- reached end of block code, inflate() to interpret next block
BAD -- error in block data
Notes:
- The maximum input bits used by a length/distance pair is 15 bits for the
length code, 5 bits for the length extra, 15 bits for the distance code,
and 13 bits for the distance extra. This totals 48 bits, or six bytes.
Therefore if strm->avail_in >= 6, then there is enough input to avoid
checking for available input while decoding.
- The maximum bytes that a single length/distance pair can output is 258
bytes, which is the maximum length that can be coded. inflate_fast()
requires strm->avail_out >= 258 for each loop to avoid checking for
output space.
*/
typedef struct inffast_ar {
/* 64 32 x86 x86_64 */
/* ar offset register */
/* 0 0 */ void *esp; /* esp save */
/* 8 4 */ void *ebp; /* ebp save */
/* 16 8 */ unsigned char FAR *in; /* esi rsi local strm->next_in */
/* 24 12 */ unsigned char FAR *last; /* r9 while in < last */
/* 32 16 */ unsigned char FAR *out; /* edi rdi local strm->next_out */
/* 40 20 */ unsigned char FAR *beg; /* inflate()'s init next_out */
/* 48 24 */ unsigned char FAR *end; /* r10 while out < end */
/* 56 28 */ unsigned char FAR *window;/* size of window, wsize!=0 */
/* 64 32 */ code const FAR *lcode; /* ebp rbp local strm->lencode */
/* 72 36 */ code const FAR *dcode; /* r11 local strm->distcode */
/* 80 40 */ size_t /*unsigned long */hold; /* edx rdx local strm->hold */
/* 88 44 */ unsigned bits; /* ebx rbx local strm->bits */
/* 92 48 */ unsigned wsize; /* window size */
/* 96 52 */ unsigned write; /* window write index */
/*100 56 */ unsigned lmask; /* r12 mask for lcode */
/*104 60 */ unsigned dmask; /* r13 mask for dcode */
/*108 64 */ unsigned len; /* r14 match length */
/*112 68 */ unsigned dist; /* r15 match distance */
/*116 72 */ unsigned status; /* set when state chng*/
} type_ar;
#ifdef ASMINF
void inflate_fast(strm, start)
z_streamp strm;
unsigned start; /* inflate()'s starting value for strm->avail_out */
{
struct inflate_state FAR *state;
type_ar ar;
void inffas8664fnc(struct inffast_ar * par);
#if (defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )) || (defined(_MSC_VER) && defined(_M_AMD64))
#define PAD_AVAIL_IN 6
#define PAD_AVAIL_OUT 258
#else
#define PAD_AVAIL_IN 5
#define PAD_AVAIL_OUT 257
#endif
/* copy state to local variables */
state = (struct inflate_state FAR *)strm->state;
ar.in = strm->next_in;
ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN);
ar.out = strm->next_out;
ar.beg = ar.out - (start - strm->avail_out);
ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
ar.wsize = state->wsize;
ar.write = state->wnext;
ar.window = state->window;
ar.hold = state->hold;
ar.bits = state->bits;
ar.lcode = state->lencode;
ar.dcode = state->distcode;
ar.lmask = (1U << state->lenbits) - 1;
ar.dmask = (1U << state->distbits) - 1;
/* decode literals and length/distances until end-of-block or not enough
input data or output space */
/* align in on 1/2 hold size boundary */
while (((size_t)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) {
ar.hold += (unsigned long)*ar.in++ << ar.bits;
ar.bits += 8;
}
inffas8664fnc(&ar);
if (ar.status > 1) {
if (ar.status == 2)
strm->msg = "invalid literal/length code";
else if (ar.status == 3)
strm->msg = "invalid distance code";
else
strm->msg = "invalid distance too far back";
state->mode = BAD;
}
else if ( ar.status == 1 ) {
state->mode = TYPE;
}
/* return unused bytes (on entry, bits < 8, so in won't go too far back) */
ar.len = ar.bits >> 3;
ar.in -= ar.len;
ar.bits -= ar.len << 3;
ar.hold &= (1U << ar.bits) - 1;
/* update state and return */
strm->next_in = ar.in;
strm->next_out = ar.out;
strm->avail_in = (unsigned)(ar.in < ar.last ?
PAD_AVAIL_IN + (ar.last - ar.in) :
PAD_AVAIL_IN - (ar.in - ar.last));
strm->avail_out = (unsigned)(ar.out < ar.end ?
PAD_AVAIL_OUT + (ar.end - ar.out) :
PAD_AVAIL_OUT - (ar.out - ar.end));
state->hold = (unsigned long)ar.hold;
state->bits = ar.bits;
return;
}
#endif
/* inffas8664.c is a hand tuned assembler version of inffast.c - fast decoding
* version for AMD64 on Windows using Microsoft C compiler
*
* Copyright (C) 1995-2003 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*
* Copyright (C) 2003 Chris Anderson <christop@charm.net>
* Please use the copyright conditions above.
*
* 2005 - Adaptation to Microsoft C Compiler for AMD64 by Gilles Vollant
*
* inffas8664.c call function inffas8664fnc in inffasx64.asm
* inffasx64.asm is automatically convert from AMD64 portion of inffas86.c
*
* Dec-29-2003 -- I added AMD64 inflate asm support. This version is also
* slightly quicker on x86 systems because, instead of using rep movsb to copy
* data, it uses rep movsw, which moves data in 2-byte chunks instead of single
* bytes. I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates
* from http://fedora.linux.duke.edu/fc1_x86_64
* which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with
* 1GB ram. The 64-bit version is about 4% faster than the 32-bit version,
* when decompressing mozilla-source-1.3.tar.gz.
*
* Mar-13-2003 -- Most of this is derived from inffast.S which is derived from
* the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at
* the moment. I have successfully compiled and tested this code with gcc2.96,
* gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S
* compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX
* enabled. I will attempt to merge the MMX code into this version. Newer
* versions of this and inffast.S can be found at
* http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
*
*/
#include <stdio.h>
#include "zutil.h"
#include "inftrees.h"
#include "inflate.h"
#include "inffast.h"
/* Mark Adler's comments from inffast.c: */
/*
Decode literal, length, and distance codes and write out the resulting
literal and match bytes until either not enough input or output is
available, an end-of-block is encountered, or a data error is encountered.
When large enough input and output buffers are supplied to inflate(), for
example, a 16K input buffer and a 64K output buffer, more than 95% of the
inflate execution time is spent in this routine.
Entry assumptions:
state->mode == LEN
strm->avail_in >= 6
strm->avail_out >= 258
start >= strm->avail_out
state->bits < 8
On return, state->mode is one of:
LEN -- ran out of enough output space or enough available input
TYPE -- reached end of block code, inflate() to interpret next block
BAD -- error in block data
Notes:
- The maximum input bits used by a length/distance pair is 15 bits for the
length code, 5 bits for the length extra, 15 bits for the distance code,
and 13 bits for the distance extra. This totals 48 bits, or six bytes.
Therefore if strm->avail_in >= 6, then there is enough input to avoid
checking for available input while decoding.
- The maximum bytes that a single length/distance pair can output is 258
bytes, which is the maximum length that can be coded. inflate_fast()
requires strm->avail_out >= 258 for each loop to avoid checking for
output space.
*/
typedef struct inffast_ar {
/* 64 32 x86 x86_64 */
/* ar offset register */
/* 0 0 */ void *esp; /* esp save */
/* 8 4 */ void *ebp; /* ebp save */
/* 16 8 */ unsigned char FAR *in; /* esi rsi local strm->next_in */
/* 24 12 */ unsigned char FAR *last; /* r9 while in < last */
/* 32 16 */ unsigned char FAR *out; /* edi rdi local strm->next_out */
/* 40 20 */ unsigned char FAR *beg; /* inflate()'s init next_out */
/* 48 24 */ unsigned char FAR *end; /* r10 while out < end */
/* 56 28 */ unsigned char FAR *window;/* size of window, wsize!=0 */
/* 64 32 */ code const FAR *lcode; /* ebp rbp local strm->lencode */
/* 72 36 */ code const FAR *dcode; /* r11 local strm->distcode */
/* 80 40 */ size_t /*unsigned long */hold; /* edx rdx local strm->hold */
/* 88 44 */ unsigned bits; /* ebx rbx local strm->bits */
/* 92 48 */ unsigned wsize; /* window size */
/* 96 52 */ unsigned write; /* window write index */
/*100 56 */ unsigned lmask; /* r12 mask for lcode */
/*104 60 */ unsigned dmask; /* r13 mask for dcode */
/*108 64 */ unsigned len; /* r14 match length */
/*112 68 */ unsigned dist; /* r15 match distance */
/*116 72 */ unsigned status; /* set when state chng*/
} type_ar;
#ifdef ASMINF
void inflate_fast(strm, start)
z_streamp strm;
unsigned start; /* inflate()'s starting value for strm->avail_out */
{
struct inflate_state FAR *state;
type_ar ar;
void inffas8664fnc(struct inffast_ar * par);
#if (defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )) || (defined(_MSC_VER) && defined(_M_AMD64))
#define PAD_AVAIL_IN 6
#define PAD_AVAIL_OUT 258
#else
#define PAD_AVAIL_IN 5
#define PAD_AVAIL_OUT 257
#endif
/* copy state to local variables */
state = (struct inflate_state FAR *)strm->state;
ar.in = strm->next_in;
ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN);
ar.out = strm->next_out;
ar.beg = ar.out - (start - strm->avail_out);
ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
ar.wsize = state->wsize;
ar.write = state->wnext;
ar.window = state->window;
ar.hold = state->hold;
ar.bits = state->bits;
ar.lcode = state->lencode;
ar.dcode = state->distcode;
ar.lmask = (1U << state->lenbits) - 1;
ar.dmask = (1U << state->distbits) - 1;
/* decode literals and length/distances until end-of-block or not enough
input data or output space */
/* align in on 1/2 hold size boundary */
while (((size_t)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) {
ar.hold += (unsigned long)*ar.in++ << ar.bits;
ar.bits += 8;
}
inffas8664fnc(&ar);
if (ar.status > 1) {
if (ar.status == 2)
strm->msg = "invalid literal/length code";
else if (ar.status == 3)
strm->msg = "invalid distance code";
else
strm->msg = "invalid distance too far back";
state->mode = BAD;
}
else if ( ar.status == 1 ) {
state->mode = TYPE;
}
/* return unused bytes (on entry, bits < 8, so in won't go too far back) */
ar.len = ar.bits >> 3;
ar.in -= ar.len;
ar.bits -= ar.len << 3;
ar.hold &= (1U << ar.bits) - 1;
/* update state and return */
strm->next_in = ar.in;
strm->next_out = ar.out;
strm->avail_in = (unsigned)(ar.in < ar.last ?
PAD_AVAIL_IN + (ar.last - ar.in) :
PAD_AVAIL_IN - (ar.in - ar.last));
strm->avail_out = (unsigned)(ar.out < ar.end ?
PAD_AVAIL_OUT + (ar.end - ar.out) :
PAD_AVAIL_OUT - (ar.out - ar.end));
state->hold = (unsigned long)ar.hold;
state->bits = ar.bits;
return;
}
#endif
+275 -275
View File
@@ -1,275 +1,275 @@
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include "zlib.h"
void MyDoMinus64(LARGE_INTEGER *R,LARGE_INTEGER A,LARGE_INTEGER B)
{
R->HighPart = A.HighPart - B.HighPart;
if (A.LowPart >= B.LowPart)
R->LowPart = A.LowPart - B.LowPart;
else
{
R->LowPart = A.LowPart - B.LowPart;
R->HighPart --;
}
}
#ifdef _M_X64
// see http://msdn2.microsoft.com/library/twchhe95(en-us,vs.80).aspx for __rdtsc
unsigned __int64 __rdtsc(void);
void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64)
{
// printf("rdtsc = %I64x\n",__rdtsc());
pbeginTime64->QuadPart=__rdtsc();
}
LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
{
LARGE_INTEGER LIres;
unsigned _int64 res=__rdtsc()-((unsigned _int64)(beginTime64.QuadPart));
LIres.QuadPart=res;
// printf("rdtsc = %I64x\n",__rdtsc());
return LIres;
}
#else
#ifdef _M_IX86
void myGetRDTSC32(LARGE_INTEGER * pbeginTime64)
{
DWORD dwEdx,dwEax;
_asm
{
rdtsc
mov dwEax,eax
mov dwEdx,edx
}
pbeginTime64->LowPart=dwEax;
pbeginTime64->HighPart=dwEdx;
}
void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64)
{
myGetRDTSC32(pbeginTime64);
}
LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
{
LARGE_INTEGER LIres,endTime64;
myGetRDTSC32(&endTime64);
LIres.LowPart=LIres.HighPart=0;
MyDoMinus64(&LIres,endTime64,beginTime64);
return LIres;
}
#else
void myGetRDTSC32(LARGE_INTEGER * pbeginTime64)
{
}
void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64)
{
}
LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
{
LARGE_INTEGER lr;
lr.QuadPart=0;
return lr;
}
#endif
#endif
void BeginCountPerfCounter(LARGE_INTEGER * pbeginTime64,BOOL fComputeTimeQueryPerf)
{
if ((!fComputeTimeQueryPerf) || (!QueryPerformanceCounter(pbeginTime64)))
{
pbeginTime64->LowPart = GetTickCount();
pbeginTime64->HighPart = 0;
}
}
DWORD GetMsecSincePerfCounter(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
{
LARGE_INTEGER endTime64,ticksPerSecond,ticks;
DWORDLONG ticksShifted,tickSecShifted;
DWORD dwLog=16+0;
DWORD dwRet;
if ((!fComputeTimeQueryPerf) || (!QueryPerformanceCounter(&endTime64)))
dwRet = (GetTickCount() - beginTime64.LowPart)*1;
else
{
MyDoMinus64(&ticks,endTime64,beginTime64);
QueryPerformanceFrequency(&ticksPerSecond);
{
ticksShifted = Int64ShrlMod32(*(DWORDLONG*)&ticks,dwLog);
tickSecShifted = Int64ShrlMod32(*(DWORDLONG*)&ticksPerSecond,dwLog);
}
dwRet = (DWORD)((((DWORD)ticksShifted)*1000)/(DWORD)(tickSecShifted));
dwRet *=1;
}
return dwRet;
}
int ReadFileMemory(const char* filename,long* plFileSize,unsigned char** pFilePtr)
{
FILE* stream;
unsigned char* ptr;
int retVal=1;
stream=fopen(filename, "rb");
if (stream==NULL)
return 0;
fseek(stream,0,SEEK_END);
*plFileSize=ftell(stream);
fseek(stream,0,SEEK_SET);
ptr=malloc((*plFileSize)+1);
if (ptr==NULL)
retVal=0;
else
{
if (fread(ptr, 1, *plFileSize,stream) != (*plFileSize))
retVal=0;
}
fclose(stream);
*pFilePtr=ptr;
return retVal;
}
int main(int argc, char *argv[])
{
int BlockSizeCompress=0x8000;
int BlockSizeUncompress=0x8000;
int cprLevel=Z_DEFAULT_COMPRESSION ;
long lFileSize;
unsigned char* FilePtr;
long lBufferSizeCpr;
long lBufferSizeUncpr;
long lCompressedSize=0;
unsigned char* CprPtr;
unsigned char* UncprPtr;
long lSizeCpr,lSizeUncpr;
DWORD dwGetTick,dwMsecQP;
LARGE_INTEGER li_qp,li_rdtsc,dwResRdtsc;
if (argc<=1)
{
printf("run TestZlib <File> [BlockSizeCompress] [BlockSizeUncompress] [compres. level]\n");
return 0;
}
if (ReadFileMemory(argv[1],&lFileSize,&FilePtr)==0)
{
printf("error reading %s\n",argv[1]);
return 1;
}
else printf("file %s read, %u bytes\n",argv[1],lFileSize);
if (argc>=3)
BlockSizeCompress=atol(argv[2]);
if (argc>=4)
BlockSizeUncompress=atol(argv[3]);
if (argc>=5)
cprLevel=(int)atol(argv[4]);
lBufferSizeCpr = lFileSize + (lFileSize/0x10) + 0x200;
lBufferSizeUncpr = lBufferSizeCpr;
CprPtr=(unsigned char*)malloc(lBufferSizeCpr + BlockSizeCompress);
BeginCountPerfCounter(&li_qp,TRUE);
dwGetTick=GetTickCount();
BeginCountRdtsc(&li_rdtsc);
{
z_stream zcpr;
int ret=Z_OK;
long lOrigToDo = lFileSize;
long lOrigDone = 0;
int step=0;
memset(&zcpr,0,sizeof(z_stream));
deflateInit(&zcpr,cprLevel);
zcpr.next_in = FilePtr;
zcpr.next_out = CprPtr;
do
{
long all_read_before = zcpr.total_in;
zcpr.avail_in = min(lOrigToDo,BlockSizeCompress);
zcpr.avail_out = BlockSizeCompress;
ret=deflate(&zcpr,(zcpr.avail_in==lOrigToDo) ? Z_FINISH : Z_SYNC_FLUSH);
lOrigDone += (zcpr.total_in-all_read_before);
lOrigToDo -= (zcpr.total_in-all_read_before);
step++;
} while (ret==Z_OK);
lSizeCpr=zcpr.total_out;
deflateEnd(&zcpr);
dwGetTick=GetTickCount()-dwGetTick;
dwMsecQP=GetMsecSincePerfCounter(li_qp,TRUE);
dwResRdtsc=GetResRdtsc(li_rdtsc,TRUE);
printf("total compress size = %u, in %u step\n",lSizeCpr,step);
printf("time = %u msec = %f sec\n",dwGetTick,dwGetTick/(double)1000.);
printf("defcpr time QP = %u msec = %f sec\n",dwMsecQP,dwMsecQP/(double)1000.);
printf("defcpr result rdtsc = %I64x\n\n",dwResRdtsc.QuadPart);
}
CprPtr=(unsigned char*)realloc(CprPtr,lSizeCpr);
UncprPtr=(unsigned char*)malloc(lBufferSizeUncpr + BlockSizeUncompress);
BeginCountPerfCounter(&li_qp,TRUE);
dwGetTick=GetTickCount();
BeginCountRdtsc(&li_rdtsc);
{
z_stream zcpr;
int ret=Z_OK;
long lOrigToDo = lSizeCpr;
long lOrigDone = 0;
int step=0;
memset(&zcpr,0,sizeof(z_stream));
inflateInit(&zcpr);
zcpr.next_in = CprPtr;
zcpr.next_out = UncprPtr;
do
{
long all_read_before = zcpr.total_in;
zcpr.avail_in = min(lOrigToDo,BlockSizeUncompress);
zcpr.avail_out = BlockSizeUncompress;
ret=inflate(&zcpr,Z_SYNC_FLUSH);
lOrigDone += (zcpr.total_in-all_read_before);
lOrigToDo -= (zcpr.total_in-all_read_before);
step++;
} while (ret==Z_OK);
lSizeUncpr=zcpr.total_out;
inflateEnd(&zcpr);
dwGetTick=GetTickCount()-dwGetTick;
dwMsecQP=GetMsecSincePerfCounter(li_qp,TRUE);
dwResRdtsc=GetResRdtsc(li_rdtsc,TRUE);
printf("total uncompress size = %u, in %u step\n",lSizeUncpr,step);
printf("time = %u msec = %f sec\n",dwGetTick,dwGetTick/(double)1000.);
printf("uncpr time QP = %u msec = %f sec\n",dwMsecQP,dwMsecQP/(double)1000.);
printf("uncpr result rdtsc = %I64x\n\n",dwResRdtsc.QuadPart);
}
if (lSizeUncpr==lFileSize)
{
if (memcmp(FilePtr,UncprPtr,lFileSize)==0)
printf("compare ok\n");
}
return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include "zlib.h"
void MyDoMinus64(LARGE_INTEGER *R,LARGE_INTEGER A,LARGE_INTEGER B)
{
R->HighPart = A.HighPart - B.HighPart;
if (A.LowPart >= B.LowPart)
R->LowPart = A.LowPart - B.LowPart;
else
{
R->LowPart = A.LowPart - B.LowPart;
R->HighPart --;
}
}
#ifdef _M_X64
// see http://msdn2.microsoft.com/library/twchhe95(en-us,vs.80).aspx for __rdtsc
unsigned __int64 __rdtsc(void);
void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64)
{
// printf("rdtsc = %I64x\n",__rdtsc());
pbeginTime64->QuadPart=__rdtsc();
}
LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
{
LARGE_INTEGER LIres;
unsigned _int64 res=__rdtsc()-((unsigned _int64)(beginTime64.QuadPart));
LIres.QuadPart=res;
// printf("rdtsc = %I64x\n",__rdtsc());
return LIres;
}
#else
#ifdef _M_IX86
void myGetRDTSC32(LARGE_INTEGER * pbeginTime64)
{
DWORD dwEdx,dwEax;
_asm
{
rdtsc
mov dwEax,eax
mov dwEdx,edx
}
pbeginTime64->LowPart=dwEax;
pbeginTime64->HighPart=dwEdx;
}
void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64)
{
myGetRDTSC32(pbeginTime64);
}
LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
{
LARGE_INTEGER LIres,endTime64;
myGetRDTSC32(&endTime64);
LIres.LowPart=LIres.HighPart=0;
MyDoMinus64(&LIres,endTime64,beginTime64);
return LIres;
}
#else
void myGetRDTSC32(LARGE_INTEGER * pbeginTime64)
{
}
void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64)
{
}
LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
{
LARGE_INTEGER lr;
lr.QuadPart=0;
return lr;
}
#endif
#endif
void BeginCountPerfCounter(LARGE_INTEGER * pbeginTime64,BOOL fComputeTimeQueryPerf)
{
if ((!fComputeTimeQueryPerf) || (!QueryPerformanceCounter(pbeginTime64)))
{
pbeginTime64->LowPart = GetTickCount();
pbeginTime64->HighPart = 0;
}
}
DWORD GetMsecSincePerfCounter(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
{
LARGE_INTEGER endTime64,ticksPerSecond,ticks;
DWORDLONG ticksShifted,tickSecShifted;
DWORD dwLog=16+0;
DWORD dwRet;
if ((!fComputeTimeQueryPerf) || (!QueryPerformanceCounter(&endTime64)))
dwRet = (GetTickCount() - beginTime64.LowPart)*1;
else
{
MyDoMinus64(&ticks,endTime64,beginTime64);
QueryPerformanceFrequency(&ticksPerSecond);
{
ticksShifted = Int64ShrlMod32(*(DWORDLONG*)&ticks,dwLog);
tickSecShifted = Int64ShrlMod32(*(DWORDLONG*)&ticksPerSecond,dwLog);
}
dwRet = (DWORD)((((DWORD)ticksShifted)*1000)/(DWORD)(tickSecShifted));
dwRet *=1;
}
return dwRet;
}
int ReadFileMemory(const char* filename,long* plFileSize,unsigned char** pFilePtr)
{
FILE* stream;
unsigned char* ptr;
int retVal=1;
stream=fopen(filename, "rb");
if (stream==NULL)
return 0;
fseek(stream,0,SEEK_END);
*plFileSize=ftell(stream);
fseek(stream,0,SEEK_SET);
ptr=malloc((*plFileSize)+1);
if (ptr==NULL)
retVal=0;
else
{
if (fread(ptr, 1, *plFileSize,stream) != (*plFileSize))
retVal=0;
}
fclose(stream);
*pFilePtr=ptr;
return retVal;
}
int main(int argc, char *argv[])
{
int BlockSizeCompress=0x8000;
int BlockSizeUncompress=0x8000;
int cprLevel=Z_DEFAULT_COMPRESSION ;
long lFileSize;
unsigned char* FilePtr;
long lBufferSizeCpr;
long lBufferSizeUncpr;
long lCompressedSize=0;
unsigned char* CprPtr;
unsigned char* UncprPtr;
long lSizeCpr,lSizeUncpr;
DWORD dwGetTick,dwMsecQP;
LARGE_INTEGER li_qp,li_rdtsc,dwResRdtsc;
if (argc<=1)
{
printf("run TestZlib <File> [BlockSizeCompress] [BlockSizeUncompress] [compres. level]\n");
return 0;
}
if (ReadFileMemory(argv[1],&lFileSize,&FilePtr)==0)
{
printf("error reading %s\n",argv[1]);
return 1;
}
else printf("file %s read, %u bytes\n",argv[1],lFileSize);
if (argc>=3)
BlockSizeCompress=atol(argv[2]);
if (argc>=4)
BlockSizeUncompress=atol(argv[3]);
if (argc>=5)
cprLevel=(int)atol(argv[4]);
lBufferSizeCpr = lFileSize + (lFileSize/0x10) + 0x200;
lBufferSizeUncpr = lBufferSizeCpr;
CprPtr=(unsigned char*)malloc(lBufferSizeCpr + BlockSizeCompress);
BeginCountPerfCounter(&li_qp,TRUE);
dwGetTick=GetTickCount();
BeginCountRdtsc(&li_rdtsc);
{
z_stream zcpr;
int ret=Z_OK;
long lOrigToDo = lFileSize;
long lOrigDone = 0;
int step=0;
memset(&zcpr,0,sizeof(z_stream));
deflateInit(&zcpr,cprLevel);
zcpr.next_in = FilePtr;
zcpr.next_out = CprPtr;
do
{
long all_read_before = zcpr.total_in;
zcpr.avail_in = min(lOrigToDo,BlockSizeCompress);
zcpr.avail_out = BlockSizeCompress;
ret=deflate(&zcpr,(zcpr.avail_in==lOrigToDo) ? Z_FINISH : Z_SYNC_FLUSH);
lOrigDone += (zcpr.total_in-all_read_before);
lOrigToDo -= (zcpr.total_in-all_read_before);
step++;
} while (ret==Z_OK);
lSizeCpr=zcpr.total_out;
deflateEnd(&zcpr);
dwGetTick=GetTickCount()-dwGetTick;
dwMsecQP=GetMsecSincePerfCounter(li_qp,TRUE);
dwResRdtsc=GetResRdtsc(li_rdtsc,TRUE);
printf("total compress size = %u, in %u step\n",lSizeCpr,step);
printf("time = %u msec = %f sec\n",dwGetTick,dwGetTick/(double)1000.);
printf("defcpr time QP = %u msec = %f sec\n",dwMsecQP,dwMsecQP/(double)1000.);
printf("defcpr result rdtsc = %I64x\n\n",dwResRdtsc.QuadPart);
}
CprPtr=(unsigned char*)realloc(CprPtr,lSizeCpr);
UncprPtr=(unsigned char*)malloc(lBufferSizeUncpr + BlockSizeUncompress);
BeginCountPerfCounter(&li_qp,TRUE);
dwGetTick=GetTickCount();
BeginCountRdtsc(&li_rdtsc);
{
z_stream zcpr;
int ret=Z_OK;
long lOrigToDo = lSizeCpr;
long lOrigDone = 0;
int step=0;
memset(&zcpr,0,sizeof(z_stream));
inflateInit(&zcpr);
zcpr.next_in = CprPtr;
zcpr.next_out = UncprPtr;
do
{
long all_read_before = zcpr.total_in;
zcpr.avail_in = min(lOrigToDo,BlockSizeUncompress);
zcpr.avail_out = BlockSizeUncompress;
ret=inflate(&zcpr,Z_SYNC_FLUSH);
lOrigDone += (zcpr.total_in-all_read_before);
lOrigToDo -= (zcpr.total_in-all_read_before);
step++;
} while (ret==Z_OK);
lSizeUncpr=zcpr.total_out;
inflateEnd(&zcpr);
dwGetTick=GetTickCount()-dwGetTick;
dwMsecQP=GetMsecSincePerfCounter(li_qp,TRUE);
dwResRdtsc=GetResRdtsc(li_rdtsc,TRUE);
printf("total uncompress size = %u, in %u step\n",lSizeUncpr,step);
printf("time = %u msec = %f sec\n",dwGetTick,dwGetTick/(double)1000.);
printf("uncpr time QP = %u msec = %f sec\n",dwMsecQP,dwMsecQP/(double)1000.);
printf("uncpr result rdtsc = %I64x\n\n",dwResRdtsc.QuadPart);
}
if (lSizeUncpr==lFileSize)
{
if (memcmp(FilePtr,UncprPtr,lFileSize)==0)
printf("compare ok\n");
}
return 0;
}
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -20,7 +20,7 @@ int
\fBTcl_Stat\fR(\fIpath\fR, \fIstatPtr\fR)
.SH ARGUMENTS
.AS "struct stat" *statPtr out
.AP char *path in
.AP "const char" *path in
Native name of the file to check the attributes of.
.AP int mode in
Mask consisting of one or more of \fBR_OK\fR, \fBW_OK\fR, \fBX_OK\fR and
+18 -2
View File
@@ -49,7 +49,7 @@ Interpreter in which to record information.
The code returned from script evaluation.
.AP Tcl_Obj *options
A dictionary of return options.
.AP char *message in
.AP "const char" *message in
For \fBTcl_AddErrorInfo\fR,
this is a conventional C string to append to the \fB\-errorinfo\fR return option.
For \fBTcl_AddObjErrorInfo\fR,
@@ -66,7 +66,7 @@ appending to the \fB\-errorinfo\fR return option.
If negative, all bytes up to the first null byte are used.
.AP Tcl_Obj *errorObjPtr in
The \fB\-errorcode\fR return option will be set to this value.
.AP char *element in
.AP "const char" *element in
String to record as one element of the \fB\-errorcode\fR return option.
Last \fIelement\fR argument must be NULL.
.AP va_list argList in
@@ -308,6 +308,22 @@ The global variables \fBerrorInfo\fR and
\fBerrorCode\fR are not modified by \fBTcl_ResetResult\fR
so they continue to hold a record of information about the
most recent error seen in an interpreter.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The result of \fBTcl_GetReturnOptions\fR will have at least one
reference to it from the Tcl interpreter. If not using it immediately,
you should use \fBTcl_IncrRefCount\fR to add your own reference.
.PP
The \fIoptions\fR argument to \fBTcl_SetReturnOptions\fR will have a
reference added by the Tcl interpreter; it may safely be called with a
zero-reference value.
.PP
\fBTcl_AppendObjToErrorInfo\fR only reads its \fIobjPtr\fR argument;
it does not modify its reference count at all.
.PP
The \fIerrorObjPtr\fR argument to \fBTcl_SetObjErrorCode\fR will have a
reference added by the Tcl interpreter; it may safely be called with a
zero-reference value.
.SH "SEE ALSO"
Tcl_DecrRefCount(3), Tcl_IncrRefCount(3), Tcl_Interp(3), Tcl_ResetResult(3),
Tcl_SetErrno(3), errorCode(n), errorInfo(n)
+23 -12
View File
@@ -9,7 +9,7 @@
.so man.macros
.BS
.SH NAME
Tcl_AsyncCreate, Tcl_AsyncMark, Tcl_AsyncInvoke, Tcl_AsyncDelete, Tcl_AsyncReady \- handle asynchronous events
Tcl_AsyncCreate, Tcl_AsyncMark, Tcl_AsyncMarkFromSignal, Tcl_AsyncInvoke, Tcl_AsyncDelete, Tcl_AsyncReady \- handle asynchronous events
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -17,11 +17,16 @@ Tcl_AsyncCreate, Tcl_AsyncMark, Tcl_AsyncInvoke, Tcl_AsyncDelete, Tcl_AsyncReady
Tcl_AsyncHandler
\fBTcl_AsyncCreate\fR(\fIproc, clientData\fR)
.sp
void
\fBTcl_AsyncMark\fR(\fIasync\fR)
.sp
int
\fBTcl_AsyncMarkFromSignal\fR(\fIasync\fR, \fIsigNumber\fR)
.sp
int
\fBTcl_AsyncInvoke\fR(\fIinterp, code\fR)
.sp
void
\fBTcl_AsyncDelete\fR(\fIasync\fR)
.sp
int
@@ -34,6 +39,8 @@ Procedure to invoke to handle an asynchronous event.
One-word value to pass to \fIproc\fR.
.AP Tcl_AsyncHandler async in
Token for asynchronous event handler.
.AP int sigNumber in
POSIX signal number, when used in a signal context.
.AP Tcl_Interp *interp in
Tcl interpreter in which command was being evaluated when handler was
invoked, or NULL if handler was invoked when there was no interpreter
@@ -60,10 +67,11 @@ to a clean state, such as after the current Tcl command completes.
.PP
\fBTcl_AsyncCreate\fR, \fBTcl_AsyncDelete\fR, and \fBTcl_AsyncReady\fR
are thread sensitive. They access and/or set a thread-specific data
structure in the event of a core built with \fI\-\-enable\-threads\fR. The token
created by \fBTcl_AsyncCreate\fR contains the needed thread information it
was called from so that calling \fBTcl_AsyncMark\fR(\fItoken\fR) will only yield
the origin thread into the asynchronous handler.
structure in the event of a core built with \fI\-\-enable\-threads\fR.
The token created by \fBTcl_AsyncCreate\fR contains the needed thread
information it was called from so that calling \fBTcl_AsyncMarkFromSignal\fR
or \fBTcl_AsyncMark\fR with this token will only yield the origin
thread into the asynchronous handler.
.PP
\fBTcl_AsyncCreate\fR creates an asynchronous handler and returns
a token for it.
@@ -72,13 +80,16 @@ any occurrences of the asynchronous event that it is intended
to handle (it is not safe to create a handler at the time of
an event).
When an asynchronous event occurs the code that detects the event
(such as a signal handler) should call \fBTcl_AsyncMark\fR with the
token for the handler.
\fBTcl_AsyncMark\fR will mark the handler as ready to execute, but it
will not invoke the handler immediately.
Tcl will call the \fIproc\fR associated with the handler later, when
the world is in a safe state, and \fIproc\fR can then carry out
the actions associated with the asynchronous event.
(such as a POSIX signal handler) should call \fBTcl_AsyncMarkFromSignal\fR
with the token for the handler and the POSIX signal number. The
return value of this function is true, when the handler will be
marked, false otherwise.
For non-signal contexts, \fBTcl_AsyncMark\fR serves the same purpose.
\fBTcl_AsyncMarkFromSignal\fR and \fBTcl_AsyncMark\fR will mark
the handler as ready to execute, but will not invoke the handler
immediately. Tcl will call the \fIproc\fR associated with the
handler later, when the world is in a safe state, and \fIproc\fR
can then carry out the actions associated with the asynchronous event.
\fIProc\fR should have arguments and result that match the
type \fBTcl_AsyncProc\fR:
.PP
+1 -1
View File
@@ -18,7 +18,7 @@ char
\fBTcl_Backslash\fR(\fIsrc, countPtr\fR)
.SH ARGUMENTS
.AS char *countPtr out
.AP char *src in
.AP "const char" *src in
Pointer to a string starting with a backslash.
.AP int *countPtr out
If \fIcountPtr\fR is not NULL, \fI*countPtr\fR gets filled
+12
View File
@@ -88,6 +88,18 @@ will lead to a \fBTCL_OK\fR return (and the boolean value 1),
while the same value passed to \fBTcl_GetBoolean\fR will lead to
a \fBTCL_ERROR\fR return.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_NewBooleanObj\fR always returns a zero-reference object, much
like \fBTcl_NewObj\fR.
.PP
\fBTcl_SetBooleanObj\fR does not modify the reference count of its
\fIobjPtr\fR argument, but does require that the object be unshared.
.PP
\fBTcl_GetBooleanFromObj\fR does not modify the reference count of its
\fIobjPtr\fR argument; it only reads. Note however that this function
may set the interpreter result; if that is the only place that
is holding a reference to the object, it will be deleted.
.SH "SEE ALSO"
Tcl_NewObj, Tcl_IsShared, Tcl_GetBoolean
+153 -54
View File
@@ -8,85 +8,184 @@
.so man.macros
.BS
.SH NAME
Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength \- manipulate Tcl values as a arrays of bytes
Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetBytesFromObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength \- manipulate a Tcl value as an array of bytes
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
Tcl_Obj *
\fBTcl_NewByteArrayObj\fR(\fIbytes, length\fR)
\fBTcl_NewByteArrayObj\fR(\fIbytes, numBytes\fR)
.sp
void
\fBTcl_SetByteArrayObj\fR(\fIobjPtr, bytes, length\fR)
\fBTcl_SetByteArrayObj\fR(\fIobjPtr, bytes, numBytes\fR)
.sp
.VS TIP568
unsigned char *
\fBTcl_GetBytesFromObj\fR(\fIinterp, objPtr, numBytesPtr\fR)
.VE TIP568
.sp
unsigned char *
\fBTcl_GetByteArrayFromObj\fR(\fIobjPtr, lengthPtr\fR)
\fBTcl_GetByteArrayFromObj\fR(\fIobjPtr, numBytesPtr\fR)
.sp
unsigned char *
\fBTcl_SetByteArrayLength\fR(\fIobjPtr, length\fR)
\fBTcl_SetByteArrayLength\fR(\fIobjPtr, numBytes\fR)
.SH ARGUMENTS
.AS "const unsigned char" *lengthPtr in/out
.AS "const unsigned char" *numBytesPtr in/out
.AP "const unsigned char" *bytes in
The array of bytes used to initialize or set a byte-array value. May be NULL
even if \fIlength\fR is non-zero.
.AP int length in
The length of the array of bytes. It must be >= 0.
even if \fInumBytes\fR is non-zero.
.AP int numBytes in
The number of bytes in the array. It must be >= 0.
.AP Tcl_Obj *objPtr in/out
For \fBTcl_SetByteArrayObj\fR, this points to the value to be converted to
byte-array type. For \fBTcl_GetByteArrayFromObj\fR and
\fBTcl_SetByteArrayLength\fR, this points to the value from which to get
the byte-array value; if \fIobjPtr\fR does not already point to a byte-array
value, it will be converted to one.
.AP size_t | int *lengthPtr out
Filled with the length of the array of bytes in the value.
May be (int *)NULL when not used.
For \fBTcl_SetByteArrayObj\fR, this points to an unshared value to be
overwritten by a byte-array value. For \fBTcl_GetBytesFromObj\fR,
\fBTcl_GetByteArrayFromObj\fR and \fBTcl_SetByteArrayLength\fR, this points
to the value from which to extract an array of bytes.
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
.AP "size_t | int" *numBytesPtr out
Points to space where the number of bytes in the array may be written.
Caller may pass NULL when it does not need this information.
.BE
.SH DESCRIPTION
.PP
These procedures are used to create, modify, and read Tcl byte-array values
from C code. Byte-array values are typically used to hold the
results of binary IO operations or data structures created with the
\fBbinary\fR command. In Tcl, an array of bytes is not equivalent to a
string. Conceptually, a string is an array of Unicode characters, while a
byte-array is an array of 8-bit quantities with no implicit meaning.
Accessor functions are provided to get the string representation of a
byte-array or to convert an arbitrary value to a byte-array. Obtaining the
These routines are used to create, modify, store, transfer, and retrieve
arbitrary binary data in Tcl values. Specifically, data that can be
represented as a sequence of arbitrary byte values is supported.
This includes data read from binary channels, values created by the
\fBbinary\fR command, encrypted data, or other information representable as
a finite byte sequence.
.PP
A byte is an 8-bit quantity with no inherent meaning. When the 8 bits are
interpreted as an integer value, the range of possible values is (0-255).
The C type best suited to store a byte is the \fBunsigned char\fR.
An \fBunsigned char\fR array of size \fIN\fR stores an aribtrary binary
value of size \fIN\fR bytes. We call this representation a byte-array.
Here we document the routines that allow us to operate on Tcl values as
byte-arrays.
.PP
All Tcl values must correspond to a string representation.
When a byte-array value must be processed as a string, the sequence
of \fIN\fR bytes is transformed into the corresponding sequence
of \fIN\fR characters, where each byte value transforms to the same
character codepoint value in the range (U+0000 - U+00FF). Obtaining the
string representation of a byte-array value (by calling
\fBTcl_GetStringFromObj\fR) produces a properly formed UTF-8 sequence with a
one-to-one mapping between the bytes in the internal representation and the
UTF-8 characters in the string representation.
\fBTcl_GetStringFromObj\fR) produces this string in Tcl's usual
Modified UTF-8 encoding.
.PP
\fBTcl_NewByteArrayObj\fR and \fBTcl_SetByteArrayObj\fR will
create a new value of byte-array type or modify an existing value to have a
byte-array type. Both of these procedures set the value's type to be
byte-array and set the value's internal representation to a copy of the
array of bytes given by \fIbytes\fR. \fBTcl_NewByteArrayObj\fR returns a
pointer to a newly allocated value with a reference count of zero.
\fBTcl_SetByteArrayObj\fR invalidates any old string representation and, if
the value is not already a byte-array value, frees any old internal
representation. If \fIbytes\fR is NULL then the new byte array contains
arbitrary values.
\fBTcl_NewByteArrayObj\fR and \fBTcl_SetByteArrayObj\fR
create a new value or overwrite an existing unshared value, respectively,
to hold a byte-array value of \fInumBytes\fR bytes. When a caller
passes a non-NULL value of \fIbytes\fR, it must point to memory from
which \fInumBytes\fR bytes can be read. These routines
allocate \fInumBytes\fR bytes of memory, copy \fInumBytes\fR
bytes from \fIbytes\fR into it, and keep the result in the internal
representation of the new or overwritten value.
When the caller passes a NULL value of \fIbytes\fR, the data copying
step is skipped, and the bytes stored in the value are undefined.
A \fIbytes\fR value of NULL is useful only when the caller will arrange
to write known contents into the byte-array through a pointer retrieved
by a call to one of the routines explained below. \fBTcl_NewByteArrayObj\fR
returns a pointer to the created value with a reference count of zero.
\fBTcl_SetByteArrayObj\fR overwrites and invalidates any old contents
of the unshared \fIobjPtr\fR as appropriate, and keeps its reference
count (0 or 1) unchanged. The value produced by these routines has no
string representation. Any memory allocation failure may cause a panic.
Note that the type of the \fInumBytes\fR argument is \fBint\fR; consequently
the largest byte-array value that can be produced by these routines is one
holding \fBINT_MAX\fR bytes. Note also that the string representation of
any Tcl value is limited to \fBINT_MAX\fR bytes, so caution should be
taken with any byte-array of more than \fBINT_MAX / 2\fR bytes.
.PP
\fBTcl_GetByteArrayFromObj\fR converts a Tcl value to byte-array type and
returns a pointer to the value's new internal representation as an array of
bytes. The length of this array is stored in \fIlengthPtr\fR if
\fIlengthPtr\fR is non-NULL. The storage for the array of bytes is owned by
the value and should not be freed. The contents of the array may be
modified by the caller only if the value is not shared and the caller
invalidates the string representation.
\fBTcl_GetBytesFromObj\fR performs the opposite function of
\fBTcl_SetByteArrayObj\fR, providing access to read a byte-array from
a Tcl value that was previously written into it. When \fIobjPtr\fR
is a value previously produced by \fBTcl_NewByteArrayObj\fR or
\fBTcl_SetByteArrayObj\fR, then \fBTcl_GetBytesFromObj\fR returns
a pointer to the byte-array kept in the value's internal representation.
If the caller provides a non-NULL value for \fInumBytesPtr\fR, it must
point to memory where \fBTcl_GetBytesFromObj\fR can write the number
of bytes in the value's internal byte-array. With both pieces of
information, the caller is able to retrieve any information about the
contents of that byte-array that it seeks. When \fIobjPtr\fR does
not already contain an internal byte-array, \fBTcl_GetBytesFromObj\fR
will try to create one from the value's string representation. Any
string value that does not include any character codepoints outside
the range (U+0000 - U+00FF) will successfully translate to a unique
byte-array value. With the created byte-array, the routine returns
as before. For any string representation which does contain
a forbidden character codepoint, the conversion fails, and
\fBTcl_GetBytesFromObj\fR returns NULL to signal that failure. On
failure, nothing will be written to \fInumBytesPtr\fR, and if
the \fIinterp\fR argument is non-NULL, then error messages and
codes are left in it recording the error.
.PP
\fBTcl_SetByteArrayLength\fR converts the Tcl value to byte-array type
and changes the length of the value's internal representation as an
array of bytes. If \fIlength\fR is greater than the space currently
allocated for the array, the array is reallocated to the new length; the
newly allocated bytes at the end of the array have arbitrary values. If
\fIlength\fR is less than the space currently allocated for the array,
the length of array is reduced to the new length. The return value is a
pointer to the value's new array of bytes.
\fBTcl_GetByteArrayFromObj\fR performs nearly the same function as
\fBTcl_GetBytesFromObj\fR. They differ only in the circumstance when
a byte-array internal value must be created by transformation of
a string representation, and that string representation contains a
character with codepoint greater than U+00FF. Instead of failing
the conversion, \fBTcl_GetByteArrayFromObj\fR will use the 8 least
significant bits of each codepoint to produce a valid byte value
from any character codepoint value. In any other circumstance,
\fBTcl_GetByteArrayFromObj\fR performs just as \fBTcl_GetBytesFromObj\fR
does. Since the conversion cannot fail, \fBTcl_GetByteArrayFromObj\fR
has no need for an \fIinterp\fR argument to record any errors and
the caller can assume \fBTcl_GetByteArrayFromObj\fR does not return NULL.
.PP
\fBTcl_GetByteArrayFromObj\fR must be used with caution. Because of the
truncation on conversion, the byte-array made available to the caller
cannot reliably complete a round-trip back to the original string
representation. This creates opportunities for bugs due to blindness
to differences in values. This routine exists in this form primarily
for compatibility with codebases written for earlier releases of Tcl.
It is expected this routine will incompatibly change in Tcl 9 so that
it also signals failed conversions with a NULL return.
.PP
On success, both \fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR
return a pointer into the internal representation of a \fBTcl_Obj\fR.
That pointer must not be freed by the caller, and should not be retained
for use beyond the known time the internal representation of the value
has not been disturbed. The pointer may be used to overwrite the byte
contents of the internal representation, so long as the value is unshared
and any string representation is invalidated.
.PP
On success, both \fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR
write the number of bytes in the byte-array value of \fIobjPtr\fR
to the space pointed to by \fInumBytesPtr\fR. This space may be of type
\fBsize_t\fR or of type \fBint\fR. In Tcl 8, the largest number of
bytes possible is \fBINT_MAX\fR, so either type can receive the value.
In codebases meant to migrate to Tcl 9, the option to write to a space
of type \fBsize_t\fR may aid in the migration.
.PP
\fBTcl_SetByteArrayLength\fR enables a caller to change the size of a
byte-array in the internal representation of an unshared \fIobjPtr\fR to
become \fInumBytes\fR bytes. This is most often useful after the
bytes of the internal byte-array have been directly overwritten and it
has been discovered that the required size differs from the first
estimate used in the allocation. \fBTcl_SetByteArrayLength\fR returns
a pointer to the resized byte-array. Because resizing the byte-array
changes the internal representation, \fBTcl_SetByteArrayLength\fR
also invalidates any string representation in \fIobjPtr\fR. If resizing
grows the byte-array, the new byte values are undefined. If \fIobjPtr\fR
does not already possess an internal byte-array, one is produced in the
same way that \fBTcl_GetByteArrayFromObj\fR does, with all the cautions
that go along with that.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_NewByteArrayObj\fR always returns a zero-reference object, much
like \fBTcl_NewObj\fR.
.PP
\fBTcl_SetByteArrayObj\fR and \fBTcl_SetByteArrayLength\fR do not modify the
reference count of their \fIobjPtr\fR arguments, but do require that the
object be unshared.
.PP
\fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR do not modify
the reference count of \fIobjPtr\fR; they only read.
.SH "SEE ALSO"
Tcl_GetStringFromObj, Tcl_NewObj, Tcl_IncrRefCount, Tcl_DecrRefCount
.SH KEYWORDS
value, binary data, byte array, utf, unicode, internationalization
value, binary data, byte array, utf, unicode
+8
View File
@@ -67,6 +67,14 @@ other procedures. If an error is returned and this bit is set in
result, where it can be retrieved with \fBTcl_GetObjResult\fR or
\fBTcl_GetStringResult\fR. If this flag bit is not set then no error
message is left and the interpreter's result will not be modified.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_CancelEval\fR always decrements the reference count of its
\fIresultObjPtr\fR argument (if that is non-NULL). It is expected to
be usually called with an object with zero reference count. If the
object is shared with some other location (including the Tcl
evaluation stack) it should have its reference count incremented
before calling this function.
.SH "SEE ALSO"
interp(n), Tcl_Eval(3),
TIP 285
+38
View File
@@ -55,6 +55,14 @@ Tcl_ObjectMapMethodNameProc
\fBTcl_ObjectGetMethodNameMapper\fR(\fIobject\fR)
.sp
\fBTcl_ObjectSetMethodNameMapper\fR(\fIobject\fR, \fImethodNameMapper\fR)
.sp
.VS "TIP 605"
Tcl_Class
\fBTcl_GetClassOfObject\fR(\fIobject\fR)
.sp
Tcl_Obj *
\fBTcl_GetObjectClassName\fR(\fIinterp\fR, \fIobject\fR)
.VE "TIP 605"
.SH ARGUMENTS
.AS ClientData metadata in/out
.AP Tcl_Interp *interp in/out
@@ -114,6 +122,13 @@ function. Note that the Tcl_Obj reference returned by \fBTcl_GetObjectName\fR
is a shared reference. You can also get whether the object has been marked for
deletion with \fBTcl_ObjectDeleted\fR (it returns true if deletion of the
object has begun); this can be useful during the processing of methods.
.VS "TIP 605"
The class of an object can be retrieved with \fBTcl_GetClassOfObject\fR, and
the name of the class of an object with \fBTcl_GetObjectClassName\fR; note
that these two \fImay\fR return NULL during deletion of an object (this is
transient, and only occurs when the object is a long way through being
deleted).
.VE "TIP 605"
.PP
Instances of classes are created using \fBTcl_NewObjectInstance\fR, which
creates an object from any class (and which is internally called by both
@@ -241,6 +256,29 @@ NULL if the whole chain is to be processed (the argument itself is never
NULL); this variable may be updated by the callback. The \fImethodNameObj\fR
parameter gives an unshared object containing the name of the method being
invoked, as provided by the user; this object may be updated by the callback.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The \fIobjPtr\fR argument to \fBTcl_GetObjectFromObj\fR will not have its
reference count manipulated, but this function may modify the interpreter
result (to report any error) so interpreter results should not be fed into
this without an additional reference being used.
.PP
The result of \fBTcl_GetObjectName\fR is a value that is owned by the object
that is regenerated when this function is first called after the object is
renamed. If the value is to be retained at all, the caller should increment
the reference count.
.PP
The first \fIobjc\fR values in the \fIobjv\fR argument to
\fBTcl_NewObjectInstance\fR are the arguments to pass to the constructor. They
must have a reference count of at least 1, and may have their reference counts
changed during the running of the constructor. Constructors may modify the
interpreter result, which consequently means that interpreter results should
not be used as arguments without an additional reference being taken.
.PP
The \fImethodNameObj\fR argument to a Tcl_ObjectMapMethodNameProc
implementation will be a value with a reference count of at least 1 where at
least one reference is not held by the interpreter result. It is expected that
method name mappers will only read their \fImethodNameObj\fR arguments.
.SH "SEE ALSO"
Method(3), oo::class(n), oo::copy(n), oo::define(n), oo::object(n)
.SH KEYWORDS
+9 -1
View File
@@ -243,8 +243,16 @@ any script evaluation mechanism will fail.
.PP
For a description of the Tcl interface to multiple interpreters, see
\fIinterp(n)\fR.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_CreateAliasObj\fR increments the reference counts of the values
in its \fIobjv\fR argument. (That reference lasts the same length of
time as the owning alias.)
.PP
\fBTcl_GetAliasObj\fR returns (via its \fIobjvPtr\fR argument) a
pointer to values that it holds a reference to.
.SH "SEE ALSO"
interp
interp(n)
.SH KEYWORDS
alias, command, exposed commands, hidden commands, interpreter, invoke,
+4
View File
@@ -156,6 +156,10 @@ pointed to by \fIargTypesPointer\fR.
\fBTcl_ListMathFuncs\fR returns a Tcl value containing a list of all
the math functions defined in the interpreter whose name matches
\fIpattern\fR. The returned value has a reference count of zero.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_ListMathFuncs\fR always returns a zero-reference object, much
like \fBTcl_NewObj\fR.
.SH "SEE ALSO"
expr(n), info(n), Tcl_CreateObjCommand(3), Tcl_Free(3), Tcl_NewListObj(3)
.SH KEYWORDS
+16 -1
View File
@@ -54,7 +54,7 @@ const char *
.AS Tcl_CmdDeleteProc *deleteProc in/out
.AP Tcl_Interp *interp in
Interpreter in which to create a new command or that contains a command.
.AP char *cmdName in
.AP "const char" *cmdName in
Name of command.
.AP Tcl_ObjCmdProc *proc in
Implementation of the new command: \fIproc\fR will be called whenever
@@ -323,6 +323,21 @@ instead. The result from \fBTcl_GetCommandTypeName\fR will be exactly that
string which was registered, and not a copy; use of a compile-time constant
string is \fIstrongly recommended\fR.
.VE "info cmdtype feature"
.SH "REFERENCE COUNT MANAGEMENT"
.PP
When the \fIproc\fR passed to \fBTcl_CreateObjCommand\fR is called,
the values in its \fIobjv\fR argument will have a reference count of
at least 1, with that guaranteed reference being from the Tcl
evaluation stack. You should not call \fBTcl_DecrRefCount\fR on any of
those values unless you call \fBTcl_IncrRefCount\fR on them first.
Also, when the \fIproc\fR is called, the interpreter result is
guaranteed to be an empty string value with a reference count of 1.
.PP
\fBTcl_GetCommandFullName\fR does not modify the reference count of its
\fIobjPtr\fR argument, but does require that the object be unshared.
.PP
\fBTcl_GetCommandFromObj\fR does not modify the reference count of its
\fIobjPtr\fR argument; it only reads.
.SH "SEE ALSO"
Tcl_CreateCommand(3), Tcl_ResetResult(3), Tcl_SetObjResult(3)
.SH KEYWORDS
+9
View File
@@ -187,5 +187,14 @@ There is no way to be notified when the trace created by
\fBTcl_CreateTrace\fR is deleted. There is no way for the \fIproc\fR
associated with a call to \fBTcl_CreateTrace\fR to abort execution of
\fIcommand\fR.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
When the \fIproc\fR passed to \fBTcl_CreateObjTrace\fR is called,
the values in its \fIobjv\fR argument will have a reference count of
at least 1, with that guaranteed reference being from the Tcl
evaluation stack. You should not call \fBTcl_DecrRefCount\fR on any of
those values unless you call \fBTcl_IncrRefCount\fR on them first.
.SH "SEE ALSO"
trace(n)
.SH KEYWORDS
command, create, delete, interpreter, trace
+67
View File
@@ -190,6 +190,73 @@ path as this is easy to construct from repeated use of
dictionaries are created for non-terminal keys where they do not
already exist. With \fBTcl_DictObjRemoveKeyList\fR, all non-terminal
keys must exist and have dictionaries as their values.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_NewDictObj\fR always returns a zero-reference object, much like
\fBTcl_NewObj\fR.
.PP
\fBTcl_DictObjPut\fR does not modify the reference count of its \fIdictPtr\fR
argument, but does require that the object be unshared. If
\fBTcl_DictObjPut\fR returns \fBTCL_ERROR\fR it does not manipulate any
reference counts; but if it returns \fBTCL_OK\fR then it definitely increments
the reference count of \fIvaluePtr\fR and may increment the reference count of
\fIkeyPtr\fR; the latter case happens exactly when the key did not previously
exist in the dictionary. Note however that this function may set the
interpreter result; if that is the only place that is holding a reference to
an object, it will be deleted.
.PP
\fBTcl_DictObjGet\fR only reads from its \fIdictPtr\fR and \fIkeyPtr\fR
arguments, and does not manipulate their reference counts at all. If the
\fIvaluePtrPtr\fR argument is not set to NULL (and the function doesn't return
\fBTCL_ERROR\fR), it will be set to a value with a reference count of at least
1, with a reference owned by the dictionary. Note however that this function
may set the interpreter result; if that is the only place that is holding a
reference to an object, it will be deleted.
.PP
\fBTcl_DictObjRemove\fR does not modify the reference count of its
\fIdictPtr\fR argument, but does require that the object be unshared. It does
not manipulate the reference count of its \fIkeyPtr\fR argument at all. Note
however that this function may set the interpreter result; if that is the only
place that is holding a reference to an object, it will be deleted.
.PP
\fBTcl_DictObjSize\fR does not modify the reference count of its \fIdictPtr\fR
argument; it only reads. Note however that this function may set the
interpreter result; if that is the only place that is holding a reference to
the dictionary object, it will be deleted.
.PP
\fBTcl_DictObjFirst\fR does not modify the reference count of its
\fIdictPtr\fR argument; it only reads. The variables given by the
\fIkeyPtrPtr\fR and \fIvaluePtrPtr\fR arguments (if not NULL) will be updated
to contain references to the relevant values in the dictionary; their
reference counts will be at least 1 (due to the dictionary holding a reference
to them). It may also manipulate internal references; these are not exposed to
user code, but require a matching \fBTcl_DictObjDone\fR call. Note however
that this function may set the interpreter result; if that is the only place
that is holding a reference to the dictionary object, it will be deleted.
.PP
Similarly for \fBTcl_DictObjNext\fR; the variables given by the
\fIkeyPtrPtr\fR and \fIvaluePtrPtr\fR arguments (if not NULL) will be updated
to contain references to the relevant values in the dictionary; their
reference counts will be at least 1 (due to the dictionary holding a reference
to them).
.PP
\fBTcl_DictObjDone\fR does not manipulate (user-visible) reference counts.
.PP
\fBTcl_DictObjPutKeyList\fR is similar to \fBTcl_DictObjPut\fR; it does not
modify the reference count of its \fIdictPtr\fR argument, but does require
that the object be unshared. It may increment the reference count of any value
passed in the \fIkeyv\fR argument, and will increment the reference count of
the \fIvaluePtr\fR argument on success. It is recommended that values passed
via \fIkeyv\fR and \fIvaluePtr\fR do not have zero reference counts. Note
however that this function may set the interpreter result; if that is the only
place that is holding a reference to an object, it will be deleted.
.PP
\fBTcl_DictObjRemoveKeyList\fR is similar to \fBTcl_DictObjRemove\fR; it does
not modify the reference count of its \fIdictPtr\fR argument, but does require
that the object be unshared, and does not modify the reference counts of any
of the values passed in the \fIkeyv\fR argument. Note however that this
function may set the interpreter result; if that is the only place that is
holding a reference to an object, it will be deleted.
.SH EXAMPLE
Using the dictionary iteration interface to search determine if there
is a key that maps to itself:
+12
View File
@@ -58,6 +58,18 @@ and if \fIinterp\fR is non-NULL, an error message is left in \fIinterp\fR.
The \fBTcl_ObjType\fR of \fIobjPtr\fR may be changed to make subsequent
calls to \fBTcl_GetDoubleFromObj\fR more efficient.
'\" TODO: add discussion of treatment of NaN value
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_NewDoubleObj\fR always returns a zero-reference object, much
like \fBTcl_NewObj\fR.
.PP
\fBTcl_SetDoubleObj\fR does not modify the reference count of its
\fIobjPtr\fR argument, but does require that the object be unshared.
.PP
\fBTcl_GetDoubleFromObj\fR does not modify the reference count of its
\fIobjPtr\fR argument; it only reads. Note however that this function
may set the interpreter result; if that is the only place that
is holding a reference to the object, it will be deleted.
.SH "SEE ALSO"
Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult
.SH KEYWORDS
+11
View File
@@ -556,5 +556,16 @@ been loaded, it attempts to load an encoding file called \fIname\fB.enc\fR
from the \fBencoding\fR subdirectory of each directory that Tcl searches
for its script library. If the encoding file exists, but is
malformed, an error message will be left in \fIinterp\fR.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_GetEncodingFromObj\fR does not modify the reference count of its
\fIobjPtr\fR argument; it only reads. Note however that this function may set
the interpreter result; if that is the only place that is holding a reference
to the object, it will be deleted.
.PP
\fBTcl_GetEncodingSearchPath\fR returns an object with a reference count of at
least 1.
.SH "SEE ALSO"
encoding(n)
.SH KEYWORDS
utf, encoding, convert
+21
View File
@@ -209,6 +209,27 @@ namespace whose list of exported commands is used if both the mapping
dictionary and the subcommand list properties are NULL. May be read
using \fBTcl_GetEnsembleNamespace\fR which returns a Tcl result code
(\fBTCL_OK\fR, or \fBTCL_ERROR\fR if the token does not refer to an ensemble).
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_FindEnsemble\fR does not modify the reference count of its
\fIcmdNameObj\fR argument; it only reads. Note however that this function may
set the interpreter result; if that is the only place that is holding a
reference to the object, it will be deleted.
.PP
The ensemble property getters (\fBTcl_GetEnsembleMappingDict\fR,
\fBTcl_GetEnsembleParameterList\fR, \fBTcl_GetEnsembleSubcommandList\fR, and
\fBTcl_GetEnsembleUnknownHandler\fR) do not manipulate the reference count of
the values they provide out; if those are non-NULL, they will have a reference
count of at least 1. Note that these functions may set the interpreter
result.
.PP
The ensemble property setters (\fBTcl_SetEnsembleMappingDict\fR,
\fBTcl_SetEnsembleParameterList\fR, \fBTcl_SetEnsembleSubcommandList\fR, and
\fBTcl_SetEnsembleUnknownHandler\fR) will increment the reference count of the
new value of the property they are given if they succeed (and decrement the
reference count of the old value of the property, if relevant). If the
property setters return \fBTCL_ERROR\fR, the reference count of the Tcl_Obj
argument is left unchanged.
.SH "SEE ALSO"
namespace(n), Tcl_DeleteCommandFromToken(3)
.SH KEYWORDS
+15 -1
View File
@@ -65,7 +65,7 @@ null terminating character. If \-1, then all characters up to the
first null byte are used.
.AP "const char" *script in
Points to first byte of script to execute (null-terminated and UTF-8).
.AP char *part in
.AP "const char" *part in
String forming part of a Tcl script.
.AP va_list argList in
An argument list which must have been initialized using
@@ -207,6 +207,20 @@ the \fBreturn\fR, \fBbreak\fR, or \fBcontinue\fR command was
invoked in an inappropriate place.
This means that top-level applications should never see a return code
from \fBTcl_EvalObjEx\fR other than \fBTCL_OK\fR or \fBTCL_ERROR\fR.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_EvalObjEx\fR and \fBTcl_GlobalEvalObj\fR both increment and
decrement the reference count of their \fIobjPtr\fR argument; you must
not pass them any value with a reference count of zero. They also
manipulate the interpreter result; you must not count on the
interpreter result to hold the reference count of any value over
these calls.
.PP
\fBTcl_EvalObjv\fR may increment and decrement the reference count of
any value passed via its \fIobjv\fR argument; you must not pass any
value with a reference count of zero. This function also manipulates
the interpreter result; you must not count on the interpreter result
to hold the reference count of any value over this call.
.SH KEYWORDS
execute, file, global, result, script, value
+9
View File
@@ -98,6 +98,15 @@ containing the expression's value at \fI*resultPtrPtr\fR.
In this case, the caller is responsible for calling
\fBTcl_DecrRefCount\fR to decrement the value's reference count
when it is finished with the value.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_ExprLongObj\fR, \fBTcl_ExprDoubleObj\fR,
\fBTcl_ExprBooleanObj\fR, and \fBTcl_ExprObj\fR all increment and
decrement the reference count of their \fIobjPtr\fR arguments; you
must not pass them any value with a reference count of zero. They also
manipulate the interpreter result; you must not count on the
interpreter result to hold the reference count of any value over these
calls.
.SH "SEE ALSO"
Tcl_ExprLong, Tcl_ExprDouble, Tcl_ExprBoolean, Tcl_ExprString, Tcl_GetObjResult
+161 -3
View File
@@ -45,7 +45,7 @@ int
\fBTcl_FSDeleteFile\fR(\fIpathPtr\fR)
.sp
int
\fBTcl_FSRemoveDirectory\fR(\fIpathPtr, int recursive, errorPtr\fR)
\fBTcl_FSRemoveDirectory\fR(\fIpathPtr, recursive, errorPtr\fR)
.sp
int
\fBTcl_FSRenameFile\fR(\fIsrcPathPtr, destPathPtr\fR)
@@ -79,10 +79,10 @@ int
\fBTcl_FSUtime\fR(\fIpathPtr, tval\fR)
.sp
int
\fBTcl_FSFileAttrsGet\fR(\fIinterp, int index, pathPtr, objPtrRef\fR)
\fBTcl_FSFileAttrsGet\fR(\fIinterp, index, pathPtr, objPtrRef\fR)
.sp
int
\fBTcl_FSFileAttrsSet\fR(\fIinterp, int index, pathPtr, Tcl_Obj *objPtr\fR)
\fBTcl_FSFileAttrsSet\fR(\fIinterp, index, pathPtr, objPtr\fR)
.sp
const char *const *
\fBTcl_FSFileAttrStrings\fR(\fIpathPtr, objPtrRef\fR)
@@ -197,6 +197,8 @@ rename operation.
.AP Tcl_Obj *destPathPtr in
As for \fIpathPtr\fR, but used for the destination filename for a copy or
rename operation.
.AP int recursive in
Whether to remove subdirectories and their contents as well.
.AP "const char" *encodingName in
The encoding of the data stored in the
file identified by \fIpathPtr\fR and to be evaluated.
@@ -224,6 +226,10 @@ be joined together. If negative, then all elements are joined.
.AP Tcl_Obj **errorPtr out
In the case of an error, filled with a value containing the name of
the file which caused an error in the various copy/rename operations.
.AP int index in
The index of the attribute in question.
.AP Tcl_Obj *objPtr in
The value to set in the operation.
.AP Tcl_Obj **objPtrRef out
Filled with a value containing the result of the operation.
.AP Tcl_Obj *resultPtr out
@@ -1628,6 +1634,158 @@ typedef int \fBTcl_FSChdirProc\fR(
The \fBTcl_FSChdirProc\fR changes the applications current working
directory to the value specified in \fIpathPtr\fR. The function returns
-1 on error or 0 on success.
.SH "REFERENCE COUNT MANAGEMENT"
.SS "PUBLIC API CALLS"
.PP
For all of these functions, \fIpathPtr\fR (including the \fIsrcPathPtr\fR and
\fIdestPathPtr\fR arguments to \fBTcl_FSCopyFile\fR,
\fBTcl_FSCopyDirectory\fR, and \fBTcl_FSRenameFile\fR, the \fIfirstPtr\fR and
\fIsecondPtr\fR arguments to \fBTcl_FSEqualPaths\fR, and the \fIlinkNamePtr\fR
and \fItoPtr\fR arguments to \fBTcl_FSLink\fR) must not be a zero reference
count value; references may be retained in internal caches even for
theoretically read-only operations. These functions may also manipulate the
interpreter result (if they take and are given a non-NULL \fIinterp\fR
argument); you must not count on the interpreter result to hold the reference
count of any argument value over these calls and should manage your own
references there. However, references held by the arguments to a Tcl command
\fIare\fR suitable for reference count management purposes for the duration of
the implementation of that command.
.PP
The \fIerrorPtr\fR argument to \fBTcl_FSCopyDirectory\fR and
\fBTcl_FSRemoveDirectory\fR is, when an object is set into it at all, set to
an object with a non-zero reference count that should be passed to
\fBTcl_DecrRefCount\fR when no longer needed.
.PP
\fBTcl_FSListVolumes\fR always returns a zero-reference object, much
like \fBTcl_NewObj\fR.
.PP
\fBTcl_FSLink\fR always returns a non-zero-reference object when it is
asked to read; you must call \fBTcl_DecrRefCount\fR on the object
once you no longer need it.
.PP
\fBTcl_FSGetCwd\fR always returns a non-zero-reference object; you
must call \fBTcl_DecrRefCount\fR on the object once you no longer need
it.
.PP
\fBTcl_FSPathSeparator\fR always returns a zero-reference object, much
like \fBTcl_NewObj\fR.
.PP
\fBTcl_FSJoinPath\fR always returns a zero-reference object, much
like \fBTcl_NewObj\fR. Its \fIlistObj\fR argument can have any reference
count; it is only read by this function.
.PP
\fBTcl_FSSplitPath\fR always returns a zero-reference object, much
like \fBTcl_NewObj\fR.
.PP
\fBTcl_FSGetNormalizedPath\fR returns an object with a non-zero
reference count where Tcl is the owner. You should increment its
reference count if you want to retain it, but do not need to if you
are just using the value immediately.
.PP
\fBTcl_FSJoinToPath\fR always returns a zero-reference object, much like
\fBTcl_NewObj\fR. Its \fIbasePtr\fR argument follows the rules above for
\fIpathPtr\fR, as do the values in the \fIobjv\fR argument.
.PP
\fBTcl_FSGetTranslatedPath\fR returns a non-zero-reference object (or
NULL in the error case); you must call \fBTcl_DecrRefCount\fR on the
object once you no longer need it.
.PP
\fBTcl_FSNewNativePath\fR always returns a zero-reference object (or
NULL), much like \fBTcl_NewObj\fR.
.PP
\fBTcl_FSFileSystemInfo\fR always returns a zero-reference object (or
NULL), much like \fBTcl_NewObj\fR.
.PP
The \fIobjPtr\fR and \fIobjPtrRef\fR arguments to \fBTcl_FSFileAttrsGet\fR,
\fBTcl_FSFileAttrsSet\fR and \fBTcl_FSFileAttrStrings\fR are conventional Tcl
values; the \fIobjPtr\fR argument will be read but not retained, and the
\fIobjPtrRef\fR argument will have (on success) a zero-reference value written
into it (as with \fBTcl_NewObj\fR). \fBTcl_FSFileAttrsGet\fR and
\fBTcl_FSFileAttrsSet\fR may also manipulate the interpreter result.
.PP
The \fIresultPtr\fR argument to \fBTcl_FSMatchInDirectory\fR will not have its
reference count manipulated, but it should have a reference count of no more
than 1, and should not be the current interpreter result (as the function may
overwrite that on error).
.SS "VIRTUAL FILESYSTEM INTERFACE"
.PP
For all virtual filesystem implementation functions, any \fIpathPtr\fR
arguments should not have their reference counts manipulated. If they take an
\fIinterp\fR argument, they may set an error message in that, but must not
manipulate the \fIpathPtr\fR afterwards. Aside from that:
.TP
\fIinternalToNormalizedProc\fR
.
This should return a zero-reference count value, as if allocated with
\fBTcl_NewObj\fR.
.TP
\fInormalizePathProc\fR
.
Unlike with other API implementation functions, the \fIpathPtr\fR argument
here is guaranteed to be an unshared object that should be updated. Its
reference count should not be modified.
.TP
\fIfilesystemPathTypeProc\fR
.
The return value (if non-NULL) either has a reference count of zero or needs
to be maintained (on a per-thread basis) by the filesystem. Tcl will increment
the reference count of the value if it wishes to retain it.
.TP
\fIfilesystemSeparatorProc\fR
.
The return value should be a value with reference count of zero.
.TP
\fImatchInDirectoryProc\fR
.
The \fIresultPtr\fR argument should be assumed to hold a list that can be
appended to (i.e., that has a reference count no greater than 1). No reference
to it should be retained.
.TP
\fIlinkProc\fR
.
If \fItoPtr\fR is NULL, this should return a value with reference count 1 that
has just been allocated and passed to \fBTcl_IncrRefCount\fR. If \fItoPtr\fR
is not NULL, it should be returned on success.
.TP
\fIlistVolumesProc\fR
.
The result value should be a list (if non-NULL); it will have its reference
count decremented once (with \fBTcl_DecrRefCount\fR) by Tcl once done.
.TP
\fIfileAttrStringsProc\fR
.
If the result is NULL, the \fIobjPtrRef\fR should have a list value written to
it; that list will have its reference count both incremented (with
\fBTcl_IncrRefCount\fR) and decremented (with \fBTcl_DecrRefCount\fR).
.TP
\fIfileAttrsGetProc\fR
.
The \fIobjPtrRef\fR argument should have (on non-error return) a zero
reference count value written to it (allocated as if with \fBTcl_NewObj\fR).
.TP
\fIfileAttrsSetProc\fR
.
The \fIobjPtr\fR argument should either just be read or its reference count
incremented to retain it.
.TP
\fIremoveDirectoryProc\fR
.
If an error is being reported, the problem filename reported via
\fIerrorPtr\fR should be newly allocated (as if with \fBTcl_NewObj\fR) and
have a reference count of 1 (i.e., have been passed to
\fBTcl_IncrRefCount\fR).
.TP
\fIcopyDirectoryProc\fR
.
If an error is being reported, the problem filename reported via
\fIerrorPtr\fR should be newly allocated (as if with \fBTcl_NewObj\fR) and
have a reference count of 1 (i.e., have been passed to
\fBTcl_IncrRefCount\fR).
.TP
\fIgetCwdProc\fR
.
The result will be passed to \fBTcl_DecrRefCount\fR by the implementation of
\fBTcl_FSGetCwd\fR after it has been normalized.
.SH "SEE ALSO"
cd(n), file(n), filename(n), load(n), open(n), pwd(n), source(n), unload(n)
.SH KEYWORDS
+4 -1
View File
@@ -13,7 +13,7 @@ Tcl_FindExecutable, Tcl_GetNameOfExecutable \- identify or return the name of th
.nf
\fB#include <tcl.h>\fR
.sp
void
const char *
\fBTcl_FindExecutable\fR(\fIargv0\fR)
.sp
const char *
@@ -35,6 +35,9 @@ Tcl. For example, it is needed on some platforms in the
implementation of the \fBload\fR command.
It is also returned by the \fBinfo nameofexecutable\fR command.
.PP
The result of \fBTcl_FindExecutable\fR is the full Tcl version (e.g.,
\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
.PP
On UNIX platforms this procedure is typically invoked as the very
first thing in the application's main program; it must be passed
\fIargv[0]\fR as its argument. It is important not to change the
+3 -3
View File
@@ -17,7 +17,7 @@ char *
\fBTcl_GetCwd\fR(\fIinterp\fR, \fIbufferPtr\fR)
.sp
int
\fBTcl_Chdir\fR(\fIpath\fR)
\fBTcl_Chdir\fR(\fIdirName\fR)
.SH ARGUMENTS
.AS Tcl_DString *bufferPtr in/out
.AP Tcl_Interp *interp in
@@ -27,7 +27,7 @@ This dynamic string is used to store the current working directory.
At the time of the call it should be uninitialized or free. The
caller must eventually call \fBTcl_DStringFree\fR to free up
anything stored here.
.AP char *path in
.AP "const char" *dirName in
File path in UTF\-8 format.
.BE
@@ -45,7 +45,7 @@ must call \fBTcl_DStringFree()\fR when the result is no longer needed.
The format of the path is UTF\-8.
.PP
\fBTcl_Chdir\fR changes the applications current working directory to
the value specified in \fIpath\fR. The format of the passed in string
the value specified in \fIdirName\fR. The format of the passed in string
must be UTF\-8. The function returns -1 on error or 0 on success.
.SH KEYWORDS
+6
View File
@@ -105,6 +105,12 @@ array of characters at \fItablePtr\fR+\fIoffset\fR bytes, etc.)
This is particularly useful when processing things like
\fBTk_ConfigurationSpec\fR, whose string keys are in the same place in
each of several array elements.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_GetIndexFromObj\fR and \fBTcl_GetIndexFromObjStruct\fR do not modify
the reference count of their \fIobjPtr\fR arguments; they only read. Note
however that these functions may set the interpreter result; if that is the
only place that is holding a reference to the object, it will be deleted.
.SH "SEE ALSO"
prefix(n), Tcl_WrongNumArgs(3)
.SH KEYWORDS
+14
View File
@@ -330,5 +330,19 @@ typedef void \fBTcl_FreeHashEntryProc\fR(
If this is NULL then \fBTcl_Free\fR is used to free the space for the entry.
Tcl_Obj* keys use this function to decrement the reference count on the
value.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
When a hash table is created with \fBTcl_InitCustomHashTable\fR, the
\fBTcl_CreateHashEntry\fR function will increment the reference count of its
\fIkey\fR argument when it creates a key (but not if there is an existing
matching key). The reference count of the key will be decremented when the
corresponding hash entry is deleted, whether with \fBTcl_DeleteHashEntry\fR or
with \fBTcl_DeleteHashTable\fR. The \fBTcl_GetHashKey\fR function will return
the key without further modifying its reference count.
.PP
Custom hash tables that use a Tcl_Obj* as key will generally need to do
something similar in their \fIallocEntryProc\fR.
.SH "SEE ALSO"
Dict(3)
.SH KEYWORDS
hash table, key, lookup, search, value
+13 -1
View File
@@ -2,7 +2,7 @@
'\" Copyright (c) 1998-2000 Scriptics Corporation.
'\" All rights reserved.
'\"
.TH Tcl_Init 3 8.0 Tcl "Tcl Library Procedures"
.TH Tcl_Init 3 8.7 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -13,10 +13,15 @@ Tcl_Init \- find and source initialization script
.sp
int
\fBTcl_Init\fR(\fIinterp\fR)
.sp
const char *
\fBTcl_SetPreInitScript\fR(\fIscriptPtr\fR)
.SH ARGUMENTS
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
Interpreter to initialize.
.AP "const char" *scriptPtr in
Address of the initialization script.
.BE
.SH DESCRIPTION
@@ -26,6 +31,13 @@ Interpreter to initialize.
path.
.PP
\fBTcl_Init\fR is typically called from \fBTcl_AppInit\fR procedures.
.PP
\fBTcl_SetPreInitScript\fR registers the pre-initialization script and
returns the former (now replaced) script pointer.
A value of \fINULL\fR may be passed to not register any script.
The pre-initialization script is executed by \fBTcl_Init\fR before accessing
the file system. The purpose is to typically prepare a custom file system
(like an embedded zip-file) to be activated before the search.
.SH "SEE ALSO"
Tcl_AppInit, Tcl_Main
+5 -2
View File
@@ -13,7 +13,7 @@ Tcl_InitSubsystems \- initialize the Tcl library.
.nf
\fB#include <tcl.h>\fR
.sp
void
const char *
\fBTcl_InitSubsystems\fR(\fIvoid\fR)
.SH DESCRIPTION
.PP
@@ -21,10 +21,13 @@ The \fBTcl_InitSubsystems\fR procedure initializes the Tcl
library. This procedure is typically invoked as the very
first thing in the application's main program.
.PP
The result of \fBTcl_InitSubsystems\fR is the full Tcl version (e.g.,
\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
.PP
\fBTcl_InitSubsystems\fR is very similar in use to
\fBTcl_FindExecutable\fR. It can be used when Tcl is
used as utility library, no other encodings than utf8,
iso8859-1 or unicode are used, and no interest exists in the
iso8859-1 or utf-16 are used, and no interest exists in the
value of \fBinfo nameofexecutable\fR. The system encoding will not
be extracted from the environment, but falls back to iso8859-1.
.SH KEYWORDS
+21
View File
@@ -160,6 +160,27 @@ If anything later in the caller requires
The \fBTcl_InitBignumFromDouble\fR routine is a utility procedure
that extracts the integer part of \fIdoubleValue\fR and stores that
integer value in the \fBmp_int\fR value \fIbigValue\fR.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_NewIntObj\fR, \fBTcl_NewLongObj\fR, \fBTcl_NewWideIntObj\fR, and
\fBTcl_NewBignumObj\fR always return a zero-reference object, much like
\fBTcl_NewObj\fR.
.PP
\fBTcl_SetIntObj\fR, \fBTcl_SetLongObj\fR, \fBTcl_SetWideIntObj\fR, and
\fBTcl_SetBignumObj\fR do not modify the reference count of their \fIobjPtr\fR
arguments, but do require that the object be unshared.
.PP
\fBTcl_GetIntFromObj\fR, \fBTcl_GetIntForIndex\fR, \fBTcl_GetLongFromObj\fR,
\fBTcl_GetWideIntFromObj\fR, \fBTcl_GetBignumFromObj\fR, and
\fBTcl_TakeBignumFromObj\fR do not modify the reference count of their
\fIobjPtr\fR arguments; they only read. Note however that this function may
set the interpreter result; if that is the only place that is holding a
reference to the object, it will be deleted. Also note that if
\fBTcl_TakeBignumFromObj\fR is given an unshared value, the value of that
object may be modified; it is intended to be used when the value is
.QW consumed
by the operation at this point.
.SH "SEE ALSO"
Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult
.SH KEYWORDS
+28 -3
View File
@@ -28,7 +28,7 @@ int
\fBTcl_ListObjGetElements\fR(\fIinterp, listPtr, objcPtr, objvPtr\fR)
.sp
int
\fBTcl_ListObjLength\fR(\fIinterp, listPtr, intPtr\fR)
\fBTcl_ListObjLength\fR(\fIinterp, listPtr, lengthPtr\fR)
.sp
int
\fBTcl_ListObjIndex\fR(\fIinterp, listPtr, index, objPtrPtr\fR)
@@ -76,7 +76,7 @@ An array of pointers to values.
\fBTcl_NewListObj\fR will insert these values into a new list value
and \fBTcl_ListObjReplace\fR will insert them into an existing \fIlistPtr\fR.
Each value will become a separate list element.
.AP int *intPtr out
.AP int *lengthPtr out
Points to location where \fBTcl_ListObjLength\fR
stores the length of the list.
.AP int index in
@@ -162,7 +162,7 @@ Otherwise it returns \fBTCL_OK\fR after storing the count and array pointer.
.PP
\fBTcl_ListObjLength\fR returns the number of elements in the list value
referenced by \fIlistPtr\fR.
It returns this count by storing an integer in the address \fIintPtr\fR.
It returns this count by storing an integer in the address \fIlengthPtr\fR.
If the value is not already a list value,
\fBTcl_ListObjLength\fR will attempt to convert it to one;
if the conversion fails, it returns \fBTCL_ERROR\fR
@@ -246,6 +246,31 @@ with a NULL \fIobjvPtr\fR:
result = \fBTcl_ListObjReplace\fR(interp, listPtr, first, count,
0, NULL);
.CE
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_NewListObj\fR always returns a zero-reference object, much like
\fBTcl_NewObj\fR. If a non-NULL \fIobjv\fR argument is given, the reference
counts of the first \fIobjc\fR values in that array are incremented.
.PP
\fBTcl_SetListObj\fR does not modify the reference count of its \fIobjPtr\fR
argument, but does require that the object be unshared. The reference counts
of the first \fIobjc\fR values in the \fIobjv\fR array are incremented.
.PP
\fBTcl_ListObjGetElements\fR, \fBTcl_ListObjIndex\fR, and
\fBTcl_ListObjLength\fR do not modify the reference count of their
\fIlistPtr\fR arguments; they only read. Note however that these three
functions may set the interpreter result; if that is the only place that is
holding a reference to the object, it will be deleted.
.PP
\fBTcl_ListObjAppendList\fR, \fBTcl_ListObjAppendElement\fR, and
\fBTcl_ListObjReplace\fR require an unshared \fIlistPtr\fR argument.
\fBTcl_ListObjAppendList\fR only reads its \fIelemListPtr\fR argument.
\fBTcl_ListObjAppendElement\fR increments the reference count of its
\fIobjPtr\fR on success. \fBTcl_ListObjReplace\fR increments the reference
count of the first \fIobjc\fR values in the \fIobjv\fR array on success. Note
however that all these three functions may set the interpreter result on
failure; if that is the only place that is holding a reference to the object,
it will be deleted.
.SH "SEE ALSO"
Tcl_NewObj(3), Tcl_DecrRefCount(3), Tcl_IncrRefCount(3), Tcl_GetObjResult(3)
.SH KEYWORDS
+4
View File
@@ -60,6 +60,10 @@ be unloaded with \fBTcl_FSUnloadFile\fR.
the symbol cannot be found, it returns NULL and sets an error message in the
given \fIinterp\fR (if that is non-NULL). Note that it is unsafe to use this
operation on a handle that has been passed to \fBTcl_FSUnloadFile\fR.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The reference count of the \fIpathPtr\fR argument to \fBTcl_LoadFile\fR may be
incremented. As such, it should not be given a zero reference count value.
.SH "SEE ALSO"
Tcl_FSLoadFile(3), Tcl_FSUnloadFile(3), load(n), unload(n)
.SH KEYWORDS
+25 -1
View File
@@ -258,8 +258,32 @@ also return TCL_ERROR; it should return TCL_OK otherwise.
The \fIoldClientData\fR field to a Tcl_CloneProc gives the value from the
method being copied from, and the \fInewClientDataPtr\fR field will point to
a variable in which to write the value for the method being copied to.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The \fInameObj\fR argument to \fBTcl_NewMethod\fR and
\fBTcl_NewInstanceMethod\fR (when non-NULL) will have its reference count
incremented if there is no existing method with that name in that
class/object.
.PP
The result of \fBTcl_MethodName\fR is a value with a reference count of at
least one. It should not be modified without first duplicating it (with
\fBTcl_DuplicateObj\fR).
.PP
The values in the first \fIobjc\fR values of the \fIobjv\fR argument to
\fBTcl_ObjectContextInvokeNext\fR are assumed to have a reference count of at
least 1; the containing array is assumed to endure until the next method
implementation (see \fBnext\fR) returns. Be aware that methods may
\fByield\fR; if any post-call actions are desired (e.g., decrementing the
reference count of values passed in here), they must be scheduled with
\fBTcl_NRAddCallback\fR.
.PP
The \fIcallProc\fR of the \fBTcl_MethodType\fR structure takes values of at
least reference count 1 in its \fIobjv\fR argument. It may add its own
references, but must not decrement the reference count below that level; the
caller of the method will decrement the reference count once the method
returns properly (and the reference will be held if the method \fByield\fRs).
.SH "SEE ALSO"
Class(3), oo::class(n), oo::define(n), oo::object(n)
Class(3), NRE(3), oo::class(n), oo::define(n), oo::object(n)
.SH KEYWORDS
constructor, method, object
+20 -1
View File
@@ -40,7 +40,7 @@ void
.AS Tcl_CmdDeleteProc *interp in
.AP Tcl_Interp *interp in
The relevant Interpreter.
.AP char *cmdName in
.AP "const char" *cmdName in
Name of the command to create.
.AP Tcl_ObjCmdProc *proc in
Called in order to evaluate a command. Is often just a small wrapper that uses
@@ -227,6 +227,25 @@ int
Any function comprising a routine can push other functions, making it possible
implement looping and sequencing constructs using the function stack.
.PP
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The first \fIobjc\fR values in the \fIobjv\fR array passed to the functions
\fBTcl_NRCallObjProc\fR, \fBTcl_NREvalObjv\fR, and \fBTcl_NRCmdSwap\fR should
have a reference count of at least 1; they may have additional references
taken during the execution.
.PP
The \fIobjPtr\fR argument to \fBTcl_NREvalObj\fR and \fBTcl_NRExprObj\fR
should have a reference count of at least 1, and may have additional
references taken to it during execution.
.PP
The \fIresultObj\fR argument to \fBTcl_NRExprObj\fR should be an unshared
object.
.PP
Use \fBTcl_NRAddCallback\fR to schedule any required final decrementing of the
reference counts of arguments to any of the other functions on this page, as
with any other post-processing step in the non-recursive execution engine.
.PP
The
.SH "SEE ALSO"
Tcl_CreateCommand(3), Tcl_CreateObjCommand(3), Tcl_EvalObjEx(3), Tcl_GetCommandFromObj(3), Tcl_ExprObj(3)
.SH KEYWORDS
+14 -2
View File
@@ -46,10 +46,10 @@ Tcl_Command
\fBTcl_FindCommand\fR(\fIinterp, name, contextNsPtr, flags\fR)
.sp
Tcl_Obj *
\fBTcl_GetNamespaceUnknownHandler(\fIinterp, nsPtr\fR)
\fBTcl_GetNamespaceUnknownHandler\fR(\fIinterp, nsPtr\fR)
.sp
int
\fBTcl_SetNamespaceUnknownHandler(\fIinterp, nsPtr, handlerPtr\fR)
\fBTcl_SetNamespaceUnknownHandler\fR(\fIinterp, nsPtr, handlerPtr\fR)
.SH ARGUMENTS
.AS Tcl_NamespaceDeleteProc allowOverwrite in/out
.AP Tcl_Interp *interp in/out
@@ -159,6 +159,18 @@ for the namespace, or NULL if none is set.
\fBTcl_SetNamespaceUnknownHandler\fR sets the unknown command handler for
the namespace. If \fIhandlerPtr\fR is NULL, then the handler is reset to
its default.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The \fIobjPtr\fR argument to \fBTcl_AppendExportList\fR should be an
unshared object, as it will be modified by this function. The
reference count of \fIobjPtr\fR will not be altered.
.PP
\fBTcl_GetNamespaceUnknownHandler\fR returns a possibly shared value.
Its reference count should be incremented if the value is to be
retained.
.PP
The \fIhandlerPtr\fR argument to \fBTcl_SetNamespaceUnknownHandler\fR
will have its reference count incremented if it is a non-empty list.
.SH "SEE ALSO"
Tcl_CreateCommand(3), Tcl_ListObjAppendList(3), Tcl_SetVar(3)
.SH KEYWORDS
+6 -1
View File
@@ -283,7 +283,12 @@ to reduce storage requirements.
Reference counting is used to determine when a value is
no longer needed and can safely be freed.
A value just created by \fBTcl_NewObj\fR or \fBTcl_NewStringObj\fR
has \fIrefCount\fR 0.
has \fIrefCount\fR 0, meaning that the object can often be given to a function
like \fBTcl_SetObjResult\fR, \fBTcl_ListObjAppendElement\fR, or
\fBTcl_DictObjPut\fR (as a value) without explicit reference management, all
of which are common use cases. (The latter two require that the the target
list or dictionary be well-formed, but that is often easy to arrange when the
value is being initially constructed.)
The macro \fBTcl_IncrRefCount\fR increments the reference count
when a new reference to the value is created.
The macro \fBTcl_DecrRefCount\fR decrements the count
+22
View File
@@ -248,6 +248,28 @@ The \fIfreeIntRepProc\fR implementation must not access the
uses of that field during value deletion. The defined tasks for
the \fIfreeIntRepProc\fR have no need to consult the \fIbytes\fR
member.
.PP
Note that if a subsidiary value has its reference count reduced to zero
during the running of a \fIfreeIntRepProc\fR, that value may be not freed
immediately, in order to limit stack usage. However, the value will be freed
before the outermost current \fBTcl_DecrRefCount\fR returns.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The \fIobjPtr\fR argument to \fBTcl_AppendAllObjTypes\fR should be an unshared
value; this function will not modify the reference count of that value, but
will modify its contents. If \fIobjPtr\fR is not (interpretable as) a list,
this function will set the interpreter result and produce an error; using an
unshared empty value is strongly recommended.
.PP
The \fIobjPtr\fR argument to \fBTcl_ConvertToType\fR can have any non-zero
reference count; this function will not modify the reference count, but may
write to the interpreter result on error so values that originate from there
should have an additional reference made before calling this.
.PP
None of the callback functions in the \fBTcl_ObjType\fR structure should
modify the reference count of their arguments, but if the values contain
subsidiary values (e.g., the elements of a list or the keys of a dictionary)
then those subsidiary values may have their reference counts modified.
.SH "SEE ALSO"
Tcl_NewObj(3), Tcl_DecrRefCount(3), Tcl_IncrRefCount(3)
.SH KEYWORDS
+18
View File
@@ -641,6 +641,24 @@ the channel was created with \fBTcl_OpenFileChannel\fR,
\fBTcl_OpenCommandChannel\fR, or \fBTcl_MakeFileChannel\fR. Other
channel types may return a different type of handle on Windows
platforms.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The \fIreadObjPtr\fR argument to \fBTcl_ReadChars\fR must be an unshared
value; it will be modified by this function. Using the interpreter result for
this purpose is \fIstrongly\fR not recommended; the preferred pattern is to
use a new value from \fBTcl_NewObj\fR to receive the data and only to pass it
to \fBTcl_SetObjResult\fR if this function succeeds.
.PP
The \fIlineObjPtr\fR argument to \fBTcl_GetsObj\fR must be an unshared value;
it will be modified by this function. Using the interpreter result for this
purpose is \fIstrongly\fR not recommended; the preferred pattern is to use a
new value from \fBTcl_NewObj\fR to receive the data and only to pass it to
\fBTcl_SetObjResult\fR if this function succeeds.
.PP
The \fIwriteObjPtr\fR argument to \fBTcl_WriteObj\fR should be a value with
any reference count. This function will not modify the reference count. Using
the interpreter result without adding an additional reference to it is not
recommended.
.SH "SEE ALSO"
DString(3), fconfigure(n), filename(n), fopen(3), Tcl_CreateChannel(3)
.SH KEYWORDS
+4 -1
View File
@@ -18,7 +18,7 @@ void
void
\fBTcl_PanicVA\fR(\fIformat\fR, \fIargList\fR)
.sp
void
const char *
\fBTcl_SetPanicProc\fR(\fIpanicProc\fR)
.sp
void
@@ -82,6 +82,9 @@ making calls into the Tcl library, or into other libraries that may
call the Tcl library, since the original call to \fBTcl_Panic\fR
indicates the Tcl library is not in a state of reliable operation.
.PP
The result of \fBTcl_SetPanicProc\fR is the full Tcl version (e.g.,
\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
.PP
The typical use of \fBTcl_SetPanicProc\fR arranges for the error message
to be displayed or reported in a manner more suitable for the
application or the platform.
+6
View File
@@ -189,6 +189,12 @@ will be stored at \fIdstPtr\fR; the string inside will have a lifetime linked
to the lifetime of the string representation of the argument value that it
came from, and so should be copied if it needs to be retained. The
\fIsrcPtr\fR and \fIclientData\fR fields are ignored.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The values in the \fIobjv\fR argument to \fBTcl_ParseArgsObjv\fR will not have
their reference counts modified by this function. The interpreter result may
be modified on error; the values passed should not be the interpreter result
with no further reference added.
.SH "SEE ALSO"
Tcl_GetIndexFromObj(3), Tcl_Main(3), Tcl_CreateObjCommand(3)
.SH KEYWORDS
+8
View File
@@ -191,6 +191,7 @@ code with one of the values \fBTCL_OK\fR, \fBTCL_ERROR\fR,
some other integer value originating in an extension.
In addition, a result value or error message is left in \fIinterp\fR's
result; it can be retrieved using \fBTcl_GetObjResult\fR.
.SS "DEPRECATED FUNCTIONS"
.PP
\fBTcl_EvalTokens\fR differs from \fBTcl_EvalTokensStandard\fR only in
the return convention used: it returns the result in a new Tcl_Obj.
@@ -463,5 +464,12 @@ There are additional fields in the Tcl_Parse structure after the
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
\fBTcl_ParseQuotedString\fR, and \fBTcl_ParseVarName\fR; they should not be
referenced by code outside of these procedures.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The result of \fBTcl_EvalTokens\fR is an unshared value with a reference count
of 1; the caller of that function should call \fBTcl_DecrRefCount\fR on the
result value to dispose of it. (The equivalent with
\fBTcl_EvalTokenStandard\fR is just the interpreter result, which can be
retrieved with \fBTcl_GetObjResult\fR.)
.SH KEYWORDS
backslash substitution, braces, command, expression, parse, token, variable substitution
+4
View File
@@ -91,6 +91,10 @@ functions.
\fBTcl_PkgRequireProc\fR is the form of \fBpackage require\fR handling
multiple requirements. The other forms are present for backward
compatibility and translate their invocations to this form.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The requirements values given (in the \fIobjv\fR argument) to
\fBTcl_PkgRequireProc\fR must have non-zero reference counts.
.SH KEYWORDS
package, present, provide, require, version
.SH "SEE ALSO"
+6
View File
@@ -44,6 +44,12 @@ allow the user to re-issue recently invoked commands.
If the \fIflags\fR argument contains the \fBTCL_NO_EVAL\fR bit then
the command is recorded without being evaluated.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The reference count of the \fIcmdPtr\fR argument to \fBTcl_RecordAndEvalObj\fR
must be at least 1. This function will modify the interpreter result; do not
use an existing result as \fIcmdPtr\fR directly without incrementing its
reference count.
.SH "SEE ALSO"
Tcl_EvalObjEx, Tcl_GetObjResult
+18 -2
View File
@@ -51,14 +51,14 @@ can be efficiently searched.
.AP Tcl_Obj *patObj in/out
Refers to the value from which to get a regular expression. The
compiled regular expression is cached in the value.
.AP char *text in
.AP "const char" *text in
Text to search for a match with a regular expression.
.AP "const char" *pattern in
String in the form of a regular expression pattern.
.AP Tcl_RegExp regexp in
Compiled regular expression. Must have been returned previously
by \fBTcl_GetRegExpFromObj\fR or \fBTcl_RegExpCompile\fR.
.AP char *start in
.AP "const 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
@@ -377,6 +377,22 @@ If no match was found, then it indicates the earliest point at which a
match might occur if additional text is appended to the string. If it
is no match is possible even with further text, this field will be set
to \-1.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The \fItextObj\fR and \fIpatObj\fR arguments to \fBTcl_RegExpMatchObj\fR must
have reference counts of at least 1. Note however that this function may set
the interpreter result; neither argument should be the direct interpreter
result without an additional reference being taken.
.PP
The \fIpatObj\fR argument to \fBTcl_GetRegExpFromObj\fR must have a reference
count of at least 1. Note however that this function may set the interpreter
result; the argument should not be the direct interpreter result without an
additional reference being taken.
.PP
The \fItextObj\fR argument to \fBTcl_RegExpExecObj\fR must have a reference
count of at least 1. Note however that this function may set the interpreter
result; the argument should not be the direct interpreter result without an
additional reference being taken.
.SH "SEE ALSO"
re_syntax(n)
.SH KEYWORDS
+12 -3
View File
@@ -35,20 +35,20 @@ Refers to the Tcl interpreter whose bypass area is accessed.
.AP Tcl_Obj* msg in
Error message put into a bypass area. A list of return options and values,
followed by a string message. Both message and the option/value information
are optional.
are optional. This \fImust\fR be a well-formed list.
.AP Tcl_Obj** msgPtr out
Reference to a place where the message stored in the accessed bypass area can
be stored in.
.BE
.SH DESCRIPTION
.PP
The current definition of a Tcl channel driver does not permit the direct
The standard definition of a Tcl channel driver does not permit the direct
return of arbitrary error messages, except for the setting and retrieval of
channel options. All other functions are restricted to POSIX error codes.
.PP
The functions described here overcome this limitation. Channel drivers are
allowed to use \fBTcl_SetChannelError\fR and \fBTcl_SetChannelErrorInterp\fR
to place arbitrary error messages in \fBbypass areas\fR defined for channels
to place arbitrary error messages in \fIbypass areas\fR defined for channels
and interpreters. And the generic I/O layer uses \fBTcl_GetChannelError\fR and
\fBTcl_GetChannelErrorInterp\fR to look for messages in the bypass areas and
arrange for their return as errors. The POSIX error codes set by a driver are
@@ -134,6 +134,15 @@ leave all their error information in the interpreter result.
.ta 1.9i 4i
\fBTcl_Close\fR \fBTcl_UnstackChannel\fR \fBTcl_UnregisterChannel\fR
.DE
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The \fImsg\fR argument to \fBTcl_SetChannelError\fR and
\fBTcl_SetChannelErrorInterp\fR, if not NULL, may have any reference count;
these functions will copy.
.PP
\fBTcl_GetChannelError\fR and \fBTcl_GetChannelErrorInterp\fR write a value
reference into their \fImsgPtr\fR, but do not manipulate its reference count.
The reference count will be at least 1 (unless the reference is NULL).
.SH "SEE ALSO"
Tcl_Close(3), Tcl_OpenFileChannel(3), Tcl_SetErrno(3)
.SH KEYWORDS
+27
View File
@@ -239,6 +239,33 @@ typedef void \fBTcl_FreeProc\fR(
.PP
When \fIfreeProc\fR is called, its \fIblockPtr\fR will be set to
the value of \fIresult\fR passed to \fBTcl_SetResult\fR.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The interpreter result is one of the main places that owns references to
values, along with the bytecode execution stack, argument lists, variables,
and the list and dictionary collection values.
.PP
\fBTcl_SetObjResult\fR takes a value with an arbitrary reference count
\fI(specifically including zero)\fR and guarantees to increment the reference
count. If code wishes to continue using the value after setting it as the
result, it should add its own reference to it with \fBTcl_IncrRefCount\fR.
.PP
\fBTcl_GetObjResult\fR returns the current interpreter result value. This will
have a reference count of at least 1. If the caller wishes to keep the
interpreter result value, it should increment its reference count.
.PP
\fBTcl_GetStringResult\fR does not manipulate reference counts, but the string
it returns is owned by (and has a lifetime controlled by) the current
interpreter result value; it should be copied instead of being relied upon to
persist after the next Tcl API call, as most Tcl operations can modify the
interpreter result.
.PP
\fBTcl_SetResult\fR, \fBTcl_AppendResult\fR, \fBTcl_AppendResultVA\fR,
\fBTcl_AppendElement\fR, and \fBTcl_ResetResult\fR all modify the interpreter
result. They may cause the old interpreter result to have its reference count
decremented and a new interpreter result to be allocated. After they have been
called, the reference count of the interpreter result is guaranteed to be 1.
.SH "SEE ALSO"
Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp,
Tcl_GetReturnOptions
+21
View File
@@ -242,6 +242,27 @@ but the array remains.
If an array name is specified without an index, then the entire
array is removed.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The result of \fBTcl_SetVar2Ex\fR, \fBTcl_ObjSetVar2\fR, \fBTcl_GetVar2Ex\fR,
and \fBTcl_ObjGetVar2\fR is (if non-NULL) a value with a reference of at least
1, where that reference is held by the variable that the function has just
operated upon.
.PP
The \fInewValuePtr\fR argument to \fBTcl_SetVar2Ex\fR and \fBTcl_ObjSetVar2\fR
may be an arbitrary reference count value; its reference count will be
incremented on success. However, it is recommended to not use a zero reference
count value, as that makes correct handling of the error case tricky.
.PP
The \fIpart1\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR can
have any reference count; these functions never modify it. It is recommended
to not use a zero reference count for this argument.
.PP
The \fIpart2\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR, if
non-NULL, should not have a zero reference count as these functions may
retain a reference to it (particularly when it is used to create an array
element that did not previously exist).
.SH "SEE ALSO"
Tcl_GetObjResult, Tcl_GetStringResult, Tcl_TraceVar
+1 -1
View File
@@ -36,7 +36,7 @@ int
.AP Tcl_Interp *interp out
Interpreter to use for error reporting. If NULL, then no error message
is left.
.AP char *list in
.AP "const char" *list in
Pointer to a string with proper list structure.
.AP int *argcPtr out
Filled in with number of elements in \fIlist\fR.
+32 -3
View File
@@ -111,15 +111,17 @@ If negative, all characters up to the first null character are used.
The index of the Unicode character to return.
.AP int first in
The index of the first Unicode character in the Unicode range to be
returned as a new value.
returned as a new value. If negative, behave the same as if the
value was 0.
.AP int last in
The index of the last Unicode character in the Unicode range to be
returned as a new value.
returned as a new value. If negative, take all characters up to
the last one available.
.AP Tcl_Obj *objPtr in/out
Points to a value to manipulate.
.AP Tcl_Obj *appendObjPtr in
The value to append to \fIobjPtr\fR in \fBTcl_AppendObjToObj\fR.
.AP size_t | int *lengthPtr out
.AP int *lengthPtr out
The location where \fBTcl_GetStringFromObj\fR will store the length
of a value's string representation. May be (int *)NULL when not used.
.AP "const char" *string in
@@ -383,6 +385,33 @@ white space, then that value is ignored entirely. This white-space
removal was added to make the output of the \fBconcat\fR command
cleaner-looking. \fBTcl_ConcatObj\fR returns a pointer to a
newly-created value whose ref count is zero.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_NewStringObj\fR, \fBTcl_NewUnicodeObj\fR, \fBTcl_Format\fR,
\fBTcl_ObjPrintf\fR, and \fBTcl_ConcatObj\fR always return a zero-reference
object, much like \fBTcl_NewObj\fR.
.PP
\fBTcl_GetStringFromObj\fR, \fBTcl_GetString\fR, \fBTcl_GetUnicodeFromObj\fR,
\fBTcl_GetUnicode\fR, \fBTcl_GetUniChar\fR, \fBTcl_GetCharLength\fR, and
\fBTcl_GetRange\fR all only work with an existing value; they do not
manipulate its reference count in any way.
.PP
\fBTcl_SetStringObj\fR, \fBTcl_SetUnicodeObj\fR, \fBTcl_AppendToObj\fR,
\fBTcl_AppendUnicodeToObj\fR, \fBTcl_AppendObjToObj\fR,
\fBTcl_AppendStringsToObj\fR, \fBTcl_AppendStringsToObjVA\fR,
\fBTcl_AppendLimitedToObj\fR, \fBTcl_AppendFormatToObj\fR,
\fBTcl_AppendPrintfToObj\fR, \fBTcl_SetObjLength\fR, and
\fBTcl_AttemptSetObjLength\fR and require their \fIobjPtr\fR to be an unshared
value (i.e, a reference count no more than 1) as they will modify it.
.PP
Additional arguments to the above functions (the \fIappendObjPtr\fR argument
to \fBTcl_AppendObjToObj\fR, values in the \fIobjv\fR argument to
\fBTcl_Format\fR, \fBTcl_AppendFormatToObj\fR, and \fBTcl_ConcatObj\fR) can
have any reference count, but reference counts of zero are not recommended.
.PP
\fBTcl_Format\fR and \fBTcl_AppendFormatToObj\fR may modify the interpreter
result, which involves changing the reference count of a value.
.SH "SEE ALSO"
Tcl_NewObj(3), Tcl_IncrRefCount(3), Tcl_DecrRefCount(3), format(n), sprintf(3)
.SH KEYWORDS
+7
View File
@@ -62,6 +62,13 @@ result of the whole substitution on \fIobjPtr\fR will be truncated at
the point immediately before the start of the command substitution,
and no characters will be added to the result or substitutions
performed after that point.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The \fIobjPtr\fR argument to \fBTcl_SubstObj\fR must not have a reference
count of zero. This function modifies the interpreter result, both on success
and on failure; the result of this function on success is exactly the current
interpreter result. Successful results should have their reference count
incremented if they are to be retained.
.SH "SEE ALSO"
subst(n)
.SH KEYWORDS
+25
View File
@@ -262,6 +262,31 @@ file named by the \fBfilename\fR field was modified. Suitable for use with
.
The type of the uncompressed data (either \fBbinary\fR or \fBtext\fR) if
known.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_ZlibDeflate\fR and \fBTcl_ZlibInflate\fR take a value with arbitrary
reference count for their \fIdataObj\fR and \fIdictObj\fR arguments (the
latter often being NULL instead), and set the interpreter result with their
output value (or an error). The existing interpreter result should not be
passed as any argument value unless an additional reference is held.
.PP
\fBTcl_ZlibStreamInit\fR takes a value with arbitrary reference count for its
\fIdictObj\fR argument; it only reads from it. The existing interpreter result
should not be passed unless an additional reference is held.
.PP
\fBTcl_ZlibStreamGetCommandName\fR returns a zero reference count value, much
like \fBTcl_NewObj\fR.
.PP
The \fIdataObj\fR argument to \fBTcl_ZlibStreamPut\fR is a value with
arbitrary reference count; it is only ever read from.
.PP
The \fIdataObj\fR argument to \fBTcl_ZlibStreamGet\fR is an unshared value
(see \fBTcl_IsShared\fR) that will be updated by the function.
.PP
The \fIcompDict\fR argument to \fBTcl_ZlibStreamSetCompressionDictionary\fR,
if non-NULL, may be duplicated or may have its reference count incremented.
Using a zero reference count value is not recommended.
.SH "PORTABILITY NOTES"
These functions will fail gracefully if Tcl is not linked with the zlib
library.
+9
View File
@@ -201,6 +201,15 @@ procedure (if any) returns, \fBTcl_Main\fR will also evaluate
the \fBexit\fR command.
.PP
\fBTcl_Main\fR can not be used in stub-enabled extensions.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
\fBTcl_SetStartupScript\fR takes a value (or NULL) for its \fIpath\fR
argument, and will increment the reference count of it.
.PP
\fBTcl_GetStartupScript\fR returns a value with reference count at least 1, or
NULL. It's \fIencodingPtr\fR is also used (if non-NULL) to return a value with
a reference count at least 1, or NULL. In both cases, the owner of the values
is the current thread.
.SH "SEE ALSO"
tclsh(1), Tcl_GetStdChannel(3), Tcl_StandardChannels(3), Tcl_AppInit(3),
exit(n), encoding(n)
+8
View File
@@ -359,6 +359,14 @@ Traces on a variable are always removed whenever the variable
is deleted; the only time \fBTCL_TRACE_DESTROYED\fR is not set is for
a whole-array trace invoked when only a single element of an
array is unset.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
When a \fIproc\fR callback is invoked, and that callback was installed with
the \fBTCL_TRACE_RESULT_OBJECT\fR flag, the result of the callback is a
Tcl_Obj reference when there is an error. The result will have its reference
count decremented once when no longer needed, or may have additional
references made to it (e.g., by setting it as the interpreter result with
\fBTcl_SetObjResult\fR).
.SH BUGS
.PP
Array traces are not yet integrated with the Tcl \fBinfo exists\fR command,
+7 -1
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_UniCharIsAlnum, Tcl_UniCharIsAlpha, Tcl_UniCharIsControl, Tcl_UniCharIsDigit, Tcl_UniCharIsGraph, Tcl_UniCharIsLower, Tcl_UniCharIsPrint, Tcl_UniCharIsPunct, Tcl_UniCharIsSpace, Tcl_UniCharIsUpper, Tcl_UniCharIsWordChar \- routines for classification of Tcl_UniChar characters
Tcl_UniCharIsAlnum, Tcl_UniCharIsAlpha, Tcl_UniCharIsControl, Tcl_UniCharIsDigit, Tcl_UniCharIsGraph, Tcl_UniCharIsLower, Tcl_UniCharIsPrint, Tcl_UniCharIsPunct, Tcl_UniCharIsSpace, Tcl_UniCharIsUpper, Tcl_UniCharIsUnicode, Tcl_UniCharIsWordChar \- routines for classification of Tcl_UniChar characters
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -44,6 +44,9 @@ int
\fBTcl_UniCharIsUpper\fR(\fIch\fR)
.sp
int
\fBTcl_UniCharIsUnicode\fR(\fIch\fR)
.sp
int
\fBTcl_UniCharIsWordChar\fR(\fIch\fR)
.SH ARGUMENTS
.AS int ch
@@ -81,6 +84,9 @@ with the various routines.
.PP
\fBTcl_UniCharIsUpper\fR tests if the character is an uppercase Unicode character.
.PP
\fBTcl_UniCharIsUnicode\fR tests if the character is a Unicode character, not being
a surrogate or noncharacter.
.PP
\fBTcl_UniCharIsWordChar\fR tests if the character is alphanumeric or
a connector punctuation mark.
+6
View File
@@ -73,6 +73,12 @@ is now an \fIindexObject\fR because it was passed to
.CS
wrong # args: should be "foo barfly fileName count"
.CE
.SH "REFERENCE COUNT MANAGEMENT"
.PP
The \fIobjv\fR argument to \fBTcl_WrongNumArgs\fR should be the exact
arguments passed to the command or method implementation function that is
calling \fBTcl_WrongNumArgs\fR. As such, all values referenced in it should
have reference counts greater than zero; this is usually a non-issue.
.SH "SEE ALSO"
Tcl_GetIndexFromObj(3)
.SH KEYWORDS
+3 -1
View File
@@ -81,7 +81,9 @@ RFC 2045 calls for base64 decoders to be non-strict.
\fBhex\fR
.
The \fBhex\fR binary encoding converts each byte to a pair of hexadecimal
digits in big-endian form.
digits that represent the byte value as a hexadecimal integer.
When encoding, lower characters are used.
When decoding, upper and lower characters are accepted.
.RS
.PP
No options are supported during encoding. During decoding, the following
+420 -594
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -823,7 +823,7 @@ the minus sign one west of Greenwich.
A time zone string conforming to the Posix specification of the \fBTZ\fR
environment variable will be recognized. The specification
may be found at
\fIhttp://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html\fR.
\fIhttps://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html\fR.
.PP
If the Posix time zone string contains a DST (Daylight Savings Time)
part, but doesn't contain a rule stating when DST starts or ends,
@@ -847,7 +847,7 @@ to use it as a location name, as above.
.SH "LOCALIZATION"
.PP
Developers wishing to localize the date and time formatting and parsing
are referred to \fIhttp://tip.tcl.tk/173\fR for a
are referred to \fIhttps://tip.tcl-lang.org/173\fR for a
specification.
.SH "FREE FORM SCAN"
.PP
+2 -2
View File
@@ -182,7 +182,7 @@ set cookiedb ~/.tclcookies.db
http::configure -cookiejar [\fBhttp::cookiejar new\fR $cookiedb]
# No further explicit steps are required to use cookies
set tok [http::geturl http://core.tcl.tk/]
set tok [http::geturl http://core.tcl-lang.org/]
.CE
.PP
To only allow a particular domain to use cookies, perhaps because you only
@@ -205,7 +205,7 @@ set cookiedb ~/.tclcookies.db
http::configure -cookiejar [MyCookieJar new $cookiedb]
# No further explicit steps are required to use cookies
set tok [http::geturl http://core.tcl.tk/]
set tok [http::geturl http://core.tcl-lang.org/]
.CE
.SH "SEE ALSO"
http(n), oo::class(n), sqlite3(n)
+1 -1
View File
@@ -172,7 +172,7 @@ particularly important website:
.PP
.CS
package require dde
\fBdde execute\fR -async iexplore WWW_OpenURL http://www.tcl.tk/
\fBdde execute\fR -async iexplore WWW_OpenURL http://www.tcl-lang.org/
.CE
.SH "SEE ALSO"
tk(n), winfo(n), send(n)
+2 -18
View File
@@ -81,29 +81,13 @@ omitted then the command returns the current system encoding. The
system encoding is used whenever Tcl passes strings to system calls.
.SH EXAMPLE
.PP
It is common practice to write script files using a text editor that
produces output in the euc-jp encoding, which represents the ASCII
characters as singe bytes and Japanese characters as two bytes. This
makes it easy to embed literal strings that correspond to non-ASCII
characters by simply typing the strings in place in the script.
However, because the \fBsource\fR command always reads files using the
current system encoding, Tcl will only source such files correctly
when the encoding used to write the file is the same. This tends not
to be true in an internationalized setting. For example, if such a
file was sourced in North America (where the ISO8859\-1 is normally
used), each byte in the file would be treated as a separate character
that maps to the 00 page in Unicode. The resulting Tcl strings will
not contain the expected Japanese characters. Instead, they will
contain a sequence of Latin-1 characters that correspond to the bytes
of the original string. The \fBencoding\fR command can be used to
convert this string to the expected Japanese Unicode characters. For
example,
The following example converts a byte sequence in Japanese euc-jp encoding to a TCL string:
.PP
.CS
set s [\fBencoding convertfrom\fR euc-jp "\exA4\exCF"]
.CE
.PP
would return the Unicode string
The result is the unicode codepoint:
.QW "\eu306F" ,
which is the Hiragana letter HA.
.SH "SEE ALSO"
+71 -70
View File
@@ -17,7 +17,7 @@ expr \- Evaluate an expression
.BE
.SH DESCRIPTION
.PP
The \fIexpr\fR command concatenates \fIarg\fRs, separated by a space, into an expression, and evaluates
Concatenates \fIarg\fRs, separated by a space, into an expression, and evaluates
that expression, returning its value.
The operators permitted in an expression include a subset of
the operators permitted in C expressions. For those operators
@@ -37,45 +37,88 @@ operands are specified. Expressions also support
non-numeric operands, string comparisons, and some
additional operators not found in C.
.PP
When an expression evaluates to an integer, the value is the decimal form of
the integer, and when an expression evaluates to a floating-point number, the
value is the form produced by the \fB%g\fR format specifier of Tcl's
\fBformat\fR command.
When the result of expression is an integer, it is in decimal form, and when
the result is a floating-point number, it is in the form produced by the
\fB%g\fR format specifier of \fBformat\fR.
.PP
.VS "TIP 582"
You can use \fB#\fR at any point in the expression (except inside double
quotes or braces) to start a comment. Comments last to the end of the line or
At any point in the expression except within double quotes or braces, \fB#\fR
is the beginning of a comment, which lasts to the end of the line or
the end of the expression, whichever comes first.
.VE "TIP 582"
.SS OPERANDS
.PP
An expression consists of a combination of operands, operators, parentheses and
commas, possibly with whitespace between any of these elements, which is
ignored.
ignored. Each operand is intepreted as a numeric value if at all possible.
.PP
An operand may be specified in any of the following ways:
.IP [1]
As a numeric value, either integer or floating-point.
.IP [2]
As a boolean value, using any form understood by \fBstring is\fR
Each operand has one of the following forms:
.RS
.PP
.TP
A \fBnumeric value\fR
.PP
.RS
.
Either integer or floating-point. The first two characters of an integer may
also be \fB0d\fR for decimal, \fB0b\fR for binary, \fB0o\fR for octal or
\fB0x\fR for hexadicimal. For compatibility with older Tcl releases, an
operand that begins with \fB0\fR is interpreted as an octal integer even if the
second character is not \fBo\fR.
.PP
A floating-point number may be take any of several
common decimal formats, and may use the decimal point \fB.\fR,
\fBe\fR or \fBE\fR for scientific notation, and
the sign characters \fB+\fR and \fB\-\fR. The
following are all valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16.
The strings \fBInf\fR
and \fBNaN\fR, in any combination of case, are also recognized as floating point
values. An operand that doesn't have a numeric interpretation must be quoted
with either braces or with double quotes.
.PP
Digits in any numeric value may be separated with one or more underscore
characters, "\fB_\fR". A separator may only
appear between digits, not appear at the start of a
numeric value, between the leading 0 and radix specifier, or at the
end of a numeric value. Here are some examples:
.PP
.CS
.ta 9c
\fBexpr\fR 100_000_000 \fI100000000\fR
\fBexpr\fR 0xffff_ffff \fI4294967295\fR
\fBformat\fR 0x%x 0b1111_1110_1101_1011 \fI0xfedb\fR
.CE
.RE
.TP
A \fBboolean value\fR
.
Using any form understood by \fBstring is\fR
\fBboolean\fR.
.IP [3]
As a variable, using standard \fB$\fR notation.
The value of the variable is then the value of the operand.
.IP [4]
As a string enclosed in double-quotes.
Backslash, variable, and command substitution are performed as described in
.TP
A \fBvariable\fR
.
Using standard \fB$\fR notation.
The value of the variable is the value of the operand.
.TP
A string enclosed in \fBdouble-quotes\fR
.
Backslash, variable, and command substitution are performed according to the
rules for \fBTcl\fR.
.TP
A string enclosed in \fBbraces\fR.
The operand is treated as a braced value according to the rule for braces in
\fBTcl\fR.
.IP [5]
As a string enclosed in braces.
The operand is treated as a braced value as described in \fBTcl\fR.
.IP [6]
As a Tcl command enclosed in brackets.
Command substitution is performed as described in \fBTcl\fR.
.IP [7]
As a mathematical function such as \fBsin($x)\fR, whose arguments have any of the above
.TP
A Tcl command enclosed in \fBbrackets\fR
.
Command substitution is performed as according to the command substitution rule
for \fBTcl\fR.
.TP
A mathematical function such as \fBsin($x)\fR, whose arguments have any of the above
forms for operands. See \fBMATH FUNCTIONS\fR below for
a discussion of how mathematical functions are handled.
.RE
.PP
Because \fBexpr\fR parses and performs substitutions on values that have
already been parsed and substituted by \fBTcl\fR, it is usually best to enclose
@@ -90,52 +133,10 @@ produces the value on the right side.
.ta 9c
\fBexpr\fR {3.1 + $a} \fI6.1\fR
\fBexpr\fR {2 + "$a.$b"} \fI5.6\fR
\fBexpr\fR {4*[llength "6 2"]} \fI8\fR
\fBexpr\fR {4*[llength {6 2}]} \fI8\fR
\fBexpr\fR {{word one} < "word $a"} \fI0\fR
.CE
.PP
\fBInteger value\fR
.PP
An integer operand may be specified in decimal (the normal case, the optional
first two characters are \fB0d\fR), binary
(the first two characters are \fB0b\fR), octal
(the first two characters are \fB0o\fR), or hexadecimal
(the first two characters are \fB0x\fR) form. For
compatibility with older Tcl releases, an operand that begins with \fB0\fR is
interpreted as an octal integer even if the second character is not \fBo\fR.
.PP
\fBFloating-point value\fR
.PP
A floating-point number may be specified in any of several
common decimal formats, and may use the decimal point \fB.\fR,
\fBe\fR or \fBE\fR for scientific notation, and
the sign characters \fB+\fR and \fB\-\fR. The
following are all valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16.
The strings \fBInf\fR
and \fBNaN\fR, in any combination of case, are also recognized as floating point
values. An operand that doesn't have a numeric interpretation must be quoted
with either braces or with double quotes.
.PP
\fBBoolean value\fR
.PP
A boolean value may be represented by any of the values \fB0\fR, \fBfalse\fR, \fBno\fR,
or \fBoff\fR and any of the values \fB1\fR, \fBtrue\fR, \fByes\fR, or \fBon\fR.
.PP
\fBDigit Separator\fR
.PP
Digits in any numeric value may be separated with one or more underscore
characters, "\fB_\fR", to improve readability. These separators may only
appear between digits. The separator may not appear at the start of a
numeric value, between the leading 0 and radix specifier, or at the
end of a numeric value. Here are some examples:
.PP
.CS
.ta 9c
\fBexpr\fR 100_000_000 \fI100000000\fR
\fBexpr\fR 0xffff_ffff \fI4294967295\fR
\fBformat\fR 0x%x 0b1111_1110_1101_1011 \fI0xfedb\fR
.CE
.PP
.SS OPERATORS
.PP
For operators having both a numeric mode and a string mode, the numeric mode is
+2 -2
View File
@@ -6,14 +6,14 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH "http" n 2.9 http "Tcl Bundled Packages"
.TH "http" n 2.10 http "Tcl Bundled Packages"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
http \- Client-side implementation of the HTTP/1.1 protocol
.SH SYNOPSIS
\fBpackage require http\fI ?\fB2.9\fR?
\fBpackage require http\fI ?\fB2.10\fR?
.\" See Also -useragent option documentation in body!
.sp
\fB::http::config\fR ?\fI\-option value\fR ...?
+2 -2
View File
@@ -735,7 +735,7 @@ To register to a callback, use:
namespace eval gui {
msgcat::mcpackageconfig changecmd updateGUI
proc updateGui args {
proc updateGUI args {
puts "New locale is '[lindex $args 0]'."
}
}
@@ -769,7 +769,7 @@ msgcat::mcpackageconfig unknowncmd ""
.CE
As an example, the user requires the week day in a certain locale as follows:
.CS
clock format clock seconds -format %A -locale fr
clock format [clock seconds] -format %A -locale fr
.CE
\fBclock\fR sets the package locale to \fBfr\fR and looks for the day name as follows:
.CS
+8 -7
View File
@@ -319,9 +319,10 @@ specified as for the \fBindex\fR method. If \fInewstring\fR is
specified, then it is placed in the removed character range. If
\fIfirst\fR is less than zero then it is treated as if it were zero,
and if \fIlast\fR is greater than or equal to the length of the string
then it is treated as if it were \fBend\fR. If \fIfirst\fR is greater
than \fIlast\fR or the length of the initial string, or \fIlast\fR is
less than 0, then the initial string is returned untouched.
then it is treated as if it were \fBend\fR. The initial string is
returned untouched, if \fIfirst\fR is greater than \fIlast\fR, or if
\fIfirst\fR is equal to or greater than the length of the initial string,
or \fIlast\fR is less than 0.
.TP
\fBstring reverse \fIstring\fR
.
@@ -413,10 +414,10 @@ store the representation is of very low value (except to C extension
code, which has direct access for the purpose of memory management,
etc.)
.PP
\fICompatibility note:\fR it is likely that this subcommand will be
withdrawn in a future version of Tcl. It is better to use the
\fBencoding convertto\fR command to convert a string to a known
encoding and then apply \fBstring length\fR to that.
\fICompatibility note:\fR This subcommand is deprecated and will
be removed in Tcl 9.0. It is better to use the \fBencoding convertto\fR
command to convert a string to a known encoding (e.g. "utf-8" or "cesu-8")
and then apply \fBstring length\fR to that.
.PP
.CS
\fBstring length\fR [encoding convertto utf-8 $theString]
+2 -2
View File
@@ -298,9 +298,9 @@ environment variables:
.SH "SEE ALSO"
package(n), Tcl Improvement Proposal #189
.QW "\fITcl Modules\fR"
(online at http://tip.tcl.tk/189.html), Tcl Improvement Proposal #190
(online at https://tip.tcl-lang.org/189.html), Tcl Improvement Proposal #190
.QW "\fIImplementation Choices for Tcl Modules\fR"
(online at http://tip.tcl.tk/190.html)
(online at https://tip.tcl-lang.org/190.html)
.SH "KEYWORDS"
modules, package
.\" Local Variables:
+1 -1
View File
@@ -87,7 +87,7 @@ Handle different reasons for a file to not be openable for reading:
.PP
.CS
\fBtry\fR {
set f [open /some/file/name w]
set f [open /some/file/name r]
} \fBtrap\fR {POSIX EISDIR} {} {
puts "failed to open /some/file/name: it's a directory"
} \fBtrap\fR {POSIX ENOENT} {} {
+6 -6
View File
@@ -13,7 +13,7 @@
TclZipfs_AppHook, Tclzipfs_Mount, TclZipfs_MountBuffer, Tclzipfs_Unmount \- handle ZIP files as Tcl virtual filesystems
.SH SYNOPSIS
.nf
int
const char *
\fBTclZipfs_AppHook(\fIargcPtr, argvPtr\fR)
.sp
int
@@ -87,11 +87,11 @@ it uses WCHAR instead of char. As a result, it requires your application to
be compiled with the UNICODE preprocessor symbol defined (e.g., via the
\fB-DUNICODE\fR compiler flag).
.PP
The result of \fBTclZipfs_AppHook\fR is a Tcl result code (e.g., \fBTCL_OK\fR
when the function is successful). The function \fImay\fR modify the variables
pointed to by \fIargcPtr\fR and \fIargvPtr\fR to remove arguments; the
current implementation does not do so, but callers \fIshould not\fR assume
that this will be true in the future.
The result of \fBTclZipfs_AppHook\fR is the full Tcl version (e.g.,
\fB8.7.0+abcdef...abcdef.gcc-1002.utf16\fR).
The function \fImay\fR modify the variables pointed to by \fIargcPtr\fR and
\fIargvPtr\fR to remove arguments; the current implementation does not do so,
but callers \fIshould not\fR assume that this will be true in the future.
.PP
\fBTclzipfs_Mount\fR mounts the ZIP archive \fIzipname\fR on the mount point
given in \fImountpoint\fR using the optional ZIP password \fIpassword\fR.
+319 -304
View File
@@ -140,34 +140,34 @@ static const crange alphaRangeTable[] = {
{0x3F7, 0x481}, {0x48A, 0x52F}, {0x531, 0x556}, {0x560, 0x588},
{0x5D0, 0x5EA}, {0x5EF, 0x5F2}, {0x620, 0x64A}, {0x671, 0x6D3},
{0x6FA, 0x6FC}, {0x712, 0x72F}, {0x74D, 0x7A5}, {0x7CA, 0x7EA},
{0x800, 0x815}, {0x840, 0x858}, {0x860, 0x86A}, {0x8A0, 0x8B4},
{0x8B6, 0x8C7}, {0x904, 0x939}, {0x958, 0x961}, {0x971, 0x980},
{0x985, 0x98C}, {0x993, 0x9A8}, {0x9AA, 0x9B0}, {0x9B6, 0x9B9},
{0x9DF, 0x9E1}, {0xA05, 0xA0A}, {0xA13, 0xA28}, {0xA2A, 0xA30},
{0xA59, 0xA5C}, {0xA72, 0xA74}, {0xA85, 0xA8D}, {0xA8F, 0xA91},
{0xA93, 0xAA8}, {0xAAA, 0xAB0}, {0xAB5, 0xAB9}, {0xB05, 0xB0C},
{0xB13, 0xB28}, {0xB2A, 0xB30}, {0xB35, 0xB39}, {0xB5F, 0xB61},
{0xB85, 0xB8A}, {0xB8E, 0xB90}, {0xB92, 0xB95}, {0xBA8, 0xBAA},
{0xBAE, 0xBB9}, {0xC05, 0xC0C}, {0xC0E, 0xC10}, {0xC12, 0xC28},
{0xC2A, 0xC39}, {0xC58, 0xC5A}, {0xC85, 0xC8C}, {0xC8E, 0xC90},
{0xC92, 0xCA8}, {0xCAA, 0xCB3}, {0xCB5, 0xCB9}, {0xD04, 0xD0C},
{0xD0E, 0xD10}, {0xD12, 0xD3A}, {0xD54, 0xD56}, {0xD5F, 0xD61},
{0xD7A, 0xD7F}, {0xD85, 0xD96}, {0xD9A, 0xDB1}, {0xDB3, 0xDBB},
{0xDC0, 0xDC6}, {0xE01, 0xE30}, {0xE40, 0xE46}, {0xE86, 0xE8A},
{0xE8C, 0xEA3}, {0xEA7, 0xEB0}, {0xEC0, 0xEC4}, {0xEDC, 0xEDF},
{0xF40, 0xF47}, {0xF49, 0xF6C}, {0xF88, 0xF8C}, {0x1000, 0x102A},
{0x1050, 0x1055}, {0x105A, 0x105D}, {0x106E, 0x1070}, {0x1075, 0x1081},
{0x10A0, 0x10C5}, {0x10D0, 0x10FA}, {0x10FC, 0x1248}, {0x124A, 0x124D},
{0x1250, 0x1256}, {0x125A, 0x125D}, {0x1260, 0x1288}, {0x128A, 0x128D},
{0x1290, 0x12B0}, {0x12B2, 0x12B5}, {0x12B8, 0x12BE}, {0x12C2, 0x12C5},
{0x12C8, 0x12D6}, {0x12D8, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x135A},
{0x1380, 0x138F}, {0x13A0, 0x13F5}, {0x13F8, 0x13FD}, {0x1401, 0x166C},
{0x166F, 0x167F}, {0x1681, 0x169A}, {0x16A0, 0x16EA}, {0x16F1, 0x16F8},
{0x1700, 0x170C}, {0x170E, 0x1711}, {0x1720, 0x1731}, {0x1740, 0x1751},
{0x800, 0x815}, {0x840, 0x858}, {0x860, 0x86A}, {0x870, 0x887},
{0x889, 0x88E}, {0x8A0, 0x8C9}, {0x904, 0x939}, {0x958, 0x961},
{0x971, 0x980}, {0x985, 0x98C}, {0x993, 0x9A8}, {0x9AA, 0x9B0},
{0x9B6, 0x9B9}, {0x9DF, 0x9E1}, {0xA05, 0xA0A}, {0xA13, 0xA28},
{0xA2A, 0xA30}, {0xA59, 0xA5C}, {0xA72, 0xA74}, {0xA85, 0xA8D},
{0xA8F, 0xA91}, {0xA93, 0xAA8}, {0xAAA, 0xAB0}, {0xAB5, 0xAB9},
{0xB05, 0xB0C}, {0xB13, 0xB28}, {0xB2A, 0xB30}, {0xB35, 0xB39},
{0xB5F, 0xB61}, {0xB85, 0xB8A}, {0xB8E, 0xB90}, {0xB92, 0xB95},
{0xBA8, 0xBAA}, {0xBAE, 0xBB9}, {0xC05, 0xC0C}, {0xC0E, 0xC10},
{0xC12, 0xC28}, {0xC2A, 0xC39}, {0xC58, 0xC5A}, {0xC85, 0xC8C},
{0xC8E, 0xC90}, {0xC92, 0xCA8}, {0xCAA, 0xCB3}, {0xCB5, 0xCB9},
{0xD04, 0xD0C}, {0xD0E, 0xD10}, {0xD12, 0xD3A}, {0xD54, 0xD56},
{0xD5F, 0xD61}, {0xD7A, 0xD7F}, {0xD85, 0xD96}, {0xD9A, 0xDB1},
{0xDB3, 0xDBB}, {0xDC0, 0xDC6}, {0xE01, 0xE30}, {0xE40, 0xE46},
{0xE86, 0xE8A}, {0xE8C, 0xEA3}, {0xEA7, 0xEB0}, {0xEC0, 0xEC4},
{0xEDC, 0xEDF}, {0xF40, 0xF47}, {0xF49, 0xF6C}, {0xF88, 0xF8C},
{0x1000, 0x102A}, {0x1050, 0x1055}, {0x105A, 0x105D}, {0x106E, 0x1070},
{0x1075, 0x1081}, {0x10A0, 0x10C5}, {0x10D0, 0x10FA}, {0x10FC, 0x1248},
{0x124A, 0x124D}, {0x1250, 0x1256}, {0x125A, 0x125D}, {0x1260, 0x1288},
{0x128A, 0x128D}, {0x1290, 0x12B0}, {0x12B2, 0x12B5}, {0x12B8, 0x12BE},
{0x12C2, 0x12C5}, {0x12C8, 0x12D6}, {0x12D8, 0x1310}, {0x1312, 0x1315},
{0x1318, 0x135A}, {0x1380, 0x138F}, {0x13A0, 0x13F5}, {0x13F8, 0x13FD},
{0x1401, 0x166C}, {0x166F, 0x167F}, {0x1681, 0x169A}, {0x16A0, 0x16EA},
{0x16F1, 0x16F8}, {0x1700, 0x1711}, {0x171F, 0x1731}, {0x1740, 0x1751},
{0x1760, 0x176C}, {0x176E, 0x1770}, {0x1780, 0x17B3}, {0x1820, 0x1878},
{0x1880, 0x1884}, {0x1887, 0x18A8}, {0x18B0, 0x18F5}, {0x1900, 0x191E},
{0x1950, 0x196D}, {0x1970, 0x1974}, {0x1980, 0x19AB}, {0x19B0, 0x19C9},
{0x1A00, 0x1A16}, {0x1A20, 0x1A54}, {0x1B05, 0x1B33}, {0x1B45, 0x1B4B},
{0x1A00, 0x1A16}, {0x1A20, 0x1A54}, {0x1B05, 0x1B33}, {0x1B45, 0x1B4C},
{0x1B83, 0x1BA0}, {0x1BBA, 0x1BE5}, {0x1C00, 0x1C23}, {0x1C4D, 0x1C4F},
{0x1C5A, 0x1C7D}, {0x1C80, 0x1C88}, {0x1C90, 0x1CBA}, {0x1CBD, 0x1CBF},
{0x1CE9, 0x1CEC}, {0x1CEE, 0x1CF3}, {0x1D00, 0x1DBF}, {0x1E00, 0x1F15},
@@ -176,74 +176,78 @@ static const crange alphaRangeTable[] = {
{0x1FC6, 0x1FCC}, {0x1FD0, 0x1FD3}, {0x1FD6, 0x1FDB}, {0x1FE0, 0x1FEC},
{0x1FF2, 0x1FF4}, {0x1FF6, 0x1FFC}, {0x2090, 0x209C}, {0x210A, 0x2113},
{0x2119, 0x211D}, {0x212A, 0x212D}, {0x212F, 0x2139}, {0x213C, 0x213F},
{0x2145, 0x2149}, {0x2C00, 0x2C2E}, {0x2C30, 0x2C5E}, {0x2C60, 0x2CE4},
{0x2CEB, 0x2CEE}, {0x2D00, 0x2D25}, {0x2D30, 0x2D67}, {0x2D80, 0x2D96},
{0x2DA0, 0x2DA6}, {0x2DA8, 0x2DAE}, {0x2DB0, 0x2DB6}, {0x2DB8, 0x2DBE},
{0x2DC0, 0x2DC6}, {0x2DC8, 0x2DCE}, {0x2DD0, 0x2DD6}, {0x2DD8, 0x2DDE},
{0x3031, 0x3035}, {0x3041, 0x3096}, {0x309D, 0x309F}, {0x30A1, 0x30FA},
{0x30FC, 0x30FF}, {0x3105, 0x312F}, {0x3131, 0x318E}, {0x31A0, 0x31BF},
{0x31F0, 0x31FF}, {0x3400, 0x4DBF}, {0x4E00, 0x9FFC}, {0xA000, 0xA48C},
{0xA4D0, 0xA4FD}, {0xA500, 0xA60C}, {0xA610, 0xA61F}, {0xA640, 0xA66E},
{0xA67F, 0xA69D}, {0xA6A0, 0xA6E5}, {0xA717, 0xA71F}, {0xA722, 0xA788},
{0xA78B, 0xA7BF}, {0xA7C2, 0xA7CA}, {0xA7F5, 0xA801}, {0xA803, 0xA805},
{0xA807, 0xA80A}, {0xA80C, 0xA822}, {0xA840, 0xA873}, {0xA882, 0xA8B3},
{0xA8F2, 0xA8F7}, {0xA90A, 0xA925}, {0xA930, 0xA946}, {0xA960, 0xA97C},
{0xA984, 0xA9B2}, {0xA9E0, 0xA9E4}, {0xA9E6, 0xA9EF}, {0xA9FA, 0xA9FE},
{0xAA00, 0xAA28}, {0xAA40, 0xAA42}, {0xAA44, 0xAA4B}, {0xAA60, 0xAA76},
{0xAA7E, 0xAAAF}, {0xAAB9, 0xAABD}, {0xAADB, 0xAADD}, {0xAAE0, 0xAAEA},
{0xAAF2, 0xAAF4}, {0xAB01, 0xAB06}, {0xAB09, 0xAB0E}, {0xAB11, 0xAB16},
{0xAB20, 0xAB26}, {0xAB28, 0xAB2E}, {0xAB30, 0xAB5A}, {0xAB5C, 0xAB69},
{0xAB70, 0xABE2}, {0xAC00, 0xD7A3}, {0xD7B0, 0xD7C6}, {0xD7CB, 0xD7FB},
{0xF900, 0xFA6D}, {0xFA70, 0xFAD9}, {0xFB00, 0xFB06}, {0xFB13, 0xFB17},
{0xFB1F, 0xFB28}, {0xFB2A, 0xFB36}, {0xFB38, 0xFB3C}, {0xFB46, 0xFBB1},
{0xFBD3, 0xFD3D}, {0xFD50, 0xFD8F}, {0xFD92, 0xFDC7}, {0xFDF0, 0xFDFB},
{0xFE70, 0xFE74}, {0xFE76, 0xFEFC}, {0xFF21, 0xFF3A}, {0xFF41, 0xFF5A},
{0xFF66, 0xFFBE}, {0xFFC2, 0xFFC7}, {0xFFCA, 0xFFCF}, {0xFFD2, 0xFFD7},
{0xFFDA, 0xFFDC}
{0x2145, 0x2149}, {0x2C00, 0x2CE4}, {0x2CEB, 0x2CEE}, {0x2D00, 0x2D25},
{0x2D30, 0x2D67}, {0x2D80, 0x2D96}, {0x2DA0, 0x2DA6}, {0x2DA8, 0x2DAE},
{0x2DB0, 0x2DB6}, {0x2DB8, 0x2DBE}, {0x2DC0, 0x2DC6}, {0x2DC8, 0x2DCE},
{0x2DD0, 0x2DD6}, {0x2DD8, 0x2DDE}, {0x3031, 0x3035}, {0x3041, 0x3096},
{0x309D, 0x309F}, {0x30A1, 0x30FA}, {0x30FC, 0x30FF}, {0x3105, 0x312F},
{0x3131, 0x318E}, {0x31A0, 0x31BF}, {0x31F0, 0x31FF}, {0x3400, 0x4DBF},
{0x4E00, 0xA48C}, {0xA4D0, 0xA4FD}, {0xA500, 0xA60C}, {0xA610, 0xA61F},
{0xA640, 0xA66E}, {0xA67F, 0xA69D}, {0xA6A0, 0xA6E5}, {0xA717, 0xA71F},
{0xA722, 0xA788}, {0xA78B, 0xA7CA}, {0xA7D5, 0xA7D9}, {0xA7F2, 0xA801},
{0xA803, 0xA805}, {0xA807, 0xA80A}, {0xA80C, 0xA822}, {0xA840, 0xA873},
{0xA882, 0xA8B3}, {0xA8F2, 0xA8F7}, {0xA90A, 0xA925}, {0xA930, 0xA946},
{0xA960, 0xA97C}, {0xA984, 0xA9B2}, {0xA9E0, 0xA9E4}, {0xA9E6, 0xA9EF},
{0xA9FA, 0xA9FE}, {0xAA00, 0xAA28}, {0xAA40, 0xAA42}, {0xAA44, 0xAA4B},
{0xAA60, 0xAA76}, {0xAA7E, 0xAAAF}, {0xAAB9, 0xAABD}, {0xAADB, 0xAADD},
{0xAAE0, 0xAAEA}, {0xAAF2, 0xAAF4}, {0xAB01, 0xAB06}, {0xAB09, 0xAB0E},
{0xAB11, 0xAB16}, {0xAB20, 0xAB26}, {0xAB28, 0xAB2E}, {0xAB30, 0xAB5A},
{0xAB5C, 0xAB69}, {0xAB70, 0xABE2}, {0xAC00, 0xD7A3}, {0xD7B0, 0xD7C6},
{0xD7CB, 0xD7FB}, {0xF900, 0xFA6D}, {0xFA70, 0xFAD9}, {0xFB00, 0xFB06},
{0xFB13, 0xFB17}, {0xFB1F, 0xFB28}, {0xFB2A, 0xFB36}, {0xFB38, 0xFB3C},
{0xFB46, 0xFBB1}, {0xFBD3, 0xFD3D}, {0xFD50, 0xFD8F}, {0xFD92, 0xFDC7},
{0xFDF0, 0xFDFB}, {0xFE70, 0xFE74}, {0xFE76, 0xFEFC}, {0xFF21, 0xFF3A},
{0xFF41, 0xFF5A}, {0xFF66, 0xFFBE}, {0xFFC2, 0xFFC7}, {0xFFCA, 0xFFCF},
{0xFFD2, 0xFFD7}, {0xFFDA, 0xFFDC}
#if CHRBITS > 16
,{0x10000, 0x1000B}, {0x1000D, 0x10026}, {0x10028, 0x1003A}, {0x1003F, 0x1004D},
{0x10050, 0x1005D}, {0x10080, 0x100FA}, {0x10280, 0x1029C}, {0x102A0, 0x102D0},
{0x10300, 0x1031F}, {0x1032D, 0x10340}, {0x10342, 0x10349}, {0x10350, 0x10375},
{0x10380, 0x1039D}, {0x103A0, 0x103C3}, {0x103C8, 0x103CF}, {0x10400, 0x1049D},
{0x104B0, 0x104D3}, {0x104D8, 0x104FB}, {0x10500, 0x10527}, {0x10530, 0x10563},
{0x10600, 0x10736}, {0x10740, 0x10755}, {0x10760, 0x10767}, {0x10800, 0x10805},
{0x1080A, 0x10835}, {0x1083F, 0x10855}, {0x10860, 0x10876}, {0x10880, 0x1089E},
{0x108E0, 0x108F2}, {0x10900, 0x10915}, {0x10920, 0x10939}, {0x10980, 0x109B7},
{0x10A10, 0x10A13}, {0x10A15, 0x10A17}, {0x10A19, 0x10A35}, {0x10A60, 0x10A7C},
{0x10A80, 0x10A9C}, {0x10AC0, 0x10AC7}, {0x10AC9, 0x10AE4}, {0x10B00, 0x10B35},
{0x10B40, 0x10B55}, {0x10B60, 0x10B72}, {0x10B80, 0x10B91}, {0x10C00, 0x10C48},
{0x10C80, 0x10CB2}, {0x10CC0, 0x10CF2}, {0x10D00, 0x10D23}, {0x10E80, 0x10EA9},
{0x10F00, 0x10F1C}, {0x10F30, 0x10F45}, {0x10FB0, 0x10FC4}, {0x10FE0, 0x10FF6},
{0x11003, 0x11037}, {0x11083, 0x110AF}, {0x110D0, 0x110E8}, {0x11103, 0x11126},
{0x11150, 0x11172}, {0x11183, 0x111B2}, {0x111C1, 0x111C4}, {0x11200, 0x11211},
{0x11213, 0x1122B}, {0x11280, 0x11286}, {0x1128A, 0x1128D}, {0x1128F, 0x1129D},
{0x1129F, 0x112A8}, {0x112B0, 0x112DE}, {0x11305, 0x1130C}, {0x11313, 0x11328},
{0x1132A, 0x11330}, {0x11335, 0x11339}, {0x1135D, 0x11361}, {0x11400, 0x11434},
{0x11447, 0x1144A}, {0x1145F, 0x11461}, {0x11480, 0x114AF}, {0x11580, 0x115AE},
{0x115D8, 0x115DB}, {0x11600, 0x1162F}, {0x11680, 0x116AA}, {0x11700, 0x1171A},
{0x11800, 0x1182B}, {0x118A0, 0x118DF}, {0x118FF, 0x11906}, {0x1190C, 0x11913},
{0x11918, 0x1192F}, {0x119A0, 0x119A7}, {0x119AA, 0x119D0}, {0x11A0B, 0x11A32},
{0x11A5C, 0x11A89}, {0x11AC0, 0x11AF8}, {0x11C00, 0x11C08}, {0x11C0A, 0x11C2E},
{0x11C72, 0x11C8F}, {0x11D00, 0x11D06}, {0x11D0B, 0x11D30}, {0x11D60, 0x11D65},
{0x11D6A, 0x11D89}, {0x11EE0, 0x11EF2}, {0x12000, 0x12399}, {0x12480, 0x12543},
{0x10570, 0x1057A}, {0x1057C, 0x1058A}, {0x1058C, 0x10592}, {0x10597, 0x105A1},
{0x105A3, 0x105B1}, {0x105B3, 0x105B9}, {0x10600, 0x10736}, {0x10740, 0x10755},
{0x10760, 0x10767}, {0x10780, 0x10785}, {0x10787, 0x107B0}, {0x107B2, 0x107BA},
{0x10800, 0x10805}, {0x1080A, 0x10835}, {0x1083F, 0x10855}, {0x10860, 0x10876},
{0x10880, 0x1089E}, {0x108E0, 0x108F2}, {0x10900, 0x10915}, {0x10920, 0x10939},
{0x10980, 0x109B7}, {0x10A10, 0x10A13}, {0x10A15, 0x10A17}, {0x10A19, 0x10A35},
{0x10A60, 0x10A7C}, {0x10A80, 0x10A9C}, {0x10AC0, 0x10AC7}, {0x10AC9, 0x10AE4},
{0x10B00, 0x10B35}, {0x10B40, 0x10B55}, {0x10B60, 0x10B72}, {0x10B80, 0x10B91},
{0x10C00, 0x10C48}, {0x10C80, 0x10CB2}, {0x10CC0, 0x10CF2}, {0x10D00, 0x10D23},
{0x10E80, 0x10EA9}, {0x10F00, 0x10F1C}, {0x10F30, 0x10F45}, {0x10F70, 0x10F81},
{0x10FB0, 0x10FC4}, {0x10FE0, 0x10FF6}, {0x11003, 0x11037}, {0x11083, 0x110AF},
{0x110D0, 0x110E8}, {0x11103, 0x11126}, {0x11150, 0x11172}, {0x11183, 0x111B2},
{0x111C1, 0x111C4}, {0x11200, 0x11211}, {0x11213, 0x1122B}, {0x11280, 0x11286},
{0x1128A, 0x1128D}, {0x1128F, 0x1129D}, {0x1129F, 0x112A8}, {0x112B0, 0x112DE},
{0x11305, 0x1130C}, {0x11313, 0x11328}, {0x1132A, 0x11330}, {0x11335, 0x11339},
{0x1135D, 0x11361}, {0x11400, 0x11434}, {0x11447, 0x1144A}, {0x1145F, 0x11461},
{0x11480, 0x114AF}, {0x11580, 0x115AE}, {0x115D8, 0x115DB}, {0x11600, 0x1162F},
{0x11680, 0x116AA}, {0x11700, 0x1171A}, {0x11740, 0x11746}, {0x11800, 0x1182B},
{0x118A0, 0x118DF}, {0x118FF, 0x11906}, {0x1190C, 0x11913}, {0x11918, 0x1192F},
{0x119A0, 0x119A7}, {0x119AA, 0x119D0}, {0x11A0B, 0x11A32}, {0x11A5C, 0x11A89},
{0x11AB0, 0x11AF8}, {0x11C00, 0x11C08}, {0x11C0A, 0x11C2E}, {0x11C72, 0x11C8F},
{0x11D00, 0x11D06}, {0x11D0B, 0x11D30}, {0x11D60, 0x11D65}, {0x11D6A, 0x11D89},
{0x11EE0, 0x11EF2}, {0x12000, 0x12399}, {0x12480, 0x12543}, {0x12F90, 0x12FF0},
{0x13000, 0x1342E}, {0x14400, 0x14646}, {0x16800, 0x16A38}, {0x16A40, 0x16A5E},
{0x16AD0, 0x16AED}, {0x16B00, 0x16B2F}, {0x16B40, 0x16B43}, {0x16B63, 0x16B77},
{0x16B7D, 0x16B8F}, {0x16E40, 0x16E7F}, {0x16F00, 0x16F4A}, {0x16F93, 0x16F9F},
{0x17000, 0x187F7}, {0x18800, 0x18CD5}, {0x18D00, 0x18D08}, {0x1B000, 0x1B11E},
{0x1B150, 0x1B152}, {0x1B164, 0x1B167}, {0x1B170, 0x1B2FB}, {0x1BC00, 0x1BC6A},
{0x1BC70, 0x1BC7C}, {0x1BC80, 0x1BC88}, {0x1BC90, 0x1BC99}, {0x1D400, 0x1D454},
{0x1D456, 0x1D49C}, {0x1D4A9, 0x1D4AC}, {0x1D4AE, 0x1D4B9}, {0x1D4BD, 0x1D4C3},
{0x1D4C5, 0x1D505}, {0x1D507, 0x1D50A}, {0x1D50D, 0x1D514}, {0x1D516, 0x1D51C},
{0x1D51E, 0x1D539}, {0x1D53B, 0x1D53E}, {0x1D540, 0x1D544}, {0x1D54A, 0x1D550},
{0x1D552, 0x1D6A5}, {0x1D6A8, 0x1D6C0}, {0x1D6C2, 0x1D6DA}, {0x1D6DC, 0x1D6FA},
{0x1D6FC, 0x1D714}, {0x1D716, 0x1D734}, {0x1D736, 0x1D74E}, {0x1D750, 0x1D76E},
{0x1D770, 0x1D788}, {0x1D78A, 0x1D7A8}, {0x1D7AA, 0x1D7C2}, {0x1D7C4, 0x1D7CB},
{0x1E100, 0x1E12C}, {0x1E137, 0x1E13D}, {0x1E2C0, 0x1E2EB}, {0x1E800, 0x1E8C4},
{0x16A70, 0x16ABE}, {0x16AD0, 0x16AED}, {0x16B00, 0x16B2F}, {0x16B40, 0x16B43},
{0x16B63, 0x16B77}, {0x16B7D, 0x16B8F}, {0x16E40, 0x16E7F}, {0x16F00, 0x16F4A},
{0x16F93, 0x16F9F}, {0x17000, 0x187F7}, {0x18800, 0x18CD5}, {0x18D00, 0x18D08},
{0x1AFF0, 0x1AFF3}, {0x1AFF5, 0x1AFFB}, {0x1B000, 0x1B122}, {0x1B150, 0x1B152},
{0x1B164, 0x1B167}, {0x1B170, 0x1B2FB}, {0x1BC00, 0x1BC6A}, {0x1BC70, 0x1BC7C},
{0x1BC80, 0x1BC88}, {0x1BC90, 0x1BC99}, {0x1D400, 0x1D454}, {0x1D456, 0x1D49C},
{0x1D4A9, 0x1D4AC}, {0x1D4AE, 0x1D4B9}, {0x1D4BD, 0x1D4C3}, {0x1D4C5, 0x1D505},
{0x1D507, 0x1D50A}, {0x1D50D, 0x1D514}, {0x1D516, 0x1D51C}, {0x1D51E, 0x1D539},
{0x1D53B, 0x1D53E}, {0x1D540, 0x1D544}, {0x1D54A, 0x1D550}, {0x1D552, 0x1D6A5},
{0x1D6A8, 0x1D6C0}, {0x1D6C2, 0x1D6DA}, {0x1D6DC, 0x1D6FA}, {0x1D6FC, 0x1D714},
{0x1D716, 0x1D734}, {0x1D736, 0x1D74E}, {0x1D750, 0x1D76E}, {0x1D770, 0x1D788},
{0x1D78A, 0x1D7A8}, {0x1D7AA, 0x1D7C2}, {0x1D7C4, 0x1D7CB}, {0x1DF00, 0x1DF1E},
{0x1E100, 0x1E12C}, {0x1E137, 0x1E13D}, {0x1E290, 0x1E2AD}, {0x1E2C0, 0x1E2EB},
{0x1E7E0, 0x1E7E6}, {0x1E7E8, 0x1E7EB}, {0x1E7F0, 0x1E7FE}, {0x1E800, 0x1E8C4},
{0x1E900, 0x1E943}, {0x1EE00, 0x1EE03}, {0x1EE05, 0x1EE1F}, {0x1EE29, 0x1EE32},
{0x1EE34, 0x1EE37}, {0x1EE4D, 0x1EE4F}, {0x1EE67, 0x1EE6A}, {0x1EE6C, 0x1EE72},
{0x1EE74, 0x1EE77}, {0x1EE79, 0x1EE7C}, {0x1EE80, 0x1EE89}, {0x1EE8B, 0x1EE9B},
{0x1EEA1, 0x1EEA3}, {0x1EEA5, 0x1EEA9}, {0x1EEAB, 0x1EEBB}, {0x20000, 0x2A6DD},
{0x2A700, 0x2B734}, {0x2B740, 0x2B81D}, {0x2B820, 0x2CEA1}, {0x2CEB0, 0x2EBE0},
{0x1EEA1, 0x1EEA3}, {0x1EEA5, 0x1EEA9}, {0x1EEAB, 0x1EEBB}, {0x20000, 0x2A6DF},
{0x2A700, 0x2B738}, {0x2B740, 0x2B81D}, {0x2B820, 0x2CEA1}, {0x2CEB0, 0x2EBE0},
{0x2F800, 0x2FA1D}, {0x30000, 0x3134A}
#endif
};
@@ -259,27 +263,28 @@ static const chr alphaCharTable[] = {
0xA38, 0xA39, 0xA5E, 0xAB2, 0xAB3, 0xABD, 0xAD0, 0xAE0, 0xAE1,
0xAF9, 0xB0F, 0xB10, 0xB32, 0xB33, 0xB3D, 0xB5C, 0xB5D, 0xB71,
0xB83, 0xB99, 0xB9A, 0xB9C, 0xB9E, 0xB9F, 0xBA3, 0xBA4, 0xBD0,
0xC3D, 0xC60, 0xC61, 0xC80, 0xCBD, 0xCDE, 0xCE0, 0xCE1, 0xCF1,
0xCF2, 0xD3D, 0xD4E, 0xDBD, 0xE32, 0xE33, 0xE81, 0xE82, 0xE84,
0xEA5, 0xEB2, 0xEB3, 0xEBD, 0xEC6, 0xF00, 0x103F, 0x1061, 0x1065,
0x1066, 0x108E, 0x10C7, 0x10CD, 0x1258, 0x12C0, 0x17D7, 0x17DC, 0x18AA,
0x1AA7, 0x1BAE, 0x1BAF, 0x1CF5, 0x1CF6, 0x1CFA, 0x1F59, 0x1F5B, 0x1F5D,
0x1FBE, 0x2071, 0x207F, 0x2102, 0x2107, 0x2115, 0x2124, 0x2126, 0x2128,
0x214E, 0x2183, 0x2184, 0x2CF2, 0x2CF3, 0x2D27, 0x2D2D, 0x2D6F, 0x2E2F,
0x3005, 0x3006, 0x303B, 0x303C, 0xA62A, 0xA62B, 0xA8FB, 0xA8FD, 0xA8FE,
0xA9CF, 0xAA7A, 0xAAB1, 0xAAB5, 0xAAB6, 0xAAC0, 0xAAC2, 0xFB1D, 0xFB3E,
0xFB40, 0xFB41, 0xFB43, 0xFB44
0xC3D, 0xC5D, 0xC60, 0xC61, 0xC80, 0xCBD, 0xCDD, 0xCDE, 0xCE0,
0xCE1, 0xCF1, 0xCF2, 0xD3D, 0xD4E, 0xDBD, 0xE32, 0xE33, 0xE81,
0xE82, 0xE84, 0xEA5, 0xEB2, 0xEB3, 0xEBD, 0xEC6, 0xF00, 0x103F,
0x1061, 0x1065, 0x1066, 0x108E, 0x10C7, 0x10CD, 0x1258, 0x12C0, 0x17D7,
0x17DC, 0x18AA, 0x1AA7, 0x1BAE, 0x1BAF, 0x1CF5, 0x1CF6, 0x1CFA, 0x1F59,
0x1F5B, 0x1F5D, 0x1FBE, 0x2071, 0x207F, 0x2102, 0x2107, 0x2115, 0x2124,
0x2126, 0x2128, 0x214E, 0x2183, 0x2184, 0x2CF2, 0x2CF3, 0x2D27, 0x2D2D,
0x2D6F, 0x2E2F, 0x3005, 0x3006, 0x303B, 0x303C, 0xA62A, 0xA62B, 0xA7D0,
0xA7D1, 0xA7D3, 0xA8FB, 0xA8FD, 0xA8FE, 0xA9CF, 0xAA7A, 0xAAB1, 0xAAB5,
0xAAB6, 0xAAC0, 0xAAC2, 0xFB1D, 0xFB3E, 0xFB40, 0xFB41, 0xFB43, 0xFB44
#if CHRBITS > 16
,0x1003C, 0x1003D, 0x10808, 0x10837, 0x10838, 0x1083C, 0x108F4, 0x108F5, 0x109BE,
0x109BF, 0x10A00, 0x10EB0, 0x10EB1, 0x10F27, 0x11144, 0x11147, 0x11176, 0x111DA,
0x111DC, 0x11288, 0x1130F, 0x11310, 0x11332, 0x11333, 0x1133D, 0x11350, 0x114C4,
0x114C5, 0x114C7, 0x11644, 0x116B8, 0x11909, 0x11915, 0x11916, 0x1193F, 0x11941,
0x119E1, 0x119E3, 0x11A00, 0x11A3A, 0x11A50, 0x11A9D, 0x11C40, 0x11D08, 0x11D09,
0x11D46, 0x11D67, 0x11D68, 0x11D98, 0x11FB0, 0x16F50, 0x16FE0, 0x16FE1, 0x16FE3,
0x1D49E, 0x1D49F, 0x1D4A2, 0x1D4A5, 0x1D4A6, 0x1D4BB, 0x1D546, 0x1E14E, 0x1E94B,
0x1EE21, 0x1EE22, 0x1EE24, 0x1EE27, 0x1EE39, 0x1EE3B, 0x1EE42, 0x1EE47, 0x1EE49,
0x1EE4B, 0x1EE51, 0x1EE52, 0x1EE54, 0x1EE57, 0x1EE59, 0x1EE5B, 0x1EE5D, 0x1EE5F,
0x1EE61, 0x1EE62, 0x1EE64, 0x1EE7E
,0x1003C, 0x1003D, 0x10594, 0x10595, 0x105BB, 0x105BC, 0x10808, 0x10837, 0x10838,
0x1083C, 0x108F4, 0x108F5, 0x109BE, 0x109BF, 0x10A00, 0x10EB0, 0x10EB1, 0x10F27,
0x11071, 0x11072, 0x11075, 0x11144, 0x11147, 0x11176, 0x111DA, 0x111DC, 0x11288,
0x1130F, 0x11310, 0x11332, 0x11333, 0x1133D, 0x11350, 0x114C4, 0x114C5, 0x114C7,
0x11644, 0x116B8, 0x11909, 0x11915, 0x11916, 0x1193F, 0x11941, 0x119E1, 0x119E3,
0x11A00, 0x11A3A, 0x11A50, 0x11A9D, 0x11C40, 0x11D08, 0x11D09, 0x11D46, 0x11D67,
0x11D68, 0x11D98, 0x11FB0, 0x16F50, 0x16FE0, 0x16FE1, 0x16FE3, 0x1AFFD, 0x1AFFE,
0x1D49E, 0x1D49F, 0x1D4A2, 0x1D4A5, 0x1D4A6, 0x1D4BB, 0x1D546, 0x1E14E, 0x1E7ED,
0x1E7EE, 0x1E94B, 0x1EE21, 0x1EE22, 0x1EE24, 0x1EE27, 0x1EE39, 0x1EE3B, 0x1EE42,
0x1EE47, 0x1EE49, 0x1EE4B, 0x1EE51, 0x1EE52, 0x1EE54, 0x1EE57, 0x1EE59, 0x1EE5B,
0x1EE5D, 0x1EE5F, 0x1EE61, 0x1EE62, 0x1EE64, 0x1EE7E
#endif
};
@@ -302,7 +307,7 @@ static const crange controlRangeTable[] = {
#define NUM_CONTROL_RANGE (sizeof(controlRangeTable)/sizeof(crange))
static const chr controlCharTable[] = {
0xAD, 0x61C, 0x6DD, 0x70F, 0x8E2, 0x180E, 0xFEFF
0xAD, 0x61C, 0x6DD, 0x70F, 0x890, 0x891, 0x8E2, 0x180E, 0xFEFF
#if CHRBITS > 16
,0x110BD, 0x110CD, 0xE0001
#endif
@@ -330,8 +335,9 @@ static const crange digitRangeTable[] = {
{0x11136, 0x1113F}, {0x111D0, 0x111D9}, {0x112F0, 0x112F9}, {0x11450, 0x11459},
{0x114D0, 0x114D9}, {0x11650, 0x11659}, {0x116C0, 0x116C9}, {0x11730, 0x11739},
{0x118E0, 0x118E9}, {0x11950, 0x11959}, {0x11C50, 0x11C59}, {0x11D50, 0x11D59},
{0x11DA0, 0x11DA9}, {0x16A60, 0x16A69}, {0x16B50, 0x16B59}, {0x1D7CE, 0x1D7FF},
{0x1E140, 0x1E149}, {0x1E2F0, 0x1E2F9}, {0x1E950, 0x1E959}, {0x1FBF0, 0x1FBF9}
{0x11DA0, 0x11DA9}, {0x16A60, 0x16A69}, {0x16AC0, 0x16AC9}, {0x16B50, 0x16B59},
{0x1D7CE, 0x1D7FF}, {0x1E140, 0x1E149}, {0x1E2F0, 0x1E2F9}, {0x1E950, 0x1E959},
{0x1FBF0, 0x1FBF9}
#endif
};
@@ -347,27 +353,27 @@ static const crange digitRangeTable[] = {
static const crange punctRangeTable[] = {
{0x21, 0x23}, {0x25, 0x2A}, {0x2C, 0x2F}, {0x5B, 0x5D},
{0x55A, 0x55F}, {0x66A, 0x66D}, {0x700, 0x70D}, {0x7F7, 0x7F9},
{0x830, 0x83E}, {0xF04, 0xF12}, {0xF3A, 0xF3D}, {0xFD0, 0xFD4},
{0x104A, 0x104F}, {0x1360, 0x1368}, {0x16EB, 0x16ED}, {0x17D4, 0x17D6},
{0x17D8, 0x17DA}, {0x1800, 0x180A}, {0x1AA0, 0x1AA6}, {0x1AA8, 0x1AAD},
{0x1B5A, 0x1B60}, {0x1BFC, 0x1BFF}, {0x1C3B, 0x1C3F}, {0x1CC0, 0x1CC7},
{0x2010, 0x2027}, {0x2030, 0x2043}, {0x2045, 0x2051}, {0x2053, 0x205E},
{0x2308, 0x230B}, {0x2768, 0x2775}, {0x27E6, 0x27EF}, {0x2983, 0x2998},
{0x29D8, 0x29DB}, {0x2CF9, 0x2CFC}, {0x2E00, 0x2E2E}, {0x2E30, 0x2E4F},
{0x3001, 0x3003}, {0x3008, 0x3011}, {0x3014, 0x301F}, {0xA60D, 0xA60F},
{0xA6F2, 0xA6F7}, {0xA874, 0xA877}, {0xA8F8, 0xA8FA}, {0xA9C1, 0xA9CD},
{0xAA5C, 0xAA5F}, {0xFE10, 0xFE19}, {0xFE30, 0xFE52}, {0xFE54, 0xFE61},
{0xFF01, 0xFF03}, {0xFF05, 0xFF0A}, {0xFF0C, 0xFF0F}, {0xFF3B, 0xFF3D},
{0xFF5F, 0xFF65}
{0x55A, 0x55F}, {0x61D, 0x61F}, {0x66A, 0x66D}, {0x700, 0x70D},
{0x7F7, 0x7F9}, {0x830, 0x83E}, {0xF04, 0xF12}, {0xF3A, 0xF3D},
{0xFD0, 0xFD4}, {0x104A, 0x104F}, {0x1360, 0x1368}, {0x16EB, 0x16ED},
{0x17D4, 0x17D6}, {0x17D8, 0x17DA}, {0x1800, 0x180A}, {0x1AA0, 0x1AA6},
{0x1AA8, 0x1AAD}, {0x1B5A, 0x1B60}, {0x1BFC, 0x1BFF}, {0x1C3B, 0x1C3F},
{0x1CC0, 0x1CC7}, {0x2010, 0x2027}, {0x2030, 0x2043}, {0x2045, 0x2051},
{0x2053, 0x205E}, {0x2308, 0x230B}, {0x2768, 0x2775}, {0x27E6, 0x27EF},
{0x2983, 0x2998}, {0x29D8, 0x29DB}, {0x2CF9, 0x2CFC}, {0x2E00, 0x2E2E},
{0x2E30, 0x2E4F}, {0x2E52, 0x2E5D}, {0x3001, 0x3003}, {0x3008, 0x3011},
{0x3014, 0x301F}, {0xA60D, 0xA60F}, {0xA6F2, 0xA6F7}, {0xA874, 0xA877},
{0xA8F8, 0xA8FA}, {0xA9C1, 0xA9CD}, {0xAA5C, 0xAA5F}, {0xFE10, 0xFE19},
{0xFE30, 0xFE52}, {0xFE54, 0xFE61}, {0xFF01, 0xFF03}, {0xFF05, 0xFF0A},
{0xFF0C, 0xFF0F}, {0xFF3B, 0xFF3D}, {0xFF5F, 0xFF65}
#if CHRBITS > 16
,{0x10100, 0x10102}, {0x10A50, 0x10A58}, {0x10AF0, 0x10AF6}, {0x10B39, 0x10B3F},
{0x10B99, 0x10B9C}, {0x10F55, 0x10F59}, {0x11047, 0x1104D}, {0x110BE, 0x110C1},
{0x11140, 0x11143}, {0x111C5, 0x111C8}, {0x111DD, 0x111DF}, {0x11238, 0x1123D},
{0x1144B, 0x1144F}, {0x115C1, 0x115D7}, {0x11641, 0x11643}, {0x11660, 0x1166C},
{0x1173C, 0x1173E}, {0x11944, 0x11946}, {0x11A3F, 0x11A46}, {0x11A9A, 0x11A9C},
{0x11A9E, 0x11AA2}, {0x11C41, 0x11C45}, {0x12470, 0x12474}, {0x16B37, 0x16B3B},
{0x16E97, 0x16E9A}, {0x1DA87, 0x1DA8B}
{0x10B99, 0x10B9C}, {0x10F55, 0x10F59}, {0x10F86, 0x10F89}, {0x11047, 0x1104D},
{0x110BE, 0x110C1}, {0x11140, 0x11143}, {0x111C5, 0x111C8}, {0x111DD, 0x111DF},
{0x11238, 0x1123D}, {0x1144B, 0x1144F}, {0x115C1, 0x115D7}, {0x11641, 0x11643},
{0x11660, 0x1166C}, {0x1173C, 0x1173E}, {0x11944, 0x11946}, {0x11A3F, 0x11A46},
{0x11A9A, 0x11A9C}, {0x11A9E, 0x11AA2}, {0x11C41, 0x11C45}, {0x12470, 0x12474},
{0x16B37, 0x16B3B}, {0x16E97, 0x16E9A}, {0x1DA87, 0x1DA8B}
#endif
};
@@ -377,21 +383,22 @@ static const chr punctCharTable[] = {
0x3A, 0x3B, 0x3F, 0x40, 0x5F, 0x7B, 0x7D, 0xA1, 0xA7,
0xAB, 0xB6, 0xB7, 0xBB, 0xBF, 0x37E, 0x387, 0x589, 0x58A,
0x5BE, 0x5C0, 0x5C3, 0x5C6, 0x5F3, 0x5F4, 0x609, 0x60A, 0x60C,
0x60D, 0x61B, 0x61E, 0x61F, 0x6D4, 0x85E, 0x964, 0x965, 0x970,
0x9FD, 0xA76, 0xAF0, 0xC77, 0xC84, 0xDF4, 0xE4F, 0xE5A, 0xE5B,
0xF14, 0xF85, 0xFD9, 0xFDA, 0x10FB, 0x1400, 0x166E, 0x169B, 0x169C,
0x1735, 0x1736, 0x1944, 0x1945, 0x1A1E, 0x1A1F, 0x1C7E, 0x1C7F, 0x1CD3,
0x60D, 0x61B, 0x6D4, 0x85E, 0x964, 0x965, 0x970, 0x9FD, 0xA76,
0xAF0, 0xC77, 0xC84, 0xDF4, 0xE4F, 0xE5A, 0xE5B, 0xF14, 0xF85,
0xFD9, 0xFDA, 0x10FB, 0x1400, 0x166E, 0x169B, 0x169C, 0x1735, 0x1736,
0x1944, 0x1945, 0x1A1E, 0x1A1F, 0x1B7D, 0x1B7E, 0x1C7E, 0x1C7F, 0x1CD3,
0x207D, 0x207E, 0x208D, 0x208E, 0x2329, 0x232A, 0x27C5, 0x27C6, 0x29FC,
0x29FD, 0x2CFE, 0x2CFF, 0x2D70, 0x2E52, 0x3030, 0x303D, 0x30A0, 0x30FB,
0xA4FE, 0xA4FF, 0xA673, 0xA67E, 0xA8CE, 0xA8CF, 0xA8FC, 0xA92E, 0xA92F,
0xA95F, 0xA9DE, 0xA9DF, 0xAADE, 0xAADF, 0xAAF0, 0xAAF1, 0xABEB, 0xFD3E,
0xFD3F, 0xFE63, 0xFE68, 0xFE6A, 0xFE6B, 0xFF1A, 0xFF1B, 0xFF1F, 0xFF20,
0xFF3F, 0xFF5B, 0xFF5D
0x29FD, 0x2CFE, 0x2CFF, 0x2D70, 0x3030, 0x303D, 0x30A0, 0x30FB, 0xA4FE,
0xA4FF, 0xA673, 0xA67E, 0xA8CE, 0xA8CF, 0xA8FC, 0xA92E, 0xA92F, 0xA95F,
0xA9DE, 0xA9DF, 0xAADE, 0xAADF, 0xAAF0, 0xAAF1, 0xABEB, 0xFD3E, 0xFD3F,
0xFE63, 0xFE68, 0xFE6A, 0xFE6B, 0xFF1A, 0xFF1B, 0xFF1F, 0xFF20, 0xFF3F,
0xFF5B, 0xFF5D
#if CHRBITS > 16
,0x1039F, 0x103D0, 0x1056F, 0x10857, 0x1091F, 0x1093F, 0x10A7F, 0x10EAD, 0x110BB,
0x110BC, 0x11174, 0x11175, 0x111CD, 0x111DB, 0x112A9, 0x1145A, 0x1145B, 0x1145D,
0x114C6, 0x1183B, 0x119E2, 0x11C70, 0x11C71, 0x11EF7, 0x11EF8, 0x11FFF, 0x16A6E,
0x16A6F, 0x16AF5, 0x16B44, 0x16FE2, 0x1BC9F, 0x1E95E, 0x1E95F
0x114C6, 0x116B9, 0x1183B, 0x119E2, 0x11C70, 0x11C71, 0x11EF7, 0x11EF8, 0x11FFF,
0x12FF1, 0x12FF2, 0x16A6E, 0x16A6F, 0x16AF5, 0x16B44, 0x16FE2, 0x1BC9F, 0x1E95E,
0x1E95F
#endif
};
@@ -429,18 +436,20 @@ static const crange lowerRangeTable[] = {
{0x1F50, 0x1F57}, {0x1F60, 0x1F67}, {0x1F70, 0x1F7D}, {0x1F80, 0x1F87},
{0x1F90, 0x1F97}, {0x1FA0, 0x1FA7}, {0x1FB0, 0x1FB4}, {0x1FC2, 0x1FC4},
{0x1FD0, 0x1FD3}, {0x1FE0, 0x1FE7}, {0x1FF2, 0x1FF4}, {0x2146, 0x2149},
{0x2C30, 0x2C5E}, {0x2C76, 0x2C7B}, {0x2D00, 0x2D25}, {0xA72F, 0xA731},
{0x2C30, 0x2C5F}, {0x2C76, 0x2C7B}, {0x2D00, 0x2D25}, {0xA72F, 0xA731},
{0xA771, 0xA778}, {0xA793, 0xA795}, {0xAB30, 0xAB5A}, {0xAB60, 0xAB68},
{0xAB70, 0xABBF}, {0xFB00, 0xFB06}, {0xFB13, 0xFB17}, {0xFF41, 0xFF5A}
#if CHRBITS > 16
,{0x10428, 0x1044F}, {0x104D8, 0x104FB}, {0x10CC0, 0x10CF2}, {0x118C0, 0x118DF},
{0x16E60, 0x16E7F}, {0x1D41A, 0x1D433}, {0x1D44E, 0x1D454}, {0x1D456, 0x1D467},
{0x1D482, 0x1D49B}, {0x1D4B6, 0x1D4B9}, {0x1D4BD, 0x1D4C3}, {0x1D4C5, 0x1D4CF},
{0x1D4EA, 0x1D503}, {0x1D51E, 0x1D537}, {0x1D552, 0x1D56B}, {0x1D586, 0x1D59F},
{0x1D5BA, 0x1D5D3}, {0x1D5EE, 0x1D607}, {0x1D622, 0x1D63B}, {0x1D656, 0x1D66F},
{0x1D68A, 0x1D6A5}, {0x1D6C2, 0x1D6DA}, {0x1D6DC, 0x1D6E1}, {0x1D6FC, 0x1D714},
{0x1D716, 0x1D71B}, {0x1D736, 0x1D74E}, {0x1D750, 0x1D755}, {0x1D770, 0x1D788},
{0x1D78A, 0x1D78F}, {0x1D7AA, 0x1D7C2}, {0x1D7C4, 0x1D7C9}, {0x1E922, 0x1E943}
,{0x10428, 0x1044F}, {0x104D8, 0x104FB}, {0x10597, 0x105A1}, {0x105A3, 0x105B1},
{0x105B3, 0x105B9}, {0x10CC0, 0x10CF2}, {0x118C0, 0x118DF}, {0x16E60, 0x16E7F},
{0x1D41A, 0x1D433}, {0x1D44E, 0x1D454}, {0x1D456, 0x1D467}, {0x1D482, 0x1D49B},
{0x1D4B6, 0x1D4B9}, {0x1D4BD, 0x1D4C3}, {0x1D4C5, 0x1D4CF}, {0x1D4EA, 0x1D503},
{0x1D51E, 0x1D537}, {0x1D552, 0x1D56B}, {0x1D586, 0x1D59F}, {0x1D5BA, 0x1D5D3},
{0x1D5EE, 0x1D607}, {0x1D622, 0x1D63B}, {0x1D656, 0x1D66F}, {0x1D68A, 0x1D6A5},
{0x1D6C2, 0x1D6DA}, {0x1D6DC, 0x1D6E1}, {0x1D6FC, 0x1D714}, {0x1D716, 0x1D71B},
{0x1D736, 0x1D74E}, {0x1D750, 0x1D755}, {0x1D770, 0x1D788}, {0x1D78A, 0x1D78F},
{0x1D7AA, 0x1D7C2}, {0x1D7C4, 0x1D7C9}, {0x1DF00, 0x1DF09}, {0x1DF0B, 0x1DF1E},
{0x1E922, 0x1E943}
#endif
};
@@ -510,10 +519,10 @@ static const chr lowerCharTable[] = {
0xA763, 0xA765, 0xA767, 0xA769, 0xA76B, 0xA76D, 0xA76F, 0xA77A, 0xA77C,
0xA77F, 0xA781, 0xA783, 0xA785, 0xA787, 0xA78C, 0xA78E, 0xA791, 0xA797,
0xA799, 0xA79B, 0xA79D, 0xA79F, 0xA7A1, 0xA7A3, 0xA7A5, 0xA7A7, 0xA7A9,
0xA7AF, 0xA7B5, 0xA7B7, 0xA7B9, 0xA7BB, 0xA7BD, 0xA7BF, 0xA7C3, 0xA7C8,
0xA7CA, 0xA7F6, 0xA7FA
0xA7AF, 0xA7B5, 0xA7B7, 0xA7B9, 0xA7BB, 0xA7BD, 0xA7BF, 0xA7C1, 0xA7C3,
0xA7C8, 0xA7CA, 0xA7D1, 0xA7D3, 0xA7D5, 0xA7D7, 0xA7D9, 0xA7F6, 0xA7FA
#if CHRBITS > 16
,0x1D4BB, 0x1D7CB
,0x105BB, 0x105BC, 0x1D4BB, 0x1D7CB
#endif
};
@@ -532,18 +541,18 @@ static const crange upperRangeTable[] = {
{0x1F18, 0x1F1D}, {0x1F28, 0x1F2F}, {0x1F38, 0x1F3F}, {0x1F48, 0x1F4D},
{0x1F68, 0x1F6F}, {0x1FB8, 0x1FBB}, {0x1FC8, 0x1FCB}, {0x1FD8, 0x1FDB},
{0x1FE8, 0x1FEC}, {0x1FF8, 0x1FFB}, {0x210B, 0x210D}, {0x2110, 0x2112},
{0x2119, 0x211D}, {0x212A, 0x212D}, {0x2130, 0x2133}, {0x2C00, 0x2C2E},
{0x2119, 0x211D}, {0x212A, 0x212D}, {0x2130, 0x2133}, {0x2C00, 0x2C2F},
{0x2C62, 0x2C64}, {0x2C6D, 0x2C70}, {0x2C7E, 0x2C80}, {0xA7AA, 0xA7AE},
{0xA7B0, 0xA7B4}, {0xA7C4, 0xA7C7}, {0xFF21, 0xFF3A}
#if CHRBITS > 16
,{0x10400, 0x10427}, {0x104B0, 0x104D3}, {0x10C80, 0x10CB2}, {0x118A0, 0x118BF},
{0x16E40, 0x16E5F}, {0x1D400, 0x1D419}, {0x1D434, 0x1D44D}, {0x1D468, 0x1D481},
{0x1D4A9, 0x1D4AC}, {0x1D4AE, 0x1D4B5}, {0x1D4D0, 0x1D4E9}, {0x1D507, 0x1D50A},
{0x1D50D, 0x1D514}, {0x1D516, 0x1D51C}, {0x1D53B, 0x1D53E}, {0x1D540, 0x1D544},
{0x1D54A, 0x1D550}, {0x1D56C, 0x1D585}, {0x1D5A0, 0x1D5B9}, {0x1D5D4, 0x1D5ED},
{0x1D608, 0x1D621}, {0x1D63C, 0x1D655}, {0x1D670, 0x1D689}, {0x1D6A8, 0x1D6C0},
{0x1D6E2, 0x1D6FA}, {0x1D71C, 0x1D734}, {0x1D756, 0x1D76E}, {0x1D790, 0x1D7A8},
{0x1E900, 0x1E921}
,{0x10400, 0x10427}, {0x104B0, 0x104D3}, {0x10570, 0x1057A}, {0x1057C, 0x1058A},
{0x1058C, 0x10592}, {0x10C80, 0x10CB2}, {0x118A0, 0x118BF}, {0x16E40, 0x16E5F},
{0x1D400, 0x1D419}, {0x1D434, 0x1D44D}, {0x1D468, 0x1D481}, {0x1D4A9, 0x1D4AC},
{0x1D4AE, 0x1D4B5}, {0x1D4D0, 0x1D4E9}, {0x1D507, 0x1D50A}, {0x1D50D, 0x1D514},
{0x1D516, 0x1D51C}, {0x1D53B, 0x1D53E}, {0x1D540, 0x1D544}, {0x1D54A, 0x1D550},
{0x1D56C, 0x1D585}, {0x1D5A0, 0x1D5B9}, {0x1D5D4, 0x1D5ED}, {0x1D608, 0x1D621},
{0x1D63C, 0x1D655}, {0x1D670, 0x1D689}, {0x1D6A8, 0x1D6C0}, {0x1D6E2, 0x1D6FA},
{0x1D71C, 0x1D734}, {0x1D756, 0x1D76E}, {0x1D790, 0x1D7A8}, {0x1E900, 0x1E921}
#endif
};
@@ -613,10 +622,11 @@ static const chr upperCharTable[] = {
0xA768, 0xA76A, 0xA76C, 0xA76E, 0xA779, 0xA77B, 0xA77D, 0xA77E, 0xA780,
0xA782, 0xA784, 0xA786, 0xA78B, 0xA78D, 0xA790, 0xA792, 0xA796, 0xA798,
0xA79A, 0xA79C, 0xA79E, 0xA7A0, 0xA7A2, 0xA7A4, 0xA7A6, 0xA7A8, 0xA7B6,
0xA7B8, 0xA7BA, 0xA7BC, 0xA7BE, 0xA7C2, 0xA7C9, 0xA7F5
0xA7B8, 0xA7BA, 0xA7BC, 0xA7BE, 0xA7C0, 0xA7C2, 0xA7C9, 0xA7D0, 0xA7D6,
0xA7D8, 0xA7F5
#if CHRBITS > 16
,0x1D49C, 0x1D49E, 0x1D49F, 0x1D4A2, 0x1D4A5, 0x1D4A6, 0x1D504, 0x1D505, 0x1D538,
0x1D539, 0x1D546, 0x1D7CA
,0x10594, 0x10595, 0x1D49C, 0x1D49E, 0x1D49F, 0x1D4A2, 0x1D4A5, 0x1D4A6, 0x1D504,
0x1D505, 0x1D538, 0x1D539, 0x1D546, 0x1D7CA
#endif
};
@@ -630,74 +640,72 @@ static const crange graphRangeTable[] = {
{0x21, 0x7E}, {0xA1, 0xAC}, {0xAE, 0x377}, {0x37A, 0x37F},
{0x384, 0x38A}, {0x38E, 0x3A1}, {0x3A3, 0x52F}, {0x531, 0x556},
{0x559, 0x58A}, {0x58D, 0x58F}, {0x591, 0x5C7}, {0x5D0, 0x5EA},
{0x5EF, 0x5F4}, {0x606, 0x61B}, {0x61E, 0x6DC}, {0x6DE, 0x70D},
{0x5EF, 0x5F4}, {0x606, 0x61B}, {0x61D, 0x6DC}, {0x6DE, 0x70D},
{0x710, 0x74A}, {0x74D, 0x7B1}, {0x7C0, 0x7FA}, {0x7FD, 0x82D},
{0x830, 0x83E}, {0x840, 0x85B}, {0x860, 0x86A}, {0x8A0, 0x8B4},
{0x8B6, 0x8C7}, {0x8D3, 0x8E1}, {0x8E3, 0x983}, {0x985, 0x98C},
{0x993, 0x9A8}, {0x9AA, 0x9B0}, {0x9B6, 0x9B9}, {0x9BC, 0x9C4},
{0x9CB, 0x9CE}, {0x9DF, 0x9E3}, {0x9E6, 0x9FE}, {0xA01, 0xA03},
{0xA05, 0xA0A}, {0xA13, 0xA28}, {0xA2A, 0xA30}, {0xA3E, 0xA42},
{0xA4B, 0xA4D}, {0xA59, 0xA5C}, {0xA66, 0xA76}, {0xA81, 0xA83},
{0xA85, 0xA8D}, {0xA8F, 0xA91}, {0xA93, 0xAA8}, {0xAAA, 0xAB0},
{0xAB5, 0xAB9}, {0xABC, 0xAC5}, {0xAC7, 0xAC9}, {0xACB, 0xACD},
{0xAE0, 0xAE3}, {0xAE6, 0xAF1}, {0xAF9, 0xAFF}, {0xB01, 0xB03},
{0xB05, 0xB0C}, {0xB13, 0xB28}, {0xB2A, 0xB30}, {0xB35, 0xB39},
{0xB3C, 0xB44}, {0xB4B, 0xB4D}, {0xB55, 0xB57}, {0xB5F, 0xB63},
{0xB66, 0xB77}, {0xB85, 0xB8A}, {0xB8E, 0xB90}, {0xB92, 0xB95},
{0xBA8, 0xBAA}, {0xBAE, 0xBB9}, {0xBBE, 0xBC2}, {0xBC6, 0xBC8},
{0xBCA, 0xBCD}, {0xBE6, 0xBFA}, {0xC00, 0xC0C}, {0xC0E, 0xC10},
{0xC12, 0xC28}, {0xC2A, 0xC39}, {0xC3D, 0xC44}, {0xC46, 0xC48},
{0xC4A, 0xC4D}, {0xC58, 0xC5A}, {0xC60, 0xC63}, {0xC66, 0xC6F},
{0xC77, 0xC8C}, {0xC8E, 0xC90}, {0xC92, 0xCA8}, {0xCAA, 0xCB3},
{0xCB5, 0xCB9}, {0xCBC, 0xCC4}, {0xCC6, 0xCC8}, {0xCCA, 0xCCD},
{0xCE0, 0xCE3}, {0xCE6, 0xCEF}, {0xD00, 0xD0C}, {0xD0E, 0xD10},
{0xD12, 0xD44}, {0xD46, 0xD48}, {0xD4A, 0xD4F}, {0xD54, 0xD63},
{0xD66, 0xD7F}, {0xD81, 0xD83}, {0xD85, 0xD96}, {0xD9A, 0xDB1},
{0xDB3, 0xDBB}, {0xDC0, 0xDC6}, {0xDCF, 0xDD4}, {0xDD8, 0xDDF},
{0xDE6, 0xDEF}, {0xDF2, 0xDF4}, {0xE01, 0xE3A}, {0xE3F, 0xE5B},
{0xE86, 0xE8A}, {0xE8C, 0xEA3}, {0xEA7, 0xEBD}, {0xEC0, 0xEC4},
{0xEC8, 0xECD}, {0xED0, 0xED9}, {0xEDC, 0xEDF}, {0xF00, 0xF47},
{0xF49, 0xF6C}, {0xF71, 0xF97}, {0xF99, 0xFBC}, {0xFBE, 0xFCC},
{0xFCE, 0xFDA}, {0x1000, 0x10C5}, {0x10D0, 0x1248}, {0x124A, 0x124D},
{0x1250, 0x1256}, {0x125A, 0x125D}, {0x1260, 0x1288}, {0x128A, 0x128D},
{0x1290, 0x12B0}, {0x12B2, 0x12B5}, {0x12B8, 0x12BE}, {0x12C2, 0x12C5},
{0x12C8, 0x12D6}, {0x12D8, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x135A},
{0x135D, 0x137C}, {0x1380, 0x1399}, {0x13A0, 0x13F5}, {0x13F8, 0x13FD},
{0x1400, 0x167F}, {0x1681, 0x169C}, {0x16A0, 0x16F8}, {0x1700, 0x170C},
{0x170E, 0x1714}, {0x1720, 0x1736}, {0x1740, 0x1753}, {0x1760, 0x176C},
{0x176E, 0x1770}, {0x1780, 0x17DD}, {0x17E0, 0x17E9}, {0x17F0, 0x17F9},
{0x1800, 0x180D}, {0x1810, 0x1819}, {0x1820, 0x1878}, {0x1880, 0x18AA},
{0x18B0, 0x18F5}, {0x1900, 0x191E}, {0x1920, 0x192B}, {0x1930, 0x193B},
{0x1944, 0x196D}, {0x1970, 0x1974}, {0x1980, 0x19AB}, {0x19B0, 0x19C9},
{0x19D0, 0x19DA}, {0x19DE, 0x1A1B}, {0x1A1E, 0x1A5E}, {0x1A60, 0x1A7C},
{0x1A7F, 0x1A89}, {0x1A90, 0x1A99}, {0x1AA0, 0x1AAD}, {0x1AB0, 0x1AC0},
{0x1B00, 0x1B4B}, {0x1B50, 0x1B7C}, {0x1B80, 0x1BF3}, {0x1BFC, 0x1C37},
{0x1C3B, 0x1C49}, {0x1C4D, 0x1C88}, {0x1C90, 0x1CBA}, {0x1CBD, 0x1CC7},
{0x1CD0, 0x1CFA}, {0x1D00, 0x1DF9}, {0x1DFB, 0x1F15}, {0x1F18, 0x1F1D},
{0x1F20, 0x1F45}, {0x1F48, 0x1F4D}, {0x1F50, 0x1F57}, {0x1F5F, 0x1F7D},
{0x1F80, 0x1FB4}, {0x1FB6, 0x1FC4}, {0x1FC6, 0x1FD3}, {0x1FD6, 0x1FDB},
{0x1FDD, 0x1FEF}, {0x1FF2, 0x1FF4}, {0x1FF6, 0x1FFE}, {0x2010, 0x2027},
{0x2030, 0x205E}, {0x2074, 0x208E}, {0x2090, 0x209C}, {0x20A0, 0x20BF},
{0x20D0, 0x20F0}, {0x2100, 0x218B}, {0x2190, 0x2426}, {0x2440, 0x244A},
{0x2460, 0x2B73}, {0x2B76, 0x2B95}, {0x2B97, 0x2C2E}, {0x2C30, 0x2C5E},
{0x2C60, 0x2CF3}, {0x2CF9, 0x2D25}, {0x2D30, 0x2D67}, {0x2D7F, 0x2D96},
{0x2DA0, 0x2DA6}, {0x2DA8, 0x2DAE}, {0x2DB0, 0x2DB6}, {0x2DB8, 0x2DBE},
{0x2DC0, 0x2DC6}, {0x2DC8, 0x2DCE}, {0x2DD0, 0x2DD6}, {0x2DD8, 0x2DDE},
{0x2DE0, 0x2E52}, {0x2E80, 0x2E99}, {0x2E9B, 0x2EF3}, {0x2F00, 0x2FD5},
{0x2FF0, 0x2FFB}, {0x3001, 0x303F}, {0x3041, 0x3096}, {0x3099, 0x30FF},
{0x3105, 0x312F}, {0x3131, 0x318E}, {0x3190, 0x31E3}, {0x31F0, 0x321E},
{0x3220, 0x9FFC}, {0xA000, 0xA48C}, {0xA490, 0xA4C6}, {0xA4D0, 0xA62B},
{0xA640, 0xA6F7}, {0xA700, 0xA7BF}, {0xA7C2, 0xA7CA}, {0xA7F5, 0xA82C},
{0xA830, 0xA839}, {0xA840, 0xA877}, {0xA880, 0xA8C5}, {0xA8CE, 0xA8D9},
{0xA8E0, 0xA953}, {0xA95F, 0xA97C}, {0xA980, 0xA9CD}, {0xA9CF, 0xA9D9},
{0xA9DE, 0xA9FE}, {0xAA00, 0xAA36}, {0xAA40, 0xAA4D}, {0xAA50, 0xAA59},
{0xAA5C, 0xAAC2}, {0xAADB, 0xAAF6}, {0xAB01, 0xAB06}, {0xAB09, 0xAB0E},
{0xAB11, 0xAB16}, {0xAB20, 0xAB26}, {0xAB28, 0xAB2E}, {0xAB30, 0xAB6B},
{0xAB70, 0xABED}, {0xABF0, 0xABF9}, {0xAC00, 0xD7A3}, {0xD7B0, 0xD7C6},
{0xD7CB, 0xD7FB}, {0xF900, 0xFA6D}, {0xFA70, 0xFAD9}, {0xFB00, 0xFB06},
{0xFB13, 0xFB17}, {0xFB1D, 0xFB36}, {0xFB38, 0xFB3C}, {0xFB46, 0xFBC1},
{0xFBD3, 0xFD3F}, {0xFD50, 0xFD8F}, {0xFD92, 0xFDC7}, {0xFDF0, 0xFDFD},
{0xFE00, 0xFE19}, {0xFE20, 0xFE52}, {0xFE54, 0xFE66}, {0xFE68, 0xFE6B},
{0x830, 0x83E}, {0x840, 0x85B}, {0x860, 0x86A}, {0x870, 0x88E},
{0x898, 0x8E1}, {0x8E3, 0x983}, {0x985, 0x98C}, {0x993, 0x9A8},
{0x9AA, 0x9B0}, {0x9B6, 0x9B9}, {0x9BC, 0x9C4}, {0x9CB, 0x9CE},
{0x9DF, 0x9E3}, {0x9E6, 0x9FE}, {0xA01, 0xA03}, {0xA05, 0xA0A},
{0xA13, 0xA28}, {0xA2A, 0xA30}, {0xA3E, 0xA42}, {0xA4B, 0xA4D},
{0xA59, 0xA5C}, {0xA66, 0xA76}, {0xA81, 0xA83}, {0xA85, 0xA8D},
{0xA8F, 0xA91}, {0xA93, 0xAA8}, {0xAAA, 0xAB0}, {0xAB5, 0xAB9},
{0xABC, 0xAC5}, {0xAC7, 0xAC9}, {0xACB, 0xACD}, {0xAE0, 0xAE3},
{0xAE6, 0xAF1}, {0xAF9, 0xAFF}, {0xB01, 0xB03}, {0xB05, 0xB0C},
{0xB13, 0xB28}, {0xB2A, 0xB30}, {0xB35, 0xB39}, {0xB3C, 0xB44},
{0xB4B, 0xB4D}, {0xB55, 0xB57}, {0xB5F, 0xB63}, {0xB66, 0xB77},
{0xB85, 0xB8A}, {0xB8E, 0xB90}, {0xB92, 0xB95}, {0xBA8, 0xBAA},
{0xBAE, 0xBB9}, {0xBBE, 0xBC2}, {0xBC6, 0xBC8}, {0xBCA, 0xBCD},
{0xBE6, 0xBFA}, {0xC00, 0xC0C}, {0xC0E, 0xC10}, {0xC12, 0xC28},
{0xC2A, 0xC39}, {0xC3C, 0xC44}, {0xC46, 0xC48}, {0xC4A, 0xC4D},
{0xC58, 0xC5A}, {0xC60, 0xC63}, {0xC66, 0xC6F}, {0xC77, 0xC8C},
{0xC8E, 0xC90}, {0xC92, 0xCA8}, {0xCAA, 0xCB3}, {0xCB5, 0xCB9},
{0xCBC, 0xCC4}, {0xCC6, 0xCC8}, {0xCCA, 0xCCD}, {0xCE0, 0xCE3},
{0xCE6, 0xCEF}, {0xD00, 0xD0C}, {0xD0E, 0xD10}, {0xD12, 0xD44},
{0xD46, 0xD48}, {0xD4A, 0xD4F}, {0xD54, 0xD63}, {0xD66, 0xD7F},
{0xD81, 0xD83}, {0xD85, 0xD96}, {0xD9A, 0xDB1}, {0xDB3, 0xDBB},
{0xDC0, 0xDC6}, {0xDCF, 0xDD4}, {0xDD8, 0xDDF}, {0xDE6, 0xDEF},
{0xDF2, 0xDF4}, {0xE01, 0xE3A}, {0xE3F, 0xE5B}, {0xE86, 0xE8A},
{0xE8C, 0xEA3}, {0xEA7, 0xEBD}, {0xEC0, 0xEC4}, {0xEC8, 0xECD},
{0xED0, 0xED9}, {0xEDC, 0xEDF}, {0xF00, 0xF47}, {0xF49, 0xF6C},
{0xF71, 0xF97}, {0xF99, 0xFBC}, {0xFBE, 0xFCC}, {0xFCE, 0xFDA},
{0x1000, 0x10C5}, {0x10D0, 0x1248}, {0x124A, 0x124D}, {0x1250, 0x1256},
{0x125A, 0x125D}, {0x1260, 0x1288}, {0x128A, 0x128D}, {0x1290, 0x12B0},
{0x12B2, 0x12B5}, {0x12B8, 0x12BE}, {0x12C2, 0x12C5}, {0x12C8, 0x12D6},
{0x12D8, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x135A}, {0x135D, 0x137C},
{0x1380, 0x1399}, {0x13A0, 0x13F5}, {0x13F8, 0x13FD}, {0x1400, 0x167F},
{0x1681, 0x169C}, {0x16A0, 0x16F8}, {0x1700, 0x1715}, {0x171F, 0x1736},
{0x1740, 0x1753}, {0x1760, 0x176C}, {0x176E, 0x1770}, {0x1780, 0x17DD},
{0x17E0, 0x17E9}, {0x17F0, 0x17F9}, {0x1800, 0x180D}, {0x180F, 0x1819},
{0x1820, 0x1878}, {0x1880, 0x18AA}, {0x18B0, 0x18F5}, {0x1900, 0x191E},
{0x1920, 0x192B}, {0x1930, 0x193B}, {0x1944, 0x196D}, {0x1970, 0x1974},
{0x1980, 0x19AB}, {0x19B0, 0x19C9}, {0x19D0, 0x19DA}, {0x19DE, 0x1A1B},
{0x1A1E, 0x1A5E}, {0x1A60, 0x1A7C}, {0x1A7F, 0x1A89}, {0x1A90, 0x1A99},
{0x1AA0, 0x1AAD}, {0x1AB0, 0x1ACE}, {0x1B00, 0x1B4C}, {0x1B50, 0x1B7E},
{0x1B80, 0x1BF3}, {0x1BFC, 0x1C37}, {0x1C3B, 0x1C49}, {0x1C4D, 0x1C88},
{0x1C90, 0x1CBA}, {0x1CBD, 0x1CC7}, {0x1CD0, 0x1CFA}, {0x1D00, 0x1F15},
{0x1F18, 0x1F1D}, {0x1F20, 0x1F45}, {0x1F48, 0x1F4D}, {0x1F50, 0x1F57},
{0x1F5F, 0x1F7D}, {0x1F80, 0x1FB4}, {0x1FB6, 0x1FC4}, {0x1FC6, 0x1FD3},
{0x1FD6, 0x1FDB}, {0x1FDD, 0x1FEF}, {0x1FF2, 0x1FF4}, {0x1FF6, 0x1FFE},
{0x2010, 0x2027}, {0x2030, 0x205E}, {0x2074, 0x208E}, {0x2090, 0x209C},
{0x20A0, 0x20C0}, {0x20D0, 0x20F0}, {0x2100, 0x218B}, {0x2190, 0x2426},
{0x2440, 0x244A}, {0x2460, 0x2B73}, {0x2B76, 0x2B95}, {0x2B97, 0x2CF3},
{0x2CF9, 0x2D25}, {0x2D30, 0x2D67}, {0x2D7F, 0x2D96}, {0x2DA0, 0x2DA6},
{0x2DA8, 0x2DAE}, {0x2DB0, 0x2DB6}, {0x2DB8, 0x2DBE}, {0x2DC0, 0x2DC6},
{0x2DC8, 0x2DCE}, {0x2DD0, 0x2DD6}, {0x2DD8, 0x2DDE}, {0x2DE0, 0x2E5D},
{0x2E80, 0x2E99}, {0x2E9B, 0x2EF3}, {0x2F00, 0x2FD5}, {0x2FF0, 0x2FFB},
{0x3001, 0x303F}, {0x3041, 0x3096}, {0x3099, 0x30FF}, {0x3105, 0x312F},
{0x3131, 0x318E}, {0x3190, 0x31E3}, {0x31F0, 0x321E}, {0x3220, 0xA48C},
{0xA490, 0xA4C6}, {0xA4D0, 0xA62B}, {0xA640, 0xA6F7}, {0xA700, 0xA7CA},
{0xA7D5, 0xA7D9}, {0xA7F2, 0xA82C}, {0xA830, 0xA839}, {0xA840, 0xA877},
{0xA880, 0xA8C5}, {0xA8CE, 0xA8D9}, {0xA8E0, 0xA953}, {0xA95F, 0xA97C},
{0xA980, 0xA9CD}, {0xA9CF, 0xA9D9}, {0xA9DE, 0xA9FE}, {0xAA00, 0xAA36},
{0xAA40, 0xAA4D}, {0xAA50, 0xAA59}, {0xAA5C, 0xAAC2}, {0xAADB, 0xAAF6},
{0xAB01, 0xAB06}, {0xAB09, 0xAB0E}, {0xAB11, 0xAB16}, {0xAB20, 0xAB26},
{0xAB28, 0xAB2E}, {0xAB30, 0xAB6B}, {0xAB70, 0xABED}, {0xABF0, 0xABF9},
{0xAC00, 0xD7A3}, {0xD7B0, 0xD7C6}, {0xD7CB, 0xD7FB}, {0xF900, 0xFA6D},
{0xFA70, 0xFAD9}, {0xFB00, 0xFB06}, {0xFB13, 0xFB17}, {0xFB1D, 0xFB36},
{0xFB38, 0xFB3C}, {0xFB46, 0xFBC2}, {0xFBD3, 0xFD8F}, {0xFD92, 0xFDC7},
{0xFDF0, 0xFE19}, {0xFE20, 0xFE52}, {0xFE54, 0xFE66}, {0xFE68, 0xFE6B},
{0xFE70, 0xFE74}, {0xFE76, 0xFEFC}, {0xFF01, 0xFFBE}, {0xFFC2, 0xFFC7},
{0xFFCA, 0xFFCF}, {0xFFD2, 0xFFD7}, {0xFFDA, 0xFFDC}, {0xFFE0, 0xFFE6},
{0xFFE8, 0xFFEE}
@@ -708,68 +716,74 @@ static const crange graphRangeTable[] = {
{0x102A0, 0x102D0}, {0x102E0, 0x102FB}, {0x10300, 0x10323}, {0x1032D, 0x1034A},
{0x10350, 0x1037A}, {0x10380, 0x1039D}, {0x1039F, 0x103C3}, {0x103C8, 0x103D5},
{0x10400, 0x1049D}, {0x104A0, 0x104A9}, {0x104B0, 0x104D3}, {0x104D8, 0x104FB},
{0x10500, 0x10527}, {0x10530, 0x10563}, {0x10600, 0x10736}, {0x10740, 0x10755},
{0x10760, 0x10767}, {0x10800, 0x10805}, {0x1080A, 0x10835}, {0x1083F, 0x10855},
{0x10857, 0x1089E}, {0x108A7, 0x108AF}, {0x108E0, 0x108F2}, {0x108FB, 0x1091B},
{0x1091F, 0x10939}, {0x10980, 0x109B7}, {0x109BC, 0x109CF}, {0x109D2, 0x10A03},
{0x10A0C, 0x10A13}, {0x10A15, 0x10A17}, {0x10A19, 0x10A35}, {0x10A38, 0x10A3A},
{0x10A3F, 0x10A48}, {0x10A50, 0x10A58}, {0x10A60, 0x10A9F}, {0x10AC0, 0x10AE6},
{0x10AEB, 0x10AF6}, {0x10B00, 0x10B35}, {0x10B39, 0x10B55}, {0x10B58, 0x10B72},
{0x10B78, 0x10B91}, {0x10B99, 0x10B9C}, {0x10BA9, 0x10BAF}, {0x10C00, 0x10C48},
{0x10C80, 0x10CB2}, {0x10CC0, 0x10CF2}, {0x10CFA, 0x10D27}, {0x10D30, 0x10D39},
{0x10E60, 0x10E7E}, {0x10E80, 0x10EA9}, {0x10EAB, 0x10EAD}, {0x10F00, 0x10F27},
{0x10F30, 0x10F59}, {0x10FB0, 0x10FCB}, {0x10FE0, 0x10FF6}, {0x11000, 0x1104D},
{0x11052, 0x1106F}, {0x1107F, 0x110BC}, {0x110BE, 0x110C1}, {0x110D0, 0x110E8},
{0x110F0, 0x110F9}, {0x11100, 0x11134}, {0x11136, 0x11147}, {0x11150, 0x11176},
{0x11180, 0x111DF}, {0x111E1, 0x111F4}, {0x11200, 0x11211}, {0x11213, 0x1123E},
{0x11280, 0x11286}, {0x1128A, 0x1128D}, {0x1128F, 0x1129D}, {0x1129F, 0x112A9},
{0x112B0, 0x112EA}, {0x112F0, 0x112F9}, {0x11300, 0x11303}, {0x11305, 0x1130C},
{0x11313, 0x11328}, {0x1132A, 0x11330}, {0x11335, 0x11339}, {0x1133B, 0x11344},
{0x1134B, 0x1134D}, {0x1135D, 0x11363}, {0x11366, 0x1136C}, {0x11370, 0x11374},
{0x11400, 0x1145B}, {0x1145D, 0x11461}, {0x11480, 0x114C7}, {0x114D0, 0x114D9},
{0x11580, 0x115B5}, {0x115B8, 0x115DD}, {0x11600, 0x11644}, {0x11650, 0x11659},
{0x11660, 0x1166C}, {0x11680, 0x116B8}, {0x116C0, 0x116C9}, {0x11700, 0x1171A},
{0x1171D, 0x1172B}, {0x11730, 0x1173F}, {0x11800, 0x1183B}, {0x118A0, 0x118F2},
{0x118FF, 0x11906}, {0x1190C, 0x11913}, {0x11918, 0x11935}, {0x1193B, 0x11946},
{0x11950, 0x11959}, {0x119A0, 0x119A7}, {0x119AA, 0x119D7}, {0x119DA, 0x119E4},
{0x11A00, 0x11A47}, {0x11A50, 0x11AA2}, {0x11AC0, 0x11AF8}, {0x11C00, 0x11C08},
{0x11C0A, 0x11C36}, {0x11C38, 0x11C45}, {0x11C50, 0x11C6C}, {0x11C70, 0x11C8F},
{0x11C92, 0x11CA7}, {0x11CA9, 0x11CB6}, {0x11D00, 0x11D06}, {0x11D0B, 0x11D36},
{0x11D3F, 0x11D47}, {0x11D50, 0x11D59}, {0x11D60, 0x11D65}, {0x11D6A, 0x11D8E},
{0x11D93, 0x11D98}, {0x11DA0, 0x11DA9}, {0x11EE0, 0x11EF8}, {0x11FC0, 0x11FF1},
{0x11FFF, 0x12399}, {0x12400, 0x1246E}, {0x12470, 0x12474}, {0x12480, 0x12543},
{0x13000, 0x1342E}, {0x14400, 0x14646}, {0x16800, 0x16A38}, {0x16A40, 0x16A5E},
{0x16A60, 0x16A69}, {0x16AD0, 0x16AED}, {0x16AF0, 0x16AF5}, {0x16B00, 0x16B45},
{0x16B50, 0x16B59}, {0x16B5B, 0x16B61}, {0x16B63, 0x16B77}, {0x16B7D, 0x16B8F},
{0x16E40, 0x16E9A}, {0x16F00, 0x16F4A}, {0x16F4F, 0x16F87}, {0x16F8F, 0x16F9F},
{0x16FE0, 0x16FE4}, {0x17000, 0x187F7}, {0x18800, 0x18CD5}, {0x18D00, 0x18D08},
{0x1B000, 0x1B11E}, {0x1B150, 0x1B152}, {0x1B164, 0x1B167}, {0x1B170, 0x1B2FB},
{0x1BC00, 0x1BC6A}, {0x1BC70, 0x1BC7C}, {0x1BC80, 0x1BC88}, {0x1BC90, 0x1BC99},
{0x1BC9C, 0x1BC9F}, {0x1D000, 0x1D0F5}, {0x1D100, 0x1D126}, {0x1D129, 0x1D172},
{0x1D17B, 0x1D1E8}, {0x1D200, 0x1D245}, {0x1D2E0, 0x1D2F3}, {0x1D300, 0x1D356},
{0x1D360, 0x1D378}, {0x1D400, 0x1D454}, {0x1D456, 0x1D49C}, {0x1D4A9, 0x1D4AC},
{0x1D4AE, 0x1D4B9}, {0x1D4BD, 0x1D4C3}, {0x1D4C5, 0x1D505}, {0x1D507, 0x1D50A},
{0x1D50D, 0x1D514}, {0x1D516, 0x1D51C}, {0x1D51E, 0x1D539}, {0x1D53B, 0x1D53E},
{0x1D540, 0x1D544}, {0x1D54A, 0x1D550}, {0x1D552, 0x1D6A5}, {0x1D6A8, 0x1D7CB},
{0x1D7CE, 0x1DA8B}, {0x1DA9B, 0x1DA9F}, {0x1DAA1, 0x1DAAF}, {0x1E000, 0x1E006},
{0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E026, 0x1E02A}, {0x1E100, 0x1E12C},
{0x1E130, 0x1E13D}, {0x1E140, 0x1E149}, {0x1E2C0, 0x1E2F9}, {0x1E800, 0x1E8C4},
{0x1E8C7, 0x1E8D6}, {0x1E900, 0x1E94B}, {0x1E950, 0x1E959}, {0x1EC71, 0x1ECB4},
{0x1ED01, 0x1ED3D}, {0x1EE00, 0x1EE03}, {0x1EE05, 0x1EE1F}, {0x1EE29, 0x1EE32},
{0x1EE34, 0x1EE37}, {0x1EE4D, 0x1EE4F}, {0x1EE67, 0x1EE6A}, {0x1EE6C, 0x1EE72},
{0x1EE74, 0x1EE77}, {0x1EE79, 0x1EE7C}, {0x1EE80, 0x1EE89}, {0x1EE8B, 0x1EE9B},
{0x1EEA1, 0x1EEA3}, {0x1EEA5, 0x1EEA9}, {0x1EEAB, 0x1EEBB}, {0x1F000, 0x1F02B},
{0x1F030, 0x1F093}, {0x1F0A0, 0x1F0AE}, {0x1F0B1, 0x1F0BF}, {0x1F0C1, 0x1F0CF},
{0x1F0D1, 0x1F0F5}, {0x1F100, 0x1F1AD}, {0x1F1E6, 0x1F202}, {0x1F210, 0x1F23B},
{0x1F240, 0x1F248}, {0x1F260, 0x1F265}, {0x1F300, 0x1F6D7}, {0x1F6E0, 0x1F6EC},
{0x1F6F0, 0x1F6FC}, {0x1F700, 0x1F773}, {0x1F780, 0x1F7D8}, {0x1F7E0, 0x1F7EB},
{0x1F800, 0x1F80B}, {0x1F810, 0x1F847}, {0x1F850, 0x1F859}, {0x1F860, 0x1F887},
{0x1F890, 0x1F8AD}, {0x1F900, 0x1F978}, {0x1F97A, 0x1F9CB}, {0x1F9CD, 0x1FA53},
{0x1FA60, 0x1FA6D}, {0x1FA70, 0x1FA74}, {0x1FA78, 0x1FA7A}, {0x1FA80, 0x1FA86},
{0x1FA90, 0x1FAA8}, {0x1FAB0, 0x1FAB6}, {0x1FAC0, 0x1FAC2}, {0x1FAD0, 0x1FAD6},
{0x1FB00, 0x1FB92}, {0x1FB94, 0x1FBCA}, {0x1FBF0, 0x1FBF9}, {0x20000, 0x2A6DD},
{0x2A700, 0x2B734}, {0x2B740, 0x2B81D}, {0x2B820, 0x2CEA1}, {0x2CEB0, 0x2EBE0},
{0x2F800, 0x2FA1D}, {0x30000, 0x3134A}, {0xE0100, 0xE01EF}
{0x10500, 0x10527}, {0x10530, 0x10563}, {0x1056F, 0x1057A}, {0x1057C, 0x1058A},
{0x1058C, 0x10592}, {0x10597, 0x105A1}, {0x105A3, 0x105B1}, {0x105B3, 0x105B9},
{0x10600, 0x10736}, {0x10740, 0x10755}, {0x10760, 0x10767}, {0x10780, 0x10785},
{0x10787, 0x107B0}, {0x107B2, 0x107BA}, {0x10800, 0x10805}, {0x1080A, 0x10835},
{0x1083F, 0x10855}, {0x10857, 0x1089E}, {0x108A7, 0x108AF}, {0x108E0, 0x108F2},
{0x108FB, 0x1091B}, {0x1091F, 0x10939}, {0x10980, 0x109B7}, {0x109BC, 0x109CF},
{0x109D2, 0x10A03}, {0x10A0C, 0x10A13}, {0x10A15, 0x10A17}, {0x10A19, 0x10A35},
{0x10A38, 0x10A3A}, {0x10A3F, 0x10A48}, {0x10A50, 0x10A58}, {0x10A60, 0x10A9F},
{0x10AC0, 0x10AE6}, {0x10AEB, 0x10AF6}, {0x10B00, 0x10B35}, {0x10B39, 0x10B55},
{0x10B58, 0x10B72}, {0x10B78, 0x10B91}, {0x10B99, 0x10B9C}, {0x10BA9, 0x10BAF},
{0x10C00, 0x10C48}, {0x10C80, 0x10CB2}, {0x10CC0, 0x10CF2}, {0x10CFA, 0x10D27},
{0x10D30, 0x10D39}, {0x10E60, 0x10E7E}, {0x10E80, 0x10EA9}, {0x10EAB, 0x10EAD},
{0x10F00, 0x10F27}, {0x10F30, 0x10F59}, {0x10F70, 0x10F89}, {0x10FB0, 0x10FCB},
{0x10FE0, 0x10FF6}, {0x11000, 0x1104D}, {0x11052, 0x11075}, {0x1107F, 0x110BC},
{0x110BE, 0x110C2}, {0x110D0, 0x110E8}, {0x110F0, 0x110F9}, {0x11100, 0x11134},
{0x11136, 0x11147}, {0x11150, 0x11176}, {0x11180, 0x111DF}, {0x111E1, 0x111F4},
{0x11200, 0x11211}, {0x11213, 0x1123E}, {0x11280, 0x11286}, {0x1128A, 0x1128D},
{0x1128F, 0x1129D}, {0x1129F, 0x112A9}, {0x112B0, 0x112EA}, {0x112F0, 0x112F9},
{0x11300, 0x11303}, {0x11305, 0x1130C}, {0x11313, 0x11328}, {0x1132A, 0x11330},
{0x11335, 0x11339}, {0x1133B, 0x11344}, {0x1134B, 0x1134D}, {0x1135D, 0x11363},
{0x11366, 0x1136C}, {0x11370, 0x11374}, {0x11400, 0x1145B}, {0x1145D, 0x11461},
{0x11480, 0x114C7}, {0x114D0, 0x114D9}, {0x11580, 0x115B5}, {0x115B8, 0x115DD},
{0x11600, 0x11644}, {0x11650, 0x11659}, {0x11660, 0x1166C}, {0x11680, 0x116B9},
{0x116C0, 0x116C9}, {0x11700, 0x1171A}, {0x1171D, 0x1172B}, {0x11730, 0x11746},
{0x11800, 0x1183B}, {0x118A0, 0x118F2}, {0x118FF, 0x11906}, {0x1190C, 0x11913},
{0x11918, 0x11935}, {0x1193B, 0x11946}, {0x11950, 0x11959}, {0x119A0, 0x119A7},
{0x119AA, 0x119D7}, {0x119DA, 0x119E4}, {0x11A00, 0x11A47}, {0x11A50, 0x11AA2},
{0x11AB0, 0x11AF8}, {0x11C00, 0x11C08}, {0x11C0A, 0x11C36}, {0x11C38, 0x11C45},
{0x11C50, 0x11C6C}, {0x11C70, 0x11C8F}, {0x11C92, 0x11CA7}, {0x11CA9, 0x11CB6},
{0x11D00, 0x11D06}, {0x11D0B, 0x11D36}, {0x11D3F, 0x11D47}, {0x11D50, 0x11D59},
{0x11D60, 0x11D65}, {0x11D6A, 0x11D8E}, {0x11D93, 0x11D98}, {0x11DA0, 0x11DA9},
{0x11EE0, 0x11EF8}, {0x11FC0, 0x11FF1}, {0x11FFF, 0x12399}, {0x12400, 0x1246E},
{0x12470, 0x12474}, {0x12480, 0x12543}, {0x12F90, 0x12FF2}, {0x13000, 0x1342E},
{0x14400, 0x14646}, {0x16800, 0x16A38}, {0x16A40, 0x16A5E}, {0x16A60, 0x16A69},
{0x16A6E, 0x16ABE}, {0x16AC0, 0x16AC9}, {0x16AD0, 0x16AED}, {0x16AF0, 0x16AF5},
{0x16B00, 0x16B45}, {0x16B50, 0x16B59}, {0x16B5B, 0x16B61}, {0x16B63, 0x16B77},
{0x16B7D, 0x16B8F}, {0x16E40, 0x16E9A}, {0x16F00, 0x16F4A}, {0x16F4F, 0x16F87},
{0x16F8F, 0x16F9F}, {0x16FE0, 0x16FE4}, {0x17000, 0x187F7}, {0x18800, 0x18CD5},
{0x18D00, 0x18D08}, {0x1AFF0, 0x1AFF3}, {0x1AFF5, 0x1AFFB}, {0x1B000, 0x1B122},
{0x1B150, 0x1B152}, {0x1B164, 0x1B167}, {0x1B170, 0x1B2FB}, {0x1BC00, 0x1BC6A},
{0x1BC70, 0x1BC7C}, {0x1BC80, 0x1BC88}, {0x1BC90, 0x1BC99}, {0x1BC9C, 0x1BC9F},
{0x1CF00, 0x1CF2D}, {0x1CF30, 0x1CF46}, {0x1CF50, 0x1CFC3}, {0x1D000, 0x1D0F5},
{0x1D100, 0x1D126}, {0x1D129, 0x1D172}, {0x1D17B, 0x1D1EA}, {0x1D200, 0x1D245},
{0x1D2E0, 0x1D2F3}, {0x1D300, 0x1D356}, {0x1D360, 0x1D378}, {0x1D400, 0x1D454},
{0x1D456, 0x1D49C}, {0x1D4A9, 0x1D4AC}, {0x1D4AE, 0x1D4B9}, {0x1D4BD, 0x1D4C3},
{0x1D4C5, 0x1D505}, {0x1D507, 0x1D50A}, {0x1D50D, 0x1D514}, {0x1D516, 0x1D51C},
{0x1D51E, 0x1D539}, {0x1D53B, 0x1D53E}, {0x1D540, 0x1D544}, {0x1D54A, 0x1D550},
{0x1D552, 0x1D6A5}, {0x1D6A8, 0x1D7CB}, {0x1D7CE, 0x1DA8B}, {0x1DA9B, 0x1DA9F},
{0x1DAA1, 0x1DAAF}, {0x1DF00, 0x1DF1E}, {0x1E000, 0x1E006}, {0x1E008, 0x1E018},
{0x1E01B, 0x1E021}, {0x1E026, 0x1E02A}, {0x1E100, 0x1E12C}, {0x1E130, 0x1E13D},
{0x1E140, 0x1E149}, {0x1E290, 0x1E2AE}, {0x1E2C0, 0x1E2F9}, {0x1E7E0, 0x1E7E6},
{0x1E7E8, 0x1E7EB}, {0x1E7F0, 0x1E7FE}, {0x1E800, 0x1E8C4}, {0x1E8C7, 0x1E8D6},
{0x1E900, 0x1E94B}, {0x1E950, 0x1E959}, {0x1EC71, 0x1ECB4}, {0x1ED01, 0x1ED3D},
{0x1EE00, 0x1EE03}, {0x1EE05, 0x1EE1F}, {0x1EE29, 0x1EE32}, {0x1EE34, 0x1EE37},
{0x1EE4D, 0x1EE4F}, {0x1EE67, 0x1EE6A}, {0x1EE6C, 0x1EE72}, {0x1EE74, 0x1EE77},
{0x1EE79, 0x1EE7C}, {0x1EE80, 0x1EE89}, {0x1EE8B, 0x1EE9B}, {0x1EEA1, 0x1EEA3},
{0x1EEA5, 0x1EEA9}, {0x1EEAB, 0x1EEBB}, {0x1F000, 0x1F02B}, {0x1F030, 0x1F093},
{0x1F0A0, 0x1F0AE}, {0x1F0B1, 0x1F0BF}, {0x1F0C1, 0x1F0CF}, {0x1F0D1, 0x1F0F5},
{0x1F100, 0x1F1AD}, {0x1F1E6, 0x1F202}, {0x1F210, 0x1F23B}, {0x1F240, 0x1F248},
{0x1F260, 0x1F265}, {0x1F300, 0x1F6D7}, {0x1F6DD, 0x1F6EC}, {0x1F6F0, 0x1F6FC},
{0x1F700, 0x1F773}, {0x1F780, 0x1F7D8}, {0x1F7E0, 0x1F7EB}, {0x1F800, 0x1F80B},
{0x1F810, 0x1F847}, {0x1F850, 0x1F859}, {0x1F860, 0x1F887}, {0x1F890, 0x1F8AD},
{0x1F900, 0x1FA53}, {0x1FA60, 0x1FA6D}, {0x1FA70, 0x1FA74}, {0x1FA78, 0x1FA7C},
{0x1FA80, 0x1FA86}, {0x1FA90, 0x1FAAC}, {0x1FAB0, 0x1FABA}, {0x1FAC0, 0x1FAC5},
{0x1FAD0, 0x1FAD9}, {0x1FAE0, 0x1FAE7}, {0x1FAF0, 0x1FAF6}, {0x1FB00, 0x1FB92},
{0x1FB94, 0x1FBCA}, {0x1FBF0, 0x1FBF9}, {0x20000, 0x2A6DF}, {0x2A700, 0x2B738},
{0x2B740, 0x2B81D}, {0x2B820, 0x2CEA1}, {0x2CEB0, 0x2EBE0}, {0x2F800, 0x2FA1D},
{0x30000, 0x3134A}, {0xE0100, 0xE01EF}
#endif
};
@@ -781,22 +795,23 @@ static const chr graphCharTable[] = {
0xA3C, 0xA47, 0xA48, 0xA51, 0xA5E, 0xAB2, 0xAB3, 0xAD0, 0xB0F,
0xB10, 0xB32, 0xB33, 0xB47, 0xB48, 0xB5C, 0xB5D, 0xB82, 0xB83,
0xB99, 0xB9A, 0xB9C, 0xB9E, 0xB9F, 0xBA3, 0xBA4, 0xBD0, 0xBD7,
0xC55, 0xC56, 0xCD5, 0xCD6, 0xCDE, 0xCF1, 0xCF2, 0xDBD, 0xDCA,
0xDD6, 0xE81, 0xE82, 0xE84, 0xEA5, 0xEC6, 0x10C7, 0x10CD, 0x1258,
0x12C0, 0x1772, 0x1773, 0x1940, 0x1F59, 0x1F5B, 0x1F5D, 0x2070, 0x2071,
0x2D27, 0x2D2D, 0x2D6F, 0x2D70, 0xFB3E, 0xFB40, 0xFB41, 0xFB43, 0xFB44,
0xFFFC, 0xFFFD
0xC55, 0xC56, 0xC5D, 0xCD5, 0xCD6, 0xCDD, 0xCDE, 0xCF1, 0xCF2,
0xDBD, 0xDCA, 0xDD6, 0xE81, 0xE82, 0xE84, 0xEA5, 0xEC6, 0x10C7,
0x10CD, 0x1258, 0x12C0, 0x1772, 0x1773, 0x1940, 0x1F59, 0x1F5B, 0x1F5D,
0x2070, 0x2071, 0x2D27, 0x2D2D, 0x2D6F, 0x2D70, 0xA7D0, 0xA7D1, 0xA7D3,
0xFB3E, 0xFB40, 0xFB41, 0xFB43, 0xFB44, 0xFDCF, 0xFFFC, 0xFFFD
#if CHRBITS > 16
,0x1003C, 0x1003D, 0x101A0, 0x1056F, 0x10808, 0x10837, 0x10838, 0x1083C, 0x108F4,
0x108F5, 0x1093F, 0x10A05, 0x10A06, 0x10EB0, 0x10EB1, 0x11288, 0x1130F, 0x11310,
0x11332, 0x11333, 0x11347, 0x11348, 0x11350, 0x11357, 0x11909, 0x11915, 0x11916,
0x11937, 0x11938, 0x11D08, 0x11D09, 0x11D3A, 0x11D3C, 0x11D3D, 0x11D67, 0x11D68,
0x11D90, 0x11D91, 0x11FB0, 0x16A6E, 0x16A6F, 0x16FF0, 0x16FF1, 0x1D49E, 0x1D49F,
0x1D4A2, 0x1D4A5, 0x1D4A6, 0x1D4BB, 0x1D546, 0x1E023, 0x1E024, 0x1E14E, 0x1E14F,
0x1E2FF, 0x1E95E, 0x1E95F, 0x1EE21, 0x1EE22, 0x1EE24, 0x1EE27, 0x1EE39, 0x1EE3B,
0x1EE42, 0x1EE47, 0x1EE49, 0x1EE4B, 0x1EE51, 0x1EE52, 0x1EE54, 0x1EE57, 0x1EE59,
0x1EE5B, 0x1EE5D, 0x1EE5F, 0x1EE61, 0x1EE62, 0x1EE64, 0x1EE7E, 0x1EEF0, 0x1EEF1,
0x1F250, 0x1F251, 0x1F8B0, 0x1F8B1
,0x1003C, 0x1003D, 0x101A0, 0x10594, 0x10595, 0x105BB, 0x105BC, 0x10808, 0x10837,
0x10838, 0x1083C, 0x108F4, 0x108F5, 0x1093F, 0x10A05, 0x10A06, 0x10EB0, 0x10EB1,
0x11288, 0x1130F, 0x11310, 0x11332, 0x11333, 0x11347, 0x11348, 0x11350, 0x11357,
0x11909, 0x11915, 0x11916, 0x11937, 0x11938, 0x11D08, 0x11D09, 0x11D3A, 0x11D3C,
0x11D3D, 0x11D67, 0x11D68, 0x11D90, 0x11D91, 0x11FB0, 0x16FF0, 0x16FF1, 0x1AFFD,
0x1AFFE, 0x1D49E, 0x1D49F, 0x1D4A2, 0x1D4A5, 0x1D4A6, 0x1D4BB, 0x1D546, 0x1E023,
0x1E024, 0x1E14E, 0x1E14F, 0x1E2FF, 0x1E7ED, 0x1E7EE, 0x1E95E, 0x1E95F, 0x1EE21,
0x1EE22, 0x1EE24, 0x1EE27, 0x1EE39, 0x1EE3B, 0x1EE42, 0x1EE47, 0x1EE49, 0x1EE4B,
0x1EE51, 0x1EE52, 0x1EE54, 0x1EE57, 0x1EE59, 0x1EE5B, 0x1EE5D, 0x1EE5F, 0x1EE61,
0x1EE62, 0x1EE64, 0x1EE7E, 0x1EEF0, 0x1EEF1, 0x1F250, 0x1F251, 0x1F7F0, 0x1F8B0,
0x1F8B1
#endif
};
+34 -16
View File
@@ -108,7 +108,7 @@ declare 22 {deprecated {No longer in use, changed to macro}} {
Tcl_Obj *Tcl_DbNewBooleanObj(int boolValue, const char *file, int line)
}
declare 23 {
Tcl_Obj *Tcl_DbNewByteArrayObj(const unsigned char *bytes, int length,
Tcl_Obj *Tcl_DbNewByteArrayObj(const unsigned char *bytes, int numBytes,
const char *file, int line)
}
declare 24 {
@@ -143,7 +143,7 @@ declare 32 {
int *boolPtr)
}
declare 33 {
unsigned char *Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, int *lengthPtr)
unsigned char *Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, int *numBytesPtr)
}
declare 34 {
int Tcl_GetDouble(Tcl_Interp *interp, const char *src, double *doublePtr)
@@ -202,7 +202,7 @@ declare 49 {deprecated {No longer in use, changed to macro}} {
Tcl_Obj *Tcl_NewBooleanObj(int boolValue)
}
declare 50 {
Tcl_Obj *Tcl_NewByteArrayObj(const unsigned char *bytes, int length)
Tcl_Obj *Tcl_NewByteArrayObj(const unsigned char *bytes, int numBytes)
}
declare 51 {
Tcl_Obj *Tcl_NewDoubleObj(double doubleValue)
@@ -226,11 +226,11 @@ declare 57 {deprecated {No longer in use, changed to macro}} {
void Tcl_SetBooleanObj(Tcl_Obj *objPtr, int boolValue)
}
declare 58 {
unsigned char *Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int length)
unsigned char *Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int numBytes)
}
declare 59 {
void Tcl_SetByteArrayObj(Tcl_Obj *objPtr, const unsigned char *bytes,
int length)
int numBytes)
}
declare 60 {
void Tcl_SetDoubleObj(Tcl_Obj *objPtr, double doubleValue)
@@ -514,7 +514,7 @@ declare 143 {
void Tcl_Finalize(void)
}
declare 144 {nostub {Don't use this function in a stub-enabled extension}} {
void Tcl_FindExecutable(const char *argv0)
const char *Tcl_FindExecutable(const char *argv0)
}
declare 145 {
Tcl_HashEntry *Tcl_FirstHashEntry(Tcl_HashTable *tablePtr,
@@ -813,7 +813,7 @@ declare 229 {
void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr)
}
declare 230 {nostub {Don't use this function in a stub-enabled extension}} {
void Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
const char *Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
}
declare 231 {
int Tcl_SetRecursionLimit(Tcl_Interp *interp, int depth)
@@ -2348,18 +2348,18 @@ declare 635 {
# TIP #445
declare 636 {
void Tcl_FreeIntRep(Tcl_Obj *objPtr)
void Tcl_FreeInternalRep(Tcl_Obj *objPtr)
}
declare 637 {
char *Tcl_InitStringRep(Tcl_Obj *objPtr, const char *bytes,
unsigned int numBytes)
}
declare 638 {
Tcl_ObjIntRep *Tcl_FetchIntRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr)
Tcl_ObjInternalRep *Tcl_FetchInternalRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr)
}
declare 639 {
void Tcl_StoreIntRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr,
const Tcl_ObjIntRep *irPtr)
void Tcl_StoreInternalRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr,
const Tcl_ObjInternalRep *irPtr)
}
declare 640 {
int Tcl_HasStringRep(Tcl_Obj *objPtr)
@@ -2402,6 +2402,16 @@ declare 648 {
int length, Tcl_DString *dsPtr)
}
# TIP #568
declare 649 {
unsigned char *TclGetBytesFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
int *numBytesPtr)
}
declare 650 {
unsigned char *Tcl_GetBytesFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
size_t *numBytesPtr)
}
# TIP #481
declare 651 {
char *TclGetStringFromObj(Tcl_Obj *objPtr, size_t *lengthPtr)
@@ -2410,7 +2420,7 @@ declare 652 {
Tcl_UniChar *TclGetUnicodeFromObj(Tcl_Obj *objPtr, size_t *lengthPtr)
}
declare 653 {
unsigned char *TclGetByteArrayFromObj(Tcl_Obj *objPtr, size_t *lengthPtr)
unsigned char *TclGetByteArrayFromObj(Tcl_Obj *objPtr, size_t *numBytesPtr)
}
# TIP #575
@@ -2423,6 +2433,14 @@ declare 655 {
declare 656 {
const char *Tcl_UtfPrev(const char *src, const char *start)
}
declare 657 {
int Tcl_UniCharIsUnicode(int ch)
}
# TIP #511
declare 660 {
int Tcl_AsyncMarkFromSignal(Tcl_AsyncHandler async, int sigNumber)
}
# ----- BASELINE -- FOR -- 8.7.0 ----- #
@@ -2485,13 +2503,13 @@ export {
Tcl_LibraryInitProc *initProc, Tcl_LibraryInitProc *safeInitProc)
}
export {
void Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
const char *Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
}
export {
Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc)
}
export {
void Tcl_FindExecutable(const char *argv0)
const char *Tcl_FindExecutable(const char *argv0)
}
export {
const char *Tcl_InitStubs(Tcl_Interp *interp, const char *version,
@@ -2509,10 +2527,10 @@ export {
void Tcl_GetMemoryInfo(Tcl_DString *dsPtr)
}
export {
void Tcl_InitSubsystems(void)
const char *Tcl_InitSubsystems(void)
}
export {
int TclZipfs_AppHook(int *argc, char ***argv)
const char *TclZipfs_AppHook(int *argc, char ***argv)
}
# Local Variables:
+14 -13
View File
@@ -50,10 +50,10 @@ extern "C" {
#define TCL_MAJOR_VERSION 8
#define TCL_MINOR_VERSION 7
#define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE
#define TCL_RELEASE_SERIAL 4
#define TCL_RELEASE_SERIAL 6
#define TCL_VERSION "8.7"
#define TCL_PATCH_LEVEL "8.7a4"
#define TCL_PATCH_LEVEL "8.7a6"
#if !defined(TCL_NO_DEPRECATED) || defined(RC_INVOKED)
/*
@@ -749,13 +749,13 @@ typedef struct Tcl_ObjType {
} Tcl_ObjType;
/*
* The following structure stores an internal representation (intrep) for
* a Tcl value. An intrep is associated with an Tcl_ObjType when both
* The following structure stores an internal representation (internalrep) for
* a Tcl value. An internalrep is associated with an Tcl_ObjType when both
* are stored in the same Tcl_Obj. The routines of the Tcl_ObjType govern
* the handling of the intrep.
* the handling of the internalrep.
*/
typedef union Tcl_ObjIntRep { /* The internal representation: */
typedef union Tcl_ObjInternalRep { /* The internal representation: */
long longValue; /* - an long integer value. */
double doubleValue; /* - a double-precision floating value. */
void *otherValuePtr; /* - another, type-specific value, */
@@ -769,7 +769,7 @@ typedef union Tcl_ObjIntRep { /* The internal representation: */
void *ptr; /* not used internally any more. */
unsigned long value;
} ptrAndLongRep;
} Tcl_ObjIntRep;
} Tcl_ObjInternalRep;
/*
* One of the following structures exists for each object in the Tcl system.
@@ -796,7 +796,7 @@ typedef struct Tcl_Obj {
* corresponds to the type of the object's
* internal rep. NULL indicates the object has
* no internal rep (has no type). */
Tcl_ObjIntRep internalRep; /* The internal representation: */
Tcl_ObjInternalRep internalRep; /* The internal representation: */
} Tcl_Obj;
@@ -2136,7 +2136,7 @@ typedef struct Tcl_EncodingType {
#if TCL_UTF_MAX > 3
/*
* int isn't 100% accurate as it should be a strict 4-byte value
* (perhaps wchar_t). ILP64/SILP64 systems may have troubles. The
* (perhaps int32_t). ILP64/SILP64 systems may have troubles. The
* size of this value must be reflected correctly in regcustom.h.
*/
typedef int Tcl_UniChar;
@@ -2383,15 +2383,16 @@ EXTERN void Tcl_MainEx(int argc, char **argv,
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
const char *version, int exact);
EXTERN void Tcl_InitSubsystems(void);
EXTERN const char * Tcl_InitSubsystems(void);
EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
EXTERN const char * Tcl_SetPreInitScript(const char *string);
#ifndef TCL_NO_DEPRECATED
# define Tcl_StaticPackage Tcl_StaticLibrary
#endif
#ifdef _WIN32
EXTERN int TclZipfs_AppHook(int *argc, wchar_t ***argv);
EXTERN const char *TclZipfs_AppHook(int *argc, wchar_t ***argv);
#else
EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv);
#endif
/*
@@ -2478,7 +2479,7 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
++(objPtr)->refCount
/*
* Use do/while0 idiom for optimum correctness without compiler warnings.
* http://c2.com/cgi/wiki?TrivialDoWhileLoop
* https://wiki.c2.com/?TrivialDoWhileLoop
*/
# undef Tcl_DecrRefCount
# define Tcl_DecrRefCount(objPtr) \
+6 -6
View File
@@ -865,7 +865,7 @@ CompileAssembleObj(
* is valid in the current context.
*/
ByteCodeGetIntRep(objPtr, &assembleCodeType, codePtr);
ByteCodeGetInternalRep(objPtr, &assembleCodeType, codePtr);
if (codePtr) {
namespacePtr = iPtr->varFramePtr->nsPtr;
@@ -882,7 +882,7 @@ CompileAssembleObj(
* Not valid, so free it and regenerate.
*/
Tcl_StoreIntRep(objPtr, &assembleCodeType, NULL);
Tcl_StoreInternalRep(objPtr, &assembleCodeType, NULL);
}
/*
@@ -1985,7 +1985,7 @@ CreateMirrorJumpTable(
* table. */
int i;
if (Tcl_ListObjGetElements(interp, jumps, &objc, &objv) != TCL_OK) {
if (TclListObjGetElements(interp, jumps, &objc, &objv) != TCL_OK) {
return TCL_ERROR;
}
if (objc % 2 != 0) {
@@ -4289,7 +4289,7 @@ AddBasicBlockRangeToErrorInfo(
* DupAssembleCodeInternalRep --
*
* Part of the Tcl object type implementation for Tcl assembly language
* bytecode. We do not copy the bytecode intrep. Instead, we return
* bytecode. We do not copy the bytecode internalrep. Instead, we return
* without setting copyPtr->typePtr, so the copy is a plain string copy
* of the assembly source, and if it is to be used as a compiled
* expression, it will need to be reprocessed.
@@ -4298,7 +4298,7 @@ AddBasicBlockRangeToErrorInfo(
* usual (only?) time Tcl_DuplicateObj() will be called is when the copy
* is about to be modified, which would invalidate any copied bytecode
* anyway. The only reason it might make sense to copy the bytecode is if
* we had some modifying routines that operated directly on the intrep,
* we had some modifying routines that operated directly on the internalrep,
* as we do for lists and dicts.
*
* Results:
@@ -4342,7 +4342,7 @@ FreeAssembleCodeInternalRep(
{
ByteCode *codePtr;
ByteCodeGetIntRep(objPtr, &assembleCodeType, codePtr);
ByteCodeGetInternalRep(objPtr, &assembleCodeType, codePtr);
assert(codePtr != NULL);
TclReleaseByteCode(codePtr);
+153 -57
View File
@@ -25,9 +25,9 @@ typedef struct AsyncHandler {
int ready; /* Non-zero means this handler should be
* invoked in the next call to
* Tcl_AsyncInvoke. */
struct AsyncHandler *nextPtr;
/* Next in list of all handlers for the
* process. */
struct AsyncHandler *nextPtr, *prevPtr;
/* Next, previous in list of all handlers
* for the process. */
Tcl_AsyncProc *proc; /* Procedure to call when handler is
* invoked. */
ClientData clientData; /* Value to pass to handler when it is
@@ -38,16 +38,10 @@ typedef struct AsyncHandler {
* associated to. */
Tcl_ThreadId originThrdId; /* Origin thread where this token was created
* and where it will be yielded. */
ClientData notifierData; /* Platform notifier data or NULL. */
} AsyncHandler;
typedef struct ThreadSpecificData {
/*
* The variables below maintain a list of all existing handlers specific
* to the calling thread.
*/
AsyncHandler *firstHandler; /* First handler defined for process, or NULL
* if none. */
AsyncHandler *lastHandler; /* Last handler or NULL. */
int asyncReady; /* This is set to 1 whenever a handler becomes
* ready and it is cleared to zero whenever
* Tcl_AsyncInvoke is called. It can be
@@ -58,24 +52,29 @@ typedef struct ThreadSpecificData {
* currently working. If so then we won't set
* asyncReady again until Tcl_AsyncInvoke
* returns. */
Tcl_Mutex asyncMutex; /* Thread-specific AsyncHandler linked-list
* lock */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
/* Mutex to protect linked-list of AsyncHandlers in the process. */
TCL_DECLARE_MUTEX(asyncMutex)
/* List of all existing handlers of the process. */
static AsyncHandler *firstHandler = NULL;
static AsyncHandler *lastHandler = NULL;
/*
*----------------------------------------------------------------------
*
* TclFinalizeAsync --
*
* Finalizes the mutex in the thread local data structure for the async
* Finalizes the thread local data structure for the async
* subsystem.
*
* Results:
* None.
*
* Side effects:
* Forgets knowledge of the mutex should it have been created.
* Cleans up left-over async handlers for the calling thread.
*
*----------------------------------------------------------------------
*/
@@ -83,10 +82,40 @@ static Tcl_ThreadDataKey dataKey;
void
TclFinalizeAsync(void)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
AsyncHandler *token, *toDelete = NULL;
Tcl_ThreadId self = Tcl_GetCurrentThread();
if (tsdPtr->asyncMutex != NULL) {
Tcl_MutexFinalize(&tsdPtr->asyncMutex);
Tcl_MutexLock(&asyncMutex);
for (token = firstHandler; token != NULL;) {
AsyncHandler *nextToken = token->nextPtr;
if (token->originThrdId == self) {
if (token->prevPtr == NULL) {
firstHandler = token->nextPtr;
if (firstHandler == NULL) {
lastHandler = NULL;
break;
}
} else {
token->prevPtr->nextPtr = token->nextPtr;
if (token == lastHandler) {
lastHandler = token->prevPtr;
}
}
if (token->nextPtr != NULL) {
token->nextPtr->prevPtr = token->prevPtr;
}
token->nextPtr = toDelete;
token->prevPtr = NULL;
toDelete = token;
}
token = nextToken;
}
Tcl_MutexUnlock(&asyncMutex);
while (toDelete != NULL) {
token = toDelete;
toDelete = toDelete->nextPtr;
ckfree(token);
}
}
@@ -121,19 +150,22 @@ Tcl_AsyncCreate(
asyncPtr = (AsyncHandler*)ckalloc(sizeof(AsyncHandler));
asyncPtr->ready = 0;
asyncPtr->nextPtr = NULL;
asyncPtr->prevPtr = NULL;
asyncPtr->proc = proc;
asyncPtr->clientData = clientData;
asyncPtr->originTsd = tsdPtr;
asyncPtr->originThrdId = Tcl_GetCurrentThread();
asyncPtr->notifierData = TclpNotifierData();
Tcl_MutexLock(&tsdPtr->asyncMutex);
if (tsdPtr->firstHandler == NULL) {
tsdPtr->firstHandler = asyncPtr;
Tcl_MutexLock(&asyncMutex);
if (firstHandler == NULL) {
firstHandler = asyncPtr;
} else {
tsdPtr->lastHandler->nextPtr = asyncPtr;
asyncPtr->prevPtr = lastHandler;
lastHandler->nextPtr = asyncPtr;
}
tsdPtr->lastHandler = asyncPtr;
Tcl_MutexUnlock(&tsdPtr->asyncMutex);
lastHandler = asyncPtr;
Tcl_MutexUnlock(&asyncMutex);
return (Tcl_AsyncHandler) asyncPtr;
}
@@ -162,13 +194,86 @@ Tcl_AsyncMark(
{
AsyncHandler *token = (AsyncHandler *) async;
Tcl_MutexLock(&token->originTsd->asyncMutex);
Tcl_MutexLock(&asyncMutex);
token->ready = 1;
if (!token->originTsd->asyncActive) {
token->originTsd->asyncReady = 1;
Tcl_ThreadAlert(token->originThrdId);
}
Tcl_MutexUnlock(&token->originTsd->asyncMutex);
Tcl_MutexUnlock(&asyncMutex);
}
/*
*----------------------------------------------------------------------
*
* Tcl_AsyncMarkFromSignal --
*
* This procedure is similar to Tcl_AsyncMark but must be used
* in POSIX signal contexts. In addition to Tcl_AsyncMark the
* signal number is passed.
*
* Results:
* True, when the handler will be marked, false otherwise.
*
* Side effects:
* The handler gets marked for invocation later.
*
*----------------------------------------------------------------------
*/
int
Tcl_AsyncMarkFromSignal(
Tcl_AsyncHandler async, /* Token for handler. */
int sigNumber) /* Signal number. */
{
#if TCL_THREADS
AsyncHandler *token = (AsyncHandler *) async;
return TclAsyncNotifier(sigNumber, token->originThrdId,
token->notifierData, &token->ready, -1);
#else
(void)sigNumber;
Tcl_AsyncMark(async);
return 1;
#endif
}
/*
*----------------------------------------------------------------------
*
* TclAsyncMarkFromNotifier --
*
* This procedure is called from the notifier thread and
* invokes Tcl_AsyncMark for specifically marked handlers.
*
* Results:
* None.
*
* Side effects:
* Handlers get marked for invocation later.
*
*----------------------------------------------------------------------
*/
void
TclAsyncMarkFromNotifier(void)
{
AsyncHandler *token;
Tcl_MutexLock(&asyncMutex);
for (token = firstHandler; token != NULL;
token = token->nextPtr) {
if (token->ready == -1) {
token->ready = 1;
if (!token->originTsd->asyncActive) {
token->originTsd->asyncReady = 1;
Tcl_ThreadAlert(token->originThrdId);
}
}
}
Tcl_MutexUnlock(&asyncMutex);
}
/*
@@ -200,11 +305,12 @@ Tcl_AsyncInvoke(
{
AsyncHandler *asyncPtr;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
Tcl_ThreadId self = Tcl_GetCurrentThread();
Tcl_MutexLock(&tsdPtr->asyncMutex);
Tcl_MutexLock(&asyncMutex);
if (tsdPtr->asyncReady == 0) {
Tcl_MutexUnlock(&tsdPtr->asyncMutex);
Tcl_MutexUnlock(&asyncMutex);
return code;
}
tsdPtr->asyncReady = 0;
@@ -224,8 +330,11 @@ Tcl_AsyncInvoke(
*/
while (1) {
for (asyncPtr = tsdPtr->firstHandler; asyncPtr != NULL;
for (asyncPtr = firstHandler; asyncPtr != NULL;
asyncPtr = asyncPtr->nextPtr) {
if (asyncPtr->originThrdId != self) {
continue;
}
if (asyncPtr->ready) {
break;
}
@@ -234,12 +343,12 @@ Tcl_AsyncInvoke(
break;
}
asyncPtr->ready = 0;
Tcl_MutexUnlock(&tsdPtr->asyncMutex);
Tcl_MutexUnlock(&asyncMutex);
code = asyncPtr->proc(asyncPtr->clientData, interp, code);
Tcl_MutexLock(&tsdPtr->asyncMutex);
Tcl_MutexLock(&asyncMutex);
}
tsdPtr->asyncActive = 0;
Tcl_MutexUnlock(&tsdPtr->asyncMutex);
Tcl_MutexUnlock(&asyncMutex);
return code;
}
@@ -271,9 +380,7 @@ void
Tcl_AsyncDelete(
Tcl_AsyncHandler async) /* Token for handler to delete. */
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
AsyncHandler *asyncPtr = (AsyncHandler *) async;
AsyncHandler *prevPtr, *thisPtr;
/*
* Assure early handling of the constraint
@@ -283,33 +390,22 @@ Tcl_AsyncDelete(
Tcl_Panic("Tcl_AsyncDelete: async handler deleted by the wrong thread");
}
/*
* If we come to this point when TSD's for the current
* thread have already been garbage-collected, we are
* in the _serious_ trouble. OTOH, we tolerate calling
* with already cleaned-up handler list (should we?).
*/
Tcl_MutexLock(&tsdPtr->asyncMutex);
if (tsdPtr->firstHandler != NULL) {
prevPtr = thisPtr = tsdPtr->firstHandler;
while (thisPtr != NULL && thisPtr != asyncPtr) {
prevPtr = thisPtr;
thisPtr = thisPtr->nextPtr;
Tcl_MutexLock(&asyncMutex);
if (asyncPtr->prevPtr == NULL) {
firstHandler = asyncPtr->nextPtr;
if (firstHandler == NULL) {
lastHandler = NULL;
}
if (thisPtr == NULL) {
Tcl_Panic("Tcl_AsyncDelete: cannot find async handler");
}
if (asyncPtr == tsdPtr->firstHandler) {
tsdPtr->firstHandler = asyncPtr->nextPtr;
} else {
prevPtr->nextPtr = asyncPtr->nextPtr;
}
if (asyncPtr == tsdPtr->lastHandler) {
tsdPtr->lastHandler = prevPtr;
} else {
asyncPtr->prevPtr->nextPtr = asyncPtr->nextPtr;
if (asyncPtr == lastHandler) {
lastHandler = asyncPtr->prevPtr;
}
}
Tcl_MutexUnlock(&tsdPtr->asyncMutex);
if (asyncPtr->nextPtr != NULL) {
asyncPtr->nextPtr->prevPtr = asyncPtr->prevPtr;
}
Tcl_MutexUnlock(&asyncMutex);
ckfree(asyncPtr);
}
+159 -31
View File
@@ -604,6 +604,108 @@ TclFinalizeEvaluation(void)
Tcl_MutexUnlock(&commandTypeLock);
}
/*
*----------------------------------------------------------------------
*
* buildInfoObjCmd --
*
* Implements tcl::build-info command.
*
* Results:
* None.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
static int
buildInfoObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?option?");
return TCL_ERROR;
}
if (objc == 2) {
int len;
const char *arg = TclGetStringFromObj(objv[1], &len);
if (len == 7 && !strcmp(arg, "version")) {
char buf[80];
const char *p = strchr((char *)clientData, '.');
if (p) {
const char *q = strchr(p+1, '.');
const char *r = strchr(p+1, '+');
p = (q < r) ? q : r;
}
if (p) {
memcpy(buf, (char *)clientData, p - (char *)clientData);
buf[p - (char *)clientData] = '\0';
Tcl_AppendResult(interp, buf, NULL);
}
return TCL_OK;
} else if (len == 10 && !strcmp(arg, "patchlevel")) {
char buf[80];
const char *p = strchr((char *)clientData, '+');
if (p) {
memcpy(buf, (char *)clientData, p - (char *)clientData);
buf[p - (char *)clientData] = '\0';
Tcl_AppendResult(interp, buf, NULL);
}
return TCL_OK;
} else if (len == 6 && !strcmp(arg, "commit")) {
const char *q, *p = strchr((char *)clientData, '+');
if (p) {
if ((q = strchr(p, '.'))) {
char buf[80];
memcpy(buf, p+1, q - p - 1);
buf[q - p - 1] = '\0';
Tcl_AppendResult(interp, buf, NULL);
} else {
Tcl_AppendResult(interp, p+1, NULL);
}
}
return TCL_OK;
} else if (len == 8 && !strcmp(arg, "compiler")) {
const char *p = strchr((char *)clientData, '.');
while (p) {
if (!strncmp(p+1, "clang-", 6) || !strncmp(p+1, "gcc-", 4)
|| !strncmp(p+1, "icc-", 4) || !strncmp(p+1, "msvc-", 5)) {
const char *q = strchr(p+1, '.');
if (q) {
char buf[16];
memcpy(buf, p+1, q - p - 1);
buf[q - p - 1] = '\0';
Tcl_AppendResult(interp, buf, NULL);
} else {
Tcl_AppendResult(interp, p+1, NULL);
}
return TCL_OK;
}
p = strchr(p+1, '.');
}
Tcl_AppendResult(interp, "0", NULL);
return TCL_OK;
}
const char *p = strchr((char *)clientData, '.');
while (p) {
if (!strncmp(p+1, arg, len) && ((p[len+1] == '.') || (p[len+1] == '\0'))) {
Tcl_AppendResult(interp, "1", NULL);
return TCL_OK;
}
p = strchr(p+1, '.');
}
Tcl_AppendResult(interp, "0", NULL);
return TCL_OK;
}
Tcl_AppendResult(interp, (char *)clientData, NULL);
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
@@ -644,8 +746,7 @@ Tcl_CreateInterp(void)
#endif /* TCL_COMPILE_STATS */
char mathFuncName[32];
CallFrame *framePtr;
Tcl_InitSubsystems();
const char *version = Tcl_InitSubsystems();
/*
* Panic if someone updated the CallFrame structure without also updating
@@ -1162,7 +1263,7 @@ Tcl_CreateInterp(void)
#endif /* !TCL_NO_DEPRECATED */
TclpSetVariables(interp);
#if TCL_THREADS
#if TCL_THREADS && !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
/*
* The existence of the "threaded" element of the tcl_platform array
* indicates that this particular Tcl shell has been compiled with threads
@@ -1176,10 +1277,14 @@ Tcl_CreateInterp(void)
/*
* Register Tcl's version number.
* TIP #268: Full patchlevel instead of just major.minor
* TIP #599: Extended build information "+<UUID>.<tag1>.<tag2>...."
*/
Tcl_PkgProvideEx(interp, "Tcl", TCL_PATCH_LEVEL, &tclStubs);
Tcl_PkgProvideEx(interp, "tcl", TCL_PATCH_LEVEL, &tclStubs);
Tcl_CreateObjCommand(interp, "::tcl::build-info",
buildInfoObjCmd, (void *)version, NULL);
if (TclTommath_Init(interp) != TCL_OK) {
Tcl_Panic("%s", TclGetString(Tcl_GetObjResult(interp)));
@@ -1826,28 +1931,28 @@ DeleteInterpProc(
ckfree(hTablePtr);
}
/*
* Invoke deletion callbacks; note that a callback can create new
* callbacks, so we iterate.
*/
while (iPtr->assocData != NULL) {
if (iPtr->assocData != NULL) {
AssocData *dPtr;
hTablePtr = iPtr->assocData;
iPtr->assocData = NULL;
/*
* Invoke deletion callbacks; note that a callback can create new
* callbacks, so we iterate.
*/
for (hPtr = Tcl_FirstHashEntry(hTablePtr, &search);
hPtr != NULL;
hPtr = Tcl_FirstHashEntry(hTablePtr, &search)) {
dPtr = (AssocData *)Tcl_GetHashValue(hPtr);
Tcl_DeleteHashEntry(hPtr);
if (dPtr->proc != NULL) {
dPtr->proc(dPtr->clientData, interp);
}
Tcl_DeleteHashEntry(hPtr);
ckfree(dPtr);
}
Tcl_DeleteHashTable(hTablePtr);
ckfree(hTablePtr);
iPtr->assocData = NULL;
}
/*
@@ -3505,15 +3610,14 @@ Tcl_DeleteCommandFromToken(
cmdPtr->flags |= CMD_DYING;
/*
* Call trace functions for the command being deleted. Then delete its
* traces.
* Call each functions and then delete the trace.
*/
cmdPtr->nsPtr->refCount++;
if (cmdPtr->tracePtr != NULL) {
CommandTrace *tracePtr;
/* Note that CallCommandTraces() never frees cmdPtr, that's
/* CallCommandTraces() does not cmdPtr, that's
* done just before Tcl_DeleteCommandFromToken() returns */
CallCommandTraces(iPtr,cmdPtr,NULL,NULL,TCL_TRACE_DELETE);
@@ -3897,7 +4001,9 @@ Tcl_CreateMathFunc(
data->proc = proc;
data->numArgs = numArgs;
data->argTypes = (Tcl_ValueType *)ckalloc(numArgs * sizeof(Tcl_ValueType));
memcpy(data->argTypes, argTypes, numArgs * sizeof(Tcl_ValueType));
if ((numArgs > 0) && (argTypes != NULL)) {
memcpy(data->argTypes, argTypes, numArgs * sizeof(Tcl_ValueType));
}
data->clientData = clientData;
Tcl_DStringInit(&bigName);
@@ -3960,8 +4066,8 @@ OldMathFuncProc(
result = Tcl_GetDoubleFromObj(NULL, valuePtr, &d);
#ifdef ACCEPT_NAN
if (result != TCL_OK) {
const Tcl_ObjIntRep *irPtr
= TclFetchIntRep(valuePtr, &tclDoubleType);
const Tcl_ObjInternalRep *irPtr
= TclFetchInternalRep(valuePtr, &tclDoubleType);
if (irPtr) {
d = irPtr->doubleValue;
@@ -4867,6 +4973,7 @@ NRCommand(
int result)
{
Interp *iPtr = (Interp *) interp;
Tcl_Obj *listPtr;
iPtr->numLevels--;
@@ -4875,7 +4982,10 @@ NRCommand(
*/
if (data[1] && (data[1] != INT2PTR(1))) {
TclNRAddCallback(interp, TclNRTailcallEval, data[1], NULL, NULL, NULL);
listPtr = (Tcl_Obj *)data[1];
data[1] = NULL;
TclNRAddCallback(interp, TclNRTailcallEval, listPtr, NULL, NULL, NULL);
}
/* OPT ??
@@ -5069,7 +5179,7 @@ TEOV_NotFound(
* itself.
*/
Tcl_ListObjGetElements(NULL, currNsPtr->unknownHandlerPtr,
TclListObjGetElements(NULL, currNsPtr->unknownHandlerPtr,
&handlerObjc, &handlerObjv);
newObjc = objc + handlerObjc;
newObjv = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * newObjc);
@@ -5678,7 +5788,7 @@ TclEvalEx(
int numElements;
Tcl_Obj **elements, *temp = copy[wordIdx];
Tcl_ListObjGetElements(NULL, temp, &numElements,
TclListObjGetElements(NULL, temp, &numElements,
&elements);
objectsUsed += numElements;
while (numElements--) {
@@ -7534,7 +7644,7 @@ ExprCeilFunc(
code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
if (code != TCL_OK) {
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);
const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType);
if (irPtr) {
Tcl_SetObjResult(interp, objv[1]);
@@ -7574,7 +7684,7 @@ ExprFloorFunc(
code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
if (code != TCL_OK) {
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);
const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType);
if (irPtr) {
Tcl_SetObjResult(interp, objv[1]);
@@ -7720,7 +7830,7 @@ ExprSqrtFunc(
code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
if (code != TCL_OK) {
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);
const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType);
if (irPtr) {
Tcl_SetObjResult(interp, objv[1]);
@@ -7774,7 +7884,7 @@ ExprUnaryFunc(
code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
if (code != TCL_OK) {
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);
const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType);
if (irPtr) {
d = irPtr->doubleValue;
@@ -7838,7 +7948,7 @@ ExprBinaryFunc(
code = Tcl_GetDoubleFromObj(interp, objv[1], &d1);
#ifdef ACCEPT_NAN
if (code != TCL_OK) {
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);
const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType);
if (irPtr) {
d1 = irPtr->doubleValue;
@@ -7853,7 +7963,7 @@ ExprBinaryFunc(
code = Tcl_GetDoubleFromObj(interp, objv[2], &d2);
#ifdef ACCEPT_NAN
if (code != TCL_OK) {
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);
const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType);
if (irPtr) {
d2 = irPtr->doubleValue;
@@ -8014,7 +8124,7 @@ ExprDoubleFunc(
}
if (Tcl_GetDoubleFromObj(interp, objv[1], &dResult) != TCL_OK) {
#ifdef ACCEPT_NAN
if (TclHasIntRep(objv[1], &tclDoubleType)) {
if (TclHasInternalRep(objv[1], &tclDoubleType)) {
Tcl_SetObjResult(interp, objv[1]);
return TCL_OK;
}
@@ -8191,15 +8301,15 @@ ExprRandFunc(
* take into consideration the thread this interp is running in.
*/
iPtr->randSeed = TclpGetClicks() + (PTR2INT(Tcl_GetCurrentThread())<<12);
iPtr->randSeed = TclpGetClicks() + PTR2UINT(Tcl_GetCurrentThread())*4093U;
/*
* Make sure 1 <= randSeed <= (2^31) - 2. See below.
*/
iPtr->randSeed &= 0x7FFFFFFF;
if ((iPtr->randSeed == 0) || (iPtr->randSeed == 0x7FFFFFFF)) {
iPtr->randSeed ^= 123459876;
iPtr->randSeed &= 0x7FFFFFFFL;
if ((iPtr->randSeed == 0) || (iPtr->randSeed == 0x7FFFFFFFL)) {
iPtr->randSeed ^= 123459876L;
}
}
@@ -9287,7 +9397,7 @@ TclNRTailcallEval(
int objc;
Tcl_Obj **objv;
Tcl_ListObjGetElements(interp, listPtr, &objc, &objv);
TclListObjGetElements(interp, listPtr, &objc, &objv);
nsObjPtr = objv[0];
if (result == TCL_OK) {
@@ -9450,6 +9560,7 @@ TclNRYieldToObjCmd(
iPtr->execEnvPtr = corPtr->callerEEPtr;
TclSetTailcall(interp, listPtr);
corPtr->yieldPtr = listPtr;
iPtr->execEnvPtr = corPtr->eePtr;
return TclNRYieldObjCmd(INT2PTR(CORO_ACTIVATE_YIELDM), interp, 1, objv);
@@ -9647,6 +9758,22 @@ TclNRCoroutineActivateCallback(
*/
if (corPtr->stackLevel != stackLevel) {
NRE_callback *runPtr;
iPtr->execEnvPtr = corPtr->callerEEPtr;
if (corPtr->yieldPtr) {
for (runPtr = TOP_CB(interp); runPtr; runPtr = runPtr->nextPtr) {
if (runPtr->data[1] == corPtr->yieldPtr) {
runPtr->data[1] = NULL;
Tcl_DecrRefCount(corPtr->yieldPtr);
corPtr->yieldPtr = NULL;
break;
}
}
}
iPtr->execEnvPtr = corPtr->eePtr;
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"cannot yield: C stack busy", -1));
Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "CANT_YIELD",
@@ -9662,6 +9789,7 @@ TclNRCoroutineActivateCallback(
Tcl_Panic("Yield received an option which is not implemented");
}
corPtr->yieldPtr = NULL;
corPtr->stackLevel = NULL;
numLevels = iPtr->numLevels;
+175 -169
View File
@@ -2,7 +2,7 @@
* tclBinary.c --
*
* This file contains the implementation of the "binary" Tcl built-in
* command and the Tcl binary data object.
* command and the Tcl value internal representation for binary data.
*
* Copyright © 1997 Sun Microsystems, Inc.
* Copyright © 1998-1999 Scriptics Corporation.
@@ -73,33 +73,17 @@ static void UpdateStringOfByteArray(Tcl_Obj *listPtr);
static void DeleteScanNumberCache(Tcl_HashTable *numberCachePtr);
static int NeedReversing(int format);
static void CopyNumber(const void *from, void *to,
unsigned length, int type);
unsigned int length, int type);
/* Binary ensemble commands */
static int BinaryFormatCmd(ClientData clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static int BinaryScanCmd(ClientData clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static Tcl_ObjCmdProc BinaryFormatCmd;
static Tcl_ObjCmdProc BinaryScanCmd;
/* Binary encoding sub-ensemble commands */
static int BinaryEncodeHex(ClientData clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static int BinaryDecodeHex(ClientData clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static int BinaryEncode64(ClientData clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static int BinaryDecode64(ClientData clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static int BinaryEncodeUu(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int BinaryDecodeUu(ClientData clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static Tcl_ObjCmdProc BinaryEncodeHex;
static Tcl_ObjCmdProc BinaryDecodeHex;
static Tcl_ObjCmdProc BinaryEncode64;
static Tcl_ObjCmdProc BinaryDecode64;
static Tcl_ObjCmdProc BinaryEncodeUu;
static Tcl_ObjCmdProc BinaryDecodeUu;
/*
* The following tables are used by the binary encoders
@@ -165,12 +149,11 @@ static const EnsembleImplMap decodeMap[] = {
* images to name just two.
*
* It's strange to have two Tcl_ObjTypes in place for this task when one would
* do, so a bit of detail and history how we got to this point and where we
* might go from here.
* do, so a bit of detail and history will aid understanding.
*
* A bytearray is an ordered sequence of bytes. Each byte is an integer value
* in the range [0-255]. To be a Tcl value type, we need a way to encode each
* value in the value set as a Tcl string. The simplest encoding is to
* value in the value set as a Tcl string. A simple encoding is to
* represent each byte value as the same codepoint value. A bytearray of N
* bytes is encoded into a Tcl string of N characters where the codepoint of
* each character is the value of corresponding byte. This approach creates a
@@ -181,9 +164,7 @@ static const EnsembleImplMap decodeMap[] = {
* question arises what to do with strings outside that subset? That is,
* those Tcl strings containing at least one codepoint greater than 255? The
* obviously correct answer is to raise an error! That string value does not
* represent any valid bytearray value. Full Stop. The setFromAnyProc
* signature has a completion code return value for just this reason, to
* reject invalid inputs.
* represent any valid bytearray value.
*
* Unfortunately this was not the path taken by the authors of the original
* tclByteArrayType. They chose to accept all Tcl string values as acceptable
@@ -191,33 +172,10 @@ static const EnsembleImplMap decodeMap[] = {
* high bits of any codepoint value at all. This meant that every bytearray
* value had multiple accepted string representations.
*
* The implications of this choice are truly ugly. When a Tcl value has a
* string representation, we are required to accept that as the true value.
* Bytearray values that possess a string representation cannot be processed
* as bytearrays because we cannot know which true value that bytearray
* represents. The consequence is that we drag around an internal rep that we
* cannot make any use of. This painful price is extracted at any point after
* a string rep happens to be generated for the value. This happens even when
* the troublesome codepoints outside the byte range never show up. This
* happens rather routinely in normal Tcl operations unless we burden the
* script writer with the cognitive burden of avoiding it. The price is also
* paid by callers of the C interface. The routine
*
* unsigned char *Tcl_GetByteArrayFromObj(objPtr, lenPtr)
*
* has a guarantee to always return a non-NULL value, but that value points to
* a byte sequence that cannot be used by the caller to process the Tcl value
* absent some sideband testing that objPtr is "pure". Tcl offers no public
* interface to perform this test, so callers either break encapsulation or
* are unavoidably buggy. Tcl has defined a public interface that cannot be
* used correctly. The Tcl source code itself suffers the same problem, and
* has been buggy, but progressively less so as more and more portions of the
* code have been retrofitted with the required "purity testing". The set of
* values able to pass the purity test can be increased via the introduction
* of a "canonical" flag marker, but the only way the broken interface itself
* can be discarded is to start over and define the Tcl_ObjType properly.
* Bytearrays should simply be usable as bytearrays without a kabuki dance of
* testing.
* The implications of this choice are truly ugly, and motivated the proposal
* of TIP 568 to migrate away from it and to the more sensible design where
* each bytearray value has only one string representation. Full details are
* recorded in that TIP for those who seek them.
*
* The Tcl_ObjType "properByteArrayType" is (nearly) a correct implementation
* of bytearrays. Any Tcl value with the type properByteArrayType can have
@@ -226,21 +184,24 @@ static const EnsembleImplMap decodeMap[] = {
* implies a side testing burden -- past mistakes will not let us avoid that
* immediately, but it is at least a conventional test of type, and can be
* implemented entirely by examining the objPtr fields, with no need to query
* the intrep, as a canonical flag would require.
* the internalrep, as a canonical flag would require. This benefit is made
* available to extensions through the public routine Tcl_GetBytesFromObj(),
* first available in Tcl 8.7.
*
* Until Tcl_GetByteArrayFromObj() and Tcl_SetByteArrayLength() can be revised
* to admit the possibility of returning NULL when the true value is not a
* valid bytearray, we need a mechanism to retain compatibility with the
* deployed callers of the broken interface. That's what the retained
* "tclByteArrayType" provides. In those unusual circumstances where we
* convert an invalid bytearray value to a bytearray type, it is to this
* legacy type. Essentially any time this legacy type gets used, it's a
* signal of a bug being ignored. A TIP should be drafted to remove this
* connection to the broken past so that Tcl 9 will no longer have any trace
* of it. Prescribing a migration path will be the key element of that work.
* The internal changes now in place are the limit of what can be done short
* of interface repair. They provide a great expansion of the histories over
* which bytearray values can be useful in the meanwhile.
* The public routines Tcl_GetByteArrayFromObj() and Tcl_SetByteArrayLength()
* must continue to follow their documented behavior through the 8.* series of
* releases. To support that legacy operation, we need a mechanism to retain
* compatibility with the deployed callers of the broken interface. That's
* what the retained "tclByteArrayType" provides. In those unusual
* circumstances where we convert an invalid bytearray value to a bytearray
* type, it is to this legacy type. Essentially any time this legacy type
* shows up, it's a signal of a bug being ignored.
*
* In Tcl 9, the incompatibility in the behavior of these public routines
* has been approved, and the legacy internal rep is no longer retained.
* The internal changes seen below are the limit of what can be done
* in a Tcl 8.* release. They provide a great expansion of the histories
* over which bytearray values can be useful.
*/
static const Tcl_ObjType properByteArrayType = {
@@ -267,15 +228,16 @@ const Tcl_ObjType tclByteArrayType = {
*/
typedef struct ByteArray {
unsigned int bad; /* Index of the character that is a nonbyte.
* If all characters are bytes, bad = used,
* though then we should never read it. */
unsigned int bad; /* Index of first character that is a nonbyte.
* If all characters are bytes, bad = used. */
unsigned int used; /* The number of bytes used in the byte
* array. */
unsigned int allocated; /* The amount of space actually allocated
* minus 1 byte. */
unsigned char bytes[TCLFLEXARRAY]; /* The array of bytes. The actual size of this
* field depends on the 'allocated' field
* array. Must be <= allocated. The bytes
* used to store the value are indexed from
* 0 to used-1. */
unsigned int allocated; /* The number of bytes of space allocated. */
unsigned char bytes[TCLFLEXARRAY];
/* The array of bytes. The actual size of this
* field is stored in the 'allocated' field
* above. */
} ByteArray;
@@ -289,7 +251,7 @@ int
TclIsPureByteArray(
Tcl_Obj * objPtr)
{
return TclHasIntRep(objPtr, &properByteArrayType);
return TclHasInternalRep(objPtr, &properByteArrayType);
}
/*
@@ -301,7 +263,7 @@ TclIsPureByteArray(
* from the given array of bytes.
*
* Results:
* The newly create object is returned. This object will have no initial
* The newly created object is returned. This object has no initial
* string representation. The returned object has a ref count of 0.
*
* Side effects:
@@ -316,16 +278,16 @@ Tcl_Obj *
Tcl_NewByteArrayObj(
const unsigned char *bytes, /* The array of bytes used to initialize the
* new object. */
int length) /* Length of the array of bytes, which must be
* >= 0. */
int numBytes) /* Number of bytes in the array,
* must be >= 0. */
{
#ifdef TCL_MEM_DEBUG
return Tcl_DbNewByteArrayObj(bytes, length, "unknown", 0);
return Tcl_DbNewByteArrayObj(bytes, numBytes, "unknown", 0);
#else /* if not TCL_MEM_DEBUG */
Tcl_Obj *objPtr;
TclNewObj(objPtr);
Tcl_SetByteArrayObj(objPtr, bytes, length);
Tcl_SetByteArrayObj(objPtr, bytes, numBytes);
return objPtr;
#endif /* TCL_MEM_DEBUG */
}
@@ -346,7 +308,7 @@ Tcl_NewByteArrayObj(
* result of calling Tcl_NewByteArrayObj.
*
* Results:
* The newly create object is returned. This object will have no initial
* The newly created object is returned. This object has no initial
* string representation. The returned object has a ref count of 0.
*
* Side effects:
@@ -360,8 +322,8 @@ Tcl_Obj *
Tcl_DbNewByteArrayObj(
const unsigned char *bytes, /* The array of bytes used to initialize the
* new object. */
int length, /* Length of the array of bytes, which must be
* >= 0. */
int numBytes, /* Number of bytes in the array,
* must be >= 0. */
const char *file, /* The name of the source file calling this
* procedure; used for debugging. */
int line) /* Line number in the source file; used for
@@ -370,7 +332,7 @@ Tcl_DbNewByteArrayObj(
Tcl_Obj *objPtr;
TclDbNewObj(objPtr, file, line);
Tcl_SetByteArrayObj(objPtr, bytes, length);
Tcl_SetByteArrayObj(objPtr, bytes, numBytes);
return objPtr;
}
#else /* if not TCL_MEM_DEBUG */
@@ -378,12 +340,12 @@ Tcl_Obj *
Tcl_DbNewByteArrayObj(
const unsigned char *bytes, /* The array of bytes used to initialize the
* new object. */
int length, /* Length of the array of bytes, which must be
* >= 0. */
int numBytes, /* Number of bytes in the array,
* must be >= 0. */
TCL_UNUSED(const char *) /*file*/,
TCL_UNUSED(int) /*line*/)
{
return Tcl_NewByteArrayObj(bytes, length);
return Tcl_NewByteArrayObj(bytes, numBytes);
}
#endif /* TCL_MEM_DEBUG */
@@ -409,47 +371,45 @@ void
Tcl_SetByteArrayObj(
Tcl_Obj *objPtr, /* Object to initialize as a ByteArray. */
const unsigned char *bytes, /* The array of bytes to use as the new value.
* May be NULL even if length > 0. */
int length) /* Length of the array of bytes, which must
* be >= 0. */
* May be NULL even if numBytes > 0. */
int numBytes) /* Number of bytes in the array,
* must be >= 0. */
{
ByteArray *byteArrayPtr;
Tcl_ObjIntRep ir;
Tcl_ObjInternalRep ir;
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayObj");
}
TclInvalidateStringRep(objPtr);
if (length < 0) {
length = 0;
}
byteArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
byteArrayPtr->bad = length;
byteArrayPtr->used = length;
byteArrayPtr->allocated = length;
assert(numBytes >= 0);
byteArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(numBytes));
byteArrayPtr->bad = numBytes;
byteArrayPtr->used = numBytes;
byteArrayPtr->allocated = numBytes;
if ((bytes != NULL) && (length > 0)) {
memcpy(byteArrayPtr->bytes, bytes, length);
if ((bytes != NULL) && (numBytes > 0)) {
memcpy(byteArrayPtr->bytes, bytes, numBytes);
}
SET_BYTEARRAY(&ir, byteArrayPtr);
Tcl_StoreIntRep(objPtr, &properByteArrayType, &ir);
Tcl_StoreInternalRep(objPtr, &properByteArrayType, &ir);
}
/*
*----------------------------------------------------------------------
*
* TclGetBytesFromObj --
* Tcl_GetBytesFromObj/TclGetBytesFromObj --
*
* Attempt to extract the value from objPtr in the representation
* of a byte sequence. On success return the extracted byte sequence.
* On failures, return NULL and record error message and code in
* On failure, return NULL and record error message and code in
* interp (if not NULL).
*
* Results:
* Pointer to array of bytes, or NULL. representing the ByteArray object.
* Writes number of bytes in array to *lengthPtr.
* NULL or pointer to array of bytes representing the ByteArray object.
* Writes number of bytes in array to *numBytesPtr.
*
*----------------------------------------------------------------------
*/
@@ -458,21 +418,21 @@ unsigned char *
TclGetBytesFromObj(
Tcl_Interp *interp, /* For error reporting */
Tcl_Obj *objPtr, /* Value to extract from */
int *lengthPtr) /* If non-NULL, filled with length of the
* array of bytes in the ByteArray object. */
int *numBytesPtr) /* If non-NULL, write the number of bytes
* in the array here */
{
ByteArray *baPtr;
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
SetByteArrayFromAny(NULL, objPtr);
irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
if (interp) {
const char *nonbyte;
int ucs4;
irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
baPtr = GET_BYTEARRAY(irPtr);
nonbyte = Tcl_UtfAtIndex(Tcl_GetString(objPtr), baPtr->bad);
TclUtfToUCS4(nonbyte, &ucs4);
@@ -487,8 +447,47 @@ TclGetBytesFromObj(
}
baPtr = GET_BYTEARRAY(irPtr);
if (lengthPtr != NULL) {
*lengthPtr = baPtr->used;
if (numBytesPtr != NULL) {
*numBytesPtr = baPtr->used;
}
return baPtr->bytes;
}
#undef Tcl_GetBytesFromObj
unsigned char *
Tcl_GetBytesFromObj(
Tcl_Interp *interp, /* For error reporting */
Tcl_Obj *objPtr, /* Value to extract from */
size_t *numBytesPtr) /* If non-NULL, write the number of bytes
* in the array here */
{
ByteArray *baPtr;
const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
SetByteArrayFromAny(NULL, objPtr);
irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
if (interp) {
const char *nonbyte;
int ucs4;
irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
baPtr = GET_BYTEARRAY(irPtr);
nonbyte = Tcl_UtfAtIndex(Tcl_GetString(objPtr), baPtr->bad);
TclUtfToUCS4(nonbyte, &ucs4);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"expected byte sequence but character %d "
"was '%1s' (U+%06X)", baPtr->bad, nonbyte, ucs4));
Tcl_SetErrorCode(interp, "TCL", "VALUE", "BYTES", NULL);
}
return NULL;
}
}
baPtr = GET_BYTEARRAY(irPtr);
if (numBytesPtr != NULL) {
*numBytesPtr = baPtr->used;
}
return baPtr->bytes;
}
@@ -515,24 +514,24 @@ TclGetBytesFromObj(
unsigned char *
Tcl_GetByteArrayFromObj(
Tcl_Obj *objPtr, /* The ByteArray object. */
int *lengthPtr) /* If non-NULL, filled with length of the
* array of bytes in the ByteArray object. */
int *numBytesPtr) /* If non-NULL, write the number of bytes
* in the array here */
{
ByteArray *baPtr;
const Tcl_ObjIntRep *irPtr;
unsigned char *result = TclGetBytesFromObj(NULL, objPtr, lengthPtr);
const Tcl_ObjInternalRep *irPtr;
unsigned char *result = TclGetBytesFromObj(NULL, objPtr, numBytesPtr);
if (result) {
return result;
}
irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
assert(irPtr != NULL);
baPtr = GET_BYTEARRAY(irPtr);
if (lengthPtr != NULL) {
*lengthPtr = baPtr->used;
if (numBytesPtr != NULL) {
*numBytesPtr = baPtr->used;
}
return (unsigned char *) baPtr->bytes;
}
@@ -540,27 +539,28 @@ Tcl_GetByteArrayFromObj(
unsigned char *
TclGetByteArrayFromObj(
Tcl_Obj *objPtr, /* The ByteArray object. */
size_t *lengthPtr) /* If non-NULL, filled with length of the
* array of bytes in the ByteArray object. */
size_t *numBytesPtr) /* If non-NULL, write the number of bytes
* in the array here */
{
ByteArray *baPtr;
const Tcl_ObjIntRep *irPtr;
unsigned char *result = TclGetBytesFromObj(NULL, objPtr, (int *)NULL);
const Tcl_ObjInternalRep *irPtr;
unsigned char *result = Tcl_GetBytesFromObj(NULL, objPtr, numBytesPtr);
if (result) {
return result;
}
irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
assert(irPtr != NULL);
baPtr = GET_BYTEARRAY(irPtr);
if (lengthPtr != NULL) {
if (numBytesPtr != NULL) {
#if TCL_MAJOR_VERSION > 8
*lengthPtr = baPtr->used;
*numBytesPtr = baPtr->used;
#else
*lengthPtr = ((size_t)(unsigned)(baPtr->used + 1)) - 1;
/* TODO: What's going on here? Document or eliminate. */
*numBytesPtr = ((size_t)(unsigned int)(baPtr->used + 1)) - 1;
#endif
}
return baPtr->bytes;
@@ -591,31 +591,34 @@ TclGetByteArrayFromObj(
unsigned char *
Tcl_SetByteArrayLength(
Tcl_Obj *objPtr, /* The ByteArray object. */
int length) /* New length for internal byte array. */
int numBytes) /* Number of bytes in resized array */
{
ByteArray *byteArrayPtr;
unsigned newLength;
Tcl_ObjIntRep *irPtr;
Tcl_ObjInternalRep *irPtr;
assert(length >= 0);
newLength = (unsigned int)length;
assert(numBytes >= 0);
newLength = (unsigned int)numBytes;
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayLength");
}
irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
if (irPtr == NULL) {
SetByteArrayFromAny(NULL, objPtr);
irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
}
}
}
/* Note that during truncation, the implementation does not free
* memory that is no longer needed. */
byteArrayPtr = GET_BYTEARRAY(irPtr);
if (newLength > byteArrayPtr->allocated) {
byteArrayPtr = (ByteArray *)ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(newLength));
@@ -655,12 +658,12 @@ SetByteArrayFromAny(
unsigned char *dst;
Tcl_UniChar ch = 0;
ByteArray *byteArrayPtr;
Tcl_ObjIntRep ir;
Tcl_ObjInternalRep ir;
if (TclHasIntRep(objPtr, &properByteArrayType)) {
if (TclHasInternalRep(objPtr, &properByteArrayType)) {
return TCL_OK;
}
if (TclHasIntRep(objPtr, &tclByteArrayType)) {
if (TclHasInternalRep(objPtr, &tclByteArrayType)) {
return TCL_OK;
}
@@ -668,6 +671,9 @@ SetByteArrayFromAny(
length = bad = objPtr->length;
srcEnd = src + length;
/* Note the allocation is over-sized, possibly by a factor of four,
* or even a factor of two with a proper byte array value. */
byteArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
for (dst = byteArrayPtr->bytes; src < srcEnd; ) {
src += TclUtfToUniChar(src, &ch);
@@ -683,10 +689,10 @@ SetByteArrayFromAny(
if (bad == length) {
byteArrayPtr->bad = byteArrayPtr->used;
Tcl_StoreIntRep(objPtr, &properByteArrayType, &ir);
Tcl_StoreInternalRep(objPtr, &properByteArrayType, &ir);
} else {
byteArrayPtr->bad = bad;
Tcl_StoreIntRep(objPtr, &tclByteArrayType, &ir);
Tcl_StoreInternalRep(objPtr, &tclByteArrayType, &ir);
}
return TCL_OK;
@@ -713,14 +719,14 @@ static void
FreeByteArrayInternalRep(
Tcl_Obj *objPtr) /* Object with internal rep to free. */
{
ckfree(GET_BYTEARRAY(TclFetchIntRep(objPtr, &tclByteArrayType)));
ckfree(GET_BYTEARRAY(TclFetchInternalRep(objPtr, &tclByteArrayType)));
}
static void
FreeProperByteArrayInternalRep(
Tcl_Obj *objPtr) /* Object with internal rep to free. */
{
ckfree(GET_BYTEARRAY(TclFetchIntRep(objPtr, &properByteArrayType)));
ckfree(GET_BYTEARRAY(TclFetchInternalRep(objPtr, &properByteArrayType)));
}
/*
@@ -747,9 +753,9 @@ DupByteArrayInternalRep(
{
unsigned int length;
ByteArray *srcArrayPtr, *copyArrayPtr;
Tcl_ObjIntRep ir;
Tcl_ObjInternalRep ir;
srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &tclByteArrayType));
srcArrayPtr = GET_BYTEARRAY(TclFetchInternalRep(srcPtr, &tclByteArrayType));
length = srcArrayPtr->used;
copyArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
@@ -759,7 +765,7 @@ DupByteArrayInternalRep(
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
SET_BYTEARRAY(&ir, copyArrayPtr);
Tcl_StoreIntRep(copyPtr, &tclByteArrayType, &ir);
Tcl_StoreInternalRep(copyPtr, &tclByteArrayType, &ir);
}
static void
@@ -769,9 +775,9 @@ DupProperByteArrayInternalRep(
{
unsigned int length;
ByteArray *srcArrayPtr, *copyArrayPtr;
Tcl_ObjIntRep ir;
Tcl_ObjInternalRep ir;
srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &properByteArrayType));
srcArrayPtr = GET_BYTEARRAY(TclFetchInternalRep(srcPtr, &properByteArrayType));
length = srcArrayPtr->used;
copyArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length));
@@ -781,7 +787,7 @@ DupProperByteArrayInternalRep(
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
SET_BYTEARRAY(&ir, copyArrayPtr);
Tcl_StoreIntRep(copyPtr, &properByteArrayType, &ir);
Tcl_StoreInternalRep(copyPtr, &properByteArrayType, &ir);
}
/*
@@ -806,7 +812,7 @@ UpdateStringOfByteArray(
Tcl_Obj *objPtr) /* ByteArray object whose string rep to
* update. */
{
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
ByteArray *byteArrayPtr = GET_BYTEARRAY(irPtr);
unsigned char *src = byteArrayPtr->bytes;
unsigned int i, length = byteArrayPtr->used;
@@ -836,7 +842,6 @@ UpdateStringOfByteArray(
for (i = 0; i < length; i++) {
dst += Tcl_UniCharToUtf(src[i], dst);
}
(void) Tcl_InitStringRep(objPtr, NULL, size);
}
}
@@ -867,7 +872,7 @@ TclAppendBytesToByteArray(
{
ByteArray *byteArrayPtr;
unsigned int length, needed;
Tcl_ObjIntRep *irPtr;
Tcl_ObjInternalRep *irPtr;
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("%s called with shared object","TclAppendBytesToByteArray");
@@ -886,14 +891,14 @@ TclAppendBytesToByteArray(
length = (unsigned int) len;
irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
if (irPtr == NULL) {
SetByteArrayFromAny(NULL, objPtr);
irPtr = TclFetchIntRep(objPtr, &properByteArrayType);
irPtr = TclFetchInternalRep(objPtr, &properByteArrayType);
if (irPtr == NULL) {
irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType);
}
}
}
@@ -1503,7 +1508,7 @@ BinaryFormatCmd(
*----------------------------------------------------------------------
*/
int
static int
BinaryScanCmd(
TCL_UNUSED(ClientData),
Tcl_Interp *interp, /* Current interpreter. */
@@ -1923,7 +1928,7 @@ GetFormatSpec(
(*formatPtr)++;
*countPtr = BINARY_ALL;
} else if (isdigit(UCHAR(**formatPtr))) { /* INTL: digit */
unsigned long int count;
unsigned long count;
errno = 0;
count = strtoul(*formatPtr, (char **) formatPtr, 10);
@@ -2123,7 +2128,7 @@ CopyNumber(
*
* FormatNumber --
*
* This routine is called by Tcl_BinaryObjCmd to format a number into a
* This routine is called by BinaryFormatCmd to format a number into a
* location pointed at by cursor.
*
* Results:
@@ -2158,7 +2163,7 @@ FormatNumber(
*/
if (Tcl_GetDoubleFromObj(interp, src, &dvalue) != TCL_OK) {
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(src, &tclDoubleType);
const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(src, &tclDoubleType);
if (irPtr == NULL) {
return TCL_ERROR;
}
@@ -2178,7 +2183,7 @@ FormatNumber(
*/
if (Tcl_GetDoubleFromObj(interp, src, &dvalue) != TCL_OK) {
const Tcl_ObjIntRep *irPtr = TclFetchIntRep(src, &tclDoubleType);
const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(src, &tclDoubleType);
if (irPtr == NULL) {
return TCL_ERROR;
@@ -2292,7 +2297,7 @@ FormatNumber(
*
* ScanNumber --
*
* This routine is called by Tcl_BinaryObjCmd to scan a number out of a
* This routine is called by BinaryScanCmd to scan a number out of a
* buffer.
*
* Results:
@@ -2879,7 +2884,8 @@ BinaryEncodeUu(
{
Tcl_Obj *resultObj;
unsigned char *data, *start, *cursor;
int offset, count, rawLength, n, i, j, bits, index;
int offset, count, rawLength, i, j, bits, index;
unsigned int n;
int lineLength = 61;
const unsigned char SingleNewline[] = { UCHAR('\n') };
const unsigned char *wrapchar = SingleNewline;
+9 -9
View File
@@ -41,7 +41,7 @@ typedef struct MemTag {
* last field in the structure. */
} MemTag;
#define TAG_SIZE(bytesInString) ((offsetof(MemTag, string) + 1) + bytesInString)
#define TAG_SIZE(bytesInString) ((offsetof(MemTag, string) + 1U) + (bytesInString))
static MemTag *curTagPtr = NULL;/* Tag to use in all future mem_headers (set
* by "memory tag" command). */
@@ -131,10 +131,10 @@ static int ckallocInit = 0;
* Prototypes for procedures defined in this file:
*/
static int CheckmemCmd(ClientData clientData,
static int CheckmemCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int MemoryCmd(ClientData clientData,
static int MemoryCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static void ValidateMemory(struct mem_header *memHeaderP,
@@ -177,7 +177,7 @@ TclInitDbCkalloc(void)
int
TclDumpMemoryInfo(
ClientData clientData,
void *clientData,
int flags)
{
char buf[1024];
@@ -381,7 +381,7 @@ Tcl_DumpActiveMemory(
* Tcl_DbCkalloc - debugging ckalloc
*
* Allocate the requested amount of space plus some extra for guard bands
* at both ends of the request, plus a size, panicing if there isn't
* at both ends of the request, plus a size, panicking if there isn't
* enough space, then write in the guard bands and return the address of
* the space in the middle that the user asked for.
*
@@ -810,7 +810,7 @@ Tcl_AttemptRealloc(
*/
static int
MemoryCmd(
TCL_UNUSED(ClientData),
TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Obj values of arguments. */
@@ -980,13 +980,13 @@ MemoryCmd(
*
*----------------------------------------------------------------------
*/
static int CheckmemCmd(ClientData clientData,
static int CheckmemCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int
CheckmemCmd(
TCL_UNUSED(ClientData),
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Interpreter for evaluation. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Obj values of arguments. */
@@ -1240,7 +1240,7 @@ Tcl_ValidateAllMemory(
int
TclDumpMemoryInfo(
TCL_UNUSED(ClientData),
TCL_UNUSED(void *),
TCL_UNUSED(int) /*flags*/)
{
return 1;
+1 -1
View File
@@ -452,7 +452,7 @@ ClockGetdatefieldsObjCmd(
* that it isn't.
*/
if (TclHasIntRep(objv[1], &tclBignumType)) {
if (TclHasInternalRep(objv[1], &tclBignumType)) {
Tcl_SetObjResult(interp, lit[LIT_INTEGER_VALUE_TOO_LARGE]);
return TCL_ERROR;
}
-2
View File
@@ -613,8 +613,6 @@ EncodingConverttoObjCmd(
int length; /* Length of the string being converted */
const char *stringPtr; /* Pointer to the first byte of the string */
/* TODO - ADJUST OBJ INDICES WHEN ENSEMBLIFYING THIS */
if (objc == 2) {
encoding = Tcl_GetEncoding(interp, NULL);
data = objv[1];
+19 -19
View File
@@ -1241,7 +1241,7 @@ TclInfoFrame(
{
Interp *iPtr = (Interp *) interp;
Tcl_Obj *tmpObj;
Tcl_Obj *lv[20]; /* Keep uptodate when more keys are added to
Tcl_Obj *lv[20] = {NULL}; /* Keep uptodate when more keys are added to
* the dict. */
int lc = 0;
/*
@@ -2731,8 +2731,8 @@ Tcl_LremoveObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
int i, idxc;
int listLen, *idxv, prevIdx, first, num;
int i, idxc, listLen, prevIdx, first, num;
int *idxv;
Tcl_Obj *listObj;
/*
@@ -2960,7 +2960,8 @@ Tcl_LreplaceObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Obj *listPtr;
int first, last, listLen, numToDelete, result;
int first, last;
int listLen, numToDelete, result;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 1, objv,
@@ -2991,8 +2992,7 @@ Tcl_LreplaceObjCmd(
if (first == TCL_INDEX_NONE) {
first = 0;
}
if (first > listLen) {
} else if (first > listLen) {
first = listLen;
}
@@ -3140,9 +3140,10 @@ Tcl_LsearchObjCmd(
Tcl_Obj *const objv[]) /* Argument values. */
{
const char *bytes, *patternBytes;
int i, match, index, result=TCL_OK, listc, length, elemLen, bisect;
int i, match, index, result=TCL_OK, listc, bisect;
int length, elemLen, start, groupSize, groupOffset, lower, upper;
int allocatedIndexVector = 0;
int dataType, isIncreasing, lower, upper, start, groupSize, groupOffset;
int dataType, isIncreasing;
Tcl_WideInt patWide, objWide;
int allMatches, inlineReturn, negatedMatch, returnSubindices, noCase;
double patDouble, objDouble;
@@ -3514,7 +3515,7 @@ Tcl_LsearchObjCmd(
if (allMatches || inlineReturn) {
Tcl_ResetResult(interp);
} else {
TclNewIntObj(itemPtr, TCL_INDEX_NONE);
TclNewIndexObj(itemPtr, TCL_INDEX_NONE);
Tcl_SetObjResult(interp, itemPtr);
}
goto done;
@@ -3645,7 +3646,7 @@ Tcl_LsearchObjCmd(
* our first match might not be the first occurrence.
* Consider: 0 0 0 1 1 1 2 2 2
*
* To maintain consistancy with standard lsearch semantics, we
* To maintain consistency with standard lsearch semantics, we
* must find the leftmost occurrence of the pattern in the
* list. Thus we don't just stop searching here. This
* variation means that a search always makes log n
@@ -3719,8 +3720,7 @@ Tcl_LsearchObjCmd(
if (noCase) {
match = (TclUtfCasecmp(bytes, patternBytes) == 0);
} else {
match = (memcmp(bytes, patternBytes,
(size_t) length) == 0);
match = (memcmp(bytes, patternBytes, length) == 0);
}
}
break;
@@ -3804,10 +3804,10 @@ Tcl_LsearchObjCmd(
} else if (returnSubindices) {
int j;
TclNewIntObj(itemPtr, i+groupOffset);
TclNewIndexObj(itemPtr, i+groupOffset);
for (j=0 ; j<sortInfo.indexc ; j++) {
Tcl_Obj *elObj;
TclNewIntObj(elObj, TclIndexDecode(sortInfo.indexv[j], listc));
TclNewIndexObj(elObj, TclIndexDecode(sortInfo.indexv[j], listc));
Tcl_ListObjAppendElement(interp, itemPtr, elObj);
}
Tcl_ListObjAppendElement(interp, listPtr, itemPtr);
@@ -3827,16 +3827,16 @@ Tcl_LsearchObjCmd(
if (returnSubindices) {
int j;
TclNewIntObj(itemPtr, index+groupOffset);
TclNewIndexObj(itemPtr, index+groupOffset);
for (j=0 ; j<sortInfo.indexc ; j++) {
Tcl_Obj *elObj;
TclNewIntObj(elObj, TclIndexDecode(sortInfo.indexv[j], listc));
TclNewIndexObj(elObj, TclIndexDecode(sortInfo.indexv[j], listc));
Tcl_ListObjAppendElement(interp, itemPtr, elObj);
}
Tcl_SetObjResult(interp, itemPtr);
} else {
Tcl_Obj *elObj;
TclNewIntObj(elObj, index);
TclNewIndexObj(elObj, index);
Tcl_SetObjResult(interp, elObj);
}
} else if (index < 0) {
@@ -4420,7 +4420,7 @@ Tcl_LsortObjCmd(
idx = elementPtr->payload.index;
for (j = 0; j < groupSize; j++) {
if (indices) {
TclNewIntObj(objPtr, idx + j - groupOffset);
TclNewIndexObj(objPtr, idx + j - groupOffset);
newArray[i++] = objPtr;
Tcl_IncrRefCount(objPtr);
} else {
@@ -4432,7 +4432,7 @@ Tcl_LsortObjCmd(
}
} else if (indices) {
for (i=0; elementPtr != NULL ; elementPtr = elementPtr->nextPtr) {
TclNewIntObj(objPtr, elementPtr->payload.index);
TclNewIndexObj(objPtr, elementPtr->payload.index);
newArray[i++] = objPtr;
Tcl_IncrRefCount(objPtr);
}
+47 -46
View File
@@ -385,16 +385,16 @@ Tcl_RegexpObjCmd(
end--;
}
} else {
start = -1;
end = -1;
start = TCL_INDEX_NONE;
end = TCL_INDEX_NONE;
}
TclNewIntObj(objs[0], start);
TclNewIntObj(objs[1], end);
TclNewIndexObj(objs[0], start);
TclNewIndexObj(objs[1], end);
newPtr = Tcl_NewListObj(2, objs);
} else {
if (i <= info.nsubs) {
if ((i <= info.nsubs) && (info.matches[i].end > 0)) {
newPtr = Tcl_GetRange(objPtr,
offset + info.matches[i].start,
offset + info.matches[i].end - 1);
@@ -674,7 +674,7 @@ Tcl_RegsubObjCmd(
* object. (If they aren't, that's cheap to do.)
*/
if (Tcl_ListObjLength(interp, objv[2], &numParts) != TCL_OK) {
if (TclListObjLength(interp, objv[2], &numParts) != TCL_OK) {
return TCL_ERROR;
}
if (numParts < 1) {
@@ -776,7 +776,7 @@ Tcl_RegsubObjCmd(
Tcl_Obj **args = NULL, **parts;
int numArgs;
Tcl_ListObjGetElements(interp, subPtr, &numParts, &parts);
TclListObjGetElements(interp, subPtr, &numParts, &parts);
numArgs = numParts + info.nsubs + 1;
args = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj*) * numArgs);
memcpy(args, parts, sizeof(Tcl_Obj*) * numParts);
@@ -1533,16 +1533,16 @@ StringIsCmd(
"boolean", "dict", "digit", "double",
"entier", "false", "graph", "integer",
"list", "lower", "print", "punct",
"space", "true", "upper", "wideinteger",
"wordchar", "xdigit", NULL
"space", "true", "upper", "unicode",
"wideinteger", "wordchar", "xdigit", NULL
};
enum isClassesEnum {
STR_IS_ALNUM, STR_IS_ALPHA, STR_IS_ASCII, STR_IS_CONTROL,
STR_IS_BOOL, STR_IS_DICT, STR_IS_DIGIT, STR_IS_DOUBLE,
STR_IS_ENTIER, STR_IS_FALSE, STR_IS_GRAPH, STR_IS_INT,
STR_IS_LIST, STR_IS_LOWER, STR_IS_PRINT, STR_IS_PUNCT,
STR_IS_SPACE, STR_IS_TRUE, STR_IS_UPPER, STR_IS_WIDE,
STR_IS_WORD, STR_IS_XDIGIT
STR_IS_SPACE, STR_IS_TRUE, STR_IS_UPPER, STR_IS_UNICODE,
STR_IS_WIDE, STR_IS_WORD, STR_IS_XDIGIT
};
static const char *const isOptions[] = {
"-strict", "-failindex", NULL
@@ -1611,7 +1611,7 @@ StringIsCmd(
case STR_IS_BOOL:
case STR_IS_TRUE:
case STR_IS_FALSE:
if (!TclHasIntRep(objPtr, &tclBooleanType)
if (!TclHasInternalRep(objPtr, &tclBooleanType)
&& (TCL_OK != TclSetBooleanFromAny(NULL, objPtr))) {
if (strict) {
result = 0;
@@ -1681,9 +1681,9 @@ StringIsCmd(
chcomp = Tcl_UniCharIsDigit;
break;
case STR_IS_DOUBLE: {
if (TclHasIntRep(objPtr, &tclDoubleType) ||
TclHasIntRep(objPtr, &tclIntType) ||
TclHasIntRep(objPtr, &tclBignumType)) {
if (TclHasInternalRep(objPtr, &tclDoubleType) ||
TclHasInternalRep(objPtr, &tclIntType) ||
TclHasInternalRep(objPtr, &tclBignumType)) {
break;
}
string1 = TclGetStringFromObj(objPtr, &length1);
@@ -1702,7 +1702,7 @@ StringIsCmd(
failat = stop - string1;
if (stop < end) {
result = 0;
TclFreeIntRep(objPtr);
TclFreeInternalRep(objPtr);
}
}
break;
@@ -1712,8 +1712,8 @@ StringIsCmd(
break;
case STR_IS_INT:
case STR_IS_ENTIER:
if (TclHasIntRep(objPtr, &tclIntType) ||
TclHasIntRep(objPtr, &tclBignumType)) {
if (TclHasInternalRep(objPtr, &tclIntType) ||
TclHasInternalRep(objPtr, &tclBignumType)) {
break;
}
string1 = TclGetStringFromObj(objPtr, &length1);
@@ -1742,7 +1742,7 @@ StringIsCmd(
result = 0;
failat = stop - string1;
TclFreeIntRep(objPtr);
TclFreeInternalRep(objPtr);
}
} else {
/*
@@ -1795,7 +1795,7 @@ StringIsCmd(
*/
failat = stop - string1;
TclFreeIntRep(objPtr);
TclFreeInternalRep(objPtr);
}
} else {
/*
@@ -1872,6 +1872,9 @@ StringIsCmd(
case STR_IS_UPPER:
chcomp = Tcl_UniCharIsUpper;
break;
case STR_IS_UNICODE:
chcomp = Tcl_UniCharIsUnicode;
break;
case STR_IS_WORD:
chcomp = Tcl_UniCharIsWordChar;
break;
@@ -1907,7 +1910,7 @@ StringIsCmd(
str_is_done:
if ((result == 0) && (failVarObj != NULL)) {
TclNewIntObj(objPtr, failat);
TclNewIndexObj(objPtr, failat);
if (Tcl_ObjSetVar2(interp, failVarObj, NULL, objPtr, TCL_LEAVE_ERR_MSG) == NULL) {
return TCL_ERROR;
}
@@ -1987,7 +1990,7 @@ StringMapCmd(
*/
if (!TclHasStringRep(objv[objc-2])
&& TclHasIntRep(objv[objc-2], &tclDictType)) {
&& TclHasInternalRep(objv[objc-2], &tclDictType)) {
int i, done;
Tcl_DictSearch search;
@@ -2297,13 +2300,7 @@ StringRangeCmd(
return TCL_ERROR;
}
if (first < 0) {
first = 0;
}
if (last >= length) {
last = length;
}
if (last >= first) {
if (last >= 0) {
Tcl_SetObjResult(interp, Tcl_GetRange(objv[1], first, last));
}
return TCL_OK;
@@ -2540,7 +2537,7 @@ StringStartCmd(
cur += 1;
}
}
TclNewIntObj(obj, cur);
TclNewIndexObj(obj, cur);
Tcl_SetObjResult(interp, obj);
return TCL_OK;
}
@@ -2601,7 +2598,7 @@ StringEndCmd(
} else {
cur = length;
}
TclNewIntObj(obj, cur);
TclNewIndexObj(obj, cur);
Tcl_SetObjResult(interp, obj);
return TCL_OK;
}
@@ -2832,6 +2829,7 @@ StringCatCmd(
*
*----------------------------------------------------------------------
*/
#if TCL_MAJOR_VERSION < 9 && !defined(TCL_NO_DEPRECATED)
static int
StringBytesCmd(
TCL_UNUSED(ClientData),
@@ -2850,6 +2848,7 @@ StringBytesCmd(
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(length));
return TCL_OK;
}
#endif
/*
*----------------------------------------------------------------------
@@ -3306,7 +3305,9 @@ TclInitStringCmd(
Tcl_Interp *interp) /* Current interpreter. */
{
static const EnsembleImplMap stringImplMap[] = {
#if TCL_MAJOR_VERSION < 9 && !defined(TCL_NO_DEPRECATED)
{"bytelength", StringBytesCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0},
#endif
{"cat", StringCatCmd, TclCompileStringCatCmd, NULL, NULL, 0},
{"compare", StringCmpCmd, TclCompileStringCmpCmd, NULL, NULL, 0},
{"equal", StringEqualCmd, TclCompileStringEqualCmd, NULL, NULL, 0},
@@ -3771,10 +3772,10 @@ TclNRSwitchObjCmd(
Tcl_Obj *rangeObjAry[2];
if (info.matches[j].end > 0) {
TclNewIntObj(rangeObjAry[0], info.matches[j].start);
TclNewIntObj(rangeObjAry[1], info.matches[j].end-1);
TclNewIndexObj(rangeObjAry[0], info.matches[j].start);
TclNewIndexObj(rangeObjAry[1], info.matches[j].end-1);
} else {
TclNewIntObj(rangeObjAry[1], TCL_INDEX_NONE);
TclNewIndexObj(rangeObjAry[1], TCL_INDEX_NONE);
rangeObjAry[0] = rangeObjAry[1];
}
@@ -3994,7 +3995,7 @@ Tcl_ThrowObjCmd(
* The type must be a list of at least length 1.
*/
if (Tcl_ListObjLength(interp, objv[1], &len) != TCL_OK) {
if (TclListObjLength(interp, objv[1], &len) != TCL_OK) {
return TCL_ERROR;
} else if (len < 1) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
@@ -4782,7 +4783,7 @@ TclNRTryObjCmd(
return TCL_ERROR;
}
code = 1;
if (Tcl_ListObjLength(NULL, objv[i+1], &dummy) != TCL_OK) {
if (TclListObjLength(NULL, objv[i+1], &dummy) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad prefix '%s': must be a list",
Tcl_GetString(objv[i+1])));
@@ -4794,7 +4795,7 @@ TclNRTryObjCmd(
info[2] = objv[i+1];
commonHandler:
if (Tcl_ListObjLength(interp, objv[i+2], &dummy) != TCL_OK) {
if (TclListObjLength(interp, objv[i+2], &dummy) != TCL_OK) {
Tcl_DecrRefCount(handlersObj);
return TCL_ERROR;
}
@@ -4944,12 +4945,12 @@ TryPostBody(
int found = 0;
Tcl_Obj **handlers, **info;
Tcl_ListObjGetElements(NULL, handlersObj, &numHandlers, &handlers);
TclListObjGetElements(NULL, handlersObj, &numHandlers, &handlers);
for (i=0 ; i<numHandlers ; i++) {
Tcl_Obj *handlerBodyObj;
int numElems = 0;
Tcl_ListObjGetElements(NULL, handlers[i], &numElems, &info);
TclListObjGetElements(NULL, handlers[i], &numElems, &info);
if (!found) {
Tcl_GetIntFromObj(NULL, info[1], &code);
if (code != result) {
@@ -4970,8 +4971,8 @@ TryPostBody(
TclNewLiteralStringObj(errorCodeName, "-errorcode");
Tcl_DictObjGet(NULL, options, errorCodeName, &errcode);
Tcl_DecrRefCount(errorCodeName);
Tcl_ListObjGetElements(NULL, info[2], &len1, &bits1);
if (Tcl_ListObjGetElements(NULL, errcode, &len2,
TclListObjGetElements(NULL, info[2], &len1, &bits1);
if (TclListObjGetElements(NULL, errcode, &len2,
&bits2) != TCL_OK) {
continue;
}
@@ -5011,7 +5012,7 @@ TryPostBody(
Tcl_ResetResult(interp);
result = TCL_ERROR;
Tcl_ListObjLength(NULL, info[3], &numElems);
TclListObjLength(NULL, info[3], &numElems);
if (numElems> 0) {
Tcl_Obj *varName;
@@ -5113,15 +5114,15 @@ TryPostHandler(
{
Tcl_Obj *resultObj, *cmdObj, *options, *handlerKindObj, **objv;
Tcl_Obj *finallyObj;
int finally;
int finallyIndex;
objv = (Tcl_Obj **)data[0];
options = (Tcl_Obj *)data[1];
handlerKindObj = (Tcl_Obj *)data[2];
finally = PTR2INT(data[3]);
finallyIndex = PTR2INT(data[3]);
cmdObj = objv[0];
finallyObj = finally ? objv[finally] : 0;
finallyObj = finallyIndex ? objv[finallyIndex] : 0;
/*
* Check for limits/rewinding, which override normal trapping behaviour.
@@ -5165,7 +5166,7 @@ TryPostHandler(
/* The 'finally' script is always the last argument word. */
return TclNREvalObjEx(interp, finallyObj, 0, iPtr->cmdFramePtr,
finally);
finallyIndex);
}
/*
+6 -6
View File
@@ -301,7 +301,7 @@ TclCompileArraySetCmd(
TclNewObj(literalObj);
isDataLiteral = TclWordKnownAtCompileTime(dataTokenPtr, literalObj);
isDataValid = (isDataLiteral
&& Tcl_ListObjLength(NULL, literalObj, &len) == TCL_OK);
&& TclListObjLength(NULL, literalObj, &len) == TCL_OK);
isDataEven = (isDataValid && (len & 1) == 0);
/*
@@ -892,7 +892,7 @@ TclCompileConcatCmd(
const char *bytes;
int len;
Tcl_ListObjGetElements(NULL, listObj, &len, &objs);
TclListObjGetElements(NULL, listObj, &len, &objs);
objPtr = Tcl_ConcatObj(len, objs);
Tcl_DecrRefCount(listObj);
bytes = TclGetStringFromObj(objPtr, &len);
@@ -2641,8 +2641,8 @@ TclCompileLmapCmd(
Tcl_Interp *interp, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to defintion of command being
* compiled. */
Command *cmdPtr, /* Points to the definition of the command
* being compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
return CompileEachloopCmd(interp, parsePtr, cmdPtr, envPtr,
@@ -2703,7 +2703,7 @@ CompileEachloopCmd(
}
/*
* Bail out if the body requires substitutions in order to insure correct
* Bail out if the body requires substitutions in order to ensure correct
* behaviour. [Bug 219166]
*/
@@ -2750,7 +2750,7 @@ CompileEachloopCmd(
*/
if (!TclWordKnownAtCompileTime(tokenPtr, varListObj) ||
TCL_OK != Tcl_ListObjLength(NULL, varListObj, &numVars) ||
TCL_OK != TclListObjLength(NULL, varListObj, &numVars) ||
numVars == 0) {
code = TCL_ERROR;
goto done;
+20 -16
View File
@@ -505,19 +505,19 @@ TclCompileStringIsCmd(
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
static const char *const isClasses[] = {
"alnum", "alpha", "ascii", "control",
"boolean", "dict", "digit", "double", "entier",
"false", "graph", "integer", "list",
"lower", "print", "punct", "space",
"true", "upper", "wideinteger", "wordchar",
"xdigit", NULL
"boolean", "dict", "digit", "double",
"entier", "false", "graph", "integer",
"list", "lower", "print", "punct",
"space", "true", "upper", "unicode",
"wideinteger", "wordchar", "xdigit", NULL
};
enum isClassesEnum {
STR_IS_ALNUM, STR_IS_ALPHA, STR_IS_ASCII, STR_IS_CONTROL,
STR_IS_BOOL, STR_IS_DICT, STR_IS_DIGIT, STR_IS_DOUBLE, STR_IS_ENTIER,
STR_IS_FALSE, STR_IS_GRAPH, STR_IS_INT, STR_IS_LIST,
STR_IS_LOWER, STR_IS_PRINT, STR_IS_PUNCT, STR_IS_SPACE,
STR_IS_TRUE, STR_IS_UPPER, STR_IS_WIDE, STR_IS_WORD,
STR_IS_XDIGIT
STR_IS_BOOL, STR_IS_DICT, STR_IS_DIGIT, STR_IS_DOUBLE,
STR_IS_ENTIER, STR_IS_FALSE, STR_IS_GRAPH, STR_IS_INT,
STR_IS_LIST, STR_IS_LOWER, STR_IS_PRINT, STR_IS_PUNCT,
STR_IS_SPACE, STR_IS_TRUE, STR_IS_UPPER, STR_IS_UNICODE,
STR_IS_WIDE, STR_IS_WORD, STR_IS_XDIGIT
};
int t, range, allowEmpty = 0, end;
InstStringClassType strClassType;
@@ -609,6 +609,9 @@ TclCompileStringIsCmd(
case STR_IS_UPPER:
strClassType = STR_CLASS_UPPER;
goto compileStrClass;
case STR_IS_UNICODE:
strClassType = STR_CLASS_UNICODE;
goto compileStrClass;
case STR_IS_WORD:
strClassType = STR_CLASS_WORD;
goto compileStrClass;
@@ -935,7 +938,7 @@ TclCompileStringMapCmd(
if (!TclWordKnownAtCompileTime(mapTokenPtr, mapObj)) {
Tcl_DecrRefCount(mapObj);
return TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
} else if (Tcl_ListObjGetElements(NULL, mapObj, &len, &objv) != TCL_OK) {
} else if (TclListObjGetElements(NULL, mapObj, &len, &objv) != TCL_OK) {
Tcl_DecrRefCount(mapObj);
return TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
} else if (len != 2) {
@@ -1415,6 +1418,7 @@ StringClassDesc const tclStringClassTable[] = {
{"upper", Tcl_UniCharIsUpper},
{"word", Tcl_UniCharIsWordChar},
{"xdigit", UniCharIsHexDigit},
{"unicode", Tcl_UniCharIsUnicode},
{"", NULL}
};
@@ -2727,7 +2731,7 @@ TclCompileThrowCmd(
CompileWord(envPtr, msgToken, interp, 2);
codeIsList = codeKnown && (TCL_OK ==
Tcl_ListObjLength(interp, objPtr, &len));
TclListObjLength(interp, objPtr, &len));
codeIsValid = codeIsList && (len != 0);
if (codeIsValid) {
@@ -2860,7 +2864,7 @@ TclCompileTryCmd(
TclNewObj(tmpObj);
Tcl_IncrRefCount(tmpObj);
if (!TclWordKnownAtCompileTime(tokenPtr, tmpObj)
|| Tcl_ListObjLength(NULL, tmpObj, &objc) != TCL_OK
|| TclListObjLength(NULL, tmpObj, &objc) != TCL_OK
|| (objc == 0)) {
TclDecrRefCount(tmpObj);
goto failedToCompile;
@@ -2903,7 +2907,7 @@ TclCompileTryCmd(
TclDecrRefCount(tmpObj);
goto failedToCompile;
}
if (Tcl_ListObjGetElements(NULL, tmpObj, &objc, &objv) != TCL_OK
if (TclListObjGetElements(NULL, tmpObj, &objc, &objv) != TCL_OK
|| (objc > 2)) {
TclDecrRefCount(tmpObj);
goto failedToCompile;
@@ -3114,7 +3118,7 @@ IssueTryClausesInstructions(
JUMP4( JUMP_FALSE, notCodeJumpSource);
if (matchClauses[i]) {
const char *p;
Tcl_ListObjLength(NULL, matchClauses[i], &len);
TclListObjLength(NULL, matchClauses[i], &len);
/*
* Match the errorcode according to try/trap rules.
@@ -3325,7 +3329,7 @@ IssueTryClausesFinallyInstructions(
OP( EQ);
JUMP4( JUMP_FALSE, notCodeJumpSource);
if (matchClauses[i]) {
Tcl_ListObjLength(NULL, matchClauses[i], &len);
TclListObjLength(NULL, matchClauses[i], &len);
/*
* Match the errorcode according to try/trap rules.
+5 -5
View File
@@ -2109,7 +2109,7 @@ ParseLexeme(
* Example: Inf + luence + () becomes a valid function call.
* [Bug 3401704]
*/
if (TclHasIntRep(literal, &tclDoubleType)) {
if (TclHasInternalRep(literal, &tclDoubleType)) {
const char *p = start;
while (p < end) {
@@ -2520,7 +2520,7 @@ CompileExprTree(
* However, the design of the "global" and "local"
* LiteralTable does not permit the value of lePtr->objPtr
* to change. So rather than replace lePtr->objPtr, we do
* surgery to transfer our desired intrep into it.
* surgery to transfer our desired internalrep into it.
*/
objPtr->typePtr = literal->typePtr;
@@ -2533,9 +2533,9 @@ CompileExprTree(
* When optimize==0, we know the expression is a one-off and
* there's nothing to be gained from sharing literals when
* they won't live long, and the copies we have already have
* an appropriate intrep. In this case, skip literal
* an appropriate internalrep. In this case, skip literal
* registration that would enable sharing, and use the routine
* that preserves intreps.
* that preserves internalreps.
*/
TclEmitPush(TclAddLiteralObj(envPtr, literal, NULL), envPtr);
@@ -2572,7 +2572,7 @@ CompileExprTree(
if ((tableValue->typePtr == NULL) &&
(objPtr->typePtr != NULL)) {
/*
* Same intrep surgery as for OT_LITERAL.
* Same internalrep surgery as for OT_LITERAL.
*/
tableValue->typePtr = objPtr->typePtr;
+186 -197
View File
@@ -717,8 +717,8 @@ static void EnterCmdWordData(ExtCmdLoc *eclPtr, int srcOffset,
static void ReleaseCmdWordData(ExtCmdLoc *eclPtr);
/*
* The structure below defines the bytecode Tcl object type by means of
* procedures that can be invoked by generic object code.
* tclByteCodeType provides the standard type management procedures for the
* bytecode type.
*/
const Tcl_ObjType tclByteCodeType = {
@@ -730,8 +730,8 @@ const Tcl_ObjType tclByteCodeType = {
};
/*
* The structure below defines a bytecode Tcl object type to hold the
* compiled bytecode for the [subst]itution of Tcl values.
* subtCodeType provides the standard type managemnt procedures for the
* substcode type, which represents substiution within a Tcl value.
*/
static const Tcl_ObjType substCodeType = {
@@ -756,16 +756,14 @@ static const Tcl_ObjType substCodeType = {
* TclSetByteCodeFromAny --
*
* Part of the bytecode Tcl object type implementation. Attempts to
* generate an byte code internal form for the Tcl object "objPtr" by
* compiling its string representation. This function also takes a hook
* procedure that will be invoked to perform any needed post processing
* on the compilation results before generating byte codes. interp is
* compile the string representation of the objPtr into bytecode. Accepts
* a hook routine that is invoked to perform any needed post-processing on
* the compilation results before generating byte codes. interp is the
* compilation context and may not be NULL.
*
* Results:
* The return value is a standard Tcl object result. If an error occurs
* during compilation, an error message is left in the interpreter's
* result.
* A standard Tcl object result. If an error occurs during compilation, an
* error message is left in the interpreter's result.
*
* Side effects:
* Frees the old internal representation. If no error occurs, then the
@@ -807,7 +805,7 @@ TclSetByteCodeFromAny(
length = objPtr->length;
/*
* TIP #280: Pick up the CmdFrame in which the BC compiler was invoked and
* TIP #280: Pick up the CmdFrame in which the BC compiler was invoked, and
* use to initialize the tracking in the compiler. This information was
* stored by TclCompEvalObj and ProcCompileProc.
*/
@@ -816,15 +814,14 @@ TclSetByteCodeFromAny(
iPtr->invokeCmdFramePtr, iPtr->invokeWord);
/*
* Now we check if we have data about invisible continuation lines for the
* script, and make it available to the compile environment, if so.
* Make available to the compilation environment any data about invisible
* continuation lines for the script.
*
* It is not clear if the script Tcl_Obj* can be free'd while the compiler
* is using it, leading to the release of the associated ContLineLoc
* structure as well. To ensure that the latter doesn't happen we set a
* lock on it. We release this lock in the function TclFreeCompileEnv(),
* found in this file. The "lineCLPtr" hashtable is managed in the file
* "tclObj.c".
* structure as well. To ensure that the latter doesn't happen set a lock
* on it, which is released in TclFreeCompileEnv(). The "lineCLPtr"
* hashtable tclObj.c.
*/
clLocPtr = TclContinuationsGet(objPtr);
@@ -835,7 +832,7 @@ TclSetByteCodeFromAny(
TclCompileScript(interp, stringPtr, length, &compEnv);
/*
* Successful compilation. Add a "done" instruction at the end.
* Compilation succeeded. Add a "done" instruction at the end.
*/
TclEmitOpcode(INST_DONE, &compEnv);
@@ -843,9 +840,9 @@ TclSetByteCodeFromAny(
/*
* Check for optimizations!
*
* Test if the generated code is free of most hazards; if so, recompile
* but with generation of INST_START_CMD disabled. This produces somewhat
* faster code in some cases, and more compact code in more.
* If the generated code is free of most hazards, recompile with generation
* of INST_START_CMD disabled to produce code that more compact in many
* cases, and also sometimes more performant.
*/
if (Tcl_GetParent(interp) == NULL &&
@@ -875,7 +872,7 @@ TclSetByteCodeFromAny(
}
/*
* Invoke the compilation hook procedure if one exists.
* Invoke the compilation hook procedure if there is one.
*/
if (hookProc) {
@@ -884,7 +881,7 @@ TclSetByteCodeFromAny(
/*
* Change the object into a ByteCode object. Ownership of the literal
* objects and aux data items is given to the ByteCode object.
* objects and aux data items passes to the ByteCode object.
*/
#ifdef TCL_COMPILE_DEBUG
@@ -915,12 +912,12 @@ TclSetByteCodeFromAny(
* compiling its string representation.
*
* Results:
* The return value is a standard Tcl object result. If an error occurs
* during compilation, an error message is left in the interpreter's
* result unless "interp" is NULL.
* A standard Tcl object result. If an error occurs during compilation and
* "interp" is not null, an error message is left in the interpreter's
* result.
*
* Side effects:
* Frees the old internal representation. If no error occurs, then the
* Frees the old internal representation. If no error occurs then the
* compiled code is stored as "objPtr"s bytecode representation. Also, if
* debugging, initializes the "tcl_traceCompile" Tcl variable used to
* trace compilations.
@@ -932,7 +929,7 @@ static int
SetByteCodeFromAny(
Tcl_Interp *interp, /* The interpreter for which the code is being
* compiled. Must not be NULL. */
Tcl_Obj *objPtr) /* The object to make a ByteCode object. */
Tcl_Obj *objPtr) /* The object to compile to bytecode */
{
if (interp == NULL) {
return TCL_ERROR;
@@ -946,9 +943,9 @@ SetByteCodeFromAny(
* DupByteCodeInternalRep --
*
* Part of the bytecode Tcl object type implementation. However, it does
* not copy the internal representation of a bytecode Tcl_Obj, but
* instead leaves the new object untyped (with a NULL type pointer).
* Code will be compiled for the new object only if necessary.
* not copy the internal representation of a bytecode Tcl_Obj, instead
* assigning NULL to the type pointer of the new object. Code is compiled
* for the new object only if necessary.
*
* Results:
* None.
@@ -980,9 +977,9 @@ DupByteCodeInternalRep(
* None.
*
* Side effects:
* The bytecode object's internal rep is marked invalid and its code gets
* freed unless the code is actively being executed. In that case the
* cleanup is delayed until the last execution of the code completes.
* The bytecode object's internal rep is invalidated and its code is freed
* unless the code is actively being executed, in which case cleanup is
* delayed until the last execution of the code completes.
*
*----------------------------------------------------------------------
*/
@@ -993,7 +990,7 @@ FreeByteCodeInternalRep(
{
ByteCode *codePtr;
ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr);
ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr);
assert(codePtr != NULL);
TclReleaseByteCode(codePtr);
@@ -1004,16 +1001,16 @@ FreeByteCodeInternalRep(
*
* TclReleaseByteCode --
*
* This procedure does all the real work of freeing up a bytecode
* object's ByteCode structure. It's called only when the structure's
* reference count becomes zero.
* Does all the real work of freeing up a bytecode object's ByteCode
* structure. Called only when the structure's reference count
* is zero.
*
* Results:
* None.
*
* Side effects:
* Frees objPtr's bytecode internal representation and sets its type NULL
* Also releases its literals and frees its auxiliary data items.
* Frees objPtr's bytecode internal representation and sets its type to
* NULL. Also releases its literals and frees its auxiliary data items.
*
*----------------------------------------------------------------------
*/
@@ -1089,8 +1086,8 @@ CleanupByteCode(
/*
* A single heap object holds the ByteCode structure and its code, object,
* command location, and auxiliary data arrays. This means we only need to
* 1) decrement the ref counts of the LiteralEntry's in its literal array,
* 2) call the free procs for the auxiliary data items, 3) free the
* 1) decrement the ref counts of each LiteralEntry in the literal array,
* 2) call the free procedures for the auxiliary data items, 3) free the
* localCache if it is unused, and finally 4) free the ByteCode
* structure's heap object.
*
@@ -1099,11 +1096,11 @@ CleanupByteCode(
* the global literal table. They instead maintain private references to
* their literals which must be decremented.
*
* In order to insure a proper and efficient cleanup of the literal array
* when it contains non-shared literals [Bug 983660], we also distinguish
* the case of an interpreter being deleted (signaled by interp == NULL).
* In order to ensure proper and efficient cleanup of the literal array
* when it contains non-shared literals [Bug 983660], distinguish the case
* of an interpreter being deleted, which is signaled by interp == NULL.
* Also, as the interp deletion will remove the global literal table
* anyway, we avoid the extra cost of updating it for each literal being
* anyway, avoid the extra cost of updating it for each literal being
* released.
*/
@@ -1135,9 +1132,9 @@ CleanupByteCode(
}
/*
* TIP #280. Release the location data associated with this byte code
* structure, if any. NOTE: The interp we belong to may be gone already,
* and the data with it.
* TIP #280. Release the location data associated with this bytecode
* structure, if any. The associated interp may be gone already, and the
* data with it.
*
* See also tclBasic.c, DeleteInterpProc
*/
@@ -1165,8 +1162,8 @@ CleanupByteCode(
*
* IsCompactibleCompileEnv --
*
* Checks to see if we may apply some basic compaction optimizations to a
* piece of bytecode. Idempotent.
* Determines whether some basic compaction optimizations may be applied
* to a piece of bytecode. Idempotent.
*
* ---------------------------------------------------------------------
*/
@@ -1180,7 +1177,7 @@ IsCompactibleCompileEnv(
/*
* Special: procedures in the '::tcl' namespace (or its children) are
* considered to be well-behaved and so can have compaction applied even
* considered to be well-behaved, so compaction can be applied to them even
* if it would otherwise be invalid.
*/
@@ -1196,10 +1193,10 @@ IsCompactibleCompileEnv(
/*
* Go through and ensure that no operation involved can cause a desired
* change of bytecode sequence during running. This comes down to ensuring
* that there are no mapped variables (due to traces) or calls to external
* commands (traces, [uplevel] trickery). This is actually a very
* conservative check; it turns down a lot of code that is OK in practice.
* change of bytecode sequence during its execution. This comes down to
* ensuring that there are no mapped variables (due to traces) or calls to
* external commands (traces, [uplevel] trickery). This is actually a very
* conservative check. It turns down a lot of code that is OK in practice.
*/
for (pc = envPtr->codeStart ; pc < envPtr->codeNext ; pc += size) {
@@ -1235,8 +1232,8 @@ IsCompactibleCompileEnv(
*
* Tcl_SubstObj --
*
* This function performs the substitutions specified on the given string
* as described in the user documentation for the "subst" Tcl command.
* Performs substitutions on the given string as described in the user
* documentation for "subst".
*
* Results:
* A Tcl_Obj* containing the substituted string, or NULL to indicate that
@@ -1268,14 +1265,14 @@ Tcl_SubstObj(
*
* Tcl_NRSubstObj --
*
* Request substitution of a Tcl value by the NR stack.
* Adds substitution within the value of objPtr to the NR execution stack.
*
* Results:
* Returns TCL_OK.
* TCL_OK.
*
* Side effects:
* Compiles objPtr into bytecode that performs the substitutions as
* governed by flags and places callbacks on the NR stack to execute
* governed by flags, adds a callback to the NR execution stack to execute
* the bytecode and store the result in the interp.
*
*----------------------------------------------------------------------
@@ -1299,11 +1296,11 @@ Tcl_NRSubstObj(
*
* CompileSubstObj --
*
* Compile a Tcl value into ByteCode implementing its substitution, as
* governed by flags.
* Compiles a value into bytecode that performs substitution within the
* value, as governed by flags.
*
* Results:
* A (ByteCode *) is returned pointing to the resulting ByteCode.
* A (ByteCode *) is pointing to the resulting ByteCode.
*
* Side effects:
* The Tcl_ObjType of objPtr is changed to the "substcode" type, and the
@@ -1323,7 +1320,7 @@ CompileSubstObj(
Interp *iPtr = (Interp *) interp;
ByteCode *codePtr = NULL;
ByteCodeGetIntRep(objPtr, &substCodeType, codePtr);
ByteCodeGetInternalRep(objPtr, &substCodeType, codePtr);
if (codePtr != NULL) {
Namespace *nsPtr = iPtr->varFramePtr->nsPtr;
@@ -1335,7 +1332,7 @@ CompileSubstObj(
|| (codePtr->nsEpoch != nsPtr->resolverEpoch)
|| (codePtr->localCachePtr !=
iPtr->varFramePtr->localCachePtr)) {
Tcl_StoreIntRep(objPtr, &substCodeType, NULL);
Tcl_StoreInternalRep(objPtr, &substCodeType, NULL);
codePtr = NULL;
}
}
@@ -1373,9 +1370,9 @@ CompileSubstObj(
*
* FreeSubstCodeInternalRep --
*
* Part of the substcode Tcl object type implementation. Frees the
* storage associated with a substcode object's internal representation
* unless its code is actively being executed.
* Part of the "substcode" Tcl object type implementation. Frees the
* storage associated with the substcode internal representation of a
* Tcl_Obj unless its code is actively being executed.
*
* Results:
* None.
@@ -1394,7 +1391,7 @@ FreeSubstCodeInternalRep(
{
ByteCode *codePtr;
ByteCodeGetIntRep(objPtr, &substCodeType, codePtr);
ByteCodeGetInternalRep(objPtr, &substCodeType, codePtr);
assert(codePtr != NULL);
TclReleaseByteCode(codePtr);
@@ -1629,14 +1626,14 @@ TclInitCompileEnv(
*
* TclFreeCompileEnv --
*
* Free the storage allocated in a CompileEnv compilation environment
* Frees the storage allocated in a CompileEnv compilation environment
* structure.
*
* Results:
* None.
*
* Side effects:
* Allocated storage in the CompileEnv structure is freed. Note that its
* Allocated storage in the CompileEnv structure is freed, although its
* local literal table is not deleted and its literal objects are not
* released. In addition, storage referenced by its auxiliary data items
* is not freed. This is done so that, when compilation is successful,
@@ -1707,10 +1704,11 @@ TclFreeCompileEnv(
*
* TclWordKnownAtCompileTime --
*
* Test whether the value of a token is completely known at compile time.
* Determines whether the value of a token is completely known at compile
* time.
*
* Results:
* Returns true if the tokenPtr argument points to a word value that is
* True if the tokenPtr argument points to a word value that is
* completely known at compile time. Generally, values that are known at
* compile time can be compiled to their values, while values that cannot
* be known until substitution at runtime must be compiled to bytecode
@@ -1787,12 +1785,12 @@ TclWordKnownAtCompileTime(
*
* TclCompileScript --
*
* Compile a Tcl script in a string.
* Compiles a Tcl script in a string.
*
* Results:
* The return value is TCL_OK on a successful compilation and TCL_ERROR
* on failure. If TCL_ERROR is returned, then the interpreter's result
* contains an error message.
*
* A standard Tcl result. If an error occurs, an
* error message is left in the interpreter's result.
*
* Side effects:
* Adds instructions to envPtr to evaluate the script at runtime.
@@ -1929,14 +1927,14 @@ CompileExpanded(
/*
* The stack depth during argument expansion can only be managed at
* runtime, as the number of elements in the expanded lists is not known
* at compile time. We adjust here the stack depth estimate so that it is
* at compile time. Adjust the stack depth estimate here so that it is
* correct after the command with expanded arguments returns.
*
* The end effect of this command's invocation is that all the words of
* the command are popped from the stack, and the result is pushed: the
* the command are popped from the stack and the result is pushed: The
* stack top changes by (1-wordIdx).
*
* Note that the estimates are not correct while the command is being
* The estimates are not correct while the command is being
* prepared and run, INST_EXPAND_STKTOP is not stack-neutral in general.
*/
@@ -1956,16 +1954,16 @@ CompileCmdCompileProc(
int depth = TclGetStackDepth(envPtr);
/*
* Emit of the INST_START_CMD instruction is controlled by the value of
* Emission of the INST_START_CMD instruction is controlled by the value of
* envPtr->atCmdStart:
*
* atCmdStart == 2 : We are not using the INST_START_CMD instruction.
* atCmdStart == 1 : INST_START_CMD was the last instruction emitted.
* : We do not need to emit another. Instead we
* : increment the number of cmds started at it (except
* : for the special case at the start of a script.)
* atCmdStart == 0 : The last instruction was something else. We need
* : to emit INST_START_CMD here.
* atCmdStart == 2 : Don't use the INST_START_CMD instruction.
* atCmdStart == 1 : INST_START_CMD was the last instruction emitted,
* : so no need to emit another. Instead
* : increment the number of cmds started at it, except
* : for the special case at the start of a script.
* atCmdStart == 0 : The last instruction was something else.
* : Emit INST_START_CMD here.
*/
switch (envPtr->atCmdStart) {
@@ -1988,7 +1986,7 @@ CompileCmdCompileProc(
if (TCL_OK == TclAttemptCompileProc(interp, parsePtr, 1, cmdPtr, envPtr)) {
if (incrOffset >= 0) {
/*
* We successfully compiled a command. Increment the number of
* Command compiled succesfully. Increment the number of
* commands that start at the currently active INST_START_CMD.
*/
@@ -2057,7 +2055,7 @@ CompileCommandTokens(
/*
* TIP #280. Scan the words and compute the extended location information.
* The map first contain full per-word line information for use by the
* At first the map first contains full per-word line information for use by the
* compiler. This is later replaced by a reduced form which signals
* non-literal words, stored in 'wlines'.
*/
@@ -2099,7 +2097,7 @@ CompileCommandTokens(
}
}
/* If cmdPtr != NULL, we will try to call cmdPtr->compileProc */
/* If cmdPtr != NULL, try to call cmdPtr->compileProc */
if (cmdPtr) {
code = CompileCmdCompileProc(interp, parsePtr, cmdPtr, envPtr);
}
@@ -2126,8 +2124,8 @@ CompileCommandTokens(
(envPtr->codeNext-envPtr->codeStart) - startCodeOffset);
/*
* TIP #280: Free full form of per-word line data and insert the reduced
* form now
* TIP #280: Free the full form of per-word line data and insert the
* reduced form now.
*/
envPtr->line = cmdLine;
@@ -2165,10 +2163,10 @@ TclCompileScript(
}
/*
* Check depth to avoid overflow of the C execution stack by too many
* nested calls of TclCompileScript (considering interp recursionlimit).
* Factor 5/4 (1.25) is used to avoid too mistaken limit recognition
* during "mixed" evaluation and compilation process (nested eval+compile)
* and is good enough for default recursionlimit (1000).
* nested calls of TclCompileScript, considering interp recursionlimit.
* Use factor 5/4 (1.25) to avoid being too mistaken when recognizing the
* limit during "mixed" evaluation and compilation process (nested
* eval+compile) and is good enough for default recursionlimit (1000).
*/
if (iPtr->numLevels / 5 > iPtr->maxNestingDepth / 4) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
@@ -2311,8 +2309,8 @@ TclCompileScript(
*
* TclCompileTokens --
*
* Given an array of tokens parsed from a Tcl command (e.g., the tokens
* that make up a word) this procedure emits instructions to evaluate the
* Given an array of tokens parsed from a Tcl command, e.g. the tokens
* that make up a word, emits instructions to evaluate the
* tokens and concatenate their values to form a single result value on
* the interpreter's runtime evaluation stack.
*
@@ -2417,18 +2415,16 @@ TclCompileTokens(
int depth = TclGetStackDepth(envPtr);
/*
* For the handling of continuation lines in literals we first check if
* this is actually a literal. For if not we can forego the additional
* processing. Otherwise we pre-allocate a small table to store the
* locations of all continuation lines we find in this literal, if any.
* The table is extended if needed.
* if this is actually a literal, handle continuation lines by
* preallocating a small table to store the locations of any continuation
* lines we find in this literal. The table is extended if needed.
*
* Note: Different to the equivalent code in function 'TclSubstTokens()'
* (see file "tclParse.c") we do not seem to need the 'adjust' variable.
* We also do not seem to need code which merges continuation line
* information of multiple words which concat'd at runtime. Either that or
* I have not managed to find a test case for these two possibilities yet.
* It might be a difference between compile- versus run-time processing.
* Note: In contrast with the analagous code in 'TclSubstTokens()' the
* 'adjust' variable seems unneeded here. The code which merges
* continuation line information of multiple words which concat'd at
* runtime also seems unneeded. Either that or I have not managed to find a
* test case for these two possibilities yet. It might be a difference
* between compile- versus run-time processing.
*/
numCL = 0;
@@ -2464,18 +2460,17 @@ TclCompileTokens(
Tcl_DStringAppend(&textBuffer, buffer, length);
/*
* If the backslash sequence we found is in a literal, and
* represented a continuation line, we compute and store its
* If the identified backslash sequence is in a literal and
* represented a continuation line, compute and store its
* location (as char offset to the beginning of the _result_
* script). We may have to extend the table of locations.
*
* Note that the continuation line information is relevant even if
* the word we are processing is not a literal, as it can affect
* nested commands. See the branch for TCL_TOKEN_COMMAND below,
* where the adjustment we are tracking here is taken into
* account. The good thing is that we do not need a table of
* everything, just the number of lines we have to add as
* correction.
* The continuation line information is relevant even if the word
* being processed is not a literal, as it can affect nested
* commands. See the branch below for TCL_TOKEN_COMMAND, where the
* adjustment being tracked here is taken into account. The good
* thing is a table of everything is not needed, just the number of
* lines to to add as correction.
*/
if ((length == 1) && (buffer[0] == ' ') &&
@@ -2601,13 +2596,13 @@ TclCompileTokens(
* TclCompileCmdWord --
*
* Given an array of parse tokens for a word containing one or more Tcl
* commands, emit inline instructions to execute them. This procedure
* differs from TclCompileTokens in that a simple word such as a loop
* body enclosed in braces is not just pushed as a string, but is itself
* parsed into tokens and compiled.
* commands, emits inline instructions to execute them. In contrast with
* TclCompileTokens, a simple word such as a loop body enclosed in braces
* is not just pushed as a string, but is itself parsed into tokens and
* compiled.
*
* Results:
* The return value is a standard Tcl result. If an error occurs, an
* A standard Tcl result. If an error occurs, an
* error message is left in the interpreter's result.
*
* Side effects:
@@ -2627,16 +2622,16 @@ TclCompileCmdWord(
{
if ((count == 1) && (tokenPtr->type == TCL_TOKEN_TEXT)) {
/*
* Handle the common case: if there is a single text token, compile it
* The common case that there is a single text token. Compile it
* into an inline sequence of instructions.
*/
TclCompileScript(interp, tokenPtr->start, tokenPtr->size, envPtr);
} else {
/*
* Multiple tokens or the single token involves substitutions. Emit
* instructions to invoke the eval command procedure at runtime on the
* result of evaluating the tokens.
* Either there are multiple tokens, or the single token involves
* substitutions. Emit instructions to invoke the eval command
* procedure at runtime on the result of evaluating the tokens.
*/
TclCompileTokens(interp, tokenPtr, count, envPtr);
@@ -2650,13 +2645,12 @@ TclCompileCmdWord(
* TclCompileExprWords --
*
* Given an array of parse tokens representing one or more words that
* contain a Tcl expression, emit inline instructions to execute the
* expression. This procedure differs from TclCompileExpr in that it
* supports Tcl's two-level substitution semantics for expressions that
* appear as command words.
* contain a Tcl expression, emits inline instructions to execute the
* expression. In contrast with TclCompileExpr, supports Tcl's two-level
* substitution semantics for an expression that appears as command words.
*
* Results:
* The return value is a standard Tcl result. If an error occurs, an
* A standard Tcl result. If an error occurs, an
* error message is left in the interpreter's result.
*
* Side effects:
@@ -2718,10 +2712,10 @@ TclCompileExprWords(
*
* TclCompileNoOp --
*
* Function called to compile no-op's
* Compiles no-op's
*
* Results:
* The return value is TCL_OK, indicating successful compilation.
* TCL_OK if completion was successful.
*
* Side effects:
* Instructions are added to envPtr to execute a no-op at runtime. No
@@ -2760,14 +2754,14 @@ TclCompileNoOp(
*
* TclInitByteCodeObj --
*
* Create a ByteCode structure and initialize it from a CompileEnv
* Creates a ByteCode structure and initializes it from a CompileEnv
* compilation environment structure. The ByteCode structure is smaller
* and contains just that information needed to execute the bytecode
* instructions resulting from compiling a Tcl script. The resulting
* structure is placed in the specified object.
*
* Results:
* A newly constructed ByteCode object is stored in the internal
* A newly-constructed ByteCode object is stored in the internal
* representation of the objPtr.
*
* Side effects:
@@ -2790,7 +2784,7 @@ PreventCycle(
for (i = 0; i < envPtr->literalArrayNext; i++) {
if (objPtr == TclFetchLiteral(envPtr, i)) {
/*
* Prevent circular reference where the bytecode intrep of
* Prevent circular reference where the bytecode internalrep of
* a value contains a literal which is that same value.
* If this is allowed to happen, refcount decrements may not
* reach zero, and memory may leak. Bugs 467523, 3357771
@@ -2798,7 +2792,7 @@ PreventCycle(
* NOTE: [Bugs 3392070, 3389764] We make a copy based completely
* on the string value, and do not call Tcl_DuplicateObj() so we
* can be sure we do not have any lingering cycles hiding in
* the intrep.
* the internalrep.
*/
int numBytes;
const char *bytes = TclGetStringFromObj(objPtr, &numBytes);
@@ -2969,7 +2963,7 @@ TclInitByteCodeObj(
* by making its internal rep point to the just compiled ByteCode.
*/
ByteCodeSetIntRep(objPtr, typePtr, codePtr);
ByteCodeSetInternalRep(objPtr, typePtr, codePtr);
return codePtr;
}
@@ -3071,7 +3065,7 @@ TclFindCompiledLocal(
if (create || (name == NULL)) {
localVar = procPtr->numCompiledLocals;
localPtr = (CompiledLocal *)ckalloc(offsetof(CompiledLocal, name) + nameBytes + 1);
localPtr = (CompiledLocal *)ckalloc(offsetof(CompiledLocal, name) + 1U + nameBytes);
if (procPtr->firstLocalPtr == NULL) {
procPtr->firstLocalPtr = procPtr->lastLocalPtr = localPtr;
} else {
@@ -3102,16 +3096,15 @@ TclFindCompiledLocal(
*
* TclExpandCodeArray --
*
* Procedure that uses malloc to allocate more storage for a CompileEnv's
* code array.
* Uses malloc to allocate more storage for a CompileEnv's code array.
*
* Results:
* None.
*
* Side effects:
* The byte code array in *envPtr is reallocated to a new array of double
* the size, and if envPtr->mallocedCodeArray is non-zero the old array
* is freed. Byte codes are copied from the old array to the new one.
* The size of the bytecode array is doubled. If envPtr->mallocedCodeArray
* is non-zero the old array is freed. Byte codes are copied from the old
* array to the new one.
*
*----------------------------------------------------------------------
*/
@@ -3138,8 +3131,8 @@ TclExpandCodeArray(
envPtr->codeStart = (unsigned char *)ckrealloc(envPtr->codeStart, newBytes);
} else {
/*
* envPtr->codeStart isn't a ckalloc'd pointer, so we must code a
* ckrealloc equivalent for ourselves.
* envPtr->exceptArrayPtr isn't a Tcl_Alloc'd pointer, so
* perform the equivalent of Tcl_Realloc directly.
*/
unsigned char *newPtr = (unsigned char *)ckalloc(newBytes);
@@ -3455,7 +3448,7 @@ TclCreateExceptRange(
* TclGetInnermostExceptionRange --
*
* Returns the innermost exception range that covers the current code
* creation point, and (optionally) the stack depth that is expected at
* creation point, and optionally the stack depth that is expected at
* that point. Relies on the fact that the range has a numCodeBytes = -1
* when it is being populated and that inner ranges come after outer
* ranges.
@@ -3497,7 +3490,7 @@ TclGetInnermostExceptionRange(
*
* Adds a place that wants to break/continue to the loop exception range
* tracking that will be fixed up once the loop can be finalized. These
* functions will generate an INST_JUMP4 that will be fixed up during the
* functions generate an INST_JUMP4 that is fixed up during the
* loop finalization.
*
* ---------------------------------------------------------------------
@@ -3561,8 +3554,8 @@ TclAddLoopContinueFixup(
*
* TclCleanupStackForBreakContinue --
*
* Ditch the extra elements from the auxiliary stack and the main stack.
* How to do this exactly depends on whether there are any elements on
* Removes the extra elements from the auxiliary stack and the main stack.
* How this is done depends on whether there are any elements on
* the auxiliary stack to pop.
*
* ---------------------------------------------------------------------
@@ -3632,7 +3625,7 @@ StartExpanding(
}
/*
* Adequate condition: further out loops and further in exceptions
* Adequate condition: loops further out and exceptions further in
* don't actually need this information.
*/
@@ -3642,7 +3635,7 @@ StartExpanding(
}
/*
* There's now one more expansion being processed on the auxiliary stack.
* One more expansion is now being processed on the auxiliary stack.
*/
envPtr->expandCount++;
@@ -3655,7 +3648,7 @@ StartExpanding(
*
* Finalizes a loop exception range, binding the registered [break] and
* [continue] implementations so that they jump to the correct place.
* Note that this must only be called after *all* the exception range
* This must be called only after *all* the exception range
* target offsets have been set.
*
* ---------------------------------------------------------------------
@@ -3726,21 +3719,17 @@ TclFinalizeLoopExceptionRange(
*
* TclCreateAuxData --
*
* Procedure that allocates and initializes a new AuxData structure in a
* Allocates and initializes a new AuxData structure in a
* CompileEnv's array of compilation auxiliary data records. These
* AuxData records hold information created during compilation by
* CompileProcs and used by instructions during execution.
*
* Results:
* Returns the index for the newly created AuxData structure.
* The index of the newly-created AuxData structure in the array.
*
* Side effects:
* If there is not enough room in the CompileEnv's AuxData array, the
* AuxData array in expanded: a new array of double the size is
* allocated, if envPtr->mallocedAuxDataArray is non-zero the old array
* is freed, and AuxData entries are copied from the old array to the new
* one.
*
* If there is not enough room in the CompileEnv's AuxData array, its size
* is doubled.
*----------------------------------------------------------------------
*/
@@ -3828,8 +3817,7 @@ TclInitJumpFixupArray(
*
* TclExpandJumpFixupArray --
*
* Procedure that uses malloc to allocate more storage for a jump fixup
* array.
* Uses malloc to allocate more storage for a jump fixup array.
*
* Results:
* None.
@@ -3908,10 +3896,11 @@ TclFreeJumpFixupArray(
*
* TclEmitForwardJump --
*
* Procedure to emit a two-byte forward jump of kind "jumpType". Since
* the jump may later have to be grown to five bytes if the jump target
* is more than, say, 127 bytes away, this procedure also initializes a
* JumpFixup record with information about the jump.
* Emits a two-byte forward jump of kind "jumpType". Also initializes a
* JumpFixup record with information about the jump. Since may later be
* necessary to increase the size of the jump instruction to five bytes if
* the jump target is more than, say, 127 bytes away.
*
*
* Results:
* None.
@@ -3966,16 +3955,17 @@ TclEmitForwardJump(
*
* TclFixupForwardJump --
*
* Procedure that updates a previously-emitted forward jump to jump a
* specified number of bytes, "jumpDist". If necessary, the jump is grown
* from two to five bytes; this is done if the jump distance is greater
* than "distThreshold" (normally 127 bytes). The jump is described by a
* JumpFixup record previously initialized by TclEmitForwardJump.
* Modifies a previously-emitted forward jump to jump a specified number
* of bytes, "jumpDist". If necessary, the size of the jump instruction is
* increased from two to five bytes. This is done if the jump distance is
* greater than "distThreshold" (normally 127 bytes). The jump is
* described by a JumpFixup record previously initialized by
* TclEmitForwardJump.
*
* Results:
* 1 if the jump was grown and subsequent instructions had to be moved;
* otherwise 0. This result is returned to allow callers to update any
* additional code offsets they may hold.
* 1 if the jump was grown and subsequent instructions had to be moved, or
* 0 otherwsie. This allows callers to update any additional code offsets
* they may hold.
*
* Side effects:
* The jump may be grown and subsequent instructions moved. If this
@@ -4018,10 +4008,10 @@ TclFixupForwardJump(
}
/*
* We must grow the jump then move subsequent instructions down. Note that
* if we expand the space for generated instructions, code addresses might
* change; be careful about updating any of these addresses held in
* variables.
* Increase the size of the jump instruction, and then move subsequent
* instructions down. Expanding the space for generated instructions means
* that code addresses might change. Be careful about updating any of
* these addresses held in variables.
*/
if ((envPtr->codeNext + 3) > envPtr->codeEnd) {
@@ -4105,7 +4095,7 @@ TclFixupForwardJump(
*
* TclEmitInvoke --
*
* Emit one of the invoke-related instructions, wrapping it if necessary
* Emits one of the invoke-related instructions, wrapping it if necessary
* in code that ensures that any break or continue operation passing
* through it gets the stack unwinding correct, converting it into an
* internal jump if in an appropriate context.
@@ -4115,7 +4105,7 @@ TclFixupForwardJump(
*
* Side effects:
* Issues the jump with all correct stack management. May create another
* loop exception range; pointers to ExceptionRange and ExceptionAux
* loop exception range. Pointers to ExceptionRange and ExceptionAux
* structures should not be held across this call.
*
*----------------------------------------------------------------------
@@ -4173,12 +4163,11 @@ TclEmitInvoke(
va_end(argList);
/*
* Determine if we need to handle break and continue exceptions with a
* special handling exception range (so that we can correctly unwind the
* stack).
* If the exceptions is for break or continue handle it with special
* handling exception range so the stack may be correctly unwound.
*
* These must be done separately; they can be different (especially for
* calls from inside a [for] increment clause).
* These must be done separately since they can be different, especially
* for calls from inside a [for] increment clause.
*/
rangePtr = TclGetInnermostExceptionRange(envPtr, TCL_CONTINUE,
@@ -4398,16 +4387,16 @@ GetCmdLocEncodingSize(
*
* EncodeCmdLocMap --
*
* Encode the command location information for some compiled code into a
* Encodes the command location information for some compiled code into a
* ByteCode structure. The encoded command location map is stored as
* three adjacent byte sequences.
* three-adjacent-byte sequences.
*
* Results:
* Pointer to the first byte after the encoded command location
* A pointer to the first byte after the encoded command location
* information.
*
* Side effects:
* The encoded information is stored into the block of memory headed by
* Stores encoded information into the block of memory headed by
* codePtr. Also records pointers to the start of the four byte sequences
* in fields in codePtr's ByteCode header structure.
*
@@ -4522,9 +4511,9 @@ EncodeCmdLocMap(
*
* RecordByteCodeStats --
*
* Accumulates various compilation-related statistics for each newly
* compiled ByteCode. Called by the TclInitByteCodeObj when Tcl is
* compiled with the -DTCL_COMPILE_STATS flag
* Accumulates compilation-related statistics for each newly-compiled
* ByteCode. Called by the TclInitByteCodeObj when Tcl is compiled with
* the -DTCL_COMPILE_STATS flag
*
* Results:
* None.
+29 -28
View File
@@ -217,9 +217,9 @@ typedef struct ExtCmdLoc {
* the AuxData structure.
*/
typedef ClientData (AuxDataDupProc) (ClientData clientData);
typedef void (AuxDataFreeProc) (ClientData clientData);
typedef void (AuxDataPrintProc)(ClientData clientData,
typedef void *(AuxDataDupProc) (void *clientData);
typedef void (AuxDataFreeProc) (void *clientData);
typedef void (AuxDataPrintProc)(void *clientData,
Tcl_Obj *appendObj, struct ByteCode *codePtr,
unsigned int pcOffset);
@@ -515,20 +515,20 @@ typedef struct ByteCode {
#endif /* TCL_COMPILE_STATS */
} ByteCode;
#define ByteCodeSetIntRep(objPtr, typePtr, codePtr) \
#define ByteCodeSetInternalRep(objPtr, typePtr, codePtr) \
do { \
Tcl_ObjIntRep ir; \
Tcl_ObjInternalRep ir; \
ir.twoPtrValue.ptr1 = (codePtr); \
ir.twoPtrValue.ptr2 = NULL; \
Tcl_StoreIntRep((objPtr), (typePtr), &ir); \
Tcl_StoreInternalRep((objPtr), (typePtr), &ir); \
} while (0)
#define ByteCodeGetIntRep(objPtr, typePtr, codePtr) \
#define ByteCodeGetInternalRep(objPtr, typePtr, codePtr) \
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), (typePtr)); \
const Tcl_ObjInternalRep *irPtr; \
irPtr = TclFetchInternalRep((objPtr), (typePtr)); \
(codePtr) = irPtr ? (ByteCode*)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -922,8 +922,9 @@ typedef enum InstStringClassType {
STR_CLASS_UPPER, /* Unicode upper-case alphabet characters. */
STR_CLASS_WORD, /* Unicode word (alphabetic, digit, connector
* punctuation) characters. */
STR_CLASS_XDIGIT /* Characters that can be used as digits in
STR_CLASS_XDIGIT, /* Characters that can be used as digits in
* hexadecimal numbers ([0-9A-Fa-f]). */
STR_CLASS_UNICODE /* Unicode characters. */
} InstStringClassType;
typedef struct StringClassDesc {
@@ -1117,7 +1118,7 @@ MODULE_SCOPE void TclCompileTokens(Tcl_Interp *interp,
CompileEnv *envPtr);
MODULE_SCOPE void TclCompileVarSubst(Tcl_Interp *interp,
Tcl_Token *tokenPtr, CompileEnv *envPtr);
MODULE_SCOPE int TclCreateAuxData(ClientData clientData,
MODULE_SCOPE int TclCreateAuxData(void *clientData,
const AuxDataType *typePtr, CompileEnv *envPtr);
MODULE_SCOPE int TclCreateExceptRange(ExceptionRangeType type,
CompileEnv *envPtr);
@@ -1191,16 +1192,16 @@ MODULE_SCOPE void TclReleaseByteCode(ByteCode *codePtr);
MODULE_SCOPE void TclReleaseLiteral(Tcl_Interp *interp, Tcl_Obj *objPtr);
MODULE_SCOPE void TclInvalidateCmdLiteral(Tcl_Interp *interp,
const char *name, Namespace *nsPtr);
MODULE_SCOPE int TclSingleOpCmd(ClientData clientData,
MODULE_SCOPE int TclSingleOpCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE int TclSortingOpCmd(ClientData clientData,
MODULE_SCOPE int TclSortingOpCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE int TclVariadicOpCmd(ClientData clientData,
MODULE_SCOPE int TclVariadicOpCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE int TclNoIdentOpCmd(ClientData clientData,
MODULE_SCOPE int TclNoIdentOpCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
#ifdef TCL_COMPILE_DEBUG
@@ -1216,7 +1217,7 @@ MODULE_SCOPE void TclLogCommandInfo(Tcl_Interp *interp,
MODULE_SCOPE Tcl_Obj *TclGetInnerContext(Tcl_Interp *interp,
const unsigned char *pc, Tcl_Obj **tosPtr);
MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[], int isLambda);
@@ -1231,7 +1232,7 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
/*
* Simplified form to access AuxData.
*
* ClientData TclFetchAuxData(CompileEng *envPtr, int index);
* void *TclFetchAuxData(CompileEng *envPtr, int index);
*/
#define TclFetchAuxData(envPtr, index) \
@@ -1494,22 +1495,22 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
# define TclGetInt1AtPtr(p) ((int) *((signed char *) p))
#else
# define TclGetInt1AtPtr(p) \
(((int) *((char *) p)) | ((*(p) & 0200) ? (-256) : 0))
((int) ((*((char *) p)) | ((*(p) & 0200) ? (-256) : 0)))
#endif
#define TclGetInt4AtPtr(p) \
(((int) (TclGetUInt1AtPtr(p) << 24)) | \
(*((p)+1) << 16) | \
(*((p)+2) << 8) | \
(*((p)+3)))
((int) ((TclGetUInt1AtPtr(p) << 24) | \
(*((p)+1) << 16) | \
(*((p)+2) << 8) | \
(*((p)+3))))
#define TclGetUInt1AtPtr(p) \
((unsigned int) *(p))
#define TclGetUInt4AtPtr(p) \
((unsigned int) (*(p) << 24) | \
(*((p)+1) << 16) | \
(*((p)+2) << 8) | \
(*((p)+3)))
((unsigned int) ((*(p) << 24) | \
(*((p)+1) << 16) | \
(*((p)+2) << 8) | \
(*((p)+3))))
/*
* Macros used to compute the minimum and maximum of two integers. The ANSI C
@@ -1556,9 +1557,9 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
*/
#define PushLiteral(envPtr, string, length) \
TclEmitPush(TclRegisterLiteral(envPtr, string, length, 0), (envPtr))
TclEmitPush(TclRegisterLiteral((envPtr), (string), (length), 0), (envPtr))
#define PushStringLiteral(envPtr, string) \
PushLiteral(envPtr, string, (int) (sizeof(string "") - 1))
PushLiteral((envPtr), (string), (int) (sizeof(string "") - 1))
/*
* Macro to advance to the next token; it is more mnemonic than the address
+2 -2
View File
@@ -185,9 +185,9 @@ typedef struct DateInfo {
#define TM_YEAR_BASE 1900
#define HOUR(x) ((int) (60 * x))
#define HOUR(x) ((int) (60 * (x)))
#define SECSPERDAY (24L * 60L * 60L)
#define IsLeapYear(x) ((x % 4 == 0) && (x % 100 != 0 || x % 400 == 0))
#define IsLeapYear(x) (((x) % 4 == 0) && ((x) % 100 != 0 || (x) % 400 == 0))
/*
* An entry in the lexical lookup table.
+94 -41
View File
@@ -124,7 +124,7 @@ Tcl_Obj * Tcl_DbNewBooleanObj(int boolValue, const char *file,
int line);
/* 23 */
EXTERN Tcl_Obj * Tcl_DbNewByteArrayObj(const unsigned char *bytes,
int length, const char *file, int line);
int numBytes, const char *file, int line);
/* 24 */
EXTERN Tcl_Obj * Tcl_DbNewDoubleObj(double doubleValue,
const char *file, int line);
@@ -152,7 +152,7 @@ EXTERN int Tcl_GetBooleanFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, int *boolPtr);
/* 33 */
EXTERN unsigned char * Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr,
int *lengthPtr);
int *numBytesPtr);
/* 34 */
EXTERN int Tcl_GetDouble(Tcl_Interp *interp, const char *src,
double *doublePtr);
@@ -205,7 +205,7 @@ TCL_DEPRECATED("No longer in use, changed to macro")
Tcl_Obj * Tcl_NewBooleanObj(int boolValue);
/* 50 */
EXTERN Tcl_Obj * Tcl_NewByteArrayObj(const unsigned char *bytes,
int length);
int numBytes);
/* 51 */
EXTERN Tcl_Obj * Tcl_NewDoubleObj(double doubleValue);
/* 52 */
@@ -224,10 +224,10 @@ EXTERN Tcl_Obj * Tcl_NewStringObj(const char *bytes, int length);
TCL_DEPRECATED("No longer in use, changed to macro")
void Tcl_SetBooleanObj(Tcl_Obj *objPtr, int boolValue);
/* 58 */
EXTERN unsigned char * Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int length);
EXTERN unsigned char * Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int numBytes);
/* 59 */
EXTERN void Tcl_SetByteArrayObj(Tcl_Obj *objPtr,
const unsigned char *bytes, int length);
const unsigned char *bytes, int numBytes);
/* 60 */
EXTERN void Tcl_SetDoubleObj(Tcl_Obj *objPtr, double doubleValue);
/* 61 */
@@ -471,7 +471,7 @@ EXTERN int Tcl_ExprString(Tcl_Interp *interp, const char *expr);
/* 143 */
EXTERN void Tcl_Finalize(void);
/* 144 */
EXTERN void Tcl_FindExecutable(const char *argv0);
EXTERN const char * Tcl_FindExecutable(const char *argv0);
/* 145 */
EXTERN Tcl_HashEntry * Tcl_FirstHashEntry(Tcl_HashTable *tablePtr,
Tcl_HashSearch *searchPtr);
@@ -710,7 +710,7 @@ EXTERN void Tcl_SetErrorCode(Tcl_Interp *interp, ...);
/* 229 */
EXTERN void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr);
/* 230 */
EXTERN void Tcl_SetPanicProc(
EXTERN const char * Tcl_SetPanicProc(
TCL_NORETURN1 Tcl_PanicProc *panicProc);
/* 231 */
EXTERN int Tcl_SetRecursionLimit(Tcl_Interp *interp, int depth);
@@ -1886,17 +1886,17 @@ EXTERN int TclZipfs_MountBuffer(Tcl_Interp *interp,
const char *mountPoint, unsigned char *data,
size_t datalen, int copy);
/* 636 */
EXTERN void Tcl_FreeIntRep(Tcl_Obj *objPtr);
EXTERN void Tcl_FreeInternalRep(Tcl_Obj *objPtr);
/* 637 */
EXTERN char * Tcl_InitStringRep(Tcl_Obj *objPtr, const char *bytes,
unsigned int numBytes);
/* 638 */
EXTERN Tcl_ObjIntRep * Tcl_FetchIntRep(Tcl_Obj *objPtr,
EXTERN Tcl_ObjInternalRep * Tcl_FetchInternalRep(Tcl_Obj *objPtr,
const Tcl_ObjType *typePtr);
/* 639 */
EXTERN void Tcl_StoreIntRep(Tcl_Obj *objPtr,
EXTERN void Tcl_StoreInternalRep(Tcl_Obj *objPtr,
const Tcl_ObjType *typePtr,
const Tcl_ObjIntRep *irPtr);
const Tcl_ObjInternalRep *irPtr);
/* 640 */
EXTERN int Tcl_HasStringRep(Tcl_Obj *objPtr);
/* 641 */
@@ -1920,8 +1920,12 @@ EXTERN char * Tcl_UniCharToUtfDString(const int *uniStr,
/* 648 */
EXTERN int * Tcl_UtfToUniCharDString(const char *src, int length,
Tcl_DString *dsPtr);
/* Slot 649 is reserved */
/* Slot 650 is reserved */
/* 649 */
EXTERN unsigned char * TclGetBytesFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, int *numBytesPtr);
/* 650 */
EXTERN unsigned char * Tcl_GetBytesFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, size_t *numBytesPtr);
/* 651 */
EXTERN char * TclGetStringFromObj(Tcl_Obj *objPtr,
size_t *lengthPtr);
@@ -1930,13 +1934,20 @@ EXTERN Tcl_UniChar * TclGetUnicodeFromObj(Tcl_Obj *objPtr,
size_t *lengthPtr);
/* 653 */
EXTERN unsigned char * TclGetByteArrayFromObj(Tcl_Obj *objPtr,
size_t *lengthPtr);
size_t *numBytesPtr);
/* 654 */
EXTERN int Tcl_UtfCharComplete(const char *src, int length);
/* 655 */
EXTERN const char * Tcl_UtfNext(const char *src);
/* 656 */
EXTERN const char * Tcl_UtfPrev(const char *src, const char *start);
/* 657 */
EXTERN int Tcl_UniCharIsUnicode(int ch);
/* Slot 658 is reserved */
/* Slot 659 is reserved */
/* 660 */
EXTERN int Tcl_AsyncMarkFromSignal(Tcl_AsyncHandler async,
int sigNumber);
typedef struct {
const struct TclPlatStubs *tclPlatStubs;
@@ -1987,7 +1998,7 @@ typedef struct TclStubs {
void (*tcl_DbIncrRefCount) (Tcl_Obj *objPtr, const char *file, int line); /* 20 */
int (*tcl_DbIsShared) (Tcl_Obj *objPtr, const char *file, int line); /* 21 */
TCL_DEPRECATED_API("No longer in use, changed to macro") Tcl_Obj * (*tcl_DbNewBooleanObj) (int boolValue, const char *file, int line); /* 22 */
Tcl_Obj * (*tcl_DbNewByteArrayObj) (const unsigned char *bytes, int length, const char *file, int line); /* 23 */
Tcl_Obj * (*tcl_DbNewByteArrayObj) (const unsigned char *bytes, int numBytes, const char *file, int line); /* 23 */
Tcl_Obj * (*tcl_DbNewDoubleObj) (double doubleValue, const char *file, int line); /* 24 */
Tcl_Obj * (*tcl_DbNewListObj) (int objc, Tcl_Obj *const *objv, const char *file, int line); /* 25 */
TCL_DEPRECATED_API("No longer in use, changed to macro") Tcl_Obj * (*tcl_DbNewLongObj) (long longValue, const char *file, int line); /* 26 */
@@ -1997,7 +2008,7 @@ typedef struct TclStubs {
void (*tclFreeObj) (Tcl_Obj *objPtr); /* 30 */
int (*tcl_GetBoolean) (Tcl_Interp *interp, const char *src, int *boolPtr); /* 31 */
int (*tcl_GetBooleanFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *boolPtr); /* 32 */
unsigned char * (*tcl_GetByteArrayFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 33 */
unsigned char * (*tcl_GetByteArrayFromObj) (Tcl_Obj *objPtr, int *numBytesPtr); /* 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 */
TCL_DEPRECATED_API("No longer in use, changed to macro") int (*tcl_GetIndexFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, const char *const *tablePtr, const char *msg, int flags, int *indexPtr); /* 36 */
@@ -2014,7 +2025,7 @@ typedef struct TclStubs {
int (*tcl_ListObjLength) (Tcl_Interp *interp, Tcl_Obj *listPtr, int *lengthPtr); /* 47 */
int (*tcl_ListObjReplace) (Tcl_Interp *interp, Tcl_Obj *listPtr, int first, int count, int objc, Tcl_Obj *const objv[]); /* 48 */
TCL_DEPRECATED_API("No longer in use, changed to macro") Tcl_Obj * (*tcl_NewBooleanObj) (int boolValue); /* 49 */
Tcl_Obj * (*tcl_NewByteArrayObj) (const unsigned char *bytes, int length); /* 50 */
Tcl_Obj * (*tcl_NewByteArrayObj) (const unsigned char *bytes, int numBytes); /* 50 */
Tcl_Obj * (*tcl_NewDoubleObj) (double doubleValue); /* 51 */
TCL_DEPRECATED_API("No longer in use, changed to macro") Tcl_Obj * (*tcl_NewIntObj) (int intValue); /* 52 */
Tcl_Obj * (*tcl_NewListObj) (int objc, Tcl_Obj *const objv[]); /* 53 */
@@ -2022,8 +2033,8 @@ typedef struct TclStubs {
Tcl_Obj * (*tcl_NewObj) (void); /* 55 */
Tcl_Obj * (*tcl_NewStringObj) (const char *bytes, int length); /* 56 */
TCL_DEPRECATED_API("No longer in use, changed to macro") void (*tcl_SetBooleanObj) (Tcl_Obj *objPtr, int boolValue); /* 57 */
unsigned char * (*tcl_SetByteArrayLength) (Tcl_Obj *objPtr, int length); /* 58 */
void (*tcl_SetByteArrayObj) (Tcl_Obj *objPtr, const unsigned char *bytes, int length); /* 59 */
unsigned char * (*tcl_SetByteArrayLength) (Tcl_Obj *objPtr, int numBytes); /* 58 */
void (*tcl_SetByteArrayObj) (Tcl_Obj *objPtr, const unsigned char *bytes, int numBytes); /* 59 */
void (*tcl_SetDoubleObj) (Tcl_Obj *objPtr, double doubleValue); /* 60 */
TCL_DEPRECATED_API("No longer in use, changed to macro") void (*tcl_SetIntObj) (Tcl_Obj *objPtr, int intValue); /* 61 */
void (*tcl_SetListObj) (Tcl_Obj *objPtr, int objc, Tcl_Obj *const objv[]); /* 62 */
@@ -2108,7 +2119,7 @@ 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 */
TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tcl_FindExecutable) (const char *argv0); /* 144 */
TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") const char * (*tcl_FindExecutable) (const char *argv0); /* 144 */
Tcl_HashEntry * (*tcl_FirstHashEntry) (Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 145 */
int (*tcl_Flush) (Tcl_Channel chan); /* 146 */
TCL_DEPRECATED_API("see TIP #559. Use Tcl_ResetResult") void (*tcl_FreeResult) (Tcl_Interp *interp); /* 147 */
@@ -2202,7 +2213,7 @@ typedef struct TclStubs {
void (*tcl_SetErrno) (int err); /* 227 */
void (*tcl_SetErrorCode) (Tcl_Interp *interp, ...); /* 228 */
void (*tcl_SetMaxBlockTime) (const Tcl_Time *timePtr); /* 229 */
TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tcl_SetPanicProc) (TCL_NORETURN1 Tcl_PanicProc *panicProc); /* 230 */
TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") const char * (*tcl_SetPanicProc) (TCL_NORETURN1 Tcl_PanicProc *panicProc); /* 230 */
int (*tcl_SetRecursionLimit) (Tcl_Interp *interp, int depth); /* 231 */
void (*tcl_SetResult) (Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc); /* 232 */
int (*tcl_SetServiceMode) (int mode); /* 233 */
@@ -2608,10 +2619,10 @@ typedef struct TclStubs {
int (*tclZipfs_Unmount) (Tcl_Interp *interp, const char *mountPoint); /* 633 */
Tcl_Obj * (*tclZipfs_TclLibrary) (void); /* 634 */
int (*tclZipfs_MountBuffer) (Tcl_Interp *interp, const char *mountPoint, unsigned char *data, size_t datalen, int copy); /* 635 */
void (*tcl_FreeIntRep) (Tcl_Obj *objPtr); /* 636 */
void (*tcl_FreeInternalRep) (Tcl_Obj *objPtr); /* 636 */
char * (*tcl_InitStringRep) (Tcl_Obj *objPtr, const char *bytes, unsigned int numBytes); /* 637 */
Tcl_ObjIntRep * (*tcl_FetchIntRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr); /* 638 */
void (*tcl_StoreIntRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr, const Tcl_ObjIntRep *irPtr); /* 639 */
Tcl_ObjInternalRep * (*tcl_FetchInternalRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr); /* 638 */
void (*tcl_StoreInternalRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr, const Tcl_ObjInternalRep *irPtr); /* 639 */
int (*tcl_HasStringRep) (Tcl_Obj *objPtr); /* 640 */
void (*tcl_IncrRefCount) (Tcl_Obj *objPtr); /* 641 */
void (*tcl_DecrRefCount) (Tcl_Obj *objPtr); /* 642 */
@@ -2621,14 +2632,18 @@ typedef struct TclStubs {
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 (*reserved649)(void);
void (*reserved650)(void);
unsigned char * (*tclGetBytesFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *numBytesPtr); /* 649 */
unsigned char * (*tcl_GetBytesFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, size_t *numBytesPtr); /* 650 */
char * (*tclGetStringFromObj) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 651 */
Tcl_UniChar * (*tclGetUnicodeFromObj) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 652 */
unsigned char * (*tclGetByteArrayFromObj) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 653 */
unsigned char * (*tclGetByteArrayFromObj) (Tcl_Obj *objPtr, size_t *numBytesPtr); /* 653 */
int (*tcl_UtfCharComplete) (const char *src, int length); /* 654 */
const char * (*tcl_UtfNext) (const char *src); /* 655 */
const char * (*tcl_UtfPrev) (const char *src, const char *start); /* 656 */
int (*tcl_UniCharIsUnicode) (int ch); /* 657 */
void (*reserved658)(void);
void (*reserved659)(void);
int (*tcl_AsyncMarkFromSignal) (Tcl_AsyncHandler async, int sigNumber); /* 660 */
} TclStubs;
extern const TclStubs *tclStubsPtr;
@@ -3931,14 +3946,14 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tclZipfs_TclLibrary) /* 634 */
#define TclZipfs_MountBuffer \
(tclStubsPtr->tclZipfs_MountBuffer) /* 635 */
#define Tcl_FreeIntRep \
(tclStubsPtr->tcl_FreeIntRep) /* 636 */
#define Tcl_FreeInternalRep \
(tclStubsPtr->tcl_FreeInternalRep) /* 636 */
#define Tcl_InitStringRep \
(tclStubsPtr->tcl_InitStringRep) /* 637 */
#define Tcl_FetchIntRep \
(tclStubsPtr->tcl_FetchIntRep) /* 638 */
#define Tcl_StoreIntRep \
(tclStubsPtr->tcl_StoreIntRep) /* 639 */
#define Tcl_FetchInternalRep \
(tclStubsPtr->tcl_FetchInternalRep) /* 638 */
#define Tcl_StoreInternalRep \
(tclStubsPtr->tcl_StoreInternalRep) /* 639 */
#define Tcl_HasStringRep \
(tclStubsPtr->tcl_HasStringRep) /* 640 */
#define Tcl_IncrRefCount \
@@ -3957,8 +3972,10 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tcl_UniCharToUtfDString) /* 647 */
#define Tcl_UtfToUniCharDString \
(tclStubsPtr->tcl_UtfToUniCharDString) /* 648 */
/* Slot 649 is reserved */
/* Slot 650 is reserved */
#define TclGetBytesFromObj \
(tclStubsPtr->tclGetBytesFromObj) /* 649 */
#define Tcl_GetBytesFromObj \
(tclStubsPtr->tcl_GetBytesFromObj) /* 650 */
#define TclGetStringFromObj \
(tclStubsPtr->tclGetStringFromObj) /* 651 */
#define TclGetUnicodeFromObj \
@@ -3971,6 +3988,12 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tcl_UtfNext) /* 655 */
#define Tcl_UtfPrev \
(tclStubsPtr->tcl_UtfPrev) /* 656 */
#define Tcl_UniCharIsUnicode \
(tclStubsPtr->tcl_UniCharIsUnicode) /* 657 */
/* Slot 658 is reserved */
/* Slot 659 is reserved */
#define Tcl_AsyncMarkFromSignal \
(tclStubsPtr->tcl_AsyncMarkFromSignal) /* 660 */
#endif /* defined(USE_TCL_STUBS) */
@@ -3994,10 +4017,18 @@ extern const TclStubs *tclStubsPtr;
#endif
#if defined(_WIN32) && defined(UNICODE)
# define Tcl_FindExecutable(arg) ((Tcl_FindExecutable)((const char *)(arg)))
# if defined(TCL_NO_DEPRECATED)
# define Tcl_FindExecutable(arg) ((Tcl_FindExecutable)((const char *)(arg)))
# else
# define Tcl_FindExecutable(arg) ((void)((Tcl_FindExecutable)((const char *)(arg))))
# define Tcl_SetPanicProc(arg) ((void)((Tcl_SetPanicProc)(arg)))
# endif
# define Tcl_MainEx Tcl_MainExW
EXTERN void Tcl_MainExW(int argc, wchar_t **argv,
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
#elif !defined(TCL_NO_DEPRECATED)
# define Tcl_FindExecutable(arg) ((void)((Tcl_FindExecutable)(arg)))
# define Tcl_SetPanicProc(arg) ((void)((Tcl_SetPanicProc)(arg)))
#endif
#undef TCL_STORAGE_CLASS
@@ -4112,7 +4143,24 @@ extern const TclStubs *tclStubsPtr;
} while(0)
#endif /* TCL_NO_DEPRECATED */
#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
#if defined(USE_TCL_STUBS)
# if defined(_WIN32) && defined(_WIN64)
# undef Tcl_GetTime
/* Handle Win64 tk.dll being loaded in Cygwin64. */
# define Tcl_GetTime(t) \
do { \
union { \
Tcl_Time now; \
long long reserved; \
} _t; \
_t.reserved = -1; \
tclStubsPtr->tcl_GetTime((&_t.now)); \
if (_t.reserved != -1) { \
_t.now.usec = _t.reserved; \
} \
*(t) = _t.now; \
} while (0)
# endif
# if defined(__CYGWIN__) && defined(TCL_WIDE_INT_IS_LONG)
/* On Cygwin64, long is 64-bit while on Win64 long is 32-bit. Therefore
* we have to make sure that all stub entries on Cygwin64 follow the
@@ -4160,12 +4208,15 @@ extern const TclStubs *tclStubsPtr;
Tcl_GetStringFromObj(objPtr, (int *)NULL)
#define Tcl_GetUnicode(objPtr) \
Tcl_GetUnicodeFromObj(objPtr, (int *)NULL)
#undef Tcl_GetBytesFromObj
#ifdef TCL_NO_DEPRECATED
#undef Tcl_GetStringFromObj
#undef Tcl_GetUnicodeFromObj
#undef Tcl_GetByteArrayFromObj
#endif
#if defined(USE_TCL_STUBS)
#define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \
(sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tclGetBytesFromObj(interp, objPtr, (int *)sizePtr) : tclStubsPtr->tcl_GetBytesFromObj(interp, objPtr, (size_t *)sizePtr))
#ifdef TCL_NO_DEPRECATED
#define Tcl_GetStringFromObj(objPtr, sizePtr) \
(sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tcl_GetStringFromObj(objPtr, (int *)sizePtr) : tclStubsPtr->tclGetStringFromObj(objPtr, (size_t *)sizePtr))
@@ -4175,6 +4226,8 @@ extern const TclStubs *tclStubsPtr;
(sizeof(*sizePtr) <= sizeof(int) ? tclStubsPtr->tcl_GetUnicodeFromObj(objPtr, (int *)sizePtr) : tclStubsPtr->tclGetUnicodeFromObj(objPtr, (size_t *)sizePtr))
#endif
#else
#define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \
(sizeof(*sizePtr) <= sizeof(int) ? (TclGetBytesFromObj)(interp, objPtr, (int *)sizePtr) : (Tcl_GetBytesFromObj)(interp, objPtr, (size_t *)sizePtr))
#ifdef TCL_NO_DEPRECATED
#define Tcl_GetStringFromObj(objPtr, sizePtr) \
(sizeof(*sizePtr) <= sizeof(int) ? (Tcl_GetStringFromObj)(objPtr, (int *)sizePtr) : (TclGetStringFromObj)(objPtr, (size_t *)sizePtr))
@@ -4216,8 +4269,8 @@ extern const TclStubs *tclStubsPtr;
? (wchar_t *(*)(const char *, int, Tcl_DString *))tclStubsPtr->tcl_UtfToUniCharDString \
: (wchar_t *(*)(const char *, int, Tcl_DString *))Tcl_UtfToChar16DString)
# define Tcl_UtfToWChar (sizeof(wchar_t) != sizeof(short) \
? (int (*)(const char *, wchar_t *))tclStubsPtr->tcl_UtfToChar16 \
: (int (*)(const char *, wchar_t *))Tcl_UtfToUniChar)
? (int (*)(const char *, wchar_t *))tclStubsPtr->tcl_UtfToUniChar \
: (int (*)(const char *, wchar_t *))Tcl_UtfToChar16)
#else
# define Tcl_WCharToUtfDString (sizeof(wchar_t) != sizeof(short) \
? (char *(*)(const wchar_t *, int, Tcl_DString *))Tcl_UniCharToUtfDString \
@@ -4226,8 +4279,8 @@ extern const TclStubs *tclStubsPtr;
? (wchar_t *(*)(const char *, int, Tcl_DString *))Tcl_UtfToUniCharDString \
: (wchar_t *(*)(const char *, int, Tcl_DString *))Tcl_UtfToChar16DString)
# define Tcl_UtfToWChar (sizeof(wchar_t) != sizeof(short) \
? (int (*)(const char *, wchar_t *))Tcl_UtfToChar16 \
: (int (*)(const char *, wchar_t *))Tcl_UtfToUniChar)
? (int (*)(const char *, wchar_t *))Tcl_UtfToUniChar \
: (int (*)(const char *, wchar_t *))Tcl_UtfToChar16)
#endif
/*
+32 -31
View File
@@ -149,18 +149,18 @@ const Tcl_ObjType tclDictType = {
SetDictFromAny /* setFromAnyProc */
};
#define DictSetIntRep(objPtr, dictRepPtr) \
#define DictSetInternalRep(objPtr, dictRepPtr) \
do { \
Tcl_ObjIntRep ir; \
Tcl_ObjInternalRep ir; \
ir.twoPtrValue.ptr1 = (dictRepPtr); \
ir.twoPtrValue.ptr2 = NULL; \
Tcl_StoreIntRep((objPtr), &tclDictType, &ir); \
Tcl_StoreInternalRep((objPtr), &tclDictType, &ir); \
} while (0)
#define DictGetIntRep(objPtr, dictRepPtr) \
#define DictGetInternalRep(objPtr, dictRepPtr) \
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &tclDictType); \
const Tcl_ObjInternalRep *irPtr; \
irPtr = TclFetchInternalRep((objPtr), &tclDictType); \
(dictRepPtr) = irPtr ? (Dict *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -362,7 +362,7 @@ DupDictInternalRep(
Dict *oldDict, *newDict = (Dict *)ckalloc(sizeof(Dict));
ChainEntry *cPtr;
DictGetIntRep(srcPtr, oldDict);
DictGetInternalRep(srcPtr, oldDict);
/*
* Copy values across from the old hash table.
@@ -395,7 +395,7 @@ DupDictInternalRep(
* Store in the object.
*/
DictSetIntRep(copyPtr, newDict);
DictSetInternalRep(copyPtr, newDict);
}
/*
@@ -422,7 +422,7 @@ FreeDictInternalRep(
{
Dict *dict;
DictGetIntRep(dictPtr, dict);
DictGetInternalRep(dictPtr, dict);
if (dict->refCount-- <= 1) {
DeleteDict(dict);
@@ -499,7 +499,7 @@ UpdateStringOfDict(
int numElems;
DictGetIntRep(dictPtr, dict);
DictGetInternalRep(dictPtr, dict);
assert (dict != NULL);
@@ -566,6 +566,7 @@ UpdateStringOfDict(
dst += TclConvertElement(elem, length, dst, flagPtr[i+1]);
*dst++ = ' ';
}
/* Last space overwrote the terminating NUL; cal T_ISR again to restore */
(void)Tcl_InitStringRep(dictPtr, NULL, bytesNeeded - 1);
if (flagPtr != localFlags) {
@@ -610,7 +611,7 @@ SetDictFromAny(
* the conversion from lists to dictionaries.
*/
if (TclHasIntRep(objPtr, &tclListType)) {
if (TclHasInternalRep(objPtr, &tclListType)) {
int objc, i;
Tcl_Obj **objv;
@@ -717,7 +718,7 @@ SetDictFromAny(
dict->epoch = 1;
dict->chain = NULL;
dict->refCount = 1;
DictSetIntRep(objPtr, dict);
DictSetInternalRep(objPtr, dict);
return TCL_OK;
missingValue:
@@ -739,12 +740,12 @@ GetDictFromObj(
{
Dict *dict;
DictGetIntRep(dictPtr, dict);
DictGetInternalRep(dictPtr, dict);
if (dict == NULL) {
if (SetDictFromAny(interp, dictPtr) != TCL_OK) {
return NULL;
}
DictGetIntRep(dictPtr, dict);
DictGetInternalRep(dictPtr, dict);
}
return dict;
}
@@ -792,12 +793,12 @@ TclTraceDictPath(
Dict *dict, *newDict;
int i;
DictGetIntRep(dictPtr, dict);
DictGetInternalRep(dictPtr, dict);
if (dict == NULL) {
if (SetDictFromAny(interp, dictPtr) != TCL_OK) {
return NULL;
}
DictGetIntRep(dictPtr, dict);
DictGetInternalRep(dictPtr, dict);
}
if (flags & DICT_PATH_UPDATE) {
dict->chain = NULL;
@@ -835,7 +836,7 @@ TclTraceDictPath(
} else {
tmpObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
DictGetIntRep(tmpObj, newDict);
DictGetInternalRep(tmpObj, newDict);
if (newDict == NULL) {
if (SetDictFromAny(interp, tmpObj) != TCL_OK) {
@@ -844,7 +845,7 @@ TclTraceDictPath(
}
}
DictGetIntRep(tmpObj, newDict);
DictGetInternalRep(tmpObj, newDict);
if (flags & DICT_PATH_UPDATE) {
if (Tcl_IsShared(tmpObj)) {
TclDecrRefCount(tmpObj);
@@ -852,7 +853,7 @@ TclTraceDictPath(
Tcl_IncrRefCount(tmpObj);
Tcl_SetHashValue(hPtr, tmpObj);
dict->epoch++;
DictGetIntRep(tmpObj, newDict);
DictGetInternalRep(tmpObj, newDict);
}
newDict->chain = dictPtr;
@@ -889,14 +890,14 @@ InvalidateDictChain(
{
Dict *dict;
DictGetIntRep(dictObj, dict);
DictGetInternalRep(dictObj, dict);
assert( dict != NULL);
do {
dict->refCount++;
TclInvalidateStringRep(dictObj);
TclFreeIntRep(dictObj);
DictSetIntRep(dictObj, dict);
TclFreeInternalRep(dictObj);
DictSetInternalRep(dictObj, dict);
dict->epoch++;
dictObj = dict->chain;
@@ -904,7 +905,7 @@ InvalidateDictChain(
break;
}
dict->chain = NULL;
DictGetIntRep(dictObj, dict);
DictGetInternalRep(dictObj, dict);
} while (dict != NULL);
}
@@ -950,8 +951,8 @@ Tcl_DictObjPut(
TclInvalidateStringRep(dictPtr);
hPtr = CreateChainEntry(dict, keyPtr, &isNew);
dict->refCount++;
TclFreeIntRep(dictPtr)
DictSetIntRep(dictPtr, dict);
TclFreeInternalRep(dictPtr)
DictSetInternalRep(dictPtr, dict);
Tcl_IncrRefCount(valuePtr);
if (!isNew) {
Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
@@ -1306,7 +1307,7 @@ Tcl_DictObjPutKeyList(
return TCL_ERROR;
}
DictGetIntRep(dictPtr, dict);
DictGetInternalRep(dictPtr, dict);
assert(dict != NULL);
hPtr = CreateChainEntry(dict, keyv[keyc-1], &isNew);
Tcl_IncrRefCount(valuePtr);
@@ -1364,7 +1365,7 @@ Tcl_DictObjRemoveKeyList(
return TCL_ERROR;
}
DictGetIntRep(dictPtr, dict);
DictGetInternalRep(dictPtr, dict);
assert(dict != NULL);
DeleteChainEntry(dict, keyv[keyc-1]);
InvalidateDictChain(dictPtr);
@@ -1411,7 +1412,7 @@ Tcl_NewDictObj(void)
dict->epoch = 1;
dict->chain = NULL;
dict->refCount = 1;
DictSetIntRep(dictPtr, dict);
DictSetInternalRep(dictPtr, dict);
return dictPtr;
#endif
}
@@ -1459,7 +1460,7 @@ Tcl_DbNewDictObj(
dict->epoch = 1;
dict->chain = NULL;
dict->refCount = 1;
DictSetIntRep(dictPtr, dict);
DictSetInternalRep(dictPtr, dict);
return dictPtr;
}
#else /* !TCL_MEM_DEBUG */
@@ -3373,7 +3374,7 @@ FinalizeDictUpdate(
* an instruction to remove the key.
*/
Tcl_ListObjGetElements(NULL, argsObj, &objc, &objv);
TclListObjGetElements(NULL, argsObj, &objc, &objv);
for (i=0 ; i<objc ; i+=2) {
objPtr = Tcl_ObjGetVar2(interp, objv[i+1], NULL, 0);
if (objPtr == NULL) {
@@ -3497,7 +3498,7 @@ FinalizeDictWith(
state = Tcl_SaveInterpState(interp, result);
if (pathPtr != NULL) {
Tcl_ListObjGetElements(NULL, pathPtr, &pathc, &pathv);
TclListObjGetElements(NULL, pathPtr, &pathc, &pathv);
} else {
pathc = 0;
pathv = NULL;
+17 -17
View File
@@ -44,17 +44,17 @@ static const Tcl_ObjType instNameType = {
NULL, /* setFromAnyProc */
};
#define InstNameSetIntRep(objPtr, inst) \
#define InstNameSetInternalRep(objPtr, inst) \
do { \
Tcl_ObjIntRep ir; \
Tcl_ObjInternalRep ir; \
ir.wideValue = (inst); \
Tcl_StoreIntRep((objPtr), &instNameType, &ir); \
Tcl_StoreInternalRep((objPtr), &instNameType, &ir); \
} while (0)
#define InstNameGetIntRep(objPtr, inst) \
#define InstNameGetInternalRep(objPtr, inst) \
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &instNameType); \
const Tcl_ObjInternalRep *irPtr; \
irPtr = TclFetchInternalRep((objPtr), &instNameType); \
assert(irPtr != NULL); \
(inst) = (size_t)irPtr->wideValue; \
} while (0)
@@ -259,7 +259,7 @@ DisassembleByteCodeObj(
Interp *iPtr;
Tcl_Obj *bufferObj, *fileObj;
ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr);
ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr);
iPtr = (Interp *) *codePtr->interpHandle;
@@ -761,10 +761,10 @@ TclGetInnerContext(
int len;
/*
* Reset while keeping the list intrep as much as possible.
* Reset while keeping the list internalrep as much as possible.
*/
Tcl_ListObjLength(interp, result, &len);
TclListObjLength(interp, result, &len);
Tcl_ListObjReplace(interp, result, 0, len, 0, NULL);
}
Tcl_ListObjAppendElement(NULL, result, TclNewInstNameObj(*pc));
@@ -808,7 +808,7 @@ TclNewInstNameObj(
TclNewObj(objPtr);
TclInvalidateStringRep(objPtr);
InstNameSetIntRep(objPtr, (long) inst);
InstNameSetInternalRep(objPtr, (long) inst);
return objPtr;
}
@@ -830,7 +830,7 @@ UpdateStringOfInstName(
size_t inst; /* NOTE: We know this is really an unsigned char */
char *dst;
InstNameGetIntRep(objPtr, inst);
InstNameGetInternalRep(objPtr, inst);
if (inst > LAST_INST_OPCODE) {
dst = Tcl_InitStringRep(objPtr, NULL, TCL_INTEGER_SPACE + 5);
@@ -945,7 +945,7 @@ DisassembleByteCodeAsDicts(
int codeOffset, codeLength, sourceOffset, sourceLength;
int i, val, line;
ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr);
ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr);
/*
* Get the literals from the bytecode.
@@ -1368,7 +1368,7 @@ Tcl_DisassembleObjCmd(
return TCL_ERROR;
}
if (!TclHasIntRep(objv[2], &tclByteCodeType) && (TCL_OK
if (!TclHasInternalRep(objv[2], &tclByteCodeType) && (TCL_OK
!= TclSetByteCodeFromAny(interp, objv[2], NULL, NULL))) {
return TCL_ERROR;
}
@@ -1419,7 +1419,7 @@ Tcl_DisassembleObjCmd(
* Compile if necessary.
*/
if (!TclHasIntRep(procPtr->bodyPtr, &tclByteCodeType)) {
if (!TclHasInternalRep(procPtr->bodyPtr, &tclByteCodeType)) {
Command cmd;
/*
@@ -1484,7 +1484,7 @@ Tcl_DisassembleObjCmd(
* Compile if necessary.
*/
if (!TclHasIntRep(procPtr->bodyPtr, &tclByteCodeType)) {
if (!TclHasInternalRep(procPtr->bodyPtr, &tclByteCodeType)) {
Command cmd;
/*
@@ -1569,7 +1569,7 @@ Tcl_DisassembleObjCmd(
"METHODTYPE", NULL);
return TCL_ERROR;
}
if (!TclHasIntRep(procPtr->bodyPtr, &tclByteCodeType)) {
if (!TclHasInternalRep(procPtr->bodyPtr, &tclByteCodeType)) {
Command cmd;
/*
@@ -1597,7 +1597,7 @@ Tcl_DisassembleObjCmd(
* Do the actual disassembly.
*/
ByteCodeGetIntRep(codeObjPtr, &tclByteCodeType, codePtr);
ByteCodeGetInternalRep(codeObjPtr, &tclByteCodeType, codePtr);
if (codePtr->flags & TCL_BYTECODE_PRECOMPILED) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
+327 -68
View File
@@ -37,7 +37,7 @@ typedef struct {
* end-of-string in this encoding. This number
* is used to determine the source string
* length when the srcLen argument is
* negative. This number can be 1 or 2. */
* negative. This number can be 1, 2, or 4. */
ClientData clientData; /* Arbitrary value associated with encoding
* type. Passed to conversion functions. */
LengthProc *lengthProc; /* Function to compute length of
@@ -45,7 +45,9 @@ typedef struct {
* If nullSize is 1, this is strlen; if
* nullSize is 2, this is a function that
* returns the number of bytes in a 0x0000
* terminated string. */
* terminated string; if nullSize is 4, this
* is a function that returns the number of
* bytes in a 0x00000000 terminated string. */
size_t refCount; /* Number of uses of this structure. */
Tcl_HashEntry *hPtr; /* Hash table entry that owns this encoding. */
} Encoding;
@@ -196,13 +198,13 @@ static unsigned short emptyPage[256];
*/
static Tcl_EncodingConvertProc BinaryProc;
static Tcl_DupInternalRepProc DupEncodingIntRep;
static Tcl_DupInternalRepProc DupEncodingInternalRep;
static Tcl_EncodingFreeProc EscapeFreeProc;
static Tcl_EncodingConvertProc EscapeFromUtfProc;
static Tcl_EncodingConvertProc EscapeToUtfProc;
static void FillEncodingFileMap(void);
static void FreeEncoding(Tcl_Encoding encoding);
static Tcl_FreeInternalRepProc FreeEncodingIntRep;
static Tcl_FreeInternalRepProc FreeEncodingInternalRep;
static Encoding * GetTableEncoding(EscapeEncodingData *dataPtr,
int state);
static Tcl_Encoding LoadEncodingFile(Tcl_Interp *interp,
@@ -216,7 +218,10 @@ static Tcl_Channel OpenEncodingFileChannel(Tcl_Interp *interp,
static Tcl_EncodingFreeProc TableFreeProc;
static Tcl_EncodingConvertProc TableFromUtfProc;
static Tcl_EncodingConvertProc TableToUtfProc;
static size_t unilen(const char *src);
static size_t unilen(const char *src);
static size_t unilen4(const char *src);
static Tcl_EncodingConvertProc Utf32ToUtfProc;
static Tcl_EncodingConvertProc UtfToUtf32Proc;
static Tcl_EncodingConvertProc Utf16ToUtfProc;
static Tcl_EncodingConvertProc UtfToUtf16Proc;
static Tcl_EncodingConvertProc UtfToUcs2Proc;
@@ -226,25 +231,25 @@ static Tcl_EncodingConvertProc Iso88591ToUtfProc;
/*
* A Tcl_ObjType for holding a cached Tcl_Encoding in the twoPtrValue.ptr1 field
* of the intrep. This should help the lifetime of encodings be more useful.
* of the internalrep. This should help the lifetime of encodings be more useful.
* See concerns raised in [Bug 1077262].
*/
static const Tcl_ObjType encodingType = {
"encoding", FreeEncodingIntRep, DupEncodingIntRep, NULL, NULL
"encoding", FreeEncodingInternalRep, DupEncodingInternalRep, NULL, NULL
};
#define EncodingSetIntRep(objPtr, encoding) \
#define EncodingSetInternalRep(objPtr, encoding) \
do { \
Tcl_ObjIntRep ir; \
Tcl_ObjInternalRep ir; \
ir.twoPtrValue.ptr1 = (encoding); \
ir.twoPtrValue.ptr2 = NULL; \
Tcl_StoreIntRep((objPtr), &encodingType, &ir); \
Tcl_StoreInternalRep((objPtr), &encodingType, &ir); \
} while (0)
#define EncodingGetIntRep(objPtr, encoding) \
#define EncodingGetInternalRep(objPtr, encoding) \
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep ((objPtr), &encodingType); \
const Tcl_ObjInternalRep *irPtr; \
irPtr = TclFetchInternalRep ((objPtr), &encodingType); \
(encoding) = irPtr ? (Tcl_Encoding)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -277,13 +282,13 @@ Tcl_GetEncodingFromObj(
Tcl_Encoding encoding;
const char *name = TclGetString(objPtr);
EncodingGetIntRep(objPtr, encoding);
EncodingGetInternalRep(objPtr, encoding);
if (encoding == NULL) {
encoding = Tcl_GetEncoding(interp, name);
if (encoding == NULL) {
return TCL_ERROR;
}
EncodingSetIntRep(objPtr, encoding);
EncodingSetInternalRep(objPtr, encoding);
}
*encodingPtr = Tcl_GetEncoding(NULL, name);
return TCL_OK;
@@ -292,7 +297,7 @@ Tcl_GetEncodingFromObj(
/*
*----------------------------------------------------------------------
*
* FreeEncodingIntRep --
* FreeEncodingInternalRep --
*
* The Tcl_FreeInternalRepProc for the "encoding" Tcl_ObjType.
*
@@ -300,19 +305,19 @@ Tcl_GetEncodingFromObj(
*/
static void
FreeEncodingIntRep(
FreeEncodingInternalRep(
Tcl_Obj *objPtr)
{
Tcl_Encoding encoding;
EncodingGetIntRep(objPtr, encoding);
EncodingGetInternalRep(objPtr, encoding);
Tcl_FreeEncoding(encoding);
}
/*
*----------------------------------------------------------------------
*
* DupEncodingIntRep --
* DupEncodingInternalRep --
*
* The Tcl_DupInternalRepProc for the "encoding" Tcl_ObjType.
*
@@ -320,12 +325,12 @@ FreeEncodingIntRep(
*/
static void
DupEncodingIntRep(
DupEncodingInternalRep(
Tcl_Obj *srcPtr,
Tcl_Obj *dupPtr)
{
Tcl_Encoding encoding = Tcl_GetEncoding(NULL, TclGetString(srcPtr));
EncodingSetIntRep(dupPtr, encoding);
EncodingSetInternalRep(dupPtr, encoding);
}
/*
@@ -365,7 +370,7 @@ Tcl_SetEncodingSearchPath(
{
int dummy;
if (TCL_ERROR == Tcl_ListObjLength(NULL, searchPath, &dummy)) {
if (TCL_ERROR == TclListObjLength(NULL, searchPath, &dummy)) {
return TCL_ERROR;
}
TclSetProcessGlobalValue(&encodingSearchPath, searchPath, NULL);
@@ -412,7 +417,7 @@ TclSetLibraryPath(
{
int dummy;
if (TCL_ERROR == Tcl_ListObjLength(NULL, path, &dummy)) {
if (TCL_ERROR == TclListObjLength(NULL, path, &dummy)) {
return;
}
TclSetProcessGlobalValue(&libraryPath, path, NULL);
@@ -451,7 +456,7 @@ FillEncodingFileMap(void)
searchPath = Tcl_GetEncodingSearchPath();
Tcl_IncrRefCount(searchPath);
Tcl_ListObjLength(NULL, searchPath, &numDirs);
TclListObjLength(NULL, searchPath, &numDirs);
map = Tcl_NewDictObj();
Tcl_IncrRefCount(map);
@@ -475,7 +480,7 @@ FillEncodingFileMap(void)
Tcl_FSMatchInDirectory(NULL, matchFileList, directory, "*.enc",
&readableFiles);
Tcl_ListObjGetElements(NULL, matchFileList, &numFiles, &filev);
TclListObjGetElements(NULL, matchFileList, &numFiles, &filev);
for (j=0; j<numFiles; j++) {
Tcl_Obj *encodingName, *fileObj;
@@ -510,11 +515,12 @@ FillEncodingFileMap(void)
*---------------------------------------------------------------------------
*/
/* This flags must not conflict with other TCL_ENCODING_* flags in tcl.h */
/* Those flags must not conflict with other TCL_ENCODING_* flags in tcl.h */
/* Since TCL_ENCODING_MODIFIED is only used for utf-8/cesu-8 and
* TCL_ENCODING_LE is only used for utf-16/utf-32/ucs-2. re-use the same value */
#define TCL_ENCODING_MODIFIED 0x20 /* Converting NULL bytes to 0xC0 0x80 */
/* Since TCL_ENCODING_MODIFIED is only used for utf-8 and
* TCL_ENCODING_LE is only used for utf-16/ucs-2, re-use the same value */
#define TCL_ENCODING_LE TCL_ENCODING_MODIFIED /* Little-endian encoding */
#define TCL_ENCODING_UTF 0x200 /* For UTF-8 encoding, allow 4-byte output sequences */
void
TclInitEncodingSubsystem(void)
@@ -556,7 +562,10 @@ TclInitEncodingSubsystem(void)
type.fromUtfProc = UtfToUtfProc;
type.freeProc = NULL;
type.nullSize = 1;
type.clientData = NULL;
type.clientData = INT2PTR(TCL_ENCODING_UTF);
Tcl_CreateEncoding(&type);
type.clientData = INT2PTR(0);
type.encodingName = "cesu-8";
Tcl_CreateEncoding(&type);
type.toUtfProc = Utf16ToUtfProc;
@@ -573,6 +582,20 @@ TclInitEncodingSubsystem(void)
type.clientData = INT2PTR(isLe.c);
Tcl_CreateEncoding(&type);
type.toUtfProc = Utf32ToUtfProc;
type.fromUtfProc = UtfToUtf32Proc;
type.freeProc = NULL;
type.nullSize = 4;
type.encodingName = "utf-32le";
type.clientData = INT2PTR(TCL_ENCODING_LE);
Tcl_CreateEncoding(&type);
type.encodingName = "utf-32be";
type.clientData = INT2PTR(0);
Tcl_CreateEncoding(&type);
type.encodingName = "utf-32";
type.clientData = INT2PTR(isLe.c);
Tcl_CreateEncoding(&type);
type.toUtfProc = Utf16ToUtfProc;
type.fromUtfProc = UtfToUtf16Proc;
type.freeProc = NULL;
@@ -705,7 +728,7 @@ Tcl_GetDefaultEncodingDir(void)
int numDirs;
Tcl_Obj *first, *searchPath = Tcl_GetEncodingSearchPath();
Tcl_ListObjLength(NULL, searchPath, &numDirs);
TclListObjLength(NULL, searchPath, &numDirs);
if (numDirs == 0) {
return NULL;
}
@@ -1053,10 +1076,12 @@ Tcl_CreateEncoding(
encodingPtr->freeProc = typePtr->freeProc;
encodingPtr->nullSize = typePtr->nullSize;
encodingPtr->clientData = typePtr->clientData;
if (typePtr->nullSize == 1) {
encodingPtr->lengthProc = (LengthProc *) strlen;
} else {
if (typePtr->nullSize == 2) {
encodingPtr->lengthProc = (LengthProc *) unilen;
} else if (typePtr->nullSize == 4) {
encodingPtr->lengthProc = (LengthProc *) unilen4;
} else {
encodingPtr->lengthProc = (LengthProc *) strlen;
}
encodingPtr->refCount = 1;
encodingPtr->hPtr = NULL;
@@ -1141,7 +1166,7 @@ Tcl_ExternalToUtfDString(
flags = TCL_ENCODING_START | TCL_ENCODING_END;
if (encodingPtr->toUtfProc == UtfToUtfProc) {
flags |= TCL_ENCODING_MODIFIED;
flags |= TCL_ENCODING_MODIFIED | TCL_ENCODING_UTF;
}
while (1) {
@@ -1258,7 +1283,7 @@ Tcl_ExternalToUtf(
dstLen--;
}
if (encodingPtr->toUtfProc == UtfToUtfProc) {
flags |= TCL_ENCODING_MODIFIED;
flags |= TCL_ENCODING_MODIFIED | TCL_ENCODING_UTF;
}
do {
Tcl_EncodingState savedState = *statePtr;
@@ -1337,16 +1362,16 @@ Tcl_UtfToExternalDString(
&srcRead, &dstWrote, &dstChars);
soFar = dst + dstWrote - Tcl_DStringValue(dstPtr);
src += srcRead;
if (result != TCL_CONVERT_NOSPACE) {
if (encodingPtr->nullSize == 2) {
Tcl_DStringSetLength(dstPtr, soFar + 1);
int i = soFar + encodingPtr->nullSize - 1;
while (i >= soFar) {
Tcl_DStringSetLength(dstPtr, i--);
}
Tcl_DStringSetLength(dstPtr, soFar);
return Tcl_DStringValue(dstPtr);
}
flags &= ~TCL_ENCODING_START;
src += srcRead;
srcLen -= srcRead;
if (Tcl_DStringLength(dstPtr) == 0) {
Tcl_DStringSetLength(dstPtr, dstLen);
@@ -1437,10 +1462,7 @@ Tcl_UtfToExternal(
result = encodingPtr->fromUtfProc(encodingPtr->clientData, src, srcLen,
flags, statePtr, dst, dstLen, srcReadPtr,
dstWrotePtr, dstCharsPtr);
if (encodingPtr->nullSize == 2) {
dst[*dstWrotePtr + 1] = '\0';
}
dst[*dstWrotePtr] = '\0';
memset(&dst[*dstWrotePtr], '\0', encodingPtr->nullSize);
return result;
}
@@ -1463,14 +1485,15 @@ Tcl_UtfToExternal(
*---------------------------------------------------------------------------
*/
#undef Tcl_FindExecutable
void
const char *
Tcl_FindExecutable(
const char *argv0) /* The value of the application's argv[0]
* (native). */
{
Tcl_InitSubsystems();
const char *version = Tcl_InitSubsystems();
TclpSetInitialEncodings();
TclpFindExecutable(argv0);
return version;
}
/*
@@ -1506,7 +1529,7 @@ OpenEncodingFileChannel(
Tcl_Channel chan = NULL;
int i, numDirs;
Tcl_ListObjGetElements(NULL, searchPath, &numDirs, &dir);
TclListObjGetElements(NULL, searchPath, &numDirs, &dir);
Tcl_IncrRefCount(nameObj);
Tcl_AppendToObj(fileNameObj, ".enc", -1);
Tcl_IncrRefCount(fileNameObj);
@@ -2215,7 +2238,7 @@ UtfToUtfProc(
dstStart = dst;
flags |= PTR2INT(clientData);
dstEnd = dst + dstLen - TCL_UTF_MAX;
dstEnd = dst + dstLen - ((flags & TCL_ENCODING_UTF) ? TCL_UTF_MAX : 6);
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
@@ -2231,15 +2254,15 @@ UtfToUtfProc(
result = TCL_CONVERT_NOSPACE;
break;
}
if (UCHAR(*src) < 0x80 && !(UCHAR(*src) == 0 && (flags & TCL_ENCODING_MODIFIED))) {
if (UCHAR(*src) < 0x80 && !((UCHAR(*src) == 0) && (flags & TCL_ENCODING_MODIFIED))) {
/*
* Copy 7bit characters, but skip null-bytes when we are in input
* mode, so that they get converted to 0xC080.
*/
*dst++ = *src++;
} else if (UCHAR(*src) == 0xC0 && (src + 1 < srcEnd)
&& UCHAR(src[1]) == 0x80 && !(flags & TCL_ENCODING_MODIFIED)) {
} else if ((UCHAR(*src) == 0xC0) && (src + 1 < srcEnd)
&& (UCHAR(src[1]) == 0x80) && !(flags & TCL_ENCODING_MODIFIED)) {
/*
* Convert 0xC080 to real nulls when we are in output mode.
*/
@@ -2268,6 +2291,7 @@ UtfToUtfProc(
dst += Tcl_UniCharToUtf(ch, dst);
} else {
int low;
const char *saveSrc = src;
size_t len = TclUtfToUCS4(src, &ch);
if ((len < 2) && (ch != 0) && (flags & TCL_ENCODING_STOPONERROR)
&& (flags & TCL_ENCODING_MODIFIED)) {
@@ -2275,7 +2299,17 @@ UtfToUtfProc(
break;
}
src += len;
if ((ch | 0x7FF) == 0xDFFF) {
if (!(flags & TCL_ENCODING_UTF) && (ch > 0x3FF)) {
if (ch > 0xFFFF) {
/* CESU-8 6-byte sequence for chars > U+FFFF */
ch -= 0x10000;
*dst++ = 0xED;
*dst++ = (char) (((ch >> 16) & 0x0F) | 0xA0);
*dst++ = (char) (((ch >> 10) & 0x3F) | 0x80);
ch = (ch & 0x0CFF) | 0xDC00;
}
goto cesu8;
} else if ((ch | 0x7FF) == 0xDFFF) {
/*
* A surrogate character is detected, handle especially.
*/
@@ -2284,6 +2318,12 @@ UtfToUtfProc(
len = (src <= srcEnd-3) ? TclUtfToUCS4(src, &low) : 0;
if (((low & ~0x3FF) != 0xDC00) || (ch & 0x400)) {
if (flags & TCL_ENCODING_STOPONERROR) {
result = TCL_CONVERT_UNKNOWN;
src = saveSrc;
break;
}
cesu8:
*dst++ = (char) (((ch >> 12) | 0xE0) & 0xEF);
*dst++ = (char) (((ch >> 6) | 0x80) & 0xBF);
*dst++ = (char) ((ch | 0x80) & 0xBF);
@@ -2292,6 +2332,15 @@ UtfToUtfProc(
src += len;
dst += Tcl_UniCharToUtf(ch, dst);
ch = low;
} else if (!Tcl_UniCharIsUnicode(ch)) {
if (flags & TCL_ENCODING_STOPONERROR) {
result = TCL_CONVERT_UNKNOWN;
src = saveSrc;
break;
}
if (!(flags & TCL_ENCODING_MODIFIED)) {
ch = 0xFFFD;
}
}
dst += Tcl_UniCharToUtf(ch, dst);
}
@@ -2303,6 +2352,199 @@ UtfToUtfProc(
return result;
}
/*
*-------------------------------------------------------------------------
*
* Utf32ToUtfProc --
*
* Convert from UTF-32 to UTF-8.
*
* Results:
* Returns TCL_OK if conversion was successful.
*
* Side effects:
* None.
*
*-------------------------------------------------------------------------
*/
static int
Utf32ToUtfProc(
ClientData clientData, /* additional flags, e.g. TCL_ENCODING_LE */
const char *src, /* Source string in Unicode. */
int srcLen, /* Source string length in bytes. */
int flags, /* Conversion control flags. */
TCL_UNUSED(Tcl_EncodingState *),
char *dst, /* Output buffer in which converted string is
* stored. */
int dstLen, /* The maximum length of output buffer in
* bytes. */
int *srcReadPtr, /* Filled with the number of bytes from the
* source string that were converted. This may
* be less than the original source length if
* there was a problem converting some source
* characters. */
int *dstWrotePtr, /* Filled with the number of bytes that were
* stored in the output buffer as a result of
* the conversion. */
int *dstCharsPtr) /* Filled with the number of characters that
* correspond to the bytes stored in the
* output buffer. */
{
const char *srcStart, *srcEnd;
const char *dstEnd, *dstStart;
int result, numChars, charLimit = INT_MAX;
int ch;
flags |= PTR2INT(clientData);
if (flags & TCL_ENCODING_CHAR_LIMIT) {
charLimit = *dstCharsPtr;
}
result = TCL_OK;
/*
* Check alignment with utf-32 (4 == sizeof(UTF-32))
*/
if ((srcLen % 4) != 0) {
result = TCL_CONVERT_MULTIBYTE;
srcLen &= -4;
}
srcStart = src;
srcEnd = src + srcLen;
dstStart = dst;
dstEnd = dst + dstLen - TCL_UTF_MAX;
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
if (dst > dstEnd) {
result = TCL_CONVERT_NOSPACE;
break;
}
if (flags & TCL_ENCODING_LE) {
ch = (src[3] & 0xFF) << 24 | (src[2] & 0xFF) << 16 | (src[1] & 0xFF) << 8 | (src[0] & 0xFF);
} else {
ch = (src[0] & 0xFF) << 24 | (src[1] & 0xFF) << 16 | (src[2] & 0xFF) << 8 | (src[3] & 0xFF);
}
/*
* Special case for 1-byte utf chars for speed. Make sure we work with
* unsigned short-size data.
*/
if ((ch > 0) && (ch < 0x80)) {
*dst++ = (ch & 0xFF);
} else {
dst += Tcl_UniCharToUtf(ch, dst);
}
src += sizeof(unsigned int);
}
*srcReadPtr = src - srcStart;
*dstWrotePtr = dst - dstStart;
*dstCharsPtr = numChars;
return result;
}
/*
*-------------------------------------------------------------------------
*
* UtfToUtf32Proc --
*
* Convert from UTF-8 to UTF-32.
*
* Results:
* Returns TCL_OK if conversion was successful.
*
* Side effects:
* None.
*
*-------------------------------------------------------------------------
*/
static int
UtfToUtf32Proc(
ClientData clientData, /* additional flags, e.g. TCL_ENCODING_LE */
const char *src, /* Source string in UTF-8. */
int srcLen, /* Source string length in bytes. */
int flags, /* Conversion control flags. */
TCL_UNUSED(Tcl_EncodingState *),
char *dst, /* Output buffer in which converted string is
* stored. */
int dstLen, /* The maximum length of output buffer in
* bytes. */
int *srcReadPtr, /* Filled with the number of bytes from the
* source string that were converted. This may
* be less than the original source length if
* there was a problem converting some source
* characters. */
int *dstWrotePtr, /* Filled with the number of bytes that were
* stored in the output buffer as a result of
* the conversion. */
int *dstCharsPtr) /* Filled with the number of characters that
* correspond to the bytes stored in the
* output buffer. */
{
const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd;
int result, numChars;
int ch, len;
srcStart = src;
srcEnd = src + srcLen;
srcClose = srcEnd;
if ((flags & TCL_ENCODING_END) == 0) {
srcClose -= TCL_UTF_MAX;
}
dstStart = dst;
dstEnd = dst + dstLen - sizeof(Tcl_UniChar);
flags |= PTR2INT(clientData);
result = TCL_OK;
for (numChars = 0; src < srcEnd; numChars++) {
if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
/*
* If there is more string to follow, this will ensure that the
* last UTF-8 character in the source buffer hasn't been cut off.
*/
result = TCL_CONVERT_MULTIBYTE;
break;
}
if (dst > dstEnd) {
result = TCL_CONVERT_NOSPACE;
break;
}
len = TclUtfToUCS4(src, &ch);
if (!Tcl_UniCharIsUnicode(ch)) {
if (flags & TCL_ENCODING_STOPONERROR) {
result = TCL_CONVERT_UNKNOWN;
break;
}
ch = 0xFFFD;
}
src += len;
if (flags & TCL_ENCODING_LE) {
*dst++ = (ch & 0xFF);
*dst++ = ((ch >> 8) & 0xFF);
*dst++ = ((ch >> 16) & 0xFF);
*dst++ = ((ch >> 24) & 0xFF);
} else {
*dst++ = ((ch >> 24) & 0xFF);
*dst++ = ((ch >> 16) & 0xFF);
*dst++ = ((ch >> 8) & 0xFF);
*dst++ = (ch & 0xFF);
}
}
*srcReadPtr = src - srcStart;
*dstWrotePtr = dst - dstStart;
*dstCharsPtr = numChars;
return result;
}
/*
*-------------------------------------------------------------------------
*
@@ -2450,7 +2692,7 @@ UtfToUtf16Proc(
{
const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd;
int result, numChars;
int ch;
int ch, len;
srcStart = src;
srcEnd = src + srcLen;
@@ -2478,7 +2720,15 @@ UtfToUtf16Proc(
result = TCL_CONVERT_NOSPACE;
break;
}
src += TclUtfToUCS4(src, &ch);
len = TclUtfToUCS4(src, &ch);
if (!Tcl_UniCharIsUnicode(ch)) {
if (flags & TCL_ENCODING_STOPONERROR) {
result = TCL_CONVERT_UNKNOWN;
break;
}
ch = 0xFFFD;
}
src += len;
if (flags & TCL_ENCODING_LE) {
if (ch <= 0xFFFF) {
*dst++ = (ch & 0xFF);
@@ -2610,7 +2860,7 @@ UtfToUcs2Proc(
*dstCharsPtr = numChars;
return result;
}
/*
*-------------------------------------------------------------------------
*
@@ -2796,11 +3046,7 @@ TableFromUtfProc(
len = TclUtfToUniChar(src, &ch);
#if TCL_UTF_MAX > 3
/*
* This prevents a crash condition. More evaluation is required for
* full support of int Tcl_UniChar. [Bug 1004065]
*/
/* Unicode chars > +U0FFFF cannot be represented in any table encoding */
if (ch & 0xFFFF0000) {
word = 0;
} else
@@ -3052,7 +3298,7 @@ TableFreeProc(
ClientData clientData) /* TableEncodingData that specifies
* encoding. */
{
TableEncodingData *dataPtr = (TableEncodingData *) clientData;
TableEncodingData *dataPtr = (TableEncodingData *)clientData;
/*
* Make sure we aren't freeing twice on shutdown. [Bug 219314]
@@ -3110,7 +3356,7 @@ EscapeToUtfProc(
* correspond to the bytes stored in the
* output buffer. */
{
EscapeEncodingData *dataPtr = (EscapeEncodingData *) clientData;
EscapeEncodingData *dataPtr = (EscapeEncodingData *)clientData;
const char *prefixBytes, *tablePrefixBytes, *srcStart, *srcEnd;
const unsigned short *const *tableToUnicode;
const Encoding *encodingPtr;
@@ -3587,7 +3833,7 @@ GetTableEncoding(
/*
*---------------------------------------------------------------------------
*
* unilen --
* unilen, unilen4 --
*
* A helper function for the Tcl_ExternalToUtf functions. This function
* is similar to strlen for double-byte characters: it returns the number
@@ -3614,6 +3860,19 @@ unilen(
}
return (char *) p - src;
}
static size_t
unilen4(
const char *src)
{
unsigned int *p;
p = (unsigned int *) src;
while (*p != 0x00000000) {
p++;
}
return (char *) p - src;
}
/*
*-------------------------------------------------------------------------
@@ -3645,7 +3904,7 @@ InitializeEncodingSearchPath(
Tcl_Encoding *encodingPtr)
{
const char *bytes;
int i, numDirs;
int i, numDirs, numBytes;
Tcl_Obj *libPathObj, *encodingObj, *searchPathObj;
TclNewLiteralStringObj(encodingObj, "encoding");
@@ -3654,7 +3913,7 @@ InitializeEncodingSearchPath(
Tcl_IncrRefCount(searchPathObj);
libPathObj = TclGetLibraryPath();
Tcl_IncrRefCount(libPathObj);
Tcl_ListObjLength(NULL, libPathObj, &numDirs);
TclListObjLength(NULL, libPathObj, &numDirs);
for (i = 0; i < numDirs; i++) {
Tcl_Obj *directoryObj, *pathObj;
@@ -3675,11 +3934,11 @@ InitializeEncodingSearchPath(
if (*encodingPtr) {
((Encoding *)(*encodingPtr))->refCount++;
}
bytes = TclGetString(searchPathObj);
bytes = Tcl_GetStringFromObj(searchPathObj, &numBytes);
*lengthPtr = searchPathObj->length;
*valuePtr = (char *)ckalloc(*lengthPtr + 1);
memcpy(*valuePtr, bytes, *lengthPtr + 1);
*lengthPtr = numBytes;
*valuePtr = (char *)ckalloc(numBytes + 1);
memcpy(*valuePtr, bytes, numBytes + 1);
Tcl_DecrRefCount(searchPathObj);
}
+39 -21
View File
@@ -84,18 +84,18 @@ static const Tcl_ObjType ensembleCmdType = {
NULL /* setFromAnyProc */
};
#define ECRSetIntRep(objPtr, ecRepPtr) \
#define ECRSetInternalRep(objPtr, ecRepPtr) \
do { \
Tcl_ObjIntRep ir; \
Tcl_ObjInternalRep ir; \
ir.twoPtrValue.ptr1 = (ecRepPtr); \
ir.twoPtrValue.ptr2 = NULL; \
Tcl_StoreIntRep((objPtr), &ensembleCmdType, &ir); \
Tcl_StoreInternalRep((objPtr), &ensembleCmdType, &ir); \
} while (0)
#define ECRGetIntRep(objPtr, ecRepPtr) \
#define ECRGetInternalRep(objPtr, ecRepPtr) \
do { \
const Tcl_ObjIntRep *irPtr; \
irPtr = TclFetchIntRep((objPtr), &ensembleCmdType); \
const Tcl_ObjInternalRep *irPtr; \
irPtr = TclFetchInternalRep((objPtr), &ensembleCmdType); \
(ecRepPtr) = irPtr ? (EnsembleCmdRep *)irPtr->twoPtrValue.ptr1 : NULL; \
} while (0)
@@ -165,7 +165,7 @@ TclNamespaceEnsembleCmd(
const char *simpleName;
int index, done;
if (nsPtr == NULL || nsPtr->flags & NS_DYING) {
if (nsPtr == NULL || nsPtr->flags & NS_DEAD) {
if (!Tcl_InterpDeleted(interp)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"tried to manipulate ensemble of deleted namespace",
@@ -1730,7 +1730,7 @@ NsEnsembleImplementationCmdNR(
return TCL_ERROR;
}
if (ensemblePtr->nsPtr->flags & NS_DYING) {
if (ensemblePtr->nsPtr->flags & NS_DEAD) {
/*
* Don't know how we got here, but make things give up quickly.
*/
@@ -1759,7 +1759,7 @@ NsEnsembleImplementationCmdNR(
*/
EnsembleCmdRep *ensembleCmd;
ECRGetIntRep(subObj, ensembleCmd);
ECRGetInternalRep(subObj, ensembleCmd);
if (ensembleCmd) {
if (ensembleCmd->epoch == ensemblePtr->epoch &&
ensembleCmd->token == (Command *)ensemblePtr->token) {
@@ -1890,7 +1890,7 @@ NsEnsembleImplementationCmdNR(
Tcl_Obj **copyObjv;
int copyObjc, prefixObjc;
Tcl_ListObjLength(NULL, prefixObj, &prefixObjc);
TclListObjLength(NULL, prefixObj, &prefixObjc);
if (objc == 2) {
copyPtr = TclListObjCopy(NULL, prefixObj);
@@ -1924,7 +1924,7 @@ NsEnsembleImplementationCmdNR(
*/
TclSkipTailcall(interp);
Tcl_ListObjGetElements(NULL, copyPtr, &copyObjc, &copyObjv);
TclListObjGetElements(NULL, copyPtr, &copyObjc, &copyObjv);
((Interp *)interp)->lookupNsPtr = ensemblePtr->nsPtr;
return TclNREvalObjv(interp, copyObjc, copyObjv, TCL_EVAL_INVOKE, NULL);
}
@@ -2201,6 +2201,18 @@ TclSpellFix(
TclNRAddCallback(interp, TclNRReleaseValues, fix, NULL, NULL, NULL);
}
Tcl_Obj *const *TclEnsembleGetRewriteValues(
Tcl_Interp *interp /* Current interpreter. */
)
{
Interp *iPtr = (Interp *) interp;
Tcl_Obj *const *origObjv = iPtr->ensembleRewrite.sourceObjs;
if (origObjv[0] == NULL) {
origObjv = (Tcl_Obj *const *)origObjv[2];
}
return origObjv;
}
/*
*----------------------------------------------------------------------
*
@@ -2225,12 +2237,18 @@ TclFetchEnsembleRoot(
int objc,
int *objcPtr)
{
Tcl_Obj *const *sourceObjs;
Interp *iPtr = (Interp *) interp;
if (iPtr->ensembleRewrite.sourceObjs) {
*objcPtr = objc + iPtr->ensembleRewrite.numRemovedObjs
- iPtr->ensembleRewrite.numInsertedObjs;
return iPtr->ensembleRewrite.sourceObjs;
if (iPtr->ensembleRewrite.sourceObjs[0] == NULL) {
sourceObjs = (Tcl_Obj *const *)iPtr->ensembleRewrite.sourceObjs[1];
} else {
sourceObjs = iPtr->ensembleRewrite.sourceObjs;
}
return sourceObjs;
}
*objcPtr = objc;
return objv;
@@ -2406,7 +2424,7 @@ MakeCachedEnsembleCommand(
{
EnsembleCmdRep *ensembleCmd;
ECRGetIntRep(objPtr, ensembleCmd);
ECRGetInternalRep(objPtr, ensembleCmd);
if (ensembleCmd) {
TclCleanupCommandMacro(ensembleCmd->token);
if (ensembleCmd->fix) {
@@ -2419,7 +2437,7 @@ MakeCachedEnsembleCommand(
*/
ensembleCmd = (EnsembleCmdRep *)ckalloc(sizeof(EnsembleCmdRep));
ECRSetIntRep(objPtr, ensembleCmd);
ECRSetInternalRep(objPtr, ensembleCmd);
}
/*
@@ -2587,7 +2605,7 @@ BuildEnsembleConfig(
* Must determine the target for each.
*/
Tcl_ListObjGetElements(NULL, subList, &subc, &subv);
TclListObjGetElements(NULL, subList, &subc, &subv);
if (subList == mapDict) {
/*
* Strange case where explicit list of subcommands is same value
@@ -2829,7 +2847,7 @@ FreeEnsembleCmdRep(
{
EnsembleCmdRep *ensembleCmd;
ECRGetIntRep(objPtr, ensembleCmd);
ECRGetInternalRep(objPtr, ensembleCmd);
TclCleanupCommandMacro(ensembleCmd->token);
if (ensembleCmd->fix) {
Tcl_DecrRefCount(ensembleCmd->fix);
@@ -2863,8 +2881,8 @@ DupEnsembleCmdRep(
EnsembleCmdRep *ensembleCmd;
EnsembleCmdRep *ensembleCopy = (EnsembleCmdRep *)ckalloc(sizeof(EnsembleCmdRep));
ECRGetIntRep(objPtr, ensembleCmd);
ECRSetIntRep(copyPtr, ensembleCopy);
ECRGetInternalRep(objPtr, ensembleCmd);
ECRSetInternalRep(copyPtr, ensembleCopy);
ensembleCopy->epoch = ensembleCmd->epoch;
ensembleCopy->token = ensembleCmd->token;
@@ -2988,7 +3006,7 @@ TclCompileEnsemble(
const char *str;
Tcl_Obj *matchObj = NULL;
if (Tcl_ListObjGetElements(NULL, listObj, &len, &elems) != TCL_OK) {
if (TclListObjGetElements(NULL, listObj, &len, &elems) != TCL_OK) {
goto failed;
}
for (i=0 ; i<len ; i++) {
@@ -3108,7 +3126,7 @@ TclCompileEnsemble(
doneMapLookup:
Tcl_ListObjAppendElement(NULL, replaced, replacement);
if (Tcl_ListObjGetElements(NULL, targetCmdObj, &len, &elems) != TCL_OK) {
if (TclListObjGetElements(NULL, targetCmdObj, &len, &elems) != TCL_OK) {
goto failed;
} else if (len != 1) {
/*
@@ -3390,7 +3408,7 @@ CompileToInvokedCommand(
* difference. Hence the call to TclContinuationsEnterDerived...
*/
Tcl_ListObjGetElements(NULL, replacements, &numWords, &words);
TclListObjGetElements(NULL, replacements, &numWords, &words);
for (i = 0, tokPtr = parsePtr->tokenPtr; i < parsePtr->numWords;
i++, tokPtr = TokenAfter(tokPtr)) {
if (i > 0 && i < numWords+1) {

Some files were not shown because too many files have changed in this diff Show More