Compare commits

...
570 Commits
Author SHA1 Message Date
jan.nijtmans 59248c33fa Fix [61ba0b0661]: platform::identify broken on Red Hat Linux 2026-09-09 12:13:27 +00:00
jan.nijtmans bfcda554c0 Sometimes, on macOS, 15/20 minutes are not enough to run all testcases 2026-09-08 10:17:20 +00:00
jan.nijtmans 6ebdd5f383 Sometimes, on macOS, 15/20 minutes are not enough to run all testcases 2026-09-08 10:14:10 +00:00
jan.nijtmans a8037e8df7 burnett01/rsync-deployments -> 9.0.1 2026-09-07 20:24:07 +00:00
jan.nijtmans 81914ec871 burnett01/rsync-deployments -> 9.0.1 2026-09-07 20:13:26 +00:00
dkf 166190ee63 More efficient memory handling inside ensembles 2026-09-07 14:00:05 +00:00
dkf 4614eaeb6c Fix some technically-possible memory leaks in [scan] 2026-09-07 13:53:43 +00:00
jan.nijtmans faaa406022 Cherrypick some trivial doc changes from tip-700 branch 2026-09-07 11:37:34 +00:00
sebres 4b7e30ceb8 merge 9.0 (CI-flow: refactor MSVC initialization and allow manual trigger of flow) 2026-09-04 14:31:27 +00:00
sebres b84b1b5a87 CI-flow: refactor MSVC initialization:
removed 3rd party action ilammy/msvc-dev-cmd; silence deprecation warning;
the step would use vcvarsall.bat in cmd shell and put the vc-vars to default ENV
2026-09-04 14:28:50 +00:00
sebres 68724b1f43 allow manual trigger of flow (independently on branch/tag name) 2026-09-04 14:20:36 +00:00
sebres 0c934cf5e4 merge 9.0: fix for segfault [e533296a92d89044]: avoid reset of lambda info in frames stack by nested calls; create cmdPtr once by first apply (conversion to lambda), so besides the fix it'd also get better performance 2026-09-02 19:56:45 +00:00
sebres 57aa93435e amend to [a8133670760aa4a8]: added missing initialization for flags in DuplicateProc (doesn't exist in 8.6) 2026-09-02 11:19:59 +00:00
dkf b6a04ef4e8 Clean up grapheme command a bit. Verified that it can be exposed in a safe interp 2026-09-02 08:52:55 +00:00
sebres b364073019 merge 8.6: amend to [e533296a92d89044], fixes [f6afe6b71d26e111]: same logic of lamda command init in disassemble; code simplification 2026-09-01 21:45:41 +00:00
sebres 2d5c6c16be small amend 2026-09-01 21:38:35 +00:00
sebres 035195b0f4 amend to [e533296a92d89044], fixes [f6afe6b71d26e111]: same logic of lamda command init in disassemble; code simplification 2026-09-01 21:16:44 +00:00
sebres a8897e0ba2 merge 8.6: ultimate fix for segfault [e533296a92d89044]: avoid reset of lambda info in frames stack by nested calls; create cmdPtr once by first apply (conversion to lambda), so besides the fix it'd also get better performance 2026-09-01 11:01:29 +00:00
sebres a69a6190a7 ultimate fix for segfault [e533296a92d89044]: avoid reset of lambda info in frames stack by nested calls;
merged branch bug-e533296a92-sebres-optimized - create cmdPtr once by first apply (conversion to lambda), so besides the fix it'd also get better performance
2026-09-01 10:32:56 +00:00
sebres 858697b6f6 new apply test (covering shimmer of lambda during its evaluation, similar to regexp-27.8) 2026-09-01 10:24:56 +00:00
sebres 182a8a6fbc merge fix for [e533296a92d89044] from 8.6: reset cmd in procPtr after lambda invocation; avoid reset of lambda info in frames stack by nested calls (till it is still evaluated) - fill this info and reset the artificial command only once (at parent invocation); new tests added 2026-08-31 21:35:39 +00:00
sebres 56e27b0e1a fixes [e533296a92d89044]: reset cmd in procPtr after lambda invocation; avoid reset of lambda info in frames stack by nested calls (till it is still evaluated) - fill this info and reset the artificial command only once (at parent invocation); new tests added 2026-08-31 21:07:14 +00:00
sebres f837143bc6 tests/apply.test: cherry-picked test from optimized branch 2026-08-31 21:03:24 +00:00
sebres 6006931fc9 real refcounting for owned procPtr->cmdPtr of lambda 2026-08-31 20:53:08 +00:00
sebres b793c0c17e amend (added init for var res) 2026-08-31 15:45:33 +00:00
jan.nijtmans fb558e4cef Doc fixes, backported from TIP 700 branch 2026-08-31 09:02:59 +00:00
dkf 5cf20f48c5 Spruce up tclIO.c in a few spots 2026-08-30 11:30:08 +00:00
oehhar 993a28d8cf [04d1d40a] correct expr ?: documentation (9.0 and main) 2026-08-29 09:14:26 +00:00
oehhar b43e7aec44 [04d1d40a] correct expr ?: documentation (9.0 and main) 2026-08-29 09:12:05 +00:00
sebres ffc0435a28 more tests, reset cmdPtr->nsPtr after reference decrement (in case if NS is dead) 2026-08-28 13:06:27 +00:00
jan.nijtmans e76f229b4a Fix [17960b80db]: Missing libtcl?.?.dll.a in Cygwin 2026-08-28 12:24:47 +00:00
sebres fd88611502 workaround for OO, differentiating cmdPtr between OO and lamda (lamdas procPtr owns cmdPtr now), no failing tests anymore 2026-08-27 22:25:14 +00:00
sebres d594f54dc8 small amend referencing nsPtr in lambda command (don't allow eval of lamdas in dead namespaces); todo: check effect on OO (also used ExtraFrameInfo) 2026-08-27 21:46:24 +00:00
sebres a8e53c3cea experimental: try to optimize lambda invocation (apply, frame info, TIP #280, etc) 2026-08-27 21:01:09 +00:00
sebres 5fd3c575fe backport the idea [a7a8993cca8e49c9] from 8.5 as NRE-capable version: fill this info and reset the artificial command only once (at parent invocation, bypass nested invokations); test adjusted to cover it. 2026-08-27 17:53:32 +00:00
jan.nijtmans 20b4abd9b3 Merge-mark 2026-08-27 15:08:07 +00:00
jan.nijtmans cf48dad3e5 chw's proposed patch for [e533296a92] 2026-08-27 14:57:52 +00:00
jan.nijtmans c503cda4f3 Formatting, missing sentinels 2026-08-27 14:36:37 +00:00
jan.nijtmans a414f1623d Update utf8proc.c for Unicode 18. Most GraphemeBreakTest testcases now pass. Only 4 fail, those are disabled for now 2026-08-25 12:07:36 +00:00
jan.nijtmans 72df45e415 Disable io-29.26 run in CI environment. Needs further investigation 2026-08-25 07:32:26 +00:00
jan.nijtmans 6d9e3b4ad1 Disable io-29.26 run in CI environment. Needs further investigation 2026-08-25 07:31:19 +00:00
jan.nijtmans b76f280e26 Update CI build to ubuntu-26.04 2026-08-24 17:59:10 +00:00
jan.nijtmans 933ffa5c9e Update to latest unicode 18 tables 2026-08-24 17:53:42 +00:00
jan.nijtmans 0b11f59ff8 Update testcases too 2026-08-24 17:51:57 +00:00
jan.nijtmans cc9383a9d7 Update to latest Unicode 18 tables 2026-08-24 16:38:37 +00:00
jan.nijtmans c1cd785155 Update CI build to ubuntu-26.04 (except for onefiledist) 2026-08-24 14:27:45 +00:00
Phil Brooks 327f57a896 update tclsh.svg to new Tcl logo 2026-08-23 19:30:21 +00:00
Phil Brooks c9dc381ce1 update tools/tclsh.svg to new logo 2026-08-20 16:26:52 +00:00
jan.nijtmans ec80057640 Fix [e4c24e86b5]: timer documentation typos 2026-08-20 12:12:27 +00:00
jan.nijtmans 499636ce45 Fix [e4c24e86b5]: documentation typos 2026-08-20 12:09:20 +00:00
jan.nijtmans b874a90ed8 Fix [99717117b7]: warnings when compiling with Clang ucrt64 2026-08-20 11:57:42 +00:00
apnadkarni c797510ff8 Merge 9.0. Previous fix for exec output encoding docs was incomplete 2026-08-20 09:48:52 +00:00
apnadkarni cfba261e9b Previous fix for exec output encoding docs was incomplete 2026-08-20 09:47:43 +00:00
apnadkarni 9b594af80e Merge 9.0. Fix explanation of exec -encoding option (thanks, @Schelte) 2026-08-20 03:10:09 +00:00
apnadkarni 18bc584b71 Fix explanation of exec -encoding option (thanks, @Schelte) 2026-08-20 03:08:39 +00:00
jan.nijtmans 5a55adba96 Fix [e4c24e86b5]: timer documentation typos 2026-08-18 15:42:46 +00:00
jan.nijtmans de448b8063 Fix [4bd630]: --without-tzdata on windows 2026-08-18 12:50:01 +00:00
jan.nijtmans 54b5091646 Fix [4bd630]: --without-tzdata on windows 2026-08-18 12:44:06 +00:00
Phil Brooks 5c77a3bdea Update Windows icon to new Tcl 9 logo 2026-08-16 23:55:16 +00:00
apnadkarni 64c1a87b5f Constraint console-bug-f10d91c2 test to 64-bit as triggering powershell script does not run on 32-bit Windows 2026-08-15 10:42:08 +00:00
apnadkarni 703cac60dc Fix failure of package require registry on --disable-zipfs builds 2026-08-15 09:51:24 +00:00
dkf 696e11a42b A few more places where we can use faster string concatenation. Makes the code a little less clear. 2026-08-14 06:52:30 +00:00
dkf 2b273fdd1d Another place where we can use a faster string construction technique 2026-08-14 06:34:42 +00:00
dkf 192100fcbc Add caching of the delegate class name. 2026-08-13 14:05:36 +00:00
dkf 099ec2c204 Centralise the generation of delegate class names for better comprehensibility 2026-08-12 08:35:03 +00:00
dkf 2e1a047090 Another performance improvement for properties: faster string building in the resolver wrapper 2026-08-12 07:33:12 +00:00
apnadkarni c3e4bc8b5e Merge 9.0. Fix [4676f5c78] - corrupted elements from glob -dir . in zipfs 2026-08-11 13:52:16 +00:00
apnadkarni 844399a2db Fix [4676f5c78] - corrupted elements from glob -dir . in zipfs 2026-08-11 13:30:19 +00:00
apnadkarni 5b7fa7a4e4 Merge 9.0 2026-08-10 13:20:24 +00:00
jan.nijtmans dc810f6e15 Fix [d5acb07b6411]: TIP 752 broke [clock seconds] in 32bit linux. (see remark in ticket) 2026-08-10 09:59:49 +00:00
jan.nijtmans 52d1487dfb Consolidate use of ©. Indenting 2026-08-10 09:58:38 +00:00
dkf 085a472096 Add an internal caching mechanism to make property access a bit faster 2026-08-10 08:51:42 +00:00
jan.nijtmans 3d319623b1 tzdata updated to Olson's tzdata2026c 2026-08-10 07:40:31 +00:00
jan.nijtmans e08a1229b3 tzdata updated to Olson's tzdata2026c 2026-08-10 07:39:25 +00:00
jan.nijtmans 875a2e91a1 tzdata updated to Olson's tzdata2026c 2026-08-10 07:36:00 +00:00
Phil Brooks 44d4d7b3c1 Use new Tcl9 Logo in win/tclsh.ico 2026-08-10 05:42:15 +00:00
apnadkarni 8d614c2557 Proposed fix for [4676f5c78] and more tests 2026-08-08 08:57:13 +00:00
apnadkarni 663055bebf Bug [4676f5c78] - add tests to reproduce reported defect 2026-08-08 06:06:00 +00:00
Emiliano Gavilán 050c4d7893 Proposed fix for bug [d5acb07b6411] 2026-08-02 22:30:24 +00:00
apnadkarni b229566362 Fix [6e82720e] - BUFFER_PADDING panic on 4294967296 chars read 2026-08-02 08:11:39 +00:00
apnadkarni 7be1b1e4fc Further 32-bit fixes. 2026-08-02 05:54:49 +00:00
apnadkarni 07e9a2cacf Proposed fix for [6e82720e14]. 2026-07-29 06:43:14 +00:00
apnadkarni 22b4ebf324 Add tests to recreate [6e82720e] without creating large files on disk 2026-07-29 05:40:50 +00:00
apnadkarni 0028fbcee2 Merge 9.0. Fix [d40d8db3]. Path normalization on Windows ACL-denied directory 2026-07-16 12:21:40 +00:00
apnadkarni b836bf581c Update changes.md for 2 bug fixes 2026-07-16 11:52:24 +00:00
apnadkarni 17e820f0ca Fix [d40d8db3]. Path normalization on Windows ACL-denied directory 2026-07-16 11:41:02 +00:00
apnadkarni 70fe052802 Fix MinGW warnings 2026-07-16 11:12:54 +00:00
apnadkarni 44c69cacd5 Enable test on CI. Add Unicode variant 2026-07-16 03:08:26 +00:00
apnadkarni f235a234ec Proposed fix for ACL-denied normalization 2026-07-15 17:03:05 +00:00
apnadkarni 89ea8429f7 Add test to prove presence of bug 2026-07-15 11:34:17 +00:00
apnadkarni 4cc7636fbf Add infrastructure for bug reproduction 2026-07-15 08:26:13 +00:00
apnadkarni e26ee8c21a Add missing 9.1 TIP's to changes.md 2026-07-14 16:43:03 +00:00
apnadkarni fde078cd06 Merge 9.0 - Fix [f10d91c2] - dead console busy loop 2026-07-14 16:31:39 +00:00
apnadkarni a43ca1fd70 Fix [f10d91c2] - dead console busy loop 2026-07-14 16:27:00 +00:00
jan.nijtmans 6bcc3de72a platform -> 1.2b1 2026-07-14 14:26:36 +00:00
jan.nijtmans c638ab49c1 Fix [61ba0b0661]: platform::identify broken on Red Hat Linux 2026-07-14 14:03:14 +00:00
jan.nijtmans 68277f984d Fix [61ba0b0661]: platform::identify broken on Red Hat Linux 2026-07-14 13:41:38 +00:00
apnadkarni aa1da06ab1 Added TIP 755 to changes.md 2026-07-14 11:39:35 +00:00
jan.nijtmans 78fd0d7c79 This should work on RHEL too 2026-07-14 10:16:19 +00:00
jan.nijtmans 70ca43b027 Merge-mark 2026-07-14 08:24:20 +00:00
jan.nijtmans 91685c65b4 Backout fix for [917c4a896a]. Let the improved fix land on 9.1, it can always be backported later 2026-07-14 08:22:09 +00:00
jan.nijtmans c9f88cfebb Fix [61ba0b0661]: platform::identify broken on Red Hat Linux. Now also works with musl 2026-07-14 08:06:54 +00:00
jan.nijtmans dc523fc365 Attempt to make it work with MUSL 2026-07-14 08:00:19 +00:00
apnadkarni 6aa24c8ca3 Create new branch named "bug-d40d8db3" 2026-07-14 06:52:56 +00:00
jan.nijtmans 98187fcbfe Proposed fix for [61ba0b0661]. Just detect glibc/musl, no version number 2026-07-13 12:08:24 +00:00
apnadkarni 45bbff6820 Add test case. Thanks @JulianNoble for repro script 2026-07-13 11:47:22 +00:00
jan.nijtmans 9d5f272c17 Fix [6ae6c13b18]: Warning: argument 1 of 'Tcl_SetPanicProc' might be a candiate for a format attribute 2026-07-13 11:15:23 +00:00
jan.nijtmans aa49dc2501 Fix [6ae6c13b18]: Warning: argument 1 of 'Tcl_SetPanicProc' might be a candiate for a format attribute 2026-07-13 11:14:29 +00:00
apnadkarni 8f9a8b9f45 Slightly clearer wording in console test prompts 2026-07-13 10:43:45 +00:00
jan.nijtmans 13bfda9233 Fix [6ae6c13b18]: Warning: argument 1 of 'Tcl_SetPanicProc' might be a candiate for a format attribute 2026-07-13 10:14:45 +00:00
apnadkarni e59fdf4d22 Include check for error conditions in generating Windows file events 2026-07-13 07:16:37 +00:00
jan.nijtmans 577e8eed1f Fix [2759868527]: File tcltest-2.5.11.tm provides package version nr. 2.6.0 2026-07-12 20:38:37 +00:00
apnadkarni 620201f768 Create new branch named "bug-f10d91c2" 2026-07-12 12:42:39 +00:00
apnadkarni 914b7d5eb4 Bug [9594d5a0] - non-default nmake builds 2026-07-12 10:56:22 +00:00
apnadkarni 7af0494ef1 merge main 2026-07-12 10:53:33 +00:00
apnadkarni 3bc3d61222 Fix broken manifest (GH CI failure) inclusion. Need to include winuser.h else CREATEPROCESS_MANIFEST_RESOURCE_ID gets treated as a string id. This was previously hidden due to overwriting with mt.exe 2026-07-10 11:48:52 +00:00
apnadkarni ad4c16a445 Fix nmake builds of Tcl/Tk in non-default directories 2026-07-10 09:29:21 +00:00
jan.nijtmans da381a2859 Manifest is already in rc, so no need to run mt tool 2026-07-10 08:20:46 +00:00
apnadkarni 7ba409f546 Delete extraneous puts in winFCmd.test 2026-07-09 16:12:34 +00:00
apnadkarni eb99ec4583 Added tcl::unsupported::grapheme command 2026-07-09 11:08:21 +00:00
jan.nijtmans 351d7f7c1c Fix [917c4a896a]: Glibc detection broken on Linux for platform::identify 2026-07-09 10:34:47 +00:00
apnadkarni f49614d8e0 Remove obsolete prototypes 2026-07-09 10:32:40 +00:00
jan.nijtmans 0d769c079e Fix [917c4a896a]: Glibc detection broken on Linux for platform::identify 2026-07-09 10:31:38 +00:00
jan.nijtmans 665742245e Massive simplifcation 2026-07-09 10:24:46 +00:00
apnadkarni 4bf1046fbb Merge main 2026-07-09 10:20:18 +00:00
apnadkarni d7458ecfbb Remove unused placeholder compilers 2026-07-09 10:01:20 +00:00
apnadkarni f4b5524b41 Add Unicode 17 grapheme tests 2026-07-09 09:40:43 +00:00
apnadkarni b59d1f6138 Lazy load auto_execok 2026-07-09 08:13:26 +00:00
apnadkarni 664457d046 Avoid use of tclIndex in case code checks for auto_execok existence 2026-07-09 04:15:16 +00:00
jan.nijtmans 955edbe38d Attempt to fix [917c4a896a]: Glibc detection broken on Linux for platform::identify 2026-07-08 15:06:51 +00:00
jan.nijtmans bfa682d1be Sounds like good idea (thanks), just don't forget to commit the new file too ;-) 2026-07-08 14:27:45 +00:00
apnadkarni 22584de211 Load auto_execok lazily. Cuts interp creation time by more than 15% 2026-07-08 13:52:33 +00:00
apnadkarni ce316d8ed7 Merge trunk 2026-07-08 07:42:21 +00:00
jan.nijtmans 9857af9cd8 Undo changes in rules.vc/targets.vc, since extensions might use it 2026-07-07 11:14:16 +00:00
jan.nijtmans 76769b9071 Manifest is already in rc, so no need to run mt tool 2026-07-07 07:19:16 +00:00
jan.nijtmans bdc2817db0 No need to worry about Windows 8.1 any more 2026-07-06 11:14:30 +00:00
sebres 1a4393e539 fixes [6f8bbbb34bf84bf0] hang in BSD/kqueue: fixed infinite wait for kqueue (0 is smallest timeout, negative time is no timeout), similar to other notifiers implementations, see [def988e9cd676b5b] 2026-07-04 18:17:02 +00:00
apnadkarni 7a06379184 Merge mark 2026-07-04 08:26:18 +00:00
apnadkarni fcf2c0146a Fix [59cc110f]. Manually verified but no test case as it involves the root directory 2026-07-04 08:25:35 +00:00
apnadkarni 7d3fd1055c Fix [59cc110f]. Manually verified but no test case as it involves the root directory 2026-07-04 08:17:43 +00:00
apnadkarni 6ba84df246 Move grapheme command to tcl::unsupported for 9.1 2026-07-01 17:25:39 +00:00
apnadkarni ea18874265 Create new branch named "tip-756-91" 2026-07-01 16:34:02 +00:00
apnadkarni a412b42219 Merge main 2026-07-01 16:29:43 +00:00
jan.nijtmans 471e63e56f Version -> 9.0.5 for next release cycle 2026-07-01 13:44:13 +00:00
jan.nijtmans f858a0cbf3 Version -> 9.1b1 for next release cycle 2026-06-30 15:44:13 +00:00
jan.nijtmans 4dc2735186 Merge 9.0 2026-06-30 14:48:02 +00:00
jan.nijtmans a182758520 Merge-mark 2026-06-30 14:44:36 +00:00
dgp 792695f1aa merge release 2026-06-30 14:28:44 +00:00
jan.nijtmans bb853f8e3a Fix [f04e9b1304]: Crash in Tcl_UtfToUpper/Lower/Title on a genuine 4-byte UTF-8 character 2026-06-30 12:18:22 +00:00
jan.nijtmans 60696ce81b Missing include 2026-06-30 12:16:32 +00:00
jan.nijtmans c61fb83e3a Fix [fcd3dadd79]: format honours LC_NUMERIC for %f/%g, producing numbers Tcl cannot parse 2026-06-30 11:44:00 +00:00
jan.nijtmans 7f6d8bc80e Update changes 2026-06-30 11:41:36 +00:00
jan.nijtmans b17dbcdd3b Fix [fcd3dadd79]: format honours LC_NUMERIC for %f/%g, producing numbers Tcl cannot parse 2026-06-30 11:39:02 +00:00
jan.nijtmans fe1b58230e Update to burnett01/rsync-deployments@9.0.0 2026-06-30 08:39:41 +00:00
dgp fbe83207a7 merge trunk 2026-06-28 15:12:32 +00:00
dgp a8d0827f70 merge mark 2026-06-28 15:10:39 +00:00
dgp 400cc68151 Post-release resolution of test name between 9.0 and 9.1 branches 2026-06-26 19:06:58 +00:00
dgp 63bcd1c049 Bring test suite fixes over from the RC branch 2026-06-26 18:59:49 +00:00
dgp 5cc4b2512e merge release 2026-06-26 18:29:49 +00:00
dgp 37374ee339 merge trunk 2026-06-25 15:32:14 +00:00
dgp c655b4770b merge 9.0 2026-06-25 15:31:36 +00:00
apnadkarni ef326dedb9 Merge main 2026-06-25 11:20:21 +00:00
apnadkarni 0c0bd807ae Add test cases for empty strings 2026-06-25 11:19:39 +00:00
apnadkarni 32412ee230 Implement grapheme offset 2026-06-25 10:58:30 +00:00
jan.nijtmans 08fbb6a2b5 Merge 9.0. Indenting 2026-06-25 10:52:45 +00:00
jan.nijtmans 4bb172da1b Update changes.md 2026-06-25 10:47:27 +00:00
apnadkarni 3e8bce3b3f Fix [b48a676684] - latent memory leak. Not a showstopper for 9.1 beta 2026-06-25 10:18:43 +00:00
dkf bf0a9496cd Shorter and clearer script via [try] 2026-06-25 08:14:59 +00:00
apnadkarni 19460220f2 Fix const warnings 2026-06-25 06:48:30 +00:00
apnadkarni 303a5431e8 Latent memory leak in abstract list string generation 2026-06-25 06:46:53 +00:00
apnadkarni e116c9af11 Implement grapheme split command and GraphemeList 2026-06-25 05:37:39 +00:00
dkf 50a292633e [9563b8eeec] Add test case with very compressible data 2026-06-24 15:40:16 +00:00
dgp d1b65c6354 merge trunk 2026-06-24 14:07:12 +00:00
jan.nijtmans 685c45cf51 Dde version -> 1.5b0. Don't use tcl version as registry version. 2026-06-24 10:06:59 +00:00
jan.nijtmans 5c187e3fb3 Make it (at least) compile with Makefile.in too 2026-06-24 09:33:17 +00:00
dgp d7aeb043ef merge 9.0 2026-06-23 19:27:23 +00:00
dgp 3ac46d817b merge trunk 2026-06-23 14:42:40 +00:00
apnadkarni e69ee6b528 grapheme range,reverse 2026-06-23 11:04:17 +00:00
jan.nijtmans 1afc8936a9 Update utf8proc_data.c 2026-06-23 08:33:26 +00:00
apnadkarni 8eed2915a1 end-1 should use grapheme counts! 2026-06-23 05:21:41 +00:00
jan.nijtmans c4ec70596e actions/checkout@v6 -> v7 2026-06-22 22:11:16 +00:00
jan.nijtmans 66de0e7eee actions/checkout@v6 -> v7 2026-06-22 22:03:46 +00:00
dgp b159d667f6 test hygiene: file lifetime 2026-06-22 21:10:57 +00:00
dgp df92b05127 merge trunk 2026-06-22 20:51:47 +00:00
apnadkarni 16e765fe97 grapheme length, index 2026-06-22 17:09:54 +00:00
jan.nijtmans 919e9a5f97 Re-generate utf8proc_data with the latest Unicode 18 (still beta) tables 2026-06-22 14:00:40 +00:00
dkf 1cfaa53923 Minor change: Some more indentation corrections 2026-06-21 16:33:06 +00:00
apnadkarni 22ff4d3b8d Passes Unicode 17.0 test vectors, still has 18.0 failures as utf8proc is not actually Unicode 18.0 compliant 2026-06-21 16:01:21 +00:00
apnadkarni ff6179125f Merge main 2026-06-21 00:08:43 +00:00
dkf 9459aca51d Minor change: More tab/space fixes 2026-06-20 20:13:15 +00:00
apnadkarni 3fd1de184a Add tests using grapheme test vectors from UCD. 1646 pass 60 fail. Hangul, RI, LinkingConsonants, Vedic scripts 2026-06-20 17:02:39 +00:00
dkf eb966713f4 Minor change: Fix up some wayward tabs 2026-06-20 14:47:56 +00:00
apnadkarni a6543dd593 Base implementation of grapheme prev. No support for Hangul, RI etc. 2026-06-20 10:01:28 +00:00
apnadkarni bfbba66920 Would help to add the actual code 2026-06-19 17:36:05 +00:00
apnadkarni 09fb723c51 Skeleton for grapheme next 2026-06-19 17:35:22 +00:00
dgp 437c6c59b0 file lifetime hygiene
(Can't create files in general setting, then cleanup in constrained setting)
2026-06-18 19:26:21 +00:00
dgp 776d3e36c1 Duplicate test names 2026-06-18 19:12:59 +00:00
dgp 01afb8d2fb Duplicate test name 2026-06-18 18:22:51 +00:00
dgp 559c4ce2e3 duplicate test names 2026-06-18 18:21:27 +00:00
dgp 9bb0a77f14 File lifetime management hygiene 2026-06-18 18:18:45 +00:00
dgp 7ae8a23faa Conflict over variable name "id" between tests oo-16.16 and timer-2.1.1 2026-06-18 18:08:44 +00:00
dgp 2b40d76107 Duplicate test name 2026-06-18 17:56:30 +00:00
dgp b8fa37b5a6 merge trunk 2026-06-18 17:05:53 +00:00
jan.nijtmans 2dcb7fb76b Make tclTest.c compile with c++ (again) 2026-06-18 15:03:48 +00:00
jan.nijtmans 7f888b3485 Spacing 2026-06-18 14:56:35 +00:00
dgp 6353ba4f82 merge trunk 2026-06-17 18:12:35 +00:00
apnadkarni e092debb7b Create new branch named "apn-graphemes" 2026-06-17 12:47:14 +00:00
apnadkarni 064dc2f13e changes.md - Note performance improvements 2026-06-17 12:46:39 +00:00
dkf 5497d7d71b Use Tcl_GetInt instead of atoi to get consistent integer handling rules 2026-06-16 16:11:03 +00:00
Torsten 7968cfe7b2 (ticket [a127bf6415cbfa]) removed the duplicate documentation of auto_path from library.n and inserted a reference to tclvars.n instead 2026-06-16 13:32:49 +00:00
jan.nijtmans cb1a6a9526 Eliminate compiler warning, seen on Cygwin 2026-06-16 07:38:19 +00:00
jan.nijtmans 4c7c8c41c0 Fix 'make html' warning: process-text: impotent font change 2026-06-14 16:10:07 +00:00
dkf 8164c59772 Corrections to lgen and function naming in the testing abs-list code 2026-06-14 15:18:42 +00:00
dkf 8cab375e3e Proper indentation of function formal args 2026-06-13 16:05:42 +00:00
dkf 69d261d32f Indentation corrections 2026-06-13 15:56:32 +00:00
apnadkarni 5e95ace15d Fix gcc warnings about jumps around initialization. Bogus but fix nevertheless. 2026-06-13 09:39:11 +00:00
dgp 72c3642ec5 merge 9.0 2026-06-12 20:18:13 +00:00
dgp c7fc281d13 Release branch for Tcl 9.1b0 2026-06-12 19:41:47 +00:00
dgp 391408c53d merge 9.0 2026-06-11 13:04:30 +00:00
dgp ccbb4c0693 [18383c] Fix brace imbalance that broke big portions of the test suite. 2026-06-11 12:57:43 +00:00
jan.nijtmans 78a2986c20 Merge 9.0. No need for 'package require registry' any more 2026-06-11 12:35:49 +00:00
jan.nijtmans e53d6db1ac Fix encoding-31.0 testcase, when windows codepage is utf-8 2026-06-11 12:15:29 +00:00
jan.nijtmans 4ed4fd47da Use more tcl::registry, when possible 2026-06-11 12:05:04 +00:00
oehhar f35096a343 [53a4d960] doc binary scan f endianess correction in example 2026-06-10 07:30:49 +00:00
oehhar 8f7da52298 [53a4d960] doc binary scan f endianess correction in example 2026-06-10 07:29:20 +00:00
apnadkarni a72d84e77c Remove obsolete example. Neither start nor nativename is needed in 9.1 2026-06-10 05:05:47 +00:00
dkf 7b3ea543b0 Small corrections to doc comments 2026-06-08 18:41:52 +00:00
apnadkarni 9d038092c6 Add comment explaining need for path joining code fragment from 2005 2026-06-08 10:17:39 +00:00
dkf 2774c747b5 Tcl_GetInt(3) needed to mention that _ was accepted as 'numeric whitespace' 2026-06-07 15:05:14 +00:00
dkf c3e7c58cd7 Improve documentation comments where they were a bit neglected 2026-06-07 12:04:34 +00:00
apnadkarni 4da5c0bdd8 nmake rules tweaks - add OPTS=verbose option, install extension static libs in same location as Tcl static libs 2026-06-06 02:48:56 +00:00
apnadkarni 3d19071807 Minor tweaks to nmake log messages 2026-06-06 01:19:23 +00:00
jan.nijtmans c1af3498f9 Visual Studio 2026 gives a warning without this /b option 2026-06-04 16:04:40 +00:00
jan.nijtmans 9a9a3b4500 Run the CI build with Visual Studio 2026 2026-06-04 16:03:27 +00:00
jan.nijtmans 098f477b07 Update changes.md 2026-06-04 16:01:01 +00:00
apnadkarni 7244a12bad Add missing -DNDEBUG to nmakehlp build. Silence one more invocation of echo 2026-06-04 06:02:45 +00:00
apnadkarni 984d079606 Install static libraries in same location as Tcl's, not under package directories 2026-06-04 04:28:00 +00:00
apnadkarni ce5a3f18d1 Initialize nmake VERBOSE 2026-06-03 11:41:39 +00:00
jan.nijtmans e06e2ede3e Rebase to trunk, fix copy usage for vs2026 2026-06-03 10:48:58 +00:00
jan.nijtmans 0b9d4e97b0 Sync manifest changes with Tk 2026-06-03 10:28:05 +00:00
apnadkarni 4a872c6bf4 Less verbose nmake output by default. Add OPTS=verbose for old behavior 2026-06-03 08:30:38 +00:00
jan.nijtmans bfb9efd596 TclpGetMicroseconds() doesn't exist any more 2026-06-03 07:51:16 +00:00
jan.nijtmans fe9ee5c3b7 TIP #752: New timer API without Tcl_Time 2026-06-03 07:45:39 +00:00
dgp dfe4b531f7 silence warning about uninitialized paramter. 2026-06-02 17:03:47 +00:00
dgp 7027ad7052 Silence another warning with INT2PTR() 2026-06-02 17:02:03 +00:00
dgp 6cc6830a20 Silence compiler warnings about unused parameters. 2026-06-02 16:58:22 +00:00
apnadkarni a444111b2f Don't prematurely free object needed for error message! 2026-06-02 08:02:34 +00:00
apnadkarni 523fe6b439 Merge TIP 755 Final 2026-06-02 03:16:11 +00:00
apnadkarni 35a1b3c54c Merge main - TIP 755 final 2026-06-02 03:08:08 +00:00
jan.nijtmans da70427327 Re-generate configure scripts (with correct patchlevel) 2026-06-01 13:30:48 +00:00
jan.nijtmans 49a4a1bacc Prepare for Tcl 9.1b0 2026-06-01 13:17:29 +00:00
apnadkarni 676a07f018 Merge main 2026-05-31 06:02:25 +00:00
apnadkarni 21a59cbbbc Update changes.md for socket crash and tcltest -iterations option 2026-05-29 15:15:24 +00:00
apnadkarni 8f4e1bf7e5 Fix [06f19cc4] - Windows socket crash on thread exit. 2026-05-29 15:06:20 +00:00
apnadkarni c0c027cf31 Add -iterations configuration to tcltest. Bump to 2.6.0 2026-05-29 14:43:17 +00:00
apnadkarni 41086f693e Document tcltest::configure -iterations 2026-05-29 05:31:48 +00:00
apnadkarni 6bb6ac907f Merge apn-tcltest tests 2026-05-29 05:15:02 +00:00
apnadkarni ebc98e9aaf Bump version to 2.6.0. Add tests for -iterations 2026-05-29 05:01:44 +00:00
dgp a7d1547b15 file lifetime testing hygiene 2026-05-28 17:12:07 +00:00
dgp 4564939761 Duplicate test name 2026-05-28 16:55:22 +00:00
dgp b17731c1b4 merge 9.0 2026-05-28 16:42:36 +00:00
jan.nijtmans a9a42f8fcd Merge 9.0. Formatting 2026-05-28 12:13:27 +00:00
apnadkarni b736bbb4a4 Remove knownBug constraint 2026-05-28 11:53:11 +00:00
apnadkarni 6b662da8bd Merge apn-tcltest fixes for info frame 2026-05-28 10:48:42 +00:00
apnadkarni 3d63af2f4a Fix info frame test levels as test proc now adds two levels - uplevel and the TestOnce proc 2026-05-28 10:47:13 +00:00
jan.nijtmans 927d6415a3 Remove (unused, internal) TclListObjAppendIfAbsent functions. Backport formatting from 9.1 2026-05-28 09:30:04 +00:00
apnadkarni 80966bdc8b Proposed fix for [06f19cc401] - Windows sockets segfault 2026-05-28 05:48:36 +00:00
apnadkarni 59bb4e0ef8 Add -iterations to allow running each test multiple times 2026-05-28 01:39:36 +00:00
dgp 34e3813670 merge 9.0 2026-05-27 15:58:22 +00:00
dgp 7988d4dd3e merge mark 2026-05-27 13:54:23 +00:00
dgp 98c3389124 [2a0966cdc9] Give encodings in zip archive priority over past installs. 2026-05-27 13:48:23 +00:00
jan.nijtmans 6947cc76b6 Merge-mark 2026-05-27 10:40:45 +00:00
jan.nijtmans ae67ea5ede Fix [7da6c2d04c]: fileevent poor performance due to shimmering 2026-05-27 10:35:15 +00:00
apnadkarni 4c34c250c2 Prepend zipfs path to encoding dirs instead of appending (related to bug [2a0966cdc9]) 2026-05-27 10:30:08 +00:00
apnadkarni 4c47d86166 Minor refactor 2026-05-27 09:45:51 +00:00
apnadkarni ec2bcb566c Merge main 2026-05-27 09:11:48 +00:00
apnadkarni 0e505f970b Merge 9.0 - Fix [165b1039] - error message for byte arrays 2026-05-27 03:38:06 +00:00
apnadkarni ac38cf507c Fix [165b1039] - error message for byte arrays 2026-05-27 03:35:43 +00:00
apnadkarni 24c750fe99 Fix messages in tests to match new wording 2026-05-27 03:09:28 +00:00
jan.nijtmans 22b6069178 Fix [7da6c2d04c]: fileevent poor performance due to shimmering. Same pattern in a lot of other places 2026-05-26 21:53:12 +00:00
apnadkarni 7fb53c5fc9 Check error before calling post init callbacks 2026-05-26 08:37:33 +00:00
dkf 8b300ead45 Avoid some unnecessary copies; Tcl_NewStringObj copies anyway 2026-05-26 07:19:02 +00:00
apnadkarni e41c753a81 Bug [165b103962] - do not print character on byte array error. 2026-05-25 23:24:10 +00:00
jan.nijtmans e51eee9970 Fix html generation, broken by TIP #745 2026-05-25 22:29:06 +00:00
jan.nijtmans d146c4577e Fix [673f2d]: mind PTHREAD_NULL as sentinel value vs legitimate pthread_t arg 2026-05-25 21:36:14 +00:00
jan.nijtmans f2db52d61b Fix [673f2d]: mind PTHREAD_NULL as sentinel value vs legitimate pthread_t arg 2026-05-25 21:25:59 +00:00
dkf bf9f1bdfe6 More modern way of packing extra stuff into a hash entry 2026-05-25 14:28:54 +00:00
apnadkarni dca82b9e05 Merge main 2026-05-25 11:35:56 +00:00
apnadkarni 0a3a259a4d Merge 9.0 Fix [e860418c] Windows: glob -dir $dir -tail returns name with leading / 2026-05-25 10:59:43 +00:00
apnadkarni 09cca99a2a Fix [e860418c] Windows: glob -dir $dir -tail returns name with leading / 2026-05-25 10:45:35 +00:00
apnadkarni 6d36060125 Fix test reference to env(WINDIR) 2026-05-25 10:26:06 +00:00
apnadkarni 2e28014149 Merge 9.0 - Bug [1215dca7] - inconsistent file join with volume relative arguments 2026-05-25 10:08:54 +00:00
apnadkarni 48da715792 Bug [1215dca7] - inconsistent file join with volume relative arguments 2026-05-25 10:04:11 +00:00
apnadkarni 456e957ebe Minor refactor 2026-05-25 09:47:13 +00:00
apnadkarni 88f91a837a zipfs also supports volume-relative paths and requires a separate check 2026-05-25 04:26:36 +00:00
apnadkarni ff5bc291c5 Bug [1215dca7] - inconsistent file join with volume relative arguments 2026-05-24 12:39:59 +00:00
apnadkarni 45ba8f09bf Update changes.md 2026-05-24 11:55:05 +00:00
apnadkarni 9642199be4 Forgot to update changes.md 2026-05-24 11:46:43 +00:00
apnadkarni c5651e2307 Windows: glob -dir $dir -tail returns name with leading / if $dir ends in a \ 2026-05-24 11:16:56 +00:00
apnadkarni b747c94ff8 Fix [c0f678f28c] - Crash in secondary interp on auto_path reinit 2026-05-24 08:47:02 +00:00
apnadkarni 35cdbe0233 Merge 9.0 - Fix [aa6e426437]. nmake shell install does not install shell on a clean build. The !if exist check happened BEFORE the build! and is unnecessary in any case. 2026-05-24 01:37:19 +00:00
apnadkarni 5fa067edf9 Fix [aa6e426437]. nmake shell install does not install shell on a clean build. The !if exist check happened BEFORE the build! and is unnecessary in any case. 2026-05-24 01:33:57 +00:00
apnadkarni 996fbecb44 Fix [c0f678f28c] - Crash in secondary interp on auto_path reinit 2026-05-24 00:10:59 +00:00
apnadkarni ce4f02fff2 Add test for [c0f678f28c] - Crash in secondary interp on auto_path reinit 2026-05-23 17:31:45 +00:00
apnadkarni 7804ffae10 Fix [e55a589d2b] - crash on finalization with another thread active. 2026-05-23 15:15:47 +00:00
apnadkarni 38d2451feb Priorize zipfs location of tcl_library if present 2026-05-23 14:39:48 +00:00
apnadkarni 147f70647a Create new branch named "bug-2a0966cd" 2026-05-23 13:42:28 +00:00
dkf 197226ffca Simplify things slightly in the [dict] and [for] compilers. 2026-05-23 11:21:47 +00:00
bch aa9b12534b PTHREAD_NULL is not _actually_ a valid pthread_t, and should not
be supplied as an argument to pthread_*() functions.

On NetBSD, Tcl was faulting at
  [PMutexDestroy()](/home/file?ci=e29c5206a97aa935207e1b21d33ca&name=unix/tclUnixThrd.c&ln=92)

in the assertion, which failed because PTHREAD_NULL is not actually
a valid thread identifier, did not satisfy the intention what was
trying to be asserted. pthread_t is an opaque type. On NetBSD (for
example) it is a structure, with magic for sanity checks.
"(pthread_t)0" does not pass this test when (e.g.) pthread_equal(t1,
t2) is called. I changed tests for PTHREAD_NULL to simple equality
checks (e.g. PTHREAD_NULL == pmutexPtr->thread), and guarded with
the same test pthread_*() calls where appropriate (those function
calls involving pmutexPtr->thread).
2026-05-23 02:16:41 +00:00
dgp 6210156aef merge 9.0 2026-05-22 16:31:07 +00:00
jan.nijtmans 08e6e3c75d finish 'apn-registry' work for gcc builds. And - as a bonus - for Cygwin too 2026-05-22 15:06:05 +00:00
jan.nijtmans c6aaf8950e Rebase to trunk 2026-05-22 11:02:33 +00:00
jan.nijtmans cd75864d03 Merge 9.0. Prepare for split-off 9.1 branch (not planned yet) 2026-05-22 10:34:35 +00:00
jan.nijtmans 1749ca7ab0 Whitespace changes 2026-05-22 10:26:55 +00:00
apnadkarni df5e66b219 Clarify unload docs as requested in Bug [b823e86fd2]. 2026-05-22 09:59:12 +00:00
jan.nijtmans b37de7b689 Don't build it any more in Github 2026-05-22 09:38:02 +00:00
jan.nijtmans 60744f6e1f Don't build it any more in Github 2026-05-22 09:34:37 +00:00
apnadkarni 086e536dcf Bug [e55a589d2b] - crash on finalization with another thread active. 2026-05-22 08:13:12 +00:00
apnadkarni 08ac206e05 Fix [006bef5d75] - Tcl cannot run from an arbitrary build directory with --disable-zipfs 2026-05-21 08:30:37 +00:00
apnadkarni 9b2a7343ba Merge 9.0 - Fix [b492c33154] - info exists env(xxx) and set env(xxx) are inconsistent after setting to empty string 2026-05-21 08:10:56 +00:00
apnadkarni caee54eda6 Fix [b492c33154] - info exists env(xxx) and set env(xxx) are inconsistent after setting to empty string 2026-05-21 08:07:56 +00:00
apnadkarni cb5ac9be56 Fix [596936dd2d] - auto_execok picks up non-executable files without extensions 2026-05-21 06:54:04 +00:00
apnadkarni a390f3d426 Really no need to change pkgconfig. Revert. 2026-05-21 05:05:29 +00:00
apnadkarni e2edae1809 Only use library from source tree if running in build tree 2026-05-21 03:02:15 +00:00
apnadkarni 04dee3b51f Update nmake and mingw builds 2026-05-21 01:12:21 +00:00
apnadkarni e6cfbab12a Proposed fix for [006bef5d75] on Unix. MingW and nmake pending. 2026-05-20 17:03:36 +00:00
apnadkarni 2eb2d837ae Bug [b492c33154] - info exists env(xxx) and set env(xxx) are inconsistent after setting to empty string on Windows 2026-05-20 08:02:31 +00:00
apnadkarni dbfecab127 Add coro test 2026-05-20 02:25:38 +00:00
apnadkarni e09d68e1e0 Handle and test interp deletion within callbacks 2026-05-19 16:58:38 +00:00
jan.nijtmans bb29ed5240 Update to Unicode 18.0.0 (draft) 2026-05-19 08:25:35 +00:00
dgp 70d263f6a1 merge 9.0 2026-05-18 18:48:36 +00:00
dkf 989049bb15 Fix spacing around array references 2026-05-18 16:17:03 +00:00
apnadkarni 77972707a1 9.0 merge mark 2026-05-18 15:40:51 +00:00
apnadkarni 0cc3ebdf1f Fix missing win constraint when package requiring registry 2026-05-18 15:39:36 +00:00
apnadkarni 9a8c8c142c TIP 753 final 2026-05-18 09:22:29 +00:00
apnadkarni 7960cd2ab7 Update TIP 755 related manpages 2026-05-18 08:04:08 +00:00
apnadkarni 6d8a11ed0e Merge main 2026-05-18 06:10:32 +00:00
apnadkarni 05a44998e8 Update exec.n for TIP 753 2026-05-18 05:40:40 +00:00
apnadkarni 94043164f9 Update auto_execok docs for TIP 753 2026-05-18 04:39:13 +00:00
apnadkarni da1bdaea2c Merge main 2026-05-18 01:49:10 +00:00
apnadkarni e89470dfe1 Free post-initialization memory in thread and process finalization. Clean test and valgrind. 2026-05-17 17:43:47 +00:00
dkf c9047acb43 More indentation/spacing corrections; no behaviour changes 2026-05-17 15:06:26 +00:00
apnadkarni 84b23291b0 9.0 merge mark 2026-05-16 15:57:00 +00:00
apnadkarni ef184c951b Fix [6094de399d] and [4f06d7ca08] - registry/dde packages in static builds. 2026-05-16 15:54:26 +00:00
apnadkarni b49c1403ff Merge trunk 2026-05-16 13:38:13 +00:00
apnadkarni 985ff2e1e0 Add tests and fixes for recursion, safe interps 2026-05-16 11:43:22 +00:00
apnadkarni c882e57c3c More tests 2026-05-16 03:25:47 +00:00
apnadkarni edf90ee2df Add Tcl_ClearPostInitProcs, start on tests 2026-05-15 17:30:35 +00:00
dkf fb14459371 Fix some indents 2026-05-15 11:10:15 +00:00
apnadkarni 535b232162 Test scaffolding 2026-05-15 10:54:24 +00:00
apnadkarni 0b6a0080db Update changes 2026-05-15 05:09:33 +00:00
apnadkarni d64c791358 Merge 9.0 2026-05-15 05:04:05 +00:00
apnadkarni f39a8df9f1 Add Tcl_UnregisterPostInitProc to stubs 2026-05-15 05:01:29 +00:00
apnadkarni a188aa369a Add Tcl_UnregisterPostInitProc 2026-05-15 04:42:23 +00:00
apnadkarni 8712d43327 Support multiple callback registrations. Multithread safe 2026-05-14 16:13:54 +00:00
dgp 99aade1a7b Open release branch for 9.0.4 2026-05-13 18:04:24 +00:00
apnadkarni b30c2b5242 Oops - update Windows tcltest too 2026-05-12 16:09:23 +00:00
apnadkarni 9479d47001 Update tclTest to use postinit registration 2026-05-12 16:08:29 +00:00
apnadkarni f5a59feb83 Update dde pkgindex and makefile.vc for static builds. Add basic test 2026-05-12 15:30:57 +00:00
dgp eeacbf07ed merge release 2026-05-12 15:30:29 +00:00
apnadkarni 65f5c731b0 Tcl_RegisterPostInitProc skeleton 2026-05-12 14:20:51 +00:00
dkf e98afcd1f0 Add some missing doc comments 2026-05-11 11:26:52 +00:00
apnadkarni f0a346f20c Create new branch named "bug-4f06d7ca-91" 2026-05-11 11:21:35 +00:00
apnadkarni 350e1c913f Merge 9.0 - Update vctool to accept TESTPAT parameter 2026-05-11 06:36:34 +00:00
apnadkarni 614ce62d6f Update vctool to accept TESTPAT parameter 2026-05-11 06:35:17 +00:00
apnadkarni 1e4518dd67 Disable registry and dde pkgIndex commands for static builds 2026-05-10 07:48:34 +00:00
apnadkarni aff1f5cea1 Further tweaks - also fixes [6094de39] as a side effect 2026-05-10 05:52:56 +00:00
apnadkarni 3b0645c84b Bug 4f06d7ca - package require of static packages in secondary interps 2026-05-09 17:14:32 +00:00
dgp 515167c897 Untested attempt to silence compiler warning 2026-05-08 17:31:15 +00:00
dgp 88f30c06aa Fixes for several problems reported with the RC0 candidate. 2026-05-07 19:00:34 +00:00
dkf 7c026680a9 Write constraint correctly 2026-05-07 08:48:10 +00:00
apnadkarni dc6dc70a96 Merge main 2026-05-07 08:10:48 +00:00
apnadkarni 581e09539b Add test for caching on Unix 2026-05-07 06:40:54 +00:00
apnadkarni 18831a7d07 Tests for App Exe aliases, App Paths and PATHEXT (wscript) 2026-05-07 06:07:35 +00:00
apnadkarni bb546ea967 One more set of tests 2026-05-07 03:49:24 +00:00
PHILB 300e6831bb Fix NMAKEHLP_NATIVE failures for Tk test-classic runs 2026-05-06 23:00:58 +00:00
apnadkarni 3ead868089 A few more tests 2026-05-06 16:59:33 +00:00
apnadkarni fda5ce7bce Start on auto_execok tests 2026-05-06 13:48:05 +00:00
apnadkarni 400eb47abf Match auto_execok search path with exec's 2026-05-06 03:14:11 +00:00
dkf eb8decb1b2 A better way of testing: a custom match mode 2026-05-05 19:26:10 +00:00
apnadkarni afdd1f2b01 Add test for explicit cwd in PATH 2026-05-05 16:30:26 +00:00
dkf 94fafde08e Add some rounding to tests; C implementations of functions can be 1ULP out 2026-05-05 15:53:12 +00:00
apnadkarni c536201543 Relative paths not searched in PATH. Obey Windows w.r.t current directory inclusion 2026-05-05 15:47:53 +00:00
dkf 667dd92e2d Update list of referenced pages 2026-05-05 08:56:11 +00:00
dkf 22bcf8b34c Sort the functions in the documentation. 2026-05-04 16:55:00 +00:00
dkf f25256fbdb Docfix: gamma(), not tgamma() 2026-05-04 16:47:50 +00:00
dkf 552f6132ab Whoops; my bad 2026-05-04 15:07:52 +00:00
dkf 4d85a2847a Updated changes 2026-05-04 13:36:09 +00:00
dkf 3b732aa070 Implement TIP 735: Simpler List Filtering 2026-05-04 13:19:49 +00:00
dkf bd23eeff52 Implement TIP 745: Functions from C99 2026-05-04 13:16:17 +00:00
dkf 11725fca61 Slightly better way of writing an error path 2026-05-04 07:48:18 +00:00
apnadkarni fa4025b7c4 Merge trunk. Mostly whitespace and indentation 2026-05-04 06:19:54 +00:00
dkf ea4b079432 Use OutOfUintRange() more widely. 2026-05-03 16:31:46 +00:00
dkf 6595f9e21e Fix an argument indent 2026-05-02 13:43:09 +00:00
apnadkarni f7592862bd Fix 32-bit failures introduced in [5a2d03a86e] 2026-05-02 06:38:00 +00:00
apnadkarni 8b95bc2b7a Merge 9.0 2026-05-02 04:32:56 +00:00
apnadkarni 0a33aaf3c3 Merge 8.6 2026-05-02 04:10:38 +00:00
apnadkarni 8fac59dc54 Fix test exec-bug-4f0b5767ac: Ensure winget is on PATH and test result does not assume English 2026-05-02 03:29:16 +00:00
jan.nijtmans 22a6d59d28 Update changes 2026-05-01 19:41:04 +00:00
jan.nijtmans b47003e7f2 Fix warning: ISO C90 forbids mixed declarations and code 2026-05-01 16:07:09 +00:00
dgp baaab26d44 update changes 2026-04-30 16:53:03 +00:00
dgp e66c60bd35 merge 8.6 2026-04-30 16:20:37 +00:00
dkf 1487ca01b8 Fix [1615c80638] by moving problem comparisons to common helper function 2026-04-30 16:04:22 +00:00
dkf 4c88b98427 Fix formatting of function-level comments 2026-04-30 14:52:57 +00:00
jan.nijtmans 374ef0ac72 tzdata updated to Olson's tzdata2026b 2026-04-28 07:30:39 +00:00
jan.nijtmans 40aa2c5dc5 tzdata updated to Olson's tzdata2026b 2026-04-28 07:27:00 +00:00
jan.nijtmans cbc6434d64 tzdata updated to Olson's tzdata2026b 2026-04-28 07:24:18 +00:00
apnadkarni 6ec5334ee9 Support for App Paths on Windows 2026-04-28 06:31:53 +00:00
apnadkarni 02e19998cf Eliminate auto_execs cache 2026-04-28 06:02:49 +00:00
apnadkarni 5df8f72184 Only check built-ins if no directories in file name 2026-04-28 05:56:37 +00:00
apnadkarni aa24a262a2 Fix multiple PATH appends. 2026-04-28 05:54:31 +00:00
dkf 4c6719cb50 More indentation corrections 2026-04-27 20:02:22 +00:00
dkf e8341b3f5e Fix some indentation errors 2026-04-27 18:22:22 +00:00
apnadkarni e9780f7e31 Start on [4fae07ea8a]. Process Windows PATHEXT correctly 2026-04-27 17:35:43 +00:00
apnadkarni d48d00ba7d Check directory of current program first when searching for an executable 2026-04-27 05:16:59 +00:00
apnadkarni d8631c27f6 Merge main 2026-04-26 16:50:55 +00:00
dkf 1ac87ecbe9 Remove unnecessary blank lines 2026-04-26 16:46:16 +00:00
apnadkarni 0b34b5a938 Skip Dll's as executables. Also add test for PE to file executable 2026-04-26 16:41:20 +00:00
apnadkarni 5f86cefb00 Add bugfix bca391ab51 to changes.md 2026-04-26 16:19:13 +00:00
apnadkarni 95de857e1f Done with exec 2026-04-26 11:35:07 +00:00
dkf 3a30430481 merge trunk 2026-04-26 10:35:40 +00:00
dkf 23bf708be7 Fix another case problem caused by Windows 2026-04-26 10:32:46 +00:00
dkf 41a0edcadc merge trunk 2026-04-26 10:27:18 +00:00
apnadkarni 8d39466b31 Added TclWinPathReset 2026-04-26 04:33:48 +00:00
PHILB 0496929129 Sync win/rules-ext.vc and win/rules.vc up with other projects; remove debug messages. 2026-04-26 03:55:13 +00:00
PHILB a3b9a1d59a Sync win/rules-ext.vc and win/rules.vc up with other projects; remove debug messages. 2026-04-26 03:53:20 +00:00
dkf 00ffe41f03 A few more tweaks 2026-04-25 19:49:47 +00:00
dkf c44f7fc712 Avoid variable aliasing 2026-04-25 19:44:25 +00:00
dkf 75c02f70c5 Some tweaks 2026-04-25 19:33:09 +00:00
apnadkarni 053ee60033 Fix Windows dir order in path lookup 2026-04-25 17:46:50 +00:00
apnadkarni 3a06769440 Add test cases for existing 9.0 functionality 2026-04-25 14:27:59 +00:00
jan.nijtmans c536ed5ea8 Test everything on windows-2025-vs2026 image 2026-04-24 15:33:28 +00:00
apnadkarni 93cc105c62 Merge main 2026-04-24 09:18:01 +00:00
apnadkarni 52a05837b5 Add command tcl::registry, move registry module into core dll. 2026-04-24 09:17:20 +00:00
apnadkarni 6b9b395ce2 Update documentation for tcl::registry 2026-04-24 07:55:18 +00:00
apnadkarni a51e7f4e52 Refactor ApplicationType 2026-04-24 07:42:22 +00:00
apnadkarni b2536709e2 Bug [596936dd2d] - exec PATH search should select earlier directories irrespective of extension 2026-04-23 18:14:09 +00:00
apnadkarni 756ed8d443 Fix memory leak in AppendEnvironment (long path related changes, 9.1 only) 2026-04-23 16:25:35 +00:00
apnadkarni cd47aaefbd Fix make dist. nmakehlp.exe no longer exists 2026-04-23 10:03:13 +00:00
PHILB 59367dba5f merge forked branch 2026-04-22 18:10:15 +00:00
apnadkarni 456ae66294 Make AppendSystemError non-static (TclWinAppendSystemError) 2026-04-22 12:06:18 +00:00
apnadkarni 400553abfd Merge mark 2026-04-22 11:10:59 +00:00
apnadkarni ee04bcd1d0 Merge mark 2026-04-22 11:09:50 +00:00
apnadkarni 1297436e38 Fix [24d7f1a6] - crash on proc definition in namespace being deleted 2026-04-22 11:05:41 +00:00
apnadkarni 4a9723bf58 Merge 9.0 - Fix [24d7f1a6] - crash on proc definition in namespace being deleted 2026-04-22 10:27:29 +00:00
apnadkarni 78c412d6e1 Fix [24d7f1a6] - crash on proc definition in namespace being deleted 2026-04-22 10:15:29 +00:00
dkf 0d9cfae66b merge trunk 2026-04-22 07:48:45 +00:00
apnadkarni 0b678b1316 Regenerate configure for registry changes. Add tcl::registry test 2026-04-22 07:04:31 +00:00
apnadkarni 4f9a2f3ad5 Move registry module into main dll 2026-04-22 06:32:54 +00:00
dkf 1e1e528e93 merge trunk 2026-04-21 16:24:56 +00:00
jan.nijtmans f73836a6c8 Rebase to trunk 2026-04-21 13:22:32 +00:00
apnadkarni fda01d8dd4 Fix crash on proc definition in namespace being deleted 2026-04-21 11:00:22 +00:00
jan.nijtmans b720c3cdd7 Merge-mark 2026-04-21 06:22:40 +00:00
jan.nijtmans 744a0be143 Fix [60d8692823]: Tcl_Eval macro references TCL_INDEX_NONE which is not always defined. Was introduced [7c1522f896ca3a60|here] 2026-04-21 06:20:56 +00:00
PHILB ac2c2356af Remove x86_64-w64-mingw32-nmakehlp.exe. In its place, use the NMAKEHLP_NATIVE variable to find an nmakehlp.exe
during cross compilation. Add find_nmakehlp.tcl to deduce NMAKEHLP_NATIVE from TCLSH_NATIVE.
Increase MINOR version of rules.vc to 17.
2026-04-21 04:19:01 +00:00
PHILB 6996f4631e Remove x86_64-w64-mingw32-nmakehlp.exe. In its place, use the NMAKEHLP_NATIVE variable to find an nmakehlp.exe
during cross compilation. 
Add find_nmakehlp.tcl to deduce NMAKEHLP_NATIVE from TCLSH_NATIVE when that is set.
Change MINOR rev for rules.vc to 17
2026-04-21 04:03:31 +00:00
jan.nijtmans 1215f94f59 Bump burnett01/rsync-deployments from 8.0.4 to 8.0.5 2026-04-20 20:45:13 +00:00
jan.nijtmans a7ca4b2046 Bump burnett01/rsync-deployments from 8.0.4 to 8.0.5 2026-04-20 20:35:57 +00:00
jan.nijtmans a3a821a3c5 Remove unneeded undef 2026-04-20 13:22:50 +00:00
jan.nijtmans 745997c0c5 Merge 8.6 2026-04-20 13:09:16 +00:00
jan.nijtmans 5dad98f452 Make pkg*.c files work with Tcl 9.0 (as useful example) 2026-04-20 13:01:12 +00:00
jan.nijtmans c8bae31f7c Follow-up to [ad08bca6b1] fix: unbreak Thread build with Tcl 8 headers (user: jan.nijtmans) 2026-04-20 11:59:12 +00:00
jan.nijtmans b9ba515a7c Merge-mark 2026-04-19 20:05:20 +00:00
jan.nijtmans c76b35864c Follow-up to [ad08bca6b1] fix: unbreak Itcl build with Tcl 8 headers 2026-04-19 19:46:16 +00:00
apnadkarni 54a25d27bb Minor edits - remove obsolete info from Windows README 2026-04-19 03:49:01 +00:00
dgp 54b5a4b2de Open release branch for Tcl 8.6.18 2026-04-17 18:52:17 +00:00
dgp c95d22db52 merge 9.0 2026-04-17 18:48:29 +00:00
dgp 4ff46cad9f Merge doc updates from 8.6 branch 2026-04-17 18:46:58 +00:00
dgp 87aeb56b90 Eliminate pre-8.5 practices from examples. 2026-04-17 18:34:26 +00:00
dgp 5da8b3e5b4 Code and comments have moved away from "channel ID" and just refer to "channel". Make the docs agree. 2026-04-17 17:39:11 +00:00
dgp 236ad42650 sync the documentation for tcltest 2.5.11 as well. 2026-04-17 17:36:20 +00:00
jan.nijtmans 88d217ecde Follow-up to [e6ca0b1b67]: Cygwin filesystem is case-insensitive as well 2026-04-17 15:41:40 +00:00
apnadkarni 20213800ab Merge 9.0 - Fix [e2698b94b1]. Tcl_FSChdir crash on macos/macports after seteuid 2026-04-17 11:08:20 +00:00
apnadkarni 55ff115bf7 Fix [e2698b94b1]. Tcl_FSChdir crash on macos/macports after seteuid 2026-04-17 10:45:10 +00:00
jan.nijtmans a6a276ade4 Merge-mark 2026-04-17 10:35:32 +00:00
jan.nijtmans d6e712548f Code cleanup (from Tcl 9.1) 2026-04-17 10:34:45 +00:00
jan.nijtmans 5b2c30ec48 Fix compiler warning, seen with latest clang: variable 'p' is uninitialized when passed as a const pointer argument 2026-04-17 10:22:21 +00:00
apnadkarni 038e69248a Start on [e2698b94b1]. Tcl_FSChdir crash on macos after seteuid 2026-04-17 04:04:15 +00:00
jan.nijtmans c248ef79a3 Adapt tcltest to support up to Tcl 9.1 -> 2.5.11 2026-04-16 19:16:31 +00:00
jan.nijtmans 3d337b9d90 Adapt tcltest to support up to Tcl 9.1 -> 2.5.11 2026-04-16 19:09:51 +00:00
jan.nijtmans 99733e49e6 Adapt tcltest to support up to Tcl 9.1 -> 2.5.11 2026-04-16 18:57:23 +00:00
jan.nijtmans 15c054287d Merge-mark 2026-04-16 12:00:33 +00:00
jan.nijtmans 72aa5a8ab0 Fix building unix/dltest for Tcl 8 2026-04-16 11:55:18 +00:00
jan.nijtmans 26012eaea3 Follow-up from previous commit: Since 'configure' is generated from 'tcl.m4', the actual change should have been done in tcl.m4. 2026-04-15 08:54:48 +00:00
jan.nijtmans fe30225b27 Fix [ad08bca6b1]: Building sqlite3 for tcl8 redefines typedef 2026-04-15 08:29:46 +00:00
PHILB 72e5157731 MacOS GNUmakefile fix to avoid failing hard link creation on Samba filesystem.
unix configure fix to check the version of NATIVE_TCLSH is 8.6 or better.
2026-04-14 23:17:27 +00:00
apnadkarni 11f0dc0d35 Don't auto-exec reg.exe on non-Windows! 2026-04-14 17:36:20 +00:00
apnadkarni 7e0bf522ae Bug [e6ca0b1b67]. MacOS paths should be case insensitive + macos file
normalization fix + macos glob inconsistency fix.
2026-04-14 17:05:55 +00:00
apnadkarni 6a16b0fed6 Minor comment update. 2026-04-14 09:52:39 +00:00
apnadkarni a256b088ae Fix [275db3d985] - memory leak in DecodeZipEntryText 2026-04-14 08:19:18 +00:00
apnadkarni 6b16232799 Merge 9.0 - As per TIP 542, Tcl_UniChar{CaseMatch,Ncmp,Ncasecmp} are not present in Tcl 9 2026-04-14 05:48:26 +00:00
apnadkarni dcc539d07b As per TIP 542, Tcl_UniChar{CaseMatch,Ncmp,Ncasecmp} are not present in Tcl 9 2026-04-14 05:46:56 +00:00
apnadkarni e34bff0d59 Merge main 2026-04-14 02:20:41 +00:00
PHILB 23c4d359fc Remove x86_64-w64-mingw32-nmakehlp.exe.
In its place, use the NMAKEHLP_NATIVE variable to find an nmakehlp.exe
during cross compilation. 
Add find_nmakehlp.tcl to deduce NMAKEHLP_NATIVE from TCLSH_NATIVE
when that is set.
Remove debug message.
2026-04-13 18:49:37 +00:00
PHILB 8da70fe28f Remove x86_64-w64-mingw32-nmakehlp.exe.
In its place, use the NMAKEHLP_NATIVE variable to find an nmakehlp.exe during cross compilation.
Add find_nmakehlp.tcl to deduce NMAKEHLP_NATIVE from TCLSH_NATIVE when that is set.
2026-04-13 18:37:47 +00:00
apnadkarni 4367127bcc Fix for [275db3d985] - memory leak in DecodeZipEntryText 2026-04-13 17:52:00 +00:00
jan.nijtmans a4af5fe19c Fix [4724f35ada]: Avoid ClockClientData typedef redefinition 2026-04-13 16:43:30 +00:00
jan.nijtmans cdb8ed4f05 Fix [4724f35ada]: Avoid ClockClientData typedef redefinition 2026-04-13 16:42:19 +00:00
jan.nijtmans 02b5f37b12 Update changes.md 2026-04-13 16:20:43 +00:00
apnadkarni 10fa8c7db0 Create new branch named "bug-275db3d985" 2026-04-13 09:58:44 +00:00
PHILB c7b5b79e22 Remove x86_64-w64-mingw32-nmakehlp.exe.
In its place, use the NMAKEHLP_NATIVE variable to find an nmakehlp.exe
during cross compilation.
2026-04-12 21:42:34 +00:00
dkf c0fac7a05d Match trunk filename capitalisation. 2026-04-11 21:18:15 +00:00
dkf 856ab09c0f merge trunk 2026-04-11 20:52:12 +00:00
PHILB dde4374b8a Create new branch named "pbrooks-nmakehlp-exe-removal" 2026-04-11 18:01:33 +00:00
dkf 600c126291 Match trunk filename capitalisation.
"Thanks", Windows...
2026-04-11 16:17:39 +00:00
dkf 59af3eaffb merge trunk 2026-04-11 16:10:38 +00:00
apnadkarni c5f35a4a62 Remove outdated information from README 2026-04-11 05:52:09 +00:00
PHILB 87279bab94 Create new branch named "pbrooks-nmakehlp-exe-removal" 2026-04-10 22:39:10 +00:00
apnadkarni 042945d4e1 Merge main 2026-04-10 09:02:30 +00:00
apnadkarni 92fa6b523c Update changelog 2026-04-10 05:20:49 +00:00
apnadkarni d06068d382 Clean up comments. 2026-04-10 03:46:59 +00:00
apnadkarni 6f435108b6 More case-sensitivity related tests for file normalize 2026-04-10 01:58:21 +00:00
apnadkarni 0d77fecbbf macos file normalize fixes 2026-04-09 10:00:38 +00:00
jan.nijtmans a0cfc39f55 Merge 9.0. http -> 2.10.2 2026-04-09 09:46:41 +00:00
jan.nijtmans ca45948edb (cherry-pick): Shorten sequences of multiple blank lines. http -> 2.10.2 2026-04-09 09:38:49 +00:00
jan.nijtmans 3c4addfeca There is no Tcl 8.7 2026-04-09 08:50:06 +00:00
jan.nijtmans dcb68f8a5a Formatting 2026-04-08 12:13:41 +00:00
jan.nijtmans b888f4bb89 Rebase to trunk. Remove TCL_NO_DEPRECATED usage 2026-04-08 11:29:02 +00:00
jan.nijtmans 19cfdd45da Simplifications, using TclpGetMicroseconds() 2026-04-08 10:20:37 +00:00
dkf ebdf9d98b6 Improvements to style 2026-04-07 20:21:00 +00:00
jan.nijtmans af4d79b6f9 indenting 2026-04-07 13:14:05 +00:00
apnadkarni 3e13096feb Merge main 2026-04-05 17:11:58 +00:00
apnadkarni d592e1c6f7 On-demand GH action workflow with runtime customization 2026-04-05 17:10:52 +00:00
apnadkarni bf740809ad Sigh. Typo in constraint. 2026-04-03 15:04:35 +00:00
jan.nijtmans 9a09665545 Add changes entry for bison update 2026-04-02 19:15:28 +00:00
apnadkarni 8119335e81 Enable bug tests for macos 2026-04-02 11:56:33 +00:00
apnadkarni d445c1dd75 Change case sensitivity on macos. Expected to generate test failures 2026-04-02 05:52:47 +00:00
sebres f29b982205 cherry-picked from 9.0, fixes [51aa53616067cb63]: free scan - fixed hours only TZ (±1 or ±01); adjust clock tests (runable without tzdata with system TZs only, also using -constraints clock-no-tzdata);
optimized numeric zone detection; resolve dozen conflicts (bison/yacc only left 5 shift/reduce and no reduce/reduce conflicts anymore).
2026-03-09 12:38:56 +00:00
sebres fb945046bd merge 8.6: amend to [2c237beffbace823] fixing generation of TZ name from offset by %z artificial name in data; update to tzdata 2026a; fixes test coverage (TZ generated from offset by artificial %z token in IANA TZ database) 2026-03-04 00:26:47 +00:00
sebres a60846a449 closes [96e5c814eb9ed955]: fixes sanitizer RTM-error signed integer overflow (no-trapv pragma also removed now), optimizing code, deduplication 2026-01-18 01:43:57 +00:00
dkf 18aef20d79 merge trunk 2026-01-05 15:24:18 +00:00
dkf 763d92a2ec Add divmod as well, to complete the set 2026-01-05 15:06:39 +00:00
dkf 070c43dd20 Slightly better comments in test file 2026-01-05 11:47:32 +00:00
jan.nijtmans 8a1db380a2 Minor testcase fix 2026-01-03 18:31:35 +00:00
dkf 49f6d42364 merge trunk 2026-01-03 16:01:22 +00:00
dkf 7584d63cfe add logb and remquo 2026-01-03 15:54:04 +00:00
dkf a84e34240d Improve arg count tests 2026-01-02 21:44:22 +00:00
dkf 763a5bf2e0 Add some tests for the new funcs 2026-01-02 15:58:35 +00:00
dkf aefd096d51 Stupid specification stupidity, and rename tgamma to gamma (after reading why the name is what it is) 2026-01-01 16:15:54 +00:00
dkf 14d8e78333 Added modf as a command 2026-01-01 15:27:23 +00:00
dkf 7d3a4cf418 Add frexp, as a command because it returns two things really 2025-12-31 16:03:59 +00:00
dkf b5706604db More functions 2025-12-31 08:48:09 +00:00
dkf c1afb2bf14 Added trunc() 2025-12-30 15:01:05 +00:00
dkf 67bee097dd Fix tests 2025-12-29 21:41:06 +00:00
dkf 267b3bbd8a Added documentation for new functions 2025-12-29 17:08:17 +00:00
dkf 755ff2f5a0 Some more functions 2025-12-29 15:46:35 +00:00
dkf 3ebf79647a More functions from the set available in C11 2025-12-29 15:23:31 +00:00
dkf 2b772a3fad merge trunk 2025-12-28 16:26:11 +00:00
dkf 4ef9f71b24 Update docs 2025-12-28 12:37:51 +00:00
dkf 781608aebf Tinkering with making the interpreted [lfilter] better 2025-12-28 12:26:37 +00:00
dkf 99f499aa5d Fix things to work as the TIP now specifies 2025-12-28 11:47:53 +00:00
dkf 7077ca618c Mark the places in need of fixing to match the TIP 2025-12-27 17:56:20 +00:00
dkf 95115b924a merge trunk 2025-12-27 16:28:39 +00:00
dkf e130e456c7 merge trunk 2025-12-26 16:06:00 +00:00
dkf 7c28821305 merge trunk 2025-12-23 14:06:44 +00:00
sebres fb44d9a8d8 fixes validation bug [2a1d947d8c13506d] - update gregorian flag during validation, before checking day in leap year, so consider julian-gregorian transition correctly (old logic for leap year without y/100 and y/400);
cherry-picked from [309b28d3f5335753]
2025-11-17 16:46:25 +00:00
dkf 703e94dd1f merge trunk 2025-11-14 11:57:56 +00:00
dkf 0c0a16cd0c Added docs 2025-11-13 15:46:07 +00:00
dkf 02bd0c8b01 Add tests 2025-11-13 15:09:48 +00:00
dkf 0c18669c7f Tidy up 2025-11-13 15:06:26 +00:00
dkf f6c8ffca89 merge trunk 2025-11-12 11:31:47 +00:00
dkf de0bbd0be4 Fix some bugs in the code generation and execution 2025-11-12 11:01:21 +00:00
dkf 541f81d7a6 merge trunk 2025-11-11 20:27:04 +00:00
dkf ac1b05952a Switch to using a new instruction to get the list index 2025-11-11 15:38:04 +00:00
dkf e59c343278 Compile [lfilter]; this is currently slightly wrong, but works if traces are ignored 2025-11-05 11:38:01 +00:00
dkf 18e7acb361 Start of implementation of [lfilter] 2025-11-03 09:53:36 +00:00
sebres dcb3cc310f (cherry-picked from 9.0) fixes [5137b4387019d0e1]: ensure cache of base is correct for :localtime (system TZ) if TZ-env changing, especially if there is no registry;
clock.test: several tests rewritten as locale, timezone, environment (TZ, TCL_TZ) and also registry independent, also improved several setups/cleanups and usage of test-own registry - there are also no test failures by `-singleproc 1` anymore in clock.test;
2025-08-04 16:02:46 +00:00
sebres 5d19c0b7ad cherry-pick from 9.0: improve interpreter creation speed, if there is no zipfs tcl-library (avoid performance penalty [62019f8aa9f5ec73]) 2025-07-22 18:49:59 +00:00
sebres a0a9b6dcfe cherry-pick to 8.7: amend to [61c01e0edb08a9ed], more cases for increment ref-count with use-after-free prevention for interim normalized path object; provide fixes minimally invasive (if API used with fresh created path object, so decrement would not destroy it if normalized path equal original given path) 2025-07-21 18:46:20 +00:00
sebres a3d0c99f90 cherry-pick to 8.7: fixes [61c01e0edb08a9ed] (TclpMatchInDirectory, windows only), increment ref-count to avoid use-after-free for interim normalized path object, what may cause crash (SF/BO), usage of wrong path, etc. 2025-07-18 17:36:53 +00:00
332 changed files with 30629 additions and 15871 deletions
+250
View File
@@ -0,0 +1,250 @@
# This workflow is meant for development use and run only on demand.
# It is customizable to select
# - Platforms
# - Toolchains
# - Branches (no need for core-* prefixes)
# - Tests
# To run the workflow, select "Custom" on the left side in the GH Actions
# page. Then click the Run workflow button on the right. This will display
# a dropdown that allows customization as above.
#
# To run the workflow, you need to have permissions to the repository.
# The simplest way is to clone the Tcl mirror on Github. However, that means
# if you work in fossil, you have a potential 24-hour wait before the mirror
# updates, which apart from nostalgia about the punched card batch processing
# era, is not so convenient. My preference instead is to mirror the fossil
# repository to Github via a local checkout on my system, do the work there
# pushing to github and running this workflow to verify across platforms
# and then committing back to the master fossil repository.
#
# Improvements to the workflow welcome.
name: Custom
on:
workflow_dispatch:
inputs:
platform:
description: 'Target platform(s)")'
required: true
default: 'all'
type: choice
options:
- all
- windows
- linux
- macos
windows_toolchains:
description: 'Windows toolchain'
required: true
type: choice
options:
- '["nmake", "msys"]'
- '["nmake"]'
- '["msys"]'
default: '["nmake"]'
windows_architectures:
description: 'Architecture (Windows Nmake only)'
required: true
type: choice
options:
- '["x64"]'
- '["x86"]'
- '["x64", "x86"]'
default: '["x64"]'
linux_compiler:
description: 'Linux compiler'
required: true
default: 'gcc'
type: choice
options:
- gcc
- clang
run_tests:
description: 'Run tests'
required: false
default: true
type: boolean
test_flags:
description: 'TESTFLAGS'
required: false
default: ''
jobs:
windows:
if: ${{ github.event.inputs.platform == 'windows' || github.event.inputs.platform == 'all' }}
runs-on: windows-2025-vs2026
strategy:
matrix:
arch: ${{ fromJSON(github.event.inputs.windows_architectures) }}
toolchain: ${{ fromJSON(github.event.inputs.windows_toolchains) }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ github.ref }}
# Nmake builds
- name: Setup MSVC (for nmake)
if: ${{ matrix.toolchain == 'nmake' }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Build with nmake (Visual C++)
if: ${{ matrix.toolchain == 'nmake' }}
shell: cmd
env:
ERROR_ON_FAILURES: 1
working-directory: win
run: |
nmake /s /f makefile.vc
- name: Tests with nmake (Visual C++)
if: ${{ matrix.toolchain == 'nmake' && inputs.run_tests != 'false' }}
shell: cmd
env:
ERROR_ON_FAILURES: 1
TESTFLAGS: ${{ github.event.inputs.test_flags }}
working-directory: win
run: |
echo TESTFLAGS=%TESTFLAGS%
nmake /s /f makefile.vc test
# Msys builds
- name: Set up msys2 (x64)
if: ${{ matrix.toolchain == 'msys' && matrix.arch == 'x64'}}
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
pacboy: "git: make: gcc:p"
path-type: minimal
release: true
update: false
cache: true
- name: Set up msys2 (x86)
if: ${{ matrix.toolchain == 'msys' && matrix.arch == 'x86'}}
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
pacboy: "git: make: gcc:p"
path-type: minimal
release: true
update: false
cache: true
- name: Verify toolchain
if: ${{ matrix.toolchain == 'msys' }}
shell: bash -l {0}
run: |
gcc -v
make -v
- name: Configure with MSYS
if: ${{ matrix.toolchain == 'msys' }}
env:
ERROR_ON_FAILURES: 1
working-directory: win
shell: msys2 {0}
run: |
mkdir build
cd build
../configure
- name: Compile with MSYS
if: ${{ matrix.toolchain == 'msys' }}
env:
ERROR_ON_FAILURES: 1
shell: msys2 {0}
working-directory: win\build
run: |
file ../../libtommath/win32/tommath.lib
make -s
- name: Tests with MSYS
if: ${{ matrix.toolchain == 'msys' && inputs.run_tests != 'false' }}
env:
ERROR_ON_FAILURES: 1
TESTFLAGS: ${{ github.event.inputs.test_flags }}
working-directory: win\build
shell: msys2 {0}
run: |
echo TESTFLAGS=$TESTFLAGS
make -s test
linux:
if: ${{ github.event.inputs.platform == 'linux' || github.event.inputs.platform == 'all' }}
runs-on: ubuntu-26.04
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Configure with ${{ github.event.inputs.linux_compiler }}
env:
ERROR_ON_FAILURES: 1
CC: ${{ github.event.inputs.linux_compiler }}
working-directory: unix
run: |
mkdir build
cd build
echo CC=$CC
../configure || (cat config.log && exit 1)
- name: Compile
working-directory: unix/build
run: |
make -s
- name: Run tests
if: ${{ inputs.run_tests != 'false' }}
env:
ERROR_ON_FAILURES: 1
TESTFLAGS: ${{ github.event.inputs.test_flags }}
working-directory: unix/build
run: |
echo TESTFLAGS=$TESTFLAGS
make -s test
macos:
if: ${{ github.event.inputs.platform == 'macos' || github.event.inputs.platform == 'all' }}
runs-on: macos-26
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Configure
env:
ERROR_ON_FAILURES: 1
working-directory: unix
run: |
mkdir build
cd build
../configure --enable-framework || (cat config.log && exit 1)
make -s
- name: Compile
working-directory: unix/build
run: |
make -s
- name: Run tests
if: ${{ inputs.run_tests != 'false' }}
env:
ERROR_ON_FAILURES: 1
TESTFLAGS: ${{ github.event.inputs.test_flags }}
working-directory: unix/build
run: |
echo TESTFLAGS=$TESTFLAGS
make -s test
+7 -5
View File
@@ -3,14 +3,15 @@ on:
push:
branches:
- "main"
- "core-9-0-branch"
- "core-9-1-branch"
tags:
- "core-*"
workflow_dispatch:
permissions:
contents: read
jobs:
plan:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04
outputs:
gcc: ${{ steps.matrix.outputs.gcc }}
steps:
@@ -21,7 +22,7 @@ jobs:
echo gcc=$(jq -nc '{config: (if env.IsMatched == "true" then env.FULL else env.PARTIAL end) | fromjson }' )
) | tee -a $GITHUB_OUTPUT
env:
IsMatched: ${{ github.ref_name == 'main' || github.ref_name == 'core-9-0-branch' }}
IsMatched: ${{ github.ref_name == 'main' || github.ref_name == 'core-9-1-branch' }}
# DO NOT CHANGE THESE MATRIX SPECS; IT AFFECTS OUR COST CONTROLS
FULL: >
[
@@ -43,7 +44,7 @@ jobs:
]
gcc:
needs: plan
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
strategy:
matrix: ${{ fromJson(needs.plan.outputs.gcc) }}
defaults:
@@ -52,7 +53,7 @@ jobs:
working-directory: unix
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
timeout-minutes: 5
- name: Install 32-bit dependencies if needed
# Duplicated from above
@@ -90,6 +91,7 @@ jobs:
echo "::remove-matcher::.github/tcltest.json"
env:
ERROR_ON_FAILURES: 1
CI: 1
timeout-minutes: 30
- name: Test-Drive Installation
run: |
+8 -7
View File
@@ -3,14 +3,15 @@ on:
push:
branches:
- "main"
- "core-9-0-branch"
- "core-9-1-branch"
tags:
- "core-*"
workflow_dispatch:
permissions:
contents: read
jobs:
plan:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04
outputs:
clang: ${{ steps.matrix.outputs.clang }}
steps:
@@ -21,7 +22,7 @@ jobs:
echo clang=$(jq -nc '{config: (if env.IsMatched == "true" then env.FULL else env.PARTIAL end) | fromjson }' )
) | tee -a $GITHUB_OUTPUT
env:
IsMatched: ${{ github.ref_name == 'main' || github.ref_name == 'core-9-0-branch' }}
IsMatched: ${{ github.ref_name == 'main' || github.ref_name == 'core-9-1-branch' }}
# DO NOT CHANGE THIS MATRIX SPEC; IT AFFECTS OUR COST CONTROLS
FULL: >
[
@@ -45,7 +46,7 @@ jobs:
working-directory: macosx
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
timeout-minutes: 5
- name: Prepare
run: |
@@ -63,7 +64,7 @@ jobs:
env:
ERROR_ON_FAILURES: 1
MAC_CI: 1
timeout-minutes: 15
timeout-minutes: 30
clang:
runs-on: macos-26
needs: plan
@@ -75,7 +76,7 @@ jobs:
working-directory: unix
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
timeout-minutes: 5
- name: Prepare
run: |
@@ -106,4 +107,4 @@ jobs:
env:
ERROR_ON_FAILURES: 1
MAC_CI: 1
timeout-minutes: 20
timeout-minutes: 30
+11 -10
View File
@@ -3,22 +3,23 @@ on:
push:
branches:
- "main"
- "core-9-0-branch"
- "core-9-1-branch"
tags:
- "core-*"
workflow_dispatch:
permissions:
contents: read
jobs:
linux:
name: Linux
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
defaults:
run:
shell: bash
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Prepare
run: |
touch generic/tclStubInit.c generic/tclOOStubInit.c
@@ -54,16 +55,16 @@ jobs:
url: ${{ steps.upload.outputs.artifact-url }}
macos:
name: macOS
runs-on: macos-15-intel
runs-on: macos-26
defaults:
run:
shell: bash
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Checkout create-dmg
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
repository: create-dmg/create-dmg
ref: v1.2.2
@@ -124,7 +125,7 @@ jobs:
url: ${{ steps.upload.outputs.artifact-url }}
win:
name: Windows
runs-on: windows-2025
runs-on: windows-2025-vs2026
defaults:
run:
shell: msys2 {0}
@@ -139,7 +140,7 @@ jobs:
msystem: UCRT64
install: git mingw-w64-ucrt-x86_64-toolchain make zip
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Prepare
run: |
touch generic/tclStubInit.c generic/tclOOStubInit.c
@@ -180,7 +181,7 @@ jobs:
- macos
- win
name: Combine Artifacts (prototype)
runs-on: ubuntu-latest
runs-on: ubuntu-26.04
defaults:
run:
shell: bash
@@ -205,7 +206,7 @@ jobs:
working-directory: data
- name: Transfer built files
# https://github.com/marketplace/actions/rsync-deployments-action
uses: burnett01/rsync-deployments@8.0.4
uses: burnett01/rsync-deployments@9.0.1
id: rsync
if: false # Disabled... for now
with:
+14 -10
View File
@@ -3,14 +3,15 @@ on:
push:
branches:
- "main"
- "core-9-0-branch"
- "core-9-1-branch"
tags:
- "core-*"
workflow_dispatch:
permissions:
contents: read
jobs:
plan:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04
outputs:
msvc: ${{ steps.matrix.outputs.msvc }}
gcc: ${{ steps.matrix.outputs.gcc }}
@@ -19,11 +20,11 @@ jobs:
id: matrix
run: |
(
echo msvc=$(jq -nc '{config: (if env.IsMatched == "true" then env.MSVC_FULL else env.MSVC_PARTIAL end) | fromjson }' )
echo msvc=$(jq -nc '{arch: ["x64"], config: (if env.IsMatched == "true" then env.MSVC_FULL else env.MSVC_PARTIAL end) | fromjson }' )
echo gcc=$(jq -nc '{config: (if env.IsMatched == "true" then env.GCC_FULL else env.GCC_PARTIAL end) | fromjson }' )
) | tee -a $GITHUB_OUTPUT
env:
IsMatched: ${{ github.ref_name == 'main' || github.ref_name == 'core-9-0-branch' }}
IsMatched: ${{ github.ref_name == 'main' || github.ref_name == 'core-9-1-branch' }}
# DO NOT CHANGE THESE MATRIX SPECS; IT AFFECTS OUR COST CONTROLS
MSVC_FULL: >
[
@@ -56,7 +57,7 @@ jobs:
"--enable-symbols=all"
]
msvc:
runs-on: windows-2025
runs-on: windows-2025-vs2026
needs: plan
defaults:
run:
@@ -67,11 +68,14 @@ jobs:
# Using powershell means we need to explicitly stop on failure
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
timeout-minutes: 5
- name: Init MSVC
uses: ilammy/msvc-dev-cmd@v1
timeout-minutes: 5
shell: cmd
run: |
for /f "usebackq tokens=*" %%i in (`vswhere -latest -property installationPath`) do set "VS_PATH=%%i"
call "%VS_PATH%\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }}
set | findstr /i "^VC ^VCTools ^Windows ^Universal ^INCLUDE ^LIB ^PATH ^DevEnv" >> %GITHUB_ENV%
- name: Build ${{ matrix.config }}
run: |
&nmake -f makefile.vc ${{ matrix.config }} all
@@ -97,7 +101,7 @@ jobs:
env:
ERROR_ON_FAILURES: 1
gcc:
runs-on: windows-2025
runs-on: windows-2025-vs2026
needs: plan
defaults:
run:
@@ -113,7 +117,7 @@ jobs:
install: git mingw-w64-x86_64-toolchain make
timeout-minutes: 10
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
timeout-minutes: 5
- name: Prepare
run: |
+6 -16
View File
@@ -1,6 +1,6 @@
# README: Tcl
This is the **Tcl 9.1a2** source distribution.
This is the **Tcl 9.1b1** source distribution.
You can get any source release of Tcl from [our distribution
site](https://sourceforge.net/projects/tcl/files/Tcl/).
@@ -64,7 +64,7 @@ There have been many Tcl books on the market. Many are mentioned in
The complete set of reference manual entries for Tcl 9.1 is [online,
here](https://www.tcl-lang.org/man/tcl9.1/).
### <a id="doc.unix">2a.</a> Unix Documentation
### <a id="doc.unix"></a> Unix man pages
The `doc` subdirectory in this release contains a complete set of
reference manual entries for Tcl. Files with extension "`.1`" are for
programs (for example, `tclsh.1`); files with extension "`.3`" are for C
@@ -82,27 +82,17 @@ normal "man" mechanisms, such as
man Tcl
### <a id="doc.win">2b.</a> Windows Documentation
The "doc" subdirectory in this release contains a complete set of Windows
help files for Tcl. Once you install this Tcl release, a shortcut to the
Windows help Tcl documentation will appear in the "Start" menu:
Start | Programs | Tcl | Tcl Help
## <a id="build">3.</a> Compiling and installing Tcl
There are brief notes in the `unix/README`, `win/README`, and `macosx/README`
about compiling on these different platforms. There is additional information
about building Tcl from sources
[online](https://www.tcl-lang.org/doc/howto/compile.html).
## <a id="devtools">4.</a> Development tools
ActiveState produces a high-quality set of commercial quality development
tools that is available to accelerate your Tcl application development.
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
## <a id="news">4.</a> News feeds
https://www.activestate.com/products/tcl/
You can keep up with the latest happenings in the Tcl world via
[fosstodon](https://fosstodon.org/@tcl_tk) or
[X](https://twitter.com/TclLang) feeds.
## <a id="complangtcl">5.</a> Tcl newsgroup
There is a USENET newsgroup, "`comp.lang.tcl`", intended for the exchange of
+41 -13
View File
@@ -4,7 +4,7 @@ changes to the Tcl source code at
> [Tcl Source Code](https://core.tcl-lang.org/tcl/timeline)
Release Tcl 9.1a2 arises from the check-in with tag `core-9-1-a2`.
Release Tcl 9.1b1 arises from the check-in with tag `core-9-1-b1`.
Highlighted differences between Tcl 9.1 and Tcl 9.0 are summarized below,
with focus on changes important to programmers using the Tcl library and
@@ -12,30 +12,58 @@ writing Tcl scripts.
# New commands and options
- [New options -backslashes, -commands and -variables for subst command](https://core.tcl-lang.org/tips/doc/trunk/tip/712.md)
- [New command unicode for Unicode normalization](https://core.tcl-lang.org/tips/doc/trunk/tip/726.md)
- [New timer command, switch to monotonic clock and microsecond resolution](https://core.tcl-lang.org/tips/doc/trunk/tip/723.md)
- [Remove "expr" behavior from lseq](https://core.tcl-lang.org/tips/doc/trunk/tip/746.md) *Incompatibility*
- [New options `-backslashes`, `-commands` and `-variables` for `subst` command](https://core.tcl-lang.org/tips/doc/trunk/tip/712.md)
- [New command `unicode` for Unicode normalization](https://core.tcl-lang.org/tips/doc/trunk/tip/726.md)
- [New `timer` command, switch to monotonic clock and microsecond resolution](https://core.tcl-lang.org/tips/doc/trunk/tip/723.md)
- [Remove `expr` behavior from `lseq`](https://core.tcl-lang.org/tips/doc/trunk/tip/746.md) *Incompatibility*
- [File paths are now treated as case-insensitive on MacOS](https://core.tcl-lang.org/tcl/tktview/e6ca0b1b) *Incompatibility*
- New command `tcl::registry` as a synonym for the `registry` command without needing
the registry package to be loaded. The registry module is now part of the core
Tcl DLL in all build configurations.
- [New `lfilter` command for selecting items from a list](https://core.tcl-lang.org/tips/doc/trunk/tip/735.md)
- [Many new functions from C99](https://core.tcl-lang.org/tips/doc/trunk/tip/745.md), specifically: `acosh()`, `asinh()`, `atanh()`, `cbrt()`, `copysign()`, `dim()`, `erf()`, `erfc()`, `exp2()`, `expm1()`, `fma()`, `gamma()`, `ldexp()`, `lgamma()`, `log1p()`, `log2()`, `logb()`, `nextafter()`, `remainder()`, `signbit()`, and `trunc()`, and (for functions that return multiple values in their C99 API) the commands: `divmod`, `frexp`, `modf`, and `remquo`. (See [this page](https://en.cppreference.com/w/c/numeric/math.html) for more information about these functions; the Tcl functions are _intentionally_ only thin wrappers around the functions in the C99 standard.)
- [New `switch` option `-integer` to compare values as integers](https://core.tcl-lang.org/tips/doc/trunk/tip/730.md)
- [Reading and writing of child interpreter variables](https://core.tcl-lang.org/tips/doc/trunk/tip/728.md)
- [Updated Tcl Bytecode opcodes](https://core.tcl-lang.org/tips/doc/trunk/tip/720.md)
- New `tcltest::configure` option `-iterations` to control number of iterations of each test.
# New public C API
- [Tcl\_IsEmpty checks if the string representation of a value would be the empty string](https://core.tcl-lang.org/tips/doc/trunk/tip/711.md)
- [Tcl\_GetEncodingNameForUser returns name of encoding from user settings](https://core.tcl-lang.org/tips/doc/trunk/tip/716.md)
- [Tcl\_AttemptCreateHashEntry - version of Tcl\_CreateHashEntry that returns NULL instead of panic'ing on memory allocation errors](https://core.tcl-lang.org/tips/doc/trunk/tip/717.md)
- [Tcl\_ListObjRange, Tcl\_ListObjRepeat, Tcl\_TclListObjReverse - C API for new list operations](https://core.tcl-lang.org/tips/doc/trunk/tip/649.md)
- [Tcl\_UtfToNormalized, Tcl\_UtfToNormalizedDString - C API for Unicode normalization](https://core.tcl-lang.org/tips/doc/trunk/tip/726.md)
- [Tcl\_UtfToExternalEx and Tcl\_ExternalToUtfEx - C encoding API supporting output buffers larger than INT_MAX](https://core.tcl-lang.org/tips/doc/trunk/tip/737.md)
- [`Tcl_IsEmpty()` &mdash; checks if the string representation of a value would be the empty string](https://core.tcl-lang.org/tips/doc/trunk/tip/711.md)
- [`Tcl_GetEncodingNameForUser()` &mdash; returns name of encoding from user settings](https://core.tcl-lang.org/tips/doc/trunk/tip/716.md)
- [`Tcl_AttemptCreateHashEntry()` &mdash; version of `Tcl_CreateHashEntry()` that returns NULL instead of panic'ing on memory allocation errors](https://core.tcl-lang.org/tips/doc/trunk/tip/717.md)
- [`Tcl_ListObjRange()`, `Tcl_ListObjRepeat()`, `Tcl_ListObjReverse()` &mdash; C API for new list operations](https://core.tcl-lang.org/tips/doc/trunk/tip/649.md)
- [`Tcl_UtfToNormalized()`, `Tcl_UtfToNormalizedDString()` &mdash; C API for Unicode normalization](https://core.tcl-lang.org/tips/doc/trunk/tip/726.md)
- [`Tcl_UtfToExternalEx()` and `Tcl_ExternalToUtfEx()` &mdash; C encoding API supporting output buffers larger than INT_MAX](https://core.tcl-lang.org/tips/doc/trunk/tip/737.md)
- [New API for monotonic clock and microseconds resolution](https://core.tcl-lang.org/tips/doc/trunk/tip/723.md)
- [Windows `auto_execok` enhancements and `exec` search reform](https://core.tcl-lang.org/tips/doc/trunk/tip/753.md)
- [New timer API using long long in stead of Tcl_Time](https://core.tcl-lang.org/tips/doc/trunk/tip/752.md)
# Changes in interpreter initialization
- [Custom applications must call Tcl\_FindExecutable or TclZipfs_AppHook to initialize Tcl](https://core.tcl-lang.org/tips/doc/trunk/tip/732.md) *Potential incompatibility*
- [Search path for locating Tcl core script and encodings is changed](https://core.tcl-lang.org/tips/doc/trunk/tip/732.md) *Potential incompatibility*
- [`Tcl_RegisterPostInitProc` callback for post-initialization of interpreters](https://core.tcl-lang.org/tips/doc/trunk/tip/755.md)
# Performance
- [Memory efficient internal representations](https://core.tcl-lang.org/tcl/wiki?name=New+abstract+list+representations)
for list operations on large lists.
- [Continued 64-bit capacity: Command line arguments larger than 2Gb](https://core.tcl-lang.org/tips/doc/trunk/tip/626.md)
- Speedup in interpreter creation
- [Support for long paths on Windows](https://core.tcl-lang.org/tips/doc/trunk/tip/744.md)
- [Support for long paths on Windows](https://core.tcl-lang.org/tips/doc/trunk/tip/744.md)
- [Faster UTF-8 encoding and I/O](https://core.tcl-lang.org/tcl/wiki?name=Faster+UTF+encoding)
- Faster interpreter creation
# Bug fixes
- [Inconsistent `glob` matching on MacOS](https://core.tcl-lang.org/tcl/tktview/e6ca0b1b)
- [`file normalize` does not uniquely identify a file on MacOS](https://core.tcl-lang.org/tcl/tktview/10890417)
- [Inconsistencies between `cd` and `file normalize` for volume-relative paths on Windows](https://core.tcl-lang.org/tcl/tktview/bca391ab)
- [Tcl cannot run from an arbitrary build directory with --disable-zipfs](https://core.tcl-lang.org/tcl/tktview/006bef5d)
- [Crash on finalization with an active thread running.](https://core.tcl-lang.org/tcl/tktview/e55a589d)
- [Crash on use-after-free in Windows socket thread.](https://core.tcl-lang.org/tcl/tktview/06f19cc4)
# Updated bundled packages, libraries, standards, data
- Unicode 18.0.0 (draft)
- platorm 1.2b1
+1 -1
View File
@@ -4,7 +4,7 @@
* This file provides the gettimeofday function on systems
* that only have the System V ftime function.
*
* Copyright (c) 1995 Sun Microsystems, Inc.
* Copyright © 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+1 -1
View File
@@ -3,7 +3,7 @@
*
* Source code for the "mkstemp" library routine.
*
* Copyright (c) 2009 Donal K. Fellows
* Copyright © 2009 Donal K. Fellows
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
+2 -2
View File
@@ -3,8 +3,8 @@
*
* Source code for the "strncasecmp" library routine.
*
* Copyright (c) 1988-1993 The Regents of the University of California.
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
* Copyright © 1988-1993 The Regents of the University of California.
* Copyright © 1995-1996 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
+2 -2
View File
@@ -5,8 +5,8 @@
* that don't have waitpid but do have wait3. This code is based on a
* prototype version written by Mark Diekhans and Karl Lehenbauer.
*
* Copyright (c) 1993 The Regents of the University of California.
* Copyright (c) 1994 Sun Microsystems, Inc.
* Copyright © 1993 The Regents of the University of California.
* Copyright © 1994 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
+1 -2
View File
@@ -13,7 +13,6 @@ Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErr
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
Tcl_Obj *
\fBTcl_GetReturnOptions\fR(\fIinterp, code\fR)
.sp
@@ -133,7 +132,7 @@ if (code == TCL_ERROR) {
.PP
\fBTcl_SetReturnOptions\fR sets the return options
of \fIinterp\fR to be \fIoptions\fR. If \fIoptions\fR
contains any invalid value for any key, TCL_ERROR will
contains any invalid value for any key, \fBTCL_ERROR\fR will
be returned, and the interp result will be set to an
appropriate error message. Otherwise, a completion code
in agreement with the \fB\-code\fR and \fB\-level\fR
+1 -1
View File
@@ -29,7 +29,7 @@ The exceptional return code to be reported.
.SH DESCRIPTION
.PP
This procedure is typically invoked when a Tcl exception (any
return code other than TCL_OK) occurs during
return code other than \fBTCL_OK\fR) occurs during
.QW "background processing"
such as executing an event handler.
When such an exception occurs, the condition is reported to Tcl
+2 -2
View File
@@ -23,7 +23,7 @@ int
\fBTcl_GetBooleanFromObj\fR(\fIinterp, objPtr, boolPtr\fR)
.sp
int
\fBTcl_GetBoolFromObj\fR(\fIinterp, objPtr, flags. charPtr\fR)
\fBTcl_GetBoolFromObj\fR(\fIinterp, objPtr, flags, charPtr\fR)
.fi
.SH ARGUMENTS
.AS Tcl_Interp intValue in/out
@@ -45,7 +45,7 @@ stores the boolean value (0 or 1) obtained from \fIobjPtr\fR.
.AP int flags in
0 or TCL_NULL_OK. If TCL_NULL_OK
is used, then the empty string or NULL will result in \fBTcl_GetBoolFromObj\fR
return TCL_OK, the *charPtr filled with the value \fB'\exFF'\fR;
return \fBTCL_OK\fR, the *charPtr filled with the value \fB'\exFF'\fR;
.BE
.SH DESCRIPTION
+4 -4
View File
@@ -220,7 +220,7 @@ typedef int \fBTcl_CloneProc\fR(
.PP
The \fIinterp\fR argument gives a place to write an error message when the
attempt to clone the object is to fail, in which case the clone procedure must
also return TCL_ERROR; it should return TCL_OK otherwise.
also return \fBTCL_ERROR\fR; it should return \fBTCL_OK\fR otherwise.
The \fIsrcMetadata\fR argument gives the address of the metadata to be cloned,
and the cloned metadata should be written into the variable pointed to by
\fIdstMetadataPtr\fR; a NULL should be written if the metadata is to not be
@@ -246,9 +246,9 @@ typedef int \fBTcl_ObjectMapMethodNameProc\fR(
Tcl_Obj *\fImethodNameObj\fR);
.CE
.PP
If the result is TCL_OK, the remapping is assumed to have been done. If the
result is TCL_ERROR, an error message will have been left in \fIinterp\fR and
the method call will fail. If the result is TCL_BREAK, the standard method
If the result is \fBTCL_OK\fR, the remapping is assumed to have been done. If the
result is \fBTCL_ERROR\fR, an error message will have been left in \fIinterp\fR and
the method call will fail. If the result is \fBTCL_BREAK\fR, the standard method
name lookup rules will be used; the behavior of other result codes is
currently undefined. The \fIobject\fR parameter says which object is being
processed. The \fIstartClsPtr\fR parameter points to a variable that contains
+2 -2
View File
@@ -18,10 +18,10 @@ const char *
\fBTcl_Concat\fR(\fIargc, argv\fR)
.fi
.SH ARGUMENTS
.AS "const char *const" argv[]
.AS "const char *const" *argv
.AP Tcl_Size argc in
Number of strings.
.AP "const char *const" argv[] in
.AP "const char *const" *argv in
Array of strings to concatenate. Must have \fIargc\fR entries.
.BE
+1 -1
View File
@@ -85,7 +85,7 @@ Pointer to location to store count of additional value arguments to be
passed to the alias. The location is in storage owned by the caller.
If it points to a variable which type is not \fBTcl_Size\fR, a compiler
warning will be generated. If your extensions is compiled with \fB-DTCL_8_API\fR,
this function will return TCL_ERROR for aliases with more than INT_MAX
this function will return \fBTCL_ERROR\fR for aliases with more than INT_MAX
value arguments, otherwise expect it to crash
.AP Tcl_Obj ***objvPtr out
Pointer to location to store a vector of Tcl_Obj structures, the additional
+1 -1
View File
@@ -70,7 +70,7 @@ was created. Typically, \fIclientData\fR points to a data
structure containing application-specific information about
what to do in \fIproc\fR.
.PP
Both functions return a \fBtolken\fR.
Both functions return a \fBtoken\fR.
In case of \fBTcl_CreateTimerHandlerMicroSeconds\fR, the return value is \fBNULL\fR,
if the given time interval is to much in the future and may not be
represented. This is a theoretical case, as it is in around 26 thousand years.
+2 -2
View File
@@ -38,7 +38,7 @@ checking the process.
.SH DESCRIPTION
.PP
\fBTcl_DetachPids\fR and \fBTcl_ReapDetachedProcs\fR provide a
mechanism for managing subprocesses that are running in background.
mechanism for managing subprocesses that are running in the background.
These procedures are needed because the parent of a process must
eventually invoke the \fBwaitpid\fR kernel call (or one of a few other
similar kernel calls) to wait for the child to exit. Until the
@@ -50,7 +50,7 @@ overflow, even if all the children have exited.
\fBTcl_DetachPids\fR may be called to ask Tcl to take responsibility
for one or more processes whose process ids are contained in the
\fIpidPtr\fR array passed as argument. The caller presumably
has started these processes running in background and does not
has started these processes running in the background and does not
want to have to deal with them again.
.PP
\fBTcl_ReapDetachedProcs\fR invokes the \fBwaitpid\fR kernel call
+3 -3
View File
@@ -284,7 +284,7 @@ trigger proper error-handling), otherwise expect it to crash.
The base path on to which to join the given elements. May be NULL.
.AP Tcl_Size objc in
The number of elements in \fIobjv\fR.
.AP "Tcl_Obj *const" objv[] in
.AP "Tcl_Obj *const" *objv in
The elements to join to the given base path.
.AP Tcl_Obj *linkNamePtr in
The name of the link to be created or read.
@@ -737,8 +737,8 @@ value, which will only receive
a UTF-8 string representation if that is required by some Tcl code.
.PP
\fBTcl_FSGetNativePath\fR is for use by the Win/Unix native
filesystems, so that they can easily retrieve the native (char* or
TCHAR*) representation of a path. This function is a convenience
filesystems, so that they can easily retrieve the native (char * or
TCHAR *) representation of a path. This function is a convenience
wrapper around \fBTcl_FSGetInternalRep\fR. It may be desirable in the
future to have non-string-based native representations (for example,
on macOS, a representation using a fileSpec of FSRef structure would
+13 -1
View File
@@ -42,7 +42,7 @@ Points to place to store boolean value (0 or 1) value converted from \fIsrc\fR.
.AP int flags in
0 or TCL_NULL_OK. If TCL_NULL_OK
is used, then the empty string or NULL will result in \fBTcl_GetBool\fR
return TCL_OK, the *charPtr filled with the value \fB'\exFF'\fR;
return \fBTCL_OK\fR, the *charPtr filled with the value \fB'\exFF'\fR;
.BE
.SH DESCRIPTION
@@ -75,6 +75,18 @@ if the first such characters are
then \fIsrc\fR
is expected to be in binary form; otherwise, \fIsrc\fR is
expected to be in decimal form.
.VS "TIP 551"
One or more underscore characters,
.QW _ ,
may be inserted between digits, acting as numeric whitespace, but not
before the first digit or after the last digit, or between the prefix
(as described above, if present) and the first digit.
Which is to say,
.QW "1_000_000"
is a \fIvalid\fR way of writing one million, but
.QW "0d_1000_000"
is \fInot valid\fR, and will be reported as an error.
.VE "TIP 551"
.PP
\fBTcl_GetDouble\fR expects \fIsrc\fR to consist of a floating-point
number, which is: white space; a sign; a sequence of digits; a
+3 -3
View File
@@ -319,7 +319,7 @@ Tcl_HashEntry, the key pointer is assigned to key.oneWordValue and the
clientData is set to NULL. String keys and array keys use this function to
allocate enough space for the entry and the key in one block, rather than
doing it in two blocks. This saves space for a pointer to the key from the
entry and another memory allocation. Tcl_Obj* keys use this function to
entry and another memory allocation. Tcl_Obj * keys use this function to
allocate enough space for an entry and increment the reference count on the
value.
.PP
@@ -332,7 +332,7 @@ typedef void \fBTcl_FreeHashEntryProc\fR(
.CE
.PP
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
Tcl_Obj * keys use this function to decrement the reference count on the
value.
.SH "REFERENCE COUNT MANAGEMENT"
.PP
@@ -344,7 +344,7 @@ 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
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)
+48 -1
View File
@@ -16,6 +16,19 @@ int
.sp
const char *
\fBTcl_SetPreInitScript\fR(\fIscriptPtr\fR)
.sp
.VS TIP755
typedef int \fBTcl_PostInitProc\fR(\fBTcl_Interp *\fIinterp\fR, \fBvoid *\fIclientData\fR)
.sp
int
\fBTcl_RegisterPostInitProc\fR(\fIpostInitProc\fR, \fIclientData\fR)
.sp
int
\fBTcl_UnregisterPostInitProc\fR(\fIpostInitProc\fR, \fIclientData\fR)
.sp
int
\fBTcl_ClearPostInitProcs\fR(void)
.VE TIP755
.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp
@@ -23,8 +36,11 @@ const char *
Interpreter to initialize.
.AP "const char" *scriptPtr in
Address of the initialization script.
.AP Tcl_PostInitProc *postInitProc in
Function to call post initialization of interpreter.
.AP "void" *clientData in
Arbitrary one-word value to pass to \fBpostInitProc\fR.
.BE
.SH DESCRIPTION
.PP
\fBTcl_Init\fR is a helper procedure that finds and \fBsource\fRs the
@@ -39,6 +55,37 @@ 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.
.VS TIP755
.PP
\fBTcl_RegisterPostInitProc\fR registers a callback that should be invoked by
\fBTcl_Init\fR at the end of initialization of subsequently created
interpreters except safe interpreters. The function returns a Tcl return code.
.PP
This callback function is passed the interpreter being initialized and the
opaque \fIclientData\fR value that was passed at the time of registration. It
should return a Tcl return code. Multiple callbacks are supported and will be
invoked in the order of their registration except that an error return from a
callback will skip the remaining registrations. The Tcl return code from the
last callback invoked is returned as the return value from \fBTcl_Init\fR.
.PP
\fBTcl_UnregisterPostInitProc\fR unregisters a previously registered callback.
Both \fIpostInitProc\fR and \fIclientData\fR must match the the corresponding
values that were passed to \fBTcl_RegisterPostInitProc\fR. The function returns
a standard Tcl return code. It is not an error if there is no matching prior
registration.
.PP
The \fBTcl_ClearPostInitProcs\fR function unregisters all currently registered
callbacks.
.PP
Callback functions registered through \fBTcl_RegisterPostInitProc\fR may load
static packages, add commands, or set up other facilities so they are available
in all interpreters. They cannot however execute any code that may result in new
interpreters and should not delete the passed interpreter.
.PP
The `Tcl_RegisterPostInitProc` and `Tcl_UnregisterPostInitProc` functions may be
invoked from within a registered callback. However, the change in registration
will not have effect for the interpreter that is being initialized.
.VE TIP755
.PP
When used in stub-enabled embedders, the stubs table must be first initialized
using one of \fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR,
+1 -1
View File
@@ -85,7 +85,7 @@ A location where \fBTcl_ListObjGetElements\fR stores a pointer to an array
of pointers to the element values of \fIlistPtr\fR.
.AP Tcl_Size objc in
The number of Tcl values in the \fIobjv\fR array.
.AP "Tcl_Obj *const" objv[] in
.AP "Tcl_Obj *const" *objv in
An array of pointers to Tcl values.
.AP "Tcl_Size \&| int" *lengthPtr out
Points to location where \fBTcl_ListObjLength\fR
+2 -2
View File
@@ -254,7 +254,7 @@ execute scripts and access variables as well as being where to put the result
of the method, and the \fIobjc\fR and \fIobjv\fR fields give the parameter
objects to the method. The calling context of the method can be discovered
through the \fIobjectContext\fR argument, and the return value from a
Tcl_MethodCallProc is any Tcl return code (e.g. TCL_OK, TCL_ERROR).
Tcl_MethodCallProc is any Tcl return code (e.g. \fBTCL_OK\fR, \fBTCL_ERROR\fR).
.SS "TCL_METHODDELETEPROC FUNCTION SIGNATURE"
.PP
Functions matching this signature are used when a method is deleted, whether
@@ -282,7 +282,7 @@ typedef int \fBTcl_CloneProc\fR(
.PP
The \fIinterp\fR argument gives a place to write an error message when the
attempt to clone the object is to fail, in which case the clone procedure must
also return TCL_ERROR; it should return TCL_OK otherwise.
also return \fBTCL_ERROR\fR; it should return \fBTCL_OK\fR 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.
+4 -4
View File
@@ -80,7 +80,7 @@ Token to use instead of one derived from the first word of \fIobjv\fR in order
to evaluate a command.
.AP Tcl_Obj *resultPtr out
Pointer to an unshared Tcl_Obj where the result of the evaluation is stored if
the return code is TCL_OK.
the return code is \fBTCL_OK\fR.
.AP Tcl_NRPostProc *postProcPtr in
A function to push.
.AP void *data0 in
@@ -163,7 +163,7 @@ int
void *clientData,
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
int result;
Tcl_Obj *objPtr;
@@ -194,7 +194,7 @@ int
void *clientData,
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
return \fBTcl_NRCallObjProc2\fR(interp, \fITheCmdNRObjProc\fR,
clientData, objc, objv);
@@ -207,7 +207,7 @@ int
void *clientData,
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *objPtr;
+1 -1
View File
@@ -131,7 +131,7 @@ is true.
.PP
\fBTcl_Import\fR imports commands matching a pattern into a
namespace. Note that the pattern must include the name of the
namespace to import from. This function returns TCL_ERROR if
namespace to import from. This function returns \fBTCL_ERROR\fR if
an attempt to import a command over an existing command is made,
unless the \fIallowOverwrite\fR flag has been set.
.PP
+1 -1
View File
@@ -32,7 +32,7 @@ Points to first byte of the string value to be examined.
The number of bytes, starting at \fIbytes\fR, that should be examined.
If \fBnumBytes\fR is negative, then all bytes should
be examined until the first \fBNUL\fR byte terminates examination.
.AP "void *" *clientDataPtr out
.AP void **clientDataPtr out
Points to space where a pointer value may be written through which a numeric
value is available to read.
.AP int *typePtr out
+5 -5
View File
@@ -54,13 +54,13 @@ For \fBTcl_AppendAllObjTypes\fR, this points to the value onto which
it appends the name of each value type as a list element.
For \fBTcl_ConvertToType\fR, this points to a value that
must have been the result of a previous call to \fBTcl_NewObj\fR.
.AP "const char*" bytes in
.AP "const char" *bytes in
String representation.
.AP "size_t" numBytes in
Length of the string representation in bytes.
.AP "const Tcl_ObjInternalRep *" irPtr in
.AP "const Tcl_ObjInternalRep" *irPtr in
Internal object representation.
.AP "const Tcl_ObjType *" typePtr in
.AP "const Tcl_ObjType" *typePtr in
Requested internal representation type.
.BE
@@ -369,7 +369,7 @@ to be converted to a list.
Unless specified otherwise, all functions specific to Version 2 should return
\fBTCL_OK\fR on success and \fBTCL_ERROR\fR on failure.
In the case that a \fBTcl_Obj*\fR is also returned, the reference count of the
In the case that a \fBTcl_Obj *\fR is also returned, the reference count of the
returned \fBTcl_Obj\fR should not be incremented so, for example, if a new
\fBTcl_Obj\fR value is returned it should have a reference count of zero.
@@ -400,7 +400,7 @@ typedef int (\fBTcl_ObjTypeIndexProc\fR) (
Tcl_Interp *interp,
Tcl_Obj *listPtr,
Tcl_Size index,
Tcl_Obj** elemObj);
Tcl_Obj **elemObj);
.CE
.SS "THE SLICEPROC FIELD"
.PP
+1 -1
View File
@@ -21,7 +21,7 @@ const char *
.fi
.SH ARGUMENTS
.AS Tcl_PanicProc *panicProc
.AP "const char*" format in
.AP "const char" *format in
A printf-style format string.
.AP "" arg in
Arguments matching the format string.
+1 -1
View File
@@ -57,7 +57,7 @@ function completed successfully. The storage can be any pointer
type with the same size as a void pointer.
.AP Tcl_Size objc in
Number of requirements.
.AP Tcl_Obj* objv[] in
.AP Tcl_Obj **objv in
Array of requirements.
.BE
.SH DESCRIPTION
+3 -3
View File
@@ -26,13 +26,13 @@ Tcl_SetChannelError, Tcl_SetChannelErrorInterp, Tcl_GetChannelError, Tcl_GetChan
.AS Tcl_Channel chan
.AP Tcl_Channel chan in
Refers to the Tcl channel whose bypass area is accessed.
.AP Tcl_Interp* interp in
.AP Tcl_Interp *interp in
Refers to the Tcl interpreter whose bypass area is accessed.
.AP Tcl_Obj* msg in
.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. This \fImust\fR be a well-formed list.
.AP Tcl_Obj** msgPtr out
.AP Tcl_Obj **msgPtr out
Reference to a place where the message stored in the accessed bypass area can
be stored in.
.BE
+1 -1
View File
@@ -144,7 +144,7 @@ is used.
Format control string including % conversion specifiers.
.AP Tcl_Size objc in
The number of elements to format or concatenate.
.AP Tcl_Obj *objv[] in
.AP Tcl_Obj **objv in
The array of values to format or concatenate.
.AP Tcl_Size newLength in
New length for the string value of \fIobjPtr\fR, not including the
+2 -2
View File
@@ -12,7 +12,7 @@
Tcl_ZlibAdler32, Tcl_ZlibCRC32, Tcl_ZlibDeflate, Tcl_ZlibInflate, Tcl_ZlibStreamChecksum, Tcl_ZlibStreamClose, Tcl_ZlibStreamEof, Tcl_ZlibStreamGet, Tcl_ZlibStreamGetCommandName, Tcl_ZlibStreamInit, Tcl_ZlibStreamPut \- compression and decompression functions
.SH SYNOPSIS
.nf
#include <tcl.h>
\fB#include <tcl.h>\fR
.sp
int
\fBTcl_ZlibDeflate\fR(\fIinterp, format, dataObj, level, dictObj\fR)
@@ -207,7 +207,7 @@ If you wish to clear a stream and reuse it for a new compression or
decompression action, \fBTcl_ZlibStreamReset\fR will do this and return a
normal Tcl result code to indicate whether it was successful; if the stream is
registered with an interpreter, an error message will be left in the
interpreter result when this function returns TCL_ERROR.
interpreter result when this function returns \fBTCL_ERROR\fR.
Finally, \fBTcl_ZlibStreamClose\fR will clean up the stream and delete the
associated command: using \fBTcl_DeleteCommand\fR on the stream's command is
equivalent (when such a command exists).
+6 -6
View File
@@ -32,13 +32,13 @@ Tcl_Obj *
.AS Tcl_MainLoopProc *mainLoopProc
.AP Tcl_Size argc in
Number of elements in \fIargv\fR.
.AP char *argv[] in
.AP char **argv in
Array of strings containing command-line arguments. On Windows, when
using \fB\-DUNICODE\fR, the parameter type changes to wchar_t *.
.AP char *charargv[] in
As argv, but does not change type to wchar_t.
.AP char *wideargv[] in
As argv, but type is always wchar_t.
using \fB\-DUNICODE\fR, the parameter type changes to wchar_t **.
.AP char **charargv in
As argv, but does not change type to wchar_t **.
.AP char **wideargv in
As argv, but type is always wchar_t **.
.AP Tcl_AppInitProc *appInitProc in
Address of an application-specific initialization procedure.
The value for this argument is usually \fBTcl_AppInit\fR.
+2 -2
View File
@@ -120,7 +120,7 @@ string that will be released by the Tcl library via a call to
.TP
\fBTCL_TRACE_RESULT_OBJECT\fR
.
The result of invoking the \fIproc\fR is a Tcl_Obj* (cast to a char*)
The result of invoking the \fIproc\fR is a Tcl_Obj * (cast to a char *)
with a reference count of at least one. The ownership of that
reference will be transferred to the Tcl core for release (when the
core has finished with it) via a call to \fBTcl_DecrRefCount\fR. Must
@@ -320,7 +320,7 @@ containing an error message,
unless (\fIexactly\fR one of) the \fBTCL_TRACE_RESULT_DYNAMIC\fR and
\fBTCL_TRACE_RESULT_OBJECT\fR flags is set, which specify that the result is
either a dynamic string (to be released with \fBTcl_Free\fR) or a
Tcl_Obj* (cast to char* and to be released with
Tcl_Obj * (cast to char * and to be released with
\fBTcl_DecrRefCount\fR) containing the error message.
If a trace procedure returns an error, no further traces are
invoked for the access and the traced access aborts with the
+2 -2
View File
@@ -67,14 +67,14 @@ respectively. For details on the above normalization forms, refer to Section
The \fBTcl_UtfToNormalized\fR function stores the normalized result
in the buffer provided by the caller through the \fIdst\fR argument. The
result is nul terminated but the nul is not included in the count of
stored bytes returned in \fIdstWrotePtr\fR. The function returns TCL_OK
stored bytes returned in \fIdstWrotePtr\fR. The function returns \fBTCL_OK\fR
on success, TCL_CONVERT_NOSPACE if there is insufficient room in the output
buffer and TCL_ERROR in case of other failures. In the latter two cases,
an error message is stored in \fIinterp\fR if it is not NULL.
.PP
The \fBTcl_UtfToNormalizedDString\fR function stores the normalized result
in \fIdstPtr\fR which must eventually be freed by caller through
\fBTcl_DStringFree\fR. The function returns TCL_OK on success and
\fBTcl_DStringFree\fR. The function returns \fBTCL_OK\fR on success and
TCL_ERROR on failure with an error message in \fIinterp\fR if it is not NULL.
.SH "SEE ALSO"
unicode(n)
+1 -25
View File
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UtfToChar16, Tcl_UtfToWChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_Char16ToUtfDString, Tcl_UtfToWCharDString, Tcl_UtfToChar16DString, Tcl_WCharToUtfDString, Tcl_WCharLen, Tcl_Char16Len, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharNcasecmp, Tcl_UniCharCaseMatch, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating TUTF-8 encoded byte sequences
Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UtfToChar16, Tcl_UtfToWChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_Char16ToUtfDString, Tcl_UtfToWCharDString, Tcl_UtfToChar16DString, Tcl_WCharToUtfDString, Tcl_WCharLen, Tcl_Char16Len, Tcl_UniCharLen, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating TUTF-8 encoded byte sequences
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -55,15 +55,6 @@ Tcl_Size
\fBTcl_UniCharLen\fR(\fIuniStr\fR)
.sp
int
\fBTcl_UniCharNcmp\fR(\fIucs, uct, uniLength\fR)
.sp
int
\fBTcl_UniCharNcasecmp\fR(\fIucs, uct, uniLength\fR)
.sp
int
\fBTcl_UniCharCaseMatch\fR(\fIuniStr, uniPattern, nocase\fR)
.sp
int
\fBTcl_UtfNcmp\fR(\fIcs, ct, length\fR)
.sp
int
@@ -233,21 +224,6 @@ the number of \fBwchar_t\fR units until the null.
characters. It accepts a null-terminated Tcl_UniChar string and returns
the number of Tcl_UniChar's (not bytes) in that string.
.PP
\fBTcl_UniCharNcmp\fR and \fBTcl_UniCharNcasecmp\fR correspond to \fBstrncmp\fR
and \fBstrncasecmp\fR, respectively, for Tcl_UniChar code points. They accept
two null-terminated Tcl_UniChar strings and the number of Tcl_UniChar code
points to compare. Both strings are assumed to be at least \fIuniLength\fR
characters long. \fBTcl_UniCharNcmp\fR compares the code points in two strings
in order according to the Unicode character ordering. It returns an integer
greater than, equal to, or less than 0 if the first string is greater than,
equal to, or less than the second string respectively. \fBTcl_UniCharNcasecmp\fR
is the case insensitive variant of \fBTcl_UniCharNcmp\fR.
.PP
\fBTcl_UniCharCaseMatch\fR is the Unicode equivalent to
\fBTcl_StringCaseMatch\fR. It accepts a null-terminated Tcl_UniChar string,
a Tcl_UniChar pattern, a boolean value specifying whether the match should
be case sensitive and returns whether the string matches the pattern.
.PP
\fBTcl_UtfNcmp\fR corresponds to \fBstrncmp\fR and accepts two null-terminated
TUTF-8 encoded strings each of which should represent a sequence of at least
\fIlength\fR code points. \fBTcl_UtfNcmp\fR compares the code points represented
+1 -1
View File
@@ -23,7 +23,7 @@ in its result value.
.AP Tcl_Size objc in
Number of leading arguments from \fIobjv\fR to include in error
message.
.AP "Tcl_Obj *const" objv[] in
.AP "Tcl_Obj *const" *objv in
Arguments to command that had the wrong number of arguments.
.AP "const char" *message in
Additional error information to print after leading arguments
+2 -2
View File
@@ -24,7 +24,7 @@ after \- Execute a command after a time delay
.SH DESCRIPTION
.PP
This command is used to delay execution of the program or to execute
a command in background sometime in the future.
a command in the background sometime in the future.
This command uses a monotonic clock if available.
It has several forms, depending on the first argument to the command:
.\" METHOD: <none>
@@ -119,7 +119,7 @@ and \fBupdate\fR commands.
.SH "TIME MAXIMUM VALUE"
The argument \fIdelay\fR is bound to a resulting 63 bit monotonic clock value
(in unit microseconds).
Any higher value (which is after year 294441) will result in a \fBtime to far\fR error.
Any higher value (which is after year 294441) will result in a \fBtime too far away\fR error.
.SH "EXAMPLES"
This defines a command to make Tcl do nothing at all for \fIN\fR
seconds:
+3 -3
View File
@@ -972,12 +972,12 @@ single-precision floating point number will be scanned. The size of a
floating point number may vary across architectures, so the number of
bytes that are scanned may vary. If the data does not represent a
valid floating point number, the resulting value is undefined and
compiler dependent. For example, on a Windows system running on an
Intel Pentium processor,
compiler dependent. For example, on a MS-Windows system running on an
x86/x64 processor,
.RS
.PP
.CS
\fBbinary scan\fR \ex3F\exCC\exCC\exCD f var1
\fBbinary scan\fR \exCD\exCC\exCC\ex3F f var1
.CE
.PP
will return \fB1\fR with \fB1.6000000238418579\fR stored in
+1 -1
View File
@@ -442,7 +442,7 @@ seconds from the epoch, that group is used to determine the date.
If the string contains a \fB%J\fR, \fB%EJ\fR or \fB%Ej\fR format groups,
representing the Calendar or Astronomical Julian Day Number, that groups
are used to determine the date.
Note, that in case of \fB%EJ\fR or \fB%Ej\fR format groups, representing
Note that in case of \fB%EJ\fR or \fB%Ej\fR format groups, representing
the Julian Date with time fraction, this groups may be used to determine
the date and time.
.IP [3]
+40
View File
@@ -0,0 +1,40 @@
'\"
'\" Copyright (c) 2025 Donal Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH divmod n 9.1 Tcl "Tcl Integer Division"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
divmod \- Divide an integer by another and report quotient and remainder
.SH SYNOPSIS
\fBpackage require tcl 9.1\fR
.sp
\fBdivmod \fIx y\fR
.BE
.SH DESCRIPTION
The \fBdivmod\fR command takes two integer numbers, \fIx\fR and \fIy\fR, and
returns a list of two values. The first element of the result is the
whole quotient of \fIx\fR/\fIy\fR, and the second is the remainder such that
the sum of the remainder and the product of the quotient and \fIy\fR is equal
to \fIx\fR.
.PP
The quotient and remainder are calculated using the same rules as for Tcl's
\fB/\fR and \fB%\fR operators.
.SH EXAMPLE
.PP
.CS
lassign [\fBdivmod\fR 123 50] q r
puts "quotient=$q remainder=$r"
# quotient=2 remainder=23
.CE
.SH "SEE ALSO"
expr(n), mathfunc(n), mathop(n)
.SH KEYWORDS
division, integer value
'\" Local Variables:
'\" mode: nroff
'\" End:
+15 -27
View File
@@ -23,9 +23,7 @@ The arguments take the form of a standard shell pipeline
where each \fIarg\fR becomes one word of a command, and
each distinct command becomes a subprocess.
The result of the command is the standard output of the final subprocess in
the pipeline, interpreted using the system \fBencoding\fR; to use any other
encoding (especially including binary data), the pipeline must be
\fBopen\fRed, configured and read explicitly.
the pipeline, decoded as per the \fB-encoding\fR option.
.PP
If the initial arguments to \fBexec\fR start with \fB\-\fR then
they are treated as command-line switches and are not part
@@ -35,8 +33,9 @@ currently supported:
.TP 13
\fB\-encoding \fIencodingName\fR
.
Specifies the name of the encoding to use to decode the output of the first
subprocess. Defaults to that returned by the \fBencoding system\fR command.
Specifies the name of the encoding to use to decode the result of the
command when not run in the background. Defaults to that returned by
the \fBencoding system\fR command.
.\" OPTION: -ignorestderr
.TP 13
\fB\-ignorestderr\fR
@@ -198,7 +197,7 @@ pipeline is taken from the application's current standard input.
.PP
If the last \fIarg\fR is
.QW &
then the pipeline will be executed in background.
then the pipeline will be executed in the background.
In this case the \fBexec\fR command will return a list whose
elements are the process identifiers for all of the subprocesses
in the pipeline.
@@ -319,28 +318,17 @@ to have console applications hidden and detached. This is a designed-in
limitation as \fBexec\fR wants to communicate over pipes. The Expect
extension addresses this issue when communicating with a TUI application.
.PP
When attempting to execute an application, \fBexec\fR first searches for
the name as it was specified. Then, in order,
\fB.com\fR, \fB.exe\fR, \fB.bat\fR and \fB.cmd\fR
are appended to the end of the specified name and it searches
for the longer name. If a directory name was not specified as part of the
application name, the following directories are automatically searched in
order when attempting to locate the application:
.IP \(bu 3
The directory from which the Tcl executable was loaded.
.IP \(bu 3
The current directory.
.IP \(bu 3
The Windows 32-bit system directory.
.IP \(bu 3
The Windows home directory.
.IP \(bu 3
The directories listed in the path.
.PP
When attempting to execute an application, \fBexec\fR searches directories
in the same manner as described for the \fBauto_execok\fR command. However,
with respect to file extensions, unlike \fBauto_execok\fR, \fBexec\fR only
searches for
the name as it was specified and then in order,
\fB.com\fR, \fB.exe\fR, \fB.bat\fR and \fB.cmd\fR. The \fBPATHEXT\fR
environment variable is disregarded as are any file associations.
In order to execute shell built-in commands like \fBdir\fR and \fBcopy\fR,
the caller must prepend the desired command with
.QW "\fBcmd.exe /c\0\fR"
because built-in commands are not implemented using executables.
other extensions in \fBPATHEXT\fR, or registered application paths,
make use of \fBauto_execok\fR to retrieve the command to be passed to
\fBexec\fR.
.RE
.TP
\fBUnix\fR (including macOS)
+1 -1
View File
@@ -247,7 +247,7 @@ must in order to determine its result.
.TP 20
\fIx \fB?\fI y \fB:\fI z\fR
.
If-then-else, as in C. If \fIx\fR is false , the result is the value of
If-then-else, as in C. If \fIx\fR is true , the result is the value of
\fIy\fR. Otherwise the result is the value of \fIz\fR.
This operator evaluates lazily; it evaluates only one of \fIy\fR or \fIz\fR.
.PP
-10
View File
@@ -645,16 +645,6 @@ if {![\fBfile isdirectory\fR [\fBfile dirname\fR $newName]]} {
\fBfile rename\fR $oldName $newName
\fBfile link\fR -symbolic $oldName $newName
.CE
.PP
On Windows, a file can be
.QW started
easily enough (equivalent to double-clicking on it in the Explorer
interface) but the name passed to the operating system must be in
native format:
.PP
.CS
exec {*}[auto_execok start] {} [\fBfile nativename\fR C:/Users/fred/example.txt]
.CE
.SH "SEE ALSO"
filename(n), open(n), close(n), eof(n), gets(n), tell(n), seek(n),
fblocked(n), flush(n)
+41
View File
@@ -0,0 +1,41 @@
'\"
'\" Copyright (c) 2025 Donal Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH frexp n 9.1 Tcl "Tcl Float Decomposition"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
frexp \- Split a floating-point number into fraction and exponent parts
.SH SYNOPSIS
\fBpackage require tcl 9.1\fR
.sp
\fBfrexp \fIvalue\fR
.BE
.SH DESCRIPTION
The \fBfrexp\fR command takes a floating-point number, \fIvalue\fR, and
returns a list of two values. The first element of the result is the
fractional part of \fIvalue\fR (signed, of magnitude between 0.5 and 1.0),
and the second element of the result is the integer exponent from \fIvalue\fR.
When \fIvalue\fR is infinite, the fraction is also infinite (of the same sign).
.SH EXAMPLE
.PP
The \fBfrexp\fR command is paired with the \fBldexp\fR function, like this:
.PP
.CS
set value 123.456
lassign [\fBfrexp\fR $value] frac exp
set recovered [expr { ldexp($frac, $exp) }]
puts "$value -> $frac*2**$exp -> $recovered"
# 123.456 -> 0.9645*2**7 -> 123.456
.CE
.SH "SEE ALSO"
expr(n), mathfunc(n), modf(n)
.SH KEYWORDS
floating point
'\" Local Variables:
'\" mode: nroff
'\" End:
+3 -3
View File
@@ -12,7 +12,7 @@
.SH NAME
global \- Access global variables
.SH SYNOPSIS
\fBglobal \fR?\fIvarname ...\fR?
\fBglobal \fR?\fIvarName ...\fR?
.BE
.SH DESCRIPTION
.PP
@@ -22,11 +22,11 @@ creates local variables linked to the corresponding global variables (though
these linked variables, like those created by \fBupvar\fR, are not included
in the list returned by \fBinfo locals\fR).
.PP
If \fIvarname\fR contains namespace qualifiers, the local variable's name is
If \fIvarName\fR contains namespace qualifiers, the local variable's name is
the unqualified name of the global variable, as determined by the
\fBnamespace tail\fR command.
.PP
\fIvarname\fR is always treated as the name of a variable, not an
\fIvarName\fR is always treated as the name of a variable, not an
array element. An error is returned if the name looks like an array element,
such as \fBa(b)\fR.
.SH EXAMPLES
+1 -1
View File
@@ -12,7 +12,7 @@
.SH NAME
history \- Manipulate the history list
.SH SYNOPSIS
\fBhistory \fR?\fIoption\fR? ?\fIarg arg ...\fR?
\fBhistory \fR?\fIoption\fR? ?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
+1 -1
View File
@@ -259,7 +259,7 @@ The default is \fButf-8\fR, as specified by RFC 2718.
The value of the User-Agent header in the HTTP request. In an unsafe
interpreter, the default value depends upon the operating system, and
the version numbers of \fBhttp\fR and \fBTcl\fR, and is (for example)
.QW "\fBMozilla/5.0 (Windows; U; Windows NT 10.0) http/2.10.1 Tcl/9.0.0\fR" .
.QW "\fBMozilla/5.0 (Windows; U; Windows NT 10.0) http/2.10.2 Tcl/9.0.0\fR" .
A safe interpreter cannot determine its operating system, and so the default
in a safe interpreter is to use a Windows 10 value with the current version
numbers of \fBhttp\fR and \fBTcl\fR.
+9 -9
View File
@@ -15,7 +15,7 @@
.SH NAME
info \- Information about the state of the Tcl interpreter
.SH SYNOPSIS
\fBinfo \fIoption \fR?\fIarg arg ...\fR?
\fBinfo \fIoption \fR?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
@@ -32,7 +32,7 @@ Returns the names of the parameters to the procedure named \fIprocname\fR.
Returns the body of the procedure named \fIprocname\fR.
.\" METHOD: class
.TP
\fBinfo class\fI subcommand class\fR ?\fIarg ...\fR
\fBinfo class\fI subcommand class\fR ?\fIarg ...\fR?
.
Returns information about the class named \fIclass\fR.
See \fBCLASS INTROSPECTION\fR below.
@@ -83,7 +83,7 @@ Returns the names of all commands visible in the current namespace. If
\fIpattern\fR is given, returns only those names that match according to
\fBstring match\fR. Only the last component of \fIpattern\fR is a pattern.
Other components identify a namespace. See \fBNAMESPACE RESOLUTION\fR in the
\fBnamespace\fR(n) documentation.
manual page for the \fBnamespace\fR command.
.\" METHOD: complete
.TP
\fBinfo complete \fIcommand\fR
@@ -161,7 +161,7 @@ defined, and \fB0\fR otherwise.
Returns the depth of the call to \fBinfo frame\fR itself. Otherwise, returns a
dictionary describing the active command at the \fIdepth\fR, which counts all
commands visible to \fBinfo level\fR, plus commands that don't create a new
level, such as \fBeval\fR, \fBsource\fR, or \fIuplevel\fR. The frame depth is
level, such as \fBeval\fR, \fBsource\fR, or \fBuplevel\fR. The frame depth is
always greater than the current level.
.RS
.PP
@@ -305,7 +305,7 @@ Returns the absolute pathname of the program for the current interpreter. If
such a file can not be identified an empty string is returned.
.\" METHOD: object
.TP
\fBinfo object\fI subcommand object\fR ?\fIarg ...\fR
\fBinfo object\fI subcommand object\fR ?\fIarg ...\fR?
.
Returns information about the object named \fIobject\fR. \fIsubcommand\fR is
described \fBOBJECT INTROSPECTION\fR below.
@@ -323,7 +323,7 @@ Returns the names of all visible procedures. If \fIpattern\fR is given, returns
only those names that match according to \fBstring match\fR. Only the final
component in \fIpattern\fR is actually considered a pattern. Any qualifying
components simply select a namespace. See \fBNAMESPACE RESOLUTION\fR in the
\fBnamespace\fR(n) documentation.
manual page of the \fBnamespace\fR command.
.\" METHOD: script
.TP
\fBinfo script\fR ?\fIfilename\fR?
@@ -354,7 +354,7 @@ If \fIpattern\fR is not given, returns the names of all visible variables. If
\fIpattern\fR is given, returns only those names that match according to
\fBstring match\fR. Only the last component of \fIpattern\fR is a pattern.
Other components identify a namespace. See \fBNAMESPACE RESOLUTION\fR in the
\fBnamespace\fR(n) documentation. When \fIpattern\fR is a qualified name,
manual page for the \fBnamespace\fR command. When \fIpattern\fR is a qualified name,
results are fully qualified.
.RS
.PP
@@ -528,7 +528,7 @@ This subcommand returns a list of all classes that have been mixed into the
class named \fIclass\fR.
.\" METHOD: properties
.TP
\fBinfo class properties\fI class\fR ?\fIoptions...\fR
\fBinfo class properties\fI class\fR ?\fIoptions ...\fR?
.VS TIP558
This subcommand returns a sorted list of properties defined on the class named
\fIclass\fR. The \fIoptions\fR define exactly which properties are returned:
@@ -761,7 +761,7 @@ This subcommand returns the name of the internal namespace of the object named
\fIobject\fR.
.\" METHOD: properties
.TP
\fBinfo object properties\fI object\fR ?\fIoptions...\fR
\fBinfo object properties\fI object\fR ?\fIoptions...\fR?
.VS TIP558
This subcommand returns a sorted list of properties defined on the object
named \fIobject\fR. The \fIoptions\fR define exactly which properties are
+12 -10
View File
@@ -13,7 +13,7 @@
.SH NAME
interp \- Create and manipulate Tcl interpreters
.SH SYNOPSIS
\fBinterp \fIsubcommand \fR?\fIarg arg ...\fR?
\fBinterp \fIsubcommand \fR?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
@@ -105,7 +105,7 @@ Deletes the alias for \fIsrcToken\fR in the child interpreter identified by
was created; if the source command has been renamed, the renamed
command will be deleted.
.TP
\fBinterp alias\fI srcPath srcCmd targetPath targetCmd \fR?\fIarg arg ...\fR?
\fBinterp alias\fI srcPath srcCmd targetPath targetCmd \fR?\fIarg ...\fR?
.
This command creates an alias between one child and another (see the
\fBalias\fR child command below for creating aliases between a child
@@ -206,13 +206,15 @@ The initial recursion limit of the child interpreter is set to the
current recursion limit of its parent interpreter.
.\" METHOD: debug
.TP
\fBinterp debug \fIpath\fR ?\fB\-frame\fR ?\fIbool\fR??
\fBinterp debug \fIpath\fR ?\fB\-frame\fR?
.TP
\fBinterp debug \fIpath\fR ?\fB\-frame\fR \fIboolean\fR?
.
Controls whether frame-level stack information is captured in the
child interpreter identified by \fIpath\fR. If no arguments are
given, option and current setting are returned. If \fB\-frame\fR
is given, the debug setting is set to the given boolean if provided
and the current setting is returned.
specified, the option and its current setting are returned. If \fB\-frame\fR
is specified, the current setting is returned. If \fIboolean\fR if provided as well,
the debug setting is set to the specified value.
This only affects the output of \fBinfo frame\fR, in that exact
frame-level information for command invocation at the bytecode level
is only captured with this setting on.
@@ -470,7 +472,7 @@ Deletes the alias for \fIsrcToken\fR in the child interpreter.
was created; if the source command has been renamed, the renamed
command will be deleted.
.TP
\fIchild \fBalias \fIsrcCmd targetCmd \fR?\fIarg ..\fR?
\fIchild \fBalias \fIsrcCmd targetCmd \fR?\fIarg ...\fR?
.
Creates an alias such that whenever \fIsrcCmd\fR is invoked
in \fIchild\fR, \fItargetCmd\fR is invoked in the parent.
@@ -493,7 +495,7 @@ what to set the interpreter's background exception handler to. See the
\fBBACKGROUND EXCEPTION HANDLING\fR section for more details.
.\" METHOD: eval
.TP
\fIchild \fBeval \fIarg \fR?\fIarg ..\fR?
\fIchild \fBeval \fIarg \fR?\fIarg ...\fR?
.
This command concatenates all of the \fIarg\fR arguments in
the same fashion as the \fBconcat\fR command, then evaluates
@@ -543,7 +545,7 @@ For more details on hidden commands, see \fBHIDDEN COMMANDS\fR, below.
Returns a list of the names of all hidden commands in \fIchild\fR.
.\" METHOD: invokehidden
.TP
\fIchild \fBinvokehidden\fR ?\fI\-option ...\fR? \fIhiddenName \fR?\fIarg ..\fR?
\fIchild \fBinvokehidden\fR ?\fI\-option ...\fR? \fIhiddenName \fR?\fIarg ...\fR?
.
This command invokes the hidden command \fIhiddenName\fR with the
supplied arguments, in \fIchild\fR. No substitutions or evaluations are
@@ -597,7 +599,7 @@ is already trusted.
.
Returns the maximum allowable nesting depth for the \fIchild\fR interpreter.
If \fInewlimit\fR is specified, the recursion limit in \fIchild\fR will be
set so that nesting of more than \fInewlimit\fR calls to \fBTcl_Eval()\fR
set so that nesting of more than \fInewlimit\fR calls to \fBTcl_Eval\fR
and related procedures in \fIchild\fR will return an error.
The \fInewlimit\fR value is also returned.
The \fInewlimit\fR value must be a positive integer between 1 and the
+1 -1
View File
@@ -13,7 +13,7 @@
.SH NAME
lappend \- Append list elements onto a variable
.SH SYNOPSIS
\fBlappend \fIvarName \fR?\fIvalue value value ...\fR?
\fBlappend \fIvarName \fR?\fIvalue ...\fR?
.BE
.SH DESCRIPTION
.PP
+1 -1
View File
@@ -11,7 +11,7 @@
.SH NAME
ledit \- Replace elements of a list stored in variable
.SH SYNOPSIS
\fBledit \fIlistVar first last \fR?\fIvalue value ...\fR?
\fBledit \fIlistVar first last \fR?\fIvalue ...\fR?
.BE
.SH DESCRIPTION
.PP
+97
View File
@@ -0,0 +1,97 @@
'\"
'\" Copyright (c) 2025 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH lfilter n "" Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
lfilter \- Select elements from a list based on an expression
.SH SYNOPSIS
\fBlfilter \fIvarname list expression\fR
.br
\fBlfilter \fIvarlist1 list1\fR ?\fIvarlist2 list2 ...\fR? \fIbody\fR
.BE
.SH DESCRIPTION
.PP
The \fBlfilter\fR command implements a loop where the loop variable(s) take on
values from one or more lists, and the loop returns a list of values from the
(first) list where the \fIbody\fR script evaluates to a true value.
.PP
In the simplest case there is one loop variable, \fIvarname\fR, and one list,
\fIlist\fR, that is a list of values to assign to \fIvarname\fR. The
\fIbody\fR argument is a Tcl script. For each element of \fIlist\fR
(in order from first to last), \fBlfilter\fR assigns the contents of the
element to \fIvarname\fR as if the \fBlindex\fR command had been used to
extract the element, then calls the Tcl interpreter to execute \fIbody\fR.
If execution of the script completes normally and produces a true value,
that element of \fIlist\fR is appended to an accumulator list. \fBlmap\fR
returns the accumulator list.
.PP
In the general case there can be more than one value list (e.g., \fIlist1\fR
and \fIlist2\fR), and each value list can be associated with a list of loop
variables (e.g., \fIvarlist1\fR and \fIvarlist2\fR). During each iteration of
the loop the variables of each \fIvarlist\fR are assigned consecutive values
from the corresponding \fIlist\fR. Values in each \fIlist\fR are used in order
from first to last, and each value is used exactly once. The total number of
loop iterations is large enough to use up all the values from all the value
lists. If a value list does not contain enough elements for each of its loop
variables in each iteration, empty values are used for the missing elements.
For each iteration, the value that is appended when \fIbody\fR yields
a true value (i.e., anything accepted by \fBTcl_GetBooleanFromObj\fR as a
boolean) is the value that was assigned to the first variable of the first
list of variables; all other values are not collected.
.PP
The \fBbreak\fR and \fBcontinue\fR statements may be invoked inside
\fIbody\fR, with the same effect as in the \fBfor\fR and \fBforeach\fR
commands. In these cases the body does not complete normally and the lead value
is not appended to the accumulator list.
.SH EXAMPLES
.PP
Select the elements of the list that are odd:
.PP
.CS
\fBlfilter\fR x {0 2 4 1 3 5 10 8 6 11 9 7} {
expr {($x % 2) == 1}
}
# The result is "1 3 5 11 9 7"
.CE
.PP
Select elements of a list according to a condition in another list:
.PP
.CS
\fBlfilter\fR x [lseq 10] y [lseq 0 .. 1 by 0.1] {
expr {$y > 0.3 && $y < 0.7}
}
# The result is "4 5 6"
.CE
.PP
Select the elements containing at least five characters:
.PP
.CS
set sentence "The quick brown fox jumps over the lazy dog."
\fBlfilter\fR word [split $sentence] {
expr {[string length $word] >= 5}
}
# The result is "quick brown jumps"
.CE
.PP
Select the elements that are true palindromes:
.PP
.CS
set usernames {tom bob steve dood}
\fBlfilter\fR word $usernames {
string equal $word [string reverse $word]
}
# The result is "bob dood"
.CE
.SH "SEE ALSO"
dict(n), foreach(n), lmap(n), lsearch(n)
.SH KEYWORDS
foreach, iteration, list, loop, filter
'\" Local Variables:
'\" mode: nroff
'\" End:
+74 -53
View File
@@ -15,7 +15,7 @@ auto_execok, auto_import, auto_load, auto_mkindex, auto_qualify, auto_reset, for
\fBauto_execok \fIcmd\fR
\fBauto_import \fIpattern\fR
\fBauto_load \fIcmd\fR
\fBauto_mkindex \fIdir pattern pattern ...\fR
\fBauto_mkindex\fR \fIdir\fR ?\fIpattern ...\fR?
\fBauto_qualify \fIcommand namespace\fR
\fBauto_reset\fR
\fBtcl_findLibrary \fIbasename version patch initScript enVarName varName\fR
@@ -66,25 +66,59 @@ The following procedures are provided in the Tcl library:
.TP
\fBauto_execok \fIcmd\fR
.
Determines whether there is an executable file or shell builtin
by the name \fIcmd\fR. If so, it returns a list of arguments to be
passed to \fBexec\fR to execute the executable file or shell builtin
named by \fIcmd\fR. If not, it returns an empty string. This command
examines the directories in the current search path (given by the PATH
environment variable) in its search for an executable file named
\fIcmd\fR. On Windows platforms, the search is expanded with the same
directories and file extensions as used by \fBexec\fR. \fBAuto_execok\fR
remembers information about previous searches in an array named
\fBauto_execs\fR; this avoids the path search in future calls for the
same \fIcmd\fR. The command \fBauto_reset\fR may be used to force
\fBauto_execok\fR to forget its cached information.
The command returns a list of arguments to be passed to \fBexec\fR to
execute the external program named by \fIcmd\fR. If no such program is
found, the command returns an empty list. Callers must not make any
assumptions about any returned paths being in any particular form such
as normalized, absolute, native or canonical.
.RS
.PP
For example, to run the \fIumask\fR shell builtin on Linux, you would do:
On platforms other than Windows, if \fIcmd\fR contains any path
separators, \fBauto_execok\fR checks for the existence of an executable
file with that path. If present, it is returned as the first element of
the returned list. Note that this may be a relative path. If \fIcmd\fR
does not contain any path separators, all directories in the \fBPATH\fR
environment variable are searched for an executable file of that name.
If found, a list containing a single element holding the full path to
the file is returned.
.PP
.CS
exec {*}[\fBauto_execok\fR umask]
.CE
The rest of this description applies to Windows platforms.
.PP
If \fIcmd\fR contains path separators, the command checks for the
existence of a file of that name. If found, the file associations in the
Windows registry is looked up to retrieve the template for the file's
extension. On success, the template is processed to replace environment
variables, placeholders for the file path, converted to list form and
returned. Otherwise, an empty list is returned.
.PP
If \fIcmd\fR does not contain path separators, it is first matched
against the built-in commands in the \fBcmd.exe\fR command shell.
Built-ins that are intended only for batch file use are excluded. On a
match, the returned list is the list of arguments to be passed to
\fBexec\fR to run the built-in using \fBcmd.exe\fR.
.PP
Next, \fBauto_execok\fR searches directories in the following order:
the directory of the process executable, the current working directory
(subject to conditions described below), the Windows \fBsystem32\fR
directory, the Windows directory and the directories in the \fBPATH\fR
environment variable. Within each directory, the command will look for
a file matching the passed name, and if not found, for a file matching
the passed name appended with extensions listed in the \fBPATHEXT\fR
environment variable. The extension of the matched file is looked up in
the file associations in the registry and the corresponding template is
returned after processing as described earlier.
.PP
Inclusion of the current working directory in the list of examined
directories depends on Windows system settings retrieved with the
\fBNeedCurrentDirectoryForExePathW\fR Win32 API. Refer to its
documentation for details. Note that if the current directory, \fB.\fR,
is explicitly included in \fBPATH\fR, it is not affected by this
setting.
.PP
Finally, if all above fails, \fIcmd\fR is looked up in the \fBApp
Paths\fR key in the Windows registry after appending \fB.exe\fR if not
already present. If listed there as a registered application, its path
is returned as the first (and only) list element.
.PP
To run the \fIDIR\fR shell builtin on Windows, you would do:
.PP
@@ -92,7 +126,18 @@ To run the \fIDIR\fR shell builtin on Windows, you would do:
exec {*}[\fBauto_execok\fR dir]
.CE
.PP
To discover if there is a \fIfrobnicate\fR binary on the user's PATH,
To open a \fB.txt\fR file on Windows with the associated program,
you would do:
.PP
.CS
exec {*}[\fBauto_execok\fR path/to/foo.txt]
.CE
.PP
Note in the above that since \fB.txt\fR is not generally included in
\fBPATHEXT\fR, the passed name is not searched for even if it does not
include any path separators.
.PP
To discover if there is a \fIfrobnicate\fR that can be run by \fBexec\fR,
you would do:
.PP
.CS
@@ -103,7 +148,7 @@ set mayFrob [expr {[llength [\fBauto_execok\fR frobnicate]] > 0}]
.TP
\fBauto_import \fIpattern\fR
.
\fBAuto_import\fR is invoked during \fBnamespace import\fR to see if
\fBauto_import\fR is invoked during \fBnamespace import\fR to see if
the imported commands specified by \fIpattern\fR reside in an
autoloaded library. If so, the commands are loaded so that they will
be available to the interpreter for creating the import links. If the
@@ -121,7 +166,8 @@ It is not normally necessary to call this command directly.
This command attempts to load the definition for a Tcl command named
\fIcmd\fR. To do this, it searches an \fIauto-load path\fR, which is
a list of one or more directories. The auto-load path is given by the
global variable \fBauto_path\fR if it exists. If there is no
global variable \fBauto_path\fR if it exists (see the tclvars manual page).
If there is no
\fBauto_path\fR variable, then the \fBTCLLIBPATH\fR environment variable is
used, if it exists. Otherwise the auto-load path consists of just the
Tcl library directory. Within each directory in the auto-load path
@@ -135,7 +181,7 @@ successfully created. The command returns 0 if there was no index
entry for \fIcmd\fR or if the script did not actually define \fIcmd\fR
(e.g. because index information is out of date). If an error occurs
while processing the script, then that error is returned.
\fBAuto_load\fR only reads the index information once and saves it in
\fBauto_load\fR only reads the index information once and saves it in
the array \fBauto_index\fR; future calls to \fBauto_load\fR check for
\fIcmd\fR in the array rather than re-reading the index files. The
cached index information may be deleted with the command
@@ -148,7 +194,7 @@ default \fBunknown\fR handler will do so.
.RE
.\" COMMAND: auto_mkindex
.TP
\fBauto_mkindex \fIdir pattern pattern ...\fR
\fBauto_mkindex \fIdir\fR ?\fIpattern ...\fR?
.
Generates an index suitable for use by \fBauto_load\fR. The command
searches \fIdir\fR for all files whose names match any of the
@@ -166,14 +212,14 @@ named \fBtclIndex\fR in \fIdir\fR. If no pattern is given a pattern of
will read all the \fB.tcl\fR files in subdirectory \fBfoo\fR and
generate a new index file \fBfoo/tclIndex\fR.
.PP
\fBAuto_mkindex\fR parses the Tcl scripts by sourcing them into a
\fBauto_mkindex\fR parses the Tcl scripts by sourcing them into a
child interpreter and monitoring the proc and namespace commands that
are executed. Extensions can use the (undocumented)
auto_mkindex_parser package to register other commands that can
contribute to the auto_load index. You will have to read through
auto.tcl to see how this works.
.PP
\fBAuto_mkindex_old\fR
\fBauto_mkindex_old\fR
(which has the same syntax as \fBauto_mkindex\fR)
parses the Tcl scripts in a relatively
unsophisticated way: if any line contains the word
@@ -195,7 +241,7 @@ code or procedure names with special characters like \fB$\fR,
.
Destroys all the information cached by \fBauto_execok\fR and
\fBauto_load\fR. This information will be re-read from disk the next
time it is needed. \fBAuto_reset\fR also deletes any procedures
time it is needed. \fBauto_reset\fR also deletes any procedures
listed in the auto-load index, so that fresh copies of them will be
loaded the next time that they are used.
.\" COMMAND: auto_qualify
@@ -215,7 +261,7 @@ were a command in the global namespace. Otherwise, if either
if it were a command in the global namespace.
.RS
.PP
\fBAuto_qualify\fR is used by the auto-loading facilities in Tcl, both
\fBauto_qualify\fR is used by the auto-loading facilities in Tcl, both
for producing auto-loading indexes such as \fIpkgIndex.tcl\fR, and for
performing the actual auto-loading of functions at runtime.
.RE
@@ -403,32 +449,6 @@ any commands.
.
If set to any value, then \fBunknown\fR will not attempt to auto-load
any commands.
.\" VARIABLE: auto_path
.TP
\fBauto_path\fR
.
If set, then it must contain a valid Tcl list giving directories to
search during auto-load operations (including for package index
files when using the default \fBpackage unknown\fR handler).
This variable is initialized during startup to contain, in order:
the directories listed in the \fBTCLLIBPATH\fR environment variable,
the directory named by the \fBtcl_library\fR global variable,
the parent directory of \fBtcl_library\fR,
the directories listed in the \fBtcl_pkgPath\fR variable.
Additional locations to look for files and package indices should
normally be added to this variable using \fBlappend\fR.
.RS
.PP
For example, to add the \fIlib\fR directory next to the running
script, you would do:
.PP
.CS
lappend \fBauto_path\fR [file dirname [info script]]/lib
.CE
.PP
Note that if the script uses \fBcd\fR, it is advisable to ensure that
entries on the \fBauto_path\fR are \fBfile normalize\fRd.
.RE
.\" VARIABLE: env(TCL_LIBRARY)
.TP
\fBenv(TCL_LIBRARY)\fR
@@ -453,7 +473,8 @@ search during auto-load operations. Directories must be specified in
Tcl format, using
.QW /
as the path separator, regardless of platform.
This variable is only used when initializing the \fBauto_path\fR variable.
This variable is only used when initializing the \fBauto_path\fR variable
(see the \fBauto_load\fR command).
.RS
.PP
A key consequence of this variable is that it gives a way to let the user
+1 -1
View File
@@ -13,7 +13,7 @@
.SH NAME
linsert \- Insert elements into a list
.SH SYNOPSIS
\fBlinsert \fIlist index \fR?\fIelement element ...\fR?
\fBlinsert \fIlist index \fR?\fIelement ...\fR?
.BE
.SH DESCRIPTION
.PP
+1 -1
View File
@@ -13,7 +13,7 @@
.SH NAME
list \- Create a list
.SH SYNOPSIS
\fBlist \fR?\fIarg arg ...\fR?
\fBlist \fR?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
+1 -1
View File
@@ -150,7 +150,7 @@ The following is a minimal extension:
#include <tcl.h>
#include <stdio.h>
static int fooCmd(void *clientData,
Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]) {
Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const *objv) {
printf("called with %d arguments\en", objc);
return TCL_OK;
}
+1 -1
View File
@@ -11,7 +11,7 @@
.SH NAME
lpop \- Get and remove an element in a list
.SH SYNOPSIS
\fBlpop \fIvarName ?index ...\fR?
\fBlpop \fIvarName\fR ?\fIindex ...\fR?
.BE
.SH DESCRIPTION
.PP
+1 -1
View File
@@ -13,7 +13,7 @@
.SH NAME
lreplace \- Replace elements in a list with new elements
.SH SYNOPSIS
\fBlreplace \fIlist first last \fR?\fIelement element ...\fR?
\fBlreplace \fIlist first last \fR?\fIelement ...\fR?
.BE
.SH DESCRIPTION
.PP
+3 -3
View File
@@ -35,19 +35,19 @@ last matching style given takes precedence.
.TP
\fB\-exact\fR
.
\fIPattern\fR is a literal string that is compared for exact equality
\fIpattern\fR is a literal string that is compared for exact equality
against each list element.
.\" OPTION: -glob
.TP
\fB\-glob\fR
.
\fIPattern\fR is a glob-style pattern which is matched against each list
\fIpattern\fR is a glob-style pattern which is matched against each list
element using the same rules as the \fBstring match\fR command.
.\" OPTION: -regexp
.TP
\fB\-regexp\fR
.
\fIPattern\fR is treated as a regular expression and matched against
\fIpattern\fR is treated as a regular expression and matched against
each list element using the rules described in the \fBre_syntax\fR
reference page.
.\" OPTION: -sorted
+209 -9
View File
@@ -18,17 +18,46 @@ mathfunc \- Mathematical functions for Tcl expressions
\fB::tcl::mathfunc::abs\fI arg\fR
\fB::tcl::mathfunc::acos\fI arg\fR
.VS TIP745
\fB::tcl::mathfunc::acosh\fI arg\fR
.VE TIP745
\fB::tcl::mathfunc::asin\fI arg\fR
.VS TIP745
\fB::tcl::mathfunc::asin\fI arg\fR
.VE TIP745
\fB::tcl::mathfunc::atan\fI arg\fR
\fB::tcl::mathfunc::atan2\fI y x\fR
.VS TIP745
\fB::tcl::mathfunc::atan\fI arg\fR
.VE TIP745
\fB::tcl::mathfunc::bool\fI arg\fR
.VS TIP745
\fB::tcl::mathfunc::cbrt\fI arg\fR
.VE TIP745
\fB::tcl::mathfunc::ceil\fI arg\fR
.VS TIP745
\fB::tcl::mathfunc::copysign\fI x y\fR
.VE TIP745
\fB::tcl::mathfunc::cos\fI arg\fR
\fB::tcl::mathfunc::cosh\fI arg\fR
.VS TIP745
\fB::tcl::mathfunc::dim\fI x y\fR
.VE TIP745
\fB::tcl::mathfunc::double\fI arg\fR
\fB::tcl::mathfunc::entier\fI arg\fR
.VS TIP745
\fB::tcl::mathfunc::erf\fI arg\fR
\fB::tcl::mathfunc::erfc\fI arg\fR
.VE TIP745
\fB::tcl::mathfunc::exp\fI arg\fR
.VS TIP745
\fB::tcl::mathfunc::exp2\fI arg\fR
\fB::tcl::mathfunc::expm1\fI arg\fR
.VE TIP745
\fB::tcl::mathfunc::floor\fI arg\fR
.VS TIP745
\fB::tcl::mathfunc::fma\fI x y z\fR
.VE TIP745
\fB::tcl::mathfunc::fmod\fI x y\fR
\fB::tcl::mathfunc::hypot\fI x y\fR
\fB::tcl::mathfunc::int\fI arg\fR
@@ -43,19 +72,40 @@ mathfunc \- Mathematical functions for Tcl expressions
\fB::tcl::mathfunc::issubnormal\fI arg\fR
\fB::tcl::mathfunc::isunordered\fI x y\fR
.VE TIP521
.VS TIP745
\fB::tcl::mathfunc::lgamma\fI arg\fR
.VE TIP745
\fB::tcl::mathfunc::log\fI arg\fR
\fB::tcl::mathfunc::log10\fI arg\fR
.VS TIP745
\fB::tcl::mathfunc::log1p\fI arg\fR
\fB::tcl::mathfunc::log2\fI arg\fR
\fB::tcl::mathfunc::logb\fI arg\fR
.VE TIP745
\fB::tcl::mathfunc::max\fI arg\fR ?\fIarg ...\fR?
\fB::tcl::mathfunc::min\fI arg\fR ?\fIarg ...\fR?
.VS TIP745
\fB::tcl::mathfunc::nextafter\fI x y\fR
.VE TIP745
\fB::tcl::mathfunc::pow\fI x y\fR
\fB::tcl::mathfunc::rand\fR
.VS TIP745
\fB::tcl::mathfunc::remainder\fI x y\fR
.VE TIP745
\fB::tcl::mathfunc::round\fI arg\fR
.VS TIP745
\fB::tcl::mathfunc::signbit\fI arg\fR
.VE TIP745
\fB::tcl::mathfunc::sin\fI arg\fR
\fB::tcl::mathfunc::sinh\fI arg\fR
\fB::tcl::mathfunc::sqrt\fI arg\fR
\fB::tcl::mathfunc::srand\fI arg\fR
\fB::tcl::mathfunc::tan\fI arg\fR
\fB::tcl::mathfunc::tanh\fI arg\fR
.VS TIP745
\fB::tcl::mathfunc::gamma\fI arg\fR
\fB::tcl::mathfunc::trunc\fI arg\fR
.VE TIP745
\fB::tcl::mathfunc::wide\fI arg\fR
.fi
.BE
@@ -74,15 +124,20 @@ Tcl supports the following mathematical functions in expressions, all
of which work solely with floating-point numbers unless otherwise noted:
.DS
.ta 3.2c 6.4c 9.6c
\fBabs\fR \fBacos\fR \fBasin\fR \fBatan\fR
\fBatan2\fR \fBbool\fR \fBceil\fR \fBcos\fR
\fBcosh\fR \fBdouble\fR \fBentier\fR \fBexp\fR
\fBfloor\fR \fBfmod\fR \fBhypot\fR \fBint\fR
\fBabs\fR \fBacos\fR \fBacosh\fR \fBasin\fR
\fBasinh\fR \fBatan\fR \fBatan2\fR \fBatanh\fR
\fBbool\fR \fBcbrt\fR \fBcopysign\fR \fBceil\fR
\fBcos\fR \fBcosh\fR \fBdim\fR \fBdouble\fR
\fBentier\fR \fBerf\fR \fBerfc\fR \fBexp\fR
\fBexp2\fR \fBexpm1\fR \fBfloor\fR \fBfma\fR
\fBfmod\fR \fBgamma\fR \fBhypot\fR \fBint\fR
\fBisfinite\fR \fBisinf\fR \fBisnan\fR \fBisnormal\fR
\fBisqrt\fR \fBissubnormal\fR \fBisunordered\fR \fBlog\fR
\fBlog10\fR \fBmax\fR \fBmin\fR \fBpow\fR
\fBrand\fR \fBround\fR \fBsin\fR \fBsinh\fR
\fBsqrt\fR \fBsrand\fR \fBtan\fR \fBtanh\fR
\fBisqrt\fR \fBissubnormal\fR \fBisunordered\fR \fBldexp\fR
\fBlgamma\fR \fBlog\fR \fBlog10\fR \fBlog1p\fR
\fBlog2\fR \fBlogb\fR \fBmax\fR \fBmin\fR
\fBnextafter\fR \fBpow\fR \fBrand\fR \fBremainder\fR
\fBround\fR \fBsin\fR \fBsinh\fR \fBsqrt\fR
\fBsrand\fR \fBtan\fR \fBtanh\fR \fBtrunc\fR
\fBwide\fR
.DE
.PP
@@ -103,12 +158,25 @@ integer or floating-point, and the result is returned in the same form.
.
Returns the arc cosine of \fIarg\fR, in the range [\fI0\fR,\fIpi\fR]
radians. \fIArg\fR should be in the range [\fI\-1\fR,\fI1\fR].
.\" COMMAND: acosh
.TP
\fBacosh \fIarg\fR
.VS TIP745
Returns the arc hyperbolic cosine of \fIarg\fR, in the range [\fI0\fR,\fIinf\fR]
radians. \fIArg\fR should be in the range [\fI1\fR,\fIinf\fR].
.VE TIP745
.\" COMMAND: asin
.TP
\fBasin \fIarg\fR
.
Returns the arc sine of \fIarg\fR, in the range [\fI\-pi/2\fR,\fIpi/2\fR]
radians. \fIArg\fR should be in the range [\fI\-1\fR,\fI1\fR].
.\" COMMAND: asinh
.TP
\fBasinh \fIarg\fR
.VS TIP745
Returns the arc hyperbolic sine of \fIarg\fR, in the range [\fI\-inf\fR,\fIinf\fR].
.VE TIP745
.\" COMMAND: atan
.TP
\fBatan \fIarg\fR
@@ -123,6 +191,13 @@ Returns the arc tangent of \fIy\fR/\fIx\fR, in the range [\fI\-pi\fR,\fIpi\fR]
radians. \fIx\fR and \fIy\fR cannot both be 0. If \fIx\fR is greater
than \fI0\fR, this is equivalent to
.QW "\fBatan \fR[\fBexpr\fR {\fIy\fB/\fIx\fR}]" .
.\" COMMAND: atanh
.TP
\fBatanh \fIarg\fR
.VS TIP745
Returns the arc hyperbolic tangent of \fIarg\fR, in the range [\fI\-inf\fR,\fIinf\fR].
\fIArg\fR should be in the range [\fI\-1\fR,\fI1\fR].
.VE TIP745
.\" COMMAND: bool
.TP
\fBbool \fIarg\fR
@@ -132,6 +207,15 @@ Accepts any numeric value, or any string acceptable to
boolean value \fB0\fR or \fB1\fR. Non-zero numbers are true.
Other numbers are false. Non-numeric strings produce boolean value in
agreement with \fBstring is true\fR and \fBstring is false\fR.
.\" COMMAND: cbrt
.TP
\fBcbrt \fIarg\fR
.VS TIP745
The argument may be any numeric value. Returns a floating-point
value that is the cube root of \fIarg\fR. May return \fBInf\fR when the
argument is a numeric value that exceeds the cube of the maximum value of
the floating-point range.
.VE TIP745
.\" COMMAND: ceil
.TP
\fBceil \fIarg\fR
@@ -139,6 +223,12 @@ agreement with \fBstring is true\fR and \fBstring is false\fR.
Returns the smallest integral floating-point value (i.e. with a zero
fractional part) not less than \fIarg\fR. The argument may be any
numeric value.
.\" COMMAND: copysign
.TP
\fBcopysign \fIx y\fR
.VS TIP745
Returns the floating-point value with the magnitude of \fIx\fR and sign of \fIy\fR.
.VE TIP745
.\" COMMAND: cos
.TP
\fBcos \fIarg\fR
@@ -150,6 +240,12 @@ Returns the cosine of \fIarg\fR, measured in radians.
.
Returns the hyperbolic cosine of \fIarg\fR. If the result would cause
an overflow, an error is returned.
.\" COMMAND: dim
.TP
\fBdim \fIx y\fR
.VS TIP745
Returns the floating-point value that is the maximum of 0 and \fIx\fR\-\fIy\fR.
.VE TIP745
.\" COMMAND: double
.TP
\fBdouble \fIarg\fR
@@ -167,12 +263,41 @@ The argument may be any numeric value. The integer part of \fIarg\fR
is determined and returned. The integer range returned by this function
is unlimited, unlike \fBint\fR and \fBwide\fR which
truncate their range to fit in particular storage widths.
.\" COMMAND: erf
.TP
\fBerf \fIarg\fR
.VS TIP745
Computes the Gauss error function of the numeric value \fIarg\fR.
.VE TIP745
.\" COMMAND: erfc
.TP
\fBerfc \fIarg\fR
.VS TIP745
Computes the complementary error function of the numeric value \fIarg\fR.
.VE TIP745
.\" COMMAND: exp
.TP
\fBexp \fIarg\fR
.
Returns the exponential of \fIarg\fR, defined as \fIe\fR**\fIarg\fR.
If the result would cause an overflow, an error is returned.
.\" COMMAND: exp2
.TP
\fBexp2 \fIarg\fR
.VS TIP745
Returns the 2 to the power of \fIarg\fR, defined as \fB2\fR**\fIarg\fR.
The result is always a floating point number except if it would cause an
overflow, when an error is returned.
.VE TIP745
.\" COMMAND: expm1
.TP
\fBexpm1 \fIarg\fR
.VS TIP745
Returns the exponential of \fIarg\fR, minus 1, defined as \fIe\fR**\fIarg\fR\-\fB1\fR.
If the result would cause an overflow, an error is returned.
Use of this function can be numerically preferable to of \fBexp\fR for values
close to 1, and is matched with \fBlog1p\fR.
.VE TIP745
.\" COMMAND: floor
.TP
\fBfloor \fIarg\fR
@@ -180,12 +305,26 @@ If the result would cause an overflow, an error is returned.
Returns the largest integral floating-point value (i.e. with a zero
fractional part) not greater than \fIarg\fR. The argument may be
any numeric value.
.\" COMMAND: fma
.TP
\fBfma \fIx y z\fR
.VS TIP745
Returns the floating-point value that is the sum of the product of \fIx\fR and
\fIy\fR, and \fIz\fR, without unnecessarily losing intermediate accuracy.
.VE TIP745
.\" COMMAND: fmod
.TP
\fBfmod \fIx y\fR
.
Returns the floating-point remainder of the division of \fIx\fR by
\fIy\fR. If \fIy\fR is 0, an error is returned.
.\" COMMAND: gamma
.TP
\fBgamma \fIarg\fR
.VS TIP745
Returns the absolute value of the gamma function of \fIarg\fR (a generalized factorial).
If the result would cause an overflow, an error is returned.
.VE TIP745
.\" COMMAND: hypot
.TP
\fBhypot \fIx y\fR
@@ -263,6 +402,19 @@ are both chosen from among the set of zero, subnormal, normal and infinite
values. Throws an error if either \fIx\fR or \fIy\fR cannot be promoted to a
floating-point value.
.VE TIP521
.\" COMMAND: ldexp
.TP
\fBldexp \fIx y\fR
.VS TIP745
Multiplies a floating-point value \fIx\fR by the number 2 raised to the \fIy\fR power.
.VE TIP745
.\" COMMAND: lgamma
.TP
\fBlgamma \fIarg\fR
.VS TIP745
Returns the natural logarithm of the absolute value of the gamma function of \fIarg\fR.
If the result would cause an overflow, an error is returned.
.VE TIP745
.\" COMMAND: log
.TP
\fBlog \fIarg\fR
@@ -275,6 +427,28 @@ positive value.
.
Returns the base 10 logarithm of \fIarg\fR. \fIArg\fR must be a
positive value.
.\" COMMAND: log1p
.TP
\fBlog1p \fIarg\fR
.VS TIP745
Returns the natural logarithm of \fIarg\fR+\fB1\fR. \fIArg\fR must be a
value greater than \-1. This function is numerically preferable to \fBlog\fR
for values very close to 1, and is matched with \fBexpm1\fR.
.VE TIP745
.\" COMMAND: log2
.TP
\fBlog2 \fIarg\fR
.VS TIP745
Returns the base 2 logarithm of \fIarg\fR. \fIArg\fR must be a
positive value.
.VE TIP745
.\" COMMAND: logb
.TP
\fBlogb \fIarg\fR
.VS TIP745
Returns the value of the unbiased radix-independent exponent from the
floating-point argument \fIarg\fR.
.VE TIP745
.\" COMMAND: max
.TP
\fBmax \fIarg\fB \fR...
@@ -287,6 +461,13 @@ with the greatest value.
.
Accepts one or more numeric arguments. Returns the one argument
with the least value.
.\" COMMAND: nextafter
.TP
\fBnextafter \fIx y\fR
.VS TIP745
Returns the next floating-point value after (or before) \fIx\fR in the
direction of \fIy\fR. If \fIx\fR and \fIy\fR are equal, returns \fIy\fR.
.VE TIP745
.\" COMMAND: pow
.TP
\fBpow \fIx y\fR
@@ -304,12 +485,24 @@ determines all future results from subsequent calls to \fBrand\fR, so
\fBrand\fR should not be used to generate a sequence of secrets, such as
one-time passwords. The seed of the generator is initialized from the
internal clock of the machine or may be set with the \fBsrand\fR function.
.\" COMMAND: remainder
.TP
\fBremainder \fIx y\fR
.VS TIP745
Computes the IEEE remainder of the floating point division operation \fIx\fR/\fIy\fR.
.VE TIP745
.\" COMMAND: round
.TP
\fBround \fIarg\fR
.
If \fIarg\fR is an integer value, returns \fIarg\fR, otherwise converts
\fIarg\fR to integer by rounding and returns the converted value.
.\" COMMAND: signbit
.TP
\fBsignbit \fIarg\fR
.VS TIP745
Get the sign bit of the numeric value, \fIarg\fR, as 0 (positive) or 1 (negative).
.VE TIP745
.\" COMMAND: sin
.TP
\fBsin \fIarg\fR
@@ -346,6 +539,12 @@ Returns the tangent of \fIarg\fR, measured in radians.
\fBtanh \fIarg\fR
.
Returns the hyperbolic tangent of \fIarg\fR.
.\" COMMAND: trunc
.TP
\fBtrunc \fIarg\fR
.VS TIP745
Returns the nearest integer not greater in magnitude than \fIarg\fR.
.VE TIP745
.\" COMMAND: wide
.TP
\fBwide \fIarg\fR
@@ -354,7 +553,8 @@ The argument may be any numeric value. The integer part of \fIarg\fR
is determined, and then the low order 64 bits of that integer value
are returned as an integer value.
.SH "SEE ALSO"
expr(n), fpclassify(n), mathop(n), namespace(n)
divmod(n), expr(n), fpclassify(n), frexp(n),
mathop(n), modf(n), namespace(n), remquo(n)
.SH "COPYRIGHT"
.nf
Copyright \(co 1993 The Regents of the University of California.
+4 -4
View File
@@ -9,7 +9,7 @@
.SH NAME
memory \- Control Tcl memory debugging capabilities
.SH SYNOPSIS
\fBmemory \fIoption \fR?\fIarg arg ...\fR?
\fBmemory \fIoption \fR?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
@@ -43,7 +43,7 @@ to \fBTcl_Free\fR), the current bytes allocated, and the maximum number
of packets and bytes allocated.
.\" METHOD: init
.TP
\fBmemory init \fR[\fBon\fR|\fBoff\fR]
\fBmemory init on\fR|\fBoff\fR
.
Turn on or off the preinitialization of all allocated memory
with bogus bytes. Useful for detecting the use of uninitialized
@@ -74,7 +74,7 @@ is printed along with other information about the packet. The
to \fBTcl_Alloc\fR to be \fIstring\fR.
.\" METHOD: trace
.TP
\fBmemory trace \fR[\fBon\fR|\fBoff\fR]
\fBmemory trace on\fR|\fBoff\fR
.
Turns memory tracing on or off. When memory tracing is on, every call
to \fBTcl_Alloc\fR causes a line of trace information to be written to
@@ -104,7 +104,7 @@ the problem sets in. The current number of memory allocations that have
occurred since Tcl started is printed on a guard zone failure.
.\" METHOD: validate
.TP
\fBmemory validate \fR[\fBon\fR|\fBoff\fR]
\fBmemory validate on\fR|\fBoff\fR
.
Turns memory validation on or off. When memory validation is enabled,
on every call to \fBTcl_Alloc\fR or \fBTcl_Free\fR, the guard zones are
+44
View File
@@ -0,0 +1,44 @@
'\"
'\" Copyright (c) 2025 Donal Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH modf n 9.1 Tcl "Tcl Float Decomposition"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
modf \- Split a floating-point number into integer and fraction parts
.SH SYNOPSIS
\fBpackage require tcl 9.1\fR
.sp
\fBmodf \fIvalue\fR
.BE
.SH DESCRIPTION
The \fBmodf\fR command takes a floating-point number, \fIvalue\fR, and
returns a list of two values. The first element of the result is the
whole integer part (as a floating-point number) of \fIvalue\fR, and the
second element of the result is the fractional part of \fIvalue\fR.
The signs of the two elements will match the sign of \fIvalue\fR.
.SH EXAMPLE
.PP
It should be noted that the fractional part may have some digits that
appear to be undetermined by the input. This is due to the nature of
approximation inherent in floating-point arithmetic; the digits will
apparently disappear if the two parts are added back together.
.PP
.CS
set value 123.456
lassign [\fBmodf\fR $value] whole part
set sum [expr {$whole + $part}]
puts "$value -> $whole $part -> $sum"
# 123.456 -> 123.0 0.45600000000000307 -> 123.456
.CE
.SH "SEE ALSO"
expr(n), frexp(n), mathfunc(n)
.SH KEYWORDS
floating point
'\" Local Variables:
'\" mode: nroff
'\" End:
+1 -1
View File
@@ -378,7 +378,7 @@ communications hardware.
.SS "ERROR CODES (Windows only)"
.PP
A lot of different errors may occur during serial read operations or during
event polling in background. The external device may have been switched
event polling in the background. The external device may have been switched
off, the data lines may be noisy, system buffers may overrun or your mode
settings may be wrong. That is why a reliable software should always
\fBcatch\fR serial read operations. In cases of an error Tcl returns a
+2 -2
View File
@@ -61,8 +61,8 @@ where:
.TP
\fIcode\fR
.
is a standard Tcl return code, i.e., \fB0\fR for TCL_OK and \fB1\fR
for TCL_ERROR,
is a standard Tcl return code, i.e., \fB0\fR for \fBTCL_OK\fR and \fB1\fR
for \fBTCL_ERROR\fR,
.TP
\fImsg\fR
.
+8 -3
View File
@@ -13,9 +13,9 @@
registry \- Manipulate the Windows registry
.SH SYNOPSIS
.nf
\fBtcl::registry \fR?\fI\-mode\fR? \fIoption keyName\fR ?\fIarg arg ...\fR?
\fBpackage require registry 1.4\fR
\fBregistry \fR?\fI\-mode\fR? \fIoption keyName\fR ?\fIarg arg ...\fR?
\fBregistry \fR?\fI\-mode\fR? \fIoption keyName\fR ?\fIarg ...\fR?
.fi
.BE
.SH DESCRIPTION
@@ -26,6 +26,9 @@ manipulating the Windows registry. The package implements the
Windows platform. Warning: this command should be used with caution
as a corrupted registry can leave your system in an unusable state.
.PP
Starting with Tcl 9.1, the command is also available as \fBtcl::registry\fR
without requiring the \fBregistry\fR package to be loaded.
.PP
\fIKeyName\fR is the name of a registry key. Registry keys must be
one of the following forms:
.RS
@@ -110,7 +113,9 @@ using the same rules as for \fBstring match\fR. If the
specified \fIkeyName\fR does not exist, then an error is generated.
.\" METHOD: set
.TP
\fBregistry set \fIkeyName\fR ?\fIvalueName data \fR?\fItype\fR??
\fBregistry set \fIkeyName\fR ?\fIvalueName data\fR?
.TP
\fBregistry set \fIkeyName\fR ?\fIvalueName data type\fR?
.
If \fIvalueName\fR is not specified, creates the key \fIkeyName\fR if
it does not already exist. If \fIvalueName\fR is specified, creates
+37
View File
@@ -0,0 +1,37 @@
'\"
'\" Copyright (c) 2025 Donal Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH remquo n 9.1 Tcl "Tcl Float Remainder"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
remquo \- Compute floating point remainder and quadrant determinant
.SH SYNOPSIS
\fBpackage require tcl 9.1\fR
.sp
\fBremquo \fIx y\fR
.BE
.SH DESCRIPTION
The \fBremquo\fR command computes the floating-point remainder of
\fIx\fR/\fIy\fR, much like the \fBremainder\fR function. Its result is a list
of two values; the first value is the remainder, and the second value is an
integer containing sign and bits sufficient to determine which octant the
gradient was located within.
.SH EXAMPLE
.PP
.CS
lassign [\fBremquo\fR 12.3 3.89] rem quo
puts "rem=$rem, quo=$quo"
# rem=0.6300000000000003, quo=3
.CE
.SH "SEE ALSO"
expr(n), mathfunc(n)
.SH KEYWORDS
floating point
'\" Local Variables:
'\" mode: nroff
'\" End:
+24 -18
View File
@@ -8,7 +8,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH "tcltest" n 2.5 tcltest "Tcl Bundled Packages"
.TH "tcltest" n 2.6 tcltest "Tcl Bundled Packages"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
@@ -16,7 +16,7 @@
tcltest \- Test harness support code and utilities
.SH SYNOPSIS
.nf
\fBpackage require tcltest\fR ?\fB2.5\fR?
\fBpackage require tcltest\fR ?\fB2.6\fR?
\fBtcltest::test \fIname description\fR ?\fI\-option value ...\fR?
\fBtcltest::test \fIname description\fR ?\fIconstraints\fR? \fIbody result\fR
@@ -35,8 +35,8 @@ tcltest \- Test harness support code and utilities
\fBtcltest::configure \fI\-option value\fR ?\fI\-option value ...\fR?
\fBtcltest::customMatch \fImode command\fR
\fBtcltest::testConstraint \fIconstraint\fR ?\fIvalue\fR?
\fBtcltest::outputChannel \fR?\fIchannelID\fR?
\fBtcltest::errorChannel \fR?\fIchannelID\fR?
\fBtcltest::outputChannel \fR?\fIchannel\fR?
\fBtcltest::errorChannel \fR?\fIchannel\fR?
\fBtcltest::interpreter \fR?\fIinterp\fR?
\fBtcltest::debug \fR?\fIlevel\fR?
@@ -54,6 +54,7 @@ tcltest \- Test harness support code and utilities
\fBtcltest::skipDirectories \fR?\fIpatternList\fR?
\fBtcltest::skipFiles \fR?\fIpatternList\fR?
\fBtcltest::temporaryDirectory \fR?\fIdirectory\fR?
\fBtcltest::testIterations \fR?\fIcount\fR?
\fBtcltest::testsDirectory \fR?\fIdirectory\fR?
\fBtcltest::verbose \fR?\fIlevel\fR?
@@ -279,17 +280,17 @@ The default value for \fBinterpreter\fR is the name of the
currently running program as returned by \fBinfo nameofexecutable\fR.
.\" COMMAND: outputChannel
.TP
\fBoutputChannel\fR ?\fIchannelID\fR?
\fBoutputChannel\fR ?\fIchannel\fR?
.
Sets or returns the output channel ID. This defaults to \fBstdout\fR.
Sets or returns the output channel. This defaults to \fBstdout\fR.
Any test that prints test related output should send
that output to \fBoutputChannel\fR rather than letting
that output default to \fBstdout\fR.
.\" COMMAND: errorChannel
.TP
\fBerrorChannel\fR ?\fIchannelID\fR?
\fBerrorChannel\fR ?\fIchannel\fR?
.
Sets or returns the error channel ID. This defaults to \fBstderr\fR.
Sets or returns the error channel. This defaults to \fBstderr\fR.
Any test that prints error messages should send
that output to \fBerrorChannel\fR rather than printing
directly to \fBstderr\fR.
@@ -383,6 +384,12 @@ Same as
.
Same as
.QW "\fBconfigure \-tmpdir\fR ?\fIdirectory\fR?" .
.\" COMMAND: testIterations
.TP
\fBtestIterations\fR ?\fIcount\fR?
.
Same as
.QW "\fBconfigure \-iterations\fR ?\fIcount\fR?" .
.\" COMMAND: testsDirectory
.TP
\fBtestsDirectory\fR ?\fIdirectory\fR?
@@ -1022,6 +1029,11 @@ Sets the file to which all error output produced by tcltest
should be written. A file named \fIfilename\fR will be \fBopen\fRed
for writing, and the resulting channel will be set as the value
of \fBerrorChannel\fR.
.\" OPTION: -iterations
.TP
\fB\-iterations \fIcount\fR
.
Sets the number of times each test is executed. Default value is \fB1\fR.
.SH "CREATING TEST SUITES WITH TCLTEST"
.PP
The fundamental element of a test suite is the individual \fBtest\fR
@@ -1147,8 +1159,8 @@ Here is a sketch of a sample test file illustrating those points:
.RS
.PP
.CS
\fBpackage require tcltest 2.5\fR
eval \fB::tcltest::configure\fR $argv
\fBpackage require tcltest 2.6\fR
\fB::tcltest::configure\fR {*}$::argv
\fBpackage require example\fR
namespace eval ::example::test {
namespace import ::tcltest::*
@@ -1181,11 +1193,11 @@ Here is a sketch of a sample test suite main script:
.RS
.PP
.CS
\fBpackage require tcltest 2.5\fR
\fBpackage require tcltest 2.6\fR
\fBpackage require example\fR
\fB::tcltest::configure\fR -testdir \e
[file dirname [file normalize [info script]]]
eval \fB::tcltest::configure\fR $argv
\fB::tcltest::configure\fR {*}$::argv
\fB::tcltest::runAllTests\fR
.CE
.RE
@@ -1206,12 +1218,6 @@ configured from command line arguments. New test files should not
depend on this, but should explicitly include
.PP
.CS
eval \fB::tcltest::configure\fR $::argv
.CE
.PP
or
.PP
.CS
\fB::tcltest::configure\fR {*}$::argv
.CE
.PP
+16 -12
View File
@@ -24,7 +24,7 @@ timer \- timer events for monotonic and wall clock time
.SH DESCRIPTION
.PP
This command is used to delay execution of the program or to execute
a command in background sometime in the future.
a command in the background sometime in the future.
Time may be specified by a monotonic time delay or by wall clock time point.
It has the following methods:
.\" METHOD: in
@@ -48,9 +48,11 @@ to cancel the delayed command using \fBtimer cancel\fR or \fBafter cancel\fR.
A \fIdelay\fR value of 0 (or negative) queues the event immediately with
priority over other event types (if not installed with an event proc,
which will wait for next round of events).
.TP
.RS
.PP
The command \fBafter ms script\fR may also be used to register monotonic clock timer events.
Theey are handled by the same que as this form of the \fBtimer\fR command.
They are handled by the same queue as this form of the \fBtimer\fR command.
.RE
.\" METHOD: at
.TP
\fBtimer at \fItimepoint\fR \fIunit\fR \fIscript\fR
@@ -58,9 +60,11 @@ Theey are handled by the same que as this form of the \fBtimer\fR command.
Same as \fBtimer in\fR, but specifying a wall clock time point (epoc).
A typical use-case is to pass result of a \fBclock scan\fR as time point.
See example below.
.TP
.RS
.PP
Wall clock events have second priority after monotonic clock events.
If both fire the same instant, the monotonic clock command is always handled first.
.RE
.\" METHOD: idle
.TP
\fBtimer idle \fIscript\fR
@@ -73,17 +77,17 @@ to cancel the delayed command using \fBtimer cancel\fR or \fBafter cancel\fR.
If an error occurs while executing the script then the
background error will be reported by the command
registered with \fBinterp bgerror\fR.
.\" METHOD: wait for
.\" METHOD: sleep for
.TP
\fBtimer wait for \fIdelay\fR ?\fIunit\fR?
\fBtimer sleep for \fIdelay\fR ?\fIunit\fR?
\fIdelay\fR must be a wide integer giving a time in the given unit (default: \fBmilliseconds\fR).
A negative number is treated as 0.
The command sleeps for the given monotonic delay and then returns.
While the command is sleeping the application does not respond to
events.
.\" METHOD: wait until
.\" METHOD: sleep until
.TP
\fBtimer wait until \fItimepoint\fR ?\fIunit\fR?
\fBtimer sleep until \fItimepoint\fR ?\fIunit\fR?
\fItimepoint\fR must be a wide integer giving a wall clock time point in the given unit (default: \fBseconds\fR).
A negative number is treated as 0.
The command sleeps (at least) until the given wall clock time point and then returns.
@@ -116,7 +120,7 @@ The first element of the list is the script associated
with \fIid\fR, and the second element is either
\fBidle\fR, \fBmonotonic\fR or \fBwallclock\fR to indicate what kind of event
handler it is.
A thierd list element is present for the kinds \fB monotonic\fR or \fBwallclock\fR.
A third list element is present for the kinds \fB monotonic\fR or \fBwallclock\fR.
This element is the scheduled execution time point in microseconds of the given clock type.
.LP
The \fBtimer in\fR, \fBtimer at\fR and \fBtimer idle\fR forms of the command
@@ -126,7 +130,7 @@ In applications that are not normally event-driven, such as
\fBtclsh\fR, the event loop can be entered with the \fBvwait\fR
and \fBupdate\fR commands.
.LP
Note, that the output differs from \fBafter info\fR.
Note that the output differs from \fBafter info\fR.
.SH "TIME UNITS"
Some forms of the command take a time unit.
Available units are: \fBus\fR (for microseconds), \fBmicroseconds\fR,
@@ -135,13 +139,13 @@ Available units are: \fBus\fR (for microseconds), \fBmicroseconds\fR,
.SH "TIME MAXIMUM VALUE"
The arguments \fIdelay\fR and \fItimepoint\fR are bound to a resulting 63 bit clock value
(in unit microseconds).
Any higher value (which is after year 294441) will result in a \fBtime to far\fR error.
Any higher value (which is after year 294441) will result in a \fBtime too far away\fR error.
.SH "EXAMPLES"
This arranges for the command \fIwake_up\fR to be run in eight hours
wall clock time (providing the event loop is active at that time):
.PP
.CS
\fBtime at\fR [\fBclock add\fR [\fBclock seconds\fR] 24 hours] seconds wake_up
\fBtimer at\fR [\fBclock add\fR [\fBclock seconds\fR] 8 hours] seconds wake_up
.CE
.PP
.SH "SEE ALSO"
+1 -1
View File
@@ -95,7 +95,7 @@ an actual limitation, as some may believe.
Ever since 8.4 the Tcl \fBsource\fR command reads only until the first
^Z character. This allows us to combine an arbitrary Tcl script with
arbitrary binary data into one file, where the script processes the
attached data in any it chooses to fully import and activate the
attached data in any way it chooses to fully import and activate the
package.
.PP
The name of a module file has to match the regular expression:
+1 -1
View File
@@ -13,7 +13,7 @@
.SH NAME
trace \- Monitor variable accesses, command usages and command executions
.SH SYNOPSIS
\fBtrace \fIoption\fR ?\fIarg arg ...\fR?
\fBtrace \fIoption\fR ?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
+1 -1
View File
@@ -12,7 +12,7 @@
.SH NAME
unknown \- Handle attempts to use non-existent commands
.SH SYNOPSIS
\fBunknown \fIcmdName \fR?\fIarg arg ...\fR?
\fBunknown \fIcmdName \fR?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
+5 -1
View File
@@ -21,7 +21,7 @@ unload \- Unload machine code
.PP
This command tries to unload shared libraries previously loaded
with \fBload\fR from the application's address space. \fIfileName\fR
is the name of the file containing the library file to be unload; it
is the name of the file containing the library file unload; it
must be the same as the filename provided to \fBload\fR for
loading the library.
The \fIprefix\fR argument is the prefix (as
@@ -113,6 +113,10 @@ the library is used by other interpreters),
library is used only by the target interpreter and the library will be
detached from the application as soon as the unload procedure returns,
the \fIflags\fR argument will be set to \fBTCL_UNLOAD_DETACH_FROM_PROCESS\fR.
.PP
The unload procedure must take care to delete any commands it owns, rescind
callbacks or event handler, and free all resources such as file handles, memory,
TSD storage.
.SS NOTES
.PP
The \fBunload\fR command cannot unload libraries that are statically
+1 -1
View File
@@ -13,7 +13,7 @@
.SH NAME
unset \- Delete variables
.SH SYNOPSIS
\fBunset \fR?\fB\-nocomplain\fR? ?\fB\-\-\fR? ?\fIname name name ...\fR?
\fBunset \fR?\fB\-nocomplain\fR? ?\fB\-\-\fR? ?\fIname ...\fR?
.BE
.SH DESCRIPTION
.PP
+2 -2
View File
@@ -12,13 +12,13 @@
.SH NAME
uplevel \- Execute a script in a different stack frame
.SH SYNOPSIS
\fBuplevel \fR?\fIlevel\fR?\fI arg \fR?\fIarg ...\fR?
\fBuplevel\fR ?\fIlevel\fR? \fIarg\fR ?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
All of the \fIarg\fR arguments are concatenated as if they had
been passed to \fBconcat\fR; the result is then evaluated in the
variable context indicated by \fIlevel\fR. \fBUplevel\fR returns
variable context indicated by \fIlevel\fR. \fBuplevel\fR returns
the result of that evaluation.
.PP
If \fIlevel\fR is an integer then
+2 -2
View File
@@ -14,7 +14,7 @@ variable \- Create and initialize a namespace variable
.SH SYNOPSIS
\fBvariable \fR\fIname\fR
.sp
\fBvariable \fR?\fIname value...\fR?
\fBvariable \fR?\fIname value ...\fR?
.BE
.SH DESCRIPTION
.PP
@@ -42,7 +42,7 @@ command, but not to the \fBinfo exists\fR command.
If the \fBvariable\fR command is executed inside a Tcl procedure,
it creates local variables
linked to the corresponding namespace variables (and therefore these
variables are listed by \fBinfo vars\fR.)
variables are listed by \fBinfo vars\fR).
In this way the \fBvariable\fR command resembles the \fBglobal\fR command,
although the \fBglobal\fR command
resolves variable names with respect to the global namespace instead
+1 -1
View File
@@ -23,7 +23,7 @@ value; if it is a true value
then \fIbody\fR is executed by passing it to the Tcl interpreter.
Once \fIbody\fR has been executed then \fItest\fR is evaluated
again, and the process repeats until eventually \fItest\fR
evaluates to a false boolean value. \fBContinue\fR
evaluates to a false boolean value. \fBcontinue\fR
commands may be executed inside \fIbody\fR to terminate the current
iteration of the loop, and \fBbreak\fR
commands may be executed inside \fIbody\fR to cause immediate
+1 -1
View File
@@ -12,7 +12,7 @@
zlib \- Compression and decompression operations
.SH SYNOPSIS
.nf
\fBzlib \fIsubcommand arg ...\fR
\fBzlib \fIsubcommand arg\fR ?\fIarg ...\fR?
.fi
.BE
.SH DESCRIPTION
+195 -187
View File
@@ -174,7 +174,7 @@ static const crange alphaRangeTable[] = {
{0x1E00, 0x1F15}, {0x1F18, 0x1F1D}, {0x1F20, 0x1F45}, {0x1F48, 0x1F4D},
{0x1F50, 0x1F57}, {0x1F5F, 0x1F7D}, {0x1F80, 0x1FB4}, {0x1FB6, 0x1FBC},
{0x1FC2, 0x1FC4}, {0x1FC6, 0x1FCC}, {0x1FD0, 0x1FD3}, {0x1FD6, 0x1FDB},
{0x1FE0, 0x1FEC}, {0x1FF2, 0x1FF4}, {0x1FF6, 0x1FFC}, {0x2090, 0x209C},
{0x1FE0, 0x1FEC}, {0x1FF2, 0x1FF4}, {0x1FF6, 0x1FFC}, {0x208F, 0x209F},
{0x210A, 0x2113}, {0x2119, 0x211D}, {0x212A, 0x212D}, {0x212F, 0x2139},
{0x213C, 0x213F}, {0x2145, 0x2149}, {0x2C00, 0x2CE4}, {0x2CEB, 0x2CEE},
{0x2D00, 0x2D25}, {0x2D30, 0x2D67}, {0x2D80, 0x2D96}, {0x2DA0, 0x2DA6},
@@ -184,7 +184,7 @@ static const crange alphaRangeTable[] = {
{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, 0xA7DC}, {0xA7F1, 0xA801},
{0xA717, 0xA71F}, {0xA722, 0xA788}, {0xA78B, 0xA7DD}, {0xA7F1, 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},
@@ -208,44 +208,45 @@ static const crange alphaRangeTable[] = {
{0x10570, 0x1057A}, {0x1057C, 0x1058A}, {0x1058C, 0x10592}, {0x10597, 0x105A1},
{0x105A3, 0x105B1}, {0x105B3, 0x105B9}, {0x105C0, 0x105F3}, {0x10600, 0x10736},
{0x10740, 0x10755}, {0x10760, 0x10767}, {0x10780, 0x10785}, {0x10787, 0x107B0},
{0x107B2, 0x107BA}, {0x10800, 0x10805}, {0x1080A, 0x10835}, {0x1083F, 0x10855},
{0x107B2, 0x107BF}, {0x10800, 0x10805}, {0x1080A, 0x10835}, {0x1083F, 0x10855},
{0x10860, 0x10876}, {0x10880, 0x1089E}, {0x108E0, 0x108F2}, {0x10900, 0x10915},
{0x10920, 0x10939}, {0x10940, 0x10959}, {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}, {0x10D4A, 0x10D65}, {0x10D6F, 0x10D85},
{0x10E80, 0x10EA9}, {0x10EC2, 0x10EC7}, {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}, {0x11380, 0x11389}, {0x11390, 0x113B5},
{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},
{0x11BC0, 0x11BE0}, {0x11C00, 0x11C08}, {0x11C0A, 0x11C2E}, {0x11C72, 0x11C8F},
{0x11D00, 0x11D06}, {0x11D0B, 0x11D30}, {0x11D60, 0x11D65}, {0x11D6A, 0x11D89},
{0x11DB0, 0x11DDB}, {0x11EE0, 0x11EF2}, {0x11F04, 0x11F10}, {0x11F12, 0x11F33},
{0x12000, 0x12399}, {0x12480, 0x12543}, {0x12F90, 0x12FF0}, {0x13000, 0x1342F},
{0x13441, 0x13446}, {0x13460, 0x143FA}, {0x14400, 0x14646}, {0x16100, 0x1611D},
{0x16800, 0x16A38}, {0x16A40, 0x16A5E}, {0x16A70, 0x16ABE}, {0x16AD0, 0x16AED},
{0x16B00, 0x16B2F}, {0x16B40, 0x16B43}, {0x16B63, 0x16B77}, {0x16B7D, 0x16B8F},
{0x16D40, 0x16D6C}, {0x16E40, 0x16E7F}, {0x16EA0, 0x16EB8}, {0x16EBB, 0x16ED3},
{0x16F00, 0x16F4A}, {0x16F93, 0x16F9F}, {0x17000, 0x18CD5}, {0x18CFF, 0x18D1E},
{0x18D80, 0x18DF2}, {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}, {0x1DF25, 0x1DF2A}, {0x1E030, 0x1E06D}, {0x1E100, 0x1E12C},
{0x10E80, 0x10EA9}, {0x10EC2, 0x10EC7}, {0x10ED9, 0x10EEE}, {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}, {0x11380, 0x11389},
{0x11390, 0x113B5}, {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}, {0x11BC0, 0x11BE0}, {0x11C00, 0x11C08}, {0x11C0A, 0x11C2E},
{0x11C72, 0x11C8F}, {0x11D00, 0x11D06}, {0x11D0B, 0x11D30}, {0x11D60, 0x11D65},
{0x11D6A, 0x11D89}, {0x11DB0, 0x11DDB}, {0x11EE0, 0x11EF2}, {0x11F04, 0x11F10},
{0x11F12, 0x11F33}, {0x12000, 0x12399}, {0x12480, 0x12543}, {0x12F90, 0x12FF0},
{0x13000, 0x1342F}, {0x13441, 0x13446}, {0x13460, 0x143FA}, {0x14400, 0x14646},
{0x16100, 0x1611D}, {0x16800, 0x16A38}, {0x16A40, 0x16A5E}, {0x16A70, 0x16ABE},
{0x16AD0, 0x16AED}, {0x16B00, 0x16B2F}, {0x16B40, 0x16B43}, {0x16B63, 0x16B77},
{0x16B7D, 0x16B8F}, {0x16D40, 0x16D6C}, {0x16E40, 0x16E7F}, {0x16EA0, 0x16EB8},
{0x16EBB, 0x16ED3}, {0x16F00, 0x16F4A}, {0x16F93, 0x16F9F}, {0x17000, 0x18CDA},
{0x18CFF, 0x18D20}, {0x18D80, 0x18DF2}, {0x18E00, 0x19191}, {0x191A0, 0x191D2},
{0x1AFF0, 0x1AFF3}, {0x1AFF5, 0x1AFFB}, {0x1B000, 0x1B128}, {0x1B150, 0x1B152},
{0x1B164, 0x1B168}, {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, 0x1D6A6},
{0x1D6A8, 0x1D6C0}, {0x1D6C2, 0x1D6DA}, {0x1D6DC, 0x1D6FA}, {0x1D6FC, 0x1D714},
{0x1D716, 0x1D734}, {0x1D736, 0x1D74E}, {0x1D750, 0x1D76E}, {0x1D770, 0x1D788},
{0x1D78A, 0x1D7A8}, {0x1D7AA, 0x1D7C2}, {0x1D7C4, 0x1D7CB}, {0x1DF00, 0x1DF81},
{0x1DF90, 0x1DF96}, {0x1DFCD, 0x1DFFF}, {0x1E030, 0x1E06D}, {0x1E100, 0x1E12C},
{0x1E137, 0x1E13D}, {0x1E290, 0x1E2AD}, {0x1E2C0, 0x1E2EB}, {0x1E4D0, 0x1E4EB},
{0x1E5D0, 0x1E5ED}, {0x1E6C0, 0x1E6DE}, {0x1E6E0, 0x1E6E2}, {0x1E6E7, 0x1E6ED},
{0x1E6F0, 0x1E6F4}, {0x1E7E0, 0x1E7E6}, {0x1E7E8, 0x1E7EB}, {0x1E7F0, 0x1E7FE},
@@ -253,8 +254,9 @@ static const crange alphaRangeTable[] = {
{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, 0x2A6DF}, {0x2A700, 0x2B81D}, {0x2B820, 0x2CEAD}, {0x2CEB0, 0x2EBE0},
{0x2EBF0, 0x2EE5D}, {0x2F800, 0x2FA1D}, {0x30000, 0x3134A}, {0x31350, 0x33479}
{0x20000, 0x2A6DF}, {0x2A700, 0x2B81E}, {0x2B820, 0x2CEAD}, {0x2CEB0, 0x2EBE0},
{0x2EBF0, 0x2EE5D}, {0x2F800, 0x2FA1D}, {0x30000, 0x3134A}, {0x31350, 0x33479},
{0x3D000, 0x3FC3F}
#endif
};
@@ -262,23 +264,24 @@ static const crange alphaRangeTable[] = {
static const chr alphaCharTable[] = {
0xAA, 0xB5, 0xBA, 0x2EC, 0x2EE, 0x376, 0x377, 0x37F, 0x386,
0x38C, 0x559, 0x66E, 0x66F, 0x6D5, 0x6E5, 0x6E6, 0x6EE, 0x6EF,
0x6FF, 0x710, 0x7B1, 0x7F4, 0x7F5, 0x7FA, 0x81A, 0x824, 0x828,
0x93D, 0x950, 0x98F, 0x990, 0x9B2, 0x9BD, 0x9CE, 0x9DC, 0x9DD,
0x9F0, 0x9F1, 0x9FC, 0xA0F, 0xA10, 0xA32, 0xA33, 0xA35, 0xA36,
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, 0xC5C, 0xC5D, 0xC60, 0xC61, 0xC80, 0xCBD, 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
0x38C, 0x558, 0x559, 0x58B, 0x58C, 0x66E, 0x66F, 0x6D5, 0x6E5,
0x6E6, 0x6EE, 0x6EF, 0x6FF, 0x710, 0x7B1, 0x7F4, 0x7F5, 0x7FA,
0x81A, 0x824, 0x828, 0x93D, 0x950, 0x98F, 0x990, 0x9B2, 0x9BD,
0x9CE, 0x9DC, 0x9DD, 0x9F0, 0x9F1, 0x9FC, 0xA0F, 0xA10, 0xA32,
0xA33, 0xA35, 0xA36, 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, 0xC5C, 0xC5D, 0xC60, 0xC61, 0xC80,
0xCBD, 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, 0xA7E2, 0xA8FB, 0xA8FD, 0xA8FE, 0xA9CF, 0xAA7A, 0xAAB1, 0xAAB5,
0xAAB6, 0xAAC0, 0xAAC2, 0xAB6C, 0xAB6D, 0xFB1D, 0xFB3E, 0xFB40, 0xFB41,
0xFB43, 0xFB44
#if CHRBITS > 16
,0x1003C, 0x1003D, 0x10594, 0x10595, 0x105BB, 0x105BC, 0x10808, 0x10837, 0x10838,
0x1083C, 0x108F4, 0x108F5, 0x109BE, 0x109BF, 0x10A00, 0x10EB0, 0x10EB1, 0x10F27,
@@ -286,13 +289,13 @@ static const chr alphaCharTable[] = {
0x11240, 0x11288, 0x1130F, 0x11310, 0x11332, 0x11333, 0x1133D, 0x11350, 0x1138B,
0x1138E, 0x113B7, 0x113D1, 0x113D3, 0x114C4, 0x114C5, 0x114C7, 0x11644, 0x116B8,
0x11909, 0x11915, 0x11916, 0x1193F, 0x11941, 0x119E1, 0x119E3, 0x11A00, 0x11A3A,
0x11A50, 0x11A9D, 0x11C40, 0x11D08, 0x11D09, 0x11D46, 0x11D67, 0x11D68, 0x11D98,
0x11F02, 0x11FB0, 0x16F50, 0x16FE0, 0x16FE1, 0x16FE3, 0x16FF2, 0x16FF3, 0x1AFFD,
0x1AFFE, 0x1B132, 0x1B155, 0x1D49E, 0x1D49F, 0x1D4A2, 0x1D4A5, 0x1D4A6, 0x1D4BB,
0x1D546, 0x1E14E, 0x1E5F0, 0x1E6E4, 0x1E6E5, 0x1E6FE, 0x1E6FF, 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
0x11A50, 0x11A9D, 0x11B0A, 0x11C40, 0x11D08, 0x11D09, 0x11D46, 0x11D67, 0x11D68,
0x11D98, 0x11DF1, 0x11F02, 0x11FB0, 0x16F50, 0x16FE0, 0x16FE1, 0x16FE3, 0x16FF2,
0x16FF3, 0x1AFFD, 0x1AFFE, 0x1B132, 0x1B155, 0x1D49E, 0x1D49F, 0x1D4A2, 0x1D4A5,
0x1D4A6, 0x1D4BB, 0x1D546, 0x1E14E, 0x1E5F0, 0x1E6E4, 0x1E6E5, 0x1E6FE, 0x1E6FF,
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
};
@@ -369,11 +372,12 @@ static const crange punctRangeTable[] = {
{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}
{0x2E00, 0x2E2E}, {0x2E30, 0x2E4F}, {0x2E52, 0x2E5D}, {0x2E60, 0x2E63},
{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}, {0x10F86, 0x10F89}, {0x11047, 0x1104D},
@@ -455,10 +459,11 @@ static const crange lowerRangeTable[] = {
{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},
{0x1D656, 0x1D66F}, {0x1D68A, 0x1D6A6}, {0x1D6C2, 0x1D6DA}, {0x1D6DC, 0x1D6E1},
{0x1D6FC, 0x1D714}, {0x1D716, 0x1D71B}, {0x1D736, 0x1D74E}, {0x1D750, 0x1D755},
{0x1D770, 0x1D788}, {0x1D78A, 0x1D78F}, {0x1D7AA, 0x1D7C2}, {0x1D7C4, 0x1D7C9},
{0x1DF00, 0x1DF09}, {0x1DF0B, 0x1DF1E}, {0x1DF25, 0x1DF2A}, {0x1E922, 0x1E943}
{0x1DF00, 0x1DF09}, {0x1DF0B, 0x1DF3F}, {0x1DF41, 0x1DF47}, {0x1DF4E, 0x1DF50},
{0x1DF52, 0x1DF67}, {0x1DF6F, 0x1DF71}, {0x1DF90, 0x1DF96}, {0x1E922, 0x1E943}
#endif
};
@@ -532,7 +537,8 @@ static const chr lowerCharTable[] = {
0xA7C3, 0xA7C8, 0xA7CA, 0xA7CD, 0xA7CF, 0xA7D1, 0xA7D3, 0xA7D5, 0xA7D7,
0xA7D9, 0xA7DB, 0xA7F6, 0xA7FA
#if CHRBITS > 16
,0x105BB, 0x105BC, 0x1D4BB, 0x1D7CB
,0x105BB, 0x105BC, 0x1D4BB, 0x1D7CB, 0x1DF49, 0x1DF4B, 0x1DF4C, 0x1DF69, 0x1DF6B,
0x1DF6D, 0x1DF73, 0x1DF75, 0x1DF77, 0x1DF79, 0x1DF7B, 0x1DF7D, 0x1DF7F
#endif
};
@@ -635,10 +641,12 @@ static const chr upperCharTable[] = {
0xA798, 0xA79A, 0xA79C, 0xA79E, 0xA7A0, 0xA7A2, 0xA7A4, 0xA7A6, 0xA7A8,
0xA7B6, 0xA7B8, 0xA7BA, 0xA7BC, 0xA7BE, 0xA7C0, 0xA7C2, 0xA7C9, 0xA7CB,
0xA7CC, 0xA7CE, 0xA7D0, 0xA7D2, 0xA7D4, 0xA7D6, 0xA7D8, 0xA7DA, 0xA7DC,
0xA7F5
0xA7DD, 0xA7E2, 0xA7F5, 0xAB6C, 0xAB6D
#if CHRBITS > 16
,0x10594, 0x10595, 0x1D49C, 0x1D49E, 0x1D49F, 0x1D4A2, 0x1D4A5, 0x1D4A6, 0x1D504,
0x1D505, 0x1D538, 0x1D539, 0x1D546, 0x1D7CA
0x1D505, 0x1D538, 0x1D539, 0x1D546, 0x1D7CA, 0x1DF40, 0x1DF48, 0x1DF4A, 0x1DF4D,
0x1DF51, 0x1DF68, 0x1DF6A, 0x1DF6C, 0x1DF6E, 0x1DF72, 0x1DF74, 0x1DF76, 0x1DF78,
0x1DF7A, 0x1DF7C, 0x1DF7E
#endif
};
@@ -651,75 +659,74 @@ static const chr upperCharTable[] = {
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}, {0x61D, 0x6DC}, {0x6DE, 0x70D},
{0x710, 0x74A}, {0x74D, 0x7B1}, {0x7C0, 0x7FA}, {0x7FD, 0x82D},
{0x830, 0x83E}, {0x840, 0x85B}, {0x860, 0x86A}, {0x870, 0x88F},
{0x897, 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}, {0xCDC, 0xCDE},
{0xCE0, 0xCE3}, {0xCE6, 0xCEF}, {0xCF1, 0xCF3}, {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, 0xECE}, {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, 0x1ADD},
{0x1AE0, 0x1AEB}, {0x1B00, 0x1B4C}, {0x1B4E, 0x1BF3}, {0x1BFC, 0x1C37},
{0x1C3B, 0x1C49}, {0x1C4D, 0x1C8A}, {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, 0x20C1}, {0x20D0, 0x20F0},
{0x558, 0x58F}, {0x591, 0x5C9}, {0x5D0, 0x5EA}, {0x5EF, 0x5F4},
{0x606, 0x61B}, {0x61D, 0x6DC}, {0x6DE, 0x70D}, {0x710, 0x74A},
{0x74D, 0x7B1}, {0x7C0, 0x7FA}, {0x7FD, 0x82D}, {0x830, 0x83E},
{0x840, 0x85B}, {0x860, 0x86A}, {0x870, 0x88F}, {0x897, 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},
{0xB53, 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}, {0xCDC, 0xCDE}, {0xCE0, 0xCE3},
{0xCE6, 0xCEF}, {0xCF1, 0xCF3}, {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, 0xECE}, {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, 0x1AF0}, {0x1B00, 0x1B4C},
{0x1B4E, 0x1BF3}, {0x1BFC, 0x1C37}, {0x1C3B, 0x1C49}, {0x1C4D, 0x1C8A},
{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, 0x20C4}, {0x20D0, 0x20F0},
{0x2100, 0x218B}, {0x2190, 0x2429}, {0x2440, 0x244A}, {0x2460, 0x2B73},
{0x2B76, 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, 0x2FFF}, {0x3001, 0x303F}, {0x3041, 0x3096}, {0x3099, 0x30FF},
{0x3105, 0x312F}, {0x3131, 0x318E}, {0x3190, 0x31E5}, {0x31EF, 0x321E},
{0x3220, 0xA48C}, {0xA490, 0xA4C6}, {0xA4D0, 0xA62B}, {0xA640, 0xA6F7},
{0xA700, 0xA7DC}, {0xA7F1, 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, 0xFDCF}, {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}
{0x2DE0, 0x2E5D}, {0x2E60, 0x2E63}, {0x2E80, 0x2E99}, {0x2E9B, 0x2EF3},
{0x2F00, 0x2FD5}, {0x2FF0, 0x2FFF}, {0x3001, 0x303F}, {0x3041, 0x3096},
{0x3099, 0x30FF}, {0x3105, 0x312F}, {0x3131, 0x318E}, {0x3190, 0x31E5},
{0x31EF, 0x321E}, {0x3220, 0xA48C}, {0xA490, 0xA4C6}, {0xA4D0, 0xA62B},
{0xA640, 0xA6F7}, {0xA700, 0xA7DD}, {0xA7F1, 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, 0xAB6D}, {0xAB70, 0xABED},
{0xABF0, 0xABF9}, {0xAC00, 0xD7A3}, {0xD7B0, 0xD7C6}, {0xD7CB, 0xD7FB},
{0xF900, 0xFA6D}, {0xFA70, 0xFAD9}, {0xFB00, 0xFB06}, {0xFB13, 0xFB17},
{0xFB1D, 0xFB36}, {0xFB38, 0xFB3C}, {0xFB46, 0xFDCF}, {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}
#if CHRBITS > 16
,{0x10000, 0x1000B}, {0x1000D, 0x10026}, {0x10028, 0x1003A}, {0x1003F, 0x1004D},
{0x10050, 0x1005D}, {0x10080, 0x100FA}, {0x10100, 0x10102}, {0x10107, 0x10133},
@@ -730,7 +737,7 @@ static const crange graphRangeTable[] = {
{0x10500, 0x10527}, {0x10530, 0x10563}, {0x1056F, 0x1057A}, {0x1057C, 0x1058A},
{0x1058C, 0x10592}, {0x10597, 0x105A1}, {0x105A3, 0x105B1}, {0x105B3, 0x105B9},
{0x105C0, 0x105F3}, {0x10600, 0x10736}, {0x10740, 0x10755}, {0x10760, 0x10767},
{0x10780, 0x10785}, {0x10787, 0x107B0}, {0x107B2, 0x107BA}, {0x10800, 0x10805},
{0x10780, 0x10785}, {0x10787, 0x107B0}, {0x107B2, 0x107BF}, {0x10800, 0x10805},
{0x1080A, 0x10835}, {0x1083F, 0x10855}, {0x10857, 0x1089E}, {0x108A7, 0x108AF},
{0x108E0, 0x108F2}, {0x108FB, 0x1091B}, {0x1091F, 0x10939}, {0x1093F, 0x10959},
{0x10980, 0x109B7}, {0x109BC, 0x109CF}, {0x109D2, 0x10A03}, {0x10A0C, 0x10A13},
@@ -740,7 +747,7 @@ static const crange graphRangeTable[] = {
{0x10B99, 0x10B9C}, {0x10BA9, 0x10BAF}, {0x10C00, 0x10C48}, {0x10C80, 0x10CB2},
{0x10CC0, 0x10CF2}, {0x10CFA, 0x10D27}, {0x10D30, 0x10D39}, {0x10D40, 0x10D65},
{0x10D69, 0x10D85}, {0x10E60, 0x10E7E}, {0x10E80, 0x10EA9}, {0x10EAB, 0x10EAD},
{0x10EC2, 0x10EC7}, {0x10ED0, 0x10ED8}, {0x10EFA, 0x10F27}, {0x10F30, 0x10F59},
{0x10EC2, 0x10EC7}, {0x10EC9, 0x10EEE}, {0x10EF0, 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},
@@ -757,53 +764,54 @@ static const crange graphRangeTable[] = {
{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}, {0x11B00, 0x11B09}, {0x11B60, 0x11B67}, {0x11BC0, 0x11BE1},
{0x11AB0, 0x11AF8}, {0x11B00, 0x11B0A}, {0x11B60, 0x11B67}, {0x11BC0, 0x11BE1},
{0x11BF0, 0x11BF9}, {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},
{0x11DB0, 0x11DDB}, {0x11DE0, 0x11DE9}, {0x11EE0, 0x11EF8}, {0x11F00, 0x11F10},
{0x11F12, 0x11F3A}, {0x11F3E, 0x11F5A}, {0x11FC0, 0x11FF1}, {0x11FFF, 0x12399},
{0x12400, 0x1246E}, {0x12470, 0x12474}, {0x12480, 0x12543}, {0x12F90, 0x12FF2},
{0x13000, 0x1342F}, {0x13440, 0x13455}, {0x13460, 0x143FA}, {0x14400, 0x14646},
{0x16100, 0x16139}, {0x16800, 0x16A38}, {0x16A40, 0x16A5E}, {0x16A60, 0x16A69},
{0x16A6E, 0x16ABE}, {0x16AC0, 0x16AC9}, {0x16AD0, 0x16AED}, {0x16AF0, 0x16AF5},
{0x16B00, 0x16B45}, {0x16B50, 0x16B59}, {0x16B5B, 0x16B61}, {0x16B63, 0x16B77},
{0x16B7D, 0x16B8F}, {0x16D40, 0x16D79}, {0x16E40, 0x16E9A}, {0x16EA0, 0x16EB8},
{0x16EBB, 0x16ED3}, {0x16F00, 0x16F4A}, {0x16F4F, 0x16F87}, {0x16F8F, 0x16F9F},
{0x16FE0, 0x16FE4}, {0x16FF0, 0x16FF6}, {0x17000, 0x18CD5}, {0x18CFF, 0x18D1E},
{0x18D80, 0x18DF2}, {0x1AFF0, 0x1AFF3}, {0x1AFF5, 0x1AFFB}, {0x1B000, 0x1B122},
{0x1B150, 0x1B152}, {0x1B164, 0x1B167}, {0x1B170, 0x1B2FB}, {0x1BC00, 0x1BC6A},
{0x1BC70, 0x1BC7C}, {0x1BC80, 0x1BC88}, {0x1BC90, 0x1BC99}, {0x1BC9C, 0x1BC9F},
{0x1CC00, 0x1CCFC}, {0x1CD00, 0x1CEB3}, {0x1CEBA, 0x1CED0}, {0x1CEE0, 0x1CEF0},
{0x1CF00, 0x1CF2D}, {0x1CF30, 0x1CF46}, {0x1CF50, 0x1CFC3}, {0x1D000, 0x1D0F5},
{0x1D100, 0x1D126}, {0x1D129, 0x1D172}, {0x1D17B, 0x1D1EA}, {0x1D200, 0x1D245},
{0x1D2C0, 0x1D2D3}, {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}, {0x1DF25, 0x1DF2A},
{0x1E000, 0x1E006}, {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E026, 0x1E02A},
{0x1E030, 0x1E06D}, {0x1E100, 0x1E12C}, {0x1E130, 0x1E13D}, {0x1E140, 0x1E149},
{0x1E290, 0x1E2AE}, {0x1E2C0, 0x1E2F9}, {0x1E4D0, 0x1E4F9}, {0x1E5D0, 0x1E5FA},
{0x1E6C0, 0x1E6DE}, {0x1E6E0, 0x1E6F5}, {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, 0x1F6D8}, {0x1F6DC, 0x1F6EC}, {0x1F6F0, 0x1F6FC}, {0x1F700, 0x1F7D9},
{0x1F7E0, 0x1F7EB}, {0x1F800, 0x1F80B}, {0x1F810, 0x1F847}, {0x1F850, 0x1F859},
{0x1F860, 0x1F887}, {0x1F890, 0x1F8AD}, {0x1F8B0, 0x1F8BB}, {0x1F8D0, 0x1F8D8},
{0x1F900, 0x1FA57}, {0x1FA60, 0x1FA6D}, {0x1FA70, 0x1FA7C}, {0x1FA80, 0x1FA8A},
{0x1FA8E, 0x1FAC6}, {0x1FACD, 0x1FADC}, {0x1FADF, 0x1FAEA}, {0x1FAEF, 0x1FAF8},
{0x1FB00, 0x1FB92}, {0x1FB94, 0x1FBFA}, {0x20000, 0x2A6DF}, {0x2A700, 0x2B81D},
{0x2B820, 0x2CEAD}, {0x2CEB0, 0x2EBE0}, {0x2EBF0, 0x2EE5D}, {0x2F800, 0x2FA1D},
{0x30000, 0x3134A}, {0x31350, 0x33479}, {0xE0100, 0xE01EF}
{0x12400, 0x12543}, {0x12550, 0x12686}, {0x12F90, 0x12FF2}, {0x13000, 0x1342F},
{0x13440, 0x13455}, {0x13460, 0x143FA}, {0x14400, 0x14646}, {0x16100, 0x16139},
{0x16800, 0x16A38}, {0x16A40, 0x16A5E}, {0x16A60, 0x16A69}, {0x16A6E, 0x16ABE},
{0x16AC0, 0x16AC9}, {0x16AD0, 0x16AED}, {0x16AF0, 0x16AF5}, {0x16B00, 0x16B45},
{0x16B50, 0x16B59}, {0x16B5B, 0x16B61}, {0x16B63, 0x16B77}, {0x16B7D, 0x16B8F},
{0x16D40, 0x16D79}, {0x16E40, 0x16E9A}, {0x16EA0, 0x16EB8}, {0x16EBB, 0x16ED3},
{0x16F00, 0x16F4A}, {0x16F4F, 0x16F87}, {0x16F8F, 0x16F9F}, {0x16FE0, 0x16FE4},
{0x16FF0, 0x16FF6}, {0x17000, 0x18CDA}, {0x18CFF, 0x18D20}, {0x18D80, 0x18DF2},
{0x18E00, 0x19191}, {0x191A0, 0x191D2}, {0x1AFF0, 0x1AFF3}, {0x1AFF5, 0x1AFFB},
{0x1B000, 0x1B128}, {0x1B150, 0x1B152}, {0x1B164, 0x1B168}, {0x1B170, 0x1B2FB},
{0x1BC00, 0x1BC6A}, {0x1BC70, 0x1BC7C}, {0x1BC80, 0x1BC88}, {0x1BC90, 0x1BC99},
{0x1BC9C, 0x1BC9F}, {0x1CC00, 0x1CCFC}, {0x1CD00, 0x1CEB3}, {0x1CEBA, 0x1CED0},
{0x1CED2, 0x1CED4}, {0x1CEDD, 0x1CEFD}, {0x1CF00, 0x1CF2D}, {0x1CF30, 0x1CF46},
{0x1CF50, 0x1CFC3}, {0x1D000, 0x1D0F5}, {0x1D100, 0x1D172}, {0x1D17B, 0x1D245},
{0x1D250, 0x1D281}, {0x1D2C0, 0x1D2D3}, {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, 0x1D6A6}, {0x1D6A8, 0x1D7CB},
{0x1D7CE, 0x1DA8B}, {0x1DA9B, 0x1DA9F}, {0x1DAA1, 0x1DAAF}, {0x1DB00, 0x1DB1C},
{0x1DF00, 0x1DF81}, {0x1DF90, 0x1DF96}, {0x1DFCD, 0x1E006}, {0x1E008, 0x1E018},
{0x1E01B, 0x1E021}, {0x1E026, 0x1E02A}, {0x1E030, 0x1E06D}, {0x1E100, 0x1E12C},
{0x1E130, 0x1E13D}, {0x1E140, 0x1E149}, {0x1E290, 0x1E2AE}, {0x1E2C0, 0x1E2F9},
{0x1E4D0, 0x1E4F9}, {0x1E5D0, 0x1E5FA}, {0x1E6C0, 0x1E6DE}, {0x1E6E0, 0x1E6F5},
{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, 0x1F1AE}, {0x1F1E6, 0x1F202}, {0x1F210, 0x1F23B},
{0x1F240, 0x1F248}, {0x1F260, 0x1F265}, {0x1F300, 0x1F6D9}, {0x1F6DC, 0x1F6EC},
{0x1F6F0, 0x1F6FC}, {0x1F700, 0x1F7DB}, {0x1F7E0, 0x1F7EB}, {0x1F7F0, 0x1F80B},
{0x1F810, 0x1F847}, {0x1F850, 0x1F859}, {0x1F860, 0x1F887}, {0x1F890, 0x1F8AD},
{0x1F8B0, 0x1F8BB}, {0x1F8D0, 0x1F8D8}, {0x1F900, 0x1FA57}, {0x1FA60, 0x1FA6D},
{0x1FA70, 0x1FA7C}, {0x1FA80, 0x1FAC6}, {0x1FACC, 0x1FADD}, {0x1FADF, 0x1FAEB},
{0x1FAEF, 0x1FAFA}, {0x1FB00, 0x1FB92}, {0x1FB94, 0x1FBFA}, {0x20000, 0x2A6DF},
{0x2A700, 0x2B81E}, {0x2B820, 0x2CEAD}, {0x2CEB0, 0x2EBE0}, {0x2EBF0, 0x2EE5D},
{0x2F800, 0x2FA1D}, {0x30000, 0x3134A}, {0x31350, 0x33479}, {0x3D000, 0x3FC3F},
{0xE0100, 0xE01EF}
#endif
};
@@ -818,21 +826,21 @@ static const chr graphCharTable[] = {
0xC55, 0xC56, 0xC5C, 0xC5D, 0xCD5, 0xCD6, 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
0x2D2D, 0x2D6F, 0x2D70, 0xA7E2, 0xFB3E, 0xFB40, 0xFB41, 0xFB43, 0xFB44,
0xFFFC, 0xFFFD
#if CHRBITS > 16
,0x1003C, 0x1003D, 0x101A0, 0x10594, 0x10595, 0x105BB, 0x105BC, 0x10808, 0x10837,
0x10838, 0x1083C, 0x108F4, 0x108F5, 0x10A05, 0x10A06, 0x10D8E, 0x10D8F, 0x10EB0,
0x10EB1, 0x11288, 0x1130F, 0x11310, 0x11332, 0x11333, 0x11347, 0x11348, 0x11350,
0x11357, 0x1138B, 0x1138E, 0x113C2, 0x113C5, 0x113D7, 0x113D8, 0x113E1, 0x113E2,
0x11909, 0x11915, 0x11916, 0x11937, 0x11938, 0x11D08, 0x11D09, 0x11D3A, 0x11D3C,
0x11D3D, 0x11D67, 0x11D68, 0x11D90, 0x11D91, 0x11FB0, 0x1AFFD, 0x1AFFE, 0x1B132,
0x1B155, 0x1D49E, 0x1D49F, 0x1D4A2, 0x1D4A5, 0x1D4A6, 0x1D4BB, 0x1D546, 0x1E023,
0x1E024, 0x1E08F, 0x1E14E, 0x1E14F, 0x1E2FF, 0x1E5FF, 0x1E6FE, 0x1E6FF, 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, 0x1F8C0, 0x1F8C1, 0x1FAC8
0x11D3D, 0x11D67, 0x11D68, 0x11D90, 0x11D91, 0x11DF0, 0x11DF1, 0x11FB0, 0x1AFFD,
0x1AFFE, 0x1B132, 0x1B155, 0x1D49E, 0x1D49F, 0x1D4A2, 0x1D4A5, 0x1D4A6, 0x1D4BB,
0x1D546, 0x1E023, 0x1E024, 0x1E08F, 0x1E14E, 0x1E14F, 0x1E2FF, 0x1E5FF, 0x1E6FE,
0x1E6FF, 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, 0x1F8C0, 0x1F8C1, 0x1FAC8
#endif
};
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
* Copyright © 1998, 1999 Henry Spencer. All rights reserved.
*
* Development of this software was funded, in part, by Cray Research Inc.,
* UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
+1 -1
View File
@@ -6,7 +6,7 @@
/*
* regular expressions
*
* Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
* Copyright © 1998, 1999 Henry Spencer. All rights reserved.
*
* Development of this software was funded, in part, by Cray Research Inc.,
* UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
+1 -1
View File
@@ -1,7 +1,7 @@
/*
* Internal interface definitions, etc., for the reg package
*
* Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
* Copyright © 1998, 1999 Henry Spencer. All rights reserved.
*
* Development of this software was funded, in part, by Cray Research Inc.,
* UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
+16 -2
View File
@@ -2454,9 +2454,23 @@ declare 698 {
Tcl_Size *dstCharsPtr)
}
declare 699 {
int Tcl_RegisterPostInitProc(Tcl_PostInitProc *postInitProc,
void * clientData)
}
declare 700 {
int Tcl_UnregisterPostInitProc(Tcl_PostInitProc *postInitProc,
void * clientData)
}
declare 701 {
int Tcl_ClearPostInitProcs(void)
}
# ----- BASELINE -- FOR -- 9.1.0 ----- #
declare 699 {
declare 702 {
void TclUnusedStubEntry(void)
}
@@ -2515,7 +2529,7 @@ export {
int exact)
}
export {
const char *TclTomMathInitializeStubs(Tcl_Interp* interp,
const char *TclTomMathInitializeStubs(Tcl_Interp *interp,
const char* version, int epoch, int revision)
}
export {
+25 -26
View File
@@ -4,11 +4,11 @@
* This header file describes the externally-visible facilities of the
* Tcl interpreter.
*
* Copyright (c) 1987-1994 The Regents of the University of California.
* Copyright (c) 1993-1996 Lucent Technologies.
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
* Copyright (c) 1998-2000 by Scriptics Corporation.
* Copyright (c) 2002 by Kevin B. Kenny. All rights reserved.
* Copyright © 1987-1994 The Regents of the University of California.
* Copyright © 1993-1996 Lucent Technologies.
* Copyright © 1994-1998 Sun Microsystems, Inc.
* Copyright © 1998-2000 by Scriptics Corporation.
* Copyright © 2002 by Kevin B. Kenny. All rights reserved.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -53,11 +53,11 @@ extern "C" {
# error "This header-file is for Tcl 9 only"
#endif
#define TCL_MINOR_VERSION 1
#define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE
#define TCL_RELEASE_SERIAL 2
#define TCL_RELEASE_LEVEL TCL_BETA_RELEASE
#define TCL_RELEASE_SERIAL 1
#define TCL_VERSION "9.1"
#define TCL_PATCH_LEVEL "9.1a2"
#define TCL_PATCH_LEVEL "9.1b1"
#if defined(RC_INVOKED)
/*
@@ -503,7 +503,7 @@ typedef struct stat *Tcl_OldStat_;
#define TCL_BREAK 3
#define TCL_CONTINUE 4
#define TCL_CODE_USER_MIN 5
#define TCL_CODE_USER_MAX 0x3fffffff /* 1073741823 */
#define TCL_CODE_USER_MAX 0x3fffffff /* 1073741823 */
/*
*----------------------------------------------------------------------------
@@ -534,11 +534,11 @@ typedef void (Tcl_ChannelProc) (void *clientData, int mask);
typedef void (Tcl_CloseProc) (void *data);
typedef void (Tcl_CmdDeleteProc) (void *clientData);
typedef int (Tcl_CmdProc) (void *clientData, Tcl_Interp *interp,
int argc, const char *argv[]);
int argc, const char **argv);
#ifndef TCL_NO_DEPRECATED
typedef void (Tcl_CmdTraceProc) (void *clientData, Tcl_Interp *interp,
int level, char *command, Tcl_CmdProc *proc,
void *cmdClientData, int argc, const char *argv[]);
void *cmdClientData, int argc, const char **argv);
typedef int (Tcl_CmdObjTraceProc) (void *clientData, Tcl_Interp *interp,
int level, const char *command, Tcl_Command commandInfo, int objc,
struct Tcl_Obj *const *objv);
@@ -578,7 +578,8 @@ typedef void (Tcl_FreeProc) (void *blockPtr);
#define Tcl_EncodingFreeProc Tcl_FreeProc
typedef int (Tcl_LibraryInitProc) (Tcl_Interp *interp);
typedef int (Tcl_LibraryUnloadProc) (Tcl_Interp *interp, int flags);
typedef void (Tcl_PanicProc) (const char *format, ...);
typedef void (Tcl_PanicProc) (const char *format, ...) TCL_FORMAT_PRINTF(1, 2);
typedef int (Tcl_PostInitProc) (Tcl_Interp *interp, void *clientData);
typedef void (Tcl_TcpAcceptProc) (void *callbackData, Tcl_Channel chan,
char *address, int port);
typedef void (Tcl_TimerProc) (void *clientData);
@@ -600,14 +601,14 @@ typedef void (Tcl_MainLoopProc) (void);
/* Abstract List functions */
typedef Tcl_Size (Tcl_ObjTypeLengthProc) (struct Tcl_Obj *listPtr);
typedef int (Tcl_ObjTypeIndexProc) (Tcl_Interp *interp, struct Tcl_Obj *listPtr,
Tcl_Size index, struct Tcl_Obj** elemObj);
Tcl_Size index, struct Tcl_Obj **elemObj);
typedef int (Tcl_ObjTypeSliceProc) (Tcl_Interp *interp, struct Tcl_Obj *listPtr,
Tcl_Size fromIdx, Tcl_Size toIdx, struct Tcl_Obj **newObjPtr);
typedef int (Tcl_ObjTypeReverseProc) (Tcl_Interp *interp,
struct Tcl_Obj *listPtr, struct Tcl_Obj **newObjPtr);
typedef int (Tcl_ObjTypeGetElements) (Tcl_Interp *interp,
struct Tcl_Obj *listPtr, Tcl_Size *objcptr, struct Tcl_Obj ***objvptr);
typedef struct Tcl_Obj *(Tcl_ObjTypeSetElement) (Tcl_Interp *interp,
typedef struct Tcl_Obj *(Tcl_ObjTypeSetElement) (Tcl_Interp *interp,
struct Tcl_Obj *listPtr, Tcl_Size indexCount,
struct Tcl_Obj *const indexArray[], struct Tcl_Obj *valueObj);
typedef int (Tcl_ObjTypeReplaceProc) (Tcl_Interp *interp,
@@ -1279,7 +1280,6 @@ typedef enum {
* On Unix systems the epoch is Midnight Jan 1, 1970 GMT.
*/
#ifndef TCL_NO_DEPRECATED
typedef struct Tcl_Time {
long long sec; /* Seconds. */
#if defined(_CYGWIN_)
@@ -1297,6 +1297,7 @@ typedef int (Tcl_WaitForEventProc) (const Tcl_Time *timePtr);
* WARNING: functionality removed, calls Tcl_Panic
*/
#ifndef TCL_NO_DEPRECATED
typedef void (Tcl_GetTimeProc) (Tcl_Time *timebuf, void *clientData);
typedef void (Tcl_ScaleTimeProc) (Tcl_Time *timebuf, void *clientData);
#endif /* TCL_NO_DEPRECATED */
@@ -1639,11 +1640,11 @@ typedef struct Tcl_Filesystem {
* if the filesystem does not support glob or
* recursive copy. */
Tcl_FSUtimeProc *utimeProc; /* Called by 'Tcl_FSUtime()', by 'file
* mtime' to set (not read) times, 'file
* atime', and the open-r/open-w/fcopy variant
* of 'file copy'. */
* mtime' to set (not read) times, 'file
* atime', and the open-r/open-w/fcopy variant
* of 'file copy'. */
Tcl_FSLinkProc *linkProc; /* Called by 'Tcl_FSLink()'. NULL if reading or
* creating links is not supported. */
* creating links is not supported. */
Tcl_FSListVolumesProc *listVolumesProc;
/* Lists filesystem volumes added by this
* filesystem. NULL if the filesystem does not
@@ -1728,7 +1729,6 @@ typedef struct Tcl_Filesystem {
* override with the Tcl_SetNotifier call.
*/
#ifndef TCL_NO_DEPRECATED
typedef struct Tcl_NotifierProcs {
Tcl_SetTimerProc *setTimerProc;
Tcl_WaitForEventProc *waitForEventProc;
@@ -1739,7 +1739,6 @@ typedef struct Tcl_NotifierProcs {
Tcl_AlertNotifierProc *alertNotifierProc;
Tcl_ServiceModeHookProc *serviceModeHookProc;
} Tcl_NotifierProcs;
#endif /* TCL_NO_DEPRECATED */
/*
*----------------------------------------------------------------------------
@@ -2316,9 +2315,9 @@ EXTERN void Tcl_StaticLibrary(Tcl_Interp *interp,
#endif
EXTERN Tcl_ExitProc * Tcl_SetExitProc(Tcl_ExitProc *proc);
#ifdef _WIN32
EXTERN const char *TclZipfs_AppHook(int *argc, unsigned short ***argv);
EXTERN const char * TclZipfs_AppHook(int *argc, unsigned short ***argv);
#else
EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv);
EXTERN const char * TclZipfs_AppHook(int *argc, char ***argv);
#endif
#if defined(_WIN32) && defined(UNICODE)
#ifndef USE_TCL_STUBS
@@ -2438,8 +2437,8 @@ EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv);
static inline void
TclBounceRefCount(
Tcl_Obj* objPtr,
const char* file,
Tcl_Obj *objPtr,
const char *file,
int line)
{
if (objPtr) {
@@ -2477,7 +2476,7 @@ TclBounceRefCount(
static inline void
TclBounceRefCount(
Tcl_Obj* objPtr)
Tcl_Obj *objPtr)
{
if (objPtr) {
if ((objPtr)->refCount == 0) {
+5 -5
View File
@@ -72,9 +72,9 @@ union overhead {
#define RMAGIC 0x5555 /* magic # on range info */
#ifndef NDEBUG
#define RSLOP sizeof(unsigned short)
#define RSLOP sizeof(unsigned short)
#else
#define RSLOP 0
#define RSLOP 0
#endif
#define OVERHEAD (sizeof(union overhead) + RSLOP)
@@ -138,10 +138,10 @@ static size_t numMallocs[NBUCKETS+1];
#endif
#if !defined(NDEBUG)
#define ASSERT(p) if (!(p)) Tcl_Panic(# p)
#define ASSERT(p) if (!(p)) Tcl_Panic(# p)
#define RANGE_ASSERT(p) if (!(p)) Tcl_Panic(# p)
#else
#define ASSERT(p)
#define ASSERT(p)
#define RANGE_ASSERT(p)
#endif
@@ -666,7 +666,7 @@ mstats(
}
fprintf(stderr, "\n\tTotal small in use: %" TCL_Z_MODIFIER "u, total free: %" TCL_Z_MODIFIER "u\n",
totalUsed, totalFree);
totalUsed, totalFree);
fprintf(stderr, "\n\tNumber of big (>%" TCL_Z_MODIFIER "u) blocks in use: %" TCL_Z_MODIFIER "u\n",
MAXMALLOC, numMallocs[NBUCKETS]);
+40 -36
View File
@@ -68,6 +68,9 @@ typedef struct {
/* Forward declarations. */
static int ExtractNumber(Tcl_Interp *interp, bool useDoubles,
Tcl_WideInt *intNumberPtr, double *dblNumberPtr,
Tcl_Obj *numberObj);
static int TclArithSeriesObjIndex(TCL_UNUSED(Tcl_Interp *),
Tcl_Obj *arithSeriesObj, Tcl_Size index,
Tcl_Obj **elemObj);
@@ -304,7 +307,7 @@ ArithSeriesLenInt(
// Check for opposite sequence directions
if ((step < 0 && (end-start) > 0)
|| (step > 0 && (end-start) < 0)) {
|| (step > 0 && (end-start) < 0)) {
return 0;
}
if (step == 0) {
@@ -453,11 +456,11 @@ FreeArithSeriesInternalRep(
*
* NewArithSeriesInt --
*
* Creates a new ArithSeries object. The returned object has
* refcount = 0.
* Creates a new ArithSeries object.
*
* Results:
* A Tcl_Obj pointer to the created ArithSeries object.
* A Tcl_Obj pointer to the created ArithSeries object. The returned
* object has refcount = 0.
* A NULL pointer of the range is invalid.
*
* Side Effects:
@@ -553,11 +556,11 @@ NewArithSeriesInt(
*
* NewArithSeriesDbl --
*
* Creates a new ArithSeries object with doubles. The returned object has
* refcount = 0.
* Creates a new ArithSeries object with doubles.
*
* Results:
* A Tcl_Obj pointer to the created ArithSeries object.
* A Tcl_Obj pointer to the created ArithSeries object. The returned
* object has refcount = 0.
* A NULL pointer of the range is invalid.
*
* Side Effects:
@@ -609,27 +612,28 @@ NewArithSeriesDbl(
/*
*----------------------------------------------------------------------
*
* assignNumber --
* ExtractNumber --
*
* Create the appropriate Tcl_Obj value for the given numeric values.
* Used locally only for decoding [lseq] numeric arguments.
* refcount = 0.
* Extract the number from a Tcl_Obj value given the type of number
* expected at that point. Used locally only for decoding [lseq]
* numeric arguments.
*
* Results:
* A Tcl_Obj pointer. No assignment on error.
* A Tcl result code, with OUT parameters assigned on success.
* No assignment on error.
*
* Side Effects:
* None.
* May alter the Tcl_Obj's type. May set the interpreter result.
*
*----------------------------------------------------------------------
*/
static int
assignNumber(
Tcl_Interp *interp,
bool useDoubles,
Tcl_WideInt *intNumberPtr,
double *dblNumberPtr,
Tcl_Obj *numberObj)
ExtractNumber(
Tcl_Interp *interp, // Where to report errors.
bool useDoubles, // Whether we're looking for doubles.
Tcl_WideInt *intNumberPtr, // Where to write the integer value.
double *dblNumberPtr, // Where to write the double value.
Tcl_Obj *numberObj) // The Tcl value to read the number from.
{
void *ptr;
int type;
@@ -674,7 +678,7 @@ assignNumber(
*
* Creates a new ArithSeries object. Some arguments may be NULL and will
* be computed based on the other given arguments.
* refcount = 0.
* refcount = 0.
*
* Results:
* A Tcl_Obj pointer to the created ArithSeries object.
@@ -703,7 +707,6 @@ TclNewArithSeriesObj(
const char *description;
char tmp[TCL_DOUBLE_SPACE + 2] = {0};
if (lenObj) {
if (Tcl_GetWideIntFromObj(interp, lenObj, &len) != TCL_OK) {
return NULL;
@@ -714,7 +717,7 @@ TclNewArithSeriesObj(
}
if (stepObj) {
if (assignNumber(interp, useDoubles, &step, &dstep, stepObj) != TCL_OK) {
if (ExtractNumber(interp, useDoubles, &step, &dstep, stepObj) != TCL_OK) {
return NULL;
}
} else {
@@ -724,7 +727,7 @@ TclNewArithSeriesObj(
}
if (startObj) {
if (assignNumber(interp, useDoubles, &start, &dstart, startObj) != TCL_OK) {
if (ExtractNumber(interp, useDoubles, &start, &dstart, startObj) != TCL_OK) {
return NULL;
}
} else {
@@ -734,12 +737,12 @@ TclNewArithSeriesObj(
}
if (endObj) {
if (assignNumber(interp, useDoubles, &end, &dend, endObj) != TCL_OK) {
if (ExtractNumber(interp, useDoubles, &end, &dend, endObj) != TCL_OK) {
return NULL;
}
}
if (endObj) {
if (assignNumber(interp, useDoubles, &end, &dend, endObj) != TCL_OK) {
if (ExtractNumber(interp, useDoubles, &end, &dend, endObj) != TCL_OK) {
return NULL;
}
}
@@ -916,11 +919,11 @@ ArithSeriesObjLength(
* TclArithSeriesObjRange --
*
* Makes a slice of an ArithSeries value.
* *arithSeriesObj must be known to be a valid list.
* *arithSeriesObj must be known to be a valid list.
*
* Results:
* Returns a pointer to the sliced series.
* This may be a new object or the same object if not shared.
* This may be a new object or the same object if not shared.
*
* Side effects:
* ?The possible conversion of the object referenced by listPtr?
@@ -973,7 +976,7 @@ TclArithSeriesObjRange(
if (Tcl_IsShared(arithSeriesObj) || (arithSeriesRepPtr->refCount > 1)) {
/* as new object */
*newObjPtr = NewArithSeriesDbl(dstart, dblRepPtr->step, len,
dblRepPtr->precision);
dblRepPtr->precision);
} else {
/* in-place is possible */
*newObjPtr = arithSeriesObj;
@@ -1064,7 +1067,7 @@ TclArithSeriesGetElements(
objv = arithSeriesRepPtr->elements;
} else {
/* Construct the elements array */
objv = (Tcl_Obj **) Tcl_Alloc(sizeof(Tcl_Obj*) * objc);
objv = (Tcl_Obj **) Tcl_Alloc(sizeof(Tcl_Obj *) * objc);
if (objv == NULL) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
@@ -1112,10 +1115,10 @@ TclArithSeriesGetElements(
* values appropriately swapped and the Step value sign is changed.
*
* Results:
* The result will be an ArithSeries in the reverse order.
* The result will be an ArithSeries in the reverse order.
*
* Side effects:
* The ogiginal obj will be modified and returned if it is not Shared.
* The ogiginal obj will be modified and returned if it is not Shared.
*
*----------------------------------------------------------------------
*/
@@ -1138,11 +1141,12 @@ TclArithSeriesObjReverse(
if (arithSeriesRepPtr->isDouble) {
ArithSeriesDbl *dblRepPtr = (ArithSeriesDbl *)arithSeriesRepPtr;
resultObj = NewArithSeriesDbl(ArithSeriesEndDbl(dblRepPtr),
-dblRepPtr->step, arithSeriesRepPtr->len, dblRepPtr->precision);
-dblRepPtr->step, arithSeriesRepPtr->len,
dblRepPtr->precision);
} else {
ArithSeriesInt *intRepPtr = (ArithSeriesInt *)arithSeriesRepPtr;
resultObj = NewArithSeriesInt(ArithSeriesEndInt(intRepPtr),
-intRepPtr->step, arithSeriesRepPtr->len);
-intRepPtr->step, arithSeriesRepPtr->len);
}
} else {
/*
@@ -1278,14 +1282,14 @@ UpdateStringOfArithSeries(
*
* Evaluate the "in" operation for expr
*
* This can be done more efficiently in the Arith Series relative to
* doing a linear search as implemented in expr.
* This can be done more efficiently in the Arith Series relative to
* doing a linear search as implemented in expr.
*
* Results:
* Boolean true or false (1/0)
*
* Side effects:
* None
* None
*
*----------------------------------------------------------------------
*/
+166 -165
View File
@@ -18,7 +18,7 @@
*- More instructions:
*- done - alternate exit point (affects stack and exception range checking)
*- break and continue - if exception ranges can be sorted out.
*- foreach_start4, foreach_step4
*- foreach_start, foreach_step, foreach_index, foreach_end
*- returnImm, returnStk
*- expandStart, expandStkTop, invokeExpanded, expandDrop
*- dictFirst, dictNext, dictDone
@@ -78,7 +78,7 @@ typedef struct BasicBlock {
/* BasicBlock structure of the following
* block: NULL at the end of the bytecode
* sequence. */
Tcl_Obj* jumpTarget; /* Jump target label if the jump target is
Tcl_Obj *jumpTarget; /* Jump target label if the jump target is
* unresolved */
int initialStackDepth; /* Absolute stack depth on entry */
int minStackDepth; /* Low-water relative stack depth */
@@ -231,80 +231,79 @@ typedef struct AssemblyEnv {
* Static functions defined in this file.
*/
static void AddBasicBlockRangeToErrorInfo(AssemblyEnv*,
BasicBlock*);
static BasicBlock * AllocBB(AssemblyEnv*);
static int AssembleOneLine(AssemblyEnv* envPtr);
static void BBAdjustStackDepth(BasicBlock* bbPtr, int consumed,
static void AddBasicBlockRangeToErrorInfo(AssemblyEnv *,
BasicBlock *);
static BasicBlock * AllocBB(AssemblyEnv *);
static int AssembleOneLine(AssemblyEnv *envPtr);
static void BBAdjustStackDepth(BasicBlock *bbPtr, int consumed,
int produced);
static void BBUpdateStackReqs(BasicBlock* bbPtr, int tblIdx,
static void BBUpdateStackReqs(BasicBlock *bbPtr, int tblIdx,
int count);
static void BBEmitInstInt1(AssemblyEnv* assemEnvPtr, int tblIdx,
static void BBEmitInstInt1(AssemblyEnv *assemEnvPtr, int tblIdx,
int opnd, int count);
static void BBEmitInstInt4(AssemblyEnv* assemEnvPtr, int tblIdx,
static void BBEmitInstInt4(AssemblyEnv *assemEnvPtr, int tblIdx,
int opnd, int count);
static void BBEmitOpcode(AssemblyEnv* assemEnvPtr, int tblIdx,
static void BBEmitOpcode(AssemblyEnv *assemEnvPtr, int tblIdx,
int count);
static int BuildExceptionRanges(AssemblyEnv* assemEnvPtr);
static int ValidateJumpTargets(AssemblyEnv*);
static int CheckForUnclosedCatches(AssemblyEnv*);
static int CheckForThrowInWrongContext(AssemblyEnv*);
static int CheckNonThrowingBlock(AssemblyEnv*, BasicBlock*);
static int BuildExceptionRanges(AssemblyEnv *assemEnvPtr);
static int ValidateJumpTargets(AssemblyEnv *);
static int CheckForUnclosedCatches(AssemblyEnv *);
static int CheckForThrowInWrongContext(AssemblyEnv *);
static int CheckNonThrowingBlock(AssemblyEnv *, BasicBlock *);
static int BytecodeMightThrow(unsigned char);
static int CheckJumpTableLabels(AssemblyEnv*, BasicBlock*);
static int CheckNamespaceQualifiers(Tcl_Interp*, const char*,
static int CheckJumpTableLabels(AssemblyEnv *, BasicBlock *);
static int CheckNamespaceQualifiers(Tcl_Interp *, const char *,
Tcl_Size);
static int CheckNonNegative(Tcl_Interp*, Tcl_Size);
static int CheckOneByte(Tcl_Interp*, Tcl_Size);
static int CheckSignedOneByte(Tcl_Interp*, Tcl_Size);
static int CheckStack(AssemblyEnv*);
static int CheckStrictlyPositive(Tcl_Interp*, Tcl_Size);
static ByteCode * CompileAssembleObj(Tcl_Interp *interp,
Tcl_Obj *objPtr);
static void CompileEmbeddedScript(AssemblyEnv*, Tcl_Token*,
const TalInstDesc*);
static int DefineLabel(AssemblyEnv* envPtr, const char* label);
static void DeleteMirrorJumpTable(JumptableInfo* jtPtr,
JumptableNumInfo* jtnPtr);
static void FillInJumpOffsets(AssemblyEnv*);
static int CreateMirrorJumpTable(AssemblyEnv* assemEnvPtr,
Tcl_Size objc, Tcl_Obj** objv);
static int CreateMirrorNumJumpTable(AssemblyEnv* assemEnvPtr,
Tcl_Size objc, Tcl_Obj** objv);
static size_t FindLocalVar(AssemblyEnv* envPtr,
static int CheckNonNegative(Tcl_Interp *, Tcl_Size);
static int CheckOneByte(Tcl_Interp *, Tcl_Size);
static int CheckSignedOneByte(Tcl_Interp *, Tcl_Size);
static int CheckStack(AssemblyEnv *);
static int CheckStrictlyPositive(Tcl_Interp *, Tcl_Size);
static ByteCode * CompileAssembleObj(Tcl_Interp *, Tcl_Obj *objPtr);
static void CompileEmbeddedScript(AssemblyEnv *, Tcl_Token *,
const TalInstDesc *);
static int DefineLabel(AssemblyEnv *envPtr, const char *label);
static void DeleteMirrorJumpTable(JumptableInfo *jtPtr,
JumptableNumInfo *jtnPtr);
static void FillInJumpOffsets(AssemblyEnv *);
static int CreateMirrorJumpTable(AssemblyEnv *assemEnvPtr,
Tcl_Size objc, Tcl_Obj **objv);
static int CreateMirrorNumJumpTable(AssemblyEnv *assemEnvPtr,
Tcl_Size objc, Tcl_Obj **objv);
static size_t FindLocalVar(AssemblyEnv *envPtr,
Tcl_Token** tokenPtrPtr);
static int FinishAssembly(AssemblyEnv*);
static void FreeAssemblyEnv(AssemblyEnv*);
static int GetBooleanOperand(AssemblyEnv*, Tcl_Token**, int*);
static int GetListIndexOperand(AssemblyEnv*, Tcl_Token**, int*);
static int GetIntegerOperand(AssemblyEnv*, Tcl_Token**, int*);
static int GetNextOperand(AssemblyEnv*, Tcl_Token**, Tcl_Obj**);
static void LookForFreshCatches(BasicBlock*, BasicBlock**);
static void MoveExceptionRangesToBasicBlock(AssemblyEnv*, Tcl_Size);
static AssemblyEnv* NewAssemblyEnv(CompileEnv*, int);
static int ProcessCatches(AssemblyEnv*);
static int ProcessCatchesInBasicBlock(AssemblyEnv*, BasicBlock*,
BasicBlock*, enum BasicBlockCatchState, int);
static void ResetVisitedBasicBlocks(AssemblyEnv*);
static void ResolveJumpTableTargets(AssemblyEnv*, BasicBlock*);
static void ReportUndefinedLabel(AssemblyEnv*, BasicBlock*,
Tcl_Obj*);
static void RestoreEmbeddedExceptionRanges(AssemblyEnv*);
static int StackCheckBasicBlock(AssemblyEnv*, BasicBlock *,
static int FinishAssembly(AssemblyEnv *);
static void FreeAssemblyEnv(AssemblyEnv *);
static int GetBooleanOperand(AssemblyEnv *, Tcl_Token **, int *);
static int GetListIndexOperand(AssemblyEnv *, Tcl_Token **, int *);
static int GetIntegerOperand(AssemblyEnv *, Tcl_Token **, int *);
static int GetNextOperand(AssemblyEnv *, Tcl_Token **, Tcl_Obj **);
static void LookForFreshCatches(BasicBlock *, BasicBlock **);
static void MoveExceptionRangesToBasicBlock(AssemblyEnv *, Tcl_Size);
static AssemblyEnv* NewAssemblyEnv(CompileEnv *, int);
static int ProcessCatches(AssemblyEnv *);
static int ProcessCatchesInBasicBlock(AssemblyEnv *, BasicBlock *,
BasicBlock *, enum BasicBlockCatchState, int);
static void ResetVisitedBasicBlocks(AssemblyEnv *);
static void ResolveJumpTableTargets(AssemblyEnv *, BasicBlock *);
static void ReportUndefinedLabel(AssemblyEnv *, BasicBlock *,
Tcl_Obj *);
static void RestoreEmbeddedExceptionRanges(AssemblyEnv *);
static int StackCheckBasicBlock(AssemblyEnv *, BasicBlock *,
BasicBlock *, int);
static BasicBlock* StartBasicBlock(AssemblyEnv*, int fallthrough,
Tcl_Obj* jumpLabel);
Tcl_Obj *jumpLabel);
/* static int AdvanceIp(const unsigned char *pc); */
static int StackCheckBasicBlock(AssemblyEnv*, BasicBlock *,
static int StackCheckBasicBlock(AssemblyEnv *, BasicBlock *,
BasicBlock *, int);
static int StackCheckExit(AssemblyEnv*);
static void StackFreshCatches(AssemblyEnv*, BasicBlock*, int,
BasicBlock**, Tcl_Size*);
static void SyncStackDepth(AssemblyEnv*);
static int TclAssembleCode(CompileEnv* envPtr, const char* code,
static int StackCheckExit(AssemblyEnv *);
static void StackFreshCatches(AssemblyEnv *, BasicBlock *, int,
BasicBlock **, Tcl_Size *);
static void SyncStackDepth(AssemblyEnv *);
static int TclAssembleCode(CompileEnv *envPtr, const char *code,
Tcl_Size codeLen, int flags);
static void UnstackExpiredCatches(CompileEnv*, BasicBlock*, int,
BasicBlock**, Tcl_Size*);
static void UnstackExpiredCatches(CompileEnv *, BasicBlock *, int,
BasicBlock **, Tcl_Size *);
/*
* Tcl_ObjType that describes bytecode emitted by the assembler.
@@ -735,7 +734,7 @@ Tcl_AssembleObjCmd(
void *clientData, /* clientData */
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
/*
* Boilerplate - make sure that there is an NRE trampoline on the C stack
@@ -751,7 +750,7 @@ TclNRAssembleObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
ByteCode *codePtr; /* Pointer to the bytecode to execute */
@@ -991,7 +990,7 @@ TclAssembleCode(
Tcl_Size codeLen, /* Length of the code */
int flags) /* OR'ed combination of flags */
{
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
/*
* Walk through the assembly script using the Tcl parser. Each 'command'
@@ -1116,7 +1115,7 @@ NewAssemblyEnv(
* generation*/
int flags) /* Compilation flags (TCL_EVAL_DIRECT) */
{
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
AssemblyEnv* assemEnvPtr = (AssemblyEnv*)TclStackAlloc(interp,
sizeof(AssemblyEnv));
@@ -1169,7 +1168,7 @@ FreeAssemblyEnv(
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment being used for code
* generation */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
BasicBlock* thisBB; /* Pointer to a basic block being deleted */
BasicBlock* nextBB; /* Pointer to a deleted basic block's
@@ -1226,18 +1225,18 @@ AssembleOneLine(
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment being used for code
* gen */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
Tcl_Parse* parsePtr = assemEnvPtr->parsePtr;
/* Parse of the line of code */
Tcl_Token* tokenPtr; /* Current token within the line of code */
Tcl_Obj* instNameObj; /* Name of the instruction */
Tcl_Obj *instNameObj; /* Name of the instruction */
int tblIdx; /* Index in TalInstructionTable of the
* instruction */
TalInstType instType; /* Type of the instruction */
Tcl_Obj* operand1Obj = NULL;
Tcl_Obj *operand1Obj = NULL;
/* First operand to the instruction */
const char* operand1; /* String rep of the operand */
const char *operand1; /* String rep of the operand */
Tcl_Size operand1Len; /* String length of the operand */
int opnd; /* Integer representation of an operand */
int litIndex; /* Literal pool index of a constant */
@@ -1768,7 +1767,7 @@ CompileEmbeddedScript(
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
/*
@@ -1933,17 +1932,18 @@ MoveExceptionRangesToBasicBlock(
* JumptableInfo. The keys in the JumptableInfo are the comparison
* strings. The values, instead of being jump displacements, are
* Tcl_Obj's with the code labels.
*
*-----------------------------------------------------------------------------
*/
static int
CreateMirrorJumpTable(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
Tcl_Size objc, /* Number of elements in the 'jumps' list */
Tcl_Obj** objv) /* Pointers to the elements in the list */
Tcl_Obj **objv) /* Pointers to the elements in the list */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
BasicBlock* bbPtr = assemEnvPtr->curr_bb;
/* Current basic block */
@@ -2009,17 +2009,18 @@ CreateMirrorJumpTable(
* JumptableNumInfo. The keys in the JumptableNumInfo are the comparison
* integers. The values, instead of being jump displacements, are
* Tcl_Obj's with the code labels.
*
*-----------------------------------------------------------------------------
*/
static int
CreateMirrorNumJumpTable(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
Tcl_Size objc, /* Number of elements in the 'jumps' list */
Tcl_Obj** objv) /* Pointers to the elements in the list */
Tcl_Obj **objv) /* Pointers to the elements in the list */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
BasicBlock* bbPtr = assemEnvPtr->curr_bb;
/* Current basic block */
@@ -2099,14 +2100,14 @@ DeleteMirrorJumpTable(
Tcl_HashTable* hashPtr; /* Hash table pointer */
Tcl_HashSearch search; /* Hash search control */
Tcl_HashEntry* entry; /* Hash table entry containing a jump label */
Tcl_Obj* label; /* Jump label from the hash table */
Tcl_Obj *label; /* Jump label from the hash table */
if (jtPtr) {
hashPtr = &jtPtr->hashTable;
for (entry = Tcl_FirstHashEntry(hashPtr, &search);
entry != NULL;
entry = Tcl_NextHashEntry(&search)) {
label = (Tcl_Obj*)Tcl_GetHashValue(entry);
label = (Tcl_Obj *)Tcl_GetHashValue(entry);
Tcl_DecrRefCount(label);
Tcl_SetHashValue(entry, NULL);
}
@@ -2118,7 +2119,7 @@ DeleteMirrorJumpTable(
for (entry = Tcl_FirstHashEntry(hashPtr, &search);
entry != NULL;
entry = Tcl_NextHashEntry(&search)) {
label = (Tcl_Obj*)Tcl_GetHashValue(entry);
label = (Tcl_Obj *)Tcl_GetHashValue(entry);
Tcl_DecrRefCount(label);
Tcl_SetHashValue(entry, NULL);
}
@@ -2148,14 +2149,14 @@ DeleteMirrorJumpTable(
static int
GetNextOperand(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
Tcl_Token** tokenPtrPtr, /* INPUT/OUTPUT: Pointer to the token holding
AssemblyEnv *assemEnvPtr, /* Assembly environment */
Tcl_Token **tokenPtrPtr, /* INPUT/OUTPUT: Pointer to the token holding
* the operand */
Tcl_Obj** operandObjPtr) /* OUTPUT: Tcl object holding the operand text
Tcl_Obj **operandObjPtr) /* OUTPUT: Tcl object holding the operand text
* with \-substitutions done. */
{
Tcl_Interp* interp = (Tcl_Interp*) assemEnvPtr->envPtr->iPtr;
Tcl_Obj* operandObj;
Tcl_Interp *interp = (Tcl_Interp *) assemEnvPtr->envPtr->iPtr;
Tcl_Obj *operandObj;
TclNewObj(operandObj);
if (!TclWordKnownAtCompileTime(*tokenPtrPtr, operandObj)) {
@@ -2201,12 +2202,12 @@ GetBooleanOperand(
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
Tcl_Token* tokenPtr = *tokenPtrPtr;
/* INOUT: Pointer to the next token in the
* source code */
Tcl_Obj* intObj; /* Integer from the source code */
Tcl_Obj *intObj; /* Integer from the source code */
int status; /* Tcl status return */
/*
@@ -2254,12 +2255,12 @@ GetIntegerOperand(
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
Tcl_Token* tokenPtr = *tokenPtrPtr;
/* INOUT: Pointer to the next token in the
* source code */
Tcl_Obj* intObj; /* Integer from the source code */
Tcl_Obj *intObj; /* Integer from the source code */
int status; /* Tcl status return */
/*
@@ -2305,11 +2306,11 @@ GetListIndexOperand(
Tcl_Token** tokenPtrPtr, /* Current token from the parser */
int* result) /* OUTPUT: encoded index derived from the token */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
CompileEnv *envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
Tcl_Token* tokenPtr = *tokenPtrPtr;
Tcl_Token *tokenPtr = *tokenPtrPtr;
/* INOUT: Pointer to the next token in the
* source code */
Tcl_Obj *value;
@@ -2357,18 +2358,18 @@ GetListIndexOperand(
static size_t
FindLocalVar(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
Tcl_Token** tokenPtrPtr)
AssemblyEnv *assemEnvPtr, /* Assembly environment */
Tcl_Token **tokenPtrPtr)
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
CompileEnv *envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
Tcl_Token* tokenPtr = *tokenPtrPtr;
Tcl_Token *tokenPtr = *tokenPtrPtr;
/* INOUT: Pointer to the next token in the
* source code. */
Tcl_Obj* varNameObj; /* Name of the variable */
const char* varNameStr;
Tcl_Obj *varNameObj; /* Name of the variable */
const char *varNameStr;
Tcl_Size varNameLen;
Tcl_Size localVar; /* Index of the variable in the LVT */
@@ -2412,11 +2413,11 @@ FindLocalVar(
static int
CheckNamespaceQualifiers(
Tcl_Interp* interp, /* Tcl interpreter for error reporting */
const char* name, /* Variable name to check */
Tcl_Interp *interp, /* Tcl interpreter for error reporting */
const char *name, /* Variable name to check */
Tcl_Size nameLen) /* Length of the variable */
{
const char* p;
const char *p;
for (p = name; p+2 < name+nameLen; p++) {
if ((*p == ':') && (p[1] == ':')) {
@@ -2446,7 +2447,7 @@ CheckNamespaceQualifiers(
static int
CheckOneByte(
Tcl_Interp* interp, /* Tcl interpreter for error reporting */
Tcl_Interp *interp, /* Tcl interpreter for error reporting */
Tcl_Size value) /* Value to check */
{
if (value < 0 || value > 0xFF) {
@@ -2478,7 +2479,7 @@ CheckOneByte(
static int
CheckSignedOneByte(
Tcl_Interp* interp, /* Tcl interpreter for error reporting */
Tcl_Interp *interp, /* Tcl interpreter for error reporting */
Tcl_Size value) /* Value to check */
{
if (value > 0x7F || value < -0x80) {
@@ -2509,7 +2510,7 @@ CheckSignedOneByte(
static int
CheckNonNegative(
Tcl_Interp* interp, /* Tcl interpreter for error reporting */
Tcl_Interp *interp, /* Tcl interpreter for error reporting */
Tcl_Size value) /* Value to check */
{
if (value < 0 || value > INT_MAX) {
@@ -2540,7 +2541,7 @@ CheckNonNegative(
static int
CheckStrictlyPositive(
Tcl_Interp* interp, /* Tcl interpreter for error reporting */
Tcl_Interp *interp, /* Tcl interpreter for error reporting */
Tcl_Size value) /* Value to check */
{
if (value <= 0 || value > INT_MAX) {
@@ -2569,14 +2570,14 @@ CheckStrictlyPositive(
static int
DefineLabel(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
const char* labelName) /* Label being defined */
AssemblyEnv *assemEnvPtr, /* Assembly environment */
const char *labelName) /* Label being defined */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
CompileEnv *envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
Tcl_HashEntry* entry; /* Label's entry in the symbol table */
Tcl_HashEntry *entry; /* Label's entry in the symbol table */
int isNew; /* Flag == 1 iff the label was previously
* undefined */
@@ -2630,7 +2631,7 @@ StartBasicBlock(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
int flags, /* Flags to apply to the basic block being
* closed, if there is one. */
Tcl_Obj* jumpLabel) /* Label of the location that the block jumps
Tcl_Obj *jumpLabel) /* Label of the location that the block jumps
* to, or NULL if the block does not jump */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
@@ -2875,11 +2876,11 @@ CheckJumpTableLabels(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
BasicBlock* bbPtr) /* Basic block that ends in a jump table */
{
Tcl_HashTable* symHash; /* Hash table with the symbols */
Tcl_HashTable *symHash; /* Hash table with the symbols */
Tcl_HashSearch search; /* Hash table iterator */
Tcl_HashEntry* symEntryPtr; /* Hash entry for the symbols */
Tcl_Obj* symbolObj; /* Jump target */
Tcl_HashEntry* valEntryPtr; /* Hash entry for the resolutions */
Tcl_HashEntry *symEntryPtr; /* Hash entry for the symbols */
Tcl_Obj *symbolObj; /* Jump target */
Tcl_HashEntry *valEntryPtr; /* Hash entry for the resolutions */
/*
* Look up every jump target in the jump hash.
@@ -2891,7 +2892,7 @@ CheckJumpTableLabels(
for (symEntryPtr = Tcl_FirstHashEntry(symHash, &search);
symEntryPtr != NULL;
symEntryPtr = Tcl_NextHashEntry(&search)) {
symbolObj = (Tcl_Obj*)Tcl_GetHashValue(symEntryPtr);
symbolObj = (Tcl_Obj *)Tcl_GetHashValue(symEntryPtr);
valEntryPtr = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(symbolObj));
DEBUG_PRINT(" %s -> %s (%d)\n",
@@ -2907,7 +2908,7 @@ CheckJumpTableLabels(
for (symEntryPtr = Tcl_FirstHashEntry(symHash, &search);
symEntryPtr != NULL;
symEntryPtr = Tcl_NextHashEntry(&search)) {
symbolObj = (Tcl_Obj*)Tcl_GetHashValue(symEntryPtr);
symbolObj = (Tcl_Obj *)Tcl_GetHashValue(symEntryPtr);
valEntryPtr = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(symbolObj));
DEBUG_PRINT(" %" TCL_SIZE_MODIFIER "d -> %s (%d)\n",
@@ -2939,14 +2940,14 @@ CheckJumpTableLabels(
static void
ReportUndefinedLabel(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
BasicBlock* bbPtr, /* Basic block that contains the undefined
AssemblyEnv *assemEnvPtr, /* Assembly environment */
BasicBlock *bbPtr, /* Basic block that contains the undefined
* label */
Tcl_Obj* jumpTarget) /* Label of a jump target */
Tcl_Obj *jumpTarget) /* Label of a jump target */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
CompileEnv *envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
if (assemEnvPtr->flags & TCL_EVAL_DIRECT) {
@@ -3024,7 +3025,7 @@ ResolveJumpTableTargets(
Tcl_HashTable* symHash; /* Hash table with the symbols */
Tcl_HashSearch search; /* Hash table iterator */
Tcl_HashEntry* symEntryPtr; /* Hash entry for the symbols */
Tcl_Obj* symbolObj; /* Jump target */
Tcl_Obj *symbolObj; /* Jump target */
Tcl_HashEntry* valEntryPtr; /* Hash entry for the resolutions */
Tcl_HashTable* realJumpHashPtr;
/* Jump table hash in the actual code */
@@ -3056,7 +3057,7 @@ ResolveJumpTableTargets(
for (symEntryPtr = Tcl_FirstHashEntry(symHash, &search);
symEntryPtr != NULL;
symEntryPtr = Tcl_NextHashEntry(&search)) {
symbolObj = (Tcl_Obj*)Tcl_GetHashValue(symEntryPtr);
symbolObj = (Tcl_Obj *)Tcl_GetHashValue(symEntryPtr);
DEBUG_PRINT(" symbol %s\n", TclGetString(symbolObj));
valEntryPtr = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
@@ -3097,7 +3098,7 @@ ResolveJumpTableTargets(
for (symEntryPtr = Tcl_FirstHashEntry(symHash, &search);
symEntryPtr != NULL;
symEntryPtr = Tcl_NextHashEntry(&search)) {
symbolObj = (Tcl_Obj*)Tcl_GetHashValue(symEntryPtr);
symbolObj = (Tcl_Obj *)Tcl_GetHashValue(symEntryPtr);
DEBUG_PRINT(" symbol %s\n", TclGetString(symbolObj));
valEntryPtr = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
@@ -3183,15 +3184,15 @@ CheckForThrowInWrongContext(
static int
CheckNonThrowingBlock(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
BasicBlock* blockPtr) /* Basic block where exceptions are not
AssemblyEnv *assemEnvPtr, /* Assembly environment */
BasicBlock *blockPtr) /* Basic block where exceptions are not
* allowed */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
CompileEnv *envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
BasicBlock* nextPtr; /* Pointer to the succeeding basic block */
BasicBlock *nextPtr; /* Pointer to the succeeding basic block */
Tcl_Size offset; /* Bytecode offset of the current
* instruction */
Tcl_Size bound; /* Bytecode offset following the last
@@ -3374,23 +3375,23 @@ CheckStack(
static int
StackCheckBasicBlock(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
BasicBlock* blockPtr, /* Pointer to the basic block being checked */
BasicBlock* predecessor, /* Pointer to the block that passed control to
AssemblyEnv *assemEnvPtr, /* Assembly environment */
BasicBlock *blockPtr, /* Pointer to the basic block being checked */
BasicBlock *predecessor, /* Pointer to the block that passed control to
* this one. */
int initialStackDepth) /* Stack depth on entry to the block */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
CompileEnv *envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
BasicBlock* jumpTarget; /* Basic block where a jump goes */
int stackDepth; /* Current stack depth */
int maxDepth; /* Maximum stack depth so far */
int result; /* Tcl status return */
Tcl_HashSearch jtSearch; /* Search structure for the jump table */
Tcl_HashEntry* jtEntry; /* Hash entry in the jump table */
Tcl_Obj* targetLabel; /* Target label from the jump table */
Tcl_HashEntry *jtEntry; /* Hash entry in the jump table */
Tcl_Obj *targetLabel; /* Target label from the jump table */
Tcl_HashEntry* entry; /* Hash entry in the label table */
if (blockPtr->flags & BB_VISITED) {
@@ -3502,10 +3503,10 @@ StackCheckBasicBlock(
for (jtEntry = Tcl_FirstHashEntry(tablePtr, &jtSearch);
result == TCL_OK && jtEntry != NULL;
jtEntry = Tcl_NextHashEntry(&jtSearch)) {
targetLabel = (Tcl_Obj*)Tcl_GetHashValue(jtEntry);
targetLabel = (Tcl_Obj *)Tcl_GetHashValue(jtEntry);
entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(targetLabel));
jumpTarget = (BasicBlock*)Tcl_GetHashValue(entry);
jumpTarget = (BasicBlock *)Tcl_GetHashValue(entry);
result = StackCheckBasicBlock(assemEnvPtr, jumpTarget,
blockPtr, stackDepth);
}
@@ -3537,16 +3538,16 @@ StackCheckBasicBlock(
static int
StackCheckExit(
AssemblyEnv* assemEnvPtr) /* Assembly environment */
AssemblyEnv *assemEnvPtr) /* Assembly environment */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
CompileEnv *envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
int depth; /* Net stack effect */
int litIndex; /* Index in the literal pool of the empty
* string */
BasicBlock* curr_bb = assemEnvPtr->curr_bb;
BasicBlock *curr_bb = assemEnvPtr->curr_bb;
/* Final basic block in the assembly */
/*
@@ -3687,34 +3688,34 @@ ProcessCatches(
static int
ProcessCatchesInBasicBlock(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
BasicBlock* bbPtr, /* Basic block being processed */
BasicBlock* enclosing, /* Start basic block of the enclosing catch */
AssemblyEnv *assemEnvPtr, /* Assembly environment */
BasicBlock *bbPtr, /* Basic block being processed */
BasicBlock *enclosing, /* Start basic block of the enclosing catch */
enum BasicBlockCatchState state,
/* BBCS_NONE, BBCS_INCATCH, or BBCS_CAUGHT */
int catchDepth) /* Depth of nesting of catches */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
CompileEnv *envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
int result; /* Return value from this procedure */
BasicBlock* fallThruEnclosing;
BasicBlock *fallThruEnclosing;
/* Enclosing catch if execution falls thru */
enum BasicBlockCatchState fallThruState;
/* Catch state of the successor block */
BasicBlock* jumpEnclosing; /* Enclosing catch if execution goes to jump
BasicBlock *jumpEnclosing; /* Enclosing catch if execution goes to jump
* target */
enum BasicBlockCatchState jumpState;
/* Catch state of the jump target */
int changed = 0; /* Flag == 1 iff successor blocks need to be
* checked because the state of this block has
* changed. */
BasicBlock* jumpTarget; /* Basic block where a jump goes */
BasicBlock *jumpTarget; /* Basic block where a jump goes */
Tcl_HashSearch jtSearch; /* Hash search control for a jumptable */
Tcl_HashEntry* jtEntry; /* Entry in a jumptable */
Tcl_Obj* targetLabel; /* Target label from a jumptable */
Tcl_HashEntry* entry; /* Entry from the label table */
Tcl_HashEntry *jtEntry; /* Entry in a jumptable */
Tcl_Obj *targetLabel; /* Target label from a jumptable */
Tcl_HashEntry *entry; /* Entry from the label table */
/*
* Update the state of the current block, checking for consistency. Set
@@ -3826,7 +3827,7 @@ ProcessCatchesInBasicBlock(
for (jtEntry = Tcl_FirstHashEntry(tablePtr, &jtSearch);
result == TCL_OK && jtEntry != NULL;
jtEntry = Tcl_NextHashEntry(&jtSearch)) {
targetLabel = (Tcl_Obj*)Tcl_GetHashValue(jtEntry);
targetLabel = (Tcl_Obj *)Tcl_GetHashValue(jtEntry);
entry = Tcl_FindHashEntry(&assemEnvPtr->labelHash,
TclGetString(targetLabel));
jumpTarget = (BasicBlock*)Tcl_GetHashValue(entry);
@@ -3855,11 +3856,11 @@ ProcessCatchesInBasicBlock(
static int
CheckForUnclosedCatches(
AssemblyEnv* assemEnvPtr) /* Assembly environment */
AssemblyEnv *assemEnvPtr) /* Assembly environment */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
CompileEnv *envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
if (assemEnvPtr->curr_bb->catchState >= BBCS_INCATCH) {
@@ -4260,12 +4261,12 @@ ResetVisitedBasicBlocks(
static void
AddBasicBlockRangeToErrorInfo(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
BasicBlock* bbPtr) /* Basic block in which the error is found */
AssemblyEnv *assemEnvPtr, /* Assembly environment */
BasicBlock *bbPtr) /* Basic block in which the error is found */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
CompileEnv *envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
Tcl_Interp *interp = (Tcl_Interp *) envPtr->iPtr;
/* Tcl interpreter */
if (bbPtr->successor1 != NULL) {
+1 -1
View File
@@ -438,7 +438,7 @@ bool *
TclGetAsyncReadyPtr(void)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
return &(tsdPtr->asyncReady);
return &tsdPtr->asyncReady;
}
/*
+529 -103
View File
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -520,9 +520,9 @@ MakeByteArray(
if (demandProper) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"expected byte sequence but character %"
TCL_Z_MODIFIER "u was '%1s' (U+%06X)",
dst - byteArrayPtr->bytes, src, ch));
"expected code point values below 0xff but value at byte offset %"
TCL_Z_MODIFIER "u was 0x%x",
dst - byteArrayPtr->bytes, ch));
Tcl_SetErrorCode(interp, "TCL", "VALUE", "BYTES", (char *)NULL);
}
Tcl_Free(byteArrayPtr);
@@ -806,7 +806,7 @@ BinaryFormatCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size arg; /* Index of next argument to consume. */
int value = 0; /* Current integer value to be packed.
@@ -1318,7 +1318,7 @@ BinaryScanCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size arg; /* Index of next argument to consume. */
int value = 0; /* Current integer value to be packed.
@@ -2009,7 +2009,7 @@ FormatNumber(
if (fabs(dvalue) > (FLT_MAX + pow(2, (FLT_MAX_EXP - FLT_MANT_DIG - 1)))) {
fvalue = (dvalue >= 0.0) ? INFINITY : -INFINITY; // c99
} else {
fvalue = (dvalue >= 0.0) ? FLT_MAX : -FLT_MAX;
fvalue = (dvalue >= 0.0) ? FLT_MAX : -FLT_MAX;
}
} else {
fvalue = (float) dvalue;
@@ -2402,7 +2402,7 @@ BinaryEncodeHex(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *resultObj = NULL;
unsigned char *data = NULL;
@@ -2450,7 +2450,7 @@ BinaryDecodeHex(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *resultObj = NULL;
unsigned char *data, *datastart, *dataend;
@@ -2577,7 +2577,7 @@ BinaryEncode64(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *resultObj;
unsigned char *data, *limit;
@@ -2705,7 +2705,7 @@ BinaryEncodeUu(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *resultObj;
unsigned char *data, *start, *cursor;
@@ -2856,7 +2856,7 @@ BinaryDecodeUu(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *resultObj = NULL;
unsigned char *data, *datastart, *dataend;
@@ -3032,7 +3032,7 @@ BinaryDecode64(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *resultObj = NULL;
unsigned char *data, *datastart, *dataend, c = '\0';
+18 -19
View File
@@ -94,7 +94,7 @@ static size_t total_frees = 0;
static size_t current_bytes_malloced = 0;
static size_t maximum_bytes_malloced = 0;
static size_t current_malloc_packets = 0;
static size_t maximum_malloc_packets = 0;
static size_t maximum_malloc_packets = 0;
static size_t break_on_malloc = 0;
static size_t trace_on_at_malloc = 0;
static int alloc_tracing = FALSE;
@@ -798,7 +798,7 @@ MemoryCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Obj values of arguments. */
Tcl_Obj *const *objv) /* Obj values of arguments. */
{
const char *fileName;
FILE *fileP;
@@ -968,7 +968,7 @@ CheckmemCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Interpreter for evaluation. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Obj values of arguments. */
Tcl_Obj *const *objv) /* Obj values of arguments. */
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "fileName");
@@ -1232,15 +1232,15 @@ TclDumpMemoryInfo(
*
* TclAllocElemsEx --
*
* See TclAttemptAllocElemsEx. This function differs in that it panics
* on failure.
* See TclAttemptAllocElemsEx. This function differs in that it panics
* on failure.
*
* Results:
* Non-NULL pointer to allocated memory block.
* Non-NULL pointer to allocated memory block.
*
* Side effects:
* Panics if memory of at least the requested size could not be
* allocated.
* Panics if memory of at least the requested size could not be
* allocated.
*
*------------------------------------------------------------------------
*/
@@ -1267,14 +1267,13 @@ TclAllocElemsEx(
*
* TclAttemptReallocElemsEx --
*
* Attempts to allocate (oldPtr == NULL) or reallocate memory of the
* requested size plus some more for future growth. The amount of
* reallocation is adjusted depending on failure.
*
* Attempts to allocate (oldPtr == NULL) or reallocate memory of the
* requested size plus some more for future growth. The amount of
* reallocation is adjusted depending on failure.
*
* Results:
* Pointer to allocated memory block which is at least as large
* as the requested size or NULL if allocation failed.
* Pointer to allocated memory block which is at least as large
* as the requested size or NULL if allocation failed.
*
*------------------------------------------------------------------------
*/
@@ -1336,15 +1335,15 @@ TclAttemptReallocElemsEx(
*
* TclReallocElemsEx --
*
* See TclAttemptReallocElemsEx. This function differs in that it panics
* on failure.
* See TclAttemptReallocElemsEx. This function differs in that it panics
* on failure.
*
* Results:
* Non-NULL pointer to allocated memory block.
* Non-NULL pointer to allocated memory block.
*
* Side effects:
* Panics if memory of at least the requested size could not be
* allocated.
* Panics if memory of at least the requested size could not be
* allocated.
*
*------------------------------------------------------------------------
*/
+21 -23
View File
@@ -220,7 +220,7 @@ TclClockInit(
ClockClientData *data = (ClockClientData *)Tcl_Alloc(sizeof(ClockClientData));
data->refCount = 0;
data->literals = (Tcl_Obj **)Tcl_Alloc(LIT__END * sizeof(Tcl_Obj*));
data->literals = (Tcl_Obj **)Tcl_Alloc(LIT__END * sizeof(Tcl_Obj *));
int i;
for (i = 0; i < LIT__END; ++i) {
TclInitObjRef(data->literals[i], Tcl_NewStringObj(
@@ -714,7 +714,6 @@ TclClockMCDict(
/* if dict not yet retrieved */
if (opts->mcDictObj == NULL) {
/* if locale was not yet used */
if (!(opts->flags & CLF_LOCALE_USED)) {
opts->localeObj = NormLocaleObj(dataPtr, opts->interp,
@@ -734,7 +733,7 @@ TclClockMCDict(
int i;
dataPtr->mcLiterals = (Tcl_Obj **)
Tcl_Alloc(MCLIT__END * sizeof(Tcl_Obj*));
Tcl_Alloc(MCLIT__END * sizeof(Tcl_Obj *));
for (i = 0; i < MCLIT__END; ++i) {
TclInitObjRef(dataPtr->mcLiterals[i], Tcl_NewStringObj(
MsgCtLiterals[i], TCL_AUTO_LENGTH));
@@ -907,7 +906,7 @@ TclClockMCSetIdx(
if (dataPtr->mcLitIdxs == NULL) {
int i;
dataPtr->mcLitIdxs = (Tcl_Obj **)Tcl_Alloc(MCLIT__END * sizeof(Tcl_Obj*));
dataPtr->mcLitIdxs = (Tcl_Obj **)Tcl_Alloc(MCLIT__END * sizeof(Tcl_Obj *));
for (i = 0; i < MCLIT__END; ++i) {
TclInitObjRef(dataPtr->mcLitIdxs[i],
Tcl_NewStringObj(MsgCtLitIdxs[i], TCL_AUTO_LENGTH));
@@ -968,7 +967,7 @@ ClockConfigureObjCmd(
void *clientData, /* Client data containing literal pool */
Tcl_Interp *interp, /* Tcl interpreter */
Tcl_Size objc, /* Parameter count */
Tcl_Obj *const objv[]) /* Parameter vector */
Tcl_Obj *const *objv) /* Parameter vector */
{
ClockClientData *dataPtr = (ClockClientData *)clientData;
static const char *const options[] = {
@@ -3025,7 +3024,7 @@ ClockGetenvObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
#ifdef _WIN32
const WCHAR *varName;
@@ -3325,7 +3324,7 @@ ClockParseFmtScnArgs(
TclDateFields *date, /* Extracted date-time corresponding base
* (by scan or add) resp. clockval (by format) */
Tcl_Size objc, /* Parameter count */
Tcl_Obj *const objv[], /* Parameter vector */
Tcl_Obj *const *objv, /* Parameter vector */
ClockOperation operation, /* What operation are we doing: format, scan, add */
const char *syntax) /* Syntax of the current command */
{
@@ -3570,7 +3569,7 @@ ClockFormatObjCmd(
void *clientData, /* Client data containing literal pool */
Tcl_Interp *interp, /* Tcl interpreter */
Tcl_Size objc, /* Parameter count */
Tcl_Obj *const objv[]) /* Parameter values */
Tcl_Obj *const *objv) /* Parameter values */
{
ClockClientData *dataPtr = (ClockClientData *)clientData;
static const char *syntax = "clock format clockval|now "
@@ -3639,7 +3638,7 @@ ClockScanObjCmd(
void *clientData, /* Client data containing literal pool */
Tcl_Interp *interp, /* Tcl interpreter */
Tcl_Size objc, /* Parameter count */
Tcl_Obj *const objv[]) /* Parameter values */
Tcl_Obj *const *objv) /* Parameter values */
{
ClockClientData *dataPtr = (ClockClientData *)clientData;
static const char *syntax = "clock scan string "
@@ -4454,15 +4453,15 @@ ClockWeekdaysOffs(
* Refer to the user documentation to see what it exactly does.
*
* Syntax:
* clock add clockval ?count unit?... ?-option value?
* clock add clockval ?count unit?... ?-option value?
*
* Parameters:
* clockval -- Starting time value
* count -- Amount of a unit of time to add
* unit -- Unit of time to add, must be one of:
* years year months month weeks week
* days day hours hour minutes minute
* seconds second
* clockval -- Starting time value
* count -- Amount of a unit of time to add
* unit -- Unit of time to add, must be one of:
* years year months month weeks week
* days day hours hour minutes minute
* seconds second
*
* Options:
* -gmt BOOLEAN
@@ -4478,10 +4477,10 @@ ClockWeekdaysOffs(
* by the given offset(s) in order.
*
* Notes:
* It is possible that adding a number of months or years will adjust the
* day of the month as well. For instance, the time at one month after
* 31 January is either 28 or 29 February, because February has fewer
* than 31 days.
* It is possible that adding a number of months or years will adjust the
* day of the month as well. For instance, the time at one month after
* 31 January is either 28 or 29 February, because February has fewer
* than 31 days.
*
*----------------------------------------------------------------------
*/
@@ -4491,7 +4490,7 @@ ClockAddObjCmd(
void *clientData, /* Client data containing literal pool */
Tcl_Interp *interp, /* Tcl interpreter */
Tcl_Size objc, /* Parameter count */
Tcl_Obj *const objv[]) /* Parameter values */
Tcl_Obj *const *objv) /* Parameter values */
{
static const char *syntax = "clock add clockval|now ?number units?..."
"?-gmt boolean? "
@@ -4582,8 +4581,7 @@ ClockAddObjCmd(
* refresh it now (see test clock-30.34 "clock add jump over DST hole") */
if ((info->flags & CLF_RELCONV) ||
(yyRelSeconds && unitIndex < CLC_ADD_HOURS)
) {
(yyRelSeconds && unitIndex < CLC_ADD_HOURS)) {
if (ClockCalcRelTime(info, &opts) != TCL_OK) {
goto done;
}
+81 -44
View File
@@ -4,7 +4,7 @@
* Contains the date format (and scan) routines. This code is back-ported
* from the time and date facilities of tclSE engine, by Serg G. Brester.
*
* Copyright (c) 2015 by Sergey G. Brester aka sebres. All rights reserved.
* Copyright © 2015 by Sergey G. Brester aka sebres. All rights reserved.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -92,7 +92,7 @@ Clock_str2int(
* Overflow impossible for max 9 digits ("9..9"),
* or for 10 digits if it starts with 1 ("19..9").
*/
if (e - p <= 9 || *p <= '1' ) {
if (e - p <= 9 || *p <= '1') {
while (p < e) {
val = val * 10 + (*p++ - '0');
}
@@ -109,7 +109,7 @@ Clock_str2int(
if (sign >= 0) {
if ((val > INT_MAX / 10) ||
((val == INT_MAX / 10) && (last > INT_MAX % 10))) {
return TCL_ERROR; /* overflow*/
return TCL_ERROR; /* overflow */
}
val = val * 10 + last;
} else {
@@ -118,7 +118,7 @@ Clock_str2int(
((val == INT_MIN / 10) && ((INT_MIN % 10 < 0)
? (last > -(INT_MIN % 10))
: (last > 10-(INT_MIN % 10))))) {
return TCL_ERROR; /* overflow*/
return TCL_ERROR; /* overflow */
}
val = val * 10 - last;
}
@@ -145,7 +145,7 @@ Clock_str2wideInt(
* Overflow impossible for max 18 digits ("9..9"),
* or for 19 digits if it starts with 8 ("89..9").
*/
if (e - p <= 18 || *p <= '8' ) {
if (e - p <= 18 || *p <= '8') {
while (p < e) {
val = val * 10 + (*p++ - '0');
}
@@ -162,7 +162,7 @@ Clock_str2wideInt(
if (sign >= 0) {
if ((val > WIDE_MAX / 10) ||
((val == WIDE_MAX / 10) && (last > WIDE_MAX % 10))) {
return TCL_ERROR; /* overflow*/
return TCL_ERROR; /* overflow */
}
val = val * 10 + last;
} else {
@@ -171,7 +171,7 @@ Clock_str2wideInt(
((val == WIDE_MIN / 10) && ((WIDE_MIN % 10 < 0)
? (last > -(WIDE_MIN % 10))
: (last > 10-(WIDE_MIN % 10))))) {
return TCL_ERROR; /* overflow*/
return TCL_ERROR; /* overflow */
}
val = val * 10 - last;
}
@@ -286,6 +286,7 @@ Clock_itoaw(
return buf + width;
}
char *
TclItoAw(
char *buf,
@@ -496,20 +497,14 @@ static Tcl_HashTable FmtScnHashTable;
static int initialized = 0;
/*
* Wrappers between pointers to hash entry and format storage object
* Wrapper between pointers to hash entry and containing format storage object.
*/
static inline Tcl_HashEntry *
HashEntry4FmtScn(
ClockFmtScnStorage *fss)
{
return (Tcl_HashEntry*)(fss + 1);
}
static inline ClockFmtScnStorage *
FmtScn4HashEntry(
Tcl_HashEntry *hKeyPtr)
{
return (ClockFmtScnStorage*)(((char*)hKeyPtr) - sizeof(ClockFmtScnStorage));
return (ClockFmtScnStorage *)
(((char *)hKeyPtr) - offsetof(ClockFmtScnStorage, hashEntry));
}
/*
@@ -535,14 +530,13 @@ ClockFmtScnStorageAllocProc(
const char *string = (const char *) keyPtr;
Tcl_HashEntry *hPtr;
size_t size = strlen(string) + 1;
size_t allocsize = sizeof(ClockFmtScnStorage) + sizeof(Tcl_HashEntry);
size_t allocsize = sizeof(ClockFmtScnStorage) + size;
allocsize += size;
if (size > sizeof(hPtr->key)) {
allocsize -= sizeof(hPtr->key);
}
fss = (ClockFmtScnStorage *)Tcl_AttemptAlloc(allocsize);
fss = (ClockFmtScnStorage *) Tcl_AttemptAlloc(allocsize);
if (!fss) {
return NULL;
}
@@ -550,7 +544,7 @@ ClockFmtScnStorageAllocProc(
/* initialize */
memset(fss, 0, sizeof(*fss));
hPtr = HashEntry4FmtScn(fss);
hPtr = &fss->hashEntry;
memcpy(&hPtr->key.string, string, size);
hPtr->clientData = 0; /* currently unused */
@@ -607,12 +601,11 @@ static void
ClockFmtScnStorageDelete(
ClockFmtScnStorage *fss)
{
Tcl_HashEntry *hPtr = HashEntry4FmtScn(fss);
/*
* This will delete a hash entry and call "Tcl_Free" for storage self, if
* some additionally handling required, freeEntryProc can be used instead
*/
Tcl_DeleteHashEntry(hPtr);
Tcl_DeleteHashEntry(&fss->hashEntry);
}
/*
@@ -720,8 +713,7 @@ ClockFmtObj_UpdateString(
ClockFmtScnStorage *fss = ObjClockFmtScn(objPtr);
if (fss != NULL) {
Tcl_HashEntry *hPtr = HashEntry4FmtScn(fss);
name = hPtr->key.string;
name = fss->hashEntry.key.string;
}
len = strlen(name);
objPtr->length = len++,
@@ -752,7 +744,7 @@ ClockFmtObj_UpdateString(
*----------------------------------------------------------------------
*/
Tcl_Obj*
Tcl_Obj *
ClockFrmObjGetLocFmtKey(
Tcl_Interp *interp,
Tcl_Obj *objPtr)
@@ -770,7 +762,11 @@ ClockFrmObjGetLocFmtKey(
return keyObj;
}
keyObj = Tcl_ObjPrintf("FMT_%s", TclGetString(objPtr));
Tcl_DString ds;
Tcl_DStringInit(&ds);
TclDStringAppendLiteral(&ds, "FMT_");
TclDStringAppendObj(&ds, objPtr);
keyObj = Tcl_DStringToObj(&ds);
TclInitObjRef(ObjLocFmtKey(objPtr), keyObj);
return keyObj;
@@ -1140,7 +1136,6 @@ DetermineGreedySearchLen(
}
p += tok->lookAhMin;
if (laTok->map && p < end) {
/* try to find laTok between [lookAhMin, lookAhMax] */
while (minLen < maxLen) {
const char *f = FindTokenBegin(p, end, laTok,
@@ -1257,8 +1252,7 @@ LocaleListSearch(
}
/* search in list */
return ObjListSearch(info, val, lstv, lstc,
minLen, maxLen);
return ObjListSearch(info, val, lstv, lstc, minLen, maxLen);
}
#endif
@@ -1353,7 +1347,7 @@ ClockMCGetListIdxTree(
static TclStrIdxTree *
ClockMCGetMultiListIdxTree(
ClockFmtScnCmdArgs *opts,
int mcKey,
int mcKey,
const int *mcKeys)
{
TclStrIdxTree * idxTree;
@@ -2145,6 +2139,13 @@ EstimateTokenCount(
memset(tok, 0, sizeof(*(tok)));
/*
*----------------------------------------------------------------------
*
* ClockGetOrParseScanFormat --
*
* Parse a [clock scan] format, or look up the cache version of a
* previously processed format.
*
*----------------------------------------------------------------------
*/
static ClockFmtScnStorage *
@@ -2172,7 +2173,7 @@ ClockGetOrParseScanFormat(
unsigned tokCnt;
const char *p, *e, *cp;
e = p = HashEntry4FmtScn(fss)->key.string;
e = p = fss->hashEntry.key.string;
e += strlen(p);
/* estimate token count by % char and format length */
@@ -2208,7 +2209,7 @@ ClockGetOrParseScanFormat(
continue;
case 'E':
scnMap = ScnETokenMap,
mapIndex = ScnETokenMapIndex,
mapIndex = ScnETokenMapIndex,
aliasIndex = ScnETokenMapAliasIndex;
p++;
break;
@@ -2453,7 +2454,7 @@ TclClockScan(
if (size < map->minSize) {
/* missing input -> error */
if ((map->flags & CLF_OPTIONAL)) {
if (map->flags & CLF_OPTIONAL) {
continue;
}
goto not_match;
@@ -2484,7 +2485,7 @@ TclClockScan(
case TCL_OK:
break;
case TCL_RETURN:
if ((map->flags & CLF_OPTIONAL)) {
if (map->flags & CLF_OPTIONAL) {
yyInput = p;
continue;
}
@@ -2576,7 +2577,6 @@ TclClockScan(
/* seconds token (%s) take precedence over all other tokens */
if ((opts->flags & CLF_EXTENDED) || !(flags & CLF_POSIXSEC)) {
if (flags & CLF_DATE) {
if (!(flags & CLF_JULIANDAY)) {
info->flags |= CLF_ASSEMBLE_SECONDS|CLF_ASSEMBLE_JULIANDAY;
@@ -2699,7 +2699,7 @@ TclClockScan(
Tcl_SetObjResult(opts->interp, Tcl_ObjPrintf(
"input string \"%s\" does not match supplied format \"%s\","
" locale \"%s\" - token \"%s\"",
info->dateStart, HashEntry4FmtScn(fss)->key.string,
info->dateStart, fss->hashEntry.key.string,
TclGetString(opts->localeObj),
tok && tok->tokWord.start ? tok->tokWord.start : "NULL"));
#endif
@@ -2820,6 +2820,7 @@ ClockFmtToken_StarDate_Proc(
dateFmt->output = Clock_itoaw(dateFmt->output, v, '0', 1);
return TCL_OK;
}
static int
ClockFmtToken_WeekOfYear_Proc(
TCL_UNUSED(ClockFmtScnCmdArgs *),
@@ -2838,6 +2839,7 @@ ClockFmtToken_WeekOfYear_Proc(
*val = (dateFmt->date.dayOfYear - dow + 7) / 7;
return TCL_OK;
}
static int
ClockFmtToken_JDN_Proc(
TCL_UNUSED(ClockFmtScnCmdArgs *),
@@ -2910,6 +2912,7 @@ ClockFmtToken_JDN_Proc(
}
return TCL_OK;
}
static int
ClockFmtToken_TimeZone_Proc(
ClockFmtScnCmdArgs *opts,
@@ -3010,12 +3013,12 @@ ClockFmtToken_LocaleERAYear_Proc(
dateFmt->date.localSeconds, rowc, rowv, NULL);
}
if (dateFmt->localeEra == NULL) {
dateFmt->localeEra = (Tcl_Obj*)1;
dateFmt->localeEra = (Tcl_Obj *) 1;
}
}
/* if no LOCALE_ERAS in catalog or era not found */
if (dateFmt->localeEra == (Tcl_Obj*)1) {
if (dateFmt->localeEra == (Tcl_Obj *) 1) {
if (FrmResultAllocate(dateFmt, 11) != TCL_OK) {
return TCL_ERROR;
}
@@ -3221,6 +3224,13 @@ static const ClockFormatTokenMap FmtWordTokenMap = {
};
/*
*----------------------------------------------------------------------
*
* ClockGetOrParseFmtFormat --
*
* Parse a [clock format] format, or look up the cache version of a
* previously processed format.
*
*----------------------------------------------------------------------
*/
static ClockFmtScnStorage *
@@ -3248,7 +3258,7 @@ ClockGetOrParseFmtFormat(
unsigned tokCnt;
const char *p, *e, *cp;
e = p = HashEntry4FmtScn(fss)->key.string;
e = p = fss->hashEntry.key.string;
e += strlen(p);
/* estimate token count by % char and format length */
@@ -3261,7 +3271,7 @@ ClockGetOrParseFmtFormat(
switch (*p) {
case '%': {
const ClockFormatTokenMap *fmtMap = FmtSTokenMap;
const char *mapIndex = FmtSTokenMapIndex;
const char *mapIndex = FmtSTokenMapIndex;
const char **aliasIndex = FmtSTokenMapAliasIndex;
if (p + 1 >= e) {
@@ -3282,7 +3292,7 @@ ClockGetOrParseFmtFormat(
continue;
case 'E':
fmtMap = FmtETokenMap,
mapIndex = FmtETokenMapIndex,
mapIndex = FmtETokenMapIndex,
aliasIndex = FmtETokenMapAliasIndex;
p++;
break;
@@ -3369,6 +3379,13 @@ ClockGetOrParseFmtFormat(
}
/*
*----------------------------------------------------------------------
*
* TclClockFormat --
*
* Core of implementation of [clock format]. Arguments are parsed, but
* the actual format may need parsing and compilation.
*
*----------------------------------------------------------------------
*/
int
@@ -3470,7 +3487,8 @@ TclClockFormat(
goto error;
}
if (map->width) {
dateFmt->output = Clock_witoaw(dateFmt->output, val, *map->tostr, map->width);
dateFmt->output = Clock_witoaw(dateFmt->output, val, *map->tostr,
map->width);
} else {
dateFmt->output += sprintf(dateFmt->output, map->tostr, val);
}
@@ -3546,7 +3564,16 @@ TclClockFormat(
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
* TclClockFrmScnClearCaches --
*
* Invalidate any caches held at global level for [clock].
* (TODO: finish this)
*
*----------------------------------------------------------------------
*/
void
TclClockFrmScnClearCaches(void)
{
@@ -3554,7 +3581,16 @@ TclClockFrmScnClearCaches(void)
/* clear caches ... */
Tcl_MutexUnlock(&ClockFmtMutex);
}
/*
*----------------------------------------------------------------------
*
* TclClockFrmScnFinalize --
*
* Delete all global storage held by the [clock] implementation.
*
*----------------------------------------------------------------------
*/
void
TclClockFrmScnFinalize(void)
{
@@ -3575,6 +3611,7 @@ TclClockFrmScnFinalize(void)
Tcl_MutexUnlock(&ClockFmtMutex);
Tcl_MutexFinalize(&ClockFmtMutex);
}
/*
* Local Variables:
* mode: c
+183 -108
View File
@@ -24,7 +24,7 @@
* freed in a single step.
*/
struct ForeachState {
typedef struct ForeachState {
Tcl_Obj *bodyPtr; /* The script body of the command. */
Tcl_Size bodyIdx; /* The argument index of the body. */
Tcl_Size j, maxj; /* Number of loop iterations. */
@@ -38,8 +38,12 @@ struct ForeachState {
Tcl_Obj **aCopyList; /* Copies of value list arguments. */
Tcl_Obj *resultList; /* List of result values from the loop body,
* or NULL if we're not collecting them
* ([lmap] vs [foreach]). */
};
* ([lmap]/[lfilter] vs [foreach]). */
Tcl_Obj *primeValueObj; /* If not NULL, the value to be appended to
* the resultList if the expression of
* [lfilter] is true. */
int mode; /* Which mode the machinery is operating in. */
} ForeachState;
/*
* Prototypes for local procedures defined in this file:
@@ -55,16 +59,16 @@ static Tcl_ObjCmdProc2 EncodingProfilesObjCmd;
static Tcl_ObjCmdProc2 EncodingSystemObjCmd;
static Tcl_ObjCmdProc2 EncodingUserObjCmd;
static inline int ForeachAssignments(Tcl_Interp *interp,
struct ForeachState *statePtr);
ForeachState *statePtr);
static inline void ForeachCleanup(Tcl_Interp *interp,
struct ForeachState *statePtr);
ForeachState *statePtr);
static int GetStatBuf(Tcl_Interp *interp, Tcl_Obj *pathPtr,
Tcl_FSStatProc *statProc, Tcl_StatBuf *statPtr);
static const char * GetTypeFromMode(int mode);
static int StoreStatData(Tcl_Interp *interp, Tcl_Obj *varName,
Tcl_StatBuf *statPtr);
static int EachloopCmd(Tcl_Interp *interp, int collect,
Tcl_Size objc, Tcl_Obj *const objv[]);
static int EachloopCmd(Tcl_Interp *interp, int mode,
Tcl_Size objc, Tcl_Obj *const *objv);
static Tcl_NRPostProc CatchObjCmdCallback;
static Tcl_NRPostProc ExprCallback;
static Tcl_NRPostProc ForSetupCallback;
@@ -178,7 +182,7 @@ Tcl_BreakObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -209,7 +213,7 @@ Tcl_CatchObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNRCatchObjCmd, clientData, objc, objv);
}
@@ -219,7 +223,7 @@ TclNRCatchObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *varNamePtr = NULL;
Tcl_Obj *optionVarNamePtr = NULL;
@@ -314,7 +318,7 @@ Tcl_CdObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *dir;
int result;
@@ -377,7 +381,7 @@ Tcl_ConcatObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
if (objc >= 2) {
Tcl_SetObjResult(interp, Tcl_ConcatObj(objc-1, objv+1));
@@ -411,7 +415,7 @@ Tcl_ContinueObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -425,21 +429,21 @@ Tcl_ContinueObjCmd(
*
* EncodingConvertParseOptions --
*
* Common routine for parsing arguments passed to encoding convertfrom
* and encoding convertto.
* Common routine for parsing arguments passed to encoding convertfrom
* and encoding convertto.
*
* Results:
* TCL_OK or TCL_ERROR.
* TCL_OK or TCL_ERROR.
*
* Side effects:
* On success,
* - *encPtr is set to the encoding. Must be freed with Tcl_FreeEncoding
* if non-NULL
* - *dataObjPtr is set to the Tcl_Obj containing the data to encode or
* decode
* - *profilePtr is set to encoding error handling profile
* - *failVarPtr is set to -failindex option value or NULL
* On error, all of the above are uninitialized.
* On success,
* - *encPtr is set to the encoding. Must be freed with Tcl_FreeEncoding
* if non-NULL
* - *dataObjPtr is set to the Tcl_Obj containing the data to encode or
* decode
* - *profilePtr is set to encoding error handling profile
* - *failVarPtr is set to -failindex option value or NULL
* On error, all of the above are uninitialized.
*
*------------------------------------------------------------------------
*/
@@ -447,7 +451,7 @@ static int
EncodingConvertParseOptions(
Tcl_Interp *interp, /* For error messages. May be NULL */
Tcl_Size objc, /* Number of arguments */
Tcl_Obj *const objv[], /* Argument objects as passed to command. */
Tcl_Obj *const *objv, /* Argument objects as passed to command. */
Tcl_Encoding *encPtr, /* Where to store the encoding */
Tcl_Obj **dataObjPtr, /* Where to store ptr to Tcl_Obj containing data */
int *profilePtr, /* Bit mask of encoding option profile */
@@ -541,7 +545,7 @@ EncodingConvertfromObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *data; /* Byte array to convert */
Tcl_DString ds; /* Buffer to hold the string */
@@ -639,7 +643,7 @@ EncodingConverttoObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *data; /* String to convert */
Tcl_DString ds; /* Buffer to hold the byte array */
@@ -735,7 +739,7 @@ EncodingDirsObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *dirListObj;
@@ -777,9 +781,9 @@ EncodingDirsObjCmd(
int
EncodingNamesObjCmd(
TCL_UNUSED(void *),
Tcl_Interp* interp, /* Tcl interpreter */
Tcl_Interp *interp, /* Tcl interpreter */
Tcl_Size objc, /* Number of command line args */
Tcl_Obj *const objv[]) /* Vector of command line args */
Tcl_Obj *const *objv) /* Vector of command line args */
{
if (objc > 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -805,9 +809,9 @@ EncodingNamesObjCmd(
int
EncodingProfilesObjCmd(
TCL_UNUSED(void *),
Tcl_Interp* interp, /* Tcl interpreter */
Tcl_Interp *interp, /* Tcl interpreter */
Tcl_Size objc, /* Number of command line args */
Tcl_Obj *const objv[]) /* Vector of command line args */
Tcl_Obj *const *objv) /* Vector of command line args */
{
if (objc > 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -836,9 +840,9 @@ EncodingProfilesObjCmd(
int
EncodingSystemObjCmd(
TCL_UNUSED(void *),
Tcl_Interp* interp, /* Tcl interpreter */
Tcl_Interp *interp, /* Tcl interpreter */
Tcl_Size objc, /* Number of command line args */
Tcl_Obj *const objv[]) /* Vector of command line args */
Tcl_Obj *const *objv) /* Vector of command line args */
{
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?encoding?");
@@ -869,9 +873,9 @@ EncodingSystemObjCmd(
int
EncodingUserObjCmd(
TCL_UNUSED(void *),
Tcl_Interp* interp, /* Tcl interpreter */
Tcl_Interp *interp, /* Tcl interpreter */
Tcl_Size objc, /* Number of command line args */
Tcl_Obj *const objv[]) /* Vector of command line args */
Tcl_Obj *const *objv) /* Vector of command line args */
{
if (objc > 1) {
Tcl_WrongNumArgs(interp, 1, objv, "");
@@ -905,7 +909,7 @@ Tcl_ErrorObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *options, *optName;
@@ -967,7 +971,7 @@ Tcl_EvalObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNREvalObjCmd, clientData, objc, objv);
}
@@ -977,7 +981,7 @@ TclNREvalObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *objPtr;
Interp *iPtr = (Interp *) interp;
@@ -1036,7 +1040,7 @@ Tcl_ExitObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_WideInt value;
@@ -1083,7 +1087,7 @@ Tcl_ExprObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNRExprObjCmd, clientData, objc, objv);
}
@@ -1093,7 +1097,7 @@ TclNRExprObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *resultPtr, *objPtr;
@@ -1157,7 +1161,7 @@ FileAttrAccessTimeCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_StatBuf buf;
struct utimbuf tval;
@@ -1239,7 +1243,7 @@ FileAttrModifyTimeCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_StatBuf buf;
struct utimbuf tval;
@@ -1318,7 +1322,7 @@ FileAttrLinkStatCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_StatBuf buf;
@@ -1358,7 +1362,7 @@ FileAttrStatCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_StatBuf buf;
@@ -1398,7 +1402,7 @@ FileAttrTypeCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_StatBuf buf;
@@ -1436,7 +1440,7 @@ FileAttrSizeCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_StatBuf buf;
@@ -1473,7 +1477,7 @@ FileAttrIsDirectoryCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_StatBuf buf;
int value = 0;
@@ -1511,7 +1515,7 @@ FileAttrIsExecutableCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1542,7 +1546,7 @@ FileAttrIsExistingCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1573,7 +1577,7 @@ FileAttrIsFileCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_StatBuf buf;
int value = 0;
@@ -1611,7 +1615,7 @@ FileAttrIsOwnedCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
#ifdef __CYGWIN__
#define geteuid() (short)(geteuid)()
@@ -1673,7 +1677,7 @@ FileAttrIsReadableCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1704,7 +1708,7 @@ FileAttrIsWritableCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name");
@@ -1735,7 +1739,7 @@ PathDirNameCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *dirPtr;
@@ -1774,7 +1778,7 @@ PathExtensionCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *dirPtr;
@@ -1813,7 +1817,7 @@ PathRootNameCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *dirPtr;
@@ -1852,7 +1856,7 @@ PathTailCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *dirPtr;
@@ -1891,7 +1895,7 @@ PathFilesystemCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *fsInfo;
@@ -1932,7 +1936,7 @@ PathJoinCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "name ?name ...?");
@@ -1964,7 +1968,7 @@ PathNativeNameCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_DString ds;
@@ -2001,7 +2005,7 @@ PathNormalizeCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *fileName;
@@ -2039,7 +2043,7 @@ PathSplitCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *res;
@@ -2082,7 +2086,7 @@ PathTypeCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
Tcl_Obj *typeName;
@@ -2129,7 +2133,7 @@ FilesystemSeparatorCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
if (objc < 1 || objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "?name?");
@@ -2184,7 +2188,7 @@ FilesystemVolumesCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -2489,7 +2493,7 @@ Tcl_ForObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNRForObjCmd, clientData, objc, objv);
}
@@ -2499,7 +2503,7 @@ TclNRForObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
ForIterData *iterPtr;
@@ -2683,7 +2687,7 @@ Tcl_ForeachObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNRForeachCmd, clientData, objc, objv);
}
@@ -2693,7 +2697,7 @@ TclNRForeachCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
return EachloopCmd(interp, TCL_EACH_KEEP_NONE, objc, objv);
}
@@ -2703,7 +2707,7 @@ Tcl_LmapObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNRLmapCmd, clientData, objc, objv);
}
@@ -2713,22 +2717,53 @@ TclNRLmapCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
return EachloopCmd(interp, TCL_EACH_COLLECT, objc, objv);
}
int
Tcl_LfilterObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNRLfilterCmd, clientData, objc, objv);
}
int
TclNRLfilterCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
Tcl_Size objc,
Tcl_Obj *const *objv)
{
return EachloopCmd(interp, TCL_EACH_FILTER, objc, objv);
}
static const char *const collectModeNames[] = {
"foreach",
"lmap",
"lfilter"
};
static int
EachloopCmd(
Tcl_Interp *interp, /* Our context for variables and script
* evaluation. */
int collect, /* Select collecting or accumulating mode
* (TCL_EACH_*) */
int mode, /* Select simple iterating, collecting or
* filtering mode (TCL_EACH_*) */
Tcl_Size objc, /* The arguments being passed in... */
Tcl_Obj *const objv[])
Tcl_Obj *const *objv)
{
static const char *const capitalCollectModeNames[] = {
"FOREACH",
"LMAP",
"LFILTER"
};
Tcl_Size i, numLists = (objc-2) / 2;
struct ForeachState *statePtr;
ForeachState *statePtr;
int result;
Tcl_Size j;
@@ -2753,11 +2788,11 @@ EachloopCmd(
* allocation for better performance.
*/
statePtr = (struct ForeachState *)TclStackAlloc(interp,
sizeof(struct ForeachState) + 3 * numLists * sizeof(Tcl_Size)
statePtr = (ForeachState *)TclStackAlloc(interp,
sizeof(ForeachState) + 3 * numLists * sizeof(Tcl_Size)
+ 2 * numLists * (sizeof(Tcl_Obj **) + sizeof(Tcl_Obj *)));
memset(statePtr, 0,
sizeof(struct ForeachState) + 3 * numLists * sizeof(Tcl_Size)
sizeof(ForeachState) + 3 * numLists * sizeof(Tcl_Size)
+ 2 * numLists * (sizeof(Tcl_Obj **) + sizeof(Tcl_Obj *)));
statePtr->varvList = (Tcl_Obj ***) (statePtr + 1);
statePtr->argvList = statePtr->varvList + numLists;
@@ -2766,12 +2801,14 @@ EachloopCmd(
statePtr->index = (Tcl_Size *) (statePtr->aCopyList + numLists);
statePtr->varcList = statePtr->index + numLists;
statePtr->argcList = statePtr->varcList + numLists;
statePtr->primeValueObj = NULL;
statePtr->mode = mode;
statePtr->numLists = numLists;
statePtr->bodyPtr = objv[objc - 1];
statePtr->bodyIdx = objc - 1;
if (collect == TCL_EACH_COLLECT) {
if (mode != TCL_EACH_KEEP_NONE) {
statePtr->resultList = Tcl_NewListObj(0, NULL);
} else {
statePtr->resultList = NULL;
@@ -2797,11 +2834,10 @@ EachloopCmd(
}
if (statePtr->varcList[i] < 1) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"%s varlist is empty",
(statePtr->resultList != NULL ? "lmap" : "foreach")));
"%s varlist is empty", collectModeNames[statePtr->mode]));
Tcl_SetErrorCode(interp, "TCL", "OPERATION",
(statePtr->resultList != NULL ? "LMAP" : "FOREACH"),
"NEEDVARS", (char *)NULL);
capitalCollectModeNames[statePtr->mode], "NEEDVARS",
(char *)NULL);
result = TCL_ERROR;
goto done;
}
@@ -2826,7 +2862,7 @@ EachloopCmd(
goto done;
}
result = TclListObjGetElements(interp, statePtr->aCopyList[i],
&statePtr->argcList[i], &statePtr->argvList[i]);
&statePtr->argcList[i], &statePtr->argvList[i]);
if (result != TCL_OK) {
goto done;
}
@@ -2869,7 +2905,13 @@ EachloopCmd(
}
/*
* Post-body processing handler.
*----------------------------------------------------------------------
*
* ForeachLoopStep --
*
* Post-body processing handler.
*
*----------------------------------------------------------------------
*/
static int
@@ -2878,7 +2920,8 @@ ForeachLoopStep(
Tcl_Interp *interp,
int result)
{
struct ForeachState *statePtr = (struct ForeachState *)data[0];
ForeachState *statePtr = (ForeachState *)data[0];
int filterAccepts;
/*
* Process the result code from this run of the [foreach] body. Note that
@@ -2890,13 +2933,23 @@ ForeachLoopStep(
result = TCL_OK;
break;
case TCL_OK:
if (statePtr->resultList != NULL) {
result = Tcl_ListObjAppendElement(
interp, statePtr->resultList, Tcl_GetObjResult(interp));
if (result != TCL_OK) {
/* e.g. memory alloc failure on big data tests */
goto done;
switch (statePtr->mode) {
case TCL_EACH_FILTER:
result = Tcl_GetBooleanFromObj(interp, Tcl_GetObjResult(interp),
&filterAccepts);
if (result == TCL_OK && filterAccepts) {
result = Tcl_ListObjAppendElement(interp,
statePtr->resultList, statePtr->primeValueObj);
}
break;
case TCL_EACH_COLLECT:
result = Tcl_ListObjAppendElement(interp,
statePtr->resultList, Tcl_GetObjResult(interp));
break;
}
if (result != TCL_OK) {
/* e.g. memory alloc failure on big data tests */
goto done;
}
break;
case TCL_BREAK:
@@ -2905,8 +2958,7 @@ ForeachLoopStep(
case TCL_ERROR:
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (\"%s\" body line %d)",
(statePtr->resultList != NULL ? "lmap" : "foreach"),
Tcl_GetErrorLine(interp)));
collectModeNames[statePtr->mode], Tcl_GetErrorLine(interp)));
TCL_FALLTHROUGH();
default:
goto done;
@@ -2933,7 +2985,7 @@ ForeachLoopStep(
*/
finish:
if (statePtr->resultList == NULL) {
if (statePtr->mode == TCL_EACH_KEEP_NONE) {
Tcl_ResetResult(interp);
} else {
Tcl_SetObjResult(interp, statePtr->resultList);
@@ -2946,13 +2998,18 @@ ForeachLoopStep(
}
/*
* Factored out code to do the assignments in [foreach].
*----------------------------------------------------------------------
*
* ForeachAssignments --
*
* Factored out code to do the assignments in [foreach].
*
*----------------------------------------------------------------------
*/
static inline int
ForeachAssignments(
Tcl_Interp *interp,
struct ForeachState *statePtr)
ForeachState *statePtr)
{
int i;
Tcl_Size v, k;
@@ -2966,10 +3023,11 @@ ForeachAssignments(
k = statePtr->index[i]++;
if (k < statePtr->argcList[i]) {
if (isAbstractList) {
if (TclObjTypeIndex(interp, statePtr->aCopyList[i], k, &valuePtr) != TCL_OK) {
if (TclObjTypeIndex(interp, statePtr->aCopyList[i], k,
&valuePtr) != TCL_OK) {
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (setting %s loop variable \"%s\")",
(statePtr->resultList != NULL ? "lmap" : "foreach"),
collectModeNames[statePtr->mode],
TclGetString(statePtr->varvList[i][v])));
return TCL_ERROR;
}
@@ -2980,13 +3038,22 @@ ForeachAssignments(
TclNewObj(valuePtr); /* Empty string */
}
if (statePtr->mode == TCL_EACH_FILTER && i==0 && v==0) {
if (statePtr->primeValueObj) {
Tcl_DecrRefCount(statePtr->primeValueObj);
}
statePtr->primeValueObj = valuePtr;
if (valuePtr) {
Tcl_IncrRefCount(valuePtr);
}
}
varValuePtr = Tcl_ObjSetVar2(interp, statePtr->varvList[i][v],
NULL, valuePtr, TCL_LEAVE_ERR_MSG);
if (varValuePtr == NULL) {
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (setting %s loop variable \"%s\")",
(statePtr->resultList != NULL ? "lmap" : "foreach"),
collectModeNames[statePtr->mode],
TclGetString(statePtr->varvList[i][v])));
return TCL_ERROR;
}
@@ -2997,13 +3064,18 @@ ForeachAssignments(
}
/*
* Factored out code for cleaning up the state of the foreach.
*----------------------------------------------------------------------
*
* ForeachCleanup --
*
* Factored out code for cleaning up the state of the foreach.
*
*----------------------------------------------------------------------
*/
static inline void
ForeachCleanup(
Tcl_Interp *interp,
struct ForeachState *statePtr)
ForeachState *statePtr)
{
int i;
@@ -3015,7 +3087,10 @@ ForeachCleanup(
TclDecrRefCount(statePtr->aCopyList[i]);
}
}
if (statePtr->resultList != NULL) {
if (statePtr->primeValueObj) {
TclDecrRefCount(statePtr->primeValueObj);
}
if (statePtr->resultList) {
TclDecrRefCount(statePtr->resultList);
}
TclStackFree(interp, statePtr);
@@ -3043,7 +3118,7 @@ Tcl_FormatObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *resultPtr; /* Where result is stored finally. */
+71 -63
View File
@@ -206,7 +206,7 @@ Tcl_IfObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNRIfObjCmd, clientData, objc, objv);
}
@@ -216,7 +216,7 @@ TclNRIfObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *boolObj;
@@ -390,7 +390,7 @@ Tcl_IncrObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *newValuePtr, *incrPtr;
@@ -447,7 +447,7 @@ InfoArgsCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
const char *name;
@@ -510,7 +510,7 @@ InfoBodyCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
const char *name, *bytes;
@@ -571,7 +571,7 @@ InfoCmdCountCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
@@ -613,7 +613,7 @@ InfoCommandsCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *cmdName, *pattern;
const char *simplePattern;
@@ -890,7 +890,7 @@ InfoCompleteCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "command");
@@ -927,7 +927,7 @@ InfoDefaultCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
const char *procName, *argName;
@@ -1010,7 +1010,7 @@ InfoErrorStackCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Interp *target;
Interp *iPtr;
@@ -1059,7 +1059,7 @@ TclInfoExistsCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *varName;
Var *varPtr;
@@ -1081,6 +1081,7 @@ TclInfoExistsCmd(
*----------------------------------------------------------------------
*
* InfoFrameCmd --
*
* TIP #280
*
* Called to implement the "info frame" command that returns the location
@@ -1104,7 +1105,7 @@ InfoFrameCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
int level, code = TCL_OK;
@@ -1360,8 +1361,9 @@ TclInfoFrame(
* Procedure CallFrame.
*/
if (procPtr != NULL) {
Tcl_HashEntry *namePtr = procPtr->cmdPtr->hPtr;
if (procPtr != NULL && procPtr->cmdPtr) {
Command *cmdPtr = procPtr->cmdPtr;
Tcl_HashEntry *namePtr = cmdPtr->hPtr;
if (namePtr) {
Tcl_Obj *procNameObj;
@@ -1371,11 +1373,15 @@ TclInfoFrame(
*/
TclNewObj(procNameObj);
Tcl_GetCommandFullName(interp, (Tcl_Command) procPtr->cmdPtr,
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr,
procNameObj);
ADD_PAIR("proc", procNameObj);
} else if (procPtr->cmdPtr->clientData) {
ExtraFrameInfo *efiPtr = (ExtraFrameInfo *)procPtr->cmdPtr->clientData;
} else if ((procPtr->flags && PROC_CMD_OWNED) && !cmdPtr->objProc2 &&
cmdPtr->objClientData2
) {
ADD_PAIR("lambda", (Tcl_Obj *)cmdPtr->objClientData2);
} else if (cmdPtr->clientData) {
ExtraFrameInfo *efiPtr = (ExtraFrameInfo *)cmdPtr->clientData;
Tcl_Size i;
/*
@@ -1449,7 +1455,7 @@ InfoFunctionsCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *script;
int code;
@@ -1514,7 +1520,7 @@ InfoHostnameCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *name;
@@ -1560,7 +1566,7 @@ InfoLevelCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
@@ -1634,7 +1640,7 @@ InfoLibraryCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *libDirName;
@@ -1681,7 +1687,7 @@ InfoLoadedCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *interpName, *prefix;
@@ -1729,7 +1735,7 @@ InfoNameOfExecutableCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -1765,7 +1771,7 @@ InfoPatchLevelCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *patchlevel;
@@ -1812,7 +1818,7 @@ InfoProcsCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *cmdName, *pattern;
const char *simplePattern;
@@ -1953,7 +1959,7 @@ InfoScriptCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
@@ -2001,7 +2007,7 @@ InfoSharedlibCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
@@ -2039,7 +2045,7 @@ InfoTclVersionCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *version;
@@ -2082,7 +2088,7 @@ InfoCmdTypeCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Command command;
@@ -2133,7 +2139,7 @@ Tcl_JoinObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
Tcl_Obj *const *objv) /* The argument objects. */
{
Tcl_Size length, listLen;
Tcl_Obj *resObjPtr = NULL;
@@ -2257,7 +2263,7 @@ Tcl_LassignObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *listPtr;
Tcl_Size listObjc; /* The length of the list. */
@@ -2361,7 +2367,7 @@ Tcl_LindexObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *elemPtr; /* Pointer to the element being extracted. */
@@ -2419,7 +2425,7 @@ Tcl_LinsertObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *listPtr;
Tcl_Size len, index;
@@ -2512,7 +2518,7 @@ Tcl_ListObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
Tcl_Obj *const *objv) /* The argument objects. */
{
/*
* If there are no list elements, the result is an empty object.
@@ -2547,7 +2553,7 @@ Tcl_LlengthObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size listLen;
int result;
@@ -2595,7 +2601,7 @@ Tcl_LpopObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size listLen;
int copied = 0, result;
@@ -2626,12 +2632,12 @@ Tcl_LpopObjCmd(
if (!listLen) {
/* empty list, throw the same error as with index "end" */
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"index \"end\" out of range", -1));
"index \"end\" out of range", -1));
Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX", "OUTOFRANGE", (char *)NULL);
return TCL_ERROR;
}
result = Tcl_ListObjIndex(interp, listPtr, (listLen-1), &elemPtr);
result = Tcl_ListObjIndex(interp, listPtr, listLen-1, &elemPtr);
if (result != TCL_OK) {
return result;
}
@@ -2713,7 +2719,7 @@ Tcl_LrangeObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
int result;
Tcl_Size listLen, first, last;
@@ -2784,7 +2790,7 @@ Tcl_LremoveObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size i, idxc, prevIdx, first, num;
Tcl_Size *idxv, listLen;
@@ -2915,7 +2921,7 @@ Tcl_LrepeatObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
Tcl_Obj *const *objv) /* The argument objects. */
{
Tcl_Size repeatCount;
Tcl_Obj *resultPtr;
@@ -2929,8 +2935,8 @@ Tcl_LrepeatObjCmd(
return TCL_ERROR;
}
if (Tcl_ListObjRepeat(
interp, repeatCount, objc - 2, objv + 2, &resultPtr) != TCL_OK) {
if (Tcl_ListObjRepeat(interp,
repeatCount, objc - 2, objv + 2, &resultPtr) != TCL_OK) {
return TCL_ERROR;
}
@@ -2961,7 +2967,7 @@ Tcl_LreplaceObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *listPtr;
Tcl_Size numToDelete, listLen, first, last;
@@ -3063,7 +3069,7 @@ Tcl_LreverseObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
Tcl_Obj *const *objv) /* Argument values. */
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "list");
@@ -3100,7 +3106,7 @@ Tcl_LsearchObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
Tcl_Obj *const *objv) /* Argument values. */
{
const char *bytes, *patternBytes;
int match, result=TCL_OK, bisect;
@@ -3865,20 +3871,22 @@ Tcl_LsearchObjCmd(
*----------------------------------------------------------------------
*
* SequenceIdentifyArgument --
* (for [lseq] command)
*
* Given a Tcl_Obj, identify if it is a keyword or a number
* (for [lseq] command)
*
* Return Value
* 0 - failure, unexpected value
* 1 - value is a number
* 2 - value is an operand keyword
* 3 - value is a by keyword
* Given a Tcl_Obj, identify if it is a keyword or a number
*
* The decoded value will be assigned to the appropriate
* pointer, numValuePtr reference count is incremented.
* Return Value
* 0 - failure, unexpected value
* 1 - value is a number
* 2 - value is an operand keyword
* 3 - value is a by keyword
*
* The decoded value will be assigned to the appropriate
* pointer, numValuePtr reference count is incremented.
*
*----------------------------------------------------------------------
*/
static SequenceDecoded
SequenceIdentifyArgument(
Tcl_Interp *interp, /* for error reporting */
@@ -3967,7 +3975,7 @@ Tcl_LseqObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
Tcl_Obj *const *objv) /* The argument objects. */
{
Tcl_Obj *elementCount = NULL;
Tcl_Obj *start = NULL, *end = NULL, *step = NULL;
@@ -4249,7 +4257,7 @@ Tcl_LsetObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
Tcl_Obj *const *objv) /* Argument values. */
{
Tcl_Obj *listPtr; /* Pointer to the list being altered. */
Tcl_Obj *finalValuePtr; /* Value finally assigned to the variable. */
@@ -4342,7 +4350,7 @@ Tcl_LsortObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
Tcl_Obj *const *objv) /* Argument values. */
{
int indices, nocase = 0;
int sortMode = SORTMODE_ASCII;
@@ -4591,8 +4599,8 @@ Tcl_LsortObjCmd(
}
if (TclObjTypeHasProc(objv[1], getElementsProc)) {
sortInfo.resultCode =
TclObjTypeGetElements(interp, listObj, &length, &listObjPtrs);
sortInfo.resultCode = TclObjTypeGetElements(interp, listObj,
&length, &listObjPtrs);
} else {
sortInfo.resultCode = TclListObjGetElements(interp, listObj,
&length, &listObjPtrs);
@@ -4861,7 +4869,7 @@ Tcl_LeditObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
Tcl_Obj *const *objv) /* Argument values. */
{
Tcl_Obj *listPtr; /* Pointer to the list being altered. */
Tcl_Obj *finalValuePtr; /* Value finally assigned to the variable. */
@@ -5299,7 +5307,7 @@ DictionaryCompare(
*
* Results:
* Returns NULL if a failure occurs, and sets the result in the infoPtr.
* Otherwise returns the Tcl_Obj* to the item.
* Otherwise returns the Tcl_Obj * to the item.
*
* Side effects:
* None.
+56 -52
View File
@@ -31,7 +31,7 @@ static Tcl_NRPostProc TryPostHandler;
static int UniCharIsAscii(int character);
static int UniCharIsHexDigit(int character);
static int StringCmpOpts(Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[], int *nocase,
Tcl_Obj *const *objv, int *nocase,
Tcl_Size *reqlength);
static Tcl_ObjCmdProc2 StringCatCmd;
static Tcl_ObjCmdProc2 StringCmpCmd;
@@ -154,7 +154,7 @@ Tcl_PwdObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *retVal;
@@ -194,7 +194,7 @@ Tcl_RegexpObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size i, about, all, offset, stringLength, matchLength, numMatchesSaved;
int indices, match, doinline, cflags, eflags;
@@ -555,7 +555,7 @@ Tcl_RegsubObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
int result, cflags, all, match, command;
Tcl_Size idx, wlen, wsublen = 0, offset, numMatches, numParts;
@@ -850,8 +850,8 @@ Tcl_RegsubObjCmd(
TclListObjGetElements(interp, subPtr, &numParts, &parts);
numArgs = numParts + info.nsubs + 1;
args = (Tcl_Obj **)Tcl_Alloc(sizeof(Tcl_Obj*) * numArgs);
memcpy(args, parts, sizeof(Tcl_Obj*) * numParts);
args = (Tcl_Obj **)Tcl_Alloc(sizeof(Tcl_Obj *) * numArgs);
memcpy(args, parts, sizeof(Tcl_Obj *) * numParts);
for (idx = 0 ; idx <= info.nsubs ; idx++) {
subStart = info.matches[idx].start;
@@ -1077,7 +1077,7 @@ Tcl_RenameObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *oldName, *newName;
@@ -1113,7 +1113,7 @@ Tcl_ReturnObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
int code, level;
Tcl_Obj *returnOpts;
@@ -1160,7 +1160,7 @@ Tcl_SourceObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNRSourceObjCmd, clientData, objc, objv);
}
@@ -1170,7 +1170,7 @@ TclNRSourceObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *encodingName = NULL;
Tcl_Obj *fileName;
@@ -1244,7 +1244,7 @@ Tcl_SplitObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
int ch = 0;
Tcl_Size len;
@@ -1377,7 +1377,7 @@ StringFirstCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size start = TCL_INDEX_START;
@@ -1421,7 +1421,7 @@ StringLastCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size last = TCL_SIZE_MAX;
@@ -1465,7 +1465,7 @@ StringIndexCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size index, end;
@@ -1532,7 +1532,7 @@ StringInsertCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter */
Tcl_Size objc, /* Number of arguments */
Tcl_Obj *const objv[]) /* Argument objects */
Tcl_Obj *const *objv) /* Argument objects */
{
Tcl_Size length; /* String length */
Tcl_Size index; /* Insert index */
@@ -1589,7 +1589,7 @@ StringIsCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *string1, *end, *stop;
int (*chcomp)(int) = NULL; /* The UniChar comparison function. */
@@ -2025,7 +2025,7 @@ StringMapCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size length1, length2, mapElemc, index;
int nocase = 0, mapWithDict = 0, copySource = 0;
@@ -2301,7 +2301,7 @@ StringMatchCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
int nocase = 0;
@@ -2325,7 +2325,7 @@ StringMatchCmd(
}
}
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
TclStringMatchObj(objv[objc-1], objv[objc-2], nocase)));
TclStringMatchObj(objv[objc-1], objv[objc-2], nocase)));
return TCL_OK;
}
@@ -2352,7 +2352,7 @@ StringRangeCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size first, last, end;
@@ -2402,7 +2402,7 @@ StringReptCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_WideInt count;
Tcl_Obj *resultPtr;
@@ -2458,7 +2458,7 @@ StringRplcCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size first, last, end;
@@ -2535,7 +2535,7 @@ StringRevCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
@@ -2568,7 +2568,7 @@ StringStartCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
int ch;
const Tcl_UniChar *p, *string;
@@ -2639,7 +2639,7 @@ StringEndCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
int ch;
const Tcl_UniChar *p, *end, *string;
@@ -2701,7 +2701,7 @@ StringEqualCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
/*
* Remember to keep code here in some sync with the byte-compiled versions
@@ -2781,7 +2781,7 @@ StringCmpCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
/*
* Remember to keep code here in some sync with the byte-compiled versions
@@ -2807,7 +2807,7 @@ int
StringCmpOpts(
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[], /* Argument objects. */
Tcl_Obj *const *objv, /* Argument objects. */
int *nocase,
Tcl_Size *reqlength)
{
@@ -2875,7 +2875,7 @@ StringCatCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *objResultPtr;
@@ -2920,7 +2920,7 @@ StringLenCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "string");
@@ -2954,7 +2954,7 @@ StringLowerCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size length1, length2;
const char *string1;
@@ -3039,7 +3039,7 @@ StringUpperCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size length1, length2;
const char *string1;
@@ -3124,7 +3124,7 @@ StringTitleCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Size length1, length2;
const char *string1;
@@ -3209,7 +3209,7 @@ StringTrimCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *string1, *string2;
Tcl_Size triml, trimr, length1, length2;
@@ -3256,7 +3256,7 @@ StringTrimLCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *string1, *string2;
Tcl_Size trim;
@@ -3303,7 +3303,7 @@ StringTrimRCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
const char *string1, *string2;
Tcl_Size trim;
@@ -3378,7 +3378,7 @@ TclSubstOptions(
if (flags & 0xFFFF) { /* positive options specified too */
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"cannot combine positive and negative options", -1));
"cannot combine positive and negative options", -1));
}
return TCL_ERROR;
}
@@ -3394,7 +3394,7 @@ Tcl_SubstObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNRSubstObjCmd, clientData, objc, objv);
}
@@ -3404,7 +3404,7 @@ TclNRSubstObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
int flags;
@@ -3443,7 +3443,7 @@ Tcl_SwitchObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNRSwitchObjCmd, clientData, objc, objv);
}
@@ -3452,7 +3452,7 @@ TclNRSwitchObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
int noCase, mode, foundmode, splitObjs, numMatchesSaved;
Tcl_Size i;
@@ -4007,7 +4007,7 @@ Tcl_ThrowObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *options;
Tcl_Size len;
@@ -4069,7 +4069,7 @@ Tcl_TimeObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *objPtr;
Tcl_Obj *objs[4];
@@ -4162,7 +4162,7 @@ Tcl_TimeRateObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
static double measureOverhead = 0;
/* global measure-overhead */
@@ -4751,7 +4751,7 @@ Tcl_TryObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNRTryObjCmd, clientData, objc, objv);
}
@@ -4761,7 +4761,7 @@ TclNRTryObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
Tcl_Obj *bodyObj, *handlersObj, *finallyObj = NULL;
int bodyShared, haveHandlers, code;
@@ -5326,7 +5326,7 @@ Tcl_WhileObjCmd(
void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
return Tcl_NRCallObjProc2(interp, TclNRWhileObjCmd, clientData, objc, objv);
}
@@ -5336,7 +5336,7 @@ TclNRWhileObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
ForIterData *iterPtr;
@@ -5385,7 +5385,7 @@ TclListLines(
int line, /* Line the list as a whole starts on. */
Tcl_Size n, /* #elements in lines */
int *lines, /* Array of line numbers, to fill. */
Tcl_Obj *const *elems) /* The list elems as Tcl_Obj*, in need of
Tcl_Obj *const *elems) /* The list elems as Tcl_Obj *, in need of
* derived continuation data */
{
const char *listStr = TclGetString(listObj);
@@ -5418,6 +5418,8 @@ TclListLines(
}
/*
*----------------------------------------------------------------------
*
* TclUnicodeNormalizeCmd --
*
* This procedure implements the "unicode tonfc|tonfd|tonfkc|tonfkd"
@@ -5428,21 +5430,23 @@ TclListLines(
*
* Side effects:
* Stores the normalized string in the interpreter result.
*
*----------------------------------------------------------------------
*/
static int
TclUnicodeNormalizeCmd(
void *clientData, /* TCL_{NFC,NFD,NFKC,NFKD} */
Tcl_Interp *interp, /* Current interpreter. */
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
Tcl_Obj *const *objv) /* Argument objects. */
{
static const char *optNames[] = {"-profile", NULL};
enum { OPT_PROFILE } opt;
int profile = TCL_ENCODING_PROFILE_STRICT;
if (objc == 4) {
if (Tcl_GetIndexFromObj(interp, objv[1], optNames, "option", 0, &opt) !=
TCL_OK) {
if (Tcl_GetIndexFromObj(interp, objv[1], optNames, "option", 0,
&opt) != TCL_OK) {
return TCL_ERROR;
}
const char *s = Tcl_GetString(objv[2]);
+453 -177
View File
@@ -31,15 +31,15 @@ static AuxDataPrintProc DisassembleForeachInfo;
static AuxDataPrintProc PrintNewForeachInfo;
static AuxDataPrintProc DisassembleNewForeachInfo;
static int CompileEachloopCmd(Tcl_Interp *interp,
Tcl_Parse *parsePtr, Command *cmdPtr,
CompileEnv *envPtr, int collect);
Tcl_Parse *parsePtr, CompileEnv *envPtr,
int collect);
static int CompileDictEachCmd(Tcl_Interp *interp,
Tcl_Parse *parsePtr, Command *cmdPtr,
CompileEnv *envPtr, int collect);
static inline void IssueDictWithEmpty(Tcl_Interp *interp,
static inline int IssueDictWithEmpty(Tcl_Interp *interp,
Tcl_Size numWords, Tcl_Token *varTokenPtr,
CompileEnv *envPtr);
static inline void IssueDictWithBodied(Tcl_Interp *interp,
static inline int IssueDictWithBodied(Tcl_Interp *interp,
Tcl_Size numWords, Tcl_Token *varTokenPtr,
CompileEnv *envPtr);
@@ -140,7 +140,7 @@ TclCompileAppendCmd(
Tcl_Size i, numWords = parsePtr->numWords;
/* TODO: Consider support for compiling expanded args. */
if (numWords == 1 || numWords > UINT_MAX) {
if (numWords == 1 || OutOfUintRange(numWords)) {
return TCL_ERROR;
} else if (numWords == 2) {
/*
@@ -167,6 +167,9 @@ TclCompileAppendCmd(
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
PushVarNameWord(varTokenPtr, 0, &localIndex, &isScalar, 1);
if (OutOfUintRangeUpper(localIndex)) {
return TCL_ERROR;
}
/*
* We are doing an assignment, otherwise TclCompileSetCmd was called, so
@@ -205,8 +208,8 @@ TclCompileAppendCmd(
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
localIndex = LocalScalarFromToken(varTokenPtr, envPtr);
if (localIndex < 0) {
localIndex = TclLocalScalarFromToken(varTokenPtr, envPtr);
if (OutOfUintRange(localIndex)) {
return TCL_ERROR;
}
@@ -268,7 +271,7 @@ TclCompileArrayExistsCmd(
tokenPtr = TokenAfter(parsePtr->tokenPtr);
PushVarNameWord(tokenPtr, TCL_NO_ELEMENT, &localIndex, &isScalar, 1);
if (!isScalar || localIndex > UINT_MAX) {
if (!isScalar || OutOfUintRangeUpper(localIndex)) {
return TCL_ERROR;
}
@@ -345,7 +348,7 @@ TclCompileArraySetCmd(
}
PushVarNameWord(varTokenPtr, TCL_NO_ELEMENT, &localIndex, &isScalar, 1);
if (!isScalar || localIndex > UINT_MAX) {
if (!isScalar || OutOfUintRangeUpper(localIndex)) {
code = TCL_ERROR;
goto done;
}
@@ -400,6 +403,10 @@ TclCompileArraySetCmd(
keyVar = AnonymousLocal(envPtr);
valVar = AnonymousLocal(envPtr);
if (OutOfUintRange(keyVar) || OutOfUintRange(valVar)) {
code = TCL_ERROR;
goto done;
}
infoPtr = (ForeachInfo *)Tcl_Alloc(
offsetof(ForeachInfo, varLists) + sizeof(ForeachVarList *));
@@ -479,7 +486,7 @@ TclCompileArrayUnsetCmd(
}
PushVarNameWord(tokenPtr, TCL_NO_ELEMENT, &localIndex, &isScalar, 1);
if (!isScalar) {
if (!isScalar || OutOfUintRangeUpper(localIndex)) {
return TCL_ERROR;
}
@@ -623,16 +630,16 @@ TclCompileCatchCmd(
if (numWords >= 3) {
resultNameTokenPtr = TokenAfter(cmdTokenPtr);
/* DGP */
resultIndex = LocalScalarFromToken(resultNameTokenPtr, envPtr);
if (resultIndex < 0) {
resultIndex = TclLocalScalarFromToken(resultNameTokenPtr, envPtr);
if (OutOfUintRange(resultIndex)) {
return TCL_ERROR;
}
/* DKF */
if (numWords == 4) {
optsNameTokenPtr = TokenAfter(resultNameTokenPtr);
optsIndex = LocalScalarFromToken(optsNameTokenPtr, envPtr);
if (optsIndex < 0) {
optsIndex = TclLocalScalarFromToken(optsNameTokenPtr, envPtr);
if (OutOfUintRange(optsIndex)) {
return TCL_ERROR;
}
}
@@ -864,7 +871,7 @@ TclCompileConcatCmd(
PUSH( "");
return TCL_OK;
} else if (numWords > UINT_MAX) {
} else if (OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -956,7 +963,7 @@ TclCompileConstCmd(
* If the user specified an array element, we don't bother handling
* that.
*/
if (!isScalar || localIndex > UINT_MAX) {
if (!isScalar || OutOfUintRangeUpper(localIndex)) {
return TCL_ERROR;
}
@@ -1080,7 +1087,7 @@ TclCompileDictSetCmd(
* There must be at least one argument after the command.
*/
if (numWords < 4 || numWords > UINT_MAX) {
if (numWords < 4 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -1091,8 +1098,8 @@ TclCompileDictSetCmd(
*/
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
dictVarIndex = LocalScalarFromToken(varTokenPtr, envPtr);
if (dictVarIndex < 0) {
dictVarIndex = TclLocalScalarFromToken(varTokenPtr, envPtr);
if (OutOfUintRange(dictVarIndex)) {
return TCL_ERROR;
}
@@ -1167,8 +1174,8 @@ TclCompileDictIncrCmd(
* discover what the index is.
*/
dictVarIndex = LocalScalarFromToken(varTokenPtr, envPtr);
if (dictVarIndex < 0) {
dictVarIndex = TclLocalScalarFromToken(varTokenPtr, envPtr);
if (OutOfUintRange(dictVarIndex)) {
return TclCompileBasic2Or3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
}
@@ -1199,7 +1206,7 @@ TclCompileDictGetCmd(
*/
/* TODO: Consider support for compiling expanded args. */
if (numWords < 3 || numWords > UINT_MAX) {
if (numWords < 3 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
tokenPtr = TokenAfter(parsePtr->tokenPtr);
@@ -1233,7 +1240,7 @@ TclCompileDictGetWithDefaultCmd(
*/
/* TODO: Consider support for compiling expanded args. */
if (numWords < 4 || numWords > UINT_MAX) {
if (numWords < 4 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
tokenPtr = TokenAfter(parsePtr->tokenPtr);
@@ -1264,7 +1271,7 @@ TclCompileDictExistsCmd(
*/
/* TODO: Consider support for compiling expanded args. */
if (numWords < 3 || numWords > UINT_MAX) {
if (numWords < 3 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
tokenPtr = TokenAfter(parsePtr->tokenPtr);
@@ -1297,7 +1304,7 @@ TclCompileDictReplaceCmd(
/*
* Don't compile [dict replace $dict]; it's an edge case.
*/
if (numWords <= 3 || numWords > UINT_MAX || (numWords % 1)) {
if (numWords <= 3 || OutOfUintRange(numWords) || (numWords % 1)) {
return TCL_ERROR;
}
@@ -1335,7 +1342,7 @@ TclCompileDictRemoveCmd(
/*
* Don't compile [dict remove $dict]; it's an edge case.
*/
if (numWords <= 2 || numWords > UINT_MAX) {
if (numWords <= 2 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -1374,7 +1381,7 @@ TclCompileDictUnsetCmd(
*/
/* TODO: Consider support for compiling expanded args. */
if (numWords < 3 || numWords > UINT_MAX) {
if (numWords < 3 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -1385,8 +1392,8 @@ TclCompileDictUnsetCmd(
*/
tokenPtr = TokenAfter(parsePtr->tokenPtr);
dictVarIndex = LocalScalarFromToken(tokenPtr, envPtr);
if (dictVarIndex < 0) {
dictVarIndex = TclLocalScalarFromToken(tokenPtr, envPtr);
if (OutOfUintRange(dictVarIndex)) {
return TclCompileBasicMin2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
}
@@ -1421,7 +1428,7 @@ TclCompileDictCreateCmd(
Tcl_Size i, numWords = parsePtr->numWords;
/* TODO: Consider support for compiling expanded args. */
if ((numWords & 1) == 0 || numWords > UINT_MAX) {
if ((numWords & 1) == 0 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -1587,6 +1594,119 @@ TclCompileDictMergeCmd(
}
int
TclCompileDictAppendCmd(
Tcl_Interp *interp, /* Used for looking up stuff. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to definition of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Size i, numWords = parsePtr->numWords;
Tcl_LVTIndex dictVarIndex;
/*
* There must be at least two argument after the command. And we impose an
* (arbitrary) safe limit; anyone exceeding it should stop worrying about
* speed quite so much. ;-)
* TODO: Raise the limit...
*/
/* TODO: Consider support for compiling expanded args. */
if (numWords < 4 || numWords > 100) {
return TCL_ERROR;
}
/*
* Get the index of the local variable that we will be working with.
*/
tokenPtr = TokenAfter(parsePtr->tokenPtr);
dictVarIndex = TclLocalScalarFromToken(tokenPtr, envPtr);
if (OutOfUintRange(dictVarIndex)) {
return TclCompileBasicMin2ArgCmd(interp, parsePtr,cmdPtr, envPtr);
}
/*
* Produce the string to concatenate onto the dictionary entry.
*/
tokenPtr = TokenAfter(tokenPtr);
for (i=2 ; i<numWords ; i++) {
PUSH_TOKEN( tokenPtr, i);
tokenPtr = TokenAfter(tokenPtr);
}
if (numWords > 4) {
OP1( STR_CONCAT1, numWords - 3);
}
/*
* Do the concatenation.
*/
OP4( DICT_APPEND, dictVarIndex);
return TCL_OK;
}
int
TclCompileDictLappendCmd(
Tcl_Interp *interp, /* Used for looking up stuff. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to definition of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr, *keyTokenPtr, *valueTokenPtr;
Tcl_LVTIndex dictVarIndex;
/*
* There must be three arguments after the command.
*/
/* TODO: Consider support for compiling expanded args. */
/* Probably not. Why is INST_DICT_LAPPEND limited to one value? */
if (parsePtr->numWords != 4) {
return TCL_ERROR;
}
/*
* Parse the arguments.
*/
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
keyTokenPtr = TokenAfter(varTokenPtr);
valueTokenPtr = TokenAfter(keyTokenPtr);
dictVarIndex = TclLocalScalarFromToken(varTokenPtr, envPtr);
if (OutOfUintRange(dictVarIndex)) {
return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
}
/*
* Issue the implementation.
*/
PUSH_TOKEN( keyTokenPtr, 2);
PUSH_TOKEN( valueTokenPtr, 3);
OP4( DICT_LAPPEND, dictVarIndex);
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* TclCompileDictForCmd, TclCompileDictMapCmd --
*
* Compile [dict for] and [dict map]. Delegates code issuing to
* CompileDictEachCmd().
*
*----------------------------------------------------------------------
*/
int
TclCompileDictForCmd(
Tcl_Interp *interp, /* Used for looking up stuff. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
@@ -1612,7 +1732,7 @@ TclCompileDictMapCmd(
TCL_EACH_COLLECT);
}
int
static int
CompileDictEachCmd(
Tcl_Interp *interp, /* Used for looking up stuff. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
@@ -1639,7 +1759,7 @@ CompileDictEachCmd(
*/
if (parsePtr->numWords != 4) {
return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
return TCL_ERROR;
}
if (!EnvIsProc(envPtr)) {
return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
@@ -1660,7 +1780,7 @@ CompileDictEachCmd(
if (collect == TCL_EACH_COLLECT) {
collectVar = AnonymousLocal(envPtr);
if (collectVar < 0) {
if (OutOfUintRange(collectVar)) {
return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
}
}
@@ -1684,12 +1804,12 @@ CompileDictEachCmd(
}
nameChars = strlen(argv[0]);
keyVarIndex = LocalScalar(argv[0], nameChars, envPtr);
keyVarIndex = TclLocalScalar(argv[0], nameChars, envPtr);
nameChars = strlen(argv[1]);
valueVarIndex = LocalScalar(argv[1], nameChars, envPtr);
valueVarIndex = TclLocalScalar(argv[1], nameChars, envPtr);
Tcl_Free((void *)argv);
if ((keyVarIndex < 0) || (valueVarIndex < 0)) {
if (OutOfUintRange(keyVarIndex) || OutOfUintRange(valueVarIndex)) {
return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
}
@@ -1701,7 +1821,7 @@ CompileDictEachCmd(
*/
infoIndex = AnonymousLocal(envPtr);
if (infoIndex < 0) {
if (OutOfUintRange(infoIndex)) {
return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
}
@@ -1823,6 +1943,16 @@ CompileDictEachCmd(
}
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* TclCompileDictUpdateCmd --
*
* Compile [dict update].
*
*----------------------------------------------------------------------
*/
int
TclCompileDictUpdateCmd(
@@ -1846,7 +1976,7 @@ TclCompileDictUpdateCmd(
* There must be at least one argument after the command.
*/
if (numWords < 5 || numWords > UINT_MAX) {
if (numWords < 5 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -1867,8 +1997,8 @@ TclCompileDictUpdateCmd(
*/
dictVarTokenPtr = TokenAfter(parsePtr->tokenPtr);
dictIndex = LocalScalarFromToken(dictVarTokenPtr, envPtr);
if (dictIndex < 0) {
dictIndex = TclLocalScalarFromToken(dictVarTokenPtr, envPtr);
if (OutOfUintRange(dictIndex)) {
goto issueFallback;
}
@@ -1898,8 +2028,8 @@ TclCompileDictUpdateCmd(
* scalar that is resolvable at compile-time).
*/
duiPtr->varIndices[i] = LocalScalarFromToken(tokenPtr, envPtr);
if (duiPtr->varIndices[i] == TCL_INDEX_NONE) {
duiPtr->varIndices[i] = TclLocalScalarFromToken(tokenPtr, envPtr);
if (OutOfUintRange(duiPtr->varIndices[i])) {
goto failedUpdateInfoAssembly;
}
tokenPtr = TokenAfter(tokenPtr);
@@ -1972,111 +2102,20 @@ TclCompileDictUpdateCmd(
issueFallback:
return TclCompileBasicMin2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
}
/*
*----------------------------------------------------------------------
*
* TclCompileDictWithCmd --
*
* Compile [dict with]. Delegates code issuing to IssueDictWithEmpty()
* and IssueDictWithBodied(), which handle code issuing for the two
* cases: an empty body (which allows a lot of optimisation) or a body
* with substantive content.
*
*----------------------------------------------------------------------
*/
int
TclCompileDictAppendCmd(
Tcl_Interp *interp, /* Used for looking up stuff. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to definition of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *tokenPtr;
Tcl_Size i, numWords = parsePtr->numWords;
Tcl_LVTIndex dictVarIndex;
/*
* There must be at least two argument after the command. And we impose an
* (arbitrary) safe limit; anyone exceeding it should stop worrying about
* speed quite so much. ;-)
* TODO: Raise the limit...
*/
/* TODO: Consider support for compiling expanded args. */
if (numWords < 4 || numWords > 100) {
return TCL_ERROR;
}
/*
* Get the index of the local variable that we will be working with.
*/
tokenPtr = TokenAfter(parsePtr->tokenPtr);
dictVarIndex = LocalScalarFromToken(tokenPtr, envPtr);
if (dictVarIndex < 0) {
return TclCompileBasicMin2ArgCmd(interp, parsePtr,cmdPtr, envPtr);
}
/*
* Produce the string to concatenate onto the dictionary entry.
*/
tokenPtr = TokenAfter(tokenPtr);
for (i=2 ; i<numWords ; i++) {
PUSH_TOKEN( tokenPtr, i);
tokenPtr = TokenAfter(tokenPtr);
}
if (numWords > 4) {
OP1( STR_CONCAT1, numWords - 3);
}
/*
* Do the concatenation.
*/
OP4( DICT_APPEND, dictVarIndex);
return TCL_OK;
}
int
TclCompileDictLappendCmd(
Tcl_Interp *interp, /* Used for looking up stuff. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
Command *cmdPtr, /* Points to definition of command being
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr, *keyTokenPtr, *valueTokenPtr;
Tcl_LVTIndex dictVarIndex;
/*
* There must be three arguments after the command.
*/
/* TODO: Consider support for compiling expanded args. */
/* Probably not. Why is INST_DICT_LAPPEND limited to one value? */
if (parsePtr->numWords != 4) {
return TCL_ERROR;
}
/*
* Parse the arguments.
*/
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
keyTokenPtr = TokenAfter(varTokenPtr);
valueTokenPtr = TokenAfter(keyTokenPtr);
dictVarIndex = LocalScalarFromToken(varTokenPtr, envPtr);
if (dictVarIndex < 0) {
return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
}
/*
* Issue the implementation.
*/
PUSH_TOKEN( keyTokenPtr, 2);
PUSH_TOKEN( valueTokenPtr, 3);
OP4( DICT_LAPPEND, dictVarIndex);
return TCL_OK;
}
/* Compile [dict with]. Delegates code issuing to IssueDictWithEmpty() and
* IssueDictWithBodied(). */
int
TclCompileDictWithCmd(
Tcl_Interp *interp, /* Used for looking up stuff. */
@@ -2095,7 +2134,7 @@ TclCompileDictWithCmd(
*/
/* TODO: Consider support for compiling expanded args. */
if (numWords < 3 || numWords > UINT_MAX) {
if (numWords < 3 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -2138,7 +2177,7 @@ TclCompileDictWithCmd(
* free of traces.
*/
IssueDictWithEmpty(interp, numWords, varTokenPtr, envPtr);
return IssueDictWithEmpty(interp, numWords, varTokenPtr, envPtr);
} else {
/*
* OK, we have a non-trivial body. This means that the focus is on
@@ -2146,19 +2185,24 @@ TclCompileDictWithCmd(
* goes in the 'finally' clause.
*/
IssueDictWithBodied(interp, numWords, varTokenPtr, envPtr);
return IssueDictWithBodied(interp, numWords, varTokenPtr, envPtr);
}
return TCL_OK;
}
/*
* Issue code for a special case of [dict with]: an empty body means we
* definitely have no need to issue try-finally style code or to allocate local
* variable table entries for storing temporaries. Still need to do both
* INST_DICT_EXPAND and INST_DICT_RECOMBINE_* though, because we can't
* determine if we're free of traces.
*----------------------------------------------------------------------
*
* IssueDictWithEmpty --
*
* Issue code for a special case of [dict with]: an empty body means we
* definitely have no need to issue try-finally style code or to allocate
* local variable table entries for storing temporaries. Still need to do
* both INST_DICT_EXPAND and INST_DICT_RECOMBINE_* though, because we
* can't determine if we're free of traces.
*
*----------------------------------------------------------------------
*/
static inline void
static inline int
IssueDictWithEmpty(
Tcl_Interp *interp,
Tcl_Size numWords,
@@ -2176,7 +2220,10 @@ IssueDictWithEmpty(
*/
gotPath = (numWords > 3);
dictVar = LocalScalarFromToken(varTokenPtr, envPtr);
dictVar = TclLocalScalarFromToken(varTokenPtr, envPtr);
if (OutOfUintRangeUpper(dictVar)) {
return TCL_ERROR;
}
if (dictVar >= 0) {
if (gotPath) {
@@ -2238,14 +2285,23 @@ IssueDictWithEmpty(
}
}
PUSH( "");
return TCL_OK;
}
/*
* Issue code for a [dict with] that has a non-trivial body. The focus is on
* generating a try-finally structure where the INST_DICT_RECOMBINE_* goes
* in the 'finally' clause.
*----------------------------------------------------------------------
*
* IssueDictWithBodied --
*
* Issue code for a [dict with] that has a non-trivial body. The focus is
* on generating a try-finally structure where the INST_DICT_RECOMBINE_*
* goes in the 'finally' clause.
*
* Assumes that EnvInProc() is true.
*
*----------------------------------------------------------------------
*/
static inline void
static inline int
IssueDictWithBodied(
Tcl_Interp *interp,
Tcl_Size numWords,
@@ -2270,15 +2326,27 @@ IssueDictWithBodied(
*/
gotPath = (numWords > 3);
dictVar = LocalScalarFromToken(varTokenPtr, envPtr);
dictVar = TclLocalScalarFromToken(varTokenPtr, envPtr);
if (OutOfUintRangeUpper(dictVar)) {
return TCL_ERROR;
}
if (dictVar == TCL_INDEX_NONE) {
varNameTmp = AnonymousLocal(envPtr);
if (OutOfUintRangeUpper(varNameTmp)) {
return TCL_ERROR;
}
}
if (gotPath) {
pathTmp = AnonymousLocal(envPtr);
if (OutOfUintRangeUpper(pathTmp)) {
return TCL_ERROR;
}
}
keysTmp = AnonymousLocal(envPtr);
if (OutOfUintRangeUpper(keysTmp)) {
return TCL_ERROR;
}
/*
* Issue instructions. First, the part to expand the dictionary.
@@ -2384,6 +2452,7 @@ IssueDictWithBodied(
*/
FWDLABEL( done);
return TCL_OK;
}
/*
@@ -2566,7 +2635,7 @@ TclCompileExprCmd(
{
Tcl_Token *firstWordPtr;
if (parsePtr->numWords == 1 || parsePtr->numWords > UINT_MAX) {
if (parsePtr->numWords == 1 || OutOfUintRange(parsePtr->numWords)) {
return TCL_ERROR;
}
@@ -2741,12 +2810,10 @@ TclCompileForeachCmd(
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 definition of command being
* compiled. */
TCL_UNUSED(Command *),
CompileEnv *envPtr) /* Holds resulting instructions. */
{
return CompileEachloopCmd(interp, parsePtr, cmdPtr, envPtr,
TCL_EACH_KEEP_NONE);
return CompileEachloopCmd(interp, parsePtr, envPtr, TCL_EACH_KEEP_NONE);
}
/*
@@ -2772,12 +2839,10 @@ 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 the definition of the command
* being compiled. */
TCL_UNUSED(Command *),
CompileEnv *envPtr) /* Holds resulting instructions. */
{
return CompileEachloopCmd(interp, parsePtr, cmdPtr, envPtr,
TCL_EACH_COLLECT);
return CompileEachloopCmd(interp, parsePtr, envPtr, TCL_EACH_COLLECT);
}
/*
@@ -2803,7 +2868,6 @@ CompileEachloopCmd(
Tcl_Interp *interp, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
TCL_UNUSED(Command *),
CompileEnv *envPtr, /* Holds resulting instructions. */
int collect) /* Select collecting or accumulating mode
* (TCL_EACH_*) */
@@ -2830,7 +2894,7 @@ CompileEachloopCmd(
}
numWords = parsePtr->numWords;
if ((numWords < 4) || (numWords > UINT_MAX) || (numWords%2 != 0)) {
if ((numWords < 4) || OutOfUintRange(numWords) || (numWords%2 != 0)) {
return TCL_ERROR;
}
@@ -2902,8 +2966,8 @@ CompileEachloopCmd(
Tcl_ListObjIndex(NULL, varListObj, j, &varNameObj);
bytes = TclGetStringFromObj(varNameObj, &length);
varIndex = LocalScalar(bytes, length, envPtr);
if (varIndex < 0) {
varIndex = TclLocalScalar(bytes, length, envPtr);
if (OutOfUintRange(varIndex)) {
code = TCL_ERROR;
goto done;
}
@@ -2994,6 +3058,218 @@ CompileEachloopCmd(
return code;
}
/*
*----------------------------------------------------------------------
*
* TclCompileLfilterCmd --
*
* Procedure called to compile the "lfilter" command.
*
* Results:
* Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer
* evaluation to runtime.
*
* Side effects:
* Instructions are added to envPtr to execute the "lfilter" command at
* runtime.
*
*----------------------------------------------------------------------
*/
int
TclCompileLfilterCmd(
Tcl_Interp *interp, /* Used for error reporting. */
Tcl_Parse *parsePtr, /* Points to a parse structure for the command
* created by Tcl_ParseCommand. */
TCL_UNUSED(Command *), /* Points to the definition of the command
* being compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
ForeachInfo *infoPtr=NULL; /* Points to the structure describing this
* foreach command. Stored in a AuxData
* record in the ByteCode. */
Tcl_Token *tokenPtr, *bodyTokenPtr;
Tcl_Size jumpBackOffset, numWords, numLists, i, j;
Tcl_BytecodeLabel continueTarget;
Tcl_AuxDataRef infoIndex;
Tcl_ExceptionRange range;
int code = TCL_OK;
Tcl_Obj *varListObj = NULL;
/*
* If the foreach command isn't in a procedure, don't compile it inline:
* the payoff is too small.
*/
if (!EnvIsProc(envPtr)) {
return TCL_ERROR;
}
numWords = parsePtr->numWords;
if ((numWords < 4) || OutOfUintRange(numWords) || (numWords%2 != 0)) {
return TCL_ERROR;
}
/*
* Bail out if the body requires substitutions in order to ensure correct
* behaviour. [Bug 219166]
*/
for (i = 0, tokenPtr = parsePtr->tokenPtr; i < numWords-1; i++) {
tokenPtr = TokenAfter(tokenPtr);
}
bodyTokenPtr = tokenPtr;
if (bodyTokenPtr->type != TCL_TOKEN_SIMPLE_WORD) {
return TCL_ERROR;
}
/*
* Create and initialize the ForeachInfo and ForeachVarList data
* structures describing this command. Then create a AuxData record
* pointing to the ForeachInfo structure.
*/
numLists = (numWords - 2)/2;
infoPtr = (ForeachInfo *)Tcl_Alloc(offsetof(ForeachInfo, varLists)
+ numLists * sizeof(ForeachVarList *));
infoPtr->numLists = 0; /* Count this up as we go */
/*
* Parse each var list into sequence of var names. Don't
* compile the foreach inline if any var name needs substitutions or isn't
* a scalar, or if any var list needs substitutions.
*/
TclNewObj(varListObj);
for (i = 0, tokenPtr = parsePtr->tokenPtr;
i < numWords-1;
i++, tokenPtr = TokenAfter(tokenPtr)) {
ForeachVarList *varListPtr;
Tcl_Size numVars;
if (i%2 != 1) {
continue;
}
/*
* If the variable list is empty, we can enter an infinite loop when
* the interpreted version would not. Take care to ensure this does
* not happen. [Bug 1671138]
*/
if (!TclWordKnownAtCompileTime(tokenPtr, varListObj) ||
TCL_OK != TclListObjLength(NULL, varListObj, &numVars) ||
numVars == 0) {
code = TCL_ERROR;
goto done;
}
varListPtr = (ForeachVarList *)Tcl_Alloc(offsetof(ForeachVarList, varIndexes)
+ numVars * sizeof(varListPtr->varIndexes[0]));
varListPtr->numVars = numVars;
infoPtr->varLists[i / 2] = varListPtr;
infoPtr->numLists++;
for (j = 0; j < numVars; j++) {
Tcl_Obj *varNameObj;
const char *bytes;
Tcl_LVTIndex varIndex;
Tcl_Size length;
Tcl_ListObjIndex(NULL, varListObj, j, &varNameObj);
bytes = TclGetStringFromObj(varNameObj, &length);
varIndex = TclLocalScalar(bytes, length, envPtr);
if (OutOfUintRange(varIndex)) {
code = TCL_ERROR;
goto done;
}
varListPtr->varIndexes[j] = varIndex;
}
Tcl_SetObjLength(varListObj, 0);
}
/*
* We will compile the foreach command.
*/
infoIndex = TclCreateAuxData(infoPtr, &newForeachInfoType, envPtr);
/*
* Create the collecting object, unshared.
*/
OP4( LIST, 0);
/*
* Evaluate each value list and leave it on stack.
*/
for (i = 0, tokenPtr = parsePtr->tokenPtr;
i < numWords-1;
i++, tokenPtr = TokenAfter(tokenPtr)) {
if ((i%2 == 0) && (i > 0)) {
PUSH_TOKEN( tokenPtr, i);
}
}
OP4( FOREACH_START, infoIndex);
/*
* Inline compile the loop body.
*/
range = MAKE_LOOP_RANGE();
CATCH_RANGE(range) {
Tcl_BytecodeLabel collectVal;
// Get the value that went into the lead variable
OP44( FOREACH_INDEX, 0, 0);
OP4( OVER, numLists + 2);
OP( SWAP);
OP( LIST_INDEX);
// Don't bother with the constant optimisation of [if]
BODY( bodyTokenPtr, numWords - 1);
FWDJUMP( JUMP_TRUE, collectVal);
OP( POP);
FWDJUMP( JUMP, continueTarget);
STKDELTA(+1);
FWDLABEL( collectVal);
}
OP( LMAP_COLLECT);
/*
* Bottom of loop code: assign each loop variable and check whether
* to terminate the loop. Set the loop's break target.
*/
CONTINUE_TARGET( range);
FWDLABEL( continueTarget);
OP( FOREACH_STEP);
BREAK_TARGET( range);
FINALIZE_LOOP(range);
OP( FOREACH_END);
STKDELTA(-(numLists + 2));
/*
* Set the jumpback distance from INST_FOREACH_STEP to the start of the
* body's code. Misuse loopCtTemp for storing the jump size.
*/
jumpBackOffset = envPtr->exceptArrayPtr[range].continueOffset -
envPtr->exceptArrayPtr[range].codeOffset;
infoPtr->loopCtTemp = -jumpBackOffset;
done:
if (code == TCL_ERROR) {
FreeForeachInfo(infoPtr);
}
Tcl_DecrRefCount(varListObj);
return code;
}
/*
*----------------------------------------------------------------------
*
@@ -3288,7 +3564,7 @@ TclCompileFormatCmd(
* Don't handle any guaranteed-error cases.
*/
if (numWords < 2 || numWords > UINT_MAX) {
if (numWords < 2 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -3322,7 +3598,7 @@ TclCompileFormatCmd(
*/
tmpObj = Tcl_Format(interp, TclGetString(formatObj), numWords - 2, objv);
for (; --i>=0 ;) {
while (--i >= 0) {
Tcl_DecrRefCount(objv[i]);
}
TclStackFree(interp, objv);
+42 -24
View File
@@ -95,7 +95,7 @@ TclCompileGlobalCmd(
Tcl_LVTIndex localIndex;
Tcl_Size i, numWords = parsePtr->numWords;
if (numWords < 2 || numWords > UINT_MAX) {
if (numWords < 2 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -121,7 +121,7 @@ TclCompileGlobalCmd(
for (i=1; i<numWords; varTokenPtr = TokenAfter(varTokenPtr),i++) {
localIndex = IndexTailVarIfKnown(interp, varTokenPtr, envPtr);
if (localIndex < 0 || localIndex > INT_MAX) {
if (OutOfUintRange(localIndex)) {
return TCL_ERROR;
}
@@ -194,7 +194,7 @@ TclCompileIfCmd(
tokenPtr = parsePtr->tokenPtr;
numWords = parsePtr->numWords;
if (numWords > UINT_MAX) {
if (OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -441,6 +441,9 @@ TclCompileIncrCmd(
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
PushVarNameWord(varTokenPtr, 0, &localIndex, &isScalar, 1);
if (OutOfUintRangeUpper(localIndex)) {
return TCL_ERROR;
}
/*
* If an increment is given, push it, but see first if it's a small
@@ -637,6 +640,9 @@ TclCompileInfoExistsCmd(
tokenPtr = TokenAfter(parsePtr->tokenPtr);
PushVarNameWord(tokenPtr, 0, &localIndex, &isScalar, 1);
if (OutOfUintRangeUpper(localIndex)) {
return TCL_ERROR;
}
/*
* Emit instruction to check the variable for existence.
@@ -816,7 +822,7 @@ TclCompileLappendCmd(
int isScalar;
Tcl_LVTIndex localIndex;
if (numWords < 2 || numWords > UINT_MAX) {
if (numWords < 2 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -834,6 +840,9 @@ TclCompileLappendCmd(
return TCL_ERROR;
}
PushVarNameWord(varTokenPtr, 0, &localIndex, &isScalar, 1);
if (OutOfUintRangeUpper(localIndex)) {
return TCL_ERROR;
}
if (numWords != 3) {
goto lappendMultiple;
@@ -1002,7 +1011,7 @@ TclCompileLassignCmd(
* Check for command syntax error, but we'll punt that to runtime.
*/
if (numWords < 3 || numWords > UINT_MAX) {
if (numWords < 3 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -1024,6 +1033,9 @@ TclCompileLassignCmd(
tokenPtr = TokenAfter(tokenPtr);
PushVarNameWord(tokenPtr, 0, &localIndex, &isScalar, idx + 2);
if (OutOfUintRangeUpper(localIndex)) {
return TCL_ERROR;
}
/*
* Emit instructions to get the idx'th item out of the list value on
@@ -1102,7 +1114,7 @@ TclCompileLindexCmd(
*/
/* TODO: Consider support for compiling expanded args. */
if (numWords <= 1 || numWords > UINT_MAX) {
if (numWords <= 1 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -1190,7 +1202,7 @@ TclCompileListCmd(
int concat;
Tcl_Obj *listObj, *objPtr;
if (numWords > UINT_MAX) {
if (OutOfUintRange(numWords)) {
return TCL_ERROR;
}
if (numWords == 1) {
@@ -1401,7 +1413,7 @@ TclCompileLinsertCmd(
Tcl_Size i, numWords = parsePtr->numWords;
/* TODO: Consider support for compiling expanded args. */
if (numWords < 3 || numWords > UINT_MAX) {
if (numWords < 3 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -1454,7 +1466,7 @@ TclCompileLreplaceCmd(
Tcl_Size i, numWords = parsePtr->numWords;
/* TODO: Consider support for compiling expanded args. */
if (numWords < 4 || numWords > UINT_MAX) {
if (numWords < 4 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -1516,6 +1528,9 @@ TclCompileLeditCmd(
Tcl_LVTIndex varIdx;
int isScalar;
PushVarNameWord(varTokenPtr, 0, &varIdx, &isScalar, 1);
if (OutOfUintRangeUpper(varIdx)) {
return TCL_ERROR;
}
// Stack: varWords...
/*
@@ -1633,8 +1648,8 @@ TclCompileLpopCmd(
}
Tcl_Token *varTokenPtr = TokenAfter(parsePtr->tokenPtr);
Tcl_LVTIndex varIdx = LocalScalarFromToken(varTokenPtr, envPtr);
if (varIdx < 0) {
Tcl_LVTIndex varIdx = TclLocalScalarFromToken(varTokenPtr, envPtr);
if (OutOfUintRange(varIdx)) {
// Give up if we pushed any words; makes stack computations tractable
return TCL_ERROR;
}
@@ -1967,7 +1982,7 @@ TclCompileLsetCmd(
*/
/* TODO: Consider support for compiling expanded args. */
if (numWords < 3 || numWords > UINT_MAX) {
if (numWords < 3 || OutOfUintRange(numWords)) {
/*
* Fail at run time, not in compilation.
*/
@@ -1985,6 +2000,9 @@ TclCompileLsetCmd(
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
PushVarNameWord(varTokenPtr, 0, &localIndex, &isScalar, 1);
if (OutOfUintRangeUpper(localIndex)) {
return TCL_ERROR;
}
/*
* Push the "index" args and the new element value.
@@ -2267,7 +2285,7 @@ TclCompileNamespaceUpvarCmd(
* Only compile [namespace upvar ...]: needs an even number of args, >=4
*/
if ((numWords % 2) || numWords < 4 || numWords > UINT_MAX) {
if ((numWords % 2) || numWords < 4 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -2290,8 +2308,8 @@ TclCompileNamespaceUpvarCmd(
localTokenPtr = TokenAfter(otherTokenPtr);
PUSH_TOKEN( otherTokenPtr, i);
localIndex = LocalScalarFromToken(localTokenPtr, envPtr);
if (localIndex < 0) {
localIndex = TclLocalScalarFromToken(localTokenPtr, envPtr);
if (OutOfUintRange(localIndex)) {
return TCL_ERROR;
}
OP4( NSUPVAR, localIndex);
@@ -2387,7 +2405,7 @@ TclCompileRegexpCmd(
* regexp ?-nocase? ?--? {^staticString$} $var
*/
if (numWords < 3 || numWords > UINT_MAX) {
if (numWords < 3 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -2657,7 +2675,7 @@ TclCompileRegsubCmd(
result = TCL_OK;
bytes = Tcl_DStringValue(&pattern) + 1;
PushLiteral(envPtr, bytes, len);
PushLiteral(envPtr, bytes, len);
PUSH_OBJ( replacementObj);
PUSH_TOKEN( stringTokenPtr, numWords - 2);
OP( STR_MAP);
@@ -2708,7 +2726,7 @@ TclCompileReturnCmd(
Tcl_Obj *returnOpts, **objv;
Tcl_Token *wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
if (numWords > UINT_MAX) {
if (OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -2959,7 +2977,7 @@ TclCompileUpvarCmd(
return TCL_ERROR;
}
if (numWords < 3 || numWords > UINT_MAX) {
if (numWords < 3 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -3008,8 +3026,8 @@ TclCompileUpvarCmd(
localTokenPtr = TokenAfter(otherTokenPtr);
PUSH_TOKEN( otherTokenPtr, i);
localIndex = LocalScalarFromToken(localTokenPtr, envPtr);
if (localIndex < 0) {
localIndex = TclLocalScalarFromToken(localTokenPtr, envPtr);
if (OutOfUintRange(localIndex)) {
return TCL_ERROR;
}
OP4( UPVAR, localIndex);
@@ -3055,7 +3073,7 @@ TclCompileVariableCmd(
Tcl_LVTIndex localIndex;
Tcl_Size numWords = parsePtr->numWords, i;
if (numWords < 2 || numWords > UINT_MAX) {
if (numWords < 2 || OutOfUintRange(numWords)) {
return TCL_ERROR;
}
@@ -3228,7 +3246,7 @@ TclCompileObjectNextCmd(
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
Tcl_Size i, numWords = parsePtr->numWords;
if (parsePtr->numWords > UINT_MAX) {
if (OutOfUintRange(parsePtr->numWords)) {
goto issueExpanded;
}
@@ -3309,7 +3327,7 @@ TclCompileObjectNextToCmd(
if (numWords < 2) {
return TCL_ERROR;
} else if (numWords > UINT_MAX) {
} else if (OutOfUintRange(numWords)) {
// Very large number of words anyway
goto issueExpanded;
}

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