Compare commits
655
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8365a58070 | ||
|
|
b25cb7d39a | ||
|
|
02b32be1a7 | ||
|
|
d533bb6a26 | ||
|
|
972aafc741 | ||
|
|
3c9ec7f76f | ||
|
|
e39b986e81 | ||
|
|
605aff99c9 | ||
|
|
6df8a636f8 | ||
|
|
72dd32a3ca | ||
|
|
0b00017862 | ||
|
|
e3a26ef9f6 | ||
|
|
2e57446fb4 | ||
|
|
456e333da9 | ||
|
|
6c1d8b86ca | ||
|
|
a2b2c6bfc4 | ||
|
|
c7c95d77f8 | ||
|
|
e6fa255ed5 | ||
|
|
4dd62bd6ed | ||
|
|
d06ef17019 | ||
|
|
99ba912ceb | ||
|
|
9782f13f46 | ||
|
|
e922cb1cd3 | ||
|
|
a166c55da0 | ||
|
|
7e6cdc9cc4 | ||
|
|
94b81dda49 | ||
|
|
f4b65459ef | ||
|
|
81ee44ac3b | ||
|
|
c3e6dcaa67 | ||
|
|
f89b8b1e2d | ||
|
|
4e12f02a75 | ||
|
|
8f1f92264a | ||
|
|
d85dd92c27 | ||
|
|
9965b67d8e | ||
|
|
533f349b01 | ||
|
|
f3a2810d20 | ||
|
|
04d1b41522 | ||
|
|
a2efc41118 | ||
|
|
91ec2f6354 | ||
|
|
f98d4ff859 | ||
|
|
58e31795d0 | ||
|
|
2a20e200df | ||
|
|
383da62572 | ||
|
|
500fbe92e6 | ||
|
|
3fc99c04f6 | ||
|
|
56bf715712 | ||
|
|
422eaa2077 | ||
|
|
e8786f8348 | ||
|
|
d1f3fe0de0 | ||
|
|
a29de0a577 | ||
|
|
116ec0f471 | ||
|
|
4028edd571 | ||
|
|
828abac60a | ||
|
|
f5599d7f8d | ||
|
|
b421519004 | ||
|
|
c6fd11389a | ||
|
|
a231dcf0ac | ||
|
|
c0a4d1371a | ||
|
|
990b376ae1 | ||
|
|
7640d1e898 | ||
|
|
cf8194b6a0 | ||
|
|
1636c5d39a | ||
|
|
33180e74dd | ||
|
|
f51da6d726 | ||
|
|
6c297ad438 | ||
|
|
1ead60af0b | ||
|
|
d5029136c1 | ||
|
|
c0ab3b7128 | ||
|
|
ef1cf6b99b | ||
|
|
44deaab456 | ||
|
|
dfb834e395 | ||
|
|
463aed9329 | ||
|
|
c6511f8d77 | ||
|
|
8f5f70cbb1 | ||
|
|
e19283c7d5 | ||
|
|
f0ba2933f2 | ||
|
|
0519b566b8 | ||
|
|
96ba10aa41 | ||
|
|
5767ab9581 | ||
|
|
efecaa64e2 | ||
|
|
8d774cfa0b | ||
|
|
fe2ac816b0 | ||
|
|
ffeedbcbca | ||
|
|
aaa3242a11 | ||
|
|
6524bed322 | ||
|
|
cfea006a9d | ||
|
|
3a680cc449 | ||
|
|
7c5ea5b5f1 | ||
|
|
601fa19fab | ||
|
|
ecd0d69efb | ||
|
|
ef310f81a0 | ||
|
|
4c6eb20ea5 | ||
|
|
6a0634acc9 | ||
|
|
6e716af3b7 | ||
|
|
db1ca42627 | ||
|
|
677ffa1104 | ||
|
|
a82b49336a | ||
|
|
e24d246c87 | ||
|
|
56a99d9dd9 | ||
|
|
4cabc332b4 | ||
|
|
7d9ccac72d | ||
|
|
3449d223d1 | ||
|
|
0036891363 | ||
|
|
c6f5daec40 | ||
|
|
9c536234a9 | ||
|
|
0ad034c3c6 | ||
|
|
e39c8e6b26 | ||
|
|
829e5981d2 | ||
|
|
b381dafa84 | ||
|
|
bb34bee773 | ||
|
|
1f6b04d51b | ||
|
|
27989920c5 | ||
|
|
faef5b981f | ||
|
|
92b0e12403 | ||
|
|
856c560b71 | ||
|
|
daa0c940b8 | ||
|
|
c3eea370e5 | ||
|
|
c3805dda91 | ||
|
|
02960a691f | ||
|
|
c222d15bd1 | ||
|
|
93695198d8 | ||
|
|
f2a99f6167 | ||
|
|
049bb5ecaa | ||
|
|
8d4e35dc59 | ||
|
|
9bcf18e010 | ||
|
|
df9835efa1 | ||
|
|
bac8bd28c0 | ||
|
|
4067fb322f | ||
|
|
1d9460e1e6 | ||
|
|
001513fa18 | ||
|
|
2b9d31917d | ||
|
|
cdf813e288 | ||
|
|
9b08e4775f | ||
|
|
e014381903 | ||
|
|
256865fe12 | ||
|
|
4669ea6d0c | ||
|
|
87744f43c9 | ||
|
|
a6f9ef29ae | ||
|
|
d32ca76ec2 | ||
|
|
0371108cbf | ||
|
|
b29f3e80a5 | ||
|
|
05956b6b36 | ||
|
|
1ee459aa14 | ||
|
|
9f4810e640 | ||
|
|
85699b47e7 | ||
|
|
0e03c742fa | ||
|
|
4c98b8717b | ||
|
|
2841bb1300 | ||
|
|
4792d8fa00 | ||
|
|
d9762826b9 | ||
|
|
932409d7aa | ||
|
|
b13ad88718 | ||
|
|
cdee0fcd74 | ||
|
|
b3892c4018 | ||
|
|
a3c3dc2581 | ||
|
|
3d8fa193f4 | ||
|
|
6dfc99d7f2 | ||
|
|
1439f39555 | ||
|
|
cc771f1b47 | ||
|
|
62addcfa82 | ||
|
|
6e58473427 | ||
|
|
570eb6b10d | ||
|
|
f08cbe00fd | ||
|
|
63ba958fe4 | ||
|
|
2974c8e22c | ||
|
|
2da34cb738 | ||
|
|
9f8346d54f | ||
|
|
bd0d616070 | ||
|
|
5dc66dd0c9 | ||
|
|
023624c3c9 | ||
|
|
da2329ba8b | ||
|
|
6916d195ce | ||
|
|
c892bc1f1d | ||
|
|
2e4ba03817 | ||
|
|
b8a93e8423 | ||
|
|
5f6beb1bd2 | ||
|
|
341ea00aaa | ||
|
|
c6028b1641 | ||
|
|
cdcc22a92d | ||
|
|
85469aaecf | ||
|
|
3ad3a0eae3 | ||
|
|
57e43137bd | ||
|
|
ed005a749a | ||
|
|
1cc03c884b | ||
|
|
cababb3290 | ||
|
|
ec3c0c79fb | ||
|
|
656a0f78c7 | ||
|
|
b50f18b840 | ||
|
|
32a9dde838 | ||
|
|
faa471576e | ||
|
|
de133cb36a | ||
|
|
c24688ad4f | ||
|
|
d1ab32cd40 | ||
|
|
70c0fd83e8 | ||
|
|
ff00a132ab | ||
|
|
7e228aa961 | ||
|
|
4e411a89fe | ||
|
|
9d7f20adc5 | ||
|
|
93b515b360 | ||
|
|
034f00bf1b | ||
|
|
29603179f4 | ||
|
|
33a7feeefd | ||
|
|
f795c9e131 | ||
|
|
743ef38cdc | ||
|
|
b62b6bd490 | ||
|
|
90beed4f41 | ||
|
|
f4fe4153ee | ||
|
|
0b6ed354d1 | ||
|
|
a6c191c2ea | ||
|
|
7dfee7792b | ||
|
|
a16827f77e | ||
|
|
e91db44e66 | ||
|
|
aa7b8f6ccb | ||
|
|
7578a2c2bd | ||
|
|
7d2d8c6e11 | ||
|
|
fff7447683 | ||
|
|
d17930c875 | ||
|
|
dfd5e62014 | ||
|
|
c4bd26e054 | ||
|
|
5bb79143c1 | ||
|
|
67b1d52de2 | ||
|
|
dd3c1d71f7 | ||
|
|
324a884128 | ||
|
|
90fbc0fe78 | ||
|
|
db73017a4a | ||
|
|
1a4e6b5d92 | ||
|
|
60a6f1779d | ||
|
|
7b49d1632e | ||
|
|
a7f9c92001 | ||
|
|
5500c15d8a | ||
|
|
1b5d2f150d | ||
|
|
444cb185b8 | ||
|
|
22932eb228 | ||
|
|
2ee3ddac8a | ||
|
|
8037d27915 | ||
|
|
4ce2c3e6e7 | ||
|
|
b00e732483 | ||
|
|
20dafdc09e | ||
|
|
9aa3e85104 | ||
|
|
fb6b7a8d8d | ||
|
|
4cd9155ae9 | ||
|
|
0918bf8c7b | ||
|
|
fec1116ba7 | ||
|
|
261a4a6282 | ||
|
|
bbb80087ae | ||
|
|
73484694b5 | ||
|
|
6af49e65ad | ||
|
|
12cc9a424d | ||
|
|
f63cfcaea3 | ||
|
|
502287c9dd | ||
|
|
63aa951254 | ||
|
|
0698861f80 | ||
|
|
352740916d | ||
|
|
987b08480c | ||
|
|
b87531a583 | ||
|
|
52f920ba57 | ||
|
|
14476f18e0 | ||
|
|
2b81ec85d4 | ||
|
|
c56e67115f | ||
|
|
14f9ede961 | ||
|
|
50ccb92ce7 | ||
|
|
d150ddf591 | ||
|
|
3ea3c1f2f9 | ||
|
|
71ef3ba082 | ||
|
|
51adf20eaf | ||
|
|
fde157fe11 | ||
|
|
c793ae92e4 | ||
|
|
2972e0894d | ||
|
|
9c52f7a98a | ||
|
|
0985259acd | ||
|
|
0132d11834 | ||
|
|
ad6cba5a8e | ||
|
|
f43007cdd8 | ||
|
|
e6c567a325 | ||
|
|
7ba021af61 | ||
|
|
d4bb7bdf65 | ||
|
|
5fc6bbc782 | ||
|
|
d948ee6daa | ||
|
|
e008d75c19 | ||
|
|
ea9f9ac81e | ||
|
|
e99979bfcf | ||
|
|
2d6d821ea4 | ||
|
|
5c4acfb73f | ||
|
|
4c5f334c06 | ||
|
|
51bbc67659 | ||
|
|
0f3896176d | ||
|
|
2e30712093 | ||
|
|
9cfa94b1da | ||
|
|
810baa10b8 | ||
|
|
6f63d23863 | ||
|
|
aef7e0d6d9 | ||
|
|
94d9bfa884 | ||
|
|
6f959222be | ||
|
|
8f43773d55 | ||
|
|
b4cd8e5d9c | ||
|
|
15c03f09c9 | ||
|
|
7f5f2ddc7f | ||
|
|
d249a8af5d | ||
|
|
e8d057ad67 | ||
|
|
450b7aafd0 | ||
|
|
a0d647ab06 | ||
|
|
8c32ef71da | ||
|
|
756d989440 | ||
|
|
d93aaadc5e | ||
|
|
17420ef9f0 | ||
|
|
907aebaab8 | ||
|
|
967856b8f8 | ||
|
|
2ce1ce01c5 | ||
|
|
babd0b88a0 | ||
|
|
0f54d7701d | ||
|
|
bd81f35273 | ||
|
|
deaa520c80 | ||
|
|
acdb6bc384 | ||
|
|
6be68f173f | ||
|
|
0ae5b5b3c1 | ||
|
|
0dd03dfef9 | ||
|
|
2e3d1fac48 | ||
|
|
fdf990faf5 | ||
|
|
58f3361635 | ||
|
|
282b159f3b | ||
|
|
e403d82b18 | ||
|
|
c489e47329 | ||
|
|
a32cc9b49b | ||
|
|
e3a528bc44 | ||
|
|
12d28d084d | ||
|
|
fc49271c0a | ||
|
|
8c1c07d4bf | ||
|
|
4240cb00f0 | ||
|
|
1a30606518 | ||
|
|
99cc729bd2 | ||
|
|
9d64916f18 | ||
|
|
c9e70a3901 | ||
|
|
c11a7a6b08 | ||
|
|
6135265f5c | ||
|
|
1913208e18 | ||
|
|
73deb43f4f | ||
|
|
205345779a | ||
|
|
92ce12cc43 | ||
|
|
1754a9a311 | ||
|
|
91d8b69074 | ||
|
|
d3e04b3a76 | ||
|
|
3b743160f6 | ||
|
|
09d67aff95 | ||
|
|
227d96bf13 | ||
|
|
fd9d40cb5b | ||
|
|
f108505a5b | ||
|
|
90b9288358 | ||
|
|
5ecd3fa2b6 | ||
|
|
a46cd743dd | ||
|
|
ae445193f4 | ||
|
|
459a48dc5c | ||
|
|
1590eb50c5 | ||
|
|
c3f11e7741 | ||
|
|
9f710e45a9 | ||
|
|
c472223773 | ||
|
|
7f030a6b44 | ||
|
|
de7a370d58 | ||
|
|
63f824a7e9 | ||
|
|
805cd597f9 | ||
|
|
1f2fb4cf5b | ||
|
|
3d5869fb4b | ||
|
|
6d6afda39d | ||
|
|
7fc61f369b | ||
|
|
c6e6569dfe | ||
|
|
bc7e4c5d68 | ||
|
|
cd70770139 | ||
|
|
63e0947392 | ||
|
|
4ed03a1f4b | ||
|
|
ee626d5909 | ||
|
|
d4166a6b3a | ||
|
|
e325a4742e | ||
|
|
2cc11d4918 | ||
|
|
7dbf5ed0b0 | ||
|
|
1292a0d927 | ||
|
|
6003e823bf | ||
|
|
50426ba9c5 | ||
|
|
f399206c21 | ||
|
|
b2c41c81e4 | ||
|
|
0e5a1e2642 | ||
|
|
74708147ba | ||
|
|
b199b80ba8 | ||
|
|
226278b0ac | ||
|
|
2c4d707b8f | ||
|
|
544df0c1b8 | ||
|
|
8c7378b541 | ||
|
|
4f07b18244 | ||
|
|
f396811dd5 | ||
|
|
83f6249875 | ||
|
|
27503d10cd | ||
|
|
761a093174 | ||
|
|
97739f4d09 | ||
|
|
f14d6cb130 | ||
|
|
07bc28e627 | ||
|
|
4a22756b41 | ||
|
|
94f2309f51 | ||
|
|
dfc57be3b1 | ||
|
|
ec9c80bba9 | ||
|
|
7e79080ed7 | ||
|
|
75e1a82785 | ||
|
|
434f351abc | ||
|
|
8104f5f53d | ||
|
|
b3e2027137 | ||
|
|
28fe834bc3 | ||
|
|
2919fd5221 | ||
|
|
e4089d79b3 | ||
|
|
87e36a4aa9 | ||
|
|
6d6598bbcb | ||
|
|
bb005f26e4 | ||
|
|
b8674e42d2 | ||
|
|
48650316e3 | ||
|
|
b1ad5d16a7 | ||
|
|
d90a15ace1 | ||
|
|
fc506f9ca9 | ||
|
|
48bab372b9 | ||
|
|
f6b7fa43d6 | ||
|
|
4214c7a3a9 | ||
|
|
02cc7437b2 | ||
|
|
9d3e75eb7a | ||
|
|
4d7ebbdc94 | ||
|
|
22ce6aeb4b | ||
|
|
2fabe1cead | ||
|
|
4b3f548c27 | ||
|
|
3f9555d4c2 | ||
|
|
8acaf40209 | ||
|
|
8ee4bdf94d | ||
|
|
579463bcec | ||
|
|
2f36a2d349 | ||
|
|
6a233e935b | ||
|
|
4d5ff6cd13 | ||
|
|
acad581479 | ||
|
|
52d37c087d | ||
|
|
5e6453d592 | ||
|
|
f16ec6e776 | ||
|
|
42c1a1e15a | ||
|
|
5cd16427f7 | ||
|
|
1ddabb17f9 | ||
|
|
a3babfe12a | ||
|
|
b6fecacc22 | ||
|
|
360b5c41ee | ||
|
|
5a6443d00e | ||
|
|
7134cd9399 | ||
|
|
1a92fb378c | ||
|
|
ef6f1ba2c3 | ||
|
|
b0078c8129 | ||
|
|
49e7d0262b | ||
|
|
2cbec4bf44 | ||
|
|
7ac39417f1 | ||
|
|
3faf4cc3b8 | ||
|
|
9f699d22a2 | ||
|
|
13667e8096 | ||
|
|
51f7688e96 | ||
|
|
f6d6b394eb | ||
|
|
7e44dabec3 | ||
|
|
cfefe7127b | ||
|
|
2613112a13 | ||
|
|
18131f9c09 | ||
|
|
baf649278a | ||
|
|
88ec3c9772 | ||
|
|
ad19550909 | ||
|
|
aed72bee30 | ||
|
|
f65cb994d8 | ||
|
|
893c9c7302 | ||
|
|
24817641b1 | ||
|
|
89e6a65411 | ||
|
|
f664d633e6 | ||
|
|
d56e61b246 | ||
|
|
8dd58baa04 | ||
|
|
559113cc4c | ||
|
|
5dafefe112 | ||
|
|
955507f635 | ||
|
|
e942227f6e | ||
|
|
68b5780dde | ||
|
|
3b7664e77f | ||
|
|
b47b88af9b | ||
|
|
d7a9d63520 | ||
|
|
f716d8815b | ||
|
|
4e0313afe2 | ||
|
|
d9b30b94b8 | ||
|
|
2f8ea1be7c | ||
|
|
59cb45cc16 | ||
|
|
ee5c231ff5 | ||
|
|
604faa265f | ||
|
|
8e80c62f6f | ||
|
|
a417c667a5 | ||
|
|
26326004c6 | ||
|
|
0318c256ed | ||
|
|
704532c57a | ||
|
|
2d415cbf59 | ||
|
|
916f1716f3 | ||
|
|
d297273a13 | ||
|
|
b27238fbbb | ||
|
|
7466351c90 | ||
|
|
58bde2cb77 | ||
|
|
40420634aa | ||
|
|
b52476a5cd | ||
|
|
bc8ffb3922 | ||
|
|
bfb321eb38 | ||
|
|
5c1b9fefdf | ||
|
|
6d936db4a3 | ||
|
|
dd4c175c81 | ||
|
|
29b10229de | ||
|
|
bff00baca2 | ||
|
|
7dfd9c5a96 | ||
|
|
05971adca4 | ||
|
|
2f3edeea43 | ||
|
|
0c0be35710 | ||
|
|
137e142be2 | ||
|
|
8694763c10 | ||
|
|
58cd08bb7d | ||
|
|
730a9a132c | ||
|
|
d7cf041bab | ||
|
|
03f0d60f88 | ||
|
|
92402afe21 | ||
|
|
d9465a5be2 | ||
|
|
52bcb866e5 | ||
|
|
7f5ddf43ee | ||
|
|
484de8b987 | ||
|
|
2b3e403550 | ||
|
|
fa8d5668aa | ||
|
|
24d57ad4ff | ||
|
|
3185389da2 | ||
|
|
164250cf86 | ||
|
|
9c2149012b | ||
|
|
6e056b1e14 | ||
|
|
99ee3e86d7 | ||
|
|
3bbc2317b3 | ||
|
|
7d10d699c7 | ||
|
|
620cf6fa02 | ||
|
|
98e4ac55d2 | ||
|
|
eb64ed3cf0 | ||
|
|
5e0d1d6bc5 | ||
|
|
7565b9ff1e | ||
|
|
10dc783c93 | ||
|
|
0c027bb706 | ||
|
|
c658976cc3 | ||
|
|
1db5ff8c2c | ||
|
|
fbba7d0b1e | ||
|
|
559b8ab9de | ||
|
|
60ef43cb8c | ||
|
|
5c6717b7d5 | ||
|
|
2f8dae1cec | ||
|
|
dac552ac0b | ||
|
|
53ae611583 | ||
|
|
57de194b09 | ||
|
|
5204910c12 | ||
|
|
71d27bd9c6 | ||
|
|
3fa4ffc77a | ||
|
|
d2b69b306e | ||
|
|
db9946ccc3 | ||
|
|
cb0895755d | ||
|
|
b14c2f49d2 | ||
|
|
48ab03f3cd | ||
|
|
de82a1a99e | ||
|
|
7ec17e20d3 | ||
|
|
d95273cf0e | ||
|
|
f87735c127 | ||
|
|
1e769e4b57 | ||
|
|
a8dc863399 | ||
|
|
476a68cbe5 | ||
|
|
54d2883694 | ||
|
|
5a9b116846 | ||
|
|
df4391e23f | ||
|
|
717a98747d | ||
|
|
915359ddce | ||
|
|
999c88ea06 | ||
|
|
790fed46bb | ||
|
|
da01ebeabe | ||
|
|
91d5ac9d0b | ||
|
|
adff5bc1c6 | ||
|
|
eee56ee95a | ||
|
|
9cf7e2a336 | ||
|
|
93082a74a2 | ||
|
|
9f2c3815f7 | ||
|
|
592ab670f3 | ||
|
|
c0e8db49d5 | ||
|
|
d7604e5728 | ||
|
|
8e5b3b87a5 | ||
|
|
d31d858702 | ||
|
|
1234267c92 | ||
|
|
59491ce8ca | ||
|
|
ef89704696 | ||
|
|
1ce240e90f | ||
|
|
c132978e4b | ||
|
|
59f2031ac5 | ||
|
|
f85490f4e1 | ||
|
|
c2be2a28e0 | ||
|
|
4977df535f | ||
|
|
182bace1e3 | ||
|
|
1f33c7ae12 | ||
|
|
78c2c1cedf | ||
|
|
186ecf8003 | ||
|
|
56c0b11912 | ||
|
|
1df1505d69 | ||
|
|
1a08ae6fb4 | ||
|
|
891a0ade43 | ||
|
|
29d06499aa | ||
|
|
ea97de415f | ||
|
|
b327c90dcc | ||
|
|
cd1372b52d | ||
|
|
3b4cf982e3 | ||
|
|
7c4da917a7 | ||
|
|
e36d384130 | ||
|
|
5e53c4c296 | ||
|
|
78fcaa3580 | ||
|
|
11db57d058 | ||
|
|
822a2b50f7 | ||
|
|
fc21aee814 | ||
|
|
d06897f3ea | ||
|
|
1598658a83 | ||
|
|
192fa71096 | ||
|
|
76db7c5c04 | ||
|
|
85f3786d9c | ||
|
|
5e0835667d | ||
|
|
26fe5fff38 | ||
|
|
d75135cca1 | ||
|
|
a5dd225e78 | ||
|
|
5f9519213f | ||
|
|
7bce68fe3b | ||
|
|
600ace1c4b | ||
|
|
62004c9fb4 | ||
|
|
976c48a7f1 | ||
|
|
a3b501f125 | ||
|
|
13d8cae724 | ||
|
|
303cced03d | ||
|
|
3f8809d6ec | ||
|
|
b47df5123e | ||
|
|
996c102b1f | ||
|
|
2e512ffbe8 | ||
|
|
aa2667b729 | ||
|
|
0bab3624a9 | ||
|
|
c0726f8f4f | ||
|
|
39ddd8c91b | ||
|
|
d69c1d382b | ||
|
|
14b32b82e1 | ||
|
|
3f60452ac2 | ||
|
|
75b361386e | ||
|
|
f3dba34e63 | ||
|
|
36a7db47de | ||
|
|
97323cd8a0 | ||
|
|
8fa124afba | ||
|
|
df623b6abe | ||
|
|
3ef97fba38 | ||
|
|
a261f7d413 | ||
|
|
50cc521ee3 | ||
|
|
48205fa50d | ||
|
|
9fb06ec1c9 | ||
|
|
f9e188bad3 | ||
|
|
6b65756937 | ||
|
|
a74538b064 | ||
|
|
55787f4f08 | ||
|
|
0d59c187fe | ||
|
|
4d2add8f0f | ||
|
|
a4ced94ae6 | ||
|
|
496eb965ff | ||
|
|
c2423634f2 |
@@ -0,0 +1,10 @@
|
||||
tools/tcl.hpj.in
|
||||
tools/tcl.wse.in
|
||||
win/buildall.vc.bat
|
||||
win/coffbase.txt
|
||||
win/makefile.bc
|
||||
win/makefile.vc
|
||||
win/rules.vc
|
||||
win/tcl.dsp
|
||||
win/tcl.dsw
|
||||
win/tcl.hpj.in
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
tools/tcl.hpj.in
|
||||
tools/tcl.wse.in
|
||||
win/buildall.vc.bat
|
||||
win/coffbase.txt
|
||||
win/makefile.bc
|
||||
win/makefile.vc
|
||||
win/rules.vc
|
||||
win/tcl.dsp
|
||||
win/tcl.dsw
|
||||
win/tcl.hpj.in
|
||||
@@ -913,6 +913,14 @@ a better first place to look now.
|
||||
* win/nmakehlp.c: Let "nmakehlp -V" start searching digits after the
|
||||
found match (suggested by Harald Oehlmann).
|
||||
|
||||
2012-09-19 Harald Oehlmann <oehhar@users.sf.net>
|
||||
|
||||
IMPLEMENTATION OF TIP#412.
|
||||
|
||||
* library/msgcat/msgcat.tcl: dynamic locale change with mc file
|
||||
* library/clock.tcl: load on locale change.
|
||||
clock uses new msgcat features.
|
||||
|
||||
2012-09-07 Harald Oehlmann <oehhar@users.sf.net>
|
||||
|
||||
*** 8.6b3 TAGGED FOR RELEASE ***
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
README: Tcl
|
||||
This is the Tcl 8.6.2 source distribution.
|
||||
This is the Tcl 8.6.4 source distribution.
|
||||
http://sourceforge.net/projects/tcl/files/Tcl/
|
||||
You can get any source release of Tcl from the URL above.
|
||||
|
||||
|
||||
@@ -8303,11 +8303,11 @@ reported usage of large expressions (porter)
|
||||
|
||||
Many optmizations, improvements, and tightened stack management in bytecode.
|
||||
|
||||
--- Released 8.6.1, September 20, 2013 --- http://core.tcl.tk/tcl/ for details
|
||||
--- Released 8.6.1, September 20, 2013 --- http://core.tcl.tk/tcl/ for details
|
||||
|
||||
2013-09-27 (enhancement) improved ::env synchronization (fellows)
|
||||
|
||||
2013-10-20 (bug fix)[2835313] segfault from
|
||||
2013-10-20 (bug fix)[2835313] segfault from
|
||||
[apply {{} {while 1 {a {*}[return -level 0 -code continue]}}}] (fellows)
|
||||
|
||||
2013-10-22 (bug fix)[3556215] [scan %E%G%X] support (fellows)
|
||||
@@ -8451,4 +8451,84 @@ include ::oo::class (fellows)
|
||||
|
||||
2014-08-25 (TIP 429) New command [string cat] (leitgeb,ferrieux)
|
||||
|
||||
--- Released 8.6.2, August 27, 2014 --- http://core.tcl.tk/tcl/ for details
|
||||
--- Released 8.6.2, August 27, 2014 --- http://core.tcl.tk/tcl/ for details
|
||||
|
||||
2014-08-28 (bug)[b9e1a3] Correct Method Search Order (nadkarni,fellows)
|
||||
=> TclOO 1.0.3
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2014-09-05 (bug)[ccc2c2] Regression [lreplace {} 1 1] (bron,fellows)
|
||||
|
||||
2014-09-08 (bug)<oo-1.18.2> Crash regression in [oo::class destroy] (porter)
|
||||
|
||||
2014-09-09 (bug)[84af11] Regress [regsub -all {\(.*} a(b) {}] (fellows)
|
||||
|
||||
2014-09-10 (bug)[cee90e] [try {} on ok {} - on return {} {}] panic (porter)
|
||||
|
||||
2014-09-20 (feature) [tcl::unsupported::getbytecode] disassember (fellows)
|
||||
|
||||
2014-09-27 (enhancement) [string cat] bytecode optimization (leitgeb,ferrieux)
|
||||
|
||||
2014-09-27 (bug)[82521b] segfault in mangled bytecode (ogilvie,sofer)
|
||||
|
||||
2014-10-02 (bug)[bc5b79] Hang in some [read]s of limited size (rogers,porter)
|
||||
|
||||
2014-10-03 (bug)[bc1a96] segfault in [array set] of traced array (tab,porter)
|
||||
|
||||
2014-10-08 (bug)[59a2e7] MSVC14 compile support (dower,nijtmans)
|
||||
|
||||
2014-10-10 (bug)[ed29c4] [fcopy] treats [blocked] as error (rowen,porter)
|
||||
|
||||
2014-10-10 (bug)[bf7135] regression in Tcl_Write() interface (porter)
|
||||
|
||||
2014-10-18 (bug)[10dc6d] fix [gets] on non-blocking channels (fassel,porter)
|
||||
|
||||
2014-10-26 Support for Windows 10 (nijtmans)
|
||||
|
||||
2014-10-31 (bug)[dcc034] restore [open comX: r+] (lll,nijtmans)
|
||||
|
||||
2014-11-05 (bug)[214cc0] Restore [lappend v] return value (sayers,porter)
|
||||
|
||||
2014-11-06 (bug)[5adc35] Stop forcing EOF to be permanent (porter)
|
||||
|
||||
--- Released 8.6.3, November 12, 2014 --- http://core.tcl.tk/tcl/ for details
|
||||
|
||||
2014-11-21 (bug)[743338] Win: socket error encoding (ladayaroslav,nijtmans)
|
||||
|
||||
2014-12-01 (bug) restore tbcload/tclcompiler support (kupries)
|
||||
|
||||
2014-12-03 (bug)[0c043a] Fix compiled [set var($) val] (porter)
|
||||
|
||||
2014-12-04 (bug)[d2ffcc] Limit $... and bareword parsing to ASCII (ladayaroslav,porter)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2014-12-06 (bug)[c6cd4a] Win: hang in async socket connection (shults,nadkarni)
|
||||
|
||||
2014-12-10 tzdata updated to Olson's tzdata2014j (venkat)
|
||||
|
||||
2014-12-13 fix header files installation on OS X (houben)
|
||||
|
||||
2014-12-17 (TIP 427) [fconfigure $h -connecting, -peername, -sockname] (oehlmann,rmax)
|
||||
|
||||
2014-12-18 (bug)[af08c8] Crash in full finalize encoding teardown (porter)
|
||||
|
||||
2014-12-18 (bug)[7c187a] [chan copy] crash (io-53.17) (benno,porter)
|
||||
|
||||
2015-01-26 (bug)[df0848] Trouble with INFINITY macro (dower,nijtmans)
|
||||
|
||||
2015-01-29 (bug) Stop crashes when extension var resolvers misbehave (porter)
|
||||
|
||||
2015-01-29 (bug)[088727] [read] past EOF (io-73.4) (fenugrec,porter)
|
||||
|
||||
2015-02-11 tzdata updated to Olson's tzdata2015a (venkat)
|
||||
|
||||
2015-02-20 (bug)[32b615] Fix compiled [lreplace] (lreplace-4.[345]) (aspect)
|
||||
|
||||
2015-03-10 (enhancement) Revise OS X notifier for better Cocoa (walzer)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
--- Released 8.6.4, March 12, 2015 --- http://core.tcl.tk/tcl/ for details
|
||||
|
||||
2015-06-25 (TIP 412) msgcat dynamic locale change and package private locale (oehlmann)
|
||||
=> msgcat 1.6.0
|
||||
|
||||
|
||||
+16
-16
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2000-2003 Damien Miller. All rights reserved.
|
||||
* Copyright (C) 1999 WIDE Project. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
@@ -13,7 +13,7 @@
|
||||
* 3. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -67,7 +67,7 @@ strlcpy(char *dst, const char *src, size_t siz)
|
||||
}
|
||||
#endif
|
||||
|
||||
int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
|
||||
int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
|
||||
size_t hostlen, char *serv, size_t servlen, int flags)
|
||||
{
|
||||
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
|
||||
@@ -96,7 +96,7 @@ int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
|
||||
} else {
|
||||
int ret;
|
||||
Tcl_MutexLock(&netdbMutex);
|
||||
hp = gethostbyaddr((char *)&sin->sin_addr,
|
||||
hp = gethostbyaddr((char *)&sin->sin_addr,
|
||||
sizeof(struct in_addr), AF_INET);
|
||||
if (hp == NULL) {
|
||||
ret = EAI_NODATA;
|
||||
@@ -130,7 +130,7 @@ fake_gai_strerror(int err)
|
||||
default:
|
||||
return ("unknown/invalid error.");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* !HAVE_GAI_STRERROR */
|
||||
|
||||
#ifndef HAVE_FREEADDRINFO
|
||||
@@ -156,9 +156,9 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
|
||||
ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
|
||||
if (ai == NULL)
|
||||
return (NULL);
|
||||
|
||||
|
||||
memset(ai, '\0', sizeof(*ai) + sizeof(struct sockaddr_in));
|
||||
|
||||
|
||||
ai->ai_addr = (struct sockaddr *)(ai + 1);
|
||||
/* XXX -- ssh doesn't use sa_len */
|
||||
ai->ai_addrlen = sizeof(struct sockaddr_in);
|
||||
@@ -166,7 +166,7 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
|
||||
|
||||
((struct sockaddr_in *)(ai)->ai_addr)->sin_port = port;
|
||||
((struct sockaddr_in *)(ai)->ai_addr)->sin_addr.s_addr = addr;
|
||||
|
||||
|
||||
/* XXX: the following is not generally correct, but does what we want */
|
||||
if (hints->ai_socktype)
|
||||
ai->ai_socktype = hints->ai_socktype;
|
||||
@@ -180,7 +180,7 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
|
||||
}
|
||||
|
||||
int
|
||||
fake_getaddrinfo(const char *hostname, const char *servname,
|
||||
fake_getaddrinfo(const char *hostname, const char *servname,
|
||||
const struct addrinfo *hints, struct addrinfo **res)
|
||||
{
|
||||
struct hostent *hp;
|
||||
@@ -211,29 +211,29 @@ fake_getaddrinfo(const char *hostname, const char *servname,
|
||||
if (hostname && inet_aton(hostname, &in) != 0)
|
||||
addr = in.s_addr;
|
||||
*res = malloc_ai(port, addr, hints);
|
||||
if (*res == NULL)
|
||||
if (*res == NULL)
|
||||
return (EAI_MEMORY);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
if (!hostname) {
|
||||
*res = malloc_ai(port, htonl(0x7f000001), hints);
|
||||
if (*res == NULL)
|
||||
if (*res == NULL)
|
||||
return (EAI_MEMORY);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
if (inet_aton(hostname, &in)) {
|
||||
*res = malloc_ai(port, in.s_addr, hints);
|
||||
if (*res == NULL)
|
||||
if (*res == NULL)
|
||||
return (EAI_MEMORY);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/* Don't try DNS if AI_NUMERICHOST is set */
|
||||
if (hints && hints->ai_flags & AI_NUMERICHOST)
|
||||
return (EAI_NONAME);
|
||||
|
||||
|
||||
Tcl_MutexLock(&netdbMutex);
|
||||
hp = gethostbyname(hostname);
|
||||
if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2000-2003 Damien Miller. All rights reserved.
|
||||
* Copyright (C) 1999 WIDE Project. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
@@ -13,7 +13,7 @@
|
||||
* 3. Neither the name of the project nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -39,7 +39,7 @@
|
||||
#define _FAKE_RFC2553_H
|
||||
|
||||
/*
|
||||
* First, socket and INET6 related definitions
|
||||
* First, socket and INET6 related definitions
|
||||
*/
|
||||
#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
|
||||
# define _SS_MAXSIZE 128 /* Implementation specific max size */
|
||||
@@ -146,7 +146,7 @@ struct addrinfo {
|
||||
# undef getaddrinfo
|
||||
#endif
|
||||
#define getaddrinfo(a,b,c,d) (fake_getaddrinfo(a,b,c,d))
|
||||
int getaddrinfo(const char *, const char *,
|
||||
int getaddrinfo(const char *, const char *,
|
||||
const struct addrinfo *, struct addrinfo **);
|
||||
#endif /* !HAVE_GETADDRINFO */
|
||||
|
||||
@@ -162,7 +162,7 @@ void freeaddrinfo(struct addrinfo *);
|
||||
|
||||
#ifndef HAVE_GETNAMEINFO
|
||||
#define getnameinfo(a,b,c,d,e,f,g) (fake_getnameinfo(a,b,c,d,e,f,g))
|
||||
int getnameinfo(const struct sockaddr *, size_t, char *, size_t,
|
||||
int getnameinfo(const struct sockaddr *, size_t, char *, size_t,
|
||||
char *, size_t, int);
|
||||
#endif /* !HAVE_GETNAMEINFO */
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* fixstrtod.c --
|
||||
*
|
||||
* Source code for the "fixstrtod" procedure. This procedure is
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* gettod.c --
|
||||
*
|
||||
* This file provides the gettimeofday function on systems
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* limits.h --
|
||||
*
|
||||
* This is a dummy header file to #include in Tcl when there
|
||||
* is no limits.h in /usr/include. There are only a few
|
||||
* definitions here; also see tclPort.h, which already
|
||||
* #defines some of the things here if they're not arleady
|
||||
* defined.
|
||||
*
|
||||
* Copyright (c) 1991 The Regents of the University of California.
|
||||
* Copyright (c) 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.
|
||||
*/
|
||||
|
||||
#define LONG_MIN 0x80000000
|
||||
#define LONG_MAX 0x7fffffff
|
||||
#define INT_MIN 0x80000000
|
||||
#define INT_MAX 0x7fffffff
|
||||
#define SHRT_MIN 0x8000
|
||||
#define SHRT_MAX 0x7fff
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* mkstemp.c --
|
||||
*
|
||||
* Source code for the "mkstemp" library routine.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* opendir.c --
|
||||
*
|
||||
* This file provides dirent-style directory-reading procedures for V7
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* strncasecmp.c --
|
||||
*
|
||||
* Source code for the "strncasecmp" library routine.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* strstr.c --
|
||||
*
|
||||
* Source code for the "strstr" library routine.
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* strtod.c --
|
||||
*
|
||||
* Source code for the "strtod" library procedure.
|
||||
@@ -137,7 +137,7 @@ strtod(
|
||||
* has more than 18 digits, ignore the extras, since they can't affect the
|
||||
* value anyway.
|
||||
*/
|
||||
|
||||
|
||||
pExp = p;
|
||||
p -= mantSize;
|
||||
if (decPt < 0) {
|
||||
@@ -217,7 +217,7 @@ strtod(
|
||||
* by processing the exponent one bit at a time to combine many powers of
|
||||
* 2 of 10. Then combine the exponent with the fraction.
|
||||
*/
|
||||
|
||||
|
||||
if (exp < 0) {
|
||||
expSign = TRUE;
|
||||
exp = -exp;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* strtol.c --
|
||||
*
|
||||
* Source code for the "strtol" library procedure.
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* strtoul.c --
|
||||
*
|
||||
* Source code for the "strtoul" library procedure.
|
||||
@@ -90,7 +90,7 @@ strtoul(
|
||||
* If no base was provided, pick one from the leading characters of the
|
||||
* string.
|
||||
*/
|
||||
|
||||
|
||||
if (base == 0) {
|
||||
if (*p == '0') {
|
||||
p += 1;
|
||||
@@ -206,7 +206,7 @@ strtoul(
|
||||
if (overflow) {
|
||||
errno = ERANGE;
|
||||
return ULONG_MAX;
|
||||
}
|
||||
}
|
||||
if (negative) {
|
||||
return -result;
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
/*
|
||||
* Strict POSIX stuff goes here. Extensions go down below, in the ifndef
|
||||
* _POSIX_SOURCE section.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* waitpid.c --
|
||||
*
|
||||
* This procedure emulates the POSIX waitpid kernel call on BSD systems
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_AddErrorInfo 3 8.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+13
-5
@@ -13,20 +13,25 @@ Tcl_CancelEval, Tcl_Canceled \- cancel Tcl scripts
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
int
|
||||
\fBTcl_CancelEval\fR(\fIinterp, clientData, flags\fR)
|
||||
\fBTcl_CancelEval\fR(\fIinterp, resultObjPtr, clientData, flags\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_Canceled\fR(\fIinterp, flags\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *interp
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which to cancel the script.
|
||||
.AP Tcl_Obj *resultObjPtr in
|
||||
Error message to use in the cancellation, or NULL to use a default message. If
|
||||
not NULL, this object will have its reference count decremented before
|
||||
\fBTcl_CancelEval\fR returns.
|
||||
.AP int flags in
|
||||
ORed combination of flag bits that specify additional options.
|
||||
For \fBTcl_CancelEval\fR, only \fBTCL_CANCEL_UNWIND\fR is currently
|
||||
supported. For \fBTcl_Canceled\fR, only \fBTCL_LEAVE_ERR_MSG\fR and
|
||||
\fBTCL_CANCEL_UNWIND\fR are currently supported.
|
||||
.AP ClientData clientData in
|
||||
Currently, reserved for future use.
|
||||
Currently reserved for future use.
|
||||
It should be set to NULL.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -41,19 +46,21 @@ returns \fBTCL_ERROR\fR if it has. Otherwise, \fBTCL_OK\fR is returned.
|
||||
Extensions can use this function to check to see if they should abort a long
|
||||
running command. This function is thread sensitive and may only be called
|
||||
from the thread the interpreter was created in.
|
||||
.SH "FLAG BITS"
|
||||
.SS "FLAG BITS"
|
||||
Any ORed combination of the following values may be used for the
|
||||
\fIflags\fR argument to procedures such as \fBTcl_CancelEval\fR:
|
||||
.TP 23
|
||||
.TP 20
|
||||
\fBTCL_CANCEL_UNWIND\fR
|
||||
.
|
||||
This flag is used by \fBTcl_CancelEval\fR and \fBTcl_Canceled\fR.
|
||||
For \fBTcl_CancelEval\fR, if this flag is set, the script in progress
|
||||
is canceled and the evaluation stack for the interpreter is unwound.
|
||||
For \fBTcl_Canceled\fR, if this flag is set, the script in progress
|
||||
is considered to be canceled only if the evaluation stack for the
|
||||
interpreter is being unwound.
|
||||
.TP 23
|
||||
.TP 20
|
||||
\fBTCL_LEAVE_ERR_MSG\fR
|
||||
.
|
||||
This flag is only used by \fBTcl_Canceled\fR; it is ignored by
|
||||
other procedures. If an error is returned and this bit is set in
|
||||
\fIflags\fR, then an error message will be left in the interpreter's
|
||||
@@ -61,6 +68,7 @@ result, where it can be retrieved with \fBTcl_GetObjResult\fR or
|
||||
\fBTcl_GetStringResult\fR. If this flag bit is not set then no error
|
||||
message is left and the interpreter's result will not be modified.
|
||||
.SH "SEE ALSO"
|
||||
interp(n), Tcl_Eval(3),
|
||||
TIP 285
|
||||
.SH KEYWORDS
|
||||
cancel, unwind
|
||||
|
||||
+2
-1
@@ -71,7 +71,8 @@ The name of the object to create, or NULL if a new unused name is to be
|
||||
automatically selected.
|
||||
.AP "const char" *nsName in
|
||||
The name of the namespace to create for the object's private use, or NULL if a
|
||||
new unused name is to be automatically selected.
|
||||
new unused name is to be automatically selected. The namespace must not
|
||||
already exist.
|
||||
.AP int objc in
|
||||
The number of elements in the \fIobjv\fR array.
|
||||
.AP "Tcl_Obj *const" *objv in
|
||||
|
||||
+1
-1
@@ -336,7 +336,7 @@ typedef struct Tcl_ChannelType {
|
||||
It is not necessary to provide implementations for all channel
|
||||
operations. Those which are not necessary may be set to NULL in the
|
||||
struct: \fIblockModeProc\fR, \fIseekProc\fR, \fIsetOptionProc\fR,
|
||||
\fIgetOptionProc\fR, and \fIclose2Proc\fR, in addition to
|
||||
\fIgetOptionProc\fR, \fIgetHandleProc\fR, and \fIclose2Proc\fR, in addition to
|
||||
\fIflushProc\fR, \fIhandlerProc\fR, \fIthreadActionProc\fR, and
|
||||
\fItruncateProc\fR. Other functions that cannot be implemented in a
|
||||
meaningful way should return \fBEINVAL\fR when called, to indicate
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_DString 3 7.4 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+40
-74
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_GetEncoding 3 "8.1" Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -76,7 +76,7 @@ desired.
|
||||
.AP "const char" *name in
|
||||
Name of encoding to load.
|
||||
.AP Tcl_Encoding encoding in
|
||||
The encoding to query, free, or use for converting text. If \fIencoding\fR is
|
||||
The encoding to query, free, or use for converting text. If \fIencoding\fR is
|
||||
NULL, the current system encoding is used.
|
||||
.AP Tcl_Obj *objPtr in
|
||||
Name of encoding to get token for.
|
||||
@@ -86,17 +86,17 @@ Points to storage where encoding token is to be written.
|
||||
For the \fBTcl_ExternalToUtf\fR functions, an array of bytes in the
|
||||
specified encoding that are to be converted to UTF-8. For the
|
||||
\fBTcl_UtfToExternal\fR and \fBTcl_WinUtfToTChar\fR functions, an array of
|
||||
UTF-8 characters to be converted to the specified encoding.
|
||||
UTF-8 characters to be converted to the specified encoding.
|
||||
.AP "const TCHAR" *tsrc in
|
||||
An array of Windows TCHAR characters to convert to UTF-8.
|
||||
.AP int srcLen in
|
||||
Length of \fIsrc\fR or \fItsrc\fR in bytes. If the length is negative, the
|
||||
.AP int srcLen in
|
||||
Length of \fIsrc\fR or \fItsrc\fR in bytes. If the length is negative, the
|
||||
encoding-specific length of the string is used.
|
||||
.AP Tcl_DString *dstPtr out
|
||||
Pointer to an uninitialized or free \fBTcl_DString\fR in which the converted
|
||||
result will be stored.
|
||||
.AP int flags in
|
||||
Various flag bits OR-ed together.
|
||||
Various flag bits OR-ed together.
|
||||
\fBTCL_ENCODING_START\fR signifies that the
|
||||
source buffer is the first block in a (potentially multi-block) input
|
||||
stream, telling the conversion routine to reset to an initial state and
|
||||
@@ -108,7 +108,7 @@ byte is converted and then to reset to an initial state.
|
||||
\fBTCL_ENCODING_STOPONERROR\fR signifies that the conversion routine should
|
||||
return immediately upon reading a source character that does not exist in
|
||||
the target encoding; otherwise a default fallback character will
|
||||
automatically be substituted.
|
||||
automatically be substituted.
|
||||
.AP Tcl_EncodingState *statePtr in/out
|
||||
Used when converting a (generally long or indefinite length) byte stream
|
||||
in a piece-by-piece fashion. The conversion routine stores its current
|
||||
@@ -116,7 +116,7 @@ state in \fI*statePtr\fR after \fIsrc\fR (the buffer containing the
|
||||
current piece) has been converted; that state information must be passed
|
||||
back when converting the next piece of the stream so the conversion
|
||||
routine knows what state it was in when it left off at the end of the
|
||||
last piece. May be NULL, in which case the value specified for \fIflags\fR
|
||||
last piece. May be NULL, in which case the value specified for \fIflags\fR
|
||||
is ignored and the source buffer is assumed to contain the complete string to
|
||||
convert.
|
||||
.AP char *dst out
|
||||
@@ -137,11 +137,11 @@ stored in the output buffer. May be NULL.
|
||||
.AP Tcl_DString *bufPtr out
|
||||
Storage for the prescribed system encoding name.
|
||||
.AP "const Tcl_EncodingType" *typePtr in
|
||||
Structure that defines a new type of encoding.
|
||||
Structure that defines a new type of encoding.
|
||||
.AP Tcl_Obj *searchPath in
|
||||
List of filesystem directories in which to search for encoding data files.
|
||||
.AP "const char" *path in
|
||||
A path to the location of the encoding file.
|
||||
A path to the location of the encoding file.
|
||||
.BE
|
||||
.SH INTRODUCTION
|
||||
.PP
|
||||
@@ -180,13 +180,13 @@ The first time \fIname\fR is seen, \fBTcl_GetEncoding\fR returns an
|
||||
encoding with a reference count of 1. If the same \fIname\fR is requested
|
||||
further times, then the reference count for that encoding is incremented
|
||||
without the overhead of allocating a new encoding and all its associated
|
||||
data structures.
|
||||
data structures.
|
||||
.PP
|
||||
When an \fIencoding\fR is no longer needed, \fBTcl_FreeEncoding\fR
|
||||
should be called to release it. When an \fIencoding\fR is no longer in use
|
||||
anywhere (i.e., it has been freed as many times as it has been gotten)
|
||||
\fBTcl_FreeEncoding\fR will release all storage the encoding was using
|
||||
and delete it from the database.
|
||||
and delete it from the database.
|
||||
.PP
|
||||
\fBTcl_GetEncodingFromObj\fR treats the string representation of
|
||||
\fIobjPtr\fR as an encoding name, and finds an encoding with that
|
||||
@@ -201,7 +201,7 @@ on the resulting encoding token when that token will no longer be
|
||||
used.
|
||||
.PP
|
||||
\fBTcl_ExternalToUtfDString\fR converts a source buffer \fIsrc\fR from the
|
||||
specified \fIencoding\fR into UTF-8. The converted bytes are stored in
|
||||
specified \fIencoding\fR into UTF-8. The converted bytes are stored in
|
||||
\fIdstPtr\fR, which is then null-terminated. The caller should eventually
|
||||
call \fBTcl_DStringFree\fR to free any information stored in \fIdstPtr\fR.
|
||||
When converting, if any of the characters in the source buffer cannot be
|
||||
@@ -227,17 +227,17 @@ sequence, but more bytes were needed to complete this sequence. A
|
||||
subsequent call to the conversion routine should pass a buffer containing
|
||||
the unconverted bytes that remained in \fIsrc\fR plus some further bytes
|
||||
from the source stream to properly convert the formerly split-up multibyte
|
||||
sequence.
|
||||
sequence.
|
||||
.IP \fBTCL_CONVERT_SYNTAX\fR 29
|
||||
The source buffer contained an invalid character sequence. This may occur
|
||||
if the input stream has been damaged or if the input encoding method was
|
||||
misidentified.
|
||||
.IP \fBTCL_CONVERT_UNKNOWN\fR 29
|
||||
The source buffer contained a character that could not be represented in
|
||||
the target encoding and \fBTCL_ENCODING_STOPONERROR\fR was specified.
|
||||
the target encoding and \fBTCL_ENCODING_STOPONERROR\fR was specified.
|
||||
.RE
|
||||
.LP
|
||||
\fBTcl_UtfToExternalDString\fR converts a source buffer \fIsrc\fR from UTF-8
|
||||
\fBTcl_UtfToExternalDString\fR converts a source buffer \fIsrc\fR from UTF-8
|
||||
into the specified \fIencoding\fR. The converted bytes are stored in
|
||||
\fIdstPtr\fR, which is then terminated with the appropriate encoding-specific
|
||||
null. The caller should eventually call \fBTcl_DStringFree\fR to free any
|
||||
@@ -257,51 +257,17 @@ is filled with the corresponding number of bytes that were stored in
|
||||
.PP
|
||||
\fBTcl_WinUtfToTChar\fR and \fBTcl_WinTCharToUtf\fR are
|
||||
Windows-only convenience
|
||||
functions for converting between UTF-8 and Windows strings. On Windows 95
|
||||
(as with the Unix operating system),
|
||||
all strings exchanged between Tcl and the operating system are
|
||||
.QW "char"
|
||||
based. On Windows NT, some strings exchanged between Tcl and the
|
||||
operating system are
|
||||
.QW "char"
|
||||
oriented while others are in Unicode. By
|
||||
convention, in Windows a TCHAR is a character in the ANSI code page
|
||||
on Windows 95 and a Unicode character on Windows NT.
|
||||
.PP
|
||||
If you planned to use the same
|
||||
.QW "char"
|
||||
based interfaces on both Windows
|
||||
95 and Windows NT, you could use \fBTcl_UtfToExternal\fR and
|
||||
\fBTcl_ExternalToUtf\fR (or their \fBTcl_DString\fR equivalents) with an
|
||||
encoding of NULL (the current system encoding). On the other hand,
|
||||
if you planned to use the Unicode interface when running on Windows NT
|
||||
and the
|
||||
.QW "char"
|
||||
interfaces when running on Windows 95, you would have
|
||||
to perform the following type of test over and over in your program
|
||||
(as represented in pseudo-code):
|
||||
.PP
|
||||
.CS
|
||||
if (running NT) {
|
||||
encoding <- Tcl_GetEncoding("unicode");
|
||||
nativeBuffer <- Tcl_UtfToExternal(encoding, utfBuffer);
|
||||
Tcl_FreeEncoding(encoding);
|
||||
} else {
|
||||
nativeBuffer <- Tcl_UtfToExternal(NULL, utfBuffer);
|
||||
}
|
||||
.CE
|
||||
.PP
|
||||
\fBTcl_WinUtfToTChar\fR and \fBTcl_WinTCharToUtf\fR automatically
|
||||
handle this test and use the proper encoding based on the current
|
||||
operating system. \fBTcl_WinUtfToTChar\fR returns a pointer to
|
||||
a TCHAR string, and \fBTcl_WinTCharToUtf\fR expects a TCHAR string
|
||||
pointer as the \fIsrc\fR string. Otherwise, these functions
|
||||
behave identically to \fBTcl_UtfToExternalDString\fR and
|
||||
\fBTcl_ExternalToUtfDString\fR.
|
||||
functions for converting between UTF-8 and Windows strings
|
||||
based on the TCHAR type which is by convention
|
||||
a Unicode character on Windows NT.
|
||||
These functions are essentially wrappers around
|
||||
\fBTcl_UtfToExternalDString\fR and
|
||||
\fBTcl_ExternalToUtfDString\fR that convert to and from the
|
||||
Unicode encoding.
|
||||
.PP
|
||||
\fBTcl_GetEncodingName\fR is roughly the inverse of \fBTcl_GetEncoding\fR.
|
||||
Given an \fIencoding\fR, the return value is the \fIname\fR argument that
|
||||
was used to create the encoding. The string returned by
|
||||
was used to create the encoding. The string returned by
|
||||
\fBTcl_GetEncodingName\fR is only guaranteed to persist until the
|
||||
\fIencoding\fR is deleted. The caller must not modify this string.
|
||||
.PP
|
||||
@@ -340,9 +306,9 @@ reference count of 1. If an encoding with the specified \fIname\fR
|
||||
already exists, then its entry in the database is replaced with the new
|
||||
encoding; the token for the old encoding will remain valid and continue
|
||||
to behave as before, but users of the new token will now call the new
|
||||
encoding procedures.
|
||||
encoding procedures.
|
||||
.PP
|
||||
The \fItypePtr\fR argument to \fBTcl_CreateEncoding\fR contains information
|
||||
The \fItypePtr\fR argument to \fBTcl_CreateEncoding\fR contains information
|
||||
about the name of the encoding and the procedures that will be called to
|
||||
convert between this encoding and UTF-8. It is defined as follows:
|
||||
.PP
|
||||
@@ -354,7 +320,7 @@ typedef struct Tcl_EncodingType {
|
||||
Tcl_EncodingFreeProc *\fIfreeProc\fR;
|
||||
ClientData \fIclientData\fR;
|
||||
int \fInullSize\fR;
|
||||
} \fBTcl_EncodingType\fR;
|
||||
} \fBTcl_EncodingType\fR;
|
||||
.CE
|
||||
.PP
|
||||
The \fIencodingName\fR provides a string name for the encoding, by
|
||||
@@ -384,12 +350,12 @@ type \fBTcl_EncodingConvertProc\fR:
|
||||
.CS
|
||||
typedef int \fBTcl_EncodingConvertProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
const char *\fIsrc\fR,
|
||||
int \fIsrcLen\fR,
|
||||
int \fIflags\fR,
|
||||
const char *\fIsrc\fR,
|
||||
int \fIsrcLen\fR,
|
||||
int \fIflags\fR,
|
||||
Tcl_EncodingState *\fIstatePtr\fR,
|
||||
char *\fIdst\fR,
|
||||
int \fIdstLen\fR,
|
||||
char *\fIdst\fR,
|
||||
int \fIdstLen\fR,
|
||||
int *\fIsrcReadPtr\fR,
|
||||
int *\fIdstWrotePtr\fR,
|
||||
int *\fIdstCharsPtr\fR);
|
||||
@@ -405,12 +371,12 @@ documented at the top, to \fBTcl_ExternalToUtf\fR or
|
||||
\fBTcl_UtfToExternal\fR, with the following exceptions. If the
|
||||
\fIsrcLen\fR argument to one of those high-level functions is negative,
|
||||
the value passed to the callback procedure will be the appropriate
|
||||
encoding-specific string length of \fIsrc\fR. If any of the \fIsrcReadPtr\fR,
|
||||
encoding-specific string length of \fIsrc\fR. If any of the \fIsrcReadPtr\fR,
|
||||
\fIdstWrotePtr\fR, or \fIdstCharsPtr\fR arguments to one of the high-level
|
||||
functions is NULL, the corresponding value passed to the callback
|
||||
procedure will be a non-NULL location.
|
||||
.PP
|
||||
The callback procedure \fIfreeProc\fR, if non-NULL, should match the type
|
||||
The callback procedure \fIfreeProc\fR, if non-NULL, should match the type
|
||||
\fBTcl_EncodingFreeProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
@@ -420,11 +386,11 @@ typedef void \fBTcl_EncodingFreeProc\fR(
|
||||
.PP
|
||||
This \fIfreeProc\fR function is called when the encoding is deleted. The
|
||||
\fIclientData\fR parameter is the same as the \fIclientData\fR field
|
||||
specified to \fBTcl_CreateEncoding\fR when the encoding was created.
|
||||
specified to \fBTcl_CreateEncoding\fR when the encoding was created.
|
||||
.PP
|
||||
\fBTcl_GetEncodingSearchPath\fR and \fBTcl_SetEncodingSearchPath\fR
|
||||
are called to access and set the list of filesystem directories searched
|
||||
for encoding data files.
|
||||
for encoding data files.
|
||||
.PP
|
||||
The value returned by \fBTcl_GetEncodingSearchPath\fR
|
||||
is the value stored by the last successful call to
|
||||
@@ -457,7 +423,7 @@ encoding files that can be loaded using the same mechanism. These
|
||||
encoding files contain information about the tables and/or escape
|
||||
sequences used to map between an external encoding and Unicode. The
|
||||
external encoding may consist of single-byte, multi-byte, or double-byte
|
||||
characters.
|
||||
characters.
|
||||
.PP
|
||||
Each dynamically-loadable encoding is represented as a text file. The
|
||||
initial line of the file, beginning with a
|
||||
@@ -481,9 +447,9 @@ many Japanese computers.
|
||||
.IP "[4] \fBE\fR"
|
||||
An escape-sequence encoding, specifying that certain sequences of bytes
|
||||
do not represent characters, but commands that describe how following bytes
|
||||
should be interpreted.
|
||||
should be interpreted.
|
||||
.PP
|
||||
The rest of the lines in the file depend on the type.
|
||||
The rest of the lines in the file depend on the type.
|
||||
.PP
|
||||
Cases [1], [2], and [3] are collectively referred to as table-based encoding
|
||||
files. The lines in a table-based encoding file are in the same
|
||||
@@ -534,7 +500,7 @@ The third line of the file is three numbers. The first number is the
|
||||
fallback character (in base 16) to use when converting from UTF-8 to this
|
||||
encoding. The second number is a \fB1\fR if this file represents the
|
||||
encoding for a symbol font, or \fB0\fR otherwise. The last number (in base
|
||||
10) is how many pages of data follow.
|
||||
10) is how many pages of data follow.
|
||||
.PP
|
||||
Subsequent lines in the example above are pages that describe how to map
|
||||
from the encoding into 2-byte Unicode. The first line in a page identifies
|
||||
|
||||
+3
-1
@@ -67,7 +67,9 @@ The class to create the method in.
|
||||
The name of the method to create. Should not be NULL unless creating
|
||||
constructors or destructors.
|
||||
.AP int isPublic in
|
||||
A boolean flag saying whether the method is to be exported.
|
||||
A flag saying what the visibility of the method is. The only supported public
|
||||
values of this flag are 0 for a non-exported method, and 1 for an exported
|
||||
method.
|
||||
.AP Tcl_MethodType *methodTypePtr in
|
||||
A description of the type of the method to create, or the type of method to
|
||||
compare against.
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_Obj 3 8.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -94,7 +94,7 @@ Also, most Tcl values are only read and never modified.
|
||||
This is especially true for procedure arguments,
|
||||
which can be shared between the caller and the called procedure.
|
||||
Assignment and argument binding is done by
|
||||
simply assigning a pointer to the value.
|
||||
simply assigning a pointer to the value.
|
||||
Reference counting is used to determine when it is safe to
|
||||
reclaim a value's storage.
|
||||
.PP
|
||||
|
||||
+13
-13
@@ -115,7 +115,7 @@ Used for error reporting and to look up a channel registered in it.
|
||||
The name of a local or network file.
|
||||
.AP "const char" *mode in
|
||||
Specifies how the file is to be accessed. May have any of the values
|
||||
allowed for the \fImode\fR argument to the Tcl \fBopen\fR command.
|
||||
allowed for the \fImode\fR argument to the Tcl \fBopen\fR command.
|
||||
.AP int permissions in
|
||||
POSIX-style permission flags such as 0644. If a new file is created, these
|
||||
permissions will be set on the created file.
|
||||
@@ -141,7 +141,7 @@ file descriptor, for Windows it is a HANDLE.
|
||||
OR-ed combination of \fBTCL_READABLE\fR and \fBTCL_WRITABLE\fR to indicate
|
||||
what operations are valid on \fIhandle\fR.
|
||||
.AP "const char" *channelName in
|
||||
The name of the channel.
|
||||
The name of the channel.
|
||||
.AP int *modePtr out
|
||||
Points at an integer variable that will receive an OR-ed combination of
|
||||
\fBTCL_READABLE\fR and \fBTCL_WRITABLE\fR denoting whether the channel is
|
||||
@@ -155,8 +155,8 @@ from a procedure such as \fBTcl_OpenFileChannel\fR.
|
||||
A pointer to a Tcl value in which to store the characters read from the
|
||||
channel.
|
||||
.AP int charsToRead in
|
||||
The number of characters to read from the channel. If the channel's encoding
|
||||
is \fBbinary\fR, this is equivalent to the number of bytes to read from the
|
||||
The number of characters to read from the channel. If the channel's encoding
|
||||
is \fBbinary\fR, this is equivalent to the number of bytes to read from the
|
||||
channel.
|
||||
.AP int appendFlag in
|
||||
If non-zero, data read from the channel will be appended to the value.
|
||||
@@ -169,7 +169,7 @@ be large enough to hold this many bytes.
|
||||
.AP Tcl_Obj *lineObjPtr in/out
|
||||
A pointer to a Tcl value in which to store the line read from the
|
||||
channel. The line read will be appended to the current value of the
|
||||
value.
|
||||
value.
|
||||
.AP Tcl_DString *lineRead in/out
|
||||
A pointer to a Tcl dynamic string in which to store the line read from the
|
||||
channel. Must have been initialized by the caller. The line read will be
|
||||
@@ -238,8 +238,8 @@ If an error occurs while opening the channel, \fBTcl_OpenFileChannel\fR
|
||||
returns NULL and records a POSIX error code that can be
|
||||
retrieved with \fBTcl_GetErrno\fR.
|
||||
In addition, if \fIinterp\fR is non-NULL, \fBTcl_OpenFileChannel\fR
|
||||
leaves an error message in \fIinterp\fR's result after any error.
|
||||
As of Tcl 8.4, the value-based API \fBTcl_FSOpenFileChannel\fR should
|
||||
leaves an error message in \fIinterp\fR's result after any error.
|
||||
As of Tcl 8.4, the value-based API \fBTcl_FSOpenFileChannel\fR should
|
||||
be used in preference to \fBTcl_OpenFileChannel\fR wherever possible.
|
||||
.PP
|
||||
The newly created channel is not registered in the supplied interpreter; to
|
||||
@@ -360,7 +360,7 @@ the standard channels (\fBstdout\fR, \fBstderr\fR, \fBstdin\fR), and will return
|
||||
Code not associated with a Tcl interpreter can call
|
||||
\fBTcl_DetachChannel\fR with \fIinterp\fR as NULL, to indicate to Tcl
|
||||
that it no longer holds a reference to that channel. If this is the last
|
||||
reference to the channel, unlike \fBTcl_UnregisterChannel\fR,
|
||||
reference to the channel, unlike \fBTcl_UnregisterChannel\fR,
|
||||
it will not be closed.
|
||||
.SH TCL_ISSTANDARDCHANNEL
|
||||
.PP
|
||||
@@ -368,7 +368,7 @@ it will not be closed.
|
||||
three standard channels, \fBstdin\fR, \fBstdout\fR or \fBstderr\fR.
|
||||
If so, it returns 1, otherwise 0.
|
||||
.PP
|
||||
No attempt is made to check whether the given channel or the standard
|
||||
No attempt is made to check whether the given channel or the standard
|
||||
channels are initialized or otherwise valid.
|
||||
.SH TCL_CLOSE
|
||||
.PP
|
||||
@@ -402,7 +402,7 @@ corresponding calls to \fBTcl_UnregisterChannel\fR.
|
||||
.SH "TCL_READCHARS AND TCL_READ"
|
||||
.PP
|
||||
\fBTcl_ReadChars\fR consumes bytes from \fIchannel\fR, converting the bytes
|
||||
to UTF-8 based on the channel's encoding and storing the produced data in
|
||||
to UTF-8 based on the channel's encoding and storing the produced data in
|
||||
\fIreadObjPtr\fR's string representation. The return value of
|
||||
\fBTcl_ReadChars\fR is the number of characters, up to \fIcharsToRead\fR,
|
||||
that were stored in \fIreadObjPtr\fR. If an error occurs while reading, the
|
||||
@@ -450,7 +450,7 @@ extensions. It consumes bytes from \fIchannel\fR and stores them in
|
||||
of \fBTcl_Read\fR is the number of bytes, up to \fIbytesToRead\fR, written in
|
||||
\fIreadBuf\fR. The buffer produced by \fBTcl_Read\fR is not null-terminated.
|
||||
Its contents are valid from the zeroth position up to and excluding the
|
||||
position indicated by the return value.
|
||||
position indicated by the return value.
|
||||
.PP
|
||||
\fBTcl_ReadRaw\fR is the same as \fBTcl_Read\fR but does not
|
||||
compensate for stacking. While \fBTcl_Read\fR (and the other functions
|
||||
@@ -507,7 +507,7 @@ to be null-terminated and it outputs everything up to the null.
|
||||
.PP
|
||||
Data queued for output may not appear on the output device immediately, due
|
||||
to internal buffering. If the data should appear immediately, call
|
||||
\fBTcl_Flush\fR after the call to \fBTcl_WriteChars\fR, or set the
|
||||
\fBTcl_Flush\fR after the call to \fBTcl_WriteChars\fR, or set the
|
||||
\fB\-buffering\fR option on the channel to \fBnone\fR. If you wish the data
|
||||
to appear as soon as a complete line is accepted for output, set the
|
||||
\fB\-buffering\fR option on the channel to \fBline\fR mode.
|
||||
@@ -525,7 +525,7 @@ channel. This is done even if the channel has no encoding.
|
||||
\fBTcl_WriteObj\fR is similar to \fBTcl_WriteChars\fR except it
|
||||
accepts a Tcl value whose contents will be output to the channel. The
|
||||
UTF-8 characters in \fIwriteObjPtr\fR's string representation are converted
|
||||
to the channel's encoding and queued for output to \fIchannel\fR.
|
||||
to the channel's encoding and queued for output to \fIchannel\fR.
|
||||
As a performance optimization, when writing to a channel with the encoding
|
||||
\fBbinary\fR, UTF-8 characters are not converted as they are written.
|
||||
Instead, the bytes in \fIwriteObjPtr\fR's internal representation as a
|
||||
|
||||
+9
-9
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_ParseCommand 3 8.3 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -56,7 +56,7 @@ following \fIstart\fR up to the first null character.
|
||||
.AP int nested in
|
||||
Non-zero means that the script is part of a command substitution so an
|
||||
unquoted close bracket should be treated as a command terminator. If zero,
|
||||
close brackets have no special meaning.
|
||||
close brackets have no special meaning.
|
||||
.AP int append in
|
||||
Non-zero means that \fI*parsePtr\fR already contains valid tokens; the new
|
||||
tokens should be appended to those already present. Zero means that
|
||||
@@ -118,7 +118,7 @@ result, and no information is left at \fI*parsePtr\fR.
|
||||
enclosed in braces such as
|
||||
\fB{hello}\fR or \fB{string \et with \et tabs}\fR
|
||||
from the beginning of its argument \fIstart\fR.
|
||||
The first character of \fIstart\fR must be \fB{\fR.
|
||||
The first character of \fIstart\fR must be \fB{\fR.
|
||||
If the braced string was parsed successfully,
|
||||
\fBTcl_ParseBraces\fR returns \fBTCL_OK\fR,
|
||||
fills in the structure pointed to by \fIparsePtr\fR
|
||||
@@ -134,7 +134,7 @@ and no information is left at \fI*parsePtr\fR or \fI*termPtr\fR.
|
||||
\fBTcl_ParseQuotedString\fR parses a double-quoted string such as
|
||||
\fB"sum is [expr {$a+$b}]"\fR
|
||||
from the beginning of the argument \fIstart\fR.
|
||||
The first character of \fIstart\fR must be \fB\N'34'\fR.
|
||||
The first character of \fIstart\fR must be \fB\N'34'\fR.
|
||||
If the double-quoted string was parsed successfully,
|
||||
\fBTcl_ParseQuotedString\fR returns \fBTCL_OK\fR,
|
||||
fills in the structure pointed to by \fIparsePtr\fR
|
||||
@@ -150,7 +150,7 @@ and no information is left at \fI*parsePtr\fR or \fI*termPtr\fR.
|
||||
\fBTcl_ParseVarName\fR parses a Tcl variable reference such as
|
||||
\fB$abc\fR or \fB$x([expr {$index + 1}])\fR from the beginning of its
|
||||
\fIstart\fR argument.
|
||||
The first character of \fIstart\fR must be \fB$\fR.
|
||||
The first character of \fIstart\fR must be \fB$\fR.
|
||||
If a variable name was parsed successfully, \fBTcl_ParseVarName\fR
|
||||
returns \fBTCL_OK\fR and fills in the structure pointed to by
|
||||
\fIparsePtr\fR with information about the structure of the variable name
|
||||
@@ -184,7 +184,7 @@ a Tcl_Parse structure. The tokens typically consist
|
||||
of all the tokens in a word or all the tokens that make up the index for
|
||||
a reference to an array variable. \fBTcl_EvalTokensStandard\fR performs the
|
||||
substitutions requested by the tokens and concatenates the
|
||||
resulting values.
|
||||
resulting values.
|
||||
The return value from \fBTcl_EvalTokensStandard\fR is a Tcl completion
|
||||
code with one of the values \fBTCL_OK\fR, \fBTCL_ERROR\fR,
|
||||
\fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or \fBTCL_CONTINUE\fR, or possibly
|
||||
@@ -242,7 +242,7 @@ character that terminates the last comment.
|
||||
If the command is not preceded by any comments, \fIcommentSize\fR is 0.
|
||||
\fBTcl_ParseCommand\fR also sets the \fIcommandStart\fR field
|
||||
to point to the first character of the first
|
||||
word in the command (skipping any comments and leading space) and
|
||||
word in the command (skipping any comments and leading space) and
|
||||
\fIcommandSize\fR gives the total number of bytes in the command,
|
||||
including the character pointed to by \fIcommandStart\fR up to and
|
||||
including the newline, close bracket, or semicolon character that
|
||||
@@ -350,7 +350,7 @@ just the \fBTCL_TOKEN_OPERATOR\fR token.
|
||||
Each operand is described by a \fBTCL_TOKEN_SUB_EXPR\fR token.
|
||||
Otherwise, the subexpression is a value described by
|
||||
one of the token types \fBTCL_TOKEN_WORD\fR, \fBTCL_TOKEN_TEXT\fR,
|
||||
\fBTCL_TOKEN_BS\fR, \fBTCL_TOKEN_COMMAND\fR,
|
||||
\fBTCL_TOKEN_BS\fR, \fBTCL_TOKEN_COMMAND\fR,
|
||||
\fBTCL_TOKEN_VARIABLE\fR, and \fBTCL_TOKEN_SUB_EXPR\fR.
|
||||
The \fInumComponents\fR field
|
||||
counts the total number of sub-tokens that make up the subexpression;
|
||||
@@ -389,7 +389,7 @@ is always 0.
|
||||
After \fBTcl_ParseCommand\fR returns, the first token pointed to by
|
||||
the \fItokenPtr\fR field of the
|
||||
Tcl_Parse structure always has type \fBTCL_TOKEN_WORD\fR or
|
||||
\fBTCL_TOKEN_SIMPLE_WORD\fR or \fBTCL_TOKEN_EXPAND_WORD\fR.
|
||||
\fBTCL_TOKEN_SIMPLE_WORD\fR or \fBTCL_TOKEN_EXPAND_WORD\fR.
|
||||
It is followed by the sub-tokens
|
||||
that must be concatenated to produce the value of that word.
|
||||
The next token is the \fBTCL_TOKEN_WORD\fR or \fBTCL_TOKEN_SIMPLE_WORD\fR
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_StringObj 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -308,7 +308,7 @@ sprintf(buf, format, ...);
|
||||
\fBTcl_NewStringObj\fR(buf, -1);
|
||||
.CE
|
||||
.PP
|
||||
but with greater convenience and no need to
|
||||
but with greater convenience and no need to
|
||||
determine \fBSOME_SUITABLE_LENGTH\fR. The formatting is done with the same
|
||||
core formatting engine used by \fBTcl_Format\fR. This means the set of
|
||||
supported conversion specifiers is that of the \fBformat\fR command and
|
||||
@@ -329,8 +329,8 @@ Tcl_Obj *objPtr = \fBTcl_ObjPrintf\fR("Value is %d", x);
|
||||
.PP
|
||||
If the value of \fIformat\fR contains internal inconsistencies or invalid
|
||||
specifier formats, the formatted string result produced by
|
||||
\fBTcl_ObjPrintf\fR will be an error message describing the error.
|
||||
It is impossible however to provide runtime protection against
|
||||
\fBTcl_ObjPrintf\fR will be an error message describing the error.
|
||||
It is impossible however to provide runtime protection against
|
||||
mismatches between the format and any subsequent arguments.
|
||||
Compile-time protection may be provided by some compilers.
|
||||
.PP
|
||||
|
||||
+6
-5
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Threads 3 "8.1" Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -79,9 +79,10 @@ waited upon into it.
|
||||
.SH INTRODUCTION
|
||||
Beginning with the 8.1 release, the Tcl core is thread safe, which
|
||||
allows you to incorporate Tcl into multithreaded applications without
|
||||
customizing the Tcl core. To enable Tcl multithreading support,
|
||||
you must include the \fB\-\|\-enable-threads\fR option to \fBconfigure\fR
|
||||
when you configure and compile your Tcl core.
|
||||
customizing the Tcl core. Starting with the 8.6 release, Tcl
|
||||
multithreading support is on by default. To disable Tcl multithreading
|
||||
support, you must include the \fB\-\|\-disable-threads\fR option to
|
||||
\fBconfigure\fR when you configure and compile your Tcl core.
|
||||
.PP
|
||||
An important constraint of the Tcl threads implementation is that
|
||||
\fIonly the thread that created a Tcl interpreter can use that
|
||||
@@ -126,7 +127,7 @@ will cause a memory leak.
|
||||
.PP
|
||||
The \fBTcl_GetThreadData\fR call returns a pointer to a block of
|
||||
thread-private data. Its argument is a key that is shared by all threads
|
||||
and a size for the block of storage. The storage is automatically
|
||||
and a size for the block of storage. The storage is automatically
|
||||
allocated and initialized to all zeros the first time each thread asks for it.
|
||||
The storage is automatically deallocated by \fBTcl_FinalizeThread\fR.
|
||||
.SS "SYNCHRONIZATION AND COMMUNICATION"
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_UtfToUpper 3 "8.1" Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+11
-24
@@ -78,7 +78,7 @@ created. \fIClientData\fR typically points to an application-specific
|
||||
data structure that describes what to do when \fIproc\fR is invoked.
|
||||
\fIOldName\fR gives the name of the command being renamed, and
|
||||
\fInewName\fR gives the name that the command is being renamed to (or
|
||||
an empty string or NULL when the command is being deleted.)
|
||||
NULL when the command is being deleted.)
|
||||
\fIFlags\fR is an OR'ed combination of bits potentially providing
|
||||
several pieces of information. One of the bits \fBTCL_TRACE_RENAME\fR and
|
||||
\fBTCL_TRACE_DELETE\fR will be set in \fIflags\fR to indicate which
|
||||
@@ -86,11 +86,14 @@ operation is being performed on the command. The bit
|
||||
\fBTCL_TRACE_DESTROYED\fR will be set in \fIflags\fR if the trace is about
|
||||
to be destroyed; this information may be useful to \fIproc\fR so that
|
||||
it can clean up its own internal data structures (see the section
|
||||
\fBTCL_TRACE_DESTROYED\fR below for more details). Lastly, the bit
|
||||
\fBTCL_INTERP_DESTROYED\fR will be set if the entire interpreter is being
|
||||
destroyed. When this bit is set, \fIproc\fR must be especially
|
||||
careful in the things it does (see the section \fBTCL_INTERP_DESTROYED\fR
|
||||
below).
|
||||
\fBTCL_TRACE_DESTROYED\fR below for more details). Because the
|
||||
deletion of commands can take place as part of the deletion of the interp
|
||||
that contains them, \fIproc\fR must be careful about checking what
|
||||
the passed in \fIinterp\fR value can be called upon to do.
|
||||
The routine \fBTcl_InterpDeleted\fR is an important tool for this.
|
||||
When \fBTcl_InterpDeleted\fR returns 1, \fIproc\fR will not be able
|
||||
to invoke any scripts in \fIinterp\fR. The function of \fIproc\fR
|
||||
in that circumstance is limited to the cleanup of its own data structures.
|
||||
.PP
|
||||
\fBTcl_UntraceCommand\fR may be used to remove a trace. If the
|
||||
command specified by \fIinterp\fR, \fIcmdName\fR, and \fIflags\fR has
|
||||
@@ -123,7 +126,8 @@ traces for a given command that have the same \fIproc\fR.
|
||||
.PP
|
||||
During rename traces, the command being renamed is visible with both
|
||||
names simultaneously, and the command still exists during delete
|
||||
traces (if \fBTCL_INTERP_DESTROYED\fR is not set). However, there is no
|
||||
traces, unless the interp that contains it is being deleted.
|
||||
However, there is no
|
||||
mechanism for signaling that an error occurred in a trace procedure,
|
||||
so great care should be taken that errors do not get silently lost.
|
||||
.SH "MULTIPLE TRACES"
|
||||
@@ -142,22 +146,5 @@ rename the command, the last renaming takes precedence.
|
||||
In a delete callback to \fIproc\fR, the \fBTCL_TRACE_DESTROYED\fR bit
|
||||
is set in \fIflags\fR.
|
||||
.\" Perhaps need some more comments here? - DKF
|
||||
.SH "TCL_INTERP_DESTROYED"
|
||||
.PP
|
||||
When an interpreter is destroyed, unset traces are called for
|
||||
all of its commands.
|
||||
The \fBTCL_INTERP_DESTROYED\fR bit will be set in the \fIflags\fR
|
||||
argument passed to the trace procedures.
|
||||
Trace procedures must be extremely careful in what they do if
|
||||
the \fBTCL_INTERP_DESTROYED\fR bit is set.
|
||||
It is not safe for the procedures to invoke any Tcl procedures
|
||||
on the interpreter, since its state is partially deleted.
|
||||
All that trace procedures should do under these circumstances is
|
||||
to clean up and free their own internal data structures.
|
||||
.SH BUGS
|
||||
.PP
|
||||
Tcl does not do any error checking to prevent trace procedures
|
||||
from misusing the interpreter during traces with \fBTCL_INTERP_DESTROYED\fR
|
||||
set.
|
||||
.SH KEYWORDS
|
||||
clientData, trace, command
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Utf 3 "8.1" Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_UniChar, Tcl_UniCharCaseMatch, Tcl_UniCharNcasecmp, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings
|
||||
Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, 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 UTF-8 strings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -48,7 +48,7 @@ int
|
||||
int
|
||||
\fBTcl_UtfCharComplete\fR(\fIsrc, length\fR)
|
||||
.sp
|
||||
int
|
||||
int
|
||||
\fBTcl_NumUtfChars\fR(\fIsrc, length\fR)
|
||||
.sp
|
||||
const char *
|
||||
@@ -109,7 +109,7 @@ Pointer to the beginning of a UTF-8 string.
|
||||
.AP int index in
|
||||
The index of a character (not byte) in the UTF-8 string.
|
||||
.AP int *readPtr out
|
||||
If non-NULL, filled with the number of bytes in the backslash sequence,
|
||||
If non-NULL, filled with the number of bytes in the backslash sequence,
|
||||
including the backslash character.
|
||||
.AP char *dst out
|
||||
Buffer in which the bytes represented by the backslash sequence are stored.
|
||||
@@ -142,7 +142,7 @@ end and dereference non-existent or random memory; if the source buffer
|
||||
is known to be null-terminated, this will not happen. If the input is
|
||||
not in proper UTF-8 format, \fBTcl_UtfToUniChar\fR will store the first
|
||||
byte of \fIsrc\fR in \fI*chPtr\fR as a Tcl_UniChar between 0x0000 and
|
||||
0x00ff and return 1.
|
||||
0x00ff and return 1.
|
||||
.PP
|
||||
\fBTcl_UniCharToUtfDString\fR converts the given Unicode string
|
||||
to UTF-8, storing the result in a previously initialized \fBTcl_DString\fR.
|
||||
@@ -210,12 +210,12 @@ length is negative, all bytes up to the first null byte are used.
|
||||
\fBTcl_UtfFindFirst\fR corresponds to \fBstrchr\fR for UTF-8 strings. It
|
||||
returns a pointer to the first occurrence of the Tcl_UniChar \fIch\fR
|
||||
in the null-terminated UTF-8 string \fIsrc\fR. The null terminator is
|
||||
considered part of the UTF-8 string.
|
||||
considered part of the UTF-8 string.
|
||||
.PP
|
||||
\fBTcl_UtfFindLast\fR corresponds to \fBstrrchr\fR for UTF-8 strings. It
|
||||
returns a pointer to the last occurrence of the Tcl_UniChar \fIch\fR
|
||||
in the null-terminated UTF-8 string \fIsrc\fR. The null terminator is
|
||||
considered part of the UTF-8 string.
|
||||
considered part of the UTF-8 string.
|
||||
.PP
|
||||
Given \fIsrc\fR, a pointer to some location in a UTF-8 string,
|
||||
\fBTcl_UtfNext\fR returns a pointer to the next UTF-8 character in the
|
||||
@@ -239,7 +239,7 @@ characters. Behavior is undefined if a negative \fIindex\fR is given.
|
||||
.PP
|
||||
\fBTcl_UtfAtIndex\fR returns a pointer to the specified character (not
|
||||
byte) \fIindex\fR in the UTF-8 string \fIsrc\fR. The source string must
|
||||
contain at least \fIindex\fR characters. This is equivalent to calling
|
||||
contain at least \fIindex\fR characters. This is equivalent to calling
|
||||
\fBTcl_UtfNext\fR \fIindex\fR times. If a negative \fIindex\fR is given,
|
||||
the return pointer points to the first character in the source string.
|
||||
.PP
|
||||
|
||||
+13
-13
@@ -16,13 +16,13 @@ package require \fBTcl 8.5\fR
|
||||
.sp
|
||||
\fBclock format\fR \fItimeVal\fR ?\fI\-option value\fR...?
|
||||
.sp
|
||||
\fBclock microseconds\fR
|
||||
\fBclock microseconds\fR
|
||||
.sp
|
||||
\fBclock milliseconds\fR
|
||||
\fBclock milliseconds\fR
|
||||
.sp
|
||||
\fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...?
|
||||
.sp
|
||||
\fBclock seconds\fR
|
||||
\fBclock seconds\fR
|
||||
.sp
|
||||
.BE
|
||||
.SH "DESCRIPTION"
|
||||
@@ -58,10 +58,10 @@ Formats a time that is expressed as an integer number of seconds into a format
|
||||
intended for consumption by users or external programs.
|
||||
See \fBFORMATTING TIMES\fR for a full description.
|
||||
.TP
|
||||
\fBclock microseconds\fR
|
||||
\fBclock microseconds\fR
|
||||
Returns the current time as an integer number of microseconds. See \fBHIGH RESOLUTION TIMERS\fR for a full description.
|
||||
.TP
|
||||
\fBclock milliseconds\fR
|
||||
\fBclock milliseconds\fR
|
||||
Returns the current time as an integer number of milliseconds. See \fBHIGH RESOLUTION TIMERS\fR for a full description.
|
||||
.TP
|
||||
\fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...?
|
||||
@@ -69,7 +69,7 @@ Scans a time that is expressed as a character string and produces an
|
||||
integer number of seconds.
|
||||
See \fBSCANNING TIMES\fR for a full description.
|
||||
.TP
|
||||
\fBclock seconds\fR
|
||||
\fBclock seconds\fR
|
||||
Returns the current time as an integer number of seconds.
|
||||
.SS "PARAMETERS"
|
||||
.TP
|
||||
@@ -113,7 +113,7 @@ and their interpretation, are described under \fBFORMAT GROUPS\fR.
|
||||
On \fBclock format\fR, the default format is
|
||||
.PP
|
||||
.CS
|
||||
%a %b %d %H:%M:%S %z %Y
|
||||
%a %b %d %H:%M:%S %Z %Y
|
||||
.CE
|
||||
.PP
|
||||
On \fBclock scan\fR, the lack of a \fB\-format\fR option indicates that a
|
||||
@@ -525,7 +525,7 @@ string of the same meaning in the locale, to indicate whether \fB%Y\fR refers
|
||||
to years before or after Year 1 of the Common Era. On input, accepts
|
||||
the string \fBB.C.E.\fR, \fBB.C.\fR, \fBC.E.\fR, \fBA.D.\fR, or the
|
||||
abbreviation appropriate to the current locale, and uses it to fix
|
||||
whether \fB%Y\fR refers to years before or after Year 1 of the
|
||||
whether \fB%Y\fR refers to years before or after Year 1 of the
|
||||
Common Era.
|
||||
.TP
|
||||
\fB%Ex\fR
|
||||
@@ -684,8 +684,8 @@ ISO8601 week number.
|
||||
\fB%w\fR
|
||||
On output, produces the ordinal number of the day of the week
|
||||
(Sunday==0; Saturday==6). On input, accepts a single digit and
|
||||
interprets it as the day of the week; Sunday may be represented as
|
||||
either 0 or 7. Note that \fB%w\fR is not the ISO8601 weekday number,
|
||||
interprets it as the day of the week; Sunday may be represented as
|
||||
either 0 or 7. Note that \fB%w\fR is not the ISO8601 weekday number,
|
||||
which is produced and accepted by \fB%u\fR.
|
||||
.TP
|
||||
\fB%W\fR
|
||||
@@ -765,7 +765,7 @@ The local time zone from the Control Panel on Windows systems.
|
||||
The C library's idea of the local time zone, as defined by the
|
||||
\fBmktime\fR and \fBlocaltime\fR functions.
|
||||
.PP
|
||||
In case [1] \fIonly,\fR the string is tested to see if it is one
|
||||
In case [1] \fIonly,\fR the string is tested to see if it is one
|
||||
of the strings:
|
||||
.PP
|
||||
.CS
|
||||
@@ -783,7 +783,7 @@ of the strings:
|
||||
If it is a string in the above list, it designates a known
|
||||
time zone, and is interpreted as such.
|
||||
.PP
|
||||
For time zones in case [1] that do not match any of the above strings,
|
||||
For time zones in case [1] that do not match any of the above strings,
|
||||
and always for cases [2]-[6], the following rules apply.
|
||||
.PP
|
||||
If the time zone begins with a colon, it is one of a
|
||||
@@ -909,7 +909,7 @@ giving an explicit \fB\-format\fR option to the \fBclock scan\fR command.
|
||||
.TP
|
||||
\fIrelative time\fR
|
||||
A specification relative to the current time. The format is \fBnumber
|
||||
unit\fR. Acceptable units are \fByear\fR, \fBfortnight\fR,
|
||||
unit\fR. Acceptable units are \fByear\fR, \fBfortnight\fR,
|
||||
\fBmonth\fR, \fBweek\fR, \fBday\fR,
|
||||
\fBhour\fR, \fBminute\fR (or \fBmin\fR), and \fBsecond\fR (or \fBsec\fR). The
|
||||
unit can be specified as a singular or plural, as in \fB3 weeks\fR.
|
||||
|
||||
+1
-66
@@ -269,17 +269,13 @@ present, as is done when launching applications under wish. It is desirable
|
||||
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.
|
||||
.RE
|
||||
.TP
|
||||
\fBWindows NT\fR
|
||||
.
|
||||
.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, and
|
||||
\fB.bat\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:
|
||||
.RS
|
||||
.IP \(bu 3
|
||||
The directory from which the Tcl executable was loaded.
|
||||
.IP \(bu 3
|
||||
@@ -299,67 +295,6 @@ the caller must prepend the desired command with
|
||||
because built-in commands are not implemented using executables.
|
||||
.RE
|
||||
.TP
|
||||
\fBWindows 9x\fR
|
||||
.
|
||||
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, and
|
||||
\fB.bat\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:
|
||||
.RS
|
||||
.IP \(bu 3
|
||||
The directory from which the Tcl executable was loaded.
|
||||
.IP \(bu 3
|
||||
The current directory.
|
||||
.IP \(bu 3
|
||||
The Windows 9x system directory.
|
||||
.IP \(bu 3
|
||||
The Windows 9x home directory.
|
||||
.IP \(bu 3
|
||||
The directories listed in the path.
|
||||
.RE
|
||||
.RS
|
||||
.PP
|
||||
In order to execute shell built-in commands like \fBdir\fR and \fBcopy\fR,
|
||||
the caller must prepend the desired command with
|
||||
.QW "\fBcommand.com /c\0\fR"
|
||||
because built-in commands are not implemented using executables.
|
||||
.PP
|
||||
Once a 16-bit DOS application has read standard input from a console and
|
||||
then quit, all subsequently run 16-bit DOS applications will see the
|
||||
standard input as already closed. 32-bit applications do not have this
|
||||
problem and will run correctly, even after a 16-bit DOS application thinks
|
||||
that standard input is closed. There is no known workaround for this bug
|
||||
at this time.
|
||||
.PP
|
||||
Redirection between the \fBNUL:\fR device and a 16-bit application does not
|
||||
always work. When redirecting from \fBNUL:\fR, some applications may hang,
|
||||
others will get an infinite stream of
|
||||
.QW 0x01
|
||||
bytes, and some will actually
|
||||
correctly get an immediate end-of-file; the behavior seems to depend upon
|
||||
something compiled into the application itself. When redirecting greater than
|
||||
4K or so to \fBNUL:\fR, some applications will hang. The above problems do not
|
||||
happen with 32-bit applications.
|
||||
.PP
|
||||
All DOS 16-bit applications are run synchronously. All standard input from
|
||||
a pipe to a 16-bit DOS application is collected into a temporary file; the
|
||||
other end of the pipe must be closed before the 16-bit DOS application
|
||||
begins executing. All standard output or error from a 16-bit DOS
|
||||
application to a pipe is collected into temporary files; the application
|
||||
must terminate before the temporary files are redirected to the next stage
|
||||
of the pipeline. This is due to a workaround for a Windows 95 bug in the
|
||||
implementation of pipes, and is how the standard Windows 95 DOS shell
|
||||
handles pipes itself.
|
||||
.PP
|
||||
Certain applications, such as \fBcommand.com\fR, should not be executed
|
||||
interactively. Applications which directly access the console window,
|
||||
rather than reading from their standard input and writing to their standard
|
||||
output may fail, hang Tcl, or even hang the system if their own private
|
||||
console window is not available to them.
|
||||
.RE
|
||||
.TP
|
||||
\fBUnix\fR (including Mac OS X)
|
||||
.
|
||||
The \fBexec\fR command is fully functional and works as described.
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ proc main {} {
|
||||
|
||||
if {[catch {main} msg options]} {
|
||||
puts stderr "unexpected script error: $msg"
|
||||
if {[info exist env(DEBUG)]} {
|
||||
if {[info exists env(DEBUG)]} {
|
||||
puts stderr "---- BEGIN TRACE ----"
|
||||
puts stderr [dict get $options -errorinfo]
|
||||
puts stderr "---- END TRACE ----"
|
||||
|
||||
+3
-5
@@ -241,11 +241,9 @@ as relative to the cwd). Furthermore,
|
||||
paths are always expanded
|
||||
to absolute form. When creating links on filesystems that either do not
|
||||
support any links, or do not support the specific type requested, an
|
||||
error message will be returned. In particular Windows 95, 98 and ME do
|
||||
not support any links at present, but most Unix platforms support both
|
||||
symbolic and hard links (the latter for files only) and Windows
|
||||
NT/2000/XP (on NTFS drives) support symbolic
|
||||
directory links and hard file links.
|
||||
error message will be returned. Most Unix platforms support both
|
||||
symbolic and hard links (the latter for files only). Windows
|
||||
supports symbolic directory links and hard file links on NTFS drives.
|
||||
.RE
|
||||
.TP
|
||||
\fBfile lstat \fIname varName\fR
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH for n "" Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -49,7 +49,7 @@ each loop iteration), so changes in the variables will be visible.
|
||||
See below for an example:
|
||||
.SH EXAMPLES
|
||||
.PP
|
||||
Print a line for each of the integers from 0 to 10:
|
||||
Print a line for each of the integers from 0 to 9:
|
||||
.PP
|
||||
.CS
|
||||
\fBfor\fR {set x 0} {$x<10} {incr x} {
|
||||
|
||||
+1
-7
@@ -204,13 +204,7 @@ of the form
|
||||
it refers to the home
|
||||
directory of the user whose account information resides on the specified NT
|
||||
domain server. Otherwise, user account information is obtained from
|
||||
the local computer. On Windows 95 and 98, \fBglob\fR accepted patterns
|
||||
like
|
||||
.QW .../
|
||||
and
|
||||
.QW ..../
|
||||
for successively higher up parent directories, but later versions of
|
||||
Windows do not accept these forms.
|
||||
the local computer.
|
||||
.PP
|
||||
Since the backslash character has a special meaning to the glob
|
||||
command, glob patterns containing Windows style path separators need
|
||||
|
||||
+11
-9
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH library n "8.0" Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -19,7 +19,7 @@ auto_execok, auto_import, auto_load, auto_mkindex, auto_qualify, auto_reset, tcl
|
||||
\fBauto_qualify \fIcommand namespace\fR
|
||||
\fBauto_reset\fR
|
||||
\fBtcl_findLibrary \fIbasename version patch initScript enVarName varName\fR
|
||||
\fBparray \fIarrayName\fR
|
||||
\fBparray \fIarrayName\fR ?\fIpattern\fR?
|
||||
\fBtcl_endOfWord \fIstr start\fR
|
||||
\fBtcl_startOfNextWord \fIstr start\fR
|
||||
\fBtcl_startOfPreviousWord \fIstr start\fR
|
||||
@@ -139,7 +139,7 @@ as its first characters then it is assumed to be a procedure
|
||||
definition and the next word of the line is taken as the
|
||||
procedure's name.
|
||||
Procedure definitions that do not appear in this way (e.g.\ they
|
||||
have spaces before the \fBproc\fR) will not be indexed. If your
|
||||
have spaces before the \fBproc\fR) will not be indexed. If your
|
||||
script contains
|
||||
.QW dangerous
|
||||
code, such as global initialization
|
||||
@@ -178,7 +178,7 @@ performing the actual auto-loading of functions at runtime.
|
||||
This is a standard search procedure for use by extensions during
|
||||
their initialization. They call this procedure to look for their
|
||||
script library in several standard directories.
|
||||
The last component of the name of the library directory is
|
||||
The last component of the name of the library directory is
|
||||
normally \fIbasenameversion\fR
|
||||
(e.g., tk8.0), but it might be
|
||||
.QW library
|
||||
@@ -196,9 +196,11 @@ bin or bin/\fIarch\fR directory;
|
||||
relative to the executable file in the current build tree;
|
||||
relative to the executable file in a parallel build tree.
|
||||
.TP
|
||||
\fBparray \fIarrayName\fR
|
||||
Prints on standard output the names and values of all the elements
|
||||
in the array \fIarrayName\fR.
|
||||
\fBparray \fIarrayName\fR ?\fIpattern\fR?
|
||||
Prints on standard output the names and values of all the elements in the
|
||||
array \fIarrayName\fR, or just the names that match \fIpattern\fR (using the
|
||||
matching rules of \fBstring match\fR) and their values if \fIpattern\fR is
|
||||
given.
|
||||
\fIArrayName\fR must be an array accessible to the caller of \fBparray\fR.
|
||||
It may be either local or global.
|
||||
.TP
|
||||
@@ -283,7 +285,7 @@ a default value is used.
|
||||
.TP
|
||||
\fBenv(TCLLIBPATH)\fR
|
||||
If set, then it must contain a valid Tcl list giving directories to
|
||||
search during auto-load operations. Directories must be specified in
|
||||
search during auto-load operations. Directories must be specified in
|
||||
Tcl format, using
|
||||
.QW /
|
||||
as the path separator, regardless of platform.
|
||||
@@ -312,7 +314,7 @@ Unix, words are comprised of numbers, letters or underscores.
|
||||
.SH "SEE ALSO"
|
||||
env(n), info(n), re_syntax(n)
|
||||
.SH KEYWORDS
|
||||
auto-exec, auto-load, library, unknown, word, whitespace
|
||||
auto-exec, auto-load, library, unknown, word, whitespace
|
||||
'\"Local Variables:
|
||||
'\"mode: nroff
|
||||
'\"End:
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ by \fIfirst\fR must exist or \fIfirst\fR must indicate before the
|
||||
start of the list.
|
||||
.PP
|
||||
If \fIlast\fR is less than \fIfirst\fR, then any specified elements
|
||||
will be inserted into the list at the point specified by \fIfirst\fR
|
||||
will be inserted into the list before the point specified by \fIfirst\fR
|
||||
with no elements being deleted.
|
||||
.PP
|
||||
The \fIelement\fR arguments specify zero or more new arguments to
|
||||
|
||||
+286
-20
@@ -13,29 +13,43 @@ msgcat \- Tcl message catalog
|
||||
.SH SYNOPSIS
|
||||
\fBpackage require Tcl 8.5\fR
|
||||
.sp
|
||||
\fBpackage require msgcat 1.5\fR
|
||||
\fBpackage require msgcat 1.6\fR
|
||||
.sp
|
||||
\fB::msgcat::mc \fIsrc-string\fR ?\fIarg arg ...\fR?
|
||||
.sp
|
||||
\fB::msgcat::mcmax ?\fIsrc-string src-string ...\fR?
|
||||
.sp
|
||||
.VS "TIP 412"
|
||||
\fB::msgcat::mcexists\fR ?\fB-exactnamespace\fR? ?\fB-exactlocale\fR? \fIsrc-string\fR
|
||||
.VE "TIP 412"
|
||||
.sp
|
||||
\fB::msgcat::mclocale \fR?\fInewLocale\fR?
|
||||
.sp
|
||||
\fB::msgcat::mcpreferences\fR
|
||||
.sp
|
||||
.VS "TIP 412"
|
||||
\fB::msgcat::mcloadedlocales subcommand\fR ?\fIlocale\fR?
|
||||
.VE "TIP 412"
|
||||
.sp
|
||||
\fB::msgcat::mcload \fIdirname\fR
|
||||
.sp
|
||||
\fB::msgcat::mcset \fIlocale src-string \fR?\fItranslate-string\fR?
|
||||
.sp
|
||||
\fB::msgcat::mcmset \fIlocale src-trans-list\fR
|
||||
.sp
|
||||
.VS "TIP 404"
|
||||
\fB::msgcat::mcflset \fIsrc-string \fR?\fItranslate-string\fR?
|
||||
.sp
|
||||
\fB::msgcat::mcflmset \fIsrc-trans-list\fR
|
||||
.VE "TIP 404"
|
||||
.sp
|
||||
\fB::msgcat::mcunknown \fIlocale src-string\fR ?\fIarg arg ...\fR?
|
||||
.sp
|
||||
.VS "TIP 412"
|
||||
\fB::msgcat::mcpackagelocale subcommand\fR ?\fIlocale\fR?
|
||||
.sp
|
||||
\fB::msgcat::mcpackageconfig subcommand\fR \fIoption\fR ?\fIvalue\fR?
|
||||
.sp
|
||||
\fB::msgcat::mcforgetpackage\fR
|
||||
.VE "TIP 412"
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
@@ -46,18 +60,23 @@ Text strings are defined in a
|
||||
which is independent from the application, and
|
||||
which can be edited or localized without modifying
|
||||
the application source code. New languages
|
||||
or locales are provided by adding a new file to
|
||||
or locales may be provided by adding a new file to
|
||||
the message catalog.
|
||||
.PP
|
||||
Use of the message catalog is optional by any application
|
||||
or package, but is encouraged if the application or package
|
||||
wishes to be enabled for multi-lingual applications.
|
||||
\fBmsgcat\fR distinguises packages by its namespace.
|
||||
Each package has its own message catalog and configuration settings in \fBmsgcat\fR.
|
||||
.PP
|
||||
A \fIlocale\fR is a specification string describing a user language like \fBde_ch\fR for Swiss German.
|
||||
In \fBmsgcat\fR, there is a global locale initialized by the system locale of the current system.
|
||||
Each package may decide to use the global locale or to use a package specific locale.
|
||||
.PP
|
||||
The global locale may be changed on demand, for example by a user initiated language change or within a multi user application like a web server.
|
||||
.SH COMMANDS
|
||||
.TP
|
||||
\fB::msgcat::mc \fIsrc-string\fR ?\fIarg arg ...\fR?
|
||||
.
|
||||
Returns a translation of \fIsrc-string\fR according to the
|
||||
user's current locale. If additional arguments past \fIsrc-string\fR
|
||||
current locale. If additional arguments past \fIsrc-string\fR
|
||||
are given, the \fBformat\fR command is used to substitute the
|
||||
additional arguments in the translation of \fIsrc-string\fR.
|
||||
.RS
|
||||
@@ -84,6 +103,18 @@ of the longest translated string. This is useful when designing
|
||||
localized GUIs, which may require that all buttons, for example, be a
|
||||
fixed width (which will be the width of the widest button).
|
||||
.TP
|
||||
\fB::msgcat::mcexists\fR ?\fB-exactnamespace\fR? ?\fB-exactlocale\fR? \fIsrc-string\fR
|
||||
.
|
||||
.VS "TIP 412"
|
||||
Return true, if there is a translation for the given \fIsrc-string\fR.
|
||||
.PP
|
||||
.RS
|
||||
The search may be limited by the option \fB\-exactnamespace\fR to only check the current namespace and not any parent namespaces.
|
||||
.PP
|
||||
It may also be limited by the option \fB\-exactlocale\fR to only check the first prefered locale (e.g. first element returned by \fB::msgcat::mcpreferences\fR if global locale is used).
|
||||
.RE
|
||||
.VE "TIP 412"
|
||||
.TP
|
||||
\fB::msgcat::mclocale \fR?\fInewLocale\fR?
|
||||
.
|
||||
This function sets the locale to \fInewLocale\fR. If \fInewLocale\fR
|
||||
@@ -93,6 +124,13 @@ case-insensitive manner, and returns locales in lowercase.
|
||||
The initial locale is determined by the locale specified in
|
||||
the user's environment. See \fBLOCALE SPECIFICATION\fR
|
||||
below for a description of the locale string format.
|
||||
.RS
|
||||
.PP
|
||||
.VS "TIP 412"
|
||||
If the locale is set, the preference list of locales is evaluated.
|
||||
Locales in this list are loaded now, if not jet loaded.
|
||||
.VE "TIP 412"
|
||||
.RE
|
||||
.TP
|
||||
\fB::msgcat::mcpreferences\fR
|
||||
.
|
||||
@@ -103,13 +141,26 @@ preference. The list is derived from the current
|
||||
locale set in msgcat by \fB::msgcat::mclocale\fR, and
|
||||
cannot be set independently. For example, if the
|
||||
current locale is en_US_funky, then \fB::msgcat::mcpreferences\fR
|
||||
returns \fB{en_US_funky en_US en {}}\fR.
|
||||
returns \fB{en_us_funky en_us en {}}\fR.
|
||||
.TP
|
||||
\fB::msgcat:mcloadedlocales subcommand\fR ?\fIlocale\fR?
|
||||
.
|
||||
This group of commands manage the list of loaded locales for packages not setting a package locale.
|
||||
.PP
|
||||
.RS
|
||||
The subcommand \fBget\fR returns the list of currently loaded locales.
|
||||
.PP
|
||||
The subcommand \fBpresent\fR requires the argument \fIlocale\fR and returns true, if this locale is loaded.
|
||||
.PP
|
||||
The subcommand \fBclear\fR removes all locales and their data, which are not in the current preference list.
|
||||
.RE
|
||||
.TP
|
||||
\fB::msgcat::mcload \fIdirname\fR
|
||||
.
|
||||
.VS "TIP 412"
|
||||
Searches the specified directory for files that match
|
||||
the language specifications returned by \fB::msgcat::mcpreferences\fR
|
||||
(note that these are all lowercase), extended by the file extension
|
||||
the language specifications returned by \fB::msgcat::mcloadedlocales get\fR
|
||||
(or \fBmsgcat::mcpackagelocale preferences\fR if a package locale is set) (note that these are all lowercase), extended by the file extension
|
||||
.QW .msg .
|
||||
Each matching file is
|
||||
read in order, assuming a UTF-8 encoding. The file contents are
|
||||
@@ -118,6 +169,11 @@ may be present in the message file either directly in their UTF-8
|
||||
encoded form, or by use of the backslash-u quoting recognized by Tcl
|
||||
evaluation. The number of message files which matched the specification
|
||||
and were loaded is returned.
|
||||
.RS
|
||||
.PP
|
||||
In addition, the given folder is stored in the \fBmsgcat\fR package configuration option \fImcfolder\fR to eventually load message catalog files required by a locale change.
|
||||
.VE "TIP 412"
|
||||
.RE
|
||||
.TP
|
||||
\fB::msgcat::mcset \fIlocale src-string \fR?\fItranslate-string\fR?
|
||||
.
|
||||
@@ -138,16 +194,13 @@ faster than multiple invocations of \fB::msgcat::mcset\fR. The function
|
||||
returns the number of translations set.
|
||||
.TP
|
||||
\fB::msgcat::mcflset \fIsrc-string \fR?\fItranslate-string\fR?
|
||||
.VS "TIP 404"
|
||||
Sets the translation for \fIsrc-string\fR to \fItranslate-string\fR in the
|
||||
current namespace for the locale implied by the name of the message catalog
|
||||
being loaded via \fB::msgcat::mcload\fR. If \fItranslate-string\fR is not
|
||||
specified, \fIsrc-string\fR is used for both. The function returns
|
||||
\fItranslate-string\fR.
|
||||
.VE "TIP 404"
|
||||
.TP
|
||||
\fB::msgcat::mcflmset \fIsrc-trans-list\fR
|
||||
.VS "TIP 404"
|
||||
Sets the translation for multiple source strings in \fIsrc-trans-list\fR in
|
||||
the current namespace for the locale implied by the name of the message
|
||||
catalog being loaded via \fB::msgcat::mcload\fR. \fIsrc-trans-list\fR must
|
||||
@@ -155,7 +208,6 @@ have an even number of elements and is in the form {\fIsrc-string
|
||||
translate-string\fR ?\fIsrc-string translate-string ...\fR?}
|
||||
\fB::msgcat::mcflmset\fR can be significantly faster than multiple invocations
|
||||
of \fB::msgcat::mcflset\fR. The function returns the number of translations set.
|
||||
.VE "TIP 404"
|
||||
.TP
|
||||
\fB::msgcat::mcunknown \fIlocale src-string\fR ?\fIarg arg ...\fR?
|
||||
.
|
||||
@@ -168,7 +220,18 @@ application, for example to log error messages for each unknown
|
||||
string. The \fB::msgcat::mcunknown\fR procedure is invoked at the
|
||||
same stack context as the call to \fB::msgcat::mc\fR. The return value
|
||||
of \fB::msgcat::mcunknown\fR is used as the return value for the call
|
||||
to \fB::msgcat::mc\fR.
|
||||
to \fB::msgcat::mc\fR.
|
||||
.VS "TIP 412"
|
||||
.RS
|
||||
.PP
|
||||
Note that this routine is only called if the concerned package did not set a package locale unknown command name.
|
||||
.RE
|
||||
.TP
|
||||
\fB::msgcat::mcforgetpackage\fR
|
||||
.
|
||||
The calling package clears all its state within the \fBmsgcat\fR package including all settings and translations.
|
||||
.VE "TIP 412"
|
||||
.PP
|
||||
.SH "LOCALE SPECIFICATION"
|
||||
.PP
|
||||
The locale is specified to \fBmsgcat\fR by a locale string
|
||||
@@ -217,15 +280,15 @@ When a locale is specified by the user, a
|
||||
search is performed during string translation. For example, if a user
|
||||
specifies
|
||||
en_GB_Funky, the locales
|
||||
.QW en_GB_Funky ,
|
||||
.QW en_GB ,
|
||||
.QW en_gb_funky ,
|
||||
.QW en_gb ,
|
||||
.QW en
|
||||
and
|
||||
.MT
|
||||
(the empty string)
|
||||
are searched in order until a matching translation
|
||||
string is found. If no translation string is available, then
|
||||
\fB::msgcat::mcunknown\fR is called.
|
||||
the unknown handler is called.
|
||||
.SH "NAMESPACES AND MESSAGE CATALOGS"
|
||||
.PP
|
||||
Strings stored in the message catalog are stored relative
|
||||
@@ -321,7 +384,7 @@ the package. For example, a short \fBes.msg\fR might contain:
|
||||
.PP
|
||||
.CS
|
||||
namespace eval ::mypackage {
|
||||
\fB::msgcat::mcflset\fR "Free Beer!" "Cerveza Gracias!"
|
||||
\fB::msgcat::mcflset\fR "Free Beer" "Cerveza Gratis"
|
||||
}
|
||||
.CE
|
||||
.SH "RECOMMENDED MESSAGE SETUP FOR PACKAGES"
|
||||
@@ -373,6 +436,209 @@ formatting substitution is done directly.
|
||||
# ... where that key is mapped to one of the
|
||||
# human-oriented versions by \fBmsgcat::mcset\fR
|
||||
.CE
|
||||
.VS "TIP 412"
|
||||
.SH Package private locale
|
||||
.PP
|
||||
A package using \fBmsgcat\fR may choose to use its own package private
|
||||
locale and its own set of loaded locales, independent to the global
|
||||
locale set by \fB::msgcat::mclocale\fR.
|
||||
.PP
|
||||
This allows a package to change its locale without causing any locales load or removal in other packages and not to invoke the global locale change callback (see below).
|
||||
.PP
|
||||
This action is controled by the following ensemble:
|
||||
.TP
|
||||
\fB::msgcat::mcpackagelocale set\fR ?\fIlocale\fR?
|
||||
.
|
||||
Set or change a package private locale.
|
||||
The package private locale is set to the given \fIlocale\fR if the \fIlocale\fR is given.
|
||||
If the option \fIlocale\fR is not given, the package is set to package private locale mode, but no locale is changed (e.g. if the global locale was valid for the package before, it is copied to the package private locale).
|
||||
.PP
|
||||
.RS
|
||||
This command may cause the load of locales.
|
||||
.RE
|
||||
.TP
|
||||
\fB::msgcat::mcpackagelocale get\fR
|
||||
.
|
||||
Return the package private locale or the global locale, if no package private locale is set.
|
||||
.TP
|
||||
\fB::msgcat::mcpackagelocale preferences\fR
|
||||
.
|
||||
Return the package private preferences or the global preferences,
|
||||
if no package private locale is set.
|
||||
.TP
|
||||
\fB::msgcat::mcpackagelocale loaded\fR
|
||||
.
|
||||
Return the list of locales loaded for this package.
|
||||
.TP
|
||||
\fB::msgcat::mcpackagelocale isset\fR
|
||||
.
|
||||
Returns true, if a package private locale is set.
|
||||
.TP
|
||||
\fB::msgcat::mcpackagelocale unset\fR
|
||||
.
|
||||
Unset the package private locale and use the globale locale.
|
||||
Load and remove locales to adjust the list of loaded locales for the
|
||||
package to the global loaded locales list.
|
||||
.TP
|
||||
\fB::msgcat::mcpackagelocale present\fR \fIlocale\fR
|
||||
.
|
||||
Returns true, if the given locale is loaded for the package.
|
||||
.TP
|
||||
\fB::msgcat::mcpackagelocale clear\fR
|
||||
.
|
||||
Clear any loaded locales of the package not present in the package preferences.
|
||||
.PP
|
||||
.SH Changing package options
|
||||
.PP
|
||||
Each package using msgcat has a set of options within \fBmsgcat\fR.
|
||||
The package options are described in the next sectionPackage options.
|
||||
Each package option may be set or unset individually using the following ensemble:
|
||||
.TP
|
||||
\fB::msgcat::mcpackageconfig get\fR \fIoption\fR
|
||||
.
|
||||
Return the current value of the given \fIoption\fR.
|
||||
This call returns an error if the option is not set for the package.
|
||||
.TP
|
||||
\fB::msgcat::mcpackageconfig isset\fR \fIoption\fR
|
||||
.
|
||||
Returns 1, if the given \fIoption\fR is set for the package, 0 otherwise.
|
||||
.TP
|
||||
\fB::msgcat::mcpackageconfig set\fR \fIoption\fR \fIvalue\fR
|
||||
.
|
||||
Set the given \fIoption\fR to the given \fIvalue\fR.
|
||||
This may invoke additional actions in dependency of the \fIoption\fR.
|
||||
The return value is 0 or the number of loaded packages for the option \fBmcfolder\fR.
|
||||
.TP
|
||||
\fB::msgcat::mcpackageconfig unset\fR \fIoption\fR
|
||||
.
|
||||
Unsets the given \fIoption\fR for the package.
|
||||
No action is taken if the \fIoption\fR is not set for the package.
|
||||
The empty string is returned.
|
||||
.SS Package options
|
||||
.PP
|
||||
The following package options are available for each package:
|
||||
.TP
|
||||
\fBmcfolder\fR
|
||||
.
|
||||
This is the message folder of the package. This option is set by mcload and by the subcommand set. Both are identical and both return the number of loaded message catalog files.
|
||||
.RS
|
||||
.PP
|
||||
Setting or changing this value will load all locales contained in the preferences valid for the package. This implies also to invoke any set loadcmd (see below).
|
||||
.PP
|
||||
Unsetting this value will disable message file load for the package.
|
||||
.RE
|
||||
.TP
|
||||
\fBloadcmd\fR
|
||||
.
|
||||
This callback is invoked before a set of message catalog files are loaded for the package which has this property set.
|
||||
.PP
|
||||
.RS
|
||||
This callback may be used to do any preparation work for message file load or to get the message data from another source like a data base. In this case, no message files are used (mcfolder is unset).
|
||||
.PP
|
||||
See section \fBcallback invocation\fR below.
|
||||
The parameter list appended to this callback is the list of locales to load.
|
||||
.PP
|
||||
If this callback is changed, it is called with the preferences valid for the package.
|
||||
.RE
|
||||
.TP
|
||||
\fBchangecmd\fR
|
||||
.
|
||||
This callback is invoked when a default local change was performed. Its purpose is to allow a package to update any dependency on the default locale like showing the GUI in another language.
|
||||
.PP
|
||||
.RS
|
||||
See the callback invocation section below.
|
||||
The parameter list appended to this callback is \fBmcpreferences\fR.
|
||||
The registered callbacks are invoked in no particular order.
|
||||
.RE
|
||||
.TP
|
||||
\fBunknowncmd\fR
|
||||
.
|
||||
Use a package locale mcunknown procedure instead of the standard version supplied by the msgcat package (msgcat::mcunknown).
|
||||
.PP
|
||||
.RS
|
||||
The called procedure must return the formatted message which will finally be returned by msgcat::mc.
|
||||
.PP
|
||||
A generic unknown handler is used if set to the empty string. This consists in returning the key if no arguments are given. With given arguments, format is used to process the arguments.
|
||||
.PP
|
||||
See section \fBcallback invocation\fR below.
|
||||
The appended arguments are identical to \fB::msgcat::mcunknown\fR.
|
||||
.RE
|
||||
.SS Callback invocation
|
||||
A package may decide to register one or multiple callbacks, as described above.
|
||||
.PP
|
||||
Callbacks are invoked, if:
|
||||
.PP
|
||||
1. the callback command is set,
|
||||
.PP
|
||||
2. the command is not the empty string,
|
||||
.PP
|
||||
3. the registering namespace exists.
|
||||
.PP
|
||||
If a called routine fails with an error, the \fBbgerror\fR routine for the interpreter is invoked after command completion.
|
||||
Only exception is the callback \fBunknowncmd\fR, where an error causes the invoking \fBmc\fR-command to fail with that error.
|
||||
.PP
|
||||
.SS Examples
|
||||
Packages which display a GUI may update their widgets when the global locale changes.
|
||||
To register to a callback, use:
|
||||
.CS
|
||||
namespace eval gui {
|
||||
msgcat::mcpackageconfig changecmd updateGUI
|
||||
|
||||
proc updateGui args {
|
||||
puts "New locale is '[lindex $args 0]'."
|
||||
}
|
||||
}
|
||||
% msgcat::mclocale fr
|
||||
fr
|
||||
% New locale is 'fr'.
|
||||
.CE
|
||||
.PP
|
||||
If locales (or additional locales) are contained in another source like a data base, a package may use the load callback and not mcload:
|
||||
.CS
|
||||
namespace eval db {
|
||||
msgcat::mcpackageconfig loadcmd loadMessages
|
||||
|
||||
proc loadMessages args {
|
||||
foreach locale $args {
|
||||
if {[LocaleInDB $locale]} {
|
||||
msgcat::mcmset $locale [GetLocaleList $locale]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.CE
|
||||
.PP
|
||||
The \fBclock\fR command implementation uses \fBmsgcat\fR with a package locale to implement the command line parameter \fB-locale\fR.
|
||||
Here are some sketches of the implementation:
|
||||
.PP
|
||||
First, a package locale is initialized and the generic unknown function is desactivated:
|
||||
.CS
|
||||
msgcat::mcpackagelocale set
|
||||
msgcat::mcpackageconfig unknowncmd ""
|
||||
.CE
|
||||
As an example, the user requires the week day in a certain locale as follows:
|
||||
.CS
|
||||
clock format clock seconds -format %A -locale fr
|
||||
.CE
|
||||
\fBclock\fR sets the package locale to \fBfr\fR and looks for the day name as follows:
|
||||
.CS
|
||||
msgcat::mcpackagelocale set $locale
|
||||
return [lindex [msgcat::mc DAYS_OF_WEEK_FULL] $day]
|
||||
### Returns "mercredi"
|
||||
.CE
|
||||
Within \fBclock\fR, some message-catalog items are heavy in computation and thus are dynamically cached using:
|
||||
.CS
|
||||
proc ::tcl::clock::LocalizeFormat { locale format } {
|
||||
set key FORMAT_$format
|
||||
if { [::msgcat::mcexists -exactlocale -exactnamespace $key] } {
|
||||
return [mc $key]
|
||||
}
|
||||
#...expensive computation of format clipped...
|
||||
mcset $locale $key $format
|
||||
return $format
|
||||
}
|
||||
.CE
|
||||
.VE "TIP 412"
|
||||
.SH CREDITS
|
||||
.PP
|
||||
The message catalog code was developed by Mark Harrison.
|
||||
|
||||
@@ -37,7 +37,7 @@ the \fBoo::object\fR class, which is not publicly visible by default:
|
||||
oo::class create c {
|
||||
method count {} {
|
||||
\fBmy\fR variable counter
|
||||
print [incr counter]
|
||||
puts [incr counter]
|
||||
}
|
||||
}
|
||||
c create o
|
||||
|
||||
+7
-5
@@ -96,9 +96,11 @@ forward to the proper implementation of the method (which it does by invoking
|
||||
the \fBnext\fR command as filters are inserted into the front of the method
|
||||
call chain) and is responsible for returning the result of \fBnext\fR.
|
||||
.PP
|
||||
Filters are not invoked when processing an invocation of the \fBunknown\fR
|
||||
method because of a failure to locate a method implementation, or when
|
||||
invoking either constructors or destructors.
|
||||
Filters are invoked when processing an invokation of the \fBunknown\fR
|
||||
method because of a failure to locate a method implementation, but \fInot\fR
|
||||
when invoking either constructors or destructors. (Note however that the
|
||||
\fBdestroy\fR method is a conventional method, and filters are invoked as
|
||||
normal when it is called.)
|
||||
.SH EXAMPLES
|
||||
.PP
|
||||
This example demonstrates how to use the \fBnext\fR command to call the
|
||||
@@ -120,7 +122,7 @@ oo::class create theSubclass {
|
||||
}
|
||||
}
|
||||
theSubclass create obj
|
||||
oo::define obj method example args {
|
||||
oo::objdefine obj method example args {
|
||||
puts "per-object method, args = $args"
|
||||
\fBnext\fR x {*}$args y
|
||||
\fBnext\fR
|
||||
@@ -174,7 +176,7 @@ oo::class create cache {
|
||||
}
|
||||
|
||||
oo::object create demo
|
||||
oo::define demo {
|
||||
oo::objdefine demo {
|
||||
mixin cache
|
||||
method compute {a b c} {
|
||||
after 3000 \fI;# Simulate deep thought\fR
|
||||
|
||||
+13
-48
@@ -361,63 +361,28 @@ may cause this error.
|
||||
A BREAK condition has been detected by your UART (see above).
|
||||
.SH "PORTABILITY ISSUES"
|
||||
.TP
|
||||
\fBWindows \fR(all versions)
|
||||
\fBWindows \fR
|
||||
.
|
||||
Valid values for \fIfileName\fR to open a serial port are of the form
|
||||
\fBcom\fIX\fB:\fR, where \fIX\fR is a number, generally from 1 to 4.
|
||||
This notation only works for serial ports from 1 to 9, if the system
|
||||
happens to have more than four. An attempt to open a serial port that
|
||||
\fBcom\fIX\fB\fR, where \fIX\fR is a number, generally from 1 to 9.
|
||||
A legacy form accepted as well is \fBcom\fIX\fB:\fR. This notation only
|
||||
works for serial ports from 1 to 9. An attempt to open a serial port that
|
||||
does not exist or has a number greater than 9 will fail. An alternate
|
||||
form of opening serial ports is to use the filename \fB\e\e.\ecomX\fR,
|
||||
where X is any number that corresponds to a serial port; please note
|
||||
that this method is considerably slower on Windows 95 and Windows 98.
|
||||
.TP
|
||||
\fBWindows NT\fR
|
||||
.
|
||||
form of opening serial ports is to use the filename \fB//./comX\fR,
|
||||
where X is any number that corresponds to a serial port.
|
||||
.PP
|
||||
.RS
|
||||
When running Tcl interactively, there may be some strange interactions
|
||||
between the real console, if one is present, and a command pipeline that uses
|
||||
standard input or output. If a command pipeline is opened for reading, some
|
||||
of the lines entered at the console will be sent to the command pipeline and
|
||||
some will be sent to the Tcl evaluator. If a command pipeline is opened for
|
||||
writing, keystrokes entered into the console are not visible until the
|
||||
pipe is closed. This behavior occurs whether the command pipeline is
|
||||
executing 16-bit or 32-bit applications. These problems only occur because
|
||||
both Tcl and the child application are competing for the console at
|
||||
the same time. If the command pipeline is started from a script, so that Tcl
|
||||
is not accessing the console, or if the command pipeline does not use
|
||||
standard input or output, but is redirected from or to a file, then the
|
||||
above problems do not occur.
|
||||
.TP
|
||||
\fBWindows 95\fR
|
||||
.
|
||||
A command pipeline that executes a 16-bit DOS application cannot be opened
|
||||
for both reading and writing, since 16-bit DOS applications that receive
|
||||
standard input from a pipe and send standard output to a pipe run
|
||||
synchronously. Command pipelines that do not execute 16-bit DOS
|
||||
applications run asynchronously and can be opened for both reading and
|
||||
writing.
|
||||
.RS
|
||||
.PP
|
||||
When running Tcl interactively, there may be some strange interactions
|
||||
between the real console, if one is present, and a command pipeline that uses
|
||||
standard input or output. If a command pipeline is opened for reading from
|
||||
a 32-bit application, some of the keystrokes entered at the console will be
|
||||
sent to the command pipeline and some will be sent to the Tcl evaluator. If
|
||||
a command pipeline is opened for writing to a 32-bit application, no output
|
||||
is visible on the console until the pipe is closed. These problems only
|
||||
occur because both Tcl and the child application are competing for the
|
||||
console at the same time. If the command pipeline is started from a script,
|
||||
so that Tcl is not accessing the console, or if the command pipeline does
|
||||
not use standard input or output, but is redirected from or to a file, then
|
||||
the above problems do not occur.
|
||||
.PP
|
||||
Whether or not Tcl is running interactively, if a command pipeline is opened
|
||||
for reading from a 16-bit DOS application, the call to \fBopen\fR will not
|
||||
return until end-of-file has been received from the command pipeline's
|
||||
standard output. If a command pipeline is opened for writing to a 16-bit DOS
|
||||
application, no data will be sent to the command pipeline's standard output
|
||||
until the pipe is actually closed. This problem occurs because 16-bit DOS
|
||||
applications are run synchronously, as described above.
|
||||
pipe is closed. These problems only occur because both Tcl and the child
|
||||
application are competing for the console at the same time. If the command
|
||||
pipeline is started from a script, so that Tcl is not accessing the console,
|
||||
or if the command pipeline does not use standard input or output, but is
|
||||
redirected from or to a file, then the above problems do not occur.
|
||||
.RE
|
||||
.TP
|
||||
\fBUnix\fR\0\0\0\0\0\0\0
|
||||
|
||||
+25
-1
@@ -683,9 +683,33 @@ earlier in the RE taking priority over ones starting later. Note that
|
||||
outer subexpressions thus take priority over their component
|
||||
subexpressions.
|
||||
.PP
|
||||
Note that the quantifiers \fB{1,1}\fR and \fB{1,1}?\fR can be used to
|
||||
The quantifiers \fB{1,1}\fR and \fB{1,1}?\fR can be used to
|
||||
force longest and shortest preference, respectively, on a
|
||||
subexpression or a whole RE.
|
||||
.RS
|
||||
.PP
|
||||
\fBNOTE:\fR This means that you can usually make a RE be non-greedy overall by
|
||||
putting \fB{1,1}?\fR after one of the first non-constraint atoms or
|
||||
parenthesized sub-expressions in it. \fIIt pays to experiment\fR with the
|
||||
placing of this non-greediness override on a suitable range of input texts
|
||||
when you are writing a RE if you are using this level of complexity.
|
||||
.PP
|
||||
For example, this regular expression is non-greedy, and will match the
|
||||
shortest substring possible given that
|
||||
.QW \fBabc\fR
|
||||
will be matched as early as possible (the quantifier does not change that):
|
||||
.PP
|
||||
.CS
|
||||
ab{1,1}?c.*x.*cba
|
||||
.CE
|
||||
.PP
|
||||
The atom
|
||||
.QW \fBa\fR
|
||||
has no greediness preference, we explicitly give one for
|
||||
.QW \fBb\fR ,
|
||||
and the remaining quantifiers are overridden to be non-greedy by the preceding
|
||||
non-greedy quantifier.
|
||||
.RE
|
||||
.PP
|
||||
Match lengths are measured in characters, not collating elements. An
|
||||
empty string is considered longer than no match at all. For example,
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ the \fB(?x)\fR embedded option (see the \fBre_syntax\fR manual page).
|
||||
.TP 15
|
||||
\fB\-indices\fR
|
||||
.
|
||||
Changes what is stored in the \fIsubMatchVar\fRs.
|
||||
Changes what is stored in the \fImatchVar\fR and \fIsubMatchVar\fRs.
|
||||
Instead of storing the matching characters from \fIstring\fR,
|
||||
each variable
|
||||
will contain a list of two decimal strings giving the indices
|
||||
|
||||
@@ -97,6 +97,10 @@ writable channel event on the socket to get notified when the
|
||||
asynchronous connection has succeeded or failed. See the \fBvwait\fR
|
||||
and the \fBchan\fR commands for more details on the event loop and
|
||||
channel events.
|
||||
.PP
|
||||
The \fBchan configure\fR option \fB-connecting\fR may be used to check if the connect is still running. To verify a successful connect, the option \fB-error\fR may be checked when \fB-connecting\fR returned 0.
|
||||
.PP
|
||||
Operation without the event queue requires at the moment calls to \fBchan configure\fR to advance the internal state machine.
|
||||
.RE
|
||||
.SH "SERVER SOCKETS"
|
||||
.PP
|
||||
@@ -186,6 +190,10 @@ sockets, this option returns a list of three elements; these are the
|
||||
address, the host name and the port to which the peer socket is connected
|
||||
or bound. If the host name cannot be computed, the second element of the
|
||||
list is identical to the address, its first element.
|
||||
.TP
|
||||
\fB\-connecting\fR
|
||||
.
|
||||
This option is not supported by server sockets. For client sockets, this option returns 1 if an asyncroneous connect is still in progress, 0 otherwise.
|
||||
.PP
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
|
||||
@@ -43,6 +43,8 @@ or
|
||||
which will be safely substituted by the Tcl interpreter into
|
||||
.QW ^Z .
|
||||
.PP
|
||||
A leading BOM (Byte order mark) contained in the file is ignored for unicode encodings (utf-8, unicode).
|
||||
.PP
|
||||
The \fB\-encoding\fR option is used to specify the encoding of
|
||||
the data stored in \fIfileName\fR. When the \fB\-encoding\fR option
|
||||
is omitted, the system encoding is assumed.
|
||||
|
||||
@@ -642,14 +642,6 @@ This test can only be run on any Windows platform.
|
||||
.
|
||||
This test can only be run on any Windows NT platform.
|
||||
.TP
|
||||
\fI95\fR
|
||||
.
|
||||
This test can only be run on any Windows 95 platform.
|
||||
.TP
|
||||
\fI98\fR
|
||||
.
|
||||
This test can only be run on any Windows 98 platform.
|
||||
.TP
|
||||
\fImac\fR
|
||||
.
|
||||
This test can only be run on any Mac platform.
|
||||
|
||||
+7
-7
@@ -299,6 +299,11 @@ so extension writers can specify which package to load depending on the
|
||||
C run-time library that is in use. This is not an indication that this core
|
||||
contains symbols.
|
||||
.TP
|
||||
\fBengine\fR
|
||||
.
|
||||
The name of the Tcl language implementation. When the interpreter is first
|
||||
created, this is always set to the string \fBTcl\fR.
|
||||
.TP
|
||||
\fBmachine\fR
|
||||
.
|
||||
The instruction set executed by this machine, such as
|
||||
@@ -308,18 +313,13 @@ is the value returned by \fBuname -m\fR.
|
||||
\fBos\fR
|
||||
.
|
||||
The name of the operating system running on this machine,
|
||||
such as \fBWindows 95\fR, \fBWindows NT\fR, or \fBSunOS\fR.
|
||||
such as \fBWindows NT\fR or \fBSunOS\fR.
|
||||
On UNIX machines, this is the value returned by \fBuname -s\fR.
|
||||
On Windows 95 and Windows 98, the value returned will be \fBWindows
|
||||
95\fR to provide better backwards compatibility to Windows 95; to
|
||||
distinguish between the two, check the \fBosVersion\fR.
|
||||
.TP
|
||||
\fBosVersion\fR
|
||||
.
|
||||
The version number for the operating system running on this machine.
|
||||
On UNIX machines, this is the value returned by \fBuname -r\fR. On
|
||||
Windows 95, the version will be 4.0; on Windows 98, the version will
|
||||
be 4.10.
|
||||
On UNIX machines, this is the value returned by \fBuname -r\fR.
|
||||
.TP
|
||||
\fBpathSeparator\fR
|
||||
.VS 8.6
|
||||
|
||||
@@ -259,7 +259,7 @@ newcolor(
|
||||
return COLORLESS; /* too many colors */
|
||||
}
|
||||
n = cm->ncds * 2;
|
||||
if (n < MAX_COLOR + 1) {
|
||||
if (n > MAX_COLOR + 1) {
|
||||
n = MAX_COLOR + 1;
|
||||
}
|
||||
if (cm->cd == cm->cdspace) {
|
||||
@@ -777,18 +777,19 @@ dumpcolors(
|
||||
}
|
||||
|
||||
/*
|
||||
* It's hard to do this more efficiently.
|
||||
* Unfortunately, it's hard to do this next bit more efficiently.
|
||||
*
|
||||
* Spencer's original coding has the loop iterating from CHR_MIN
|
||||
* to CHR_MAX, but that's utterly unusable for 32-bit chr, or
|
||||
* even 16-bit. For debugging purposes it seems fine to print
|
||||
* only chr codes up to 1000 or so.
|
||||
*/
|
||||
|
||||
for (c=CHR_MIN ; c<CHR_MAX ; c++) {
|
||||
for (c=CHR_MIN ; c<1000 ; c++) {
|
||||
if (GETCOLOR(cm, c) == co) {
|
||||
dumpchr(c, f);
|
||||
}
|
||||
}
|
||||
assert(c == CHR_MAX);
|
||||
if (GETCOLOR(cm, c) == co) {
|
||||
dumpchr(c, f);
|
||||
}
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ addchr(
|
||||
struct cvec *cv, /* character vector */
|
||||
pchr c) /* character to add */
|
||||
{
|
||||
assert(cv->nchrs < cv->chrspace);
|
||||
cv->chrs[cv->nchrs++] = (chr)c;
|
||||
}
|
||||
|
||||
|
||||
@@ -1138,24 +1138,6 @@ newline(void)
|
||||
return CHR('\n');
|
||||
}
|
||||
|
||||
/*
|
||||
- ch - return the chr sequence for regc_locale.c's fake collating element ch
|
||||
* This helps confine use of CHR to this source file. Beware that the caller
|
||||
* knows how long the sequence is.
|
||||
^ #ifdef REG_DEBUG
|
||||
^ static const chr *ch(NOPARMS);
|
||||
^ #endif
|
||||
*/
|
||||
#ifdef REG_DEBUG
|
||||
static const chr *
|
||||
ch(void)
|
||||
{
|
||||
static const chr chstr[] = { CHR('c'), CHR('h'), CHR('\0') };
|
||||
|
||||
return chstr;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
- chrnamed - return the chr known by a given (chr string) name
|
||||
* The code is a bit clumsy, but this routine gets only such specialized
|
||||
|
||||
+255
-242
@@ -140,7 +140,7 @@ static const crange alphaRangeTable[] = {
|
||||
{0x3f7, 0x481}, {0x48a, 0x52f}, {0x531, 0x556}, {0x561, 0x587},
|
||||
{0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x620, 0x64a}, {0x671, 0x6d3},
|
||||
{0x6fa, 0x6fc}, {0x712, 0x72f}, {0x74d, 0x7a5}, {0x7ca, 0x7ea},
|
||||
{0x800, 0x815}, {0x840, 0x858}, {0x8a0, 0x8b2}, {0x904, 0x939},
|
||||
{0x800, 0x815}, {0x840, 0x858}, {0x8a0, 0x8b4}, {0x904, 0x939},
|
||||
{0x958, 0x961}, {0x971, 0x980}, {0x985, 0x98c}, {0x993, 0x9a8},
|
||||
{0x9aa, 0x9b0}, {0x9b6, 0x9b9}, {0x9df, 0x9e1}, {0xa05, 0xa0a},
|
||||
{0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa59, 0xa5c}, {0xa72, 0xa74},
|
||||
@@ -148,55 +148,58 @@ static const crange alphaRangeTable[] = {
|
||||
{0xab5, 0xab9}, {0xb05, 0xb0c}, {0xb13, 0xb28}, {0xb2a, 0xb30},
|
||||
{0xb35, 0xb39}, {0xb5f, 0xb61}, {0xb85, 0xb8a}, {0xb8e, 0xb90},
|
||||
{0xb92, 0xb95}, {0xba8, 0xbaa}, {0xbae, 0xbb9}, {0xc05, 0xc0c},
|
||||
{0xc0e, 0xc10}, {0xc12, 0xc28}, {0xc2a, 0xc39}, {0xc85, 0xc8c},
|
||||
{0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9},
|
||||
{0xd05, 0xd0c}, {0xd0e, 0xd10}, {0xd12, 0xd3a}, {0xd7a, 0xd7f},
|
||||
{0xd85, 0xd96}, {0xd9a, 0xdb1}, {0xdb3, 0xdbb}, {0xdc0, 0xdc6},
|
||||
{0xe01, 0xe30}, {0xe40, 0xe46}, {0xe94, 0xe97}, {0xe99, 0xe9f},
|
||||
{0xea1, 0xea3}, {0xead, 0xeb0}, {0xec0, 0xec4}, {0xedc, 0xedf},
|
||||
{0xf40, 0xf47}, {0xf49, 0xf6c}, {0xf88, 0xf8c}, {0x1000, 0x102a},
|
||||
{0x1050, 0x1055}, {0x105a, 0x105d}, {0x106e, 0x1070}, {0x1075, 0x1081},
|
||||
{0x10a0, 0x10c5}, {0x10d0, 0x10fa}, {0x10fc, 0x1248}, {0x124a, 0x124d},
|
||||
{0x1250, 0x1256}, {0x125a, 0x125d}, {0x1260, 0x1288}, {0x128a, 0x128d},
|
||||
{0x1290, 0x12b0}, {0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c2, 0x12c5},
|
||||
{0x12c8, 0x12d6}, {0x12d8, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x135a},
|
||||
{0x1380, 0x138f}, {0x13a0, 0x13f4}, {0x1401, 0x166c}, {0x166f, 0x167f},
|
||||
{0x1681, 0x169a}, {0x16a0, 0x16ea}, {0x16f1, 0x16f8}, {0x1700, 0x170c},
|
||||
{0x170e, 0x1711}, {0x1720, 0x1731}, {0x1740, 0x1751}, {0x1760, 0x176c},
|
||||
{0x176e, 0x1770}, {0x1780, 0x17b3}, {0x1820, 0x1877}, {0x1880, 0x18a8},
|
||||
{0x18b0, 0x18f5}, {0x1900, 0x191e}, {0x1950, 0x196d}, {0x1970, 0x1974},
|
||||
{0x1980, 0x19ab}, {0x19c1, 0x19c7}, {0x1a00, 0x1a16}, {0x1a20, 0x1a54},
|
||||
{0x1b05, 0x1b33}, {0x1b45, 0x1b4b}, {0x1b83, 0x1ba0}, {0x1bba, 0x1be5},
|
||||
{0x1c00, 0x1c23}, {0x1c4d, 0x1c4f}, {0x1c5a, 0x1c7d}, {0x1ce9, 0x1cec},
|
||||
{0x1cee, 0x1cf1}, {0x1d00, 0x1dbf}, {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}, {0x210a, 0x2113}, {0x2119, 0x211d},
|
||||
{0x212a, 0x212d}, {0x212f, 0x2139}, {0x213c, 0x213f}, {0x2145, 0x2149},
|
||||
{0x2c00, 0x2c2e}, {0x2c30, 0x2c5e}, {0x2c60, 0x2ce4}, {0x2ceb, 0x2cee},
|
||||
{0x2d00, 0x2d25}, {0x2d30, 0x2d67}, {0x2d80, 0x2d96}, {0x2da0, 0x2da6},
|
||||
{0x2da8, 0x2dae}, {0x2db0, 0x2db6}, {0x2db8, 0x2dbe}, {0x2dc0, 0x2dc6},
|
||||
{0x2dc8, 0x2dce}, {0x2dd0, 0x2dd6}, {0x2dd8, 0x2dde}, {0x3031, 0x3035},
|
||||
{0x3041, 0x3096}, {0x309d, 0x309f}, {0x30a1, 0x30fa}, {0x30fc, 0x30ff},
|
||||
{0x3105, 0x312d}, {0x3131, 0x318e}, {0x31a0, 0x31ba}, {0x31f0, 0x31ff},
|
||||
{0x3400, 0x4db5}, {0x4e00, 0x9fcc}, {0xa000, 0xa48c}, {0xa4d0, 0xa4fd},
|
||||
{0xa500, 0xa60c}, {0xa610, 0xa61f}, {0xa640, 0xa66e}, {0xa67f, 0xa69d},
|
||||
{0xa6a0, 0xa6e5}, {0xa717, 0xa71f}, {0xa722, 0xa788}, {0xa78b, 0xa78e},
|
||||
{0xa790, 0xa7ad}, {0xa7f7, 0xa801}, {0xa803, 0xa805}, {0xa807, 0xa80a},
|
||||
{0xa80c, 0xa822}, {0xa840, 0xa873}, {0xa882, 0xa8b3}, {0xa8f2, 0xa8f7},
|
||||
{0xa90a, 0xa925}, {0xa930, 0xa946}, {0xa960, 0xa97c}, {0xa984, 0xa9b2},
|
||||
{0xa9e0, 0xa9e4}, {0xa9e6, 0xa9ef}, {0xa9fa, 0xa9fe}, {0xaa00, 0xaa28},
|
||||
{0xaa40, 0xaa42}, {0xaa44, 0xaa4b}, {0xaa60, 0xaa76}, {0xaa7e, 0xaaaf},
|
||||
{0xaab9, 0xaabd}, {0xaadb, 0xaadd}, {0xaae0, 0xaaea}, {0xaaf2, 0xaaf4},
|
||||
{0xab01, 0xab06}, {0xab09, 0xab0e}, {0xab11, 0xab16}, {0xab20, 0xab26},
|
||||
{0xab28, 0xab2e}, {0xab30, 0xab5a}, {0xab5c, 0xab5f}, {0xabc0, 0xabe2},
|
||||
{0xac00, 0xd7a3}, {0xd7b0, 0xd7c6}, {0xd7cb, 0xd7fb}, {0xf900, 0xfa6d},
|
||||
{0xfa70, 0xfad9}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xfb1f, 0xfb28},
|
||||
{0xfb2a, 0xfb36}, {0xfb38, 0xfb3c}, {0xfb46, 0xfbb1}, {0xfbd3, 0xfd3d},
|
||||
{0xfd50, 0xfd8f}, {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, {0xfe70, 0xfe74},
|
||||
{0xfe76, 0xfefc}, {0xff21, 0xff3a}, {0xff41, 0xff5a}, {0xff66, 0xffbe},
|
||||
{0xffc2, 0xffc7}, {0xffca, 0xffcf}, {0xffd2, 0xffd7}, {0xffda, 0xffdc}
|
||||
{0xc0e, 0xc10}, {0xc12, 0xc28}, {0xc2a, 0xc39}, {0xc58, 0xc5a},
|
||||
{0xc85, 0xc8c}, {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3},
|
||||
{0xcb5, 0xcb9}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, {0xd12, 0xd3a},
|
||||
{0xd5f, 0xd61}, {0xd7a, 0xd7f}, {0xd85, 0xd96}, {0xd9a, 0xdb1},
|
||||
{0xdb3, 0xdbb}, {0xdc0, 0xdc6}, {0xe01, 0xe30}, {0xe40, 0xe46},
|
||||
{0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xead, 0xeb0},
|
||||
{0xec0, 0xec4}, {0xedc, 0xedf}, {0xf40, 0xf47}, {0xf49, 0xf6c},
|
||||
{0xf88, 0xf8c}, {0x1000, 0x102a}, {0x1050, 0x1055}, {0x105a, 0x105d},
|
||||
{0x106e, 0x1070}, {0x1075, 0x1081}, {0x10a0, 0x10c5}, {0x10d0, 0x10fa},
|
||||
{0x10fc, 0x1248}, {0x124a, 0x124d}, {0x1250, 0x1256}, {0x125a, 0x125d},
|
||||
{0x1260, 0x1288}, {0x128a, 0x128d}, {0x1290, 0x12b0}, {0x12b2, 0x12b5},
|
||||
{0x12b8, 0x12be}, {0x12c2, 0x12c5}, {0x12c8, 0x12d6}, {0x12d8, 0x1310},
|
||||
{0x1312, 0x1315}, {0x1318, 0x135a}, {0x1380, 0x138f}, {0x13a0, 0x13f5},
|
||||
{0x13f8, 0x13fd}, {0x1401, 0x166c}, {0x166f, 0x167f}, {0x1681, 0x169a},
|
||||
{0x16a0, 0x16ea}, {0x16f1, 0x16f8}, {0x1700, 0x170c}, {0x170e, 0x1711},
|
||||
{0x1720, 0x1731}, {0x1740, 0x1751}, {0x1760, 0x176c}, {0x176e, 0x1770},
|
||||
{0x1780, 0x17b3}, {0x1820, 0x1877}, {0x1880, 0x18a8}, {0x18b0, 0x18f5},
|
||||
{0x1900, 0x191e}, {0x1950, 0x196d}, {0x1970, 0x1974}, {0x1980, 0x19ab},
|
||||
{0x19b0, 0x19c9}, {0x1a00, 0x1a16}, {0x1a20, 0x1a54}, {0x1b05, 0x1b33},
|
||||
{0x1b45, 0x1b4b}, {0x1b83, 0x1ba0}, {0x1bba, 0x1be5}, {0x1c00, 0x1c23},
|
||||
{0x1c4d, 0x1c4f}, {0x1c5a, 0x1c7d}, {0x1ce9, 0x1cec}, {0x1cee, 0x1cf1},
|
||||
{0x1d00, 0x1dbf}, {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}, {0x210a, 0x2113}, {0x2119, 0x211d}, {0x212a, 0x212d},
|
||||
{0x212f, 0x2139}, {0x213c, 0x213f}, {0x2145, 0x2149}, {0x2c00, 0x2c2e},
|
||||
{0x2c30, 0x2c5e}, {0x2c60, 0x2ce4}, {0x2ceb, 0x2cee}, {0x2d00, 0x2d25},
|
||||
{0x2d30, 0x2d67}, {0x2d80, 0x2d96}, {0x2da0, 0x2da6}, {0x2da8, 0x2dae},
|
||||
{0x2db0, 0x2db6}, {0x2db8, 0x2dbe}, {0x2dc0, 0x2dc6}, {0x2dc8, 0x2dce},
|
||||
{0x2dd0, 0x2dd6}, {0x2dd8, 0x2dde}, {0x3031, 0x3035}, {0x3041, 0x3096},
|
||||
{0x309d, 0x309f}, {0x30a1, 0x30fa}, {0x30fc, 0x30ff}, {0x3105, 0x312d},
|
||||
{0x3131, 0x318e}, {0x31a0, 0x31ba}, {0x31f0, 0x31ff}, {0x3400, 0x4db5},
|
||||
{0x4e00, 0x9fd5}, {0xa000, 0xa48c}, {0xa4d0, 0xa4fd}, {0xa500, 0xa60c},
|
||||
{0xa610, 0xa61f}, {0xa640, 0xa66e}, {0xa67f, 0xa69d}, {0xa6a0, 0xa6e5},
|
||||
{0xa717, 0xa71f}, {0xa722, 0xa788}, {0xa78b, 0xa7ad}, {0xa7b0, 0xa7b7},
|
||||
{0xa7f7, 0xa801}, {0xa803, 0xa805}, {0xa807, 0xa80a}, {0xa80c, 0xa822},
|
||||
{0xa840, 0xa873}, {0xa882, 0xa8b3}, {0xa8f2, 0xa8f7}, {0xa90a, 0xa925},
|
||||
{0xa930, 0xa946}, {0xa960, 0xa97c}, {0xa984, 0xa9b2}, {0xa9e0, 0xa9e4},
|
||||
{0xa9e6, 0xa9ef}, {0xa9fa, 0xa9fe}, {0xaa00, 0xaa28}, {0xaa40, 0xaa42},
|
||||
{0xaa44, 0xaa4b}, {0xaa60, 0xaa76}, {0xaa7e, 0xaaaf}, {0xaab9, 0xaabd},
|
||||
{0xaadb, 0xaadd}, {0xaae0, 0xaaea}, {0xaaf2, 0xaaf4}, {0xab01, 0xab06},
|
||||
{0xab09, 0xab0e}, {0xab11, 0xab16}, {0xab20, 0xab26}, {0xab28, 0xab2e},
|
||||
{0xab30, 0xab5a}, {0xab5c, 0xab65}, {0xab70, 0xabe2}, {0xac00, 0xd7a3},
|
||||
{0xd7b0, 0xd7c6}, {0xd7cb, 0xd7fb}, {0xdc00, 0xdc3e}, {0xdc40, 0xdc7e},
|
||||
{0xde80, 0xdebe}, {0xdec0, 0xdefe}, {0xdf00, 0xdf3e}, {0xdf40, 0xdf7e},
|
||||
{0xdf80, 0xdfbe}, {0xdfc0, 0xdffe}, {0xf900, 0xfa6d}, {0xfa70, 0xfad9},
|
||||
{0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xfb1f, 0xfb28}, {0xfb2a, 0xfb36},
|
||||
{0xfb38, 0xfb3c}, {0xfb46, 0xfbb1}, {0xfbd3, 0xfd3d}, {0xfd50, 0xfd8f},
|
||||
{0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, {0xfe70, 0xfe74}, {0xfe76, 0xfefc},
|
||||
{0xff21, 0xff3a}, {0xff41, 0xff5a}, {0xff66, 0xffbe}, {0xffc2, 0xffc7},
|
||||
{0xffca, 0xffcf}, {0xffd2, 0xffd7}, {0xffda, 0xffdc}
|
||||
#if TCL_UTF_MAX > 4
|
||||
,{0x10000, 0x1000b}, {0x1000d, 0x10026}, {0x10028, 0x1003a}, {0x1003f, 0x1004d},
|
||||
{0x10050, 0x1005d}, {0x10080, 0x100fa}, {0x10280, 0x1029c}, {0x102a0, 0x102d0},
|
||||
@@ -204,30 +207,33 @@ static const crange alphaRangeTable[] = {
|
||||
{0x10380, 0x1039d}, {0x103a0, 0x103c3}, {0x103c8, 0x103cf}, {0x10400, 0x1049d},
|
||||
{0x10500, 0x10527}, {0x10530, 0x10563}, {0x10600, 0x10736}, {0x10740, 0x10755},
|
||||
{0x10760, 0x10767}, {0x10800, 0x10805}, {0x1080a, 0x10835}, {0x1083f, 0x10855},
|
||||
{0x10860, 0x10876}, {0x10880, 0x1089e}, {0x10900, 0x10915}, {0x10920, 0x10939},
|
||||
{0x10980, 0x109b7}, {0x10a10, 0x10a13}, {0x10a15, 0x10a17}, {0x10a19, 0x10a33},
|
||||
{0x10a60, 0x10a7c}, {0x10a80, 0x10a9c}, {0x10ac0, 0x10ac7}, {0x10ac9, 0x10ae4},
|
||||
{0x10b00, 0x10b35}, {0x10b40, 0x10b55}, {0x10b60, 0x10b72}, {0x10b80, 0x10b91},
|
||||
{0x10c00, 0x10c48}, {0x11003, 0x11037}, {0x11083, 0x110af}, {0x110d0, 0x110e8},
|
||||
{0x11103, 0x11126}, {0x11150, 0x11172}, {0x11183, 0x111b2}, {0x111c1, 0x111c4},
|
||||
{0x11200, 0x11211}, {0x11213, 0x1122b}, {0x112b0, 0x112de}, {0x11305, 0x1130c},
|
||||
{0x11313, 0x11328}, {0x1132a, 0x11330}, {0x11335, 0x11339}, {0x1135d, 0x11361},
|
||||
{0x11480, 0x114af}, {0x11580, 0x115ae}, {0x11600, 0x1162f}, {0x11680, 0x116aa},
|
||||
{0x118a0, 0x118df}, {0x11ac0, 0x11af8}, {0x12000, 0x12398}, {0x13000, 0x1342e},
|
||||
{0x16800, 0x16a38}, {0x16a40, 0x16a5e}, {0x16ad0, 0x16aed}, {0x16b00, 0x16b2f},
|
||||
{0x16b40, 0x16b43}, {0x16b63, 0x16b77}, {0x16b7d, 0x16b8f}, {0x16f00, 0x16f44},
|
||||
{0x16f93, 0x16f9f}, {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}, {0x1e800, 0x1e8c4}, {0x1ee00, 0x1ee03},
|
||||
{0x1ee05, 0x1ee1f}, {0x1ee29, 0x1ee32}, {0x1ee34, 0x1ee37}, {0x1ee4d, 0x1ee4f},
|
||||
{0x1ee67, 0x1ee6a}, {0x1ee6c, 0x1ee72}, {0x1ee74, 0x1ee77}, {0x1ee79, 0x1ee7c},
|
||||
{0x1ee80, 0x1ee89}, {0x1ee8b, 0x1ee9b}, {0x1eea1, 0x1eea3}, {0x1eea5, 0x1eea9},
|
||||
{0x1eeab, 0x1eebb}, {0x20000, 0x2a6d6}, {0x2a700, 0x2b734}, {0x2b740, 0x2b81d},
|
||||
{0x10860, 0x10876}, {0x10880, 0x1089e}, {0x108e0, 0x108f2}, {0x10900, 0x10915},
|
||||
{0x10920, 0x10939}, {0x10980, 0x109b7}, {0x10a10, 0x10a13}, {0x10a15, 0x10a17},
|
||||
{0x10a19, 0x10a33}, {0x10a60, 0x10a7c}, {0x10a80, 0x10a9c}, {0x10ac0, 0x10ac7},
|
||||
{0x10ac9, 0x10ae4}, {0x10b00, 0x10b35}, {0x10b40, 0x10b55}, {0x10b60, 0x10b72},
|
||||
{0x10b80, 0x10b91}, {0x10c00, 0x10c48}, {0x10c80, 0x10cb2}, {0x10cc0, 0x10cf2},
|
||||
{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}, {0x11480, 0x114af},
|
||||
{0x11580, 0x115ae}, {0x115d8, 0x115db}, {0x11600, 0x1162f}, {0x11680, 0x116aa},
|
||||
{0x11700, 0x11719}, {0x118a0, 0x118df}, {0x11ac0, 0x11af8}, {0x12000, 0x12399},
|
||||
{0x12480, 0x12543}, {0x13000, 0x1342e}, {0x14400, 0x14646}, {0x16800, 0x16a38},
|
||||
{0x16a40, 0x16a5e}, {0x16ad0, 0x16aed}, {0x16b00, 0x16b2f}, {0x16b40, 0x16b43},
|
||||
{0x16b63, 0x16b77}, {0x16b7d, 0x16b8f}, {0x16f00, 0x16f44}, {0x16f93, 0x16f9f},
|
||||
{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}, {0x1e800, 0x1e8c4}, {0x1ee00, 0x1ee03}, {0x1ee05, 0x1ee1f},
|
||||
{0x1ee29, 0x1ee32}, {0x1ee34, 0x1ee37}, {0x1ee4d, 0x1ee4f}, {0x1ee67, 0x1ee6a},
|
||||
{0x1ee6c, 0x1ee72}, {0x1ee74, 0x1ee77}, {0x1ee79, 0x1ee7c}, {0x1ee80, 0x1ee89},
|
||||
{0x1ee8b, 0x1ee9b}, {0x1eea1, 0x1eea3}, {0x1eea5, 0x1eea9}, {0x1eeab, 0x1eebb},
|
||||
{0x20000, 0x2a6d6}, {0x2a700, 0x2b734}, {0x2b740, 0x2b81d}, {0x2b820, 0x2cea1},
|
||||
{0x2f800, 0x2fa1d}
|
||||
#endif
|
||||
};
|
||||
@@ -240,27 +246,27 @@ static const chr alphaCharTable[] = {
|
||||
0x6ff, 0x710, 0x7b1, 0x7f4, 0x7f5, 0x7fa, 0x81a, 0x824, 0x828,
|
||||
0x93d, 0x950, 0x98f, 0x990, 0x9b2, 0x9bd, 0x9ce, 0x9dc, 0x9dd,
|
||||
0x9f0, 0x9f1, 0xa0f, 0xa10, 0xa32, 0xa33, 0xa35, 0xa36, 0xa38,
|
||||
0xa39, 0xa5e, 0xab2, 0xab3, 0xabd, 0xad0, 0xae0, 0xae1, 0xb0f,
|
||||
0xb10, 0xb32, 0xb33, 0xb3d, 0xb5c, 0xb5d, 0xb71, 0xb83, 0xb99,
|
||||
0xb9a, 0xb9c, 0xb9e, 0xb9f, 0xba3, 0xba4, 0xbd0, 0xc3d, 0xc58,
|
||||
0xc59, 0xc60, 0xc61, 0xcbd, 0xcde, 0xce0, 0xce1, 0xcf1, 0xcf2,
|
||||
0xd3d, 0xd4e, 0xd60, 0xd61, 0xdbd, 0xe32, 0xe33, 0xe81, 0xe82,
|
||||
0xe84, 0xe87, 0xe88, 0xe8a, 0xe8d, 0xea5, 0xea7, 0xeaa, 0xeab,
|
||||
0xeb2, 0xeb3, 0xebd, 0xec6, 0xf00, 0x103f, 0x1061, 0x1065, 0x1066,
|
||||
0x108e, 0x10c7, 0x10cd, 0x1258, 0x12c0, 0x17d7, 0x17dc, 0x18aa, 0x1aa7,
|
||||
0x1bae, 0x1baf, 0x1cf5, 0x1cf6, 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, 0xa7b0, 0xa7b1, 0xa8fb, 0xa9cf, 0xaa7a,
|
||||
0xaab1, 0xaab5, 0xaab6, 0xaac0, 0xaac2, 0xab64, 0xab65, 0xfb1d, 0xfb3e,
|
||||
0xfb40, 0xfb41, 0xfb43, 0xfb44
|
||||
0xa39, 0xa5e, 0xab2, 0xab3, 0xabd, 0xad0, 0xae0, 0xae1, 0xaf9,
|
||||
0xb0f, 0xb10, 0xb32, 0xb33, 0xb3d, 0xb5c, 0xb5d, 0xb71, 0xb83,
|
||||
0xb99, 0xb9a, 0xb9c, 0xb9e, 0xb9f, 0xba3, 0xba4, 0xbd0, 0xc3d,
|
||||
0xc60, 0xc61, 0xcbd, 0xcde, 0xce0, 0xce1, 0xcf1, 0xcf2, 0xd3d,
|
||||
0xd4e, 0xdbd, 0xe32, 0xe33, 0xe81, 0xe82, 0xe84, 0xe87, 0xe88,
|
||||
0xe8a, 0xe8d, 0xea5, 0xea7, 0xeaa, 0xeab, 0xeb2, 0xeb3, 0xebd,
|
||||
0xec6, 0xf00, 0x103f, 0x1061, 0x1065, 0x1066, 0x108e, 0x10c7, 0x10cd,
|
||||
0x1258, 0x12c0, 0x17d7, 0x17dc, 0x18aa, 0x1aa7, 0x1bae, 0x1baf, 0x1cf5,
|
||||
0x1cf6, 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, 0xa9cf, 0xaa7a, 0xaab1, 0xaab5, 0xaab6, 0xaac0,
|
||||
0xaac2, 0xfb1d, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44
|
||||
#if TCL_UTF_MAX > 4
|
||||
,0x1003c, 0x1003d, 0x10808, 0x10837, 0x10838, 0x1083c, 0x109be, 0x109bf, 0x10a00,
|
||||
0x11176, 0x111da, 0x1130f, 0x11310, 0x11332, 0x11333, 0x1133d, 0x114c4, 0x114c5,
|
||||
0x114c7, 0x11644, 0x118ff, 0x16f50, 0x1b000, 0x1b001, 0x1d49e, 0x1d49f, 0x1d4a2,
|
||||
0x1d4a5, 0x1d4a6, 0x1d4bb, 0x1d546, 0x1ee21, 0x1ee22, 0x1ee24, 0x1ee27, 0x1ee39,
|
||||
0x1ee3b, 0x1ee42, 0x1ee47, 0x1ee49, 0x1ee4b, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee57,
|
||||
0x1ee59, 0x1ee5b, 0x1ee5d, 0x1ee5f, 0x1ee61, 0x1ee62, 0x1ee64, 0x1ee7e
|
||||
,0x1003c, 0x1003d, 0x10808, 0x10837, 0x10838, 0x1083c, 0x108f4, 0x108f5, 0x109be,
|
||||
0x109bf, 0x10a00, 0x11176, 0x111da, 0x111dc, 0x11288, 0x1130f, 0x11310, 0x11332,
|
||||
0x11333, 0x1133d, 0x11350, 0x114c4, 0x114c5, 0x114c7, 0x11644, 0x118ff, 0x16f50,
|
||||
0x1b000, 0x1b001, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4bb, 0x1d546,
|
||||
0x1ee21, 0x1ee22, 0x1ee24, 0x1ee27, 0x1ee39, 0x1ee3b, 0x1ee42, 0x1ee47, 0x1ee49,
|
||||
0x1ee4b, 0x1ee51, 0x1ee52, 0x1ee54, 0x1ee57, 0x1ee59, 0x1ee5b, 0x1ee5d, 0x1ee5f,
|
||||
0x1ee61, 0x1ee62, 0x1ee64, 0x1ee7e
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -309,8 +315,8 @@ static const crange digitRangeTable[] = {
|
||||
#if TCL_UTF_MAX > 4
|
||||
,{0x104a0, 0x104a9}, {0x11066, 0x1106f}, {0x110f0, 0x110f9}, {0x11136, 0x1113f},
|
||||
{0x111d0, 0x111d9}, {0x112f0, 0x112f9}, {0x114d0, 0x114d9}, {0x11650, 0x11659},
|
||||
{0x116c0, 0x116c9}, {0x118e0, 0x118e9}, {0x16a60, 0x16a69}, {0x16b50, 0x16b59},
|
||||
{0x1d7ce, 0x1d7ff}
|
||||
{0x116c0, 0x116c9}, {0x11730, 0x11739}, {0x118e0, 0x118e9}, {0x16a60, 0x16a69},
|
||||
{0x16b50, 0x16b59}, {0x1d7ce, 0x1d7ff}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -342,8 +348,9 @@ static const crange punctRangeTable[] = {
|
||||
#if TCL_UTF_MAX > 4
|
||||
,{0x10100, 0x10102}, {0x10a50, 0x10a58}, {0x10af0, 0x10af6}, {0x10b39, 0x10b3f},
|
||||
{0x10b99, 0x10b9c}, {0x11047, 0x1104d}, {0x110be, 0x110c1}, {0x11140, 0x11143},
|
||||
{0x111c5, 0x111c8}, {0x11238, 0x1123d}, {0x115c1, 0x115c9}, {0x11641, 0x11643},
|
||||
{0x12470, 0x12474}, {0x16b37, 0x16b3b}
|
||||
{0x111c5, 0x111c9}, {0x111dd, 0x111df}, {0x11238, 0x1123d}, {0x115c1, 0x115d7},
|
||||
{0x11641, 0x11643}, {0x1173c, 0x1173e}, {0x12470, 0x12474}, {0x16b37, 0x16b3b},
|
||||
{0x1da87, 0x1da8b}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -359,12 +366,13 @@ static const chr punctCharTable[] = {
|
||||
0x1945, 0x1a1e, 0x1a1f, 0x1c7e, 0x1c7f, 0x1cd3, 0x207d, 0x207e, 0x208d,
|
||||
0x208e, 0x2329, 0x232a, 0x27c5, 0x27c6, 0x29fc, 0x29fd, 0x2cfe, 0x2cff,
|
||||
0x2d70, 0x3030, 0x303d, 0x30a0, 0x30fb, 0xa4fe, 0xa4ff, 0xa673, 0xa67e,
|
||||
0xa8ce, 0xa8cf, 0xa92e, 0xa92f, 0xa95f, 0xa9de, 0xa9df, 0xaade, 0xaadf,
|
||||
0xaaf0, 0xaaf1, 0xabeb, 0xfd3e, 0xfd3f, 0xfe63, 0xfe68, 0xfe6a, 0xfe6b,
|
||||
0xff1a, 0xff1b, 0xff1f, 0xff20, 0xff3f, 0xff5b, 0xff5d
|
||||
0xa8ce, 0xa8cf, 0xa8fc, 0xa92e, 0xa92f, 0xa95f, 0xa9de, 0xa9df, 0xaade,
|
||||
0xaadf, 0xaaf0, 0xaaf1, 0xabeb, 0xfd3e, 0xfd3f, 0xfe63, 0xfe68, 0xfe6a,
|
||||
0xfe6b, 0xff1a, 0xff1b, 0xff1f, 0xff20, 0xff3f, 0xff5b, 0xff5d
|
||||
#if TCL_UTF_MAX > 4
|
||||
,0x1039f, 0x103d0, 0x1056f, 0x10857, 0x1091f, 0x1093f, 0x10a7f, 0x110bb, 0x110bc,
|
||||
0x11174, 0x11175, 0x111cd, 0x114c6, 0x16a6e, 0x16a6f, 0x16af5, 0x16b44, 0x1bc9f
|
||||
0x11174, 0x11175, 0x111cd, 0x111db, 0x112a9, 0x114c6, 0x16a6e, 0x16a6f, 0x16af5,
|
||||
0x16b44, 0x1bc9f
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -395,23 +403,25 @@ static const crange lowerRangeTable[] = {
|
||||
{0x61, 0x7a}, {0xdf, 0xf6}, {0xf8, 0xff}, {0x17e, 0x180},
|
||||
{0x199, 0x19b}, {0x1bd, 0x1bf}, {0x233, 0x239}, {0x24f, 0x293},
|
||||
{0x295, 0x2af}, {0x37b, 0x37d}, {0x3ac, 0x3ce}, {0x3d5, 0x3d7},
|
||||
{0x3ef, 0x3f3}, {0x430, 0x45f}, {0x561, 0x587}, {0x1d00, 0x1d2b},
|
||||
{0x1d6b, 0x1d77}, {0x1d79, 0x1d9a}, {0x1e95, 0x1e9d}, {0x1eff, 0x1f07},
|
||||
{0x1f10, 0x1f15}, {0x1f20, 0x1f27}, {0x1f30, 0x1f37}, {0x1f40, 0x1f45},
|
||||
{0x1f50, 0x1f57}, {0x1f60, 0x1f67}, {0x1f70, 0x1f7d}, {0x1f80, 0x1f87},
|
||||
{0x1f90, 0x1f97}, {0x1fa0, 0x1fa7}, {0x1fb0, 0x1fb4}, {0x1fc2, 0x1fc4},
|
||||
{0x1fd0, 0x1fd3}, {0x1fe0, 0x1fe7}, {0x1ff2, 0x1ff4}, {0x2146, 0x2149},
|
||||
{0x2c30, 0x2c5e}, {0x2c76, 0x2c7b}, {0x2d00, 0x2d25}, {0xa72f, 0xa731},
|
||||
{0xa771, 0xa778}, {0xa793, 0xa795}, {0xab30, 0xab5a}, {0xfb00, 0xfb06},
|
||||
{0xfb13, 0xfb17}, {0xff41, 0xff5a}
|
||||
{0x3ef, 0x3f3}, {0x430, 0x45f}, {0x561, 0x587}, {0x13f8, 0x13fd},
|
||||
{0x1d00, 0x1d2b}, {0x1d6b, 0x1d77}, {0x1d79, 0x1d9a}, {0x1e95, 0x1e9d},
|
||||
{0x1eff, 0x1f07}, {0x1f10, 0x1f15}, {0x1f20, 0x1f27}, {0x1f30, 0x1f37},
|
||||
{0x1f40, 0x1f45}, {0x1f50, 0x1f57}, {0x1f60, 0x1f67}, {0x1f70, 0x1f7d},
|
||||
{0x1f80, 0x1f87}, {0x1f90, 0x1f97}, {0x1fa0, 0x1fa7}, {0x1fb0, 0x1fb4},
|
||||
{0x1fc2, 0x1fc4}, {0x1fd0, 0x1fd3}, {0x1fe0, 0x1fe7}, {0x1ff2, 0x1ff4},
|
||||
{0x2146, 0x2149}, {0x2c30, 0x2c5e}, {0x2c76, 0x2c7b}, {0x2d00, 0x2d25},
|
||||
{0xa72f, 0xa731}, {0xa771, 0xa778}, {0xa793, 0xa795}, {0xab30, 0xab5a},
|
||||
{0xab60, 0xab65}, {0xab70, 0xabbf}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17},
|
||||
{0xff41, 0xff5a}
|
||||
#if TCL_UTF_MAX > 4
|
||||
,{0x10428, 0x1044f}, {0x118c0, 0x118df}, {0x1d41a, 0x1d433}, {0x1d44e, 0x1d454},
|
||||
{0x1d456, 0x1d467}, {0x1d482, 0x1d49b}, {0x1d4b6, 0x1d4b9}, {0x1d4bd, 0x1d4c3},
|
||||
{0x1d4c5, 0x1d4cf}, {0x1d4ea, 0x1d503}, {0x1d51e, 0x1d537}, {0x1d552, 0x1d56b},
|
||||
{0x1d586, 0x1d59f}, {0x1d5ba, 0x1d5d3}, {0x1d5ee, 0x1d607}, {0x1d622, 0x1d63b},
|
||||
{0x1d656, 0x1d66f}, {0x1d68a, 0x1d6a5}, {0x1d6c2, 0x1d6da}, {0x1d6dc, 0x1d6e1},
|
||||
{0x1d6fc, 0x1d714}, {0x1d716, 0x1d71b}, {0x1d736, 0x1d74e}, {0x1d750, 0x1d755},
|
||||
{0x1d770, 0x1d788}, {0x1d78a, 0x1d78f}, {0x1d7aa, 0x1d7c2}, {0x1d7c4, 0x1d7c9}
|
||||
,{0x10428, 0x1044f}, {0x10cc0, 0x10cf2}, {0x118c0, 0x118df}, {0x1d41a, 0x1d433},
|
||||
{0x1d44e, 0x1d454}, {0x1d456, 0x1d467}, {0x1d482, 0x1d49b}, {0x1d4b6, 0x1d4b9},
|
||||
{0x1d4bd, 0x1d4c3}, {0x1d4c5, 0x1d4cf}, {0x1d4ea, 0x1d503}, {0x1d51e, 0x1d537},
|
||||
{0x1d552, 0x1d56b}, {0x1d586, 0x1d59f}, {0x1d5ba, 0x1d5d3}, {0x1d5ee, 0x1d607},
|
||||
{0x1d622, 0x1d63b}, {0x1d656, 0x1d66f}, {0x1d68a, 0x1d6a5}, {0x1d6c2, 0x1d6da},
|
||||
{0x1d6dc, 0x1d6e1}, {0x1d6fc, 0x1d714}, {0x1d716, 0x1d71b}, {0x1d736, 0x1d74e},
|
||||
{0x1d750, 0x1d755}, {0x1d770, 0x1d788}, {0x1d78a, 0x1d78f}, {0x1d7aa, 0x1d7c2},
|
||||
{0x1d7c4, 0x1d7c9}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -481,7 +491,7 @@ static const chr lowerCharTable[] = {
|
||||
0xa763, 0xa765, 0xa767, 0xa769, 0xa76b, 0xa76d, 0xa76f, 0xa77a, 0xa77c,
|
||||
0xa77f, 0xa781, 0xa783, 0xa785, 0xa787, 0xa78c, 0xa78e, 0xa791, 0xa797,
|
||||
0xa799, 0xa79b, 0xa79d, 0xa79f, 0xa7a1, 0xa7a3, 0xa7a5, 0xa7a7, 0xa7a9,
|
||||
0xa7fa, 0xab64, 0xab65
|
||||
0xa7b5, 0xa7b7, 0xa7fa
|
||||
#if TCL_UTF_MAX > 4
|
||||
,0x1d4bb, 0x1d7cb
|
||||
#endif
|
||||
@@ -498,20 +508,20 @@ static const crange upperRangeTable[] = {
|
||||
{0x18e, 0x191}, {0x196, 0x198}, {0x1b1, 0x1b3}, {0x1f6, 0x1f8},
|
||||
{0x243, 0x246}, {0x388, 0x38a}, {0x391, 0x3a1}, {0x3a3, 0x3ab},
|
||||
{0x3d2, 0x3d4}, {0x3fd, 0x42f}, {0x531, 0x556}, {0x10a0, 0x10c5},
|
||||
{0x1f08, 0x1f0f}, {0x1f18, 0x1f1d}, {0x1f28, 0x1f2f}, {0x1f38, 0x1f3f},
|
||||
{0x1f48, 0x1f4d}, {0x1f68, 0x1f6f}, {0x1fb8, 0x1fbb}, {0x1fc8, 0x1fcb},
|
||||
{0x1fd8, 0x1fdb}, {0x1fe8, 0x1fec}, {0x1ff8, 0x1ffb}, {0x210b, 0x210d},
|
||||
{0x2110, 0x2112}, {0x2119, 0x211d}, {0x212a, 0x212d}, {0x2130, 0x2133},
|
||||
{0x2c00, 0x2c2e}, {0x2c62, 0x2c64}, {0x2c6d, 0x2c70}, {0x2c7e, 0x2c80},
|
||||
{0xa7aa, 0xa7ad}, {0xff21, 0xff3a}
|
||||
{0x13a0, 0x13f5}, {0x1f08, 0x1f0f}, {0x1f18, 0x1f1d}, {0x1f28, 0x1f2f},
|
||||
{0x1f38, 0x1f3f}, {0x1f48, 0x1f4d}, {0x1f68, 0x1f6f}, {0x1fb8, 0x1fbb},
|
||||
{0x1fc8, 0x1fcb}, {0x1fd8, 0x1fdb}, {0x1fe8, 0x1fec}, {0x1ff8, 0x1ffb},
|
||||
{0x210b, 0x210d}, {0x2110, 0x2112}, {0x2119, 0x211d}, {0x212a, 0x212d},
|
||||
{0x2130, 0x2133}, {0x2c00, 0x2c2e}, {0x2c62, 0x2c64}, {0x2c6d, 0x2c70},
|
||||
{0x2c7e, 0x2c80}, {0xa7aa, 0xa7ad}, {0xa7b0, 0xa7b4}, {0xff21, 0xff3a}
|
||||
#if TCL_UTF_MAX > 4
|
||||
,{0x10400, 0x10427}, {0x118a0, 0x118bf}, {0x1d400, 0x1d419}, {0x1d434, 0x1d44d},
|
||||
{0x1d468, 0x1d481}, {0x1d4a9, 0x1d4ac}, {0x1d4ae, 0x1d4b5}, {0x1d4d0, 0x1d4e9},
|
||||
{0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, {0x1d516, 0x1d51c}, {0x1d53b, 0x1d53e},
|
||||
{0x1d540, 0x1d544}, {0x1d54a, 0x1d550}, {0x1d56c, 0x1d585}, {0x1d5a0, 0x1d5b9},
|
||||
{0x1d5d4, 0x1d5ed}, {0x1d608, 0x1d621}, {0x1d63c, 0x1d655}, {0x1d670, 0x1d689},
|
||||
{0x1d6a8, 0x1d6c0}, {0x1d6e2, 0x1d6fa}, {0x1d71c, 0x1d734}, {0x1d756, 0x1d76e},
|
||||
{0x1d790, 0x1d7a8}
|
||||
,{0x10400, 0x10427}, {0x10c80, 0x10cb2}, {0x118a0, 0x118bf}, {0x1d400, 0x1d419},
|
||||
{0x1d434, 0x1d44d}, {0x1d468, 0x1d481}, {0x1d4a9, 0x1d4ac}, {0x1d4ae, 0x1d4b5},
|
||||
{0x1d4d0, 0x1d4e9}, {0x1d507, 0x1d50a}, {0x1d50d, 0x1d514}, {0x1d516, 0x1d51c},
|
||||
{0x1d53b, 0x1d53e}, {0x1d540, 0x1d544}, {0x1d54a, 0x1d550}, {0x1d56c, 0x1d585},
|
||||
{0x1d5a0, 0x1d5b9}, {0x1d5d4, 0x1d5ed}, {0x1d608, 0x1d621}, {0x1d63c, 0x1d655},
|
||||
{0x1d670, 0x1d689}, {0x1d6a8, 0x1d6c0}, {0x1d6e2, 0x1d6fa}, {0x1d71c, 0x1d734},
|
||||
{0x1d756, 0x1d76e}, {0x1d790, 0x1d7a8}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -580,8 +590,7 @@ static const chr upperCharTable[] = {
|
||||
0xa756, 0xa758, 0xa75a, 0xa75c, 0xa75e, 0xa760, 0xa762, 0xa764, 0xa766,
|
||||
0xa768, 0xa76a, 0xa76c, 0xa76e, 0xa779, 0xa77b, 0xa77d, 0xa77e, 0xa780,
|
||||
0xa782, 0xa784, 0xa786, 0xa78b, 0xa78d, 0xa790, 0xa792, 0xa796, 0xa798,
|
||||
0xa79a, 0xa79c, 0xa79e, 0xa7a0, 0xa7a2, 0xa7a4, 0xa7a6, 0xa7a8, 0xa7b0,
|
||||
0xa7b1
|
||||
0xa79a, 0xa79c, 0xa79e, 0xa7a0, 0xa7a2, 0xa7a4, 0xa7a6, 0xa7a8, 0xa7b6
|
||||
#if TCL_UTF_MAX > 4
|
||||
,0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d504, 0x1d505, 0x1d538,
|
||||
0x1d539, 0x1d546, 0x1d7ca
|
||||
@@ -600,8 +609,8 @@ static const crange graphRangeTable[] = {
|
||||
{0x559, 0x55f}, {0x561, 0x587}, {0x58d, 0x58f}, {0x591, 0x5c7},
|
||||
{0x5d0, 0x5ea}, {0x5f0, 0x5f4}, {0x606, 0x61b}, {0x61e, 0x6dc},
|
||||
{0x6de, 0x70d}, {0x710, 0x74a}, {0x74d, 0x7b1}, {0x7c0, 0x7fa},
|
||||
{0x800, 0x82d}, {0x830, 0x83e}, {0x840, 0x85b}, {0x8a0, 0x8b2},
|
||||
{0x8e4, 0x983}, {0x985, 0x98c}, {0x993, 0x9a8}, {0x9aa, 0x9b0},
|
||||
{0x800, 0x82d}, {0x830, 0x83e}, {0x840, 0x85b}, {0x8a0, 0x8b4},
|
||||
{0x8e3, 0x983}, {0x985, 0x98c}, {0x993, 0x9a8}, {0x9aa, 0x9b0},
|
||||
{0x9b6, 0x9b9}, {0x9bc, 0x9c4}, {0x9cb, 0x9ce}, {0x9df, 0x9e3},
|
||||
{0x9e6, 0x9fb}, {0xa01, 0xa03}, {0xa05, 0xa0a}, {0xa13, 0xa28},
|
||||
{0xa2a, 0xa30}, {0xa3e, 0xa42}, {0xa4b, 0xa4d}, {0xa59, 0xa5c},
|
||||
@@ -614,66 +623,67 @@ static const crange graphRangeTable[] = {
|
||||
{0xba8, 0xbaa}, {0xbae, 0xbb9}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8},
|
||||
{0xbca, 0xbcd}, {0xbe6, 0xbfa}, {0xc00, 0xc03}, {0xc05, 0xc0c},
|
||||
{0xc0e, 0xc10}, {0xc12, 0xc28}, {0xc2a, 0xc39}, {0xc3d, 0xc44},
|
||||
{0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc60, 0xc63}, {0xc66, 0xc6f},
|
||||
{0xc78, 0xc7f}, {0xc81, 0xc83}, {0xc85, 0xc8c}, {0xc8e, 0xc90},
|
||||
{0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, {0xcbc, 0xcc4},
|
||||
{0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xce0, 0xce3}, {0xce6, 0xcef},
|
||||
{0xd01, 0xd03}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, {0xd12, 0xd3a},
|
||||
{0xd3d, 0xd44}, {0xd46, 0xd48}, {0xd4a, 0xd4e}, {0xd60, 0xd63},
|
||||
{0xd66, 0xd75}, {0xd79, 0xd7f}, {0xd85, 0xd96}, {0xd9a, 0xdb1},
|
||||
{0xdb3, 0xdbb}, {0xdc0, 0xdc6}, {0xdcf, 0xdd4}, {0xdd8, 0xddf},
|
||||
{0xde6, 0xdef}, {0xdf2, 0xdf4}, {0xe01, 0xe3a}, {0xe3f, 0xe5b},
|
||||
{0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xead, 0xeb9},
|
||||
{0xebb, 0xebd}, {0xec0, 0xec4}, {0xec8, 0xecd}, {0xed0, 0xed9},
|
||||
{0xedc, 0xedf}, {0xf00, 0xf47}, {0xf49, 0xf6c}, {0xf71, 0xf97},
|
||||
{0xf99, 0xfbc}, {0xfbe, 0xfcc}, {0xfce, 0xfda}, {0x1000, 0x10c5},
|
||||
{0x10d0, 0x1248}, {0x124a, 0x124d}, {0x1250, 0x1256}, {0x125a, 0x125d},
|
||||
{0x1260, 0x1288}, {0x128a, 0x128d}, {0x1290, 0x12b0}, {0x12b2, 0x12b5},
|
||||
{0x12b8, 0x12be}, {0x12c2, 0x12c5}, {0x12c8, 0x12d6}, {0x12d8, 0x1310},
|
||||
{0x1312, 0x1315}, {0x1318, 0x135a}, {0x135d, 0x137c}, {0x1380, 0x1399},
|
||||
{0x13a0, 0x13f4}, {0x1400, 0x167f}, {0x1681, 0x169c}, {0x16a0, 0x16f8},
|
||||
{0x1700, 0x170c}, {0x170e, 0x1714}, {0x1720, 0x1736}, {0x1740, 0x1753},
|
||||
{0x1760, 0x176c}, {0x176e, 0x1770}, {0x1780, 0x17dd}, {0x17e0, 0x17e9},
|
||||
{0x17f0, 0x17f9}, {0x1800, 0x180d}, {0x1810, 0x1819}, {0x1820, 0x1877},
|
||||
{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, 0x1abe}, {0x1b00, 0x1b4b}, {0x1b50, 0x1b7c}, {0x1b80, 0x1bf3},
|
||||
{0x1bfc, 0x1c37}, {0x1c3b, 0x1c49}, {0x1c4d, 0x1c7f}, {0x1cc0, 0x1cc7},
|
||||
{0x1cd0, 0x1cf6}, {0x1d00, 0x1df5}, {0x1dfc, 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, 0x20bd},
|
||||
{0x20d0, 0x20f0}, {0x2100, 0x2189}, {0x2190, 0x23fa}, {0x2400, 0x2426},
|
||||
{0x2440, 0x244a}, {0x2460, 0x2b73}, {0x2b76, 0x2b95}, {0x2b98, 0x2bb9},
|
||||
{0x2bbd, 0x2bc8}, {0x2bca, 0x2bd1}, {0x2c00, 0x2c2e}, {0x2c30, 0x2c5e},
|
||||
{0x2c60, 0x2cf3}, {0x2cf9, 0x2d25}, {0x2d30, 0x2d67}, {0x2d7f, 0x2d96},
|
||||
{0x2da0, 0x2da6}, {0x2da8, 0x2dae}, {0x2db0, 0x2db6}, {0x2db8, 0x2dbe},
|
||||
{0x2dc0, 0x2dc6}, {0x2dc8, 0x2dce}, {0x2dd0, 0x2dd6}, {0x2dd8, 0x2dde},
|
||||
{0x2de0, 0x2e42}, {0x2e80, 0x2e99}, {0x2e9b, 0x2ef3}, {0x2f00, 0x2fd5},
|
||||
{0x2ff0, 0x2ffb}, {0x3001, 0x303f}, {0x3041, 0x3096}, {0x3099, 0x30ff},
|
||||
{0x3105, 0x312d}, {0x3131, 0x318e}, {0x3190, 0x31ba}, {0x31c0, 0x31e3},
|
||||
{0x31f0, 0x321e}, {0x3220, 0x32fe}, {0x3300, 0x4db5}, {0x4dc0, 0x9fcc},
|
||||
{0xa000, 0xa48c}, {0xa490, 0xa4c6}, {0xa4d0, 0xa62b}, {0xa640, 0xa69d},
|
||||
{0xa69f, 0xa6f7}, {0xa700, 0xa78e}, {0xa790, 0xa7ad}, {0xa7f7, 0xa82b},
|
||||
{0xa830, 0xa839}, {0xa840, 0xa877}, {0xa880, 0xa8c4}, {0xa8ce, 0xa8d9},
|
||||
{0xa8e0, 0xa8fb}, {0xa900, 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, 0xab5f}, {0xabc0, 0xabed}, {0xabf0, 0xabf9}, {0xac00, 0xd7a3},
|
||||
{0xd7b0, 0xd7c6}, {0xd7cb, 0xd7fb}, {0xdc00, 0xdc3e}, {0xdc40, 0xdc7e},
|
||||
{0xdc80, 0xdcbe}, {0xdcc0, 0xdcfe}, {0xdd80, 0xddbe}, {0xddc0, 0xddfe},
|
||||
{0xde80, 0xdebe}, {0xdec0, 0xdefe}, {0xdf00, 0xdf3e}, {0xdf40, 0xdf7e},
|
||||
{0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc58, 0xc5a}, {0xc60, 0xc63},
|
||||
{0xc66, 0xc6f}, {0xc78, 0xc7f}, {0xc81, 0xc83}, {0xc85, 0xc8c},
|
||||
{0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9},
|
||||
{0xcbc, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xce0, 0xce3},
|
||||
{0xce6, 0xcef}, {0xd01, 0xd03}, {0xd05, 0xd0c}, {0xd0e, 0xd10},
|
||||
{0xd12, 0xd3a}, {0xd3d, 0xd44}, {0xd46, 0xd48}, {0xd4a, 0xd4e},
|
||||
{0xd5f, 0xd63}, {0xd66, 0xd75}, {0xd79, 0xd7f}, {0xd85, 0xd96},
|
||||
{0xd9a, 0xdb1}, {0xdb3, 0xdbb}, {0xdc0, 0xdc6}, {0xdcf, 0xdd4},
|
||||
{0xdd8, 0xddf}, {0xde6, 0xdef}, {0xdf2, 0xdf4}, {0xe01, 0xe3a},
|
||||
{0xe3f, 0xe5b}, {0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3},
|
||||
{0xead, 0xeb9}, {0xebb, 0xebd}, {0xec0, 0xec4}, {0xec8, 0xecd},
|
||||
{0xed0, 0xed9}, {0xedc, 0xedf}, {0xf00, 0xf47}, {0xf49, 0xf6c},
|
||||
{0xf71, 0xf97}, {0xf99, 0xfbc}, {0xfbe, 0xfcc}, {0xfce, 0xfda},
|
||||
{0x1000, 0x10c5}, {0x10d0, 0x1248}, {0x124a, 0x124d}, {0x1250, 0x1256},
|
||||
{0x125a, 0x125d}, {0x1260, 0x1288}, {0x128a, 0x128d}, {0x1290, 0x12b0},
|
||||
{0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c2, 0x12c5}, {0x12c8, 0x12d6},
|
||||
{0x12d8, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x135a}, {0x135d, 0x137c},
|
||||
{0x1380, 0x1399}, {0x13a0, 0x13f5}, {0x13f8, 0x13fd}, {0x1400, 0x167f},
|
||||
{0x1681, 0x169c}, {0x16a0, 0x16f8}, {0x1700, 0x170c}, {0x170e, 0x1714},
|
||||
{0x1720, 0x1736}, {0x1740, 0x1753}, {0x1760, 0x176c}, {0x176e, 0x1770},
|
||||
{0x1780, 0x17dd}, {0x17e0, 0x17e9}, {0x17f0, 0x17f9}, {0x1800, 0x180d},
|
||||
{0x1810, 0x1819}, {0x1820, 0x1877}, {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, 0x1abe}, {0x1b00, 0x1b4b},
|
||||
{0x1b50, 0x1b7c}, {0x1b80, 0x1bf3}, {0x1bfc, 0x1c37}, {0x1c3b, 0x1c49},
|
||||
{0x1c4d, 0x1c7f}, {0x1cc0, 0x1cc7}, {0x1cd0, 0x1cf6}, {0x1d00, 0x1df5},
|
||||
{0x1dfc, 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, 0x20be}, {0x20d0, 0x20f0}, {0x2100, 0x218b},
|
||||
{0x2190, 0x23fa}, {0x2400, 0x2426}, {0x2440, 0x244a}, {0x2460, 0x2b73},
|
||||
{0x2b76, 0x2b95}, {0x2b98, 0x2bb9}, {0x2bbd, 0x2bc8}, {0x2bca, 0x2bd1},
|
||||
{0x2bec, 0x2bef}, {0x2c00, 0x2c2e}, {0x2c30, 0x2c5e}, {0x2c60, 0x2cf3},
|
||||
{0x2cf9, 0x2d25}, {0x2d30, 0x2d67}, {0x2d7f, 0x2d96}, {0x2da0, 0x2da6},
|
||||
{0x2da8, 0x2dae}, {0x2db0, 0x2db6}, {0x2db8, 0x2dbe}, {0x2dc0, 0x2dc6},
|
||||
{0x2dc8, 0x2dce}, {0x2dd0, 0x2dd6}, {0x2dd8, 0x2dde}, {0x2de0, 0x2e42},
|
||||
{0x2e80, 0x2e99}, {0x2e9b, 0x2ef3}, {0x2f00, 0x2fd5}, {0x2ff0, 0x2ffb},
|
||||
{0x3001, 0x303f}, {0x3041, 0x3096}, {0x3099, 0x30ff}, {0x3105, 0x312d},
|
||||
{0x3131, 0x318e}, {0x3190, 0x31ba}, {0x31c0, 0x31e3}, {0x31f0, 0x321e},
|
||||
{0x3220, 0x32fe}, {0x3300, 0x4db5}, {0x4dc0, 0x9fd5}, {0xa000, 0xa48c},
|
||||
{0xa490, 0xa4c6}, {0xa4d0, 0xa62b}, {0xa640, 0xa6f7}, {0xa700, 0xa7ad},
|
||||
{0xa7b0, 0xa7b7}, {0xa7f7, 0xa82b}, {0xa830, 0xa839}, {0xa840, 0xa877},
|
||||
{0xa880, 0xa8c4}, {0xa8ce, 0xa8d9}, {0xa8e0, 0xa8fd}, {0xa900, 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, 0xab65}, {0xab70, 0xabed},
|
||||
{0xabf0, 0xabf9}, {0xac00, 0xd7a3}, {0xd7b0, 0xd7c6}, {0xd7cb, 0xd7fb},
|
||||
{0xdc00, 0xdc3e}, {0xdc40, 0xdc7e}, {0xdc80, 0xdcbe}, {0xdcc0, 0xdcfe},
|
||||
{0xdd00, 0xdd3e}, {0xdd40, 0xdd7e}, {0xdd80, 0xddbe}, {0xddc0, 0xddfe},
|
||||
{0xde00, 0xde3e}, {0xde40, 0xde7e}, {0xde80, 0xdebe}, {0xdec0, 0xdefe},
|
||||
{0xdf00, 0xdf3e}, {0xdf40, 0xdf7e}, {0xdf80, 0xdfbe}, {0xdfc0, 0xdffe},
|
||||
{0xf900, 0xfa6d}, {0xfa70, 0xfad9}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17},
|
||||
{0xfb1d, 0xfb36}, {0xfb38, 0xfb3c}, {0xfb46, 0xfbc1}, {0xfbd3, 0xfd3f},
|
||||
{0xfd50, 0xfd8f}, {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfd}, {0xfe00, 0xfe19},
|
||||
{0xfe20, 0xfe2d}, {0xfe30, 0xfe52}, {0xfe54, 0xfe66}, {0xfe68, 0xfe6b},
|
||||
{0xfe70, 0xfe74}, {0xfe76, 0xfefc}, {0xff01, 0xffbe}, {0xffc2, 0xffc7},
|
||||
{0xffca, 0xffcf}, {0xffd2, 0xffd7}, {0xffda, 0xffdc}, {0xffe0, 0xffe6},
|
||||
{0xffe8, 0xffee}
|
||||
{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 TCL_UTF_MAX > 4
|
||||
,{0x10000, 0x1000b}, {0x1000d, 0x10026}, {0x10028, 0x1003a}, {0x1003f, 0x1004d},
|
||||
{0x10050, 0x1005d}, {0x10080, 0x100fa}, {0x10100, 0x10102}, {0x10107, 0x10133},
|
||||
@@ -683,45 +693,48 @@ static const crange graphRangeTable[] = {
|
||||
{0x10400, 0x1049d}, {0x104a0, 0x104a9}, {0x10500, 0x10527}, {0x10530, 0x10563},
|
||||
{0x10600, 0x10736}, {0x10740, 0x10755}, {0x10760, 0x10767}, {0x10800, 0x10805},
|
||||
{0x1080a, 0x10835}, {0x1083f, 0x10855}, {0x10857, 0x1089e}, {0x108a7, 0x108af},
|
||||
{0x10900, 0x1091b}, {0x1091f, 0x10939}, {0x10980, 0x109b7}, {0x10a00, 0x10a03},
|
||||
{0x10a0c, 0x10a13}, {0x10a15, 0x10a17}, {0x10a19, 0x10a33}, {0x10a38, 0x10a3a},
|
||||
{0x10a3f, 0x10a47}, {0x10a50, 0x10a58}, {0x10a60, 0x10a9f}, {0x10ac0, 0x10ae6},
|
||||
{0x10aeb, 0x10af6}, {0x10b00, 0x10b35}, {0x10b39, 0x10b55}, {0x10b58, 0x10b72},
|
||||
{0x10b78, 0x10b91}, {0x10b99, 0x10b9c}, {0x10ba9, 0x10baf}, {0x10c00, 0x10c48},
|
||||
{0x10e60, 0x10e7e}, {0x11000, 0x1104d}, {0x11052, 0x1106f}, {0x1107f, 0x110bc},
|
||||
{0x110be, 0x110c1}, {0x110d0, 0x110e8}, {0x110f0, 0x110f9}, {0x11100, 0x11134},
|
||||
{0x11136, 0x11143}, {0x11150, 0x11176}, {0x11180, 0x111c8}, {0x111d0, 0x111da},
|
||||
{0x111e1, 0x111f4}, {0x11200, 0x11211}, {0x11213, 0x1123d}, {0x112b0, 0x112ea},
|
||||
{0x112f0, 0x112f9}, {0x11301, 0x11303}, {0x11305, 0x1130c}, {0x11313, 0x11328},
|
||||
{0x1132a, 0x11330}, {0x11335, 0x11339}, {0x1133c, 0x11344}, {0x1134b, 0x1134d},
|
||||
{0x1135d, 0x11363}, {0x11366, 0x1136c}, {0x11370, 0x11374}, {0x11480, 0x114c7},
|
||||
{0x114d0, 0x114d9}, {0x11580, 0x115b5}, {0x115b8, 0x115c9}, {0x11600, 0x11644},
|
||||
{0x11650, 0x11659}, {0x11680, 0x116b7}, {0x116c0, 0x116c9}, {0x118a0, 0x118f2},
|
||||
{0x11ac0, 0x11af8}, {0x12000, 0x12398}, {0x12400, 0x1246e}, {0x12470, 0x12474},
|
||||
{0x13000, 0x1342e}, {0x16800, 0x16a38}, {0x16a40, 0x16a5e}, {0x16a60, 0x16a69},
|
||||
{0x16ad0, 0x16aed}, {0x16af0, 0x16af5}, {0x16b00, 0x16b45}, {0x16b50, 0x16b59},
|
||||
{0x16b5b, 0x16b61}, {0x16b63, 0x16b77}, {0x16b7d, 0x16b8f}, {0x16f00, 0x16f44},
|
||||
{0x16f50, 0x16f7e}, {0x16f8f, 0x16f9f}, {0x1bc00, 0x1bc6a}, {0x1bc70, 0x1bc7c},
|
||||
{0x1bc80, 0x1bc88}, {0x1bc90, 0x1bc99}, {0x1bc9c, 0x1bc9f}, {0x1d000, 0x1d0f5},
|
||||
{0x1d100, 0x1d126}, {0x1d129, 0x1d172}, {0x1d17b, 0x1d1dd}, {0x1d200, 0x1d245},
|
||||
{0x1d300, 0x1d356}, {0x1d360, 0x1d371}, {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, 0x1d7ff}, {0x1e800, 0x1e8c4}, {0x1e8c7, 0x1e8d6},
|
||||
{0x108e0, 0x108f2}, {0x108fb, 0x1091b}, {0x1091f, 0x10939}, {0x10980, 0x109b7},
|
||||
{0x109bc, 0x109cf}, {0x109d2, 0x10a03}, {0x10a0c, 0x10a13}, {0x10a15, 0x10a17},
|
||||
{0x10a19, 0x10a33}, {0x10a38, 0x10a3a}, {0x10a3f, 0x10a47}, {0x10a50, 0x10a58},
|
||||
{0x10a60, 0x10a9f}, {0x10ac0, 0x10ae6}, {0x10aeb, 0x10af6}, {0x10b00, 0x10b35},
|
||||
{0x10b39, 0x10b55}, {0x10b58, 0x10b72}, {0x10b78, 0x10b91}, {0x10b99, 0x10b9c},
|
||||
{0x10ba9, 0x10baf}, {0x10c00, 0x10c48}, {0x10c80, 0x10cb2}, {0x10cc0, 0x10cf2},
|
||||
{0x10cfa, 0x10cff}, {0x10e60, 0x10e7e}, {0x11000, 0x1104d}, {0x11052, 0x1106f},
|
||||
{0x1107f, 0x110bc}, {0x110be, 0x110c1}, {0x110d0, 0x110e8}, {0x110f0, 0x110f9},
|
||||
{0x11100, 0x11134}, {0x11136, 0x11143}, {0x11150, 0x11176}, {0x11180, 0x111cd},
|
||||
{0x111d0, 0x111df}, {0x111e1, 0x111f4}, {0x11200, 0x11211}, {0x11213, 0x1123d},
|
||||
{0x11280, 0x11286}, {0x1128a, 0x1128d}, {0x1128f, 0x1129d}, {0x1129f, 0x112a9},
|
||||
{0x112b0, 0x112ea}, {0x112f0, 0x112f9}, {0x11300, 0x11303}, {0x11305, 0x1130c},
|
||||
{0x11313, 0x11328}, {0x1132a, 0x11330}, {0x11335, 0x11339}, {0x1133c, 0x11344},
|
||||
{0x1134b, 0x1134d}, {0x1135d, 0x11363}, {0x11366, 0x1136c}, {0x11370, 0x11374},
|
||||
{0x11480, 0x114c7}, {0x114d0, 0x114d9}, {0x11580, 0x115b5}, {0x115b8, 0x115dd},
|
||||
{0x11600, 0x11644}, {0x11650, 0x11659}, {0x11680, 0x116b7}, {0x116c0, 0x116c9},
|
||||
{0x11700, 0x11719}, {0x1171d, 0x1172b}, {0x11730, 0x1173f}, {0x118a0, 0x118f2},
|
||||
{0x11ac0, 0x11af8}, {0x12000, 0x12399}, {0x12400, 0x1246e}, {0x12470, 0x12474},
|
||||
{0x12480, 0x12543}, {0x13000, 0x1342e}, {0x14400, 0x14646}, {0x16800, 0x16a38},
|
||||
{0x16a40, 0x16a5e}, {0x16a60, 0x16a69}, {0x16ad0, 0x16aed}, {0x16af0, 0x16af5},
|
||||
{0x16b00, 0x16b45}, {0x16b50, 0x16b59}, {0x16b5b, 0x16b61}, {0x16b63, 0x16b77},
|
||||
{0x16b7d, 0x16b8f}, {0x16f00, 0x16f44}, {0x16f50, 0x16f7e}, {0x16f8f, 0x16f9f},
|
||||
{0x1bc00, 0x1bc6a}, {0x1bc70, 0x1bc7c}, {0x1bc80, 0x1bc88}, {0x1bc90, 0x1bc99},
|
||||
{0x1bc9c, 0x1bc9f}, {0x1d000, 0x1d0f5}, {0x1d100, 0x1d126}, {0x1d129, 0x1d172},
|
||||
{0x1d17b, 0x1d1e8}, {0x1d200, 0x1d245}, {0x1d300, 0x1d356}, {0x1d360, 0x1d371},
|
||||
{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}, {0x1e800, 0x1e8c4}, {0x1e8c7, 0x1e8d6},
|
||||
{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, 0x1f10c}, {0x1f110, 0x1f12e}, {0x1f130, 0x1f16b}, {0x1f170, 0x1f19a},
|
||||
{0x1f1e6, 0x1f202}, {0x1f210, 0x1f23a}, {0x1f240, 0x1f248}, {0x1f300, 0x1f32c},
|
||||
{0x1f330, 0x1f37d}, {0x1f380, 0x1f3ce}, {0x1f3d4, 0x1f3f7}, {0x1f400, 0x1f4fe},
|
||||
{0x1f500, 0x1f54a}, {0x1f550, 0x1f579}, {0x1f57b, 0x1f5a3}, {0x1f5a5, 0x1f642},
|
||||
{0x1f645, 0x1f6cf}, {0x1f6e0, 0x1f6ec}, {0x1f6f0, 0x1f6f3}, {0x1f700, 0x1f773},
|
||||
{0x1f780, 0x1f7d4}, {0x1f800, 0x1f80b}, {0x1f810, 0x1f847}, {0x1f850, 0x1f859},
|
||||
{0x1f860, 0x1f887}, {0x1f890, 0x1f8ad}, {0x20000, 0x2a6d6}, {0x2a700, 0x2b734},
|
||||
{0x2b740, 0x2b81d}, {0x2f800, 0x2fa1d}, {0xe0100, 0xe01ef}
|
||||
{0x1f1e6, 0x1f202}, {0x1f210, 0x1f23a}, {0x1f240, 0x1f248}, {0x1f300, 0x1f579},
|
||||
{0x1f57b, 0x1f5a3}, {0x1f5a5, 0x1f6d0}, {0x1f6e0, 0x1f6ec}, {0x1f6f0, 0x1f6f3},
|
||||
{0x1f700, 0x1f773}, {0x1f780, 0x1f7d4}, {0x1f800, 0x1f80b}, {0x1f810, 0x1f847},
|
||||
{0x1f850, 0x1f859}, {0x1f860, 0x1f887}, {0x1f890, 0x1f8ad}, {0x1f910, 0x1f918},
|
||||
{0x1f980, 0x1f984}, {0x20000, 0x2a6d6}, {0x2a700, 0x2b734}, {0x2b740, 0x2b81d},
|
||||
{0x2b820, 0x2cea1}, {0x2f800, 0x2fa1d}, {0xe0100, 0xe01ef}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -731,23 +744,23 @@ static const chr graphCharTable[] = {
|
||||
0x38c, 0x589, 0x58a, 0x85e, 0x98f, 0x990, 0x9b2, 0x9c7, 0x9c8,
|
||||
0x9d7, 0x9dc, 0x9dd, 0xa0f, 0xa10, 0xa32, 0xa33, 0xa35, 0xa36,
|
||||
0xa38, 0xa39, 0xa3c, 0xa47, 0xa48, 0xa51, 0xa5e, 0xab2, 0xab3,
|
||||
0xad0, 0xb0f, 0xb10, 0xb32, 0xb33, 0xb47, 0xb48, 0xb56, 0xb57,
|
||||
0xb5c, 0xb5d, 0xb82, 0xb83, 0xb99, 0xb9a, 0xb9c, 0xb9e, 0xb9f,
|
||||
0xba3, 0xba4, 0xbd0, 0xbd7, 0xc55, 0xc56, 0xc58, 0xc59, 0xcd5,
|
||||
0xcd6, 0xcde, 0xcf1, 0xcf2, 0xd57, 0xd82, 0xd83, 0xdbd, 0xdca,
|
||||
0xdd6, 0xe81, 0xe82, 0xe84, 0xe87, 0xe88, 0xe8a, 0xe8d, 0xea5,
|
||||
0xea7, 0xeaa, 0xeab, 0xec6, 0x10c7, 0x10cd, 0x1258, 0x12c0, 0x1772,
|
||||
0x1773, 0x1940, 0x1cf8, 0x1cf9, 0x1f59, 0x1f5b, 0x1f5d, 0x2070, 0x2071,
|
||||
0x2d27, 0x2d2d, 0x2d6f, 0x2d70, 0xa7b0, 0xa7b1, 0xab64, 0xab65, 0xfb3e,
|
||||
0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfffc, 0xfffd
|
||||
0xad0, 0xaf9, 0xb0f, 0xb10, 0xb32, 0xb33, 0xb47, 0xb48, 0xb56,
|
||||
0xb57, 0xb5c, 0xb5d, 0xb82, 0xb83, 0xb99, 0xb9a, 0xb9c, 0xb9e,
|
||||
0xb9f, 0xba3, 0xba4, 0xbd0, 0xbd7, 0xc55, 0xc56, 0xcd5, 0xcd6,
|
||||
0xcde, 0xcf1, 0xcf2, 0xd57, 0xd82, 0xd83, 0xdbd, 0xdca, 0xdd6,
|
||||
0xe81, 0xe82, 0xe84, 0xe87, 0xe88, 0xe8a, 0xe8d, 0xea5, 0xea7,
|
||||
0xeaa, 0xeab, 0xec6, 0x10c7, 0x10cd, 0x1258, 0x12c0, 0x1772, 0x1773,
|
||||
0x1940, 0x1cf8, 0x1cf9, 0x1f59, 0x1f5b, 0x1f5d, 0x2070, 0x2071, 0x2d27,
|
||||
0x2d2d, 0x2d6f, 0x2d70, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfffc,
|
||||
0xfffd
|
||||
#if TCL_UTF_MAX > 4
|
||||
,0x1003c, 0x1003d, 0x101a0, 0x1056f, 0x10808, 0x10837, 0x10838, 0x1083c, 0x1093f,
|
||||
0x109be, 0x109bf, 0x10a05, 0x10a06, 0x111cd, 0x1130f, 0x11310, 0x11332, 0x11333,
|
||||
0x11347, 0x11348, 0x11357, 0x118ff, 0x16a6e, 0x16a6f, 0x1b000, 0x1b001, 0x1d49e,
|
||||
0x1d49f, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4bb, 0x1d546, 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
|
||||
,0x1003c, 0x1003d, 0x101a0, 0x1056f, 0x10808, 0x10837, 0x10838, 0x1083c, 0x108f4,
|
||||
0x108f5, 0x1093f, 0x10a05, 0x10a06, 0x11288, 0x1130f, 0x11310, 0x11332, 0x11333,
|
||||
0x11347, 0x11348, 0x11350, 0x11357, 0x118ff, 0x16a6e, 0x16a6f, 0x1b000, 0x1b001,
|
||||
0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4bb, 0x1d546, 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, 0x1f9c0
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
+1565
-396
File diff suppressed because it is too large
Load Diff
+148
-98
@@ -83,9 +83,6 @@ static int lexdigits(struct vars *, int, int, int);
|
||||
static int brenext(struct vars *, pchr);
|
||||
static void skip(struct vars *);
|
||||
static chr newline(NOPARMS);
|
||||
#ifdef REG_DEBUG
|
||||
static const chr *ch(NOPARMS);
|
||||
#endif
|
||||
static chr chrnamed(struct vars *, const chr *, const chr *, pchr);
|
||||
/* === regc_color.c === */
|
||||
static void initcm(struct vars *, struct colormap *);
|
||||
@@ -119,17 +116,22 @@ static void dropstate(struct nfa *, struct state *);
|
||||
static void freestate(struct nfa *, struct state *);
|
||||
static void destroystate(struct nfa *, struct state *);
|
||||
static void newarc(struct nfa *, int, pcolor, struct state *, struct state *);
|
||||
static void createarc(struct nfa *, int, pcolor, struct state *, struct state *);
|
||||
static struct arc *allocarc(struct nfa *, struct state *);
|
||||
static void freearc(struct nfa *, struct arc *);
|
||||
static void changearctarget(struct arc *, struct state *);
|
||||
static int hasnonemptyout(struct state *);
|
||||
static int nonemptyouts(struct state *);
|
||||
static int nonemptyins(struct state *);
|
||||
static struct arc *findarc(struct state *, int, pcolor);
|
||||
static void cparc(struct nfa *, struct arc *, struct state *, struct state *);
|
||||
static void sortins(struct nfa *, struct state *);
|
||||
static int sortins_cmp(const void *, const void *);
|
||||
static void sortouts(struct nfa *, struct state *);
|
||||
static int sortouts_cmp(const void *, const void *);
|
||||
static void moveins(struct nfa *, struct state *, struct state *);
|
||||
static void copyins(struct nfa *, struct state *, struct state *, int);
|
||||
static void copyins(struct nfa *, struct state *, struct state *);
|
||||
static void mergeins(struct nfa *, struct state *, struct arc **, int);
|
||||
static void moveouts(struct nfa *, struct state *, struct state *);
|
||||
static void copyouts(struct nfa *, struct state *, struct state *, int);
|
||||
static void copyouts(struct nfa *, struct state *, struct state *);
|
||||
static void cloneouts(struct nfa *, struct state *, struct state *, struct state *, int);
|
||||
static void delsub(struct nfa *, struct state *, struct state *);
|
||||
static void deltraverse(struct nfa *, struct state *, struct state *);
|
||||
@@ -139,33 +141,40 @@ static void cleartraverse(struct nfa *, struct state *);
|
||||
static void specialcolors(struct nfa *);
|
||||
static long optimize(struct nfa *, FILE *);
|
||||
static void pullback(struct nfa *, FILE *);
|
||||
static int pull(struct nfa *, struct arc *);
|
||||
static int pull(struct nfa *, struct arc *, struct state **);
|
||||
static void pushfwd(struct nfa *, FILE *);
|
||||
static int push(struct nfa *, struct arc *);
|
||||
static int push(struct nfa *, struct arc *, struct state **);
|
||||
#define INCOMPATIBLE 1 /* destroys arc */
|
||||
#define SATISFIED 2 /* constraint satisfied */
|
||||
#define COMPATIBLE 3 /* compatible but not satisfied yet */
|
||||
static int combine(struct arc *, struct arc *);
|
||||
static void fixempties(struct nfa *, FILE *);
|
||||
static struct state *emptyreachable(struct state *, struct state *);
|
||||
static void replaceempty(struct nfa *, struct state *, struct state *);
|
||||
static struct state *emptyreachable(struct nfa *, struct state *,
|
||||
struct state *, struct arc **);
|
||||
static int isconstraintarc(struct arc *);
|
||||
static int hasconstraintout(struct state *);
|
||||
static void fixconstraintloops(struct nfa *, FILE *);
|
||||
static int findconstraintloop(struct nfa *, struct state *);
|
||||
static void breakconstraintloop(struct nfa *, struct state *);
|
||||
static void clonesuccessorstates(struct nfa *, struct state *, struct state *,
|
||||
struct state *, struct arc *, char *, char *, int);
|
||||
static void cleanup(struct nfa *);
|
||||
static void markreachable(struct nfa *, struct state *, struct state *, struct state *);
|
||||
static void markcanreach(struct nfa *, struct state *, struct state *, struct state *);
|
||||
static long analyze(struct nfa *);
|
||||
static void compact(struct nfa *, struct cnfa *);
|
||||
static void carcsort(struct carc *, struct carc *);
|
||||
static void carcsort(struct carc *, size_t);
|
||||
static int carc_cmp(const void *, const void *);
|
||||
static void freecnfa(struct cnfa *);
|
||||
static void dumpnfa(struct nfa *, FILE *);
|
||||
#ifdef REG_DEBUG
|
||||
static void dumpstate(struct state *, FILE *);
|
||||
static void dumparcs(struct state *, FILE *);
|
||||
static int dumprarcs(struct arc *, struct state *, FILE *, int);
|
||||
static void dumparc(struct arc *, struct state *, FILE *);
|
||||
#endif
|
||||
static void dumpcnfa(struct cnfa *, FILE *);
|
||||
#ifdef REG_DEBUG
|
||||
static void dumpcstate(int, struct carc *, struct cnfa *, FILE *);
|
||||
static void dumpcstate(int, struct cnfa *, FILE *);
|
||||
#endif
|
||||
/* === regc_cvec.c === */
|
||||
static struct cvec *clearcvec(struct cvec *);
|
||||
@@ -210,11 +219,12 @@ struct vars {
|
||||
struct subre *tree; /* subexpression tree */
|
||||
struct subre *treechain; /* all tree nodes allocated */
|
||||
struct subre *treefree; /* any free tree nodes */
|
||||
int ntree; /* number of tree nodes */
|
||||
int ntree; /* number of tree nodes, plus one */
|
||||
struct cvec *cv; /* interface cvec */
|
||||
struct cvec *cv2; /* utility cvec */
|
||||
struct subre *lacons; /* lookahead-constraint vector */
|
||||
int nlacons; /* size of lacons */
|
||||
size_t spaceused; /* approx. space used for compilation */
|
||||
};
|
||||
|
||||
/* parsing macros; most know that `v' is the struct vars pointer */
|
||||
@@ -223,13 +233,13 @@ struct vars {
|
||||
#define EAT(t) (SEE(t) && next(v)) /* if next is this, swallow it */
|
||||
#define VISERR(vv) ((vv)->err != 0)/* have we seen an error yet? */
|
||||
#define ISERR() VISERR(v)
|
||||
#define VERR(vv,e) \
|
||||
((vv)->nexttype = EOS, ((vv)->err) ? (vv)->err : ((vv)->err = (e)))
|
||||
#define VERR(vv,e) ((vv)->nexttype = EOS, \
|
||||
(vv)->err = ((vv)->err ? (vv)->err : (e)))
|
||||
#define ERR(e) VERR(v, e) /* record an error */
|
||||
#define NOERR() {if (ISERR()) return;} /* if error seen, return */
|
||||
#define NOERRN() {if (ISERR()) return NULL;} /* NOERR with retval */
|
||||
#define NOERRZ() {if (ISERR()) return 0;} /* NOERR with retval */
|
||||
#define INSIST(c, e) ((c) ? 0 : ERR(e)) /* if condition false, error */
|
||||
#define INSIST(c, e) do { if (!(c)) ERR(e); } while (0) /* error if c false */
|
||||
#define NOTE(b) (v->re->re_info |= (b)) /* note visible condition */
|
||||
#define EMPTYARC(x, y) newarc(v->nfa, EMPTY, 0, x, y)
|
||||
|
||||
@@ -258,12 +268,14 @@ struct vars {
|
||||
((a)->type == PLAIN || (a)->type == AHEAD || (a)->type == BEHIND)
|
||||
|
||||
/* static function list */
|
||||
static struct fns functions = {
|
||||
static const struct fns functions = {
|
||||
rfree, /* regfree insides */
|
||||
};
|
||||
|
||||
/*
|
||||
- compile - compile regular expression
|
||||
* Note: on failure, no resources remain allocated, so regfree()
|
||||
* need not be applied to re.
|
||||
^ int compile(regex_t *, const chr *, size_t, int);
|
||||
*/
|
||||
int
|
||||
@@ -324,6 +336,7 @@ compile(
|
||||
v->cv2 = NULL;
|
||||
v->lacons = NULL;
|
||||
v->nlacons = 0;
|
||||
v->spaceused = 0;
|
||||
re->re_magic = REMAGIC;
|
||||
re->re_info = 0; /* bits get set during parse */
|
||||
re->re_csize = sizeof(chr);
|
||||
@@ -593,13 +606,15 @@ makesearch(
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (b != NULL && s->tmp == NULL) {
|
||||
/*
|
||||
* Must be split if not already in the list (fixes bugs 505048,
|
||||
* 230589, 840258, 504785).
|
||||
*/
|
||||
|
||||
s->tmp = slist;
|
||||
/*
|
||||
* We want to mark states as being in the list already by having non
|
||||
* NULL tmp fields, but we can't just store the old slist value in tmp
|
||||
* because that doesn't work for the first such state. Instead, the
|
||||
* first list entry gets its own address in tmp.
|
||||
*/
|
||||
if (b != NULL && s->tmp == NULL) {
|
||||
s->tmp = (slist != NULL) ? slist : s;
|
||||
slist = s;
|
||||
}
|
||||
}
|
||||
@@ -610,8 +625,9 @@ makesearch(
|
||||
|
||||
for (s=slist ; s!=NULL ; s=s2) {
|
||||
s2 = newstate(nfa);
|
||||
|
||||
copyouts(nfa, s, s2, 1);
|
||||
NOERR();
|
||||
copyouts(nfa, s, s2);
|
||||
NOERR();
|
||||
for (a=s->ins ; a!=NULL ; a=b) {
|
||||
b = a->inchain;
|
||||
|
||||
@@ -620,7 +636,7 @@ makesearch(
|
||||
freearc(nfa, a);
|
||||
}
|
||||
}
|
||||
s2 = s->tmp;
|
||||
s2 = (s->tmp != s) ? s->tmp : NULL;
|
||||
s->tmp = NULL; /* clean up while we're at it */
|
||||
}
|
||||
}
|
||||
@@ -982,6 +998,7 @@ parseqatom(
|
||||
NOERR();
|
||||
assert(v->nextvalue > 0);
|
||||
atom = subre(v, 'b', BACKR, lp, rp);
|
||||
NOERR();
|
||||
subno = v->nextvalue;
|
||||
atom->subno = subno;
|
||||
EMPTYARC(lp, rp); /* temporarily, so there's something */
|
||||
@@ -996,13 +1013,13 @@ parseqatom(
|
||||
switch (v->nexttype) {
|
||||
case '*':
|
||||
m = 0;
|
||||
n = INFINITY;
|
||||
n = DUPINF;
|
||||
qprefer = (v->nextvalue) ? LONGER : SHORTER;
|
||||
NEXT();
|
||||
break;
|
||||
case '+':
|
||||
m = 1;
|
||||
n = INFINITY;
|
||||
n = DUPINF;
|
||||
qprefer = (v->nextvalue) ? LONGER : SHORTER;
|
||||
NEXT();
|
||||
break;
|
||||
@@ -1019,7 +1036,7 @@ parseqatom(
|
||||
if (SEE(DIGIT)) {
|
||||
n = scannum(v);
|
||||
} else {
|
||||
n = INFINITY;
|
||||
n = DUPINF;
|
||||
}
|
||||
if (m > n) {
|
||||
ERR(REG_BADBR);
|
||||
@@ -1102,11 +1119,17 @@ parseqatom(
|
||||
/*
|
||||
* Prepare a general-purpose state skeleton.
|
||||
*
|
||||
* ---> [s] ---prefix---> [begin] ---atom---> [end] ----rest---> [rp]
|
||||
* / /
|
||||
* [lp] ----> [s2] ----bypass---------------------
|
||||
* In the no-backrefs case, we want this:
|
||||
*
|
||||
* where bypass is an empty, and prefix is some repetitions of atom
|
||||
* [lp] ---> [s] ---prefix---> [begin] ---atom---> [end] ---rest---> [rp]
|
||||
*
|
||||
* where prefix is some repetitions of atom. In the general case we need
|
||||
*
|
||||
* [lp] ---> [s] ---iterator---> [s2] ---rest---> [rp]
|
||||
*
|
||||
* where the iterator wraps around [begin] ---atom---> [end]
|
||||
*
|
||||
* We make the s state here for both cases; s2 is made below if needed
|
||||
*/
|
||||
|
||||
s = newstate(v->nfa); /* first, new endpoints for the atom */
|
||||
@@ -1117,11 +1140,9 @@ parseqatom(
|
||||
NOERR();
|
||||
atom->begin = s;
|
||||
atom->end = s2;
|
||||
s = newstate(v->nfa); /* and spots for prefix and bypass */
|
||||
s2 = newstate(v->nfa);
|
||||
s = newstate(v->nfa); /* set up starting state */
|
||||
NOERR();
|
||||
EMPTYARC(lp, s);
|
||||
EMPTYARC(lp, s2);
|
||||
NOERR();
|
||||
|
||||
/*
|
||||
@@ -1129,6 +1150,7 @@ parseqatom(
|
||||
*/
|
||||
|
||||
t = subre(v, '.', COMBINE(qprefer, atom->flags), lp, rp);
|
||||
NOERR();
|
||||
t->left = atom;
|
||||
atomp = &t->left;
|
||||
|
||||
@@ -1142,6 +1164,7 @@ parseqatom(
|
||||
|
||||
assert(top->op == '=' && top->left == NULL && top->right == NULL);
|
||||
top->left = subre(v, '=', top->flags, top->begin, lp);
|
||||
NOERR();
|
||||
top->op = '.';
|
||||
top->right = t;
|
||||
|
||||
@@ -1166,27 +1189,8 @@ parseqatom(
|
||||
}
|
||||
|
||||
/*
|
||||
* It's quantifier time; first, turn x{0,...} into x{1,...}|empty
|
||||
*/
|
||||
|
||||
if (m == 0) {
|
||||
EMPTYARC(s2, atom->end);/* the bypass */
|
||||
assert(PREF(qprefer) != 0);
|
||||
f = COMBINE(qprefer, atom->flags);
|
||||
t = subre(v, '|', f, lp, atom->end);
|
||||
NOERR();
|
||||
t->left = atom;
|
||||
t->right = subre(v, '|', PREF(f), s2, atom->end);
|
||||
NOERR();
|
||||
t->right->left = subre(v, '=', 0, s2, atom->end);
|
||||
NOERR();
|
||||
*atomp = t;
|
||||
atomp = &t->left;
|
||||
m = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Deal with the rest of the quantifier.
|
||||
* It's quantifier time. If the atom is just a backref, we'll let it deal
|
||||
* with quantifiers internally.
|
||||
*/
|
||||
|
||||
if (atomtype == BACKREF) {
|
||||
@@ -1204,21 +1208,29 @@ parseqatom(
|
||||
atom->min = (short) m;
|
||||
atom->max = (short) n;
|
||||
atom->flags |= COMBINE(qprefer, atom->flags);
|
||||
/* rest of branch can be strung starting from atom->end */
|
||||
s2 = atom->end;
|
||||
} else if (m == 1 && n == 1) {
|
||||
/*
|
||||
* No/vacuous quantifier: done.
|
||||
*/
|
||||
|
||||
EMPTYARC(s, atom->begin); /* empty prefix */
|
||||
} else {
|
||||
/* rest of branch can be strung starting from atom->end */
|
||||
s2 = atom->end;
|
||||
} else if (m > 0 && !(atom->flags & BACKR)) {
|
||||
/*
|
||||
* Turn x{m,n} into x{m-1,n-1}x, with capturing parens in only second
|
||||
* x
|
||||
* If there's no backrefs involved, we can turn x{m,n} into
|
||||
* x{m-1,n-1}x, with capturing parens in only the second x. This
|
||||
* is valid because we only care about capturing matches from the
|
||||
* final iteration of the quantifier. It's a win because we can
|
||||
* implement the backref-free left side as a plain DFA node, since
|
||||
* we don't really care where its submatches are.
|
||||
*/
|
||||
|
||||
dupnfa(v->nfa, atom->begin, atom->end, s, atom->begin);
|
||||
assert(m >= 1 && m != INFINITY && n >= 1);
|
||||
repeat(v, s, atom->begin, m-1, (n == INFINITY) ? n : n-1);
|
||||
assert(m >= 1 && m != DUPINF && n >= 1);
|
||||
repeat(v, s, atom->begin, m-1, (n == DUPINF) ? n : n-1);
|
||||
f = COMBINE(qprefer, atom->flags);
|
||||
t = subre(v, '.', f, s, atom->end); /* prefix and atom */
|
||||
NOERR();
|
||||
@@ -1226,6 +1238,24 @@ parseqatom(
|
||||
NOERR();
|
||||
t->right = atom;
|
||||
*atomp = t;
|
||||
/* rest of branch can be strung starting from atom->end */
|
||||
s2 = atom->end;
|
||||
} else {
|
||||
/* general case: need an iteration node */
|
||||
s2 = newstate(v->nfa);
|
||||
NOERR();
|
||||
moveouts(v->nfa, atom->end, s2);
|
||||
NOERR();
|
||||
dupnfa(v->nfa, atom->begin, atom->end, s, s2);
|
||||
repeat(v, s, s2, m, n);
|
||||
f = COMBINE(qprefer, atom->flags);
|
||||
t = subre(v, '*', f, s, s2);
|
||||
NOERR();
|
||||
t->min = (short) m;
|
||||
t->max = (short) n;
|
||||
t->left = atom;
|
||||
*atomp = t;
|
||||
/* rest of branch is to be strung from iteration's end state */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1234,10 +1264,10 @@ parseqatom(
|
||||
|
||||
t = top->right;
|
||||
if (!(SEE('|') || SEE(stopper) || SEE(EOS))) {
|
||||
t->right = parsebranch(v, stopper, type, atom->end, rp, 1);
|
||||
t->right = parsebranch(v, stopper, type, s2, rp, 1);
|
||||
} else {
|
||||
EMPTYARC(atom->end, rp);
|
||||
t->right = subre(v, '=', 0, atom->end, rp);
|
||||
EMPTYARC(s2, rp);
|
||||
t->right = subre(v, '=', 0, s2, rp);
|
||||
}
|
||||
NOERR();
|
||||
assert(SEE('|') || SEE(stopper) || SEE(EOS));
|
||||
@@ -1304,6 +1334,8 @@ scannum(
|
||||
|
||||
/*
|
||||
- repeat - replicate subNFA for quantifiers
|
||||
* The sub-NFA strung from lp to rp is modified to represent m to n
|
||||
* repetitions of its initial contents.
|
||||
* The duplication sequences used here are chosen carefully so that any
|
||||
* pointers starting out pointing into the subexpression end up pointing into
|
||||
* the last occurrence. (Note that it may not be strung between the same left
|
||||
@@ -1323,7 +1355,7 @@ repeat(
|
||||
#define SOME 2
|
||||
#define INF 3
|
||||
#define PAIR(x, y) ((x)*4 + (y))
|
||||
#define REDUCE(x) ( ((x) == INFINITY) ? INF : (((x) > 1) ? SOME : (x)) )
|
||||
#define REDUCE(x) ( ((x) == DUPINF) ? INF : (((x) > 1) ? SOME : (x)) )
|
||||
const int rm = REDUCE(m);
|
||||
const int rn = REDUCE(n);
|
||||
struct state *s, *s2;
|
||||
@@ -1713,11 +1745,11 @@ subre(
|
||||
v->treechain = ret;
|
||||
}
|
||||
|
||||
assert(strchr("|.b(=", op) != NULL);
|
||||
assert(strchr("=b|.*(", op) != NULL);
|
||||
|
||||
ret->op = op;
|
||||
ret->flags = flags;
|
||||
ret->retry = 0;
|
||||
ret->id = 0; /* will be assigned later */
|
||||
ret->subno = 0;
|
||||
ret->min = ret->max = 1;
|
||||
ret->left = NULL;
|
||||
@@ -1770,7 +1802,8 @@ freesrnode(
|
||||
}
|
||||
sr->flags = 0;
|
||||
|
||||
if (v != NULL) {
|
||||
if (v != NULL && v->treechain != NULL) {
|
||||
/* we're still parsing, maybe we can reuse the subre */
|
||||
sr->left = v->treefree;
|
||||
v->treefree = sr;
|
||||
} else {
|
||||
@@ -1798,7 +1831,7 @@ optst(
|
||||
}
|
||||
|
||||
/*
|
||||
- numst - number tree nodes (assigning retry indexes)
|
||||
- numst - number tree nodes (assigning "id" indexes)
|
||||
^ static int numst(struct subre *, int);
|
||||
*/
|
||||
static int /* next number */
|
||||
@@ -1811,7 +1844,7 @@ numst(
|
||||
assert(t != NULL);
|
||||
|
||||
i = start;
|
||||
t->retry = (short) i++;
|
||||
t->id = (short) i++;
|
||||
if (t->left != NULL) {
|
||||
i = numst(t->left, i);
|
||||
}
|
||||
@@ -1823,6 +1856,19 @@ numst(
|
||||
|
||||
/*
|
||||
- markst - mark tree nodes as INUSE
|
||||
* Note: this is a great deal more subtle than it looks. During initial
|
||||
* parsing of a regex, all subres are linked into the treechain list;
|
||||
* discarded ones are also linked into the treefree list for possible reuse.
|
||||
* After we are done creating all subres required for a regex, we run markst()
|
||||
* then cleanst(), which results in discarding all subres not reachable from
|
||||
* v->tree. We then clear v->treechain, indicating that subres must be found
|
||||
* by descending from v->tree. This changes the behavior of freesubre(): it
|
||||
* will henceforth FREE() unwanted subres rather than sticking them into the
|
||||
* treefree list. (Doing that any earlier would result in dangling links in
|
||||
* the treechain list.) This all means that freev() will clean up correctly
|
||||
* if invoked before or after markst()+cleanst(); but it would not work if
|
||||
* called partway through this state conversion, so we mustn't error out
|
||||
* in or between these two functions.
|
||||
^ static void markst(struct subre *);
|
||||
*/
|
||||
static void
|
||||
@@ -1929,24 +1975,26 @@ newlacon(
|
||||
struct state *end,
|
||||
int pos)
|
||||
{
|
||||
struct subre *sub;
|
||||
int n;
|
||||
struct subre *newlacons;
|
||||
struct subre *sub;
|
||||
|
||||
if (v->nlacons == 0) {
|
||||
v->lacons = (struct subre *) MALLOC(2 * sizeof(struct subre));
|
||||
n = 1; /* skip 0th */
|
||||
v->nlacons = 2;
|
||||
newlacons = (struct subre *) MALLOC(2 * sizeof(struct subre));
|
||||
} else {
|
||||
v->lacons = (struct subre *) REALLOC(v->lacons,
|
||||
(v->nlacons+1)*sizeof(struct subre));
|
||||
n = v->nlacons++;
|
||||
n = v->nlacons;
|
||||
newlacons = (struct subre *) REALLOC(v->lacons,
|
||||
(n + 1) * sizeof(struct subre));
|
||||
}
|
||||
|
||||
if (v->lacons == NULL) {
|
||||
if (newlacons == NULL) {
|
||||
ERR(REG_ESPACE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
v->lacons = newlacons;
|
||||
v->nlacons = n + 1;
|
||||
sub = &v->lacons[n];
|
||||
sub->begin = begin;
|
||||
sub->end = end;
|
||||
@@ -1994,18 +2042,20 @@ rfree(
|
||||
g = (struct guts *) re->re_guts;
|
||||
re->re_guts = NULL;
|
||||
re->re_fns = NULL;
|
||||
g->magic = 0;
|
||||
freecm(&g->cmap);
|
||||
if (g->tree != NULL) {
|
||||
freesubre(NULL, g->tree);
|
||||
if (g != NULL) {
|
||||
g->magic = 0;
|
||||
freecm(&g->cmap);
|
||||
if (g->tree != NULL) {
|
||||
freesubre(NULL, g->tree);
|
||||
}
|
||||
if (g->lacons != NULL) {
|
||||
freelacons(g->lacons, g->nlacons);
|
||||
}
|
||||
if (!NULLCNFA(g->search)) {
|
||||
freecnfa(&g->search);
|
||||
}
|
||||
FREE(g);
|
||||
}
|
||||
if (g->lacons != NULL) {
|
||||
freelacons(g->lacons, g->nlacons);
|
||||
}
|
||||
if (!NULLCNFA(g->search)) {
|
||||
freecnfa(&g->search);
|
||||
}
|
||||
FREE(g);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2037,11 +2087,11 @@ dump(
|
||||
|
||||
fprintf(f, "\n\n\n========= DUMP ==========\n");
|
||||
fprintf(f, "nsub %d, info 0%lo, csize %d, ntree %d\n",
|
||||
re->re_nsub, re->re_info, re->re_csize, g->ntree);
|
||||
(int) re->re_nsub, re->re_info, re->re_csize, g->ntree);
|
||||
|
||||
dumpcolors(&g->cmap, f);
|
||||
if (!NULLCNFA(g->search)) {
|
||||
printf("\nsearch:\n");
|
||||
fprintf(f, "\nsearch:\n");
|
||||
dumpcnfa(&g->search, f);
|
||||
}
|
||||
for (i = 1; i < g->nlacons; i++) {
|
||||
@@ -2108,7 +2158,7 @@ stdump(
|
||||
}
|
||||
if (t->min != 1 || t->max != 1) {
|
||||
fprintf(f, " {%d,", t->min);
|
||||
if (t->max != INFINITY) {
|
||||
if (t->max != DUPINF) {
|
||||
fprintf(f, "%d", t->max);
|
||||
}
|
||||
fprintf(f, "}");
|
||||
@@ -2146,14 +2196,14 @@ stid(
|
||||
size_t bufsize)
|
||||
{
|
||||
/*
|
||||
* Big enough for hex int or decimal t->retry?
|
||||
* Big enough for hex int or decimal t->id?
|
||||
*/
|
||||
|
||||
if (bufsize < sizeof(void*)*2 + 3 || bufsize < sizeof(t->retry)*3 + 1) {
|
||||
if (bufsize < sizeof(void*)*2 + 3 || bufsize < sizeof(t->id)*3 + 1) {
|
||||
return "unable";
|
||||
}
|
||||
if (t->retry != 0) {
|
||||
sprintf(buf, "%d", t->retry);
|
||||
if (t->id != 0) {
|
||||
sprintf(buf, "%d", t->id);
|
||||
} else {
|
||||
sprintf(buf, "%p", t);
|
||||
}
|
||||
|
||||
@@ -60,12 +60,6 @@
|
||||
#ifdef __REG_REGOFF_T
|
||||
#undef __REG_REGOFF_T
|
||||
#endif
|
||||
#ifdef __REG_VOID_T
|
||||
#undef __REG_VOID_T
|
||||
#endif
|
||||
#ifdef __REG_CONST
|
||||
#undef __REG_CONST
|
||||
#endif
|
||||
#ifdef __REG_NOFRONT
|
||||
#undef __REG_NOFRONT
|
||||
#endif
|
||||
@@ -75,8 +69,6 @@
|
||||
/* Interface types */
|
||||
#define __REG_WIDE_T Tcl_UniChar
|
||||
#define __REG_REGOFF_T long /* Not really right, but good enough... */
|
||||
#define __REG_VOID_T void
|
||||
#define __REG_CONST const
|
||||
/* Names and declarations */
|
||||
#define __REG_WIDE_COMPILE TclReComp
|
||||
#define __REG_WIDE_EXEC TclReExec
|
||||
|
||||
+15
-14
@@ -84,7 +84,7 @@ longest(
|
||||
|
||||
if (v->eflags®_FTRACE) {
|
||||
while (cp < realstop) {
|
||||
FDEBUG(("+++ at c%d +++\n", css - d->ssets));
|
||||
FDEBUG(("+++ at c%d +++\n", (int) (css - d->ssets)));
|
||||
co = GETCOLOR(cm, *cp);
|
||||
FDEBUG(("char %c, color %ld\n", (char)*cp, (long)co));
|
||||
ss = css->outs[co];
|
||||
@@ -118,7 +118,7 @@ longest(
|
||||
* Shutdown.
|
||||
*/
|
||||
|
||||
FDEBUG(("+++ shutdown at c%d +++\n", css - d->ssets));
|
||||
FDEBUG(("+++ shutdown at c%d +++\n", (int) (css - d->ssets)));
|
||||
if (cp == v->stop && stop == v->stop) {
|
||||
if (hitstopp != NULL) {
|
||||
*hitstopp = 1;
|
||||
@@ -213,7 +213,7 @@ shortest(
|
||||
|
||||
if (v->eflags®_FTRACE) {
|
||||
while (cp < realmax) {
|
||||
FDEBUG(("--- at c%d ---\n", css - d->ssets));
|
||||
FDEBUG(("--- at c%d ---\n", (int) (css - d->ssets)));
|
||||
co = GETCOLOR(cm, *cp);
|
||||
FDEBUG(("char %c, color %ld\n", (char)*cp, (long)co));
|
||||
ss = css->outs[co];
|
||||
@@ -516,14 +516,14 @@ miss(
|
||||
gotState = 0;
|
||||
for (i = 0; i < d->nstates; i++) {
|
||||
if (ISBSET(css->states, i)) {
|
||||
for (ca = cnfa->states[i]+1; ca->co != COLORLESS; ca++) {
|
||||
for (ca = cnfa->states[i]; ca->co != COLORLESS; ca++) {
|
||||
if (ca->co == co) {
|
||||
BSET(d->work, ca->to);
|
||||
gotState = 1;
|
||||
if (ca->to == cnfa->post) {
|
||||
isPost = 1;
|
||||
}
|
||||
if (!cnfa->states[ca->to]->co) {
|
||||
if (!(cnfa->stflags[ca->to] & CNFA_NOPROGRESS)) {
|
||||
noProgress = 0;
|
||||
}
|
||||
FDEBUG(("%d -> %d\n", i, ca->to));
|
||||
@@ -537,8 +537,8 @@ miss(
|
||||
doLAConstraints = 0;
|
||||
for (i = 0; i < d->nstates; i++) {
|
||||
if (ISBSET(d->work, i)) {
|
||||
for (ca = cnfa->states[i]+1; ca->co != COLORLESS; ca++) {
|
||||
if (ca->co <= cnfa->ncolors) {
|
||||
for (ca = cnfa->states[i]; ca->co != COLORLESS; ca++) {
|
||||
if (ca->co < cnfa->ncolors) {
|
||||
continue; /* NOTE CONTINUE */
|
||||
}
|
||||
sawLAConstraints = 1;
|
||||
@@ -553,7 +553,7 @@ miss(
|
||||
if (ca->to == cnfa->post) {
|
||||
isPost = 1;
|
||||
}
|
||||
if (!cnfa->states[ca->to]->co) {
|
||||
if (!(cnfa->stflags[ca->to] & CNFA_NOPROGRESS)) {
|
||||
noProgress = 0;
|
||||
}
|
||||
FDEBUG(("%d :> %d\n", i, ca->to));
|
||||
@@ -572,7 +572,7 @@ miss(
|
||||
|
||||
for (p = d->ssets, i = d->nssused; i > 0; p++, i--) {
|
||||
if (HIT(h, d->work, p, d->wordsper)) {
|
||||
FDEBUG(("cached c%d\n", p - d->ssets));
|
||||
FDEBUG(("cached c%d\n", (int) (p - d->ssets)));
|
||||
break; /* NOTE BREAK OUT */
|
||||
}
|
||||
}
|
||||
@@ -594,7 +594,8 @@ miss(
|
||||
}
|
||||
|
||||
if (!sawLAConstraints) { /* lookahead conds. always cache miss */
|
||||
FDEBUG(("c%d[%d]->c%d\n", css - d->ssets, co, p - d->ssets));
|
||||
FDEBUG(("c%d[%d]->c%d\n",
|
||||
(int) (css - d->ssets), co, (int) (p - d->ssets)));
|
||||
css->outs[co] = p;
|
||||
css->inchain[co] = p->ins;
|
||||
p->ins.ss = css;
|
||||
@@ -663,7 +664,7 @@ getVacantSS(
|
||||
ap = ss->ins;
|
||||
while ((p = ap.ss) != NULL) {
|
||||
co = ap.co;
|
||||
FDEBUG(("zapping c%d's %ld outarc\n", p - d->ssets, (long)co));
|
||||
FDEBUG(("zapping c%d's %ld outarc\n", (int) (p - d->ssets), (long)co));
|
||||
p->outs[co] = NULL;
|
||||
ap = p->inchain[co];
|
||||
p->inchain[co].ss = NULL; /* paranoia */
|
||||
@@ -680,7 +681,7 @@ getVacantSS(
|
||||
if (p == NULL) {
|
||||
continue; /* NOTE CONTINUE */
|
||||
}
|
||||
FDEBUG(("del outarc %d from c%d's in chn\n", i, p - d->ssets));
|
||||
FDEBUG(("del outarc %d from c%d's in chn\n", i, (int) (p - d->ssets)));
|
||||
if (p->ins.ss == ss && p->ins.co == i) {
|
||||
p->ins = ss->inchain[i];
|
||||
} else {
|
||||
@@ -772,7 +773,7 @@ pickNextSS(
|
||||
if ((ss->lastseen == NULL || ss->lastseen < ancient)
|
||||
&& !(ss->flags&LOCKED)) {
|
||||
d->search = ss + 1;
|
||||
FDEBUG(("replacing c%d\n", ss - d->ssets));
|
||||
FDEBUG(("replacing c%d\n", (int) (ss - d->ssets)));
|
||||
return ss;
|
||||
}
|
||||
}
|
||||
@@ -780,7 +781,7 @@ pickNextSS(
|
||||
if ((ss->lastseen == NULL || ss->lastseen < ancient)
|
||||
&& !(ss->flags&LOCKED)) {
|
||||
d->search = ss + 1;
|
||||
FDEBUG(("replacing c%d\n", ss - d->ssets));
|
||||
FDEBUG(("replacing c%d\n", (int) (ss - d->ssets)));
|
||||
return ss;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ static const char unk[] = "*** unknown regex error code 0x%x ***";
|
||||
* Struct to map among codes, code names, and explanations.
|
||||
*/
|
||||
|
||||
static struct rerr {
|
||||
static const struct rerr {
|
||||
int code;
|
||||
const char *name;
|
||||
const char *explain;
|
||||
@@ -62,7 +62,7 @@ regerror(
|
||||
char *errbuf, /* Result buffer (unless errbuf_size==0) */
|
||||
size_t errbuf_size) /* Available space in errbuf, can be 0 */
|
||||
{
|
||||
struct rerr *r;
|
||||
const struct rerr *r;
|
||||
const char *msg;
|
||||
char convbuf[sizeof(unk)+50]; /* 50 = plenty for int */
|
||||
size_t len;
|
||||
|
||||
+1
-1
@@ -16,5 +16,5 @@
|
||||
{ REG_INVARG, "REG_INVARG", "invalid argument to regex function" },
|
||||
{ REG_MIXED, "REG_MIXED", "character widths of regex and string differ" },
|
||||
{ REG_BADOPT, "REG_BADOPT", "invalid embedded option" },
|
||||
{ REG_ETOOBIG, "REG_ETOOBIG", "nfa has too many states" },
|
||||
{ REG_ETOOBIG, "REG_ETOOBIG", "regular expression is too complex" },
|
||||
{ REG_ECOLORS, "REG_ECOLORS", "too many colors" },
|
||||
|
||||
+17
-45
@@ -92,12 +92,6 @@ extern "C" {
|
||||
#ifdef __REG_REGOFF_T
|
||||
#undef __REG_REGOFF_T
|
||||
#endif
|
||||
#ifdef __REG_VOID_T
|
||||
#undef __REG_VOID_T
|
||||
#endif
|
||||
#ifdef __REG_CONST
|
||||
#undef __REG_CONST
|
||||
#endif
|
||||
#ifdef __REG_NOFRONT
|
||||
#undef __REG_NOFRONT
|
||||
#endif
|
||||
@@ -107,8 +101,6 @@ extern "C" {
|
||||
/* interface types */
|
||||
#define __REG_WIDE_T Tcl_UniChar
|
||||
#define __REG_REGOFF_T long /* not really right, but good enough... */
|
||||
#define __REG_VOID_T void
|
||||
#define __REG_CONST const
|
||||
/* names and declarations */
|
||||
#define __REG_WIDE_COMPILE TclReComp
|
||||
#define __REG_WIDE_EXEC TclReExec
|
||||
@@ -133,26 +125,6 @@ typedef __REG_REGOFF_T regoff_t;
|
||||
typedef long regoff_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* For benefit of old compilers, we offer <sys/types.h> the option of
|
||||
* overriding the `void' type used to declare nonexistent return types.
|
||||
*/
|
||||
#ifdef __REG_VOID_T
|
||||
typedef __REG_VOID_T re_void;
|
||||
#else
|
||||
typedef void re_void;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Also for benefit of old compilers, <sys/types.h> can supply a macro which
|
||||
* expands to a substitute for `const'.
|
||||
*/
|
||||
#ifndef __REG_CONST
|
||||
#define __REG_CONST const
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* other interface types
|
||||
*/
|
||||
@@ -197,13 +169,13 @@ typedef struct {
|
||||
/*
|
||||
* compilation
|
||||
^ #ifndef __REG_NOCHAR
|
||||
^ int re_comp(regex_t *, __REG_CONST char *, size_t, int);
|
||||
^ int re_comp(regex_t *, const char *, size_t, int);
|
||||
^ #endif
|
||||
^ #ifndef __REG_NOFRONT
|
||||
^ int regcomp(regex_t *, __REG_CONST char *, int);
|
||||
^ int regcomp(regex_t *, const char *, int);
|
||||
^ #endif
|
||||
^ #ifdef __REG_WIDE_T
|
||||
^ int __REG_WIDE_COMPILE(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int);
|
||||
^ int __REG_WIDE_COMPILE(regex_t *, const __REG_WIDE_T *, size_t, int);
|
||||
^ #endif
|
||||
*/
|
||||
#define REG_BASIC 000000 /* BREs (convenience) */
|
||||
@@ -228,14 +200,14 @@ typedef struct {
|
||||
/*
|
||||
* execution
|
||||
^ #ifndef __REG_NOCHAR
|
||||
^ int re_exec(regex_t *, __REG_CONST char *, size_t,
|
||||
^ int re_exec(regex_t *, const char *, size_t,
|
||||
^ rm_detail_t *, size_t, regmatch_t [], int);
|
||||
^ #endif
|
||||
^ #ifndef __REG_NOFRONT
|
||||
^ int regexec(regex_t *, __REG_CONST char *, size_t, regmatch_t [], int);
|
||||
^ int regexec(regex_t *, const char *, size_t, regmatch_t [], int);
|
||||
^ #endif
|
||||
^ #ifdef __REG_WIDE_T
|
||||
^ int __REG_WIDE_EXEC(regex_t *, __REG_CONST __REG_WIDE_T *, size_t,
|
||||
^ int __REG_WIDE_EXEC(regex_t *, const __REG_WIDE_T *, size_t,
|
||||
^ rm_detail_t *, size_t, regmatch_t [], int);
|
||||
^ #endif
|
||||
*/
|
||||
@@ -248,7 +220,7 @@ typedef struct {
|
||||
|
||||
/*
|
||||
* misc generics (may be more functions here eventually)
|
||||
^ re_void regfree(regex_t *);
|
||||
^ void regfree(regex_t *);
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -260,7 +232,7 @@ typedef struct {
|
||||
* of character is used for error reports is independent of what kind is used
|
||||
* in matching.
|
||||
*
|
||||
^ extern size_t regerror(int, __REG_CONST regex_t *, char *, size_t);
|
||||
^ extern size_t regerror(int, const regex_t *, char *, size_t);
|
||||
*/
|
||||
#define REG_OKAY 0 /* no errors detected */
|
||||
#define REG_NOMATCH 1 /* failed to match */
|
||||
@@ -280,7 +252,7 @@ typedef struct {
|
||||
#define REG_INVARG 16 /* invalid argument to regex function */
|
||||
#define REG_MIXED 17 /* character widths of regex and string differ */
|
||||
#define REG_BADOPT 18 /* invalid embedded option */
|
||||
#define REG_ETOOBIG 19 /* nfa has too many states */
|
||||
#define REG_ETOOBIG 19 /* regular expression is too complex */
|
||||
#define REG_ECOLORS 20 /* too many colors */
|
||||
/* two specials for debugging and testing */
|
||||
#define REG_ATOI 101 /* convert error-code name to number */
|
||||
@@ -293,25 +265,25 @@ typedef struct {
|
||||
/* automatically gathered by fwd; do not hand-edit */
|
||||
/* === regproto.h === */
|
||||
#ifndef __REG_NOCHAR
|
||||
int re_comp(regex_t *, __REG_CONST char *, size_t, int);
|
||||
int re_comp(regex_t *, const char *, size_t, int);
|
||||
#endif
|
||||
#ifndef __REG_NOFRONT
|
||||
int regcomp(regex_t *, __REG_CONST char *, int);
|
||||
int regcomp(regex_t *, const char *, int);
|
||||
#endif
|
||||
#ifdef __REG_WIDE_T
|
||||
MODULE_SCOPE int __REG_WIDE_COMPILE(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int);
|
||||
MODULE_SCOPE int __REG_WIDE_COMPILE(regex_t *, const __REG_WIDE_T *, size_t, int);
|
||||
#endif
|
||||
#ifndef __REG_NOCHAR
|
||||
int re_exec(regex_t *, __REG_CONST char *, size_t, rm_detail_t *, size_t, regmatch_t [], int);
|
||||
int re_exec(regex_t *, const char *, size_t, rm_detail_t *, size_t, regmatch_t [], int);
|
||||
#endif
|
||||
#ifndef __REG_NOFRONT
|
||||
int regexec(regex_t *, __REG_CONST char *, size_t, regmatch_t [], int);
|
||||
int regexec(regex_t *, const char *, size_t, regmatch_t [], int);
|
||||
#endif
|
||||
#ifdef __REG_WIDE_T
|
||||
MODULE_SCOPE int __REG_WIDE_EXEC(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, rm_detail_t *, size_t, regmatch_t [], int);
|
||||
MODULE_SCOPE int __REG_WIDE_EXEC(regex_t *, const __REG_WIDE_T *, size_t, rm_detail_t *, size_t, regmatch_t [], int);
|
||||
#endif
|
||||
MODULE_SCOPE re_void regfree(regex_t *);
|
||||
MODULE_SCOPE size_t regerror(int, __REG_CONST regex_t *, char *, size_t);
|
||||
MODULE_SCOPE void regfree(regex_t *);
|
||||
MODULE_SCOPE size_t regerror(int, const regex_t *, char *, size_t);
|
||||
/* automatically gathered by fwd; do not hand-edit */
|
||||
/* =====^!^===== end forwards =====^!^===== */
|
||||
|
||||
|
||||
+588
-471
File diff suppressed because it is too large
Load Diff
+61
-20
@@ -99,7 +99,7 @@
|
||||
#define xxx 1
|
||||
|
||||
#define DUPMAX _POSIX2_RE_DUP_MAX
|
||||
#define INFINITY (DUPMAX+1)
|
||||
#define DUPINF (DUPMAX+1)
|
||||
|
||||
#define REMAGIC 0xfed7 /* magic number for main struct */
|
||||
|
||||
@@ -186,7 +186,14 @@ struct colordesc {
|
||||
union tree *block; /* block of solid color, if any */
|
||||
};
|
||||
|
||||
/* the color map itself */
|
||||
/*
|
||||
* The color map itself
|
||||
*
|
||||
* Much of the data in the colormap struct is only used at compile time.
|
||||
* However, the bulk of the space usage is in the "tree" structure, so it's
|
||||
* not clear that there's much point in converting the rest to a more compact
|
||||
* form when compilation is finished.
|
||||
*/
|
||||
struct colormap {
|
||||
int magic;
|
||||
#define CMMAGIC 0x876
|
||||
@@ -242,14 +249,15 @@ struct cvec {
|
||||
struct state;
|
||||
|
||||
struct arc {
|
||||
int type;
|
||||
#define ARCFREE '\0'
|
||||
int type; /* 0 if free, else an NFA arc type code */
|
||||
color co;
|
||||
struct state *from; /* where it's from (and contained within) */
|
||||
struct state *to; /* where it's to */
|
||||
struct arc *outchain; /* *from's outs chain or free chain */
|
||||
#define freechain outchain
|
||||
struct arc *outchain; /* link in *from's outs chain or free chain */
|
||||
struct arc *outchainRev; /* back-link in *from's outs chain */
|
||||
#define freechain outchain /* we do not maintain "freechainRev" */
|
||||
struct arc *inchain; /* *to's ins chain */
|
||||
struct arc *inchainRev; /* back-link in *to's ins chain */
|
||||
struct arc *colorchain; /* color's arc chain */
|
||||
struct arc *colorchainRev; /* back-link in color's arc chain */
|
||||
};
|
||||
@@ -288,20 +296,28 @@ struct nfa {
|
||||
struct colormap *cm; /* the color map */
|
||||
color bos[2]; /* colors, if any, assigned to BOS and BOL */
|
||||
color eos[2]; /* colors, if any, assigned to EOS and EOL */
|
||||
size_t size; /* Current NFA size; differs from nstates as
|
||||
* it also counts the number of states created
|
||||
* by children of this state. */
|
||||
struct vars *v; /* simplifies compile error reporting */
|
||||
struct nfa *parent; /* parent NFA, if any */
|
||||
};
|
||||
|
||||
/*
|
||||
* definitions for compacted NFA
|
||||
*
|
||||
* The main space savings in a compacted NFA is from making the arcs as small
|
||||
* as possible. We store only the transition color and next-state number for
|
||||
* each arc. The list of out arcs for each state is an array beginning at
|
||||
* cnfa.states[statenumber], and terminated by a dummy carc struct with
|
||||
* co == COLORLESS.
|
||||
*
|
||||
* The non-dummy carc structs are of two types: plain arcs and LACON arcs.
|
||||
* Plain arcs just store the transition color number as "co". LACON arcs
|
||||
* store the lookahead constraint number plus cnfa.ncolors as "co". LACON
|
||||
* arcs can be distinguished from plain by testing for co >= cnfa.ncolors.
|
||||
*/
|
||||
|
||||
struct carc {
|
||||
color co; /* COLORLESS is list terminator */
|
||||
int to; /* state number */
|
||||
int to; /* next-state number */
|
||||
};
|
||||
|
||||
struct cnfa {
|
||||
@@ -313,27 +329,52 @@ struct cnfa {
|
||||
int post; /* teardown state number */
|
||||
color bos[2]; /* colors, if any, assigned to BOS and BOL */
|
||||
color eos[2]; /* colors, if any, assigned to EOS and EOL */
|
||||
char *stflags; /* vector of per-state flags bytes */
|
||||
#define CNFA_NOPROGRESS 01 /* flag bit for a no-progress state */
|
||||
struct carc **states; /* vector of pointers to outarc lists */
|
||||
/* states[n] are pointers into a single malloc'd array of arcs */
|
||||
struct carc *arcs; /* the area for the lists */
|
||||
};
|
||||
#define ZAPCNFA(cnfa) ((cnfa).nstates = 0)
|
||||
#define NULLCNFA(cnfa) ((cnfa).nstates == 0)
|
||||
|
||||
/*
|
||||
* Used to limit the maximum NFA size to something sane. [Bug 1810264]
|
||||
* This symbol limits the transient heap space used by the regex compiler,
|
||||
* and thereby also the maximum complexity of NFAs that we'll deal with.
|
||||
* Currently we only count NFA states and arcs against this; the other
|
||||
* transient data is generally not large enough to notice compared to those.
|
||||
* Note that we do not charge anything for the final output data structures
|
||||
* (the compacted NFA and the colormap).
|
||||
*/
|
||||
|
||||
#ifndef REG_MAX_STATES
|
||||
# define REG_MAX_STATES 100000
|
||||
#ifndef REG_MAX_COMPILE_SPACE
|
||||
#define REG_MAX_COMPILE_SPACE \
|
||||
(100000 * sizeof(struct state) + 100000 * sizeof(struct arcbatch))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* subexpression tree
|
||||
*
|
||||
* "op" is one of:
|
||||
* '=' plain regex without interesting substructure (implemented as DFA)
|
||||
* 'b' back-reference (has no substructure either)
|
||||
* '(' capture node: captures the match of its single child
|
||||
* '.' concatenation: matches a match for left, then a match for right
|
||||
* '|' alternation: matches a match for left or a match for right
|
||||
* '*' iteration: matches some number of matches of its single child
|
||||
*
|
||||
* Note: the right child of an alternation must be another alternation or
|
||||
* NULL; hence, an N-way branch requires N alternation nodes, not N-1 as you
|
||||
* might expect. This could stand to be changed. Actually I'd rather see
|
||||
* a single alternation node with N children, but that will take revising
|
||||
* the representation of struct subre.
|
||||
*
|
||||
* Note: when a backref is directly quantified, we stick the min/max counts
|
||||
* into the backref rather than plastering an iteration node on top. This is
|
||||
* for efficiency: there is no need to search for possible division points.
|
||||
*/
|
||||
|
||||
struct subre {
|
||||
char op; /* '|', '.' (concat), 'b' (backref), '(',
|
||||
* '=' */
|
||||
char op; /* see type codes above */
|
||||
char flags;
|
||||
#define LONGER 01 /* prefers longer match */
|
||||
#define SHORTER 02 /* prefers shorter match */
|
||||
@@ -349,10 +390,10 @@ struct subre {
|
||||
#define PREF(f) ((f)&NOPROP)
|
||||
#define PREF2(f1, f2) ((PREF(f1) != 0) ? PREF(f1) : PREF(f2))
|
||||
#define COMBINE(f1, f2) (UP((f1)|(f2)) | PREF2(f1, f2))
|
||||
short retry; /* index into retry memory */
|
||||
short id; /* ID of subre (1..ntree-1) */
|
||||
int subno; /* subexpression number (for 'b' and '(') */
|
||||
short min; /* min repetitions, for backref only */
|
||||
short max; /* max repetitions, for backref only */
|
||||
short min; /* min repetitions for iteration or backref */
|
||||
short max; /* max repetitions for iteration or backref */
|
||||
struct subre *left; /* left child, if any (also freelist chain) */
|
||||
struct subre *right; /* right child, if any */
|
||||
struct state *begin; /* outarcs from here... */
|
||||
@@ -382,7 +423,7 @@ struct guts {
|
||||
size_t nsub; /* copy of re_nsub */
|
||||
struct subre *tree;
|
||||
struct cnfa search; /* for fast preliminary search */
|
||||
int ntree;
|
||||
int ntree; /* number of subre's, plus one */
|
||||
struct colormap cmap;
|
||||
int FUNCPTR(compare, (const chr *, const chr *, size_t));
|
||||
struct subre *lacons; /* lookahead-constraint vector */
|
||||
|
||||
+7
-7
@@ -2,8 +2,8 @@
|
||||
#
|
||||
# This file contains the declarations for all supported public
|
||||
# functions that are exported by the Tcl library via the stubs table.
|
||||
# This file is used to generate the tclDecls.h, tclPlatDecls.h,
|
||||
# tclStub.c, and tclPlatStub.c files.
|
||||
# This file is used to generate the tclDecls.h, tclPlatDecls.h
|
||||
# and tclStubInit.c files.
|
||||
#
|
||||
# Copyright (c) 1998-1999 by Scriptics Corporation.
|
||||
# Copyright (c) 2001, 2002 by Kevin B. Kenny. All rights reserved.
|
||||
@@ -37,7 +37,7 @@ declare 1 {
|
||||
void *clientDataPtr)
|
||||
}
|
||||
declare 2 {
|
||||
void Tcl_Panic(const char *format, ...)
|
||||
TCL_NORETURN void Tcl_Panic(const char *format, ...)
|
||||
}
|
||||
declare 3 {
|
||||
char *Tcl_Alloc(unsigned int size)
|
||||
@@ -480,7 +480,7 @@ declare 132 {
|
||||
void Tcl_EventuallyFree(ClientData clientData, Tcl_FreeProc *freeProc)
|
||||
}
|
||||
declare 133 {
|
||||
void Tcl_Exit(int status)
|
||||
TCL_NORETURN void Tcl_Exit(int status)
|
||||
}
|
||||
declare 134 {
|
||||
int Tcl_ExposeCommand(Tcl_Interp *interp, const char *hiddenCmdToken,
|
||||
@@ -815,7 +815,7 @@ declare 229 {
|
||||
void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr)
|
||||
}
|
||||
declare 230 {
|
||||
void Tcl_SetPanicProc(Tcl_PanicProc *panicProc)
|
||||
void Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
|
||||
}
|
||||
declare 231 {
|
||||
int Tcl_SetRecursionLimit(Tcl_Interp *interp, int depth)
|
||||
@@ -986,7 +986,7 @@ declare 277 {
|
||||
Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options)
|
||||
}
|
||||
declare 278 {
|
||||
void Tcl_PanicVA(const char *format, va_list argList)
|
||||
TCL_NORETURN void Tcl_PanicVA(const char *format, va_list argList)
|
||||
}
|
||||
declare 279 {
|
||||
void Tcl_GetVersion(int *major, int *minor, int *patchLevel, int *type)
|
||||
@@ -1872,7 +1872,7 @@ declare 518 {
|
||||
|
||||
# TIP#121 (exit handler) dkf for Joe Mistachkin
|
||||
declare 519 {
|
||||
Tcl_ExitProc *Tcl_SetExitProc(Tcl_ExitProc *proc)
|
||||
Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc)
|
||||
}
|
||||
|
||||
# TIP#143 (resource limits) dkf
|
||||
|
||||
+46
-32
@@ -56,10 +56,10 @@ extern "C" {
|
||||
#define TCL_MAJOR_VERSION 8
|
||||
#define TCL_MINOR_VERSION 6
|
||||
#define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE
|
||||
#define TCL_RELEASE_SERIAL 2
|
||||
#define TCL_RELEASE_SERIAL 4
|
||||
|
||||
#define TCL_VERSION "8.6"
|
||||
#define TCL_PATCH_LEVEL "8.6.2"
|
||||
#define TCL_PATCH_LEVEL "8.6.4"
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
@@ -76,16 +76,6 @@ extern "C" {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* STRICT: See MSDN Article Q83456
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifndef STRICT
|
||||
# define STRICT
|
||||
# endif
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/*
|
||||
* Utility macros: STRINGIFY takes an argument and wraps it in "" (double
|
||||
* quotation marks), JOIN joins two arguments.
|
||||
@@ -153,8 +143,20 @@ extern "C" {
|
||||
#endif
|
||||
#if defined(__GNUC__) && (__GNUC__ > 2)
|
||||
# define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b)))
|
||||
# define TCL_NORETURN __attribute__ ((noreturn))
|
||||
# if defined(BUILD_tcl) || defined(BUILD_tk)
|
||||
# define TCL_NORETURN1 __attribute__ ((noreturn))
|
||||
# else
|
||||
# define TCL_NORETURN1 /* nothing */
|
||||
# endif
|
||||
#else
|
||||
# define TCL_FORMAT_PRINTF(a,b)
|
||||
# if defined(_MSC_VER) && (_MSC_VER >= 1310)
|
||||
# define TCL_NORETURN _declspec(noreturn)
|
||||
# else
|
||||
# define TCL_NORETURN /* nothing */
|
||||
# endif
|
||||
# define TCL_NORETURN1 /* nothing */
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -402,16 +404,12 @@ typedef long LONG;
|
||||
* Don't know what platform it is and configure hasn't discovered what is
|
||||
* going on for us. Try to guess...
|
||||
*/
|
||||
# ifdef NO_LIMITS_H
|
||||
# error please define either TCL_WIDE_INT_TYPE or TCL_WIDE_INT_IS_LONG
|
||||
# else /* !NO_LIMITS_H */
|
||||
# include <limits.h>
|
||||
# if (INT_MAX < LONG_MAX)
|
||||
# define TCL_WIDE_INT_IS_LONG 1
|
||||
# else
|
||||
# define TCL_WIDE_INT_TYPE long long
|
||||
# endif
|
||||
# endif /* NO_LIMITS_H */
|
||||
# include <limits.h>
|
||||
# if (INT_MAX < LONG_MAX)
|
||||
# define TCL_WIDE_INT_IS_LONG 1
|
||||
# else
|
||||
# define TCL_WIDE_INT_TYPE long long
|
||||
# endif
|
||||
# endif /* _WIN32 */
|
||||
#endif /* !TCL_WIDE_INT_TYPE & !TCL_WIDE_INT_IS_LONG */
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
@@ -830,18 +828,19 @@ typedef struct Tcl_Obj {
|
||||
union { /* The internal representation: */
|
||||
long longValue; /* - an long integer value. */
|
||||
double doubleValue; /* - a double-precision floating value. */
|
||||
void *otherValuePtr; /* - another, type-specific value. */
|
||||
void *otherValuePtr; /* - another, type-specific value,
|
||||
not used internally any more. */
|
||||
Tcl_WideInt wideValue; /* - a long long value. */
|
||||
struct { /* - internal rep as two pointers. */
|
||||
struct { /* - internal rep as two pointers.
|
||||
* the main use of which is a bignum's
|
||||
* tightly packed fields, where the alloc,
|
||||
* used and signum flags are packed into
|
||||
* ptr2 with everything else hung off ptr1. */
|
||||
void *ptr1;
|
||||
void *ptr2;
|
||||
} twoPtrValue;
|
||||
struct { /* - internal rep as a pointer and a long,
|
||||
* the main use of which is a bignum's
|
||||
* tightly packed fields, where the alloc,
|
||||
* used and signum flags are packed into a
|
||||
* single word with everything else hung
|
||||
* off the pointer. */
|
||||
not used internally any more. */
|
||||
void *ptr;
|
||||
unsigned long value;
|
||||
} ptrAndLongRep;
|
||||
@@ -2144,11 +2143,28 @@ typedef struct Tcl_EncodingType {
|
||||
* substituting one or more "close" characters in
|
||||
* the destination buffer and then continue to
|
||||
* convert the source.
|
||||
* TCL_ENCODING_NO_TERMINATE - If set, Tcl_ExternalToUtf will not append a
|
||||
* terminating NUL byte. Knowing that it will
|
||||
* not need space to do so, it will fill all
|
||||
* dstLen bytes with encoded UTF-8 content, as
|
||||
* other circumstances permit. If clear, the
|
||||
* default behavior is to reserve a byte in
|
||||
* the dst space for NUL termination, and to
|
||||
* append the NUL byte.
|
||||
* TCL_ENCODING_CHAR_LIMIT - If set and dstCharsPtr is not NULL, then
|
||||
* Tcl_ExternalToUtf takes the initial value
|
||||
* of *dstCharsPtr is taken as a limit of the
|
||||
* maximum number of chars to produce in the
|
||||
* encoded UTF-8 content. Otherwise, the
|
||||
* number of chars produced is controlled only
|
||||
* by other limiting factors.
|
||||
*/
|
||||
|
||||
#define TCL_ENCODING_START 0x01
|
||||
#define TCL_ENCODING_END 0x02
|
||||
#define TCL_ENCODING_STOPONERROR 0x04
|
||||
#define TCL_ENCODING_NO_TERMINATE 0x08
|
||||
#define TCL_ENCODING_CHAR_LIMIT 0x10
|
||||
|
||||
/*
|
||||
* The following definitions are the error codes returned by the conversion
|
||||
@@ -2419,9 +2435,7 @@ EXTERN void Tcl_MainEx(int argc, char **argv,
|
||||
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
|
||||
EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
|
||||
const char *version, int exact);
|
||||
#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
|
||||
EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
@@ -2508,7 +2522,7 @@ EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
|
||||
# define Tcl_DecrRefCount(objPtr) \
|
||||
do { \
|
||||
Tcl_Obj *_objPtr = (objPtr); \
|
||||
if (--(_objPtr)->refCount <= 0) { \
|
||||
if ((_objPtr)->refCount-- <= 1) { \
|
||||
TclFreeObj(_objPtr); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
* until Tcl uses config.h properly.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__BORLANDC__)
|
||||
#if defined(_MSC_VER) || defined(__MSVCRT__) || defined(__BORLANDC__)
|
||||
typedef unsigned long caddr_t;
|
||||
#endif
|
||||
|
||||
|
||||
+94
-52
@@ -22,10 +22,7 @@
|
||||
#include "tclCompile.h"
|
||||
#include "tommath.h"
|
||||
#include <math.h>
|
||||
|
||||
#if NRE_ENABLE_ASSERTS
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#define INTERP_STACK_INITIAL_SIZE 2000
|
||||
#define CORO_STACK_INITIAL_SIZE 200
|
||||
@@ -472,7 +469,6 @@ Tcl_CreateInterp(void)
|
||||
#endif /* TCL_COMPILE_STATS */
|
||||
char mathFuncName[32];
|
||||
CallFrame *framePtr;
|
||||
int result;
|
||||
|
||||
TclInitSubsystems();
|
||||
|
||||
@@ -642,11 +638,8 @@ Tcl_CreateInterp(void)
|
||||
|
||||
/* This is needed to satisfy GCC 3.3's strict aliasing rules */
|
||||
framePtr = ckalloc(sizeof(CallFrame));
|
||||
result = Tcl_PushCallFrame(interp, (Tcl_CallFrame *) framePtr,
|
||||
(void) Tcl_PushCallFrame(interp, (Tcl_CallFrame *) framePtr,
|
||||
(Tcl_Namespace *) iPtr->globalNsPtr, /*isProcCallFrame*/ 0);
|
||||
if (result != TCL_OK) {
|
||||
Tcl_Panic("Tcl_CreateInterp: failed to push the root stack frame");
|
||||
}
|
||||
framePtr->objc = 0;
|
||||
|
||||
iPtr->framePtr = framePtr;
|
||||
@@ -840,7 +833,9 @@ Tcl_CreateInterp(void)
|
||||
*/
|
||||
|
||||
Tcl_CreateObjCommand(interp, "::tcl::unsupported::disassemble",
|
||||
Tcl_DisassembleObjCmd, NULL, NULL);
|
||||
Tcl_DisassembleObjCmd, INT2PTR(0), NULL);
|
||||
Tcl_CreateObjCommand(interp, "::tcl::unsupported::getbytecode",
|
||||
Tcl_DisassembleObjCmd, INT2PTR(1), NULL);
|
||||
Tcl_CreateObjCommand(interp, "::tcl::unsupported::representation",
|
||||
Tcl_RepresentationCmd, NULL, NULL);
|
||||
|
||||
@@ -920,6 +915,13 @@ Tcl_CreateInterp(void)
|
||||
|
||||
TclInitEmbeddedConfigurationInformation(interp);
|
||||
|
||||
/*
|
||||
* TIP #440: Declare the name of the script engine to be "Tcl".
|
||||
*/
|
||||
|
||||
Tcl_SetVar2(interp, "tcl_platform", "engine", "Tcl",
|
||||
TCL_GLOBAL_ONLY);
|
||||
|
||||
/*
|
||||
* Compute the byte order of this machine.
|
||||
*/
|
||||
@@ -2258,7 +2260,7 @@ Tcl_CreateObjCommand(
|
||||
/* Command already exists. */
|
||||
|
||||
/*
|
||||
* [***] This is wrong. See Tcl Bug a16752c252.
|
||||
* [***] This is wrong. See Tcl Bug a16752c252.
|
||||
* However, this buggy behavior is kept under particular
|
||||
* circumstances to accommodate deployed binaries of the
|
||||
* "tclcompiler" program. http://sourceforge.net/projects/tclpro/
|
||||
@@ -3082,7 +3084,7 @@ Tcl_DeleteCommandFromToken(
|
||||
while (tracePtr != NULL) {
|
||||
CommandTrace *nextPtr = tracePtr->nextPtr;
|
||||
|
||||
if ((--tracePtr->refCount) <= 0) {
|
||||
if (tracePtr->refCount-- <= 1) {
|
||||
ckfree(tracePtr);
|
||||
}
|
||||
tracePtr = nextPtr;
|
||||
@@ -3268,7 +3270,7 @@ CallCommandTraces(
|
||||
tracePtr->traceProc(tracePtr->clientData, (Tcl_Interp *) iPtr,
|
||||
oldName, newName, flags);
|
||||
cmdPtr->flags &= ~tracePtr->flags;
|
||||
if ((--tracePtr->refCount) <= 0) {
|
||||
if (tracePtr->refCount-- <= 1) {
|
||||
ckfree(tracePtr);
|
||||
}
|
||||
}
|
||||
@@ -4140,8 +4142,9 @@ TclNREvalObjv(
|
||||
|
||||
/*
|
||||
* data[1] stores a marker for use by tailcalls; it will be set to 1 by
|
||||
* command redirectors (imports, alias, ensembles) so that tailcalls
|
||||
* finishes the source command and not just the target.
|
||||
* command redirectors (imports, alias, ensembles) so that tailcall skips
|
||||
* this callback (that marks the end of the target command) and goes back
|
||||
* to the end of the source command.
|
||||
*/
|
||||
|
||||
if (iPtr->deferredCallbacks) {
|
||||
@@ -4169,7 +4172,7 @@ EvalObjvCore(
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Namespace *lookupNsPtr = NULL;
|
||||
int enterTracesDone = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Push records for task to be done on return, in INVERSE order. First, if
|
||||
* needed, the exception handlers (as they should happen last).
|
||||
@@ -4295,7 +4298,7 @@ EvalObjvCore(
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Schedule leave traces. Raise the refCount on the resolved
|
||||
* cmdPtr, so that when it passes to the leave traces we know
|
||||
* it's still valid.
|
||||
@@ -4404,9 +4407,9 @@ NRCommand(
|
||||
iPtr->numLevels--;
|
||||
|
||||
/*
|
||||
* If there is a tailcall, schedule it
|
||||
* If there is a tailcall, schedule it next
|
||||
*/
|
||||
|
||||
|
||||
if (data[1] && (data[1] != INT2PTR(1))) {
|
||||
TclNRAddCallback(interp, TclNRTailcallEval, data[1], NULL, NULL, NULL);
|
||||
}
|
||||
@@ -5640,10 +5643,10 @@ TclArgumentBCEnter(
|
||||
* ensemble dispatch. Ensemble subcommands that lead to script
|
||||
* evaluation are not supposed to get compiled, because a command
|
||||
* such as [info level] in the script can expose some of the dispatch
|
||||
* shenanigans. This means that we don't have to tend to the
|
||||
* shenanigans. This means that we don't have to tend to the
|
||||
* housekeeping, and can escape now.
|
||||
*/
|
||||
|
||||
|
||||
if (ePtr->nline != objc) {
|
||||
return;
|
||||
}
|
||||
@@ -5907,7 +5910,7 @@ Tcl_GlobalEvalObj(
|
||||
*
|
||||
* If the flag TCL_EVAL_DIRECT is passed in, the value of invoker
|
||||
* must be NULL. Support for non-NULL invokers in that mode has
|
||||
* been removed since it was unused and untested. Failure to
|
||||
* been removed since it was unused and untested. Failure to
|
||||
* follow this limitation will lead to an assertion panic.
|
||||
*
|
||||
* Results:
|
||||
@@ -6515,11 +6518,7 @@ TclObjInvokeNamespace(
|
||||
* command.
|
||||
*/
|
||||
|
||||
result = TclPushStackFrame(interp, &framePtr, nsPtr, /*isProcFrame*/0);
|
||||
if (result != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
(void) TclPushStackFrame(interp, &framePtr, nsPtr, /*isProcFrame*/0);
|
||||
result = TclObjInvoke(interp, objc, objv, flags);
|
||||
|
||||
TclPopStackFrame(interp);
|
||||
@@ -8168,27 +8167,31 @@ Tcl_NRCmdSwap(
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Stuff for tailcalls
|
||||
* Tailcall related code
|
||||
*****************************************************************************
|
||||
*
|
||||
* Just to show that IT CAN BE DONE! The precise semantics are not simple,
|
||||
* require more thought. Possibly need a new Tcl return code to do it right?
|
||||
* Questions include:
|
||||
* (1) How is the objc/objv tailcall to be run? My current thinking is that
|
||||
* it should essentially be
|
||||
* [tailcall a b c] <=> [uplevel 1 [list a b c]]
|
||||
* with two caveats
|
||||
* (a) the current frame is dropped first, after running all pending
|
||||
* cleanup tasks and saving its namespace
|
||||
* (b) 'a' is looked up in the returning frame's namespace, but the
|
||||
* command is run in the context to which we are returning
|
||||
* Current implementation does this if [tailcall] is called from within
|
||||
* a proc, errors otherwise.
|
||||
* (2) Should a tailcall bypass [catch] in the returning frame? Current
|
||||
* implementation does not (or does it? Changed, test!) - it causes an
|
||||
* error.
|
||||
* The steps of the tailcall dance are as follows:
|
||||
*
|
||||
* FIXME NRE!
|
||||
* 1. when [tailcall] is invoked, it stores the corresponding callback in
|
||||
* the current CallFrame and returns TCL_RETURN
|
||||
* 2. when the CallFrame is popped, it calls TclSetTailcall to store the
|
||||
* callback in the proper NRCommand callback - the spot where the command
|
||||
* that pushed the CallFrame is completely cleaned up
|
||||
* 3. when the NRCommand callback runs, it schedules the tailcall callback
|
||||
* to run immediately after it returns
|
||||
*
|
||||
* One delicate point is to properly define the NRCommand where the tailcall
|
||||
* will execute. There are functions whose purpose is to help define the
|
||||
* precise spot:
|
||||
* TclMarkTailcall: if the NEXT command to be pushed tailcalls, execution
|
||||
* should continue right here
|
||||
* TclSkipTailcall: if the NEXT command to be pushed tailcalls, execution
|
||||
* should continue after the CURRENT command is fully returned ("skip
|
||||
* the next command: we are redirecting to it, tailcalls should run
|
||||
* after WE return")
|
||||
* TclPushTailcallPoint: the search for a tailcalling spot cannot traverse
|
||||
* this point. This is special for OO, as some of the oo constructs
|
||||
* that behave like commands may not push an NRCommand callback.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -8222,6 +8225,18 @@ TclPushTailcallPoint(
|
||||
((Interp *) interp)->numLevels++;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclSetTailcall --
|
||||
*
|
||||
* Splice a tailcall command in the proper spot of the NRE callback
|
||||
* stack, so that it runs at the right time.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
TclSetTailcall(
|
||||
Tcl_Interp *interp,
|
||||
@@ -8246,6 +8261,23 @@ TclSetTailcall(
|
||||
runPtr->data[1] = listPtr;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclNRTailcallObjCmd --
|
||||
*
|
||||
* Prepare the tailcall as a list and store it in the current
|
||||
* varFrame. When the frame is later popped the tailcall will be spliced
|
||||
* at the proper place.
|
||||
*
|
||||
* Results:
|
||||
* The first NRCommand callback that is not marked to be skipped is
|
||||
* updated so that its data[1] field contains the tailcall list.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclNRTailcallObjCmd(
|
||||
ClientData clientData,
|
||||
@@ -8260,9 +8292,9 @@ TclNRTailcallObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (!(iPtr->varFramePtr->isProcCallFrame & 1)) { /* or is upleveled */
|
||||
if (!(iPtr->varFramePtr->isProcCallFrame & 1)) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"tailcall can only be called from a proc or lambda", -1));
|
||||
"tailcall can only be called from a proc, lambda or method", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -8280,8 +8312,7 @@ TclNRTailcallObjCmd(
|
||||
/*
|
||||
* Create the callback to actually evaluate the tailcalled
|
||||
* command, then set it in the varFrame so that PopCallFrame can use it
|
||||
* at the proper time. Being lazy: exploit the TclNRAddCallBack macro to
|
||||
* build the callback.
|
||||
* at the proper time.
|
||||
*/
|
||||
|
||||
if (objc > 1) {
|
||||
@@ -8291,7 +8322,7 @@ TclNRTailcallObjCmd(
|
||||
|
||||
/* The tailcall data is in a Tcl list: the first element is the
|
||||
* namespace, the rest the command to be tailcalled. */
|
||||
|
||||
|
||||
listPtr = Tcl_NewListObj(objc, objv);
|
||||
|
||||
nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, -1);
|
||||
@@ -8300,12 +8331,23 @@ TclNRTailcallObjCmd(
|
||||
Tcl_Panic("Tailcall failed to find the proper namespace");
|
||||
}
|
||||
TclListObjSetElement(interp, listPtr, 0, nsObjPtr);
|
||||
|
||||
|
||||
iPtr->varFramePtr->tailcallPtr = listPtr;
|
||||
}
|
||||
return TCL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclNRTailcallEval --
|
||||
*
|
||||
* This NREcallback actually causes the tailcall to be evaluated.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclNRTailcallEval(
|
||||
ClientData data[],
|
||||
@@ -8318,9 +8360,9 @@ TclNRTailcallEval(
|
||||
int objc;
|
||||
Tcl_Obj **objv;
|
||||
|
||||
Tcl_ListObjGetElements(interp, listPtr, &objc, &objv);
|
||||
Tcl_ListObjGetElements(interp, listPtr, &objc, &objv);
|
||||
nsObjPtr = objv[0];
|
||||
|
||||
|
||||
if (result == TCL_OK) {
|
||||
result = TclGetNamespaceFromObj(interp, nsObjPtr, &nsPtr);
|
||||
}
|
||||
|
||||
+5
-4
@@ -2005,22 +2005,23 @@ ClockSecondsObjCmd(
|
||||
static void
|
||||
TzsetIfNecessary(void)
|
||||
{
|
||||
static char *tzWas = NULL; /* Previous value of TZ, protected by
|
||||
static char* tzWas = INT2PTR(-1); /* Previous value of TZ, protected by
|
||||
* clockMutex. */
|
||||
const char *tzIsNow; /* Current value of TZ */
|
||||
|
||||
Tcl_MutexLock(&clockMutex);
|
||||
tzIsNow = getenv("TZ");
|
||||
if (tzIsNow != NULL && (tzWas == NULL || strcmp(tzIsNow, tzWas) != 0)) {
|
||||
if (tzIsNow != NULL && (tzWas == NULL || tzWas == INT2PTR(-1)
|
||||
|| strcmp(tzIsNow, tzWas) != 0)) {
|
||||
tzset();
|
||||
if (tzWas != NULL) {
|
||||
if (tzWas != NULL && tzWas != INT2PTR(-1)) {
|
||||
ckfree(tzWas);
|
||||
}
|
||||
tzWas = ckalloc(strlen(tzIsNow) + 1);
|
||||
strcpy(tzWas, tzIsNow);
|
||||
} else if (tzIsNow == NULL && tzWas != NULL) {
|
||||
tzset();
|
||||
ckfree(tzWas);
|
||||
if (tzWas != INT2PTR(-1)) ckfree(tzWas);
|
||||
tzWas = NULL;
|
||||
}
|
||||
Tcl_MutexUnlock(&clockMutex);
|
||||
|
||||
+1
-1
@@ -748,7 +748,7 @@ Tcl_EvalObjCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
return Tcl_NRCallObjProc(interp, TclNREvalObjCmd, dummy, objc, objv);
|
||||
return Tcl_NRCallObjProc(interp, TclNREvalObjCmd, dummy, objc, objv);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
+8
-2
@@ -2390,7 +2390,10 @@ Tcl_LinsertObjCmd(
|
||||
|
||||
Tcl_ListObjAppendElement(NULL, listPtr, objv[3]);
|
||||
} else {
|
||||
Tcl_ListObjReplace(NULL, listPtr, index, 0, (objc-3), &(objv[3]));
|
||||
if (TCL_OK != Tcl_ListObjReplace(interp, listPtr, index, 0,
|
||||
(objc-3), &(objv[3]))) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2786,7 +2789,10 @@ Tcl_LreplaceObjCmd(
|
||||
* optimize this case away.
|
||||
*/
|
||||
|
||||
Tcl_ListObjReplace(NULL, listPtr, first, numToDelete, objc-4, objv+4);
|
||||
if (TCL_OK != Tcl_ListObjReplace(interp, listPtr, first, numToDelete,
|
||||
objc-4, objv+4)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the interpreter's object result.
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ static int UniCharIsHexDigit(int character);
|
||||
* UTF-8 literal string containing all Unicode space characters [TIP #413]
|
||||
*/
|
||||
|
||||
const char tclDefaultTrimSet[] =
|
||||
const char tclDefaultTrimSet[] =
|
||||
"\x09\x0a\x0b\x0c\x0d " /* ASCII */
|
||||
"\xc0\x80" /* nul (U+0000) */
|
||||
"\xc2\x85" /* next line (U+0085) */
|
||||
@@ -2884,7 +2884,7 @@ StringCatCmd(
|
||||
Tcl_AppendObjToObj(objResultPtr, objv[i]);
|
||||
}
|
||||
Tcl_SetObjResult(interp, objResultPtr);
|
||||
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
+277
-129
@@ -26,14 +26,23 @@ static void FreeDictUpdateInfo(ClientData clientData);
|
||||
static void PrintDictUpdateInfo(ClientData clientData,
|
||||
Tcl_Obj *appendObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static void DisassembleDictUpdateInfo(ClientData clientData,
|
||||
Tcl_Obj *dictObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static ClientData DupForeachInfo(ClientData clientData);
|
||||
static void FreeForeachInfo(ClientData clientData);
|
||||
static void PrintForeachInfo(ClientData clientData,
|
||||
Tcl_Obj *appendObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static void DisassembleForeachInfo(ClientData clientData,
|
||||
Tcl_Obj *dictObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static void PrintNewForeachInfo(ClientData clientData,
|
||||
Tcl_Obj *appendObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static void DisassembleNewForeachInfo(ClientData clientData,
|
||||
Tcl_Obj *dictObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static int CompileEachloopCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Command *cmdPtr,
|
||||
CompileEnv *envPtr, int collect);
|
||||
@@ -45,27 +54,63 @@ static int CompileDictEachCmd(Tcl_Interp *interp,
|
||||
* The structures below define the AuxData types defined in this file.
|
||||
*/
|
||||
|
||||
const AuxDataType tclForeachInfoType = {
|
||||
static const AuxDataType foreachInfoType = {
|
||||
"ForeachInfo", /* name */
|
||||
DupForeachInfo, /* dupProc */
|
||||
FreeForeachInfo, /* freeProc */
|
||||
PrintForeachInfo /* printProc */
|
||||
PrintForeachInfo, /* printProc */
|
||||
DisassembleForeachInfo /* disassembleProc */
|
||||
};
|
||||
|
||||
const AuxDataType tclNewForeachInfoType = {
|
||||
static const AuxDataType newForeachInfoType = {
|
||||
"NewForeachInfo", /* name */
|
||||
DupForeachInfo, /* dupProc */
|
||||
FreeForeachInfo, /* freeProc */
|
||||
PrintNewForeachInfo /* printProc */
|
||||
PrintNewForeachInfo, /* printProc */
|
||||
DisassembleNewForeachInfo /* disassembleProc */
|
||||
};
|
||||
|
||||
const AuxDataType tclDictUpdateInfoType = {
|
||||
static const AuxDataType dictUpdateInfoType = {
|
||||
"DictUpdateInfo", /* name */
|
||||
DupDictUpdateInfo, /* dupProc */
|
||||
FreeDictUpdateInfo, /* freeProc */
|
||||
PrintDictUpdateInfo /* printProc */
|
||||
PrintDictUpdateInfo, /* printProc */
|
||||
DisassembleDictUpdateInfo /* disassembleProc */
|
||||
};
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclGetAuxDataType --
|
||||
*
|
||||
* This procedure looks up an Auxdata type by name.
|
||||
*
|
||||
* Results:
|
||||
* If an AuxData type with name matching "typeName" is found, a pointer
|
||||
* to its AuxDataType structure is returned; otherwise, NULL is returned.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const AuxDataType *
|
||||
TclGetAuxDataType(
|
||||
const char *typeName) /* Name of AuxData type to look up. */
|
||||
{
|
||||
if (!strcmp(typeName, foreachInfoType.name)) {
|
||||
return &foreachInfoType;
|
||||
} else if (!strcmp(typeName, newForeachInfoType.name)) {
|
||||
return &newForeachInfoType;
|
||||
} else if (!strcmp(typeName, dictUpdateInfoType.name)) {
|
||||
return &dictUpdateInfoType;
|
||||
} else if (!strcmp(typeName, tclJumptableInfoType.name)) {
|
||||
return &tclJumptableInfoType;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -165,9 +210,9 @@ TclCompileAppendCmd(
|
||||
*/
|
||||
|
||||
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
PushVarNameWord(interp, varTokenPtr, envPtr, TCL_NO_ELEMENT,
|
||||
&localIndex, &isScalar, 1);
|
||||
if (!isScalar || localIndex < 0) {
|
||||
|
||||
localIndex = LocalScalarFromToken(varTokenPtr, envPtr);
|
||||
if (localIndex < 0) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -289,7 +334,8 @@ TclCompileArraySetCmd(
|
||||
* a proc, we cannot do a better compile than generic.
|
||||
*/
|
||||
|
||||
if (envPtr->procPtr == NULL && !(isDataEven && len == 0)) {
|
||||
if ((varTokenPtr->type != TCL_TOKEN_SIMPLE_WORD) ||
|
||||
(envPtr->procPtr == NULL && !(isDataEven && len == 0))) {
|
||||
code = TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
|
||||
goto done;
|
||||
}
|
||||
@@ -330,14 +376,15 @@ TclCompileArraySetCmd(
|
||||
* a non-local variable: upvar from a local one! This consumes the
|
||||
* variable name that was left at stacktop.
|
||||
*/
|
||||
|
||||
localIndex = AnonymousLocal(envPtr);
|
||||
|
||||
localIndex = TclFindCompiledLocal(varTokenPtr->start,
|
||||
varTokenPtr->size, 1, envPtr);
|
||||
PushStringLiteral(envPtr, "0");
|
||||
TclEmitInstInt4(INST_REVERSE, 2, envPtr);
|
||||
TclEmitInstInt4(INST_UPVAR, localIndex, envPtr);
|
||||
TclEmitOpcode(INST_POP, envPtr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Prepare for the internal foreach.
|
||||
*/
|
||||
@@ -351,7 +398,7 @@ TclCompileArraySetCmd(
|
||||
infoPtr->varLists[0]->numVars = 2;
|
||||
infoPtr->varLists[0]->varIndexes[0] = keyVar;
|
||||
infoPtr->varLists[0]->varIndexes[1] = valVar;
|
||||
infoIndex = TclCreateAuxData(infoPtr, &tclForeachInfoType, envPtr);
|
||||
infoIndex = TclCreateAuxData(infoPtr, &newForeachInfoType, envPtr);
|
||||
|
||||
/*
|
||||
* Start issuing instructions to write to the array.
|
||||
@@ -533,7 +580,7 @@ TclCompileCatchCmd(
|
||||
int resultIndex, optsIndex, range, dropScript = 0;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int depth = TclGetStackDepth(envPtr);
|
||||
|
||||
|
||||
/*
|
||||
* If syntax does not match what we expect for [catch], do not compile.
|
||||
* Let runtime checks determine if syntax has changed.
|
||||
@@ -612,7 +659,7 @@ TclCompileCatchCmd(
|
||||
}
|
||||
ExceptionRangeEnds(envPtr, range);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Emit the "no errors" epilogue: push "0" (TCL_OK) as the catch result,
|
||||
* and jump around the "error case" code.
|
||||
@@ -622,14 +669,14 @@ TclCompileCatchCmd(
|
||||
PushStringLiteral(envPtr, "0");
|
||||
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &jumpFixup);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Emit the "error case" epilogue. Push the interpreter result and the
|
||||
* return code.
|
||||
*/
|
||||
|
||||
ExceptionRangeTarget(envPtr, range, catchOffset);
|
||||
TclSetStackDepth(depth + dropScript, envPtr);
|
||||
|
||||
|
||||
if (dropScript) {
|
||||
TclEmitOpcode( INST_POP, envPtr);
|
||||
}
|
||||
@@ -1655,7 +1702,7 @@ TclCompileDictUpdateCmd(
|
||||
* can't be snagged by literal sharing and forced to shimmer dangerously.
|
||||
*/
|
||||
|
||||
infoIndex = TclCreateAuxData(duiPtr, &tclDictUpdateInfoType, envPtr);
|
||||
infoIndex = TclCreateAuxData(duiPtr, &dictUpdateInfoType, envPtr);
|
||||
|
||||
for (i=0 ; i<numVars ; i++) {
|
||||
CompileWord(envPtr, keyTokenPtrs[i], interp, 2*i+2);
|
||||
@@ -2084,11 +2131,13 @@ TclCompileDictWithCmd(
|
||||
* DupDictUpdateInfo: a copy of the auxiliary data
|
||||
* FreeDictUpdateInfo: none
|
||||
* PrintDictUpdateInfo: none
|
||||
* DisassembleDictUpdateInfo: none
|
||||
*
|
||||
* Side effects:
|
||||
* DupDictUpdateInfo: allocates memory
|
||||
* FreeDictUpdateInfo: releases memory
|
||||
* PrintDictUpdateInfo: none
|
||||
* DisassembleDictUpdateInfo: none
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2131,6 +2180,25 @@ PrintDictUpdateInfo(
|
||||
Tcl_AppendPrintfToObj(appendObj, "%%v%u", duiPtr->varIndices[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
DisassembleDictUpdateInfo(
|
||||
ClientData clientData,
|
||||
Tcl_Obj *dictObj,
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
DictUpdateInfo *duiPtr = clientData;
|
||||
int i;
|
||||
Tcl_Obj *variables = Tcl_NewObj();
|
||||
|
||||
for (i=0 ; i<duiPtr->length ; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, variables,
|
||||
Tcl_NewIntObj(duiPtr->varIndices[i]));
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("variables", -1),
|
||||
variables);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -2368,7 +2436,6 @@ TclCompileForCmd(
|
||||
|
||||
SetLineInformation(2);
|
||||
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
|
||||
TclClearNumConversion(envPtr);
|
||||
|
||||
jumpDist = CurrentOffset(envPtr) - bodyCodeOffset;
|
||||
if (jumpDist > 127) {
|
||||
@@ -2493,24 +2560,16 @@ CompileEachloopCmd(
|
||||
* (TCL_EACH_*) */
|
||||
{
|
||||
Proc *procPtr = envPtr->procPtr;
|
||||
ForeachInfo *infoPtr; /* Points to the structure describing this
|
||||
ForeachInfo *infoPtr=NULL; /* Points to the structure describing this
|
||||
* foreach command. Stored in a AuxData
|
||||
* record in the ByteCode. */
|
||||
|
||||
|
||||
Tcl_Token *tokenPtr, *bodyTokenPtr;
|
||||
int jumpBackOffset, infoIndex, range;
|
||||
int numWords, numLists, numVars, loopIndex, i, j, code;
|
||||
int numWords, numLists, i, j, code = TCL_OK;
|
||||
Tcl_Obj *varListObj = NULL;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
* We parse the variable list argument words and create two arrays:
|
||||
* varcList[i] is number of variables in i-th var list.
|
||||
* varvList[i] points to array of var names in i-th var list.
|
||||
*/
|
||||
|
||||
int *varcList;
|
||||
const char ***varvList;
|
||||
|
||||
/*
|
||||
* If the foreach command isn't in a procedure, don't compile it inline:
|
||||
* the payoff is too small.
|
||||
@@ -2539,115 +2598,83 @@ CompileEachloopCmd(
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate storage for the varcList and varvList arrays if necessary.
|
||||
* 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;
|
||||
varcList = TclStackAlloc(interp, numLists * sizeof(int));
|
||||
memset(varcList, 0, numLists * sizeof(int));
|
||||
varvList = (const char ***) TclStackAlloc(interp,
|
||||
numLists * sizeof(const char **));
|
||||
memset((char*) varvList, 0, numLists * sizeof(const char **));
|
||||
infoPtr = ckalloc(sizeof(ForeachInfo)
|
||||
+ (numLists - 1) * sizeof(ForeachVarList *));
|
||||
infoPtr->numLists = 0; /* Count this up as we go */
|
||||
|
||||
/*
|
||||
* Break up each var list and set the varcList and varvList arrays. Don't
|
||||
* 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.
|
||||
*/
|
||||
|
||||
loopIndex = 0;
|
||||
varListObj = Tcl_NewObj();
|
||||
for (i = 0, tokenPtr = parsePtr->tokenPtr;
|
||||
i < numWords-1;
|
||||
i++, tokenPtr = TokenAfter(tokenPtr)) {
|
||||
Tcl_DString varList;
|
||||
ForeachVarList *varListPtr;
|
||||
int numVars;
|
||||
|
||||
if (i%2 != 1) {
|
||||
continue;
|
||||
}
|
||||
if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) {
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/*
|
||||
* Lots of copying going on here. Need a ListObj wizard to show a
|
||||
* better way.
|
||||
*/
|
||||
|
||||
Tcl_DStringInit(&varList);
|
||||
TclDStringAppendToken(&varList, &tokenPtr[1]);
|
||||
code = Tcl_SplitList(NULL, Tcl_DStringValue(&varList),
|
||||
&varcList[loopIndex], &varvList[loopIndex]);
|
||||
Tcl_DStringFree(&varList);
|
||||
if (code != TCL_OK) {
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
numVars = varcList[loopIndex];
|
||||
|
||||
/*
|
||||
* 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]
|
||||
* the interpreted version would not. Take care to ensure this does
|
||||
* not happen. [Bug 1671138]
|
||||
*/
|
||||
|
||||
if (numVars == 0) {
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, varListObj) ||
|
||||
TCL_OK != Tcl_ListObjLength(NULL, varListObj, &numVars) ||
|
||||
numVars == 0) {
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
for (j = 0; j < numVars; j++) {
|
||||
const char *varName = varvList[loopIndex][j];
|
||||
varListPtr = ckalloc(sizeof(ForeachVarList)
|
||||
+ (numVars - 1) * sizeof(int));
|
||||
varListPtr->numVars = numVars;
|
||||
infoPtr->varLists[i/2] = varListPtr;
|
||||
infoPtr->numLists++;
|
||||
|
||||
if (!TclIsLocalScalar(varName, (int) strlen(varName))) {
|
||||
for (j = 0; j < numVars; j++) {
|
||||
Tcl_Obj *varNameObj;
|
||||
const char *bytes;
|
||||
int numBytes, varIndex;
|
||||
|
||||
Tcl_ListObjIndex(NULL, varListObj, j, &varNameObj);
|
||||
bytes = Tcl_GetStringFromObj(varNameObj, &numBytes);
|
||||
varIndex = LocalScalar(bytes, numBytes, envPtr);
|
||||
if (varIndex < 0) {
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
varListPtr->varIndexes[j] = varIndex;
|
||||
}
|
||||
loopIndex++;
|
||||
Tcl_SetObjLength(varListObj, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* We will compile the foreach command.
|
||||
*/
|
||||
|
||||
code = TCL_OK;
|
||||
|
||||
/*
|
||||
* Create and initialize the ForeachInfo and ForeachVarList data
|
||||
* structures describing this command. Then create a AuxData record
|
||||
* pointing to the ForeachInfo structure.
|
||||
*/
|
||||
|
||||
infoPtr = ckalloc(sizeof(ForeachInfo)
|
||||
+ (numLists - 1) * sizeof(ForeachVarList *));
|
||||
infoPtr->numLists = numLists;
|
||||
for (loopIndex = 0; loopIndex < numLists; loopIndex++) {
|
||||
ForeachVarList *varListPtr;
|
||||
|
||||
numVars = varcList[loopIndex];
|
||||
varListPtr = ckalloc(sizeof(ForeachVarList)
|
||||
+ (numVars - 1) * sizeof(int));
|
||||
varListPtr->numVars = numVars;
|
||||
for (j = 0; j < numVars; j++) {
|
||||
const char *varName = varvList[loopIndex][j];
|
||||
int nameChars = strlen(varName);
|
||||
|
||||
varListPtr->varIndexes[j] = TclFindCompiledLocal(varName,
|
||||
nameChars, /*create*/ 1, envPtr);
|
||||
}
|
||||
infoPtr->varLists[loopIndex] = varListPtr;
|
||||
}
|
||||
infoIndex = TclCreateAuxData(infoPtr, &tclNewForeachInfoType, envPtr);
|
||||
infoIndex = TclCreateAuxData(infoPtr, &newForeachInfoType, envPtr);
|
||||
|
||||
/*
|
||||
* Create the collecting object, unshared.
|
||||
*/
|
||||
|
||||
|
||||
if (collect == TCL_EACH_COLLECT) {
|
||||
TclEmitInstInt4(INST_LIST, 0, envPtr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Evaluate each value list and leave it on stack.
|
||||
*/
|
||||
@@ -2661,7 +2688,7 @@ CompileEachloopCmd(
|
||||
}
|
||||
|
||||
TclEmitInstInt4(INST_FOREACH_START, infoIndex, envPtr);
|
||||
|
||||
|
||||
/*
|
||||
* Inline compile the loop body.
|
||||
*/
|
||||
@@ -2671,7 +2698,7 @@ CompileEachloopCmd(
|
||||
ExceptionRangeStarts(envPtr, range);
|
||||
BODY(bodyTokenPtr, numWords - 1);
|
||||
ExceptionRangeEnds(envPtr, range);
|
||||
|
||||
|
||||
if (collect == TCL_EACH_COLLECT) {
|
||||
TclEmitOpcode(INST_LMAP_COLLECT, envPtr);
|
||||
} else {
|
||||
@@ -2680,7 +2707,7 @@ CompileEachloopCmd(
|
||||
|
||||
/*
|
||||
* Bottom of loop code: assign each loop variable and check whether
|
||||
* to terminate the loop. Set the loop's break target.
|
||||
* to terminate the loop. Set the loop's break target.
|
||||
*/
|
||||
|
||||
ExceptionRangeTarget(envPtr, range, continueOffset);
|
||||
@@ -2694,7 +2721,7 @@ CompileEachloopCmd(
|
||||
* 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;
|
||||
@@ -2707,15 +2734,12 @@ CompileEachloopCmd(
|
||||
if (collect != TCL_EACH_COLLECT) {
|
||||
PushStringLiteral(envPtr, "");
|
||||
}
|
||||
|
||||
|
||||
done:
|
||||
for (loopIndex = 0; loopIndex < numLists; loopIndex++) {
|
||||
if (varvList[loopIndex] != NULL) {
|
||||
ckfree(varvList[loopIndex]);
|
||||
}
|
||||
if (code == TCL_ERROR) {
|
||||
FreeForeachInfo(infoPtr);
|
||||
}
|
||||
TclStackFree(interp, (void *)varvList);
|
||||
TclStackFree(interp, varcList);
|
||||
Tcl_DecrRefCount(varListObj);
|
||||
return code;
|
||||
}
|
||||
|
||||
@@ -2809,10 +2833,10 @@ FreeForeachInfo(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* PrintForeachInfo --
|
||||
* PrintForeachInfo, DisassembleForeachInfo --
|
||||
*
|
||||
* Function to write a human-readable representation of a ForeachInfo
|
||||
* structure to stdout for debugging.
|
||||
* Functions to write a human-readable or script-readablerepresentation
|
||||
* of a ForeachInfo structure to a Tcl_Obj for debugging.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
@@ -2892,6 +2916,89 @@ PrintNewForeachInfo(
|
||||
Tcl_AppendToObj(appendObj, "]", -1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
DisassembleForeachInfo(
|
||||
ClientData clientData,
|
||||
Tcl_Obj *dictObj,
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
register ForeachInfo *infoPtr = clientData;
|
||||
register ForeachVarList *varsPtr;
|
||||
int i, j;
|
||||
Tcl_Obj *objPtr, *innerPtr;
|
||||
|
||||
/*
|
||||
* Data stores.
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
for (i=0 ; i<infoPtr->numLists ; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, objPtr,
|
||||
Tcl_NewIntObj(infoPtr->firstValueTemp + i));
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("data", -1), objPtr);
|
||||
|
||||
/*
|
||||
* Loop counter.
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("loop", -1),
|
||||
Tcl_NewIntObj(infoPtr->loopCtTemp));
|
||||
|
||||
/*
|
||||
* Assignment targets.
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
for (i=0 ; i<infoPtr->numLists ; i++) {
|
||||
innerPtr = Tcl_NewObj();
|
||||
varsPtr = infoPtr->varLists[i];
|
||||
for (j=0 ; j<varsPtr->numVars ; j++) {
|
||||
Tcl_ListObjAppendElement(NULL, innerPtr,
|
||||
Tcl_NewIntObj(varsPtr->varIndexes[j]));
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, objPtr, innerPtr);
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("assign", -1), objPtr);
|
||||
}
|
||||
|
||||
static void
|
||||
DisassembleNewForeachInfo(
|
||||
ClientData clientData,
|
||||
Tcl_Obj *dictObj,
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
register ForeachInfo *infoPtr = clientData;
|
||||
register ForeachVarList *varsPtr;
|
||||
int i, j;
|
||||
Tcl_Obj *objPtr, *innerPtr;
|
||||
|
||||
/*
|
||||
* Jump offset.
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("jumpOffset", -1),
|
||||
Tcl_NewIntObj(infoPtr->loopCtTemp));
|
||||
|
||||
/*
|
||||
* Assignment targets.
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
for (i=0 ; i<infoPtr->numLists ; i++) {
|
||||
innerPtr = Tcl_NewObj();
|
||||
varsPtr = infoPtr->varLists[i];
|
||||
for (j=0 ; j<varsPtr->numVars ; j++) {
|
||||
Tcl_ListObjAppendElement(NULL, innerPtr,
|
||||
Tcl_NewIntObj(varsPtr->varIndexes[j]));
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, objPtr, innerPtr);
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("assign", -1), objPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -3114,6 +3221,54 @@ TclCompileFormatCmd(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclLocalScalarFromToken --
|
||||
*
|
||||
* Get the index into the table of compiled locals that corresponds
|
||||
* to a local scalar variable name.
|
||||
*
|
||||
* Results:
|
||||
* Returns the non-negative integer index value into the table of
|
||||
* compiled locals corresponding to a local scalar variable name.
|
||||
* If the arguments passed in do not identify a local scalar variable
|
||||
* then return -1.
|
||||
*
|
||||
* Side effects:
|
||||
* May add an entery into the table of compiled locals.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclLocalScalarFromToken(
|
||||
Tcl_Token *tokenPtr,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
int isScalar, index;
|
||||
|
||||
TclPushVarName(NULL, tokenPtr, envPtr, TCL_NO_ELEMENT, &index, &isScalar);
|
||||
if (!isScalar) {
|
||||
index = -1;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
int
|
||||
TclLocalScalar(
|
||||
const char *bytes,
|
||||
int numBytes,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
Tcl_Token token[2] = {{TCL_TOKEN_SIMPLE_WORD, NULL, 0, 1},
|
||||
{TCL_TOKEN_TEXT, NULL, 0, 0}};
|
||||
|
||||
token[1].start = bytes;
|
||||
token[1].size = numBytes;
|
||||
return TclLocalScalarFromToken(token, envPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -3172,16 +3327,7 @@ TclPushVarName(
|
||||
nameChars = elNameChars = 0;
|
||||
localIndex = -1;
|
||||
|
||||
/*
|
||||
* Check not only that the type is TCL_TOKEN_SIMPLE_WORD, but whether
|
||||
* curly braces surround the variable name. This really matters for array
|
||||
* elements to handle things like
|
||||
* set {x($foo)} 5
|
||||
* which raises an undefined var error if we are not careful here.
|
||||
*/
|
||||
|
||||
if ((varTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) &&
|
||||
(varTokenPtr->start[0] != '{')) {
|
||||
if (varTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
|
||||
/*
|
||||
* A simple variable name. Divide it up into "name" and "elName"
|
||||
* strings. If it is not a local variable, look it up at runtime.
|
||||
@@ -3205,7 +3351,7 @@ TclPushVarName(
|
||||
}
|
||||
}
|
||||
|
||||
if ((elName != NULL) && elNameChars) {
|
||||
if (!(flags & TCL_NO_ELEMENT) && (elName != NULL) && elNameChars) {
|
||||
/*
|
||||
* An array element, the element name is a simple string:
|
||||
* assemble the corresponding token.
|
||||
@@ -3220,7 +3366,7 @@ TclPushVarName(
|
||||
elemTokenCount = 1;
|
||||
}
|
||||
}
|
||||
} else if (((n = varTokenPtr->numComponents) > 1)
|
||||
} else if (interp && ((n = varTokenPtr->numComponents) > 1)
|
||||
&& (varTokenPtr[1].type == TCL_TOKEN_TEXT)
|
||||
&& (varTokenPtr[n].type == TCL_TOKEN_TEXT)
|
||||
&& (varTokenPtr[n].start[varTokenPtr[n].size - 1] == ')')) {
|
||||
@@ -3256,9 +3402,10 @@ TclPushVarName(
|
||||
nameChars = p - varTokenPtr[1].start;
|
||||
elName = p + 1;
|
||||
remainingChars = (varTokenPtr[2].start - p) - 1;
|
||||
elNameChars = (varTokenPtr[n].start-p) + varTokenPtr[n].size - 2;
|
||||
elNameChars = (varTokenPtr[n].start-p) + varTokenPtr[n].size - 1;
|
||||
|
||||
if (remainingChars) {
|
||||
if (!(flags & TCL_NO_ELEMENT)) {
|
||||
if (remainingChars) {
|
||||
/*
|
||||
* Make a first token with the extra characters in the first
|
||||
* token.
|
||||
@@ -3278,13 +3425,14 @@ TclPushVarName(
|
||||
|
||||
memcpy(elemTokenPtr+1, varTokenPtr+2,
|
||||
(n-1) * sizeof(Tcl_Token));
|
||||
} else {
|
||||
} else {
|
||||
/*
|
||||
* Use the already available tokens.
|
||||
*/
|
||||
|
||||
elemTokenPtr = &varTokenPtr[2];
|
||||
elemTokenCount = n - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3319,7 +3467,7 @@ TclPushVarName(
|
||||
localIndex = -1;
|
||||
}
|
||||
}
|
||||
if (localIndex < 0) {
|
||||
if (interp && localIndex < 0) {
|
||||
PushLiteral(envPtr, name, nameChars);
|
||||
}
|
||||
|
||||
@@ -3336,7 +3484,7 @@ TclPushVarName(
|
||||
PushStringLiteral(envPtr, "");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if (interp) {
|
||||
/*
|
||||
* The var name isn't simple: compile and push it.
|
||||
*/
|
||||
|
||||
+31
-33
@@ -144,7 +144,7 @@ TclCompileGlobalCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/* TODO: Consider what value can pass throug the
|
||||
/* TODO: Consider what value can pass throug the
|
||||
* IndexTailVarIfKnown() screen. Full CompileWord()
|
||||
* likely does not apply here. Push known value instead. */
|
||||
CompileWord(envPtr, varTokenPtr, interp, i);
|
||||
@@ -281,7 +281,6 @@ TclCompileIfCmd(
|
||||
SetLineInformation(wordIdx);
|
||||
Tcl_ResetResult(interp);
|
||||
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
|
||||
TclClearNumConversion(envPtr);
|
||||
if (jumpFalseFixupArray.next >= jumpFalseFixupArray.end) {
|
||||
TclExpandJumpFixupArray(&jumpFalseFixupArray);
|
||||
}
|
||||
@@ -531,7 +530,6 @@ TclCompileIncrCmd(
|
||||
} else {
|
||||
SetLineInformation(2);
|
||||
CompileTokens(envPtr, incrTokenPtr, interp);
|
||||
TclClearNumConversion(envPtr);
|
||||
}
|
||||
} else { /* No incr amount given so use 1. */
|
||||
haveImmValue = 1;
|
||||
@@ -873,7 +871,7 @@ TclCompileLappendCmd(
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords;
|
||||
if (numWords == 1) {
|
||||
if (numWords < 3) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1212,20 +1210,7 @@ TclCompileListCmd(
|
||||
valueTokenPtr = TokenAfter(valueTokenPtr);
|
||||
}
|
||||
if (listObj != NULL) {
|
||||
int len;
|
||||
const char *bytes = Tcl_GetStringFromObj(listObj, &len);
|
||||
|
||||
PushLiteral(envPtr, bytes, len);
|
||||
Tcl_DecrRefCount(listObj);
|
||||
if (len > 0) {
|
||||
/*
|
||||
* Force list interpretation!
|
||||
*/
|
||||
|
||||
TclEmitOpcode( INST_DUP, envPtr);
|
||||
TclEmitOpcode( INST_LIST_LENGTH, envPtr);
|
||||
TclEmitOpcode( INST_POP, envPtr);
|
||||
}
|
||||
TclEmitPush(TclAddLiteralObj(envPtr, listObj, NULL), envPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -1480,7 +1465,7 @@ TclCompileLreplaceCmd(
|
||||
Tcl_Token *tokenPtr, *listTokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Obj *tmpObj;
|
||||
int idx1, idx2, i, offset;
|
||||
int idx1, idx2, i, offset, offset2;
|
||||
|
||||
if (parsePtr->numWords < 4) {
|
||||
return TCL_ERROR;
|
||||
@@ -1503,6 +1488,10 @@ TclCompileLreplaceCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if(idx2 != INDEX_END && idx2 >= 0 && idx2 < idx1) {
|
||||
idx2 = idx1-1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Work out what this [lreplace] is actually doing.
|
||||
*/
|
||||
@@ -1586,12 +1575,18 @@ TclCompileLreplaceCmd(
|
||||
TclEmitOpcode( INST_GT, envPtr);
|
||||
offset = CurrentOffset(envPtr);
|
||||
TclEmitInstInt1( INST_JUMP_TRUE1, 0, envPtr);
|
||||
TclEmitOpcode( INST_DUP, envPtr);
|
||||
TclEmitOpcode( INST_LIST_LENGTH, envPtr);
|
||||
offset2 = CurrentOffset(envPtr);
|
||||
TclEmitInstInt1( INST_JUMP_FALSE1, 0, envPtr);
|
||||
TclEmitPush(TclAddLiteralObj(envPtr, Tcl_ObjPrintf(
|
||||
"list doesn't contain element %d", idx1), NULL), envPtr);
|
||||
CompileReturnInternal(envPtr, INST_RETURN_IMM, TCL_ERROR, 0,
|
||||
Tcl_ObjPrintf("-errorcode {TCL OPERATION LREPLACE BADIDX}"));
|
||||
TclStoreInt1AtPtr(CurrentOffset(envPtr) - offset,
|
||||
envPtr->codeStart + offset + 1);
|
||||
TclStoreInt1AtPtr(CurrentOffset(envPtr) - offset2,
|
||||
envPtr->codeStart + offset2 + 1);
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
}
|
||||
TclEmitOpcode( INST_DUP, envPtr);
|
||||
@@ -1636,12 +1631,18 @@ TclCompileLreplaceCmd(
|
||||
TclEmitOpcode( INST_GT, envPtr);
|
||||
offset = CurrentOffset(envPtr);
|
||||
TclEmitInstInt1( INST_JUMP_TRUE1, 0, envPtr);
|
||||
TclEmitOpcode( INST_DUP, envPtr);
|
||||
TclEmitOpcode( INST_LIST_LENGTH, envPtr);
|
||||
offset2 = CurrentOffset(envPtr);
|
||||
TclEmitInstInt1( INST_JUMP_TRUE1, 0, envPtr);
|
||||
TclEmitPush(TclAddLiteralObj(envPtr, Tcl_ObjPrintf(
|
||||
"list doesn't contain element %d", idx1), NULL), envPtr);
|
||||
CompileReturnInternal(envPtr, INST_RETURN_IMM, TCL_ERROR, 0,
|
||||
Tcl_ObjPrintf("-errorcode {TCL OPERATION LREPLACE BADIDX}"));
|
||||
TclStoreInt1AtPtr(CurrentOffset(envPtr) - offset,
|
||||
envPtr->codeStart + offset + 1);
|
||||
TclStoreInt1AtPtr(CurrentOffset(envPtr) - offset2,
|
||||
envPtr->codeStart + offset2 + 1);
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
}
|
||||
TclEmitOpcode( INST_DUP, envPtr);
|
||||
@@ -2034,7 +2035,7 @@ TclCompileNamespaceUpvarCmd(
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
|
||||
int isScalar, localIndex, numWords, i;
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (envPtr->procPtr == NULL) {
|
||||
@@ -2069,10 +2070,8 @@ TclCompileNamespaceUpvarCmd(
|
||||
localTokenPtr = TokenAfter(otherTokenPtr);
|
||||
|
||||
CompileWord(envPtr, otherTokenPtr, interp, i);
|
||||
PushVarNameWord(interp, localTokenPtr, envPtr, 0,
|
||||
&localIndex, &isScalar, i+1);
|
||||
|
||||
if ((localIndex < 0) || !isScalar) {
|
||||
localIndex = LocalScalarFromToken(localTokenPtr, envPtr);
|
||||
if (localIndex < 0) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclEmitInstInt4( INST_NSUPVAR, localIndex, envPtr);
|
||||
@@ -2258,7 +2257,7 @@ TclCompileRegexpCmd(
|
||||
* converted pattern as a literal.
|
||||
*/
|
||||
|
||||
if (TclReToGlob(NULL, varTokenPtr[1].start, len, &ds, &exact)
|
||||
if (TclReToGlob(NULL, varTokenPtr[1].start, len, &ds, &exact, NULL)
|
||||
== TCL_OK) {
|
||||
simple = 1;
|
||||
PushLiteral(envPtr, Tcl_DStringValue(&ds),Tcl_DStringLength(&ds));
|
||||
@@ -2350,7 +2349,7 @@ TclCompileRegsubCmd(
|
||||
Tcl_Obj *patternObj = NULL, *replacementObj = NULL;
|
||||
Tcl_DString pattern;
|
||||
const char *bytes;
|
||||
int len, exact, result = TCL_ERROR;
|
||||
int len, exact, quantified, result = TCL_ERROR;
|
||||
|
||||
if (parsePtr->numWords < 5 || parsePtr->numWords > 6) {
|
||||
return TCL_ERROR;
|
||||
@@ -2410,7 +2409,8 @@ TclCompileRegsubCmd(
|
||||
*/
|
||||
|
||||
bytes = Tcl_GetStringFromObj(patternObj, &len);
|
||||
if (TclReToGlob(NULL, bytes, len, &pattern, &exact) != TCL_OK || exact) {
|
||||
if (TclReToGlob(NULL, bytes, len, &pattern, &exact, &quantified)
|
||||
!= TCL_OK || exact || quantified) {
|
||||
goto done;
|
||||
}
|
||||
bytes = Tcl_DStringValue(&pattern);
|
||||
@@ -2752,7 +2752,7 @@ TclCompileUpvarCmd(
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
|
||||
int isScalar, localIndex, numWords, i;
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
@@ -2815,10 +2815,8 @@ TclCompileUpvarCmd(
|
||||
localTokenPtr = TokenAfter(otherTokenPtr);
|
||||
|
||||
CompileWord(envPtr, otherTokenPtr, interp, i);
|
||||
PushVarNameWord(interp, localTokenPtr, envPtr, 0,
|
||||
&localIndex, &isScalar, i+1);
|
||||
|
||||
if ((localIndex < 0) || !isScalar) {
|
||||
localIndex = LocalScalarFromToken(localTokenPtr, envPtr);
|
||||
if (localIndex < 0) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclEmitInstInt4( INST_UPVAR, localIndex, envPtr);
|
||||
@@ -2892,7 +2890,7 @@ TclCompileVariableCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/* TODO: Consider what value can pass throug the
|
||||
/* TODO: Consider what value can pass throug the
|
||||
* IndexTailVarIfKnown() screen. Full CompileWord()
|
||||
* likely does not apply here. Push known value instead. */
|
||||
CompileWord(envPtr, varTokenPtr, interp, i);
|
||||
|
||||
+47
-17
@@ -28,6 +28,9 @@ static void FreeJumptableInfo(ClientData clientData);
|
||||
static void PrintJumptableInfo(ClientData clientData,
|
||||
Tcl_Obj *appendObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static void DisassembleJumptableInfo(ClientData clientData,
|
||||
Tcl_Obj *dictObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static int CompileAssociativeBinaryOpCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, const char *identity,
|
||||
int instruction, CompileEnv *envPtr);
|
||||
@@ -72,7 +75,8 @@ const AuxDataType tclJumptableInfoType = {
|
||||
"JumptableInfo", /* name */
|
||||
DupJumptableInfo, /* dupProc */
|
||||
FreeJumptableInfo, /* freeProc */
|
||||
PrintJumptableInfo /* printProc */
|
||||
PrintJumptableInfo, /* printProc */
|
||||
DisassembleJumptableInfo /* disassembleProc */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -288,7 +292,7 @@ TclCompileStringCatCmd(
|
||||
PushStringLiteral(envPtr, "");
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
/* General case: issue CONCAT1's (by chunks of 254 if needed), folding
|
||||
contiguous constants along the way */
|
||||
|
||||
@@ -309,7 +313,7 @@ TclCompileStringCatCmd(
|
||||
if (folded) {
|
||||
int len;
|
||||
const char *bytes = Tcl_GetStringFromObj(folded, &len);
|
||||
|
||||
|
||||
PushLiteral(envPtr, bytes, len);
|
||||
Tcl_DecrRefCount(folded);
|
||||
folded = NULL;
|
||||
@@ -318,8 +322,8 @@ TclCompileStringCatCmd(
|
||||
CompileWord(envPtr, wordTokenPtr, interp, i);
|
||||
numArgs ++;
|
||||
if (numArgs >= 254) { /* 254 to take care of the possible +1 of "folded" above */
|
||||
TclEmitInstInt1(INST_STR_CONCAT1, 254, envPtr);
|
||||
numArgs -= 253; /* concat pushes 1 obj, the result */
|
||||
TclEmitInstInt1(INST_STR_CONCAT1, numArgs, envPtr);
|
||||
numArgs = 1; /* concat pushes 1 obj, the result */
|
||||
}
|
||||
}
|
||||
wordTokenPtr = TokenAfter(wordTokenPtr);
|
||||
@@ -327,7 +331,7 @@ TclCompileStringCatCmd(
|
||||
if (folded) {
|
||||
int len;
|
||||
const char *bytes = Tcl_GetStringFromObj(folded, &len);
|
||||
|
||||
|
||||
PushLiteral(envPtr, bytes, len);
|
||||
Tcl_DecrRefCount(folded);
|
||||
folded = NULL;
|
||||
@@ -999,7 +1003,7 @@ TclCompileStringRangeCmd(
|
||||
|
||||
/*
|
||||
* Push the operands onto the stack and then the substring operation.
|
||||
*/
|
||||
*/
|
||||
|
||||
nonConstantIndices:
|
||||
CompileWord(envPtr, stringTokenPtr, interp, 1);
|
||||
@@ -2091,7 +2095,7 @@ IssueSwitchChainedTests(
|
||||
*/
|
||||
|
||||
if (TclReToGlob(NULL, bodyToken[i]->start,
|
||||
bodyToken[i]->size, &ds, &exact) == TCL_OK) {
|
||||
bodyToken[i]->size, &ds, &exact, NULL) == TCL_OK){
|
||||
simple = 1;
|
||||
PushLiteral(envPtr, Tcl_DStringValue(&ds),
|
||||
Tcl_DStringLength(&ds));
|
||||
@@ -2178,7 +2182,7 @@ IssueSwitchChainedTests(
|
||||
}
|
||||
|
||||
/*
|
||||
* Now do the actual compilation. Note that we do not use BODY()
|
||||
* Now do the actual compilation. Note that we do not use BODY()
|
||||
* because we may have synthesized the tokens in a non-standard
|
||||
* pattern.
|
||||
*/
|
||||
@@ -2441,11 +2445,13 @@ IssueSwitchJumpTable(
|
||||
* DupJumptableInfo: a copy of the jump-table
|
||||
* FreeJumptableInfo: none
|
||||
* PrintJumptableInfo: none
|
||||
* DisassembleJumptableInfo: none
|
||||
*
|
||||
* Side effects:
|
||||
* DupJumptableInfo: allocates memory
|
||||
* FreeJumptableInfo: releases memory
|
||||
* PrintJumptableInfo: none
|
||||
* DisassembleJumptableInfo: none
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2508,6 +2514,30 @@ PrintJumptableInfo(
|
||||
keyPtr, pcOffset + offset);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
DisassembleJumptableInfo(
|
||||
ClientData clientData,
|
||||
Tcl_Obj *dictObj,
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
register JumptableInfo *jtPtr = clientData;
|
||||
Tcl_Obj *mapping = Tcl_NewObj();
|
||||
Tcl_HashEntry *hPtr;
|
||||
Tcl_HashSearch search;
|
||||
const char *keyPtr;
|
||||
int offset;
|
||||
|
||||
hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search);
|
||||
for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) {
|
||||
keyPtr = Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
|
||||
offset = PTR2INT(Tcl_GetHashValue(hPtr));
|
||||
Tcl_DictObjPut(NULL, mapping, Tcl_NewStringObj(keyPtr, -1),
|
||||
Tcl_NewIntObj(offset));
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("mapping", -1), mapping);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -2610,7 +2640,7 @@ TclCompileThrowCmd(
|
||||
}
|
||||
CompileWord(envPtr, msgToken, interp, 2);
|
||||
|
||||
codeIsList = codeKnown && (TCL_OK ==
|
||||
codeIsList = codeKnown && (TCL_OK ==
|
||||
Tcl_ListObjLength(interp, objPtr, &len));
|
||||
codeIsValid = codeIsList && (len != 0);
|
||||
|
||||
@@ -3038,6 +3068,7 @@ IssueTryClausesInstructions(
|
||||
if (!handlerTokens[i]) {
|
||||
forwardsNeedFixing = 1;
|
||||
JUMP4( JUMP, forwardsToFix[i]);
|
||||
TclAdjustStackDepth(1, envPtr);
|
||||
} else {
|
||||
int dontChangeOptions;
|
||||
|
||||
@@ -3544,16 +3575,16 @@ TclCompileUnsetCmd(
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (i == 1) {
|
||||
if (varCount == 0) {
|
||||
const char *bytes;
|
||||
int len;
|
||||
|
||||
bytes = Tcl_GetStringFromObj(leadingWord, &len);
|
||||
if (len == 11 && !strncmp("-nocomplain", bytes, 11)) {
|
||||
if (i == 1 && len == 11 && !strncmp("-nocomplain", bytes, 11)) {
|
||||
flags = 0;
|
||||
haveFlags = 1;
|
||||
} else if (len == 2 && !strncmp("--", bytes, 2)) {
|
||||
haveFlags = 1;
|
||||
haveFlags++;
|
||||
} else if (i == (2 - flags) && len == 2 && !strncmp("--", bytes, 2)) {
|
||||
haveFlags++;
|
||||
} else {
|
||||
varCount++;
|
||||
}
|
||||
@@ -3568,7 +3599,7 @@ TclCompileUnsetCmd(
|
||||
*/
|
||||
|
||||
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
if (haveFlags) {
|
||||
for (i=0; i<haveFlags;i++) {
|
||||
varTokenPtr = TokenAfter(varTokenPtr);
|
||||
}
|
||||
for (i=1+haveFlags ; i<parsePtr->numWords ; i++) {
|
||||
@@ -3751,7 +3782,6 @@ TclCompileWhileCmd(
|
||||
}
|
||||
SetLineInformation(1);
|
||||
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
|
||||
TclClearNumConversion(envPtr);
|
||||
|
||||
jumpDist = CurrentOffset(envPtr) - bodyCodeOffset;
|
||||
if (jumpDist > 127) {
|
||||
|
||||
+43
-44
@@ -365,7 +365,7 @@ static const unsigned char prec[] = {
|
||||
0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0,
|
||||
0,
|
||||
/* Unary operator lexemes */
|
||||
PREC_UNARY, /* UNARY_PLUS */
|
||||
PREC_UNARY, /* UNARY_MINUS */
|
||||
@@ -420,7 +420,7 @@ static const unsigned char instruction[] = {
|
||||
0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0,
|
||||
0,
|
||||
/* Unary operator lexemes */
|
||||
INST_UPLUS, /* UNARY_PLUS */
|
||||
INST_UMINUS, /* UNARY_MINUS */
|
||||
@@ -488,7 +488,7 @@ static const unsigned char Lexeme[] = {
|
||||
|
||||
typedef struct JumpList {
|
||||
JumpFixup jump; /* Pass this argument to matching calls of
|
||||
* TclEmitForwardJump() and
|
||||
* TclEmitForwardJump() and
|
||||
* TclFixupForwardJump(). */
|
||||
struct JumpList *next; /* Point to next item on the stack */
|
||||
} JumpList;
|
||||
@@ -663,10 +663,12 @@ ParseExpr(
|
||||
|
||||
if (nodesUsed >= nodesAvailable) {
|
||||
int size = nodesUsed * 2;
|
||||
OpNode *newPtr;
|
||||
OpNode *newPtr = NULL;
|
||||
|
||||
do {
|
||||
if (size <= UINT_MAX/sizeof(OpNode)) {
|
||||
newPtr = attemptckrealloc(nodes, size * sizeof(OpNode));
|
||||
}
|
||||
} while ((newPtr == NULL)
|
||||
&& ((size -= (size - nodesUsed) / 2) > nodesUsed));
|
||||
if (newPtr == NULL) {
|
||||
@@ -838,7 +840,7 @@ ParseExpr(
|
||||
|
||||
switch (lexeme) {
|
||||
case NUMBER:
|
||||
case BOOLEAN:
|
||||
case BOOLEAN:
|
||||
/*
|
||||
* TODO: Consider using a dict or hash to collapse all
|
||||
* duplicate literals into a single representative value.
|
||||
@@ -861,7 +863,7 @@ ParseExpr(
|
||||
start += scanned;
|
||||
numBytes -= scanned;
|
||||
continue;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1324,7 +1326,7 @@ ParseExpr(
|
||||
nodePtr->mark = MARK_LEFT;
|
||||
nodePtr->left = complete;
|
||||
|
||||
/*
|
||||
/*
|
||||
* The COMMA operator cannot be optimized, since the function
|
||||
* needs all of its arguments, and optimization would reduce the
|
||||
* number. Other binary operators root constant expressions when
|
||||
@@ -1546,7 +1548,7 @@ ConvertTreeToTokens(
|
||||
* Tcl_ParseExpr() we do not change them now. Internally, we can
|
||||
* do better.
|
||||
*/
|
||||
|
||||
|
||||
int toCopy = tokenPtr->numComponents + 1;
|
||||
|
||||
if (tokenPtr->numComponents == tokenPtr[1].numComponents + 1) {
|
||||
@@ -1562,7 +1564,7 @@ ConvertTreeToTokens(
|
||||
subExprTokenPtr->type = TCL_TOKEN_SUB_EXPR;
|
||||
parsePtr->numTokens += toCopy;
|
||||
} else {
|
||||
/*
|
||||
/*
|
||||
* Multiple element word. Create a TCL_TOKEN_SUB_EXPR token to
|
||||
* lead, with fields initialized from the leading token, then
|
||||
* copy entire set of word tokens.
|
||||
@@ -1611,7 +1613,7 @@ ConvertTreeToTokens(
|
||||
case COMMA:
|
||||
case COLON:
|
||||
|
||||
/*
|
||||
/*
|
||||
* Historical practice has been to have no Tcl_Tokens for
|
||||
* these operators.
|
||||
*/
|
||||
@@ -1747,7 +1749,7 @@ ConvertTreeToTokens(
|
||||
/*
|
||||
* Before we leave this node/operator/subexpression for the
|
||||
* last time, finish up its tokens....
|
||||
*
|
||||
*
|
||||
* Our current position scanning the string is where the
|
||||
* substring for the subexpression ends.
|
||||
*/
|
||||
@@ -1967,7 +1969,7 @@ ParseLexeme(
|
||||
|
||||
case 'i':
|
||||
if ((numBytes > 1) && (start[1] == 'n')
|
||||
&& ((numBytes == 2) || !isalpha(UCHAR(start[2])))) {
|
||||
&& ((numBytes == 2) || start[2] & 0x80 || !isalpha(UCHAR(start[2])))) {
|
||||
/*
|
||||
* Must make this check so we can tell the difference between the
|
||||
* "in" operator and the "int" function name and the "infinity"
|
||||
@@ -1981,14 +1983,15 @@ ParseLexeme(
|
||||
|
||||
case 'e':
|
||||
if ((numBytes > 1) && (start[1] == 'q')
|
||||
&& ((numBytes == 2) || !isalpha(UCHAR(start[2])))) {
|
||||
&& ((numBytes == 2) || start[2] & 0x80 || !isalpha(UCHAR(start[2])))) {
|
||||
*lexemePtr = STREQ;
|
||||
return 2;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
if ((numBytes > 1) && ((numBytes == 2) || !isalpha(UCHAR(start[2])))) {
|
||||
if ((numBytes > 1)
|
||||
&& ((numBytes == 2) || start[2] & 0x80 || !isalpha(UCHAR(start[2])))) {
|
||||
switch (start[1]) {
|
||||
case 'e':
|
||||
*lexemePtr = STRNEQ;
|
||||
@@ -2003,9 +2006,8 @@ ParseLexeme(
|
||||
literal = Tcl_NewObj();
|
||||
if (TclParseNumber(NULL, literal, NULL, start, numBytes, &end,
|
||||
TCL_PARSE_NO_WHITESPACE) == TCL_OK) {
|
||||
if (end < start + numBytes && !isalnum(UCHAR(*end))
|
||||
&& UCHAR(*end) != '_') {
|
||||
|
||||
if (end < start + numBytes && !TclIsBareword(*end)) {
|
||||
|
||||
number:
|
||||
TclInitStringRep(literal, start, end-start);
|
||||
*lexemePtr = NUMBER;
|
||||
@@ -2029,9 +2031,9 @@ ParseLexeme(
|
||||
const char *p = start;
|
||||
|
||||
while (p < end) {
|
||||
if (!isalnum(UCHAR(*p++))) {
|
||||
if (!TclIsBareword(*p++)) {
|
||||
/*
|
||||
* The number has non-bareword characters, so we
|
||||
* The number has non-bareword characters, so we
|
||||
* must treat it as a number.
|
||||
*/
|
||||
goto number;
|
||||
@@ -2054,33 +2056,30 @@ ParseLexeme(
|
||||
}
|
||||
}
|
||||
|
||||
if (Tcl_UtfCharComplete(start, numBytes)) {
|
||||
scanned = Tcl_UtfToUniChar(start, &ch);
|
||||
} else {
|
||||
char utfBytes[TCL_UTF_MAX];
|
||||
/*
|
||||
* We reject leading underscores in bareword. No sensible reason why.
|
||||
* Might be inspired by reserved identifier rules in C, which of course
|
||||
* have no direct relevance here.
|
||||
*/
|
||||
|
||||
memcpy(utfBytes, start, (size_t) numBytes);
|
||||
utfBytes[numBytes] = '\0';
|
||||
scanned = Tcl_UtfToUniChar(utfBytes, &ch);
|
||||
}
|
||||
if (!isalnum(UCHAR(ch))) {
|
||||
if (!TclIsBareword(*start) || *start == '_') {
|
||||
if (Tcl_UtfCharComplete(start, numBytes)) {
|
||||
scanned = Tcl_UtfToUniChar(start, &ch);
|
||||
} else {
|
||||
char utfBytes[TCL_UTF_MAX];
|
||||
|
||||
memcpy(utfBytes, start, (size_t) numBytes);
|
||||
utfBytes[numBytes] = '\0';
|
||||
scanned = Tcl_UtfToUniChar(utfBytes, &ch);
|
||||
}
|
||||
*lexemePtr = INVALID;
|
||||
Tcl_DecrRefCount(literal);
|
||||
return scanned;
|
||||
}
|
||||
end = start;
|
||||
while (isalnum(UCHAR(ch)) || (UCHAR(ch) == '_')) {
|
||||
end += scanned;
|
||||
numBytes -= scanned;
|
||||
if (Tcl_UtfCharComplete(end, numBytes)) {
|
||||
scanned = Tcl_UtfToUniChar(end, &ch);
|
||||
} else {
|
||||
char utfBytes[TCL_UTF_MAX];
|
||||
|
||||
memcpy(utfBytes, end, (size_t) numBytes);
|
||||
utfBytes[numBytes] = '\0';
|
||||
scanned = Tcl_UtfToUniChar(utfBytes, &ch);
|
||||
}
|
||||
while (numBytes && TclIsBareword(*end)) {
|
||||
end += 1;
|
||||
numBytes -= 1;
|
||||
}
|
||||
*lexemePtr = BAREWORD;
|
||||
if (literalPtr) {
|
||||
@@ -2098,7 +2097,7 @@ ParseLexeme(
|
||||
* TclCompileExpr --
|
||||
*
|
||||
* This procedure compiles a string containing a Tcl expression into Tcl
|
||||
* bytecodes.
|
||||
* bytecodes.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
@@ -2333,7 +2332,7 @@ CompileExprTree(
|
||||
* Use the numWords count we've kept to invoke the function
|
||||
* command with the correct number of arguments.
|
||||
*/
|
||||
|
||||
|
||||
if (numWords < 255) {
|
||||
TclEmitInvoke(envPtr, INST_INVOKE_STK1, numWords);
|
||||
} else {
|
||||
@@ -2427,7 +2426,7 @@ CompileExprTree(
|
||||
const char *bytes = TclGetStringFromObj(literal, &length);
|
||||
int index = TclRegisterNewLiteral(envPtr, bytes, length);
|
||||
Tcl_Obj *objPtr = TclFetchLiteral(envPtr, index);
|
||||
|
||||
|
||||
if ((objPtr->typePtr == NULL) && (literal->typePtr != NULL)) {
|
||||
/*
|
||||
* Would like to do this:
|
||||
@@ -2570,7 +2569,7 @@ TclSingleOpCmd(
|
||||
*
|
||||
* TclSortingOpCmd --
|
||||
* Implements the commands:
|
||||
* <, <=, >, >=, ==, eq
|
||||
* <, <=, >, >=, ==, eq
|
||||
* in the ::tcl::mathop namespace. These commands are defined for
|
||||
* arbitrary number of arguments by computing the AND of the base
|
||||
* operator applied to all neighbor argument pairs.
|
||||
|
||||
+36
-1014
File diff suppressed because it is too large
Load Diff
+38
-35
@@ -48,6 +48,13 @@ MODULE_SCOPE int tclTraceCompile;
|
||||
|
||||
MODULE_SCOPE int tclTraceExec;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The type of lambda expressions. Note that every lambda will *always* have a
|
||||
* string representation.
|
||||
*/
|
||||
|
||||
MODULE_SCOPE const Tcl_ObjType tclLambdaType;
|
||||
|
||||
/*
|
||||
*------------------------------------------------------------------------
|
||||
@@ -238,6 +245,16 @@ typedef struct AuxDataType {
|
||||
AuxDataPrintProc *printProc;/* Callback function to invoke when printing
|
||||
* the aux data as part of debugging. NULL
|
||||
* means that the data can't be printed. */
|
||||
AuxDataPrintProc *disassembleProc;
|
||||
/* Callback function to invoke when doing a
|
||||
* disassembly of the aux data (like the
|
||||
* printProc, except that the output is
|
||||
* intended to be script-readable). The
|
||||
* appendObj argument should be filled in with
|
||||
* a descriptive dictionary; it will start out
|
||||
* with "name" mapped to the content of the
|
||||
* name field. NULL means that the printProc
|
||||
* should be used instead. */
|
||||
} AuxDataType;
|
||||
|
||||
/*
|
||||
@@ -832,6 +849,12 @@ typedef enum InstOperandType {
|
||||
* variable table. */
|
||||
OPERAND_AUX4, /* Four byte unsigned index into the aux data
|
||||
* table. */
|
||||
OPERAND_OFFSET1, /* One byte signed jump offset. */
|
||||
OPERAND_OFFSET4, /* Four byte signed jump offset. */
|
||||
OPERAND_LIT1, /* One byte unsigned index into table of
|
||||
* literals. */
|
||||
OPERAND_LIT4, /* Four byte unsigned index into table of
|
||||
* literals. */
|
||||
OPERAND_SCLS1 /* Index into tclStringClassTable. */
|
||||
} InstOperandType;
|
||||
|
||||
@@ -972,12 +995,6 @@ typedef struct ForeachInfo {
|
||||
* LAST FIELD IN THE STRUCTURE! */
|
||||
} ForeachInfo;
|
||||
|
||||
MODULE_SCOPE const AuxDataType tclForeachInfoType;
|
||||
MODULE_SCOPE const AuxDataType tclNewForeachInfoType;
|
||||
|
||||
#define FOREACHINFO(envPtr, index) \
|
||||
((ForeachInfo*)((envPtr)->auxDataArrayPtr[TclGetUInt4AtPtr(index)].clientData))
|
||||
|
||||
/*
|
||||
* Structure used to hold information about a switch command that is needed
|
||||
* during program execution. These structures are stored in CompileEnv and
|
||||
@@ -1010,11 +1027,6 @@ typedef struct {
|
||||
* STRUCTURE. */
|
||||
} DictUpdateInfo;
|
||||
|
||||
MODULE_SCOPE const AuxDataType tclDictUpdateInfoType;
|
||||
|
||||
#define DICTUPDATEINFO(envPtr, index) \
|
||||
((DictUpdateInfo*)((envPtr)->auxDataArrayPtr[TclGetUInt4AtPtr(index)].clientData))
|
||||
|
||||
/*
|
||||
* ClientData type used by the math operator commands.
|
||||
*/
|
||||
@@ -1100,7 +1112,6 @@ MODULE_SCOPE void TclExpandJumpFixupArray(JumpFixupArray *fixupArrayPtr);
|
||||
MODULE_SCOPE int TclNRExecuteByteCode(Tcl_Interp *interp,
|
||||
ByteCode *codePtr);
|
||||
MODULE_SCOPE Tcl_Obj * TclFetchLiteral(CompileEnv *envPtr, unsigned int index);
|
||||
MODULE_SCOPE void TclFinalizeAuxDataTypeTable(void);
|
||||
MODULE_SCOPE int TclFindCompiledLocal(const char *name, int nameChars,
|
||||
int create, CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclFixupForwardJump(CompileEnv *envPtr,
|
||||
@@ -1108,7 +1119,6 @@ MODULE_SCOPE int TclFixupForwardJump(CompileEnv *envPtr,
|
||||
int distThreshold);
|
||||
MODULE_SCOPE void TclFreeCompileEnv(CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclFreeJumpFixupArray(JumpFixupArray *fixupArrayPtr);
|
||||
MODULE_SCOPE void TclInitAuxDataTypeTable(void);
|
||||
MODULE_SCOPE void TclInitByteCodeObj(Tcl_Obj *objPtr,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclInitCompileEnv(Tcl_Interp *interp,
|
||||
@@ -1128,6 +1138,10 @@ MODULE_SCOPE void TclFinalizeLoopExceptionRange(CompileEnv *envPtr,
|
||||
MODULE_SCOPE char * TclLiteralStats(LiteralTable *tablePtr);
|
||||
MODULE_SCOPE int TclLog2(int value);
|
||||
#endif
|
||||
MODULE_SCOPE int TclLocalScalar(const char *bytes, int numBytes,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclLocalScalarFromToken(Tcl_Token *tokenPtr,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclOptimizeBytecode(void *envPtr);
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
MODULE_SCOPE void TclPrintByteCodeObj(Tcl_Interp *interp,
|
||||
@@ -1144,7 +1158,7 @@ MODULE_SCOPE void TclPushVarName(Tcl_Interp *interp,
|
||||
int flags, int *localIndexPtr,
|
||||
int *isScalarPtr);
|
||||
MODULE_SCOPE void TclReleaseLiteral(Tcl_Interp *interp, Tcl_Obj *objPtr);
|
||||
MODULE_SCOPE void TclInvalidateCmdLiteral(Tcl_Interp *interp,
|
||||
MODULE_SCOPE void TclInvalidateCmdLiteral(Tcl_Interp *interp,
|
||||
const char *name, Namespace *nsPtr);
|
||||
MODULE_SCOPE int TclSingleOpCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
@@ -1165,12 +1179,15 @@ MODULE_SCOPE void TclVerifyLocalLiteralTable(CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclWordKnownAtCompileTime(Tcl_Token *tokenPtr,
|
||||
Tcl_Obj *valuePtr);
|
||||
MODULE_SCOPE void TclLogCommandInfo(Tcl_Interp *interp,
|
||||
const char *script,
|
||||
const char *command, int length,
|
||||
const unsigned char *pc, Tcl_Obj **tosPtr);
|
||||
const char *script, const char *command,
|
||||
int length, const unsigned char *pc,
|
||||
Tcl_Obj **tosPtr);
|
||||
MODULE_SCOPE Tcl_Obj *TclGetInnerContext(Tcl_Interp *interp,
|
||||
const unsigned char *pc, Tcl_Obj **tosPtr);
|
||||
const unsigned char *pc, Tcl_Obj **tosPtr);
|
||||
MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
|
||||
MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
|
||||
register Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[], int isLambda);
|
||||
|
||||
|
||||
/*
|
||||
@@ -1387,18 +1404,6 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* If the expr compiler finished with TRY_CONVERT, macro to remove it when the
|
||||
* job is done by the following instruction.
|
||||
*/
|
||||
|
||||
#define TclClearNumConversion(envPtr) \
|
||||
do { \
|
||||
if (*(envPtr->codeNext - 1) == INST_TRY_CVT_TO_NUMERIC) { \
|
||||
envPtr->codeNext--; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* Macros to update a (signed or unsigned) integer starting at a pointer. The
|
||||
* two variants depend on the number of bytes. The ANSI C "prototypes" for
|
||||
@@ -1642,7 +1647,7 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
|
||||
|
||||
#define PushVarNameWord(i,v,e,f,l,sc,word) \
|
||||
SetLineInformation(word); \
|
||||
TclPushVarName(i,v,e,f,l,sc)
|
||||
TclPushVarName(i,v,e,f,l,sc)
|
||||
|
||||
/*
|
||||
* Often want to issue one of two versions of an instruction based on whether
|
||||
@@ -1664,11 +1669,9 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
|
||||
#define AnonymousLocal(envPtr) \
|
||||
(TclFindCompiledLocal(NULL, /*nameChars*/ 0, /*create*/ 1, (envPtr)))
|
||||
#define LocalScalar(chars,len,envPtr) \
|
||||
(!TclIsLocalScalar((chars), (len)) ? -1 : \
|
||||
TclFindCompiledLocal((chars), (len), /*create*/ 1, (envPtr)))
|
||||
TclLocalScalar(chars, len, envPtr)
|
||||
#define LocalScalarFromToken(tokenPtr,envPtr) \
|
||||
((tokenPtr)->type != TCL_TOKEN_SIMPLE_WORD ? -1 : \
|
||||
LocalScalar((tokenPtr)[1].start, (tokenPtr)[1].size, (envPtr)))
|
||||
TclLocalScalarFromToken(tokenPtr, envPtr)
|
||||
|
||||
/*
|
||||
* Flags bits used by TclPushVarName.
|
||||
|
||||
+11
-10
@@ -48,7 +48,7 @@ EXTERN CONST84_RETURN char * Tcl_PkgRequireEx(Tcl_Interp *interp,
|
||||
const char *name, const char *version,
|
||||
int exact, void *clientDataPtr);
|
||||
/* 2 */
|
||||
EXTERN void Tcl_Panic(const char *format, ...) TCL_FORMAT_PRINTF(1, 2);
|
||||
EXTERN TCL_NORETURN void Tcl_Panic(const char *format, ...) TCL_FORMAT_PRINTF(1, 2);
|
||||
/* 3 */
|
||||
EXTERN char * Tcl_Alloc(unsigned int size);
|
||||
/* 4 */
|
||||
@@ -417,7 +417,7 @@ EXTERN int Tcl_EvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr);
|
||||
EXTERN void Tcl_EventuallyFree(ClientData clientData,
|
||||
Tcl_FreeProc *freeProc);
|
||||
/* 133 */
|
||||
EXTERN void Tcl_Exit(int status);
|
||||
EXTERN TCL_NORETURN void Tcl_Exit(int status);
|
||||
/* 134 */
|
||||
EXTERN int Tcl_ExposeCommand(Tcl_Interp *interp,
|
||||
const char *hiddenCmdToken,
|
||||
@@ -686,7 +686,8 @@ EXTERN void Tcl_SetErrorCode(Tcl_Interp *interp, ...);
|
||||
/* 229 */
|
||||
EXTERN void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr);
|
||||
/* 230 */
|
||||
EXTERN void Tcl_SetPanicProc(Tcl_PanicProc *panicProc);
|
||||
EXTERN void Tcl_SetPanicProc(
|
||||
TCL_NORETURN1 Tcl_PanicProc *panicProc);
|
||||
/* 231 */
|
||||
EXTERN int Tcl_SetRecursionLimit(Tcl_Interp *interp, int depth);
|
||||
/* 232 */
|
||||
@@ -835,7 +836,7 @@ EXTERN int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList);
|
||||
/* 277 */
|
||||
EXTERN Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options);
|
||||
/* 278 */
|
||||
EXTERN void Tcl_PanicVA(const char *format, va_list argList);
|
||||
EXTERN TCL_NORETURN void Tcl_PanicVA(const char *format, va_list argList);
|
||||
/* 279 */
|
||||
EXTERN void Tcl_GetVersion(int *major, int *minor,
|
||||
int *patchLevel, int *type);
|
||||
@@ -1499,7 +1500,7 @@ EXTERN void Tcl_GetCommandFullName(Tcl_Interp *interp,
|
||||
EXTERN int Tcl_FSEvalFileEx(Tcl_Interp *interp,
|
||||
Tcl_Obj *fileName, const char *encodingName);
|
||||
/* 519 */
|
||||
EXTERN Tcl_ExitProc * Tcl_SetExitProc(Tcl_ExitProc *proc);
|
||||
EXTERN Tcl_ExitProc * Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc);
|
||||
/* 520 */
|
||||
EXTERN void Tcl_LimitAddHandler(Tcl_Interp *interp, int type,
|
||||
Tcl_LimitHandlerProc *handlerProc,
|
||||
@@ -1828,7 +1829,7 @@ typedef struct TclStubs {
|
||||
|
||||
int (*tcl_PkgProvideEx) (Tcl_Interp *interp, const char *name, const char *version, const void *clientData); /* 0 */
|
||||
CONST84_RETURN char * (*tcl_PkgRequireEx) (Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr); /* 1 */
|
||||
void (*tcl_Panic) (const char *format, ...) TCL_FORMAT_PRINTF(1, 2); /* 2 */
|
||||
TCL_NORETURN1 void (*tcl_Panic) (const char *format, ...) TCL_FORMAT_PRINTF(1, 2); /* 2 */
|
||||
char * (*tcl_Alloc) (unsigned int size); /* 3 */
|
||||
void (*tcl_Free) (char *ptr); /* 4 */
|
||||
char * (*tcl_Realloc) (char *ptr, unsigned int size); /* 5 */
|
||||
@@ -1975,7 +1976,7 @@ typedef struct TclStubs {
|
||||
int (*tcl_EvalFile) (Tcl_Interp *interp, const char *fileName); /* 130 */
|
||||
int (*tcl_EvalObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 131 */
|
||||
void (*tcl_EventuallyFree) (ClientData clientData, Tcl_FreeProc *freeProc); /* 132 */
|
||||
void (*tcl_Exit) (int status); /* 133 */
|
||||
TCL_NORETURN1 void (*tcl_Exit) (int status); /* 133 */
|
||||
int (*tcl_ExposeCommand) (Tcl_Interp *interp, const char *hiddenCmdToken, const char *cmdName); /* 134 */
|
||||
int (*tcl_ExprBoolean) (Tcl_Interp *interp, const char *expr, int *ptr); /* 135 */
|
||||
int (*tcl_ExprBooleanObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *ptr); /* 136 */
|
||||
@@ -2080,7 +2081,7 @@ typedef struct TclStubs {
|
||||
void (*tcl_SetErrno) (int err); /* 227 */
|
||||
void (*tcl_SetErrorCode) (Tcl_Interp *interp, ...); /* 228 */
|
||||
void (*tcl_SetMaxBlockTime) (const Tcl_Time *timePtr); /* 229 */
|
||||
void (*tcl_SetPanicProc) (Tcl_PanicProc *panicProc); /* 230 */
|
||||
void (*tcl_SetPanicProc) (TCL_NORETURN1 Tcl_PanicProc *panicProc); /* 230 */
|
||||
int (*tcl_SetRecursionLimit) (Tcl_Interp *interp, int depth); /* 231 */
|
||||
void (*tcl_SetResult) (Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc); /* 232 */
|
||||
int (*tcl_SetServiceMode) (int mode); /* 233 */
|
||||
@@ -2128,7 +2129,7 @@ typedef struct TclStubs {
|
||||
void (*tcl_SetErrorCodeVA) (Tcl_Interp *interp, va_list argList); /* 275 */
|
||||
int (*tcl_VarEvalVA) (Tcl_Interp *interp, va_list argList); /* 276 */
|
||||
Tcl_Pid (*tcl_WaitPid) (Tcl_Pid pid, int *statPtr, int options); /* 277 */
|
||||
void (*tcl_PanicVA) (const char *format, va_list argList); /* 278 */
|
||||
TCL_NORETURN1 void (*tcl_PanicVA) (const char *format, va_list argList); /* 278 */
|
||||
void (*tcl_GetVersion) (int *major, int *minor, int *patchLevel, int *type); /* 279 */
|
||||
void (*tcl_InitMemory) (Tcl_Interp *interp); /* 280 */
|
||||
Tcl_Channel (*tcl_StackChannel) (Tcl_Interp *interp, const Tcl_ChannelType *typePtr, ClientData instanceData, int mask, Tcl_Channel prevChan); /* 281 */
|
||||
@@ -2369,7 +2370,7 @@ typedef struct TclStubs {
|
||||
Tcl_Command (*tcl_GetCommandFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 516 */
|
||||
void (*tcl_GetCommandFullName) (Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 517 */
|
||||
int (*tcl_FSEvalFileEx) (Tcl_Interp *interp, Tcl_Obj *fileName, const char *encodingName); /* 518 */
|
||||
Tcl_ExitProc * (*tcl_SetExitProc) (Tcl_ExitProc *proc); /* 519 */
|
||||
Tcl_ExitProc * (*tcl_SetExitProc) (TCL_NORETURN1 Tcl_ExitProc *proc); /* 519 */
|
||||
void (*tcl_LimitAddHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData, Tcl_LimitHandlerDeleteProc *deleteProc); /* 520 */
|
||||
void (*tcl_LimitRemoveHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData); /* 521 */
|
||||
int (*tcl_LimitReady) (Tcl_Interp *interp); /* 522 */
|
||||
|
||||
@@ -631,7 +631,7 @@ SetDictFromAny(
|
||||
}
|
||||
|
||||
for (i=0 ; i<objc ; i+=2) {
|
||||
|
||||
|
||||
/* Store key and value in the hash table we're building. */
|
||||
hPtr = CreateChainEntry(dict, objv[i], &isNew);
|
||||
if (!isNew) {
|
||||
@@ -3051,14 +3051,14 @@ DictFilterCmd(
|
||||
Tcl_IncrRefCount(valueObj);
|
||||
if (Tcl_ObjSetVar2(interp, keyVarObj, NULL, keyObj,
|
||||
TCL_LEAVE_ERR_MSG) == NULL) {
|
||||
Tcl_AddErrorInfo(interp,
|
||||
Tcl_AddErrorInfo(interp,
|
||||
"\n (\"dict filter\" filter script key variable)");
|
||||
result = TCL_ERROR;
|
||||
goto abnormalResult;
|
||||
}
|
||||
if (Tcl_ObjSetVar2(interp, valueVarObj, NULL, valueObj,
|
||||
TCL_LEAVE_ERR_MSG) == NULL) {
|
||||
Tcl_AddErrorInfo(interp,
|
||||
Tcl_AddErrorInfo(interp,
|
||||
"\n (\"dict filter\" filter script value variable)");
|
||||
result = TCL_ERROR;
|
||||
goto abnormalResult;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+89
-28
@@ -180,9 +180,9 @@ TCL_DECLARE_MUTEX(encodingMutex)
|
||||
* the system encoding will be used to perform the conversion.
|
||||
*/
|
||||
|
||||
static Tcl_Encoding defaultEncoding;
|
||||
static Tcl_Encoding systemEncoding;
|
||||
Tcl_Encoding tclIdentityEncoding;
|
||||
static Tcl_Encoding defaultEncoding = NULL;
|
||||
static Tcl_Encoding systemEncoding = NULL;
|
||||
Tcl_Encoding tclIdentityEncoding = NULL;
|
||||
|
||||
/*
|
||||
* The following variable is used in the sparse matrix code for a
|
||||
@@ -652,7 +652,10 @@ TclFinalizeEncodingSubsystem(void)
|
||||
Tcl_MutexLock(&encodingMutex);
|
||||
encodingsInitialized = 0;
|
||||
FreeEncoding(systemEncoding);
|
||||
systemEncoding = NULL;
|
||||
defaultEncoding = NULL;
|
||||
FreeEncoding(tclIdentityEncoding);
|
||||
tclIdentityEncoding = NULL;
|
||||
|
||||
hPtr = Tcl_FirstHashEntry(&encodingTable, &search);
|
||||
while (hPtr != NULL) {
|
||||
@@ -1203,7 +1206,10 @@ Tcl_ExternalToUtf(
|
||||
* output buffer. */
|
||||
{
|
||||
const Encoding *encodingPtr;
|
||||
int result, srcRead, dstWrote, dstChars;
|
||||
int result, srcRead, dstWrote, dstChars = 0;
|
||||
int noTerminate = flags & TCL_ENCODING_NO_TERMINATE;
|
||||
int charLimited = (flags & TCL_ENCODING_CHAR_LIMIT) && dstCharsPtr;
|
||||
int maxChars = INT_MAX;
|
||||
Tcl_EncodingState state;
|
||||
|
||||
if (encoding == NULL) {
|
||||
@@ -1228,19 +1234,40 @@ Tcl_ExternalToUtf(
|
||||
}
|
||||
if (dstCharsPtr == NULL) {
|
||||
dstCharsPtr = &dstChars;
|
||||
flags &= ~TCL_ENCODING_CHAR_LIMIT;
|
||||
} else if (charLimited) {
|
||||
maxChars = *dstCharsPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
* If there are any null characters in the middle of the buffer, they will
|
||||
* converted to the UTF-8 null character (\xC080). To get the actual \0 at
|
||||
* the end of the destination buffer, we need to append it manually.
|
||||
*/
|
||||
if (!noTerminate) {
|
||||
/*
|
||||
* If there are any null characters in the middle of the buffer,
|
||||
* they will converted to the UTF-8 null character (\xC080). To get
|
||||
* the actual \0 at the end of the destination buffer, we need to
|
||||
* append it manually. First make room for it...
|
||||
*/
|
||||
|
||||
dstLen--;
|
||||
result = encodingPtr->toUtfProc(encodingPtr->clientData, src, srcLen,
|
||||
flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr,
|
||||
dstCharsPtr);
|
||||
dst[*dstWrotePtr] = '\0';
|
||||
dstLen--;
|
||||
}
|
||||
do {
|
||||
int savedFlags = flags;
|
||||
Tcl_EncodingState savedState = *statePtr;
|
||||
|
||||
result = encodingPtr->toUtfProc(encodingPtr->clientData, src, srcLen,
|
||||
flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr,
|
||||
dstCharsPtr);
|
||||
if (*dstCharsPtr <= maxChars) {
|
||||
break;
|
||||
}
|
||||
dstLen = Tcl_UtfAtIndex(dst, maxChars) - 1 - dst + TCL_UTF_MAX;
|
||||
flags = savedFlags;
|
||||
*statePtr = savedState;
|
||||
} while (1);
|
||||
if (!noTerminate) {
|
||||
/* ...and then append it */
|
||||
|
||||
dst[*dstWrotePtr] = '\0';
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1423,7 +1450,7 @@ Tcl_UtfToExternal(
|
||||
*
|
||||
* Side effects:
|
||||
* The absolute pathname for the application is computed and stored to be
|
||||
* returned later be [info nameofexecutable].
|
||||
* returned later by [info nameofexecutable].
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2104,6 +2131,9 @@ BinaryProc(
|
||||
if (dstLen < 0) {
|
||||
dstLen = 0;
|
||||
}
|
||||
if ((flags & TCL_ENCODING_CHAR_LIMIT) && srcLen > *dstCharsPtr) {
|
||||
srcLen = *dstCharsPtr;
|
||||
}
|
||||
if (srcLen > dstLen) {
|
||||
srcLen = dstLen;
|
||||
result = TCL_CONVERT_NOSPACE;
|
||||
@@ -2264,7 +2294,7 @@ UtfToUtfProc(
|
||||
{
|
||||
const char *srcStart, *srcEnd, *srcClose;
|
||||
const char *dstStart, *dstEnd;
|
||||
int result, numChars;
|
||||
int result, numChars, charLimit = INT_MAX;
|
||||
Tcl_UniChar ch;
|
||||
|
||||
result = TCL_OK;
|
||||
@@ -2275,11 +2305,14 @@ UtfToUtfProc(
|
||||
if ((flags & TCL_ENCODING_END) == 0) {
|
||||
srcClose -= TCL_UTF_MAX;
|
||||
}
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
}
|
||||
|
||||
dstStart = dst;
|
||||
dstEnd = dst + dstLen - TCL_UTF_MAX;
|
||||
|
||||
for (numChars = 0; src < srcEnd; numChars++) {
|
||||
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
|
||||
if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
|
||||
/*
|
||||
* If there is more string to follow, this will ensure that the
|
||||
@@ -2301,7 +2334,7 @@ UtfToUtfProc(
|
||||
|
||||
*dst++ = *src++;
|
||||
} else if (pureNullMode == 1 && UCHAR(*src) == 0xc0 &&
|
||||
UCHAR(*(src+1)) == 0x80) {
|
||||
(src + 1 < srcEnd) && UCHAR(*(src+1)) == 0x80) {
|
||||
/*
|
||||
* Convert 0xc080 to real nulls when we are in output mode.
|
||||
*/
|
||||
@@ -2375,9 +2408,12 @@ UnicodeToUtfProc(
|
||||
{
|
||||
const char *srcStart, *srcEnd;
|
||||
const char *dstEnd, *dstStart;
|
||||
int result, numChars;
|
||||
int result, numChars, charLimit = INT_MAX;
|
||||
Tcl_UniChar ch;
|
||||
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
}
|
||||
result = TCL_OK;
|
||||
if ((srcLen % sizeof(Tcl_UniChar)) != 0) {
|
||||
result = TCL_CONVERT_MULTIBYTE;
|
||||
@@ -2391,7 +2427,7 @@ UnicodeToUtfProc(
|
||||
dstStart = dst;
|
||||
dstEnd = dst + dstLen - TCL_UTF_MAX;
|
||||
|
||||
for (numChars = 0; src < srcEnd; numChars++) {
|
||||
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
|
||||
if (dst > dstEnd) {
|
||||
result = TCL_CONVERT_NOSPACE;
|
||||
break;
|
||||
@@ -2489,21 +2525,34 @@ UtfToUnicodeProc(
|
||||
if (dst > dstEnd) {
|
||||
result = TCL_CONVERT_NOSPACE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
src += TclUtfToUniChar(src, &ch);
|
||||
|
||||
/*
|
||||
* Need to handle this in a way that won't cause misalignment by
|
||||
* casting dst to a Tcl_UniChar. [Bug 1122671]
|
||||
* XXX: This hard-codes the assumed size of Tcl_UniChar as 2.
|
||||
*/
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#if TCL_UTF_MAX > 4
|
||||
*dst++ = (ch >> 24);
|
||||
*dst++ = ((ch >> 16) & 0xFF);
|
||||
*dst++ = ((ch >> 8) & 0xFF);
|
||||
*dst++ = (ch & 0xFF);
|
||||
#else
|
||||
*dst++ = (ch >> 8);
|
||||
*dst++ = (ch & 0xFF);
|
||||
#endif
|
||||
#else
|
||||
#if TCL_UTF_MAX > 4
|
||||
*dst++ = (ch & 0xFF);
|
||||
*dst++ = ((ch >> 8) & 0xFF);
|
||||
*dst++ = ((ch >> 16) & 0xFF);
|
||||
*dst++ = (ch >> 24);
|
||||
#else
|
||||
*dst++ = (ch & 0xFF);
|
||||
*dst++ = (ch >> 8);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
*srcReadPtr = src - srcStart;
|
||||
@@ -2559,12 +2608,15 @@ TableToUtfProc(
|
||||
{
|
||||
const char *srcStart, *srcEnd;
|
||||
const char *dstEnd, *dstStart, *prefixBytes;
|
||||
int result, byte, numChars;
|
||||
int result, byte, numChars, charLimit = INT_MAX;
|
||||
Tcl_UniChar ch;
|
||||
const unsigned short *const *toUnicode;
|
||||
const unsigned short *pageZero;
|
||||
TableEncodingData *dataPtr = clientData;
|
||||
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
}
|
||||
srcStart = src;
|
||||
srcEnd = src + srcLen;
|
||||
|
||||
@@ -2576,7 +2628,7 @@ TableToUtfProc(
|
||||
pageZero = toUnicode[0];
|
||||
|
||||
result = TCL_OK;
|
||||
for (numChars = 0; src < srcEnd; numChars++) {
|
||||
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
|
||||
if (dst > dstEnd) {
|
||||
result = TCL_CONVERT_NOSPACE;
|
||||
break;
|
||||
@@ -2790,8 +2842,11 @@ Iso88591ToUtfProc(
|
||||
{
|
||||
const char *srcStart, *srcEnd;
|
||||
const char *dstEnd, *dstStart;
|
||||
int result, numChars;
|
||||
int result, numChars, charLimit = INT_MAX;
|
||||
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
}
|
||||
srcStart = src;
|
||||
srcEnd = src + srcLen;
|
||||
|
||||
@@ -2799,7 +2854,7 @@ Iso88591ToUtfProc(
|
||||
dstEnd = dst + dstLen - TCL_UTF_MAX;
|
||||
|
||||
result = TCL_OK;
|
||||
for (numChars = 0; src < srcEnd; numChars++) {
|
||||
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
|
||||
Tcl_UniChar ch;
|
||||
|
||||
if (dst > dstEnd) {
|
||||
@@ -2960,7 +3015,9 @@ TableFreeProc(
|
||||
*/
|
||||
|
||||
ckfree(dataPtr->toUnicode);
|
||||
dataPtr->toUnicode = NULL;
|
||||
ckfree(dataPtr->fromUnicode);
|
||||
dataPtr->fromUnicode = NULL;
|
||||
ckfree(dataPtr);
|
||||
}
|
||||
|
||||
@@ -3013,9 +3070,12 @@ EscapeToUtfProc(
|
||||
const char *prefixBytes, *tablePrefixBytes, *srcStart, *srcEnd;
|
||||
const unsigned short *const *tableToUnicode;
|
||||
const Encoding *encodingPtr;
|
||||
int state, result, numChars;
|
||||
int state, result, numChars, charLimit = INT_MAX;
|
||||
const char *dstStart, *dstEnd;
|
||||
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
}
|
||||
result = TCL_OK;
|
||||
tablePrefixBytes = NULL; /* lint. */
|
||||
tableToUnicode = NULL; /* lint. */
|
||||
@@ -3033,7 +3093,7 @@ EscapeToUtfProc(
|
||||
state = 0;
|
||||
}
|
||||
|
||||
for (numChars = 0; src < srcEnd; ) {
|
||||
for (numChars = 0; src < srcEnd && numChars <= charLimit; ) {
|
||||
int byte, hi, lo, ch;
|
||||
|
||||
if (dst > dstEnd) {
|
||||
@@ -3433,6 +3493,7 @@ EscapeFreeProc(
|
||||
subTablePtr = dataPtr->subTables;
|
||||
for (i = 0; i < dataPtr->numSubTables; i++) {
|
||||
FreeEncoding((Tcl_Encoding) subTablePtr->encodingPtr);
|
||||
subTablePtr->encodingPtr = NULL;
|
||||
subTablePtr++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3115,7 +3115,7 @@ TclAttemptCompileProc(
|
||||
result = cmdPtr->compileProc(interp, parsePtr, cmdPtr, envPtr);
|
||||
|
||||
/*
|
||||
* Undo the shift.
|
||||
* Undo the shift.
|
||||
*/
|
||||
|
||||
mapPtr->loc[eclIndex].line -= (depth - 1);
|
||||
|
||||
+1
-98
@@ -43,11 +43,6 @@ static char * EnvTraceProc(ClientData clientData, Tcl_Interp *interp,
|
||||
static void ReplaceString(const char *oldStr, char *newStr);
|
||||
MODULE_SCOPE void TclSetEnv(const char *name, const char *value);
|
||||
MODULE_SCOPE void TclUnsetEnv(const char *name);
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
static void TclCygwinPutenv(char *string);
|
||||
# define putenv TclCygwinPutenv
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -444,7 +439,7 @@ TclUnsetEnv(
|
||||
* that no = should be included, and Windows requires it.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
#if defined(_WIN32)
|
||||
string = ckalloc(length + 2);
|
||||
memcpy(string, name, (size_t) length);
|
||||
string[length] = '=';
|
||||
@@ -740,98 +735,6 @@ TclFinalizeEnvironment(void)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
|
||||
/*
|
||||
* When using cygwin, when an environment variable changes, we need to synch
|
||||
* with both the cygwin environment (in case the application C code calls
|
||||
* fork) and the Windows environment (in case the application TCL code calls
|
||||
* exec, which calls the Windows CreateProcess function).
|
||||
*/
|
||||
DLLIMPORT extern void __stdcall SetEnvironmentVariableA(const char*, const char *);
|
||||
|
||||
static void
|
||||
TclCygwinPutenv(
|
||||
char *str)
|
||||
{
|
||||
char *name, *value;
|
||||
|
||||
/*
|
||||
* Get the name and value, so that we can change the environment variable
|
||||
* for Windows.
|
||||
*/
|
||||
|
||||
name = alloca(strlen(str) + 1);
|
||||
strcpy(name, str);
|
||||
for (value=name ; *value!='=' && *value!='\0' ; ++value) {
|
||||
/* Empty body */
|
||||
}
|
||||
if (*value == '\0') {
|
||||
/* Can't happen. */
|
||||
return;
|
||||
}
|
||||
*(value++) = '\0';
|
||||
if (*value == '\0') {
|
||||
value = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the cygwin environment variable.
|
||||
*/
|
||||
|
||||
#undef putenv
|
||||
if (value == NULL) {
|
||||
unsetenv(name);
|
||||
} else {
|
||||
putenv(str);
|
||||
}
|
||||
|
||||
/*
|
||||
* Before changing the environment variable in Windows, if this is PATH,
|
||||
* we need to convert the value back to a Windows style path.
|
||||
*
|
||||
* FIXME: The calling program may know it is running under windows, and
|
||||
* may have set the path to a Windows path, or, worse, appended or
|
||||
* prepended a Windows path to PATH.
|
||||
*/
|
||||
|
||||
if (strcmp(name, "PATH") != 0) {
|
||||
/*
|
||||
* If this is Path, eliminate any PATH variable, to prevent any
|
||||
* confusion.
|
||||
*/
|
||||
|
||||
if (strcmp(name, "Path") == 0) {
|
||||
SetEnvironmentVariableA("PATH", NULL);
|
||||
unsetenv("PATH");
|
||||
}
|
||||
|
||||
SetEnvironmentVariableA(name, value);
|
||||
} else {
|
||||
char *buf;
|
||||
|
||||
/*
|
||||
* Eliminate any Path variable, to prevent any confusion.
|
||||
*/
|
||||
|
||||
SetEnvironmentVariableA("Path", NULL);
|
||||
unsetenv("Path");
|
||||
|
||||
if (value == NULL) {
|
||||
buf = NULL;
|
||||
} else {
|
||||
int size;
|
||||
|
||||
size = cygwin_conv_path_list(0, value, NULL, 0);
|
||||
buf = alloca(size + 1);
|
||||
cygwin_conv_path_list(0, value, buf, size);
|
||||
}
|
||||
|
||||
SetEnvironmentVariableA(name, buf);
|
||||
}
|
||||
}
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
|
||||
+41
-36
@@ -89,7 +89,7 @@ static int subsystemsInitialized = 0;
|
||||
* non-NULL value.
|
||||
*/
|
||||
|
||||
static Tcl_ExitProc *appExitPtr = NULL;
|
||||
static TCL_NORETURN1 Tcl_ExitProc *appExitPtr = NULL;
|
||||
|
||||
typedef struct ThreadSpecificData {
|
||||
ExitHandler *firstExitPtr; /* First in list of all exit handlers for this
|
||||
@@ -119,6 +119,7 @@ static char * VwaitVarProc(ClientData clientData,
|
||||
Tcl_Interp *interp, const char *name1,
|
||||
const char *name2, int flags);
|
||||
static void InvokeExitHandlers(void);
|
||||
static void FinalizeThread(int quick);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -262,7 +263,7 @@ HandleBgErrors(
|
||||
|
||||
if (errChannel != NULL) {
|
||||
Tcl_Obj *options = Tcl_GetReturnOptions(interp, code);
|
||||
Tcl_Obj *keyPtr, *valuePtr;
|
||||
Tcl_Obj *keyPtr, *valuePtr = NULL;
|
||||
|
||||
TclNewLiteralStringObj(keyPtr, "-errorinfo");
|
||||
Tcl_IncrRefCount(keyPtr);
|
||||
@@ -314,7 +315,7 @@ TclDefaultBgErrorHandlerObjCmd(
|
||||
{
|
||||
Tcl_Obj *keyPtr, *valuePtr;
|
||||
Tcl_Obj *tempObjv[2];
|
||||
int code, level;
|
||||
int result, code, level;
|
||||
Tcl_InterpState saved;
|
||||
|
||||
if (objc != 3) {
|
||||
@@ -328,9 +329,9 @@ TclDefaultBgErrorHandlerObjCmd(
|
||||
|
||||
TclNewLiteralStringObj(keyPtr, "-level");
|
||||
Tcl_IncrRefCount(keyPtr);
|
||||
Tcl_DictObjGet(NULL, objv[2], keyPtr, &valuePtr);
|
||||
result = Tcl_DictObjGet(NULL, objv[2], keyPtr, &valuePtr);
|
||||
Tcl_DecrRefCount(keyPtr);
|
||||
if (valuePtr == NULL) {
|
||||
if (result != TCL_OK || valuePtr == NULL) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"missing return option \"-level\"", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL);
|
||||
@@ -341,9 +342,9 @@ TclDefaultBgErrorHandlerObjCmd(
|
||||
}
|
||||
TclNewLiteralStringObj(keyPtr, "-code");
|
||||
Tcl_IncrRefCount(keyPtr);
|
||||
Tcl_DictObjGet(NULL, objv[2], keyPtr, &valuePtr);
|
||||
result = Tcl_DictObjGet(NULL, objv[2], keyPtr, &valuePtr);
|
||||
Tcl_DecrRefCount(keyPtr);
|
||||
if (valuePtr == NULL) {
|
||||
if (result != TCL_OK || valuePtr == NULL) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"missing return option \"-code\"", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL);
|
||||
@@ -406,17 +407,17 @@ TclDefaultBgErrorHandlerObjCmd(
|
||||
|
||||
TclNewLiteralStringObj(keyPtr, "-errorcode");
|
||||
Tcl_IncrRefCount(keyPtr);
|
||||
Tcl_DictObjGet(NULL, objv[2], keyPtr, &valuePtr);
|
||||
result = Tcl_DictObjGet(NULL, objv[2], keyPtr, &valuePtr);
|
||||
Tcl_DecrRefCount(keyPtr);
|
||||
if (valuePtr) {
|
||||
if (result == TCL_OK && valuePtr != NULL) {
|
||||
Tcl_SetObjErrorCode(interp, valuePtr);
|
||||
}
|
||||
|
||||
TclNewLiteralStringObj(keyPtr, "-errorinfo");
|
||||
Tcl_IncrRefCount(keyPtr);
|
||||
Tcl_DictObjGet(NULL, objv[2], keyPtr, &valuePtr);
|
||||
result = Tcl_DictObjGet(NULL, objv[2], keyPtr, &valuePtr);
|
||||
Tcl_DecrRefCount(keyPtr);
|
||||
if (valuePtr) {
|
||||
if (result == TCL_OK && valuePtr != NULL) {
|
||||
Tcl_AppendObjToErrorInfo(interp, valuePtr);
|
||||
}
|
||||
|
||||
@@ -856,7 +857,7 @@ Tcl_DeleteThreadExitHandler(
|
||||
|
||||
Tcl_ExitProc *
|
||||
Tcl_SetExitProc(
|
||||
Tcl_ExitProc *proc) /* New exit handler for app or NULL */
|
||||
TCL_NORETURN1 Tcl_ExitProc *proc) /* New exit handler for app or NULL */
|
||||
{
|
||||
Tcl_ExitProc *prevExitProc;
|
||||
|
||||
@@ -891,7 +892,7 @@ Tcl_SetExitProc(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
static void
|
||||
InvokeExitHandlers(void)
|
||||
InvokeExitHandlers(void)
|
||||
{
|
||||
ExitHandler *exitPtr;
|
||||
|
||||
@@ -932,12 +933,12 @@ InvokeExitHandlers(void)
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
TCL_NORETURN void
|
||||
Tcl_Exit(
|
||||
int status) /* Exit status for application; typically 0
|
||||
* for normal return, 1 for error return. */
|
||||
{
|
||||
Tcl_ExitProc *currentAppExitPtr;
|
||||
TCL_NORETURN1 Tcl_ExitProc *currentAppExitPtr;
|
||||
|
||||
Tcl_MutexLock(&exitMutex);
|
||||
currentAppExitPtr = appExitPtr;
|
||||
@@ -967,23 +968,23 @@ Tcl_Exit(
|
||||
/*
|
||||
* Fast and deterministic exit (default behavior)
|
||||
*/
|
||||
|
||||
|
||||
InvokeExitHandlers();
|
||||
|
||||
|
||||
/*
|
||||
* Ensure the thread-specific data is initialised as it is used in
|
||||
* Tcl_FinalizeThread()
|
||||
*/
|
||||
|
||||
|
||||
(void) TCL_TSD_INIT(&dataKey);
|
||||
|
||||
|
||||
/*
|
||||
* Now finalize the calling thread only (others are not safely
|
||||
* reachable). Among other things, this triggers a flush of the
|
||||
* Tcl_Channels that may have data enqueued.
|
||||
*/
|
||||
|
||||
Tcl_FinalizeThread();
|
||||
|
||||
FinalizeThread(/* quick */ 1);
|
||||
}
|
||||
TclpExit(status);
|
||||
Tcl_Panic("OS exit failed!");
|
||||
@@ -1089,7 +1090,7 @@ Tcl_Finalize(void)
|
||||
* Invoke exit handlers first.
|
||||
*/
|
||||
|
||||
InvokeExitHandlers();
|
||||
InvokeExitHandlers();
|
||||
|
||||
TclpInitLock();
|
||||
if (subsystemsInitialized == 0) {
|
||||
@@ -1183,7 +1184,7 @@ Tcl_Finalize(void)
|
||||
* This fixes the Tcl Bug #990552.
|
||||
*/
|
||||
|
||||
TclFinalizeThreadData();
|
||||
TclFinalizeThreadData(/* quick */ 0);
|
||||
|
||||
/*
|
||||
* Now we can free constants for conversions to/from double.
|
||||
@@ -1268,6 +1269,13 @@ Tcl_Finalize(void)
|
||||
|
||||
void
|
||||
Tcl_FinalizeThread(void)
|
||||
{
|
||||
FinalizeThread(/* quick */ 0);
|
||||
}
|
||||
|
||||
void
|
||||
FinalizeThread(
|
||||
int quick)
|
||||
{
|
||||
ExitHandler *exitPtr;
|
||||
ThreadSpecificData *tsdPtr;
|
||||
@@ -1299,20 +1307,17 @@ Tcl_FinalizeThread(void)
|
||||
TclFinalizeAsync();
|
||||
TclFinalizeThreadObjects();
|
||||
}
|
||||
if (TclFullFinalizationRequested()) { /* useless if we are facing a quick-exit */
|
||||
|
||||
/*
|
||||
* Blow away all thread local storage blocks.
|
||||
*
|
||||
* Note that Tcl API allows creation of threads which do not use any Tcl
|
||||
* interp or other Tcl subsytems. Those threads might, however, use thread
|
||||
* local storage, so we must unconditionally finalize it.
|
||||
*
|
||||
* Fix [Bug #571002]
|
||||
*/
|
||||
|
||||
TclFinalizeThreadData();
|
||||
}
|
||||
/*
|
||||
* Blow away all thread local storage blocks.
|
||||
*
|
||||
* Note that Tcl API allows creation of threads which do not use any Tcl
|
||||
* interp or other Tcl subsytems. Those threads might, however, use thread
|
||||
* local storage, so we must unconditionally finalize it.
|
||||
*
|
||||
* Fix [Bug #571002]
|
||||
*/
|
||||
TclFinalizeThreadData(quick);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+71
-63
@@ -20,10 +20,7 @@
|
||||
#include "tclOOInt.h"
|
||||
#include "tommath.h"
|
||||
#include <math.h>
|
||||
|
||||
#if NRE_ENABLE_ASSERTS
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Hack to determine whether we may expect IEEE floating point. The hack is
|
||||
@@ -81,9 +78,7 @@ int tclTraceExec = 0;
|
||||
|
||||
static const char *const operatorStrings[] = {
|
||||
"||", "&&", "|", "^", "&", "==", "!=", "<", ">", "<=", ">=", "<<", ">>",
|
||||
"+", "-", "*", "/", "%", "+", "-", "~", "!",
|
||||
"BUILTIN FUNCTION", "FUNCTION",
|
||||
"", "", "", "", "", "", "", "", "eq", "ne"
|
||||
"+", "-", "*", "/", "%", "+", "-", "~", "!"
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -200,14 +195,14 @@ typedef struct TEBCdata {
|
||||
if (auxObjList) { \
|
||||
objPtr->length += auxObjList->length; \
|
||||
} \
|
||||
objPtr->internalRep.ptrAndLongRep.ptr = auxObjList; \
|
||||
objPtr->internalRep.twoPtrValue.ptr1 = auxObjList; \
|
||||
auxObjList = objPtr; \
|
||||
} while (0)
|
||||
|
||||
#define POP_TAUX_OBJ() \
|
||||
do { \
|
||||
tmpPtr = auxObjList; \
|
||||
auxObjList = tmpPtr->internalRep.ptrAndLongRep.ptr; \
|
||||
auxObjList = tmpPtr->internalRep.twoPtrValue.ptr1; \
|
||||
Tcl_DecrRefCount(tmpPtr); \
|
||||
} while (0)
|
||||
|
||||
@@ -760,7 +755,7 @@ static Tcl_Obj * ExecuteExtendedUnaryMathOp(int opcode,
|
||||
Tcl_Obj *valuePtr);
|
||||
static void FreeExprCodeInternalRep(Tcl_Obj *objPtr);
|
||||
static ExceptionRange * GetExceptRangeForPc(const unsigned char *pc,
|
||||
int catchOnly, ByteCode *codePtr);
|
||||
int searchMode, ByteCode *codePtr);
|
||||
static const char * GetSrcInfoForPc(const unsigned char *pc,
|
||||
ByteCode *codePtr, int *lengthPtr,
|
||||
const unsigned char **pcBeg, int *cmdIdxPtr);
|
||||
@@ -932,7 +927,6 @@ TclCreateExecEnv(
|
||||
|
||||
Tcl_MutexLock(&execMutex);
|
||||
if (!execInitialized) {
|
||||
TclInitAuxDataTypeTable();
|
||||
InitByteCodeExecution(interp);
|
||||
execInitialized = 1;
|
||||
}
|
||||
@@ -1031,7 +1025,6 @@ TclFinalizeExecution(void)
|
||||
Tcl_MutexLock(&execMutex);
|
||||
execInitialized = 0;
|
||||
Tcl_MutexUnlock(&execMutex);
|
||||
TclFinalizeAuxDataTypeTable();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1140,7 +1133,7 @@ GrowEvaluationStack(
|
||||
}
|
||||
needed = growth + moveWords + WALLOCALIGN;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Check if there is enough room in the next stack (if there is one, it
|
||||
* should be both empty and the last one!)
|
||||
@@ -1178,7 +1171,7 @@ GrowEvaluationStack(
|
||||
#else
|
||||
newElems = needed;
|
||||
#endif
|
||||
|
||||
|
||||
newBytes = sizeof(ExecStack) + (newElems-1) * sizeof(Tcl_Obj *);
|
||||
|
||||
oldPtr = esPtr;
|
||||
@@ -1651,8 +1644,7 @@ FreeExprCodeInternalRep(
|
||||
ByteCode *codePtr = objPtr->internalRep.twoPtrValue.ptr1;
|
||||
|
||||
objPtr->typePtr = NULL;
|
||||
codePtr->refCount--;
|
||||
if (codePtr->refCount <= 0) {
|
||||
if (codePtr->refCount-- <= 1) {
|
||||
TclCleanupByteCode(codePtr);
|
||||
}
|
||||
}
|
||||
@@ -2155,7 +2147,7 @@ TEBCresume(
|
||||
const unsigned char *pc = data[1];
|
||||
/* The current program counter. */
|
||||
unsigned char inst; /* The currently running instruction */
|
||||
|
||||
|
||||
/*
|
||||
* Transfer variables - needed only between opcodes, but not while
|
||||
* executing an instruction.
|
||||
@@ -2360,7 +2352,7 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
inst = *pc;
|
||||
|
||||
|
||||
peepholeStart:
|
||||
#ifdef TCL_COMPILE_STATS
|
||||
iPtr->stats.instructionCount[*pc]++;
|
||||
@@ -2380,7 +2372,7 @@ TEBCresume(
|
||||
#endif /* TCL_COMPILE_DEBUG */
|
||||
|
||||
TCL_DTRACE_INST_NEXT();
|
||||
|
||||
|
||||
if (inst == INST_LOAD_SCALAR1) {
|
||||
goto instLoadScalar1;
|
||||
} else if (inst == INST_PUSH1) {
|
||||
@@ -2392,7 +2384,7 @@ TEBCresume(
|
||||
/*
|
||||
* Peephole: do not run INST_START_CMD, just skip it
|
||||
*/
|
||||
|
||||
|
||||
iPtr->cmdCount += TclGetUInt4AtPtr(pc+5);
|
||||
if (checkInterp) {
|
||||
checkInterp = 0;
|
||||
@@ -2413,7 +2405,7 @@ TEBCresume(
|
||||
}
|
||||
goto peepholeStart;
|
||||
}
|
||||
|
||||
|
||||
switch (inst) {
|
||||
case INST_SYNTAX:
|
||||
case INST_RETURN_IMM: {
|
||||
@@ -2560,7 +2552,7 @@ TEBCresume(
|
||||
/* TIP #280: Record the last piece of info needed by
|
||||
* 'TclGetSrcInfoForPc', and push the frame.
|
||||
*/
|
||||
|
||||
|
||||
bcFramePtr->data.tebc.pc = (char *) pc;
|
||||
iPtr->cmdFramePtr = bcFramePtr;
|
||||
|
||||
@@ -2860,7 +2852,7 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
TclNewObj(objPtr);
|
||||
objPtr->internalRep.ptrAndLongRep.value = CURR_DEPTH;
|
||||
objPtr->internalRep.twoPtrValue.ptr2 = INT2PTR(CURR_DEPTH);
|
||||
objPtr->length = 0;
|
||||
PUSH_TAUX_OBJ(objPtr);
|
||||
TRACE(("=> mark depth as %d\n", (int) CURR_DEPTH));
|
||||
@@ -2874,7 +2866,7 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
CLANG_ASSERT(auxObjList);
|
||||
objc = CURR_DEPTH - auxObjList->internalRep.ptrAndLongRep.value;
|
||||
objc = CURR_DEPTH - PTR2INT(auxObjList->internalRep.twoPtrValue.ptr2);
|
||||
POP_TAUX_OBJ();
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
/* Ugly abuse! */
|
||||
@@ -2923,7 +2915,6 @@ TEBCresume(
|
||||
* stack-allocated parameter, update the stack pointers.
|
||||
*/
|
||||
|
||||
esPtr = iPtr->execEnvPtr->execStackPtr;
|
||||
TD = (TEBCdata *) (((Tcl_Obj **)TD) + moved);
|
||||
|
||||
catchTop += moved;
|
||||
@@ -2975,7 +2966,7 @@ TEBCresume(
|
||||
|
||||
case INST_INVOKE_EXPANDED:
|
||||
CLANG_ASSERT(auxObjList);
|
||||
objc = CURR_DEPTH - auxObjList->internalRep.ptrAndLongRep.value;
|
||||
objc = CURR_DEPTH - PTR2INT(auxObjList->internalRep.twoPtrValue.ptr2);
|
||||
POP_TAUX_OBJ();
|
||||
if (objc) {
|
||||
pcAdjustment = 1;
|
||||
@@ -3187,8 +3178,8 @@ TEBCresume(
|
||||
pc += 6;
|
||||
TEBC_YIELD();
|
||||
|
||||
TclMarkTailcall(interp);
|
||||
TclNRAddCallback(interp, TclClearRootEnsemble, NULL,NULL,NULL,NULL);
|
||||
TclSkipTailcall(interp);
|
||||
return TclNREvalObjEx(interp, objPtr, TCL_EVAL_INVOKE, NULL, INT_MIN);
|
||||
|
||||
/*
|
||||
@@ -4184,10 +4175,12 @@ TEBCresume(
|
||||
|
||||
if (!TclIsVarUndefined(varPtr)) {
|
||||
TclDecrRefCount(varPtr->value.objPtr);
|
||||
TclSetVarUndefined(varPtr);
|
||||
TclClearVarNamespaceVar(varPtr);
|
||||
TclCleanupVar(varPtr, arrayPtr);
|
||||
} else if (flags & TCL_LEAVE_ERR_MSG) {
|
||||
goto slowUnsetArray;
|
||||
}
|
||||
varPtr->value.objPtr = NULL;
|
||||
TRACE_APPEND(("OK\n"));
|
||||
NEXT_INST_F(6, 1, 0);
|
||||
} else if (!varPtr && !(flags & TCL_LEAVE_ERR_MSG)) {
|
||||
@@ -4948,6 +4941,7 @@ TEBCresume(
|
||||
pc += pcAdjustment;
|
||||
TEBC_YIELD();
|
||||
|
||||
TclPushTailcallPoint(interp);
|
||||
oPtr = contextPtr->oPtr;
|
||||
if (oPtr->flags & FILTER_HANDLING) {
|
||||
TclNRAddCallback(interp, FinalizeOONextFilter,
|
||||
@@ -5412,8 +5406,8 @@ TEBCresume(
|
||||
s1 = (char *) Tcl_GetByteArrayFromObj(valuePtr, &s1len);
|
||||
s2 = (char *) Tcl_GetByteArrayFromObj(value2Ptr, &s2len);
|
||||
memCmpFn = memcmp;
|
||||
} else if (((valuePtr->typePtr == &tclStringType)
|
||||
&& (value2Ptr->typePtr == &tclStringType))) {
|
||||
} else if ((valuePtr->typePtr == &tclStringType)
|
||||
&& (value2Ptr->typePtr == &tclStringType)) {
|
||||
/*
|
||||
* Do a unicode-specific comparison if both of the args are of
|
||||
* String type. If the char length == byte length, we can do a
|
||||
@@ -5424,7 +5418,9 @@ TEBCresume(
|
||||
s1len = Tcl_GetCharLength(valuePtr);
|
||||
s2len = Tcl_GetCharLength(value2Ptr);
|
||||
if ((s1len == valuePtr->length)
|
||||
&& (s2len == value2Ptr->length)) {
|
||||
&& (valuePtr->bytes != NULL)
|
||||
&& (s2len == value2Ptr->length)
|
||||
&& (value2Ptr->bytes != NULL)) {
|
||||
s1 = valuePtr->bytes;
|
||||
s2 = value2Ptr->bytes;
|
||||
memCmpFn = memcmp;
|
||||
@@ -5591,7 +5587,7 @@ TEBCresume(
|
||||
TclNewObj(objResultPtr);
|
||||
} else if (TclIsPureByteArray(valuePtr)) {
|
||||
objResultPtr = Tcl_NewByteArrayObj(
|
||||
Tcl_GetByteArrayFromObj(valuePtr, &length)+index, 1);
|
||||
Tcl_GetByteArrayFromObj(valuePtr, NULL)+index, 1);
|
||||
} else if (valuePtr->bytes && length == valuePtr->length) {
|
||||
objResultPtr = Tcl_NewStringObj((const char *)
|
||||
valuePtr->bytes+index, 1);
|
||||
@@ -5763,7 +5759,7 @@ TEBCresume(
|
||||
* at this point (post Tcl_GetUnicodeFromObj).
|
||||
*/
|
||||
|
||||
((int *) objResultPtr->internalRep.otherValuePtr)[1] = 0;
|
||||
((int *) objResultPtr->internalRep.twoPtrValue.ptr1)[1] = 0;
|
||||
}
|
||||
Tcl_InvalidateStringRep(objResultPtr);
|
||||
TclDecrRefCount(value3Ptr);
|
||||
@@ -5790,7 +5786,7 @@ TEBCresume(
|
||||
* at this point (post Tcl_GetUnicodeFromObj).
|
||||
*/
|
||||
|
||||
((int *) objResultPtr->internalRep.otherValuePtr)[1] = 0;
|
||||
((int *) objResultPtr->internalRep.twoPtrValue.ptr1)[1] = 0;
|
||||
}
|
||||
Tcl_InvalidateStringRep(valuePtr);
|
||||
TclDecrRefCount(value3Ptr);
|
||||
@@ -7111,7 +7107,7 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
TclNewObj(tmpPtr);
|
||||
tmpPtr->internalRep.otherValuePtr = infoPtr;
|
||||
tmpPtr->internalRep.twoPtrValue.ptr1 = infoPtr;
|
||||
PUSH_OBJECT(tmpPtr); /* infoPtr object */
|
||||
TRACE_APPEND(("jump to loop step\n"));
|
||||
|
||||
@@ -7129,7 +7125,7 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
tmpPtr = OBJ_AT_TOS;
|
||||
infoPtr = tmpPtr->internalRep.otherValuePtr;
|
||||
infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
|
||||
numLists = infoPtr->numLists;
|
||||
TRACE(("=> "));
|
||||
|
||||
@@ -7213,7 +7209,7 @@ TEBCresume(
|
||||
case INST_FOREACH_END:
|
||||
/* THIS INSTRUCTION IS ONLY CALLED AS A BREAK TARGET */
|
||||
tmpPtr = OBJ_AT_TOS;
|
||||
infoPtr = tmpPtr->internalRep.otherValuePtr;
|
||||
infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
|
||||
numLists = infoPtr->numLists;
|
||||
TRACE(("=> loop terminated\n"));
|
||||
NEXT_INST_V(1, numLists+2, 0);
|
||||
@@ -7230,10 +7226,10 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
tmpPtr = OBJ_AT_DEPTH(1);
|
||||
infoPtr = tmpPtr->internalRep.otherValuePtr;
|
||||
infoPtr = tmpPtr->internalRep.twoPtrValue.ptr1;
|
||||
numLists = infoPtr->numLists;
|
||||
TRACE_APPEND(("=> appending to list at depth %d\n", 3 + numLists));
|
||||
|
||||
|
||||
objPtr = OBJ_AT_DEPTH(3 + numLists);
|
||||
Tcl_ListObjAppendElement(NULL, objPtr, OBJ_AT_TOS);
|
||||
NEXT_INST_F(1, 1, 0);
|
||||
@@ -7953,7 +7949,7 @@ TEBCresume(
|
||||
}
|
||||
#endif
|
||||
if ((result == TCL_CONTINUE) || (result == TCL_BREAK)) {
|
||||
rangePtr = GetExceptRangeForPc(pc, /*catchOnly*/ 0, codePtr);
|
||||
rangePtr = GetExceptRangeForPc(pc, result, codePtr);
|
||||
if (rangePtr == NULL) {
|
||||
TRACE_APPEND(("no encl. loop or catch, returning %s\n",
|
||||
StringForResultCode(result)));
|
||||
@@ -8065,7 +8061,7 @@ TEBCresume(
|
||||
while (auxObjList) {
|
||||
if ((catchTop != initCatchTop)
|
||||
&& (*catchTop > (ptrdiff_t)
|
||||
auxObjList->internalRep.ptrAndLongRep.value)) {
|
||||
auxObjList->internalRep.twoPtrValue.ptr2)) {
|
||||
break;
|
||||
}
|
||||
POP_TAUX_OBJ();
|
||||
@@ -8114,7 +8110,7 @@ TEBCresume(
|
||||
#endif
|
||||
goto abnormalReturn;
|
||||
}
|
||||
rangePtr = GetExceptRangeForPc(pc, /*catchOnly*/ 1, codePtr);
|
||||
rangePtr = GetExceptRangeForPc(pc, TCL_ERROR, codePtr);
|
||||
if (rangePtr == NULL) {
|
||||
/*
|
||||
* This is only possible when compiling a [catch] that sends its
|
||||
@@ -8195,7 +8191,7 @@ TEBCresume(
|
||||
}
|
||||
|
||||
iPtr->cmdFramePtr = bcFramePtr->nextPtr;
|
||||
if (--codePtr->refCount <= 0) {
|
||||
if (codePtr->refCount-- <= 1) {
|
||||
TclCleanupByteCode(codePtr);
|
||||
}
|
||||
TclStackFree(interp, TD); /* free my stack */
|
||||
@@ -8234,6 +8230,7 @@ TEBCresume(
|
||||
bytes = GetSrcInfoForPc(pc, codePtr, &length, NULL, NULL);
|
||||
opnd = TclGetUInt4AtPtr(pc+1);
|
||||
pc += (opnd-1);
|
||||
assert(bytes);
|
||||
PUSH_OBJECT(Tcl_NewStringObj(bytes, length));
|
||||
goto instEvalStk;
|
||||
}
|
||||
@@ -8247,6 +8244,7 @@ TEBCresume(
|
||||
#undef auxObjList
|
||||
#undef catchTop
|
||||
#undef TCONST
|
||||
#undef esPtr
|
||||
|
||||
static int
|
||||
FinalizeOONext(
|
||||
@@ -9773,7 +9771,7 @@ ValidatePcAndStackTop(
|
||||
(unsigned) opCode, relativePc);
|
||||
Tcl_Panic("TclNRExecuteByteCode execution failure: bad opcode");
|
||||
}
|
||||
if (checkStack &&
|
||||
if (checkStack &&
|
||||
((stackTop < 0) || (stackTop > stackUpperBound))) {
|
||||
int numChars;
|
||||
const char *cmd = GetSrcInfoForPc(pc, codePtr, &numChars, NULL, NULL);
|
||||
@@ -9830,7 +9828,7 @@ IllegalExprOperandType(
|
||||
|
||||
if (opcode == INST_EXPON) {
|
||||
operator = "**";
|
||||
} else if (opcode <= INST_STR_NEQ) {
|
||||
} else if (opcode <= INST_LNOT) {
|
||||
operator = operatorStrings[opcode - INST_LOR];
|
||||
}
|
||||
|
||||
@@ -9899,7 +9897,11 @@ TclGetSourceFromFrame(
|
||||
cfPtr->cmd = GetSrcInfoForPc((unsigned char *)
|
||||
cfPtr->data.tebc.pc, codePtr, &cfPtr->len, NULL, NULL);
|
||||
}
|
||||
cfPtr->cmdObj = Tcl_NewStringObj(cfPtr->cmd, cfPtr->len);
|
||||
if (cfPtr->cmd) {
|
||||
cfPtr->cmdObj = Tcl_NewStringObj(cfPtr->cmd, cfPtr->len);
|
||||
} else {
|
||||
cfPtr->cmdObj = Tcl_NewListObj(objc, objv);
|
||||
}
|
||||
Tcl_IncrRefCount(cfPtr->cmdObj);
|
||||
}
|
||||
return cfPtr->cmdObj;
|
||||
@@ -9981,7 +9983,7 @@ GetSrcInfoForPc(
|
||||
* where the current instruction starts.
|
||||
* If NULL; no pointer is stored. */
|
||||
int *cmdIdxPtr) /* If non-NULL, the location where the index
|
||||
* of the command containing the pc should
|
||||
* of the command containing the pc should
|
||||
* be stored. */
|
||||
{
|
||||
register int pcOffset = (pc - codePtr->codeStart);
|
||||
@@ -9994,10 +9996,8 @@ GetSrcInfoForPc(
|
||||
int bestSrcLength = -1; /* Initialized to avoid compiler warning. */
|
||||
int bestCmdIdx = -1;
|
||||
|
||||
if ((pcOffset < 0) || (pcOffset >= codePtr->numCodeBytes)) {
|
||||
if (pcBeg != NULL) *pcBeg = NULL;
|
||||
return NULL;
|
||||
}
|
||||
/* The pc must point within the bytecode */
|
||||
assert ((pcOffset >= 0) && (pcOffset < codePtr->numCodeBytes));
|
||||
|
||||
/*
|
||||
* Decode the code and source offset and length for each command. The
|
||||
@@ -10106,13 +10106,14 @@ GetSrcInfoForPc(
|
||||
* ExceptionRange.
|
||||
*
|
||||
* Results:
|
||||
* In the normal case, catchOnly is 0 (false) and this procedure returns
|
||||
* a pointer to the most closely enclosing ExceptionRange structure
|
||||
* regardless of whether it is a loop or catch exception range. This is
|
||||
* appropriate when processing a TCL_BREAK or TCL_CONTINUE, which will be
|
||||
* "handled" either by a loop exception range or a closer catch range. If
|
||||
* catchOnly is nonzero, this procedure ignores loop exception ranges and
|
||||
* returns a pointer to the closest catch range. If no matching
|
||||
* If the searchMode is TCL_ERROR, this procedure ignores loop exception
|
||||
* ranges and returns a pointer to the closest catch range. If the
|
||||
* searchMode is TCL_BREAK, this procedure returns a pointer to the most
|
||||
* closely enclosing ExceptionRange regardless of whether it is a loop or
|
||||
* catch exception range. If the searchMode is TCL_CONTINUE, this
|
||||
* procedure returns a pointer to the most closely enclosing
|
||||
* ExceptionRange (of any type) skipping only loop exception ranges if
|
||||
* they don't have a sensible continueOffset defined. If no matching
|
||||
* ExceptionRange is found that encloses pc, a NULL is returned.
|
||||
*
|
||||
* Side effects:
|
||||
@@ -10123,14 +10124,16 @@ GetSrcInfoForPc(
|
||||
|
||||
static ExceptionRange *
|
||||
GetExceptRangeForPc(
|
||||
const unsigned char *pc, /* The program counter value for which to
|
||||
const unsigned char *pc, /* The program counter value for which to
|
||||
* search for a closest enclosing exception
|
||||
* range. This points to a bytecode
|
||||
* instruction in codePtr's code. */
|
||||
int catchOnly, /* If 0, consider either loop or catch
|
||||
* ExceptionRanges in search. If nonzero
|
||||
int searchMode, /* If TCL_BREAK, consider either loop or catch
|
||||
* ExceptionRanges in search. If TCL_ERROR
|
||||
* consider only catch ranges (and ignore any
|
||||
* closer loop ranges). */
|
||||
* closer loop ranges). If TCL_CONTINUE, look
|
||||
* for loop ranges that define a continue
|
||||
* point or a catch range. */
|
||||
ByteCode *codePtr) /* Points to the ByteCode in which to search
|
||||
* for the enclosing ExceptionRange. */
|
||||
{
|
||||
@@ -10156,8 +10159,13 @@ GetExceptRangeForPc(
|
||||
start = rangePtr->codeOffset;
|
||||
if ((start <= pcOffset) &&
|
||||
(pcOffset < (start + rangePtr->numCodeBytes))) {
|
||||
if ((!catchOnly)
|
||||
|| (rangePtr->type == CATCH_EXCEPTION_RANGE)) {
|
||||
if (rangePtr->type == CATCH_EXCEPTION_RANGE) {
|
||||
return rangePtr;
|
||||
}
|
||||
if (searchMode == TCL_BREAK) {
|
||||
return rangePtr;
|
||||
}
|
||||
if (searchMode == TCL_CONTINUE && rangePtr->continueOffset != -1){
|
||||
return rangePtr;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -120,7 +120,7 @@ FileCopyRename(
|
||||
}
|
||||
i++;
|
||||
if ((objc - i) < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
"?-option value ...? source ?source ...? target");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -735,7 +735,7 @@ CopyRenameOneFile(
|
||||
|
||||
errfile = target;
|
||||
}
|
||||
/*
|
||||
/*
|
||||
* We now need to reset the result, because the above call,
|
||||
* may have left set it. (Ideally we would prefer not to pass
|
||||
* an interpreter in above, but the channel IO code used by
|
||||
|
||||
@@ -235,9 +235,9 @@ ExtractWinRoot(
|
||||
if ((path[0] == 'c' || path[0] == 'C')
|
||||
&& (path[1] == 'o' || path[1] == 'O')) {
|
||||
if ((path[2] == 'm' || path[2] == 'M')
|
||||
&& path[3] >= '1' && path[3] <= '4') {
|
||||
&& path[3] >= '1' && path[3] <= '9') {
|
||||
/*
|
||||
* May have match for 'com[1-4]:?', which is a serial port.
|
||||
* May have match for 'com[1-9]:?', which is a serial port.
|
||||
*/
|
||||
|
||||
if (path[4] == '\0') {
|
||||
@@ -257,9 +257,9 @@ ExtractWinRoot(
|
||||
} else if ((path[0] == 'l' || path[0] == 'L')
|
||||
&& (path[1] == 'p' || path[1] == 'P')
|
||||
&& (path[2] == 't' || path[2] == 'T')) {
|
||||
if (path[3] >= '1' && path[3] <= '3') {
|
||||
if (path[3] >= '1' && path[3] <= '9') {
|
||||
/*
|
||||
* May have match for 'lpt[1-3]:?'
|
||||
* May have match for 'lpt[1-9]:?'
|
||||
*/
|
||||
|
||||
if (path[4] == '\0') {
|
||||
@@ -821,10 +821,10 @@ Tcl_FSJoinToPath(
|
||||
return TclJoinPath(2, pair);
|
||||
} else {
|
||||
int elemc = objc + 1;
|
||||
Tcl_Obj *ret, **elemv = ckalloc(elemc*sizeof(Tcl_Obj **));
|
||||
Tcl_Obj *ret, **elemv = ckalloc(elemc*sizeof(Tcl_Obj *));
|
||||
|
||||
elemv[0] = pathPtr;
|
||||
memcpy(elemv+1, objv, objc*sizeof(Tcl_Obj **));
|
||||
memcpy(elemv+1, objv, objc*sizeof(Tcl_Obj *));
|
||||
ret = TclJoinPath(elemc, elemv);
|
||||
ckfree(elemv);
|
||||
return ret;
|
||||
|
||||
@@ -33,7 +33,7 @@ MODULE_SCOPE void TclFSSetPathDetails(Tcl_Obj *pathPtr,
|
||||
const Tcl_Filesystem *fsPtr, ClientData clientData);
|
||||
MODULE_SCOPE Tcl_Obj * TclFSNormalizeAbsolutePath(Tcl_Interp *interp,
|
||||
Tcl_Obj *pathPtr);
|
||||
MODULE_SCOPE int TclFSEpoch(void);
|
||||
MODULE_SCOPE size_t TclFSEpoch(void);
|
||||
|
||||
/*
|
||||
* Private shared variables for use by tclIOUtil.c and tclPathObj.c
|
||||
@@ -55,7 +55,7 @@ MODULE_SCOPE Tcl_PathType TclFSNonnativePathType(const char *pathPtr,
|
||||
MODULE_SCOPE Tcl_PathType TclGetPathType(Tcl_Obj *pathPtr,
|
||||
const Tcl_Filesystem **filesystemPtrPtr,
|
||||
int *driveNameLengthPtr, Tcl_Obj **driveNameRef);
|
||||
MODULE_SCOPE int TclFSEpochOk(int filesystemEpoch);
|
||||
MODULE_SCOPE int TclFSEpochOk(size_t filesystemEpoch);
|
||||
MODULE_SCOPE int TclFSCwdIsNative(void);
|
||||
MODULE_SCOPE Tcl_Obj * TclWinVolumeRelativeNormalize(Tcl_Interp *interp,
|
||||
const char *path, Tcl_Obj **useThisCwdPtr);
|
||||
|
||||
+1
-1
@@ -326,7 +326,7 @@ CreateHashEntry(
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (compareKeysProc((void *) key, hPtr)) {
|
||||
if (((void *) key == hPtr) || compareKeysProc((void *) key, hPtr)) {
|
||||
if (newPtr) {
|
||||
*newPtr = 0;
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ Tcl_RecordAndEvalObj(
|
||||
Tcl_Obj *list[3];
|
||||
|
||||
/*
|
||||
* Do recording by eval'ing a tcl history command: history add $cmd.
|
||||
* Do recording by eval'ing a tcl history command: history add $cmd.
|
||||
*/
|
||||
|
||||
list[0] = histObjsPtr->historyObj;
|
||||
@@ -175,7 +175,7 @@ Tcl_RecordAndEvalObj(
|
||||
/*
|
||||
* One possible failure mode above: exceeding a resource limit.
|
||||
*/
|
||||
|
||||
|
||||
if (Tcl_LimitExceeded(interp)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
+405
-137
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -126,7 +126,7 @@ typedef struct Channel {
|
||||
*/
|
||||
|
||||
typedef struct ChannelState {
|
||||
const char *channelName; /* The name of the channel instance in Tcl
|
||||
char *channelName; /* The name of the channel instance in Tcl
|
||||
* commands. Storage is owned by the generic
|
||||
* IO code, is dynamically allocated. */
|
||||
int flags; /* ORed combination of the flags defined
|
||||
|
||||
+21
-10
@@ -187,6 +187,7 @@ struct TransformChannelData {
|
||||
Tcl_Channel self; /* Our own Channel handle. */
|
||||
int readIsFlushed; /* Flag to note whether in.flushProc was
|
||||
* called or not. */
|
||||
int eofPending; /* Flag: EOF seen down, not raised up */
|
||||
int flags; /* Currently CHANNEL_ASYNC or zero. */
|
||||
int watchMask; /* Current watch/event/interest mask. */
|
||||
int mode; /* Mode of parent channel, OR'ed combination
|
||||
@@ -292,6 +293,7 @@ TclChannelTransform(
|
||||
Tcl_DStringInit(&ds);
|
||||
Tcl_GetChannelOption(interp, chan, "-blocking", &ds);
|
||||
dataPtr->readIsFlushed = 0;
|
||||
dataPtr->eofPending = 0;
|
||||
dataPtr->flags = 0;
|
||||
if (ds.string[0] == '0') {
|
||||
dataPtr->flags |= CHANNEL_ASYNC;
|
||||
@@ -624,7 +626,7 @@ TransformInputProc(
|
||||
|
||||
if (toRead == 0 || dataPtr->self == NULL) {
|
||||
/*
|
||||
* Catch a no-op.
|
||||
* Catch a no-op. TODO: Is this a panic()?
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
@@ -676,6 +678,17 @@ TransformInputProc(
|
||||
if (toRead <= 0) {
|
||||
break;
|
||||
}
|
||||
if (dataPtr->eofPending) {
|
||||
/*
|
||||
* Already saw EOF from downChan; don't ask again.
|
||||
* NOTE: Could move this up to avoid the last maxRead
|
||||
* execution. Believe this would still be correct behavior,
|
||||
* but the test suite tests the whole command callback
|
||||
* sequence, so leave it unchanged for now.
|
||||
*/
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get bytes from the underlying channel.
|
||||
@@ -711,14 +724,7 @@ TransformInputProc(
|
||||
* on the down channel.
|
||||
*/
|
||||
|
||||
if (dataPtr->readIsFlushed) {
|
||||
/*
|
||||
* Already flushed, nothing to do anymore.
|
||||
*/
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
dataPtr->eofPending = 1;
|
||||
dataPtr->readIsFlushed = 1;
|
||||
ExecuteCallback(dataPtr, NULL, A_FLUSH_READ, NULL, 0,
|
||||
TRANSMIT_IBUF, P_PRESERVE);
|
||||
@@ -746,8 +752,11 @@ TransformInputProc(
|
||||
break;
|
||||
}
|
||||
} /* while toRead > 0 */
|
||||
ReleaseData(dataPtr);
|
||||
|
||||
if (gotBytes == 0) {
|
||||
dataPtr->eofPending = 0;
|
||||
}
|
||||
ReleaseData(dataPtr);
|
||||
return gotBytes;
|
||||
}
|
||||
|
||||
@@ -858,6 +867,7 @@ TransformSeekProc(
|
||||
P_NO_PRESERVE);
|
||||
ResultClear(&dataPtr->result);
|
||||
dataPtr->readIsFlushed = 0;
|
||||
dataPtr->eofPending = 0;
|
||||
}
|
||||
ReleaseData(dataPtr);
|
||||
|
||||
@@ -931,6 +941,7 @@ TransformWideSeekProc(
|
||||
P_NO_PRESERVE);
|
||||
ResultClear(&dataPtr->result);
|
||||
dataPtr->readIsFlushed = 0;
|
||||
dataPtr->eofPending = 0;
|
||||
}
|
||||
ReleaseData(dataPtr);
|
||||
|
||||
|
||||
+19
-6
@@ -161,6 +161,7 @@ typedef struct {
|
||||
int mode; /* Mask of R/W mode */
|
||||
int nonblocking; /* Flag: Channel is blocking or not. */
|
||||
int readIsDrained; /* Flag: Read buffers are flushed. */
|
||||
int eofPending; /* Flag: EOF seen down, but not raised up */
|
||||
int dead; /* Boolean signal that some operations
|
||||
* should no longer be attempted. */
|
||||
ResultBuffer result;
|
||||
@@ -942,7 +943,7 @@ ReflectClose(
|
||||
Tcl_EventuallyFree(rtPtr,
|
||||
(Tcl_FreeProc *) FreeReflectedTransform);
|
||||
return errorCode;
|
||||
}
|
||||
}
|
||||
#endif /* TCL_THREADS */
|
||||
errorCodeSet = 1;
|
||||
goto cleanup;
|
||||
@@ -956,7 +957,7 @@ ReflectClose(
|
||||
Tcl_EventuallyFree(rtPtr,
|
||||
(Tcl_FreeProc *) FreeReflectedTransform);
|
||||
return errorCode;
|
||||
}
|
||||
}
|
||||
#endif /* TCL_THREADS */
|
||||
errorCodeSet = 1;
|
||||
goto cleanup;
|
||||
@@ -1082,6 +1083,10 @@ ReflectInput(
|
||||
bufObj = Tcl_NewByteArrayObj(NULL, toRead);
|
||||
Tcl_IncrRefCount(bufObj);
|
||||
gotBytes = 0;
|
||||
if (rtPtr->eofPending) {
|
||||
goto stop;
|
||||
}
|
||||
rtPtr->readIsDrained = 0;
|
||||
while (toRead > 0) {
|
||||
/*
|
||||
* Loop until the request is satisfied (or no data available from
|
||||
@@ -1097,6 +1102,11 @@ ReflectInput(
|
||||
goto stop;
|
||||
}
|
||||
|
||||
if (rtPtr->eofPending) {
|
||||
goto stop;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The buffer is exhausted, but the caller wants even more. We now
|
||||
* have to go to the underlying channel, get more bytes and then
|
||||
@@ -1165,10 +1175,8 @@ ReflectInput(
|
||||
* Zero returned from Tcl_ReadRaw() always indicates EOF
|
||||
* on the down channel.
|
||||
*/
|
||||
|
||||
if (rtPtr->readIsDrained) {
|
||||
goto stop;
|
||||
}
|
||||
|
||||
rtPtr->eofPending = 1;
|
||||
|
||||
/*
|
||||
* Now this is a bit different. The partial data waiting is
|
||||
@@ -1211,6 +1219,9 @@ ReflectInput(
|
||||
} /* while toRead > 0 */
|
||||
|
||||
stop:
|
||||
if (gotBytes == 0) {
|
||||
rtPtr->eofPending = 0;
|
||||
}
|
||||
Tcl_DecrRefCount(bufObj);
|
||||
Tcl_Release(rtPtr);
|
||||
return gotBytes;
|
||||
@@ -1766,6 +1777,7 @@ NewReflectedTransform(
|
||||
rtPtr->timer = NULL;
|
||||
rtPtr->mode = 0;
|
||||
rtPtr->readIsDrained = 0;
|
||||
rtPtr->eofPending = 0;
|
||||
rtPtr->nonblocking =
|
||||
(((Channel *) parentChan)->state->flags & CHANNEL_NONBLOCKING);
|
||||
rtPtr->dead = 0;
|
||||
@@ -3318,6 +3330,7 @@ TransformClear(
|
||||
(void) InvokeTclMethod(rtPtr, "clear", NULL, NULL, NULL);
|
||||
|
||||
rtPtr->readIsDrained = 0;
|
||||
rtPtr->eofPending = 0;
|
||||
ResultClear(&rtPtr->result);
|
||||
}
|
||||
|
||||
|
||||
+24
-12
@@ -12,9 +12,26 @@
|
||||
#include "tclInt.h"
|
||||
|
||||
#if defined(_WIN32) && defined(UNICODE)
|
||||
/* On Windows, we always need the ASCII version. */
|
||||
# undef gai_strerror
|
||||
# define gai_strerror gai_strerrorA
|
||||
/* On Windows, we need to do proper Unicode->UTF-8 conversion. */
|
||||
|
||||
typedef struct ThreadSpecificData {
|
||||
int initialized;
|
||||
Tcl_DString errorMsg; /* UTF-8 encoded error-message */
|
||||
} ThreadSpecificData;
|
||||
static Tcl_ThreadDataKey dataKey;
|
||||
|
||||
#undef gai_strerror
|
||||
static const char *gai_strerror(int code) {
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
|
||||
|
||||
if (tsdPtr->initialized) {
|
||||
Tcl_DStringFree(&tsdPtr->errorMsg);
|
||||
} else {
|
||||
tsdPtr->initialized = 1;
|
||||
}
|
||||
Tcl_WinTCharToUtf(gai_strerrorW(code), -1, &tsdPtr->errorMsg);
|
||||
return Tcl_DStringValue(&tsdPtr->errorMsg);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -154,7 +171,7 @@ TclCreateSocketAddress(
|
||||
char *native = NULL, portbuf[TCL_INTEGER_SPACE], *portstring;
|
||||
const char *family = NULL;
|
||||
Tcl_DString ds;
|
||||
int result, i;
|
||||
int result;
|
||||
|
||||
if (host != NULL) {
|
||||
native = Tcl_UtfToExternalDString(NULL, host, -1, &ds);
|
||||
@@ -170,11 +187,11 @@ TclCreateSocketAddress(
|
||||
TclFormatInt(portbuf, port);
|
||||
portstring = portbuf;
|
||||
}
|
||||
|
||||
|
||||
(void) memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Magic variable to enforce a certain address family - to be superseded
|
||||
* by a TIP that adds explicit switches to [socket]
|
||||
*/
|
||||
@@ -211,7 +228,7 @@ TclCreateSocketAddress(
|
||||
|
||||
if (willBind) {
|
||||
hints.ai_flags |= AI_PASSIVE;
|
||||
}
|
||||
}
|
||||
|
||||
result = getaddrinfo(native, portstring, &hints, addrlist);
|
||||
|
||||
@@ -262,11 +279,6 @@ TclCreateSocketAddress(
|
||||
*addrlist = v4head;
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
for (p = *addrlist; p != NULL; p = p->ai_next) {
|
||||
i++;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
+66
-29
@@ -59,12 +59,12 @@ typedef struct FilesystemRecord {
|
||||
|
||||
typedef struct ThreadSpecificData {
|
||||
int initialized;
|
||||
int cwdPathEpoch;
|
||||
int filesystemEpoch;
|
||||
size_t cwdPathEpoch;
|
||||
size_t filesystemEpoch;
|
||||
Tcl_Obj *cwdPathPtr;
|
||||
ClientData cwdClientData;
|
||||
FilesystemRecord *filesystemList;
|
||||
int claims;
|
||||
size_t claims;
|
||||
} ThreadSpecificData;
|
||||
|
||||
/*
|
||||
@@ -215,7 +215,7 @@ static FilesystemRecord nativeFilesystemRecord = {
|
||||
* trigger cache cleanup in all threads.
|
||||
*/
|
||||
|
||||
static int theFilesystemEpoch = 1;
|
||||
static size_t theFilesystemEpoch = 1;
|
||||
|
||||
/*
|
||||
* Stores the linked list of filesystems. A 1:1 copy of this list is also
|
||||
@@ -231,7 +231,7 @@ TCL_DECLARE_MUTEX(filesystemMutex)
|
||||
*/
|
||||
|
||||
static Tcl_Obj *cwdPathPtr = NULL;
|
||||
static int cwdPathEpoch = 0;
|
||||
static size_t cwdPathEpoch = 0;
|
||||
static ClientData cwdClientData = NULL;
|
||||
TCL_DECLARE_MUTEX(cwdMutex)
|
||||
|
||||
@@ -645,7 +645,7 @@ FsGetFirstFilesystem(void)
|
||||
|
||||
int
|
||||
TclFSEpochOk(
|
||||
int filesystemEpoch)
|
||||
size_t filesystemEpoch)
|
||||
{
|
||||
return (filesystemEpoch == 0 || filesystemEpoch == theFilesystemEpoch);
|
||||
}
|
||||
@@ -666,7 +666,7 @@ Disclaim(void)
|
||||
tsdPtr->claims--;
|
||||
}
|
||||
|
||||
int
|
||||
size_t
|
||||
TclFSEpoch(void)
|
||||
{
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&fsDataKey);
|
||||
@@ -713,7 +713,9 @@ FsUpdateCwd(
|
||||
cwdClientData = TclNativeDupInternalRep(clientData);
|
||||
}
|
||||
|
||||
cwdPathEpoch++;
|
||||
if (++cwdPathEpoch == 0) {
|
||||
++cwdPathEpoch;
|
||||
}
|
||||
tsdPtr->cwdPathEpoch = cwdPathEpoch;
|
||||
Tcl_MutexUnlock(&cwdMutex);
|
||||
|
||||
@@ -790,7 +792,9 @@ TclFinalizeFilesystem(void)
|
||||
}
|
||||
fsRecPtr = tmpFsRecPtr;
|
||||
}
|
||||
theFilesystemEpoch++;
|
||||
if (++theFilesystemEpoch == 0) {
|
||||
++theFilesystemEpoch;
|
||||
}
|
||||
filesystemList = NULL;
|
||||
|
||||
/*
|
||||
@@ -823,7 +827,9 @@ void
|
||||
TclResetFilesystem(void)
|
||||
{
|
||||
filesystemList = &nativeFilesystemRecord;
|
||||
theFilesystemEpoch++;
|
||||
if (++theFilesystemEpoch == 0) {
|
||||
++theFilesystemEpoch;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
@@ -908,7 +914,9 @@ Tcl_FSRegister(
|
||||
* conceivably now belong to different filesystems.
|
||||
*/
|
||||
|
||||
theFilesystemEpoch++;
|
||||
if (++theFilesystemEpoch == 0) {
|
||||
++theFilesystemEpoch;
|
||||
}
|
||||
Tcl_MutexUnlock(&filesystemMutex);
|
||||
|
||||
return TCL_OK;
|
||||
@@ -973,7 +981,9 @@ Tcl_FSUnregister(
|
||||
* (which would of course lead to memory exceptions).
|
||||
*/
|
||||
|
||||
theFilesystemEpoch++;
|
||||
if (++theFilesystemEpoch == 0) {
|
||||
++theFilesystemEpoch;
|
||||
}
|
||||
|
||||
ckfree(fsRecPtr);
|
||||
|
||||
@@ -1304,7 +1314,9 @@ Tcl_FSMountsChanged(
|
||||
*/
|
||||
|
||||
Tcl_MutexLock(&filesystemMutex);
|
||||
theFilesystemEpoch++;
|
||||
if (++theFilesystemEpoch == 0) {
|
||||
++theFilesystemEpoch;
|
||||
}
|
||||
Tcl_MutexUnlock(&filesystemMutex);
|
||||
}
|
||||
|
||||
@@ -2890,9 +2902,13 @@ int
|
||||
Tcl_FSChdir(
|
||||
Tcl_Obj *pathPtr)
|
||||
{
|
||||
const Tcl_Filesystem *fsPtr;
|
||||
const Tcl_Filesystem *fsPtr, *oldFsPtr = NULL;
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&fsDataKey);
|
||||
int retVal = -1;
|
||||
|
||||
if (tsdPtr->cwdPathPtr != NULL) {
|
||||
oldFsPtr = Tcl_FSGetFileSystemForPath(tsdPtr->cwdPathPtr);
|
||||
}
|
||||
if (Tcl_FSGetNormalizedPath(NULL, pathPtr) == NULL) {
|
||||
Tcl_SetErrno(ENOENT);
|
||||
return retVal;
|
||||
@@ -2992,7 +3008,6 @@ Tcl_FSChdir(
|
||||
* instead. This should be examined by someone on Unix.
|
||||
*/
|
||||
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&fsDataKey);
|
||||
ClientData cd;
|
||||
ClientData oldcd = tsdPtr->cwdClientData;
|
||||
|
||||
@@ -3009,6 +3024,14 @@ Tcl_FSChdir(
|
||||
} else {
|
||||
FsUpdateCwd(normDirName, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the filesystem changed between old and new cwd
|
||||
* force filesystem refresh on path objects.
|
||||
*/
|
||||
if (oldFsPtr != NULL && fsPtr != oldFsPtr) {
|
||||
Tcl_FSMountsChanged(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return retVal;
|
||||
@@ -3150,7 +3173,7 @@ TclSkipUnlink (Tcl_Obj* shlibFile)
|
||||
*
|
||||
* Ad 2: This variable can disable/override the AUFS detection, i.e. for
|
||||
* testing if a newer AUFS does not have the bug any more.
|
||||
*
|
||||
*
|
||||
* Ad 3: This is conditionally compiled in. Condition currently must be set manually.
|
||||
* This part needs proper tests in the configure(.in).
|
||||
*/
|
||||
@@ -3231,7 +3254,9 @@ Tcl_LoadFile(
|
||||
if (*handlePtr == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_ResetResult(interp);
|
||||
if (interp) {
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
goto resolveSymbols;
|
||||
}
|
||||
if (Tcl_GetErrno() != EXDEV) {
|
||||
@@ -3247,9 +3272,11 @@ Tcl_LoadFile(
|
||||
*/
|
||||
|
||||
if (Tcl_FSAccess(pathPtr, R_OK) != 0) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"couldn't load library \"%s\": %s",
|
||||
Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
|
||||
if (interp) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"couldn't load library \"%s\": %s",
|
||||
Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -3298,7 +3325,9 @@ Tcl_LoadFile(
|
||||
}
|
||||
|
||||
mustCopyToTempAnyway:
|
||||
Tcl_ResetResult(interp);
|
||||
if (interp) {
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
#endif /* TCL_LOAD_FROM_MEMORY */
|
||||
|
||||
/*
|
||||
@@ -3322,8 +3351,10 @@ Tcl_LoadFile(
|
||||
|
||||
Tcl_FSDeleteFile(copyToPtr);
|
||||
Tcl_DecrRefCount(copyToPtr);
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"couldn't load from current filesystem", -1));
|
||||
if (interp) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"couldn't load from current filesystem", -1));
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -3363,7 +3394,9 @@ Tcl_LoadFile(
|
||||
* have stored the number of bytes in the result.
|
||||
*/
|
||||
|
||||
Tcl_ResetResult(interp);
|
||||
if (interp) {
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
retVal = Tcl_LoadFile(interp, copyToPtr, symbols, flags, procPtrs,
|
||||
&newLoadHandle);
|
||||
@@ -3395,7 +3428,9 @@ Tcl_LoadFile(
|
||||
*/
|
||||
|
||||
*handlePtr = newLoadHandle;
|
||||
Tcl_ResetResult(interp);
|
||||
if (interp) {
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -3456,11 +3491,13 @@ Tcl_LoadFile(
|
||||
divertedLoadHandle->unloadFileProcPtr = DivertUnloadFile;
|
||||
*handlePtr = divertedLoadHandle;
|
||||
|
||||
Tcl_ResetResult(interp);
|
||||
if (interp) {
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
return retVal;
|
||||
|
||||
resolveSymbols:
|
||||
/*
|
||||
/*
|
||||
* At this point, *handlePtr is already set up to the handle for the
|
||||
* loaded library. We now try to resolve the symbols.
|
||||
*/
|
||||
@@ -3469,7 +3506,7 @@ Tcl_LoadFile(
|
||||
for (i=0 ; symbols[i] != NULL; i++) {
|
||||
procPtrs[i] = Tcl_FindSymbol(interp, *handlePtr, symbols[i]);
|
||||
if (procPtrs[i] == NULL) {
|
||||
/*
|
||||
/*
|
||||
* At least one symbol in the list was not found. Unload the
|
||||
* file, and report the problem back to the caller.
|
||||
* (Tcl_FindSymbol should already have left an appropriate
|
||||
@@ -3489,7 +3526,7 @@ Tcl_LoadFile(
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* DivertFindSymbol --
|
||||
*
|
||||
*
|
||||
* Find a symbol in a shared library loaded by copy-from-VFS.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
#
|
||||
# This file contains the declarations for all unsupported
|
||||
# functions that are exported by the Tcl library. This file
|
||||
# is used to generate the tclIntDecls.h, tclIntPlatDecls.h,
|
||||
# tclIntStub.c, tclPlatStub.c, tclCompileDecls.h and tclCompileStub.c
|
||||
# files
|
||||
# is used to generate the tclIntDecls.h, tclIntPlatDecls.h
|
||||
# and tclStubInit.c files
|
||||
#
|
||||
# Copyright (c) 1998-1999 by Scriptics Corporation.
|
||||
# Copyright (c) 2001 by Kevin B. Kenny. All rights reserved.
|
||||
|
||||
+30
-31
@@ -1177,25 +1177,25 @@ typedef struct CmdFrame {
|
||||
*
|
||||
* Field TEBC EvalEx
|
||||
* ======= ==== ======
|
||||
* level yes yes
|
||||
* level yes yes
|
||||
* type BC/PREBC SRC/EVAL
|
||||
* line0 yes yes
|
||||
* framePtr yes yes
|
||||
* line0 yes yes
|
||||
* framePtr yes yes
|
||||
* ======= ==== ======
|
||||
*
|
||||
* ======= ==== ========= union data
|
||||
* line1 - yes
|
||||
* line3 - yes
|
||||
* path - yes
|
||||
* line1 - yes
|
||||
* line3 - yes
|
||||
* path - yes
|
||||
* ------- ---- ------
|
||||
* codePtr yes -
|
||||
* pc yes -
|
||||
* codePtr yes -
|
||||
* pc yes -
|
||||
* ======= ==== ======
|
||||
*
|
||||
* ======= ==== ========= union cmd
|
||||
* str.cmd yes yes
|
||||
* str.len yes yes
|
||||
* ------- ---- ------
|
||||
* str.cmd yes yes
|
||||
* str.len yes yes
|
||||
* ------- ---- ------
|
||||
*/
|
||||
|
||||
union {
|
||||
@@ -1741,7 +1741,7 @@ enum PkgPreferOptions {
|
||||
* definition there.
|
||||
* Some macros require knowledge of some fields in the struct in order to
|
||||
* avoid hitting the TSD unnecessarily. In order to facilitate this, a pointer
|
||||
* to the relevant fields is kept in the objCache field in struct Interp.
|
||||
* to the relevant fields is kept in the allocCache field in struct Interp.
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -2927,7 +2927,7 @@ MODULE_SCOPE void TclFinalizePreserve(void);
|
||||
MODULE_SCOPE void TclFinalizeSynchronization(void);
|
||||
MODULE_SCOPE void TclFinalizeThreadAlloc(void);
|
||||
MODULE_SCOPE void TclFinalizeThreadAllocThread(void);
|
||||
MODULE_SCOPE void TclFinalizeThreadData(void);
|
||||
MODULE_SCOPE void TclFinalizeThreadData(int quick);
|
||||
MODULE_SCOPE void TclFinalizeThreadObjects(void);
|
||||
MODULE_SCOPE double TclFloor(const mp_int *a);
|
||||
MODULE_SCOPE void TclFormatNaN(double value, char *buffer);
|
||||
@@ -2985,8 +2985,8 @@ MODULE_SCOPE void TclInitNotifier(void);
|
||||
MODULE_SCOPE void TclInitObjSubsystem(void);
|
||||
MODULE_SCOPE void TclInitSubsystems(void);
|
||||
MODULE_SCOPE int TclInterpReady(Tcl_Interp *interp);
|
||||
MODULE_SCOPE int TclIsLocalScalar(const char *src, int len);
|
||||
MODULE_SCOPE int TclIsSpaceProc(char byte);
|
||||
MODULE_SCOPE int TclIsBareword(char byte);
|
||||
MODULE_SCOPE Tcl_Obj * TclJoinPath(int elements, Tcl_Obj * const objv[]);
|
||||
MODULE_SCOPE int TclJoinThread(Tcl_ThreadId id, int *result);
|
||||
MODULE_SCOPE void TclLimitRemoveAllHandlers(Tcl_Interp *interp);
|
||||
@@ -3095,7 +3095,8 @@ MODULE_SCOPE void TclRememberJoinableThread(Tcl_ThreadId id);
|
||||
MODULE_SCOPE void TclRememberMutex(Tcl_Mutex *mutex);
|
||||
MODULE_SCOPE void TclRemoveScriptLimitCallbacks(Tcl_Interp *interp);
|
||||
MODULE_SCOPE int TclReToGlob(Tcl_Interp *interp, const char *reStr,
|
||||
int reStrLen, Tcl_DString *dsPtr, int *flagsPtr);
|
||||
int reStrLen, Tcl_DString *dsPtr, int *flagsPtr,
|
||||
int *quantifiersFoundPtr);
|
||||
MODULE_SCOPE int TclScanElement(const char *string, int length,
|
||||
int *flagPtr);
|
||||
MODULE_SCOPE void TclSetBgErrorHandler(Tcl_Interp *interp,
|
||||
@@ -3229,15 +3230,15 @@ MODULE_SCOPE Tcl_Obj * TclDictWithInit(Tcl_Interp *interp, Tcl_Obj *dictPtr,
|
||||
MODULE_SCOPE int Tcl_DisassembleObjCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
|
||||
/* Assemble command function */
|
||||
|
||||
/* Assemble command function */
|
||||
MODULE_SCOPE int Tcl_AssembleObjCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int TclNRAssembleObjCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
|
||||
Tcl_Obj *const objv[]);
|
||||
|
||||
MODULE_SCOPE int Tcl_EncodingObjCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
@@ -3908,7 +3909,7 @@ MODULE_SCOPE int TclStreqOpCmd(ClientData clientData,
|
||||
MODULE_SCOPE int TclCompileStreqOpCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Command *cmdPtr,
|
||||
struct CompileEnv *envPtr);
|
||||
|
||||
|
||||
MODULE_SCOPE int TclCompileAssembleCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Command *cmdPtr,
|
||||
struct CompileEnv *envPtr);
|
||||
@@ -4038,7 +4039,7 @@ typedef const char *TclDTraceStr;
|
||||
*/
|
||||
|
||||
# define TclDecrRefCount(objPtr) \
|
||||
if (--(objPtr)->refCount > 0) ; else { \
|
||||
if ((objPtr)->refCount-- > 1) ; else { \
|
||||
if (!(objPtr)->typePtr || !(objPtr)->typePtr->freeIntRepProc) { \
|
||||
TCL_DTRACE_OBJ_FREE(objPtr); \
|
||||
if ((objPtr)->bytes \
|
||||
@@ -4115,7 +4116,8 @@ MODULE_SCOPE void TclpFreeAllocCache(void *);
|
||||
AllocCache *cachePtr; \
|
||||
if (((interp) == NULL) || \
|
||||
((cachePtr = ((Interp *)(interp))->allocCache), \
|
||||
(cachePtr->numObjects >= ALLOC_NOBJHIGH))) { \
|
||||
((cachePtr->numObjects == 0) || \
|
||||
(cachePtr->numObjects >= ALLOC_NOBJHIGH)))) { \
|
||||
TclThreadFreeObj(objPtr); \
|
||||
} else { \
|
||||
(objPtr)->internalRep.twoPtrValue.ptr1 = cachePtr->firstObjPtr; \
|
||||
@@ -4433,17 +4435,12 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Core procedures added to libtommath for bignum manipulation.
|
||||
* Core procedure added to libtommath for bignum manipulation.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
MODULE_SCOPE Tcl_PackageInitProc TclTommath_Init;
|
||||
MODULE_SCOPE void TclBNInitBignumFromLong(mp_int *bignum, long initVal);
|
||||
MODULE_SCOPE void TclBNInitBignumFromWideInt(mp_int *bignum,
|
||||
Tcl_WideInt initVal);
|
||||
MODULE_SCOPE void TclBNInitBignumFromWideUInt(mp_int *bignum,
|
||||
Tcl_WideUInt initVal);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -4677,7 +4674,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
|
||||
*/
|
||||
|
||||
#define TclCleanupCommandMacro(cmdPtr) \
|
||||
if (--(cmdPtr)->refCount <= 0) { \
|
||||
if ((cmdPtr)->refCount-- <= 1) { \
|
||||
ckfree((char *) (cmdPtr));\
|
||||
}
|
||||
|
||||
@@ -4794,7 +4791,9 @@ void Tcl_Panic(const char *, ...) __attribute__((analyzer_noreturn));
|
||||
*/
|
||||
|
||||
#define NRE_USE_SMALL_ALLOC 1 /* Only turn off for debugging purposes. */
|
||||
#define NRE_ENABLE_ASSERTS 1
|
||||
#ifndef NRE_ENABLE_ASSERTS
|
||||
#define NRE_ENABLE_ASSERTS 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is the main data struct for representing NR commands. It is designed
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user