Compare commits
774
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd45c8be9d | ||
|
|
40b3d4d5dd | ||
|
|
25c115b5a8 | ||
|
|
d4ef5a261a | ||
|
|
81a445ad46 | ||
|
|
ca9f2d6210 | ||
|
|
0b56647743 | ||
|
|
f827fd2a9d | ||
|
|
d60bc321ce | ||
|
|
4404292972 | ||
|
|
82ffc550db | ||
|
|
89e3b6811b | ||
|
|
3c53be5e75 | ||
|
|
b7efdfe9bc | ||
|
|
3b0ee42270 | ||
|
|
f163c24b4c | ||
|
|
8f3e8012b1 | ||
|
|
076a7e2839 | ||
|
|
cfe53b8870 | ||
|
|
9efaa4d7f1 | ||
|
|
dc84eca339 | ||
|
|
f15717bcda | ||
|
|
ff316586bc | ||
|
|
109828f090 | ||
|
|
0df05b3515 | ||
|
|
84623a09f2 | ||
|
|
1c0ca80fe5 | ||
|
|
17211d39a0 | ||
|
|
37d6f90099 | ||
|
|
32d6283561 | ||
|
|
b0654427ca | ||
|
|
6e6d624ec3 | ||
|
|
34d3750e3c | ||
|
|
63855497af | ||
|
|
48d0827130 | ||
|
|
1c788e178d | ||
|
|
be83197ee5 | ||
|
|
33918a2b0b | ||
|
|
6459a50433 | ||
|
|
cac264cd19 | ||
|
|
c41f605368 | ||
|
|
fb10e693b2 | ||
|
|
8514e60248 | ||
|
|
fd9662ee1c | ||
|
|
28e7632fe6 | ||
|
|
7f986a59bf | ||
|
|
ad823f4eb1 | ||
|
|
4cecb91655 | ||
|
|
40c3ec35ee | ||
|
|
0b669eacf8 | ||
|
|
8ce6115cf5 | ||
|
|
81060c0741 | ||
|
|
71b64b8e1c | ||
|
|
dd306f5b8f | ||
|
|
69875ee99d | ||
|
|
546165585c | ||
|
|
fd320780c7 | ||
|
|
59a788a6c4 | ||
|
|
e51ff962f0 | ||
|
|
f3ae2684eb | ||
|
|
e3f7f1bad8 | ||
|
|
f70e1f98b3 | ||
|
|
3fc1392c92 | ||
|
|
fe00b6dcf6 | ||
|
|
81e7623b78 | ||
|
|
ceb9567874 | ||
|
|
579cd0b138 | ||
|
|
cd1fc2183e | ||
|
|
208927f009 | ||
|
|
e250b6f551 | ||
|
|
7bf5af5c22 | ||
|
|
4a3369807b | ||
|
|
92bd8b3a3f | ||
|
|
5039e7ce17 | ||
|
|
5c9a145403 | ||
|
|
e53cbf77bf | ||
|
|
ec01eef200 | ||
|
|
a9405cc253 | ||
|
|
17b3cb8739 | ||
|
|
4dfeb77d2e | ||
|
|
f7bdf7cfb1 | ||
|
|
b7c4b811ec | ||
|
|
09fd21b65b | ||
|
|
cb6ae54424 | ||
|
|
1f4f47ccf5 | ||
|
|
195ea285da | ||
|
|
20d206c4c2 | ||
|
|
98a93d4ca7 | ||
|
|
accd2800ec | ||
|
|
2b01204e41 | ||
|
|
43e27f10a5 | ||
|
|
2342babe99 | ||
|
|
6ac6380f7a | ||
|
|
38b30033c8 | ||
|
|
2a48060425 | ||
|
|
8e25003fbd | ||
|
|
947369a720 | ||
|
|
f6bf85fb67 | ||
|
|
94a0658bc2 | ||
|
|
866a79313b | ||
|
|
636e4d4826 | ||
|
|
e6b8f92493 | ||
|
|
194cfb5382 | ||
|
|
9a01f0fa35 | ||
|
|
67f864dc65 | ||
|
|
29577449a1 | ||
|
|
21b10cef38 | ||
|
|
26bb60bef7 | ||
|
|
167555e6ab | ||
|
|
00a4f18c38 | ||
|
|
8f0b94f037 | ||
|
|
9d34b872ce | ||
|
|
b8b008ad84 | ||
|
|
abc23e6723 | ||
|
|
e4fcd7152b | ||
|
|
3ee0402bd5 | ||
|
|
3fcb054f91 | ||
|
|
5189ce8eae | ||
|
|
a9ba2a08b5 | ||
|
|
768db27d4c | ||
|
|
ebb520a849 | ||
|
|
9e43cbb973 | ||
|
|
a9fc439a35 | ||
|
|
7f917c56f7 | ||
|
|
7a56ff406f | ||
|
|
fb77f1148f | ||
|
|
107d130ce3 | ||
|
|
0266195479 | ||
|
|
bddd146942 | ||
|
|
e42885732a | ||
|
|
1a94f57ab6 | ||
|
|
516be1cd2e | ||
|
|
7b7d6e2116 | ||
|
|
bfbfb2e5d3 | ||
|
|
249c689f2d | ||
|
|
ac45c8d851 | ||
|
|
8da77a52ef | ||
|
|
57849b86a1 | ||
|
|
f0ab6a724c | ||
|
|
be275081a1 | ||
|
|
733b7a43a4 | ||
|
|
0a36b1187d | ||
|
|
bc10bf6d03 | ||
|
|
e14285c3a1 | ||
|
|
32975bd346 | ||
|
|
76e4a71917 | ||
|
|
23520a7648 | ||
|
|
1dc3124160 | ||
|
|
c11add7a17 | ||
|
|
929fdafe13 | ||
|
|
93124d77a6 | ||
|
|
2238887c08 | ||
|
|
5758c119f8 | ||
|
|
245a63f491 | ||
|
|
39aec08fb0 | ||
|
|
66798b2c01 | ||
|
|
52f93c85fd | ||
|
|
fa3cf75311 | ||
|
|
262b6297ea | ||
|
|
d0cfe30a0d | ||
|
|
f0ec68f072 | ||
|
|
5bef31d2da | ||
|
|
f073bc7484 | ||
|
|
e89503a925 | ||
|
|
278837f261 | ||
|
|
d16f803f15 | ||
|
|
779b664e54 | ||
|
|
6e44927248 | ||
|
|
aa4c91c838 | ||
|
|
524b1d9fb2 | ||
|
|
7f62b76887 | ||
|
|
0715d88019 | ||
|
|
f796d62367 | ||
|
|
2061afedcc | ||
|
|
f5ac592def | ||
|
|
06d15abf35 | ||
|
|
2592b1e93b | ||
|
|
1699143ae3 | ||
|
|
0e0be8492f | ||
|
|
f4d0f6366c | ||
|
|
049f2bdf3e | ||
|
|
60fde1d90f | ||
|
|
5cf272491e | ||
|
|
45e00e9df8 | ||
|
|
a7f1b76ad2 | ||
|
|
76b326ce86 | ||
|
|
264c574c23 | ||
|
|
230f0601cc | ||
|
|
0d66de6c27 | ||
|
|
618c49af4d | ||
|
|
87b0db4d91 | ||
|
|
66dd14a480 | ||
|
|
ff741e8b29 | ||
|
|
0aaf6122a5 | ||
|
|
f2963d15d0 | ||
|
|
1674055d7a | ||
|
|
fd253d8677 | ||
|
|
a4abf50c23 | ||
|
|
db325590a7 | ||
|
|
2b83b2c999 | ||
|
|
9f309d56cc | ||
|
|
712f88bef7 | ||
|
|
ee7073e468 | ||
|
|
de2793025f | ||
|
|
ebff38e965 | ||
|
|
4cdb0426f4 | ||
|
|
d85664964a | ||
|
|
264c84606b | ||
|
|
0ca087be13 | ||
|
|
008cd7d2a9 | ||
|
|
a9843e57c2 | ||
|
|
d995661712 | ||
|
|
724de352e3 | ||
|
|
6b0b7154f1 | ||
|
|
d52b3eef80 | ||
|
|
6c69cf8504 | ||
|
|
9cb408090e | ||
|
|
0468c659f5 | ||
|
|
30fd8c842c | ||
|
|
4047fa1ba8 | ||
|
|
517172cbc1 | ||
|
|
0cb06ba3ca | ||
|
|
3b621e98a7 | ||
|
|
6ecf15e4f1 | ||
|
|
213447740b | ||
|
|
5bb0947953 | ||
|
|
01b6b4918f | ||
|
|
db4a945f2e | ||
|
|
e3707dae62 | ||
|
|
643301e722 | ||
|
|
30c146de54 | ||
|
|
be42098b82 | ||
|
|
6149b214e8 | ||
|
|
4af0efa4cb | ||
|
|
de01488d55 | ||
|
|
ab94b4c534 | ||
|
|
953e3ea899 | ||
|
|
3b1ca15e07 | ||
|
|
c1d3ca8bae | ||
|
|
ffe530a1b2 | ||
|
|
df56e0e1df | ||
|
|
532db685f4 | ||
|
|
1d040a5bae | ||
|
|
7cb8eb7218 | ||
|
|
fcab027ea1 | ||
|
|
171bea3624 | ||
|
|
06a30a3a2a | ||
|
|
fe94c1d6c4 | ||
|
|
120f367646 | ||
|
|
1192757fb7 | ||
|
|
c76cad8a92 | ||
|
|
42a34d459e | ||
|
|
dc1ca56b6a | ||
|
|
d753cbc088 | ||
|
|
749efa7f84 | ||
|
|
f78ef1eea2 | ||
|
|
40b259956c | ||
|
|
430924da25 | ||
|
|
7aa1b00468 | ||
|
|
91c115082e | ||
|
|
cc21b0be2a | ||
|
|
e299458ad5 | ||
|
|
dddf36c195 | ||
|
|
4b9763f5f7 | ||
|
|
b5e50e499a | ||
|
|
dfcc8ce6e5 | ||
|
|
1ba4ad76b3 | ||
|
|
a2db4b22d0 | ||
|
|
0f06b1b667 | ||
|
|
b7a2d6b3d5 | ||
|
|
c1c4367262 | ||
|
|
33c3374723 | ||
|
|
17c6c5b754 | ||
|
|
0e59966ac5 | ||
|
|
d98891b0a7 | ||
|
|
bb22d2e869 | ||
|
|
9684712f82 | ||
|
|
7f6ef9991b | ||
|
|
00ec998267 | ||
|
|
720183a9af | ||
|
|
14cfbc651c | ||
|
|
5016da417f | ||
|
|
05f25dff9f | ||
|
|
cab7f268d6 | ||
|
|
f9c196e0e6 | ||
|
|
204434e4d4 | ||
|
|
42d0a72e21 | ||
|
|
51449d078f | ||
|
|
e6a9f22409 | ||
|
|
a03c2cb1c2 | ||
|
|
d91e1e6efb | ||
|
|
2705cb22d6 | ||
|
|
f48f2735de | ||
|
|
a541a7be4c | ||
|
|
d12eb85c8f | ||
|
|
201d01f9da | ||
|
|
6310c709d3 | ||
|
|
690f2c2839 | ||
|
|
a300508fee | ||
|
|
2a52ff28dd | ||
|
|
651f71edfd | ||
|
|
9598926f42 | ||
|
|
85bdb7cb8e | ||
|
|
a352c6e663 | ||
|
|
711c236648 | ||
|
|
7d6a2292b5 | ||
|
|
18560d970e | ||
|
|
d44da35f2c | ||
|
|
4c85e21797 | ||
|
|
a757f1e30d | ||
|
|
634e9464b5 | ||
|
|
79214905a2 | ||
|
|
a13bb8b0ca | ||
|
|
69fdd85b74 | ||
|
|
c14dbae8ad | ||
|
|
a812785399 | ||
|
|
e152f1757c | ||
|
|
5e45a1d39a | ||
|
|
be285dcca7 | ||
|
|
4e07591402 | ||
|
|
ea2a934216 | ||
|
|
326725ae5d | ||
|
|
fc071d71a5 | ||
|
|
7e2905fd74 | ||
|
|
7141714e0b | ||
|
|
4c9b6b2c4b | ||
|
|
e7adb3dadd | ||
|
|
a26b107bd3 | ||
|
|
26cf086c2c | ||
|
|
7169e0abe0 | ||
|
|
250532912f | ||
|
|
6d32ec4c20 | ||
|
|
4c326aa381 | ||
|
|
12ba446acb | ||
|
|
f0a97b5c71 | ||
|
|
cca23e5286 | ||
|
|
af4b36c13d | ||
|
|
9c9af976ae | ||
|
|
c256107a5c | ||
|
|
2c1750c78f | ||
|
|
0d59960edf | ||
|
|
7f5a85dcea | ||
|
|
1994f539c3 | ||
|
|
80b6a1a464 | ||
|
|
326bd29be7 | ||
|
|
418d81804c | ||
|
|
cd166c904c | ||
|
|
9c113f21c0 | ||
|
|
498a9bf1f9 | ||
|
|
2232bed6d6 | ||
|
|
2cede8bf26 | ||
|
|
a4d1a762c2 | ||
|
|
ca6983f6f2 | ||
|
|
1acb4994ab | ||
|
|
b63a473177 | ||
|
|
0076acc80a | ||
|
|
e599140047 | ||
|
|
730530baba | ||
|
|
7231e548e3 | ||
|
|
97399b2494 | ||
|
|
4dc8aea827 | ||
|
|
5b449103dc | ||
|
|
b3e1525f8a | ||
|
|
f2b9098a94 | ||
|
|
630bd308da | ||
|
|
fb50a7f7b5 | ||
|
|
4c7dc5ff2d | ||
|
|
5680e6571d | ||
|
|
efa3f20107 | ||
|
|
654d14d706 | ||
|
|
f857db0e8e | ||
|
|
0f48821995 | ||
|
|
b8e14e3802 | ||
|
|
ec76fbd070 | ||
|
|
c856a8931e | ||
|
|
c54b77dd74 | ||
|
|
3715125afc | ||
|
|
549548bacf | ||
|
|
7d5a69fb31 | ||
|
|
bc8811c498 | ||
|
|
2c687a4d1d | ||
|
|
e47d494335 | ||
|
|
d2d5ffc3b6 | ||
|
|
5320364a0d | ||
|
|
27b62f923f | ||
|
|
0b4d13b85c | ||
|
|
aca8877841 | ||
|
|
fd87c6a4bb | ||
|
|
38a609f39c | ||
|
|
cd2794b2d3 | ||
|
|
f198eb8b6b | ||
|
|
22f9794cfd | ||
|
|
446d76d5f3 | ||
|
|
b17f64a406 | ||
|
|
10d25a2209 | ||
|
|
e288cc94fa | ||
|
|
9392c28ed8 | ||
|
|
22274089f5 | ||
|
|
e137127ae3 | ||
|
|
d8fdcffdf7 | ||
|
|
889df48bf0 | ||
|
|
afba02fe04 | ||
|
|
77a25a222a | ||
|
|
a8c52ddb7d | ||
|
|
22ab1b1e6c | ||
|
|
e42d35507c | ||
|
|
69a1133f21 | ||
|
|
edceb04b1f | ||
|
|
606fa23238 | ||
|
|
924a7fca6b | ||
|
|
eb2fa54e32 | ||
|
|
0e5cda3a47 | ||
|
|
731ea18a69 | ||
|
|
be98f67f6a | ||
|
|
2e67393129 | ||
|
|
97e600c877 | ||
|
|
aa386ba8fc | ||
|
|
d9e077b2fa | ||
|
|
9a08654b23 | ||
|
|
3dce3e5685 | ||
|
|
99a9e5c7c5 | ||
|
|
d438ca171b | ||
|
|
4a86cf8b00 | ||
|
|
d2444449ec | ||
|
|
0f01f464de | ||
|
|
5fe38b57ea | ||
|
|
c202c057b1 | ||
|
|
f4072f4ef7 | ||
|
|
666cf1c887 | ||
|
|
4bd7d54291 | ||
|
|
b002a51274 | ||
|
|
1e6e700682 | ||
|
|
fc7ca4202e | ||
|
|
68c30819ad | ||
|
|
fa2ae66dcd | ||
|
|
8ddd5fea3c | ||
|
|
980bcbfdbf | ||
|
|
14abfaa3d0 | ||
|
|
d296c39c60 | ||
|
|
54e3729e91 | ||
|
|
8f8f9400f5 | ||
|
|
0103777046 | ||
|
|
d20e8e7e25 | ||
|
|
3a2ad288ca | ||
|
|
6c1d8e4d62 | ||
|
|
5edd5f235f | ||
|
|
6a0b66fc79 | ||
|
|
527a481e1a | ||
|
|
1e0c16c4db | ||
|
|
a763531949 | ||
|
|
54adbbe05c | ||
|
|
9848eb222d | ||
|
|
6e89d3d433 | ||
|
|
f47fbe763a | ||
|
|
fc83e1302a | ||
|
|
2fa58f1e9f | ||
|
|
401fb4fe4f | ||
|
|
b586e6742c | ||
|
|
5bd35202c0 | ||
|
|
b804844729 | ||
|
|
a9032c6dac | ||
|
|
f8715bf730 | ||
|
|
6bce59a249 | ||
|
|
47e4246d76 | ||
|
|
8ab2c9cf62 | ||
|
|
6a1a8526f1 | ||
|
|
e266daa43e | ||
|
|
6e29f3da25 | ||
|
|
50737b35c5 | ||
|
|
449b68a777 | ||
|
|
f3056f720b | ||
|
|
998384d149 | ||
|
|
c578a1e4fa | ||
|
|
c0fc8c6aad | ||
|
|
ddd4c15594 | ||
|
|
958d0d8617 | ||
|
|
9e82ddc739 | ||
|
|
2a007ddb50 | ||
|
|
ce51daca48 | ||
|
|
5da270361f | ||
|
|
08d3728b1d | ||
|
|
d58bfaf6f3 | ||
|
|
c3948aeea7 | ||
|
|
8c16a043c1 | ||
|
|
6eaa73e23c | ||
|
|
b6f9e488f5 | ||
|
|
a514fc0bbb | ||
|
|
f00ce28128 | ||
|
|
fa618f393f | ||
|
|
ac5b43b095 | ||
|
|
a2aaaad84a | ||
|
|
39b03cdb38 | ||
|
|
d7364d1f4b | ||
|
|
303fbfc4be | ||
|
|
77bbf50dd0 | ||
|
|
9c405af577 | ||
|
|
2632f2d529 | ||
|
|
a98d79021f | ||
|
|
49b167a388 | ||
|
|
2ded4dcac5 | ||
|
|
72f5a0b42f | ||
|
|
745e45d119 | ||
|
|
f336629f65 | ||
|
|
254b4fa35f | ||
|
|
24cfa12d40 | ||
|
|
2c34ced219 | ||
|
|
c4a1ea568e | ||
|
|
1e155ca669 | ||
|
|
2a68cc554f | ||
|
|
7f9190f5db | ||
|
|
2328e4a58e | ||
|
|
d9f1c65e5b | ||
|
|
cf1d1dfbd9 | ||
|
|
026ddaafb8 | ||
|
|
c3d90415a2 | ||
|
|
f4a42dff01 | ||
|
|
0846f65993 | ||
|
|
f30e9cfd65 | ||
|
|
35cf0ba42a | ||
|
|
4a07460db0 | ||
|
|
4af90e27e5 | ||
|
|
63994a73e3 | ||
|
|
86d269ab0a | ||
|
|
912dd9a997 | ||
|
|
2cce06805f | ||
|
|
3929a73ee0 | ||
|
|
30c32418f6 | ||
|
|
802d340dad | ||
|
|
33f3ebf7ec | ||
|
|
7c18228900 | ||
|
|
108d222378 | ||
|
|
d6e3843b5a | ||
|
|
58232a8750 | ||
|
|
7fa698c624 | ||
|
|
29b9dd2e6f | ||
|
|
9d8c640e00 | ||
|
|
2a7ba6468e | ||
|
|
0ebc58865f | ||
|
|
a9fd991fe6 | ||
|
|
5570417141 | ||
|
|
dc9dbe5998 | ||
|
|
a3f11a86e9 | ||
|
|
2c19ef85ed | ||
|
|
5bf4816c29 | ||
|
|
5f9514bba4 | ||
|
|
c48019496e | ||
|
|
b77246e08b | ||
|
|
a3fdbe449b | ||
|
|
4b7066e5b3 | ||
|
|
8ff40f7d46 | ||
|
|
041d53289b | ||
|
|
a72376335b | ||
|
|
fc63e758a4 | ||
|
|
54beae13a7 | ||
|
|
c32336ef0e | ||
|
|
86052f5003 | ||
|
|
5953233f3b | ||
|
|
034fad8f6a | ||
|
|
01db149e3c | ||
|
|
1afc0833ed | ||
|
|
7c1facbfb4 | ||
|
|
d7e1a76e06 | ||
|
|
7d716898d7 | ||
|
|
3b9e37ced8 | ||
|
|
6776429ba1 | ||
|
|
631c17942e | ||
|
|
98496f3c16 | ||
|
|
1b9f0a138d | ||
|
|
889b9a832f | ||
|
|
99c687177a | ||
|
|
162b310610 | ||
|
|
a315170269 | ||
|
|
ff7ff08f29 | ||
|
|
fd4b052c0d | ||
|
|
f5a8aaadf8 | ||
|
|
329faccfd5 | ||
|
|
8d0c814716 | ||
|
|
d326c63806 | ||
|
|
3ae5ed3dfc | ||
|
|
89890a88e6 | ||
|
|
5074a34663 | ||
|
|
32a3c1d678 | ||
|
|
1d52808a73 | ||
|
|
de7ebc2ea1 | ||
|
|
e9fb22cfeb | ||
|
|
a91c7a019d | ||
|
|
676312d822 | ||
|
|
be44843404 | ||
|
|
9118bcfb5f | ||
|
|
8f533db35f | ||
|
|
077504f676 | ||
|
|
d0ff8f4a0d | ||
|
|
43b7af15a7 | ||
|
|
d1a4083e3f | ||
|
|
ac849b98ed | ||
|
|
beb5137192 | ||
|
|
4c162a421c | ||
|
|
de8a9991af | ||
|
|
0e4f559e7f | ||
|
|
fe32483d5c | ||
|
|
f3b259c158 | ||
|
|
8ed389c37a | ||
|
|
3fc1c2a172 | ||
|
|
8d6601013e | ||
|
|
f00afc4fdd | ||
|
|
5a66f39637 | ||
|
|
87baa32396 | ||
|
|
38160dc3cc | ||
|
|
9be1e807d6 | ||
|
|
b6a51d3251 | ||
|
|
332c5aadfa | ||
|
|
bf9226489d | ||
|
|
3ea27f399f | ||
|
|
5fc479ca03 | ||
|
|
8e51252be8 | ||
|
|
f67e946a67 | ||
|
|
389e7e96e5 | ||
|
|
dfdf436fb2 | ||
|
|
93246519da | ||
|
|
405b29cd1b | ||
|
|
8f7d32c7dd | ||
|
|
43550ce1fa | ||
|
|
d8127f5c3a | ||
|
|
41381425e6 | ||
|
|
a9fd02e864 | ||
|
|
18e4f3d635 | ||
|
|
5a7c86fa32 | ||
|
|
69aedf8b17 | ||
|
|
9d9fcdf383 | ||
|
|
d7e26630c0 | ||
|
|
06bbb3d47b | ||
|
|
5d4efa2510 | ||
|
|
1b8114cd71 | ||
|
|
7ff0cfd5b7 | ||
|
|
13ebaf6ca3 | ||
|
|
c44fa310d2 | ||
|
|
f3c5988996 | ||
|
|
b28beee0fc | ||
|
|
7e79827ba3 | ||
|
|
33632b0955 | ||
|
|
d085d8f0bb | ||
|
|
27fd2bbb61 | ||
|
|
9ec6e380ed | ||
|
|
8f3c64a7cd | ||
|
|
1acefe17b1 | ||
|
|
a3bdd051a3 | ||
|
|
79b3f448c0 | ||
|
|
8665d61608 | ||
|
|
cbeadca761 | ||
|
|
6802d4740c | ||
|
|
22abf1ffa4 | ||
|
|
cda283c652 | ||
|
|
16ee735e92 | ||
|
|
0d8a34fe68 | ||
|
|
b3b2c76fdc | ||
|
|
1813f87d9a | ||
|
|
1e1530a566 | ||
|
|
af55df92b4 | ||
|
|
275904f8cb | ||
|
|
d85bcdef8b | ||
|
|
b89e3d8c83 | ||
|
|
fb040138c9 | ||
|
|
56f2abbf89 | ||
|
|
2cd7aa2260 | ||
|
|
bf1382a38f | ||
|
|
6362d5ced5 | ||
|
|
2d699b3818 | ||
|
|
e9121854f9 | ||
|
|
1a5b1241db | ||
|
|
065fc14cc4 | ||
|
|
8f3937588f | ||
|
|
d068a54395 | ||
|
|
52f3af0bcf | ||
|
|
4958363608 | ||
|
|
8726aabade | ||
|
|
d14ab39047 | ||
|
|
7f35785b2f | ||
|
|
17993c4a6f | ||
|
|
c358ee8f78 | ||
|
|
152c7b4944 | ||
|
|
24a1b4e94f | ||
|
|
35c793de5f | ||
|
|
6e4833d8fd | ||
|
|
ae65a0ee04 | ||
|
|
80a7abf7e5 | ||
|
|
d9415749f8 | ||
|
|
82947d7ebf | ||
|
|
0153d6f564 | ||
|
|
e75152402a | ||
|
|
fe0c007b96 | ||
|
|
1e8a4963fc | ||
|
|
2912ca25d8 | ||
|
|
ce1a26acf5 | ||
|
|
dc6c385849 | ||
|
|
52e96157d2 | ||
|
|
1d9a058eae | ||
|
|
11aba21de9 | ||
|
|
86273355c2 | ||
|
|
632946bbe0 | ||
|
|
b765d541e6 | ||
|
|
1583d8b4ef | ||
|
|
556c0dbc24 | ||
|
|
fc77f0dda4 | ||
|
|
4396d37f6f | ||
|
|
3f40916f38 | ||
|
|
bd089b3935 | ||
|
|
5d5451c6da | ||
|
|
a6c66ef755 | ||
|
|
e3967b9754 | ||
|
|
ae9073b853 | ||
|
|
810e5a0f69 | ||
|
|
a142b502a9 | ||
|
|
1224ff3e01 | ||
|
|
a9f4dacf81 | ||
|
|
f1d0940b8e | ||
|
|
c6ad528613 | ||
|
|
3f58909d20 | ||
|
|
dec6843491 | ||
|
|
b0bd304e08 | ||
|
|
cef22b73ee | ||
|
|
bbdcf41e95 | ||
|
|
eeff0f5146 | ||
|
|
0625bbefb4 | ||
|
|
dbdb35e20e | ||
|
|
f5daf73202 | ||
|
|
b7f809ade5 | ||
|
|
fa1cc2cd3f | ||
|
|
276049980e | ||
|
|
3721613126 | ||
|
|
21ec4f64b2 | ||
|
|
136bf8d460 | ||
|
|
69a117efbe | ||
|
|
ab449cd1d2 | ||
|
|
be3995f91a | ||
|
|
e05045246f | ||
|
|
6ba55114e2 | ||
|
|
9888ccda67 | ||
|
|
3558c04970 | ||
|
|
e0e662b6cd | ||
|
|
fe381e2b84 | ||
|
|
84da3c8113 | ||
|
|
4def430d27 | ||
|
|
9367d3491b | ||
|
|
a4cdc92947 | ||
|
|
0f58a5ca73 | ||
|
|
75b8ba1fa3 | ||
|
|
62c64586b6 | ||
|
|
810eeec19d | ||
|
|
737c82426b | ||
|
|
a3853cafd1 | ||
|
|
bcd1623533 | ||
|
|
73788579a1 | ||
|
|
44952e7c43 | ||
|
|
15b8ba49c1 | ||
|
|
cd1e068061 | ||
|
|
ba1938b59e | ||
|
|
4864626e88 | ||
|
|
7e70c52009 | ||
|
|
dc2e004dcb | ||
|
|
91661a7da0 | ||
|
|
25dac72093 | ||
|
|
9884b5887e | ||
|
|
91407fd3d6 | ||
|
|
658e03b4d7 | ||
|
|
121c6e30ab | ||
|
|
9f89b782ef | ||
|
|
2298ba7ed7 | ||
|
|
8265ea67d6 | ||
|
|
800ce1bfa2 | ||
|
|
dae5abca60 | ||
|
|
cd2d12e256 | ||
|
|
dc465cd88f | ||
|
|
bedeed1c1b | ||
|
|
f61c3bdb28 |
@@ -1,20 +1,3 @@
|
||||
compat/zlib/win32/zdll.lib
|
||||
compat/zlib/win32/zlib1.dll
|
||||
compat/zlib/win64/zdll.lib
|
||||
compat/zlib/win64/zlib1.dll
|
||||
compat/zlib/win64/libz.dll.a
|
||||
compat/zlib/zlib.3.pdf
|
||||
compat/zlib/win32/zdll.lib
|
||||
compat/zlib/win32/zlib1.dll
|
||||
compat/zlib/win64/zdll.lib
|
||||
compat/zlib/win64/zlib1.dll
|
||||
compat/zlib/win64/libz.dll.a
|
||||
compat/zlib/zlib.3.pdf
|
||||
libtommath/win32/tommath.lib
|
||||
libtommath/win32/libtommath.dll
|
||||
libtommath/win64/tommath.lib
|
||||
libtommath/win64/libtommath.dll
|
||||
libtommath/win64/libtommath.dll.a
|
||||
*.a
|
||||
*.bmp
|
||||
*.dll
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.a binary
|
||||
*.bmp binary
|
||||
*.dll binary
|
||||
*.exe binary
|
||||
*.gif binary
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
name: Linux Build and Test
|
||||
on: [push]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Configure
|
||||
working-directory: unix
|
||||
run: |
|
||||
mkdir "${HOME}/install dir"
|
||||
./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
|
||||
- name: Build
|
||||
working-directory: unix
|
||||
run: |
|
||||
make all
|
||||
- name: Build Test Harness
|
||||
working-directory: unix
|
||||
run: |
|
||||
make tcltest
|
||||
- name: Run Tests
|
||||
working-directory: unix
|
||||
run: |
|
||||
make test
|
||||
- name: Test-Drive Installation
|
||||
working-directory: unix
|
||||
run: |
|
||||
make install
|
||||
- name: Create Distribution Package
|
||||
working-directory: unix
|
||||
run: |
|
||||
make dist
|
||||
- name: Convert Documentation to HTML
|
||||
working-directory: unix
|
||||
run: |
|
||||
make html-tcl
|
||||
@@ -0,0 +1,37 @@
|
||||
name: Linux Build and Test
|
||||
on: [push]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Configure
|
||||
working-directory: unix
|
||||
run: |
|
||||
mkdir "${HOME}/install dir"
|
||||
./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
|
||||
- name: Build
|
||||
working-directory: unix
|
||||
run: |
|
||||
make all
|
||||
- name: Build Test Harness
|
||||
working-directory: unix
|
||||
run: |
|
||||
make tcltest
|
||||
- name: Run Tests
|
||||
working-directory: unix
|
||||
run: |
|
||||
make test
|
||||
- name: Test-Drive Installation
|
||||
working-directory: unix
|
||||
run: |
|
||||
make install
|
||||
- name: Create Distribution Package
|
||||
working-directory: unix
|
||||
run: |
|
||||
make dist
|
||||
- name: Convert Documentation to HTML
|
||||
working-directory: unix
|
||||
run: |
|
||||
make html-tcl
|
||||
@@ -0,0 +1,22 @@
|
||||
name: Windows Build and Test
|
||||
on: [push]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Init MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
- name: Build
|
||||
working-directory: win
|
||||
run: |
|
||||
nmake -f makefile.vc all
|
||||
- name: Build Test Harness
|
||||
working-directory: win
|
||||
run: |
|
||||
nmake -f makefile.vc tcltest
|
||||
- name: Run Tests
|
||||
working-directory: win
|
||||
run: |
|
||||
nmake -f makefile.vc test
|
||||
@@ -5,7 +5,22 @@
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
||||
+44
-34
@@ -1,6 +1,8 @@
|
||||
language: c
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- binutils-mingw-w64-i686
|
||||
- binutils-mingw-w64-x86-64
|
||||
@@ -11,7 +13,7 @@ addons:
|
||||
- gcc-multilib
|
||||
jobs:
|
||||
include:
|
||||
# Testing on Linux with various compilers
|
||||
# Testing on Linux GCC
|
||||
- name: "Linux/GCC/Shared"
|
||||
os: linux
|
||||
dist: focal
|
||||
@@ -61,29 +63,15 @@ jobs:
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="CC=g++ CFLAGS=-Dregister=dont+use+register"
|
||||
# Older versions of GCC...
|
||||
- name: "Linux/GCC 7/Shared"
|
||||
# Newer/Older versions of GCC
|
||||
- name: "Linux/GCC 10/Shared"
|
||||
os: linux
|
||||
dist: focal
|
||||
compiler: gcc-7
|
||||
compiler: gcc-10
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-7
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC 6/Shared"
|
||||
os: linux
|
||||
dist: bionic
|
||||
compiler: gcc-6
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-6
|
||||
- g++-10
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC 5/Shared"
|
||||
@@ -92,13 +80,11 @@ jobs:
|
||||
compiler: gcc-5
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-5
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
# Clang
|
||||
# Testing on Linux Clang
|
||||
- name: "Linux/Clang/Shared"
|
||||
os: linux
|
||||
dist: focal
|
||||
@@ -134,9 +120,9 @@ jobs:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="--enable-symbols=mem"
|
||||
# Testing on Mac, various styles
|
||||
- name: "macOS/Clang/Xcode 11.5/Shared"
|
||||
- name: "macOS/Clang/Xcode 12/Shared"
|
||||
os: osx
|
||||
osx_image: xcode11.5
|
||||
osx_image: xcode12.2
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
@@ -144,14 +130,15 @@ jobs:
|
||||
- make all
|
||||
# The styles=develop avoids some weird problems on OSX
|
||||
- make test styles=develop
|
||||
- name: "macOS/Clang/Xcode 11.5/Shared/Unix-like"
|
||||
- name: "macOS/Clang/Xcode 12/Shared/Unix-like"
|
||||
os: osx
|
||||
osx_image: xcode11.5
|
||||
osx_image: xcode12.2
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "macOS/Clang/Xcode 11.5/Shared/libtommath"
|
||||
- CFGOPT="--enable-dtrace"
|
||||
- name: "macOS/Clang/Xcode 12/Shared/libtommath"
|
||||
os: osx
|
||||
osx_image: xcode11.5
|
||||
osx_image: xcode12.2
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
@@ -160,18 +147,26 @@ jobs:
|
||||
homebrew:
|
||||
packages:
|
||||
- libtommath
|
||||
- name: "macOS/Clang++/Xcode 11.5/Shared"
|
||||
- name: "macOS/Clang++/Xcode 12/Shared"
|
||||
os: osx
|
||||
osx_image: xcode11.5
|
||||
osx_image: xcode12.2
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="CC=clang++ --enable-framework CFLAGS=-Dregister=dont+use+register CPPFLAGS=-D__private_extern__=extern"
|
||||
- CFGOPT="CC=clang++ --enable-framework --enable-dtrace CFLAGS=-Dregister=dont+use+register CPPFLAGS=-D__private_extern__=extern"
|
||||
script:
|
||||
- make all tcltest
|
||||
# Newer MacOS versions
|
||||
- name: "macOS/Clang/Xcode 12/Universal Apps/Shared"
|
||||
os: osx
|
||||
osx_image: xcode12u
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
# Older MacOS versions
|
||||
- name: "macOS/Clang/Xcode 11/Shared"
|
||||
os: osx
|
||||
osx_image: xcode11
|
||||
osx_image: xcode11.7
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
@@ -185,7 +180,7 @@ jobs:
|
||||
script: *mactest
|
||||
- name: "macOS/Clang/Xcode 9/Shared"
|
||||
os: osx
|
||||
osx_image: xcode9.2
|
||||
osx_image: xcode9.4
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
@@ -229,6 +224,8 @@ jobs:
|
||||
- BUILD_DIR=win
|
||||
- VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build"
|
||||
before_install: &vcpreinst
|
||||
- rm -rf tests/safe-stock8*.test
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
|
||||
- PATH="$PATH:$VCDIR"
|
||||
- cd ${BUILD_DIR}
|
||||
install: []
|
||||
@@ -262,6 +259,15 @@ jobs:
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/StaticPackage"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/Debug"
|
||||
os: windows
|
||||
compiler: cl
|
||||
@@ -343,6 +349,8 @@ jobs:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit"
|
||||
before_install: &makepreinst
|
||||
- rm -rf tests/safe-stock8*.test
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
|
||||
- choco install -y make zip
|
||||
- cd ${BUILD_DIR}
|
||||
- name: "Windows/GCC/Shared: UTF_MAX=4"
|
||||
@@ -450,6 +458,8 @@ jobs:
|
||||
script:
|
||||
- make dist
|
||||
before_install:
|
||||
- rm -rf tests/safe-stock8*.test
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
|
||||
- cd ${BUILD_DIR}
|
||||
install:
|
||||
- mkdir "$HOME/install dir"
|
||||
@@ -457,6 +467,6 @@ install:
|
||||
before_script:
|
||||
- export ERROR_ON_FAILURES=1
|
||||
script:
|
||||
- make all tcltest
|
||||
- make all tcltest || echo "Something wrong, maybe a hickup, let's try again"
|
||||
- make test
|
||||
- make install
|
||||
|
||||
+2
-2
@@ -351,7 +351,7 @@
|
||||
|
||||
* mac/tclMacFile.c: fixed bug in permission checking code
|
||||
|
||||
* mac/tclMacLoad.c: corrected utf8 handling, comparison of package
|
||||
* mac/tclMacLoad.c: corrected utf-8 handling, comparison of package
|
||||
names to code fragment names changed to only match on the length of
|
||||
package name, this allows for fragment names with version numbers
|
||||
appended.
|
||||
@@ -3525,7 +3525,7 @@
|
||||
* generic/tclVar.c (Tcl_UnsetObjCmd): Rewrote argument parser to avoid
|
||||
a read off the end of the argument array that could occur when
|
||||
executing something like [unset -nocomplain] was executed. Improved
|
||||
the error message given when too few arguments are given (-nocomplain
|
||||
the error message given when not enough arguments are given (-nocomplain
|
||||
should obviously be *before* --, not after it) and also modified the
|
||||
test suite to take account of that and the documentation to use the
|
||||
same improvement. [Bug 405769]
|
||||
|
||||
+1
-1
@@ -1753,7 +1753,7 @@
|
||||
|
||||
2002-07-05 Reinhard Max <max@suse.de>
|
||||
|
||||
* generic/tclClock.c (FormatClock): Convert the format string to UTF8
|
||||
* generic/tclClock.c (FormatClock): Convert the format string to utf-8
|
||||
before calling TclpStrftime, so that non-ASCII characters don't get
|
||||
mangled when the result string is being converted back.
|
||||
* tests/clock.test: Added a test for that.
|
||||
|
||||
+2
-2
@@ -2302,7 +2302,7 @@
|
||||
934511].
|
||||
|
||||
* doc/CrtCommand.3: Added note that the arguments given to the command
|
||||
proc of a Tcl_CreateCommand are in utf8 since Tcl 8.1. Closing [Patch
|
||||
proc of a Tcl_CreateCommand are in utf-8 since Tcl 8.1. Closing [Patch
|
||||
414778].
|
||||
|
||||
* doc/ChnlStack.3: Removed the declaration that the interp argument to
|
||||
@@ -2873,7 +2873,7 @@
|
||||
2004-06-02 Jeff Hobbs <jeffh@ActiveState.com>
|
||||
|
||||
* win/tclWinFile.c (TclpFindExecutable): when using GetModuleFileNameA
|
||||
(Win9x), convert from CP_ACP to WCHAR then convert back to utf8.
|
||||
(Win9x), convert from CP_ACP to WCHAR then convert back to utf-8.
|
||||
Adjunct to 2004-04-07 fix.
|
||||
|
||||
2004-06-02 David Gravereaux <davygrvy@pobox.com>
|
||||
|
||||
@@ -5,7 +5,17 @@ This is the **Tcl 8.7a4** source distribution.
|
||||
You can get any source release of Tcl from [our distribution
|
||||
site](https://sourceforge.net/projects/tcl/files/Tcl/).
|
||||
|
||||
[](https://travis-ci.org/tcltk/tcl)
|
||||
8.6.10
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-6-branch)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-6-branch)
|
||||
<br>
|
||||
8.7a4
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-branch)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-branch)
|
||||
<br>
|
||||
9.0a2
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Amain)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Amain)
|
||||
|
||||
## Contents
|
||||
1. [Introduction](#intro)
|
||||
|
||||
+2
-6
@@ -21,19 +21,15 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
extern void * memchr(const void *s, int c, size_t n);
|
||||
#else
|
||||
extern char * memchr(const void *s, int c, size_t n);
|
||||
#endif
|
||||
extern int memcmp(const void *s1, const void *s2, size_t n);
|
||||
extern char * memcpy(void *t, const void *f, size_t n);
|
||||
extern void * memcpy(void *t, const void *f, size_t n);
|
||||
#ifdef NO_MEMMOVE
|
||||
#define memmove(d,s,n) (bcopy((s), (d), (n)))
|
||||
#else
|
||||
extern char * memmove(void *t, const void *f, size_t n);
|
||||
#endif
|
||||
extern char * memset(void *s, int c, size_t n);
|
||||
extern void * memset(void *s, int c, size_t n);
|
||||
|
||||
extern int strcasecmp(const char *s1, const char *s2);
|
||||
extern char * strcat(char *dst, const char *src);
|
||||
|
||||
+47
-32
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateSlave, Tcl_GetSlave, Tcl_GetMaster, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands
|
||||
Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateChild, Tcl_CreateSlave, Tcl_GetChild, Tcl_GetSlave, Tcl_GetParent, Tcl_GetMaster, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -20,31 +20,40 @@ int
|
||||
\fBTcl_MakeSafe\fR(\fIinterp\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_CreateChild\fR(\fIinterp, name, isSafe\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_CreateSlave\fR(\fIinterp, name, isSafe\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetSlave\fR(\fIinterp, name\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetChild\fR(\fIinterp, name\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetMaster\fR(\fIinterp\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetInterpPath\fR(\fIinterp, slaveInterp\fR)
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetParent\fR(\fIinterp\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_CreateAlias\fR(\fIslaveInterp, slaveCmd, targetInterp, targetCmd,
|
||||
\fBTcl_GetInterpPath\fR(\fIinterp, childInterp\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_CreateAlias\fR(\fIchildInterp, childCmd, targetInterp, targetCmd,
|
||||
argc, argv\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_CreateAliasObj\fR(\fIslaveInterp, slaveCmd, targetInterp, targetCmd,
|
||||
\fBTcl_CreateAliasObj\fR(\fIchildInterp, childCmd, targetInterp, targetCmd,
|
||||
objc, objv\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetAlias\fR(\fIinterp, slaveCmd, targetInterpPtr, targetCmdPtr,
|
||||
\fBTcl_GetAlias\fR(\fIinterp, childCmd, targetInterpPtr, targetCmdPtr,
|
||||
argcPtr, argvPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetAliasObj\fR(\fIinterp, slaveCmd, targetInterpPtr, targetCmdPtr,
|
||||
\fBTcl_GetAliasObj\fR(\fIinterp, childCmd, targetInterpPtr, targetCmdPtr,
|
||||
objcPtr, objvPtr\fR)
|
||||
.sp
|
||||
int
|
||||
@@ -57,16 +66,16 @@ int
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which to execute the specified command.
|
||||
.AP "const char" *name in
|
||||
Name of slave interpreter to create or manipulate.
|
||||
Name of child interpreter to create or manipulate.
|
||||
.AP int isSafe in
|
||||
If non-zero, a
|
||||
.QW safe
|
||||
slave that is suitable for running untrusted code
|
||||
is created, otherwise a trusted slave is created.
|
||||
.AP Tcl_Interp *slaveInterp in
|
||||
child that is suitable for running untrusted code
|
||||
is created, otherwise a trusted child is created.
|
||||
.AP Tcl_Interp *childInterp in
|
||||
Interpreter to use for creating the source command for an alias (see
|
||||
below).
|
||||
.AP "const char" *slaveCmd in
|
||||
.AP "const char" *childCmd in
|
||||
Name of source command for alias.
|
||||
.AP Tcl_Interp *targetInterp in
|
||||
Interpreter that contains the target command for an alias.
|
||||
@@ -121,17 +130,19 @@ interpreter. The return value for those procedures that return an \fBint\fR
|
||||
is either \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fBTCL_ERROR\fR is returned
|
||||
then the interpreter's result contains an error message.
|
||||
.PP
|
||||
\fBTcl_CreateSlave\fR creates a new interpreter as a slave of \fIinterp\fR.
|
||||
It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which
|
||||
allows \fIinterp\fR to manipulate the new slave.
|
||||
If \fIisSafe\fR is zero, the command creates a trusted slave in which Tcl
|
||||
\fBTcl_CreateChild\fR creates a new interpreter as a child of \fIinterp\fR.
|
||||
It also creates a child command named \fIname\fR in \fIinterp\fR which
|
||||
allows \fIinterp\fR to manipulate the new child.
|
||||
If \fIisSafe\fR is zero, the command creates a trusted child in which Tcl
|
||||
code has access to all the Tcl commands.
|
||||
If it is \fB1\fR, the command creates a
|
||||
.QW safe
|
||||
slave in which Tcl code has access only to set of Tcl commands defined as
|
||||
child in which Tcl code has access only to set of Tcl commands defined as
|
||||
.QW "Safe Tcl" ;
|
||||
see the manual entry for the Tcl \fBinterp\fR command for details.
|
||||
If the creation of the new slave interpreter failed, \fBNULL\fR is returned.
|
||||
If the creation of the new child interpreter failed, \fBNULL\fR is returned.
|
||||
.PP
|
||||
\fBTcl_CreateSlave\fR is a synonym for \fBTcl_CreateChild\fR.
|
||||
.PP
|
||||
\fBTcl_IsSafe\fR returns \fB1\fR if \fIinterp\fR is
|
||||
.QW safe
|
||||
@@ -147,34 +158,38 @@ from \fIinterp\fR. However, it cannot know what parts of an extension
|
||||
or application are safe and does not make any attempt to remove those
|
||||
parts, so safety is not guaranteed after calling \fBTcl_MakeSafe\fR.
|
||||
Callers will want to take care with their use of \fBTcl_MakeSafe\fR
|
||||
to avoid false claims of safety. For many situations, \fBTcl_CreateSlave\fR
|
||||
to avoid false claims of safety. For many situations, \fBTcl_CreateChild\fR
|
||||
may be a better choice, since it creates interpreters in a known-safe state.
|
||||
.PP
|
||||
\fBTcl_GetSlave\fR returns a pointer to a slave interpreter of
|
||||
\fIinterp\fR. The slave interpreter is identified by \fIslaveName\fR.
|
||||
If no such slave interpreter exists, \fBNULL\fR is returned.
|
||||
\fBTcl_GetChild\fR returns a pointer to a child interpreter of
|
||||
\fIinterp\fR. The child interpreter is identified by \fIname\fR.
|
||||
If no such child interpreter exists, \fBNULL\fR is returned.
|
||||
.PP
|
||||
\fBTcl_GetMaster\fR returns a pointer to the master interpreter of
|
||||
\fIinterp\fR. If \fIinterp\fR has no master (it is a
|
||||
\fBTcl_GetSlave\fR is a synonym for \fBTcl_GetChild\fR.
|
||||
.PP
|
||||
\fBTcl_GetParent\fR returns a pointer to the parent interpreter of
|
||||
\fIinterp\fR. If \fIinterp\fR has no parent (it is a
|
||||
top-level interpreter) then \fBNULL\fR is returned.
|
||||
.PP
|
||||
\fBTcl_GetMaster\fR is a synonym for \fBTcl_GetParent\fR.
|
||||
.PP
|
||||
\fBTcl_GetInterpPath\fR stores in the result of \fIinterp\fR
|
||||
the relative path between \fIinterp\fR and \fIslaveInterp\fR;
|
||||
\fIslaveInterp\fR must be a slave of \fIinterp\fR. If the computation
|
||||
the relative path between \fIinterp\fR and \fIchildInterp\fR;
|
||||
\fIchildInterp\fR must be a child of \fIinterp\fR. If the computation
|
||||
of the relative path succeeds, \fBTCL_OK\fR is returned, else
|
||||
\fBTCL_ERROR\fR is returned and an error message is stored as the
|
||||
result of \fIinterp\fR.
|
||||
.PP
|
||||
\fBTcl_CreateAlias\fR creates a command named \fIslaveCmd\fR in
|
||||
\fIslaveInterp\fR that when invoked, will cause the command \fItargetCmd\fR
|
||||
\fBTcl_CreateAlias\fR creates a command named \fIchildCmd\fR in
|
||||
\fIchildInterp\fR that when invoked, will cause the command \fItargetCmd\fR
|
||||
to be invoked in \fItargetInterp\fR. The arguments specified by the strings
|
||||
contained in \fIargv\fR are always prepended to any arguments supplied in the
|
||||
invocation of \fIslaveCmd\fR and passed to \fItargetCmd\fR.
|
||||
invocation of \fIchildCmd\fR and passed to \fItargetCmd\fR.
|
||||
This operation returns \fBTCL_OK\fR if it succeeds, or \fBTCL_ERROR\fR if
|
||||
it fails; in that case, an error message is left in the value result
|
||||
of \fIslaveInterp\fR.
|
||||
of \fIchildInterp\fR.
|
||||
Note that there are no restrictions on the ancestry relationship (as
|
||||
created by \fBTcl_CreateSlave\fR) between \fIslaveInterp\fR and
|
||||
created by \fBTcl_CreateChild\fR) between \fIchildInterp\fR and
|
||||
\fItargetInterp\fR. Any two interpreters can be used, without any
|
||||
restrictions on how they are related.
|
||||
.PP
|
||||
@@ -233,4 +248,4 @@ interp
|
||||
|
||||
.SH KEYWORDS
|
||||
alias, command, exposed commands, hidden commands, interpreter, invoke,
|
||||
master, slave
|
||||
parent, child
|
||||
|
||||
+4
-4
@@ -414,7 +414,7 @@ caller (with a reference count of 0).
|
||||
the encoding identified by \fIencodingName\fR and evaluates
|
||||
its contents as a Tcl script. It returns the same information as
|
||||
\fBTcl_EvalObjEx\fR.
|
||||
If \fIencodingName\fR is NULL, the system encoding is used for
|
||||
If \fIencodingName\fR is NULL, the utf-8 encoding is used for
|
||||
reading the file contents.
|
||||
If the file could not be read then a Tcl error is returned to describe
|
||||
why the file could not be read.
|
||||
@@ -430,7 +430,7 @@ or
|
||||
which will be safely substituted by the Tcl interpreter into
|
||||
.QW ^Z .
|
||||
\fBTcl_FSEvalFile\fR is a simpler version of
|
||||
\fBTcl_FSEvalFileEx\fR that always uses the system encoding
|
||||
\fBTcl_FSEvalFileEx\fR that always uses the utf-8 encoding
|
||||
when reading the file.
|
||||
.PP
|
||||
\fBTcl_FSLoadFile\fR dynamically loads a binary code file into memory and
|
||||
@@ -1340,11 +1340,11 @@ is considered to be owned by the filesystem (not by Tcl's core), but
|
||||
should be given a reference count for Tcl. Tcl will use the contents of the
|
||||
list and then decrement that reference count. This allows filesystems to
|
||||
choose whether they actually want to retain a
|
||||
.QW "master list"
|
||||
.QW "global list"
|
||||
of volumes
|
||||
or not (if not, they generate the list on the fly and pass it to Tcl
|
||||
with a reference count of 1 and then forget about the list, if yes, then
|
||||
they simply increment the reference count of their master list and pass it
|
||||
they simply increment the reference count of their global list and pass it
|
||||
to Tcl which will copy the contents and then decrement the count back
|
||||
to where it was).
|
||||
.PP
|
||||
|
||||
+13
-6
@@ -27,19 +27,22 @@ Interpreter to use for error reporting; if NULL, then no message is
|
||||
provided on errors.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
The string value of this value is used to search through \fItablePtr\fR.
|
||||
The internal representation is modified to hold the index of the matching
|
||||
If the \fBTCL_INDEX_TEMP_TABLE\fR flag is not specified,
|
||||
the internal representation is modified to hold the index of the matching
|
||||
table entry.
|
||||
.AP "const char *const" *tablePtr in
|
||||
An array of null-terminated strings. The end of the array is marked
|
||||
by a NULL string pointer.
|
||||
Note that references to the \fItablePtr\fR may be retained in the
|
||||
Note that, unless the \fBTCL_INDEX_TEMP_TABLE\fR flag is specified,
|
||||
references to the \fItablePtr\fR may be retained in the
|
||||
internal representation of \fIobjPtr\fR, so this should represent the
|
||||
address of a statically-allocated array.
|
||||
.AP "const void" *structTablePtr in
|
||||
An array of arbitrary type, typically some \fBstruct\fR type.
|
||||
The first member of the structure must be a null-terminated string.
|
||||
The size of the structure is given by \fIoffset\fR.
|
||||
Note that references to the \fIstructTablePtr\fR may be retained in the
|
||||
Note that, unless the \fBTCL_INDEX_TEMP_TABLE\fR flag is specified,
|
||||
references to the \fIstructTablePtr\fR may be retained in the
|
||||
internal representation of \fIobjPtr\fR, so this should represent the
|
||||
address of a statically-allocated array of structures.
|
||||
.AP int offset in
|
||||
@@ -50,7 +53,8 @@ Null-terminated string describing what is being looked up, such as
|
||||
\fBoption\fR. This string is included in error messages.
|
||||
.AP int flags in
|
||||
OR-ed combination of bits providing additional information for
|
||||
operation. The only bit that is currently defined is \fBTCL_EXACT\fR.
|
||||
operation. The only bits that are currently defined are \fBTCL_EXACT\fR
|
||||
and \fBTCL_INDEX_TEMP_TABLE\fR.
|
||||
.AP int *indexPtr out
|
||||
The index of the string in \fItablePtr\fR that matches the value of
|
||||
\fIobjPtr\fR is returned here.
|
||||
@@ -76,7 +80,8 @@ error message to indicate what was being looked up. For example,
|
||||
if \fImsg\fR is \fBoption\fR the error message will have a form like
|
||||
.QW "\fBbad option \N'34'firt\N'34': must be first, second, or third\fR" .
|
||||
.PP
|
||||
If \fBTcl_GetIndexFromObj\fR completes successfully it modifies the
|
||||
If the \fBTCL_INDEX_TEMP_TABLE\fR was not specified, when
|
||||
\fBTcl_GetIndexFromObj\fR completes successfully it modifies the
|
||||
internal representation of \fIobjPtr\fR to hold the address of
|
||||
the table and the index of the matching entry. If \fBTcl_GetIndexFromObj\fR
|
||||
is invoked again with the same \fIobjPtr\fR and \fItablePtr\fR
|
||||
@@ -84,7 +89,9 @@ arguments (e.g. during a reinvocation of a Tcl command), it returns
|
||||
the matching index immediately without having to redo the lookup
|
||||
operation. Note: \fBTcl_GetIndexFromObj\fR assumes that the entries
|
||||
in \fItablePtr\fR are static: they must not change between
|
||||
invocations. If the value of \fIobjPtr\fR is the empty string,
|
||||
invocations. This caching mechanism can be disallowed by specifying
|
||||
the \fBTCL_INDEX_TEMP_TABLE\fR flag.
|
||||
If the value of \fIobjPtr\fR is the empty string,
|
||||
\fBTcl_GetIndexFromObj\fR will treat it as a non-matching value
|
||||
and return \fBTCL_ERROR\fR.
|
||||
.PP
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ execution of the callbacks is unspecified) execution in the limited
|
||||
interpreter is stopped by raising an error and setting a flag that
|
||||
prevents the \fBcatch\fR command in that interpreter from trapping
|
||||
that error. It is up to the context that started execution in that
|
||||
interpreter (typically a master interpreter) to handle the error.
|
||||
interpreter (typically the main interpreter) to handle the error.
|
||||
.SH "LIMIT CHECKING API"
|
||||
.PP
|
||||
To check the resource limits for an interpreter, call
|
||||
|
||||
+6
-6
@@ -79,7 +79,7 @@ against the standard Tcl library. Extensions (stub-enabled or
|
||||
not) are not intended to call \fBTcl_Main\fR.
|
||||
.PP
|
||||
\fBTcl_Main\fR is not thread-safe. It should only be called by
|
||||
a single master thread of a multi-threaded application. This
|
||||
a single main thread of a multi-threaded application. This
|
||||
restriction is not a problem with normal use described above.
|
||||
.PP
|
||||
\fBTcl_Main\fR and therefore all applications based upon it, like
|
||||
@@ -112,7 +112,7 @@ The file name and encoding values managed by the routines
|
||||
\fBTcl_SetStartupScript\fR and \fBTcl_GetStartupScript\fR
|
||||
are stored per-thread. Although the storage and retrieval
|
||||
functions of these routines work in any thread, only those
|
||||
calls in the same master thread as \fBTcl_Main\fR can have
|
||||
calls in the same main thread as \fBTcl_Main\fR can have
|
||||
any influence on it.
|
||||
.PP
|
||||
The caller of \fBTcl_Main\fR may call \fBTcl_SetStartupScript\fR
|
||||
@@ -126,7 +126,7 @@ a \fIstartup script\fR, and \fIname\fR is taken to be the name
|
||||
of the encoding of the contents of that file. \fBTcl_Main\fR
|
||||
then calls \fBTcl_SetStartupScript\fR with these values.
|
||||
.PP
|
||||
\fBTcl_Main\fR then defines in its master interpreter
|
||||
\fBTcl_Main\fR then defines in its main interpreter
|
||||
the Tcl variables \fIargc\fR, \fIargv\fR, \fIargv0\fR, and
|
||||
\fItcl_interactive\fR, as described in the documentation for \fBtclsh\fR.
|
||||
.PP
|
||||
@@ -154,9 +154,9 @@ When the \fIappInitProc\fR is finished, \fBTcl_Main\fR calls
|
||||
been requested, if any. If a startup script has been provided,
|
||||
\fBTcl_Main\fR attempts to evaluate it. Otherwise, interactive
|
||||
mode begins with examination of the variable \fItcl_rcFileName\fR
|
||||
in the master interpreter. If that variable exists and holds the
|
||||
in the main interpreter. If that variable exists and holds the
|
||||
name of a readable file, the contents of that file are evaluated
|
||||
in the master interpreter. Then interactive operations begin,
|
||||
in the main interpreter. Then interactive operations begin,
|
||||
with prompts and command evaluation results written to the standard
|
||||
output channel, and commands read from the standard input channel
|
||||
and then evaluated. The prompts written to the standard output
|
||||
@@ -164,7 +164,7 @@ channel may be customized by defining the Tcl variables \fItcl_prompt1\fR
|
||||
and \fItcl_prompt2\fR as described in the documentation for \fBtclsh\fR.
|
||||
The prompts and command evaluation results are written to the standard
|
||||
output channel only if the Tcl variable \fItcl_interactive\fR in the
|
||||
master interpreter holds a non-zero integer value.
|
||||
main interpreter holds a non-zero integer value.
|
||||
.PP
|
||||
\fBTcl_SetMainLoop\fR allows setting an event loop procedure to be run.
|
||||
This allows, for example, Tk to be dynamically loaded and set its event
|
||||
|
||||
+1
-1
@@ -772,7 +772,7 @@ set offset 0
|
||||
\fI# Search for string "FOOBAR" in the file\fR
|
||||
while {[\fBchan gets\fR $f line] >= 0} {
|
||||
set idx [string first FOOBAR $line]
|
||||
if {$idx > -1} {
|
||||
if {$idx >= 0} {
|
||||
\fI# Found it; rewrite line\fR
|
||||
|
||||
\fBchan seek\fR $f [expr {$offset + $idx}]
|
||||
|
||||
+13
-4
@@ -41,6 +41,12 @@ When an expression evaluates to an integer, the value is the decimal form of
|
||||
the integer, and when an expression evaluates to a floating-point number, the
|
||||
value is the form produced by the \fB%g\fR format specifier of Tcl's
|
||||
\fBformat\fR command.
|
||||
.PP
|
||||
.VS "TIP 582"
|
||||
You can use \fB#\fR at any point in the expression (except inside double
|
||||
quotes or braces) to start a comment. Comments last to the end of the line or
|
||||
the end of the expression, whichever comes first.
|
||||
.VE "TIP 582"
|
||||
.SS OPERANDS
|
||||
.PP
|
||||
An expression consists of a combination of operands, operators, parentheses and
|
||||
@@ -82,9 +88,9 @@ produces the value on the right side.
|
||||
.PP
|
||||
.CS
|
||||
.ta 9c
|
||||
\fBexpr\fR 3.1 + $a \fI6.1\fR
|
||||
\fBexpr\fR 2 + "$a.$b" \fI5.6\fR
|
||||
\fBexpr\fR 4*[llength "6 2"] \fI8\fR
|
||||
\fBexpr\fR {3.1 + $a} \fI6.1\fR
|
||||
\fBexpr\fR {2 + "$a.$b"} \fI5.6\fR
|
||||
\fBexpr\fR {4*[llength "6 2"]} \fI8\fR
|
||||
\fBexpr\fR {{word one} < "word $a"} \fI0\fR
|
||||
.CE
|
||||
.PP
|
||||
@@ -270,7 +276,7 @@ which means that operands are not evaluated if they are
|
||||
not needed to determine the outcome. For example, in
|
||||
.PP
|
||||
.CS
|
||||
\fBexpr\fR {$v ? [a] : [b]}
|
||||
\fBexpr\fR {$v?[a]:[b]}
|
||||
.CE
|
||||
.PP
|
||||
only one of \fB[a]\fR or \fB[b]\fR is evaluated,
|
||||
@@ -487,7 +493,9 @@ value of true:
|
||||
.PP
|
||||
.CS
|
||||
set isTrue [\fBexpr\fR {
|
||||
# Does the environment variable exist, and...
|
||||
[info exists ::env(SOME_ENV_VAR)] &&
|
||||
# ...does it contain a proper true value?
|
||||
[string is true -strict $::env(SOME_ENV_VAR)]
|
||||
}]
|
||||
.CE
|
||||
@@ -510,4 +518,5 @@ Copyright \(co 2005 by Kevin B. Kenny <kennykb@acm.org>. All rights reserved.
|
||||
.fi
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" fill-column: 78
|
||||
'\" End:
|
||||
|
||||
@@ -259,6 +259,10 @@ proc httpHandlerCallback {socket token} {
|
||||
return $nbytes
|
||||
}
|
||||
.CE
|
||||
.PP
|
||||
The \fBhttp::geturl\fR code for the \fB-handler\fR option is not compatible with either compression or chunked transfer-encoding. If \fB-handler\fR is specified, then to work around these issues \fBhttp::geturl\fR will reduce the HTTP protocol to 1.0, and override the \fB-zip\fR option (i.e. it will not send the header "\fBAccept-Encoding: gzip,deflate,compress\fR").
|
||||
.PP
|
||||
If options \fB-handler\fR and \fB-channel\fR are used together, the handler is responsible for copying the data from the HTTP socket to the specified channel. The name of the channel is available to the handler as element \fB-channel\fR of the token array.
|
||||
.RE
|
||||
.TP
|
||||
\fB\-headers\fR \fIkeyvaluelist\fR
|
||||
|
||||
+126
-122
@@ -19,18 +19,18 @@ interp \- Create and manipulate Tcl interpreters
|
||||
.PP
|
||||
This command makes it possible to create one or more new Tcl
|
||||
interpreters that co-exist with the creating interpreter in the
|
||||
same application. The creating interpreter is called the \fImaster\fR
|
||||
and the new interpreter is called a \fIslave\fR.
|
||||
A master can create any number of slaves, and each slave can
|
||||
itself create additional slaves for which it is master, resulting
|
||||
same application. The creating interpreter is called the \fIparent\fR
|
||||
and the new interpreter is called a \fIchild\fR.
|
||||
A parent can create any number of children, and each child can
|
||||
itself create additional children for which it is parent, resulting
|
||||
in a hierarchy of interpreters.
|
||||
.PP
|
||||
Each interpreter is independent from the others: it has its own name
|
||||
space for commands, procedures, and global variables.
|
||||
A master interpreter may create connections between its slaves and
|
||||
A parent interpreter may create connections between its children and
|
||||
itself using a mechanism called an \fIalias\fR. An \fIalias\fR is
|
||||
a command in a slave interpreter which, when invoked, causes a
|
||||
command to be invoked in its master interpreter or in another slave
|
||||
a command in a child interpreter which, when invoked, causes a
|
||||
command to be invoked in its parent interpreter or in another child
|
||||
interpreter. The only other connections between interpreters are
|
||||
through environment variables (the \fBenv\fR variable), which are
|
||||
normally shared among all interpreters in the application,
|
||||
@@ -41,7 +41,7 @@ share files and to transfer references to open files from one interpreter
|
||||
to another.
|
||||
.PP
|
||||
The \fBinterp\fR command also provides support for \fIsafe\fR
|
||||
interpreters. A safe interpreter is a slave whose functions have
|
||||
interpreters. A safe interpreter is a child whose functions have
|
||||
been greatly restricted, so that it is safe to execute untrusted
|
||||
scripts without fear of them damaging other interpreters or the
|
||||
application's environment. For example, all IO channel creation
|
||||
@@ -54,18 +54,18 @@ instead, it is \fIhidden\fR, so that only trusted interpreters can obtain
|
||||
access to it. For a detailed explanation of hidden commands, see
|
||||
\fBHIDDEN COMMANDS\fR, below.
|
||||
The alias mechanism can be used for protected communication (analogous to a
|
||||
kernel call) between a slave interpreter and its master.
|
||||
kernel call) between a child interpreter and its parent.
|
||||
See \fBALIAS INVOCATION\fR, below, for more details
|
||||
on how the alias mechanism works.
|
||||
.PP
|
||||
A qualified interpreter name is a proper Tcl lists containing a subset of its
|
||||
A qualified interpreter name is a proper Tcl list containing a subset of its
|
||||
ancestors in the interpreter hierarchy, terminated by the string naming the
|
||||
interpreter in its immediate master. Interpreter names are relative to the
|
||||
interpreter in its immediate parent. Interpreter names are relative to the
|
||||
interpreter in which they are used. For example, if
|
||||
.QW \fBa\fR
|
||||
is a slave of the current interpreter and it has a slave
|
||||
is a child of the current interpreter and it has a child
|
||||
.QW \fBa1\fR ,
|
||||
which in turn has a slave
|
||||
which in turn has a child
|
||||
.QW \fBa11\fR ,
|
||||
the qualified name of
|
||||
.QW \fBa11\fR
|
||||
@@ -77,14 +77,14 @@ is the list
|
||||
The \fBinterp\fR command, described below, accepts qualified interpreter
|
||||
names as arguments; the interpreter in which the command is being evaluated
|
||||
can always be referred to as \fB{}\fR (the empty list or string). Note that
|
||||
it is impossible to refer to a master (ancestor) interpreter by name in a
|
||||
slave interpreter except through aliases. Also, there is no global name by
|
||||
it is impossible to refer to a parent (ancestor) interpreter by name in a
|
||||
child interpreter except through aliases. Also, there is no global name by
|
||||
which one can refer to the first interpreter created in an application.
|
||||
Both restrictions are motivated by safety concerns.
|
||||
.SH "THE INTERP COMMAND"
|
||||
.PP
|
||||
The \fBinterp\fR command is used to create, delete, and manipulate
|
||||
slave interpreters, and to share or transfer
|
||||
child interpreters, and to share or transfer
|
||||
channels between interpreters. It can have any of several forms, depending
|
||||
on the \fIsubcommand\fR argument:
|
||||
.TP
|
||||
@@ -94,11 +94,11 @@ Returns a Tcl list whose elements are the \fItargetCmd\fR and
|
||||
\fIarg\fRs associated with the alias represented by \fIsrcToken\fR
|
||||
(this is the value returned when the alias was
|
||||
created; it is possible that the name of the source command in the
|
||||
slave is different from \fIsrcToken\fR).
|
||||
child is different from \fIsrcToken\fR).
|
||||
.TP
|
||||
\fBinterp\fR \fBalias\fR \fIsrcPath\fR \fIsrcToken\fR \fB{}\fR
|
||||
.
|
||||
Deletes the alias for \fIsrcToken\fR in the slave interpreter identified by
|
||||
Deletes the alias for \fIsrcToken\fR in the child interpreter identified by
|
||||
\fIsrcPath\fR.
|
||||
\fIsrcToken\fR refers to the value returned when the alias
|
||||
was created; if the source command has been renamed, the renamed
|
||||
@@ -106,9 +106,9 @@ command will be deleted.
|
||||
.TP
|
||||
\fBinterp\fR \fBalias\fR \fIsrcPath\fR \fIsrcCmd\fR \fItargetPath\fR \fItargetCmd \fR?\fIarg arg ...\fR?
|
||||
.
|
||||
This command creates an alias between one slave and another (see the
|
||||
\fBalias\fR slave command below for creating aliases between a slave
|
||||
and its master). In this command, either of the slave interpreters
|
||||
This command creates an alias between one child and another (see the
|
||||
\fBalias\fR child command below for creating aliases between a child
|
||||
and its parent). In this command, either of the child interpreters
|
||||
may be anywhere in the hierarchy of interpreters under the interpreter
|
||||
invoking the command.
|
||||
\fISrcPath\fR and \fIsrcCmd\fR identify the source of the alias.
|
||||
@@ -117,9 +117,9 @@ interpreter. For example,
|
||||
.QW "\fBa b\fR"
|
||||
identifies an interpreter
|
||||
.QW \fBb\fR ,
|
||||
which is a slave of interpreter
|
||||
which is a child of interpreter
|
||||
.QW \fBa\fR ,
|
||||
which is a slave of the invoking interpreter. An empty list specifies
|
||||
which is a child of the invoking interpreter. An empty list specifies
|
||||
the interpreter invoking the command. \fIsrcCmd\fR gives the name of
|
||||
a new command, which will be created in the source interpreter.
|
||||
\fITargetPath\fR and \fItargetCmd\fR specify a target interpreter
|
||||
@@ -169,33 +169,33 @@ used.
|
||||
.TP
|
||||
\fBinterp\fR \fBcreate \fR?\fB\-safe\fR? ?\fB\-\|\-\fR? ?\fIpath\fR?
|
||||
.
|
||||
Creates a slave interpreter identified by \fIpath\fR and a new command,
|
||||
called a \fIslave command\fR. The name of the slave command is the last
|
||||
component of \fIpath\fR. The new slave interpreter and the slave command
|
||||
Creates a child interpreter identified by \fIpath\fR and a new command,
|
||||
called a \fIchild command\fR. The name of the child command is the last
|
||||
component of \fIpath\fR. The new child interpreter and the child command
|
||||
are created in the interpreter identified by the path obtained by removing
|
||||
the last component from \fIpath\fR. For example, if \fIpath\fR is \fBa b
|
||||
c\fR then a new slave interpreter and slave command named \fBc\fR are
|
||||
c\fR then a new child interpreter and child command named \fBc\fR are
|
||||
created in the interpreter identified by the path \fBa b\fR.
|
||||
The slave command may be used to manipulate the new interpreter as
|
||||
The child command may be used to manipulate the new interpreter as
|
||||
described below. If \fIpath\fR is omitted, Tcl creates a unique name of the
|
||||
form \fBinterp\fIx\fR, where \fIx\fR is an integer, and uses it for the
|
||||
interpreter and the slave command. If the \fB\-safe\fR switch is specified
|
||||
(or if the master interpreter is a safe interpreter), the new slave
|
||||
interpreter and the child command. If the \fB\-safe\fR switch is specified
|
||||
(or if the parent interpreter is a safe interpreter), the new child
|
||||
interpreter will be created as a safe interpreter with limited
|
||||
functionality; otherwise the slave will include the full set of Tcl
|
||||
functionality; otherwise the child will include the full set of Tcl
|
||||
built-in commands and variables. The \fB\-\|\-\fR switch can be used to
|
||||
mark the end of switches; it may be needed if \fIpath\fR is an unusual
|
||||
value such as \fB\-safe\fR. The result of the command is the name of the
|
||||
new interpreter. The name of a slave interpreter must be unique among all
|
||||
the slaves for its master; an error occurs if a slave interpreter by the
|
||||
given name already exists in this master.
|
||||
The initial recursion limit of the slave interpreter is set to the
|
||||
new interpreter. The name of a child interpreter must be unique among all
|
||||
the children for its parent; an error occurs if a child interpreter by the
|
||||
given name already exists in this parent.
|
||||
The initial recursion limit of the child interpreter is set to the
|
||||
current recursion limit of its parent interpreter.
|
||||
.TP
|
||||
\fBinterp\fR \fBdebug \fIpath\fR ?\fB\-frame\fR ?\fIbool\fR??
|
||||
.
|
||||
Controls whether frame-level stack information is captured in the
|
||||
slave interpreter identified by \fIpath\fR. If no arguments are
|
||||
child interpreter identified by \fIpath\fR. If no arguments are
|
||||
given, option and current setting are returned. If \fB\-frame\fR
|
||||
is given, the debug setting is set to the given boolean if provided
|
||||
and the current setting is returned.
|
||||
@@ -237,8 +237,8 @@ consistency of the underlying interpreter's state.
|
||||
\fBinterp\fR \fBdelete \fR?\fIpath ...\fR?
|
||||
.
|
||||
Deletes zero or more interpreters given by the optional \fIpath\fR
|
||||
arguments, and for each interpreter, it also deletes its slaves. The
|
||||
command also deletes the slave command for each interpreter deleted.
|
||||
arguments, and for each interpreter, it also deletes its children. The
|
||||
command also deletes the child command for each interpreter deleted.
|
||||
For each \fIpath\fR argument, if no interpreter by that name
|
||||
exists, the command raises an error.
|
||||
.TP
|
||||
@@ -246,20 +246,20 @@ exists, the command raises an error.
|
||||
.
|
||||
This command concatenates all of the \fIarg\fR arguments in the same
|
||||
fashion as the \fBconcat\fR command, then evaluates the resulting string as
|
||||
a Tcl script in the slave interpreter identified by \fIpath\fR. The result
|
||||
a Tcl script in the child interpreter identified by \fIpath\fR. The result
|
||||
of this evaluation (including all \fBreturn\fR options,
|
||||
such as \fB\-errorinfo\fR and \fB\-errorcode\fR information, if an
|
||||
error occurs) is returned to the invoking interpreter.
|
||||
Note that the script will be executed in the current context stack frame of the
|
||||
\fIpath\fR interpreter; this is so that the implementations (in a master
|
||||
interpreter) of aliases in a slave interpreter can execute scripts in
|
||||
the slave that find out information about the slave's current state
|
||||
\fIpath\fR interpreter; this is so that the implementations (in a parent
|
||||
interpreter) of aliases in a child interpreter can execute scripts in
|
||||
the child that find out information about the child's current state
|
||||
and stack frame.
|
||||
.TP
|
||||
\fBinterp exists \fIpath\fR
|
||||
.
|
||||
Returns \fB1\fR if a slave interpreter by the specified \fIpath\fR
|
||||
exists in this master, \fB0\fR otherwise. If \fIpath\fR is omitted, the
|
||||
Returns \fB1\fR if a child interpreter by the specified \fIpath\fR
|
||||
exists in this parent, \fB0\fR otherwise. If \fIpath\fR is omitted, the
|
||||
invoking interpreter is used.
|
||||
.TP
|
||||
\fBinterp expose \fIpath\fR \fIhiddenName\fR ?\fIexposedCmdName\fR?
|
||||
@@ -285,7 +285,7 @@ Currently both \fIexposedCmdName\fR and \fIhiddenCmdName\fR can
|
||||
not contain namespace qualifiers, or an error is raised.
|
||||
Commands to be hidden by \fBinterp hide\fR are looked up in the global
|
||||
namespace even if the current namespace is not the global one. This
|
||||
prevents slaves from fooling a master interpreter into hiding the wrong
|
||||
prevents children from fooling a parent interpreter into hiding the wrong
|
||||
command, by making the current namespace be different from the global one.
|
||||
Hidden commands are explained in more detail in \fBHIDDEN COMMANDS\fR, below.
|
||||
.TP
|
||||
@@ -369,12 +369,16 @@ Both interpreters must close it to close the underlying IO channel; IO
|
||||
channels accessible in an interpreter are automatically closed when an
|
||||
interpreter is destroyed.
|
||||
.TP
|
||||
\fBinterp\fR \fBslaves\fR ?\fIpath\fR?
|
||||
\fBinterp\fR \fBchildren\fR ?\fIpath\fR?
|
||||
.
|
||||
Returns a Tcl list of the names of all the slave interpreters associated
|
||||
Returns a Tcl list of the names of all the child interpreters associated
|
||||
with the interpreter identified by \fIpath\fR. If \fIpath\fR is omitted,
|
||||
the invoking interpreter is used.
|
||||
.TP
|
||||
\fBinterp\fR \fBslaves\fR ?\fIpath\fR?
|
||||
.
|
||||
Synonym for . \fBinterp\fR \fBchildren\fR ?\fIpath\fR?
|
||||
.TP
|
||||
\fBinterp\fR \fBtarget\fR \fIpath alias\fR
|
||||
.
|
||||
Returns a Tcl list describing the target interpreter for an alias. The
|
||||
@@ -391,48 +395,48 @@ The target command does not have to be defined at the time of this invocation.
|
||||
Causes the IO channel identified by \fIchannelId\fR to become available in
|
||||
the interpreter identified by \fIdestPath\fR and unavailable in the
|
||||
interpreter identified by \fIsrcPath\fR.
|
||||
.SH "SLAVE COMMAND"
|
||||
.SH "CHILD COMMAND"
|
||||
.PP
|
||||
For each slave interpreter created with the \fBinterp\fR command, a
|
||||
new Tcl command is created in the master interpreter with the same
|
||||
For each child interpreter created with the \fBinterp\fR command, a
|
||||
new Tcl command is created in the parent interpreter with the same
|
||||
name as the new interpreter. This command may be used to invoke
|
||||
various operations on the interpreter. It has the following
|
||||
general form:
|
||||
.PP
|
||||
.CS
|
||||
\fIslave command \fR?\fIarg arg ...\fR?
|
||||
\fIchild command \fR?\fIarg arg ...\fR?
|
||||
.CE
|
||||
.PP
|
||||
\fISlave\fR is the name of the interpreter, and \fIcommand\fR
|
||||
\fIChild\fR is the name of the interpreter, and \fIcommand\fR
|
||||
and the \fIarg\fRs determine the exact behavior of the command.
|
||||
The valid forms of this command are:
|
||||
.TP
|
||||
\fIslave \fBaliases\fR
|
||||
\fIchild \fBaliases\fR
|
||||
.
|
||||
Returns a Tcl list whose elements are the tokens of all the
|
||||
aliases in \fIslave\fR. The tokens correspond to the values returned when
|
||||
aliases in \fIchild\fR. The tokens correspond to the values returned when
|
||||
the aliases were created (which may not be the same
|
||||
as the current names of the commands).
|
||||
.TP
|
||||
\fIslave \fBalias \fIsrcToken\fR
|
||||
\fIchild \fBalias \fIsrcToken\fR
|
||||
.
|
||||
Returns a Tcl list whose elements are the \fItargetCmd\fR and
|
||||
\fIarg\fRs associated with the alias represented by \fIsrcToken\fR
|
||||
(this is the value returned when the alias was
|
||||
created; it is possible that the actual source command in the
|
||||
slave is different from \fIsrcToken\fR).
|
||||
child is different from \fIsrcToken\fR).
|
||||
.TP
|
||||
\fIslave \fBalias \fIsrcToken \fB{}\fR
|
||||
\fIchild \fBalias \fIsrcToken \fB{}\fR
|
||||
.
|
||||
Deletes the alias for \fIsrcToken\fR in the slave interpreter.
|
||||
Deletes the alias for \fIsrcToken\fR in the child interpreter.
|
||||
\fIsrcToken\fR refers to the value returned when the alias
|
||||
was created; if the source command has been renamed, the renamed
|
||||
command will be deleted.
|
||||
.TP
|
||||
\fIslave \fBalias \fIsrcCmd targetCmd \fR?\fIarg ..\fR?
|
||||
\fIchild \fBalias \fIsrcCmd targetCmd \fR?\fIarg ..\fR?
|
||||
.
|
||||
Creates an alias such that whenever \fIsrcCmd\fR is invoked
|
||||
in \fIslave\fR, \fItargetCmd\fR is invoked in the master.
|
||||
in \fIchild\fR, \fItargetCmd\fR is invoked in the parent.
|
||||
The \fIarg\fR arguments will be passed to \fItargetCmd\fR as additional
|
||||
arguments, prepended before any arguments passed in the invocation of
|
||||
\fIsrcCmd\fR.
|
||||
@@ -441,69 +445,69 @@ The command returns a token that uniquely identifies the command created
|
||||
\fIsrcCmd\fR, even if the command is renamed afterwards. The token may but
|
||||
does not have to be equal to \fIsrcCmd\fR.
|
||||
.TP
|
||||
\fIslave \fBbgerror\fR ?\fIcmdPrefix\fR?
|
||||
\fIchild \fBbgerror\fR ?\fIcmdPrefix\fR?
|
||||
.
|
||||
This command either gets or sets the current background exception handler
|
||||
for the \fIslave\fR interpreter. If \fIcmdPrefix\fR is
|
||||
for the \fIchild\fR interpreter. If \fIcmdPrefix\fR is
|
||||
absent, the current background exception handler is returned, and if it is
|
||||
present, it is a list of words (of minimum length one) that describes
|
||||
what to set the interpreter's background exception handler to. See the
|
||||
\fBBACKGROUND EXCEPTION HANDLING\fR section for more details.
|
||||
.TP
|
||||
\fIslave \fBeval \fIarg \fR?\fIarg ..\fR?
|
||||
\fIchild \fBeval \fIarg \fR?\fIarg ..\fR?
|
||||
.
|
||||
This command concatenates all of the \fIarg\fR arguments in
|
||||
the same fashion as the \fBconcat\fR command, then evaluates
|
||||
the resulting string as a Tcl script in \fIslave\fR.
|
||||
the resulting string as a Tcl script in \fIchild\fR.
|
||||
The result of this evaluation (including all \fBreturn\fR options,
|
||||
such as \fB\-errorinfo\fR and \fB\-errorcode\fR information, if an
|
||||
error occurs) is returned to the invoking interpreter.
|
||||
Note that the script will be executed in the current context stack frame
|
||||
of \fIslave\fR; this is so that the implementations (in a master
|
||||
interpreter) of aliases in a slave interpreter can execute scripts in
|
||||
the slave that find out information about the slave's current state
|
||||
of \fIchild\fR; this is so that the implementations (in a parent
|
||||
interpreter) of aliases in a child interpreter can execute scripts in
|
||||
the child that find out information about the child's current state
|
||||
and stack frame.
|
||||
.TP
|
||||
\fIslave \fBexpose \fIhiddenName \fR?\fIexposedCmdName\fR?
|
||||
\fIchild \fBexpose \fIhiddenName \fR?\fIexposedCmdName\fR?
|
||||
.
|
||||
This command exposes the hidden command \fIhiddenName\fR, eventually bringing
|
||||
it back under a new \fIexposedCmdName\fR name (this name is currently
|
||||
accepted only if it is a valid global name space name without any ::),
|
||||
in \fIslave\fR.
|
||||
in \fIchild\fR.
|
||||
If an exposed command with the targeted name already exists, this command
|
||||
fails.
|
||||
For more details on hidden commands, see \fBHIDDEN COMMANDS\fR, below.
|
||||
.TP
|
||||
\fIslave \fBhide \fIexposedCmdName\fR ?\fIhiddenCmdName\fR?
|
||||
\fIchild \fBhide \fIexposedCmdName\fR ?\fIhiddenCmdName\fR?
|
||||
.
|
||||
This command hides the exposed command \fIexposedCmdName\fR, renaming it to
|
||||
the hidden command \fIhiddenCmdName\fR, or keeping the same name if the
|
||||
argument is not given, in the \fIslave\fR interpreter.
|
||||
argument is not given, in the \fIchild\fR interpreter.
|
||||
If a hidden command with the targeted name already exists, this command
|
||||
fails.
|
||||
Currently both \fIexposedCmdName\fR and \fIhiddenCmdName\fR can
|
||||
not contain namespace qualifiers, or an error is raised.
|
||||
Commands to be hidden are looked up in the global
|
||||
namespace even if the current namespace is not the global one. This
|
||||
prevents slaves from fooling a master interpreter into hiding the wrong
|
||||
prevents children from fooling a parent interpreter into hiding the wrong
|
||||
command, by making the current namespace be different from the global one.
|
||||
For more details on hidden commands, see \fBHIDDEN COMMANDS\fR, below.
|
||||
.TP
|
||||
\fIslave \fBhidden\fR
|
||||
\fIchild \fBhidden\fR
|
||||
.
|
||||
Returns a list of the names of all hidden commands in \fIslave\fR.
|
||||
Returns a list of the names of all hidden commands in \fIchild\fR.
|
||||
.TP
|
||||
\fIslave \fBinvokehidden\fR ?\fI\-option ...\fR? \fIhiddenName \fR?\fIarg ..\fR?
|
||||
\fIchild \fBinvokehidden\fR ?\fI\-option ...\fR? \fIhiddenName \fR?\fIarg ..\fR?
|
||||
.
|
||||
This command invokes the hidden command \fIhiddenName\fR with the
|
||||
supplied arguments, in \fIslave\fR. No substitutions or evaluations are
|
||||
supplied arguments, in \fIchild\fR. No substitutions or evaluations are
|
||||
applied to the arguments. Three \fI\-option\fRs are supported, all
|
||||
of which start with \fB\-\fR: \fB\-namespace\fR (which takes a single
|
||||
argument afterwards, \fInsName\fR), \fB\-global\fR, and \fB\-\|\-\fR.
|
||||
If the \fB\-namespace\fR flag is given, the hidden command is invoked in
|
||||
the specified namespace in the slave.
|
||||
the specified namespace in the child.
|
||||
If the \fB\-global\fR flag is given, the command is invoked at the global
|
||||
level in the slave; otherwise it is invoked at the current call frame and
|
||||
level in the child; otherwise it is invoked at the current call frame and
|
||||
can access local variables in that or outer call frames.
|
||||
The \fB\-\|\-\fR flag allows the \fIhiddenCmdName\fR argument to start with a
|
||||
.QW \-
|
||||
@@ -511,37 +515,37 @@ character, and is otherwise unnecessary.
|
||||
If both the \fB\-namespace\fR and \fB\-global\fR flags are given, the
|
||||
\fB\-namespace\fR flag is ignored.
|
||||
Note that the hidden command will be executed (by default) in the
|
||||
current context stack frame of \fIslave\fR.
|
||||
current context stack frame of \fIchild\fR.
|
||||
For more details on hidden commands,
|
||||
see \fBHIDDEN COMMANDS\fR, below.
|
||||
.TP
|
||||
\fIslave \fBissafe\fR
|
||||
\fIchild \fBissafe\fR
|
||||
.
|
||||
Returns \fB1\fR if the slave interpreter is safe, \fB0\fR otherwise.
|
||||
Returns \fB1\fR if the child interpreter is safe, \fB0\fR otherwise.
|
||||
.TP
|
||||
\fIslave \fBlimit\fR \fIlimitType\fR ?\fI\-option\fR? ?\fIvalue\fR \fI...\fR?
|
||||
\fIchild \fBlimit\fR \fIlimitType\fR ?\fI\-option\fR? ?\fIvalue\fR \fI...\fR?
|
||||
.
|
||||
Sets up, manipulates and queries the configuration of the resource
|
||||
limit \fIlimitType\fR for the slave interpreter. If no \fI\-option\fR
|
||||
limit \fIlimitType\fR for the child interpreter. If no \fI\-option\fR
|
||||
is specified, return the current configuration of the limit. If
|
||||
\fI\-option\fR is the sole argument, return the value of that option.
|
||||
Otherwise, a list of \fI\-option\fR/\fIvalue\fR argument pairs must
|
||||
supplied. See \fBRESOURCE LIMITS\fR below for a more detailed explanation of
|
||||
what limits and options are supported.
|
||||
.TP
|
||||
\fIslave \fBmarktrusted\fR
|
||||
\fIchild \fBmarktrusted\fR
|
||||
.
|
||||
Marks the slave interpreter as trusted. Can only be invoked by a
|
||||
Marks the child interpreter as trusted. Can only be invoked by a
|
||||
trusted interpreter. This command does not expose any hidden
|
||||
commands in the slave interpreter. The command has no effect if the slave
|
||||
commands in the child interpreter. The command has no effect if the child
|
||||
is already trusted.
|
||||
.TP
|
||||
\fIslave\fR \fBrecursionlimit\fR ?\fInewlimit\fR?
|
||||
\fIchild\fR \fBrecursionlimit\fR ?\fInewlimit\fR?
|
||||
.
|
||||
Returns the maximum allowable nesting depth for the \fIslave\fR interpreter.
|
||||
If \fInewlimit\fR is specified, the recursion limit in \fIslave\fR will be
|
||||
Returns the maximum allowable nesting depth for the \fIchild\fR interpreter.
|
||||
If \fInewlimit\fR is specified, the recursion limit in \fIchild\fR will be
|
||||
set so that nesting of more than \fInewlimit\fR calls to \fBTcl_Eval()\fR
|
||||
and related procedures in \fIslave\fR will return an error.
|
||||
and related procedures in \fIchild\fR will return an error.
|
||||
The \fInewlimit\fR value is also returned.
|
||||
The \fInewlimit\fR value must be a positive integer between 1 and the
|
||||
maximum value of a non-long integer on the platform.
|
||||
@@ -565,14 +569,14 @@ For example, commands to create files on disk are removed, and the
|
||||
\fBexec\fR command is removed, since it could be used to cause damage
|
||||
through subprocesses.
|
||||
Limited access to these facilities can be provided, by creating
|
||||
aliases to the master interpreter which check their arguments carefully
|
||||
aliases to the parent interpreter which check their arguments carefully
|
||||
and provide restricted access to a safe subset of facilities.
|
||||
For example, file creation might be allowed in a particular subdirectory
|
||||
and subprocess invocation might be allowed for a carefully selected and
|
||||
fixed set of programs.
|
||||
.PP
|
||||
A safe interpreter is created by specifying the \fB\-safe\fR switch
|
||||
to the \fBinterp create\fR command. Furthermore, any slave created
|
||||
to the \fBinterp create\fR command. Furthermore, any child created
|
||||
by a safe interpreter will also be safe.
|
||||
.PP
|
||||
A safe interpreter is created with exactly the following set of
|
||||
@@ -659,15 +663,15 @@ including itself.
|
||||
.SH "ALIAS INVOCATION"
|
||||
.PP
|
||||
The alias mechanism has been carefully designed so that it can
|
||||
be used safely when an untrusted script is executing
|
||||
in a safe slave and the target of the alias is a trusted
|
||||
master. The most important thing in guaranteeing safety is to
|
||||
ensure that information passed from the slave to the master is
|
||||
never evaluated or substituted in the master; if this were to
|
||||
occur, it would enable an evil script in the slave to invoke
|
||||
arbitrary functions in the master, which would compromise security.
|
||||
be used safely in an untrusted script which is being executed in a
|
||||
safe interpreter even if the target of the alias is not a safe
|
||||
interpreter. The most important thing in guaranteeing safety is to
|
||||
ensure that information passed from the child to the parent is
|
||||
never evaluated or substituted in the parent; if this were to
|
||||
occur, it would enable an evil script in the child to invoke
|
||||
arbitrary functions in the parent, which would compromise security.
|
||||
.PP
|
||||
When the source for an alias is invoked in the slave interpreter, the
|
||||
When the source for an alias is invoked in the child interpreter, the
|
||||
usual Tcl substitutions are performed when parsing that command.
|
||||
These substitutions are carried out in the source interpreter just
|
||||
as they would be for any other command invoked in that interpreter.
|
||||
@@ -694,8 +698,8 @@ the alias's source command is parsed in the source interpreter.
|
||||
When writing the \fItargetCmd\fRs for aliases in safe interpreters,
|
||||
it is very important that the arguments to that command never be
|
||||
evaluated or substituted, since this would provide an escape
|
||||
mechanism whereby the slave interpreter could execute arbitrary
|
||||
code in the master. This in turn would compromise the security
|
||||
mechanism whereby the child interpreter could execute arbitrary
|
||||
code in the parent. This in turn would compromise the security
|
||||
of the system.
|
||||
.SH "HIDDEN COMMANDS"
|
||||
.PP
|
||||
@@ -722,28 +726,28 @@ invoke\fR. Hidden commands and exposed commands reside in separate name
|
||||
spaces. It is possible to define a hidden command and an exposed command by
|
||||
the same name within one interpreter.
|
||||
.PP
|
||||
Hidden commands in a slave interpreter can be invoked in the body of
|
||||
procedures called in the master during alias invocation. For example, an
|
||||
alias for \fBsource\fR could be created in a slave interpreter. When it is
|
||||
invoked in the slave interpreter, a procedure is called in the master
|
||||
Hidden commands in a child interpreter can be invoked in the body of
|
||||
procedures called in the parent during alias invocation. For example, an
|
||||
alias for \fBsource\fR could be created in a child interpreter. When it is
|
||||
invoked in the child interpreter, a procedure is called in the parent
|
||||
interpreter to check that the operation is allowable (e.g. it asks to
|
||||
source a file that the slave interpreter is allowed to access). The
|
||||
procedure then it invokes the hidden \fBsource\fR command in the slave
|
||||
source a file that the child interpreter is allowed to access). The
|
||||
procedure then it invokes the hidden \fBsource\fR command in the child
|
||||
interpreter to actually source in the contents of the file. Note that two
|
||||
commands named \fBsource\fR exist in the slave interpreter: the alias, and
|
||||
commands named \fBsource\fR exist in the child interpreter: the alias, and
|
||||
the hidden command.
|
||||
.PP
|
||||
Because a master interpreter may invoke a hidden command as part of
|
||||
Because a parent interpreter may invoke a hidden command as part of
|
||||
handling an alias invocation, great care must be taken to avoid evaluating
|
||||
any arguments passed in through the alias invocation.
|
||||
Otherwise, malicious slave interpreters could cause a trusted master
|
||||
Otherwise, malicious child interpreters could cause a trusted parent
|
||||
interpreter to execute dangerous commands on their behalf. See the section
|
||||
on \fBALIAS INVOCATION\fR for a more complete discussion of this topic.
|
||||
To help avoid this problem, no substitutions or evaluations are
|
||||
applied to arguments of \fBinterp invokehidden\fR.
|
||||
.PP
|
||||
Safe interpreters are not allowed to invoke hidden commands in themselves
|
||||
or in their descendants. This prevents safe slaves from gaining access to
|
||||
or in their descendants. This prevents them from gaining access to
|
||||
hidden functionality in themselves or their descendants.
|
||||
.PP
|
||||
The set of hidden commands in an interpreter can be manipulated by a trusted
|
||||
@@ -762,12 +766,12 @@ qualifiers, and you must first rename a command in a namespace to the
|
||||
global namespace before you can hide it.
|
||||
Commands to be hidden by \fBinterp hide\fR are looked up in the global
|
||||
namespace even if the current namespace is not the global one. This
|
||||
prevents slaves from fooling a master interpreter into hiding the wrong
|
||||
prevents children from fooling a parent interpreter into hiding the wrong
|
||||
command, by making the current namespace be different from the global one.
|
||||
.SH "RESOURCE LIMITS"
|
||||
.PP
|
||||
Every interpreter has two kinds of resource limits that may be imposed by any
|
||||
master interpreter upon its slaves. Command limits (of type \fBcommand\fR)
|
||||
parent interpreter upon its children. Command limits (of type \fBcommand\fR)
|
||||
restrict the total number of Tcl commands that may be executed by an
|
||||
interpreter (as can be inspected via the \fBinfo cmdcount\fR command), and
|
||||
time limits (of type \fBtime\fR) place a limit by which execution within the
|
||||
@@ -776,7 +780,7 @@ interpreter must complete. Note that time limits are expressed as
|
||||
\fBafter\fR) because they may be modified after creation.
|
||||
.PP
|
||||
When a limit is exceeded for an interpreter, first any handler callbacks
|
||||
defined by master interpreters are called. If those callbacks increase or
|
||||
defined by parent interpreters are called. If those callbacks increase or
|
||||
remove the limit, execution within the (previously) limited interpreter
|
||||
continues. If the limit is still in force, an error is generated at that point
|
||||
and normal processing of errors within the interpreter (by the \fBcatch\fR
|
||||
@@ -833,13 +837,13 @@ This option specifies the number of commands that the interpreter may execute
|
||||
before triggering the command limit. This option may be the empty string,
|
||||
which indicates that a command limit is not set for the interpreter.
|
||||
.PP
|
||||
Where an interpreter with a resource limit set on it creates a slave
|
||||
interpreter, that slave interpreter will have resource limits imposed on it
|
||||
that are at least as restrictive as the limits on the creating master
|
||||
interpreter. If the master interpreter of the limited master wishes to relax
|
||||
Where an interpreter with a resource limit set on it creates a child
|
||||
interpreter, that child interpreter will have resource limits imposed on it
|
||||
that are at least as restrictive as the limits on the creating parent
|
||||
interpreter. If the parent interpreter of the limited parent wishes to relax
|
||||
these conditions, it should hide the \fBinterp\fR command in the child and
|
||||
then use aliases and the \fBinterp invokehidden\fR subcommand to provide such
|
||||
access as it chooses to the \fBinterp\fR command to the limited master as
|
||||
access as it chooses to the \fBinterp\fR command to the limited parent as
|
||||
necessary.
|
||||
.SH "BACKGROUND EXCEPTION HANDLING"
|
||||
.PP
|
||||
@@ -900,9 +904,9 @@ set i [\fBinterp create\fR]
|
||||
}
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
bgerror(n), load(n), safe(n), Tcl_CreateSlave(3), Tcl_Eval(3), Tcl_BackgroundException(3)
|
||||
bgerror(n), load(n), safe(n), Tcl_CreateChild(3), Tcl_Eval(3), Tcl_BackgroundException(3)
|
||||
.SH KEYWORDS
|
||||
alias, master interpreter, safe interpreter, slave interpreter
|
||||
alias, parent interpreter, safe interpreter, child interpreter
|
||||
'\"Local Variables:
|
||||
'\"mode: nroff
|
||||
'\"End:
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ will read all the \fB.tcl\fR files in subdirectory \fBfoo\fR and
|
||||
generate a new index file \fBfoo/tclIndex\fR.
|
||||
.PP
|
||||
\fBAuto_mkindex\fR parses the Tcl scripts by sourcing them into a
|
||||
slave interpreter and monitoring the proc and namespace commands that
|
||||
child interpreter and monitoring the proc and namespace commands that
|
||||
are executed. Extensions can use the (undocumented)
|
||||
auto_mkindex_parser package to register other commands that can
|
||||
contribute to the auto_load index. You will have to read through
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ The default pattern is \fB*.tcl\fR and \fB*.[info sharedlibextension]\fR.
|
||||
\fBPkg_mkIndex\fR will create a file \fBpkgIndex.tcl\fR in \fIdir\fR
|
||||
with package information about all the files given by the \fIpattern\fR
|
||||
arguments.
|
||||
It does this by loading each file into a slave
|
||||
It does this by loading each file into a child
|
||||
interpreter and seeing what packages
|
||||
and new commands appear (this is why it is essential to have
|
||||
\fBpackage provide\fR commands or \fBTcl_PkgProvide\fR calls
|
||||
@@ -109,7 +109,7 @@ the use of \fIauto_reset\fR, and therefore its use is discouraged.
|
||||
.TP 15
|
||||
\fB\-load \fIpkgPat\fR
|
||||
The index process will pre-load any packages that exist in the
|
||||
current interpreter and match \fIpkgPat\fR into the slave interpreter used to
|
||||
current interpreter and match \fIpkgPat\fR into the child interpreter used to
|
||||
generate the index. The pattern match uses string match rules, but without
|
||||
making case distinctions.
|
||||
See \fBCOMPLEX CASES\fR below.
|
||||
|
||||
+59
-51
@@ -11,17 +11,17 @@
|
||||
.SH NAME
|
||||
safe \- Creating and manipulating safe interpreters
|
||||
.SH SYNOPSIS
|
||||
\fB::safe::interpCreate\fR ?\fIslave\fR? ?\fIoptions...\fR?
|
||||
\fB::safe::interpCreate\fR ?\fIchild\fR? ?\fIoptions...\fR?
|
||||
.sp
|
||||
\fB::safe::interpInit\fR \fIslave\fR ?\fIoptions...\fR?
|
||||
\fB::safe::interpInit\fR \fIchild\fR ?\fIoptions...\fR?
|
||||
.sp
|
||||
\fB::safe::interpConfigure\fR \fIslave\fR ?\fIoptions...\fR?
|
||||
\fB::safe::interpConfigure\fR \fIchild\fR ?\fIoptions...\fR?
|
||||
.sp
|
||||
\fB::safe::interpDelete\fR \fIslave\fR
|
||||
\fB::safe::interpDelete\fR \fIchild\fR
|
||||
.sp
|
||||
\fB::safe::interpAddToAccessPath\fR \fIslave\fR \fIdirectory\fR
|
||||
\fB::safe::interpAddToAccessPath\fR \fIchild\fR \fIdirectory\fR
|
||||
.sp
|
||||
\fB::safe::interpFindInAccessPath\fR \fIslave\fR \fIdirectory\fR
|
||||
\fB::safe::interpFindInAccessPath\fR \fIchild\fR \fIdirectory\fR
|
||||
.sp
|
||||
\fB::safe::setLogCmd\fR ?\fIcmd arg...\fR?
|
||||
.SS OPTIONS
|
||||
@@ -44,7 +44,7 @@ application or computer. Untrusted scripts are also prevented from
|
||||
disclosing information stored on the hosting computer or in the
|
||||
hosting application to any party.
|
||||
.PP
|
||||
Safe Tcl allows a master interpreter to create safe, restricted
|
||||
Safe Tcl allows a parent interpreter to create safe, restricted
|
||||
interpreters that contain a set of predefined aliases for the \fBsource\fR,
|
||||
\fBload\fR, \fBfile\fR, \fBencoding\fR, and \fBexit\fR commands and
|
||||
are able to use the auto-loading and package mechanisms.
|
||||
@@ -53,39 +53,47 @@ No knowledge of the file system structure is leaked to the
|
||||
safe interpreter, because it has access only to a virtualized path
|
||||
containing tokens. When the safe interpreter requests to source a file, it
|
||||
uses the token in the virtual path as part of the file name to source; the
|
||||
master interpreter transparently
|
||||
parent interpreter transparently
|
||||
translates the token into a real directory name and executes the
|
||||
requested operation (see the section \fBSECURITY\fR below for details).
|
||||
Different levels of security can be selected by using the optional flags
|
||||
of the commands described below.
|
||||
.PP
|
||||
All commands provided in the master interpreter by Safe Tcl reside in
|
||||
All commands provided in the parent interpreter by Safe Tcl reside in
|
||||
the \fBsafe\fR namespace.
|
||||
.SH COMMANDS
|
||||
The following commands are provided in the master interpreter:
|
||||
The following commands are provided in the parent interpreter:
|
||||
.TP
|
||||
\fB::safe::interpCreate\fR ?\fIslave\fR? ?\fIoptions...\fR?
|
||||
\fB::safe::interpCreate\fR ?\fIchild\fR? ?\fIoptions...\fR?
|
||||
Creates a safe interpreter, installs the aliases described in the section
|
||||
\fBALIASES\fR and initializes the auto-loading and package mechanism as
|
||||
specified by the supplied \fIoptions\fR.
|
||||
See the \fBOPTIONS\fR section below for a description of the
|
||||
optional arguments.
|
||||
If the \fIslave\fR argument is omitted, a name will be generated.
|
||||
If the \fIchild\fR argument is omitted, a name will be generated.
|
||||
\fB::safe::interpCreate\fR always returns the interpreter name.
|
||||
.sp
|
||||
The interpreter name \fIchild\fR may include namespace separators,
|
||||
but may not have leading or trailing namespace separators, or excess
|
||||
colon characters in namespace separators. The interpreter name is
|
||||
qualified relative to the global namespace ::, not the namespace in which
|
||||
the \fB::safe::interpCreate\fR command is evaluated.
|
||||
.TP
|
||||
\fB::safe::interpInit\fR \fIslave\fR ?\fIoptions...\fR?
|
||||
\fB::safe::interpInit\fR \fIchild\fR ?\fIoptions...\fR?
|
||||
This command is similar to \fBinterpCreate\fR except it that does not
|
||||
create the safe interpreter. \fIslave\fR must have been created by some
|
||||
other means, like \fBinterp create\fR \fB\-safe\fR.
|
||||
create the safe interpreter. \fIchild\fR must have been created by some
|
||||
other means, like \fBinterp create\fR \fB\-safe\fR. The interpreter
|
||||
name \fIchild\fR may include namespace separators, subject to the same
|
||||
restrictions as for \fBinterpCreate\fR.
|
||||
.TP
|
||||
\fB::safe::interpConfigure\fR \fIslave\fR ?\fIoptions...\fR?
|
||||
\fB::safe::interpConfigure\fR \fIchild\fR ?\fIoptions...\fR?
|
||||
If no \fIoptions\fR are given, returns the settings for all options for the
|
||||
named safe interpreter as a list of options and their current values
|
||||
for that \fIslave\fR.
|
||||
for that \fIchild\fR.
|
||||
If a single additional argument is provided,
|
||||
it will return a list of 2 elements \fIname\fR and \fIvalue\fR where
|
||||
\fIname\fR is the full name of that option and \fIvalue\fR the current value
|
||||
for that option and the \fIslave\fR.
|
||||
for that option and the \fIchild\fR.
|
||||
If more than two additional arguments are provided, it will reconfigure the
|
||||
safe interpreter and change each and only the provided options.
|
||||
See the section on \fBOPTIONS\fR below for options description.
|
||||
@@ -105,14 +113,14 @@ safe::interpConfigure $i0 \-delete {foo bar} \-statics 0
|
||||
.CE
|
||||
.RE
|
||||
.TP
|
||||
\fB::safe::interpDelete\fR \fIslave\fR
|
||||
\fB::safe::interpDelete\fR \fIchild\fR
|
||||
Deletes the safe interpreter and cleans up the corresponding
|
||||
master interpreter data structures.
|
||||
parent interpreter data structures.
|
||||
If a \fIdeleteHook\fR script was specified for this interpreter it is
|
||||
evaluated before the interpreter is deleted, with the name of the
|
||||
interpreter as an additional argument.
|
||||
.TP
|
||||
\fB::safe::interpFindInAccessPath\fR \fIslave\fR \fIdirectory\fR
|
||||
\fB::safe::interpFindInAccessPath\fR \fIchild\fR \fIdirectory\fR
|
||||
This command finds and returns the token for the real directory
|
||||
\fIdirectory\fR in the safe interpreter's current virtual access path.
|
||||
It generates an error if the directory is not found.
|
||||
@@ -120,14 +128,14 @@ Example of use:
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
$slave eval [list set tk_library \e
|
||||
$child eval [list set tk_library \e
|
||||
[::safe::interpFindInAccessPath $name $tk_library]]
|
||||
.CE
|
||||
.RE
|
||||
.TP
|
||||
\fB::safe::interpAddToAccessPath\fR \fIslave\fR \fIdirectory\fR
|
||||
\fB::safe::interpAddToAccessPath\fR \fIchild\fR \fIdirectory\fR
|
||||
This command adds \fIdirectory\fR to the virtual path maintained for the
|
||||
safe interpreter in the master, and returns the token that can be used in
|
||||
safe interpreter in the parent, and returns the token that can be used in
|
||||
the safe interpreter to obtain access to files in that directory.
|
||||
If the directory is already in the virtual path, it only returns the token
|
||||
without adding the directory to the virtual path again.
|
||||
@@ -135,7 +143,7 @@ Example of use:
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
$slave eval [list set tk_library \e
|
||||
$child eval [list set tk_library \e
|
||||
[::safe::interpAddToAccessPath $name $tk_library]]
|
||||
.CE
|
||||
.RE
|
||||
@@ -168,10 +176,10 @@ Note that the safe interpreter only received an error message saying that
|
||||
the file was not found:
|
||||
.PP
|
||||
.CS
|
||||
NOTICE for slave interp10 : Created
|
||||
NOTICE for slave interp10 : Setting accessPath=(/foo/bar) staticsok=1 nestedok=0 deletehook=()
|
||||
NOTICE for slave interp10 : auto_path in interp10 has been set to {$p(:0:)}
|
||||
ERROR for slave interp10 : /foo/bar/init.tcl: no such file or directory
|
||||
NOTICE for child interp10 : Created
|
||||
NOTICE for child interp10 : Setting accessPath=(/foo/bar) staticsok=1 nestedok=0 deletehook=()
|
||||
NOTICE for child interp10 : auto_path in interp10 has been set to {$p(:0:)}
|
||||
ERROR for child interp10 : /foo/bar/init.tcl: no such file or directory
|
||||
.CE
|
||||
.RE
|
||||
.SS OPTIONS
|
||||
@@ -187,7 +195,7 @@ This option sets the list of directories from which the safe interpreter
|
||||
can \fBsource\fR and \fBload\fR files.
|
||||
If this option is not specified, or if it is given as the
|
||||
empty list, the safe interpreter will use the same directories as its
|
||||
master for auto-loading.
|
||||
parent for auto-loading.
|
||||
See the section \fBSECURITY\fR below for more detail about virtual paths,
|
||||
tokens and access control.
|
||||
.TP
|
||||
@@ -216,7 +224,7 @@ to load packages into its own sub-interpreters.
|
||||
.TP
|
||||
\fB\-deleteHook\fR \fIscript\fR
|
||||
When this option is given a non-empty \fIscript\fR, it will be
|
||||
evaluated in the master with the name of
|
||||
evaluated in the parent with the name of
|
||||
the safe interpreter as an additional argument
|
||||
just before actually deleting the safe interpreter.
|
||||
Giving an empty value removes any currently installed deletion hook
|
||||
@@ -281,8 +289,8 @@ potential for information leakage about its directory structure.
|
||||
To prevent this, commands that take file names as arguments in a safe
|
||||
interpreter use tokens instead of the real directory names.
|
||||
These tokens are translated to the real directory name while a request to,
|
||||
e.g., source a file is mediated by the master interpreter.
|
||||
This virtual path system is maintained in the master interpreter for each safe
|
||||
e.g., source a file is mediated by the parent interpreter.
|
||||
This virtual path system is maintained in the parent interpreter for each safe
|
||||
interpreter created by \fB::safe::interpCreate\fR or initialized by
|
||||
\fB::safe::interpInit\fR and
|
||||
the path maps tokens accessible in the safe interpreter into real path
|
||||
@@ -291,7 +299,7 @@ from gaining knowledge about the
|
||||
structure of the file system of the host on which the interpreter is
|
||||
executing.
|
||||
The only valid file names arguments
|
||||
for the \fBsource\fR and \fBload\fR aliases provided to the slave
|
||||
for the \fBsource\fR and \fBload\fR aliases provided to the child
|
||||
are path in the form of
|
||||
\fB[file join \fItoken filename\fB]\fR (i.e. when using the
|
||||
native file path formats: \fItoken\fB/\fIfilename\fR
|
||||
@@ -320,26 +328,26 @@ or be called
|
||||
.PP
|
||||
Each element of the initial access path
|
||||
list will be assigned a token that will be set in
|
||||
the slave \fBauto_path\fR and the first element of that list will be set as
|
||||
the \fBtcl_library\fR for that slave.
|
||||
the child \fBauto_path\fR and the first element of that list will be set as
|
||||
the \fBtcl_library\fR for that child.
|
||||
.PP
|
||||
If the access path argument is not given or is the empty list,
|
||||
the default behavior is to let the slave access the same packages
|
||||
as the master has access to (Or to be more precise:
|
||||
the default behavior is to let the child access the same packages
|
||||
as the parent has access to (Or to be more precise:
|
||||
only packages written in Tcl (which by definition cannot be dangerous
|
||||
as they run in the slave interpreter) and C extensions that
|
||||
provides a _SafeInit entry point). For that purpose, the master's
|
||||
\fBauto_path\fR will be used to construct the slave access path.
|
||||
In order that the slave successfully loads the Tcl library files
|
||||
as they run in the child interpreter) and C extensions that
|
||||
provides a _SafeInit entry point). For that purpose, the parent's
|
||||
\fBauto_path\fR will be used to construct the child access path.
|
||||
In order that the child successfully loads the Tcl library files
|
||||
(which includes the auto-loading mechanism itself) the \fBtcl_library\fR will be
|
||||
added or moved to the first position if necessary, in the
|
||||
slave access path, so the slave
|
||||
\fBtcl_library\fR will be the same as the master's (its real
|
||||
path will still be invisible to the slave though).
|
||||
In order that auto-loading works the same for the slave and
|
||||
the master in this by default case, the first-level
|
||||
sub directories of each directory in the master \fBauto_path\fR will
|
||||
also be added (if not already included) to the slave access path.
|
||||
child access path, so the child
|
||||
\fBtcl_library\fR will be the same as the parent's (its real
|
||||
path will still be invisible to the child though).
|
||||
In order that auto-loading works the same for the child and
|
||||
the parent in this by default case, the first-level
|
||||
sub directories of each directory in the parent \fBauto_path\fR will
|
||||
also be added (if not already included) to the child access path.
|
||||
You can always specify a more
|
||||
restrictive path for which sub directories will never be searched by
|
||||
explicitly specifying your directory list with the \fB\-accessPath\fR flag
|
||||
@@ -352,8 +360,8 @@ to synchronize its \fBauto_index\fR with the new token list.
|
||||
.SH "SEE ALSO"
|
||||
interp(n), library(n), load(n), package(n), source(n), unknown(n)
|
||||
.SH KEYWORDS
|
||||
alias, auto\-loading, auto_mkindex, load, master interpreter, safe
|
||||
interpreter, slave interpreter, source
|
||||
alias, auto\-loading, auto_mkindex, load, parent interpreter, safe
|
||||
interpreter, child interpreter, source
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" End:
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ A leading BOM (Byte order mark) contained in the file is ignored for unicode enc
|
||||
.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.
|
||||
is omitted, the utf-8 encoding is assumed.
|
||||
.SH EXAMPLE
|
||||
.PP
|
||||
Run the script in the file \fBfoo.tcl\fR and then the script in the
|
||||
|
||||
+11
-11
@@ -203,7 +203,7 @@ array. Returns an empty string.
|
||||
.TP
|
||||
\fBrunAllTests\fR
|
||||
.
|
||||
This is a master command meant to run an entire suite of tests,
|
||||
This is a main command meant to run an entire suite of tests,
|
||||
spanning multiple files and/or directories, as governed by
|
||||
the configurable options of \fBtcltest\fR. See \fBRUNNING ALL TESTS\fR
|
||||
below for a complete description of the many variations possible
|
||||
@@ -804,17 +804,17 @@ then a copy of \fBinterpreter\fR will be \fBexec\fR'd to
|
||||
evaluate each file. The multi-process operation is useful
|
||||
when testing can cause errors so severe that a process
|
||||
terminates. Although such an error may terminate a child
|
||||
process evaluating one file, the master process can continue
|
||||
process evaluating one file, the main process can continue
|
||||
with the rest of the test suite. In multi-process operation,
|
||||
the configuration of \fBtcltest\fR in the master process is
|
||||
the configuration of \fBtcltest\fR in the main process is
|
||||
passed to the child processes as command line arguments,
|
||||
with the exception of \fBconfigure \-outfile\fR. The
|
||||
\fBrunAllTests\fR command in the
|
||||
master process collects all output from the child processes
|
||||
and collates their results into one master report. Any
|
||||
main process collects all output from the child processes
|
||||
and collates their results into one main report. Any
|
||||
reports of individual test failures, or messages requested
|
||||
by a \fBconfigure \-verbose\fR setting are passed directly
|
||||
on to \fBoutputChannel\fR by the master process.
|
||||
on to \fBoutputChannel\fR by the main process.
|
||||
.PP
|
||||
After evaluating all selected test files, a summary of the
|
||||
results is printed to \fBoutputChannel\fR. The summary
|
||||
@@ -1134,7 +1134,7 @@ A good namespace to use is a child namespace \fBtest\fR of the namespace
|
||||
of the module you are testing.
|
||||
.PP
|
||||
A test file should also be able to be evaluated directly as a script,
|
||||
not depending on being called by a master \fBrunAllTests\fR. This
|
||||
not depending on being called by a main \fBrunAllTests\fR. This
|
||||
means that each test file should process command line arguments to give
|
||||
the tester all the configuration control that \fBtcltest\fR provides.
|
||||
.PP
|
||||
@@ -1145,7 +1145,7 @@ Here is a sketch of a sample test file illustrating those points:
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
package require tcltest 2.2
|
||||
package require tcltest 2.5
|
||||
eval \fB::tcltest::configure\fR $argv
|
||||
package require example
|
||||
namespace eval ::example::test {
|
||||
@@ -1175,12 +1175,12 @@ doing any necessary setup. This script is usually named \fBall.tcl\fR
|
||||
because that is the default name used by \fBrunAllTests\fR when combining
|
||||
multiple test suites into one testing run.
|
||||
.IP [8]
|
||||
Here is a sketch of a sample test suite master script:
|
||||
Here is a sketch of a sample test suite main script:
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
package require Tcl 8.4
|
||||
package require tcltest 2.2
|
||||
package require Tcl 8.6
|
||||
package require tcltest 2.5
|
||||
package require example
|
||||
\fB::tcltest::configure\fR -testdir \e
|
||||
[file dirname [file normalize [info script]]]
|
||||
|
||||
+16
-16
@@ -56,7 +56,7 @@ static const chr *scanplain(struct vars *);
|
||||
static void onechr(struct vars *, pchr, struct state *, struct state *);
|
||||
static void dovec(struct vars *, struct cvec *, struct state *, struct state *);
|
||||
static void wordchrs(struct vars *);
|
||||
static struct subre *subre(struct vars *, int, int, struct state *, struct state *);
|
||||
static struct subre *sub_re(struct vars *, int, int, struct state *, struct state *);
|
||||
static void freesubre(struct vars *, struct subre *);
|
||||
static void freesrnode(struct vars *, struct subre *);
|
||||
static int numst(struct subre *, int);
|
||||
@@ -663,7 +663,7 @@ parse(
|
||||
|
||||
assert(stopper == ')' || stopper == EOS);
|
||||
|
||||
branches = subre(v, '|', LONGER, init, final);
|
||||
branches = sub_re(v, '|', LONGER, init, final);
|
||||
NOERRN();
|
||||
branch = branches;
|
||||
firstbranch = 1;
|
||||
@@ -673,7 +673,7 @@ parse(
|
||||
* Need a place to hang the branch.
|
||||
*/
|
||||
|
||||
branch->right = subre(v, '|', LONGER, init, final);
|
||||
branch->right = sub_re(v, '|', LONGER, init, final);
|
||||
NOERRN();
|
||||
branch = branch->right;
|
||||
}
|
||||
@@ -744,7 +744,7 @@ parsebranch(
|
||||
|
||||
lp = left;
|
||||
seencontent = 0;
|
||||
t = subre(v, '=', 0, left, right); /* op '=' is tentative */
|
||||
t = sub_re(v, '=', 0, left, right); /* op '=' is tentative */
|
||||
NOERRN();
|
||||
while (!SEE('|') && !SEE(stopper) && !SEE(EOS)) {
|
||||
if (seencontent) { /* implicit concat operator */
|
||||
@@ -977,7 +977,7 @@ parseqatom(
|
||||
NOERR();
|
||||
if (cap) {
|
||||
v->subs[subno] = atom;
|
||||
t = subre(v, '(', atom->flags|CAP, lp, rp);
|
||||
t = sub_re(v, '(', atom->flags|CAP, lp, rp);
|
||||
NOERR();
|
||||
t->subno = subno;
|
||||
t->left = atom;
|
||||
@@ -995,7 +995,7 @@ parseqatom(
|
||||
INSIST(v->subs[v->nextvalue] != NULL, REG_ESUBREG);
|
||||
NOERR();
|
||||
assert(v->nextvalue > 0);
|
||||
atom = subre(v, 'b', BACKR, lp, rp);
|
||||
atom = sub_re(v, 'b', BACKR, lp, rp);
|
||||
NOERR();
|
||||
subno = v->nextvalue;
|
||||
atom->subno = subno;
|
||||
@@ -1110,7 +1110,7 @@ parseqatom(
|
||||
*/
|
||||
|
||||
if (atom == NULL) {
|
||||
atom = subre(v, '=', 0, lp, rp);
|
||||
atom = sub_re(v, '=', 0, lp, rp);
|
||||
NOERR();
|
||||
}
|
||||
|
||||
@@ -1147,7 +1147,7 @@ parseqatom(
|
||||
* Break remaining subRE into x{...} and what follows.
|
||||
*/
|
||||
|
||||
t = subre(v, '.', COMBINE(qprefer, atom->flags), lp, rp);
|
||||
t = sub_re(v, '.', COMBINE(qprefer, atom->flags), lp, rp);
|
||||
NOERR();
|
||||
t->left = atom;
|
||||
atomp = &t->left;
|
||||
@@ -1161,7 +1161,7 @@ parseqatom(
|
||||
*/
|
||||
|
||||
assert(top->op == '=' && top->left == NULL && top->right == NULL);
|
||||
top->left = subre(v, '=', top->flags, top->begin, lp);
|
||||
top->left = sub_re(v, '=', top->flags, top->begin, lp);
|
||||
NOERR();
|
||||
top->op = '.';
|
||||
top->right = t;
|
||||
@@ -1230,9 +1230,9 @@ parseqatom(
|
||||
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 */
|
||||
t = sub_re(v, '.', f, s, atom->end); /* prefix and atom */
|
||||
NOERR();
|
||||
t->left = subre(v, '=', PREF(f), s, atom->begin);
|
||||
t->left = sub_re(v, '=', PREF(f), s, atom->begin);
|
||||
NOERR();
|
||||
t->right = atom;
|
||||
*atomp = t;
|
||||
@@ -1247,7 +1247,7 @@ parseqatom(
|
||||
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);
|
||||
t = sub_re(v, '*', f, s, s2);
|
||||
NOERR();
|
||||
t->min = (short) m;
|
||||
t->max = (short) n;
|
||||
@@ -1265,7 +1265,7 @@ parseqatom(
|
||||
t->right = parsebranch(v, stopper, type, s2, rp, 1);
|
||||
} else {
|
||||
EMPTYARC(s2, rp);
|
||||
t->right = subre(v, '=', 0, s2, rp);
|
||||
t->right = sub_re(v, '=', 0, s2, rp);
|
||||
}
|
||||
NOERR();
|
||||
assert(SEE('|') || SEE(stopper) || SEE(EOS));
|
||||
@@ -1717,12 +1717,12 @@ wordchrs(
|
||||
}
|
||||
|
||||
/*
|
||||
- subre - allocate a subre
|
||||
^ static struct subre *subre(struct vars *, int, int, struct state *,
|
||||
- sub_re - allocate a subre
|
||||
^ static struct subre *sub_re(struct vars *, int, int, struct state *,
|
||||
^ struct state *);
|
||||
*/
|
||||
static struct subre *
|
||||
subre(
|
||||
sub_re(
|
||||
struct vars *v,
|
||||
int op,
|
||||
int flags,
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ struct dfa {
|
||||
chr *lastnopr; /* location of last cache-flushed NOPROGRESS */
|
||||
struct sset *search; /* replacement-search-pointer memory */
|
||||
int cptsmalloced; /* were the areas individually malloced? */
|
||||
char *mallocarea; /* self, or master malloced area, or NULL */
|
||||
char *mallocarea; /* self, or malloced area, or NULL */
|
||||
};
|
||||
|
||||
#define WORK 1 /* number of work bitvectors needed */
|
||||
|
||||
+8
-8
@@ -316,12 +316,12 @@ declare 85 {
|
||||
int flags)
|
||||
}
|
||||
declare 86 {
|
||||
int Tcl_CreateAlias(Tcl_Interp *slave, const char *slaveCmd,
|
||||
int Tcl_CreateAlias(Tcl_Interp *childInterp, const char *childCmd,
|
||||
Tcl_Interp *target, const char *targetCmd, int argc,
|
||||
const char *const *argv)
|
||||
}
|
||||
declare 87 {
|
||||
int Tcl_CreateAliasObj(Tcl_Interp *slave, const char *slaveCmd,
|
||||
int Tcl_CreateAliasObj(Tcl_Interp *childInterp, const char *childCmd,
|
||||
Tcl_Interp *target, const char *targetCmd, int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
}
|
||||
@@ -364,7 +364,7 @@ declare 96 {
|
||||
Tcl_CmdDeleteProc *deleteProc)
|
||||
}
|
||||
declare 97 {
|
||||
Tcl_Interp *Tcl_CreateSlave(Tcl_Interp *interp, const char *slaveName,
|
||||
Tcl_Interp *Tcl_CreateChild(Tcl_Interp *interp, const char *name,
|
||||
int isSafe)
|
||||
}
|
||||
declare 98 {
|
||||
@@ -527,12 +527,12 @@ declare 147 {deprecated {see TIP #559. Use Tcl_ResetResult}} {
|
||||
void Tcl_FreeResult(Tcl_Interp *interp)
|
||||
}
|
||||
declare 148 {
|
||||
int Tcl_GetAlias(Tcl_Interp *interp, const char *slaveCmd,
|
||||
int Tcl_GetAlias(Tcl_Interp *interp, const char *childCmd,
|
||||
Tcl_Interp **targetInterpPtr, const char **targetCmdPtr,
|
||||
int *argcPtr, const char ***argvPtr)
|
||||
}
|
||||
declare 149 {
|
||||
int Tcl_GetAliasObj(Tcl_Interp *interp, const char *slaveCmd,
|
||||
int Tcl_GetAliasObj(Tcl_Interp *interp, const char *childCmd,
|
||||
Tcl_Interp **targetInterpPtr, const char **targetCmdPtr,
|
||||
int *objcPtr, Tcl_Obj ***objv)
|
||||
}
|
||||
@@ -582,10 +582,10 @@ declare 162 {
|
||||
const char *Tcl_GetHostName(void)
|
||||
}
|
||||
declare 163 {
|
||||
int Tcl_GetInterpPath(Tcl_Interp *interp, Tcl_Interp *slaveInterp)
|
||||
int Tcl_GetInterpPath(Tcl_Interp *interp, Tcl_Interp *childInterp)
|
||||
}
|
||||
declare 164 {
|
||||
Tcl_Interp *Tcl_GetMaster(Tcl_Interp *interp)
|
||||
Tcl_Interp *Tcl_GetParent(Tcl_Interp *interp)
|
||||
}
|
||||
declare 165 {
|
||||
const char *Tcl_GetNameOfExecutable(void)
|
||||
@@ -616,7 +616,7 @@ declare 171 {
|
||||
int Tcl_GetServiceMode(void)
|
||||
}
|
||||
declare 172 {
|
||||
Tcl_Interp *Tcl_GetSlave(Tcl_Interp *interp, const char *slaveName)
|
||||
Tcl_Interp *Tcl_GetChild(Tcl_Interp *interp, const char *name)
|
||||
}
|
||||
declare 173 {
|
||||
Tcl_Channel Tcl_GetStdChannel(int type)
|
||||
|
||||
+8
-5
@@ -361,7 +361,7 @@ typedef long LONG;
|
||||
*/
|
||||
|
||||
#if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
|
||||
# if defined(_MSC_VER) || defined(_WIN32)
|
||||
# if defined(_WIN32) && (!defined(__USE_MINGW_ANSI_STDIO) || !__USE_MINGW_ANSI_STDIO)
|
||||
# define TCL_WIDE_INT_TYPE __int64
|
||||
# define TCL_LL_MODIFIER "I64"
|
||||
# if defined(_WIN64)
|
||||
@@ -973,11 +973,14 @@ typedef struct Tcl_DString {
|
||||
#define TCL_DONT_QUOTE_HASH 8
|
||||
|
||||
/*
|
||||
* Flag that may be passed to Tcl_GetIndexFromObj to force it to disallow
|
||||
* abbreviated strings.
|
||||
* Flags that may be passed to Tcl_GetIndexFromObj.
|
||||
* TCL_EXACT disallows abbreviated strings.
|
||||
* TCL_INDEX_TEMP_TABLE disallows caching of lookups. A possible use case is
|
||||
* a table that will not live long enough to make it worthwhile.
|
||||
*/
|
||||
|
||||
#define TCL_EXACT 1
|
||||
#define TCL_EXACT 1
|
||||
#define TCL_INDEX_TEMP_TABLE 2
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
@@ -2476,7 +2479,7 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
|
||||
# define Tcl_DecrRefCount(objPtr) \
|
||||
do { \
|
||||
Tcl_Obj *_objPtr = (objPtr); \
|
||||
if ((_objPtr)->refCount-- <= 1) { \
|
||||
if (_objPtr->refCount-- <= 1) { \
|
||||
TclFreeObj(_objPtr); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
#include "tclInt.h"
|
||||
#if !TCL_THREADS || !defined(USE_THREAD_ALLOC)
|
||||
|
||||
#if USE_TCLALLOC
|
||||
#if defined(USE_TCLALLOC) && USE_TCLALLOC
|
||||
|
||||
/*
|
||||
* We should really make use of AC_CHECK_TYPE(caddr_t) here, but it can wait
|
||||
|
||||
@@ -131,7 +131,7 @@ enum BasicBlockFlags {
|
||||
* Source instruction type recognized by the assembler.
|
||||
*/
|
||||
|
||||
typedef enum TalInstType {
|
||||
typedef enum {
|
||||
ASSEM_1BYTE, /* Fixed arity, 1-byte instruction */
|
||||
ASSEM_BEGIN_CATCH, /* Begin catch: one 4-byte jump offset to be
|
||||
* converted to appropriate exception
|
||||
@@ -145,8 +145,6 @@ typedef enum TalInstType {
|
||||
* 1 */
|
||||
ASSEM_DICT_GET, /* 'dict get' and related - consumes N+1
|
||||
* operands, produces 1, N > 0 */
|
||||
ASSEM_DICT_GET_DEF, /* 'dict getwithdefault' - consumes N+2
|
||||
* operands, produces 1, N > 0 */
|
||||
ASSEM_DICT_SET, /* specifies key count and LVT index, consumes
|
||||
* N+1 operands, produces 1, N > 0 */
|
||||
ASSEM_DICT_UNSET, /* specifies key count and LVT index, consumes
|
||||
@@ -189,8 +187,10 @@ typedef enum TalInstType {
|
||||
* produces N */
|
||||
ASSEM_SINT1, /* One 1-byte signed-integer operand
|
||||
* (INCR_STK_IMM) */
|
||||
ASSEM_SINT4_LVT4 /* Signed 4-byte integer operand followed by
|
||||
ASSEM_SINT4_LVT4, /* Signed 4-byte integer operand followed by
|
||||
* LVT entry. Fixed arity */
|
||||
ASSEM_DICT_GET_DEF /* 'dict getwithdefault' - consumes N+2
|
||||
* operands, produces 1, N > 0 */
|
||||
} TalInstType;
|
||||
|
||||
/*
|
||||
@@ -815,7 +815,7 @@ TclNRAssembleObjCmd(
|
||||
Tcl_AddErrorInfo(interp, "\n (\"");
|
||||
Tcl_AppendObjToErrorInfo(interp, objv[0]);
|
||||
Tcl_AddErrorInfo(interp, "\" body, line ");
|
||||
backtrace = Tcl_NewWideIntObj(Tcl_GetErrorLine(interp));
|
||||
TclNewIntObj(backtrace, Tcl_GetErrorLine(interp));
|
||||
Tcl_AppendObjToErrorInfo(interp, backtrace);
|
||||
Tcl_AddErrorInfo(interp, ")");
|
||||
return TCL_ERROR;
|
||||
@@ -1266,7 +1266,7 @@ AssembleOneLine(
|
||||
Tcl_Obj* instNameObj; /* Name of the instruction */
|
||||
int tblIdx; /* Index in TalInstructionTable of the
|
||||
* instruction */
|
||||
enum TalInstType instType; /* Type of the instruction */
|
||||
TalInstType instType; /* Type of the instruction */
|
||||
Tcl_Obj* operand1Obj = NULL;
|
||||
/* First operand to the instruction */
|
||||
const char* operand1; /* String rep of the operand */
|
||||
@@ -2098,8 +2098,9 @@ GetNextOperand(
|
||||
* with \-substitutions done. */
|
||||
{
|
||||
Tcl_Interp* interp = (Tcl_Interp*) assemEnvPtr->envPtr->iPtr;
|
||||
Tcl_Obj* operandObj = Tcl_NewObj();
|
||||
Tcl_Obj* operandObj;
|
||||
|
||||
TclNewObj(operandObj);
|
||||
if (!TclWordKnownAtCompileTime(*tokenPtrPtr, operandObj)) {
|
||||
Tcl_DecrRefCount(operandObj);
|
||||
if (assemEnvPtr->flags & TCL_EVAL_DIRECT) {
|
||||
@@ -4269,7 +4270,7 @@ AddBasicBlockRangeToErrorInfo(
|
||||
Tcl_Obj* lineNo; /* Line number in the source */
|
||||
|
||||
Tcl_AddErrorInfo(interp, "\n in assembly code between lines ");
|
||||
lineNo = Tcl_NewWideIntObj(bbPtr->startLine);
|
||||
TclNewIntObj(lineNo, bbPtr->startLine);
|
||||
Tcl_IncrRefCount(lineNo);
|
||||
Tcl_AppendObjToErrorInfo(interp, lineNo);
|
||||
Tcl_AddErrorInfo(interp, " and ");
|
||||
|
||||
+56
-55
@@ -684,7 +684,7 @@ Tcl_CreateInterp(void)
|
||||
TclRegisterCommandTypeName(TclEnsembleImplementationCmd, "ensemble");
|
||||
TclRegisterCommandTypeName(TclAliasObjCmd, "alias");
|
||||
TclRegisterCommandTypeName(TclLocalAliasObjCmd, "alias");
|
||||
TclRegisterCommandTypeName(TclSlaveObjCmd, "interp");
|
||||
TclRegisterCommandTypeName(TclChildObjCmd, "interp");
|
||||
TclRegisterCommandTypeName(TclInvokeImportedCmd, "import");
|
||||
TclRegisterCommandTypeName(TclOOPublicObjectCmd, "object");
|
||||
TclRegisterCommandTypeName(TclOOPrivateObjectCmd, "privateObject");
|
||||
@@ -708,7 +708,7 @@ Tcl_CreateInterp(void)
|
||||
#endif
|
||||
iPtr->freeProc = NULL;
|
||||
iPtr->errorLine = 0;
|
||||
iPtr->objResultPtr = Tcl_NewObj();
|
||||
TclNewObj(iPtr->objResultPtr);
|
||||
Tcl_IncrRefCount(iPtr->objResultPtr);
|
||||
iPtr->handle = TclHandleCreate(iPtr);
|
||||
iPtr->globalNsPtr = NULL;
|
||||
@@ -796,8 +796,7 @@ Tcl_CreateInterp(void)
|
||||
iPtr->activeInterpTracePtr = NULL;
|
||||
iPtr->assocData = NULL;
|
||||
iPtr->execEnvPtr = NULL; /* Set after namespaces initialized. */
|
||||
iPtr->emptyObjPtr = Tcl_NewObj();
|
||||
/* Another empty object. */
|
||||
TclNewObj(iPtr->emptyObjPtr); /* Another empty object. */
|
||||
Tcl_IncrRefCount(iPtr->emptyObjPtr);
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
iPtr->resultSpace[0] = 0;
|
||||
@@ -863,7 +862,7 @@ Tcl_CreateInterp(void)
|
||||
* TIP #285, Script cancellation support.
|
||||
*/
|
||||
|
||||
iPtr->asyncCancelMsg = Tcl_NewObj();
|
||||
TclNewObj(iPtr->asyncCancelMsg);
|
||||
|
||||
cancelInfo = (CancelInfo *)ckalloc(sizeof(CancelInfo));
|
||||
cancelInfo->interp = interp;
|
||||
@@ -2785,6 +2784,8 @@ TclCreateObjCommandInNs(
|
||||
Command *refCmdPtr = oldRefPtr->importedCmdPtr;
|
||||
|
||||
dataPtr = (ImportedCmdData*)refCmdPtr->objClientData;
|
||||
cmdPtr->refCount++;
|
||||
TclCleanupCommandMacro(dataPtr->realCmdPtr);
|
||||
dataPtr->realCmdPtr = cmdPtr;
|
||||
oldRefPtr = oldRefPtr->nextPtr;
|
||||
}
|
||||
@@ -2988,7 +2989,7 @@ TclRenameCommand(
|
||||
}
|
||||
|
||||
cmdNsPtr = cmdPtr->nsPtr;
|
||||
oldFullName = Tcl_NewObj();
|
||||
TclNewObj(oldFullName);
|
||||
Tcl_IncrRefCount(oldFullName);
|
||||
Tcl_GetCommandFullName(interp, cmd, oldFullName);
|
||||
|
||||
@@ -3374,7 +3375,7 @@ Tcl_GetCommandFullName(
|
||||
* separator, and the command name.
|
||||
*/
|
||||
|
||||
if (cmdPtr != NULL) {
|
||||
if ((cmdPtr != NULL) && TclRoutineHasName(cmdPtr)) {
|
||||
if (cmdPtr->nsPtr != NULL) {
|
||||
Tcl_AppendToObj(objPtr, cmdPtr->nsPtr->fullName, -1);
|
||||
if (cmdPtr->nsPtr != iPtr->globalNsPtr) {
|
||||
@@ -3464,7 +3465,7 @@ Tcl_DeleteCommandFromToken(
|
||||
* and skip nested deletes.
|
||||
*/
|
||||
|
||||
if (cmdPtr->flags & CMD_IS_DELETED) {
|
||||
if (cmdPtr->flags & CMD_DYING) {
|
||||
/*
|
||||
* Another deletion is already in progress. Remove the hash table
|
||||
* entry now, but don't invoke a callback or free the command
|
||||
@@ -3496,7 +3497,7 @@ Tcl_DeleteCommandFromToken(
|
||||
* be ignored.
|
||||
*/
|
||||
|
||||
cmdPtr->flags |= CMD_IS_DELETED;
|
||||
cmdPtr->flags |= CMD_DYING;
|
||||
|
||||
/*
|
||||
* Call trace functions for the command being deleted. Then delete its
|
||||
@@ -3526,7 +3527,7 @@ Tcl_DeleteCommandFromToken(
|
||||
}
|
||||
|
||||
/*
|
||||
* The list of command exported from the namespace might have changed.
|
||||
* The list of commands exported from the namespace might have changed.
|
||||
* However, we do not need to recompute this just yet; next time we need
|
||||
* the info will be soon enough.
|
||||
*/
|
||||
@@ -3661,7 +3662,7 @@ CallCommandTraces(
|
||||
* While a rename trace is active, we will not process any more rename
|
||||
* traces; while a delete trace is active we will never reach here -
|
||||
* because Tcl_DeleteCommandFromToken checks for the condition
|
||||
* (cmdPtr->flags & CMD_IS_DELETED) and returns immediately when a
|
||||
* (cmdPtr->flags & CMD_DYING) and returns immediately when a
|
||||
* command deletion is in progress. For all other traces, delete
|
||||
* traces will not be invoked but a call to TraceCommandProc will
|
||||
* ensure that tracePtr->clientData is freed whenever the command
|
||||
@@ -3792,7 +3793,7 @@ CancelEvalProc(
|
||||
TclSetCancelFlags(iPtr, cancelInfo->flags | CANCELED);
|
||||
|
||||
/*
|
||||
* Now, we must set the script cancellation flags on all the slave
|
||||
* Now, we must set the script cancellation flags on all the child
|
||||
* interpreters belonging to this one.
|
||||
*/
|
||||
|
||||
@@ -4041,7 +4042,7 @@ OldMathFuncProc(
|
||||
if (funcResult.type == TCL_INT) {
|
||||
TclNewIntObj(valuePtr, funcResult.intValue);
|
||||
} else if (funcResult.type == TCL_WIDE_INT) {
|
||||
valuePtr = Tcl_NewWideIntObj(funcResult.wideValue);
|
||||
TclNewIntObj(valuePtr, funcResult.wideValue);
|
||||
} else {
|
||||
return CheckDoubleResult(interp, funcResult.doubleValue);
|
||||
}
|
||||
@@ -4200,7 +4201,7 @@ Tcl_ListMathFuncs(
|
||||
if (TCL_OK == Tcl_EvalObjEx(interp, script, 0)) {
|
||||
result = Tcl_DuplicateObj(Tcl_GetObjResult(interp));
|
||||
} else {
|
||||
result = Tcl_NewObj();
|
||||
TclNewObj(result);
|
||||
}
|
||||
Tcl_DecrRefCount(script);
|
||||
Tcl_RestoreInterpState(interp, state);
|
||||
@@ -4321,7 +4322,7 @@ TclResetCancellation(
|
||||
* Tcl_Canceled --
|
||||
*
|
||||
* Check if the script in progress has been canceled, i.e.,
|
||||
* Tcl_CancelEval was called for this interpreter or any of its master
|
||||
* Tcl_CancelEval was called for this interpreter or any of its parent
|
||||
* interpreters.
|
||||
*
|
||||
* Results:
|
||||
@@ -5214,7 +5215,7 @@ TEOV_RunLeaveTraces(
|
||||
int length;
|
||||
const char *command = TclGetStringFromObj(commandPtr, &length);
|
||||
|
||||
if (!(cmdPtr->flags & CMD_IS_DELETED)) {
|
||||
if (!(cmdPtr->flags & CMD_DYING)) {
|
||||
if (cmdPtr->flags & CMD_HAS_EXEC_TRACES) {
|
||||
traceCode = TclCheckExecutionTraces(interp, command, length,
|
||||
cmdPtr, result, TCL_TRACE_LEAVE_EXEC, objc, objv);
|
||||
@@ -5407,7 +5408,7 @@ TclEvalEx(
|
||||
* the embedded command, which is refered to
|
||||
* by 'script'. The 'clNextOuter' refers to
|
||||
* the current entry in the table of
|
||||
* continuation lines in this "master script",
|
||||
* continuation lines in this "main script",
|
||||
* and the character offsets are relative to
|
||||
* the 'outerScript' as well.
|
||||
*
|
||||
@@ -6460,7 +6461,7 @@ TclNREvalObjEx(
|
||||
/*
|
||||
* Shimmer protection! Always pass an unshared obj. The caller could
|
||||
* incr the refCount of objPtr AFTER calling us! To be completely safe
|
||||
* we always make a copy. The callback takes care od the refCounts for
|
||||
* we always make a copy. The callback takes care of the refCounts for
|
||||
* both listPtr and objPtr.
|
||||
*
|
||||
* TODO: Create a test to demo this need, or eliminate it.
|
||||
@@ -7029,7 +7030,7 @@ TclObjInvoke(
|
||||
|
||||
int
|
||||
TclNRInvoke(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -7511,7 +7512,7 @@ Tcl_GetVersion(
|
||||
|
||||
static int
|
||||
ExprCeilFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -7551,7 +7552,7 @@ ExprCeilFunc(
|
||||
|
||||
static int
|
||||
ExprFloorFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -7591,7 +7592,7 @@ ExprFloorFunc(
|
||||
|
||||
static int
|
||||
ExprIsqrtFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute. */
|
||||
int objc, /* Actual parameter count. */
|
||||
Tcl_Obj *const *objv) /* Actual parameter list. */
|
||||
@@ -7697,7 +7698,7 @@ ExprIsqrtFunc(
|
||||
|
||||
static int
|
||||
ExprSqrtFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -7865,7 +7866,7 @@ ExprBinaryFunc(
|
||||
|
||||
static int
|
||||
ExprAbsFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -7964,7 +7965,7 @@ ExprAbsFunc(
|
||||
|
||||
static int
|
||||
ExprBoolFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -7985,7 +7986,7 @@ ExprBoolFunc(
|
||||
|
||||
static int
|
||||
ExprDoubleFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8012,7 +8013,7 @@ ExprDoubleFunc(
|
||||
|
||||
static int
|
||||
ExprIntFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8068,7 +8069,7 @@ ExprIntFunc(
|
||||
|
||||
static int
|
||||
ExprWideFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8089,7 +8090,7 @@ ExprWideFunc(
|
||||
*/
|
||||
static int
|
||||
ExprMaxMinFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8129,7 +8130,7 @@ ExprMaxMinFunc(
|
||||
|
||||
static int
|
||||
ExprMaxFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8140,7 +8141,7 @@ ExprMaxFunc(
|
||||
|
||||
static int
|
||||
ExprMinFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8151,7 +8152,7 @@ ExprMinFunc(
|
||||
|
||||
static int
|
||||
ExprRandFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8244,7 +8245,7 @@ ExprRandFunc(
|
||||
|
||||
static int
|
||||
ExprRoundFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8323,7 +8324,7 @@ ExprRoundFunc(
|
||||
|
||||
static int
|
||||
ExprSrandFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count. */
|
||||
@@ -8512,7 +8513,7 @@ ClassifyDouble(
|
||||
|
||||
static int
|
||||
ExprIsFiniteFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8543,7 +8544,7 @@ ExprIsFiniteFunc(
|
||||
|
||||
static int
|
||||
ExprIsInfinityFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8573,7 +8574,7 @@ ExprIsInfinityFunc(
|
||||
|
||||
static int
|
||||
ExprIsNaNFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8603,7 +8604,7 @@ ExprIsNaNFunc(
|
||||
|
||||
static int
|
||||
ExprIsNormalFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8633,7 +8634,7 @@ ExprIsNormalFunc(
|
||||
|
||||
static int
|
||||
ExprIsSubnormalFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8663,7 +8664,7 @@ ExprIsSubnormalFunc(
|
||||
|
||||
static int
|
||||
ExprIsUnorderedFunc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8704,7 +8705,7 @@ ExprIsUnorderedFunc(
|
||||
|
||||
static int
|
||||
FloatClassifyObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The interpreter in which to execute the
|
||||
* function. */
|
||||
int objc, /* Actual parameter count */
|
||||
@@ -8789,8 +8790,8 @@ MathFuncWrongNumArgs(
|
||||
}
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"too %s arguments for math function \"%s\"",
|
||||
(found < expected ? "few" : "many"), name));
|
||||
"%s arguments for math function \"%s\"",
|
||||
(found < expected ? "not enough" : "too many"), name));
|
||||
Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL);
|
||||
}
|
||||
|
||||
@@ -8813,7 +8814,7 @@ MathFuncWrongNumArgs(
|
||||
|
||||
static int
|
||||
DTraceObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(Tcl_Interp *),
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -9197,7 +9198,7 @@ TclSetTailcall(
|
||||
|
||||
int
|
||||
TclNRTailcallObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -9390,7 +9391,7 @@ TclNRYieldObjCmd(
|
||||
|
||||
int
|
||||
TclNRYieldToObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -9513,7 +9514,7 @@ NRCoroutineCallerCallback(
|
||||
SAVE_CONTEXT(corPtr->running);
|
||||
RESTORE_CONTEXT(corPtr->caller);
|
||||
|
||||
if (cmdPtr->flags & CMD_IS_DELETED) {
|
||||
if (cmdPtr->flags & CMD_DYING) {
|
||||
/*
|
||||
* The command was deleted while it was running: wind down the
|
||||
* execEnv, this will do the complete cleanup. RewindCoroutine will
|
||||
@@ -9700,7 +9701,7 @@ TclNREvalList(
|
||||
|
||||
static int
|
||||
CoroTypeObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -9790,7 +9791,7 @@ GetCoroutineFromObj(
|
||||
|
||||
static int
|
||||
TclNRCoroInjectObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -9835,7 +9836,7 @@ TclNRCoroInjectObjCmd(
|
||||
|
||||
static int
|
||||
TclNRCoroProbeObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -9959,7 +9960,7 @@ InjectHandler(
|
||||
* I don't think this is reachable...
|
||||
*/
|
||||
|
||||
Tcl_ListObjAppendElement(NULL, listPtr, Tcl_NewIntObj(nargs));
|
||||
Tcl_ListObjAppendElement(NULL, listPtr, Tcl_NewWideIntObj(nargs));
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, listPtr, Tcl_GetObjResult(interp));
|
||||
}
|
||||
@@ -10028,7 +10029,7 @@ InjectHandlerPostCall(
|
||||
|
||||
static int
|
||||
NRInjectObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -10137,7 +10138,7 @@ TclNRInterpCoroutine(
|
||||
|
||||
int
|
||||
TclNRCoroutineObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -10270,7 +10271,7 @@ TclNRCoroutineObjCmd(
|
||||
|
||||
int
|
||||
TclInfoCoroutineCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -10282,7 +10283,7 @@ TclInfoCoroutineCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (corPtr && !(corPtr->cmdPtr->flags & CMD_IS_DELETED)) {
|
||||
if (corPtr && !(corPtr->cmdPtr->flags & CMD_DYING)) {
|
||||
Tcl_Obj *namePtr;
|
||||
|
||||
TclNewObj(namePtr);
|
||||
|
||||
+9
-8
@@ -274,7 +274,7 @@ typedef struct ByteArray {
|
||||
* array. */
|
||||
unsigned int allocated; /* The amount of space actually allocated
|
||||
* minus 1 byte. */
|
||||
unsigned char bytes[1]; /* The array of bytes. The actual size of this
|
||||
unsigned char bytes[TCLFLEXARRAY]; /* The array of bytes. The actual size of this
|
||||
* field depends on the 'allocated' field
|
||||
* above. */
|
||||
} ByteArray;
|
||||
@@ -1163,7 +1163,7 @@ BinaryFormatCmd(
|
||||
* bytes and filling with nulls.
|
||||
*/
|
||||
|
||||
resultPtr = Tcl_NewObj();
|
||||
TclNewObj(resultPtr);
|
||||
buffer = Tcl_SetByteArrayLength(resultPtr, length);
|
||||
memset(buffer, 0, length);
|
||||
|
||||
@@ -1595,7 +1595,7 @@ BinaryScanCmd(
|
||||
}
|
||||
}
|
||||
src = buffer + offset;
|
||||
valuePtr = Tcl_NewObj();
|
||||
TclNewObj(valuePtr);
|
||||
Tcl_SetObjLength(valuePtr, count);
|
||||
dest = TclGetString(valuePtr);
|
||||
|
||||
@@ -1650,7 +1650,7 @@ BinaryScanCmd(
|
||||
}
|
||||
}
|
||||
src = buffer + offset;
|
||||
valuePtr = Tcl_NewObj();
|
||||
TclNewObj(valuePtr);
|
||||
Tcl_SetObjLength(valuePtr, count);
|
||||
dest = TclGetString(valuePtr);
|
||||
|
||||
@@ -1734,7 +1734,7 @@ BinaryScanCmd(
|
||||
if ((length - offset) < (count * size)) {
|
||||
goto done;
|
||||
}
|
||||
valuePtr = Tcl_NewObj();
|
||||
TclNewObj(valuePtr);
|
||||
src = buffer + offset;
|
||||
for (i = 0; i < count; i++) {
|
||||
elementPtr = ScanNumber(src, cmd, flags, &numberCachePtr);
|
||||
@@ -2376,8 +2376,9 @@ ScanNumber(
|
||||
return (Tcl_Obj *)Tcl_GetHashValue(hPtr);
|
||||
}
|
||||
if (tablePtr->numEntries <= BINARY_SCAN_MAX_CACHE) {
|
||||
Tcl_Obj *objPtr = Tcl_NewWideIntObj(value);
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
TclNewIntObj(objPtr, value);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
Tcl_SetHashValue(hPtr, objPtr);
|
||||
return objPtr;
|
||||
@@ -2761,7 +2762,7 @@ BinaryEncode64(
|
||||
maxlen = 0;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
data = Tcl_GetByteArrayFromObj(objv[objc - 1], &count);
|
||||
if (count > 0) {
|
||||
unsigned char *cursor = NULL;
|
||||
@@ -2913,7 +2914,7 @@ BinaryEncodeUu(
|
||||
* enough".
|
||||
*/
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
offset = 0;
|
||||
data = Tcl_GetByteArrayFromObj(objv[objc - 1], &count);
|
||||
rawLength = (lineLength - 1) * 3 / 4;
|
||||
|
||||
@@ -1288,7 +1288,7 @@ TclFinalizeMemorySubsystem(void)
|
||||
Tcl_MutexUnlock(ckallocMutexPtr);
|
||||
#endif
|
||||
|
||||
#if USE_TCLALLOC
|
||||
#if defined(USE_TCLALLOC) && USE_TCLALLOC
|
||||
TclFinalizeAllocSubsystem();
|
||||
#endif
|
||||
}
|
||||
|
||||
+1
-1
@@ -263,7 +263,7 @@ TclClockInit(
|
||||
};
|
||||
|
||||
/*
|
||||
* Safe interps get [::clock] as alias to a master, so do not need their
|
||||
* Safe interps get [::clock] as alias to a parent, so do not need their
|
||||
* own copies of the support routines.
|
||||
*/
|
||||
|
||||
|
||||
+2
-2
@@ -59,7 +59,7 @@ static int GetStatBuf(Tcl_Interp *interp, Tcl_Obj *pathPtr,
|
||||
static const char * GetTypeFromMode(int mode);
|
||||
static int StoreStatData(Tcl_Interp *interp, Tcl_Obj *varName,
|
||||
Tcl_StatBuf *statPtr);
|
||||
static inline int EachloopCmd(Tcl_Interp *interp, int collect,
|
||||
static int EachloopCmd(Tcl_Interp *interp, int collect,
|
||||
int objc, Tcl_Obj *const objv[]);
|
||||
static Tcl_NRPostProc CatchObjCmdCallback;
|
||||
static Tcl_NRPostProc ExprCallback;
|
||||
@@ -2599,7 +2599,7 @@ TclNRLmapCmd(
|
||||
return EachloopCmd(interp, TCL_EACH_COLLECT, objc, objv);
|
||||
}
|
||||
|
||||
static inline int
|
||||
static int
|
||||
EachloopCmd(
|
||||
Tcl_Interp *interp, /* Our context for variables and script
|
||||
* evaluation. */
|
||||
|
||||
+29
-23
@@ -383,7 +383,7 @@ Tcl_IncrObjCmd(
|
||||
if (objc == 3) {
|
||||
incrPtr = objv[2];
|
||||
} else {
|
||||
incrPtr = Tcl_NewWideIntObj(1);
|
||||
TclNewIntObj(incrPtr, 1);
|
||||
}
|
||||
Tcl_IncrRefCount(incrPtr);
|
||||
newValuePtr = TclIncrObjVar2(interp, objv[1], NULL,
|
||||
@@ -691,7 +691,7 @@ InfoCommandsCmd(
|
||||
if (entryPtr != NULL) {
|
||||
if (specificNsInPattern) {
|
||||
cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr);
|
||||
elemObjPtr = Tcl_NewObj();
|
||||
TclNewObj(elemObjPtr);
|
||||
Tcl_GetCommandFullName(interp, cmd, elemObjPtr);
|
||||
} else {
|
||||
cmdName = (const char *)Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr);
|
||||
@@ -742,7 +742,7 @@ InfoCommandsCmd(
|
||||
|| Tcl_StringMatch(cmdName, simplePattern)) {
|
||||
if (specificNsInPattern) {
|
||||
cmd = (Tcl_Command)Tcl_GetHashValue(entryPtr);
|
||||
elemObjPtr = Tcl_NewObj();
|
||||
TclNewObj(elemObjPtr);
|
||||
Tcl_GetCommandFullName(interp, cmd, elemObjPtr);
|
||||
} else {
|
||||
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
|
||||
@@ -969,8 +969,9 @@ InfoDefaultCmd(
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(1));
|
||||
} else {
|
||||
Tcl_Obj *nullObjPtr = Tcl_NewObj();
|
||||
Tcl_Obj *nullObjPtr;
|
||||
|
||||
TclNewObj(nullObjPtr);
|
||||
valueObjPtr = Tcl_ObjSetVar2(interp, objv[3], NULL,
|
||||
nullObjPtr, TCL_LEAVE_ERR_MSG);
|
||||
if (valueObjPtr == NULL) {
|
||||
@@ -1026,7 +1027,7 @@ InfoErrorStackCmd(
|
||||
|
||||
target = interp;
|
||||
if (objc == 2) {
|
||||
target = Tcl_GetSlave(interp, TclGetString(objv[1]));
|
||||
target = Tcl_GetChild(interp, TclGetString(objv[1]));
|
||||
if (target == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1885,7 +1886,7 @@ InfoProcsCmd(
|
||||
} else {
|
||||
simpleProcOK:
|
||||
if (specificNsInPattern) {
|
||||
elemObjPtr = Tcl_NewObj();
|
||||
TclNewObj(elemObjPtr);
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr,
|
||||
elemObjPtr);
|
||||
} else {
|
||||
@@ -1906,15 +1907,15 @@ InfoProcsCmd(
|
||||
|
||||
if (!TclIsProc(cmdPtr)) {
|
||||
realCmdPtr = (Command *)
|
||||
TclGetOriginalCommand((Tcl_Command) cmdPtr);
|
||||
TclGetOriginalCommand((Tcl_Command)cmdPtr);
|
||||
if (realCmdPtr != NULL && TclIsProc(realCmdPtr)) {
|
||||
goto procOK;
|
||||
}
|
||||
} else {
|
||||
procOK:
|
||||
if (specificNsInPattern) {
|
||||
elemObjPtr = Tcl_NewObj();
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr,
|
||||
TclNewObj(elemObjPtr);
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command)cmdPtr,
|
||||
elemObjPtr);
|
||||
} else {
|
||||
elemObjPtr = Tcl_NewStringObj(cmdName, -1);
|
||||
@@ -2142,7 +2143,7 @@ InfoCmdTypeCmd(
|
||||
}
|
||||
|
||||
/*
|
||||
* There's one special case: safe slave interpreters can't see aliases as
|
||||
* There's one special case: safe interpreters can't see aliases as
|
||||
* aliases as they're part of the security mechanisms.
|
||||
*/
|
||||
|
||||
@@ -2217,7 +2218,7 @@ Tcl_JoinObjCmd(
|
||||
} else {
|
||||
int i;
|
||||
|
||||
resObjPtr = Tcl_NewObj();
|
||||
TclNewObj(resObjPtr);
|
||||
for (i = 0; i < listLen; i++) {
|
||||
if (i > 0) {
|
||||
|
||||
@@ -3156,7 +3157,7 @@ Tcl_LsearchObjCmd(
|
||||
"-real", "-regexp", "-sorted", "-start", "-stride",
|
||||
"-subindices", NULL
|
||||
};
|
||||
enum options {
|
||||
enum lsearchoptions {
|
||||
LSEARCH_ALL, LSEARCH_ASCII, LSEARCH_BISECT, LSEARCH_DECREASING,
|
||||
LSEARCH_DICTIONARY, LSEARCH_EXACT, LSEARCH_GLOB, LSEARCH_INCREASING,
|
||||
LSEARCH_INDEX, LSEARCH_INLINE, LSEARCH_INTEGER, LSEARCH_NOCASE,
|
||||
@@ -3204,7 +3205,7 @@ Tcl_LsearchObjCmd(
|
||||
result = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
switch ((enum options) index) {
|
||||
switch ((enum lsearchoptions) index) {
|
||||
case LSEARCH_ALL: /* -all */
|
||||
allMatches = 1;
|
||||
break;
|
||||
@@ -3513,7 +3514,8 @@ Tcl_LsearchObjCmd(
|
||||
if (allMatches || inlineReturn) {
|
||||
Tcl_ResetResult(interp);
|
||||
} else {
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(-1));
|
||||
TclNewIntObj(itemPtr, TCL_INDEX_NONE);
|
||||
Tcl_SetObjResult(interp, itemPtr);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
@@ -3802,10 +3804,11 @@ Tcl_LsearchObjCmd(
|
||||
} else if (returnSubindices) {
|
||||
int j;
|
||||
|
||||
itemPtr = Tcl_NewWideIntObj(i+groupOffset);
|
||||
TclNewIntObj(itemPtr, i+groupOffset);
|
||||
for (j=0 ; j<sortInfo.indexc ; j++) {
|
||||
Tcl_ListObjAppendElement(interp, itemPtr, Tcl_NewWideIntObj(
|
||||
TclIndexDecode(sortInfo.indexv[j], listc)));
|
||||
Tcl_Obj *elObj;
|
||||
TclNewIntObj(elObj, TclIndexDecode(sortInfo.indexv[j], listc));
|
||||
Tcl_ListObjAppendElement(interp, itemPtr, elObj);
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, listPtr, itemPtr);
|
||||
} else {
|
||||
@@ -3824,14 +3827,17 @@ Tcl_LsearchObjCmd(
|
||||
if (returnSubindices) {
|
||||
int j;
|
||||
|
||||
itemPtr = Tcl_NewWideIntObj(index+groupOffset);
|
||||
TclNewIntObj(itemPtr, index+groupOffset);
|
||||
for (j=0 ; j<sortInfo.indexc ; j++) {
|
||||
Tcl_ListObjAppendElement(interp, itemPtr, Tcl_NewWideIntObj(
|
||||
TclIndexDecode(sortInfo.indexv[j], listc)));
|
||||
Tcl_Obj *elObj;
|
||||
TclNewIntObj(elObj, TclIndexDecode(sortInfo.indexv[j], listc));
|
||||
Tcl_ListObjAppendElement(interp, itemPtr, elObj);
|
||||
}
|
||||
Tcl_SetObjResult(interp, itemPtr);
|
||||
} else {
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(index));
|
||||
Tcl_Obj *elObj;
|
||||
TclNewIntObj(elObj, index);
|
||||
Tcl_SetObjResult(interp, elObj);
|
||||
}
|
||||
} else if (index < 0) {
|
||||
/*
|
||||
@@ -4414,7 +4420,7 @@ Tcl_LsortObjCmd(
|
||||
idx = elementPtr->payload.index;
|
||||
for (j = 0; j < groupSize; j++) {
|
||||
if (indices) {
|
||||
objPtr = Tcl_NewWideIntObj(idx + j - groupOffset);
|
||||
TclNewIntObj(objPtr, idx + j - groupOffset);
|
||||
newArray[i++] = objPtr;
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
} else {
|
||||
@@ -4426,7 +4432,7 @@ Tcl_LsortObjCmd(
|
||||
}
|
||||
} else if (indices) {
|
||||
for (i=0; elementPtr != NULL ; elementPtr = elementPtr->nextPtr) {
|
||||
objPtr = Tcl_NewWideIntObj(elementPtr->payload.index);
|
||||
TclNewIntObj(objPtr, elementPtr->payload.index);
|
||||
newArray[i++] = objPtr;
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
}
|
||||
|
||||
+42
-33
@@ -137,7 +137,7 @@ Tcl_RegexpObjCmd(
|
||||
"-expanded", "-line", "-linestop", "-lineanchor",
|
||||
"-nocase", "-start", "--", NULL
|
||||
};
|
||||
enum options {
|
||||
enum regexpoptions {
|
||||
REGEXP_ALL, REGEXP_ABOUT, REGEXP_INDICES, REGEXP_INLINE,
|
||||
REGEXP_EXPANDED,REGEXP_LINE, REGEXP_LINESTOP,REGEXP_LINEANCHOR,
|
||||
REGEXP_NOCASE, REGEXP_START, REGEXP_LAST
|
||||
@@ -162,7 +162,7 @@ Tcl_RegexpObjCmd(
|
||||
&index) != TCL_OK) {
|
||||
goto optionError;
|
||||
}
|
||||
switch ((enum options) index) {
|
||||
switch ((enum regexpoptions) index) {
|
||||
case REGEXP_ALL:
|
||||
all = 1;
|
||||
break;
|
||||
@@ -357,7 +357,7 @@ Tcl_RegexpObjCmd(
|
||||
|
||||
objc = info.nsubs + 1;
|
||||
if (all <= 1) {
|
||||
resultPtr = Tcl_NewObj();
|
||||
TclNewObj(resultPtr);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < objc; i++) {
|
||||
@@ -389,8 +389,8 @@ Tcl_RegexpObjCmd(
|
||||
end = -1;
|
||||
}
|
||||
|
||||
objs[0] = Tcl_NewWideIntObj(start);
|
||||
objs[1] = Tcl_NewWideIntObj(end);
|
||||
TclNewIntObj(objs[0], start);
|
||||
TclNewIntObj(objs[1], end);
|
||||
|
||||
newPtr = Tcl_NewListObj(2, objs);
|
||||
} else {
|
||||
@@ -399,7 +399,7 @@ Tcl_RegexpObjCmd(
|
||||
offset + info.matches[i].start,
|
||||
offset + info.matches[i].end - 1);
|
||||
} else {
|
||||
newPtr = Tcl_NewObj();
|
||||
TclNewObj(newPtr);
|
||||
}
|
||||
}
|
||||
if (doinline) {
|
||||
@@ -499,7 +499,7 @@ Tcl_RegsubObjCmd(
|
||||
"-linestop", "-lineanchor", "-nocase", "-start",
|
||||
"--", NULL
|
||||
};
|
||||
enum options {
|
||||
enum regsubobjoptions {
|
||||
REGSUB_ALL, REGSUB_COMMAND, REGSUB_EXPANDED, REGSUB_LINE,
|
||||
REGSUB_LINESTOP, REGSUB_LINEANCHOR, REGSUB_NOCASE, REGSUB_START,
|
||||
REGSUB_LAST
|
||||
@@ -523,7 +523,7 @@ Tcl_RegsubObjCmd(
|
||||
TCL_EXACT, &index) != TCL_OK) {
|
||||
goto optionError;
|
||||
}
|
||||
switch ((enum options) index) {
|
||||
switch ((enum regsubobjoptions) index) {
|
||||
case REGSUB_ALL:
|
||||
all = 1;
|
||||
break;
|
||||
@@ -788,7 +788,7 @@ Tcl_RegsubObjCmd(
|
||||
args[idx + numParts] = Tcl_NewUnicodeObj(
|
||||
wstring + offset + subStart, subEnd - subStart);
|
||||
} else {
|
||||
args[idx + numParts] = Tcl_NewObj();
|
||||
TclNewObj(args[idx + numParts]);
|
||||
}
|
||||
Tcl_IncrRefCount(args[idx + numParts]);
|
||||
}
|
||||
@@ -1194,7 +1194,7 @@ Tcl_SplitObjCmd(
|
||||
|
||||
stringPtr = TclGetStringFromObj(objv[1], &stringLen);
|
||||
end = stringPtr + stringLen;
|
||||
listPtr = Tcl_NewObj();
|
||||
TclNewObj(listPtr);
|
||||
|
||||
if (stringLen == 0) {
|
||||
/*
|
||||
@@ -1536,7 +1536,7 @@ StringIsCmd(
|
||||
"space", "true", "upper", "wideinteger",
|
||||
"wordchar", "xdigit", NULL
|
||||
};
|
||||
enum isClasses {
|
||||
enum isClassesEnum {
|
||||
STR_IS_ALNUM, STR_IS_ALPHA, STR_IS_ASCII, STR_IS_CONTROL,
|
||||
STR_IS_BOOL, STR_IS_DICT, STR_IS_DIGIT, STR_IS_DOUBLE,
|
||||
STR_IS_ENTIER, STR_IS_FALSE, STR_IS_GRAPH, STR_IS_INT,
|
||||
@@ -1547,7 +1547,7 @@ StringIsCmd(
|
||||
static const char *const isOptions[] = {
|
||||
"-strict", "-failindex", NULL
|
||||
};
|
||||
enum isOptions {
|
||||
enum isOptionsEnum {
|
||||
OPT_STRICT, OPT_FAILIDX
|
||||
};
|
||||
|
||||
@@ -1569,7 +1569,7 @@ StringIsCmd(
|
||||
&idx2) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum isOptions) idx2) {
|
||||
switch ((enum isOptionsEnum) idx2) {
|
||||
case OPT_STRICT:
|
||||
strict = 1;
|
||||
break;
|
||||
@@ -1598,7 +1598,7 @@ StringIsCmd(
|
||||
* When entering here, result == 1 and failat == 0.
|
||||
*/
|
||||
|
||||
switch ((enum isClasses) index) {
|
||||
switch ((enum isClassesEnum) index) {
|
||||
case STR_IS_ALNUM:
|
||||
chcomp = Tcl_UniCharIsAlnum;
|
||||
break;
|
||||
@@ -1906,10 +1906,11 @@ StringIsCmd(
|
||||
*/
|
||||
|
||||
str_is_done:
|
||||
if ((result == 0) && (failVarObj != NULL) &&
|
||||
Tcl_ObjSetVar2(interp, failVarObj, NULL, Tcl_NewWideIntObj(failat),
|
||||
TCL_LEAVE_ERR_MSG) == NULL) {
|
||||
return TCL_ERROR;
|
||||
if ((result == 0) && (failVarObj != NULL)) {
|
||||
TclNewIntObj(objPtr, failat);
|
||||
if (Tcl_ObjSetVar2(interp, failVarObj, NULL, objPtr, TCL_LEAVE_ERR_MSG) == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result));
|
||||
return TCL_OK;
|
||||
@@ -2501,6 +2502,7 @@ StringStartCmd(
|
||||
int ch;
|
||||
const char *p, *string;
|
||||
int cur, index, length, numChars;
|
||||
Tcl_Obj *obj;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string index");
|
||||
@@ -2540,7 +2542,8 @@ StringStartCmd(
|
||||
cur += 1;
|
||||
}
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(cur));
|
||||
TclNewIntObj(obj, cur);
|
||||
Tcl_SetObjResult(interp, obj);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -2571,6 +2574,7 @@ StringEndCmd(
|
||||
int ch;
|
||||
const char *p, *end, *string;
|
||||
int cur, index, length, numChars;
|
||||
Tcl_Obj *obj;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string index");
|
||||
@@ -2601,7 +2605,8 @@ StringEndCmd(
|
||||
} else {
|
||||
cur = numChars;
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(cur));
|
||||
TclNewIntObj(obj, cur);
|
||||
Tcl_SetObjResult(interp, obj);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -3479,7 +3484,7 @@ TclNRSwitchObjCmd(
|
||||
"-exact", "-glob", "-indexvar", "-matchvar", "-nocase", "-regexp",
|
||||
"--", NULL
|
||||
};
|
||||
enum options {
|
||||
enum switchOptionsEnum {
|
||||
OPT_EXACT, OPT_GLOB, OPT_INDEXV, OPT_MATCHV, OPT_NOCASE, OPT_REGEXP,
|
||||
OPT_LAST
|
||||
};
|
||||
@@ -3500,7 +3505,7 @@ TclNRSwitchObjCmd(
|
||||
&index) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum options) index) {
|
||||
switch ((enum switchOptionsEnum) index) {
|
||||
/*
|
||||
* General options.
|
||||
*/
|
||||
@@ -3770,10 +3775,11 @@ TclNRSwitchObjCmd(
|
||||
Tcl_Obj *rangeObjAry[2];
|
||||
|
||||
if (info.matches[j].end > 0) {
|
||||
rangeObjAry[0] = Tcl_NewWideIntObj(info.matches[j].start);
|
||||
rangeObjAry[1] = Tcl_NewWideIntObj(info.matches[j].end-1);
|
||||
TclNewIntObj(rangeObjAry[0], info.matches[j].start);
|
||||
TclNewIntObj(rangeObjAry[1], info.matches[j].end-1);
|
||||
} else {
|
||||
rangeObjAry[0] = rangeObjAry[1] = Tcl_NewWideIntObj(-1);
|
||||
TclNewIntObj(rangeObjAry[1], TCL_INDEX_NONE);
|
||||
rangeObjAry[0] = rangeObjAry[1];
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4165,7 +4171,7 @@ Tcl_TimeRateObjCmd(
|
||||
static const char *const options[] = {
|
||||
"-direct", "-overhead", "-calibrate", "--", NULL
|
||||
};
|
||||
enum options {
|
||||
enum timeRateOptionsEnum {
|
||||
TMRT_EV_DIRECT, TMRT_OVERHEAD, TMRT_CALIBRATE, TMRT_LAST
|
||||
};
|
||||
NRE_callback *rootPtr;
|
||||
@@ -4182,7 +4188,7 @@ Tcl_TimeRateObjCmd(
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
switch (index) {
|
||||
switch ((enum timeRateOptionsEnum)index) {
|
||||
case TMRT_EV_DIRECT:
|
||||
direct = objv[i];
|
||||
break;
|
||||
@@ -4197,6 +4203,8 @@ Tcl_TimeRateObjCmd(
|
||||
case TMRT_CALIBRATE:
|
||||
calibrate = objv[i];
|
||||
break;
|
||||
case TMRT_LAST:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4542,7 +4550,8 @@ Tcl_TimeRateObjCmd(
|
||||
#endif /* TCL_WIDE_CLICKS */
|
||||
|
||||
if (!count) { /* no iterations - avoid divide by zero */
|
||||
objs[0] = objs[2] = objs[4] = Tcl_NewWideIntObj(0);
|
||||
TclNewIntObj(objs[4], 0);
|
||||
objs[0] = objs[2] = objs[4];
|
||||
goto retRes;
|
||||
}
|
||||
|
||||
@@ -4583,7 +4592,7 @@ Tcl_TimeRateObjCmd(
|
||||
|
||||
val = usec / count; /* microsecs per iteration */
|
||||
if (val >= 1000000) {
|
||||
objs[0] = Tcl_NewWideIntObj(val);
|
||||
TclNewIntObj(objs[0], val);
|
||||
} else {
|
||||
if (val < 10) {
|
||||
digits = 6;
|
||||
@@ -4599,7 +4608,7 @@ Tcl_TimeRateObjCmd(
|
||||
objs[0] = Tcl_ObjPrintf("%.*f", digits, ((double) usec)/count);
|
||||
}
|
||||
|
||||
objs[2] = Tcl_NewWideIntObj(count); /* iterations */
|
||||
TclNewIntObj(objs[2], count); /* iterations */
|
||||
|
||||
/*
|
||||
* Calculate speed as rate (count) per sec
|
||||
@@ -4621,7 +4630,7 @@ Tcl_TimeRateObjCmd(
|
||||
objs[4] = Tcl_ObjPrintf("%.*f",
|
||||
digits, ((double) (count * 1000000)) / usec);
|
||||
} else {
|
||||
objs[4] = Tcl_NewWideIntObj(val);
|
||||
TclNewIntObj(objs[4], val);
|
||||
}
|
||||
} else {
|
||||
objs[4] = Tcl_NewWideIntObj((count / usec) * 1000000);
|
||||
@@ -4636,7 +4645,7 @@ Tcl_TimeRateObjCmd(
|
||||
if (usec >= 1) {
|
||||
objs[6] = Tcl_ObjPrintf("%.3f", (double)usec / 1000);
|
||||
} else {
|
||||
objs[6] = Tcl_NewWideIntObj(0);
|
||||
TclNewIntObj(objs[6], 0);
|
||||
}
|
||||
TclNewLiteralStringObj(objs[7], "net-ms");
|
||||
}
|
||||
@@ -4714,7 +4723,7 @@ TclNRTryObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
bodyObj = objv[1];
|
||||
handlersObj = Tcl_NewObj();
|
||||
TclNewObj(handlersObj);
|
||||
bodyShared = 0;
|
||||
haveHandlers = 0;
|
||||
for (i=2 ; i<objc ; i++) {
|
||||
|
||||
+34
-33
@@ -298,7 +298,7 @@ TclCompileArraySetCmd(
|
||||
|
||||
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
dataTokenPtr = TokenAfter(varTokenPtr);
|
||||
literalObj = Tcl_NewObj();
|
||||
TclNewObj(literalObj);
|
||||
isDataLiteral = TclWordKnownAtCompileTime(dataTokenPtr, literalObj);
|
||||
isDataValid = (isDataLiteral
|
||||
&& Tcl_ListObjLength(NULL, literalObj, &len) == TCL_OK);
|
||||
@@ -390,9 +390,9 @@ TclCompileArraySetCmd(
|
||||
keyVar = AnonymousLocal(envPtr);
|
||||
valVar = AnonymousLocal(envPtr);
|
||||
|
||||
infoPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo));
|
||||
infoPtr = (ForeachInfo *)ckalloc(offsetof(ForeachInfo, varLists) + sizeof(ForeachVarList *));
|
||||
infoPtr->numLists = 1;
|
||||
infoPtr->varLists[0] = (ForeachVarList *)ckalloc(sizeof(ForeachVarList) + sizeof(int));
|
||||
infoPtr->varLists[0] = (ForeachVarList *)ckalloc(offsetof(ForeachVarList, varIndexes) + 2 * sizeof(int));
|
||||
infoPtr->varLists[0]->numVars = 2;
|
||||
infoPtr->varLists[0]->varIndexes[0] = keyVar;
|
||||
infoPtr->varLists[0]->varIndexes[1] = valVar;
|
||||
@@ -875,10 +875,10 @@ TclCompileConcatCmd(
|
||||
* implement with a simple push.
|
||||
*/
|
||||
|
||||
listObj = Tcl_NewObj();
|
||||
TclNewObj(listObj);
|
||||
for (i = 1, tokenPtr = parsePtr->tokenPtr; i < parsePtr->numWords; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
|
||||
Tcl_DecrRefCount(objPtr);
|
||||
Tcl_DecrRefCount(listObj);
|
||||
@@ -1301,10 +1301,10 @@ TclCompileDictCreateCmd(
|
||||
*/
|
||||
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
dictObj = Tcl_NewObj();
|
||||
TclNewObj(dictObj);
|
||||
Tcl_IncrRefCount(dictObj);
|
||||
for (i=1 ; i<parsePtr->numWords ; i+=2) {
|
||||
keyObj = Tcl_NewObj();
|
||||
TclNewObj(keyObj);
|
||||
Tcl_IncrRefCount(keyObj);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, keyObj)) {
|
||||
Tcl_DecrRefCount(keyObj);
|
||||
@@ -1312,7 +1312,7 @@ TclCompileDictCreateCmd(
|
||||
goto nonConstant;
|
||||
}
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
valueObj = Tcl_NewObj();
|
||||
TclNewObj(valueObj);
|
||||
Tcl_IncrRefCount(valueObj);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, valueObj)) {
|
||||
Tcl_DecrRefCount(keyObj);
|
||||
@@ -1789,7 +1789,7 @@ TclCompileDictUpdateCmd(
|
||||
* that are to be used.
|
||||
*/
|
||||
|
||||
duiPtr = (DictUpdateInfo *)ckalloc(sizeof(DictUpdateInfo) + sizeof(int) * (numVars - 1));
|
||||
duiPtr = (DictUpdateInfo *)ckalloc(offsetof(DictUpdateInfo, varIndices) + sizeof(int) * numVars);
|
||||
duiPtr->length = numVars;
|
||||
keyTokenPtrs = (Tcl_Token **)TclStackAlloc(interp, sizeof(Tcl_Token *) * numVars);
|
||||
tokenPtr = TokenAfter(dictVarTokenPtr);
|
||||
@@ -2271,7 +2271,7 @@ DupDictUpdateInfo(
|
||||
size_t len;
|
||||
|
||||
dui1Ptr = (DictUpdateInfo *)clientData;
|
||||
len = sizeof(DictUpdateInfo) + sizeof(int) * (dui1Ptr->length - 1);
|
||||
len = offsetof(DictUpdateInfo, varIndices) + sizeof(int) * dui1Ptr->length;
|
||||
dui2Ptr = (DictUpdateInfo *)ckalloc(len);
|
||||
memcpy(dui2Ptr, dui1Ptr, len);
|
||||
return dui2Ptr;
|
||||
@@ -2311,11 +2311,12 @@ DisassembleDictUpdateInfo(
|
||||
{
|
||||
DictUpdateInfo *duiPtr = (DictUpdateInfo *)clientData;
|
||||
int i;
|
||||
Tcl_Obj *variables = Tcl_NewObj();
|
||||
Tcl_Obj *variables;
|
||||
|
||||
TclNewObj(variables);
|
||||
for (i=0 ; i<duiPtr->length ; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, variables,
|
||||
Tcl_NewIntObj(duiPtr->varIndices[i]));
|
||||
Tcl_NewWideIntObj(duiPtr->varIndices[i]));
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("variables", -1),
|
||||
variables);
|
||||
@@ -2721,8 +2722,8 @@ CompileEachloopCmd(
|
||||
*/
|
||||
|
||||
numLists = (numWords - 2)/2;
|
||||
infoPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo)
|
||||
+ (numLists - 1) * sizeof(ForeachVarList *));
|
||||
infoPtr = (ForeachInfo *)ckalloc(offsetof(ForeachInfo, varLists)
|
||||
+ numLists * sizeof(ForeachVarList *));
|
||||
infoPtr->numLists = 0; /* Count this up as we go */
|
||||
|
||||
/*
|
||||
@@ -2731,7 +2732,7 @@ CompileEachloopCmd(
|
||||
* a scalar, or if any var list needs substitutions.
|
||||
*/
|
||||
|
||||
varListObj = Tcl_NewObj();
|
||||
TclNewObj(varListObj);
|
||||
for (i = 0, tokenPtr = parsePtr->tokenPtr;
|
||||
i < numWords-1;
|
||||
i++, tokenPtr = TokenAfter(tokenPtr)) {
|
||||
@@ -2755,8 +2756,8 @@ CompileEachloopCmd(
|
||||
goto done;
|
||||
}
|
||||
|
||||
varListPtr = (ForeachVarList *)ckalloc(sizeof(ForeachVarList)
|
||||
+ (numVars - 1) * sizeof(int));
|
||||
varListPtr = (ForeachVarList *)ckalloc(offsetof(ForeachVarList, varIndexes)
|
||||
+ numVars * sizeof(int));
|
||||
varListPtr->numVars = numVars;
|
||||
infoPtr->varLists[i/2] = varListPtr;
|
||||
infoPtr->numLists++;
|
||||
@@ -2891,7 +2892,7 @@ DupForeachInfo(
|
||||
ForeachVarList *srcListPtr, *dupListPtr;
|
||||
int numVars, i, j, numLists = srcPtr->numLists;
|
||||
|
||||
dupPtr = (ForeachInfo *)ckalloc(sizeof(ForeachInfo)
|
||||
dupPtr = (ForeachInfo *)ckalloc(offsetof(ForeachInfo, varLists)
|
||||
+ numLists * sizeof(ForeachVarList *));
|
||||
dupPtr->numLists = numLists;
|
||||
dupPtr->firstValueTemp = srcPtr->firstValueTemp;
|
||||
@@ -2900,7 +2901,7 @@ DupForeachInfo(
|
||||
for (i = 0; i < numLists; i++) {
|
||||
srcListPtr = srcPtr->varLists[i];
|
||||
numVars = srcListPtr->numVars;
|
||||
dupListPtr = (ForeachVarList *)ckalloc(sizeof(ForeachVarList)
|
||||
dupListPtr = (ForeachVarList *)ckalloc(offsetof(ForeachVarList, varIndexes)
|
||||
+ numVars * sizeof(int));
|
||||
dupListPtr->numVars = numVars;
|
||||
for (j = 0; j < numVars; j++) {
|
||||
@@ -3050,10 +3051,10 @@ DisassembleForeachInfo(
|
||||
* Data stores.
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
for (i=0 ; i<infoPtr->numLists ; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, objPtr,
|
||||
Tcl_NewIntObj(infoPtr->firstValueTemp + i));
|
||||
Tcl_NewWideIntObj(infoPtr->firstValueTemp + i));
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("data", -1), objPtr);
|
||||
|
||||
@@ -3062,19 +3063,19 @@ DisassembleForeachInfo(
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("loop", -1),
|
||||
Tcl_NewIntObj(infoPtr->loopCtTemp));
|
||||
Tcl_NewWideIntObj(infoPtr->loopCtTemp));
|
||||
|
||||
/*
|
||||
* Assignment targets.
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
for (i=0 ; i<infoPtr->numLists ; i++) {
|
||||
innerPtr = Tcl_NewObj();
|
||||
TclNewObj(innerPtr);
|
||||
varsPtr = infoPtr->varLists[i];
|
||||
for (j=0 ; j<varsPtr->numVars ; j++) {
|
||||
Tcl_ListObjAppendElement(NULL, innerPtr,
|
||||
Tcl_NewIntObj(varsPtr->varIndexes[j]));
|
||||
Tcl_NewWideIntObj(varsPtr->varIndexes[j]));
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, objPtr, innerPtr);
|
||||
}
|
||||
@@ -3098,19 +3099,19 @@ DisassembleNewForeachInfo(
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("jumpOffset", -1),
|
||||
Tcl_NewIntObj(infoPtr->loopCtTemp));
|
||||
Tcl_NewWideIntObj(infoPtr->loopCtTemp));
|
||||
|
||||
/*
|
||||
* Assignment targets.
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
for (i=0 ; i<infoPtr->numLists ; i++) {
|
||||
innerPtr = Tcl_NewObj();
|
||||
TclNewObj(innerPtr);
|
||||
varsPtr = infoPtr->varLists[i];
|
||||
for (j=0 ; j<varsPtr->numVars ; j++) {
|
||||
Tcl_ListObjAppendElement(NULL, innerPtr,
|
||||
Tcl_NewIntObj(varsPtr->varIndexes[j]));
|
||||
Tcl_NewWideIntObj(varsPtr->varIndexes[j]));
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, objPtr, innerPtr);
|
||||
}
|
||||
@@ -3163,7 +3164,7 @@ TclCompileFormatCmd(
|
||||
* a case we can handle by compiling to a constant.
|
||||
*/
|
||||
|
||||
formatObj = Tcl_NewObj();
|
||||
TclNewObj(formatObj);
|
||||
Tcl_IncrRefCount(formatObj);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, formatObj)) {
|
||||
@@ -3174,7 +3175,7 @@ TclCompileFormatCmd(
|
||||
objv = (Tcl_Obj **)ckalloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
|
||||
for (i=0 ; i+2 < parsePtr->numWords ; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
objv[i] = Tcl_NewObj();
|
||||
TclNewObj(objv[i]);
|
||||
Tcl_IncrRefCount(objv[i]);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, objv[i])) {
|
||||
goto checkForStringConcatCase;
|
||||
@@ -3266,7 +3267,7 @@ TclCompileFormatCmd(
|
||||
start = Tcl_GetString(formatObj);
|
||||
/* The start of the currently-scanned literal
|
||||
* in the format string. */
|
||||
tmpObj = Tcl_NewObj(); /* The buffer used to accumulate the literal
|
||||
TclNewObj(tmpObj); /* The buffer used to accumulate the literal
|
||||
* being built. */
|
||||
for (bytes = start ; *bytes ; bytes++) {
|
||||
if (*bytes == '%') {
|
||||
@@ -3284,7 +3285,7 @@ TclCompileFormatCmd(
|
||||
if (len > 0) {
|
||||
PushLiteral(envPtr, b, len);
|
||||
Tcl_DecrRefCount(tmpObj);
|
||||
tmpObj = Tcl_NewObj();
|
||||
TclNewObj(tmpObj);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
+12
-11
@@ -53,9 +53,10 @@ TclGetIndexFromToken(
|
||||
int after,
|
||||
int *indexPtr)
|
||||
{
|
||||
Tcl_Obj *tmpObj = Tcl_NewObj();
|
||||
Tcl_Obj *tmpObj;
|
||||
int result = TCL_ERROR;
|
||||
|
||||
TclNewObj(tmpObj);
|
||||
if (TclWordKnownAtCompileTime(tokenPtr, tmpObj)) {
|
||||
result = TclIndexEncode(NULL, tmpObj, before, after, indexPtr);
|
||||
}
|
||||
@@ -598,7 +599,7 @@ TclCompileInfoCommandsCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
|
||||
goto notCompilable;
|
||||
@@ -873,7 +874,7 @@ TclCompileLappendCmd(
|
||||
*/
|
||||
|
||||
if (numWords > 2) {
|
||||
Tcl_Token *valueTokenPtr = TokenAfter(varTokenPtr);
|
||||
valueTokenPtr = TokenAfter(varTokenPtr);
|
||||
|
||||
CompileWord(envPtr, valueTokenPtr, interp, 2);
|
||||
}
|
||||
@@ -1063,7 +1064,7 @@ TclCompileLindexCmd(
|
||||
int i, idx, numWords = parsePtr->numWords;
|
||||
|
||||
/*
|
||||
* Quit if too few args.
|
||||
* Quit if not enough args.
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
@@ -1169,9 +1170,9 @@ TclCompileListCmd(
|
||||
|
||||
numWords = parsePtr->numWords;
|
||||
valueTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
listObj = Tcl_NewObj();
|
||||
TclNewObj(listObj);
|
||||
for (i = 1; i < numWords && listObj != NULL; i++) {
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
if (TclWordKnownAtCompileTime(valueTokenPtr, objPtr)) {
|
||||
(void) Tcl_ListObjAppendElement(NULL, listObj, objPtr);
|
||||
} else {
|
||||
@@ -2264,7 +2265,7 @@ TclCompileRegsubCmd(
|
||||
|
||||
Tcl_DStringInit(&pattern);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
patternObj = Tcl_NewObj();
|
||||
TclNewObj(patternObj);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) {
|
||||
goto done;
|
||||
}
|
||||
@@ -2275,7 +2276,7 @@ TclCompileRegsubCmd(
|
||||
}
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
Tcl_DecrRefCount(patternObj);
|
||||
patternObj = Tcl_NewObj();
|
||||
TclNewObj(patternObj);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) {
|
||||
goto done;
|
||||
}
|
||||
@@ -2290,7 +2291,7 @@ TclCompileRegsubCmd(
|
||||
|
||||
stringTokenPtr = TokenAfter(tokenPtr);
|
||||
tokenPtr = TokenAfter(stringTokenPtr);
|
||||
replacementObj = Tcl_NewObj();
|
||||
TclNewObj(replacementObj);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, replacementObj)) {
|
||||
goto done;
|
||||
}
|
||||
@@ -2440,7 +2441,7 @@ TclCompileReturnCmd(
|
||||
*/
|
||||
|
||||
for (objc = 0; objc < numOptionWords; objc++) {
|
||||
objv[objc] = Tcl_NewObj();
|
||||
TclNewObj(objv[objc]);
|
||||
Tcl_IncrRefCount(objv[objc]);
|
||||
if (!TclWordKnownAtCompileTime(wordTokenPtr, objv[objc])) {
|
||||
/*
|
||||
@@ -2659,7 +2660,7 @@ TclCompileUpvarCmd(
|
||||
* Push the frame index if it is known at compile time
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
if (TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
|
||||
CallFrame *framePtr;
|
||||
|
||||
+13
-11
@@ -241,7 +241,7 @@ TclCompileStringCatCmd(
|
||||
folded = NULL;
|
||||
wordTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
for (i = 1; i < numWords; i++) {
|
||||
obj = Tcl_NewObj();
|
||||
TclNewObj(obj);
|
||||
if (TclWordKnownAtCompileTime(wordTokenPtr, obj)) {
|
||||
if (folded) {
|
||||
Tcl_AppendObjToObj(folded, obj);
|
||||
@@ -462,7 +462,7 @@ TclCompileStringInsertCmd(
|
||||
TCL_INDEX_END, &idx)) {
|
||||
|
||||
/* Nothing useful knowable - cease compile; let it direct eval */
|
||||
return TCL_OK;
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/* Compute and push the string to be inserted */
|
||||
@@ -511,7 +511,7 @@ TclCompileStringIsCmd(
|
||||
"true", "upper", "wideinteger", "wordchar",
|
||||
"xdigit", NULL
|
||||
};
|
||||
enum isClasses {
|
||||
enum isClassesEnum {
|
||||
STR_IS_ALNUM, STR_IS_ALPHA, STR_IS_ASCII, STR_IS_CONTROL,
|
||||
STR_IS_BOOL, STR_IS_DICT, STR_IS_DIGIT, STR_IS_DOUBLE, STR_IS_ENTIER,
|
||||
STR_IS_FALSE, STR_IS_GRAPH, STR_IS_INT, STR_IS_LIST,
|
||||
@@ -526,7 +526,7 @@ TclCompileStringIsCmd(
|
||||
if (parsePtr->numWords < 3 || parsePtr->numWords > 6) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
isClass = Tcl_NewObj();
|
||||
TclNewObj(isClass);
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, isClass)) {
|
||||
Tcl_DecrRefCount(isClass);
|
||||
return TCL_ERROR;
|
||||
@@ -575,7 +575,7 @@ TclCompileStringIsCmd(
|
||||
|
||||
CompileWord(envPtr, tokenPtr, interp, parsePtr->numWords-1);
|
||||
|
||||
switch ((enum isClasses) t) {
|
||||
switch ((enum isClassesEnum) t) {
|
||||
case STR_IS_ALNUM:
|
||||
strClassType = STR_CLASS_ALNUM;
|
||||
goto compileStrClass;
|
||||
@@ -930,7 +930,7 @@ TclCompileStringMapCmd(
|
||||
}
|
||||
mapTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
stringTokenPtr = TokenAfter(mapTokenPtr);
|
||||
mapObj = Tcl_NewObj();
|
||||
TclNewObj(mapObj);
|
||||
Tcl_IncrRefCount(mapObj);
|
||||
if (!TclWordKnownAtCompileTime(mapTokenPtr, mapObj)) {
|
||||
Tcl_DecrRefCount(mapObj);
|
||||
@@ -1461,7 +1461,7 @@ TclCompileSubstCmd(
|
||||
objv = (Tcl_Obj **)TclStackAlloc(interp, /*numArgs*/ numOpts * sizeof(Tcl_Obj *));
|
||||
|
||||
for (objc = 0; objc < /*numArgs*/ numOpts; objc++) {
|
||||
objv[objc] = Tcl_NewObj();
|
||||
TclNewObj(objv[objc]);
|
||||
Tcl_IncrRefCount(objv[objc]);
|
||||
if (!TclWordKnownAtCompileTime(wordTokenPtr, objv[objc])) {
|
||||
objc++;
|
||||
@@ -2610,18 +2610,19 @@ DisassembleJumptableInfo(
|
||||
TCL_UNUSED(unsigned int))
|
||||
{
|
||||
JumptableInfo *jtPtr = (JumptableInfo *)clientData;
|
||||
Tcl_Obj *mapping = Tcl_NewObj();
|
||||
Tcl_Obj *mapping;
|
||||
Tcl_HashEntry *hPtr;
|
||||
Tcl_HashSearch search;
|
||||
const char *keyPtr;
|
||||
int offset;
|
||||
size_t offset;
|
||||
|
||||
TclNewObj(mapping);
|
||||
hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search);
|
||||
for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) {
|
||||
keyPtr = (const char *)Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
|
||||
offset = PTR2INT(Tcl_GetHashValue(hPtr));
|
||||
Tcl_DictObjPut(NULL, mapping, Tcl_NewStringObj(keyPtr, -1),
|
||||
Tcl_NewIntObj(offset));
|
||||
Tcl_NewWideIntObj(offset));
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("mapping", -1), mapping);
|
||||
}
|
||||
@@ -3623,8 +3624,9 @@ TclCompileUnsetCmd(
|
||||
*/
|
||||
|
||||
for (i=1,varTokenPtr=parsePtr->tokenPtr ; i<parsePtr->numWords ; i++) {
|
||||
Tcl_Obj *leadingWord = Tcl_NewObj();
|
||||
Tcl_Obj *leadingWord;
|
||||
|
||||
TclNewObj(leadingWord);
|
||||
varTokenPtr = TokenAfter(varTokenPtr);
|
||||
if (!TclWordKnownAtCompileTime(varTokenPtr, leadingWord)) {
|
||||
TclDecrRefCount(leadingWord);
|
||||
|
||||
+69
-21
@@ -164,6 +164,8 @@ enum Marks {
|
||||
* "=" is encountered. */
|
||||
#define INVALID 5 /* A parse error. Used when any punctuation
|
||||
* appears that's not a supported operator. */
|
||||
#define COMMENT 6 /* Comment. Lasts to end of line or end of
|
||||
* expression, whichever comes first. */
|
||||
|
||||
/* Leaf lexemes */
|
||||
|
||||
@@ -462,7 +464,7 @@ static const unsigned char Lexeme[] = {
|
||||
INVALID /* FS */, INVALID /* GS */,
|
||||
INVALID /* RS */, INVALID /* US */,
|
||||
INVALID /* SPACE */, 0 /* ! or != */,
|
||||
QUOTED /* " */, INVALID /* # */,
|
||||
QUOTED /* " */, 0 /* # */,
|
||||
VARIABLE /* $ */, MOD /* % */,
|
||||
0 /* & or && */, INVALID /* ' */,
|
||||
OPEN_PAREN /* ( */, CLOSE_PAREN /* ) */,
|
||||
@@ -674,9 +676,10 @@ ParseExpr(
|
||||
OpNode *newPtr = NULL;
|
||||
|
||||
do {
|
||||
if (size <= UINT_MAX/sizeof(OpNode)) {
|
||||
newPtr = (OpNode *)attemptckrealloc(nodes, size * sizeof(OpNode));
|
||||
}
|
||||
if (size <= UINT_MAX/sizeof(OpNode)) {
|
||||
newPtr = (OpNode *) attemptckrealloc(nodes,
|
||||
size * sizeof(OpNode));
|
||||
}
|
||||
} while ((newPtr == NULL)
|
||||
&& ((size -= (size - nodesUsed) / 2) > nodesUsed));
|
||||
if (newPtr == NULL) {
|
||||
@@ -708,6 +711,10 @@ ParseExpr(
|
||||
int b;
|
||||
|
||||
switch (lexeme) {
|
||||
case COMMENT:
|
||||
start += scanned;
|
||||
numBytes -= scanned;
|
||||
continue;
|
||||
case INVALID:
|
||||
msg = Tcl_ObjPrintf("invalid character \"%.*s\"",
|
||||
scanned, start);
|
||||
@@ -742,6 +749,32 @@ ParseExpr(
|
||||
} else if (Tcl_GetBooleanFromObj(NULL,literal,&b) == TCL_OK) {
|
||||
lexeme = BOOLEAN;
|
||||
} else {
|
||||
/*
|
||||
* Tricky case: see test expr-62.10
|
||||
*/
|
||||
|
||||
int scanned2 = scanned;
|
||||
do {
|
||||
scanned2 += TclParseAllWhiteSpace(
|
||||
start + scanned2, numBytes - scanned2);
|
||||
scanned2 += ParseLexeme(
|
||||
start + scanned2, numBytes - scanned2, &lexeme,
|
||||
NULL);
|
||||
} while (lexeme == COMMENT);
|
||||
if (lexeme == OPEN_PAREN) {
|
||||
/*
|
||||
* Actually a function call, but with obscuring
|
||||
* comments. Skip to the start of the parentheses.
|
||||
* Note that we assume that open parentheses are one
|
||||
* byte long.
|
||||
*/
|
||||
|
||||
lexeme = FUNCTION;
|
||||
Tcl_ListObjAppendElement(NULL, funcList, literal);
|
||||
scanned = scanned2 - 1;
|
||||
break;
|
||||
}
|
||||
|
||||
Tcl_DecrRefCount(literal);
|
||||
msg = Tcl_ObjPrintf("invalid bareword \"%.*s%s\"",
|
||||
(scanned < limit) ? scanned : limit - 3, start,
|
||||
@@ -1009,7 +1042,7 @@ ParseExpr(
|
||||
* later.
|
||||
*/
|
||||
|
||||
literal = Tcl_NewObj();
|
||||
TclNewObj(literal);
|
||||
if (TclWordKnownAtCompileTime(tokenPtr, literal)) {
|
||||
Tcl_ListObjAppendElement(NULL, litList, literal);
|
||||
complete = lastParsed = OT_LITERAL;
|
||||
@@ -1836,11 +1869,13 @@ Tcl_ParseExpr(
|
||||
{
|
||||
int code;
|
||||
OpNode *opTree = NULL; /* Will point to the tree of operators. */
|
||||
Tcl_Obj *litList = Tcl_NewObj(); /* List to hold the literals. */
|
||||
Tcl_Obj *funcList = Tcl_NewObj(); /* List to hold the functon names. */
|
||||
Tcl_Obj *litList; /* List to hold the literals. */
|
||||
Tcl_Obj *funcList; /* List to hold the functon names. */
|
||||
Tcl_Parse *exprParsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
|
||||
/* Holds the Tcl_Tokens of substitutions. */
|
||||
|
||||
TclNewObj(litList);
|
||||
TclNewObj(funcList);
|
||||
if (numBytes < 0) {
|
||||
numBytes = (start ? strlen(start) : 0);
|
||||
}
|
||||
@@ -1892,7 +1927,7 @@ ParseLexeme(
|
||||
storage, if non-NULL. */
|
||||
{
|
||||
const char *end;
|
||||
int scanned;
|
||||
int scanned, size;
|
||||
Tcl_UniChar ch = 0;
|
||||
Tcl_Obj *literal = NULL;
|
||||
unsigned char byte;
|
||||
@@ -1907,6 +1942,16 @@ ParseLexeme(
|
||||
return 1;
|
||||
}
|
||||
switch (byte) {
|
||||
case '#':
|
||||
/*
|
||||
* Scan forward over the comment contents.
|
||||
*/
|
||||
for (size = 0; byte != '\n' && byte != 0 && size < numBytes; size++) {
|
||||
byte = UCHAR(start[size]);
|
||||
}
|
||||
*lexemePtr = COMMENT;
|
||||
return size - (byte == '\n');
|
||||
|
||||
case '*':
|
||||
if ((numBytes > 1) && (start[1] == '*')) {
|
||||
*lexemePtr = EXPON;
|
||||
@@ -2040,7 +2085,7 @@ ParseLexeme(
|
||||
break;
|
||||
}
|
||||
|
||||
literal = Tcl_NewObj();
|
||||
TclNewObj(literal);
|
||||
if (TclParseNumber(NULL, literal, NULL, start, numBytes, &end,
|
||||
TCL_PARSE_NO_WHITESPACE) == TCL_OK) {
|
||||
if (end < start + numBytes && !TclIsBareword(*end)) {
|
||||
@@ -2154,12 +2199,15 @@ TclCompileExpr(
|
||||
int optimize) /* 0 for one-off expressions. */
|
||||
{
|
||||
OpNode *opTree = NULL; /* Will point to the tree of operators */
|
||||
Tcl_Obj *litList = Tcl_NewObj(); /* List to hold the literals */
|
||||
Tcl_Obj *funcList = Tcl_NewObj(); /* List to hold the functon names*/
|
||||
Tcl_Obj *litList; /* List to hold the literals */
|
||||
Tcl_Obj *funcList; /* List to hold the functon names*/
|
||||
Tcl_Parse *parsePtr = (Tcl_Parse *)TclStackAlloc(interp, sizeof(Tcl_Parse));
|
||||
/* Holds the Tcl_Tokens of substitutions */
|
||||
int code;
|
||||
|
||||
int code = ParseExpr(interp, script, numBytes, &opTree, litList,
|
||||
TclNewObj(litList);
|
||||
TclNewObj(funcList);
|
||||
code = ParseExpr(interp, script, numBytes, &opTree, litList,
|
||||
funcList, parsePtr, 0 /* parseOnly */);
|
||||
|
||||
if (code == TCL_OK) {
|
||||
@@ -2458,8 +2506,8 @@ CompileExprTree(
|
||||
if (optimize) {
|
||||
int length;
|
||||
const char *bytes = TclGetStringFromObj(literal, &length);
|
||||
int index = TclRegisterLiteral(envPtr, bytes, length, 0);
|
||||
Tcl_Obj *objPtr = TclFetchLiteral(envPtr, index);
|
||||
int idx = TclRegisterLiteral(envPtr, bytes, length, 0);
|
||||
Tcl_Obj *objPtr = TclFetchLiteral(envPtr, idx);
|
||||
|
||||
if ((objPtr->typePtr == NULL) && (literal->typePtr != NULL)) {
|
||||
/*
|
||||
@@ -2479,7 +2527,7 @@ CompileExprTree(
|
||||
objPtr->internalRep = literal->internalRep;
|
||||
literal->typePtr = NULL;
|
||||
}
|
||||
TclEmitPush(index, envPtr);
|
||||
TclEmitPush(idx, envPtr);
|
||||
} else {
|
||||
/*
|
||||
* When optimize==0, we know the expression is a one-off and
|
||||
@@ -2505,7 +2553,7 @@ CompileExprTree(
|
||||
|
||||
if (ExecConstantExprTree(interp, nodes, next, litObjvPtr)
|
||||
== TCL_OK) {
|
||||
int index;
|
||||
int idx;
|
||||
Tcl_Obj *objPtr = Tcl_GetObjResult(interp);
|
||||
|
||||
/*
|
||||
@@ -2519,8 +2567,8 @@ CompileExprTree(
|
||||
const char *bytes
|
||||
= Tcl_GetStringFromObj(objPtr, &numBytes);
|
||||
|
||||
index = TclRegisterLiteral(envPtr, bytes, numBytes, 0);
|
||||
tableValue = TclFetchLiteral(envPtr, index);
|
||||
idx = TclRegisterLiteral(envPtr, bytes, numBytes, 0);
|
||||
tableValue = TclFetchLiteral(envPtr, idx);
|
||||
if ((tableValue->typePtr == NULL) &&
|
||||
(objPtr->typePtr != NULL)) {
|
||||
/*
|
||||
@@ -2532,9 +2580,9 @@ CompileExprTree(
|
||||
objPtr->typePtr = NULL;
|
||||
}
|
||||
} else {
|
||||
index = TclAddLiteralObj(envPtr, objPtr, NULL);
|
||||
idx = TclAddLiteralObj(envPtr, objPtr, NULL);
|
||||
}
|
||||
TclEmitPush(index, envPtr);
|
||||
TclEmitPush(idx, envPtr);
|
||||
} else {
|
||||
TclCompileSyntaxError(interp, envPtr);
|
||||
}
|
||||
@@ -2711,7 +2759,7 @@ TclVariadicOpCmd(
|
||||
int code;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(occdPtr->i.identity));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(occdPtr->i.identity));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -848,7 +848,7 @@ TclSetByteCodeFromAny(
|
||||
* faster code in some cases, and more compact code in more.
|
||||
*/
|
||||
|
||||
if (Tcl_GetMaster(interp) == NULL &&
|
||||
if (Tcl_GetParent(interp) == NULL &&
|
||||
!Tcl_LimitTypeEnabled(interp, TCL_LIMIT_COMMANDS|TCL_LIMIT_TIME)
|
||||
&& IsCompactibleCompileEnv(&compEnv)) {
|
||||
TclFreeCompileEnv(&compEnv);
|
||||
@@ -1746,7 +1746,7 @@ TclWordKnownAtCompileTime(
|
||||
}
|
||||
tokenPtr++;
|
||||
if (valuePtr != NULL) {
|
||||
tempPtr = Tcl_NewObj();
|
||||
TclNewObj(tempPtr);
|
||||
Tcl_IncrRefCount(tempPtr);
|
||||
}
|
||||
while (numComponents--) {
|
||||
@@ -1834,7 +1834,7 @@ CompileCmdLiteral(
|
||||
bytes = TclGetStringFromObj(cmdObj, &numBytes);
|
||||
cmdLitIdx = TclRegisterLiteral(envPtr, bytes, numBytes, extraLiteralFlags);
|
||||
|
||||
if (cmdPtr) {
|
||||
if (cmdPtr && TclRoutineHasName(cmdPtr)) {
|
||||
TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLitIdx), cmdPtr);
|
||||
}
|
||||
TclEmitPush(cmdLitIdx, envPtr);
|
||||
@@ -2035,7 +2035,7 @@ CompileCommandTokens(
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Tcl_Token *tokenPtr = parsePtr->tokenPtr;
|
||||
ExtCmdLoc *eclPtr = envPtr->extCmdMapPtr;
|
||||
Tcl_Obj *cmdObj = Tcl_NewObj();
|
||||
Tcl_Obj *cmdObj;
|
||||
Command *cmdPtr = NULL;
|
||||
int code = TCL_ERROR;
|
||||
int cmdKnown, expand = -1;
|
||||
@@ -2050,6 +2050,7 @@ CompileCommandTokens(
|
||||
|
||||
/* Pre-Compile */
|
||||
|
||||
TclNewObj(cmdObj);
|
||||
envPtr->numCommands++;
|
||||
EnterCmdStartData(envPtr, cmdIdx,
|
||||
parsePtr->commandStart - envPtr->source, startCodeOffset);
|
||||
|
||||
@@ -991,7 +991,7 @@ typedef struct JumpFixupArray {
|
||||
|
||||
typedef struct ForeachVarList {
|
||||
int numVars; /* The number of variables in the list. */
|
||||
int varIndexes[1]; /* An array of the indexes ("slot numbers")
|
||||
int varIndexes[TCLFLEXARRAY];/* An array of the indexes ("slot numbers")
|
||||
* for each variable in the procedure's array
|
||||
* of local variables. Only scalar variables
|
||||
* are supported. The actual size of this
|
||||
@@ -1015,7 +1015,7 @@ typedef struct ForeachInfo {
|
||||
* the loop's iteration count. Used to
|
||||
* determine next value list element to assign
|
||||
* each loop var. */
|
||||
ForeachVarList *varLists[1];/* An array of pointers to ForeachVarList
|
||||
ForeachVarList *varLists[TCLFLEXARRAY];/* An array of pointers to ForeachVarList
|
||||
* structures describing each var list. The
|
||||
* actual size of this field will be large
|
||||
* enough to numVars indexes. THIS MUST BE THE
|
||||
@@ -1046,7 +1046,7 @@ MODULE_SCOPE const AuxDataType tclJumptableInfoType;
|
||||
|
||||
typedef struct {
|
||||
int length; /* Size of array */
|
||||
int varIndices[1]; /* Array of variable indices to manage when
|
||||
int varIndices[TCLFLEXARRAY]; /* Array of variable indices to manage when
|
||||
* processing the start and end of a [dict
|
||||
* update]. There is really more than one
|
||||
* entry, and the structure is allocated to
|
||||
|
||||
+7
-7
@@ -2787,7 +2787,7 @@ TclClockOldscanObjCmd(
|
||||
yyHaveRel = 0;
|
||||
yyRelMonth = 0; yyRelDay = 0; yyRelSeconds = 0; yyRelPointer = NULL;
|
||||
|
||||
dateInfo.messages = Tcl_NewObj();
|
||||
TclNewObj(dateInfo.messages);
|
||||
dateInfo.separatrix = "";
|
||||
Tcl_IncrRefCount(dateInfo.messages);
|
||||
|
||||
@@ -2844,8 +2844,8 @@ TclClockOldscanObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
result = Tcl_NewObj();
|
||||
resultElement = Tcl_NewObj();
|
||||
TclNewObj(result);
|
||||
TclNewObj(resultElement);
|
||||
if (yyHaveDate) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyYear));
|
||||
@@ -2863,7 +2863,7 @@ TclClockOldscanObjCmd(
|
||||
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
|
||||
}
|
||||
|
||||
resultElement = Tcl_NewObj();
|
||||
TclNewObj(resultElement);
|
||||
if (yyHaveZone) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) -yyTimezone));
|
||||
@@ -2872,7 +2872,7 @@ TclClockOldscanObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, result, resultElement);
|
||||
|
||||
resultElement = Tcl_NewObj();
|
||||
TclNewObj(resultElement);
|
||||
if (yyHaveRel) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyRelMonth));
|
||||
@@ -2883,7 +2883,7 @@ TclClockOldscanObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, result, resultElement);
|
||||
|
||||
resultElement = Tcl_NewObj();
|
||||
TclNewObj(resultElement);
|
||||
if (yyHaveDay && !yyHaveDate) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyDayOrdinal));
|
||||
@@ -2892,7 +2892,7 @@ TclClockOldscanObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, result, resultElement);
|
||||
|
||||
resultElement = Tcl_NewObj();
|
||||
TclNewObj(resultElement);
|
||||
if (yyHaveOrdinalMonth) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyMonthOrdinal));
|
||||
|
||||
+28
-26
@@ -300,13 +300,13 @@ EXTERN int Tcl_ConvertElement(const char *src, char *dst,
|
||||
EXTERN int Tcl_ConvertCountedElement(const char *src,
|
||||
int length, char *dst, int flags);
|
||||
/* 86 */
|
||||
EXTERN int Tcl_CreateAlias(Tcl_Interp *slave,
|
||||
const char *slaveCmd, Tcl_Interp *target,
|
||||
EXTERN int Tcl_CreateAlias(Tcl_Interp *childInterp,
|
||||
const char *childCmd, Tcl_Interp *target,
|
||||
const char *targetCmd, int argc,
|
||||
const char *const *argv);
|
||||
/* 87 */
|
||||
EXTERN int Tcl_CreateAliasObj(Tcl_Interp *slave,
|
||||
const char *slaveCmd, Tcl_Interp *target,
|
||||
EXTERN int Tcl_CreateAliasObj(Tcl_Interp *childInterp,
|
||||
const char *childCmd, Tcl_Interp *target,
|
||||
const char *targetCmd, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
/* 88 */
|
||||
@@ -345,8 +345,8 @@ EXTERN Tcl_Command Tcl_CreateObjCommand(Tcl_Interp *interp,
|
||||
ClientData clientData,
|
||||
Tcl_CmdDeleteProc *deleteProc);
|
||||
/* 97 */
|
||||
EXTERN Tcl_Interp * Tcl_CreateSlave(Tcl_Interp *interp,
|
||||
const char *slaveName, int isSafe);
|
||||
EXTERN Tcl_Interp * Tcl_CreateChild(Tcl_Interp *interp, const char *name,
|
||||
int isSafe);
|
||||
/* 98 */
|
||||
EXTERN Tcl_TimerToken Tcl_CreateTimerHandler(int milliseconds,
|
||||
Tcl_TimerProc *proc, ClientData clientData);
|
||||
@@ -482,13 +482,13 @@ TCL_DEPRECATED("see TIP #559. Use Tcl_ResetResult")
|
||||
void Tcl_FreeResult(Tcl_Interp *interp);
|
||||
/* 148 */
|
||||
EXTERN int Tcl_GetAlias(Tcl_Interp *interp,
|
||||
const char *slaveCmd,
|
||||
const char *childCmd,
|
||||
Tcl_Interp **targetInterpPtr,
|
||||
const char **targetCmdPtr, int *argcPtr,
|
||||
const char ***argvPtr);
|
||||
/* 149 */
|
||||
EXTERN int Tcl_GetAliasObj(Tcl_Interp *interp,
|
||||
const char *slaveCmd,
|
||||
const char *childCmd,
|
||||
Tcl_Interp **targetInterpPtr,
|
||||
const char **targetCmdPtr, int *objcPtr,
|
||||
Tcl_Obj ***objv);
|
||||
@@ -528,9 +528,9 @@ EXTERN int Tcl_GetErrno(void);
|
||||
EXTERN const char * Tcl_GetHostName(void);
|
||||
/* 163 */
|
||||
EXTERN int Tcl_GetInterpPath(Tcl_Interp *interp,
|
||||
Tcl_Interp *slaveInterp);
|
||||
Tcl_Interp *childInterp);
|
||||
/* 164 */
|
||||
EXTERN Tcl_Interp * Tcl_GetMaster(Tcl_Interp *interp);
|
||||
EXTERN Tcl_Interp * Tcl_GetParent(Tcl_Interp *interp);
|
||||
/* 165 */
|
||||
EXTERN const char * Tcl_GetNameOfExecutable(void);
|
||||
/* 166 */
|
||||
@@ -556,8 +556,7 @@ EXTERN int Tcl_GetsObj(Tcl_Channel chan, Tcl_Obj *objPtr);
|
||||
/* 171 */
|
||||
EXTERN int Tcl_GetServiceMode(void);
|
||||
/* 172 */
|
||||
EXTERN Tcl_Interp * Tcl_GetSlave(Tcl_Interp *interp,
|
||||
const char *slaveName);
|
||||
EXTERN Tcl_Interp * Tcl_GetChild(Tcl_Interp *interp, const char *name);
|
||||
/* 173 */
|
||||
EXTERN Tcl_Channel Tcl_GetStdChannel(int type);
|
||||
/* 174 */
|
||||
@@ -2034,8 +2033,8 @@ typedef struct TclStubs {
|
||||
char * (*tcl_Concat) (int argc, const char *const *argv); /* 83 */
|
||||
int (*tcl_ConvertElement) (const char *src, char *dst, int flags); /* 84 */
|
||||
int (*tcl_ConvertCountedElement) (const char *src, int length, char *dst, int flags); /* 85 */
|
||||
int (*tcl_CreateAlias) (Tcl_Interp *slave, const char *slaveCmd, Tcl_Interp *target, const char *targetCmd, int argc, const char *const *argv); /* 86 */
|
||||
int (*tcl_CreateAliasObj) (Tcl_Interp *slave, const char *slaveCmd, Tcl_Interp *target, const char *targetCmd, int objc, Tcl_Obj *const objv[]); /* 87 */
|
||||
int (*tcl_CreateAlias) (Tcl_Interp *childInterp, const char *childCmd, Tcl_Interp *target, const char *targetCmd, int argc, const char *const *argv); /* 86 */
|
||||
int (*tcl_CreateAliasObj) (Tcl_Interp *childInterp, const char *childCmd, Tcl_Interp *target, const char *targetCmd, int objc, Tcl_Obj *const objv[]); /* 87 */
|
||||
Tcl_Channel (*tcl_CreateChannel) (const Tcl_ChannelType *typePtr, const char *chanName, ClientData instanceData, int mask); /* 88 */
|
||||
void (*tcl_CreateChannelHandler) (Tcl_Channel chan, int mask, Tcl_ChannelProc *proc, ClientData clientData); /* 89 */
|
||||
void (*tcl_CreateCloseHandler) (Tcl_Channel chan, Tcl_CloseProc *proc, ClientData clientData); /* 90 */
|
||||
@@ -2045,7 +2044,7 @@ typedef struct TclStubs {
|
||||
Tcl_Interp * (*tcl_CreateInterp) (void); /* 94 */
|
||||
TCL_DEPRECATED_API("") void (*tcl_CreateMathFunc) (Tcl_Interp *interp, const char *name, int numArgs, Tcl_ValueType *argTypes, Tcl_MathProc *proc, ClientData clientData); /* 95 */
|
||||
Tcl_Command (*tcl_CreateObjCommand) (Tcl_Interp *interp, const char *cmdName, Tcl_ObjCmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc); /* 96 */
|
||||
Tcl_Interp * (*tcl_CreateSlave) (Tcl_Interp *interp, const char *slaveName, int isSafe); /* 97 */
|
||||
Tcl_Interp * (*tcl_CreateChild) (Tcl_Interp *interp, const char *name, int isSafe); /* 97 */
|
||||
Tcl_TimerToken (*tcl_CreateTimerHandler) (int milliseconds, Tcl_TimerProc *proc, ClientData clientData); /* 98 */
|
||||
Tcl_Trace (*tcl_CreateTrace) (Tcl_Interp *interp, int level, Tcl_CmdTraceProc *proc, ClientData clientData); /* 99 */
|
||||
void (*tcl_DeleteAssocData) (Tcl_Interp *interp, const char *name); /* 100 */
|
||||
@@ -2096,8 +2095,8 @@ typedef struct TclStubs {
|
||||
Tcl_HashEntry * (*tcl_FirstHashEntry) (Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 145 */
|
||||
int (*tcl_Flush) (Tcl_Channel chan); /* 146 */
|
||||
TCL_DEPRECATED_API("see TIP #559. Use Tcl_ResetResult") void (*tcl_FreeResult) (Tcl_Interp *interp); /* 147 */
|
||||
int (*tcl_GetAlias) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *argcPtr, const char ***argvPtr); /* 148 */
|
||||
int (*tcl_GetAliasObj) (Tcl_Interp *interp, const char *slaveCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 149 */
|
||||
int (*tcl_GetAlias) (Tcl_Interp *interp, const char *childCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *argcPtr, const char ***argvPtr); /* 148 */
|
||||
int (*tcl_GetAliasObj) (Tcl_Interp *interp, const char *childCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 149 */
|
||||
ClientData (*tcl_GetAssocData) (Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc **procPtr); /* 150 */
|
||||
Tcl_Channel (*tcl_GetChannel) (Tcl_Interp *interp, const char *chanName, int *modePtr); /* 151 */
|
||||
int (*tcl_GetChannelBufferSize) (Tcl_Channel chan); /* 152 */
|
||||
@@ -2111,8 +2110,8 @@ typedef struct TclStubs {
|
||||
const char * (*tcl_GetCommandName) (Tcl_Interp *interp, Tcl_Command command); /* 160 */
|
||||
int (*tcl_GetErrno) (void); /* 161 */
|
||||
const char * (*tcl_GetHostName) (void); /* 162 */
|
||||
int (*tcl_GetInterpPath) (Tcl_Interp *interp, Tcl_Interp *slaveInterp); /* 163 */
|
||||
Tcl_Interp * (*tcl_GetMaster) (Tcl_Interp *interp); /* 164 */
|
||||
int (*tcl_GetInterpPath) (Tcl_Interp *interp, Tcl_Interp *childInterp); /* 163 */
|
||||
Tcl_Interp * (*tcl_GetParent) (Tcl_Interp *interp); /* 164 */
|
||||
const char * (*tcl_GetNameOfExecutable) (void); /* 165 */
|
||||
Tcl_Obj * (*tcl_GetObjResult) (Tcl_Interp *interp); /* 166 */
|
||||
#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */
|
||||
@@ -2128,7 +2127,7 @@ typedef struct TclStubs {
|
||||
int (*tcl_Gets) (Tcl_Channel chan, Tcl_DString *dsPtr); /* 169 */
|
||||
int (*tcl_GetsObj) (Tcl_Channel chan, Tcl_Obj *objPtr); /* 170 */
|
||||
int (*tcl_GetServiceMode) (void); /* 171 */
|
||||
Tcl_Interp * (*tcl_GetSlave) (Tcl_Interp *interp, const char *slaveName); /* 172 */
|
||||
Tcl_Interp * (*tcl_GetChild) (Tcl_Interp *interp, const char *name); /* 172 */
|
||||
Tcl_Channel (*tcl_GetStdChannel) (int type); /* 173 */
|
||||
const char * (*tcl_GetStringResult) (Tcl_Interp *interp); /* 174 */
|
||||
TCL_DEPRECATED_API("No longer in use, changed to macro") const char * (*tcl_GetVar) (Tcl_Interp *interp, const char *varName, int flags); /* 175 */
|
||||
@@ -2825,8 +2824,8 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_CreateMathFunc) /* 95 */
|
||||
#define Tcl_CreateObjCommand \
|
||||
(tclStubsPtr->tcl_CreateObjCommand) /* 96 */
|
||||
#define Tcl_CreateSlave \
|
||||
(tclStubsPtr->tcl_CreateSlave) /* 97 */
|
||||
#define Tcl_CreateChild \
|
||||
(tclStubsPtr->tcl_CreateChild) /* 97 */
|
||||
#define Tcl_CreateTimerHandler \
|
||||
(tclStubsPtr->tcl_CreateTimerHandler) /* 98 */
|
||||
#define Tcl_CreateTrace \
|
||||
@@ -2959,8 +2958,8 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_GetHostName) /* 162 */
|
||||
#define Tcl_GetInterpPath \
|
||||
(tclStubsPtr->tcl_GetInterpPath) /* 163 */
|
||||
#define Tcl_GetMaster \
|
||||
(tclStubsPtr->tcl_GetMaster) /* 164 */
|
||||
#define Tcl_GetParent \
|
||||
(tclStubsPtr->tcl_GetParent) /* 164 */
|
||||
#define Tcl_GetNameOfExecutable \
|
||||
(tclStubsPtr->tcl_GetNameOfExecutable) /* 165 */
|
||||
#define Tcl_GetObjResult \
|
||||
@@ -2981,8 +2980,8 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_GetsObj) /* 170 */
|
||||
#define Tcl_GetServiceMode \
|
||||
(tclStubsPtr->tcl_GetServiceMode) /* 171 */
|
||||
#define Tcl_GetSlave \
|
||||
(tclStubsPtr->tcl_GetSlave) /* 172 */
|
||||
#define Tcl_GetChild \
|
||||
(tclStubsPtr->tcl_GetChild) /* 172 */
|
||||
#define Tcl_GetStdChannel \
|
||||
(tclStubsPtr->tcl_GetStdChannel) /* 173 */
|
||||
#define Tcl_GetStringResult \
|
||||
@@ -4183,5 +4182,8 @@ extern const TclStubs *tclStubsPtr;
|
||||
# define Tcl_UtfCharComplete(src, length) (((unsigned)((unsigned char)*(src) - 0xF0) < 5) \
|
||||
? ((length) >= 4) : tclStubsPtr->tcl_UtfCharComplete((src), (length)))
|
||||
#endif
|
||||
#define Tcl_CreateSlave Tcl_CreateChild
|
||||
#define Tcl_GetSlave Tcl_GetChild
|
||||
#define Tcl_GetMaster Tcl_GetParent
|
||||
|
||||
#endif /* _TCLDECLS */
|
||||
|
||||
@@ -2037,7 +2037,7 @@ DictSizeCmd(
|
||||
}
|
||||
result = Tcl_DictObjSize(interp, objv[1], &size);
|
||||
if (result == TCL_OK) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(size));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(size));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -2212,7 +2212,7 @@ DictIncrCmd(
|
||||
Tcl_DictObjPut(NULL, dictPtr, objv[2], objv[3]);
|
||||
}
|
||||
} else {
|
||||
Tcl_DictObjPut(NULL, dictPtr, objv[2], Tcl_NewIntObj(1));
|
||||
Tcl_DictObjPut(NULL, dictPtr, objv[2], Tcl_NewWideIntObj(1));
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
@@ -2226,8 +2226,9 @@ DictIncrCmd(
|
||||
if (objc == 4) {
|
||||
code = TclIncrObj(interp, valuePtr, objv[3]);
|
||||
} else {
|
||||
Tcl_Obj *incrPtr = Tcl_NewIntObj(1);
|
||||
Tcl_Obj *incrPtr;
|
||||
|
||||
TclNewIntObj(incrPtr, 1);
|
||||
Tcl_IncrRefCount(incrPtr);
|
||||
code = TclIncrObj(interp, valuePtr, incrPtr);
|
||||
TclDecrRefCount(incrPtr);
|
||||
|
||||
+27
-24
@@ -284,7 +284,7 @@ DisassembleByteCodeObj(
|
||||
PrintSourceToObj(bufferObj, codePtr->source,
|
||||
TclMin(codePtr->numSrcBytes, 55));
|
||||
GetLocationInformation(codePtr->procPtr, &fileObj, &line);
|
||||
if (line > -1 && fileObj != NULL) {
|
||||
if (line >= 0 && fileObj != NULL) {
|
||||
Tcl_AppendPrintfToObj(bufferObj, "\n File \"%s\" Line %d",
|
||||
Tcl_GetString(fileObj), line);
|
||||
}
|
||||
@@ -804,8 +804,9 @@ Tcl_Obj *
|
||||
TclNewInstNameObj(
|
||||
unsigned char inst)
|
||||
{
|
||||
Tcl_Obj *objPtr = Tcl_NewObj();
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
TclNewObj(objPtr);
|
||||
TclInvalidateStringRep(objPtr);
|
||||
InstNameSetIntRep(objPtr, (long) inst);
|
||||
|
||||
@@ -950,7 +951,7 @@ DisassembleByteCodeAsDicts(
|
||||
* Get the literals from the bytecode.
|
||||
*/
|
||||
|
||||
literals = Tcl_NewObj();
|
||||
TclNewObj(literals);
|
||||
for (i=0 ; i<codePtr->numLitObjects ; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, literals, codePtr->objArrayPtr[i]);
|
||||
}
|
||||
@@ -959,7 +960,7 @@ DisassembleByteCodeAsDicts(
|
||||
* Get the variables from the bytecode.
|
||||
*/
|
||||
|
||||
variables = Tcl_NewObj();
|
||||
TclNewObj(variables);
|
||||
if (codePtr->procPtr) {
|
||||
int localCount = codePtr->procPtr->numCompiledLocals;
|
||||
CompiledLocal *localPtr = codePtr->procPtr->firstLocalPtr;
|
||||
@@ -967,7 +968,7 @@ DisassembleByteCodeAsDicts(
|
||||
for (i=0 ; i<localCount ; i++,localPtr=localPtr->nextPtr) {
|
||||
Tcl_Obj *descriptor[2];
|
||||
|
||||
descriptor[0] = Tcl_NewObj();
|
||||
TclNewObj(descriptor[0]);
|
||||
if (!(localPtr->flags & (VAR_ARRAY|VAR_LINK))) {
|
||||
Tcl_ListObjAppendElement(NULL, descriptor[0],
|
||||
Tcl_NewStringObj("scalar", -1));
|
||||
@@ -1007,12 +1008,12 @@ DisassembleByteCodeAsDicts(
|
||||
* Get the instructions from the bytecode.
|
||||
*/
|
||||
|
||||
instructions = Tcl_NewObj();
|
||||
TclNewObj(instructions);
|
||||
for (pc=codePtr->codeStart; pc<codePtr->codeStart+codePtr->numCodeBytes;){
|
||||
const InstructionDesc *instDesc = &tclInstructionTable[*pc];
|
||||
int address = pc - codePtr->codeStart;
|
||||
|
||||
inst = Tcl_NewObj();
|
||||
TclNewObj(inst);
|
||||
Tcl_ListObjAppendElement(NULL, inst, Tcl_NewStringObj(
|
||||
instDesc->name, -1));
|
||||
opnd = pc + 1;
|
||||
@@ -1034,7 +1035,7 @@ DisassembleByteCodeAsDicts(
|
||||
val = TclGetUInt4AtPtr(opnd);
|
||||
opnd += 4;
|
||||
formatNumber:
|
||||
Tcl_ListObjAppendElement(NULL, inst, Tcl_NewIntObj(val));
|
||||
Tcl_ListObjAppendElement(NULL, inst, Tcl_NewWideIntObj(val));
|
||||
break;
|
||||
|
||||
case OPERAND_OFFSET1:
|
||||
@@ -1102,7 +1103,7 @@ DisassembleByteCodeAsDicts(
|
||||
Tcl_Panic("opcode %d with more than zero 'no' operands", *pc);
|
||||
}
|
||||
}
|
||||
Tcl_DictObjPut(NULL, instructions, Tcl_NewIntObj(address), inst);
|
||||
Tcl_DictObjPut(NULL, instructions, Tcl_NewWideIntObj(address), inst);
|
||||
pc += instDesc->numBytes;
|
||||
}
|
||||
|
||||
@@ -1110,21 +1111,23 @@ DisassembleByteCodeAsDicts(
|
||||
* Get the auxiliary data from the bytecode.
|
||||
*/
|
||||
|
||||
aux = Tcl_NewObj();
|
||||
TclNewObj(aux);
|
||||
for (i=0 ; i<codePtr->numAuxDataItems ; i++) {
|
||||
AuxData *auxData = &codePtr->auxDataArrayPtr[i];
|
||||
Tcl_Obj *auxDesc = Tcl_NewStringObj(auxData->type->name, -1);
|
||||
|
||||
if (auxData->type->disassembleProc) {
|
||||
Tcl_Obj *desc = Tcl_NewObj();
|
||||
Tcl_Obj *desc;
|
||||
|
||||
TclNewObj(desc);
|
||||
Tcl_DictObjPut(NULL, desc, Tcl_NewStringObj("name", -1), auxDesc);
|
||||
auxDesc = desc;
|
||||
auxData->type->disassembleProc(auxData->clientData, auxDesc,
|
||||
codePtr, 0);
|
||||
} else if (auxData->type->printProc) {
|
||||
Tcl_Obj *desc = Tcl_NewObj();
|
||||
Tcl_Obj *desc;
|
||||
|
||||
TclNewObj(desc);
|
||||
auxData->type->printProc(auxData->clientData, desc, codePtr, 0);
|
||||
Tcl_ListObjAppendElement(NULL, auxDesc, desc);
|
||||
}
|
||||
@@ -1135,7 +1138,7 @@ DisassembleByteCodeAsDicts(
|
||||
* Get the exception ranges from the bytecode.
|
||||
*/
|
||||
|
||||
exn = Tcl_NewObj();
|
||||
TclNewObj(exn);
|
||||
for (i=0 ; i<codePtr->numExceptRanges ; i++) {
|
||||
ExceptionRange *rangePtr = &codePtr->exceptArrayPtr[i];
|
||||
|
||||
@@ -1170,7 +1173,7 @@ DisassembleByteCodeAsDicts(
|
||||
? ((ptr)+=5 , TclGetInt4AtPtr((ptr)-4)) \
|
||||
: ((ptr)+=1 , TclGetInt1AtPtr((ptr)-1)))
|
||||
|
||||
commands = Tcl_NewObj();
|
||||
TclNewObj(commands);
|
||||
codeOffPtr = codePtr->codeDeltaStart;
|
||||
codeLenPtr = codePtr->codeLengthStart;
|
||||
srcOffPtr = codePtr->srcDeltaStart;
|
||||
@@ -1183,11 +1186,11 @@ DisassembleByteCodeAsDicts(
|
||||
codeLength = Decode(codeLenPtr);
|
||||
sourceOffset += Decode(srcOffPtr);
|
||||
sourceLength = Decode(srcLenPtr);
|
||||
cmd = Tcl_NewObj();
|
||||
TclNewObj(cmd);
|
||||
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("codefrom", -1),
|
||||
Tcl_NewIntObj(codeOffset));
|
||||
Tcl_NewWideIntObj(codeOffset));
|
||||
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("codeto", -1),
|
||||
Tcl_NewIntObj(codeOffset + codeLength - 1));
|
||||
Tcl_NewWideIntObj(codeOffset + codeLength - 1));
|
||||
|
||||
/*
|
||||
* Convert byte offsets to character offsets; important if multibyte
|
||||
@@ -1195,10 +1198,10 @@ DisassembleByteCodeAsDicts(
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("scriptfrom", -1),
|
||||
Tcl_NewIntObj(Tcl_NumUtfChars(codePtr->source,
|
||||
Tcl_NewWideIntObj(Tcl_NumUtfChars(codePtr->source,
|
||||
sourceOffset)));
|
||||
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("scriptto", -1),
|
||||
Tcl_NewIntObj(Tcl_NumUtfChars(codePtr->source,
|
||||
Tcl_NewWideIntObj(Tcl_NumUtfChars(codePtr->source,
|
||||
sourceOffset + sourceLength - 1)));
|
||||
Tcl_DictObjPut(NULL, cmd, Tcl_NewStringObj("script", -1),
|
||||
Tcl_NewStringObj(codePtr->source+sourceOffset, sourceLength));
|
||||
@@ -1218,7 +1221,7 @@ DisassembleByteCodeAsDicts(
|
||||
* Build the overall result.
|
||||
*/
|
||||
|
||||
description = Tcl_NewObj();
|
||||
TclNewObj(description);
|
||||
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("literals", -1),
|
||||
literals);
|
||||
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("variables", -1),
|
||||
@@ -1234,13 +1237,13 @@ DisassembleByteCodeAsDicts(
|
||||
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("namespace", -1),
|
||||
Tcl_NewStringObj(codePtr->nsPtr->fullName, -1));
|
||||
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("stackdepth", -1),
|
||||
Tcl_NewIntObj(codePtr->maxStackDepth));
|
||||
Tcl_NewWideIntObj(codePtr->maxStackDepth));
|
||||
Tcl_DictObjPut(NULL, description, Tcl_NewStringObj("exceptdepth", -1),
|
||||
Tcl_NewIntObj(codePtr->maxExceptDepth));
|
||||
if (line > -1) {
|
||||
Tcl_NewWideIntObj(codePtr->maxExceptDepth));
|
||||
if (line >= 0) {
|
||||
Tcl_DictObjPut(NULL, description,
|
||||
Tcl_NewStringObj("initiallinenumber", -1),
|
||||
Tcl_NewIntObj(line));
|
||||
Tcl_NewWideIntObj(line));
|
||||
}
|
||||
if (file) {
|
||||
Tcl_DictObjPut(NULL, description,
|
||||
|
||||
@@ -116,7 +116,7 @@ typedef struct {
|
||||
* entry in this array is 1, otherwise it is
|
||||
* 0. */
|
||||
int numSubTables; /* Length of following array. */
|
||||
EscapeSubTable subTables[1];/* Information about each EscapeSubTable used
|
||||
EscapeSubTable subTables[TCLFLEXARRAY];/* Information about each EscapeSubTable used
|
||||
* by this encoding type. The actual size is
|
||||
* as large as necessary to hold all
|
||||
* EscapeSubTables. */
|
||||
@@ -469,12 +469,13 @@ FillEncodingFileMap(void)
|
||||
*/
|
||||
|
||||
int j, numFiles;
|
||||
Tcl_Obj *directory, *matchFileList = Tcl_NewObj();
|
||||
Tcl_Obj *directory, *matchFileList;
|
||||
Tcl_Obj **filev;
|
||||
Tcl_GlobTypeData readableFiles = {
|
||||
TCL_GLOB_TYPE_FILE, TCL_GLOB_PERM_R, NULL, NULL
|
||||
};
|
||||
|
||||
TclNewObj(matchFileList);
|
||||
Tcl_ListObjIndex(NULL, searchPath, i, &directory);
|
||||
Tcl_IncrRefCount(directory);
|
||||
Tcl_IncrRefCount(matchFileList);
|
||||
@@ -915,10 +916,11 @@ Tcl_GetEncodingNames(
|
||||
Tcl_HashTable table;
|
||||
Tcl_HashSearch search;
|
||||
Tcl_HashEntry *hPtr;
|
||||
Tcl_Obj *map, *name, *result = Tcl_NewObj();
|
||||
Tcl_Obj *map, *name, *result;
|
||||
Tcl_DictSearch mapSearch;
|
||||
int dummy, done = 0;
|
||||
|
||||
TclNewObj(result);
|
||||
Tcl_InitObjHashTable(&table);
|
||||
|
||||
/*
|
||||
@@ -2053,7 +2055,7 @@ LoadEscapeEncoding(
|
||||
Tcl_DStringFree(&lineString);
|
||||
}
|
||||
|
||||
size = sizeof(EscapeEncodingData) - sizeof(EscapeSubTable)
|
||||
size = offsetof(EscapeEncodingData, subTables)
|
||||
+ Tcl_DStringLength(&escapeData);
|
||||
dataPtr = (EscapeEncodingData *)ckalloc(size);
|
||||
dataPtr->initLen = strlen(init);
|
||||
|
||||
@@ -2909,7 +2909,7 @@ TclCompileEnsemble(
|
||||
DefineLineInformation;
|
||||
Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
Tcl_Obj *mapObj, *subcmdObj, *targetCmdObj, *listObj, **elems;
|
||||
Tcl_Obj *replaced = Tcl_NewObj(), *replacement;
|
||||
Tcl_Obj *replaced, *replacement;
|
||||
Tcl_Command ensemble = (Tcl_Command) cmdPtr;
|
||||
Command *oldCmdPtr = cmdPtr, *newCmdPtr;
|
||||
int len, result, flags = 0, i, depth = 1, invokeAnyway = 0;
|
||||
@@ -2917,6 +2917,7 @@ TclCompileEnsemble(
|
||||
unsigned numBytes;
|
||||
const char *word;
|
||||
|
||||
TclNewObj(replaced);
|
||||
Tcl_IncrRefCount(replaced);
|
||||
if (parsePtr->numWords < depth + 1) {
|
||||
goto failed;
|
||||
@@ -3161,7 +3162,7 @@ TclCompileEnsemble(
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we've done the mapping process, can now actually try to compile.
|
||||
* Now that the mapping process is done we actually try to compile.
|
||||
* If there is a subcommand compiler and that successfully produces code,
|
||||
* we'll use that. Otherwise, we fall back to generating opcodes to do the
|
||||
* invoke at runtime.
|
||||
@@ -3261,9 +3262,9 @@ TclAttemptCompileProc(
|
||||
|
||||
/*
|
||||
* Advance parsePtr->tokenPtr so that it points at the last subcommand.
|
||||
* This will be wrong, but it will not matter, and it will put the
|
||||
* tokens for the arguments in the right place without the needed to
|
||||
* allocate a synthetic Tcl_Parse struct, or copy tokens around.
|
||||
* This will be wrong but it will not matter, and it will put the
|
||||
* tokens for the arguments in the right place without the need to
|
||||
* allocate a synthetic Tcl_Parse struct or copy tokens around.
|
||||
*/
|
||||
|
||||
for (i = 0; i < depth - 1; i++) {
|
||||
@@ -3420,7 +3421,7 @@ CompileToInvokedCommand(
|
||||
* the implementation.
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr);
|
||||
bytes = TclGetString(objPtr);
|
||||
if ((cmdPtr != NULL) && (cmdPtr->flags & CMD_VIA_RESOLVER)) {
|
||||
@@ -3459,8 +3460,9 @@ CompileBasicNArgCommand(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
Tcl_Obj *objPtr = Tcl_NewObj();
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
TclNewObj(objPtr);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr);
|
||||
TclCompileInvocation(interp, parsePtr->tokenPtr, objPtr,
|
||||
|
||||
+8
-8
@@ -311,7 +311,7 @@ HandleBgErrors(
|
||||
|
||||
int
|
||||
TclDefaultBgErrorHandlerObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -1046,9 +1046,9 @@ Tcl_InitSubsystems(void)
|
||||
* implementation of self-initializing locks.
|
||||
*/
|
||||
|
||||
TclInitThreadStorage(); /* Creates master hash table for
|
||||
TclInitThreadStorage(); /* Creates hash table for
|
||||
* thread local storage */
|
||||
#if USE_TCLALLOC
|
||||
#if defined(USE_TCLALLOC) && USE_TCLALLOC
|
||||
TclInitAlloc(); /* Process wide mutex init */
|
||||
#endif
|
||||
#if TCL_THREADS && defined(USE_THREAD_ALLOC)
|
||||
@@ -1163,7 +1163,7 @@ Tcl_Finalize(void)
|
||||
TclFinalizeFilesystem();
|
||||
|
||||
/*
|
||||
* Undo all Tcl_ObjType registrations, and reset the master list of free
|
||||
* Undo all Tcl_ObjType registrations, and reset the global list of free
|
||||
* Tcl_Obj's. After this returns, no more Tcl_Obj's should be allocated or
|
||||
* freed.
|
||||
*
|
||||
@@ -1398,7 +1398,7 @@ TclInThreadExit(void)
|
||||
|
||||
int
|
||||
Tcl_VwaitObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -1494,7 +1494,7 @@ VwaitVarProc(
|
||||
|
||||
int
|
||||
Tcl_UpdateObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -1502,7 +1502,7 @@ Tcl_UpdateObjCmd(
|
||||
int optionIndex;
|
||||
int flags = 0; /* Initialized to avoid compiler warning. */
|
||||
static const char *const updateOptions[] = {"idletasks", NULL};
|
||||
enum updateOptions {OPT_IDLETASKS};
|
||||
enum updateOptionsEnum {OPT_IDLETASKS};
|
||||
|
||||
if (objc == 1) {
|
||||
flags = TCL_ALL_EVENTS|TCL_DONT_WAIT;
|
||||
@@ -1511,7 +1511,7 @@ Tcl_UpdateObjCmd(
|
||||
"option", 0, &optionIndex) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum updateOptions) optionIndex) {
|
||||
switch ((enum updateOptionsEnum) optionIndex) {
|
||||
case OPT_IDLETASKS:
|
||||
flags = TCL_WINDOW_EVENTS|TCL_IDLE_EVENTS|TCL_DONT_WAIT;
|
||||
break;
|
||||
|
||||
+56
-30
@@ -855,8 +855,8 @@ TclCreateExecEnv(
|
||||
* [sizeof(Tcl_Obj*)] */
|
||||
{
|
||||
ExecEnv *eePtr = (ExecEnv *)ckalloc(sizeof(ExecEnv));
|
||||
ExecStack *esPtr = (ExecStack *)ckalloc(sizeof(ExecStack)
|
||||
+ (size_t) (size-1) * sizeof(Tcl_Obj *));
|
||||
ExecStack *esPtr = (ExecStack *)ckalloc(offsetof(ExecStack, stackWords)
|
||||
+ size * sizeof(Tcl_Obj *));
|
||||
|
||||
eePtr->execStackPtr = esPtr;
|
||||
TclNewIntObj(eePtr->constants[0], 0);
|
||||
@@ -1121,7 +1121,7 @@ GrowEvaluationStack(
|
||||
newElems = needed;
|
||||
#endif
|
||||
|
||||
newBytes = sizeof(ExecStack) + (newElems-1) * sizeof(Tcl_Obj *);
|
||||
newBytes = offsetof(ExecStack, stackWords) + newElems * sizeof(Tcl_Obj *);
|
||||
|
||||
oldPtr = esPtr;
|
||||
esPtr = (ExecStack *)ckalloc(newBytes);
|
||||
@@ -3736,7 +3736,7 @@ TEBCresume(
|
||||
TRACE(("%u %ld => ", opnd, increment));
|
||||
if (Tcl_IsShared(objPtr)) {
|
||||
objPtr->refCount--; /* We know it's shared. */
|
||||
objResultPtr = Tcl_NewWideIntObj(w+increment);
|
||||
TclNewIntObj(objResultPtr, w + increment);
|
||||
Tcl_IncrRefCount(objResultPtr);
|
||||
varPtr->value.objPtr = objResultPtr;
|
||||
} else {
|
||||
@@ -4464,7 +4464,7 @@ TEBCresume(
|
||||
CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;
|
||||
|
||||
TclNewObj(objResultPtr);
|
||||
if (corPtr && !(corPtr->cmdPtr->flags & CMD_IS_DELETED)) {
|
||||
if (corPtr && !(corPtr->cmdPtr->flags & CMD_DYING)) {
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command) corPtr->cmdPtr,
|
||||
objResultPtr);
|
||||
}
|
||||
@@ -4524,6 +4524,18 @@ TEBCresume(
|
||||
TRACE(("\"%.30s\" => ", O2S(OBJ_AT_TOS)));
|
||||
cmd = Tcl_GetCommandFromObj(interp, OBJ_AT_TOS);
|
||||
if (cmd == NULL) {
|
||||
goto instOriginError;
|
||||
}
|
||||
origCmd = TclGetOriginalCommand(cmd);
|
||||
if (origCmd == NULL) {
|
||||
origCmd = cmd;
|
||||
}
|
||||
|
||||
TclNewObj(objResultPtr);
|
||||
Tcl_GetCommandFullName(interp, origCmd, objResultPtr);
|
||||
if (TclCheckEmptyString(objResultPtr) == TCL_EMPTYSTRING_YES ) {
|
||||
Tcl_DecrRefCount(objResultPtr);
|
||||
instOriginError:
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"invalid command name \"%s\"", TclGetString(OBJ_AT_TOS)));
|
||||
DECACHE_STACK_INFO();
|
||||
@@ -4533,12 +4545,6 @@ TEBCresume(
|
||||
TRACE_APPEND(("ERROR: not command\n"));
|
||||
goto gotError;
|
||||
}
|
||||
origCmd = TclGetOriginalCommand(cmd);
|
||||
if (origCmd == NULL) {
|
||||
origCmd = cmd;
|
||||
}
|
||||
TclNewObj(objResultPtr);
|
||||
Tcl_GetCommandFullName(interp, origCmd, objResultPtr);
|
||||
TRACE_APPEND(("\"%.30s\"", O2S(OBJ_AT_TOS)));
|
||||
NEXT_INST_F(1, 1, 1);
|
||||
}
|
||||
@@ -4857,13 +4863,19 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK)
|
||||
&& !TclHasIntRep(value2Ptr, &tclListType)
|
||||
&& (TclGetIntForIndexM(NULL, value2Ptr, objc-1,
|
||||
&index) == TCL_OK)) {
|
||||
TclDecrRefCount(value2Ptr);
|
||||
tosPtr--;
|
||||
pcAdjustment = 1;
|
||||
goto lindexFastPath;
|
||||
&& !TclHasIntRep(value2Ptr, &tclListType)) {
|
||||
int code;
|
||||
|
||||
DECACHE_STACK_INFO();
|
||||
code = TclGetIntForIndexM(interp, value2Ptr, objc-1, &index);
|
||||
CACHE_STACK_INFO();
|
||||
if (code == TCL_OK) {
|
||||
TclDecrRefCount(value2Ptr);
|
||||
tosPtr--;
|
||||
pcAdjustment = 1;
|
||||
goto lindexFastPath;
|
||||
}
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
objResultPtr = TclLindexList(interp, valuePtr, value2Ptr);
|
||||
@@ -5064,7 +5076,7 @@ TEBCresume(
|
||||
|
||||
if (toIdx == TCL_INDEX_NONE) {
|
||||
emptyList:
|
||||
objResultPtr = Tcl_NewObj();
|
||||
TclNewObj(objResultPtr);
|
||||
TRACE_APPEND(("\"%.30s\"", O2S(objResultPtr)));
|
||||
NEXT_INST_F(9, 1, 1);
|
||||
}
|
||||
@@ -5298,10 +5310,13 @@ TEBCresume(
|
||||
*/
|
||||
|
||||
length = Tcl_GetCharLength(valuePtr);
|
||||
DECACHE_STACK_INFO();
|
||||
if (TclGetIntForIndexM(interp, value2Ptr, length-1, &index)!=TCL_OK) {
|
||||
CACHE_STACK_INFO();
|
||||
TRACE_ERROR(interp);
|
||||
goto gotError;
|
||||
}
|
||||
CACHE_STACK_INFO();
|
||||
|
||||
if ((index < 0) || (index >= length)) {
|
||||
TclNewObj(objResultPtr);
|
||||
@@ -5321,7 +5336,7 @@ TEBCresume(
|
||||
* practical use.
|
||||
*/
|
||||
if (ch == -1) {
|
||||
objResultPtr = Tcl_NewObj();
|
||||
TclNewObj(objResultPtr);
|
||||
} else {
|
||||
length = Tcl_UniCharToUtf(ch, buf);
|
||||
if ((ch >= 0xD800) && (length < 3)) {
|
||||
@@ -5338,13 +5353,21 @@ TEBCresume(
|
||||
TRACE(("\"%.20s\" %.20s %.20s =>",
|
||||
O2S(OBJ_AT_DEPTH(2)), O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS)));
|
||||
length = Tcl_GetCharLength(OBJ_AT_DEPTH(2)) - 1;
|
||||
|
||||
DECACHE_STACK_INFO();
|
||||
if (TclGetIntForIndexM(interp, OBJ_UNDER_TOS, length,
|
||||
&fromIdx) != TCL_OK
|
||||
|| TclGetIntForIndexM(interp, OBJ_AT_TOS, length,
|
||||
&toIdx) != TCL_OK) {
|
||||
&fromIdx) != TCL_OK) {
|
||||
CACHE_STACK_INFO();
|
||||
TRACE_ERROR(interp);
|
||||
goto gotError;
|
||||
}
|
||||
if (TclGetIntForIndexM(interp, OBJ_AT_TOS, length,
|
||||
&toIdx) != TCL_OK) {
|
||||
CACHE_STACK_INFO();
|
||||
TRACE_ERROR(interp);
|
||||
goto gotError;
|
||||
}
|
||||
CACHE_STACK_INFO();
|
||||
|
||||
if (fromIdx < 0) {
|
||||
fromIdx = 0;
|
||||
@@ -5427,14 +5450,17 @@ TEBCresume(
|
||||
endIdx = Tcl_GetCharLength(valuePtr) - 1;
|
||||
TRACE(("\"%.20s\" %s %s \"%.20s\" => ", O2S(valuePtr),
|
||||
O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), O2S(value3Ptr)));
|
||||
DECACHE_STACK_INFO();
|
||||
if (TclGetIntForIndexM(interp, OBJ_UNDER_TOS, endIdx,
|
||||
&fromIdx) != TCL_OK
|
||||
|| TclGetIntForIndexM(interp, OBJ_AT_TOS, endIdx,
|
||||
&toIdx) != TCL_OK) {
|
||||
CACHE_STACK_INFO();
|
||||
TclDecrRefCount(value3Ptr);
|
||||
TRACE_ERROR(interp);
|
||||
goto gotError;
|
||||
}
|
||||
CACHE_STACK_INFO();
|
||||
TclDecrRefCount(OBJ_AT_TOS);
|
||||
(void) POP_OBJECT();
|
||||
TclDecrRefCount(OBJ_AT_TOS);
|
||||
@@ -6130,7 +6156,7 @@ TEBCresume(
|
||||
wideResultOfArithmetic:
|
||||
TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
|
||||
if (Tcl_IsShared(valuePtr)) {
|
||||
objResultPtr = Tcl_NewWideIntObj(wResult);
|
||||
TclNewIntObj(objResultPtr, wResult);
|
||||
TRACE(("%s\n", O2S(objResultPtr)));
|
||||
NEXT_INST_F(1, 2, 1);
|
||||
}
|
||||
@@ -6401,8 +6427,8 @@ TEBCresume(
|
||||
if (TclHasIntRep(valuePtr, &tclBooleanType)) {
|
||||
objResultPtr = TCONST(1);
|
||||
} else {
|
||||
int result = (TclSetBooleanFromAny(NULL, valuePtr) == TCL_OK);
|
||||
objResultPtr = TCONST(result);
|
||||
int res = (TclSetBooleanFromAny(NULL, valuePtr) == TCL_OK);
|
||||
objResultPtr = TCONST(res);
|
||||
}
|
||||
TRACE_WITH_OBJ(("\"%.30s\" => ", O2S(valuePtr)), objResultPtr);
|
||||
NEXT_INST_F(1, 0, 1);
|
||||
@@ -6596,7 +6622,7 @@ TEBCresume(
|
||||
}
|
||||
{
|
||||
ForeachInfo *infoPtr;
|
||||
Tcl_Obj *listPtr, **elements, *tmpPtr;
|
||||
Tcl_Obj *listPtr, **elements;
|
||||
ForeachVarList *varListPtr;
|
||||
int numLists, listLen, numVars;
|
||||
int listTmpDepth;
|
||||
@@ -7020,7 +7046,7 @@ TEBCresume(
|
||||
break;
|
||||
}
|
||||
if (valuePtr == NULL) {
|
||||
Tcl_DictObjPut(NULL, dictPtr, OBJ_AT_TOS,Tcl_NewIntObj(opnd));
|
||||
Tcl_DictObjPut(NULL, dictPtr, OBJ_AT_TOS, Tcl_NewWideIntObj(opnd));
|
||||
} else {
|
||||
TclNewIntObj(value2Ptr, opnd);
|
||||
Tcl_IncrRefCount(value2Ptr);
|
||||
@@ -7538,7 +7564,7 @@ TEBCresume(
|
||||
default:
|
||||
Tcl_Panic("clockRead instruction with unknown clock#");
|
||||
}
|
||||
objResultPtr = Tcl_NewWideIntObj(wval);
|
||||
TclNewIntObj(objResultPtr, wval);
|
||||
TRACE_WITH_OBJ(("=> "), objResultPtr);
|
||||
NEXT_INST_F(2, 0, 1);
|
||||
}
|
||||
@@ -9693,7 +9719,7 @@ EvalStatsCmd(
|
||||
|
||||
#define Percent(a,b) ((a) * 100.0 / (b))
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
|
||||
numInstructions = 0.0;
|
||||
|
||||
+3
-3
@@ -904,7 +904,7 @@ FileBasename(
|
||||
}
|
||||
}
|
||||
if (resultPtr == NULL) {
|
||||
resultPtr = Tcl_NewObj();
|
||||
TclNewObj(resultPtr);
|
||||
}
|
||||
Tcl_IncrRefCount(resultPtr);
|
||||
Tcl_DecrRefCount(splitPtr);
|
||||
@@ -1085,7 +1085,7 @@ TclFileAttrsCmd(
|
||||
}
|
||||
|
||||
if (Tcl_GetIndexFromObj(interp, objv[0], attributeStrings,
|
||||
"option", INDEX_TEMP_TABLE, &index) != TCL_OK) {
|
||||
"option", TCL_INDEX_TEMP_TABLE, &index) != TCL_OK) {
|
||||
goto end;
|
||||
}
|
||||
if (Tcl_FSFileAttrsGet(interp, index, filePtr,
|
||||
@@ -1110,7 +1110,7 @@ TclFileAttrsCmd(
|
||||
|
||||
for (i = 0; i < objc ; i += 2) {
|
||||
if (Tcl_GetIndexFromObj(interp, objv[i], attributeStrings,
|
||||
"option", INDEX_TEMP_TABLE, &index) != TCL_OK) {
|
||||
"option", TCL_INDEX_TEMP_TABLE, &index) != TCL_OK) {
|
||||
goto end;
|
||||
}
|
||||
if (i + 1 == objc) {
|
||||
|
||||
+18
-8
@@ -587,7 +587,8 @@ Tcl_SplitPath(
|
||||
* plus the argv pointers and the terminating NULL pointer.
|
||||
*/
|
||||
|
||||
*argvPtr = (const char **)ckalloc((((*argcPtr) + 1) * sizeof(char *)) + size);
|
||||
*argvPtr = (const char **)ckalloc(
|
||||
((((*argcPtr) + 1) * sizeof(char *)) + size));
|
||||
|
||||
/*
|
||||
* Position p after the last argv pointer and copy the contents of the
|
||||
@@ -644,12 +645,13 @@ SplitUnixPath(
|
||||
{
|
||||
int length;
|
||||
const char *origPath = path, *elementStart;
|
||||
Tcl_Obj *result = Tcl_NewObj();
|
||||
Tcl_Obj *result;
|
||||
|
||||
/*
|
||||
* Deal with the root directory as a special case.
|
||||
*/
|
||||
|
||||
TclNewObj(result);
|
||||
if (*path == '/') {
|
||||
Tcl_Obj *rootElt;
|
||||
++path;
|
||||
@@ -735,9 +737,10 @@ SplitWinPath(
|
||||
const char *p, *elementStart;
|
||||
Tcl_PathType type = TCL_PATH_ABSOLUTE;
|
||||
Tcl_DString buf;
|
||||
Tcl_Obj *result = Tcl_NewObj();
|
||||
Tcl_Obj *result;
|
||||
Tcl_DStringInit(&buf);
|
||||
|
||||
TclNewObj(result);
|
||||
p = ExtractWinRoot(path, &buf, 0, &type);
|
||||
|
||||
/*
|
||||
@@ -977,7 +980,7 @@ Tcl_JoinPath(
|
||||
Tcl_DString *resultPtr) /* Pointer to previously initialized DString */
|
||||
{
|
||||
int i, len;
|
||||
Tcl_Obj *listObj = Tcl_NewObj();
|
||||
Tcl_Obj *listObj;
|
||||
Tcl_Obj *resultObj;
|
||||
const char *resultStr;
|
||||
|
||||
@@ -985,6 +988,7 @@ Tcl_JoinPath(
|
||||
* Build the list of paths.
|
||||
*/
|
||||
|
||||
TclNewObj(listObj);
|
||||
for (i = 0; i < argc; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, listObj,
|
||||
Tcl_NewStringObj(argv[i], -1));
|
||||
@@ -1234,7 +1238,7 @@ Tcl_GlobObjCmd(
|
||||
"-directory", "-join", "-nocomplain", "-path", "-tails",
|
||||
"-types", "--", NULL
|
||||
};
|
||||
enum options {
|
||||
enum globOptionsEnum {
|
||||
GLOB_DIR, GLOB_JOIN, GLOB_NOCOMPLAIN, GLOB_PATH, GLOB_TAILS,
|
||||
GLOB_TYPE, GLOB_LAST
|
||||
};
|
||||
@@ -1267,7 +1271,7 @@ Tcl_GlobObjCmd(
|
||||
}
|
||||
}
|
||||
|
||||
switch (index) {
|
||||
switch ((enum globOptionsEnum) index) {
|
||||
case GLOB_NOCOMPLAIN: /* -nocomplain */
|
||||
globFlags |= TCL_GLOBMODE_NO_COMPLAIN;
|
||||
break;
|
||||
@@ -1280,7 +1284,10 @@ Tcl_GlobObjCmd(
|
||||
}
|
||||
if (dir != PATH_NONE) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"\"-directory\" cannot be used with \"-path\"", -1));
|
||||
dir == PATH_DIR
|
||||
? "\"-directory\" may only be used once"
|
||||
: "\"-directory\" cannot be used with \"-path\"",
|
||||
-1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB",
|
||||
"BADOPTIONCOMBINATION", NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -1305,7 +1312,10 @@ Tcl_GlobObjCmd(
|
||||
}
|
||||
if (dir != PATH_NONE) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"\"-path\" cannot be used with \"-directory\"", -1));
|
||||
dir == PATH_GENERAL
|
||||
? "\"-path\" may only be used once"
|
||||
: "\"-path\" cannot be used with \"-dictionary\"",
|
||||
-1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB",
|
||||
"BADOPTIONCOMBINATION", NULL);
|
||||
return TCL_ERROR;
|
||||
|
||||
@@ -1002,7 +1002,7 @@ TclClockOldscanObjCmd(
|
||||
yyHaveRel = 0;
|
||||
yyRelMonth = 0; yyRelDay = 0; yyRelSeconds = 0; yyRelPointer = NULL;
|
||||
|
||||
dateInfo.messages = Tcl_NewObj();
|
||||
TclNewObj(dateInfo.messages);
|
||||
dateInfo.separatrix = "";
|
||||
Tcl_IncrRefCount(dateInfo.messages);
|
||||
|
||||
@@ -1059,8 +1059,8 @@ TclClockOldscanObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
result = Tcl_NewObj();
|
||||
resultElement = Tcl_NewObj();
|
||||
TclNewObj(result);
|
||||
TclNewObj(resultElement);
|
||||
if (yyHaveDate) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyYear));
|
||||
@@ -1078,7 +1078,7 @@ TclClockOldscanObjCmd(
|
||||
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
|
||||
}
|
||||
|
||||
resultElement = Tcl_NewObj();
|
||||
TclNewObj(resultElement);
|
||||
if (yyHaveZone) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) -yyTimezone));
|
||||
@@ -1087,7 +1087,7 @@ TclClockOldscanObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, result, resultElement);
|
||||
|
||||
resultElement = Tcl_NewObj();
|
||||
TclNewObj(resultElement);
|
||||
if (yyHaveRel) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyRelMonth));
|
||||
@@ -1098,7 +1098,7 @@ TclClockOldscanObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, result, resultElement);
|
||||
|
||||
resultElement = Tcl_NewObj();
|
||||
TcNewObj(resultElement);
|
||||
if (yyHaveDay && !yyHaveDate) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyDayOrdinal));
|
||||
@@ -1107,7 +1107,7 @@ TclClockOldscanObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, result, resultElement);
|
||||
|
||||
resultElement = Tcl_NewObj();
|
||||
TclNewObj(resultElement);
|
||||
if (yyHaveOrdinalMonth) {
|
||||
Tcl_ListObjAppendElement(interp, resultElement,
|
||||
Tcl_NewIntObj((int) yyMonthOrdinal));
|
||||
|
||||
+4
-4
@@ -287,9 +287,9 @@ static int WillRead(Channel *chanPtr);
|
||||
|
||||
#define IsBufferOverflowing(bufPtr) ((bufPtr)->nextAdded>(bufPtr)->bufLength)
|
||||
|
||||
#define InsertPoint(bufPtr) ((bufPtr)->buf + (bufPtr)->nextAdded)
|
||||
#define InsertPoint(bufPtr) (&(bufPtr)->buf[(bufPtr)->nextAdded])
|
||||
|
||||
#define RemovePoint(bufPtr) ((bufPtr)->buf + (bufPtr)->nextRemoved)
|
||||
#define RemovePoint(bufPtr) (&(bufPtr)->buf[(bufPtr)->nextRemoved])
|
||||
|
||||
/*
|
||||
* For working with channel state flag bits.
|
||||
@@ -11130,7 +11130,7 @@ FixLevelCode(
|
||||
if (0 == strcmp(TclGetString(lv[i]), "-level")) {
|
||||
if (newlevel >= 0) {
|
||||
lvn[j++] = lv[i];
|
||||
lvn[j++] = Tcl_NewIntObj(newlevel);
|
||||
lvn[j++] = Tcl_NewWideIntObj(newlevel);
|
||||
newlevel = -1;
|
||||
lignore = 1;
|
||||
continue;
|
||||
@@ -11140,7 +11140,7 @@ FixLevelCode(
|
||||
} else if (0 == strcmp(TclGetString(lv[i]), "-code")) {
|
||||
if (newcode >= 0) {
|
||||
lvn[j++] = lv[i];
|
||||
lvn[j++] = Tcl_NewIntObj(newcode);
|
||||
lvn[j++] = Tcl_NewWideIntObj(newcode);
|
||||
newcode = -1;
|
||||
cignore = 1;
|
||||
continue;
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ typedef struct ChannelBuffer {
|
||||
int bufLength; /* How big is the buffer? */
|
||||
struct ChannelBuffer *nextPtr;
|
||||
/* Next buffer in chain. */
|
||||
char buf[1]; /* Placeholder for real buffer. The real
|
||||
char buf[TCLFLEXARRAY]; /* Placeholder for real buffer. The real
|
||||
* buffer occuppies this space + bufSize-1
|
||||
* bytes. This must be the last field in the
|
||||
* structure. */
|
||||
|
||||
+15
-15
@@ -314,7 +314,7 @@ Tcl_GetsObjCmd(
|
||||
}
|
||||
|
||||
TclChannelPreserve(chan);
|
||||
linePtr = Tcl_NewObj();
|
||||
TclNewObj(linePtr);
|
||||
lineLen = Tcl_GetsObj(chan, linePtr);
|
||||
if (lineLen < 0) {
|
||||
if (!Tcl_Eof(chan) && !Tcl_InputBlocked(chan)) {
|
||||
@@ -343,7 +343,7 @@ Tcl_GetsObjCmd(
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(lineLen));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(lineLen));
|
||||
} else {
|
||||
Tcl_SetObjResult(interp, linePtr);
|
||||
}
|
||||
@@ -453,7 +453,7 @@ Tcl_ReadObjCmd(
|
||||
}
|
||||
}
|
||||
|
||||
resultPtr = Tcl_NewObj();
|
||||
TclNewObj(resultPtr);
|
||||
Tcl_IncrRefCount(resultPtr);
|
||||
TclChannelPreserve(chan);
|
||||
charactersRead = Tcl_ReadChars(chan, resultPtr, toRead, 0);
|
||||
@@ -888,7 +888,7 @@ Tcl_ExecObjCmd(
|
||||
static const char *const options[] = {
|
||||
"-ignorestderr", "-keepnewline", "--", NULL
|
||||
};
|
||||
enum options {
|
||||
enum execOptionsEnum {
|
||||
EXEC_IGNORESTDERR, EXEC_KEEPNEWLINE, EXEC_LAST
|
||||
};
|
||||
|
||||
@@ -975,7 +975,7 @@ Tcl_ExecObjCmd(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
resultPtr = Tcl_NewObj();
|
||||
TclNewObj(resultPtr);
|
||||
if (Tcl_GetChannelHandle(chan, TCL_READABLE, NULL) == TCL_OK) {
|
||||
if (Tcl_ReadChars(chan, resultPtr, -1, 0) == TCL_IO_FAILURE) {
|
||||
/*
|
||||
@@ -1363,7 +1363,7 @@ AcceptCallbackProc(
|
||||
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewStringObj(
|
||||
Tcl_GetChannelName(chan), -1));
|
||||
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewStringObj(address, -1));
|
||||
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewIntObj(port));
|
||||
Tcl_ListObjAppendElement(NULL, objv[1], Tcl_NewWideIntObj(port));
|
||||
|
||||
script = Tcl_ConcatObj(2, objv);
|
||||
Tcl_IncrRefCount(script);
|
||||
@@ -1470,7 +1470,7 @@ Tcl_SocketObjCmd(
|
||||
"-async", "-myaddr", "-myport", "-reuseaddr", "-reuseport", "-server",
|
||||
NULL
|
||||
};
|
||||
enum socketOptions {
|
||||
enum socketOptionsEnum {
|
||||
SKT_ASYNC, SKT_MYADDR, SKT_MYPORT, SKT_REUSEADDR, SKT_REUSEPORT,
|
||||
SKT_SERVER
|
||||
};
|
||||
@@ -1495,7 +1495,7 @@ Tcl_SocketObjCmd(
|
||||
TCL_EXACT, &optionIndex) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum socketOptions) optionIndex) {
|
||||
switch ((enum socketOptionsEnum) optionIndex) {
|
||||
case SKT_ASYNC:
|
||||
if (server == 1) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
@@ -1806,7 +1806,7 @@ ChanPendingObjCmd(
|
||||
Tcl_Channel chan;
|
||||
int index, mode;
|
||||
static const char *const options[] = {"input", "output", NULL};
|
||||
enum options {PENDING_INPUT, PENDING_OUTPUT};
|
||||
enum pendingOptionsEnum {PENDING_INPUT, PENDING_OUTPUT};
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "mode channelId");
|
||||
@@ -1822,19 +1822,19 @@ ChanPendingObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
switch ((enum options) index) {
|
||||
switch ((enum pendingOptionsEnum) index) {
|
||||
case PENDING_INPUT:
|
||||
if (!(mode & TCL_READABLE)) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(-1));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(-1));
|
||||
} else {
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(Tcl_InputBuffered(chan)));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(Tcl_InputBuffered(chan)));
|
||||
}
|
||||
break;
|
||||
case PENDING_OUTPUT:
|
||||
if (!(mode & TCL_WRITABLE)) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(-1));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(-1));
|
||||
} else {
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(Tcl_OutputBuffered(chan)));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(Tcl_OutputBuffered(chan)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1954,7 +1954,7 @@ ChanPipeObjCmd(
|
||||
channelNames[0] = Tcl_GetChannelName(rchan);
|
||||
channelNames[1] = Tcl_GetChannelName(wchan);
|
||||
|
||||
resultPtr = Tcl_NewObj();
|
||||
TclNewObj(resultPtr);
|
||||
Tcl_ListObjAppendElement(NULL, resultPtr,
|
||||
Tcl_NewStringObj(channelNames[0], -1));
|
||||
Tcl_ListObjAppendElement(NULL, resultPtr,
|
||||
|
||||
+12
-9
@@ -1591,7 +1591,7 @@ ReflectSeekWide(
|
||||
|
||||
Tcl_Preserve(rcPtr);
|
||||
|
||||
offObj = Tcl_NewWideIntObj(offset);
|
||||
TclNewIntObj(offObj, offset);
|
||||
baseObj = Tcl_NewStringObj(
|
||||
(seekMode == SEEK_SET) ? "start" :
|
||||
(seekMode == SEEK_CUR) ? "current" : "end", -1);
|
||||
@@ -3052,7 +3052,7 @@ ForwardProc(
|
||||
TclNewIntObj(toReadObj, paramPtr->input.toRead);
|
||||
Tcl_IncrRefCount(toReadObj);
|
||||
|
||||
Tcl_Preserve(rcPtr);
|
||||
Tcl_Preserve(rcPtr);
|
||||
if (InvokeTclMethod(rcPtr, METH_READ, toReadObj, NULL, &resObj)!=TCL_OK){
|
||||
int code = ErrnoReturn(rcPtr, resObj);
|
||||
|
||||
@@ -3127,15 +3127,18 @@ ForwardProc(
|
||||
}
|
||||
|
||||
case ForwardedSeek: {
|
||||
Tcl_Obj *offObj = Tcl_NewWideIntObj(paramPtr->seek.offset);
|
||||
Tcl_Obj *baseObj = Tcl_NewStringObj(
|
||||
(paramPtr->seek.seekMode==SEEK_SET) ? "start" :
|
||||
(paramPtr->seek.seekMode==SEEK_CUR) ? "current" : "end", -1);
|
||||
Tcl_Obj *offObj;
|
||||
Tcl_Obj *baseObj;
|
||||
|
||||
Tcl_IncrRefCount(offObj);
|
||||
Tcl_IncrRefCount(baseObj);
|
||||
TclNewIntObj(offObj, paramPtr->seek.offset);
|
||||
baseObj = Tcl_NewStringObj(
|
||||
(paramPtr->seek.seekMode==SEEK_SET) ? "start" :
|
||||
(paramPtr->seek.seekMode==SEEK_CUR) ? "current" : "end", -1);
|
||||
|
||||
Tcl_Preserve(rcPtr);
|
||||
Tcl_IncrRefCount(offObj);
|
||||
Tcl_IncrRefCount(baseObj);
|
||||
|
||||
Tcl_Preserve(rcPtr);
|
||||
if (InvokeTclMethod(rcPtr, METH_SEEK, offObj, baseObj, &resObj)!=TCL_OK){
|
||||
ForwardSetObjError(paramPtr, resObj);
|
||||
paramPtr->seek.offset = -1;
|
||||
|
||||
@@ -1219,7 +1219,7 @@ ReflectInput(
|
||||
}
|
||||
if (Tcl_IsShared(bufObj)) {
|
||||
Tcl_DecrRefCount(bufObj);
|
||||
bufObj = Tcl_NewObj();
|
||||
TclNewObj(bufObj);
|
||||
Tcl_IncrRefCount(bufObj);
|
||||
}
|
||||
Tcl_SetByteArrayLength(bufObj, 0);
|
||||
|
||||
+27
-26
@@ -1684,7 +1684,7 @@ Tcl_FSEvalFileEx(
|
||||
* Tilde-substitution is performed on this
|
||||
* pathname. */
|
||||
const char *encodingName) /* Either the name of an encoding or NULL to
|
||||
use the system encoding. */
|
||||
use the utf-8 encoding. */
|
||||
{
|
||||
int length, result = TCL_ERROR;
|
||||
Tcl_StatBuf statBuf;
|
||||
@@ -1722,19 +1722,19 @@ Tcl_FSEvalFileEx(
|
||||
|
||||
/*
|
||||
* If the encoding is specified, set the channel to that encoding.
|
||||
* Otherwise don't touch it, leaving things up to the system encoding. If
|
||||
* the encoding is unknown report an error.
|
||||
* Otherwise use utf-8. If the encoding is unknown report an error.
|
||||
*/
|
||||
|
||||
if (encodingName != NULL) {
|
||||
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
|
||||
!= TCL_OK) {
|
||||
Tcl_Close(interp,chan);
|
||||
return result;
|
||||
}
|
||||
if (encodingName == NULL) {
|
||||
encodingName = "utf-8";
|
||||
}
|
||||
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
|
||||
!= TCL_OK) {
|
||||
Tcl_Close(interp,chan);
|
||||
return result;
|
||||
}
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
|
||||
/*
|
||||
@@ -1821,7 +1821,7 @@ TclNREvalFile(
|
||||
* evaluate. Tilde-substitution is performed on
|
||||
* this pathname. */
|
||||
const char *encodingName) /* The name of an encoding to use, or NULL to
|
||||
* use the system encoding. */
|
||||
* use the utf-8 encoding. */
|
||||
{
|
||||
Tcl_StatBuf statBuf;
|
||||
Tcl_Obj *oldScriptFile, *objPtr;
|
||||
@@ -1858,19 +1858,19 @@ TclNREvalFile(
|
||||
|
||||
/*
|
||||
* If the encoding is specified, set the channel to that encoding.
|
||||
* Otherwise don't touch it, leaving things up to the system encoding. If
|
||||
* the encoding is unknown report an error.
|
||||
* Otherwise use utf-8. If the encoding is unknown report an error.
|
||||
*/
|
||||
|
||||
if (encodingName != NULL) {
|
||||
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
|
||||
!= TCL_OK) {
|
||||
Tcl_Close(interp,chan);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (encodingName == NULL) {
|
||||
encodingName = "utf-8";
|
||||
}
|
||||
if (Tcl_SetChannelOption(interp, chan, "-encoding", encodingName)
|
||||
!= TCL_OK) {
|
||||
Tcl_Close(interp, chan);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
|
||||
/*
|
||||
@@ -2697,7 +2697,7 @@ Tcl_FSGetCwd(
|
||||
* always be in the 'else' branch below which is simpler.
|
||||
*/
|
||||
|
||||
ClientData cd = (ClientData) Tcl_FSGetNativePath(norm);
|
||||
void *cd = (void *) Tcl_FSGetNativePath(norm);
|
||||
|
||||
FsUpdateCwd(norm, TclNativeDupInternalRep(cd));
|
||||
Tcl_DecrRefCount(norm);
|
||||
@@ -3173,7 +3173,7 @@ Tcl_LoadFile(
|
||||
}
|
||||
|
||||
if (fsPtr->loadFileProc != NULL) {
|
||||
int retVal = ((Tcl_FSLoadFileProc2 *)(void *)(fsPtr->loadFileProc))
|
||||
retVal = ((Tcl_FSLoadFileProc2 *)(void *)(fsPtr->loadFileProc))
|
||||
(interp, pathPtr, handlePtr, &unloadProcPtr, flags);
|
||||
|
||||
if (retVal == TCL_OK) {
|
||||
@@ -3765,7 +3765,7 @@ Tcl_Obj *
|
||||
Tcl_FSListVolumes(void)
|
||||
{
|
||||
FilesystemRecord *fsRecPtr;
|
||||
Tcl_Obj *resultPtr = Tcl_NewObj();
|
||||
Tcl_Obj *resultPtr;
|
||||
|
||||
/*
|
||||
* Call each "listVolumes" function of each registered filesystem in
|
||||
@@ -3773,6 +3773,7 @@ Tcl_FSListVolumes(void)
|
||||
* has succeeded.
|
||||
*/
|
||||
|
||||
TclNewObj(resultPtr);
|
||||
fsRecPtr = FsGetFirstFilesystem();
|
||||
Claim();
|
||||
while (fsRecPtr != NULL) {
|
||||
@@ -3832,7 +3833,7 @@ FsListMounts(
|
||||
if (fsRecPtr->fsPtr != &tclNativeFilesystem &&
|
||||
fsRecPtr->fsPtr->matchInDirectoryProc != NULL) {
|
||||
if (resultPtr == NULL) {
|
||||
resultPtr = Tcl_NewObj();
|
||||
TclNewObj(resultPtr);
|
||||
}
|
||||
fsRecPtr->fsPtr->matchInDirectoryProc(NULL, resultPtr, pathPtr,
|
||||
pattern, &mountsOnly);
|
||||
@@ -3903,7 +3904,7 @@ Tcl_FSSplitPath(
|
||||
* For example, 'ftp://' is a valid drive name.
|
||||
*/
|
||||
|
||||
result = Tcl_NewObj();
|
||||
TclNewObj(result);
|
||||
p = Tcl_GetString(pathPtr);
|
||||
Tcl_ListObjAppendElement(NULL, result,
|
||||
Tcl_NewStringObj(p, driveNameLength));
|
||||
@@ -4488,7 +4489,7 @@ Tcl_FSGetFileSystemForPath(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Start with an up-to-date copy of the master filesystem. */
|
||||
/* Start with an up-to-date copy of the filesystem. */
|
||||
fsRecPtr = FsGetFirstFilesystem();
|
||||
Claim();
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ Tcl_GetIndexFromObj(
|
||||
int flags, /* 0 or TCL_EXACT */
|
||||
int *indexPtr) /* Place to store resulting integer index. */
|
||||
{
|
||||
if (!(flags & INDEX_TEMP_TABLE)) {
|
||||
if (!(flags & TCL_INDEX_TEMP_TABLE)) {
|
||||
|
||||
/*
|
||||
* See if there is a valid cached result from a previous lookup (doing the
|
||||
@@ -216,7 +216,7 @@ GetIndexFromObjList(
|
||||
tablePtr[objc] = NULL;
|
||||
|
||||
result = Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr,
|
||||
sizeof(char *), msg, flags | INDEX_TEMP_TABLE, indexPtr);
|
||||
sizeof(char *), msg, flags | TCL_INDEX_TEMP_TABLE, indexPtr);
|
||||
|
||||
ckfree(tablePtr);
|
||||
|
||||
@@ -280,7 +280,7 @@ Tcl_GetIndexFromObjStruct(
|
||||
* See if there is a valid cached result from a previous lookup.
|
||||
*/
|
||||
|
||||
if (!(flags & INDEX_TEMP_TABLE)) {
|
||||
if (!(flags & TCL_INDEX_TEMP_TABLE)) {
|
||||
irPtr = TclFetchIntRep(objPtr, &indexType);
|
||||
if (irPtr) {
|
||||
indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
|
||||
@@ -344,7 +344,7 @@ Tcl_GetIndexFromObjStruct(
|
||||
* operation.
|
||||
*/
|
||||
|
||||
if (!(flags & INDEX_TEMP_TABLE)) {
|
||||
if (!(flags & TCL_INDEX_TEMP_TABLE)) {
|
||||
irPtr = TclFetchIntRep(objPtr, &indexType);
|
||||
if (irPtr) {
|
||||
indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
|
||||
@@ -553,7 +553,7 @@ PrefixMatchObjCmd(
|
||||
static const char *const matchOptions[] = {
|
||||
"-error", "-exact", "-message", NULL
|
||||
};
|
||||
enum matchOptions {
|
||||
enum matchOptionsEnum {
|
||||
PRFMATCH_ERROR, PRFMATCH_EXACT, PRFMATCH_MESSAGE
|
||||
};
|
||||
|
||||
@@ -567,7 +567,7 @@ PrefixMatchObjCmd(
|
||||
&index) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum matchOptions) index) {
|
||||
switch ((enum matchOptionsEnum) index) {
|
||||
case PRFMATCH_EXACT:
|
||||
flags |= TCL_EXACT;
|
||||
break;
|
||||
@@ -633,7 +633,7 @@ PrefixMatchObjCmd(
|
||||
}
|
||||
Tcl_ListObjAppendElement(interp, errorPtr,
|
||||
Tcl_NewStringObj("-code", 5));
|
||||
Tcl_ListObjAppendElement(interp, errorPtr, Tcl_NewIntObj(result));
|
||||
Tcl_ListObjAppendElement(interp, errorPtr, Tcl_NewWideIntObj(result));
|
||||
|
||||
return Tcl_SetReturnOptions(interp, errorPtr);
|
||||
}
|
||||
|
||||
+50
-29
@@ -925,6 +925,12 @@ typedef struct VarInHash {
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ > 2)
|
||||
# define TCLFLEXARRAY 0
|
||||
#else
|
||||
# define TCLFLEXARRAY 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Forward declaration to prevent an error when the forward reference to
|
||||
* Command is encountered in the Proc and ImportRef types declared below.
|
||||
@@ -968,7 +974,7 @@ typedef struct CompiledLocal {
|
||||
* is marked by a unique tag during
|
||||
* compilation, and that same tag is used to
|
||||
* find the variable at runtime. */
|
||||
char name[1]; /* Name of the local variable starts here. If
|
||||
char name[TCLFLEXARRAY]; /* Name of the local variable starts here. If
|
||||
* the name is NULL, this will just be '\0'.
|
||||
* The actual size of this field will be large
|
||||
* enough to hold the name. MUST BE THE LAST
|
||||
@@ -1306,7 +1312,7 @@ typedef struct CFWordBC {
|
||||
typedef struct ContLineLoc {
|
||||
int num; /* Number of entries in loc, not counting the
|
||||
* final -1 marker entry. */
|
||||
int loc[1]; /* Table of locations, as character offsets.
|
||||
int loc[TCLFLEXARRAY];/* Table of locations, as character offsets.
|
||||
* The table is allocated as part of the
|
||||
* structure, extending behind the nominal end
|
||||
* of the structure. An entry containing the
|
||||
@@ -1455,7 +1461,7 @@ typedef struct ExecStack {
|
||||
Tcl_Obj **markerPtr;
|
||||
Tcl_Obj **endPtr;
|
||||
Tcl_Obj **tosPtr;
|
||||
Tcl_Obj *stackWords[1];
|
||||
Tcl_Obj *stackWords[TCLFLEXARRAY];
|
||||
} ExecStack;
|
||||
|
||||
/*
|
||||
@@ -1707,18 +1713,18 @@ typedef struct Command {
|
||||
/*
|
||||
* Flag bits for commands.
|
||||
*
|
||||
* CMD_IS_DELETED - Means that the command is in the process of
|
||||
* CMD_DYING - If 1 the command is in the process of
|
||||
* being deleted (its deleteProc is currently
|
||||
* executing). Other attempts to delete the
|
||||
* command should be ignored.
|
||||
* CMD_TRACE_ACTIVE - 1 means that trace processing is currently
|
||||
* CMD_TRACE_ACTIVE - If 1 the trace processing is currently
|
||||
* underway for a rename/delete change. See the
|
||||
* two flags below for which is currently being
|
||||
* processed.
|
||||
* CMD_HAS_EXEC_TRACES - 1 means that this command has at least one
|
||||
* CMD_HAS_EXEC_TRACES - If 1 means that this command has at least one
|
||||
* execution trace (as opposed to simple
|
||||
* delete/rename traces) in its tracePtr list.
|
||||
* CMD_COMPILES_EXPANDED - 1 means that this command has a compiler that
|
||||
* CMD_COMPILES_EXPANDED - If 1 this command has a compiler that
|
||||
* can handle expansion (provided it is not the
|
||||
* first word).
|
||||
* TCL_TRACE_RENAME - A rename trace is in progress. Further
|
||||
@@ -1728,7 +1734,7 @@ typedef struct Command {
|
||||
* (these last two flags are defined in tcl.h)
|
||||
*/
|
||||
|
||||
#define CMD_IS_DELETED 0x01
|
||||
#define CMD_DYING 0x01
|
||||
#define CMD_TRACE_ACTIVE 0x02
|
||||
#define CMD_HAS_EXEC_TRACES 0x04
|
||||
#define CMD_COMPILES_EXPANDED 0x08
|
||||
@@ -2605,15 +2611,6 @@ typedef struct TclFileAttrProcs {
|
||||
TclSetFileAttrProc *setProc;/* The procedure for setting attrs. */
|
||||
} TclFileAttrProcs;
|
||||
|
||||
/*
|
||||
* Private flag value which controls Tcl_GetIndexFromObj*() routines
|
||||
* to instruct them not to cache lookups because the table will not
|
||||
* live long enough to make it worthwhile. Must not clash with public
|
||||
* flag value TCL_EXACT.
|
||||
*/
|
||||
|
||||
#define INDEX_TEMP_TABLE 2
|
||||
|
||||
/*
|
||||
* Opaque handle used in pipeline routines to encapsulate platform-dependent
|
||||
* state.
|
||||
@@ -4175,7 +4172,7 @@ MODULE_SCOPE int TclFullFinalizationRequested(void);
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclEnsembleImplementationCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclAliasObjCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclLocalAliasObjCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclSlaveObjCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclChildObjCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclInvokeImportedCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclOOPublicObjectCmd;
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclOOPrivateObjectCmd;
|
||||
@@ -4521,12 +4518,15 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
|
||||
*/
|
||||
|
||||
#define TclInvalidateStringRep(objPtr) \
|
||||
if ((objPtr)->bytes != NULL) { \
|
||||
if ((objPtr)->bytes != &tclEmptyString) { \
|
||||
ckfree((objPtr)->bytes); \
|
||||
do { \
|
||||
Tcl_Obj *_isobjPtr = (Tcl_Obj *)(objPtr); \
|
||||
if (_isobjPtr->bytes != NULL) { \
|
||||
if (_isobjPtr->bytes != &tclEmptyString) { \
|
||||
ckfree((char *)_isobjPtr->bytes); \
|
||||
} \
|
||||
_isobjPtr->bytes = NULL; \
|
||||
} \
|
||||
(objPtr)->bytes = NULL; \
|
||||
}
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* These form part of the native filesystem support. They are needed here
|
||||
@@ -4553,7 +4553,8 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define TclHasStringRep(objPtr) ((objPtr)->bytes != NULL)
|
||||
#define TclHasStringRep(objPtr) \
|
||||
((objPtr)->bytes != NULL)
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------
|
||||
@@ -4935,7 +4936,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
|
||||
* Computes number of bytes from beginning of structure to a given field.
|
||||
*/
|
||||
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
#if !defined(TCL_NO_DEPRECATED) && !defined(BUILD_tcl)
|
||||
# define TclOffset(type, field) ((int) offsetof(type, field))
|
||||
#endif
|
||||
/* Workaround for platforms missing offsetof(), e.g. VC++ 6.0 */
|
||||
@@ -4960,10 +4961,30 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
|
||||
* the internal stubs, but the core can use the macro instead.
|
||||
*/
|
||||
|
||||
#define TclCleanupCommandMacro(cmdPtr) \
|
||||
if ((cmdPtr)->refCount-- <= 1) { \
|
||||
ckfree(cmdPtr);\
|
||||
}
|
||||
#define TclCleanupCommandMacro(cmdPtr) \
|
||||
do { \
|
||||
if ((cmdPtr)->refCount-- <= 1) { \
|
||||
ckfree(cmdPtr); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
/*
|
||||
* inside this routine crement refCount first incase cmdPtr is replacing itself
|
||||
*/
|
||||
#define TclRoutineAssign(location, cmdPtr) \
|
||||
do { \
|
||||
(cmdPtr)->refCount++; \
|
||||
if ((location) != NULL \
|
||||
&& (location--) <= 1) { \
|
||||
ckfree(((location))); \
|
||||
} \
|
||||
(location) = (cmdPtr); \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define TclRoutineHasName(cmdPtr) \
|
||||
((cmdPtr)->hPtr != NULL)
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------
|
||||
|
||||
@@ -1413,4 +1413,9 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
# define Tcl_StaticPackage (tclIntStubsPtr->tclStaticPackage)
|
||||
#endif
|
||||
|
||||
#undef TclGuessPackageName
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
# define TclGuessPackageName(fileName, pkgName) ((void)fileName,(void)pkgName,0)
|
||||
#endif
|
||||
|
||||
#endif /* _TCLINTDECLS */
|
||||
|
||||
@@ -602,7 +602,7 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
|
||||
# endif /* TCL_NO_DEPRECATED */
|
||||
#else
|
||||
# undef TclpGetPid
|
||||
# define TclpGetPid(pid) ((unsigned long) (pid))
|
||||
# define TclpGetPid(pid) ((int)(size_t)(pid))
|
||||
#endif
|
||||
|
||||
#endif /* _TCLINTPLATDECLS */
|
||||
|
||||
+578
-564
File diff suppressed because it is too large
Load Diff
+10
-10
@@ -1303,13 +1303,13 @@ ObjValue(
|
||||
return resultObj;
|
||||
}
|
||||
linkPtr->lastValue.i = LinkedVar(int);
|
||||
return Tcl_NewIntObj(linkPtr->lastValue.i);
|
||||
return Tcl_NewWideIntObj(linkPtr->lastValue.i);
|
||||
case TCL_LINK_WIDE_INT:
|
||||
if (linkPtr->flags & LINK_ALLOC_LAST) {
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.wPtr[i]);
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.wPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
@@ -1355,7 +1355,7 @@ ObjValue(
|
||||
return resultObj;
|
||||
}
|
||||
linkPtr->lastValue.c = LinkedVar(char);
|
||||
return Tcl_NewIntObj(linkPtr->lastValue.c);
|
||||
return Tcl_NewWideIntObj(linkPtr->lastValue.c);
|
||||
case TCL_LINK_UCHAR:
|
||||
if (linkPtr->flags & LINK_ALLOC_LAST) {
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
@@ -1368,7 +1368,7 @@ ObjValue(
|
||||
return resultObj;
|
||||
}
|
||||
linkPtr->lastValue.uc = LinkedVar(unsigned char);
|
||||
return Tcl_NewIntObj(linkPtr->lastValue.uc);
|
||||
return Tcl_NewWideIntObj(linkPtr->lastValue.uc);
|
||||
case TCL_LINK_SHORT:
|
||||
if (linkPtr->flags & LINK_ALLOC_LAST) {
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
@@ -1381,7 +1381,7 @@ ObjValue(
|
||||
return resultObj;
|
||||
}
|
||||
linkPtr->lastValue.s = LinkedVar(short);
|
||||
return Tcl_NewIntObj(linkPtr->lastValue.s);
|
||||
return Tcl_NewWideIntObj(linkPtr->lastValue.s);
|
||||
case TCL_LINK_USHORT:
|
||||
if (linkPtr->flags & LINK_ALLOC_LAST) {
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
@@ -1394,13 +1394,13 @@ ObjValue(
|
||||
return resultObj;
|
||||
}
|
||||
linkPtr->lastValue.us = LinkedVar(unsigned short);
|
||||
return Tcl_NewIntObj(linkPtr->lastValue.us);
|
||||
return Tcl_NewWideIntObj(linkPtr->lastValue.us);
|
||||
case TCL_LINK_UINT:
|
||||
if (linkPtr->flags & LINK_ALLOC_LAST) {
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.uiPtr[i]);
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.uiPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
@@ -1414,7 +1414,7 @@ ObjValue(
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.lPtr[i]);
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.lPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
@@ -1427,7 +1427,7 @@ ObjValue(
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.ulPtr[i]);
|
||||
TclNewIntObj(objv[i], linkPtr->lastValue.ulPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
ckfree(objv);
|
||||
@@ -1454,7 +1454,7 @@ ObjValue(
|
||||
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
|
||||
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
|
||||
for (i=0; i < linkPtr->numElems; i++) {
|
||||
objv[i] = Tcl_NewWideIntObj((Tcl_WideInt)
|
||||
TclNewIntObj(objv[i], (Tcl_WideInt)
|
||||
linkPtr->lastValue.uwPtr[i]);
|
||||
}
|
||||
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
|
||||
|
||||
@@ -479,7 +479,9 @@ TclListObjRange(
|
||||
toIdx = listLen-1;
|
||||
}
|
||||
if (fromIdx > toIdx) {
|
||||
return Tcl_NewObj();
|
||||
Tcl_Obj *obj;
|
||||
TclNewObj(obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
newLen = toIdx - fromIdx + 1;
|
||||
@@ -1379,7 +1381,7 @@ TclLindexFlat(
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
listPtr = Tcl_NewObj();
|
||||
TclNewObj(listPtr);
|
||||
} else {
|
||||
/*
|
||||
* Extract the pointer to the appropriate element.
|
||||
@@ -1623,7 +1625,7 @@ TclLsetFlat(
|
||||
if (--indexCount) {
|
||||
parentList = subListPtr;
|
||||
if (index == elemCount) {
|
||||
subListPtr = Tcl_NewObj();
|
||||
TclNewObj(subListPtr);
|
||||
} else {
|
||||
subListPtr = elemPtrs[index];
|
||||
}
|
||||
|
||||
+57
-74
@@ -115,7 +115,7 @@ static void LoadCleanupProc(ClientData clientData,
|
||||
|
||||
int
|
||||
Tcl_LoadObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -137,7 +137,7 @@ Tcl_LoadObjCmd(
|
||||
static const char *const options[] = {
|
||||
"-global", "-lazy", "--", NULL
|
||||
};
|
||||
enum options {
|
||||
enum loadOptionsEnum {
|
||||
LOAD_GLOBAL, LOAD_LAZY, LOAD_LAST
|
||||
};
|
||||
|
||||
@@ -150,9 +150,9 @@ Tcl_LoadObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
++objv; --objc;
|
||||
if (LOAD_GLOBAL == (enum options) index) {
|
||||
if (LOAD_GLOBAL == (enum loadOptionsEnum) index) {
|
||||
flags |= TCL_LOAD_GLOBAL;
|
||||
} else if (LOAD_LAZY == (enum options) index) {
|
||||
} else if (LOAD_LAZY == (enum loadOptionsEnum) index) {
|
||||
flags |= TCL_LOAD_LAZY;
|
||||
} else {
|
||||
break;
|
||||
@@ -196,9 +196,9 @@ Tcl_LoadObjCmd(
|
||||
|
||||
target = interp;
|
||||
if (objc == 4) {
|
||||
const char *slaveIntName = Tcl_GetString(objv[3]);
|
||||
const char *childIntName = Tcl_GetString(objv[3]);
|
||||
|
||||
target = Tcl_GetSlave(interp, slaveIntName);
|
||||
target = Tcl_GetChild(interp, childIntName);
|
||||
if (target == NULL) {
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
@@ -302,60 +302,55 @@ Tcl_LoadObjCmd(
|
||||
if (packageName != NULL) {
|
||||
Tcl_DStringAppend(&pkgName, packageName, -1);
|
||||
} else {
|
||||
int retc;
|
||||
Tcl_Obj *splitPtr, *pkgGuessPtr;
|
||||
int pElements;
|
||||
const char *pkgGuess;
|
||||
|
||||
/*
|
||||
* Threading note - this call used to be protected by a mutex.
|
||||
*/
|
||||
|
||||
retc = TclGuessPackageName(fullFileName, &pkgName);
|
||||
if (!retc) {
|
||||
Tcl_Obj *splitPtr, *pkgGuessPtr;
|
||||
int pElements;
|
||||
const char *pkgGuess;
|
||||
/*
|
||||
* The platform-specific code couldn't figure out the module
|
||||
* name. Make a guess by taking the last element of the file
|
||||
* name, stripping off any leading "lib", and then using all
|
||||
* of the alphabetic and underline characters that follow
|
||||
* that.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The platform-specific code couldn't figure out the module
|
||||
* name. Make a guess by taking the last element of the file
|
||||
* name, stripping off any leading "lib", and then using all
|
||||
* of the alphabetic and underline characters that follow
|
||||
* that.
|
||||
*/
|
||||
|
||||
splitPtr = Tcl_FSSplitPath(objv[1], &pElements);
|
||||
Tcl_ListObjIndex(NULL, splitPtr, pElements -1, &pkgGuessPtr);
|
||||
pkgGuess = Tcl_GetString(pkgGuessPtr);
|
||||
if ((pkgGuess[0] == 'l') && (pkgGuess[1] == 'i')
|
||||
&& (pkgGuess[2] == 'b')) {
|
||||
pkgGuess += 3;
|
||||
}
|
||||
#ifdef __CYGWIN__
|
||||
if ((pkgGuess[0] == 'c') && (pkgGuess[1] == 'y')
|
||||
&& (pkgGuess[2] == 'g')) {
|
||||
pkgGuess += 3;
|
||||
}
|
||||
#endif /* __CYGWIN__ */
|
||||
for (p = pkgGuess; *p != 0; p += offset) {
|
||||
offset = TclUtfToUniChar(p, &ch);
|
||||
if ((ch > 0x100)
|
||||
|| !(isalpha(UCHAR(ch)) /* INTL: ISO only */
|
||||
|| (UCHAR(ch) == '_'))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (p == pkgGuess) {
|
||||
Tcl_DecrRefCount(splitPtr);
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"couldn't figure out package name for %s",
|
||||
fullFileName));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD",
|
||||
"WHATPACKAGE", NULL);
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
Tcl_DStringAppend(&pkgName, pkgGuess, p - pkgGuess);
|
||||
Tcl_DecrRefCount(splitPtr);
|
||||
splitPtr = Tcl_FSSplitPath(objv[1], &pElements);
|
||||
Tcl_ListObjIndex(NULL, splitPtr, pElements -1, &pkgGuessPtr);
|
||||
pkgGuess = Tcl_GetString(pkgGuessPtr);
|
||||
if ((pkgGuess[0] == 'l') && (pkgGuess[1] == 'i')
|
||||
&& (pkgGuess[2] == 'b')) {
|
||||
pkgGuess += 3;
|
||||
}
|
||||
#ifdef __CYGWIN__
|
||||
else if ((pkgGuess[0] == 'c') && (pkgGuess[1] == 'y')
|
||||
&& (pkgGuess[2] == 'g')) {
|
||||
pkgGuess += 3;
|
||||
}
|
||||
#endif /* __CYGWIN__ */
|
||||
for (p = pkgGuess; *p != 0; p += offset) {
|
||||
offset = TclUtfToUniChar(p, &ch);
|
||||
if ((ch > 0x100)
|
||||
|| !(isalpha(UCHAR(ch)) /* INTL: ISO only */
|
||||
|| (UCHAR(ch) == '_'))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (p == pkgGuess) {
|
||||
Tcl_DecrRefCount(splitPtr);
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"couldn't figure out package name for %s",
|
||||
fullFileName));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD",
|
||||
"WHATPACKAGE", NULL);
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
Tcl_DStringAppend(&pkgName, pkgGuess, p - pkgGuess);
|
||||
Tcl_DecrRefCount(splitPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -542,7 +537,7 @@ Tcl_LoadObjCmd(
|
||||
|
||||
int
|
||||
Tcl_UnloadObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -559,7 +554,7 @@ Tcl_UnloadObjCmd(
|
||||
static const char *const options[] = {
|
||||
"-nocomplain", "-keeplibrary", "--", NULL
|
||||
};
|
||||
enum options {
|
||||
enum unloadOptionsEnum {
|
||||
UNLOAD_NOCOMPLAIN, UNLOAD_KEEPLIB, UNLOAD_LAST
|
||||
};
|
||||
|
||||
@@ -584,7 +579,7 @@ Tcl_UnloadObjCmd(
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch (index) {
|
||||
switch ((enum unloadOptionsEnum)index) {
|
||||
case UNLOAD_NOCOMPLAIN: /* -nocomplain */
|
||||
complain = 0;
|
||||
break;
|
||||
@@ -632,9 +627,9 @@ Tcl_UnloadObjCmd(
|
||||
|
||||
target = interp;
|
||||
if (objc - i == 3) {
|
||||
const char *slaveIntName = Tcl_GetString(objv[i + 2]);
|
||||
const char *childIntName = Tcl_GetString(objv[i + 2]);
|
||||
|
||||
target = Tcl_GetSlave(interp, slaveIntName);
|
||||
target = Tcl_GetChild(interp, childIntName);
|
||||
if (target == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1025,7 +1020,7 @@ Tcl_StaticPackage(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclGetLoadedPackages, TclGetLoadedPackagesEx --
|
||||
* TclGetLoadedPackagesEx --
|
||||
*
|
||||
* This function returns information about all of the files that are
|
||||
* loaded (either in a particular interpreter, or for all interpreters).
|
||||
@@ -1043,18 +1038,6 @@ Tcl_StaticPackage(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclGetLoadedPackages(
|
||||
Tcl_Interp *interp, /* Interpreter in which to return information
|
||||
* or error message. */
|
||||
const char *targetName) /* Name of target interpreter or NULL. If
|
||||
* NULL, return info about all interps;
|
||||
* otherwise, just return info about this
|
||||
* interpreter. */
|
||||
{
|
||||
return TclGetLoadedPackagesEx(interp, targetName, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
TclGetLoadedPackagesEx(
|
||||
Tcl_Interp *interp, /* Interpreter in which to return information
|
||||
@@ -1073,7 +1056,7 @@ TclGetLoadedPackagesEx(
|
||||
Tcl_Obj *resultObj, *pkgDesc[2];
|
||||
|
||||
if (targetName == NULL) {
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
Tcl_MutexLock(&packageMutex);
|
||||
for (pkgPtr = firstPackagePtr; pkgPtr != NULL;
|
||||
pkgPtr = pkgPtr->nextPtr) {
|
||||
@@ -1087,7 +1070,7 @@ TclGetLoadedPackagesEx(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
target = Tcl_GetSlave(interp, targetName);
|
||||
target = Tcl_GetChild(interp, targetName);
|
||||
if (target == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1119,7 +1102,7 @@ TclGetLoadedPackagesEx(
|
||||
* interpreter.
|
||||
*/
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
for (; ipPtr != NULL; ipPtr = ipPtr->nextPtr) {
|
||||
pkgPtr = ipPtr->pkgPtr;
|
||||
pkgDesc[0] = Tcl_NewStringObj(pkgPtr->fileName, -1);
|
||||
|
||||
@@ -53,36 +53,6 @@ TclpDlopen(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclGuessPackageName --
|
||||
*
|
||||
* If the "load" command is invoked without providing a package name,
|
||||
* this procedure is invoked to try to figure it out.
|
||||
*
|
||||
* Results:
|
||||
* Always returns 0 to indicate that we couldn't figure out a package
|
||||
* name; generic code will then try to guess the package from the file
|
||||
* name. A return value of 1 would have meant that we figured out the
|
||||
* package name and put it in bufPtr.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclGuessPackageName(
|
||||
const char *fileName, /* Name of file containing package (already
|
||||
* translated to local form if needed). */
|
||||
Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
|
||||
* name to this if possible. */
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* These functions are fallbacks if we somehow determine that the platform can
|
||||
* do loading from memory but the user wishes to disable it. They just report
|
||||
|
||||
+8
-7
@@ -43,7 +43,7 @@
|
||||
# define _tcscmp strcmp
|
||||
#endif
|
||||
|
||||
static inline Tcl_Obj *
|
||||
static Tcl_Obj *
|
||||
NewNativeObj(
|
||||
TCHAR *string)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ NewNativeObj(
|
||||
Tcl_DStringInit(&ds);
|
||||
Tcl_WCharToUtfDString(string, -1, &ds);
|
||||
#else
|
||||
Tcl_ExternalToUtfDString(NULL, (char *) string, -1, &ds);
|
||||
Tcl_ExternalToUtfDString(NULL, (char *)string, -1, &ds);
|
||||
#endif
|
||||
return TclDStringToObj(&ds);
|
||||
}
|
||||
@@ -307,7 +307,7 @@ Tcl_MainEx(
|
||||
|
||||
is.interp = interp;
|
||||
is.prompt = PROMPT_START;
|
||||
is.commandPtr = Tcl_NewObj();
|
||||
TclNewObj(is.commandPtr);
|
||||
|
||||
/*
|
||||
* If the application has not already set a startup script, parse the
|
||||
@@ -348,7 +348,7 @@ Tcl_MainEx(
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewIntObj(argc), TCL_GLOBAL_ONLY);
|
||||
Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewWideIntObj(argc), TCL_GLOBAL_ONLY);
|
||||
|
||||
argvPtr = Tcl_NewListObj(0, NULL);
|
||||
while (argc--) {
|
||||
@@ -362,7 +362,7 @@ Tcl_MainEx(
|
||||
|
||||
is.tty = isatty(0);
|
||||
Tcl_SetVar2Ex(interp, "tcl_interactive", NULL,
|
||||
Tcl_NewIntObj(!path && is.tty), TCL_GLOBAL_ONLY);
|
||||
Tcl_NewWideIntObj(!path && is.tty), TCL_GLOBAL_ONLY);
|
||||
|
||||
/*
|
||||
* Invoke application-specific initialization.
|
||||
@@ -522,7 +522,7 @@ Tcl_MainEx(
|
||||
TCL_EVAL_GLOBAL);
|
||||
is.input = Tcl_GetStdChannel(TCL_STDIN);
|
||||
Tcl_DecrRefCount(is.commandPtr);
|
||||
is.commandPtr = Tcl_NewObj();
|
||||
TclNewObj(is.commandPtr);
|
||||
Tcl_IncrRefCount(is.commandPtr);
|
||||
if (code != TCL_OK) {
|
||||
chan = Tcl_GetStdChannel(TCL_STDERR);
|
||||
@@ -790,7 +790,8 @@ StdinProc(
|
||||
code = Tcl_RecordAndEvalObj(interp, commandPtr, TCL_EVAL_GLOBAL);
|
||||
isPtr->input = chan = Tcl_GetStdChannel(TCL_STDIN);
|
||||
Tcl_DecrRefCount(commandPtr);
|
||||
isPtr->commandPtr = commandPtr = Tcl_NewObj();
|
||||
TclNewObj(commandPtr);
|
||||
isPtr->commandPtr = commandPtr;
|
||||
Tcl_IncrRefCount(commandPtr);
|
||||
if (chan != NULL) {
|
||||
Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc, isPtr);
|
||||
|
||||
+24
-20
@@ -1770,6 +1770,8 @@ DoImport(
|
||||
TclInvokeImportedCmd, InvokeImportedNRCmd, dataPtr,
|
||||
DeleteImportedCmd);
|
||||
dataPtr->realCmdPtr = cmdPtr;
|
||||
/* corresponding decrement is in DeleteImportedCmd */
|
||||
cmdPtr->refCount++;
|
||||
dataPtr->selfPtr = (Command *) importedCmd;
|
||||
dataPtr->selfPtr->compileProc = cmdPtr->compileProc;
|
||||
Tcl_DStringFree(&ds);
|
||||
@@ -2077,6 +2079,7 @@ DeleteImportedCmd(
|
||||
prevPtr->nextPtr = refPtr->nextPtr;
|
||||
}
|
||||
ckfree(refPtr);
|
||||
TclCleanupCommandMacro(realCmdPtr);
|
||||
ckfree(dataPtr);
|
||||
return;
|
||||
}
|
||||
@@ -3543,9 +3546,10 @@ NamespaceExportCmd(
|
||||
*/
|
||||
|
||||
if (objc == 1) {
|
||||
Tcl_Obj *listPtr = Tcl_NewObj();
|
||||
Tcl_Obj *listPtr;
|
||||
|
||||
(void) Tcl_AppendExportList(interp, NULL, listPtr);
|
||||
TclNewObj(listPtr);
|
||||
(void)Tcl_AppendExportList(interp, NULL, listPtr);
|
||||
Tcl_SetObjResult(interp, listPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -3888,7 +3892,7 @@ NamespaceOriginCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
Tcl_Command command, origCommand;
|
||||
Tcl_Command cmd, origCmd;
|
||||
Tcl_Obj *resultPtr;
|
||||
|
||||
if (objc != 2) {
|
||||
@@ -3896,30 +3900,29 @@ NamespaceOriginCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
command = Tcl_GetCommandFromObj(interp, objv[1]);
|
||||
if (command == NULL) {
|
||||
cmd = Tcl_GetCommandFromObj(interp, objv[1]);
|
||||
if (cmd == NULL) {
|
||||
goto namespaceOriginError;
|
||||
}
|
||||
origCmd = TclGetOriginalCommand(cmd);
|
||||
if (origCmd == NULL) {
|
||||
origCmd = cmd;
|
||||
}
|
||||
TclNewObj(resultPtr);
|
||||
Tcl_GetCommandFullName(interp, origCmd, resultPtr);
|
||||
if (TclCheckEmptyString(resultPtr) == TCL_EMPTYSTRING_YES ) {
|
||||
Tcl_DecrRefCount(resultPtr);
|
||||
namespaceOriginError:
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"invalid command name \"%s\"", TclGetString(objv[1])));
|
||||
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COMMAND",
|
||||
TclGetString(objv[1]), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
origCommand = TclGetOriginalCommand(command);
|
||||
TclNewObj(resultPtr);
|
||||
if (origCommand == NULL) {
|
||||
/*
|
||||
* The specified command isn't an imported command. Return the
|
||||
* command's name qualified by the full name of the namespace it was
|
||||
* defined in.
|
||||
*/
|
||||
|
||||
Tcl_GetCommandFullName(interp, command, resultPtr);
|
||||
} else {
|
||||
Tcl_GetCommandFullName(interp, origCommand, resultPtr);
|
||||
}
|
||||
Tcl_SetObjResult(interp, resultPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -4022,8 +4025,9 @@ NamespacePathCmd(
|
||||
*/
|
||||
|
||||
if (objc == 1) {
|
||||
Tcl_Obj *resultObj = Tcl_NewObj();
|
||||
Tcl_Obj *resultObj;
|
||||
|
||||
TclNewObj(resultObj);
|
||||
for (i=0 ; i<nsPtr->commandPathLength ; i++) {
|
||||
if (nsPtr->commandPathArray[i].nsPtr != NULL) {
|
||||
Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj(
|
||||
@@ -5016,7 +5020,7 @@ TclLogCommandInfo(
|
||||
*/
|
||||
|
||||
Tcl_ListObjAppendElement(NULL, iPtr->errorStack, iPtr->upLiteral);
|
||||
Tcl_ListObjAppendElement(NULL, iPtr->errorStack, Tcl_NewIntObj(
|
||||
Tcl_ListObjAppendElement(NULL, iPtr->errorStack, Tcl_NewWideIntObj(
|
||||
iPtr->framePtr->level - iPtr->varFramePtr->level));
|
||||
} else if (iPtr->framePtr != iPtr->rootFramePtr) {
|
||||
/*
|
||||
|
||||
+5
-5
@@ -133,7 +133,7 @@ static const Tcl_MethodType classConstructor = {
|
||||
};
|
||||
|
||||
/*
|
||||
* Scripted parts of TclOO. First, the master script (cannot be outside this
|
||||
* Scripted parts of TclOO. First, the main script (cannot be outside this
|
||||
* file).
|
||||
*/
|
||||
|
||||
@@ -258,7 +258,7 @@ TclOOInit(
|
||||
}
|
||||
|
||||
return Tcl_PkgProvideEx(interp, "TclOO", TCLOO_PATCHLEVEL,
|
||||
(ClientData) &tclOOStubs);
|
||||
(void *) &tclOOStubs);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -566,7 +566,7 @@ DeletedHelpersNamespace(
|
||||
|
||||
static void
|
||||
KillFoundation(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp) /* The interpreter containing the OO system
|
||||
* foundation. */
|
||||
{
|
||||
@@ -1177,7 +1177,7 @@ ObjectNamespaceDeleted(
|
||||
* freed memory.
|
||||
*/
|
||||
|
||||
if (((Command *) oPtr->command)->flags && CMD_IS_DELETED) {
|
||||
if (((Command *) oPtr->command)->flags && CMD_DYING) {
|
||||
/*
|
||||
* Something has already started the command deletion process. We can
|
||||
* go ahead and clean up the the namespace,
|
||||
@@ -3035,7 +3035,7 @@ TclOOObjectName(
|
||||
if (oPtr->cachedNameObj) {
|
||||
return oPtr->cachedNameObj;
|
||||
}
|
||||
namePtr = Tcl_NewObj();
|
||||
TclNewObj(namePtr);
|
||||
Tcl_GetCommandFullName(interp, oPtr->command, namePtr);
|
||||
Tcl_IncrRefCount(namePtr);
|
||||
oPtr->cachedNameObj = namePtr;
|
||||
|
||||
@@ -831,7 +831,7 @@ TclOO_Object_VarName(
|
||||
* (including traversing variable links), convert back to a name.
|
||||
*/
|
||||
|
||||
varNamePtr = Tcl_NewObj();
|
||||
TclNewObj(varNamePtr);
|
||||
if (aryVar != NULL) {
|
||||
Tcl_GetVariableFullName(interp, (Tcl_Var) aryVar, varNamePtr);
|
||||
|
||||
|
||||
@@ -1050,8 +1050,8 @@ MagicDefinitionInvoke(
|
||||
* comments above for why these contortions are necessary.
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
obj2Ptr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
TclNewObj(obj2Ptr);
|
||||
cmd = FindCommand(interp, objv[cmdIndex], nsPtr);
|
||||
if (cmd == NULL) {
|
||||
/*
|
||||
@@ -2338,7 +2338,7 @@ ClassFilterGet(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
FOREACH(filterObj, oPtr->classPtr->filters) {
|
||||
Tcl_ListObjAppendElement(NULL, resultObj, filterObj);
|
||||
}
|
||||
@@ -2419,7 +2419,7 @@ ClassMixinGet(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
FOREACH(mixinPtr, oPtr->classPtr->mixins) {
|
||||
Tcl_ListObjAppendElement(NULL, resultObj,
|
||||
TclOOObjectName(interp, mixinPtr->thisPtr));
|
||||
@@ -2525,7 +2525,7 @@ ClassSuperGet(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
FOREACH(superPtr, oPtr->classPtr->superclasses) {
|
||||
Tcl_ListObjAppendElement(NULL, resultObj,
|
||||
TclOOObjectName(interp, superPtr->thisPtr));
|
||||
@@ -2691,7 +2691,7 @@ ClassVarsGet(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
if (IsPrivateDefine(interp)) {
|
||||
PrivateVariableMapping *privatePtr;
|
||||
|
||||
@@ -2800,7 +2800,7 @@ ObjFilterGet(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
FOREACH(filterObj, oPtr->filters) {
|
||||
Tcl_ListObjAppendElement(NULL, resultObj, filterObj);
|
||||
}
|
||||
@@ -2869,7 +2869,7 @@ ObjMixinGet(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
FOREACH(mixinPtr, oPtr->mixins) {
|
||||
if (mixinPtr) {
|
||||
Tcl_ListObjAppendElement(NULL, resultObj,
|
||||
@@ -2954,7 +2954,7 @@ ObjVarsGet(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
if (IsPrivateDefine(interp)) {
|
||||
PrivateVariableMapping *privatePtr;
|
||||
|
||||
|
||||
+49
-49
@@ -114,7 +114,7 @@ TclOOInitInfo(
|
||||
TclMakeEnsemble(interp, "::oo::InfoClass", infoClassCmds);
|
||||
|
||||
/*
|
||||
* Install into the master [info] ensemble.
|
||||
* Install into the [info] ensemble.
|
||||
*/
|
||||
|
||||
infoCmd = Tcl_FindCommand(interp, "info", NULL, TCL_GLOBAL_ONLY);
|
||||
@@ -171,7 +171,7 @@ GetClassFromObj(
|
||||
|
||||
static int
|
||||
InfoObjectClassCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -206,11 +206,11 @@ InfoObjectClassCmd(
|
||||
continue;
|
||||
}
|
||||
if (TclOOIsReachable(o2clsPtr, mixinPtr)) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(1));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(1));
|
||||
return TCL_OK;
|
||||
}
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
|
||||
TclOOIsReachable(o2clsPtr, oPtr->selfCls)));
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -228,7 +228,7 @@ InfoObjectClassCmd(
|
||||
|
||||
static int
|
||||
InfoObjectDefnCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -270,13 +270,13 @@ InfoObjectDefnCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObjs[0] = Tcl_NewObj();
|
||||
TclNewObj(resultObjs[0]);
|
||||
for (localPtr=procPtr->firstLocalPtr; localPtr!=NULL;
|
||||
localPtr=localPtr->nextPtr) {
|
||||
if (TclIsVarArgument(localPtr)) {
|
||||
Tcl_Obj *argObj;
|
||||
|
||||
argObj = Tcl_NewObj();
|
||||
TclNewObj(argObj);
|
||||
Tcl_ListObjAppendElement(NULL, argObj,
|
||||
Tcl_NewStringObj(localPtr->name, -1));
|
||||
if (localPtr->defValuePtr != NULL) {
|
||||
@@ -302,7 +302,7 @@ InfoObjectDefnCmd(
|
||||
|
||||
static int
|
||||
InfoObjectFiltersCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -320,7 +320,7 @@ InfoObjectFiltersCmd(
|
||||
if (oPtr == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
|
||||
FOREACH(filterObj, oPtr->filters) {
|
||||
Tcl_ListObjAppendElement(NULL, resultObj, filterObj);
|
||||
@@ -341,7 +341,7 @@ InfoObjectFiltersCmd(
|
||||
|
||||
static int
|
||||
InfoObjectForwardCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -398,7 +398,7 @@ InfoObjectForwardCmd(
|
||||
|
||||
static int
|
||||
InfoObjectIsACmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -517,7 +517,7 @@ InfoObjectIsACmd(
|
||||
|
||||
static int
|
||||
InfoObjectMethodsCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -601,7 +601,7 @@ InfoObjectMethodsCmd(
|
||||
}
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
if (recurse) {
|
||||
const char **names;
|
||||
int i, numNames = TclOOGetSortedMethodList(oPtr, NULL, NULL, flag,
|
||||
@@ -637,7 +637,7 @@ InfoObjectMethodsCmd(
|
||||
|
||||
static int
|
||||
InfoObjectMethodTypeCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -694,7 +694,7 @@ InfoObjectMethodTypeCmd(
|
||||
|
||||
static int
|
||||
InfoObjectMixinsCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -713,7 +713,7 @@ InfoObjectMixinsCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
FOREACH(mixinPtr, oPtr->mixins) {
|
||||
if (!mixinPtr) {
|
||||
continue;
|
||||
@@ -737,7 +737,7 @@ InfoObjectMixinsCmd(
|
||||
|
||||
static int
|
||||
InfoObjectIdCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -753,7 +753,7 @@ InfoObjectIdCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(oPtr->creationEpoch));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(oPtr->creationEpoch));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -769,7 +769,7 @@ InfoObjectIdCmd(
|
||||
|
||||
static int
|
||||
InfoObjectNsCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -802,7 +802,7 @@ InfoObjectNsCmd(
|
||||
|
||||
static int
|
||||
InfoObjectVariablesCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -826,7 +826,7 @@ InfoObjectVariablesCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
if (isPrivate) {
|
||||
PrivateVariableMapping *privatePtr;
|
||||
|
||||
@@ -856,7 +856,7 @@ InfoObjectVariablesCmd(
|
||||
|
||||
static int
|
||||
InfoObjectVarsCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -878,7 +878,7 @@ InfoObjectVarsCmd(
|
||||
if (objc == 3) {
|
||||
pattern = TclGetString(objv[2]);
|
||||
}
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
|
||||
/*
|
||||
* Extract the information we need from the object's namespace's table of
|
||||
@@ -917,7 +917,7 @@ InfoObjectVarsCmd(
|
||||
|
||||
static int
|
||||
InfoClassConstrCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -946,13 +946,13 @@ InfoClassConstrCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObjs[0] = Tcl_NewObj();
|
||||
TclNewObj(resultObjs[0]);
|
||||
for (localPtr=procPtr->firstLocalPtr; localPtr!=NULL;
|
||||
localPtr=localPtr->nextPtr) {
|
||||
if (TclIsVarArgument(localPtr)) {
|
||||
Tcl_Obj *argObj;
|
||||
|
||||
argObj = Tcl_NewObj();
|
||||
TclNewObj(argObj);
|
||||
Tcl_ListObjAppendElement(NULL, argObj,
|
||||
Tcl_NewStringObj(localPtr->name, -1));
|
||||
if (localPtr->defValuePtr != NULL) {
|
||||
@@ -978,7 +978,7 @@ InfoClassConstrCmd(
|
||||
|
||||
static int
|
||||
InfoClassDefnCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1014,13 +1014,13 @@ InfoClassDefnCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObjs[0] = Tcl_NewObj();
|
||||
TclNewObj(resultObjs[0]);
|
||||
for (localPtr=procPtr->firstLocalPtr; localPtr!=NULL;
|
||||
localPtr=localPtr->nextPtr) {
|
||||
if (TclIsVarArgument(localPtr)) {
|
||||
Tcl_Obj *argObj;
|
||||
|
||||
argObj = Tcl_NewObj();
|
||||
TclNewObj(argObj);
|
||||
Tcl_ListObjAppendElement(NULL, argObj,
|
||||
Tcl_NewStringObj(localPtr->name, -1));
|
||||
if (localPtr->defValuePtr != NULL) {
|
||||
@@ -1046,7 +1046,7 @@ InfoClassDefnCmd(
|
||||
|
||||
static int
|
||||
InfoClassDefnNsCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1096,7 +1096,7 @@ InfoClassDefnNsCmd(
|
||||
|
||||
static int
|
||||
InfoClassDestrCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1140,7 +1140,7 @@ InfoClassDestrCmd(
|
||||
|
||||
static int
|
||||
InfoClassFiltersCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1158,7 +1158,7 @@ InfoClassFiltersCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
FOREACH(filterObj, clsPtr->filters) {
|
||||
Tcl_ListObjAppendElement(NULL, resultObj, filterObj);
|
||||
}
|
||||
@@ -1178,7 +1178,7 @@ InfoClassFiltersCmd(
|
||||
|
||||
static int
|
||||
InfoClassForwardCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1229,7 +1229,7 @@ InfoClassForwardCmd(
|
||||
|
||||
static int
|
||||
InfoClassInstancesCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1252,7 +1252,7 @@ InfoClassInstancesCmd(
|
||||
pattern = TclGetString(objv[2]);
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
FOREACH(oPtr, clsPtr->instances) {
|
||||
Tcl_Obj *tmpObj = TclOOObjectName(interp, oPtr);
|
||||
|
||||
@@ -1277,7 +1277,7 @@ InfoClassInstancesCmd(
|
||||
|
||||
static int
|
||||
InfoClassMethodsCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1356,7 +1356,7 @@ InfoClassMethodsCmd(
|
||||
}
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
if (recurse) {
|
||||
const char **names;
|
||||
int i, numNames = TclOOGetSortedClassMethodList(clsPtr, flag, &names);
|
||||
@@ -1393,7 +1393,7 @@ InfoClassMethodsCmd(
|
||||
|
||||
static int
|
||||
InfoClassMethodTypeCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1445,7 +1445,7 @@ InfoClassMethodTypeCmd(
|
||||
|
||||
static int
|
||||
InfoClassMixinsCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1463,7 +1463,7 @@ InfoClassMixinsCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
FOREACH(mixinPtr, clsPtr->mixins) {
|
||||
if (!mixinPtr) {
|
||||
continue;
|
||||
@@ -1487,7 +1487,7 @@ InfoClassMixinsCmd(
|
||||
|
||||
static int
|
||||
InfoClassSubsCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1509,7 +1509,7 @@ InfoClassSubsCmd(
|
||||
pattern = TclGetString(objv[2]);
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
FOREACH(subclassPtr, clsPtr->subclasses) {
|
||||
Tcl_Obj *tmpObj = TclOOObjectName(interp, subclassPtr->thisPtr);
|
||||
|
||||
@@ -1542,7 +1542,7 @@ InfoClassSubsCmd(
|
||||
|
||||
static int
|
||||
InfoClassSupersCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1560,7 +1560,7 @@ InfoClassSupersCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
FOREACH(superPtr, clsPtr->superclasses) {
|
||||
Tcl_ListObjAppendElement(NULL, resultObj,
|
||||
TclOOObjectName(interp, superPtr->thisPtr));
|
||||
@@ -1581,7 +1581,7 @@ InfoClassSupersCmd(
|
||||
|
||||
static int
|
||||
InfoClassVariablesCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1605,7 +1605,7 @@ InfoClassVariablesCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
if (isPrivate) {
|
||||
PrivateVariableMapping *privatePtr;
|
||||
|
||||
@@ -1635,7 +1635,7 @@ InfoClassVariablesCmd(
|
||||
|
||||
static int
|
||||
InfoObjectCallCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -1681,7 +1681,7 @@ InfoObjectCallCmd(
|
||||
|
||||
static int
|
||||
InfoClassCallCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
|
||||
+2
-2
@@ -329,7 +329,7 @@ typedef struct Class {
|
||||
*/
|
||||
|
||||
typedef struct ThreadLocalData {
|
||||
int nsCount; /* Master epoch counter is used for keeping
|
||||
int nsCount; /* Epoch counter is used for keeping
|
||||
* the values used in Tcl_Obj internal
|
||||
* representations sane. Must be thread-local
|
||||
* because Tcl_Objs can cross interpreter
|
||||
@@ -341,7 +341,7 @@ typedef struct Foundation {
|
||||
Tcl_Interp *interp;
|
||||
Class *objectCls; /* The root of the object system. */
|
||||
Class *classCls; /* The class of all classes. */
|
||||
Tcl_Namespace *ooNs; /* Master ::oo namespace. */
|
||||
Tcl_Namespace *ooNs; /* ::oo namespace. */
|
||||
Tcl_Namespace *defineNs; /* Namespace containing special commands for
|
||||
* manipulating objects and classes. The
|
||||
* "oo::define" command acts as a special kind
|
||||
|
||||
@@ -394,7 +394,7 @@ TclOONewProcMethod(
|
||||
|
||||
if (argsObj == NULL) {
|
||||
argsLen = -1;
|
||||
argsObj = Tcl_NewObj();
|
||||
TclNewObj(argsObj);
|
||||
Tcl_IncrRefCount(argsObj);
|
||||
procName = "<destructor>";
|
||||
} else if (Tcl_ListObjLength(interp, argsObj, &argsLen) != TCL_OK) {
|
||||
@@ -1315,12 +1315,13 @@ CloneProcedureMethod(
|
||||
* Copy the argument list.
|
||||
*/
|
||||
|
||||
argsObj = Tcl_NewObj();
|
||||
TclNewObj(argsObj);
|
||||
for (localPtr=pmPtr->procPtr->firstLocalPtr; localPtr!=NULL;
|
||||
localPtr=localPtr->nextPtr) {
|
||||
if (TclIsVarArgument(localPtr)) {
|
||||
Tcl_Obj *argObj = Tcl_NewObj();
|
||||
Tcl_Obj *argObj;
|
||||
|
||||
TclNewObj(argObj);
|
||||
Tcl_ListObjAppendElement(NULL, argObj,
|
||||
Tcl_NewStringObj(localPtr->name, -1));
|
||||
if (localPtr->defValuePtr != NULL) {
|
||||
|
||||
+13
-13
@@ -145,12 +145,12 @@ typedef struct PendingObjData {
|
||||
#define ObjDeletionUnlock(contextPtr) ((contextPtr)->deletionCount--)
|
||||
#define ObjDeletePending(contextPtr) ((contextPtr)->deletionCount > 0)
|
||||
#define ObjOnStack(contextPtr) ((contextPtr)->deletionStack != NULL)
|
||||
#define PushObjToDelete(contextPtr,objPtr) \
|
||||
#define PushObjToDelete(contextPtr,objPtr) \
|
||||
/* The string rep is already invalidated so we can use the bytes value \
|
||||
* for our pointer chain: push onto the head of the stack. */ \
|
||||
(objPtr)->bytes = (char *) ((contextPtr)->deletionStack); \
|
||||
(contextPtr)->deletionStack = (objPtr)
|
||||
#define PopObjToDelete(contextPtr,objPtrVar) \
|
||||
#define PopObjToDelete(contextPtr,objPtrVar) \
|
||||
(objPtrVar) = (contextPtr)->deletionStack; \
|
||||
(contextPtr)->deletionStack = (Tcl_Obj *) (objPtrVar)->bytes
|
||||
|
||||
@@ -161,14 +161,14 @@ typedef struct PendingObjData {
|
||||
static PendingObjData pendingObjData;
|
||||
#define ObjInitDeletionContext(contextPtr) \
|
||||
PendingObjData *const contextPtr = &pendingObjData
|
||||
#elif HAVE_FAST_TSD
|
||||
#elif defined(HAVE_FAST_TSD)
|
||||
static __thread PendingObjData pendingObjData;
|
||||
#define ObjInitDeletionContext(contextPtr) \
|
||||
PendingObjData *const contextPtr = &pendingObjData
|
||||
#else
|
||||
static Tcl_ThreadDataKey pendingObjDataKey;
|
||||
#define ObjInitDeletionContext(contextPtr) \
|
||||
PendingObjData *const contextPtr = \
|
||||
PendingObjData *const contextPtr = \
|
||||
(PendingObjData *)Tcl_GetThreadData(&pendingObjDataKey, sizeof(PendingObjData))
|
||||
#endif
|
||||
|
||||
@@ -177,15 +177,15 @@ static Tcl_ThreadDataKey pendingObjDataKey;
|
||||
*/
|
||||
|
||||
#define PACK_BIGNUM(bignum, objPtr) \
|
||||
if ((bignum).used > 0x7FFF) { \
|
||||
mp_int *temp = (mp_int *) ckalloc(sizeof(mp_int)); \
|
||||
if ((bignum).used > 0x7FFF) { \
|
||||
mp_int *temp = (mp_int *)ckalloc(sizeof(mp_int)); \
|
||||
*temp = bignum; \
|
||||
(objPtr)->internalRep.twoPtrValue.ptr1 = temp; \
|
||||
(objPtr)->internalRep.twoPtrValue.ptr2 = INT2PTR(-1); \
|
||||
(objPtr)->internalRep.twoPtrValue.ptr1 = temp; \
|
||||
(objPtr)->internalRep.twoPtrValue.ptr2 = INT2PTR(-1); \
|
||||
} else if (((bignum).alloc <= 0x7FFF) || (mp_shrink(&(bignum))) == MP_OKAY) { \
|
||||
(objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (bignum).dp; \
|
||||
(objPtr)->internalRep.twoPtrValue.ptr2 = INT2PTR( ((bignum).sign << 30) \
|
||||
| ((bignum).alloc << 15) | ((bignum).used)); \
|
||||
(objPtr)->internalRep.twoPtrValue.ptr1 = (void *)(bignum).dp; \
|
||||
(objPtr)->internalRep.twoPtrValue.ptr2 = INT2PTR(((bignum).sign << 30) \
|
||||
| ((bignum).alloc << 15) | ((bignum).used)); \
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -567,7 +567,7 @@ TclContinuationsEnter(
|
||||
ThreadSpecificData *tsdPtr = TclGetContLineTable();
|
||||
Tcl_HashEntry *hPtr =
|
||||
Tcl_CreateHashEntry(tsdPtr->lineCLPtr, objPtr, &newEntry);
|
||||
ContLineLoc *clLocPtr = (ContLineLoc *)ckalloc(sizeof(ContLineLoc) + num*sizeof(int));
|
||||
ContLineLoc *clLocPtr = (ContLineLoc *)ckalloc(offsetof(ContLineLoc, loc) + (num + 1) *sizeof(int));
|
||||
|
||||
if (!newEntry) {
|
||||
/*
|
||||
@@ -4667,7 +4667,7 @@ SetCmdNameFromAny(
|
||||
* report the failure to find the command as an error.
|
||||
*/
|
||||
|
||||
if (cmdPtr == NULL) {
|
||||
if (cmdPtr == NULL || !TclRoutineHasName(cmdPtr)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -119,7 +119,7 @@ const char tclCharTypeTable[] = {
|
||||
* Prototypes for local functions defined in this file:
|
||||
*/
|
||||
|
||||
static inline int CommandComplete(const char *script, int numBytes);
|
||||
static int CommandComplete(const char *script, int numBytes);
|
||||
static int ParseComment(const char *src, int numBytes,
|
||||
Tcl_Parse *parsePtr);
|
||||
static int ParseTokens(const char *src, int numBytes, int mask,
|
||||
@@ -2104,7 +2104,7 @@ TclSubstTokens(
|
||||
* command, which is refered to by 'script'.
|
||||
* The 'clNextOuter' refers to the current
|
||||
* entry in the table of continuation lines in
|
||||
* this "master script", and the character
|
||||
* this "main script", and the character
|
||||
* offsets are relative to the 'outerScript'
|
||||
* as well.
|
||||
*
|
||||
@@ -2396,7 +2396,7 @@ TclSubstTokens(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static inline int
|
||||
static int
|
||||
CommandComplete(
|
||||
const char *script, /* Script to check. */
|
||||
int numBytes) /* Number of bytes in script. */
|
||||
|
||||
@@ -722,7 +722,7 @@ TclPathPart(
|
||||
(Tcl_FSGetPathType(pathPtr) == TCL_PATH_RELATIVE))) {
|
||||
Tcl_ListObjIndex(NULL, splitPtr, splitElements-1, &resultPtr);
|
||||
} else {
|
||||
resultPtr = Tcl_NewObj();
|
||||
TclNewObj(resultPtr);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
@@ -760,7 +760,7 @@ GetExtension(
|
||||
tail = TclGetString(pathPtr);
|
||||
extension = TclGetExtension(tail);
|
||||
if (extension == NULL) {
|
||||
ret = Tcl_NewObj();
|
||||
TclNewObj(ret);
|
||||
} else {
|
||||
ret = Tcl_NewStringObj(extension, -1);
|
||||
}
|
||||
@@ -1036,7 +1036,7 @@ TclJoinPath(
|
||||
|
||||
noQuickReturn:
|
||||
if (res == NULL) {
|
||||
res = Tcl_NewObj();
|
||||
TclNewObj(res);
|
||||
}
|
||||
ptr = TclGetStringFromObj(res, &length);
|
||||
|
||||
@@ -1272,7 +1272,7 @@ TclNewFSPathObj(
|
||||
return pathPtr;
|
||||
}
|
||||
|
||||
pathPtr = Tcl_NewObj();
|
||||
TclNewObj(pathPtr);
|
||||
fsPathPtr = (FsPath *)ckalloc(sizeof(FsPath));
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -334,7 +334,7 @@ TclCleanupChildren(
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
Tcl_Seek(errorChan, 0, SEEK_SET);
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
count = Tcl_ReadChars(errorChan, objPtr, -1, 0);
|
||||
if (count < 0) {
|
||||
result = TCL_ERROR;
|
||||
|
||||
+8
-7
@@ -285,7 +285,7 @@ TclPkgFileSeen(
|
||||
Tcl_Obj *list;
|
||||
|
||||
if (isNew) {
|
||||
list = Tcl_NewObj();
|
||||
TclNewObj(list);
|
||||
Tcl_SetHashValue(entry, list);
|
||||
Tcl_IncrRefCount(list);
|
||||
} else {
|
||||
@@ -1073,7 +1073,7 @@ TclNRPackageObjCmd(
|
||||
"present", "provide", "require", "unknown", "vcompare",
|
||||
"versions", "vsatisfies", NULL
|
||||
};
|
||||
enum pkgOptions {
|
||||
enum pkgOptionsEnum {
|
||||
PKG_FILES, PKG_FORGET, PKG_IFNEEDED, PKG_NAMES, PKG_PREFER,
|
||||
PKG_PRESENT, PKG_PROVIDE, PKG_REQUIRE, PKG_UNKNOWN, PKG_VCOMPARE,
|
||||
PKG_VERSIONS, PKG_VSATISFIES
|
||||
@@ -1099,7 +1099,7 @@ TclNRPackageObjCmd(
|
||||
&optionIndex) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum pkgOptions) optionIndex) {
|
||||
switch ((enum pkgOptionsEnum) optionIndex) {
|
||||
case PKG_FILES: {
|
||||
PkgFiles *pkgFiles;
|
||||
|
||||
@@ -1241,7 +1241,7 @@ TclNRPackageObjCmd(
|
||||
} else {
|
||||
Tcl_Obj *resultObj;
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
TclNewObj(resultObj);
|
||||
tablePtr = &iPtr->packageTable;
|
||||
for (hPtr = Tcl_FirstHashEntry(tablePtr, &search); hPtr != NULL;
|
||||
hPtr = Tcl_NextHashEntry(&search)) {
|
||||
@@ -1368,9 +1368,9 @@ TclNRPackageObjCmd(
|
||||
newObjvPtr, NULL);
|
||||
return TCL_OK;
|
||||
} else {
|
||||
int i, newobjc = objc-3;
|
||||
Tcl_Obj *const *newobjv = objv + 3;
|
||||
|
||||
newobjc = objc - 3;
|
||||
if (CheckAllRequirements(interp, objc-3, objv+3) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1481,7 +1481,7 @@ TclNRPackageObjCmd(
|
||||
*/
|
||||
|
||||
Tcl_SetObjResult(interp,
|
||||
Tcl_NewIntObj(CompareVersions(iva, ivb, NULL)));
|
||||
Tcl_NewWideIntObj(CompareVersions(iva, ivb, NULL)));
|
||||
ckfree(iva);
|
||||
ckfree(ivb);
|
||||
break;
|
||||
@@ -1490,8 +1490,9 @@ TclNRPackageObjCmd(
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "package");
|
||||
return TCL_ERROR;
|
||||
} else {
|
||||
Tcl_Obj *resultObj = Tcl_NewObj();
|
||||
Tcl_Obj *resultObj;
|
||||
|
||||
TclNewObj(resultObj);
|
||||
argv2 = TclGetString(objv[2]);
|
||||
hPtr = Tcl_FindHashEntry(&iPtr->packageTable, argv2);
|
||||
if (hPtr != NULL) {
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
#ifndef TCL_CFGVAL_ENCODING
|
||||
# define TCL_CFGVAL_ENCODING "utf-8"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Use C preprocessor statements to define the various values for the embedded
|
||||
* configuration information.
|
||||
|
||||
+25
-3
@@ -632,7 +632,8 @@ TclCreateProc(
|
||||
* local variables for the argument.
|
||||
*/
|
||||
|
||||
localPtr = (CompiledLocal *)ckalloc(offsetof(CompiledLocal, name) + fieldValues[0]->length +1);
|
||||
localPtr = (CompiledLocal *)ckalloc(
|
||||
offsetof(CompiledLocal, name) + fieldValues[0]->length + 1);
|
||||
if (procPtr->firstLocalPtr == NULL) {
|
||||
procPtr->firstLocalPtr = procPtr->lastLocalPtr = localPtr;
|
||||
} else {
|
||||
@@ -909,9 +910,28 @@ TclNRUplevelObjCmd(
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
if (objc < 2) {
|
||||
/* to do
|
||||
* simplify things by interpreting the argument as a command when there
|
||||
* is only one argument. This requires a TIP since currently a single
|
||||
* argument is interpreted as a level indicator if possible.
|
||||
*/
|
||||
uplevelSyntax:
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?level? command ?arg ...?");
|
||||
return TCL_ERROR;
|
||||
} else if (!TclHasStringRep(objv[1]) && objc == 2) {
|
||||
int status ,llength;
|
||||
status = Tcl_ListObjLength(interp, objv[1], &llength);
|
||||
if (status == TCL_OK && llength > 1) {
|
||||
/* the first argument can't interpreted as a level. Avoid
|
||||
* generating a string representation of the script. */
|
||||
result = TclGetFrame(interp, "1", &framePtr);
|
||||
if (result == -1) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
objc -= 1;
|
||||
objv += 1;
|
||||
goto havelevel;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -928,6 +948,8 @@ TclNRUplevelObjCmd(
|
||||
}
|
||||
objv += result + 1;
|
||||
|
||||
havelevel:
|
||||
|
||||
/*
|
||||
* Modify the interpreter state to execute in the given frame.
|
||||
*/
|
||||
@@ -1313,8 +1335,8 @@ InitLocalCache(
|
||||
* for future calls.
|
||||
*/
|
||||
|
||||
localCachePtr = (LocalCache *)ckalloc(sizeof(LocalCache)
|
||||
+ (localCt - 1) * sizeof(Tcl_Obj *)
|
||||
localCachePtr = (LocalCache *)ckalloc(offsetof(LocalCache, varName0)
|
||||
+ localCt * sizeof(Tcl_Obj *)
|
||||
+ numArgs * sizeof(Var));
|
||||
|
||||
namePtr = &localCachePtr->varName0;
|
||||
|
||||
@@ -222,7 +222,7 @@ WaitProcessStatus(
|
||||
* Get process status.
|
||||
*/
|
||||
|
||||
if (pid == (Tcl_Pid) -1) {
|
||||
if (pid == (Tcl_Pid)-1) {
|
||||
/*
|
||||
* POSIX errName msg
|
||||
*/
|
||||
@@ -371,7 +371,7 @@ BuildProcessStatusObj(
|
||||
* Normal exit, return TCL_OK.
|
||||
*/
|
||||
|
||||
return Tcl_NewIntObj(TCL_OK);
|
||||
return Tcl_NewWideIntObj(TCL_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -427,7 +427,7 @@ ProcessListObjCmd(
|
||||
entry != NULL; entry = Tcl_NextHashEntry(&search)) {
|
||||
info = (ProcessInfo *) Tcl_GetHashValue(entry);
|
||||
Tcl_ListObjAppendElement(interp, list,
|
||||
Tcl_NewIntObj(info->resolvedPid));
|
||||
Tcl_NewWideIntObj(info->resolvedPid));
|
||||
}
|
||||
Tcl_MutexUnlock(&infoTablesMutex);
|
||||
Tcl_SetObjResult(interp, list);
|
||||
@@ -472,7 +472,7 @@ ProcessStatusObjCmd(
|
||||
static const char *const switches[] = {
|
||||
"-wait", "--", NULL
|
||||
};
|
||||
enum switches {
|
||||
enum switchesEnum {
|
||||
STATUS_WAIT, STATUS_LAST
|
||||
};
|
||||
|
||||
@@ -485,7 +485,7 @@ ProcessStatusObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
++objv; --objc;
|
||||
if (STATUS_WAIT == (enum switches) index) {
|
||||
if (STATUS_WAIT == (enum switchesEnum) index) {
|
||||
options = 0;
|
||||
} else {
|
||||
break;
|
||||
@@ -523,7 +523,7 @@ ProcessStatusObjCmd(
|
||||
* Add to result.
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(interp, dict, Tcl_NewIntObj(info->resolvedPid),
|
||||
Tcl_DictObjPut(interp, dict, Tcl_NewWideIntObj(info->resolvedPid),
|
||||
BuildProcessStatusObj(info));
|
||||
}
|
||||
}
|
||||
@@ -573,7 +573,7 @@ ProcessStatusObjCmd(
|
||||
* Add to result.
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(interp, dict, Tcl_NewIntObj(info->resolvedPid),
|
||||
Tcl_DictObjPut(interp, dict, Tcl_NewWideIntObj(info->resolvedPid),
|
||||
BuildProcessStatusObj(info));
|
||||
}
|
||||
}
|
||||
@@ -834,7 +834,7 @@ TclProcessCreated(
|
||||
* Allocate and initialize info structure.
|
||||
*/
|
||||
|
||||
info = (ProcessInfo *) ckalloc(sizeof(ProcessInfo));
|
||||
info = (ProcessInfo *)ckalloc(sizeof(ProcessInfo));
|
||||
InitProcessInfo(info, pid, resolvedPid);
|
||||
|
||||
/*
|
||||
|
||||
+3
-3
@@ -676,9 +676,9 @@ TclRegAbout(
|
||||
* well and Tcl has other limits that constrain things as well...
|
||||
*/
|
||||
|
||||
resultObj = Tcl_NewObj();
|
||||
Tcl_ListObjAppendElement(NULL, resultObj,
|
||||
Tcl_NewWideIntObj((Tcl_WideInt) regexpPtr->re.re_nsub));
|
||||
TclNewObj(resultObj);
|
||||
TclNewIntObj(infoObj, regexpPtr->re.re_nsub);
|
||||
Tcl_ListObjAppendElement(NULL, resultObj, infoObj);
|
||||
|
||||
/*
|
||||
* Now append a list of all the bit-flags set for the RE.
|
||||
|
||||
+15
-13
@@ -248,7 +248,7 @@ Tcl_SaveResult(
|
||||
*/
|
||||
|
||||
statePtr->objResultPtr = iPtr->objResultPtr;
|
||||
iPtr->objResultPtr = Tcl_NewObj();
|
||||
TclNewObj(iPtr->objResultPtr);
|
||||
Tcl_IncrRefCount(iPtr->objResultPtr);
|
||||
|
||||
/*
|
||||
@@ -841,19 +841,19 @@ SetupAppendBuffer(
|
||||
|
||||
totalSpace = newSpace + iPtr->appendUsed;
|
||||
if (totalSpace >= iPtr->appendAvl) {
|
||||
char *newSpace;
|
||||
char *newSpacePtr;
|
||||
|
||||
if (totalSpace < 100) {
|
||||
totalSpace = 200;
|
||||
} else {
|
||||
totalSpace *= 2;
|
||||
}
|
||||
newSpace = (char *)ckalloc(totalSpace);
|
||||
strcpy(newSpace, iPtr->result);
|
||||
newSpacePtr = (char *)ckalloc(totalSpace);
|
||||
strcpy(newSpacePtr, iPtr->result);
|
||||
if (iPtr->appendResult != NULL) {
|
||||
ckfree(iPtr->appendResult);
|
||||
}
|
||||
iPtr->appendResult = newSpace;
|
||||
iPtr->appendResult = newSpacePtr;
|
||||
iPtr->appendAvl = totalSpace;
|
||||
} else if (iPtr->result != iPtr->appendResult) {
|
||||
strcpy(iPtr->appendResult, iPtr->result);
|
||||
@@ -1036,13 +1036,14 @@ Tcl_SetErrorCodeVA(
|
||||
Tcl_Interp *interp, /* Interpreter in which to set errorCode */
|
||||
va_list argList) /* Variable argument list. */
|
||||
{
|
||||
Tcl_Obj *errorObj = Tcl_NewObj();
|
||||
Tcl_Obj *errorObj;
|
||||
|
||||
/*
|
||||
* Scan through the arguments one at a time, appending them to the
|
||||
* errorCode field as list elements.
|
||||
*/
|
||||
|
||||
TclNewObj(errorObj);
|
||||
while (1) {
|
||||
char *elem = va_arg(argList, char *);
|
||||
|
||||
@@ -1395,9 +1396,10 @@ TclMergeReturnOptions(
|
||||
int code = TCL_OK;
|
||||
int level = 1;
|
||||
Tcl_Obj *valuePtr;
|
||||
Tcl_Obj *returnOpts = Tcl_NewObj();
|
||||
Tcl_Obj *returnOpts;
|
||||
Tcl_Obj **keys = GetKeys();
|
||||
|
||||
TclNewObj(returnOpts);
|
||||
for (; objc > 1; objv += 2, objc -= 2) {
|
||||
const char *opt = TclGetString(objv[0]);
|
||||
const char *compare = TclGetString(keys[KEY_OPTIONS]);
|
||||
@@ -1591,19 +1593,19 @@ Tcl_GetReturnOptions(
|
||||
if (iPtr->returnOpts) {
|
||||
options = Tcl_DuplicateObj(iPtr->returnOpts);
|
||||
} else {
|
||||
options = Tcl_NewObj();
|
||||
TclNewObj(options);
|
||||
}
|
||||
|
||||
if (result == TCL_RETURN) {
|
||||
Tcl_DictObjPut(NULL, options, keys[KEY_CODE],
|
||||
Tcl_NewIntObj(iPtr->returnCode));
|
||||
Tcl_NewWideIntObj(iPtr->returnCode));
|
||||
Tcl_DictObjPut(NULL, options, keys[KEY_LEVEL],
|
||||
Tcl_NewIntObj(iPtr->returnLevel));
|
||||
Tcl_NewWideIntObj(iPtr->returnLevel));
|
||||
} else {
|
||||
Tcl_DictObjPut(NULL, options, keys[KEY_CODE],
|
||||
Tcl_NewIntObj(result));
|
||||
Tcl_NewWideIntObj(result));
|
||||
Tcl_DictObjPut(NULL, options, keys[KEY_LEVEL],
|
||||
Tcl_NewIntObj(0));
|
||||
Tcl_NewWideIntObj(0));
|
||||
}
|
||||
|
||||
if (result == TCL_ERROR) {
|
||||
@@ -1616,7 +1618,7 @@ Tcl_GetReturnOptions(
|
||||
if (iPtr->errorInfo) {
|
||||
Tcl_DictObjPut(NULL, options, keys[KEY_ERRORINFO], iPtr->errorInfo);
|
||||
Tcl_DictObjPut(NULL, options, keys[KEY_ERRORLINE],
|
||||
Tcl_NewIntObj(iPtr->errorLine));
|
||||
Tcl_NewWideIntObj(iPtr->errorLine));
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
+11
-11
@@ -716,7 +716,7 @@ Tcl_ScanObjCmd(
|
||||
switch (ch) {
|
||||
case 'n':
|
||||
if (!(flags & SCAN_SUPPRESS)) {
|
||||
objPtr = Tcl_NewWideIntObj(string - baseString);
|
||||
TclNewIntObj(objPtr, string - baseString);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
CLANG_ASSERT(objs);
|
||||
objs[objIndex++] = objPtr;
|
||||
@@ -879,7 +879,7 @@ Tcl_ScanObjCmd(
|
||||
offset = TclUtfToUCS4(string, &i);
|
||||
string += offset;
|
||||
if (!(flags & SCAN_SUPPRESS)) {
|
||||
objPtr = Tcl_NewWideIntObj(i);
|
||||
TclNewIntObj(objPtr, i);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
CLANG_ASSERT(objs);
|
||||
objs[objIndex++] = objPtr;
|
||||
@@ -890,7 +890,7 @@ Tcl_ScanObjCmd(
|
||||
/*
|
||||
* Scan an unsigned or signed integer.
|
||||
*/
|
||||
objPtr = Tcl_NewWideIntObj(0);
|
||||
TclNewIntObj(objPtr, 0);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
if (width == 0) {
|
||||
width = ~0;
|
||||
@@ -937,16 +937,16 @@ Tcl_ScanObjCmd(
|
||||
} else if (flags & SCAN_BIG) {
|
||||
if (flags & SCAN_UNSIGNED) {
|
||||
mp_int big;
|
||||
int code = Tcl_GetBignumFromObj(interp, objPtr, &big);
|
||||
int res = Tcl_GetBignumFromObj(interp, objPtr, &big);
|
||||
|
||||
if (code == TCL_OK) {
|
||||
if (res == TCL_OK) {
|
||||
if (mp_isneg(&big)) {
|
||||
code = TCL_ERROR;
|
||||
res = TCL_ERROR;
|
||||
}
|
||||
mp_clear(&big);
|
||||
}
|
||||
|
||||
if (code == TCL_ERROR) {
|
||||
if (res == TCL_ERROR) {
|
||||
if (objs != NULL) {
|
||||
ckfree(objs);
|
||||
}
|
||||
@@ -1068,7 +1068,7 @@ Tcl_ScanObjCmd(
|
||||
* Here no vars were specified, we want a list returned (inline scan)
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
for (i = 0; i < totalVars; i++) {
|
||||
if (objs[i] != NULL) {
|
||||
Tcl_ListObjAppendElement(NULL, objPtr, objs[i]);
|
||||
@@ -1089,16 +1089,16 @@ Tcl_ScanObjCmd(
|
||||
if (code == TCL_OK) {
|
||||
if (underflow && (nconversions == 0)) {
|
||||
if (numVars) {
|
||||
objPtr = Tcl_NewWideIntObj(-1);
|
||||
TclNewIntObj(objPtr, TCL_INDEX_NONE);
|
||||
} else {
|
||||
if (objPtr) {
|
||||
Tcl_SetListObj(objPtr, 0, NULL);
|
||||
} else {
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
}
|
||||
}
|
||||
} else if (numVars) {
|
||||
objPtr = Tcl_NewWideIntObj(result);
|
||||
TclNewIntObj(objPtr, result);
|
||||
}
|
||||
Tcl_SetObjResult(interp, objPtr);
|
||||
}
|
||||
|
||||
+35
-32
@@ -2133,7 +2133,7 @@ Tcl_AppendFormatToObj(
|
||||
if (l == (long) 0) gotHash = 0;
|
||||
}
|
||||
|
||||
segment = Tcl_NewObj();
|
||||
TclNewObj(segment);
|
||||
allocSegment = 1;
|
||||
segmentLimit = INT_MAX;
|
||||
Tcl_IncrRefCount(segment);
|
||||
@@ -2178,15 +2178,15 @@ Tcl_AppendFormatToObj(
|
||||
const char *bytes;
|
||||
|
||||
if (useShort) {
|
||||
pure = Tcl_NewWideIntObj(s);
|
||||
TclNewIntObj(pure, s);
|
||||
#ifndef TCL_WIDE_INT_IS_LONG
|
||||
} else if (useWide) {
|
||||
pure = Tcl_NewWideIntObj(w);
|
||||
TclNewIntObj(pure, w);
|
||||
#endif
|
||||
} else if (useBig) {
|
||||
pure = Tcl_NewBignumObj(&big);
|
||||
} else {
|
||||
pure = Tcl_NewWideIntObj(l);
|
||||
TclNewIntObj(pure, l);
|
||||
}
|
||||
Tcl_IncrRefCount(pure);
|
||||
bytes = TclGetStringFromObj(pure, &length);
|
||||
@@ -2308,7 +2308,7 @@ Tcl_AppendFormatToObj(
|
||||
if (numDigits == 0) {
|
||||
numDigits = 1;
|
||||
}
|
||||
pure = Tcl_NewObj();
|
||||
TclNewObj(pure);
|
||||
Tcl_SetObjLength(pure, (int) numDigits);
|
||||
bytes = TclGetString(pure);
|
||||
toAppend = length = (int) numDigits;
|
||||
@@ -2429,7 +2429,7 @@ Tcl_AppendFormatToObj(
|
||||
*p++ = (char) ch;
|
||||
*p = '\0';
|
||||
|
||||
segment = Tcl_NewObj();
|
||||
TclNewObj(segment);
|
||||
allocSegment = 1;
|
||||
if (!Tcl_AttemptSetObjLength(segment, length)) {
|
||||
msg = overflow;
|
||||
@@ -2443,10 +2443,10 @@ Tcl_AppendFormatToObj(
|
||||
goto errorMsg;
|
||||
}
|
||||
if (ch == 'A') {
|
||||
char *p = TclGetString(segment) + 1;
|
||||
*p = 'x';
|
||||
p = strchr(p, 'P');
|
||||
if (p) *p = 'p';
|
||||
char *q = TclGetString(segment) + 1;
|
||||
*q = 'x';
|
||||
q = strchr(q, 'P');
|
||||
if (q) *q = 'p';
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2543,8 +2543,9 @@ Tcl_Format(
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
int result;
|
||||
Tcl_Obj *objPtr = Tcl_NewObj();
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
TclNewObj(objPtr);
|
||||
result = Tcl_AppendFormatToObj(interp, objPtr, format, objc, objv);
|
||||
if (result != TCL_OK) {
|
||||
Tcl_DecrRefCount(objPtr);
|
||||
@@ -2572,9 +2573,10 @@ AppendPrintfToObjVA(
|
||||
va_list argList)
|
||||
{
|
||||
int code, objc;
|
||||
Tcl_Obj **objv, *list = Tcl_NewObj();
|
||||
Tcl_Obj **objv, *list;
|
||||
const char *p;
|
||||
|
||||
TclNewObj(list);
|
||||
p = format;
|
||||
Tcl_IncrRefCount(list);
|
||||
while (*p != '\0') {
|
||||
@@ -2788,8 +2790,9 @@ Tcl_ObjPrintf(
|
||||
...)
|
||||
{
|
||||
va_list argList;
|
||||
Tcl_Obj *objPtr = Tcl_NewObj();
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
TclNewObj(objPtr);
|
||||
va_start(argList, format);
|
||||
AppendPrintfToObjVA(objPtr, format, argList);
|
||||
va_end(argList);
|
||||
@@ -3314,7 +3317,7 @@ TclStringCat(
|
||||
/* assert ( length > start ) */
|
||||
TclFreeIntRep(objResultPtr);
|
||||
} else {
|
||||
objResultPtr = Tcl_NewObj(); /* PANIC? */
|
||||
TclNewObj(objResultPtr); /* PANIC? */
|
||||
if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
|
||||
Tcl_DecrRefCount(objResultPtr);
|
||||
if (interp) {
|
||||
@@ -3410,7 +3413,7 @@ TclStringCmp(
|
||||
if (nocase) {
|
||||
s1 = (char *) Tcl_GetUnicodeFromObj(value1Ptr, &s1len);
|
||||
s2 = (char *) Tcl_GetUnicodeFromObj(value2Ptr, &s2len);
|
||||
memCmpFn = (memCmpFn_t)Tcl_UniCharNcasecmp;
|
||||
memCmpFn = (memCmpFn_t)(void *)Tcl_UniCharNcasecmp;
|
||||
} else {
|
||||
s1len = Tcl_GetCharLength(value1Ptr);
|
||||
s2len = Tcl_GetCharLength(value2Ptr);
|
||||
@@ -3435,7 +3438,7 @@ TclStringCmp(
|
||||
s1len *= sizeof(Tcl_UniChar);
|
||||
s2len *= sizeof(Tcl_UniChar);
|
||||
} else {
|
||||
memCmpFn = (memCmpFn_t) Tcl_UniCharNcmp;
|
||||
memCmpFn = (memCmpFn_t)(void *)Tcl_UniCharNcmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3493,11 +3496,11 @@ TclStringCmp(
|
||||
*/
|
||||
|
||||
if ((reqlength < 0) && !nocase) {
|
||||
memCmpFn = (memCmpFn_t) TclpUtfNcmp2;
|
||||
memCmpFn = (memCmpFn_t)(void *)TclpUtfNcmp2;
|
||||
} else {
|
||||
s1len = Tcl_NumUtfChars(s1, s1len);
|
||||
s2len = Tcl_NumUtfChars(s2, s2len);
|
||||
memCmpFn = (memCmpFn_t)
|
||||
memCmpFn = (memCmpFn_t)(void *)
|
||||
(nocase ? Tcl_UtfNcasecmp : Tcl_UtfNcmp);
|
||||
}
|
||||
}
|
||||
@@ -3561,7 +3564,7 @@ TclStringFirst(
|
||||
int lh, ln = Tcl_GetCharLength(needle);
|
||||
Tcl_Obj *result;
|
||||
int value = -1;
|
||||
Tcl_UniChar *check, *end, *uh, *un;
|
||||
Tcl_UniChar *checkStr, *endStr, *uh, *un;
|
||||
|
||||
if (start < 0) {
|
||||
start = 0;
|
||||
@@ -3627,12 +3630,12 @@ TclStringFirst(
|
||||
/* Don't start the loop if there cannot be a valid answer */
|
||||
goto firstEnd;
|
||||
}
|
||||
end = uh + lh;
|
||||
endStr = uh + lh;
|
||||
|
||||
for (check = uh + start; check + ln <= end; check++) {
|
||||
if ((*check == *un) && (0 ==
|
||||
memcmp(check + 1, un + 1, (ln-1) * sizeof(Tcl_UniChar)))) {
|
||||
value = (check - uh);
|
||||
for (checkStr = uh + start; checkStr + ln <= endStr; checkStr++) {
|
||||
if ((*checkStr == *un) && (0 ==
|
||||
memcmp(checkStr + 1, un + 1, (ln-1) * sizeof(Tcl_UniChar)))) {
|
||||
value = (checkStr - uh);
|
||||
goto firstEnd;
|
||||
}
|
||||
}
|
||||
@@ -3668,7 +3671,7 @@ TclStringLast(
|
||||
int lh, ln = Tcl_GetCharLength(needle);
|
||||
Tcl_Obj *result;
|
||||
int value = -1;
|
||||
Tcl_UniChar *check, *uh, *un;
|
||||
Tcl_UniChar *checkStr, *uh, *un;
|
||||
|
||||
if (ln == 0) {
|
||||
/*
|
||||
@@ -3714,14 +3717,14 @@ TclStringLast(
|
||||
/* Don't start the loop if there cannot be a valid answer */
|
||||
goto lastEnd;
|
||||
}
|
||||
check = uh + last + 1 - ln;
|
||||
while (check >= uh) {
|
||||
if ((*check == un[0])
|
||||
&& (0 == memcmp(check+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) {
|
||||
value = (check - uh);
|
||||
checkStr = uh + last + 1 - ln;
|
||||
while (checkStr >= uh) {
|
||||
if ((*checkStr == un[0])
|
||||
&& (0 == memcmp(checkStr+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) {
|
||||
value = (checkStr - uh);
|
||||
goto lastEnd;
|
||||
}
|
||||
check--;
|
||||
checkStr--;
|
||||
}
|
||||
lastEnd:
|
||||
TclNewIntObj(result, value);
|
||||
@@ -3830,7 +3833,7 @@ TclStringReverse(
|
||||
char *to, *from = objPtr->bytes;
|
||||
|
||||
if (!inPlace || Tcl_IsShared(objPtr)) {
|
||||
objPtr = Tcl_NewObj();
|
||||
TclNewObj(objPtr);
|
||||
Tcl_SetObjLength(objPtr, numBytes);
|
||||
}
|
||||
to = objPtr->bytes;
|
||||
|
||||
@@ -59,15 +59,15 @@ typedef struct {
|
||||
* space allocated for the unicode array. */
|
||||
int hasUnicode; /* Boolean determining whether the string has
|
||||
* a Unicode representation. */
|
||||
Tcl_UniChar unicode[1]; /* The array of Unicode chars. The actual size
|
||||
Tcl_UniChar unicode[TCLFLEXARRAY]; /* The array of Unicode chars. The actual size
|
||||
* of this field depends on the 'maxChars'
|
||||
* field above. */
|
||||
} String;
|
||||
|
||||
#define STRING_MAXCHARS \
|
||||
(int)(((size_t)UINT_MAX - sizeof(String))/sizeof(Tcl_UniChar))
|
||||
(int)(((size_t)UINT_MAX - 1 - offsetof(String, unicode))/sizeof(Tcl_UniChar))
|
||||
#define STRING_SIZE(numChars) \
|
||||
(sizeof(String) + ((numChars) * sizeof(Tcl_UniChar)))
|
||||
(offsetof(String, unicode) + ((numChars + 1) * sizeof(Tcl_UniChar)))
|
||||
#define stringCheckLimits(numChars) \
|
||||
do { \
|
||||
if ((numChars) < 0 || (numChars) > STRING_MAXCHARS) { \
|
||||
|
||||
+26
-4
@@ -67,6 +67,8 @@
|
||||
#undef TclWinNToHS
|
||||
#undef TclStaticPackage
|
||||
#undef Tcl_BackgroundError
|
||||
#undef TclGuessPackageName
|
||||
#undef TclGetLoadedPackages
|
||||
#define TclStaticPackage Tcl_StaticPackage
|
||||
#undef Tcl_UniCharToUtfDString
|
||||
#undef Tcl_UtfToUniCharDString
|
||||
@@ -261,8 +263,28 @@ mp_err TclBN_mp_mul_d(const mp_int *a, unsigned int b, mp_int *c) {
|
||||
# define Tcl_ChannelCloseProc 0
|
||||
# define Tcl_Close 0
|
||||
# define Tcl_MacOSXOpenBundleResources 0
|
||||
# define TclGuessPackageName 0
|
||||
# define TclGetLoadedPackages 0
|
||||
#else
|
||||
|
||||
#define TclGuessPackageName guessPackageName
|
||||
static int TclGuessPackageName(
|
||||
TCL_UNUSED(const char *),
|
||||
TCL_UNUSED(Tcl_DString *)) {
|
||||
return 0;
|
||||
}
|
||||
#define TclGetLoadedPackages getLoadedPackages
|
||||
static int TclGetLoadedPackages(
|
||||
Tcl_Interp *interp, /* Interpreter in which to return information
|
||||
* or error message. */
|
||||
const char *targetName) /* Name of target interpreter or NULL. If
|
||||
* NULL, return info about all interps;
|
||||
* otherwise, just return info about this
|
||||
* interpreter. */
|
||||
{
|
||||
return TclGetLoadedPackagesEx(interp, targetName, NULL);
|
||||
}
|
||||
|
||||
mp_err TclBN_mp_div_3(const mp_int *a, mp_int *c, unsigned int *d) {
|
||||
mp_digit d2;
|
||||
mp_err result = mp_div_d(a, 3, c, &d2);
|
||||
@@ -450,7 +472,7 @@ void *TclWinGetTclInstance()
|
||||
int
|
||||
TclpGetPid(Tcl_Pid pid)
|
||||
{
|
||||
return (int) (size_t) pid;
|
||||
return (int)(size_t)pid;
|
||||
}
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
@@ -1312,7 +1334,7 @@ const TclStubs tclStubs = {
|
||||
Tcl_CreateInterp, /* 94 */
|
||||
Tcl_CreateMathFunc, /* 95 */
|
||||
Tcl_CreateObjCommand, /* 96 */
|
||||
Tcl_CreateSlave, /* 97 */
|
||||
Tcl_CreateChild, /* 97 */
|
||||
Tcl_CreateTimerHandler, /* 98 */
|
||||
Tcl_CreateTrace, /* 99 */
|
||||
Tcl_DeleteAssocData, /* 100 */
|
||||
@@ -1379,7 +1401,7 @@ const TclStubs tclStubs = {
|
||||
Tcl_GetErrno, /* 161 */
|
||||
Tcl_GetHostName, /* 162 */
|
||||
Tcl_GetInterpPath, /* 163 */
|
||||
Tcl_GetMaster, /* 164 */
|
||||
Tcl_GetParent, /* 164 */
|
||||
Tcl_GetNameOfExecutable, /* 165 */
|
||||
Tcl_GetObjResult, /* 166 */
|
||||
#if !defined(_WIN32) && !defined(MAC_OSX_TCL) /* UNIX */
|
||||
@@ -1395,7 +1417,7 @@ const TclStubs tclStubs = {
|
||||
Tcl_Gets, /* 169 */
|
||||
Tcl_GetsObj, /* 170 */
|
||||
Tcl_GetServiceMode, /* 171 */
|
||||
Tcl_GetSlave, /* 172 */
|
||||
Tcl_GetChild, /* 172 */
|
||||
Tcl_GetStdChannel, /* 173 */
|
||||
Tcl_GetStringResult, /* 174 */
|
||||
Tcl_GetVar, /* 175 */
|
||||
|
||||
+100
-106
@@ -727,7 +727,7 @@ Tcltest_SafeInit(
|
||||
|
||||
static int
|
||||
TestasyncCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -937,7 +937,7 @@ AsyncThreadProc(
|
||||
|
||||
static int
|
||||
TestbumpinterpepochObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -972,7 +972,7 @@ TestbumpinterpepochObjCmd(
|
||||
|
||||
static int
|
||||
TestcmdinfoCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -1099,7 +1099,7 @@ CmdDelProc2(
|
||||
|
||||
static int
|
||||
TestcmdtokenCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -1162,7 +1162,7 @@ TestcmdtokenCmd(
|
||||
|
||||
static int
|
||||
TestcmdtraceCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -1259,7 +1259,7 @@ CmdTraceProc(
|
||||
char *command, /* The command being traced (after
|
||||
* substitutions). */
|
||||
TCL_UNUSED(Tcl_CmdProc *) /*cmdProc*/,
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
int argc, /* Number of arguments. */
|
||||
const char *argv[]) /* Argument strings. */
|
||||
{
|
||||
@@ -1277,12 +1277,12 @@ CmdTraceProc(
|
||||
|
||||
static void
|
||||
CmdTraceDeleteProc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
TCL_UNUSED(int) /*level*/,
|
||||
TCL_UNUSED(char *) /*command*/,
|
||||
TCL_UNUSED(Tcl_CmdProc *),
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(int) /*argc*/,
|
||||
TCL_UNUSED(const char **) /*argv*/)
|
||||
{
|
||||
@@ -1297,7 +1297,7 @@ CmdTraceDeleteProc(
|
||||
|
||||
static int
|
||||
ObjTraceProc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Tcl interpreter */
|
||||
TCL_UNUSED(int) /*level*/,
|
||||
const char *command,
|
||||
@@ -1354,7 +1354,7 @@ ObjTraceDeleteProc(
|
||||
|
||||
static int
|
||||
TestcreatecommandCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -1384,7 +1384,7 @@ TestcreatecommandCmd(
|
||||
|
||||
static int
|
||||
CreatedCommandProc(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
TCL_UNUSED(int) /*argc*/,
|
||||
TCL_UNUSED(const char **) /*argv*/)
|
||||
@@ -1406,7 +1406,7 @@ CreatedCommandProc(
|
||||
|
||||
static int
|
||||
CreatedCommandProc2(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
TCL_UNUSED(int) /*argc*/,
|
||||
TCL_UNUSED(const char **) /*argv*/)
|
||||
@@ -1444,7 +1444,7 @@ CreatedCommandProc2(
|
||||
|
||||
static int
|
||||
TestdcallCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -1508,21 +1508,21 @@ DelCallbackProc(
|
||||
|
||||
static int
|
||||
TestdelCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
{
|
||||
DelCmd *dPtr;
|
||||
Tcl_Interp *slave;
|
||||
Tcl_Interp *child;
|
||||
|
||||
if (argc != 4) {
|
||||
Tcl_AppendResult(interp, "wrong # args", NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
slave = Tcl_GetSlave(interp, argv[1]);
|
||||
if (slave == NULL) {
|
||||
child = Tcl_GetChild(interp, argv[1]);
|
||||
if (child == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1531,7 +1531,7 @@ TestdelCmd(
|
||||
dPtr->deleteCmd = (char *)ckalloc(strlen(argv[3]) + 1);
|
||||
strcpy(dPtr->deleteCmd, argv[3]);
|
||||
|
||||
Tcl_CreateCommand(slave, argv[2], DelCmdProc, dPtr,
|
||||
Tcl_CreateCommand(child, argv[2], DelCmdProc, dPtr,
|
||||
DelDeleteProc);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1583,7 +1583,7 @@ DelDeleteProc(
|
||||
|
||||
static int
|
||||
TestdelassocdataCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -1620,7 +1620,7 @@ TestdelassocdataCmd(
|
||||
|
||||
static int
|
||||
TestdoubledigitsObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp* interp, /* Tcl interpreter */
|
||||
int objc, /* Parameter count */
|
||||
Tcl_Obj* const objv[]) /* Parameter vector */
|
||||
@@ -1707,7 +1707,7 @@ TestdoubledigitsObjCmd(
|
||||
|
||||
static int
|
||||
TestdstringCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -1833,7 +1833,7 @@ static void SpecialFree(
|
||||
|
||||
static int
|
||||
TestencodingObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -1993,7 +1993,7 @@ EncodingFreeProc(
|
||||
|
||||
static int
|
||||
TestevalexObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -2038,7 +2038,7 @@ TestevalexObjCmd(
|
||||
|
||||
static int
|
||||
TestevalobjvObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -2087,7 +2087,7 @@ TestevalobjvObjCmd(
|
||||
|
||||
static int
|
||||
TesteventObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Tcl interpreter */
|
||||
int objc, /* Parameter count */
|
||||
Tcl_Obj *const objv[]) /* Parameter vector */
|
||||
@@ -2266,7 +2266,7 @@ TesteventDeleteProc(
|
||||
|
||||
static int
|
||||
TestexithandlerCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -2342,7 +2342,7 @@ ExitProcEven(
|
||||
|
||||
static int
|
||||
TestexprlongCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -2385,7 +2385,7 @@ TestexprlongCmd(
|
||||
|
||||
static int
|
||||
TestexprlongobjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const *objv) /* Argument objects. */
|
||||
@@ -2427,7 +2427,7 @@ TestexprlongobjCmd(
|
||||
|
||||
static int
|
||||
TestexprdoubleCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -2471,7 +2471,7 @@ TestexprdoubleCmd(
|
||||
|
||||
static int
|
||||
TestexprdoubleobjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const *objv) /* Argument objects. */
|
||||
@@ -2513,7 +2513,7 @@ TestexprdoubleobjCmd(
|
||||
|
||||
static int
|
||||
TestexprstringCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -2545,7 +2545,7 @@ TestexprstringCmd(
|
||||
|
||||
static int
|
||||
TestfilelinkCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -2612,7 +2612,7 @@ TestfilelinkCmd(
|
||||
|
||||
static int
|
||||
TestgetassocdataCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -2650,7 +2650,7 @@ TestgetassocdataCmd(
|
||||
|
||||
static int
|
||||
TestgetplatformCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -2690,23 +2690,23 @@ TestgetplatformCmd(
|
||||
|
||||
static int
|
||||
TestinterpdeleteCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
{
|
||||
Tcl_Interp *slaveToDelete;
|
||||
Tcl_Interp *childToDelete;
|
||||
|
||||
if (argc != 2) {
|
||||
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
|
||||
" path\"", NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
slaveToDelete = Tcl_GetSlave(interp, argv[1]);
|
||||
if (slaveToDelete == NULL) {
|
||||
childToDelete = Tcl_GetChild(interp, argv[1]);
|
||||
if (childToDelete == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_DeleteInterp(slaveToDelete);
|
||||
Tcl_DeleteInterp(childToDelete);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -2730,7 +2730,7 @@ TestinterpdeleteCmd(
|
||||
|
||||
static int
|
||||
TestlinkCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -3198,7 +3198,7 @@ TestlinkCmd(
|
||||
|
||||
static int
|
||||
TestlinkarrayCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -3206,7 +3206,7 @@ TestlinkarrayCmd(
|
||||
static const char *LinkOption[] = {
|
||||
"update", "remove", "create", NULL
|
||||
};
|
||||
enum LinkOption { LINK_UPDATE, LINK_REMOVE, LINK_CREATE };
|
||||
enum LinkOptionEnum { LINK_UPDATE, LINK_REMOVE, LINK_CREATE };
|
||||
static const char *LinkType[] = {
|
||||
"char", "uchar", "short", "ushort", "int", "uint", "long", "ulong",
|
||||
"wide", "uwide", "float", "double", "string", "char*", "binary", NULL
|
||||
@@ -3231,7 +3231,7 @@ TestlinkarrayCmd(
|
||||
&optionIndex) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum LinkOption) optionIndex) {
|
||||
switch ((enum LinkOptionEnum) optionIndex) {
|
||||
case LINK_UPDATE:
|
||||
for (i=2; i<objc; i++) {
|
||||
Tcl_UpdateLinkedVar(interp, Tcl_GetString(objv[i]));
|
||||
@@ -3316,7 +3316,7 @@ TestlinkarrayCmd(
|
||||
|
||||
static int
|
||||
TestlocaleCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -3402,7 +3402,7 @@ CleanupTestSetassocdataTests(
|
||||
|
||||
static int
|
||||
TestparserObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -3458,7 +3458,7 @@ TestparserObjCmd(
|
||||
|
||||
static int
|
||||
TestexprparserObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -3605,7 +3605,7 @@ PrintParse(
|
||||
|
||||
static int
|
||||
TestparsevarObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -3646,7 +3646,7 @@ TestparsevarObjCmd(
|
||||
|
||||
static int
|
||||
TestparsevarnameObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -3709,7 +3709,7 @@ TestparsevarnameObjCmd(
|
||||
|
||||
static int
|
||||
TestpreferstableObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
TCL_UNUSED(int) /*objc*/,
|
||||
TCL_UNUSED(Tcl_Obj *const *) /*objv*/)
|
||||
@@ -3739,7 +3739,7 @@ TestpreferstableObjCmd(
|
||||
|
||||
static int
|
||||
TestprintObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -3780,7 +3780,7 @@ TestprintObjCmd(
|
||||
|
||||
static int
|
||||
TestregexpObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -3797,7 +3797,7 @@ TestregexpObjCmd(
|
||||
"-xflags",
|
||||
"--", NULL
|
||||
};
|
||||
enum options {
|
||||
enum optionsEnum {
|
||||
REGEXP_INDICES, REGEXP_NOCASE, REGEXP_ABOUT, REGEXP_EXPANDED,
|
||||
REGEXP_MULTI, REGEXP_NOCROSS, REGEXP_NEWL,
|
||||
REGEXP_XFLAGS,
|
||||
@@ -3822,7 +3822,7 @@ TestregexpObjCmd(
|
||||
&index) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum options) index) {
|
||||
switch ((enum optionsEnum) index) {
|
||||
case REGEXP_INDICES:
|
||||
indices = 1;
|
||||
break;
|
||||
@@ -4103,7 +4103,7 @@ TestregexpXflags(
|
||||
|
||||
static int
|
||||
TestreturnObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(Tcl_Interp *),
|
||||
TCL_UNUSED(int) /*objc*/,
|
||||
TCL_UNUSED(Tcl_Obj *const *) /*objv*/)
|
||||
@@ -4131,7 +4131,7 @@ TestreturnObjCmd(
|
||||
|
||||
static int
|
||||
TestsetassocdataCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -4182,7 +4182,7 @@ TestsetassocdataCmd(
|
||||
|
||||
static int
|
||||
TestsetplatformCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -4231,7 +4231,7 @@ TestsetplatformCmd(
|
||||
|
||||
static int
|
||||
TeststaticpkgCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -4282,7 +4282,7 @@ StaticInitProc(
|
||||
|
||||
static int
|
||||
TesttranslatefilenameCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -4323,7 +4323,7 @@ TesttranslatefilenameCmd(
|
||||
|
||||
static int
|
||||
TestupvarCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -4375,7 +4375,7 @@ TestupvarCmd(
|
||||
|
||||
static int
|
||||
TestseterrorcodeCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -4427,7 +4427,7 @@ TestseterrorcodeCmd(
|
||||
|
||||
static int
|
||||
TestsetobjerrorcodeCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -4455,7 +4455,7 @@ TestsetobjerrorcodeCmd(
|
||||
|
||||
static int
|
||||
TestfeventCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -4527,7 +4527,7 @@ TestfeventCmd(
|
||||
|
||||
static int
|
||||
TestpanicCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(Tcl_Interp *),
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -4546,7 +4546,7 @@ TestpanicCmd(
|
||||
|
||||
static int
|
||||
TestfileCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
Tcl_Obj *const argv[]) /* The argument objects. */
|
||||
@@ -4628,7 +4628,7 @@ TestfileCmd(
|
||||
|
||||
static int
|
||||
TestgetvarfullnameCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -4702,7 +4702,7 @@ TestgetvarfullnameCmd(
|
||||
|
||||
static int
|
||||
GetTimesObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* The current interpreter. */
|
||||
TCL_UNUSED(int) /*cobjc*/,
|
||||
TCL_UNUSED(Tcl_Obj *const *) /*cobjv*/)
|
||||
@@ -4881,7 +4881,7 @@ GetTimesObjCmd(
|
||||
|
||||
static int
|
||||
NoopCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(Tcl_Interp *),
|
||||
TCL_UNUSED(int) /*argc*/,
|
||||
TCL_UNUSED(const char **) /*argv*/)
|
||||
@@ -4908,7 +4908,7 @@ NoopCmd(
|
||||
|
||||
static int
|
||||
NoopObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(Tcl_Interp *),
|
||||
TCL_UNUSED(int) /*objc*/,
|
||||
TCL_UNUSED(Tcl_Obj *const *) /*objv*/)
|
||||
@@ -4933,7 +4933,7 @@ NoopObjCmd(
|
||||
|
||||
static int
|
||||
TeststringbytesObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -4973,7 +4973,7 @@ TeststringbytesObjCmd(
|
||||
|
||||
static int
|
||||
TestpurebytesobjObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -5020,7 +5020,7 @@ TestpurebytesobjObjCmd(
|
||||
|
||||
static int
|
||||
TestsetbytearraylengthObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -5064,7 +5064,7 @@ TestsetbytearraylengthObjCmd(
|
||||
|
||||
static int
|
||||
TestbytestringObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -5186,7 +5186,7 @@ Testset2Cmd(
|
||||
|
||||
static int
|
||||
TestsaveresultCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,/* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
@@ -5317,7 +5317,7 @@ TestsaveresultFree(
|
||||
|
||||
static int
|
||||
TestmainthreadCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,/* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
TCL_UNUSED(const char **) /*argv*/)
|
||||
@@ -5378,7 +5378,7 @@ MainLoop(void)
|
||||
|
||||
static int
|
||||
TestsetmainloopCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(Tcl_Interp *),
|
||||
TCL_UNUSED(int) /*argc*/,
|
||||
TCL_UNUSED(const char **) /*argv*/)
|
||||
@@ -5407,7 +5407,7 @@ TestsetmainloopCmd(
|
||||
|
||||
static int
|
||||
TestexitmainloopCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
TCL_UNUSED(Tcl_Interp *),
|
||||
TCL_UNUSED(int) /*argc*/,
|
||||
TCL_UNUSED(const char **) /*argv*/)
|
||||
@@ -5435,7 +5435,7 @@ TestexitmainloopCmd(
|
||||
|
||||
static int
|
||||
TestChannelCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Interpreter for result. */
|
||||
int argc, /* Count of additional args. */
|
||||
const char **argv) /* Additional arg strings. */
|
||||
@@ -5902,7 +5902,7 @@ TestChannelCmd(
|
||||
|
||||
static int
|
||||
TestChannelEventCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -6114,7 +6114,7 @@ TestChannelEventCmd(
|
||||
|
||||
static int
|
||||
TestSocketCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Interpreter for result. */
|
||||
int argc, /* Count of additional args. */
|
||||
const char **argv) /* Additional arg strings. */
|
||||
@@ -6185,7 +6185,7 @@ TestSocketCmd(
|
||||
|
||||
static int
|
||||
TestServiceModeCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int argc, /* Number of arguments. */
|
||||
const char **argv) /* Argument strings. */
|
||||
@@ -6229,7 +6229,7 @@ TestServiceModeCmd(
|
||||
|
||||
static int
|
||||
TestWrongNumArgsObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -6285,7 +6285,7 @@ TestWrongNumArgsObjCmd(
|
||||
|
||||
static int
|
||||
TestGetIndexFromObjStructObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -6339,7 +6339,7 @@ TestGetIndexFromObjStructObjCmd(
|
||||
|
||||
static int
|
||||
TestFilesystemObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -6681,7 +6681,7 @@ TestReportNormalizePath(
|
||||
static int
|
||||
SimplePathInFilesystem(
|
||||
Tcl_Obj *pathPtr,
|
||||
TCL_UNUSED(ClientData *))
|
||||
TCL_UNUSED(void **))
|
||||
{
|
||||
const char *str = Tcl_GetString(pathPtr);
|
||||
|
||||
@@ -6710,7 +6710,7 @@ SimplePathInFilesystem(
|
||||
|
||||
static int
|
||||
TestSimpleFilesystemObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -6971,7 +6971,7 @@ TestUtfPrevCmd(
|
||||
|
||||
static int
|
||||
TestNumUtfCharsCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -7000,7 +7000,7 @@ TestNumUtfCharsCmd(
|
||||
|
||||
static int
|
||||
TestFindFirstCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -7022,7 +7022,7 @@ TestFindFirstCmd(
|
||||
|
||||
static int
|
||||
TestFindLastCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -7064,7 +7064,7 @@ TestFindLastCmd(
|
||||
|
||||
static int
|
||||
TestcpuidCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp* interp, /* Tcl interpreter */
|
||||
int objc, /* Parameter count */
|
||||
Tcl_Obj *const * objv) /* Parameter vector */
|
||||
@@ -7100,7 +7100,7 @@ TestcpuidCmd(
|
||||
|
||||
static int
|
||||
TestHashSystemHashCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -7176,7 +7176,7 @@ TestHashSystemHashCmd(
|
||||
*/
|
||||
static int
|
||||
TestgetintCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int argc,
|
||||
const char **argv)
|
||||
@@ -7203,7 +7203,7 @@ TestgetintCmd(
|
||||
*/
|
||||
static int
|
||||
TestlongsizeCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int argc,
|
||||
TCL_UNUSED(const char **) /*argv*/)
|
||||
@@ -7245,7 +7245,7 @@ NREUnwind_callback(
|
||||
|
||||
static int
|
||||
TestNREUnwind(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
TCL_UNUSED(int) /*objc*/,
|
||||
TCL_UNUSED(Tcl_Obj *const *) /*objv*/)
|
||||
@@ -7263,7 +7263,7 @@ TestNREUnwind(
|
||||
|
||||
static int
|
||||
TestNRELevels(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
TCL_UNUSED(int) /*objc*/,
|
||||
TCL_UNUSED(Tcl_Obj *const *) /*objv*/)
|
||||
@@ -7319,7 +7319,7 @@ TestNRELevels(
|
||||
|
||||
static int
|
||||
TestconcatobjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
TCL_UNUSED(int) /*argc*/,
|
||||
TCL_UNUSED(const char **) /*argv*/)
|
||||
@@ -7488,8 +7488,6 @@ TestconcatobjCmd(
|
||||
"\n\t* (e) concatObj does not have refCount 0", NULL);
|
||||
}
|
||||
if (concatPtr == tmpPtr) {
|
||||
int len;
|
||||
|
||||
result = TCL_ERROR;
|
||||
Tcl_AppendResult(interp, "\n\t* (e) concatObj is not a new obj ",
|
||||
NULL);
|
||||
@@ -7520,8 +7518,6 @@ TestconcatobjCmd(
|
||||
"\n\t* (f) concatObj does not have refCount 0", NULL);
|
||||
}
|
||||
if (concatPtr == tmpPtr) {
|
||||
int len;
|
||||
|
||||
result = TCL_ERROR;
|
||||
Tcl_AppendResult(interp, "\n\t* (f) concatObj is not a new obj ",
|
||||
NULL);
|
||||
@@ -7553,8 +7549,6 @@ TestconcatobjCmd(
|
||||
"\n\t* (g) concatObj does not have refCount 0", NULL);
|
||||
}
|
||||
if (concatPtr == tmpPtr) {
|
||||
int len;
|
||||
|
||||
result = TCL_ERROR;
|
||||
Tcl_AppendResult(interp, "\n\t* (g) concatObj is not a new obj ",
|
||||
NULL);
|
||||
@@ -7615,7 +7609,7 @@ TestconcatobjCmd(
|
||||
|
||||
static int
|
||||
TestgetencpathObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const *objv) /* Argument strings. */
|
||||
@@ -7648,7 +7642,7 @@ TestgetencpathObjCmd(
|
||||
|
||||
static int
|
||||
TestsetencpathObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const *objv) /* Argument strings. */
|
||||
@@ -7682,7 +7676,7 @@ TestsetencpathObjCmd(
|
||||
|
||||
static int
|
||||
TestparseargsCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Arguments. */
|
||||
@@ -7921,7 +7915,7 @@ InterpCompiledVarResolver(
|
||||
|
||||
static int
|
||||
TestInterpResolverCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -7937,7 +7931,7 @@ TestInterpResolverCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (objc == 3) {
|
||||
interp = Tcl_GetSlave(interp, Tcl_GetString(objv[2]));
|
||||
interp = Tcl_GetChild(interp, Tcl_GetString(objv[2]));
|
||||
if (interp == NULL) {
|
||||
Tcl_AppendResult(interp, "provided interpreter not found", NULL);
|
||||
return TCL_ERROR;
|
||||
|
||||
@@ -149,7 +149,7 @@ TclObjTest_Init(
|
||||
|
||||
static int
|
||||
TestbignumobjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Tcl interpreter */
|
||||
int objc, /* Argument count */
|
||||
Tcl_Obj *const objv[]) /* Argument vector */
|
||||
@@ -348,7 +348,7 @@ TestbignumobjCmd(
|
||||
|
||||
static int
|
||||
TestbooleanobjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -448,7 +448,7 @@ TestbooleanobjCmd(
|
||||
|
||||
static int
|
||||
TestdoubleobjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -566,7 +566,7 @@ TestdoubleobjCmd(
|
||||
|
||||
static int
|
||||
TestindexobjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -627,7 +627,7 @@ TestindexobjCmd(
|
||||
argv[objc-4] = NULL;
|
||||
|
||||
result = Tcl_GetIndexFromObj((setError? interp : NULL), objv[3],
|
||||
argv, "token", INDEX_TEMP_TABLE|(allowAbbrev? 0 : TCL_EXACT),
|
||||
argv, "token", TCL_INDEX_TEMP_TABLE|(allowAbbrev? 0 : TCL_EXACT),
|
||||
&index);
|
||||
ckfree(argv);
|
||||
if (result == TCL_OK) {
|
||||
@@ -656,7 +656,7 @@ TestindexobjCmd(
|
||||
|
||||
static int
|
||||
TestintobjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -860,7 +860,7 @@ TestintobjCmd(
|
||||
|
||||
static int
|
||||
TestlistobjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Tcl interpreter */
|
||||
int objc, /* Number of arguments */
|
||||
Tcl_Obj *const objv[]) /* Argument objects */
|
||||
@@ -957,7 +957,7 @@ TestlistobjCmd(
|
||||
|
||||
static int
|
||||
TestobjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -1169,7 +1169,7 @@ TestobjCmd(
|
||||
|
||||
static int
|
||||
TeststringobjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
|
||||
@@ -228,7 +228,7 @@ ProcBodyTestInitInternal(
|
||||
|
||||
static int
|
||||
ProcBodyTestProcObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* the current interpreter */
|
||||
int objc, /* argument count */
|
||||
Tcl_Obj *const objv[]) /* arguments */
|
||||
@@ -327,7 +327,7 @@ ProcBodyTestProcObjCmd(
|
||||
|
||||
static int
|
||||
ProcBodyTestCheckObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* the current interpreter */
|
||||
int objc, /* argument count */
|
||||
Tcl_Obj *const objv[]) /* arguments */
|
||||
|
||||
@@ -205,7 +205,7 @@ TclThread_Init(
|
||||
|
||||
static int
|
||||
ThreadObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -413,7 +413,7 @@ ThreadObjCmd(
|
||||
Tcl_WrongNumArgs(interp, 2, objv, NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
|
||||
Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT)));
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1105,7 +1105,7 @@ ThreadFreeProc(
|
||||
static int
|
||||
ThreadDeleteEvent(
|
||||
Tcl_Event *eventPtr, /* Really ThreadEvent */
|
||||
TCL_UNUSED(ClientData))
|
||||
TCL_UNUSED(void *))
|
||||
{
|
||||
if (eventPtr->proc == ThreadEventProc) {
|
||||
ckfree(((ThreadEvent *) eventPtr)->script);
|
||||
|
||||
+5
-3
@@ -792,7 +792,7 @@ Tcl_AfterObjCmd(
|
||||
static const char *const afterSubCmds[] = {
|
||||
"cancel", "idle", "info", NULL
|
||||
};
|
||||
enum afterSubCmds {AFTER_CANCEL, AFTER_IDLE, AFTER_INFO};
|
||||
enum afterSubCmdsEnum {AFTER_CANCEL, AFTER_IDLE, AFTER_INFO};
|
||||
ThreadSpecificData *tsdPtr = InitTimer();
|
||||
|
||||
if (objc < 2) {
|
||||
@@ -942,8 +942,9 @@ Tcl_AfterObjCmd(
|
||||
break;
|
||||
case AFTER_INFO:
|
||||
if (objc == 2) {
|
||||
Tcl_Obj *resultObj = Tcl_NewObj();
|
||||
Tcl_Obj *resultObj;
|
||||
|
||||
TclNewObj(resultObj);
|
||||
for (afterPtr = assocPtr->firstAfterPtr; afterPtr != NULL;
|
||||
afterPtr = afterPtr->nextPtr) {
|
||||
if (assocPtr->interp == interp) {
|
||||
@@ -967,8 +968,9 @@ Tcl_AfterObjCmd(
|
||||
Tcl_SetErrorCode(interp, "TCL","LOOKUP","EVENT", eventStr, NULL);
|
||||
return TCL_ERROR;
|
||||
} else {
|
||||
Tcl_Obj *resultListPtr = Tcl_NewObj();
|
||||
Tcl_Obj *resultListPtr;
|
||||
|
||||
TclNewObj(resultListPtr);
|
||||
Tcl_ListObjAppendElement(interp, resultListPtr,
|
||||
afterPtr->commandPtr);
|
||||
Tcl_ListObjAppendElement(interp, resultListPtr, Tcl_NewStringObj(
|
||||
|
||||
+7
-8
@@ -183,7 +183,7 @@ typedef struct {
|
||||
|
||||
int
|
||||
Tcl_TraceObjCmd(
|
||||
TCL_UNUSED(ClientData),
|
||||
TCL_UNUSED(void *),
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
@@ -202,7 +202,7 @@ Tcl_TraceObjCmd(
|
||||
NULL
|
||||
};
|
||||
/* 'OLD' options are pre-Tcl-8.4 style */
|
||||
enum traceOptions {
|
||||
enum traceOptionsEnum {
|
||||
TRACE_ADD, TRACE_INFO, TRACE_REMOVE,
|
||||
#ifndef TCL_REMOVE_OBSOLETE_TRACES
|
||||
TRACE_OLD_VARIABLE, TRACE_OLD_VDELETE, TRACE_OLD_VINFO
|
||||
@@ -218,7 +218,7 @@ Tcl_TraceObjCmd(
|
||||
&optionIndex) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
switch ((enum traceOptions) optionIndex) {
|
||||
switch ((enum traceOptionsEnum) optionIndex) {
|
||||
case TRACE_ADD:
|
||||
case TRACE_REMOVE: {
|
||||
/*
|
||||
@@ -276,7 +276,7 @@ Tcl_TraceObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
opsList = Tcl_NewObj();
|
||||
TclNewObj(opsList);
|
||||
Tcl_IncrRefCount(opsList);
|
||||
flagOps = TclGetStringFromObj(objv[3], &numFlags);
|
||||
if (numFlags == 0) {
|
||||
@@ -320,7 +320,7 @@ Tcl_TraceObjCmd(
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "name");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
resultListPtr = Tcl_NewObj();
|
||||
TclNewObj(resultListPtr);
|
||||
name = Tcl_GetString(objv[2]);
|
||||
FOREACH_VAR_TRACE(interp, name, clientData) {
|
||||
TraceVarInfo *tvarPtr = (TraceVarInfo *)clientData;
|
||||
@@ -965,7 +965,7 @@ TraceVariableObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
resultListPtr = Tcl_NewObj();
|
||||
TclNewObj(resultListPtr);
|
||||
name = Tcl_GetString(objv[3]);
|
||||
FOREACH_VAR_TRACE(interp, name, clientData) {
|
||||
Tcl_Obj *opObjPtr, *eachTraceObjPtr, *elemObjPtr;
|
||||
@@ -1177,7 +1177,7 @@ Tcl_UntraceCommand(
|
||||
CommandTrace *tracePtr;
|
||||
CommandTrace *prevPtr;
|
||||
Command *cmdPtr;
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Interp *iPtr = (Interp *)interp;
|
||||
ActiveCommandTrace *activePtr;
|
||||
int hasExecTraces = 0;
|
||||
|
||||
@@ -1252,7 +1252,6 @@ Tcl_UntraceCommand(
|
||||
*/
|
||||
|
||||
if (cmdPtr->compileProc != NULL) {
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
iPtr->compileEpoch++;
|
||||
}
|
||||
}
|
||||
|
||||
+11
-12
@@ -2040,7 +2040,7 @@ Tcl_ConcatObj(
|
||||
}
|
||||
}
|
||||
if (!resPtr) {
|
||||
resPtr = Tcl_NewObj();
|
||||
TclNewObj(resPtr);
|
||||
}
|
||||
return resPtr;
|
||||
}
|
||||
@@ -3757,7 +3757,7 @@ GetEndOffsetFromObj(
|
||||
if (*bytes != 'e') {
|
||||
int numType;
|
||||
const char *opPtr;
|
||||
int length, t1 = 0, t2 = 0;
|
||||
int t1 = 0, t2 = 0;
|
||||
|
||||
/* Value doesn't start with "e" */
|
||||
|
||||
@@ -3774,7 +3774,7 @@ GetEndOffsetFromObj(
|
||||
* Quick scan to see if multi-value list is even possible.
|
||||
* This relies on TclGetString() returning a NUL-terminated string.
|
||||
*/
|
||||
if ((TclMaxListLength(TclGetString(objPtr), -1, NULL) > 1)
|
||||
if ((TclMaxListLength(bytes, -1, NULL) > 1)
|
||||
|
||||
/* If it's possible, do the full list parse. */
|
||||
&& (TCL_OK == Tcl_ListObjLength(NULL, objPtr, &length))
|
||||
@@ -3817,7 +3817,7 @@ GetEndOffsetFromObj(
|
||||
if ((t1 == TCL_NUMBER_INT) && (t2 == TCL_NUMBER_INT)) {
|
||||
/* Both are wide, do wide-integer math */
|
||||
if (*opPtr == '-') {
|
||||
if ((w2 == WIDE_MIN) && (interp != NULL)) {
|
||||
if (w2 == WIDE_MIN) {
|
||||
goto extreme;
|
||||
}
|
||||
w2 = -w2;
|
||||
@@ -3839,13 +3839,6 @@ GetEndOffsetFromObj(
|
||||
offset = WIDE_MIN;
|
||||
}
|
||||
}
|
||||
} else if (interp == NULL) {
|
||||
/*
|
||||
* We use an interp to do bignum index calculations.
|
||||
* If we don't get one, call all indices with bignums errors,
|
||||
* and rely on callers to handle it.
|
||||
*/
|
||||
goto parseError;
|
||||
} else {
|
||||
/*
|
||||
* At least one is big, do bignum math. Little reason to
|
||||
@@ -3856,7 +3849,13 @@ GetEndOffsetFromObj(
|
||||
Tcl_Obj *sum;
|
||||
|
||||
extreme:
|
||||
Tcl_ExprObj(interp, objPtr, &sum);
|
||||
if (interp) {
|
||||
Tcl_ExprObj(interp, objPtr, &sum);
|
||||
} else {
|
||||
Tcl_Interp *compute = Tcl_CreateInterp();
|
||||
Tcl_ExprObj(compute, objPtr, &sum);
|
||||
Tcl_DeleteInterp(compute);
|
||||
}
|
||||
TclGetNumberFromObj(NULL, sum, &cd, &numType);
|
||||
|
||||
if (numType == TCL_NUMBER_INT) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user