Compare commits
570
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59248c33fa | ||
|
|
bfcda554c0 | ||
|
|
6ebdd5f383 | ||
|
|
a8037e8df7 | ||
|
|
81914ec871 | ||
|
|
166190ee63 | ||
|
|
4614eaeb6c | ||
|
|
faaa406022 | ||
|
|
4b7e30ceb8 | ||
|
|
b84b1b5a87 | ||
|
|
68724b1f43 | ||
|
|
0c934cf5e4 | ||
|
|
57aa93435e | ||
|
|
b6a04ef4e8 | ||
|
|
b364073019 | ||
|
|
2d5c6c16be | ||
|
|
035195b0f4 | ||
|
|
a8897e0ba2 | ||
|
|
a69a6190a7 | ||
|
|
858697b6f6 | ||
|
|
182a8a6fbc | ||
|
|
56e27b0e1a | ||
|
|
f837143bc6 | ||
|
|
6006931fc9 | ||
|
|
b793c0c17e | ||
|
|
fb558e4cef | ||
|
|
5cf20f48c5 | ||
|
|
993a28d8cf | ||
|
|
b43e7aec44 | ||
|
|
ffc0435a28 | ||
|
|
e76f229b4a | ||
|
|
fd88611502 | ||
|
|
d594f54dc8 | ||
|
|
a8e53c3cea | ||
|
|
5fd3c575fe | ||
|
|
20b4abd9b3 | ||
|
|
cf48dad3e5 | ||
|
|
c503cda4f3 | ||
|
|
a414f1623d | ||
|
|
72df45e415 | ||
|
|
6d9e3b4ad1 | ||
|
|
b76f280e26 | ||
|
|
933ffa5c9e | ||
|
|
0b11f59ff8 | ||
|
|
cc9383a9d7 | ||
|
|
c1cd785155 | ||
|
|
327f57a896 | ||
|
|
c9dc381ce1 | ||
|
|
ec80057640 | ||
|
|
499636ce45 | ||
|
|
b874a90ed8 | ||
|
|
c797510ff8 | ||
|
|
cfba261e9b | ||
|
|
9b594af80e | ||
|
|
18bc584b71 | ||
|
|
5a55adba96 | ||
|
|
de448b8063 | ||
|
|
54b5091646 | ||
|
|
5c77a3bdea | ||
|
|
64c1a87b5f | ||
|
|
703cac60dc | ||
|
|
696e11a42b | ||
|
|
2b273fdd1d | ||
|
|
192100fcbc | ||
|
|
099ec2c204 | ||
|
|
2e1a047090 | ||
|
|
c3e4bc8b5e | ||
|
|
844399a2db | ||
|
|
5b7fa7a4e4 | ||
|
|
dc810f6e15 | ||
|
|
52d1487dfb | ||
|
|
085a472096 | ||
|
|
3d319623b1 | ||
|
|
e08a1229b3 | ||
|
|
875a2e91a1 | ||
|
|
44d4d7b3c1 | ||
|
|
8d614c2557 | ||
|
|
663055bebf | ||
|
|
050c4d7893 | ||
|
|
b229566362 | ||
|
|
7be1b1e4fc | ||
|
|
07e9a2cacf | ||
|
|
22b4ebf324 | ||
|
|
0028fbcee2 | ||
|
|
b836bf581c | ||
|
|
17e820f0ca | ||
|
|
70fe052802 | ||
|
|
44c69cacd5 | ||
|
|
f235a234ec | ||
|
|
89ea8429f7 | ||
|
|
4cc7636fbf | ||
|
|
e26ee8c21a | ||
|
|
fde078cd06 | ||
|
|
a43ca1fd70 | ||
|
|
6bcc3de72a | ||
|
|
c638ab49c1 | ||
|
|
68277f984d | ||
|
|
aa1da06ab1 | ||
|
|
78fd0d7c79 | ||
|
|
70ca43b027 | ||
|
|
91685c65b4 | ||
|
|
c9f88cfebb | ||
|
|
dc523fc365 | ||
|
|
6aa24c8ca3 | ||
|
|
98187fcbfe | ||
|
|
45bbff6820 | ||
|
|
9d5f272c17 | ||
|
|
aa49dc2501 | ||
|
|
8f9a8b9f45 | ||
|
|
13bfda9233 | ||
|
|
e59fdf4d22 | ||
|
|
577e8eed1f | ||
|
|
620201f768 | ||
|
|
914b7d5eb4 | ||
|
|
7af0494ef1 | ||
|
|
3bc3d61222 | ||
|
|
ad4c16a445 | ||
|
|
da381a2859 | ||
|
|
7ba409f546 | ||
|
|
eb99ec4583 | ||
|
|
351d7f7c1c | ||
|
|
f49614d8e0 | ||
|
|
0d769c079e | ||
|
|
665742245e | ||
|
|
4bf1046fbb | ||
|
|
d7458ecfbb | ||
|
|
f4b5524b41 | ||
|
|
b59d1f6138 | ||
|
|
664457d046 | ||
|
|
955edbe38d | ||
|
|
bfa682d1be | ||
|
|
22584de211 | ||
|
|
ce316d8ed7 | ||
|
|
9857af9cd8 | ||
|
|
76769b9071 | ||
|
|
bdc2817db0 | ||
|
|
1a4393e539 | ||
|
|
7a06379184 | ||
|
|
fcf2c0146a | ||
|
|
7d3fd1055c | ||
|
|
6ba84df246 | ||
|
|
ea18874265 | ||
|
|
a412b42219 | ||
|
|
471e63e56f | ||
|
|
f858a0cbf3 | ||
|
|
4dc2735186 | ||
|
|
a182758520 | ||
|
|
792695f1aa | ||
|
|
bb853f8e3a | ||
|
|
60696ce81b | ||
|
|
c61fb83e3a | ||
|
|
7f6d8bc80e | ||
|
|
b17dbcdd3b | ||
|
|
fe1b58230e | ||
|
|
fbe83207a7 | ||
|
|
a8d0827f70 | ||
|
|
400cc68151 | ||
|
|
63bcd1c049 | ||
|
|
5cc4b2512e | ||
|
|
37374ee339 | ||
|
|
c655b4770b | ||
|
|
ef326dedb9 | ||
|
|
0c0bd807ae | ||
|
|
32412ee230 | ||
|
|
08fbb6a2b5 | ||
|
|
4bb172da1b | ||
|
|
3e8bce3b3f | ||
|
|
bf0a9496cd | ||
|
|
19460220f2 | ||
|
|
303a5431e8 | ||
|
|
e116c9af11 | ||
|
|
50a292633e | ||
|
|
d1b65c6354 | ||
|
|
685c45cf51 | ||
|
|
5c187e3fb3 | ||
|
|
d7aeb043ef | ||
|
|
3ac46d817b | ||
|
|
e69ee6b528 | ||
|
|
1afc8936a9 | ||
|
|
8eed2915a1 | ||
|
|
c4ec70596e | ||
|
|
66de0e7eee | ||
|
|
b159d667f6 | ||
|
|
df92b05127 | ||
|
|
16e765fe97 | ||
|
|
919e9a5f97 | ||
|
|
1cfaa53923 | ||
|
|
22ff4d3b8d | ||
|
|
ff6179125f | ||
|
|
9459aca51d | ||
|
|
3fd1de184a | ||
|
|
eb966713f4 | ||
|
|
a6543dd593 | ||
|
|
bfbba66920 | ||
|
|
09fb723c51 | ||
|
|
437c6c59b0 | ||
|
|
776d3e36c1 | ||
|
|
01afb8d2fb | ||
|
|
559c4ce2e3 | ||
|
|
9bb0a77f14 | ||
|
|
7ae8a23faa | ||
|
|
2b40d76107 | ||
|
|
b8fa37b5a6 | ||
|
|
2dcb7fb76b | ||
|
|
7f888b3485 | ||
|
|
6353ba4f82 | ||
|
|
e092debb7b | ||
|
|
064dc2f13e | ||
|
|
5497d7d71b | ||
|
|
7968cfe7b2 | ||
|
|
cb1a6a9526 | ||
|
|
4c7c8c41c0 | ||
|
|
8164c59772 | ||
|
|
8cab375e3e | ||
|
|
69d261d32f | ||
|
|
5e95ace15d | ||
|
|
72c3642ec5 | ||
|
|
c7fc281d13 | ||
|
|
391408c53d | ||
|
|
ccbb4c0693 | ||
|
|
78a2986c20 | ||
|
|
e53d6db1ac | ||
|
|
4ed4fd47da | ||
|
|
f35096a343 | ||
|
|
8f7da52298 | ||
|
|
a72d84e77c | ||
|
|
7b3ea543b0 | ||
|
|
9d038092c6 | ||
|
|
2774c747b5 | ||
|
|
c3e7c58cd7 | ||
|
|
4da5c0bdd8 | ||
|
|
3d19071807 | ||
|
|
c1af3498f9 | ||
|
|
9a9a3b4500 | ||
|
|
098f477b07 | ||
|
|
7244a12bad | ||
|
|
984d079606 | ||
|
|
ce5a3f18d1 | ||
|
|
e06e2ede3e | ||
|
|
0b9d4e97b0 | ||
|
|
4a872c6bf4 | ||
|
|
bfb9efd596 | ||
|
|
fe9ee5c3b7 | ||
|
|
dfe4b531f7 | ||
|
|
7027ad7052 | ||
|
|
6cc6830a20 | ||
|
|
a444111b2f | ||
|
|
523fe6b439 | ||
|
|
35a1b3c54c | ||
|
|
da70427327 | ||
|
|
49a4a1bacc | ||
|
|
676a07f018 | ||
|
|
21a59cbbbc | ||
|
|
8f4e1bf7e5 | ||
|
|
c0c027cf31 | ||
|
|
41086f693e | ||
|
|
6bb6ac907f | ||
|
|
ebc98e9aaf | ||
|
|
a7d1547b15 | ||
|
|
4564939761 | ||
|
|
b17731c1b4 | ||
|
|
a9a42f8fcd | ||
|
|
b736bbb4a4 | ||
|
|
6b662da8bd | ||
|
|
3d63af2f4a | ||
|
|
927d6415a3 | ||
|
|
80966bdc8b | ||
|
|
59bb4e0ef8 | ||
|
|
34e3813670 | ||
|
|
7988d4dd3e | ||
|
|
98c3389124 | ||
|
|
6947cc76b6 | ||
|
|
ae67ea5ede | ||
|
|
4c34c250c2 | ||
|
|
4c47d86166 | ||
|
|
ec2bcb566c | ||
|
|
0e505f970b | ||
|
|
ac38cf507c | ||
|
|
24c750fe99 | ||
|
|
22b6069178 | ||
|
|
7fb53c5fc9 | ||
|
|
8b300ead45 | ||
|
|
e41c753a81 | ||
|
|
e51eee9970 | ||
|
|
d146c4577e | ||
|
|
f2db52d61b | ||
|
|
bf9f1bdfe6 | ||
|
|
dca82b9e05 | ||
|
|
0a3a259a4d | ||
|
|
09cca99a2a | ||
|
|
6d36060125 | ||
|
|
2e28014149 | ||
|
|
48da715792 | ||
|
|
456e957ebe | ||
|
|
88f91a837a | ||
|
|
ff5bc291c5 | ||
|
|
45ba8f09bf | ||
|
|
9642199be4 | ||
|
|
c5651e2307 | ||
|
|
b747c94ff8 | ||
|
|
35cdbe0233 | ||
|
|
5fa067edf9 | ||
|
|
996fbecb44 | ||
|
|
ce4f02fff2 | ||
|
|
7804ffae10 | ||
|
|
38d2451feb | ||
|
|
147f70647a | ||
|
|
197226ffca | ||
|
|
aa9b12534b | ||
|
|
6210156aef | ||
|
|
08e6e3c75d | ||
|
|
c6aaf8950e | ||
|
|
cd75864d03 | ||
|
|
1749ca7ab0 | ||
|
|
df5e66b219 | ||
|
|
b37de7b689 | ||
|
|
60744f6e1f | ||
|
|
086e536dcf | ||
|
|
08ac206e05 | ||
|
|
9b2a7343ba | ||
|
|
caee54eda6 | ||
|
|
cb5ac9be56 | ||
|
|
a390f3d426 | ||
|
|
e2edae1809 | ||
|
|
04dee3b51f | ||
|
|
e6cfbab12a | ||
|
|
2eb2d837ae | ||
|
|
dbfecab127 | ||
|
|
e09d68e1e0 | ||
|
|
bb29ed5240 | ||
|
|
70d263f6a1 | ||
|
|
989049bb15 | ||
|
|
77972707a1 | ||
|
|
0cc3ebdf1f | ||
|
|
9a8c8c142c | ||
|
|
7960cd2ab7 | ||
|
|
6d8a11ed0e | ||
|
|
05a44998e8 | ||
|
|
94043164f9 | ||
|
|
da1bdaea2c | ||
|
|
e89470dfe1 | ||
|
|
c9047acb43 | ||
|
|
84b23291b0 | ||
|
|
ef184c951b | ||
|
|
b49c1403ff | ||
|
|
985ff2e1e0 | ||
|
|
c882e57c3c | ||
|
|
edf90ee2df | ||
|
|
fb14459371 | ||
|
|
535b232162 | ||
|
|
0b6a0080db | ||
|
|
d64c791358 | ||
|
|
f39a8df9f1 | ||
|
|
a188aa369a | ||
|
|
8712d43327 | ||
|
|
99aade1a7b | ||
|
|
b30c2b5242 | ||
|
|
9479d47001 | ||
|
|
f5a59feb83 | ||
|
|
eeacbf07ed | ||
|
|
65f5c731b0 | ||
|
|
e98afcd1f0 | ||
|
|
f0a346f20c | ||
|
|
350e1c913f | ||
|
|
614ce62d6f | ||
|
|
1e4518dd67 | ||
|
|
aff1f5cea1 | ||
|
|
3b0645c84b | ||
|
|
515167c897 | ||
|
|
88f30c06aa | ||
|
|
7c026680a9 | ||
|
|
dc6dc70a96 | ||
|
|
581e09539b | ||
|
|
18831a7d07 | ||
|
|
bb546ea967 | ||
|
|
300e6831bb | ||
|
|
3ead868089 | ||
|
|
fda5ce7bce | ||
|
|
400eb47abf | ||
|
|
eb8decb1b2 | ||
|
|
afdd1f2b01 | ||
|
|
94fafde08e | ||
|
|
c536201543 | ||
|
|
667dd92e2d | ||
|
|
22bcf8b34c | ||
|
|
f25256fbdb | ||
|
|
552f6132ab | ||
|
|
4d85a2847a | ||
|
|
3b732aa070 | ||
|
|
bd23eeff52 | ||
|
|
11725fca61 | ||
|
|
fa4025b7c4 | ||
|
|
ea4b079432 | ||
|
|
6595f9e21e | ||
|
|
f7592862bd | ||
|
|
8b95bc2b7a | ||
|
|
0a33aaf3c3 | ||
|
|
8fac59dc54 | ||
|
|
22a6d59d28 | ||
|
|
b47003e7f2 | ||
|
|
baaab26d44 | ||
|
|
e66c60bd35 | ||
|
|
1487ca01b8 | ||
|
|
4c88b98427 | ||
|
|
374ef0ac72 | ||
|
|
40aa2c5dc5 | ||
|
|
cbc6434d64 | ||
|
|
6ec5334ee9 | ||
|
|
02e19998cf | ||
|
|
5df8f72184 | ||
|
|
aa24a262a2 | ||
|
|
4c6719cb50 | ||
|
|
e8341b3f5e | ||
|
|
e9780f7e31 | ||
|
|
d48d00ba7d | ||
|
|
d8631c27f6 | ||
|
|
1ac87ecbe9 | ||
|
|
0b34b5a938 | ||
|
|
5f86cefb00 | ||
|
|
95de857e1f | ||
|
|
3a30430481 | ||
|
|
23bf708be7 | ||
|
|
41a0edcadc | ||
|
|
8d39466b31 | ||
|
|
0496929129 | ||
|
|
a3b9a1d59a | ||
|
|
00ffe41f03 | ||
|
|
c44f7fc712 | ||
|
|
75c02f70c5 | ||
|
|
053ee60033 | ||
|
|
3a06769440 | ||
|
|
c536ed5ea8 | ||
|
|
93cc105c62 | ||
|
|
52a05837b5 | ||
|
|
6b9b395ce2 | ||
|
|
a51e7f4e52 | ||
|
|
b2536709e2 | ||
|
|
756ed8d443 | ||
|
|
cd47aaefbd | ||
|
|
59367dba5f | ||
|
|
456ae66294 | ||
|
|
400553abfd | ||
|
|
ee04bcd1d0 | ||
|
|
1297436e38 | ||
|
|
4a9723bf58 | ||
|
|
78c412d6e1 | ||
|
|
0d9cfae66b | ||
|
|
0b678b1316 | ||
|
|
4f9a2f3ad5 | ||
|
|
1e1e528e93 | ||
|
|
f73836a6c8 | ||
|
|
fda01d8dd4 | ||
|
|
b720c3cdd7 | ||
|
|
744a0be143 | ||
|
|
ac2c2356af | ||
|
|
6996f4631e | ||
|
|
1215f94f59 | ||
|
|
a7ca4b2046 | ||
|
|
a3a821a3c5 | ||
|
|
745997c0c5 | ||
|
|
5dad98f452 | ||
|
|
c8bae31f7c | ||
|
|
b9ba515a7c | ||
|
|
c76b35864c | ||
|
|
54a25d27bb | ||
|
|
54b5a4b2de | ||
|
|
c95d22db52 | ||
|
|
4ff46cad9f | ||
|
|
87aeb56b90 | ||
|
|
5da8b3e5b4 | ||
|
|
236ad42650 | ||
|
|
88d217ecde | ||
|
|
20213800ab | ||
|
|
55ff115bf7 | ||
|
|
a6a276ade4 | ||
|
|
d6e712548f | ||
|
|
5b2c30ec48 | ||
|
|
038e69248a | ||
|
|
c248ef79a3 | ||
|
|
3d337b9d90 | ||
|
|
99733e49e6 | ||
|
|
15c054287d | ||
|
|
72aa5a8ab0 | ||
|
|
26012eaea3 | ||
|
|
fe30225b27 | ||
|
|
72e5157731 | ||
|
|
11f0dc0d35 | ||
|
|
7e0bf522ae | ||
|
|
6a16b0fed6 | ||
|
|
a256b088ae | ||
|
|
6b16232799 | ||
|
|
dcc539d07b | ||
|
|
e34bff0d59 | ||
|
|
23c4d359fc | ||
|
|
8da70fe28f | ||
|
|
4367127bcc | ||
|
|
a4af5fe19c | ||
|
|
cdb8ed4f05 | ||
|
|
02b5f37b12 | ||
|
|
10fa8c7db0 | ||
|
|
c7b5b79e22 | ||
|
|
c0fac7a05d | ||
|
|
856ab09c0f | ||
|
|
dde4374b8a | ||
|
|
600c126291 | ||
|
|
59af3eaffb | ||
|
|
c5f35a4a62 | ||
|
|
87279bab94 | ||
|
|
042945d4e1 | ||
|
|
92fa6b523c | ||
|
|
d06068d382 | ||
|
|
6f435108b6 | ||
|
|
0d77fecbbf | ||
|
|
a0cfc39f55 | ||
|
|
ca45948edb | ||
|
|
3c4addfeca | ||
|
|
dcb68f8a5a | ||
|
|
b888f4bb89 | ||
|
|
19cfdd45da | ||
|
|
ebdf9d98b6 | ||
|
|
af4d79b6f9 | ||
|
|
3e13096feb | ||
|
|
d592e1c6f7 | ||
|
|
bf740809ad | ||
|
|
9a09665545 | ||
|
|
8119335e81 | ||
|
|
d445c1dd75 | ||
|
|
f29b982205 | ||
|
|
fb945046bd | ||
|
|
a60846a449 | ||
|
|
18aef20d79 | ||
|
|
763d92a2ec | ||
|
|
070c43dd20 | ||
|
|
8a1db380a2 | ||
|
|
49f6d42364 | ||
|
|
7584d63cfe | ||
|
|
a84e34240d | ||
|
|
763a5bf2e0 | ||
|
|
aefd096d51 | ||
|
|
14d8e78333 | ||
|
|
7d3a4cf418 | ||
|
|
b5706604db | ||
|
|
c1afb2bf14 | ||
|
|
67bee097dd | ||
|
|
267b3bbd8a | ||
|
|
755ff2f5a0 | ||
|
|
3ebf79647a | ||
|
|
2b772a3fad | ||
|
|
4ef9f71b24 | ||
|
|
781608aebf | ||
|
|
99f499aa5d | ||
|
|
7077ca618c | ||
|
|
95115b924a | ||
|
|
e130e456c7 | ||
|
|
7c28821305 | ||
|
|
fb44d9a8d8 | ||
|
|
703e94dd1f | ||
|
|
0c0a16cd0c | ||
|
|
02bd0c8b01 | ||
|
|
0c18669c7f | ||
|
|
f6c8ffca89 | ||
|
|
de0bbd0be4 | ||
|
|
541f81d7a6 | ||
|
|
ac1b05952a | ||
|
|
e59c343278 | ||
|
|
18e7acb361 | ||
|
|
dcb3cc310f | ||
|
|
5d19c0b7ad | ||
|
|
a0a9b6dcfe | ||
|
|
a3d0c99f90 |
@@ -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
|
||||
@@ -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: |
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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: |
|
||||
|
||||
@@ -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
@@ -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()` — 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_ListObjReverse()` — 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)
|
||||
- [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
@@ -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
@@ -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.
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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.
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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]
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
|
||||
|
||||
@@ -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
@@ -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
@@ -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"
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -438,7 +438,7 @@ bool *
|
||||
TclGetAsyncReadyPtr(void)
|
||||
{
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
|
||||
return &(tsdPtr->asyncReady);
|
||||
return &tsdPtr->asyncReady;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+529
-103
File diff suppressed because it is too large
Load Diff
+12
-12
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Reference in New Issue
Block a user