Compare commits
876
Commits
tip-390
...
memory-API
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99e9ce3656 | ||
|
|
d84d03b91a | ||
|
|
a51d80f377 | ||
|
|
7a674da778 | ||
|
|
54f90bae0f | ||
|
|
9c4ab4170b | ||
|
|
0624d7cbb7 | ||
|
|
5919affa3d | ||
|
|
024406099a | ||
|
|
b9d97ed6af | ||
|
|
51dbd66fe3 | ||
|
|
6dbdbb7d1b | ||
|
|
d2edfcf2bd | ||
|
|
37b9b4dedc | ||
|
|
45d39f0444 | ||
|
|
a29938f899 | ||
|
|
b4ae859604 | ||
|
|
de5344f487 | ||
|
|
ea1a9cc17e | ||
|
|
f36f29ad95 | ||
|
|
f12dda1428 | ||
|
|
283e5ff856 | ||
|
|
1f6a76bca6 | ||
|
|
50bedec272 | ||
|
|
9865f6dc47 | ||
|
|
14d9c80d61 | ||
|
|
d298eafcf5 | ||
|
|
b59b81e172 | ||
|
|
c0b6ad149e | ||
|
|
d19917714c | ||
|
|
69eafefa76 | ||
|
|
73e0989e22 | ||
|
|
2154b6c5ba | ||
|
|
004ac14973 | ||
|
|
4abfb9ea2c | ||
|
|
6e39ca4071 | ||
|
|
c828e5de43 | ||
|
|
58b8920b8f | ||
|
|
737e63d3bc | ||
|
|
21113a4394 | ||
|
|
1f6ac7f87e | ||
|
|
2562ea174b | ||
|
|
3250944e1f | ||
|
|
6b9510ca19 | ||
|
|
ba417d3ce6 | ||
|
|
195f90c951 | ||
|
|
e663097026 | ||
|
|
2c081dcd0c | ||
|
|
ce1c1edacb | ||
|
|
8623f173db | ||
|
|
e754f7aad1 | ||
|
|
b880f036f9 | ||
|
|
62c8a18cdc | ||
|
|
8ec7000cfd | ||
|
|
1bc2496e01 | ||
|
|
c3cec2c712 | ||
|
|
6042bb0be1 | ||
|
|
485410de9b | ||
|
|
e68dfbc8af | ||
|
|
5c0692322d | ||
|
|
0704a6f87b | ||
|
|
45f814fec7 | ||
|
|
7547e67f40 | ||
|
|
ec3c18e54e | ||
|
|
40e253fe8a | ||
|
|
142fa0ec7c | ||
|
|
10c6cd5a2c | ||
|
|
9a9c228341 | ||
|
|
5f1c7cb11e | ||
|
|
2b4ed03502 | ||
|
|
20b21aaa69 | ||
|
|
d4a30d2344 | ||
|
|
7f445021a0 | ||
|
|
04e4629c9f | ||
|
|
f74cbbd446 | ||
|
|
83fd58165e | ||
|
|
b4d2fffb28 | ||
|
|
572883ec08 | ||
|
|
535266afa3 | ||
|
|
cf5a680373 | ||
|
|
4a0e6ae460 | ||
|
|
79f1d89388 | ||
|
|
b8e604ca08 | ||
|
|
77ba009f38 | ||
|
|
3dc03bc4ac | ||
|
|
94741577ee | ||
|
|
709f9278ff | ||
|
|
5248fb0651 | ||
|
|
9478033661 | ||
|
|
66ec3cd3a6 | ||
|
|
7cb7a44074 | ||
|
|
41a740e30c | ||
|
|
868f84d487 | ||
|
|
3c26b9439d | ||
|
|
6264f49788 | ||
|
|
9d19f3532c | ||
|
|
ffd6cad4d9 | ||
|
|
c44181ecaf | ||
|
|
824f621875 | ||
|
|
ab3286e299 | ||
|
|
14994d8a85 | ||
|
|
919ec44584 | ||
|
|
eccaf23657 | ||
|
|
d8264cbb73 | ||
|
|
57409ec3f0 | ||
|
|
30a0e246b6 | ||
|
|
c2634b8813 | ||
|
|
accd885c10 | ||
|
|
e4c4396db2 | ||
|
|
76ffa2482f | ||
|
|
ba6f0054c4 | ||
|
|
9ae8deb0b4 | ||
|
|
5e1789954d | ||
|
|
168a0bba16 | ||
|
|
50f0f668e5 | ||
|
|
020fea0acd | ||
|
|
51ac01d942 | ||
|
|
ca0f6f2273 | ||
|
|
a9e7c22c38 | ||
|
|
94314d3409 | ||
|
|
ae73bae096 | ||
|
|
7bc7f4397f | ||
|
|
37c4a581ad | ||
|
|
cfd3e75337 | ||
|
|
33610dd48f | ||
|
|
1f7ca2ff69 | ||
|
|
c3b1e9053b | ||
|
|
cfb0d67424 | ||
|
|
b25aceb078 | ||
|
|
56af8c1770 | ||
|
|
97b08c9a24 | ||
|
|
b97b608974 | ||
|
|
7a91dd767e | ||
|
|
48a249a15e | ||
|
|
678622482a | ||
|
|
c23982e3c2 | ||
|
|
a85834a18e | ||
|
|
36aca800d0 | ||
|
|
a14cef18c0 | ||
|
|
b104b5ce6e | ||
|
|
a794e440ae | ||
|
|
1905291fed | ||
|
|
09a6e8adca | ||
|
|
d513bef710 | ||
|
|
751fe9de93 | ||
|
|
0569fc46c8 | ||
|
|
697d8c5398 | ||
|
|
bdc679352c | ||
|
|
b013797f96 | ||
|
|
e42804a0c2 | ||
|
|
368acc3d50 | ||
|
|
5bef70bd07 | ||
|
|
4f69e81ae0 | ||
|
|
50698aacbf | ||
|
|
b86f569b11 | ||
|
|
754c5a5fe1 | ||
|
|
4cc60d34fb | ||
|
|
e1e6b685fd | ||
|
|
cc19135f2e | ||
|
|
2cf7904bd2 | ||
|
|
84fe9556f1 | ||
|
|
c20405e576 | ||
|
|
795355ee43 | ||
|
|
2977f2ab44 | ||
|
|
8ecdd7277d | ||
|
|
93e9d2457c | ||
|
|
3f7e1dc18f | ||
|
|
6111cf68fe | ||
|
|
f8081ac245 | ||
|
|
a14ab9eecb | ||
|
|
ccb7c3b60b | ||
|
|
c5ae3a0a2d | ||
|
|
c7e8d507d9 | ||
|
|
cb242c0d50 | ||
|
|
24c4a4cc6e | ||
|
|
683e97521e | ||
|
|
e5f3c1495b | ||
|
|
057d325d35 | ||
|
|
54654ae7e4 | ||
|
|
a6dd04e6da | ||
|
|
14a3439dd8 | ||
|
|
695856b85c | ||
|
|
d07756fc70 | ||
|
|
79c79df0e1 | ||
|
|
2e1e641d75 | ||
|
|
aef69d0b0f | ||
|
|
bfb19782c9 | ||
|
|
2461121868 | ||
|
|
b31a3b3d70 | ||
|
|
fa036d2b99 | ||
|
|
0744802578 | ||
|
|
f5bf130f05 | ||
|
|
701d9dbe89 | ||
|
|
64ef84994a | ||
|
|
494a47ee6e | ||
|
|
f9a0feeb4b | ||
|
|
fcfee868a9 | ||
|
|
e4364f45cc | ||
|
|
967136cc0f | ||
|
|
5335ab79e5 | ||
|
|
cb2f9cccfb | ||
|
|
346aa04836 | ||
|
|
6ce7eb980b | ||
|
|
6bd80d67e4 | ||
|
|
e905a75c0f | ||
|
|
66b69b8d36 | ||
|
|
8a2f752e51 | ||
|
|
ee2574ddce | ||
|
|
cc74cb8525 | ||
|
|
e543dbc09c | ||
|
|
32aa419154 | ||
|
|
010f610a80 | ||
|
|
102d58a165 | ||
|
|
3c6933efc0 | ||
|
|
a43cab006e | ||
|
|
93fa41f6c7 | ||
|
|
eb5da6ae82 | ||
|
|
4786f9814b | ||
|
|
d695e02d2f | ||
|
|
1c58e29da2 | ||
|
|
ed6aa022a6 | ||
|
|
0019582fd2 | ||
|
|
d34c6b6526 | ||
|
|
b40ed15606 | ||
|
|
904582dd30 | ||
|
|
1402f26fc8 | ||
|
|
69384ff89c | ||
|
|
3a84b4db7e | ||
|
|
d08f08a24d | ||
|
|
7172ae9071 | ||
|
|
69be965a23 | ||
|
|
3408294224 | ||
|
|
63224df965 | ||
|
|
b067895cc4 | ||
|
|
e754f70125 | ||
|
|
2a5955ee50 | ||
|
|
9694587a1a | ||
|
|
264c508ca4 | ||
|
|
7fdcf0c76d | ||
|
|
7835ba29c7 | ||
|
|
8bafabac98 | ||
|
|
a15b801bfb | ||
|
|
1b40a62611 | ||
|
|
2bfe68441a | ||
|
|
82512215ff | ||
|
|
a430544f4a | ||
|
|
0a2389d0ab | ||
|
|
4a98f5042e | ||
|
|
1bcaf97bfd | ||
|
|
62545de5ce | ||
|
|
ab6e69444f | ||
|
|
8bc8d823bb | ||
|
|
0ebe3d394d | ||
|
|
5501e78098 | ||
|
|
5de1c8c6a5 | ||
|
|
e58661a87e | ||
|
|
5b605792cb | ||
|
|
5724764152 | ||
|
|
ae26eec096 | ||
|
|
2623503549 | ||
|
|
a7bb7b19d6 | ||
|
|
acb6a88df5 | ||
|
|
1e64c9f8b2 | ||
|
|
b68bab17c0 | ||
|
|
a49d61a64c | ||
|
|
b6b032fc3b | ||
|
|
71c032c816 | ||
|
|
200910b9c1 | ||
|
|
0bd09c4106 | ||
|
|
ff91f80124 | ||
|
|
e802927981 | ||
|
|
9d4d161834 | ||
|
|
111f52def6 | ||
|
|
9dd792a540 | ||
|
|
20bbe0a790 | ||
|
|
94b624f11c | ||
|
|
5a9014a650 | ||
|
|
a6a61c4ca6 | ||
|
|
121654ecd8 | ||
|
|
4bf4b7d35c | ||
|
|
d0e9170c39 | ||
|
|
75a121d773 | ||
|
|
adc8a8bbdf | ||
|
|
466e0f29c3 | ||
|
|
9672bba339 | ||
|
|
fd3fbe8801 | ||
|
|
5534478fa1 | ||
|
|
de0ff2272e | ||
|
|
b9216a9c1f | ||
|
|
43f411afeb | ||
|
|
a35ad3e794 | ||
|
|
7dec4a7fc5 | ||
|
|
7590c5df93 | ||
|
|
7cfe36d9ae | ||
|
|
1ce0780915 | ||
|
|
cd80622d5e | ||
|
|
c515382280 | ||
|
|
26c5e61700 | ||
|
|
de9a7da4ba | ||
|
|
d6acf8cfea | ||
|
|
c1f627b31e | ||
|
|
4ed027b7bc | ||
|
|
258b9f4333 | ||
|
|
a31c699833 | ||
|
|
9c9ce91ef5 | ||
|
|
91229781db | ||
|
|
dee7abd87b | ||
|
|
c38755a732 | ||
|
|
7417e2c917 | ||
|
|
6222dc31ab | ||
|
|
7e1ea05d53 | ||
|
|
728286b43f | ||
|
|
ca080daf7f | ||
|
|
9c75e1c5f8 | ||
|
|
1d920f34c6 | ||
|
|
2bc2789f8f | ||
|
|
c83d36abf0 | ||
|
|
eda3104306 | ||
|
|
3303fbcef8 | ||
|
|
5db79312af | ||
|
|
4f74d92f32 | ||
|
|
d0c85905c4 | ||
|
|
48ebe9c855 | ||
|
|
1152be81e6 | ||
|
|
b11f15674d | ||
|
|
aa484cae05 | ||
|
|
33538b8595 | ||
|
|
b54c19492b | ||
|
|
7b1579d769 | ||
|
|
3b96c2260e | ||
|
|
99b72814d3 | ||
|
|
4284797dbb | ||
|
|
6a606d16fd | ||
|
|
20677d90b8 | ||
|
|
6f2b60cb33 | ||
|
|
b608ba3fa4 | ||
|
|
c1d1afd473 | ||
|
|
c0aed167b8 | ||
|
|
17d410dd99 | ||
|
|
ff718174aa | ||
|
|
1d028fa4e9 | ||
|
|
2556e9b109 | ||
|
|
0d0ab7f829 | ||
|
|
75d248f10f | ||
|
|
c4a6da31ec | ||
|
|
29821af817 | ||
|
|
2b0e7061f5 | ||
|
|
fc88994cde | ||
|
|
a0fe6c0579 | ||
|
|
f4c2386551 | ||
|
|
83cbe41d4c | ||
|
|
8bd48049f9 | ||
|
|
dfd143bc6b | ||
|
|
dcf71727af | ||
|
|
5ebb774188 | ||
|
|
5f88824dc9 | ||
|
|
9dc2ed96d1 | ||
|
|
7cf3a976b9 | ||
|
|
e6e15c60ca | ||
|
|
de7fffb534 | ||
|
|
770651efae | ||
|
|
cbe13543e4 | ||
|
|
ba1388e7ae | ||
|
|
0e99e9b2f2 | ||
|
|
c280d65fd0 | ||
|
|
4ac08a5375 | ||
|
|
54043c0ee1 | ||
|
|
ea967c949e | ||
|
|
4dc66d90aa | ||
|
|
0f81412091 | ||
|
|
43f72f639e | ||
|
|
242f56b093 | ||
|
|
c2e3653931 | ||
|
|
9cbaed4d46 | ||
|
|
57c30acc7f | ||
|
|
34944b264b | ||
|
|
3f00b2490d | ||
|
|
0aeb0313c3 | ||
|
|
f9abf48ecf | ||
|
|
01c5c4ed35 | ||
|
|
da02e63f0a | ||
|
|
76e8da363b | ||
|
|
a3445370e1 | ||
|
|
fd86d4e6c9 | ||
|
|
8c56790861 | ||
|
|
ee6b4f6be2 | ||
|
|
0e01219533 | ||
|
|
18a7f14fd0 | ||
|
|
6f1a613456 | ||
|
|
ab6259370e | ||
|
|
ede10ae95d | ||
|
|
6db7cf0c22 | ||
|
|
72fc97ca20 | ||
|
|
8648956074 | ||
|
|
8a4445438c | ||
|
|
bbbd34fc38 | ||
|
|
f01bb0828e | ||
|
|
190dc679f6 | ||
|
|
12be86ca29 | ||
|
|
bd92acfbe8 | ||
|
|
b3090df235 | ||
|
|
b72bf907ec | ||
|
|
c8a4b8f057 | ||
|
|
3daba65c64 | ||
|
|
6649fab762 | ||
|
|
3d5f0518ca | ||
|
|
9ab57fce05 | ||
|
|
a69a45201b | ||
|
|
65775144bb | ||
|
|
99f1cb58e8 | ||
|
|
2cc5f1ab51 | ||
|
|
04ff99c8e5 | ||
|
|
b667a58dab | ||
|
|
a0aef631dd | ||
|
|
80893d2ca7 | ||
|
|
da2aacb75f | ||
|
|
773b4febf2 | ||
|
|
5bb280ce2f | ||
|
|
2adba3032c | ||
|
|
0a378930a3 | ||
|
|
c915433671 | ||
|
|
d90ca33b91 | ||
|
|
44ec4c77c1 | ||
|
|
e917f5db4a | ||
|
|
d6418172e0 | ||
|
|
fd5d15f9df | ||
|
|
d2724ffe92 | ||
|
|
ce1ad42e8f | ||
|
|
d62bcbc611 | ||
|
|
4434540502 | ||
|
|
1c1f866bac | ||
|
|
255a9e3bf7 | ||
|
|
e8edeca09d | ||
|
|
eeb500cf5a | ||
|
|
6312f7bf4f | ||
|
|
da2ee554de | ||
|
|
bd7f2bebde | ||
|
|
29ea02d93b | ||
|
|
9c4eb9d121 | ||
|
|
9394984c31 | ||
|
|
dedbad2748 | ||
|
|
a7951ab2ad | ||
|
|
a728d03f7d | ||
|
|
89f9758279 | ||
|
|
d58a6ddbc3 | ||
|
|
32b482d3bf | ||
|
|
99d0691f57 | ||
|
|
1f666c7ab2 | ||
|
|
389ad9987b | ||
|
|
9bf56063c6 | ||
|
|
6b83d829a8 | ||
|
|
e3c8777128 | ||
|
|
bc59d1ce4e | ||
|
|
dd1acb8d65 | ||
|
|
ae7596981b | ||
|
|
5f291bc906 | ||
|
|
82903a4b1f | ||
|
|
2290210ff1 | ||
|
|
53f3b03647 | ||
|
|
450b6f46c9 | ||
|
|
edcac92c08 | ||
|
|
630767b5f7 | ||
|
|
ad9db3faad | ||
|
|
56d57b9530 | ||
|
|
d80bf0e7a3 | ||
|
|
e6b26af8f3 | ||
|
|
de9d0bbd20 | ||
|
|
20880c7ce9 | ||
|
|
55c589e2de | ||
|
|
e7ef344d8b | ||
|
|
14c4066381 | ||
|
|
06236552b6 | ||
|
|
17cafef755 | ||
|
|
24109a18e4 | ||
|
|
4312e69dfe | ||
|
|
9c590fa6a6 | ||
|
|
46cdee3dc8 | ||
|
|
97f59556af | ||
|
|
ba2e43e953 | ||
|
|
3e12c54039 | ||
|
|
4a1f444c9f | ||
|
|
87e3de423c | ||
|
|
56b804fc38 | ||
|
|
30a4dc04bb | ||
|
|
bda3724396 | ||
|
|
33ceb47046 | ||
|
|
1ac6780aed | ||
|
|
373ad7ed6c | ||
|
|
b2416bd570 | ||
|
|
c69560787b | ||
|
|
d6656fada6 | ||
|
|
7a324dfa87 | ||
|
|
aefd27f95c | ||
|
|
2a8bbefa69 | ||
|
|
6abb3012d4 | ||
|
|
a5748bcfea | ||
|
|
f01fb783f1 | ||
|
|
32967bf1a1 | ||
|
|
71d97d21ac | ||
|
|
4783b95fdf | ||
|
|
d5259dab01 | ||
|
|
26562de083 | ||
|
|
276fee0021 | ||
|
|
9b9795105f | ||
|
|
abd0c671e8 | ||
|
|
4d9fc11c2f | ||
|
|
b294401d2f | ||
|
|
841ec05ecc | ||
|
|
3864f4ec46 | ||
|
|
46f047fba1 | ||
|
|
13269b1224 | ||
|
|
16762d4246 | ||
|
|
deaaa2ccd1 | ||
|
|
d1f3e49057 | ||
|
|
0f90e86f25 | ||
|
|
00d621dfe0 | ||
|
|
4139aa785c | ||
|
|
b2d284393d | ||
|
|
99a50b95e5 | ||
|
|
85f253bc82 | ||
|
|
0659ddeafe | ||
|
|
3d4ff3d7da | ||
|
|
3615ba88e1 | ||
|
|
2812be6504 | ||
|
|
6f51e05c87 | ||
|
|
1dab75c685 | ||
|
|
8820f08be6 | ||
|
|
958ee08b1a | ||
|
|
e12f438c54 | ||
|
|
e5b61b139f | ||
|
|
9c93108a05 | ||
|
|
dad8ec6ec5 | ||
|
|
2f61163e6f | ||
|
|
ce6cc21d0d | ||
|
|
2fa7a2f487 | ||
|
|
db5f9d232c | ||
|
|
b862d349ec | ||
|
|
24acc0b24d | ||
|
|
66c5d3e943 | ||
|
|
d2dabcff9e | ||
|
|
5873cf9d02 | ||
|
|
fdc5dd1154 | ||
|
|
1f02202956 | ||
|
|
f7e5d7a25e | ||
|
|
eccaf4b672 | ||
|
|
21ee9bfd9a | ||
|
|
eba6ef86a9 | ||
|
|
890c05b713 | ||
|
|
4baa83bda3 | ||
|
|
a749c350a3 | ||
|
|
69c8bda7a9 | ||
|
|
a85aaef490 | ||
|
|
98aa34029a | ||
|
|
ccc295d394 | ||
|
|
de842a4b05 | ||
|
|
c2bbf3cc3a | ||
|
|
e3777c3fae | ||
|
|
fdbbb3e1d1 | ||
|
|
8907bb1c56 | ||
|
|
ef37739f61 | ||
|
|
a87d7d11f7 | ||
|
|
ecd0e0dcdd | ||
|
|
9bd7291d76 | ||
|
|
f6f5bda1ed | ||
|
|
a6dea06eb0 | ||
|
|
accf365a42 | ||
|
|
14078e6cbe | ||
|
|
3826a4d32e | ||
|
|
a41657e1c7 | ||
|
|
fee8865cb8 | ||
|
|
0f07cb10d5 | ||
|
|
7004d026a9 | ||
|
|
5c26fc08b4 | ||
|
|
d90345e5ba | ||
|
|
c032143a98 | ||
|
|
b9013a32c5 | ||
|
|
6de875d527 | ||
|
|
04c18b117e | ||
|
|
c16b45ac7f | ||
|
|
602c01d366 | ||
|
|
2a95ee6ac2 | ||
|
|
e800634951 | ||
|
|
56ad3a16ab | ||
|
|
85cfbf4eb7 | ||
|
|
6494c04dee | ||
|
|
9bec80c561 | ||
|
|
7fd41e8f9e | ||
|
|
5420a19e5c | ||
|
|
68d8dd01a2 | ||
|
|
45ef27688f | ||
|
|
1a0d8884f2 | ||
|
|
3842344be7 | ||
|
|
bbb66ad482 | ||
|
|
593c09234c | ||
|
|
7e3e434235 | ||
|
|
6295fccc15 | ||
|
|
59b6753d29 | ||
|
|
2e9879b29c | ||
|
|
6b51c1fca1 | ||
|
|
2410a9036f | ||
|
|
54bb65abf5 | ||
|
|
573b39572e | ||
|
|
5821708a49 | ||
|
|
0ea82c2d43 | ||
|
|
7679c0513c | ||
|
|
6ae60815c7 | ||
|
|
8a16ff2b7f | ||
|
|
6cbae6bbd1 | ||
|
|
9480585347 | ||
|
|
c582b68ddf | ||
|
|
61b992f9d6 | ||
|
|
382eea8b75 | ||
|
|
af3600a6ed | ||
|
|
21e9e3a800 | ||
|
|
f6572d0c8d | ||
|
|
baa2eb6600 | ||
|
|
9071374443 | ||
|
|
89a037dc48 | ||
|
|
030b2d7a5e | ||
|
|
7b544a220f | ||
|
|
84864592a6 | ||
|
|
3d03d92371 | ||
|
|
2a796662ec | ||
|
|
e8bdd58fb2 | ||
|
|
9c58ff6834 | ||
|
|
d61db937ed | ||
|
|
41f0c5238f | ||
|
|
054f6c2802 | ||
|
|
e456c84871 | ||
|
|
6db6c3291b | ||
|
|
4145712613 | ||
|
|
84ff8a7d78 | ||
|
|
9454354f0e | ||
|
|
cd993feddb | ||
|
|
950a2a295d | ||
|
|
e5db9c5605 | ||
|
|
ff7f3e14a6 | ||
|
|
2d10a3d198 | ||
|
|
c44e7fcbe5 | ||
|
|
f19aaad970 | ||
|
|
6872b39b3f | ||
|
|
8872d2406c | ||
|
|
8ebd51d17f | ||
|
|
19fb52deac | ||
|
|
c4af5fcc1b | ||
|
|
7b59202f3a | ||
|
|
dd743368ee | ||
|
|
0706ebeb7b | ||
|
|
d7b8af55e7 | ||
|
|
e338d72a45 | ||
|
|
ccc37a9193 | ||
|
|
fa235831f2 | ||
|
|
3ae9b2df5c | ||
|
|
7c00be9c38 | ||
|
|
f0f432af92 | ||
|
|
c4700cbf6d | ||
|
|
e8b298cf5d | ||
|
|
8a09097741 | ||
|
|
9d05820f02 | ||
|
|
001ceafb23 | ||
|
|
c97a430827 | ||
|
|
67072c3d47 | ||
|
|
20deebc218 | ||
|
|
129cc066e9 | ||
|
|
92f89ecbb5 | ||
|
|
6d62578bd3 | ||
|
|
6c766bfaa3 | ||
|
|
4e8387e36a | ||
|
|
16ae2d2ae8 | ||
|
|
88600c03a3 | ||
|
|
f53221ce41 | ||
|
|
0b63acf914 | ||
|
|
5191cbbfe2 | ||
|
|
ee2dd7eabb | ||
|
|
3da68f9953 | ||
|
|
567da05efa | ||
|
|
882735641e | ||
|
|
4032f9d4dc | ||
|
|
a8fdebc1eb | ||
|
|
0f29d005d6 | ||
|
|
c98fcd0e26 | ||
|
|
1800d11520 | ||
|
|
e0080d92e3 | ||
|
|
09152d341c | ||
|
|
d5553abfbd | ||
|
|
9255d52d01 | ||
|
|
e8ca755d06 | ||
|
|
4e40c57d05 | ||
|
|
8598cdcc02 | ||
|
|
77f21ce1db | ||
|
|
9ad2ec38c8 | ||
|
|
92258c44a5 | ||
|
|
4434155b9f | ||
|
|
fdb028ce1c | ||
|
|
23cb83fe47 | ||
|
|
0c31f565ad | ||
|
|
1feb781a45 | ||
|
|
befe4b839e | ||
|
|
d10266cfa8 | ||
|
|
355c9fe5f3 | ||
|
|
1b3fcbabc3 | ||
|
|
0fbbfd7f67 | ||
|
|
967a775c5a | ||
|
|
5cb61b0493 | ||
|
|
a1fe1358f3 | ||
|
|
7b975975f2 | ||
|
|
cab7c54e3a | ||
|
|
f218f909ad | ||
|
|
d0e9f9dade | ||
|
|
876ca8cbf3 | ||
|
|
827e43bd24 | ||
|
|
68065e88cd | ||
|
|
783f9f4aad | ||
|
|
2f4d9112d2 | ||
|
|
109789c175 | ||
|
|
210e123b07 | ||
|
|
343300e7ed | ||
|
|
c2e6c5ebc3 | ||
|
|
0a4fd3940a | ||
|
|
901190e2cb | ||
|
|
89ec383cdc | ||
|
|
d2b087ebf8 | ||
|
|
a9efa6f602 | ||
|
|
33d091ecac | ||
|
|
e73451abd4 | ||
|
|
3db39eda8a | ||
|
|
daa073ebb1 | ||
|
|
d6392f7a28 | ||
|
|
ff0eb26d90 | ||
|
|
5a73cd05de | ||
|
|
2914b6fbc0 | ||
|
|
8cd35a3b77 | ||
|
|
d96b2343b0 | ||
|
|
936ef06e82 | ||
|
|
710249fe7f | ||
|
|
f292911c6d | ||
|
|
659d602deb | ||
|
|
5eabb6fcd1 | ||
|
|
978afd0260 | ||
|
|
976650bbd1 | ||
|
|
7e01d5f28f | ||
|
|
3eecabfda1 | ||
|
|
08553f531f | ||
|
|
7e7ec63c2c | ||
|
|
e354aa0e3d | ||
|
|
0957b2c850 | ||
|
|
57665b295c | ||
|
|
dfff588886 | ||
|
|
ca7c7ce1b7 | ||
|
|
4349c08e31 | ||
|
|
bb71951f1a | ||
|
|
4f37f05a9c | ||
|
|
abc5015131 | ||
|
|
f50166e4fc | ||
|
|
2c163978e7 | ||
|
|
4acf174468 | ||
|
|
e8b3de6a75 | ||
|
|
6fa4858662 | ||
|
|
dd7709baa2 | ||
|
|
b9c49065a5 | ||
|
|
c67bfbf1a4 | ||
|
|
3c3f3d4561 | ||
|
|
b0bf6914f1 | ||
|
|
330e115d11 | ||
|
|
1d5118fd6c | ||
|
|
acb9caa959 | ||
|
|
03c4df2e30 | ||
|
|
ff878198ef | ||
|
|
84707cf702 | ||
|
|
d8b1866404 | ||
|
|
45c9d1dc2c | ||
|
|
a3100689bc | ||
|
|
014e7b1951 | ||
|
|
ad5f7e5464 | ||
|
|
3b0f6c1c31 | ||
|
|
4198cbe8cd | ||
|
|
3e3a85339f | ||
|
|
adf3bedc0c | ||
|
|
c260fedf0c | ||
|
|
1c58938f2c | ||
|
|
051f9006ef | ||
|
|
361141a857 | ||
|
|
75194c3206 | ||
|
|
04a740f5c6 | ||
|
|
6aa85ad35f | ||
|
|
342be44f4d | ||
|
|
e42dd00e98 | ||
|
|
6797693d1b | ||
|
|
3e69878565 | ||
|
|
aef36bf11d | ||
|
|
0dc45b9fe3 | ||
|
|
e65b021050 | ||
|
|
b5100ee98f | ||
|
|
2951fec86b | ||
|
|
d07793f49c | ||
|
|
2acbdb0493 | ||
|
|
e00ad288cc | ||
|
|
5b8ce14566 | ||
|
|
facce70703 | ||
|
|
88eafacc82 | ||
|
|
26f4ba76ca | ||
|
|
949c30336f | ||
|
|
aaf8665696 | ||
|
|
e4dd07e735 | ||
|
|
e98a68549d | ||
|
|
1fc4f8eaa3 | ||
|
|
70bccae334 | ||
|
|
052f5d50c9 | ||
|
|
5815a325af | ||
|
|
3ff398393a | ||
|
|
ef0bb68bcb | ||
|
|
382a840e23 | ||
|
|
1e6fd4531c | ||
|
|
21e80b3a25 | ||
|
|
8e6efd7026 | ||
|
|
39365ed3c0 | ||
|
|
f52f05c3b1 | ||
|
|
388741b7d0 | ||
|
|
b2ca802381 | ||
|
|
b05600e60a | ||
|
|
98a8b3604f | ||
|
|
905d1e5d03 | ||
|
|
cb7c84c310 | ||
|
|
03bdf41de2 | ||
|
|
206428d2cf | ||
|
|
bc0d613154 | ||
|
|
1d6f003314 | ||
|
|
e81a4abd60 | ||
|
|
06ebe62a5e | ||
|
|
0d78d389e1 | ||
|
|
eea64f8d90 | ||
|
|
4c5cc88bdf | ||
|
|
a1cee7cd20 | ||
|
|
3327979282 | ||
|
|
8c19725a30 | ||
|
|
0a224ddfc8 | ||
|
|
9a7c011683 | ||
|
|
44427fccaa | ||
|
|
c4cf77f310 | ||
|
|
9b00a63b22 | ||
|
|
91d9bd02c0 | ||
|
|
56b69c4e9a | ||
|
|
d2b1e66352 | ||
|
|
d29d888dc6 | ||
|
|
f4ed4079b7 | ||
|
|
dde5a2565e | ||
|
|
e59a1e0b14 | ||
|
|
c4b5bfbd50 | ||
|
|
44869c9e35 | ||
|
|
e5463e8ec8 | ||
|
|
bddf737714 | ||
|
|
ef0fd808de | ||
|
|
f4fb1d1752 | ||
|
|
59ea8cb145 | ||
|
|
e9cf99c212 | ||
|
|
80630f4ec9 | ||
|
|
e63dcc2677 | ||
|
|
9bbc90b227 | ||
|
|
8e5dbc8a27 | ||
|
|
29c6b72a83 | ||
|
|
fd5b3bb085 | ||
|
|
2fda7e49a0 | ||
|
|
27256fcd71 | ||
|
|
e702454abe | ||
|
|
9423df2491 | ||
|
|
05b1764f74 | ||
|
|
bff7817ec0 | ||
|
|
13bc69a8a4 | ||
|
|
9aa711e8e0 | ||
|
|
b339d4bf03 | ||
|
|
1e58e8e42d | ||
|
|
91af7f6f90 | ||
|
|
68191ded75 | ||
|
|
ac3d0b69d3 | ||
|
|
96f611f896 | ||
|
|
ec9c29c80d |
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>tcl8</name>
|
||||
<name>tcl9</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
README: Tcl
|
||||
This is the Tcl 8.7a2 source distribution.
|
||||
This is the Tcl 9.0a0 source distribution.
|
||||
http://sourceforge.net/projects/tcl/files/Tcl/
|
||||
You can get any source release of Tcl from the URL above.
|
||||
|
||||
@@ -49,7 +49,7 @@ and selling it either in whole or in part. See the file
|
||||
|
||||
Extensive documentation is available at our website.
|
||||
The home page for this release, including new features, is
|
||||
http://www.tcl.tk/software/tcltk/8.7.html
|
||||
http://www.tcl.tk/software/tcltk/9.0.html
|
||||
|
||||
Detailed release notes can be found at the file distributions page
|
||||
by clicking on the relevant version.
|
||||
@@ -61,9 +61,9 @@ Information about Tcl itself can be found at
|
||||
There have been many Tcl books on the market. Many are mentioned in the Wiki:
|
||||
http://wiki.tcl.tk/_/ref?N=25206
|
||||
|
||||
To view the complete set of reference manual entries for Tcl 8.7 online,
|
||||
To view the complete set of reference manual entries for Tcl 9.0 online,
|
||||
visit the URL:
|
||||
http://www.tcl.tk/man/tcl8.7/
|
||||
http://www.tcl.tk/man/tcl9.0/
|
||||
|
||||
2a. Unix Documentation
|
||||
----------------------
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@ opendir(
|
||||
if ((fd = open(myname, 0, 0)) == -1) {
|
||||
return NULL;
|
||||
}
|
||||
dirp = (DIR *) ckalloc(sizeof(DIR));
|
||||
dirp = (DIR *) Tcl_Alloc(sizeof(DIR));
|
||||
if (dirp == NULL) {
|
||||
/* unreachable? */
|
||||
close(fd);
|
||||
@@ -106,5 +106,5 @@ closedir(
|
||||
close(dirp->dd_fd);
|
||||
dirp->dd_fd = -1;
|
||||
dirp->dd_loc = 0;
|
||||
ckfree(dirp);
|
||||
Tcl_Free(dirp);
|
||||
}
|
||||
|
||||
+2
-2
@@ -100,7 +100,7 @@ waitpid(
|
||||
} else {
|
||||
prevPtr->nextPtr = waitPtr->nextPtr;
|
||||
}
|
||||
ckfree(waitPtr);
|
||||
Tcl_Free(waitPtr);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ waitpid(
|
||||
goto waitAgain;
|
||||
}
|
||||
}
|
||||
waitPtr = (WaitInfo *) ckalloc(sizeof(WaitInfo));
|
||||
waitPtr = (WaitInfo *) Tcl_Alloc(sizeof(WaitInfo));
|
||||
waitPtr->pid = result;
|
||||
waitPtr->status = status;
|
||||
waitPtr->nextPtr = deadList;
|
||||
|
||||
+3
-8
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorCodeVA, Tcl_SetErrorLine, Tcl_GetErrorLine, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
|
||||
Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorLine, Tcl_GetErrorLine, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -30,8 +30,6 @@ int
|
||||
.sp
|
||||
\fBTcl_SetErrorCode\fR(\fIinterp, element, element, ... \fB(char *) NULL\fR)
|
||||
.sp
|
||||
\fBTcl_SetErrorCodeVA\fR(\fIinterp, argList\fR)
|
||||
.sp
|
||||
\fBTcl_GetErrorLine\fR(\fIinterp\fR)
|
||||
.sp
|
||||
\fBTcl_SetErrorLine\fR(\fIinterp, lineNum\fR)
|
||||
@@ -60,10 +58,10 @@ unless \fIlength\fR is negative.
|
||||
.AP Tcl_Obj *objPtr in
|
||||
A message to be appended to the \fB\-errorinfo\fR return option
|
||||
in the form of a Tcl_Obj value.
|
||||
.AP int length in
|
||||
.AP size_t length in
|
||||
The number of bytes to copy from \fImessage\fR when
|
||||
appending to the \fB\-errorinfo\fR return option.
|
||||
If negative, all bytes up to the first null byte are used.
|
||||
If (size_t)-1, all bytes up to the first null byte are used.
|
||||
.AP Tcl_Obj *errorObjPtr in
|
||||
The \fB\-errorcode\fR return option will be set to this value.
|
||||
.AP char *element in
|
||||
@@ -245,9 +243,6 @@ The procedure \fBTcl_SetErrorCode\fR is also used to set the
|
||||
record instead of a value. Otherwise, it is similar to
|
||||
\fBTcl_SetObjErrorCode\fR in behavior.
|
||||
.PP
|
||||
\fBTcl_SetErrorCodeVA\fR is the same as \fBTcl_SetErrorCode\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument list.
|
||||
.PP
|
||||
The procedure \fBTcl_GetErrorLine\fR is used to read the integer value
|
||||
of the \fB\-errorline\fR return option without the overhead of a full
|
||||
call to \fBTcl_GetReturnOptions\fR. Likewise, \fBTcl_SetErrorLine\fR
|
||||
|
||||
+8
-27
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc, ckalloc, ckfree, ckrealloc, attemptckalloc, attemptckrealloc \- allocate or free heap memory
|
||||
Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc \- allocate or free heap memory
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -19,29 +19,14 @@ char *
|
||||
void
|
||||
\fBTcl_Free\fR(\fIptr\fR)
|
||||
.sp
|
||||
char *
|
||||
void *
|
||||
\fBTcl_Realloc\fR(\fIptr, size\fR)
|
||||
.sp
|
||||
char *
|
||||
void *
|
||||
\fBTcl_AttemptAlloc\fR(\fIsize\fR)
|
||||
.sp
|
||||
char *
|
||||
void *
|
||||
\fBTcl_AttemptRealloc\fR(\fIptr, size\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBckalloc\fR(\fIsize\fR)
|
||||
.sp
|
||||
void
|
||||
\fBckfree\fR(\fIptr\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBckrealloc\fR(\fIptr, size\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBattemptckalloc\fR(\fIsize\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBattemptckrealloc\fR(\fIptr, size\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS char *size
|
||||
.AP "unsigned int" size in
|
||||
@@ -79,14 +64,10 @@ allocation fails, these functions will return NULL. Note that on some
|
||||
platforms, but not all, attempting to allocate a zero-sized block of
|
||||
memory will also cause these functions to return NULL.
|
||||
.PP
|
||||
The procedures \fBckalloc\fR, \fBckfree\fR, \fBckrealloc\fR,
|
||||
\fBattemptckalloc\fR, and \fBattemptckrealloc\fR are implemented
|
||||
as macros. Normally, they are synonyms for the corresponding
|
||||
procedures documented on this page. When Tcl and all modules
|
||||
calling Tcl are compiled with \fBTCL_MEM_DEBUG\fR defined, however,
|
||||
these macros are redefined to be special debugging versions
|
||||
of these procedures. To support Tcl's memory debugging within a
|
||||
module, use the macros rather than direct calls to \fBTcl_Alloc\fR, etc.
|
||||
When a module or Tcl itself is compiled with \fBTCL_MEM_DEBUG\fR defined,
|
||||
the procedures \fBTcl_Alloc\fR, \fBTcl_Free\fR, \fBTcl_Realloc\fR,
|
||||
\fBTcl_AttemptAlloc\fR, and \fBTcl_AttempRealloc\fR are implemented
|
||||
as macros, redefined to be special debugging versions of these procedures.
|
||||
|
||||
.SH KEYWORDS
|
||||
alloc, allocation, free, malloc, memory, realloc, TCL_MEM_DEBUG
|
||||
|
||||
+1
-2
@@ -30,8 +30,7 @@ or \fBTCL_RETURN\fR, then Tcl normally converts this into a \fBTCL_ERROR\fR
|
||||
return with an appropriate message. The particular script
|
||||
evaluation procedures of Tcl that act in the manner are
|
||||
\fBTcl_EvalObjEx\fR, \fBTcl_EvalObjv\fR, \fBTcl_Eval\fR, \fBTcl_EvalEx\fR,
|
||||
\fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR, \fBTcl_VarEval\fR and
|
||||
\fBTcl_VarEvalVA\fR.
|
||||
\fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR and \fBTcl_VarEval\fR.
|
||||
.PP
|
||||
However, if \fBTcl_AllowExceptions\fR is invoked immediately before
|
||||
calling one of those a procedures, then arbitrary completion
|
||||
|
||||
+3
-3
@@ -13,7 +13,7 @@ Tcl_GetAssocData, Tcl_SetAssocData, Tcl_DeleteAssocData \- manage associations o
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_GetAssocData\fR(\fIinterp, key, delProcPtr\fR)
|
||||
.sp
|
||||
\fBTcl_SetAssocData\fR(\fIinterp, key, delProc, clientData\fR)
|
||||
@@ -31,7 +31,7 @@ Procedure to call when \fIinterp\fR is deleted.
|
||||
.AP Tcl_InterpDeleteProc **delProcPtr in
|
||||
Pointer to location in which to store address of current deletion procedure
|
||||
for association. Ignored if NULL.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value associated with the given key in this
|
||||
interpreter. This data is owned by the caller.
|
||||
.BE
|
||||
@@ -64,7 +64,7 @@ the type \fBTcl_InterpDeleteProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_InterpDeleteProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
.CE
|
||||
.PP
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ int
|
||||
.AS Tcl_AsyncHandler clientData
|
||||
.AP Tcl_AsyncProc *proc in
|
||||
Procedure to invoke to handle an asynchronous event.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
One-word value to pass to \fIproc\fR.
|
||||
.AP Tcl_AsyncHandler async in
|
||||
Token for asynchronous event handler.
|
||||
@@ -84,7 +84,7 @@ type \fBTcl_AsyncProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_AsyncProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIcode\fR);
|
||||
.CE
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1989-1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_Backslash 3 "8.1" Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_Backslash \- parse a backslash sequence
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
char
|
||||
\fBTcl_Backslash\fR(\fIsrc, countPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS char *countPtr out
|
||||
.AP char *src in
|
||||
Pointer to a string starting with a backslash.
|
||||
.AP int *countPtr out
|
||||
If \fIcountPtr\fR is not NULL, \fI*countPtr\fR gets filled
|
||||
in with number of characters in the backslash sequence, including
|
||||
the backslash character.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The use of \fBTcl_Backslash\fR is deprecated in favor of
|
||||
\fBTcl_UtfBackslash\fR.
|
||||
.PP
|
||||
This is a utility procedure provided for backwards compatibility with
|
||||
non-internationalized Tcl extensions. It parses a backslash sequence and
|
||||
returns the low byte of the Unicode character corresponding to the sequence.
|
||||
\fBTcl_Backslash\fR modifies \fI*countPtr\fR to contain the number of
|
||||
characters in the backslash sequence.
|
||||
.PP
|
||||
See the Tcl manual entry for information on the valid backslash sequences.
|
||||
All of the sequences described in the Tcl manual entry are supported by
|
||||
\fBTcl_Backslash\fR.
|
||||
.SH "SEE ALSO"
|
||||
Tcl(n), Tcl_UtfBackslash(3)
|
||||
|
||||
.SH KEYWORDS
|
||||
backslash, parse
|
||||
+2
-2
@@ -29,8 +29,8 @@ unsigned char *
|
||||
.AP "const unsigned char" *bytes in
|
||||
The array of bytes used to initialize or set a byte-array value. May be NULL
|
||||
even if \fIlength\fR is non-zero.
|
||||
.AP int length in
|
||||
The length of the array of bytes. It must be >= 0.
|
||||
.AP size_t length in
|
||||
The length of the array of bytes.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
For \fBTcl_SetByteArrayObj\fR, this points to the value to be converted to
|
||||
byte-array type. For \fBTcl_GetByteArrayFromObj\fR and
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ Tcl_CallWhenDeleted, Tcl_DontCallWhenDeleted \- Arrange for callback when interp
|
||||
Interpreter with which to associated callback.
|
||||
.AP Tcl_InterpDeleteProc *proc in
|
||||
Procedure to call when \fIinterp\fR is deleted.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -38,7 +38,7 @@ type \fBTcl_InterpDeleteProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_InterpDeleteProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
.CE
|
||||
.PP
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ ORed combination of flag bits that specify additional options.
|
||||
For \fBTcl_CancelEval\fR, only \fBTCL_CANCEL_UNWIND\fR is currently
|
||||
supported. For \fBTcl_Canceled\fR, only \fBTCL_LEAVE_ERR_MSG\fR and
|
||||
\fBTCL_CANCEL_UNWIND\fR are currently supported.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Currently reserved for future use.
|
||||
It should be set to NULL.
|
||||
.BE
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ Tcl_Channel
|
||||
Interpreter for error reporting.
|
||||
.AP "const Tcl_ChannelType" *typePtr in
|
||||
The new channel I/O procedures to use for \fIchannel\fR.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to channel I/O procedures.
|
||||
.AP int mask in
|
||||
Conditions under which \fIchannel\fR will be used: OR-ed combination of
|
||||
|
||||
+7
-7
@@ -41,12 +41,12 @@ Tcl_Object
|
||||
int
|
||||
\fBTcl_ObjectDeleted\fR(\fIobject\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_ObjectGetMetadata\fR(\fIobject, metaTypePtr\fR)
|
||||
.sp
|
||||
\fBTcl_ObjectSetMetadata\fR(\fIobject, metaTypePtr, metadata\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_ClassGetMetadata\fR(\fIclass, metaTypePtr\fR)
|
||||
.sp
|
||||
\fBTcl_ClassSetMetadata\fR(\fIclass, metaTypePtr, metadata\fR)
|
||||
@@ -56,7 +56,7 @@ Tcl_ObjectMapMethodNameProc
|
||||
.sp
|
||||
\fBTcl_ObjectSetMethodNameMapper\fR(\fIobject\fR, \fImethodNameMapper\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS ClientData metadata in/out
|
||||
.AS void *metadata in/out
|
||||
.AP Tcl_Interp *interp in/out
|
||||
Interpreter providing the context for looking up or creating an object, and
|
||||
into whose result error messages will be written on failure.
|
||||
@@ -83,7 +83,7 @@ are not arguments to any constructors.
|
||||
.AP Tcl_ObjectMetadataType *metaTypePtr in
|
||||
The type of \fImetadata\fR being set with \fBTcl_ClassSetMetadata\fR or
|
||||
retrieved with \fBTcl_ClassGetMetadata\fR.
|
||||
.AP ClientData metadata in
|
||||
.AP void *metadata in
|
||||
An item of metadata to attach to the class, or NULL to remove the metadata
|
||||
associated with a particular \fImetaTypePtr\fR.
|
||||
.AP "Tcl_ObjectMapMethodNameProc" "methodNameMapper" in
|
||||
@@ -171,7 +171,7 @@ a class or object.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_ObjectMetadataDeleteProc\fR(
|
||||
ClientData \fImetadata\fR);
|
||||
void *\fImetadata\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fImetadata\fR argument gives the address of the metadata to be
|
||||
@@ -184,8 +184,8 @@ associated with a class or object.
|
||||
.CS
|
||||
typedef int \fBTcl_CloneProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
ClientData \fIsrcMetadata\fR,
|
||||
ClientData *\fIdstMetadataPtr\fR);
|
||||
void *\fIsrcMetadata\fR,
|
||||
void **\fIdstMetadataPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIinterp\fR argument gives a place to write an error message when the
|
||||
|
||||
+19
-19
@@ -17,7 +17,7 @@ Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChanne
|
||||
Tcl_Channel
|
||||
\fBTcl_CreateChannel\fR(\fItypePtr, channelName, instanceData, mask\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_GetChannelInstanceData\fR(\fIchannel\fR)
|
||||
.sp
|
||||
const Tcl_ChannelType *
|
||||
@@ -128,7 +128,7 @@ by any other channel. Can be NULL, in which case the channel is
|
||||
created without a name. If the created channel is assigned to one
|
||||
of the standard channels (\fBstdin\fR, \fBstdout\fR or \fBstderr\fR),
|
||||
the assigned channel name will be the name of the standard channel.
|
||||
.AP ClientData instanceData in
|
||||
.AP void *instanceData in
|
||||
Arbitrary one-word value to be associated with this channel. This
|
||||
value is passed to procedures in \fItypePtr\fR when they are invoked.
|
||||
.AP int mask in
|
||||
@@ -139,7 +139,7 @@ The channel to operate on.
|
||||
.AP int direction in
|
||||
\fBTCL_READABLE\fR means the input handle is wanted; \fBTCL_WRITABLE\fR
|
||||
means the output handle is wanted.
|
||||
.AP ClientData *handlePtr out
|
||||
.AP void **handlePtr out
|
||||
Points to the location where the desired OS-specific handle should be
|
||||
stored.
|
||||
.AP int size in
|
||||
@@ -399,7 +399,7 @@ the generic layer to set blocking and nonblocking mode on the device.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverBlockModeProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
int \fImode\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -434,7 +434,7 @@ closed. \fICloseProc\fR must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverCloseProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -456,7 +456,7 @@ following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverClose2Proc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIflags\fR);
|
||||
.CE
|
||||
@@ -487,7 +487,7 @@ internal buffer. \fIInputProc\fR must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverInputProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
char *\fIbuf\fR,
|
||||
int \fIbufSize\fR,
|
||||
int *\fIerrorCodePtr\fR);
|
||||
@@ -531,7 +531,7 @@ generic layer to transfer data from an internal buffer to the output device.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverOutputProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
const char *\fIbuf\fR,
|
||||
int \fItoWrite\fR,
|
||||
int *\fIerrorCodePtr\fR);
|
||||
@@ -570,7 +570,7 @@ prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverSeekProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
long \fIoffset\fR,
|
||||
int \fIseekMode\fR,
|
||||
int *\fIerrorCodePtr\fR);
|
||||
@@ -600,7 +600,7 @@ following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef Tcl_WideInt \fBTcl_DriverWideSeekProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
Tcl_WideInt \fIoffset\fR,
|
||||
int \fIseekMode\fR,
|
||||
int *\fIerrorCodePtr\fR);
|
||||
@@ -622,7 +622,7 @@ the generic layer to set a channel type specific option on a channel.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverSetOptionProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
const char *\fIoptionName\fR,
|
||||
const char *\fInewValue\fR);
|
||||
@@ -663,7 +663,7 @@ channel. \fIgetOptionProc\fR must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverGetOptionProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
const char *\fIoptionName\fR,
|
||||
Tcl_DString *\fIoptionValue\fR);
|
||||
@@ -701,7 +701,7 @@ notice events of interest on this channel.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_DriverWatchProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
int \fImask\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -732,9 +732,9 @@ the generic layer to retrieve a device-specific handle from the channel.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverGetHandleProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
int \fIdirection\fR,
|
||||
ClientData *\fIhandlePtr\fR);
|
||||
void **\fIhandlePtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIInstanceData\fR is the same as the value passed to
|
||||
@@ -761,7 +761,7 @@ It should be set to NULL.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverFlushProc\fR(
|
||||
ClientData \fIinstanceData\fR);
|
||||
void *\fIinstanceData\fR);
|
||||
.CE
|
||||
.PP
|
||||
This value can be retrieved with \fBTcl_ChannelFlushProc\fR, which returns
|
||||
@@ -776,7 +776,7 @@ that occur on the underlying (stacked) channel.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverHandlerProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
int \fIinterestMask\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -805,7 +805,7 @@ might be maintaining using the calling thread as the associate. See
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_DriverThreadActionProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
int \fIaction\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -822,7 +822,7 @@ length. It can be NULL.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverTruncateProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
Tcl_WideInt \fIlength\fR);
|
||||
.CE
|
||||
.PP
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ a zero value to temporarily disable an existing handler.
|
||||
.AP Tcl_FileProc *proc in
|
||||
Procedure to invoke whenever the channel indicated by \fIchannel\fR meets
|
||||
the conditions specified by \fImask\fR.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -48,7 +48,7 @@ what it means for a channel to be readable or writable.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_ChannelProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
int \fImask\fR);
|
||||
.CE
|
||||
.PP
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ void
|
||||
The channel for which to create or delete a close callback.
|
||||
.AP Tcl_CloseProc *proc in
|
||||
The procedure to call as the callback.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -38,7 +38,7 @@ Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CloseProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR is the same as the value provided in the call to
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@ Name of command.
|
||||
.AP Tcl_CmdProc *proc in
|
||||
Implementation of new command: \fIproc\fR will be called whenever
|
||||
\fIcmdName\fR is invoked as a command.
|
||||
.AP ClientData clientData in
|
||||
.AP voie *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR and \fIdeleteProc\fR.
|
||||
.AP Tcl_CmdDeleteProc *deleteProc in
|
||||
Procedure to call before \fIcmdName\fR is deleted from the interpreter;
|
||||
@@ -75,7 +75,7 @@ and it returns NULL.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_CmdProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIargc\fR,
|
||||
const char *\fIargv\fR[]);
|
||||
@@ -131,7 +131,7 @@ result that match the type \fBTcl_CmdDeleteProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CmdDeleteProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR argument will be the same as the \fIclientData\fR
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ a handler.
|
||||
.AP Tcl_FileProc *proc in
|
||||
Procedure to invoke whenever the file or device indicated
|
||||
by \fIfile\fR meets the conditions specified by \fImask\fR.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -51,7 +51,7 @@ type \fBTcl_FileProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_FileProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
int \fImask\fR);
|
||||
.CE
|
||||
.PP
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1989-1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_CreateMathFunc 3 8.4 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_CreateMathFunc, Tcl_GetMathFuncInfo, Tcl_ListMathFuncs \- Define, query and enumerate math functions for expressions
|
||||
.SH "NOTICE OF EVENTUAL DEPRECATION"
|
||||
.PP
|
||||
The \fBTcl_CreateMathFunc\fR and \fBTcl_GetMathFuncInfo\fR functions
|
||||
are rendered somewhat obsolete by the ability to create functions for
|
||||
expressions by placing commands in the \fBtcl::mathfunc\fR namespace,
|
||||
as described in the \fBmathfunc\fR manual page; the API described on
|
||||
this page is not expected to be maintained indefinitely.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
void
|
||||
\fBTcl_CreateMathFunc\fR(\fIinterp, name, numArgs, argTypes, proc, clientData\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetMathFuncInfo\fR(\fIinterp, name, numArgsPtr, argTypesPtr, procPtr,
|
||||
clientDataPtr\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_ListMathFuncs\fR(\fIinterp, pattern\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_ValueType *clientDataPtr out
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which new function will be defined.
|
||||
.AP "const char" *name in
|
||||
Name for new function.
|
||||
.AP int numArgs in
|
||||
Number of arguments to new function; also gives size of \fIargTypes\fR array.
|
||||
.AP Tcl_ValueType *argTypes in
|
||||
Points to an array giving the permissible types for each argument to
|
||||
function.
|
||||
.AP Tcl_MathProc *proc in
|
||||
Procedure that implements the function.
|
||||
.AP ClientData clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR when it is invoked.
|
||||
.AP int *numArgsPtr out
|
||||
Points to a variable that will be set to contain the number of
|
||||
arguments to the function.
|
||||
.AP Tcl_ValueType **argTypesPtr out
|
||||
Points to a variable that will be set to contain a pointer to an array
|
||||
giving the permissible types for each argument to the function which
|
||||
will need to be freed up using \fITcl_Free\fR.
|
||||
.AP Tcl_MathProc **procPtr out
|
||||
Points to a variable that will be set to contain a pointer to the
|
||||
implementation code for the function (or NULL if the function is
|
||||
implemented directly in bytecode).
|
||||
.AP ClientData *clientDataPtr out
|
||||
Points to a variable that will be set to contain the clientData
|
||||
argument passed to \fITcl_CreateMathFunc\fR when the function was
|
||||
created if the function is not implemented directly in bytecode.
|
||||
.AP "const char" *pattern in
|
||||
Pattern to match against function names so as to filter them (by
|
||||
passing to \fITcl_StringMatch\fR), or NULL to not apply any filter.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Tcl allows a number of mathematical functions to be used in
|
||||
expressions, such as \fBsin\fR, \fBcos\fR, and \fBhypot\fR.
|
||||
These functions are represented by commands in the namespace,
|
||||
\fBtcl::mathfunc\fR. The \fBTcl_CreateMathFunc\fR function is
|
||||
an obsolete way for applications to add additional functions
|
||||
to those already provided by Tcl or to replace existing functions.
|
||||
It should not be used by new applications, which should create
|
||||
math functions using \fBTcl_CreateObjCommand\fR to create a command
|
||||
in the \fBtcl::mathfunc\fR namespace.
|
||||
.PP
|
||||
In the \fBTcl_CreateMathFunc\fR interface,
|
||||
\fIName\fR is the name of the function as it will appear in expressions.
|
||||
If \fIname\fR does not already exist in the \fB::tcl::mathfunc\fR
|
||||
namespace, then a new command is created in that namespace.
|
||||
If \fIname\fR does exist, then the existing function is replaced.
|
||||
\fINumArgs\fR and \fIargTypes\fR describe the arguments to the function.
|
||||
Each entry in the \fIargTypes\fR array must be
|
||||
one of \fBTCL_INT\fR, \fBTCL_DOUBLE\fR, \fBTCL_WIDE_INT\fR,
|
||||
or \fBTCL_EITHER\fR to indicate whether the corresponding argument must be an
|
||||
integer, a double-precision floating value, a wide (64-bit) integer,
|
||||
or any, respectively.
|
||||
.PP
|
||||
Whenever the function is invoked in an expression Tcl will invoke
|
||||
\fIproc\fR. \fIProc\fR should have arguments and result that match
|
||||
the type \fBTcl_MathProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_MathProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tcl_Value *\fIargs\fR,
|
||||
Tcl_Value *\fIresultPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
When \fIproc\fR is invoked the \fIclientData\fR and \fIinterp\fR
|
||||
arguments will be the same as those passed to \fBTcl_CreateMathFunc\fR.
|
||||
\fIArgs\fR will point to an array of \fInumArgs\fR Tcl_Value structures,
|
||||
which describe the actual arguments to the function:
|
||||
.PP
|
||||
.CS
|
||||
typedef struct Tcl_Value {
|
||||
Tcl_ValueType \fItype\fR;
|
||||
long \fIintValue\fR;
|
||||
double \fIdoubleValue\fR;
|
||||
Tcl_WideInt \fIwideValue\fR;
|
||||
} \fBTcl_Value\fR;
|
||||
.CE
|
||||
.PP
|
||||
The \fItype\fR field indicates the type of the argument and is
|
||||
one of \fBTCL_INT\fR, \fBTCL_DOUBLE\fR or \fBTCL_WIDE_INT\fR.
|
||||
It will match the \fIargTypes\fR value specified for the function unless
|
||||
the \fIargTypes\fR value was \fBTCL_EITHER\fR. Tcl converts
|
||||
the argument supplied in the expression to the type requested in
|
||||
\fIargTypes\fR, if that is necessary.
|
||||
Depending on the value of the \fItype\fR field, the \fIintValue\fR,
|
||||
\fIdoubleValue\fR or \fIwideValue\fR
|
||||
field will contain the actual value of the argument.
|
||||
.PP
|
||||
\fIProc\fR should compute its result and store it either as an integer
|
||||
in \fIresultPtr->intValue\fR or as a floating value in
|
||||
\fIresultPtr->doubleValue\fR.
|
||||
It should set also \fIresultPtr->type\fR to one of
|
||||
\fBTCL_INT\fR, \fBTCL_DOUBLE\fR or \fBTCL_WIDE_INT\fR
|
||||
to indicate which value was set.
|
||||
Under normal circumstances \fIproc\fR should return \fBTCL_OK\fR.
|
||||
If an error occurs while executing the function, \fIproc\fR should
|
||||
return \fBTCL_ERROR\fR and leave an error message in the interpreter's result.
|
||||
.PP
|
||||
\fBTcl_GetMathFuncInfo\fR retrieves the values associated with
|
||||
function \fIname\fR that were passed to a preceding
|
||||
\fBTcl_CreateMathFunc\fR call. Normally, the return code is
|
||||
\fBTCL_OK\fR but if the named function does not exist, \fBTCL_ERROR\fR
|
||||
is returned and an error message is placed in the interpreter's
|
||||
result.
|
||||
.PP
|
||||
If an error did not occur, the array reference placed in the variable
|
||||
pointed to by \fIargTypesPtr\fR is newly allocated, and should be
|
||||
released by passing it to \fBTcl_Free\fR. Some functions (the
|
||||
standard set implemented in the core, and those defined by placing
|
||||
commands in the \fBtcl::mathfunc\fR namespace) do not have
|
||||
argument type information; attempting to retrieve values for
|
||||
them causes a NULL to be stored in the variable pointed to by
|
||||
\fIprocPtr\fR and the variable pointed to by \fIclientDataPtr\fR
|
||||
will not be modified. The variable pointed to by \fInumArgsPointer\fR
|
||||
will contain -1, and no argument types will be stored in the variable
|
||||
pointed to by \fIargTypesPointer\fR.
|
||||
.PP
|
||||
\fBTcl_ListMathFuncs\fR returns a Tcl value containing a list of all
|
||||
the math functions defined in the interpreter whose name matches
|
||||
\fIpattern\fR. The returned value has a reference count of zero.
|
||||
.SH "SEE ALSO"
|
||||
expr(n), info(n), Tcl_CreateObjCommand(3), Tcl_Free(3), Tcl_NewListObj(3)
|
||||
.SH KEYWORDS
|
||||
expression, mathematical function
|
||||
+10
-10
@@ -59,7 +59,7 @@ Name of command.
|
||||
.AP Tcl_ObjCmdProc *proc in
|
||||
Implementation of the new command: \fIproc\fR will be called whenever
|
||||
\fIcmdName\fR is invoked as a command.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR and \fIdeleteProc\fR.
|
||||
.AP Tcl_CmdDeleteProc *deleteProc in
|
||||
Procedure to call before \fIcmdName\fR is deleted from the interpreter;
|
||||
@@ -102,7 +102,7 @@ and it returns NULL.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_ObjCmdProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[]);
|
||||
@@ -175,7 +175,7 @@ result that match the type \fBTcl_CmdDeleteProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CmdDeleteProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR argument will be the same as the \fIclientData\fR
|
||||
@@ -217,11 +217,11 @@ A \fBTcl_CmdInfo\fR structure has the following fields:
|
||||
typedef struct Tcl_CmdInfo {
|
||||
int \fIisNativeObjectProc\fR;
|
||||
Tcl_ObjCmdProc *\fIobjProc\fR;
|
||||
ClientData \fIobjClientData\fR;
|
||||
void *\fIobjClientData\fR;
|
||||
Tcl_CmdProc *\fIproc\fR;
|
||||
ClientData \fIclientData\fR;
|
||||
void *\fIclientData\fR;
|
||||
Tcl_CmdDeleteProc *\fIdeleteProc\fR;
|
||||
ClientData \fIdeleteData\fR;
|
||||
void *\fIdeleteData\fR;
|
||||
Tcl_Namespace *\fInamespacePtr\fR;
|
||||
} \fBTcl_CmdInfo\fR;
|
||||
.CE
|
||||
@@ -247,7 +247,7 @@ otherwise, this is a compatibility procedure
|
||||
registered by \fBTcl_CreateObjCommand\fR
|
||||
that simply calls the command's
|
||||
value-based procedure after converting its string arguments to Tcl values.
|
||||
The field \fIdeleteData\fR is the ClientData value
|
||||
The field \fIdeleteData\fR is the clientData value
|
||||
to pass to \fIdeleteProc\fR; it is normally the same as
|
||||
\fIclientData\fR but may be set independently using the
|
||||
\fBTcl_SetCommandInfo\fR procedure.
|
||||
@@ -261,7 +261,7 @@ from \fBTcl_CreateObjCommand\fR in place of the command name. If the
|
||||
and fills in the structure designated by \fIinfoPtr\fR.
|
||||
.PP
|
||||
\fBTcl_SetCommandInfo\fR is used to modify the procedures and
|
||||
ClientData values associated with a command.
|
||||
clientData values associated with a command.
|
||||
Its \fIcmdName\fR argument is the name of a command in \fIinterp\fR.
|
||||
\fIcmdName\fR may include \fB::\fR namespace qualifiers
|
||||
to identify a command in a particular namespace.
|
||||
@@ -277,9 +277,9 @@ copies the information from \fI*infoPtr\fR to Tcl's internal structure
|
||||
for the command and returns 1.
|
||||
.PP
|
||||
Note that \fBTcl_SetCommandInfo\fR and
|
||||
\fBTcl_SetCommandInfoFromToken\fR both allow the ClientData for a
|
||||
\fBTcl_SetCommandInfoFromToken\fR both allow the clientData for a
|
||||
command's deletion procedure to be given a different value than the
|
||||
ClientData for its command procedure.
|
||||
clientData for its command procedure.
|
||||
.PP
|
||||
Note that neither \fBTcl_SetCommandInfo\fR nor
|
||||
\fBTcl_SetCommandInfoFromToken\fR will change a command's namespace.
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ Tcl_TimerToken
|
||||
How many milliseconds to wait before invoking \fIproc\fR.
|
||||
.AP Tcl_TimerProc *proc in
|
||||
Procedure to invoke after \fImilliseconds\fR have elapsed.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.AP Tcl_TimerToken token in
|
||||
Token for previously created timer handler (the return value
|
||||
@@ -51,7 +51,7 @@ the type \fBTcl_TimerProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_TimerProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a
|
||||
|
||||
+6
-6
@@ -41,7 +41,7 @@ details of the calling sequence.
|
||||
.AP Tcl_CmdTraceProc *proc in
|
||||
Procedure to call for each command that is executed. See below for
|
||||
details on the calling sequence.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIobjProc\fR or \fIproc\fR.
|
||||
.AP Tcl_CmdObjTraceDeleteProc *deleteProc in
|
||||
Procedure to call when the trace is deleted. See below for details of
|
||||
@@ -66,7 +66,7 @@ interpreter.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_CmdObjTraceProc\fR(
|
||||
\fBClientData\fR \fIclientData\fR,
|
||||
\fBvoid *\fR \fIclientData\fR,
|
||||
\fBTcl_Interp\fR* \fIinterp\fR,
|
||||
int \fIlevel\fR,
|
||||
const char *\fIcommand\fR,
|
||||
@@ -77,7 +77,7 @@ typedef int \fBTcl_CmdObjTraceProc\fR(
|
||||
.PP
|
||||
The \fIclientData\fR and \fIinterp\fR parameters are copies of the
|
||||
corresponding arguments given to \fBTcl_CreateTrace\fR.
|
||||
\fIClientData\fR typically points to an application-specific data
|
||||
\fIclientData\fR typically points to an application-specific data
|
||||
structure that describes what to do when \fIobjProc\fR is invoked. The
|
||||
\fIlevel\fR parameter gives the nesting level of the command (1 for
|
||||
top-level commands passed to \fBTcl_Eval\fR by the application, 2 for
|
||||
@@ -144,7 +144,7 @@ When \fBTcl_DeleteTrace\fR is called, the interpreter invokes the
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CmdObjTraceDeleteProc\fR(
|
||||
\fBClientData\fR \fIclientData\fR);
|
||||
\fBvoid *\fR \fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR parameter will be the same as the
|
||||
@@ -160,12 +160,12 @@ match the type \fBTcl_CmdTraceProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CmdTraceProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIlevel\fR,
|
||||
char *\fIcommand\fR,
|
||||
Tcl_CmdProc *\fIcmdProc\fR,
|
||||
ClientData \fIcmdClientData\fR,
|
||||
void *\fIcmdClientData\fR,
|
||||
int \fIargc\fR,
|
||||
const char *\fIargv\fR[]);
|
||||
.CE
|
||||
|
||||
+5
-11
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringTrunc, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult \- manipulate dynamic strings
|
||||
Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult \- manipulate dynamic strings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -26,7 +26,7 @@ char *
|
||||
.sp
|
||||
\fBTcl_DStringEndSublist\fR(\fIdsPtr\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_DStringLength\fR(\fIdsPtr\fR)
|
||||
.sp
|
||||
char *
|
||||
@@ -34,8 +34,6 @@ char *
|
||||
.sp
|
||||
\fBTcl_DStringSetLength\fR(\fIdsPtr, newLength\fR)
|
||||
.sp
|
||||
\fBTcl_DStringTrunc\fR(\fIdsPtr, newLength\fR)
|
||||
.sp
|
||||
\fBTcl_DStringFree\fR(\fIdsPtr\fR)
|
||||
.sp
|
||||
\fBTcl_DStringResult\fR(\fIinterp, dsPtr\fR)
|
||||
@@ -49,10 +47,10 @@ Pointer to structure that is used to manage a dynamic string.
|
||||
Pointer to characters to append to dynamic string.
|
||||
.AP "const char" *element in
|
||||
Pointer to characters to append as list element to dynamic string.
|
||||
.AP int length in
|
||||
Number of bytes from \fIbytes\fR to add to dynamic string. If -1,
|
||||
.AP size_t length in
|
||||
Number of bytes from \fIbytes\fR to add to dynamic string. If (size_t)-1,
|
||||
add all characters up to null terminating character.
|
||||
.AP int newLength in
|
||||
.AP size_t newLength in
|
||||
New length for dynamic string, not including null terminating
|
||||
character.
|
||||
.AP Tcl_Interp *interp in/out
|
||||
@@ -128,10 +126,6 @@ caller to fill in the new space.
|
||||
even if the string is truncated to zero length, so \fBTcl_DStringFree\fR
|
||||
will still need to be called.
|
||||
.PP
|
||||
\fBTcl_DStringTrunc\fR changes the length of a dynamic string.
|
||||
This procedure is now deprecated. \fBTcl_DStringSetLength\fR should
|
||||
be used instead.
|
||||
.PP
|
||||
\fBTcl_DStringFree\fR should be called when you are finished using
|
||||
the string. It frees up any memory that was allocated for the string
|
||||
and reinitializes the string's value to an empty string.
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ Tcl_DoWhenIdle, Tcl_CancelIdleCall \- invoke a procedure when there are no pendi
|
||||
.AS Tcl_IdleProc clientData
|
||||
.AP Tcl_IdleProc *proc in
|
||||
Procedure to invoke.
|
||||
.AP ClientData clientData in
|
||||
.AP coid *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -43,7 +43,7 @@ type \fBTcl_IdleProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_IdleProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
|
||||
|
||||
@@ -43,7 +43,7 @@ is not defined, these functions are all no-ops.
|
||||
\fBTcl_DumpActiveMemory\fR will output a list of all currently
|
||||
allocated memory to the specified file. The information output for
|
||||
each allocated block of memory is: starting and ending addresses
|
||||
(excluding guard zone), size, source file where \fBckalloc\fR was
|
||||
(excluding guard zone), size, source file where \fBTcl_Alloc\fR was
|
||||
called to allocate the block and line number in that file. It is
|
||||
especially useful to call \fBTcl_DumpActiveMemory\fR after the Tcl
|
||||
interpreter has been deleted.
|
||||
@@ -55,8 +55,8 @@ by \fBTcl_Main\fR.
|
||||
\fBTcl_ValidateAllMemory\fR forces a validation of the guard zones of
|
||||
all currently allocated blocks of memory. Normally validation of a
|
||||
block occurs when its freed, unless full validation is enabled, in
|
||||
which case validation of all blocks occurs when \fBckalloc\fR and
|
||||
\fBckfree\fR are called. This function forces the validation to occur
|
||||
which case validation of all blocks occurs when \fBTcl_Alloc\fR and
|
||||
\fBTcl_Free\fR are called. This function forces the validation to occur
|
||||
at any point.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
|
||||
+6
-21
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_GetEncoding, Tcl_FreeEncoding, Tcl_GetEncodingFromObj, Tcl_ExternalToUtfDString, Tcl_ExternalToUtf, Tcl_UtfToExternalDString, Tcl_UtfToExternal, Tcl_WinTCharToUtf, Tcl_WinUtfToTChar, Tcl_GetEncodingName, Tcl_SetSystemEncoding, Tcl_GetEncodingNameFromEnvironment, Tcl_GetEncodingNames, Tcl_CreateEncoding, Tcl_GetEncodingSearchPath, Tcl_SetEncodingSearchPath, Tcl_GetDefaultEncodingDir, Tcl_SetDefaultEncodingDir \- procedures for creating and using encodings
|
||||
Tcl_GetEncoding, Tcl_FreeEncoding, Tcl_GetEncodingFromObj, Tcl_ExternalToUtfDString, Tcl_ExternalToUtf, Tcl_UtfToExternalDString, Tcl_UtfToExternal, Tcl_WinTCharToUtf, Tcl_WinUtfToTChar, Tcl_GetEncodingName, Tcl_SetSystemEncoding, Tcl_GetEncodingNameFromEnvironment, Tcl_GetEncodingNames, Tcl_CreateEncoding, Tcl_GetEncodingSearchPath, Tcl_SetEncodingSearchPath \- procedures for creating and using encodings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -62,12 +62,6 @@ Tcl_Obj *
|
||||
.sp
|
||||
int
|
||||
\fBTcl_SetEncodingSearchPath\fR(\fIsearchPath\fR)
|
||||
.sp
|
||||
const char *
|
||||
\fBTcl_GetDefaultEncodingDir\fR(\fIvoid\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_SetDefaultEncodingDir\fR(\fIpath\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "const Tcl_EncodingType" *dstWrotePtr in/out
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -89,7 +83,7 @@ specified encoding that are to be converted to UTF-8. For the
|
||||
UTF-8 characters to be converted to the specified encoding.
|
||||
.AP "const TCHAR" *tsrc in
|
||||
An array of Windows TCHAR characters to convert to UTF-8.
|
||||
.AP int srcLen in
|
||||
.AP size_t srcLen in
|
||||
Length of \fIsrc\fR or \fItsrc\fR in bytes. If the length is negative, the
|
||||
encoding-specific length of the string is used.
|
||||
.AP Tcl_DString *dstPtr out
|
||||
@@ -287,7 +281,7 @@ the encoding name to it. The \fBTcl_DStringValue\fR is returned.
|
||||
\fBTcl_GetEncodingNames\fR sets the \fIinterp\fR result to a list
|
||||
consisting of the names of all the encodings that are currently defined
|
||||
or can be dynamically loaded, searching the encoding path specified by
|
||||
\fBTcl_SetDefaultEncodingDir\fR. This procedure does not ensure that the
|
||||
\fBTcl_SetEncodingSearchPath\fR. This procedure does not ensure that the
|
||||
dynamically-loadable encoding files contain valid data, but merely that they
|
||||
exist.
|
||||
.PP
|
||||
@@ -314,7 +308,7 @@ typedef struct Tcl_EncodingType {
|
||||
Tcl_EncodingConvertProc *\fItoUtfProc\fR;
|
||||
Tcl_EncodingConvertProc *\fIfromUtfProc\fR;
|
||||
Tcl_EncodingFreeProc *\fIfreeProc\fR;
|
||||
ClientData \fIclientData\fR;
|
||||
void *\fIclientData\fR;
|
||||
int \fInullSize\fR;
|
||||
} \fBTcl_EncodingType\fR;
|
||||
.CE
|
||||
@@ -345,7 +339,7 @@ type \fBTcl_EncodingConvertProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_EncodingConvertProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
const char *\fIsrc\fR,
|
||||
int \fIsrcLen\fR,
|
||||
int \fIflags\fR,
|
||||
@@ -377,7 +371,7 @@ The callback procedure \fIfreeProc\fR, if non-NULL, should match the type
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_EncodingFreeProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
This \fIfreeProc\fR function is called when the encoding is deleted. The
|
||||
@@ -402,15 +396,6 @@ are not verified as existing readable filesystem directories. When
|
||||
searching for encoding data files takes place, and non-existent or
|
||||
non-readable filesystem directories on the \fIsearchPath\fR are silently
|
||||
ignored.
|
||||
.PP
|
||||
\fBTcl_GetDefaultEncodingDir\fR and \fBTcl_SetDefaultEncodingDir\fR
|
||||
are obsolete interfaces best replaced with calls to
|
||||
\fBTcl_GetEncodingSearchPath\fR and \fBTcl_SetEncodingSearchPath\fR.
|
||||
They are called to access and set the first element of the \fIsearchPath\fR
|
||||
list. Since Tcl searches \fIsearchPath\fR for encoding data files in
|
||||
list order, these routines establish the
|
||||
.QW default
|
||||
directory in which to find encoding data files.
|
||||
.SH "ENCODING FILES"
|
||||
Space would prohibit precompiling into Tcl every possible encoding
|
||||
algorithm, so many encodings are stored on disk as dynamically-loadable
|
||||
|
||||
+3
-19
@@ -10,7 +10,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval, Tcl_VarEvalVA \- execute Tcl scripts
|
||||
Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval \- execute Tcl scripts
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -38,9 +38,6 @@ int
|
||||
.sp
|
||||
int
|
||||
\fBTcl_VarEval\fR(\fIinterp, part, part, ... \fB(char *) NULL\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_VarEvalVA\fR(\fIinterp, argList\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp **termPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -67,9 +64,6 @@ first null byte are used.
|
||||
Points to first byte of script to execute (null-terminated and UTF-8).
|
||||
.AP char *part in
|
||||
String forming part of a Tcl script.
|
||||
.AP va_list argList in
|
||||
An argument list which must have been initialized using
|
||||
\fBva_start\fR, and cleared using \fBva_end\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
@@ -128,16 +122,10 @@ might be a UTF-8 special code. The string is parsed and executed directly
|
||||
bytecodes. In situations where it is known that the script will never be
|
||||
executed again, \fBTcl_Eval\fR may be faster than \fBTcl_EvalObjEx\fR.
|
||||
\fBTcl_Eval\fR returns a completion code and result just like
|
||||
\fBTcl_EvalObjEx\fR. Note: for backward compatibility with versions before
|
||||
Tcl 8.0, \fBTcl_Eval\fR copies the value result in \fIinterp\fR to
|
||||
\fIinterp->result\fR (use is deprecated) where it can be accessed directly.
|
||||
This makes \fBTcl_Eval\fR somewhat slower than \fBTcl_EvalEx\fR, which
|
||||
does not do the copy.
|
||||
\fBTcl_EvalObjEx\fR.
|
||||
.PP
|
||||
\fBTcl_EvalEx\fR is an extended version of \fBTcl_Eval\fR that takes
|
||||
additional arguments \fInumBytes\fR and \fIflags\fR. For the
|
||||
efficiency reason given above, \fBTcl_EvalEx\fR is generally preferred
|
||||
over \fBTcl_Eval\fR.
|
||||
additional arguments \fInumBytes\fR and \fIflags\fR.
|
||||
.PP
|
||||
\fBTcl_GlobalEval\fR and \fBTcl_GlobalEvalObj\fR are older procedures
|
||||
that are now deprecated. They are similar to \fBTcl_EvalEx\fR and
|
||||
@@ -153,10 +141,6 @@ It returns the result of the command and also modifies
|
||||
\fIinterp->result\fR in the same way as \fBTcl_Eval\fR.
|
||||
The last argument to \fBTcl_VarEval\fR must be NULL to indicate the end
|
||||
of arguments. \fBTcl_VarEval\fR is now deprecated.
|
||||
.PP
|
||||
\fBTcl_VarEvalVA\fR is the same as \fBTcl_VarEval\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument
|
||||
list. Like \fBTcl_VarEval\fR, \fBTcl_VarEvalVA\fR is deprecated.
|
||||
|
||||
.SH "FLAG BITS"
|
||||
.PP
|
||||
|
||||
+4
-4
@@ -42,7 +42,7 @@ usually means that an error occurred.
|
||||
Procedure to invoke before exiting application, or (for
|
||||
\fBTcl_SetExitProc\fR) NULL to uninstall the current application exit
|
||||
procedure.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
|
||||
@@ -64,7 +64,7 @@ otherwise causes the application to terminate without calling
|
||||
returns control to its caller.
|
||||
If an application exit handler has been installed (see
|
||||
\fBTcl_SetExitProc\fR), that handler is invoked with an argument
|
||||
consisting of the exit status (cast to ClientData); the application
|
||||
consisting of the exit status (cast to void *); the application
|
||||
exit handler should not return control to Tcl.
|
||||
.PP
|
||||
\fBTcl_Finalize\fR is similar to \fBTcl_Exit\fR except that it does not
|
||||
@@ -93,7 +93,7 @@ and freeing global memory.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_ExitProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a
|
||||
@@ -133,7 +133,7 @@ installed, that exit handler takes over complete responsibility for
|
||||
finalization of Tcl's subsystems via \fBTcl_Finalize\fR at an
|
||||
appropriate time. The argument passed to \fIproc\fR when it is
|
||||
invoked will be the exit status code (as passed to \fBTcl_Exit\fR)
|
||||
cast to a ClientData value.
|
||||
cast to a void *value.
|
||||
.SH "SEE ALSO"
|
||||
exit(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+13
-13
@@ -20,7 +20,7 @@ int
|
||||
int
|
||||
\fBTcl_FSUnregister\fR(\fIfsPtr\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_FSData\fR(\fIfsPtr\fR)
|
||||
.sp
|
||||
void
|
||||
@@ -125,7 +125,7 @@ Tcl_Obj *
|
||||
int
|
||||
\fBTcl_FSConvertToPathType\fR(\fIinterp, pathPtr\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_FSGetInternalRep\fR(\fIpathPtr, fsPtr\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
@@ -212,7 +212,7 @@ this structure will be returned. This parameter may be NULL.
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use either for results, evaluation, or reporting error
|
||||
messages.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
The native description of the path value to create.
|
||||
.AP Tcl_Obj *firstPtr in
|
||||
The first of two path values to compare. The value may be converted
|
||||
@@ -249,7 +249,7 @@ Name of a procedure to look up in the file's symbol table
|
||||
Filled with the init function for this code.
|
||||
.AP Tcl_PackageInitProc **proc2Ptr out
|
||||
Filled with the safe-init function for this code.
|
||||
.AP ClientData *clientDataPtr out
|
||||
.AP void **clientDataPtr out
|
||||
Filled with the clientData value to pass to this code's unload
|
||||
function when it is called.
|
||||
.AP Tcl_LoadHandle *loadHandlePtr out
|
||||
@@ -724,7 +724,7 @@ better functions to use for most purposes.
|
||||
\fBTcl_FSGetTranslatedStringPath\fR does the same as
|
||||
\fBTcl_FSGetTranslatedPath\fR, but returns a character string or NULL.
|
||||
The string returned is dynamically allocated and owned by the caller,
|
||||
which must store it or call \fBckfree\fR to ensure it is freed. Again,
|
||||
which must store it or call \fBTcl_Free\fR to ensure it is freed. Again,
|
||||
\fBTcl_FSGetNormalizedPath\fR or \fBTcl_FSGetNativePath\fR are usually
|
||||
better functions to use for most purposes.
|
||||
.PP
|
||||
@@ -791,7 +791,7 @@ It returns one of \fBTCL_PATH_ABSOLUTE\fR, \fBTCL_PATH_RELATIVE\fR, or
|
||||
.SS "PORTABLE STAT RESULT API"
|
||||
.PP
|
||||
\fBTcl_AllocStatBuf\fR allocates a \fITcl_StatBuf\fR on the system heap (which
|
||||
may be deallocated by being passed to \fBckfree\fR). This allows extensions to
|
||||
may be deallocated by being passed to \fBTcl_Free\fR). This allows extensions to
|
||||
invoke \fBTcl_FSStat\fR and \fBTcl_FSLstat\fR without being dependent on the
|
||||
size of the buffer. That in turn depends on the flags used to build Tcl.
|
||||
.PP
|
||||
@@ -841,7 +841,7 @@ general that is not a good thing to do). \fBTCL_OK\fR will be returned.
|
||||
the list of known filesystems, if it is known, and returns \fBTCL_OK\fR. If
|
||||
the filesystem is not currently registered, \fBTCL_ERROR\fR is returned.
|
||||
.PP
|
||||
\fBTcl_FSData\fR will return the ClientData associated with the given
|
||||
\fBTcl_FSData\fR will return the clientData associated with the given
|
||||
filesystem, if that filesystem is registered. Otherwise it will
|
||||
return NULL.
|
||||
.PP
|
||||
@@ -1018,7 +1018,7 @@ Tcl's internal list of known filesystems.
|
||||
.CS
|
||||
typedef int \fBTcl_FSPathInFilesystemProc\fR(
|
||||
Tcl_Obj *\fIpathPtr\fR,
|
||||
ClientData *\fIclientDataPtr\fR);
|
||||
void **\fIclientDataPtr\fR);
|
||||
.CE
|
||||
.SS DUPINTERNALREPPROC
|
||||
.PP
|
||||
@@ -1028,8 +1028,8 @@ simply not copy the internal representation, which may then need to be
|
||||
regenerated later.
|
||||
.PP
|
||||
.CS
|
||||
typedef ClientData \fBTcl_FSDupInternalRepProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
typedef void *\fBTcl_FSDupInternalRepProc\fR(
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.SS FREEINTERNALREPPROC
|
||||
Free the internal representation. This must be implemented if internal
|
||||
@@ -1038,7 +1038,7 @@ internal representation is generated), but may otherwise be NULL.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_FSFreeInternalRepProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.SS INTERNALTONORMALIZEDPROC
|
||||
.PP
|
||||
@@ -1049,7 +1049,7 @@ representation is the normalized path.
|
||||
.PP
|
||||
.CS
|
||||
typedef Tcl_Obj *\fBTcl_FSInternalToNormalizedProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.SS CREATEINTERNALREPPROC
|
||||
.PP
|
||||
@@ -1060,7 +1060,7 @@ the \fITcl_FSPathInFilesystemProc\fR for this filesystem always
|
||||
immediately creates an internal representation for paths it accepts.
|
||||
.PP
|
||||
.CS
|
||||
typedef ClientData \fBTcl_FSCreateInternalRepProc\fR(
|
||||
typedef void *\fBTcl_FSCreateInternalRepProc\fR(
|
||||
Tcl_Obj *\fIpathPtr\fR);
|
||||
.CE
|
||||
.SS NORMALIZEPATHPROC
|
||||
|
||||
+2
-5
@@ -64,12 +64,9 @@ if the first such characters are
|
||||
then \fIsrc\fR is expected to be in octal form; otherwise,
|
||||
if the first such characters are
|
||||
.QW \fB0b\fR
|
||||
then \fIsrc\fR is expected to be in binary form; otherwise,
|
||||
if the first such character is
|
||||
.QW \fB0\fR
|
||||
then \fIsrc\fR
|
||||
is expected to be in octal form; otherwise, \fIsrc\fR
|
||||
is expected to be in decimal form.
|
||||
is expected to be in binary form; otherwise, \fIsrc\fR is
|
||||
expected to be in decimal form.
|
||||
.PP
|
||||
\fBTcl_GetDouble\fR expects \fIsrc\fR to consist of a floating-point
|
||||
number, which is: white space; a sign; a sequence of digits; a
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ be used for reading.
|
||||
.AP int checkUsage in
|
||||
If non-zero, then an error will be generated if the file was not opened
|
||||
for the access indicated by \fIwrite\fR.
|
||||
.AP ClientData *filePtr out
|
||||
.AP void **filePtr out
|
||||
Points to word in which to store pointer to FILE structure for
|
||||
the file given by \fIchanID\fR.
|
||||
.BE
|
||||
|
||||
+4
-4
@@ -27,13 +27,13 @@ Pointer to handler function replacing \fBTcl_GetTime\fR's access to the OS.
|
||||
.AP Tcl_ScaleTimeProc scaleProc in
|
||||
Pointer to handler function for the conversion of time delays in the
|
||||
virtual domain to real-time.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Value passed through to the two handler functions.
|
||||
.AP Tcl_GetTimeProc *getProcPtr out
|
||||
Pointer to place the currently registered get handler function into.
|
||||
.AP Tcl_ScaleTimeProc *scaleProcPtr out
|
||||
Pointer to place the currently registered scale handler function into.
|
||||
.AP ClientData *clientDataPtr out
|
||||
.AP void **clientDataPtr out
|
||||
Pointer to place the currently registered pass-through value into.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -83,10 +83,10 @@ The signatures of the handler functions are as follows:
|
||||
.CS
|
||||
typedef void \fBTcl_GetTimeProc\fR(
|
||||
Tcl_Time *\fItimebuf\fR,
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
typedef void \fBTcl_ScaleTimeProc\fR(
|
||||
Tcl_Time *\fItimebuf\fR,
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fItimebuf\fR fields contain the time to manipulate, and the
|
||||
|
||||
+4
-10
@@ -30,7 +30,7 @@ Tcl_HashEntry *
|
||||
Tcl_HashEntry *
|
||||
\fBTcl_FindHashEntry\fR(\fItablePtr, key\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_GetHashValue\fR(\fIentryPtr\fR)
|
||||
.sp
|
||||
\fBTcl_SetHashValue\fR(\fIentryPtr, value\fR)
|
||||
@@ -66,9 +66,8 @@ The word at \fI*newPtr\fR is set to 1 if a new entry was created
|
||||
and 0 if there was already an entry for \fIkey\fR.
|
||||
.AP Tcl_HashEntry *entryPtr in
|
||||
Pointer to hash table entry.
|
||||
.AP ClientData value in
|
||||
New value to assign to hash table entry. Need not have type
|
||||
ClientData, but must fit in same space as ClientData.
|
||||
.AP void *value in
|
||||
New value to assign to hash table entry.
|
||||
.AP Tcl_HashSearch *searchPtr in
|
||||
Pointer to record to use to keep track of progress in enumerating
|
||||
all the entries in a hash table.
|
||||
@@ -186,11 +185,6 @@ instead, it returns NULL as result.
|
||||
.PP
|
||||
\fBTcl_GetHashValue\fR and \fBTcl_SetHashValue\fR are used to
|
||||
read and write an entry's value, respectively.
|
||||
Values are stored and retrieved as type
|
||||
.QW ClientData ,
|
||||
which is
|
||||
large enough to hold a pointer value. On almost all machines this is
|
||||
large enough to hold an integer value too.
|
||||
.PP
|
||||
\fBTcl_GetHashKey\fR returns the key for a given hash table entry,
|
||||
either as a pointer to a string, a one-word
|
||||
@@ -229,7 +223,7 @@ overall information about a hash table, such as the number of
|
||||
entries it contains, the number of buckets in its hash array,
|
||||
and the utilization of the buckets.
|
||||
It is the caller's responsibility to free the result string
|
||||
by passing it to \fBckfree\fR.
|
||||
by passing it to \fBTcl_Free\fR.
|
||||
.PP
|
||||
The header file \fBtcl.h\fR defines the actual data structures
|
||||
used to implement hash tables.
|
||||
|
||||
+3
-3
@@ -63,9 +63,9 @@ Define the \fBUSE_TCL_STUBS\fR symbol. Typically, you would include the
|
||||
\fB\-DUSE_TCL_STUBS\fR flag when compiling the extension.
|
||||
.IP 3) 5
|
||||
Link the extension with the Tcl stubs library instead of the standard
|
||||
Tcl library. For example, to use the Tcl 8.6 ABI on Unix platforms,
|
||||
the library name is \fIlibtclstub8.6.a\fR; on Windows platforms, the
|
||||
library name is \fItclstub86.lib\fR.
|
||||
Tcl library. For example, to use the Tcl 9.0 ABI on Unix platforms,
|
||||
the library name is \fIlibtclstub9.0.a\fR; on Windows platforms, the
|
||||
library name is \fItclstub90.lib\fR.
|
||||
.PP
|
||||
If the extension also requires the Tk API, it must also call
|
||||
\fBTk_InitStubs\fR to initialize the Tk stubs interface and link
|
||||
|
||||
@@ -33,19 +33,6 @@ the pointer as described below is no longer supported. The supported
|
||||
public routines \fBTcl_SetResult\fR, \fBTcl_GetResult\fR,
|
||||
\fBTcl_SetErrorLine\fR, \fBTcl_GetErrorLine\fR must be used instead.
|
||||
.PP
|
||||
For legacy programs and extensions no longer being maintained, compiles
|
||||
against the Tcl 8.6 header files are only possible with the compiler
|
||||
directives
|
||||
.CS
|
||||
#define USE_INTERP_RESULT
|
||||
.CE
|
||||
and/or
|
||||
.CS
|
||||
#define USE_INTERP_ERRORLINE
|
||||
.CE
|
||||
depending on which fields of the \fBTcl_Interp\fR struct are accessed.
|
||||
These directives may be embedded in code or supplied via compiler options.
|
||||
.PP
|
||||
The \fIresult\fR and \fIfreeProc\fR fields are used to return
|
||||
results or error messages from commands.
|
||||
This information is returned by command procedures back to \fBTcl_Eval\fR,
|
||||
|
||||
+3
-3
@@ -83,7 +83,7 @@ the handler returns. Many handlers may be attached to the same
|
||||
interpreter limit; their order of execution is not defined, and they
|
||||
must be identified by \fIhandlerProc\fR and \fIclientData\fR when they
|
||||
are deleted.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary pointer-sized word used to pass some context to the
|
||||
\fIhandlerProc\fR function.
|
||||
.AP Tcl_LimitHandlerDeleteProc *deleteProc in
|
||||
@@ -162,7 +162,7 @@ following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_LimitHandlerProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -179,7 +179,7 @@ following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_LimitHandlerDeleteProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
A limit handler may be deleted using \fBTcl_LimitRemoveHandler\fR; the
|
||||
|
||||
+1
-1
@@ -190,7 +190,7 @@ Tcl errors.
|
||||
\fBTCL_LINK_STRING\fR
|
||||
The C variable is of type \fBchar *\fR.
|
||||
If its value is not NULL then it must be a pointer to a string
|
||||
allocated with \fBTcl_Alloc\fR or \fBckalloc\fR.
|
||||
allocated with \fBTcl_Alloc\fR.
|
||||
Whenever the Tcl variable is modified the current C string will be
|
||||
freed and new memory will be allocated to hold a copy of the variable's
|
||||
new value.
|
||||
|
||||
+7
-7
@@ -61,7 +61,7 @@ Tcl_Object
|
||||
int
|
||||
\fBTcl_ObjectContextSkippedArgs\fR(\fIcontext\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS ClientData clientData in
|
||||
.AS void *clientData in
|
||||
.AP Tcl_Interp *interp in/out
|
||||
The interpreter holding the object or class to create or update a method in.
|
||||
.AP Tcl_Object object in
|
||||
@@ -83,10 +83,10 @@ and \fBTCL_OO_METHOD_PRIVATE\fR for a private method.
|
||||
.AP Tcl_MethodType *methodTypePtr in
|
||||
A description of the type of the method to create, or the type of method to
|
||||
compare against.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
A piece of data that is passed to the implementation of the method without
|
||||
interpretation.
|
||||
.AP ClientData *clientDataPtr out
|
||||
.AP void **clientDataPtr out
|
||||
A pointer to a variable in which to write the \fIclientData\fR value supplied
|
||||
when the method was created. If NULL, the \fIclientData\fR value will not be
|
||||
retrieved.
|
||||
@@ -213,7 +213,7 @@ Functions matching this signature are called when the method is invoked.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_MethodCallProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tcl_ObjectContext \fIobjectContext\fR,
|
||||
int \fIobjc\fR,
|
||||
@@ -234,7 +234,7 @@ through a new method being created or because the object or class is deleted.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_MethodDeleteProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR argument to a Tcl_MethodDeleteProc will be the same as
|
||||
@@ -248,8 +248,8 @@ class is copied using \fBTcl_CopyObjectInstance\fR (or \fBoo::copy\fR).
|
||||
.CS
|
||||
typedef int \fBTcl_CloneProc\fR(
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
ClientData \fIoldClientData\fR,
|
||||
ClientData *\fInewClientDataPtr\fR);
|
||||
void *\fIoldClientData\fR,
|
||||
void **\fInewClientDataPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIinterp\fR argument gives a place to write an error message when the
|
||||
|
||||
@@ -49,7 +49,7 @@ in the same way as the \fIproc\fR argument to \fBTcl_CreateObjCommand\fR(3)
|
||||
(\fIq.v.\fR).
|
||||
.AP Tcl_ObjCmdProc *nreProc in
|
||||
Called instead of \fIproc\fR when a trampoline is already in use.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value passed to \fIproc\fR, \fInreProc\fR, \fIdeleteProc\fR
|
||||
and \fIobjProc\fR.
|
||||
.AP Tcl_CmdDeleteProc *deleteProc in/out
|
||||
@@ -72,10 +72,10 @@ Pointer to an unshared Tcl_Obj where the result of the evaluation is stored if
|
||||
the return code is TCL_OK.
|
||||
.AP Tcl_NRPostProc *postProcPtr in
|
||||
A function to push.
|
||||
.AP ClientData data0 in
|
||||
.AP ClientData data1 in
|
||||
.AP ClientData data2 in
|
||||
.AP ClientData data3 in
|
||||
.AP void *data0 in
|
||||
.AP void *data1 in
|
||||
.AP void *data2 in
|
||||
.AP void *data3 in
|
||||
\fIdata0\fR through \fIdata3\fR are four one-word values that will be passed
|
||||
to the function designated by \fIpostProcPtr\fR when it is invoked.
|
||||
.BE
|
||||
@@ -130,7 +130,7 @@ a message as the interpreter's result.
|
||||
.CS
|
||||
typedef int
|
||||
\fBTcl_NRPostProc\fR(
|
||||
\fBClientData\fR \fIdata\fR[],
|
||||
\fBvoid *\fR \fIdata\fR[],
|
||||
\fBTcl_Interp\fR *\fIinterp\fR,
|
||||
int \fIresult\fR);
|
||||
.CE
|
||||
@@ -146,7 +146,7 @@ stack, to evalute a script:
|
||||
.CS
|
||||
int
|
||||
\fITheCmdOldObjProc\fR(
|
||||
ClientData clientData,
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -177,7 +177,7 @@ call \fITheCmdNRObjProc\fR:
|
||||
.CS
|
||||
int
|
||||
\fITheCmdOldObjProc\fR(
|
||||
ClientData clientData,
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -190,7 +190,7 @@ int
|
||||
.CS
|
||||
int
|
||||
\fITheCmdNRObjProc\fR
|
||||
ClientData clientData,
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -211,7 +211,7 @@ int
|
||||
.CS
|
||||
int
|
||||
\fITheCmdNRPostProc\fR(
|
||||
ClientData data[],
|
||||
void *data[],
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
|
||||
+2
-2
@@ -57,7 +57,7 @@ The interpreter in which the namespace exists and where name lookups
|
||||
are performed. Also where error result messages are written.
|
||||
.AP "const char" *name in
|
||||
The name of the namespace or command to be created or accessed.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
A context pointer by the creator of the namespace. Not interpreted by
|
||||
Tcl at all.
|
||||
.AP Tcl_NamespaceDeleteProc *deleteProc in
|
||||
@@ -117,7 +117,7 @@ the global namespace.)
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_NamespaceDeleteProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fBTcl_DeleteNamespace\fR deletes a namespace, calling the
|
||||
|
||||
+7
-7
@@ -38,7 +38,7 @@ Tcl_ThreadId
|
||||
void
|
||||
\fBTcl_DeleteEvents\fR(\fIdeleteProc, clientData\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_InitNotifier\fR()
|
||||
.sp
|
||||
void
|
||||
@@ -78,7 +78,7 @@ Procedure to invoke to prepare for event wait in \fBTcl_DoOneEvent\fR.
|
||||
Procedure for \fBTcl_DoOneEvent\fR to invoke after waiting for
|
||||
events. Checks to see if any events have occurred and, if so,
|
||||
queues them.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIsetupProc\fR, \fIcheckProc\fR, or
|
||||
\fIdeleteProc\fR.
|
||||
.AP "const Tcl_Time" *timePtr in
|
||||
@@ -89,7 +89,7 @@ is NULL, it means there is no maximum wait time: wait forever if
|
||||
necessary.
|
||||
.AP Tcl_Event *evPtr in
|
||||
An event to add to the event queue. The storage for the event must
|
||||
have been allocated by the caller using \fBTcl_Alloc\fR or \fBckalloc\fR.
|
||||
have been allocated by the caller using \fBTcl_Alloc\fR.
|
||||
.AP Tcl_QueuePosition position in
|
||||
Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR,
|
||||
\fBTCL_QUEUE_HEAD\fR, or \fBTCL_QUEUE_MARK\fR.
|
||||
@@ -230,7 +230,7 @@ the event source.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_EventSetupProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
int \fIflags\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -308,7 +308,7 @@ following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_EventCheckProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
int \fIflags\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -399,7 +399,7 @@ of window events.
|
||||
When \fIproc\fR returns 1, \fBTcl_ServiceEvent\fR will remove the
|
||||
event from the event queue and free its storage.
|
||||
Note that the storage for an event must be allocated by
|
||||
the event source (using \fBTcl_Alloc\fR or the Tcl macro \fBckalloc\fR)
|
||||
the event source (using \fBTcl_Alloc\fR)
|
||||
before calling \fBTcl_QueueEvent\fR, but it
|
||||
will be freed by \fBTcl_ServiceEvent\fR, not by the event source.
|
||||
.PP
|
||||
@@ -428,7 +428,7 @@ queue. \fIProc\fR should match the following prototype:
|
||||
.CS
|
||||
typedef int \fBTcl_EventDeleteProc\fR(
|
||||
Tcl_Event *\fIevPtr\fR,
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR argument will be the same as the \fIclientData\fR
|
||||
|
||||
+2
-2
@@ -111,9 +111,9 @@ which is defined as follows.
|
||||
.PP
|
||||
.CS
|
||||
typedef struct Tcl_Obj {
|
||||
int \fIrefCount\fR;
|
||||
size_t \fIrefCount\fR;
|
||||
char *\fIbytes\fR;
|
||||
int \fIlength\fR;
|
||||
size_t \fIlength\fR;
|
||||
const Tcl_ObjType *\fItypePtr\fR;
|
||||
union {
|
||||
long \fIlongValue\fR;
|
||||
|
||||
+2
-2
@@ -186,8 +186,8 @@ to be treated as conventional null character-terminated C strings.
|
||||
These restrictions are easily met by using Tcl's internal UTF encoding
|
||||
for the string representation, same as one would do for other
|
||||
Tcl routines accepting string values as arguments.
|
||||
Storage for the byte array must be allocated in the heap by \fBTcl_Alloc\fR
|
||||
or \fBckalloc\fR. Note that \fIupdateStringProc\fRs must allocate
|
||||
Storage for the byte array must be allocated in the heap by \fBTcl_Alloc\fR.
|
||||
Note that \fIupdateStringProc\fRs must allocate
|
||||
enough storage for the string's bytes and the terminating null byte.
|
||||
.PP
|
||||
The \fIupdateStringProc\fR for Tcl's built-in double type, for example,
|
||||
|
||||
+13
-13
@@ -53,28 +53,28 @@ int
|
||||
int
|
||||
\fBTcl_Read\fR(\fIchannel, readBuf, bytesToRead\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_GetsObj\fR(\fIchannel, lineObjPtr\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_Gets\fR(\fIchannel, lineRead\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_Ungets\fR(\fIchannel, input, inputLen, addAtEnd\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_WriteObj\fR(\fIchannel, writeObjPtr\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_WriteChars\fR(\fIchannel, charBuf, bytesToWrite\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_Write\fR(\fIchannel, byteBuf, bytesToWrite\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_ReadRaw\fR(\fIchannel, readBuf, bytesToRead\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_WriteRaw\fR(\fIchannel, byteBuf, bytesToWrite\fR)
|
||||
.sp
|
||||
int
|
||||
@@ -134,7 +134,7 @@ input of the invoking process; likewise for \fBTCL_STDOUT\fR and
|
||||
redirect stdio handles to override the stdio handles for which
|
||||
\fBTCL_STDIN\fR, \fBTCL_STDOUT\fR and \fBTCL_STDERR\fR have been set. If it
|
||||
is set, then such redirections cause an error.
|
||||
.AP ClientData handle in
|
||||
.AP void *handle in
|
||||
Operating system specific handle for I/O to a file. For Unix this is a
|
||||
file descriptor, for Windows it is a HANDLE.
|
||||
.AP int readOrWrite in
|
||||
@@ -154,7 +154,7 @@ from a procedure such as \fBTcl_OpenFileChannel\fR.
|
||||
.AP Tcl_Obj *readObjPtr in/out
|
||||
A pointer to a Tcl value in which to store the characters read from the
|
||||
channel.
|
||||
.AP int charsToRead in
|
||||
.AP size_t charsToRead in
|
||||
The number of characters to read from the channel. If the channel's encoding
|
||||
is \fBbinary\fR, this is equivalent to the number of bytes to read from the
|
||||
channel.
|
||||
@@ -163,7 +163,7 @@ If non-zero, data read from the channel will be appended to the value.
|
||||
Otherwise, the data will replace the existing contents of the value.
|
||||
.AP char *readBuf out
|
||||
A buffer in which to store the bytes read from the channel.
|
||||
.AP int bytesToRead in
|
||||
.AP size_t bytesToRead in
|
||||
The number of bytes to read from the channel. The buffer \fIreadBuf\fR must
|
||||
be large enough to hold this many bytes.
|
||||
.AP Tcl_Obj *lineObjPtr in/out
|
||||
@@ -176,7 +176,7 @@ channel. Must have been initialized by the caller. The line read will be
|
||||
appended to any data already in the dynamic string.
|
||||
.AP "const char" *input in
|
||||
The input to add to a channel buffer.
|
||||
.AP int inputLen in
|
||||
.AP size_t inputLen in
|
||||
Length of the input
|
||||
.AP int addAtEnd in
|
||||
Flag indicating whether the input should be added to the end or
|
||||
@@ -187,7 +187,7 @@ A pointer to a Tcl value whose contents will be output to the channel.
|
||||
A buffer containing the characters to output to the channel.
|
||||
.AP "const char" *byteBuf in
|
||||
A buffer containing the bytes to output to the channel.
|
||||
.AP int bytesToWrite in
|
||||
.AP size_t bytesToWrite in
|
||||
The number of bytes to consume from \fIcharBuf\fR or \fIbyteBuf\fR and
|
||||
output to the channel.
|
||||
.AP Tcl_WideInt offset in
|
||||
|
||||
+3
-3
@@ -50,12 +50,12 @@ If nonzero, the client socket is connected asynchronously to the server.
|
||||
.AP "unsigned int" flags in
|
||||
ORed combination of \fBTCL_TCPSERVER\fR flags that specify additional
|
||||
informations about the socket being created.
|
||||
.AP ClientData sock in
|
||||
.AP void *sock in
|
||||
Platform-specific handle for client TCP socket.
|
||||
.AP Tcl_TcpAcceptProc *proc in
|
||||
Pointer to a procedure to invoke each time a new connection is
|
||||
accepted via the socket.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -127,7 +127,7 @@ the channel. \fIProc\fR must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_TcpAcceptProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Channel \fIchannel\fR,
|
||||
char *\fIhostName\fR,
|
||||
int \fIport\fR);
|
||||
|
||||
+1
-7
@@ -7,7 +7,7 @@
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc, Tcl_ConsolePanic \- report fatal error and abort
|
||||
Tcl_Panic, Tcl_SetPanicProc, Tcl_ConsolePanic \- report fatal error and abort
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -16,9 +16,6 @@ void
|
||||
\fBTcl_Panic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_PanicVA\fR(\fIformat\fR, \fIargList\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_SetPanicProc\fR(\fIpanicProc\fR)
|
||||
.sp
|
||||
void
|
||||
@@ -91,9 +88,6 @@ the Tcl library, \fBTcl_Panic\fR is a public function and may be called
|
||||
by any extension or application that wishes to abort the process and
|
||||
have a panic message displayed the same way that panic messages from Tcl
|
||||
will be displayed.
|
||||
.PP
|
||||
\fBTcl_PanicVA\fR is the same as \fBTcl_Panic\fR except that instead of
|
||||
taking a variable number of arguments it takes an argument list.
|
||||
.SH "SEE ALSO"
|
||||
abort(3), printf(3), exec(n), format(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+4
-4
@@ -31,7 +31,7 @@ The array of arguments to be parsed.
|
||||
Pointer to a variable that will hold the array of unprocessed arguments.
|
||||
Should be NULL if no return of unprocessed arguments is required. If
|
||||
\fIobjcPtr\fR is updated to a non-zero value, the array returned through this
|
||||
must be deallocated using \fBckfree\fR.
|
||||
must be deallocated using \fBTcl_Free\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
@@ -84,7 +84,7 @@ typedef struct {
|
||||
void *\fIsrcPtr\fR;
|
||||
void *\fIdstPtr\fR;
|
||||
const char *\fIhelpStr\fR;
|
||||
ClientData \fIclientData\fR;
|
||||
void *\fIclientData\fR;
|
||||
} \fBTcl_ArgvInfo\fR;
|
||||
.CE
|
||||
.PP
|
||||
@@ -127,7 +127,7 @@ have the following signature:
|
||||
.PP
|
||||
.CS
|
||||
typedef int (\fBTcl_ArgvFuncProc\fR)(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Obj *\fIobjPtr\fR,
|
||||
void *\fIdstPtr\fR);
|
||||
.CE
|
||||
@@ -149,7 +149,7 @@ function will have the following signature:
|
||||
.PP
|
||||
.CS
|
||||
typedef int (\fBTcl_ArgvGenFuncProc\fR)(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const *\fIobjv\fR,
|
||||
|
||||
+7
-21
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_ParseVar, Tcl_FreeParse, Tcl_EvalTokens, Tcl_EvalTokensStandard \- parse Tcl scripts and expressions
|
||||
Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_ParseVar, Tcl_FreeParse, Tcl_EvalTokensStandard \- parse Tcl scripts and expressions
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -33,20 +33,16 @@ const char *
|
||||
.sp
|
||||
\fBTcl_FreeParse\fR(\fIusedParsePtr\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_EvalTokens\fR(\fIinterp, tokenPtr, numTokens\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_EvalTokensStandard\fR(\fIinterp, tokenPtr, numTokens\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *usedParsePtr out
|
||||
.AP Tcl_Interp *interp out
|
||||
For procedures other than \fBTcl_FreeParse\fR, \fBTcl_EvalTokens\fR
|
||||
and \fBTcl_EvalTokensStandard\fR, used only for error reporting;
|
||||
For procedures other than \fBTcl_FreeParse\fR and
|
||||
\fBTcl_EvalTokensStandard\fR, used only for error reporting;
|
||||
if NULL, then no error messages are left after errors.
|
||||
For \fBTcl_EvalTokens\fR and \fBTcl_EvalTokensStandard\fR,
|
||||
determines the context for evaluating the
|
||||
script and also is used for error reporting; must not be NULL.
|
||||
For \fBTcl_EvalTokensStandard\fR, determines the context for evaluating
|
||||
the script and also is used for error reporting; must not be NULL.
|
||||
.AP "const char" *start in
|
||||
Pointer to first character in string to parse.
|
||||
.AP int numBytes in
|
||||
@@ -191,16 +187,6 @@ code with one of the values \fBTCL_OK\fR, \fBTCL_ERROR\fR,
|
||||
some other integer value originating in an extension.
|
||||
In addition, a result value or error message is left in \fIinterp\fR's
|
||||
result; it can be retrieved using \fBTcl_GetObjResult\fR.
|
||||
.PP
|
||||
\fBTcl_EvalTokens\fR differs from \fBTcl_EvalTokensStandard\fR only in
|
||||
the return convention used: it returns the result in a new Tcl_Obj.
|
||||
The reference count of the value returned as result has been
|
||||
incremented, so the caller must
|
||||
invoke \fBTcl_DecrRefCount\fR when it is finished with the value.
|
||||
If an error or other exception occurs while evaluating the tokens
|
||||
(such as a reference to a non-existent variable) then the return value
|
||||
is NULL and an error message is left in \fIinterp\fR's result. The use
|
||||
of \fBTcl_EvalTokens\fR is deprecated.
|
||||
.SH "TCL_PARSE STRUCTURE"
|
||||
.PP
|
||||
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
|
||||
@@ -222,8 +208,8 @@ typedef struct Tcl_Parse {
|
||||
typedef struct Tcl_Token {
|
||||
int \fItype\fR;
|
||||
const char *\fIstart\fR;
|
||||
int \fIsize\fR;
|
||||
int \fInumComponents\fR;
|
||||
size_t \fIsize\fR;
|
||||
size_t \fInumComponents\fR;
|
||||
} \fBTcl_Token\fR;
|
||||
.CE
|
||||
.PP
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ Tcl_Preserve, Tcl_Release, Tcl_EventuallyFree \- avoid freeing storage while it
|
||||
\fBTcl_EventuallyFree\fR(\fIclientData, freeProc\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_FreeProc clientData
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Token describing structure to be freed or reallocated. Usually a pointer
|
||||
to memory for structure.
|
||||
.AP Tcl_FreeProc *freeProc in
|
||||
@@ -91,7 +91,7 @@ reasons, but the value is the same.
|
||||
.PP
|
||||
When the \fIclientData\fR argument to \fBTcl_EventuallyFree\fR
|
||||
refers to storage allocated and returned by a prior call to
|
||||
\fBTcl_Alloc\fR, \fBckalloc\fR, or another function of the Tcl library,
|
||||
\fBTcl_Alloc\fR or another function of the Tcl library,
|
||||
then the \fIfreeProc\fR argument should be given the special value of
|
||||
\fBTCL_DYNAMIC\fR.
|
||||
.PP
|
||||
|
||||
+2
-7
@@ -18,10 +18,7 @@ Tcl_PrintDouble \- Convert floating value to string
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *interp out
|
||||
.AP Tcl_Interp *interp in
|
||||
Before Tcl 8.0, the \fBtcl_precision\fR variable in this interpreter
|
||||
controlled the conversion. As of Tcl 8.0, this argument is ignored and
|
||||
the conversion is controlled by the \fBtcl_precision\fR variable
|
||||
that is now shared by all interpreters.
|
||||
This argument is ignored.
|
||||
.AP double value in
|
||||
Floating-point value to be converted.
|
||||
.AP char *dst out
|
||||
@@ -41,9 +38,7 @@ so that it does not look like an integer. Where \fB%g\fR would
|
||||
generate an integer with no decimal point, \fBTcl_PrintDouble\fR adds
|
||||
.QW .0 .
|
||||
.PP
|
||||
If the \fBtcl_precision\fR value is non-zero, the result will have
|
||||
precisely that many digits of significance. If the value is zero
|
||||
(the default), the result will have the fewest digits needed to
|
||||
The result will have the fewest digits needed to
|
||||
represent the number in such a way that \fBTcl_NewDoubleObj\fR
|
||||
will generate the same number when presented with the given string.
|
||||
IEEE semantics of rounding to even apply to the conversion.
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ the command at global level instead of the current stack level.
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTcl_RecordAndEvalObj\fR is invoked to record a command as an event
|
||||
on the history list and then execute it using \fBTcl_EvalObjEx\fR
|
||||
on the history list and then execute it using \fBTcl_EvalObjEx\fR.
|
||||
It returns a completion code such as \fBTCL_OK\fR just like \fBTcl_EvalObjEx\fR,
|
||||
as well as a result value containing additional information
|
||||
(a result value or error message)
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ New limit for nested calls to \fBTcl_Eval\fR for \fIinterp\fR.
|
||||
.PP
|
||||
At any given time Tcl enforces a limit on the number of recursive
|
||||
calls that may be active for \fBTcl_Eval\fR and related procedures
|
||||
such as \fBTcl_GlobalEval\fR.
|
||||
such as \fBTcl_EvalEx\fR.
|
||||
Any call to \fBTcl_Eval\fR that exceeds this depth is aborted with
|
||||
an error.
|
||||
By default the recursion limit is 1000.
|
||||
|
||||
+1
-19
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendResultVA, Tcl_AppendElement, Tcl_ResetResult, Tcl_TransferResult, Tcl_FreeResult \- manipulate Tcl result
|
||||
Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendElement, Tcl_ResetResult, Tcl_TransferResult, Tcl_FreeResult \- manipulate Tcl result
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -26,8 +26,6 @@ const char *
|
||||
.sp
|
||||
\fBTcl_AppendResult\fR(\fIinterp, result, result, ... , \fB(char *) NULL\fR)
|
||||
.sp
|
||||
\fBTcl_AppendResultVA\fR(\fIinterp, argList\fR)
|
||||
.sp
|
||||
\fBTcl_ResetResult\fR(\fIinterp\fR)
|
||||
.sp
|
||||
.VS 8.6
|
||||
@@ -152,9 +150,6 @@ extensions.
|
||||
Any number of \fIresult\fR arguments may be passed in a single
|
||||
call; the last argument in the list must be a NULL pointer.
|
||||
.PP
|
||||
\fBTcl_AppendResultVA\fR is the same as \fBTcl_AppendResult\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument list.
|
||||
.PP
|
||||
.VS 8.6
|
||||
\fBTcl_TransferResult\fR moves a result from one interpreter to another,
|
||||
optionally (dependent on the \fIresult\fR parameter) including the error
|
||||
@@ -197,19 +192,6 @@ It also sets \fIinterp->freeProc\fR to zero, but does not
|
||||
change \fIinterp->result\fR or clear error state.
|
||||
\fBTcl_FreeResult\fR is most commonly used when a procedure
|
||||
is about to replace one result value with another.
|
||||
.SS "DIRECT ACCESS TO INTERP->RESULT"
|
||||
.PP
|
||||
It used to be legal for programs to
|
||||
directly read and write \fIinterp->result\fR
|
||||
to manipulate the interpreter result. The Tcl headers no longer
|
||||
permit this access by default, and C code still doing this must
|
||||
be updated to use supported routines \fBTcl_GetObjResult\fR,
|
||||
\fBTcl_GetStringResult\fR, \fBTcl_SetObjResult\fR, and \fBTcl_SetResult\fR.
|
||||
As a migration aid, access can be restored with the compiler directive
|
||||
.CS
|
||||
#define USE_INTERP_RESULT
|
||||
.CE
|
||||
but this is meant only to offer life support to otherwise dead code.
|
||||
.SH "THE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT"
|
||||
.PP
|
||||
\fBTcl_SetResult\fR's \fIfreeProc\fR argument specifies how
|
||||
|
||||
+5
-5
@@ -20,16 +20,16 @@ int
|
||||
char *
|
||||
\fBTcl_Merge\fR(\fIargc, argv\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_ScanElement\fR(\fIsrc, flagsPtr\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_ScanCountedElement\fR(\fIsrc, length, flagsPtr\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_ConvertElement\fR(\fIsrc, dst, flags\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_ConvertCountedElement\fR(\fIsrc, length, dst, flags\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "const char *const" ***argvPtr out
|
||||
@@ -55,7 +55,7 @@ String that is to become an element of a list.
|
||||
.AP int *flagsPtr in
|
||||
Pointer to word to fill in with information about \fIsrc\fR.
|
||||
The value of *\fIflagsPtr\fR must be passed to \fBTcl_ConvertElement\fR.
|
||||
.AP int length in
|
||||
.AP size_t length in
|
||||
Number of bytes in string \fIsrc\fR.
|
||||
.AP char *dst in
|
||||
Place to copy converted list element. Must contain enough characters
|
||||
|
||||
+11
-18
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendStringsToObjVA, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
|
||||
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -59,9 +59,6 @@ void
|
||||
\fBTcl_AppendStringsToObj\fR(\fIobjPtr, string, string, ... \fB(char *) NULL\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_AppendStringsToObjVA\fR(\fIobjPtr, argList\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_AppendLimitedToObj\fR(\fIobjPtr, bytes, length, limit, ellipsis\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
@@ -90,29 +87,29 @@ Tcl_Obj *
|
||||
Points to the first byte of an array of UTF-8-encoded bytes
|
||||
used to set or append to a string value.
|
||||
This byte array may contain embedded null characters
|
||||
unless \fInumChars\fR is negative. (Applications needing null bytes
|
||||
unless \fInumChars\fR is (size_t)-1. (Applications needing null bytes
|
||||
should represent them as the two-byte sequence \fI\e700\e600\fR, use
|
||||
\fBTcl_ExternalToUtf\fR to convert, or \fBTcl_NewByteArrayObj\fR if
|
||||
the string is a collection of uninterpreted bytes.)
|
||||
.AP int length in
|
||||
.AP size_t length in
|
||||
The number of bytes to copy from \fIbytes\fR when
|
||||
initializing, setting, or appending to a string value.
|
||||
If negative, all bytes up to the first null are used.
|
||||
If (size_t)-1, all bytes up to the first null are used.
|
||||
.AP "const Tcl_UniChar" *unicode in
|
||||
Points to the first byte of an array of Unicode characters
|
||||
used to set or append to a string value.
|
||||
This byte array may contain embedded null characters
|
||||
unless \fInumChars\fR is negative.
|
||||
.AP int numChars in
|
||||
.AP size_t numChars in
|
||||
The number of Unicode characters to copy from \fIunicode\fR when
|
||||
initializing, setting, or appending to a string value.
|
||||
If negative, all characters up to the first null character are used.
|
||||
.AP int index in
|
||||
If (size_t)-1, all characters up to the first null character are used.
|
||||
.AP size_t index in
|
||||
The index of the Unicode character to return.
|
||||
.AP int first in
|
||||
.AP size_t first in
|
||||
The index of the first Unicode character in the Unicode range to be
|
||||
returned as a new value.
|
||||
.AP int last in
|
||||
.AP size_t last in
|
||||
The index of the last Unicode character in the Unicode range to be
|
||||
returned as a new value.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
@@ -127,7 +124,7 @@ Null-terminated string value to append to \fIobjPtr\fR.
|
||||
.AP va_list argList in
|
||||
An argument list which must have been initialized using
|
||||
\fBva_start\fR, and cleared using \fBva_end\fR.
|
||||
.AP int limit in
|
||||
.AP size_t limit in
|
||||
Maximum number of bytes to be appended.
|
||||
.AP "const char" *ellipsis in
|
||||
Suffix to append when the limit leads to string truncation.
|
||||
@@ -140,7 +137,7 @@ Format control string including % conversion specifiers.
|
||||
The number of elements to format or concatenate.
|
||||
.AP Tcl_Obj *objv[] in
|
||||
The array of values to format or concatenate.
|
||||
.AP int newLength in
|
||||
.AP size_t newLength in
|
||||
New length for the string value of \fIobjPtr\fR, not including the
|
||||
final null character.
|
||||
.BE
|
||||
@@ -247,10 +244,6 @@ values may contain internal null characters). Any number of
|
||||
\fIstring\fR arguments may be provided, but the last argument
|
||||
must be a NULL pointer to indicate the end of the list.
|
||||
.PP
|
||||
\fBTcl_AppendStringsToObjVA\fR is the same as \fBTcl_AppendStringsToObj\fR
|
||||
except that instead of taking a variable number of arguments it takes an
|
||||
argument list.
|
||||
.PP
|
||||
\fBTcl_AppendLimitedToObj\fR is similar to \fBTcl_AppendToObj\fR
|
||||
except that it imposes a limit on how many bytes are appended.
|
||||
This can be handy when the string to be appended might be
|
||||
|
||||
+6
-6
@@ -34,7 +34,7 @@ and the Tcl \fBmemory\fR command can be used to validate and examine
|
||||
memory usage.
|
||||
.SH "GUARD ZONES"
|
||||
.PP
|
||||
When memory debugging is enabled, whenever a call to \fBckalloc\fR is
|
||||
When memory debugging is enabled, whenever a call to \fBTcl_Alloc\fR is
|
||||
made, slightly more memory than requested is allocated so the memory
|
||||
debugging code can keep track of the allocated memory, and eight-byte
|
||||
.QW "guard zones"
|
||||
@@ -44,7 +44,7 @@ C #define \fBLOW_GUARD_SIZE\fR and #define \fBHIGH_GUARD_SIZE\fR
|
||||
in the file \fIgeneric/tclCkalloc.c\fR \(em it can
|
||||
be extended if you suspect large overwrite problems, at some cost in
|
||||
performance.) A known pattern is written into the guard zones and, on
|
||||
a call to \fBckfree\fR, the guard zones of the space being freed are
|
||||
a call to \fBTcl_Free\fR, the guard zones of the space being freed are
|
||||
checked to see if either zone has been modified in any way. If one
|
||||
has been, the guard bytes and their new contents are identified, and a
|
||||
.QW "low guard failed"
|
||||
@@ -53,7 +53,7 @@ or
|
||||
message is issued. The
|
||||
.QW "guard failed"
|
||||
message includes the address of the memory packet and
|
||||
the file name and line number of the code that called \fBckfree\fR.
|
||||
the file name and line number of the code that called \fBTcl_Free\fR.
|
||||
This allows you to detect the common sorts of one-off problems, where
|
||||
not enough space was allocated to contain the data written, for
|
||||
example.
|
||||
@@ -66,15 +66,15 @@ suspect (or know) that corruption is occurring before the Tcl
|
||||
interpreter comes up far enough for you to issue commands, you can set
|
||||
\fBMEM_VALIDATE\fR define, recompile tclCkalloc.c and rebuild Tcl.
|
||||
This will enable memory validation from the first call to
|
||||
\fBckalloc\fR, again, at a large performance impact.
|
||||
\fBTcl_Alloc\fR, again, at a large performance impact.
|
||||
.PP
|
||||
If you are desperate and validating memory on every call to
|
||||
\fBckalloc\fR and \fBckfree\fR is not enough, you can explicitly call
|
||||
\fBTcl_Alloc\fR and \fBTcl_Free\fR is not enough, you can explicitly call
|
||||
\fBTcl_ValidateAllMemory\fR directly at any point. It takes a \fIchar
|
||||
*\fR and an \fIint\fR which are normally the filename and line number
|
||||
of the caller, but they can actually be anything you want. Remember
|
||||
to remove the calls after you find the problem.
|
||||
.SH "SEE ALSO"
|
||||
ckalloc, memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
|
||||
Tcl_Alloc, memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
|
||||
.SH KEYWORDS
|
||||
memory, debug
|
||||
|
||||
+3
-3
@@ -88,7 +88,7 @@ The initial value for the checksum algorithm.
|
||||
.AP "unsigned char" *bytes in
|
||||
An array of bytes to run the checksum algorithm over, or NULL to get the
|
||||
recommended initial value for the checksum algorithm.
|
||||
.AP int length in
|
||||
.AP size_t length in
|
||||
The number of bytes in the array.
|
||||
.AP int mode in
|
||||
What mode to operate the stream in. Should be either
|
||||
@@ -107,8 +107,8 @@ if the currently compressed data must be made available for access using
|
||||
into a state where the decompressor can recover from on corruption, or
|
||||
\fBTCL_ZLIB_FINALIZE\fR to ensure that the stream is finished and that any
|
||||
trailer demanded by the format is written.
|
||||
.AP int count in
|
||||
The maximum number of bytes to get from the stream, or -1 to get all remaining
|
||||
.AP size_t count in
|
||||
The maximum number of bytes to get from the stream, or (size_t)-1 to get all remaining
|
||||
bytes from the stream's buffers.
|
||||
.AP Tcl_Obj *compDict in
|
||||
A byte array value that is the compression dictionary to use with the stream.
|
||||
|
||||
+3
-3
@@ -67,7 +67,7 @@ Id of the thread waited upon.
|
||||
.AP Tcl_ThreadCreateProc *proc in
|
||||
This procedure will act as the \fBmain()\fR of the newly created
|
||||
thread. The specified \fIclientData\fR will be its sole argument.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary information. Passed as sole argument to the \fIproc\fR.
|
||||
.AP int stackSize in
|
||||
The size of the stack given to the new thread.
|
||||
@@ -208,7 +208,7 @@ value and then finishes.
|
||||
.CS
|
||||
static \fBTcl_ThreadCreateType\fR
|
||||
MyThreadImplFunc(
|
||||
ClientData clientData)
|
||||
void *clientData)
|
||||
{
|
||||
int i, limit = (int) clientData;
|
||||
for (i=0 ; i<limit ; i++) {
|
||||
@@ -223,7 +223,7 @@ would do this:
|
||||
.PP
|
||||
.CS
|
||||
int limit = 1000000000;
|
||||
ClientData limitData = (void*)((intptr_t) limit);
|
||||
void *limitData = (void*)((intptr_t) limit);
|
||||
Tcl_ThreadId id; \fI/* holds identity of thread created */\fR
|
||||
int result;
|
||||
|
||||
|
||||
+5
-5
@@ -13,7 +13,7 @@ Tcl_CommandTraceInfo, Tcl_TraceCommand, Tcl_UntraceCommand \- monitor renames an
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_CommandTraceInfo(\fIinterp, cmdName, flags, proc, prevClientData\fB)\fR
|
||||
.sp
|
||||
int
|
||||
@@ -32,9 +32,9 @@ OR'ed collection of the values \fBTCL_TRACE_RENAME\fR and
|
||||
\fBTCL_TRACE_DELETE\fR.
|
||||
.AP Tcl_CommandTraceProc *proc in
|
||||
Procedure to call when specified operations occur to \fIcmdName\fR.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary argument to pass to \fIproc\fR.
|
||||
.AP ClientData prevClientData in
|
||||
.AP void *prevClientData in
|
||||
If non-NULL, gives last value returned by \fBTcl_CommandTraceInfo\fR,
|
||||
so this call will return information about next trace. If NULL, this
|
||||
call will return information about first trace.
|
||||
@@ -65,7 +65,7 @@ match the type \fBTcl_CommandTraceProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CommandTraceProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
const char *\fIoldName\fR,
|
||||
const char *\fInewName\fR,
|
||||
@@ -74,7 +74,7 @@ typedef void \fBTcl_CommandTraceProc\fR(
|
||||
.PP
|
||||
The \fIclientData\fR and \fIinterp\fR parameters will have the same
|
||||
values as those passed to \fBTcl_TraceCommand\fR when the trace was
|
||||
created. \fIClientData\fR typically points to an application-specific
|
||||
created. \fIclientData\fR typically points to an application-specific
|
||||
data structure that describes what to do when \fIproc\fR is invoked.
|
||||
\fIOldName\fR gives the name of the command being renamed, and
|
||||
\fInewName\fR gives the name that the command is being renamed to (or
|
||||
|
||||
+9
-9
@@ -24,13 +24,13 @@ int
|
||||
.sp
|
||||
\fBTcl_UntraceVar2(\fIinterp, name1, name2, flags, proc, clientData\fB)\fR
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_VarTraceInfo(\fIinterp, varName, flags, proc, prevClientData\fB)\fR
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_VarTraceInfo2(\fIinterp, name1, name2, flags, proc, prevClientData\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_VarTraceProc prevClientData
|
||||
.AS void *prevClientData
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter containing variable.
|
||||
.AP "const char" *varName in
|
||||
@@ -46,7 +46,7 @@ Not all flags are used by all
|
||||
procedures. See below for more information.
|
||||
.AP Tcl_VarTraceProc *proc in
|
||||
Procedure to invoke whenever one of the traced operations occurs.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.AP "const char" *name1 in
|
||||
Name of scalar or array variable (without array index).
|
||||
@@ -54,7 +54,7 @@ Name of scalar or array variable (without array index).
|
||||
For a trace on an element of an array, gives the index of the
|
||||
element. For traces on scalar variables or on whole arrays,
|
||||
is NULL.
|
||||
.AP ClientData prevClientData in
|
||||
.AP void *prevClientData in
|
||||
If non-NULL, gives last value returned by \fBTcl_VarTraceInfo\fR or
|
||||
\fBTcl_VarTraceInfo2\fR, so this call will return information about
|
||||
next trace. If NULL, this call will return information about first
|
||||
@@ -107,7 +107,7 @@ before an array set, but that will trigger write traces.
|
||||
\fBTCL_TRACE_RESULT_DYNAMIC\fR
|
||||
The result of invoking the \fIproc\fR is a dynamically allocated
|
||||
string that will be released by the Tcl library via a call to
|
||||
\fBckfree\fR. Must not be specified at the same time as
|
||||
\fBTcl_Free\fR. Must not be specified at the same time as
|
||||
\fBTCL_TRACE_RESULT_OBJECT\fR.
|
||||
.TP
|
||||
\fBTCL_TRACE_RESULT_OBJECT\fR
|
||||
@@ -124,7 +124,7 @@ It should have arguments and result that match the type
|
||||
.PP
|
||||
.CS
|
||||
typedef char *\fBTcl_VarTraceProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
char *\fIname1\fR,
|
||||
char *\fIname2\fR,
|
||||
@@ -134,7 +134,7 @@ typedef char *\fBTcl_VarTraceProc\fR(
|
||||
The \fIclientData\fR and \fIinterp\fR parameters will
|
||||
have the same values as those passed to \fBTcl_TraceVar\fR when the
|
||||
trace was created.
|
||||
\fIClientData\fR typically points to an application-specific
|
||||
\fIclientData\fR typically points to an application-specific
|
||||
data structure that describes what to do when \fIproc\fR
|
||||
is invoked.
|
||||
\fIName1\fR and \fIname2\fR give the name of the traced variable
|
||||
@@ -312,7 +312,7 @@ The return value must be a pointer to a static character string
|
||||
containing an error message,
|
||||
unless (\fIexactly\fR one of) the \fBTCL_TRACE_RESULT_DYNAMIC\fR and
|
||||
\fBTCL_TRACE_RESULT_OBJECT\fR flags is set, which specify that the result is
|
||||
either a dynamic string (to be released with \fBckfree\fR) or a
|
||||
either a dynamic string (to be released with \fBTcl_Free\fR) or a
|
||||
Tcl_Obj* (cast to char* and to be released with
|
||||
\fBTcl_DecrRefCount\fR) containing the error message.
|
||||
If a trace procedure returns an error, no further traces are
|
||||
|
||||
@@ -31,19 +31,19 @@ int
|
||||
\fBTcl_UniCharLen\fR(\fIuniStr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UniCharNcmp\fR(\fIucs, uct, numChars\fR)
|
||||
\fBTcl_UniCharNcmp\fR(\fIucs, uct, uniLength\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UniCharNcasecmp\fR(\fIucs, uct, numChars\fR)
|
||||
\fBTcl_UniCharNcasecmp\fR(\fIucs, uct, uniLength\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UniCharCaseMatch\fR(\fIuniStr, uniPattern, nocase\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UtfNcmp\fR(\fIcs, ct, numChars\fR)
|
||||
\fBTcl_UtfNcmp\fR(\fIcs, ct, length\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UtfNcasecmp\fR(\fIcs, ct, numChars\fR)
|
||||
\fBTcl_UtfNcasecmp\fR(\fIcs, ct, length\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UtfCharComplete\fR(\fIsrc, length\fR)
|
||||
@@ -69,7 +69,7 @@ int
|
||||
const char *
|
||||
\fBTcl_UtfAtIndex\fR(\fIsrc, index\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_UtfBackslash\fR(\fIsrc, readPtr, dst\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "const Tcl_UniChar" *uniPattern in/out
|
||||
@@ -94,19 +94,16 @@ A null-terminated Unicode string.
|
||||
A null-terminated Unicode string.
|
||||
.AP "const Tcl_UniChar" *uniPattern in
|
||||
A null-terminated Unicode string.
|
||||
.AP int length in
|
||||
.AP size_t length in
|
||||
The length of the UTF-8 string in bytes (not UTF-8 characters). If
|
||||
negative, all bytes up to the first null byte are used.
|
||||
.AP int uniLength in
|
||||
The length of the Unicode string in characters. Must be greater than or
|
||||
equal to 0.
|
||||
(size_t)-1, all bytes up to the first null byte are used.
|
||||
.AP size_t uniLength in
|
||||
The length of the Unicode string in characters.
|
||||
.AP "Tcl_DString" *dsPtr in/out
|
||||
A pointer to a previously initialized \fBTcl_DString\fR.
|
||||
.AP "unsigned long" numChars in
|
||||
The number of characters to compare.
|
||||
.AP "const char" *start in
|
||||
Pointer to the beginning of a UTF-8 string.
|
||||
.AP int index in
|
||||
.AP size_t index in
|
||||
The index of a character (not byte) in the UTF-8 string.
|
||||
.AP int *readPtr out
|
||||
If non-NULL, filled with the number of bytes in the backslash sequence,
|
||||
@@ -175,7 +172,7 @@ the number of Unicode characters (not bytes) in that string.
|
||||
\fBTcl_UniCharNcmp\fR and \fBTcl_UniCharNcasecmp\fR correspond to
|
||||
\fBstrncmp\fR and \fBstrncasecmp\fR, respectively, for Unicode characters.
|
||||
They accept two null-terminated Unicode strings and the number of characters
|
||||
to compare. Both strings are assumed to be at least \fInumChars\fR characters
|
||||
to compare. Both strings are assumed to be at least \fIuniLength\fR characters
|
||||
long. \fBTcl_UniCharNcmp\fR compares the two strings character-by-character
|
||||
according to the Unicode character ordering. It returns an integer greater
|
||||
than, equal to, or less than 0 if the first string is greater than, equal
|
||||
@@ -189,7 +186,7 @@ be case sensitive and returns whether the string matches the pattern.
|
||||
.PP
|
||||
\fBTcl_UtfNcmp\fR corresponds to \fBstrncmp\fR for UTF-8 strings. It
|
||||
accepts two null-terminated UTF-8 strings and the number of characters
|
||||
to compare. (Both strings are assumed to be at least \fInumChars\fR
|
||||
to compare. (Both strings are assumed to be at least \fIlength\fR
|
||||
characters long.) \fBTcl_UtfNcmp\fR compares the two strings
|
||||
character-by-character according to the Unicode character ordering.
|
||||
It returns an integer greater than, equal to, or less than 0 if the
|
||||
@@ -241,12 +238,12 @@ return value will be \fIstart\fR.
|
||||
Pascal Ord() function. It returns the Tcl_UniChar represented at the
|
||||
specified character (not byte) \fIindex\fR in the UTF-8 string
|
||||
\fIsrc\fR. The source string must contain at least \fIindex\fR
|
||||
characters. Behavior is undefined if a negative \fIindex\fR is given.
|
||||
characters.
|
||||
.PP
|
||||
\fBTcl_UtfAtIndex\fR returns a pointer to the specified character (not
|
||||
byte) \fIindex\fR in the UTF-8 string \fIsrc\fR. The source string must
|
||||
contain at least \fIindex\fR characters. This is equivalent to calling
|
||||
\fBTcl_UtfNext\fR \fIindex\fR times. If a negative \fIindex\fR is given,
|
||||
\fBTcl_UtfNext\fR \fIindex\fR times. If \fIindex\fR is (size_t)-1,
|
||||
the return pointer points to the first character in the source string.
|
||||
.PP
|
||||
\fBTcl_UtfBackslash\fR is a utility procedure used by several of the Tcl
|
||||
|
||||
-60
@@ -1,60 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH case n 7.0 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
case \- Evaluate one of several scripts, depending on a given value
|
||||
.SH SYNOPSIS
|
||||
\fBcase\fI string \fR?\fBin\fR? \fIpatList body \fR?\fIpatList body \fR...?
|
||||
.sp
|
||||
\fBcase\fI string \fR?\fBin\fR? {\fIpatList body \fR?\fIpatList body \fR...?}
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fINote: the \fBcase\fI command is obsolete and is supported only
|
||||
for backward compatibility. At some point in the future it may be
|
||||
removed entirely. You should use the \fBswitch\fI command instead.\fR
|
||||
.PP
|
||||
The \fBcase\fR command matches \fIstring\fR against each of
|
||||
the \fIpatList\fR arguments in order.
|
||||
Each \fIpatList\fR argument is a list of one or
|
||||
more patterns. If any of these patterns matches \fIstring\fR then
|
||||
\fBcase\fR evaluates the following \fIbody\fR argument
|
||||
by passing it recursively to the Tcl interpreter and returns the result
|
||||
of that evaluation.
|
||||
Each \fIpatList\fR argument consists of a single
|
||||
pattern or list of patterns. Each pattern may contain any of the wild-cards
|
||||
described under \fBstring match\fR. If a \fIpatList\fR
|
||||
argument is \fBdefault\fR, the corresponding body will be evaluated
|
||||
if no \fIpatList\fR matches \fIstring\fR. If no \fIpatList\fR argument
|
||||
matches \fIstring\fR and no default is given, then the \fBcase\fR
|
||||
command returns an empty string.
|
||||
.PP
|
||||
Two syntaxes are provided for the \fIpatList\fR and \fIbody\fR arguments.
|
||||
The first uses a separate argument for each of the patterns and commands;
|
||||
this form is convenient if substitutions are desired on some of the
|
||||
patterns or commands.
|
||||
The second form places all of the patterns and commands together into
|
||||
a single argument; the argument must have proper list structure, with
|
||||
the elements of the list being the patterns and commands.
|
||||
The second form makes it easy to construct multi-line case commands,
|
||||
since the braces around the whole list make it unnecessary to include a
|
||||
backslash at the end of each line.
|
||||
Since the \fIpatList\fR arguments are in braces in the second form,
|
||||
no command or variable substitutions are performed on them; this makes
|
||||
the behavior of the second form different than the first form in some
|
||||
cases.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
switch(n)
|
||||
|
||||
.SH KEYWORDS
|
||||
case, match, regular expression
|
||||
+1
-1
@@ -528,7 +528,7 @@ for reading from slots is via \fBinfo class\fR and \fBinfo object\fR).
|
||||
.SH EXAMPLES
|
||||
This example demonstrates how to use both forms of the \fBoo::define\fR and
|
||||
\fBoo::objdefine\fR commands (they work in the same way), as well as
|
||||
illustrating four of the subcommands of them.
|
||||
illustrating four of their subcommands.
|
||||
.PP
|
||||
.CS
|
||||
oo::class create c
|
||||
|
||||
+1
-3
@@ -50,9 +50,7 @@ An integer operand may be specified in decimal (the normal case, the optional
|
||||
first two characters are \fB0d\fR), binary
|
||||
(the first two characters are \fB0b\fR), octal
|
||||
(the first two characters are \fB0o\fR), or hexadecimal
|
||||
(the first two characters are \fB0x\fR) form. For
|
||||
compatibility with older Tcl releases, an operand that begins with \fB0\fR is
|
||||
interpreted as an octal integer even if the second character is not \fBo\fR.
|
||||
(the first two characters are \fB0x\fR) form.
|
||||
A floating-point number may be specified in any of several
|
||||
common decimal formats, and may use the decimal point \fB.\fR,
|
||||
\fBe\fR or \fBE\fR for scientific notation, and
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ The following is a minimal extension:
|
||||
.CS
|
||||
#include <tcl.h>
|
||||
#include <stdio.h>
|
||||
static int fooCmd(ClientData clientData,
|
||||
static int fooCmd(void *clientData,
|
||||
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) {
|
||||
printf("called with %d arguments\en", objc);
|
||||
return TCL_OK;
|
||||
|
||||
+1
-4
@@ -106,10 +106,7 @@ of which work solely with floating-point numbers unless otherwise noted:
|
||||
In addition to these predefined functions, applications may
|
||||
define additional functions by using \fBproc\fR (or any other method,
|
||||
such as \fBinterp alias\fR or \fBTcl_CreateObjCommand\fR) to define
|
||||
new commands in the \fBtcl::mathfunc\fR namespace. In addition, an
|
||||
obsolete interface named \fBTcl_CreateMathFunc\fR() is available to
|
||||
extensions that are written in C. The latter interface is not recommended
|
||||
for new implementations.
|
||||
new commands in the \fBtcl::mathfunc\fR namespace.
|
||||
.SS "DETAILED DEFINITIONS"
|
||||
.TP
|
||||
\fBabs \fIarg\fR
|
||||
|
||||
+16
-16
@@ -25,7 +25,7 @@ Write a list of all currently allocated memory to the specified \fIfile\fR.
|
||||
.TP
|
||||
\fBmemory break_on_malloc\fR \fIcount\fR
|
||||
.
|
||||
After the \fIcount\fR allocations have been performed, \fBckalloc\fR
|
||||
After the \fIcount\fR allocations have been performed, \fBTcl_Alloc\fR
|
||||
outputs a message to this effect and that it is now attempting to enter
|
||||
the C debugger. Tcl will then issue a \fISIGINT\fR signal against itself.
|
||||
If you are running Tcl under a C debugger, it should then enter the debugger
|
||||
@@ -35,8 +35,8 @@ command mode.
|
||||
.
|
||||
Returns a report containing the total allocations and frees since
|
||||
Tcl began, the current packets allocated (the current
|
||||
number of calls to \fBckalloc\fR not met by a corresponding call
|
||||
to \fBckfree\fR), the current bytes allocated, and the maximum number
|
||||
number of calls to \fBTcl_Alloc\fR not met by a corresponding call
|
||||
to \fBTcl_Free\fR), the current bytes allocated, and the maximum number
|
||||
of packets and bytes allocated.
|
||||
.TP
|
||||
\fBmemory init \fR[\fBon\fR|\fBoff\fR]
|
||||
@@ -59,34 +59,34 @@ that memory is properly cleaned up during process exit.
|
||||
.TP
|
||||
\fBmemory tag\fR \fIstring\fR
|
||||
.
|
||||
Each packet of memory allocated by \fBckalloc\fR can have associated
|
||||
Each packet of memory allocated by \fBTcl_Alloc\fR can have associated
|
||||
with it a string-valued tag. In the lists of allocated memory generated
|
||||
by \fBmemory active\fR and \fBmemory onexit\fR, the tag for each packet
|
||||
is printed along with other information about the packet. The
|
||||
\fBmemory tag\fR command sets the tag value for subsequent calls
|
||||
to \fBckalloc\fR to be \fIstring\fR.
|
||||
to \fBTcl_Alloc\fR to be \fIstring\fR.
|
||||
.TP
|
||||
\fBmemory trace \fR[\fBon\fR|\fBoff\fR]
|
||||
.
|
||||
Turns memory tracing on or off. When memory tracing is on, every call
|
||||
to \fBckalloc\fR causes a line of trace information to be written to
|
||||
\fIstderr\fR, consisting of the word \fIckalloc\fR, followed by the
|
||||
to \fBTcl_Alloc\fR causes a line of trace information to be written to
|
||||
\fIstderr\fR, consisting of the word \fITcl_Alloc\fR, followed by the
|
||||
address returned, the amount of memory allocated, and the C filename
|
||||
and line number of the code performing the allocation. For example:
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
ckalloc 40e478 98 tclProc.c 1406
|
||||
Tcl_Alloc 40e478 98 tclProc.c 1406
|
||||
.CE
|
||||
.PP
|
||||
Calls to \fBckfree\fR are traced in the same manner.
|
||||
Calls to \fBTcl_Free\fR are traced in the same manner.
|
||||
.RE
|
||||
.TP
|
||||
\fBmemory trace_on_at_malloc\fR \fIcount\fR
|
||||
.
|
||||
Enable memory tracing after \fIcount\fR \fBckalloc\fRs have been performed.
|
||||
Enable memory tracing after \fIcount\fR \fBTcl_Alloc\fRs have been performed.
|
||||
For example, if you enter \fBmemory trace_on_at_malloc 100\fR,
|
||||
after the 100th call to \fBckalloc\fR, memory trace information will begin
|
||||
after the 100th call to \fBTcl_Alloc\fR, memory trace information will begin
|
||||
being displayed for all allocations and frees. Since there can be a lot
|
||||
of memory activity before a problem occurs, judicious use of this option
|
||||
can reduce the slowdown caused by tracing (and the amount of trace information
|
||||
@@ -97,17 +97,17 @@ occurred since Tcl started is printed on a guard zone failure.
|
||||
\fBmemory validate \fR[\fBon\fR|\fBoff\fR]
|
||||
.
|
||||
Turns memory validation on or off. When memory validation is enabled,
|
||||
on every call to \fBckalloc\fR or \fBckfree\fR, the guard zones are
|
||||
on every call to \fBTcl_Alloc\fR or \fBTcl_Free\fR, the guard zones are
|
||||
checked for every piece of memory currently in existence that was
|
||||
allocated by \fBckalloc\fR. This has a large performance impact and
|
||||
allocated by \fBTcl_Alloc\fR. This has a large performance impact and
|
||||
should only be used when overwrite problems are strongly suspected.
|
||||
The advantage of enabling memory validation is that a guard zone
|
||||
overwrite can be detected on the first call to \fBckalloc\fR or
|
||||
\fBckfree\fR after the overwrite occurred, rather than when the
|
||||
overwrite can be detected on the first call to \fBTcl_Alloc\fR or
|
||||
\fBTcl_Free\fR after the overwrite occurred, rather than when the
|
||||
specific memory with the overwritten guard zone(s) is freed, which may
|
||||
occur long after the overwrite occurred.
|
||||
.SH "SEE ALSO"
|
||||
ckalloc, ckfree, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory, TCL_MEM_DEBUG
|
||||
Tcl_Alloc, Tcl_Free, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory, TCL_MEM_DEBUG
|
||||
.SH KEYWORDS
|
||||
memory, debug
|
||||
'\"Local Variables:
|
||||
|
||||
+1
-1
@@ -375,7 +375,7 @@ value of \fBU+\fI10ffff\fR.
|
||||
.TP
|
||||
\fB\ev\fR
|
||||
.
|
||||
vertical tab, as in C are all available.
|
||||
vertical tab, as in C
|
||||
.TP
|
||||
\fB\ex\fIhh\fR
|
||||
.
|
||||
|
||||
+2
-4
@@ -224,12 +224,10 @@ set string "#08D03F"
|
||||
\fBscan\fR $string "#%2x%2x%2x" r g b
|
||||
.CE
|
||||
.PP
|
||||
Parse a \fIHH:MM\fR time string, noting that this avoids problems with
|
||||
octal numbers by forcing interpretation as decimals (if we did not
|
||||
care, we would use the \fB%i\fR conversion instead):
|
||||
Parse a \fIHH:MM\fR time string:
|
||||
.PP
|
||||
.CS
|
||||
set string "08:08" ;# *Not* octal!
|
||||
set string "08:08"
|
||||
if {[\fBscan\fR $string "%d:%d" hours minutes] != 2} {
|
||||
error "not a valid time string"
|
||||
}
|
||||
|
||||
+1
-65
@@ -10,7 +10,7 @@
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
argc, argv, argv0, auto_path, env, errorCode, errorInfo, tcl_interactive, tcl_library, tcl_nonwordchars, tcl_patchLevel, tcl_pkgPath, tcl_platform, tcl_precision, tcl_rcFileName, tcl_traceCompile, tcl_traceExec, tcl_wordchars, tcl_version \- Variables used by Tcl
|
||||
argc, argv, argv0, auto_path, env, errorCode, errorInfo, tcl_interactive, tcl_library, tcl_nonwordchars, tcl_patchLevel, tcl_pkgPath, tcl_platform, tcl_rcFileName, tcl_traceCompile, tcl_traceExec, tcl_wordchars, tcl_version \- Variables used by Tcl
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
@@ -356,70 +356,6 @@ This gives the size of the native-machine word in bytes (strictly, it
|
||||
is same as the result of evaluating \fIsizeof(long)\fR in C.)
|
||||
.RE
|
||||
.TP
|
||||
\fBtcl_precision\fR
|
||||
.
|
||||
This variable controls the number of digits to generate
|
||||
when converting floating-point values to strings. It defaults
|
||||
to 0. \fIApplications should not change this value;\fR it is
|
||||
provided for compatibility with legacy code.
|
||||
.PP
|
||||
.RS
|
||||
The default value of 0 is special, meaning that Tcl should
|
||||
convert numbers using as few digits as possible while still
|
||||
distinguishing any floating point number from its nearest
|
||||
neighbours. It differs from using an arbitrarily high value
|
||||
for \fItcl_precision\fR in that an inexact number like \fI1.4\fR
|
||||
will convert as \fI1.4\fR rather than \fI1.3999999999999999\fR
|
||||
even though the latter is nearer to the exact value of the
|
||||
binary number.
|
||||
.RE
|
||||
.PP
|
||||
.RS
|
||||
If \fBtcl_precision\fR is not zero, then when Tcl converts a floating
|
||||
point number, it creates a decimal representation of at most
|
||||
\fBtcl_precision\fR significant digits; the result may be shorter if
|
||||
the shorter result represents the original number exactly. If no
|
||||
result of at most \fBtcl_precision\fR digits is an exact representation
|
||||
of the original number, the one that is closest to the original
|
||||
number is chosen.
|
||||
If the original number lies precisely between two equally accurate
|
||||
decimal representations, then the one with an even value for the least
|
||||
significant digit is chosen; for instance, if \fBtcl_precision\fR is 3, then
|
||||
0.3125 will convert to 0.312, not 0.313, while 0.6875 will convert to
|
||||
0.688, not 0.687. Any string of trailing zeroes that remains is trimmed.
|
||||
.RE
|
||||
.PP
|
||||
.RS
|
||||
a \fBtcl_precision\fR value of 17 digits is
|
||||
.QW perfect
|
||||
for IEEE floating-point in that it allows
|
||||
double-precision values to be converted to strings and back to
|
||||
binary with no loss of information. For this reason, you will often
|
||||
see it as a value in legacy code that must run on Tcl versions before
|
||||
8.5. It is no longer recommended; as noted above, a zero value is the
|
||||
preferred method.
|
||||
.RE
|
||||
.PP
|
||||
.RS
|
||||
All interpreters in a thread share a single \fBtcl_precision\fR value:
|
||||
changing it in one interpreter will affect all other interpreters as
|
||||
well. Safe interpreters are not allowed to modify the
|
||||
variable.
|
||||
.RE
|
||||
.PP
|
||||
.RS
|
||||
Valid values for \fBtcl_precision\fR range from 0 to 17.
|
||||
.RE
|
||||
.TP
|
||||
\fBtcl_rcFileName\fR
|
||||
.
|
||||
This variable is used during initialization to indicate the name of a
|
||||
user-specific startup file. If it is set by application-specific
|
||||
initialization, then the Tcl startup code will check for the existence
|
||||
of this file and \fBsource\fR it if it exists. For example, for \fBwish\fR
|
||||
the variable is set to \fB~/.wishrc\fR for Unix and \fB~/wishrc.tcl\fR
|
||||
for Windows.
|
||||
.TP
|
||||
\fBtcl_traceCompile\fR
|
||||
.
|
||||
The value of this variable can be set to control
|
||||
|
||||
@@ -828,7 +828,7 @@ element(
|
||||
*/
|
||||
|
||||
Tcl_DStringInit(&ds);
|
||||
np = Tcl_UniCharToUtfDString(startp, (int)len, &ds);
|
||||
np = Tcl_UniCharToUtfDString(startp, len, &ds);
|
||||
for (cn=cnames; cn->name!=NULL; cn++) {
|
||||
if (strlen(cn->name)==len && strncmp(cn->name, np, len)==0) {
|
||||
break; /* NOTE BREAK OUT */
|
||||
@@ -1000,7 +1000,7 @@ cclass(
|
||||
|
||||
len = endp - startp;
|
||||
Tcl_DStringInit(&ds);
|
||||
np = Tcl_UniCharToUtfDString(startp, (int)len, &ds);
|
||||
np = Tcl_UniCharToUtfDString(startp, len, &ds);
|
||||
|
||||
/*
|
||||
* Map the name to the corresponding enumerated value.
|
||||
|
||||
+3
-3
@@ -36,9 +36,9 @@
|
||||
* Overrides for regguts.h definitions, if any.
|
||||
*/
|
||||
|
||||
#define MALLOC(n) (void*)(attemptckalloc(n))
|
||||
#define FREE(p) ckfree((void*)(p))
|
||||
#define REALLOC(p,n) (void*)(attemptckrealloc((void*)(p),n))
|
||||
#define MALLOC(n) Tcl_AttemptAlloc(n)
|
||||
#define FREE(p) Tcl_Free(p)
|
||||
#define REALLOC(p,n) Tcl_AttemptRealloc(p,n)
|
||||
|
||||
/*
|
||||
* Do not insert extras between the "begin" and "end" lines - this chunk is
|
||||
|
||||
+359
-314
File diff suppressed because it is too large
Load Diff
+122
-332
@@ -52,30 +52,15 @@ extern "C" {
|
||||
* tools/tcl.hpj.in (not patchlevel, for windows installer)
|
||||
*/
|
||||
|
||||
#define TCL_MAJOR_VERSION 8
|
||||
#define TCL_MINOR_VERSION 7
|
||||
#define TCL_MAJOR_VERSION 9
|
||||
#define TCL_MINOR_VERSION 0
|
||||
#define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE
|
||||
#define TCL_RELEASE_SERIAL 2
|
||||
#define TCL_RELEASE_SERIAL 0
|
||||
|
||||
#define TCL_VERSION "8.7"
|
||||
#define TCL_PATCH_LEVEL "8.7a2"
|
||||
#define TCL_VERSION "9.0"
|
||||
#define TCL_PATCH_LEVEL "9.0a0"
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) || defined(RC_INVOKED)
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* The following definitions set up the proper options for Windows compilers.
|
||||
* We use this method because there is no autoconf equivalent.
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifndef __WIN32__
|
||||
# define __WIN32__
|
||||
# endif
|
||||
# ifndef WIN32
|
||||
# define WIN32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(RC_INVOKED)
|
||||
/*
|
||||
* Utility macros: STRINGIFY takes an argument and wraps it in "" (double
|
||||
* quotation marks), JOIN joins two arguments.
|
||||
@@ -89,11 +74,7 @@ extern "C" {
|
||||
# define JOIN(a,b) JOIN1(a,b)
|
||||
# define JOIN1(a,b) a##b
|
||||
#endif
|
||||
|
||||
#ifndef TCL_THREADS
|
||||
# define TCL_THREADS 1
|
||||
#endif
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
#endif /* RC_INVOKED */
|
||||
|
||||
/*
|
||||
* A special definition used to allow this header file to be included from
|
||||
@@ -124,32 +105,11 @@ extern "C" {
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* Support for functions with a variable number of arguments.
|
||||
*
|
||||
* The following TCL_VARARGS* macros are to support old extensions
|
||||
* written for older versions of Tcl where the macros permitted
|
||||
* support for the varargs.h system as well as stdarg.h .
|
||||
*
|
||||
* New code should just directly be written to use stdarg.h conventions.
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
# define TCL_VARARGS(type, name) (type name, ...)
|
||||
# define TCL_VARARGS_DEF(type, name) (type name, ...)
|
||||
# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
#if defined(__GNUC__) && (__GNUC__ > 2)
|
||||
# define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b)))
|
||||
# define TCL_NORETURN __attribute__ ((noreturn))
|
||||
# define TCL_NOINLINE __attribute__ ((noinline))
|
||||
# if defined(BUILD_tcl) || defined(BUILD_tk)
|
||||
# define TCL_NORETURN1 __attribute__ ((noreturn))
|
||||
# else
|
||||
# define TCL_NORETURN1 /* nothing */
|
||||
# endif
|
||||
# define TCL_NORETURN1 __attribute__ ((noreturn))
|
||||
#else
|
||||
# define TCL_FORMAT_PRINTF(a,b)
|
||||
# if defined(_MSC_VER) && (_MSC_VER >= 1310)
|
||||
@@ -245,33 +205,7 @@ extern "C" {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following _ANSI_ARGS_ macro is to support old extensions
|
||||
* written for older versions of Tcl where it permitted support
|
||||
* for compilers written in the pre-prototype era of C.
|
||||
*
|
||||
* New code should use prototypes.
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
# undef _ANSI_ARGS_
|
||||
# define _ANSI_ARGS_(x) x
|
||||
|
||||
/*
|
||||
* Definitions that allow this header file to be used either with or without
|
||||
* ANSI C features.
|
||||
*/
|
||||
|
||||
#ifndef INLINE
|
||||
# define INLINE
|
||||
#endif
|
||||
#ifndef CONST
|
||||
# define CONST const
|
||||
#endif
|
||||
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
#ifndef CONST86
|
||||
#if !defined(CONST86) && !defined(TCL_NO_DEPRECATED)
|
||||
# define CONST86 const
|
||||
#endif
|
||||
|
||||
@@ -289,41 +223,11 @@ extern "C" {
|
||||
# define EXTERN extern TCL_STORAGE_CLASS
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* The following code is copied from winnt.h. If we don't replicate it here,
|
||||
* then <windows.h> can't be included after tcl.h, since tcl.h also defines
|
||||
* VOID. This block is skipped under Cygwin and Mingw.
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
#if defined(_WIN32) && !defined(HAVE_WINNT_IGNORE_VOID)
|
||||
#ifndef VOID
|
||||
#define VOID void
|
||||
typedef char CHAR;
|
||||
typedef short SHORT;
|
||||
typedef long LONG;
|
||||
#endif
|
||||
#endif /* _WIN32 && !HAVE_WINNT_IGNORE_VOID */
|
||||
|
||||
/*
|
||||
* Macro to use instead of "void" for arguments that must have type "void *"
|
||||
* in ANSI C; maps them to type "char *" in non-ANSI systems.
|
||||
*/
|
||||
|
||||
#ifndef __VXWORKS__
|
||||
# define VOID void
|
||||
#endif
|
||||
#endif /* !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 */
|
||||
|
||||
/*
|
||||
* Miscellaneous declarations.
|
||||
*/
|
||||
|
||||
#ifndef _CLIENTDATA
|
||||
typedef void *ClientData;
|
||||
# define _CLIENTDATA
|
||||
#endif
|
||||
typedef void *ClientData;
|
||||
|
||||
/*
|
||||
* Darwin specific configure overrides (to support fat compiles, where
|
||||
@@ -460,17 +364,7 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
|
||||
* accessed with Tcl_GetObjResult() and Tcl_SetObjResult().
|
||||
*/
|
||||
|
||||
typedef struct Tcl_Interp
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
{
|
||||
/* TIP #330: Strongly discourage extensions from using the string
|
||||
* result. */
|
||||
char *resultDontUse; /* Don't use in extensions! */
|
||||
void (*freeProcDontUse) (char *); /* Don't use in extensions! */
|
||||
int errorLineDontUse; /* Don't use in extensions! */
|
||||
}
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
Tcl_Interp;
|
||||
typedef struct Tcl_Interp Tcl_Interp;
|
||||
|
||||
typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;
|
||||
typedef struct Tcl_Channel_ *Tcl_Channel;
|
||||
@@ -501,9 +395,9 @@ typedef struct Tcl_ZLibStream_ *Tcl_ZlibStream;
|
||||
*/
|
||||
|
||||
#if defined _WIN32
|
||||
typedef unsigned (__stdcall Tcl_ThreadCreateProc) (ClientData clientData);
|
||||
typedef unsigned (__stdcall Tcl_ThreadCreateProc) (void *clientData);
|
||||
#else
|
||||
typedef void (Tcl_ThreadCreateProc) (ClientData clientData);
|
||||
typedef void (Tcl_ThreadCreateProc) (void *clientData);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -619,10 +513,6 @@ typedef struct stat *Tcl_OldStat_;
|
||||
#define TCL_BREAK 3
|
||||
#define TCL_CONTINUE 4
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
#define TCL_RESULT_SIZE 200
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* Flags to control what substitutions are performed by Tcl_SubstObj():
|
||||
@@ -633,27 +523,6 @@ typedef struct stat *Tcl_OldStat_;
|
||||
#define TCL_SUBST_BACKSLASHES 004
|
||||
#define TCL_SUBST_ALL 007
|
||||
|
||||
/*
|
||||
* Argument descriptors for math function callbacks in expressions:
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
typedef enum {
|
||||
TCL_INT, TCL_DOUBLE, TCL_EITHER, TCL_WIDE_INT
|
||||
} Tcl_ValueType;
|
||||
|
||||
typedef struct Tcl_Value {
|
||||
Tcl_ValueType type; /* Indicates intValue or doubleValue is valid,
|
||||
* or both. */
|
||||
long intValue; /* Integer value. */
|
||||
double doubleValue; /* Double-precision floating value. */
|
||||
Tcl_WideInt wideValue; /* Wide (min. 64-bit) integer value. */
|
||||
} Tcl_Value;
|
||||
#else
|
||||
#define Tcl_ValueType void /* Just enough to prevent compilation error in Tcl */
|
||||
#define Tcl_Value void /* Just enough to prevent compilation error in Tcl */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Forward declaration of Tcl_Obj to prevent an error when the forward
|
||||
* reference to Tcl_Obj is encountered in the function types declared below.
|
||||
@@ -667,62 +536,60 @@ struct Tcl_Obj;
|
||||
*/
|
||||
|
||||
typedef int (Tcl_AppInitProc) (Tcl_Interp *interp);
|
||||
typedef int (Tcl_AsyncProc) (ClientData clientData, Tcl_Interp *interp,
|
||||
typedef int (Tcl_AsyncProc) (void *clientData, Tcl_Interp *interp,
|
||||
int code);
|
||||
typedef void (Tcl_ChannelProc) (ClientData clientData, int mask);
|
||||
typedef void (Tcl_CloseProc) (ClientData data);
|
||||
typedef void (Tcl_CmdDeleteProc) (ClientData clientData);
|
||||
typedef int (Tcl_CmdProc) (ClientData clientData, Tcl_Interp *interp,
|
||||
typedef void (Tcl_ChannelProc) (void *clientData, int mask);
|
||||
typedef void (Tcl_CloseProc) (void *data);
|
||||
typedef void (Tcl_CmdDeleteProc) (void *clientData);
|
||||
typedef int (Tcl_CmdProc) (void *clientData, Tcl_Interp *interp,
|
||||
int argc, const char *argv[]);
|
||||
typedef void (Tcl_CmdTraceProc) (ClientData clientData, Tcl_Interp *interp,
|
||||
typedef void (Tcl_CmdTraceProc) (void *clientData, Tcl_Interp *interp,
|
||||
int level, char *command, Tcl_CmdProc *proc,
|
||||
ClientData cmdClientData, int argc, const char *argv[]);
|
||||
typedef int (Tcl_CmdObjTraceProc) (ClientData clientData, Tcl_Interp *interp,
|
||||
void *cmdClientData, int argc, const char *argv[]);
|
||||
typedef int (Tcl_CmdObjTraceProc) (void *clientData, Tcl_Interp *interp,
|
||||
int level, const char *command, Tcl_Command commandInfo, int objc,
|
||||
struct Tcl_Obj *const *objv);
|
||||
typedef void (Tcl_CmdObjTraceDeleteProc) (ClientData clientData);
|
||||
typedef void (Tcl_CmdObjTraceDeleteProc) (void *clientData);
|
||||
typedef void (Tcl_DupInternalRepProc) (struct Tcl_Obj *srcPtr,
|
||||
struct Tcl_Obj *dupPtr);
|
||||
typedef int (Tcl_EncodingConvertProc) (ClientData clientData, const char *src,
|
||||
typedef int (Tcl_EncodingConvertProc) (void *clientData, const char *src,
|
||||
int srcLen, int flags, Tcl_EncodingState *statePtr, char *dst,
|
||||
int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr);
|
||||
typedef void (Tcl_EncodingFreeProc) (ClientData clientData);
|
||||
#define Tcl_EncodingFreeProc Tcl_FreeProc
|
||||
typedef int (Tcl_EventProc) (Tcl_Event *evPtr, int flags);
|
||||
typedef void (Tcl_EventCheckProc) (ClientData clientData, int flags);
|
||||
typedef int (Tcl_EventDeleteProc) (Tcl_Event *evPtr, ClientData clientData);
|
||||
typedef void (Tcl_EventSetupProc) (ClientData clientData, int flags);
|
||||
typedef void (Tcl_ExitProc) (ClientData clientData);
|
||||
typedef void (Tcl_FileProc) (ClientData clientData, int mask);
|
||||
typedef void (Tcl_FileFreeProc) (ClientData clientData);
|
||||
typedef void (Tcl_EventCheckProc) (void *clientData, int flags);
|
||||
typedef int (Tcl_EventDeleteProc) (Tcl_Event *evPtr, void *clientData);
|
||||
typedef void (Tcl_EventSetupProc) (void *clientData, int flags);
|
||||
#define Tcl_ExitProc Tcl_FreeProc
|
||||
typedef void (Tcl_FileProc) (void *clientData, int mask);
|
||||
#define Tcl_FileFreeProc Tcl_FreeProc
|
||||
typedef void (Tcl_FreeInternalRepProc) (struct Tcl_Obj *objPtr);
|
||||
typedef void (Tcl_FreeProc) (char *blockPtr);
|
||||
typedef void (Tcl_IdleProc) (ClientData clientData);
|
||||
typedef void (Tcl_InterpDeleteProc) (ClientData clientData,
|
||||
typedef void (Tcl_FreeProc) (void *blockPtr);
|
||||
typedef void (Tcl_IdleProc) (void *clientData);
|
||||
typedef void (Tcl_InterpDeleteProc) (void *clientData,
|
||||
Tcl_Interp *interp);
|
||||
typedef int (Tcl_MathProc) (ClientData clientData, Tcl_Interp *interp,
|
||||
Tcl_Value *args, Tcl_Value *resultPtr);
|
||||
typedef void (Tcl_NamespaceDeleteProc) (ClientData clientData);
|
||||
typedef int (Tcl_ObjCmdProc) (ClientData clientData, Tcl_Interp *interp,
|
||||
typedef void (Tcl_NamespaceDeleteProc) (void *clientData);
|
||||
typedef int (Tcl_ObjCmdProc) (void *clientData, Tcl_Interp *interp,
|
||||
int objc, struct Tcl_Obj *const *objv);
|
||||
typedef int (Tcl_PackageInitProc) (Tcl_Interp *interp);
|
||||
typedef int (Tcl_PackageUnloadProc) (Tcl_Interp *interp, int flags);
|
||||
typedef void (Tcl_PanicProc) (const char *format, ...);
|
||||
typedef void (Tcl_TcpAcceptProc) (ClientData callbackData, Tcl_Channel chan,
|
||||
typedef void (Tcl_TcpAcceptProc) (void *callbackData, Tcl_Channel chan,
|
||||
char *address, int port);
|
||||
typedef void (Tcl_TimerProc) (ClientData clientData);
|
||||
typedef void (Tcl_TimerProc) (void *clientData);
|
||||
typedef int (Tcl_SetFromAnyProc) (Tcl_Interp *interp, struct Tcl_Obj *objPtr);
|
||||
typedef void (Tcl_UpdateStringProc) (struct Tcl_Obj *objPtr);
|
||||
typedef char * (Tcl_VarTraceProc) (ClientData clientData, Tcl_Interp *interp,
|
||||
typedef char * (Tcl_VarTraceProc) (void *clientData, Tcl_Interp *interp,
|
||||
const char *part1, const char *part2, int flags);
|
||||
typedef void (Tcl_CommandTraceProc) (ClientData clientData, Tcl_Interp *interp,
|
||||
typedef void (Tcl_CommandTraceProc) (void *clientData, Tcl_Interp *interp,
|
||||
const char *oldName, const char *newName, int flags);
|
||||
typedef void (Tcl_CreateFileHandlerProc) (int fd, int mask, Tcl_FileProc *proc,
|
||||
ClientData clientData);
|
||||
void *clientData);
|
||||
typedef void (Tcl_DeleteFileHandlerProc) (int fd);
|
||||
typedef void (Tcl_AlertNotifierProc) (ClientData clientData);
|
||||
typedef void (Tcl_AlertNotifierProc) (void *clientData);
|
||||
typedef void (Tcl_ServiceModeHookProc) (int mode);
|
||||
typedef ClientData (Tcl_InitNotifierProc) (void);
|
||||
typedef void (Tcl_FinalizeNotifierProc) (ClientData clientData);
|
||||
typedef void *(Tcl_InitNotifierProc) (void);
|
||||
typedef void (Tcl_FinalizeNotifierProc) (void *clientData);
|
||||
typedef void (Tcl_MainLoopProc) (void);
|
||||
|
||||
/*
|
||||
@@ -757,19 +624,19 @@ typedef struct Tcl_ObjType {
|
||||
*/
|
||||
|
||||
typedef struct Tcl_Obj {
|
||||
int refCount; /* When 0 the object will be freed. */
|
||||
size_t refCount; /* When 0 the object will be freed. */
|
||||
char *bytes; /* This points to the first byte of the
|
||||
* object's string representation. The array
|
||||
* must be followed by a null byte (i.e., at
|
||||
* offset length) but may also contain
|
||||
* embedded null characters. The array's
|
||||
* storage is allocated by ckalloc. NULL means
|
||||
* storage is allocated by Tcl_Alloc. NULL means
|
||||
* the string rep is invalid and must be
|
||||
* regenerated from the internal rep. Clients
|
||||
* should use Tcl_GetStringFromObj or
|
||||
* Tcl_GetString to get a pointer to the byte
|
||||
* array as a readonly value. */
|
||||
int length; /* The number of bytes at *bytes, not
|
||||
size_t length; /* The number of bytes at *bytes, not
|
||||
* including the terminating null. */
|
||||
const Tcl_ObjType *typePtr; /* Denotes the object's type. Always
|
||||
* corresponds to the type of the object's
|
||||
@@ -812,20 +679,11 @@ int Tcl_IsShared(Tcl_Obj *objPtr);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* The following structure contains the state needed by Tcl_SaveResult. No-one
|
||||
* outside of Tcl should access any of these fields. This structure is
|
||||
* typically allocated on the stack.
|
||||
* The following type contains the state needed by Tcl_SaveResult. It
|
||||
* is typically allocated on the stack.
|
||||
*/
|
||||
|
||||
typedef struct Tcl_SavedResult {
|
||||
char *result;
|
||||
Tcl_FreeProc *freeProc;
|
||||
Tcl_Obj *objResultPtr;
|
||||
char *appendResult;
|
||||
int appendAvl;
|
||||
int appendUsed;
|
||||
char resultSpace[200+1];
|
||||
} Tcl_SavedResult;
|
||||
typedef Tcl_Obj *Tcl_SavedResult;
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
@@ -841,7 +699,7 @@ typedef struct Tcl_Namespace {
|
||||
* is an synonym. */
|
||||
char *fullName; /* The namespace's fully qualified name. This
|
||||
* starts with ::. */
|
||||
ClientData clientData; /* Arbitrary value associated with this
|
||||
void *clientData; /* Arbitrary value associated with this
|
||||
* namespace. */
|
||||
Tcl_NamespaceDeleteProc *deleteProc;
|
||||
/* Function invoked when deleting the
|
||||
@@ -913,13 +771,13 @@ typedef struct Tcl_CmdInfo {
|
||||
* Tcl_SetCmdInfo does not modify this
|
||||
* field. */
|
||||
Tcl_ObjCmdProc *objProc; /* Command's object-based function. */
|
||||
ClientData objClientData; /* ClientData for object proc. */
|
||||
void *objClientData; /* ClientData for object proc. */
|
||||
Tcl_CmdProc *proc; /* Command's string-based function. */
|
||||
ClientData clientData; /* ClientData for string proc. */
|
||||
void *clientData; /* ClientData for string proc. */
|
||||
Tcl_CmdDeleteProc *deleteProc;
|
||||
/* Function to call when command is
|
||||
* deleted. */
|
||||
ClientData deleteData; /* Value to pass to deleteProc (usually the
|
||||
void *deleteData; /* Value to pass to deleteProc (usually the
|
||||
* same as clientData). */
|
||||
Tcl_Namespace *namespacePtr;/* Points to the namespace that contains this
|
||||
* command. Note that Tcl_SetCmdInfo will not
|
||||
@@ -939,9 +797,9 @@ typedef struct Tcl_CmdInfo {
|
||||
typedef struct Tcl_DString {
|
||||
char *string; /* Points to beginning of string: either
|
||||
* staticSpace below or a malloced array. */
|
||||
int length; /* Number of non-NULL characters in the
|
||||
size_t length; /* Number of non-NULL characters in the
|
||||
* string. */
|
||||
int spaceAvl; /* Total number of bytes available for the
|
||||
size_t spaceAvl; /* Total number of bytes available for the
|
||||
* string and its terminating NULL char. */
|
||||
char staticSpace[TCL_DSTRING_STATIC_SIZE];
|
||||
/* Space to use in common case where string is
|
||||
@@ -950,14 +808,11 @@ typedef struct Tcl_DString {
|
||||
|
||||
#define Tcl_DStringLength(dsPtr) ((dsPtr)->length)
|
||||
#define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
# define Tcl_DStringTrunc Tcl_DStringSetLength
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
/*
|
||||
* Definitions for the maximum number of digits of precision that may be
|
||||
* specified in the "tcl_precision" variable, and the number of bytes of
|
||||
* buffer space required by Tcl_PrintDouble.
|
||||
* produced by Tcl_PrintDouble, and the number of bytes of buffer space
|
||||
* required by Tcl_PrintDouble.
|
||||
*/
|
||||
|
||||
#define TCL_MAX_PREC 17
|
||||
@@ -1071,17 +926,6 @@ typedef struct Tcl_DString {
|
||||
|
||||
#define TCL_ALLOW_INLINE_COMPILATION 0x20000
|
||||
|
||||
/*
|
||||
* The TCL_PARSE_PART1 flag is deprecated and has no effect. The part1 is now
|
||||
* always parsed whenever the part2 is NULL. (This is to avoid a common error
|
||||
* when converting code to use the new object based APIs and forgetting to
|
||||
* give the flag)
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
# define TCL_PARSE_PART1 0x400
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
/*
|
||||
* Types for linked variables:
|
||||
*/
|
||||
@@ -1113,7 +957,7 @@ typedef struct Tcl_DString {
|
||||
*/
|
||||
|
||||
#ifndef TCL_HASH_TYPE
|
||||
# define TCL_HASH_TYPE unsigned
|
||||
# define TCL_HASH_TYPE size_t
|
||||
#endif
|
||||
|
||||
typedef struct Tcl_HashKeyType Tcl_HashKeyType;
|
||||
@@ -1135,10 +979,8 @@ struct Tcl_HashEntry {
|
||||
Tcl_HashEntry *nextPtr; /* Pointer to next entry in this hash bucket,
|
||||
* or NULL for end of chain. */
|
||||
Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */
|
||||
void *hash; /* Hash value, stored as pointer to ensure
|
||||
* that the offsets of the fields in this
|
||||
* structure are not changed. */
|
||||
ClientData clientData; /* Application stores something here with
|
||||
size_t hash; /* Hash value. */
|
||||
void *clientData; /* Application stores something here with
|
||||
* Tcl_SetHashValue. */
|
||||
union { /* Key has one of these forms: */
|
||||
char *oneWordValue; /* One-word value for key. */
|
||||
@@ -1226,16 +1068,16 @@ struct Tcl_HashTable {
|
||||
Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
|
||||
/* Bucket array used for small tables (to
|
||||
* avoid mallocs and frees). */
|
||||
int numBuckets; /* Total number of buckets allocated at
|
||||
size_t numBuckets; /* Total number of buckets allocated at
|
||||
* **bucketPtr. */
|
||||
int numEntries; /* Total number of entries present in
|
||||
size_t numEntries; /* Total number of entries present in
|
||||
* table. */
|
||||
int rebuildSize; /* Enlarge table when numEntries gets to be
|
||||
size_t rebuildSize; /* Enlarge table when numEntries gets to be
|
||||
* this large. */
|
||||
size_t mask; /* Mask value used in hashing function. */
|
||||
int downShift; /* Shift count used in hashing function.
|
||||
* Designed to use high-order bits of
|
||||
* randomized keys. */
|
||||
int mask; /* Mask value used in hashing function. */
|
||||
int keyType; /* Type of keys used in this table. It's
|
||||
* either TCL_CUSTOM_KEYS, TCL_STRING_KEYS,
|
||||
* TCL_ONE_WORD_KEYS, or an integer giving the
|
||||
@@ -1256,7 +1098,7 @@ struct Tcl_HashTable {
|
||||
|
||||
typedef struct Tcl_HashSearch {
|
||||
Tcl_HashTable *tablePtr; /* Table being searched. */
|
||||
int nextIndex; /* Index of next bucket to be enumerated after
|
||||
size_t nextIndex; /* Index of next bucket to be enumerated after
|
||||
* present one. */
|
||||
Tcl_HashEntry *nextEntryPtr;/* Next entry to be enumerated in the current
|
||||
* bucket. */
|
||||
@@ -1297,7 +1139,7 @@ typedef struct Tcl_HashSearch {
|
||||
typedef struct {
|
||||
void *next; /* Search position for underlying hash
|
||||
* table. */
|
||||
unsigned int epoch; /* Epoch marker for dictionary being searched,
|
||||
size_t epoch; /* Epoch marker for dictionary being searched,
|
||||
* or 0 if search has terminated. */
|
||||
Tcl_Dict dictionaryPtr; /* Reference to dictionary being searched. */
|
||||
} Tcl_DictSearch;
|
||||
@@ -1356,15 +1198,15 @@ typedef struct Tcl_Time {
|
||||
long usec; /* Microseconds. */
|
||||
} Tcl_Time;
|
||||
|
||||
typedef void (Tcl_SetTimerProc) (CONST86 Tcl_Time *timePtr);
|
||||
typedef int (Tcl_WaitForEventProc) (CONST86 Tcl_Time *timePtr);
|
||||
typedef void (Tcl_SetTimerProc) (const Tcl_Time *timePtr);
|
||||
typedef int (Tcl_WaitForEventProc) (const Tcl_Time *timePtr);
|
||||
|
||||
/*
|
||||
* TIP #233 (Virtualized Time)
|
||||
*/
|
||||
|
||||
typedef void (Tcl_GetTimeProc) (Tcl_Time *timebuf, ClientData clientData);
|
||||
typedef void (Tcl_ScaleTimeProc) (Tcl_Time *timebuf, ClientData clientData);
|
||||
typedef void (Tcl_GetTimeProc) (Tcl_Time *timebuf, void *clientData);
|
||||
typedef void (Tcl_ScaleTimeProc) (Tcl_Time *timebuf, void *clientData);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
@@ -1423,40 +1265,40 @@ typedef void (Tcl_ScaleTimeProc) (Tcl_Time *timebuf, ClientData clientData);
|
||||
* Typedefs for the various operations in a channel type:
|
||||
*/
|
||||
|
||||
typedef int (Tcl_DriverBlockModeProc) (ClientData instanceData, int mode);
|
||||
typedef int (Tcl_DriverCloseProc) (ClientData instanceData,
|
||||
typedef int (Tcl_DriverBlockModeProc) (void *instanceData, int mode);
|
||||
typedef int (Tcl_DriverCloseProc) (void *instanceData,
|
||||
Tcl_Interp *interp);
|
||||
typedef int (Tcl_DriverClose2Proc) (ClientData instanceData,
|
||||
typedef int (Tcl_DriverClose2Proc) (void *instanceData,
|
||||
Tcl_Interp *interp, int flags);
|
||||
typedef int (Tcl_DriverInputProc) (ClientData instanceData, char *buf,
|
||||
typedef int (Tcl_DriverInputProc) (void *instanceData, char *buf,
|
||||
int toRead, int *errorCodePtr);
|
||||
typedef int (Tcl_DriverOutputProc) (ClientData instanceData,
|
||||
typedef int (Tcl_DriverOutputProc) (void *instanceData,
|
||||
const char *buf, int toWrite, int *errorCodePtr);
|
||||
typedef int (Tcl_DriverSeekProc) (ClientData instanceData, long offset,
|
||||
typedef int (Tcl_DriverSeekProc) (void *instanceData, long offset,
|
||||
int mode, int *errorCodePtr);
|
||||
typedef int (Tcl_DriverSetOptionProc) (ClientData instanceData,
|
||||
typedef int (Tcl_DriverSetOptionProc) (void *instanceData,
|
||||
Tcl_Interp *interp, const char *optionName,
|
||||
const char *value);
|
||||
typedef int (Tcl_DriverGetOptionProc) (ClientData instanceData,
|
||||
typedef int (Tcl_DriverGetOptionProc) (void *instanceData,
|
||||
Tcl_Interp *interp, const char *optionName,
|
||||
Tcl_DString *dsPtr);
|
||||
typedef void (Tcl_DriverWatchProc) (ClientData instanceData, int mask);
|
||||
typedef int (Tcl_DriverGetHandleProc) (ClientData instanceData,
|
||||
int direction, ClientData *handlePtr);
|
||||
typedef int (Tcl_DriverFlushProc) (ClientData instanceData);
|
||||
typedef int (Tcl_DriverHandlerProc) (ClientData instanceData,
|
||||
typedef void (Tcl_DriverWatchProc) (void *instanceData, int mask);
|
||||
typedef int (Tcl_DriverGetHandleProc) (void *instanceData,
|
||||
int direction, void **handlePtr);
|
||||
typedef int (Tcl_DriverFlushProc) (void *instanceData);
|
||||
typedef int (Tcl_DriverHandlerProc) (void *instanceData,
|
||||
int interestMask);
|
||||
typedef Tcl_WideInt (Tcl_DriverWideSeekProc) (ClientData instanceData,
|
||||
typedef Tcl_WideInt (Tcl_DriverWideSeekProc) (void *instanceData,
|
||||
Tcl_WideInt offset, int mode, int *errorCodePtr);
|
||||
/*
|
||||
* TIP #218, Channel Thread Actions
|
||||
*/
|
||||
typedef void (Tcl_DriverThreadActionProc) (ClientData instanceData,
|
||||
typedef void (Tcl_DriverThreadActionProc) (void *instanceData,
|
||||
int action);
|
||||
/*
|
||||
* TIP #208, File Truncation (etc.)
|
||||
*/
|
||||
typedef int (Tcl_DriverTruncateProc) (ClientData instanceData,
|
||||
typedef int (Tcl_DriverTruncateProc) (void *instanceData,
|
||||
Tcl_WideInt length);
|
||||
|
||||
/*
|
||||
@@ -1629,7 +1471,7 @@ typedef int (Tcl_FSNormalizePathProc) (Tcl_Interp *interp, Tcl_Obj *pathPtr,
|
||||
int nextCheckpoint);
|
||||
typedef int (Tcl_FSFileAttrsGetProc) (Tcl_Interp *interp, int index,
|
||||
Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef);
|
||||
typedef const char *CONST86 * (Tcl_FSFileAttrStringsProc) (Tcl_Obj *pathPtr,
|
||||
typedef const char *const * (Tcl_FSFileAttrStringsProc) (Tcl_Obj *pathPtr,
|
||||
Tcl_Obj **objPtrRef);
|
||||
typedef int (Tcl_FSFileAttrsSetProc) (Tcl_Interp *interp, int index,
|
||||
Tcl_Obj *pathPtr, Tcl_Obj *objPtr);
|
||||
@@ -1638,13 +1480,13 @@ typedef Tcl_Obj * (Tcl_FSLinkProc) (Tcl_Obj *pathPtr, Tcl_Obj *toPtr,
|
||||
typedef int (Tcl_FSLoadFileProc) (Tcl_Interp *interp, Tcl_Obj *pathPtr,
|
||||
Tcl_LoadHandle *handlePtr, Tcl_FSUnloadFileProc **unloadProcPtr);
|
||||
typedef int (Tcl_FSPathInFilesystemProc) (Tcl_Obj *pathPtr,
|
||||
ClientData *clientDataPtr);
|
||||
void **clientDataPtr);
|
||||
typedef Tcl_Obj * (Tcl_FSFilesystemPathTypeProc) (Tcl_Obj *pathPtr);
|
||||
typedef Tcl_Obj * (Tcl_FSFilesystemSeparatorProc) (Tcl_Obj *pathPtr);
|
||||
typedef void (Tcl_FSFreeInternalRepProc) (ClientData clientData);
|
||||
typedef ClientData (Tcl_FSDupInternalRepProc) (ClientData clientData);
|
||||
typedef Tcl_Obj * (Tcl_FSInternalToNormalizedProc) (ClientData clientData);
|
||||
typedef ClientData (Tcl_FSCreateInternalRepProc) (Tcl_Obj *pathPtr);
|
||||
#define Tcl_FSFreeInternalRepProc Tcl_FreeProc
|
||||
typedef void *(Tcl_FSDupInternalRepProc) (void *clientData);
|
||||
typedef Tcl_Obj * (Tcl_FSInternalToNormalizedProc) (void *clientData);
|
||||
typedef void *(Tcl_FSCreateInternalRepProc) (Tcl_Obj *pathPtr);
|
||||
|
||||
typedef struct Tcl_FSVersion_ *Tcl_FSVersion;
|
||||
|
||||
@@ -1674,7 +1516,7 @@ typedef struct Tcl_FSVersion_ *Tcl_FSVersion;
|
||||
|
||||
typedef struct Tcl_Filesystem {
|
||||
const char *typeName; /* The name of the filesystem. */
|
||||
int structureLength; /* Length of this structure, so future binary
|
||||
size_t structureLength; /* Length of this structure, so future binary
|
||||
* compatibility can be assured. */
|
||||
Tcl_FSVersion version; /* Version of the filesystem type. */
|
||||
Tcl_FSPathInFilesystemProc *pathInFilesystemProc;
|
||||
@@ -1864,8 +1706,8 @@ typedef struct Tcl_Token {
|
||||
int type; /* Type of token, such as TCL_TOKEN_WORD; see
|
||||
* below for valid types. */
|
||||
const char *start; /* First character in token. */
|
||||
int size; /* Number of bytes in token. */
|
||||
int numComponents; /* If this token is composed of other tokens,
|
||||
size_t size; /* Number of bytes in token. */
|
||||
size_t numComponents; /* If this token is composed of other tokens,
|
||||
* this field tells how many of them there are
|
||||
* (including components of components, etc.).
|
||||
* The component tokens immediately follow
|
||||
@@ -1931,7 +1773,7 @@ typedef struct Tcl_Token {
|
||||
* TCL_TOKEN_OPERATOR - The token describes one expression operator.
|
||||
* An operator might be the name of a math
|
||||
* function such as "abs". A TCL_TOKEN_OPERATOR
|
||||
* token is always preceded by one
|
||||
* token is always preceeded by one
|
||||
* TCL_TOKEN_SUB_EXPR token for the operator's
|
||||
* subexpression, and is followed by zero or more
|
||||
* TCL_TOKEN_SUB_EXPR tokens for the operator's
|
||||
@@ -1979,7 +1821,7 @@ typedef struct Tcl_Token {
|
||||
typedef struct Tcl_Parse {
|
||||
const char *commentStart; /* Pointer to # that begins the first of one
|
||||
* or more comments preceding the command. */
|
||||
int commentSize; /* Number of bytes in comments (up through
|
||||
size_t commentSize; /* Number of bytes in comments (up through
|
||||
* newline character that terminates the last
|
||||
* comment). If there were no comments, this
|
||||
* field is 0. */
|
||||
@@ -2047,10 +1889,10 @@ typedef struct Tcl_EncodingType {
|
||||
Tcl_EncodingConvertProc *fromUtfProc;
|
||||
/* Function to convert from UTF-8 into
|
||||
* external encoding. */
|
||||
Tcl_EncodingFreeProc *freeProc;
|
||||
Tcl_FreeProc *freeProc;
|
||||
/* If non-NULL, function to call when this
|
||||
* encoding is deleted. */
|
||||
ClientData clientData; /* Arbitrary value associated with encoding
|
||||
void *clientData; /* Arbitrary value associated with encoding
|
||||
* type. Passed to conversion functions. */
|
||||
int nullSize; /* Number of zero bytes that signify
|
||||
* end-of-string in this encoding. This number
|
||||
@@ -2204,8 +2046,8 @@ typedef struct Tcl_Config {
|
||||
* command- or time-limit is exceeded by an interpreter.
|
||||
*/
|
||||
|
||||
typedef void (Tcl_LimitHandlerProc) (ClientData clientData, Tcl_Interp *interp);
|
||||
typedef void (Tcl_LimitHandlerDeleteProc) (ClientData clientData);
|
||||
typedef void (Tcl_LimitHandlerProc) (void *clientData, Tcl_Interp *interp);
|
||||
typedef void (Tcl_LimitHandlerDeleteProc) (void *clientData);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
@@ -2236,7 +2078,7 @@ typedef struct {
|
||||
* depends on type.*/
|
||||
const char *helpStr; /* Documentation message describing this
|
||||
* option. */
|
||||
ClientData clientData; /* Word to pass to function callbacks. */
|
||||
void *clientData; /* Word to pass to function callbacks. */
|
||||
} Tcl_ArgvInfo;
|
||||
|
||||
/*
|
||||
@@ -2259,9 +2101,9 @@ typedef struct {
|
||||
* argument types:
|
||||
*/
|
||||
|
||||
typedef int (Tcl_ArgvFuncProc)(ClientData clientData, Tcl_Obj *objPtr,
|
||||
typedef int (Tcl_ArgvFuncProc)(void *clientData, Tcl_Obj *objPtr,
|
||||
void *dstPtr);
|
||||
typedef int (Tcl_ArgvGenFuncProc)(ClientData clientData, Tcl_Interp *interp,
|
||||
typedef int (Tcl_ArgvGenFuncProc)(void *clientData, Tcl_Interp *interp,
|
||||
int objc, Tcl_Obj *const *objv, void *dstPtr);
|
||||
|
||||
/*
|
||||
@@ -2334,18 +2176,18 @@ typedef int (Tcl_ArgvGenFuncProc)(ClientData clientData, Tcl_Interp *interp,
|
||||
#define TCL_TCPSERVER_REUSEPORT (1<<1)
|
||||
|
||||
/*
|
||||
* Constants for special int-typed values, see TIP #494
|
||||
* Constants for special size_t-typed values, see TIP #494
|
||||
*/
|
||||
|
||||
#define TCL_IO_FAILURE (-1)
|
||||
#define TCL_AUTO_LENGTH (-1)
|
||||
#define TCL_IO_FAILURE ((size_t)-1)
|
||||
#define TCL_AUTO_LENGTH ((size_t)-1)
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* Single public declaration for NRE.
|
||||
*/
|
||||
|
||||
typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
|
||||
typedef int (Tcl_NRPostProc) (void *data[], Tcl_Interp *interp,
|
||||
int result);
|
||||
|
||||
/*
|
||||
@@ -2354,7 +2196,7 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
|
||||
* stubs tables. If TCL_UTF_MAX>4 use a different value.
|
||||
*/
|
||||
|
||||
#define TCL_STUB_MAGIC ((int) 0xFCA3BACF + (TCL_UTF_MAX>4))
|
||||
#define TCL_STUB_MAGIC ((int) 0xFCA3BACB + (int) sizeof(void *) + (TCL_UTF_MAX>4))
|
||||
|
||||
/*
|
||||
* The following function is required to be defined in all stubs aware
|
||||
@@ -2368,9 +2210,9 @@ const char * Tcl_InitStubs(Tcl_Interp *interp, const char *version,
|
||||
const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
|
||||
const char *version, int epoch, int revision);
|
||||
#if defined(_WIN32)
|
||||
TCL_NORETURN void Tcl_ConsolePanic(const char *format, ...);
|
||||
TCL_NORETURN1 void Tcl_ConsolePanic(const char *format, ...);
|
||||
#else
|
||||
# define Tcl_ConsolePanic ((Tcl_PanicProc *)0)
|
||||
# define Tcl_ConsolePanic NULL
|
||||
#endif
|
||||
|
||||
#ifdef USE_TCL_STUBS
|
||||
@@ -2403,8 +2245,8 @@ const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
|
||||
*/
|
||||
|
||||
#define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \
|
||||
(((Tcl_SetPanicProc)(Tcl_ConsolePanic), Tcl_CreateInterp)()))
|
||||
EXTERN void Tcl_MainEx(int argc, char **argv,
|
||||
((Tcl_SetPanicProc(Tcl_ConsolePanic), Tcl_CreateInterp)()))
|
||||
EXTERN TCL_NORETURN void Tcl_MainEx(int argc, char **argv,
|
||||
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
|
||||
EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
|
||||
const char *version, int exact);
|
||||
@@ -2436,25 +2278,17 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* The following declarations either map ckalloc and ckfree to malloc and
|
||||
* free, or they map them to functions with all sorts of debugging hooks
|
||||
* defined in tclCkalloc.c.
|
||||
* The following declarations map ckalloc and ckfree to Tcl_Alloc and
|
||||
* Tcl_Free.
|
||||
*/
|
||||
|
||||
#ifdef TCL_MEM_DEBUG
|
||||
#define ckalloc Tcl_Alloc
|
||||
#define ckfree Tcl_Free
|
||||
#define ckrealloc Tcl_Realloc
|
||||
#define attemptckalloc Tcl_AttemptAlloc
|
||||
#define attemptckrealloc Tcl_AttemptRealloc
|
||||
|
||||
# define ckalloc(x) \
|
||||
((void *) Tcl_DbCkalloc((unsigned)(x), __FILE__, __LINE__))
|
||||
# define ckfree(x) \
|
||||
Tcl_DbCkfree((char *)(x), __FILE__, __LINE__)
|
||||
# define ckrealloc(x,y) \
|
||||
((void *) Tcl_DbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__))
|
||||
# define attemptckalloc(x) \
|
||||
((void *) Tcl_AttemptDbCkalloc((unsigned)(x), __FILE__, __LINE__))
|
||||
# define attemptckrealloc(x,y) \
|
||||
((void *) Tcl_AttemptDbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__))
|
||||
|
||||
#else /* !TCL_MEM_DEBUG */
|
||||
#ifndef TCL_MEM_DEBUG
|
||||
|
||||
/*
|
||||
* If we are not using the debugging allocator, we should call the Tcl_Alloc,
|
||||
@@ -2462,16 +2296,6 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
|
||||
* memory allocator both inside and outside of the Tcl library.
|
||||
*/
|
||||
|
||||
# define ckalloc(x) \
|
||||
((void *) Tcl_Alloc((unsigned)(x)))
|
||||
# define ckfree(x) \
|
||||
Tcl_Free((char *)(x))
|
||||
# define ckrealloc(x,y) \
|
||||
((void *) Tcl_Realloc((char *)(x), (unsigned)(y)))
|
||||
# define attemptckalloc(x) \
|
||||
((void *) Tcl_AttemptAlloc((unsigned)(x)))
|
||||
# define attemptckrealloc(x,y) \
|
||||
((void *) Tcl_AttemptRealloc((char *)(x), (unsigned)(y)))
|
||||
# undef Tcl_InitMemory
|
||||
# define Tcl_InitMemory(x)
|
||||
# undef Tcl_DumpActiveMemory
|
||||
@@ -2545,7 +2369,7 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
|
||||
*/
|
||||
|
||||
#define Tcl_GetHashValue(h) ((h)->clientData)
|
||||
#define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value))
|
||||
#define Tcl_SetHashValue(h, value) ((h)->clientData = (void *) (value))
|
||||
#define Tcl_GetHashKey(tablePtr, h) \
|
||||
((void *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS || \
|
||||
(tablePtr)->keyType == TCL_CUSTOM_PTR_KEYS) \
|
||||
@@ -2557,45 +2381,11 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv);
|
||||
* hash tables:
|
||||
*/
|
||||
|
||||
#undef Tcl_FindHashEntry
|
||||
#define Tcl_FindHashEntry(tablePtr, key) \
|
||||
(*((tablePtr)->findProc))(tablePtr, (const char *)(key))
|
||||
#undef Tcl_CreateHashEntry
|
||||
#define Tcl_CreateHashEntry(tablePtr, key, newPtr) \
|
||||
(*((tablePtr)->createProc))(tablePtr, (const char *)(key), newPtr)
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* Deprecated Tcl functions:
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
/*
|
||||
* These function have been renamed. The old names are deprecated, but we
|
||||
* define these macros for backwards compatibility.
|
||||
*/
|
||||
|
||||
# define Tcl_Ckalloc Tcl_Alloc
|
||||
# define Tcl_Ckfree Tcl_Free
|
||||
# define Tcl_Ckrealloc Tcl_Realloc
|
||||
# define Tcl_Return Tcl_SetResult
|
||||
# define Tcl_TildeSubst Tcl_TranslateFileName
|
||||
#if !defined(__APPLE__) /* On OSX, there is a conflict with "mach/mach.h" */
|
||||
# define panic Tcl_Panic
|
||||
#endif
|
||||
# define panicVA Tcl_PanicVA
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* Convenience declaration of Tcl_AppInit for backwards compatibility. This
|
||||
* function is not *implemented* by the tcl library, so the storage class is
|
||||
* neither DLLEXPORT nor DLLIMPORT.
|
||||
*/
|
||||
|
||||
extern Tcl_AppInitProc Tcl_AppInit;
|
||||
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
#endif /* RC_INVOKED */
|
||||
|
||||
/*
|
||||
|
||||
+18
-16
@@ -249,9 +249,9 @@ TclFinalizeAllocSubsystem(void)
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char *
|
||||
void *
|
||||
TclpAlloc(
|
||||
unsigned int numBytes) /* Number of bytes to allocate. */
|
||||
size_t numBytes) /* Number of bytes to allocate. */
|
||||
{
|
||||
register union overhead *overPtr;
|
||||
register size_t bucket;
|
||||
@@ -275,7 +275,7 @@ TclpAlloc(
|
||||
if (numBytes >= MAXMALLOC - OVERHEAD) {
|
||||
if (numBytes <= UINT_MAX - OVERHEAD -sizeof(struct block)) {
|
||||
bigBlockPtr = (struct block *) TclpSysAlloc((unsigned)
|
||||
(sizeof(struct block) + OVERHEAD + numBytes), 0);
|
||||
(sizeof(struct block) + OVERHEAD + numBytes));
|
||||
}
|
||||
if (bigBlockPtr == NULL) {
|
||||
Tcl_MutexUnlock(allocMutexPtr);
|
||||
@@ -406,7 +406,7 @@ MoreCore(
|
||||
ASSERT(numBlocks*size == amount);
|
||||
|
||||
blockPtr = (struct block *) TclpSysAlloc(
|
||||
(sizeof(struct block) + amount), 1);
|
||||
(sizeof(struct block) + amount));
|
||||
/* no more room! */
|
||||
if (blockPtr == NULL) {
|
||||
return;
|
||||
@@ -446,7 +446,7 @@ MoreCore(
|
||||
|
||||
void
|
||||
TclpFree(
|
||||
char *oldPtr) /* Pointer to memory to free. */
|
||||
void *oldPtr) /* Pointer to memory to free. */
|
||||
{
|
||||
register size_t size;
|
||||
register union overhead *overPtr;
|
||||
@@ -509,10 +509,10 @@ TclpFree(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char *
|
||||
void *
|
||||
TclpRealloc(
|
||||
char *oldPtr, /* Pointer to alloced block. */
|
||||
unsigned int numBytes) /* New size of memory. */
|
||||
void *oldPtr, /* Pointer to alloced block. */
|
||||
size_t numBytes) /* New size of memory. */
|
||||
{
|
||||
int i;
|
||||
union overhead *overPtr;
|
||||
@@ -692,11 +692,12 @@ mstats(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char *
|
||||
#undef TclpAlloc
|
||||
void *
|
||||
TclpAlloc(
|
||||
unsigned int numBytes) /* Number of bytes to allocate. */
|
||||
size_t numBytes) /* Number of bytes to allocate. */
|
||||
{
|
||||
return (char *) malloc(numBytes);
|
||||
return malloc(numBytes);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -715,9 +716,10 @@ TclpAlloc(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#undef TclpFree
|
||||
void
|
||||
TclpFree(
|
||||
char *oldPtr) /* Pointer to memory to free. */
|
||||
void *oldPtr) /* Pointer to memory to free. */
|
||||
{
|
||||
free(oldPtr);
|
||||
return;
|
||||
@@ -739,12 +741,12 @@ TclpFree(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char *
|
||||
void *
|
||||
TclpRealloc(
|
||||
char *oldPtr, /* Pointer to alloced block. */
|
||||
unsigned int numBytes) /* New size of memory. */
|
||||
void *oldPtr, /* Pointer to alloced block. */
|
||||
size_t numBytes) /* New size of memory. */
|
||||
{
|
||||
return (char *) realloc(oldPtr, numBytes);
|
||||
return realloc(oldPtr, numBytes);
|
||||
}
|
||||
|
||||
#endif /* !USE_TCLALLOC */
|
||||
|
||||
+15
-17
@@ -406,7 +406,6 @@ static const TalInstDesc TalInstructionTable[] = {
|
||||
{"jumpTrue", ASSEM_JUMP, INST_JUMP_TRUE1, 1, 0},
|
||||
{"jumpTrue4", ASSEM_JUMP4, INST_JUMP_TRUE4, 1, 0},
|
||||
{"label", ASSEM_LABEL, 0, 0, 0},
|
||||
{"land", ASSEM_1BYTE, INST_LAND, 2, 1},
|
||||
{"lappend", ASSEM_LVT, (INST_LAPPEND_SCALAR1<<8
|
||||
| INST_LAPPEND_SCALAR4),
|
||||
1, 1},
|
||||
@@ -434,7 +433,6 @@ static const TalInstDesc TalInstructionTable[] = {
|
||||
| INST_LOAD_ARRAY4), 1, 1},
|
||||
{"loadArrayStk", ASSEM_1BYTE, INST_LOAD_ARRAY_STK, 2, 1},
|
||||
{"loadStk", ASSEM_1BYTE, INST_LOAD_STK, 1, 1},
|
||||
{"lor", ASSEM_1BYTE, INST_LOR, 2, 1},
|
||||
{"lsetFlat", ASSEM_LSET_FLAT,INST_LSET_FLAT, INT_MIN,1},
|
||||
{"lsetList", ASSEM_1BYTE, INST_LSET_LIST, 3, 1},
|
||||
{"lshift", ASSEM_1BYTE, INST_LSHIFT, 2, 1},
|
||||
@@ -845,7 +843,7 @@ CompileAssembleObj(
|
||||
* names in the bytecode resolve */
|
||||
int status; /* Status return from Tcl_AssembleCode */
|
||||
const char* source; /* String representation of the source code */
|
||||
int sourceLen; /* Length of the source code in bytes */
|
||||
size_t sourceLen; /* Length of the source code in bytes */
|
||||
|
||||
|
||||
/*
|
||||
@@ -979,7 +977,7 @@ TclCompileAssembleCmd(
|
||||
|
||||
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
|
||||
"\n (\"%.*s\" body, line %d)",
|
||||
parsePtr->tokenPtr->size, parsePtr->tokenPtr->start,
|
||||
(int)parsePtr->tokenPtr->size, parsePtr->tokenPtr->start,
|
||||
Tcl_GetErrorLine(interp)));
|
||||
envPtr->numCommands = numCommands;
|
||||
envPtr->codeNext = envPtr->codeStart + offset;
|
||||
@@ -1206,14 +1204,14 @@ FreeAssemblyEnv(
|
||||
Tcl_DecrRefCount(thisBB->jumpTarget);
|
||||
}
|
||||
if (thisBB->foreignExceptions != NULL) {
|
||||
ckfree(thisBB->foreignExceptions);
|
||||
Tcl_Free(thisBB->foreignExceptions);
|
||||
}
|
||||
nextBB = thisBB->successor1;
|
||||
if (thisBB->jtPtr != NULL) {
|
||||
DeleteMirrorJumpTable(thisBB->jtPtr);
|
||||
thisBB->jtPtr = NULL;
|
||||
}
|
||||
ckfree(thisBB);
|
||||
Tcl_Free(thisBB);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1259,7 +1257,7 @@ AssembleOneLine(
|
||||
Tcl_Obj* operand1Obj = NULL;
|
||||
/* First operand to the instruction */
|
||||
const char* operand1; /* String rep of the operand */
|
||||
int operand1Len; /* String length of the operand */
|
||||
size_t operand1Len; /* String length of the operand */
|
||||
int opnd; /* Integer representation of an operand */
|
||||
int litIndex; /* Literal pool index of a constant */
|
||||
int localVar; /* LVT index of a local variable */
|
||||
@@ -1531,7 +1529,7 @@ AssembleOneLine(
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
jtPtr = ckalloc(sizeof(JumptableInfo));
|
||||
jtPtr = Tcl_Alloc(sizeof(JumptableInfo));
|
||||
|
||||
Tcl_InitHashTable(&jtPtr->hashTable, TCL_STRING_KEYS);
|
||||
assemEnvPtr->curr_bb->jumpLine = assemEnvPtr->cmdLine;
|
||||
@@ -1930,7 +1928,7 @@ MoveExceptionRangesToBasicBlock(
|
||||
curr_bb->foreignExceptionBase = savedExceptArrayNext;
|
||||
curr_bb->foreignExceptionCount = exceptionCount;
|
||||
curr_bb->foreignExceptions =
|
||||
ckalloc(exceptionCount * sizeof(ExceptionRange));
|
||||
Tcl_Alloc(exceptionCount * sizeof(ExceptionRange));
|
||||
memcpy(curr_bb->foreignExceptions,
|
||||
envPtr->exceptArrayPtr + savedExceptArrayNext,
|
||||
exceptionCount * sizeof(ExceptionRange));
|
||||
@@ -1995,7 +1993,7 @@ CreateMirrorJumpTable(
|
||||
* Allocate the jumptable.
|
||||
*/
|
||||
|
||||
jtPtr = ckalloc(sizeof(JumptableInfo));
|
||||
jtPtr = Tcl_Alloc(sizeof(JumptableInfo));
|
||||
jtHashPtr = &jtPtr->hashTable;
|
||||
Tcl_InitHashTable(jtHashPtr, TCL_STRING_KEYS);
|
||||
|
||||
@@ -2060,7 +2058,7 @@ DeleteMirrorJumpTable(
|
||||
Tcl_SetHashValue(entry, NULL);
|
||||
}
|
||||
Tcl_DeleteHashTable(jtHashPtr);
|
||||
ckfree(jtPtr);
|
||||
Tcl_Free(jtPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2303,7 +2301,7 @@ FindLocalVar(
|
||||
* source code. */
|
||||
Tcl_Obj* varNameObj; /* Name of the variable */
|
||||
const char* varNameStr;
|
||||
int varNameLen;
|
||||
size_t varNameLen;
|
||||
int localVar; /* Index of the variable in the LVT */
|
||||
|
||||
if (GetNextOperand(assemEnvPtr, tokenPtrPtr, &varNameObj) != TCL_OK) {
|
||||
@@ -2643,7 +2641,7 @@ AllocBB(
|
||||
AssemblyEnv* assemEnvPtr) /* Assembly environment */
|
||||
{
|
||||
CompileEnv* envPtr = assemEnvPtr->envPtr;
|
||||
BasicBlock *bb = ckalloc(sizeof(BasicBlock));
|
||||
BasicBlock *bb = Tcl_Alloc(sizeof(BasicBlock));
|
||||
|
||||
bb->originalStartOffset =
|
||||
bb->startOffset = envPtr->codeNext - envPtr->codeStart;
|
||||
@@ -3921,8 +3919,8 @@ BuildExceptionRanges(
|
||||
* Allocate memory for a stack of active catches.
|
||||
*/
|
||||
|
||||
catches = ckalloc(maxCatchDepth * sizeof(BasicBlock*));
|
||||
catchIndices = ckalloc(maxCatchDepth * sizeof(int));
|
||||
catches = Tcl_Alloc(maxCatchDepth * sizeof(BasicBlock*));
|
||||
catchIndices = Tcl_Alloc(maxCatchDepth * sizeof(int));
|
||||
for (i = 0; i < maxCatchDepth; ++i) {
|
||||
catches[i] = NULL;
|
||||
catchIndices[i] = -1;
|
||||
@@ -3961,8 +3959,8 @@ BuildExceptionRanges(
|
||||
|
||||
/* Free temp storage */
|
||||
|
||||
ckfree(catchIndices);
|
||||
ckfree(catches);
|
||||
Tcl_Free(catchIndices);
|
||||
Tcl_Free(catches);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
+2
-2
@@ -118,7 +118,7 @@ Tcl_AsyncCreate(
|
||||
AsyncHandler *asyncPtr;
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
|
||||
|
||||
asyncPtr = ckalloc(sizeof(AsyncHandler));
|
||||
asyncPtr = Tcl_Alloc(sizeof(AsyncHandler));
|
||||
asyncPtr->ready = 0;
|
||||
asyncPtr->nextPtr = NULL;
|
||||
asyncPtr->proc = proc;
|
||||
@@ -310,7 +310,7 @@ Tcl_AsyncDelete(
|
||||
}
|
||||
}
|
||||
Tcl_MutexUnlock(&tsdPtr->asyncMutex);
|
||||
ckfree(asyncPtr);
|
||||
Tcl_Free(asyncPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+108
-834
File diff suppressed because it is too large
Load Diff
+41
-46
@@ -267,10 +267,10 @@ const Tcl_ObjType tclByteArrayType = {
|
||||
* fewer mallocs.
|
||||
*/
|
||||
|
||||
typedef struct ByteArray {
|
||||
int used; /* The number of bytes used in the byte
|
||||
typedef struct {
|
||||
size_t used; /* The number of bytes used in the byte
|
||||
* array. */
|
||||
int allocated; /* The amount of space actually allocated
|
||||
size_t allocated; /* The amount of space actually allocated
|
||||
* minus 1 byte. */
|
||||
unsigned char bytes[1]; /* The array of bytes. The actual size of this
|
||||
* field depends on the 'allocated' field
|
||||
@@ -278,7 +278,7 @@ typedef struct ByteArray {
|
||||
} ByteArray;
|
||||
|
||||
#define BYTEARRAY_SIZE(len) \
|
||||
((unsigned) (TclOffset(ByteArray, bytes) + (len)))
|
||||
((TclOffset(ByteArray, bytes) + (len)))
|
||||
#define GET_BYTEARRAY(objPtr) \
|
||||
((ByteArray *) (objPtr)->internalRep.twoPtrValue.ptr1)
|
||||
#define SET_BYTEARRAY(objPtr, baPtr) \
|
||||
@@ -315,8 +315,7 @@ Tcl_Obj *
|
||||
Tcl_NewByteArrayObj(
|
||||
const unsigned char *bytes, /* The array of bytes used to initialize the
|
||||
* new object. */
|
||||
int length) /* Length of the array of bytes, which must be
|
||||
* >= 0. */
|
||||
size_t length) /* Length of the array of bytes */
|
||||
{
|
||||
#ifdef TCL_MEM_DEBUG
|
||||
return Tcl_DbNewByteArrayObj(bytes, length, "unknown", 0);
|
||||
@@ -358,8 +357,7 @@ Tcl_Obj *
|
||||
Tcl_DbNewByteArrayObj(
|
||||
const unsigned char *bytes, /* The array of bytes used to initialize the
|
||||
* new object. */
|
||||
int length, /* Length of the array of bytes, which must be
|
||||
* >= 0. */
|
||||
size_t length, /* Length of the array of bytes. */
|
||||
const char *file, /* The name of the source file calling this
|
||||
* procedure; used for debugging. */
|
||||
int line) /* Line number in the source file; used for
|
||||
@@ -399,7 +397,7 @@ Tcl_SetByteArrayObj(
|
||||
Tcl_Obj *objPtr, /* Object to initialize as a ByteArray. */
|
||||
const unsigned char *bytes, /* The array of bytes to use as the new
|
||||
value. May be NULL even if length > 0. */
|
||||
int length) /* Length of the array of bytes, which must
|
||||
size_t length) /* Length of the array of bytes, which must
|
||||
be >= 0. */
|
||||
{
|
||||
ByteArray *byteArrayPtr;
|
||||
@@ -410,15 +408,12 @@ Tcl_SetByteArrayObj(
|
||||
TclFreeIntRep(objPtr);
|
||||
TclInvalidateStringRep(objPtr);
|
||||
|
||||
if (length < 0) {
|
||||
length = 0;
|
||||
}
|
||||
byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
|
||||
byteArrayPtr = Tcl_Alloc(BYTEARRAY_SIZE(length));
|
||||
byteArrayPtr->used = length;
|
||||
byteArrayPtr->allocated = length;
|
||||
|
||||
if ((bytes != NULL) && (length > 0)) {
|
||||
memcpy(byteArrayPtr->bytes, bytes, (size_t) length);
|
||||
memcpy(byteArrayPtr->bytes, bytes, length);
|
||||
}
|
||||
objPtr->typePtr = &properByteArrayType;
|
||||
SET_BYTEARRAY(objPtr, byteArrayPtr);
|
||||
@@ -487,7 +482,7 @@ Tcl_GetByteArrayFromObj(
|
||||
unsigned char *
|
||||
Tcl_SetByteArrayLength(
|
||||
Tcl_Obj *objPtr, /* The ByteArray object. */
|
||||
int length) /* New length for internal byte array. */
|
||||
size_t length) /* New length for internal byte array. */
|
||||
{
|
||||
ByteArray *byteArrayPtr;
|
||||
|
||||
@@ -501,7 +496,7 @@ Tcl_SetByteArrayLength(
|
||||
|
||||
byteArrayPtr = GET_BYTEARRAY(objPtr);
|
||||
if (length > byteArrayPtr->allocated) {
|
||||
byteArrayPtr = ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(length));
|
||||
byteArrayPtr = Tcl_Realloc(byteArrayPtr, BYTEARRAY_SIZE(length));
|
||||
byteArrayPtr->allocated = length;
|
||||
SET_BYTEARRAY(objPtr, byteArrayPtr);
|
||||
}
|
||||
@@ -549,7 +544,7 @@ SetByteArrayFromAny(
|
||||
length = objPtr->length;
|
||||
srcEnd = src + length;
|
||||
|
||||
byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
|
||||
byteArrayPtr = Tcl_Alloc(BYTEARRAY_SIZE(length));
|
||||
for (dst = byteArrayPtr->bytes; src < srcEnd; ) {
|
||||
src += TclUtfToUniChar(src, &ch);
|
||||
improper = improper || (ch > 255);
|
||||
@@ -586,7 +581,7 @@ static void
|
||||
FreeByteArrayInternalRep(
|
||||
Tcl_Obj *objPtr) /* Object with internal rep to free. */
|
||||
{
|
||||
ckfree(GET_BYTEARRAY(objPtr));
|
||||
Tcl_Free(GET_BYTEARRAY(objPtr));
|
||||
objPtr->typePtr = NULL;
|
||||
}
|
||||
|
||||
@@ -612,16 +607,16 @@ DupByteArrayInternalRep(
|
||||
Tcl_Obj *srcPtr, /* Object with internal rep to copy. */
|
||||
Tcl_Obj *copyPtr) /* Object with internal rep to set. */
|
||||
{
|
||||
int length;
|
||||
size_t length;
|
||||
ByteArray *srcArrayPtr, *copyArrayPtr;
|
||||
|
||||
srcArrayPtr = GET_BYTEARRAY(srcPtr);
|
||||
length = srcArrayPtr->used;
|
||||
|
||||
copyArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
|
||||
copyArrayPtr = Tcl_Alloc(BYTEARRAY_SIZE(length));
|
||||
copyArrayPtr->used = length;
|
||||
copyArrayPtr->allocated = length;
|
||||
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, (size_t) length);
|
||||
memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);
|
||||
SET_BYTEARRAY(copyPtr, copyArrayPtr);
|
||||
|
||||
copyPtr->typePtr = srcPtr->typePtr;
|
||||
@@ -654,7 +649,7 @@ UpdateStringOfByteArray(
|
||||
Tcl_Obj *objPtr) /* ByteArray object whose string rep to
|
||||
* update. */
|
||||
{
|
||||
int i, length, size;
|
||||
size_t i, length, size;
|
||||
unsigned char *src;
|
||||
char *dst;
|
||||
ByteArray *byteArrayPtr;
|
||||
@@ -668,21 +663,21 @@ UpdateStringOfByteArray(
|
||||
*/
|
||||
|
||||
size = length;
|
||||
for (i = 0; i < length && size >= 0; i++) {
|
||||
for (i = 0; (i < length) && (size != TCL_AUTO_LENGTH); i++) {
|
||||
if ((src[i] == 0) || (src[i] > 127)) {
|
||||
size++;
|
||||
}
|
||||
}
|
||||
if (size < 0) {
|
||||
Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
|
||||
if (size == TCL_AUTO_LENGTH) {
|
||||
Tcl_Panic("max size for a Tcl value exceeded");
|
||||
}
|
||||
|
||||
dst = ckalloc(size + 1);
|
||||
dst = Tcl_Alloc(size + 1);
|
||||
objPtr->bytes = dst;
|
||||
objPtr->length = size;
|
||||
|
||||
if (size == length) {
|
||||
memcpy(dst, src, (size_t) size);
|
||||
memcpy(dst, src, size);
|
||||
dst[size] = '\0';
|
||||
} else {
|
||||
for (i = 0; i < length; i++) {
|
||||
@@ -715,15 +710,15 @@ void
|
||||
TclAppendBytesToByteArray(
|
||||
Tcl_Obj *objPtr,
|
||||
const unsigned char *bytes,
|
||||
int len)
|
||||
size_t len)
|
||||
{
|
||||
ByteArray *byteArrayPtr;
|
||||
int needed;
|
||||
size_t needed;
|
||||
|
||||
if (Tcl_IsShared(objPtr)) {
|
||||
Tcl_Panic("%s called with shared object","TclAppendBytesToByteArray");
|
||||
}
|
||||
if (len < 0) {
|
||||
if (len == TCL_AUTO_LENGTH) {
|
||||
Tcl_Panic("%s must be called with definite number of bytes to append",
|
||||
"TclAppendBytesToByteArray");
|
||||
}
|
||||
@@ -737,8 +732,8 @@ TclAppendBytesToByteArray(
|
||||
}
|
||||
byteArrayPtr = GET_BYTEARRAY(objPtr);
|
||||
|
||||
if (len > INT_MAX - byteArrayPtr->used) {
|
||||
Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
|
||||
if (len + byteArrayPtr->used > UINT_MAX) {
|
||||
Tcl_Panic("max size for a Tcl value (%u bytes) exceeded", UINT_MAX);
|
||||
}
|
||||
|
||||
needed = byteArrayPtr->used + len;
|
||||
@@ -748,26 +743,26 @@ TclAppendBytesToByteArray(
|
||||
|
||||
if (needed > byteArrayPtr->allocated) {
|
||||
ByteArray *ptr = NULL;
|
||||
int attempt;
|
||||
size_t attempt;
|
||||
|
||||
if (needed <= INT_MAX/2) {
|
||||
/* Try to allocate double the total space that is needed. */
|
||||
attempt = 2 * needed;
|
||||
ptr = attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
|
||||
ptr = Tcl_AttemptRealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
|
||||
}
|
||||
if (ptr == NULL) {
|
||||
/* Try to allocate double the increment that is needed (plus). */
|
||||
unsigned int limit = INT_MAX - needed;
|
||||
unsigned int extra = len + TCL_MIN_GROWTH;
|
||||
int growth = (int) ((extra > limit) ? limit : extra);
|
||||
size_t limit = INT_MAX - needed;
|
||||
size_t extra = len + TCL_MIN_GROWTH;
|
||||
size_t growth = (extra > limit) ? limit : extra;
|
||||
|
||||
attempt = needed + growth;
|
||||
ptr = attemptckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
|
||||
ptr = Tcl_AttemptRealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
|
||||
}
|
||||
if (ptr == NULL) {
|
||||
/* Last chance: Try to allocate exactly what is needed. */
|
||||
attempt = needed;
|
||||
ptr = ckrealloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
|
||||
ptr = Tcl_Realloc(byteArrayPtr, BYTEARRAY_SIZE(attempt));
|
||||
}
|
||||
byteArrayPtr = ptr;
|
||||
byteArrayPtr->allocated = attempt;
|
||||
@@ -2483,7 +2478,7 @@ BinaryDecodeHex(
|
||||
}
|
||||
|
||||
c = *data++;
|
||||
if (!isxdigit((int) c)) {
|
||||
if (!isxdigit(c)) {
|
||||
if (strict || !isspace(c)) {
|
||||
goto badChar;
|
||||
}
|
||||
@@ -2517,8 +2512,8 @@ BinaryDecodeHex(
|
||||
badChar:
|
||||
TclDecrRefCount(resultObj);
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"invalid hexadecimal digit \"%c\" at position %d",
|
||||
c, (int) (data - datastart - 1)));
|
||||
"invalid hexadecimal digit \"%c\" at position %" TCL_Z_MODIFIER "u",
|
||||
c, data - datastart - 1));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -2919,8 +2914,8 @@ BinaryDecodeUu(
|
||||
|
||||
badUu:
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"invalid uuencode character \"%c\" at position %d",
|
||||
c, (int) (data - datastart - 1)));
|
||||
"invalid uuencode character \"%c\" at position %" TCL_Z_MODIFIER "u",
|
||||
c, data - datastart - 1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "INVALID", NULL);
|
||||
TclDecrRefCount(resultObj);
|
||||
return TCL_ERROR;
|
||||
@@ -3069,8 +3064,8 @@ BinaryDecode64(
|
||||
|
||||
bad64:
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"invalid base64 character \"%c\" at position %d",
|
||||
(char) c, (int) (data - datastart - 1)));
|
||||
"invalid base64 character \"%c\" at position %" TCL_Z_MODIFIER "u",
|
||||
(char) c, data - datastart - 1));
|
||||
TclDecrRefCount(resultObj);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
+66
-116
@@ -20,9 +20,7 @@
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#undef Tcl_Alloc
|
||||
#undef Tcl_Free
|
||||
#undef Tcl_Realloc
|
||||
#undef Tcl_AttemptAlloc
|
||||
#undef Tcl_AttemptRealloc
|
||||
|
||||
@@ -33,7 +31,7 @@
|
||||
* "memory tag" command is invoked, to hold the current tag.
|
||||
*/
|
||||
|
||||
typedef struct MemTag {
|
||||
typedef struct {
|
||||
size_t refCount; /* Number of mem_headers referencing this
|
||||
* tag. */
|
||||
char string[1]; /* Actual size of string will be as large as
|
||||
@@ -121,7 +119,7 @@ static char dumpFile[100]; /* Records where to dump memory allocation
|
||||
/*
|
||||
* Mutex to serialize allocations. This is a low-level mutex that must be
|
||||
* explicitly initialized. This is necessary because the self initializing
|
||||
* mutexes use ckalloc...
|
||||
* mutexes use Tcl_Alloc...
|
||||
*/
|
||||
|
||||
static Tcl_Mutex *ckallocMutexPtr;
|
||||
@@ -245,7 +243,7 @@ ValidateMemory(
|
||||
guard_failed = TRUE;
|
||||
fflush(stdout);
|
||||
byte &= 0xff;
|
||||
fprintf(stderr, "low guard byte %d is 0x%x \t%c\n", (int)idx, byte,
|
||||
fprintf(stderr, "low guard byte %" TCL_Z_MODIFIER "u is 0x%x \t%c\n", idx, byte,
|
||||
(isprint(UCHAR(byte)) ? byte : ' ')); /* INTL: bytes */
|
||||
}
|
||||
}
|
||||
@@ -266,7 +264,7 @@ ValidateMemory(
|
||||
guard_failed = TRUE;
|
||||
fflush(stdout);
|
||||
byte &= 0xff;
|
||||
fprintf(stderr, "hi guard byte %d is 0x%x \t%c\n", (int)idx, byte,
|
||||
fprintf(stderr, "hi guard byte %" TCL_Z_MODIFIER "u is 0x%x \t%c\n", idx, byte,
|
||||
(isprint(UCHAR(byte)) ? byte : ' ')); /* INTL: bytes */
|
||||
}
|
||||
}
|
||||
@@ -376,7 +374,7 @@ Tcl_DumpActiveMemory(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_DbCkalloc - debugging ckalloc
|
||||
* Tcl_DbCkalloc - debugging Tcl_Alloc
|
||||
*
|
||||
* Allocate the requested amount of space plus some extra for guard bands
|
||||
* at both ends of the request, plus a size, panicing if there isn't
|
||||
@@ -385,15 +383,15 @@ Tcl_DumpActiveMemory(
|
||||
*
|
||||
* The second and third arguments are file and line, these contain the
|
||||
* filename and line number corresponding to the caller. These are sent
|
||||
* by the ckalloc macro; it uses the preprocessor autodefines __FILE__
|
||||
* by the Tcl_Alloc macro; it uses the preprocessor autodefines __FILE__
|
||||
* and __LINE__.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char *
|
||||
void *
|
||||
Tcl_DbCkalloc(
|
||||
unsigned int size,
|
||||
size_t size,
|
||||
const char *file,
|
||||
int line)
|
||||
{
|
||||
@@ -411,7 +409,7 @@ Tcl_DbCkalloc(
|
||||
if (result == NULL) {
|
||||
fflush(stdout);
|
||||
TclDumpMemoryInfo((ClientData) stderr, 0);
|
||||
Tcl_Panic("unable to alloc %u bytes, %s line %d", size, file, line);
|
||||
Tcl_Panic("unable to alloc %" TCL_Z_MODIFIER "u bytes, %s line %d", size, file, line);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -457,7 +455,7 @@ Tcl_DbCkalloc(
|
||||
}
|
||||
|
||||
if (alloc_tracing) {
|
||||
fprintf(stderr,"ckalloc %p %u %s %d\n",
|
||||
fprintf(stderr,"Tcl_Alloc %p %" TCL_Z_MODIFIER "u %s %d\n",
|
||||
result->body, size, file, line);
|
||||
}
|
||||
|
||||
@@ -481,9 +479,9 @@ Tcl_DbCkalloc(
|
||||
return result->body;
|
||||
}
|
||||
|
||||
char *
|
||||
void *
|
||||
Tcl_AttemptDbCkalloc(
|
||||
unsigned int size,
|
||||
size_t size,
|
||||
const char *file,
|
||||
int line)
|
||||
{
|
||||
@@ -546,7 +544,7 @@ Tcl_AttemptDbCkalloc(
|
||||
}
|
||||
|
||||
if (alloc_tracing) {
|
||||
fprintf(stderr,"ckalloc %p %u %s %d\n",
|
||||
fprintf(stderr,"Tcl_Alloc %p %" TCL_Z_MODIFIER "u %s %d\n",
|
||||
result->body, size, file, line);
|
||||
}
|
||||
|
||||
@@ -573,7 +571,7 @@ Tcl_AttemptDbCkalloc(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_DbCkfree - debugging ckfree
|
||||
* Tcl_DbCkfree - debugging Tcl_Free
|
||||
*
|
||||
* Verify that the low and high guards are intact, and if so then free
|
||||
* the buffer else Tcl_Panic.
|
||||
@@ -582,7 +580,7 @@ Tcl_AttemptDbCkalloc(
|
||||
*
|
||||
* The second and third arguments are file and line, these contain the
|
||||
* filename and line number corresponding to the caller. These are sent
|
||||
* by the ckfree macro; it uses the preprocessor autodefines __FILE__ and
|
||||
* by the Tcl_Free macro; it uses the preprocessor autodefines __FILE__ and
|
||||
* __LINE__.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -590,7 +588,7 @@ Tcl_AttemptDbCkalloc(
|
||||
|
||||
void
|
||||
Tcl_DbCkfree(
|
||||
char *ptr,
|
||||
void *ptr,
|
||||
const char *file,
|
||||
int line)
|
||||
{
|
||||
@@ -611,7 +609,7 @@ Tcl_DbCkfree(
|
||||
memp = (struct mem_header *) (((size_t) ptr) - BODY_OFFSET);
|
||||
|
||||
if (alloc_tracing) {
|
||||
fprintf(stderr, "ckfree %p %" TCL_Z_MODIFIER "u %s %d\n",
|
||||
fprintf(stderr, "Tcl_Free %p %" TCL_Z_MODIFIER "u %s %d\n",
|
||||
memp->body, memp->length, file, line);
|
||||
}
|
||||
|
||||
@@ -655,7 +653,7 @@ Tcl_DbCkfree(
|
||||
/*
|
||||
*--------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_DbCkrealloc - debugging ckrealloc
|
||||
* Tcl_DbCkrealloc - debugging Tcl_Realloc
|
||||
*
|
||||
* Reallocate a chunk of memory by allocating a new one of the right
|
||||
* size, copying the old data to the new location, and then freeing the
|
||||
@@ -665,10 +663,10 @@ Tcl_DbCkfree(
|
||||
*--------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char *
|
||||
void *
|
||||
Tcl_DbCkrealloc(
|
||||
char *ptr,
|
||||
unsigned int size,
|
||||
void *ptr,
|
||||
size_t size,
|
||||
const char *file,
|
||||
int line)
|
||||
{
|
||||
@@ -696,10 +694,10 @@ Tcl_DbCkrealloc(
|
||||
return newPtr;
|
||||
}
|
||||
|
||||
char *
|
||||
void *
|
||||
Tcl_AttemptDbCkrealloc(
|
||||
char *ptr,
|
||||
unsigned int size,
|
||||
void *ptr,
|
||||
size_t size,
|
||||
const char *file,
|
||||
int line)
|
||||
{
|
||||
@@ -730,59 +728,6 @@ Tcl_AttemptDbCkrealloc(
|
||||
return newPtr;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_Alloc, et al. --
|
||||
*
|
||||
* These functions are defined in terms of the debugging versions when
|
||||
* TCL_MEM_DEBUG is set.
|
||||
*
|
||||
* Results:
|
||||
* Same as the debug versions.
|
||||
*
|
||||
* Side effects:
|
||||
* Same as the debug versions.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char *
|
||||
Tcl_Alloc(
|
||||
unsigned int size)
|
||||
{
|
||||
return Tcl_DbCkalloc(size, "unknown", 0);
|
||||
}
|
||||
|
||||
char *
|
||||
Tcl_AttemptAlloc(
|
||||
unsigned int size)
|
||||
{
|
||||
return Tcl_AttemptDbCkalloc(size, "unknown", 0);
|
||||
}
|
||||
|
||||
void
|
||||
Tcl_Free(
|
||||
char *ptr)
|
||||
{
|
||||
Tcl_DbCkfree(ptr, "unknown", 0);
|
||||
}
|
||||
|
||||
char *
|
||||
Tcl_Realloc(
|
||||
char *ptr,
|
||||
unsigned int size)
|
||||
{
|
||||
return Tcl_DbCkrealloc(ptr, size, "unknown", 0);
|
||||
}
|
||||
char *
|
||||
Tcl_AttemptRealloc(
|
||||
char *ptr,
|
||||
unsigned int size)
|
||||
{
|
||||
return Tcl_AttemptDbCkrealloc(ptr, size, "unknown", 0);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -1052,11 +997,12 @@ Tcl_InitMemory(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char *
|
||||
#undef Tcl_Alloc
|
||||
void *
|
||||
Tcl_Alloc(
|
||||
unsigned int size)
|
||||
size_t size)
|
||||
{
|
||||
char *result;
|
||||
void *result;
|
||||
|
||||
result = TclpAlloc(size);
|
||||
|
||||
@@ -1071,24 +1017,25 @@ Tcl_Alloc(
|
||||
*/
|
||||
|
||||
if ((result == NULL) && size) {
|
||||
Tcl_Panic("unable to alloc %u bytes", size);
|
||||
Tcl_Panic("unable to alloc %" TCL_Z_MODIFIER "u bytes", size);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
char *
|
||||
void *
|
||||
Tcl_DbCkalloc(
|
||||
unsigned int size,
|
||||
size_t size,
|
||||
const char *file,
|
||||
int line)
|
||||
{
|
||||
char *result;
|
||||
void *result;
|
||||
|
||||
result = (char *) TclpAlloc(size);
|
||||
result = TclpAlloc(size);
|
||||
|
||||
if ((result == NULL) && size) {
|
||||
fflush(stdout);
|
||||
Tcl_Panic("unable to alloc %u bytes, %s line %d", size, file, line);
|
||||
Tcl_Panic("unable to alloc %" TCL_Z_MODIFIER "u bytes, %s line %d",
|
||||
size, file, line);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1104,25 +1051,25 @@ Tcl_DbCkalloc(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char *
|
||||
void *
|
||||
Tcl_AttemptAlloc(
|
||||
unsigned int size)
|
||||
size_t size)
|
||||
{
|
||||
char *result;
|
||||
void *result;
|
||||
|
||||
result = TclpAlloc(size);
|
||||
return result;
|
||||
}
|
||||
|
||||
char *
|
||||
void *
|
||||
Tcl_AttemptDbCkalloc(
|
||||
unsigned int size,
|
||||
size_t size,
|
||||
const char *file,
|
||||
int line)
|
||||
{
|
||||
char *result;
|
||||
void *result;
|
||||
|
||||
result = (char *) TclpAlloc(size);
|
||||
result = TclpAlloc(size);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1137,35 +1084,37 @@ Tcl_AttemptDbCkalloc(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char *
|
||||
#undef Tcl_Realloc
|
||||
void *
|
||||
Tcl_Realloc(
|
||||
char *ptr,
|
||||
unsigned int size)
|
||||
void *ptr,
|
||||
size_t size)
|
||||
{
|
||||
char *result;
|
||||
|
||||
result = TclpRealloc(ptr, size);
|
||||
|
||||
if ((result == NULL) && size) {
|
||||
Tcl_Panic("unable to realloc %u bytes", size);
|
||||
Tcl_Panic("unable to realloc %" TCL_Z_MODIFIER "u bytes", size);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
char *
|
||||
void *
|
||||
Tcl_DbCkrealloc(
|
||||
char *ptr,
|
||||
unsigned int size,
|
||||
void *ptr,
|
||||
size_t size,
|
||||
const char *file,
|
||||
int line)
|
||||
{
|
||||
char *result;
|
||||
void *result;
|
||||
|
||||
result = (char *) TclpRealloc(ptr, size);
|
||||
result = TclpRealloc(ptr, size);
|
||||
|
||||
if ((result == NULL) && size) {
|
||||
fflush(stdout);
|
||||
Tcl_Panic("unable to realloc %u bytes, %s line %d", size, file, line);
|
||||
Tcl_Panic("unable to realloc %" TCL_Z_MODIFIER "u bytes, %s line %d",
|
||||
size, file, line);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1181,27 +1130,27 @@ Tcl_DbCkrealloc(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char *
|
||||
void *
|
||||
Tcl_AttemptRealloc(
|
||||
char *ptr,
|
||||
unsigned int size)
|
||||
void *ptr,
|
||||
size_t size)
|
||||
{
|
||||
char *result;
|
||||
void *result;
|
||||
|
||||
result = TclpRealloc(ptr, size);
|
||||
return result;
|
||||
}
|
||||
|
||||
char *
|
||||
void *
|
||||
Tcl_AttemptDbCkrealloc(
|
||||
char *ptr,
|
||||
unsigned int size,
|
||||
void *ptr,
|
||||
size_t size,
|
||||
const char *file,
|
||||
int line)
|
||||
{
|
||||
char *result;
|
||||
void *result;
|
||||
|
||||
result = (char *) TclpRealloc(ptr, size);
|
||||
result = TclpRealloc(ptr, size);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1217,16 +1166,17 @@ Tcl_AttemptDbCkrealloc(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#undef Tcl_Free
|
||||
void
|
||||
Tcl_Free(
|
||||
char *ptr)
|
||||
void *ptr)
|
||||
{
|
||||
TclpFree(ptr);
|
||||
}
|
||||
|
||||
void
|
||||
Tcl_DbCkfree(
|
||||
char *ptr,
|
||||
void *ptr,
|
||||
const char *file,
|
||||
int line)
|
||||
{
|
||||
|
||||
+8
-8
@@ -100,7 +100,7 @@ typedef struct {
|
||||
* Structure containing the fields used in [clock format] and [clock scan]
|
||||
*/
|
||||
|
||||
typedef struct TclDateFields {
|
||||
typedef struct {
|
||||
Tcl_WideInt seconds; /* Time expressed in seconds from the Posix
|
||||
* epoch */
|
||||
Tcl_WideInt localSeconds; /* Local time expressed in nominal seconds
|
||||
@@ -275,9 +275,9 @@ TclClockInit(
|
||||
* Create the client data, which is a refcounted literal pool.
|
||||
*/
|
||||
|
||||
data = ckalloc(sizeof(ClockClientData));
|
||||
data = Tcl_Alloc(sizeof(ClockClientData));
|
||||
data->refCount = 0;
|
||||
data->literals = ckalloc(LIT__END * sizeof(Tcl_Obj*));
|
||||
data->literals = Tcl_Alloc(LIT__END * sizeof(Tcl_Obj*));
|
||||
for (i = 0; i < LIT__END; ++i) {
|
||||
data->literals[i] = Tcl_NewStringObj(literals[i], -1);
|
||||
Tcl_IncrRefCount(data->literals[i]);
|
||||
@@ -2039,13 +2039,13 @@ TzsetIfNecessary(void)
|
||||
|| strcmp(tzIsNow, tzWas) != 0)) {
|
||||
tzset();
|
||||
if (tzWas != NULL && tzWas != INT2PTR(-1)) {
|
||||
ckfree(tzWas);
|
||||
Tcl_Free(tzWas);
|
||||
}
|
||||
tzWas = ckalloc(strlen(tzIsNow) + 1);
|
||||
tzWas = Tcl_Alloc(strlen(tzIsNow) + 1);
|
||||
strcpy(tzWas, tzIsNow);
|
||||
} else if (tzIsNow == NULL && tzWas != NULL) {
|
||||
tzset();
|
||||
if (tzWas != INT2PTR(-1)) ckfree(tzWas);
|
||||
if (tzWas != INT2PTR(-1)) Tcl_Free(tzWas);
|
||||
tzWas = NULL;
|
||||
}
|
||||
Tcl_MutexUnlock(&clockMutex);
|
||||
@@ -2076,8 +2076,8 @@ ClockDeleteCmdProc(
|
||||
for (i = 0; i < LIT__END; ++i) {
|
||||
Tcl_DecrRefCount(data->literals[i]);
|
||||
}
|
||||
ckfree(data->literals);
|
||||
ckfree(data);
|
||||
Tcl_Free(data->literals);
|
||||
Tcl_Free(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-140
@@ -147,143 +147,6 @@ Tcl_BreakObjCmd(
|
||||
return TCL_BREAK;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_CaseObjCmd --
|
||||
*
|
||||
* This procedure is invoked to process the "case" Tcl command. See the
|
||||
* user documentation for details on what it does. THIS COMMAND IS
|
||||
* OBSOLETE AND DEPRECATED. SLATED FOR REMOVAL IN TCL 9.0.
|
||||
*
|
||||
* Results:
|
||||
* A standard Tcl object result.
|
||||
*
|
||||
* Side effects:
|
||||
* See the user documentation.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_CaseObjCmd(
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
register int i;
|
||||
int body, result, caseObjc;
|
||||
const char *stringPtr, *arg;
|
||||
Tcl_Obj *const *caseObjv;
|
||||
Tcl_Obj *armPtr;
|
||||
|
||||
if (objc < 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
"string ?in? ?pattern body ...? ?default body?");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
stringPtr = TclGetString(objv[1]);
|
||||
body = -1;
|
||||
|
||||
arg = TclGetString(objv[2]);
|
||||
if (strcmp(arg, "in") == 0) {
|
||||
i = 3;
|
||||
} else {
|
||||
i = 2;
|
||||
}
|
||||
caseObjc = objc - i;
|
||||
caseObjv = objv + i;
|
||||
|
||||
/*
|
||||
* If all of the pattern/command pairs are lumped into a single argument,
|
||||
* split them out again.
|
||||
*/
|
||||
|
||||
if (caseObjc == 1) {
|
||||
Tcl_Obj **newObjv;
|
||||
|
||||
TclListObjGetElements(interp, caseObjv[0], &caseObjc, &newObjv);
|
||||
caseObjv = newObjv;
|
||||
}
|
||||
|
||||
for (i = 0; i < caseObjc; i += 2) {
|
||||
int patObjc, j;
|
||||
const char **patObjv;
|
||||
const char *pat, *p;
|
||||
|
||||
if (i == caseObjc-1) {
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"extra case pattern with no body", -1));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for special case of single pattern (no list) with no
|
||||
* backslash sequences.
|
||||
*/
|
||||
|
||||
pat = TclGetString(caseObjv[i]);
|
||||
for (p = pat; *p != '\0'; p++) {
|
||||
if (TclIsSpaceProc(*p) || (*p == '\\')) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (*p == '\0') {
|
||||
if ((*pat == 'd') && (strcmp(pat, "default") == 0)) {
|
||||
body = i + 1;
|
||||
}
|
||||
if (Tcl_StringMatch(stringPtr, pat)) {
|
||||
body = i + 1;
|
||||
goto match;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Break up pattern lists, then check each of the patterns in the
|
||||
* list.
|
||||
*/
|
||||
|
||||
result = Tcl_SplitList(interp, pat, &patObjc, &patObjv);
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
for (j = 0; j < patObjc; j++) {
|
||||
if (Tcl_StringMatch(stringPtr, patObjv[j])) {
|
||||
body = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ckfree(patObjv);
|
||||
if (j < patObjc) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
match:
|
||||
if (body != -1) {
|
||||
armPtr = caseObjv[body - 1];
|
||||
result = Tcl_EvalObjEx(interp, caseObjv[body], 0);
|
||||
if (result == TCL_ERROR) {
|
||||
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
|
||||
"\n (\"%.50s\" arm line %d)",
|
||||
TclGetString(armPtr), Tcl_GetErrorLine(interp)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Nothing matched: return nothing.
|
||||
*/
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -676,7 +539,7 @@ EncodingConvertfromObjCmd(
|
||||
Tcl_Obj *data; /* Byte array to convert */
|
||||
Tcl_DString ds; /* Buffer to hold the string */
|
||||
Tcl_Encoding encoding; /* Encoding to use */
|
||||
int length; /* Length of the byte array being converted */
|
||||
size_t length; /* Length of the byte array being converted */
|
||||
const char *bytesPtr; /* Pointer to the first byte of the array */
|
||||
|
||||
if (objc == 2) {
|
||||
@@ -695,7 +558,7 @@ EncodingConvertfromObjCmd(
|
||||
/*
|
||||
* Convert the string into a byte array in 'ds'
|
||||
*/
|
||||
bytesPtr = (char *) Tcl_GetByteArrayFromObj(data, &length);
|
||||
bytesPtr = (char *) TclGetByteArrayFromObj(data, &length);
|
||||
Tcl_ExternalToUtfDString(encoding, bytesPtr, length, &ds);
|
||||
|
||||
/*
|
||||
@@ -738,7 +601,7 @@ EncodingConverttoObjCmd(
|
||||
Tcl_Obj *data; /* String to convert */
|
||||
Tcl_DString ds; /* Buffer to hold the byte array */
|
||||
Tcl_Encoding encoding; /* Encoding to use */
|
||||
int length; /* Length of the string being converted */
|
||||
size_t length; /* Length of the string being converted */
|
||||
const char *stringPtr; /* Pointer to the first byte of the string */
|
||||
|
||||
/* TODO - ADJUST OBJ INDICES WHEN ENSEMBLIFYING THIS */
|
||||
|
||||
+10
-8
@@ -56,7 +56,7 @@ typedef int (*SortMemCmpFn_t) (const void *, const void *, size_t);
|
||||
* The following structure is used to pass this information.
|
||||
*/
|
||||
|
||||
typedef struct SortInfo {
|
||||
typedef struct {
|
||||
int isIncreasing; /* Nonzero means sort in increasing order. */
|
||||
int sortMode; /* The sort mode. One of SORTMODE_* values
|
||||
* defined below. */
|
||||
@@ -661,7 +661,7 @@ InfoCommandsCmd(
|
||||
Tcl_Obj *listPtr, *elemObjPtr;
|
||||
int specificNsInPattern = 0;/* Init. to avoid compiler warning. */
|
||||
Tcl_Command cmd;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
/*
|
||||
* Get the pattern and find the "effective namespace" in which to list
|
||||
@@ -1406,7 +1406,7 @@ TclInfoFrame(
|
||||
ADD_PAIR("proc", procNameObj);
|
||||
} else if (procPtr->cmdPtr->clientData) {
|
||||
ExtraFrameInfo *efiPtr = procPtr->cmdPtr->clientData;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
/*
|
||||
* This is a non-standard command. Luckily, it's told us how to
|
||||
@@ -2210,7 +2210,8 @@ Tcl_JoinObjCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
{
|
||||
int length, listLen;
|
||||
size_t length;
|
||||
int listLen;
|
||||
Tcl_Obj *resObjPtr = NULL, *joinObjPtr, **elemPtrs;
|
||||
|
||||
if ((objc < 2) || (objc > 3)) {
|
||||
@@ -2241,7 +2242,7 @@ Tcl_JoinObjCmd(
|
||||
joinObjPtr = (objc == 2) ? Tcl_NewStringObj(" ", 1) : objv[2];
|
||||
Tcl_IncrRefCount(joinObjPtr);
|
||||
|
||||
(void) Tcl_GetStringFromObj(joinObjPtr, &length);
|
||||
(void) TclGetStringFromObj(joinObjPtr, &length);
|
||||
if (length == 0) {
|
||||
resObjPtr = TclStringCat(interp, listLen, elemPtrs, 0);
|
||||
} else {
|
||||
@@ -2935,7 +2936,8 @@ Tcl_LsearchObjCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument values. */
|
||||
{
|
||||
const char *bytes, *patternBytes;
|
||||
int i, match, index, result=TCL_OK, listc, length, elemLen, bisect;
|
||||
int i, match, index, result=TCL_OK, listc, bisect;
|
||||
size_t length = 0, elemLen;
|
||||
int allocatedIndexVector = 0;
|
||||
int dataType, isIncreasing, lower, upper, start, groupSize, groupOffset;
|
||||
Tcl_WideInt patWide, objWide;
|
||||
@@ -4101,7 +4103,7 @@ Tcl_LsortObjCmd(
|
||||
* begins sorting it into the sublists as it appears.
|
||||
*/
|
||||
|
||||
elementArray = ckalloc(length * sizeof(SortElement));
|
||||
elementArray = Tcl_Alloc(length * sizeof(SortElement));
|
||||
|
||||
for (i=0; i < length; i++){
|
||||
idx = groupSize * i + groupOffset;
|
||||
@@ -4234,7 +4236,7 @@ Tcl_LsortObjCmd(
|
||||
TclStackFree(interp, sortInfo.indexv);
|
||||
}
|
||||
if (elementArray) {
|
||||
ckfree(elementArray);
|
||||
Tcl_Free(elementArray);
|
||||
}
|
||||
return sortInfo.resultCode;
|
||||
}
|
||||
|
||||
+58
-51
@@ -486,7 +486,8 @@ Tcl_RegsubObjCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int idx, result, cflags, all, wlen, wsublen, numMatches, offset;
|
||||
int idx, result, cflags, all, numMatches, offset;
|
||||
size_t wlen, wsublen = 0;
|
||||
int start, end, subStart, subEnd, match, command, numParts;
|
||||
Tcl_RegExp regExpr;
|
||||
Tcl_RegExpInfo info;
|
||||
@@ -597,17 +598,18 @@ Tcl_RegsubObjCmd(
|
||||
* slightly modified version of the one pair STR_MAP code.
|
||||
*/
|
||||
|
||||
int slen, nocase, wsrclc;
|
||||
int (*strCmpFn)(const Tcl_UniChar*,const Tcl_UniChar*,unsigned long);
|
||||
size_t slen;
|
||||
int nocase, wsrclc;
|
||||
int (*strCmpFn)(const Tcl_UniChar*,const Tcl_UniChar*,size_t);
|
||||
Tcl_UniChar *p;
|
||||
|
||||
numMatches = 0;
|
||||
nocase = (cflags & TCL_REG_NOCASE);
|
||||
strCmpFn = nocase ? Tcl_UniCharNcasecmp : Tcl_UniCharNcmp;
|
||||
|
||||
wsrc = Tcl_GetUnicodeFromObj(objv[0], &slen);
|
||||
wstring = Tcl_GetUnicodeFromObj(objv[1], &wlen);
|
||||
wsubspec = Tcl_GetUnicodeFromObj(objv[2], &wsublen);
|
||||
wsrc = TclGetUnicodeFromObj(objv[0], &slen);
|
||||
wstring = TclGetUnicodeFromObj(objv[1], &wlen);
|
||||
wsubspec = TclGetUnicodeFromObj(objv[2], &wsublen);
|
||||
wend = wstring + wlen - (slen ? slen - 1 : 0);
|
||||
result = TCL_OK;
|
||||
|
||||
@@ -633,7 +635,7 @@ Tcl_RegsubObjCmd(
|
||||
if ((*wstring == *wsrc ||
|
||||
(nocase && Tcl_UniCharToLower(*wstring)==wsrclc)) &&
|
||||
(slen==1 || (strCmpFn(wstring, wsrc,
|
||||
(unsigned long) slen) == 0))) {
|
||||
(size_t)slen) == 0))) {
|
||||
if (numMatches == 0) {
|
||||
resultPtr = Tcl_NewUnicodeObj(wstring, 0);
|
||||
Tcl_IncrRefCount(resultPtr);
|
||||
@@ -698,14 +700,14 @@ Tcl_RegsubObjCmd(
|
||||
} else {
|
||||
objPtr = objv[1];
|
||||
}
|
||||
wstring = Tcl_GetUnicodeFromObj(objPtr, &wlen);
|
||||
wstring = TclGetUnicodeFromObj(objPtr, &wlen);
|
||||
if (objv[2] == objv[0]) {
|
||||
subPtr = Tcl_DuplicateObj(objv[2]);
|
||||
} else {
|
||||
subPtr = objv[2];
|
||||
}
|
||||
if (!command) {
|
||||
wsubspec = Tcl_GetUnicodeFromObj(subPtr, &wsublen);
|
||||
wsubspec = TclGetUnicodeFromObj(subPtr, &wsublen);
|
||||
}
|
||||
|
||||
result = TCL_OK;
|
||||
@@ -721,7 +723,7 @@ Tcl_RegsubObjCmd(
|
||||
*/
|
||||
|
||||
numMatches = 0;
|
||||
for ( ; offset <= wlen; ) {
|
||||
for ( ; (size_t)offset <= wlen; ) {
|
||||
|
||||
/*
|
||||
* The flags argument is set if string is part of a larger string, so
|
||||
@@ -777,7 +779,7 @@ Tcl_RegsubObjCmd(
|
||||
|
||||
Tcl_ListObjGetElements(interp, subPtr, &numParts, &parts);
|
||||
numArgs = numParts + info.nsubs + 1;
|
||||
args = ckalloc(sizeof(Tcl_Obj*) * numArgs);
|
||||
args = Tcl_Alloc(sizeof(Tcl_Obj*) * numArgs);
|
||||
memcpy(args, parts, sizeof(Tcl_Obj*) * numParts);
|
||||
|
||||
for (idx = 0 ; idx <= info.nsubs ; idx++) {
|
||||
@@ -807,7 +809,7 @@ Tcl_RegsubObjCmd(
|
||||
for (idx = 0 ; idx <= info.nsubs ; idx++) {
|
||||
TclDecrRefCount(args[idx + numParts]);
|
||||
}
|
||||
ckfree(args);
|
||||
Tcl_Free(args);
|
||||
if (result != TCL_OK) {
|
||||
if (result == TCL_ERROR) {
|
||||
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
|
||||
@@ -825,7 +827,7 @@ Tcl_RegsubObjCmd(
|
||||
* the user code.
|
||||
*/
|
||||
|
||||
wstring = Tcl_GetUnicodeFromObj(objPtr, &wlen);
|
||||
wstring = TclGetUnicodeFromObj(objPtr, &wlen);
|
||||
|
||||
offset += end;
|
||||
if (end == 0 || start == end) {
|
||||
@@ -836,7 +838,7 @@ Tcl_RegsubObjCmd(
|
||||
* again at the same spot.
|
||||
*/
|
||||
|
||||
if (offset < wlen) {
|
||||
if ((size_t)offset < wlen) {
|
||||
Tcl_AppendUnicodeToObj(resultPtr, wstring + offset, 1);
|
||||
}
|
||||
offset++;
|
||||
@@ -909,7 +911,7 @@ Tcl_RegsubObjCmd(
|
||||
* order to prevent infinite loops.
|
||||
*/
|
||||
|
||||
if (offset < wlen) {
|
||||
if ((size_t)offset < wlen) {
|
||||
Tcl_AppendUnicodeToObj(resultPtr, wstring + offset, 1);
|
||||
}
|
||||
offset++;
|
||||
@@ -921,7 +923,7 @@ Tcl_RegsubObjCmd(
|
||||
* one more step so we don't match again at the same spot.
|
||||
*/
|
||||
|
||||
if (offset < wlen) {
|
||||
if ((size_t)offset < wlen) {
|
||||
Tcl_AppendUnicodeToObj(resultPtr, wstring + offset, 1);
|
||||
}
|
||||
offset++;
|
||||
@@ -946,7 +948,7 @@ Tcl_RegsubObjCmd(
|
||||
|
||||
resultPtr = objv[1];
|
||||
Tcl_IncrRefCount(resultPtr);
|
||||
} else if (offset < wlen) {
|
||||
} else if ((size_t)offset < wlen) {
|
||||
Tcl_AppendUnicodeToObj(resultPtr, wstring + offset, wlen - offset);
|
||||
}
|
||||
if (objc == 4) {
|
||||
@@ -1178,7 +1180,7 @@ Tcl_SplitObjCmd(
|
||||
const char *splitChars;
|
||||
const char *stringPtr;
|
||||
const char *end;
|
||||
int splitCharLen, stringLen;
|
||||
size_t splitCharLen, stringLen;
|
||||
Tcl_Obj *listPtr, *objPtr;
|
||||
|
||||
if (objc == 2) {
|
||||
@@ -1257,7 +1259,7 @@ Tcl_SplitObjCmd(
|
||||
* byte in length.
|
||||
*/
|
||||
|
||||
while (*stringPtr && (p=strchr(stringPtr,(int)*splitChars)) != NULL) {
|
||||
while (*stringPtr && (p=strchr(stringPtr,*splitChars)) != NULL) {
|
||||
objPtr = Tcl_NewStringObj(stringPtr, p - stringPtr);
|
||||
Tcl_ListObjAppendElement(NULL, listPtr, objPtr);
|
||||
stringPtr = p + 1;
|
||||
@@ -1336,7 +1338,7 @@ StringFirstCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(TclStringFirst(objv[1],
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(TclStringFirst(objv[1],
|
||||
objv[2], start)));
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1484,7 +1486,8 @@ StringIsCmd(
|
||||
const char *string1, *end, *stop;
|
||||
Tcl_UniChar ch = 0;
|
||||
int (*chcomp)(int) = NULL; /* The UniChar comparison function. */
|
||||
int i, failat = 0, result = 1, strict = 0, index, length1, length2;
|
||||
int i, failat = 0, result = 1, strict = 0, index, length3;
|
||||
size_t length1, length2;
|
||||
Tcl_Obj *objPtr, *failVarObj = NULL;
|
||||
Tcl_WideInt w;
|
||||
|
||||
@@ -1579,11 +1582,9 @@ StringIsCmd(
|
||||
string1 = TclGetStringFromObj(objPtr, &length1);
|
||||
result = length1 == 0;
|
||||
}
|
||||
} else if (index != STR_IS_BOOL) {
|
||||
TclGetBooleanFromObj(NULL, objPtr, &i);
|
||||
if ((index == STR_IS_TRUE) ^ i) {
|
||||
result = 0;
|
||||
}
|
||||
} else if ((objPtr->internalRep.wideValue != 0)
|
||||
? (index == STR_IS_FALSE) : (index == STR_IS_TRUE)) {
|
||||
result = 0;
|
||||
}
|
||||
break;
|
||||
case STR_IS_CONTROL:
|
||||
@@ -1728,7 +1729,7 @@ StringIsCmd(
|
||||
* well-formed lists.
|
||||
*/
|
||||
|
||||
if (TCL_OK == TclListObjLength(NULL, objPtr, &length2)) {
|
||||
if (TCL_OK == TclListObjLength(NULL, objPtr, &length3)) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1740,7 +1741,8 @@ StringIsCmd(
|
||||
*/
|
||||
|
||||
const char *elemStart, *nextElem;
|
||||
int lenRemain, elemSize;
|
||||
size_t lenRemain;
|
||||
size_t elemSize;
|
||||
register const char *p;
|
||||
|
||||
string1 = TclGetStringFromObj(objPtr, &length1);
|
||||
@@ -1877,11 +1879,12 @@ StringMapCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int length1, length2, mapElemc, index;
|
||||
size_t length1, length2;
|
||||
int mapElemc, index;
|
||||
int nocase = 0, mapWithDict = 0, copySource = 0;
|
||||
Tcl_Obj **mapElemv, *sourceObj, *resultPtr;
|
||||
Tcl_UniChar *ustring1, *ustring2, *p, *end;
|
||||
int (*strCmpFn)(const Tcl_UniChar*, const Tcl_UniChar*, unsigned long);
|
||||
int (*strCmpFn)(const Tcl_UniChar*, const Tcl_UniChar*, size_t);
|
||||
|
||||
if (objc < 3 || objc > 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?-nocase? charMap string");
|
||||
@@ -1978,7 +1981,7 @@ StringMapCmd(
|
||||
} else {
|
||||
sourceObj = objv[objc-1];
|
||||
}
|
||||
ustring1 = Tcl_GetUnicodeFromObj(sourceObj, &length1);
|
||||
ustring1 = TclGetUnicodeFromObj(sourceObj, &length1);
|
||||
if (length1 == 0) {
|
||||
/*
|
||||
* Empty input string, just stop now.
|
||||
@@ -2004,10 +2007,11 @@ StringMapCmd(
|
||||
* larger strings.
|
||||
*/
|
||||
|
||||
int mapLen, u2lc;
|
||||
size_t mapLen;
|
||||
int u2lc;
|
||||
Tcl_UniChar *mapString;
|
||||
|
||||
ustring2 = Tcl_GetUnicodeFromObj(mapElemv[0], &length2);
|
||||
ustring2 = TclGetUnicodeFromObj(mapElemv[0], &length2);
|
||||
p = ustring1;
|
||||
if ((length2 > length1) || (length2 == 0)) {
|
||||
/*
|
||||
@@ -2016,13 +2020,13 @@ StringMapCmd(
|
||||
|
||||
ustring1 = end;
|
||||
} else {
|
||||
mapString = Tcl_GetUnicodeFromObj(mapElemv[1], &mapLen);
|
||||
mapString = TclGetUnicodeFromObj(mapElemv[1], &mapLen);
|
||||
u2lc = (nocase ? Tcl_UniCharToLower(*ustring2) : 0);
|
||||
for (; ustring1 < end; ustring1++) {
|
||||
if (((*ustring1 == *ustring2) ||
|
||||
(nocase&&Tcl_UniCharToLower(*ustring1)==u2lc)) &&
|
||||
(length2==1 || strCmpFn(ustring1, ustring2,
|
||||
(unsigned long) length2) == 0)) {
|
||||
length2) == 0)) {
|
||||
if (p != ustring1) {
|
||||
Tcl_AppendUnicodeToObj(resultPtr, p, ustring1-p);
|
||||
p = ustring1 + length2;
|
||||
@@ -2037,7 +2041,8 @@ StringMapCmd(
|
||||
}
|
||||
} else {
|
||||
Tcl_UniChar **mapStrings;
|
||||
int *mapLens, *u2lc = NULL;
|
||||
size_t *mapLens;
|
||||
int *u2lc = 0;
|
||||
|
||||
/*
|
||||
* Precompute pointers to the unicode string and length. This saves us
|
||||
@@ -2046,13 +2051,13 @@ StringMapCmd(
|
||||
* case.
|
||||
*/
|
||||
|
||||
mapStrings = TclStackAlloc(interp, mapElemc*2*sizeof(Tcl_UniChar *));
|
||||
mapLens = TclStackAlloc(interp, mapElemc * 2 * sizeof(int));
|
||||
mapStrings = TclStackAlloc(interp, mapElemc*sizeof(Tcl_UniChar *)*2);
|
||||
mapLens = TclStackAlloc(interp, mapElemc * sizeof(size_t) * 2);
|
||||
if (nocase) {
|
||||
u2lc = TclStackAlloc(interp, mapElemc * sizeof(int));
|
||||
}
|
||||
for (index = 0; index < mapElemc; index++) {
|
||||
mapStrings[index] = Tcl_GetUnicodeFromObj(mapElemv[index],
|
||||
mapStrings[index] = TclGetUnicodeFromObj(mapElemv[index],
|
||||
mapLens+index);
|
||||
if (nocase && ((index % 2) == 0)) {
|
||||
u2lc[index/2] = Tcl_UniCharToLower(*mapStrings[index]);
|
||||
@@ -2069,8 +2074,8 @@ StringMapCmd(
|
||||
if ((length2 > 0) && ((*ustring1 == *ustring2) || (nocase &&
|
||||
(Tcl_UniCharToLower(*ustring1) == u2lc[index/2]))) &&
|
||||
/* Restrict max compare length. */
|
||||
(end-ustring1 >= length2) && ((length2 == 1) ||
|
||||
!strCmpFn(ustring2, ustring1, (unsigned) length2))) {
|
||||
((size_t)(end-ustring1) >= length2) && ((length2 == 1) ||
|
||||
!strCmpFn(ustring2, ustring1, length2))) {
|
||||
if (p != ustring1) {
|
||||
/*
|
||||
* Put the skipped chars onto the result first.
|
||||
@@ -2155,11 +2160,11 @@ StringMatchCmd(
|
||||
}
|
||||
|
||||
if (objc == 4) {
|
||||
int length;
|
||||
size_t length;
|
||||
const char *string = TclGetStringFromObj(objv[1], &length);
|
||||
|
||||
if ((length > 1) &&
|
||||
strncmp(string, "-nocase", (size_t) length) == 0) {
|
||||
strncmp(string, "-nocase", length) == 0) {
|
||||
nocase = TCL_MATCH_NOCASE;
|
||||
} else {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
@@ -2199,7 +2204,8 @@ StringRangeCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
int length, first, last;
|
||||
size_t length;
|
||||
int first, last;
|
||||
|
||||
if (objc != 4) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "string first last");
|
||||
@@ -2221,7 +2227,7 @@ StringRangeCmd(
|
||||
if (first < 0) {
|
||||
first = 0;
|
||||
}
|
||||
if (last >= length) {
|
||||
if (last >= (int)length) {
|
||||
last = length;
|
||||
}
|
||||
if (last >= first) {
|
||||
@@ -2745,6 +2751,7 @@ StringCatCmd(
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
StringBytesCmd(
|
||||
ClientData dummy, /* Not used. */
|
||||
@@ -2794,7 +2801,7 @@ StringLenCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(Tcl_GetCharLength(objv[1])));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(Tcl_GetCharLength(objv[1])));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -3079,7 +3086,7 @@ StringTrimCmd(
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
const char *string1, *string2;
|
||||
int triml, trimr, length1, length2;
|
||||
size_t triml, trimr, length1, length2;
|
||||
|
||||
if (objc == 3) {
|
||||
string2 = TclGetStringFromObj(objv[2], &length2);
|
||||
@@ -3778,7 +3785,7 @@ TclNRSwitchObjCmd(
|
||||
if (ctxPtr->type == TCL_LOCATION_SOURCE && ctxPtr->line[bidx] >= 0) {
|
||||
int bline = ctxPtr->line[bidx];
|
||||
|
||||
ctxPtr->line = ckalloc(objc * sizeof(int));
|
||||
ctxPtr->line = Tcl_Alloc(objc * sizeof(int));
|
||||
ctxPtr->nline = objc;
|
||||
TclListLines(blist, bline, objc, ctxPtr->line, objv);
|
||||
} else {
|
||||
@@ -3792,7 +3799,7 @@ TclNRSwitchObjCmd(
|
||||
|
||||
int k;
|
||||
|
||||
ctxPtr->line = ckalloc(objc * sizeof(int));
|
||||
ctxPtr->line = Tcl_Alloc(objc * sizeof(int));
|
||||
ctxPtr->nline = objc;
|
||||
for (k=0; k < objc; k++) {
|
||||
ctxPtr->line[k] = -1;
|
||||
@@ -3842,7 +3849,7 @@ SwitchPostProc(
|
||||
*/
|
||||
|
||||
if (splitObjs) {
|
||||
ckfree(ctxPtr->line);
|
||||
Tcl_Free(ctxPtr->line);
|
||||
if (pc && (ctxPtr->type == TCL_LOCATION_SOURCE)) {
|
||||
/*
|
||||
* Death of SrcInfo reference.
|
||||
@@ -4006,7 +4013,7 @@ Tcl_TimeObjCmd(
|
||||
* Use int obj since we know time is not fractional. [Bug 1202178]
|
||||
*/
|
||||
|
||||
objs[0] = Tcl_NewIntObj((count <= 0) ? 0 : (int) totalMicroSec);
|
||||
objs[0] = Tcl_NewLongObj((count <= 0) ? 0 : totalMicroSec);
|
||||
} else {
|
||||
objs[0] = Tcl_NewDoubleObj(totalMicroSec/count);
|
||||
}
|
||||
|
||||
+35
-33
@@ -403,9 +403,9 @@ TclCompileArraySetCmd(
|
||||
keyVar = AnonymousLocal(envPtr);
|
||||
valVar = AnonymousLocal(envPtr);
|
||||
|
||||
infoPtr = ckalloc(sizeof(ForeachInfo));
|
||||
infoPtr = Tcl_Alloc(sizeof(ForeachInfo));
|
||||
infoPtr->numLists = 1;
|
||||
infoPtr->varLists[0] = ckalloc(sizeof(ForeachVarList) + sizeof(int));
|
||||
infoPtr->varLists[0] = Tcl_Alloc(sizeof(ForeachVarList) + sizeof(int));
|
||||
infoPtr->varLists[0]->numVars = 2;
|
||||
infoPtr->varLists[0]->varIndexes[0] = keyVar;
|
||||
infoPtr->varLists[0]->varIndexes[1] = valVar;
|
||||
@@ -701,8 +701,8 @@ TclCompileCatchCmd(
|
||||
/* Stack at this point on both branches: result returnCode */
|
||||
|
||||
if (TclFixupForwardJumpToHere(envPtr, &jumpFixup, 127)) {
|
||||
Tcl_Panic("TclCompileCatchCmd: bad jump distance %d",
|
||||
(int)(CurrentOffset(envPtr) - jumpFixup.codeOffset));
|
||||
Tcl_Panic("TclCompileCatchCmd: bad jump distance %" TCL_Z_MODIFIER "d",
|
||||
(CurrentOffset(envPtr) - jumpFixup.codeOffset));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1096,7 +1096,8 @@ TclCompileDictIncrCmd(
|
||||
|
||||
if (parsePtr->numWords == 4) {
|
||||
const char *word;
|
||||
int numBytes, code;
|
||||
size_t numBytes;
|
||||
int code;
|
||||
Tcl_Token *incrTokenPtr;
|
||||
Tcl_Obj *intObj;
|
||||
|
||||
@@ -1563,7 +1564,7 @@ CompileDictEachCmd(
|
||||
}
|
||||
Tcl_DStringFree(&buffer);
|
||||
if (numVars != 2) {
|
||||
ckfree(argv);
|
||||
Tcl_Free(argv);
|
||||
return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
|
||||
}
|
||||
|
||||
@@ -1571,7 +1572,7 @@ CompileDictEachCmd(
|
||||
keyVarIndex = LocalScalar(argv[0], nameChars, envPtr);
|
||||
nameChars = strlen(argv[1]);
|
||||
valueVarIndex = LocalScalar(argv[1], nameChars, envPtr);
|
||||
ckfree(argv);
|
||||
Tcl_Free(argv);
|
||||
|
||||
if ((keyVarIndex < 0) || (valueVarIndex < 0)) {
|
||||
return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
|
||||
@@ -1779,7 +1780,7 @@ TclCompileDictUpdateCmd(
|
||||
* that are to be used.
|
||||
*/
|
||||
|
||||
duiPtr = ckalloc(sizeof(DictUpdateInfo) + sizeof(int) * (numVars - 1));
|
||||
duiPtr = Tcl_Alloc(sizeof(DictUpdateInfo) + sizeof(int) * (numVars - 1));
|
||||
duiPtr->length = numVars;
|
||||
keyTokenPtrs = TclStackAlloc(interp, sizeof(Tcl_Token *) * numVars);
|
||||
tokenPtr = TokenAfter(dictVarTokenPtr);
|
||||
@@ -1862,8 +1863,8 @@ TclCompileDictUpdateCmd(
|
||||
TclEmitInvoke(envPtr,INST_RETURN_STK);
|
||||
|
||||
if (TclFixupForwardJumpToHere(envPtr, &jumpFixup, 127)) {
|
||||
Tcl_Panic("TclCompileDictCmd(update): bad jump distance %d",
|
||||
(int) (CurrentOffset(envPtr) - jumpFixup.codeOffset));
|
||||
Tcl_Panic("TclCompileDictCmd(update): bad jump distance %" TCL_Z_MODIFIER "d",
|
||||
CurrentOffset(envPtr) - jumpFixup.codeOffset);
|
||||
}
|
||||
TclStackFree(interp, keyTokenPtrs);
|
||||
return TCL_OK;
|
||||
@@ -1873,7 +1874,7 @@ TclCompileDictUpdateCmd(
|
||||
*/
|
||||
|
||||
failedUpdateInfoAssembly:
|
||||
ckfree(duiPtr);
|
||||
Tcl_Free(duiPtr);
|
||||
TclStackFree(interp, keyTokenPtrs);
|
||||
issueFallback:
|
||||
return TclCompileBasicMin2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
|
||||
@@ -2224,8 +2225,8 @@ TclCompileDictWithCmd(
|
||||
*/
|
||||
|
||||
if (TclFixupForwardJumpToHere(envPtr, &jumpFixup, 127)) {
|
||||
Tcl_Panic("TclCompileDictCmd(update): bad jump distance %d",
|
||||
(int) (CurrentOffset(envPtr) - jumpFixup.codeOffset));
|
||||
Tcl_Panic("TclCompileDictCmd(update): bad jump distance %" TCL_Z_MODIFIER "d",
|
||||
CurrentOffset(envPtr) - jumpFixup.codeOffset);
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -2262,7 +2263,7 @@ DupDictUpdateInfo(
|
||||
|
||||
dui1Ptr = clientData;
|
||||
len = sizeof(DictUpdateInfo) + sizeof(int) * (dui1Ptr->length - 1);
|
||||
dui2Ptr = ckalloc(len);
|
||||
dui2Ptr = Tcl_Alloc(len);
|
||||
memcpy(dui2Ptr, dui1Ptr, len);
|
||||
return dui2Ptr;
|
||||
}
|
||||
@@ -2271,7 +2272,7 @@ static void
|
||||
FreeDictUpdateInfo(
|
||||
ClientData clientData)
|
||||
{
|
||||
ckfree(clientData);
|
||||
Tcl_Free(clientData);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2282,7 +2283,7 @@ PrintDictUpdateInfo(
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
DictUpdateInfo *duiPtr = clientData;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
for (i=0 ; i<duiPtr->length ; i++) {
|
||||
if (i) {
|
||||
@@ -2300,7 +2301,7 @@ DisassembleDictUpdateInfo(
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
DictUpdateInfo *duiPtr = clientData;
|
||||
int i;
|
||||
size_t i;
|
||||
Tcl_Obj *variables = Tcl_NewObj();
|
||||
|
||||
for (i=0 ; i<duiPtr->length ; i++) {
|
||||
@@ -2715,7 +2716,7 @@ CompileEachloopCmd(
|
||||
*/
|
||||
|
||||
numLists = (numWords - 2)/2;
|
||||
infoPtr = ckalloc(sizeof(ForeachInfo)
|
||||
infoPtr = Tcl_Alloc(sizeof(ForeachInfo)
|
||||
+ (numLists - 1) * sizeof(ForeachVarList *));
|
||||
infoPtr->numLists = 0; /* Count this up as we go */
|
||||
|
||||
@@ -2749,7 +2750,7 @@ CompileEachloopCmd(
|
||||
goto done;
|
||||
}
|
||||
|
||||
varListPtr = ckalloc(sizeof(ForeachVarList)
|
||||
varListPtr = Tcl_Alloc(sizeof(ForeachVarList)
|
||||
+ (numVars - 1) * sizeof(int));
|
||||
varListPtr->numVars = numVars;
|
||||
infoPtr->varLists[i/2] = varListPtr;
|
||||
@@ -2758,11 +2759,11 @@ CompileEachloopCmd(
|
||||
for (j = 0; j < numVars; j++) {
|
||||
Tcl_Obj *varNameObj;
|
||||
const char *bytes;
|
||||
int numBytes, varIndex;
|
||||
int varIndex;
|
||||
|
||||
Tcl_ListObjIndex(NULL, varListObj, j, &varNameObj);
|
||||
bytes = TclGetStringFromObj(varNameObj, &numBytes);
|
||||
varIndex = LocalScalar(bytes, numBytes, envPtr);
|
||||
bytes = TclGetString(varNameObj);
|
||||
varIndex = LocalScalar(bytes, varNameObj->length, envPtr);
|
||||
if (varIndex < 0) {
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
@@ -2885,7 +2886,7 @@ DupForeachInfo(
|
||||
register ForeachVarList *srcListPtr, *dupListPtr;
|
||||
int numVars, i, j, numLists = srcPtr->numLists;
|
||||
|
||||
dupPtr = ckalloc(sizeof(ForeachInfo)
|
||||
dupPtr = Tcl_Alloc(sizeof(ForeachInfo)
|
||||
+ numLists * sizeof(ForeachVarList *));
|
||||
dupPtr->numLists = numLists;
|
||||
dupPtr->firstValueTemp = srcPtr->firstValueTemp;
|
||||
@@ -2894,7 +2895,7 @@ DupForeachInfo(
|
||||
for (i = 0; i < numLists; i++) {
|
||||
srcListPtr = srcPtr->varLists[i];
|
||||
numVars = srcListPtr->numVars;
|
||||
dupListPtr = ckalloc(sizeof(ForeachVarList)
|
||||
dupListPtr = Tcl_Alloc(sizeof(ForeachVarList)
|
||||
+ numVars * sizeof(int));
|
||||
dupListPtr->numVars = numVars;
|
||||
for (j = 0; j < numVars; j++) {
|
||||
@@ -2936,9 +2937,9 @@ FreeForeachInfo(
|
||||
|
||||
for (i = 0; i < numLists; i++) {
|
||||
listPtr = infoPtr->varLists[i];
|
||||
ckfree(listPtr);
|
||||
Tcl_Free(listPtr);
|
||||
}
|
||||
ckfree(infoPtr);
|
||||
Tcl_Free(infoPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3166,7 +3167,7 @@ TclCompileFormatCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
objv = ckalloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
|
||||
objv = Tcl_Alloc((parsePtr->numWords-2) * sizeof(Tcl_Obj *));
|
||||
for (i=0 ; i+2 < parsePtr->numWords ; i++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
objv[i] = Tcl_NewObj();
|
||||
@@ -3186,7 +3187,7 @@ TclCompileFormatCmd(
|
||||
for (; --i>=0 ;) {
|
||||
Tcl_DecrRefCount(objv[i]);
|
||||
}
|
||||
ckfree(objv);
|
||||
Tcl_Free(objv);
|
||||
Tcl_DecrRefCount(formatObj);
|
||||
if (tmpObj == NULL) {
|
||||
TclCompileSyntaxError(interp, envPtr);
|
||||
@@ -3216,7 +3217,7 @@ TclCompileFormatCmd(
|
||||
for (; i>=0 ; i--) {
|
||||
Tcl_DecrRefCount(objv[i]);
|
||||
}
|
||||
ckfree(objv);
|
||||
Tcl_Free(objv);
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
i = 0;
|
||||
@@ -3358,7 +3359,7 @@ TclLocalScalarFromToken(
|
||||
int
|
||||
TclLocalScalar(
|
||||
const char *bytes,
|
||||
int numBytes,
|
||||
size_t numBytes,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
Tcl_Token token[2] = {{TCL_TOKEN_SIMPLE_WORD, NULL, 0, 1},
|
||||
@@ -3409,9 +3410,10 @@ TclPushVarName(
|
||||
{
|
||||
register const char *p;
|
||||
const char *name, *elName;
|
||||
register int i, n;
|
||||
register size_t i, n;
|
||||
Tcl_Token *elemTokenPtr = NULL;
|
||||
int nameChars, elNameChars, simpleVarName, localIndex;
|
||||
size_t nameChars, elNameChars;
|
||||
int simpleVarName, localIndex;
|
||||
int elemTokenCount = 0, allocedTokens = 0, removedParen = 0;
|
||||
|
||||
/*
|
||||
@@ -3483,7 +3485,7 @@ TclPushVarName(
|
||||
}
|
||||
}
|
||||
if (simpleVarName) {
|
||||
int remainingChars;
|
||||
size_t remainingChars;
|
||||
|
||||
/*
|
||||
* Check the last token: if it is just ')', do not count it.
|
||||
|
||||
@@ -181,7 +181,8 @@ TclCompileIfCmd(
|
||||
* determined. */
|
||||
Tcl_Token *tokenPtr, *testTokenPtr;
|
||||
int jumpIndex = 0; /* Avoid compiler warning. */
|
||||
int jumpFalseDist, numWords, wordIdx, numBytes, j, code;
|
||||
size_t numBytes;
|
||||
int jumpFalseDist, numWords, wordIdx, j, code;
|
||||
const char *word;
|
||||
int realCond = 1; /* Set to 0 for static conditions:
|
||||
* "if 0 {..}" */
|
||||
@@ -433,7 +434,7 @@ TclCompileIfCmd(
|
||||
jumpFalseDist += 3;
|
||||
TclStoreInt4AtPtr(jumpFalseDist, (ifFalsePc + 1));
|
||||
} else {
|
||||
Tcl_Panic("TclCompileIfCmd: unexpected opcode \"%d\" updating ifFalse jump", (int) opCode);
|
||||
Tcl_Panic("TclCompileIfCmd: unexpected opcode \"%u\" updating ifFalse jump", opCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -499,7 +500,7 @@ TclCompileIncrCmd(
|
||||
incrTokenPtr = TokenAfter(varTokenPtr);
|
||||
if (incrTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
|
||||
const char *word = incrTokenPtr[1].start;
|
||||
int numBytes = incrTokenPtr[1].size;
|
||||
size_t numBytes = incrTokenPtr[1].size;
|
||||
int code;
|
||||
Tcl_Obj *intObj = Tcl_NewStringObj(word, numBytes);
|
||||
|
||||
@@ -2080,7 +2081,8 @@ TclCompileRegexpCmd(
|
||||
{
|
||||
Tcl_Token *varTokenPtr; /* Pointer to the Tcl_Token representing the
|
||||
* parse of the RE or string. */
|
||||
int i, len, nocase, exact, sawLast, simple;
|
||||
size_t len;
|
||||
int i, nocase, exact, sawLast, simple;
|
||||
const char *str;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
@@ -2633,8 +2635,8 @@ TclCompileSyntaxError(
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
Tcl_Obj *msg = Tcl_GetObjResult(interp);
|
||||
int numBytes;
|
||||
const char *bytes = TclGetStringFromObj(msg, &numBytes);
|
||||
const char *bytes = TclGetString(msg);
|
||||
size_t numBytes = msg->length;
|
||||
|
||||
TclErrorStackResetIf(interp, bytes, numBytes);
|
||||
TclEmitPush(TclRegisterLiteral(envPtr, bytes, numBytes, 0), envPtr);
|
||||
|
||||
+39
-37
@@ -737,7 +737,8 @@ TclCompileStringMatchCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Token *tokenPtr;
|
||||
int i, length, exactMatch = 0, nocase = 0;
|
||||
size_t length;
|
||||
int i, exactMatch = 0, nocase = 0;
|
||||
const char *str;
|
||||
|
||||
if (parsePtr->numWords < 3 || parsePtr->numWords > 4) {
|
||||
@@ -1464,7 +1465,7 @@ void
|
||||
TclSubstCompile(
|
||||
Tcl_Interp *interp,
|
||||
const char *bytes,
|
||||
int numBytes,
|
||||
size_t numBytes,
|
||||
int flags,
|
||||
int line,
|
||||
CompileEnv *envPtr)
|
||||
@@ -1526,7 +1527,8 @@ TclSubstCompile(
|
||||
*/
|
||||
|
||||
if (tokenPtr->numComponents > 1) {
|
||||
int i, foundCommand = 0;
|
||||
size_t i;
|
||||
int foundCommand = 0;
|
||||
|
||||
for (i=2 ; i<=tokenPtr->numComponents ; i++) {
|
||||
if (tokenPtr[i].type == TCL_TOKEN_COMMAND) {
|
||||
@@ -1565,8 +1567,8 @@ TclSubstCompile(
|
||||
|
||||
/* Start */
|
||||
if (TclFixupForwardJumpToHere(envPtr, &startFixup, 127)) {
|
||||
Tcl_Panic("TclCompileSubstCmd: bad start jump distance %d",
|
||||
(int) (CurrentOffset(envPtr) - startFixup.codeOffset));
|
||||
Tcl_Panic("TclCompileSubstCmd: bad start jump distance %" TCL_Z_MODIFIER "d",
|
||||
CurrentOffset(envPtr) - startFixup.codeOffset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1624,8 +1626,8 @@ TclSubstCompile(
|
||||
TclAdjustStackDepth(1, envPtr);
|
||||
/* BREAK destination */
|
||||
if (TclFixupForwardJumpToHere(envPtr, &breakFixup, 127)) {
|
||||
Tcl_Panic("TclCompileSubstCmd: bad break jump distance %d",
|
||||
(int) (CurrentOffset(envPtr) - breakFixup.codeOffset));
|
||||
Tcl_Panic("TclCompileSubstCmd: bad break jump distance %" TCL_Z_MODIFIER "d",
|
||||
CurrentOffset(envPtr) - breakFixup.codeOffset);
|
||||
}
|
||||
OP( POP);
|
||||
OP( POP);
|
||||
@@ -1640,8 +1642,8 @@ TclSubstCompile(
|
||||
TclAdjustStackDepth(2, envPtr);
|
||||
/* CONTINUE destination */
|
||||
if (TclFixupForwardJumpToHere(envPtr, &continueFixup, 127)) {
|
||||
Tcl_Panic("TclCompileSubstCmd: bad continue jump distance %d",
|
||||
(int) (CurrentOffset(envPtr) - continueFixup.codeOffset));
|
||||
Tcl_Panic("TclCompileSubstCmd: bad continue jump distance %" TCL_Z_MODIFIER "d",
|
||||
CurrentOffset(envPtr) - continueFixup.codeOffset);
|
||||
}
|
||||
OP( POP);
|
||||
OP( POP);
|
||||
@@ -1650,12 +1652,12 @@ TclSubstCompile(
|
||||
TclAdjustStackDepth(2, envPtr);
|
||||
/* RETURN + other destination */
|
||||
if (TclFixupForwardJumpToHere(envPtr, &returnFixup, 127)) {
|
||||
Tcl_Panic("TclCompileSubstCmd: bad return jump distance %d",
|
||||
(int) (CurrentOffset(envPtr) - returnFixup.codeOffset));
|
||||
Tcl_Panic("TclCompileSubstCmd: bad return jump distance %" TCL_Z_MODIFIER "d",
|
||||
CurrentOffset(envPtr) - returnFixup.codeOffset);
|
||||
}
|
||||
if (TclFixupForwardJumpToHere(envPtr, &otherFixup, 127)) {
|
||||
Tcl_Panic("TclCompileSubstCmd: bad other jump distance %d",
|
||||
(int) (CurrentOffset(envPtr) - otherFixup.codeOffset));
|
||||
Tcl_Panic("TclCompileSubstCmd: bad other jump distance %" TCL_Z_MODIFIER "d",
|
||||
CurrentOffset(envPtr) - otherFixup.codeOffset);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1667,8 +1669,8 @@ TclSubstCompile(
|
||||
|
||||
/* OK destination */
|
||||
if (TclFixupForwardJumpToHere(envPtr, &okFixup, 127)) {
|
||||
Tcl_Panic("TclCompileSubstCmd: bad ok jump distance %d",
|
||||
(int) (CurrentOffset(envPtr) - okFixup.codeOffset));
|
||||
Tcl_Panic("TclCompileSubstCmd: bad ok jump distance %" TCL_Z_MODIFIER "d",
|
||||
CurrentOffset(envPtr) - okFixup.codeOffset);
|
||||
}
|
||||
if (count > 1) {
|
||||
OP1(STR_CONCAT1, count);
|
||||
@@ -1677,8 +1679,8 @@ TclSubstCompile(
|
||||
|
||||
/* CONTINUE jump to here */
|
||||
if (TclFixupForwardJumpToHere(envPtr, &endFixup, 127)) {
|
||||
Tcl_Panic("TclCompileSubstCmd: bad end jump distance %d",
|
||||
(int) (CurrentOffset(envPtr) - endFixup.codeOffset));
|
||||
Tcl_Panic("TclCompileSubstCmd: bad end jump distance %" TCL_Z_MODIFIER "d",
|
||||
CurrentOffset(envPtr) - endFixup.codeOffset);
|
||||
}
|
||||
bline = envPtr->line;
|
||||
}
|
||||
@@ -1799,7 +1801,7 @@ TclCompileSwitchCmd(
|
||||
*/
|
||||
|
||||
for (; numWords>=3 ; tokenPtr=TokenAfter(tokenPtr),numWords--) {
|
||||
register unsigned size = tokenPtr[1].size;
|
||||
register size_t size = tokenPtr[1].size;
|
||||
register const char *chrs = tokenPtr[1].start;
|
||||
|
||||
/*
|
||||
@@ -1890,7 +1892,7 @@ TclCompileSwitchCmd(
|
||||
|
||||
if (numWords == 1) {
|
||||
const char *bytes;
|
||||
int maxLen, numBytes;
|
||||
size_t maxLen, numBytes;
|
||||
int bline; /* TIP #280: line of the pattern/action list,
|
||||
* and start of list for when tracking the
|
||||
* location. This list comes immediately after
|
||||
@@ -1907,10 +1909,10 @@ TclCompileSwitchCmd(
|
||||
if (maxLen < 2) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
bodyTokenArray = ckalloc(sizeof(Tcl_Token) * maxLen);
|
||||
bodyToken = ckalloc(sizeof(Tcl_Token *) * maxLen);
|
||||
bodyLines = ckalloc(sizeof(int) * maxLen);
|
||||
bodyContLines = ckalloc(sizeof(int*) * maxLen);
|
||||
bodyTokenArray = Tcl_Alloc(sizeof(Tcl_Token) * maxLen);
|
||||
bodyToken = Tcl_Alloc(sizeof(Tcl_Token *) * maxLen);
|
||||
bodyLines = Tcl_Alloc(sizeof(int) * maxLen);
|
||||
bodyContLines = Tcl_Alloc(sizeof(int*) * maxLen);
|
||||
|
||||
bline = mapPtr->loc[eclIndex].line[valueIndex+1];
|
||||
numWords = 0;
|
||||
@@ -1948,10 +1950,10 @@ TclCompileSwitchCmd(
|
||||
}
|
||||
if (numWords % 2) {
|
||||
abort:
|
||||
ckfree(bodyToken);
|
||||
ckfree(bodyTokenArray);
|
||||
ckfree(bodyLines);
|
||||
ckfree(bodyContLines);
|
||||
Tcl_Free(bodyToken);
|
||||
Tcl_Free(bodyTokenArray);
|
||||
Tcl_Free(bodyLines);
|
||||
Tcl_Free(bodyContLines);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
} else if (numWords % 2 || numWords == 0) {
|
||||
@@ -1969,9 +1971,9 @@ TclCompileSwitchCmd(
|
||||
* Multi-word definition of patterns & actions.
|
||||
*/
|
||||
|
||||
bodyToken = ckalloc(sizeof(Tcl_Token *) * numWords);
|
||||
bodyLines = ckalloc(sizeof(int) * numWords);
|
||||
bodyContLines = ckalloc(sizeof(int*) * numWords);
|
||||
bodyToken = Tcl_Alloc(sizeof(Tcl_Token *) * numWords);
|
||||
bodyLines = Tcl_Alloc(sizeof(int) * numWords);
|
||||
bodyContLines = Tcl_Alloc(sizeof(int*) * numWords);
|
||||
bodyTokenArray = NULL;
|
||||
for (i=0 ; i<numWords ; i++) {
|
||||
/*
|
||||
@@ -2030,11 +2032,11 @@ TclCompileSwitchCmd(
|
||||
*/
|
||||
|
||||
freeTemporaries:
|
||||
ckfree(bodyToken);
|
||||
ckfree(bodyLines);
|
||||
ckfree(bodyContLines);
|
||||
Tcl_Free(bodyToken);
|
||||
Tcl_Free(bodyLines);
|
||||
Tcl_Free(bodyContLines);
|
||||
if (bodyTokenArray != NULL) {
|
||||
ckfree(bodyTokenArray);
|
||||
Tcl_Free(bodyTokenArray);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -2335,7 +2337,7 @@ IssueSwitchJumpTable(
|
||||
* Start by allocating the jump table itself, plus some workspace.
|
||||
*/
|
||||
|
||||
jtPtr = ckalloc(sizeof(JumptableInfo));
|
||||
jtPtr = Tcl_Alloc(sizeof(JumptableInfo));
|
||||
Tcl_InitHashTable(&jtPtr->hashTable, TCL_STRING_KEYS);
|
||||
infoIndex = TclCreateAuxData(jtPtr, &tclJumptableInfoType, envPtr);
|
||||
finalFixups = TclStackAlloc(interp, sizeof(int) * (numBodyTokens/2));
|
||||
@@ -2507,7 +2509,7 @@ DupJumptableInfo(
|
||||
ClientData clientData)
|
||||
{
|
||||
JumptableInfo *jtPtr = clientData;
|
||||
JumptableInfo *newJtPtr = ckalloc(sizeof(JumptableInfo));
|
||||
JumptableInfo *newJtPtr = Tcl_Alloc(sizeof(JumptableInfo));
|
||||
Tcl_HashEntry *hPtr, *newHPtr;
|
||||
Tcl_HashSearch search;
|
||||
int isNew;
|
||||
@@ -2529,7 +2531,7 @@ FreeJumptableInfo(
|
||||
JumptableInfo *jtPtr = clientData;
|
||||
|
||||
Tcl_DeleteHashTable(&jtPtr->hashTable);
|
||||
ckfree(jtPtr);
|
||||
Tcl_Free(jtPtr);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+31
-31
@@ -22,7 +22,7 @@
|
||||
* The tree is composed of OpNodes.
|
||||
*/
|
||||
|
||||
typedef struct OpNode {
|
||||
typedef struct {
|
||||
int left; /* "Pointer" to the left operand. */
|
||||
int right; /* "Pointer" to the right operand. */
|
||||
union {
|
||||
@@ -501,16 +501,16 @@ static void CompileExprTree(Tcl_Interp *interp, OpNode *nodes,
|
||||
int index, Tcl_Obj *const **litObjvPtr,
|
||||
Tcl_Obj *const *funcObjv, Tcl_Token *tokenPtr,
|
||||
CompileEnv *envPtr, int optimize);
|
||||
static void ConvertTreeToTokens(const char *start, int numBytes,
|
||||
static void ConvertTreeToTokens(const char *start, size_t numBytes,
|
||||
OpNode *nodes, Tcl_Token *tokenPtr,
|
||||
Tcl_Parse *parsePtr);
|
||||
static int ExecConstantExprTree(Tcl_Interp *interp, OpNode *nodes,
|
||||
int index, Tcl_Obj * const **litObjvPtr);
|
||||
static int ParseExpr(Tcl_Interp *interp, const char *start,
|
||||
int numBytes, OpNode **opTreePtr,
|
||||
size_t numBytes, OpNode **opTreePtr,
|
||||
Tcl_Obj *litList, Tcl_Obj *funcList,
|
||||
Tcl_Parse *parsePtr, int parseOnly);
|
||||
static int ParseLexeme(const char *start, int numBytes,
|
||||
static size_t ParseLexeme(const char *start, size_t numBytes,
|
||||
unsigned char *lexemePtr, Tcl_Obj **literalPtr);
|
||||
|
||||
/*
|
||||
@@ -536,7 +536,7 @@ static int ParseLexeme(const char *start, int numBytes,
|
||||
* Side effects:
|
||||
* Memory will be allocated. If TCL_OK is returned, the caller must clean
|
||||
* up the returned data structures. The (OpNode *) value written to
|
||||
* opTreePtr should be passed to ckfree() and the parsePtr argument
|
||||
* opTreePtr should be passed to Tcl_Free() and the parsePtr argument
|
||||
* should be passed to Tcl_FreeParse(). The elements appended to the
|
||||
* litList and funcList will automatically be freed whenever the refcount
|
||||
* on those lists indicates they can be freed.
|
||||
@@ -548,7 +548,7 @@ static int
|
||||
ParseExpr(
|
||||
Tcl_Interp *interp, /* Used for error reporting. */
|
||||
const char *start, /* Start of source string to parse. */
|
||||
int numBytes, /* Number of bytes in string. */
|
||||
size_t numBytes, /* Number of bytes in string. */
|
||||
OpNode **opTreePtr, /* Points to space where a pointer to the
|
||||
* allocated OpNode tree should go. */
|
||||
Tcl_Obj *litList, /* List to append literals to. */
|
||||
@@ -571,7 +571,7 @@ ParseExpr(
|
||||
* no need for array growth and
|
||||
* reallocation. */
|
||||
unsigned int nodesUsed = 0; /* Number of OpNodes filled. */
|
||||
int scanned = 0; /* Capture number of byte scanned by parsing
|
||||
size_t scanned = 0; /* Capture number of byte scanned by parsing
|
||||
* routines. */
|
||||
int lastParsed; /* Stores info about what the lexeme parsed
|
||||
* the previous pass through the parsing loop
|
||||
@@ -615,7 +615,7 @@ ParseExpr(
|
||||
* error in the expression. */
|
||||
int insertMark = 0; /* A boolean controlling whether the "mark"
|
||||
* should be inserted. */
|
||||
const int limit = 25; /* Portions of the error message are
|
||||
const unsigned limit = 25; /* Portions of the error message are
|
||||
* constructed out of substrings of the
|
||||
* original expression. In order to keep the
|
||||
* error message readable, we impose this
|
||||
@@ -623,7 +623,7 @@ ParseExpr(
|
||||
|
||||
TclParseInit(interp, start, numBytes, parsePtr);
|
||||
|
||||
nodes = attemptckalloc(nodesAvailable * sizeof(OpNode));
|
||||
nodes = Tcl_AttemptAlloc(nodesAvailable * sizeof(OpNode));
|
||||
if (nodes == NULL) {
|
||||
TclNewLiteralStringObj(msg, "not enough memory to parse expression");
|
||||
errCode = "NOMEM";
|
||||
@@ -667,7 +667,7 @@ ParseExpr(
|
||||
|
||||
do {
|
||||
if (size <= UINT_MAX/sizeof(OpNode)) {
|
||||
newPtr = attemptckrealloc(nodes, size * sizeof(OpNode));
|
||||
newPtr = Tcl_AttemptRealloc(nodes, size * sizeof(OpNode));
|
||||
}
|
||||
} while ((newPtr == NULL)
|
||||
&& ((size -= (size - nodesUsed) / 2) > nodesUsed));
|
||||
@@ -702,12 +702,12 @@ ParseExpr(
|
||||
switch (lexeme) {
|
||||
case INVALID:
|
||||
msg = Tcl_ObjPrintf("invalid character \"%.*s\"",
|
||||
scanned, start);
|
||||
(int)scanned, start);
|
||||
errCode = "BADCHAR";
|
||||
goto error;
|
||||
case INCOMPLETE:
|
||||
msg = Tcl_ObjPrintf("incomplete operator \"%.*s\"",
|
||||
scanned, start);
|
||||
(int)scanned, start);
|
||||
errCode = "PARTOP";
|
||||
goto error;
|
||||
case BAREWORD:
|
||||
@@ -736,16 +736,16 @@ ParseExpr(
|
||||
} else {
|
||||
Tcl_DecrRefCount(literal);
|
||||
msg = Tcl_ObjPrintf("invalid bareword \"%.*s%s\"",
|
||||
(scanned < limit) ? scanned : limit - 3, start,
|
||||
(scanned < limit) ? (int)scanned : (int)limit - 3, start,
|
||||
(scanned < limit) ? "" : "...");
|
||||
post = Tcl_ObjPrintf(
|
||||
"should be \"$%.*s%s\" or \"{%.*s%s}\"",
|
||||
(scanned < limit) ? scanned : limit - 3,
|
||||
(scanned < limit) ? (int)scanned : (int)limit - 3,
|
||||
start, (scanned < limit) ? "" : "...",
|
||||
(scanned < limit) ? scanned : limit - 3,
|
||||
(scanned < limit) ? (int)scanned : (int)limit - 3,
|
||||
start, (scanned < limit) ? "" : "...");
|
||||
Tcl_AppendPrintfToObj(post, " or \"%.*s%s(...)\" or ...",
|
||||
(scanned < limit) ? scanned : limit - 3,
|
||||
(scanned < limit) ? (int)scanned : (int)limit - 3,
|
||||
start, (scanned < limit) ? "" : "...");
|
||||
errCode = "BAREWORD";
|
||||
if (start[0] == '0') {
|
||||
@@ -1377,7 +1377,7 @@ ParseExpr(
|
||||
*/
|
||||
|
||||
if (nodes != NULL) {
|
||||
ckfree(nodes);
|
||||
Tcl_Free(nodes);
|
||||
}
|
||||
|
||||
if (interp == NULL) {
|
||||
@@ -1406,13 +1406,13 @@ ParseExpr(
|
||||
Tcl_AppendPrintfToObj(msg, "\nin expression \"%s%.*s%.*s%s%s%.*s%s\"",
|
||||
((start - limit) < parsePtr->string) ? "" : "...",
|
||||
((start - limit) < parsePtr->string)
|
||||
? (int) (start - parsePtr->string) : limit - 3,
|
||||
? (int) (start - parsePtr->string) : (int)limit - 3,
|
||||
((start - limit) < parsePtr->string)
|
||||
? parsePtr->string : start - limit + 3,
|
||||
(scanned < limit) ? scanned : limit - 3, start,
|
||||
(scanned < limit) ? (int)scanned : (int)limit - 3, start,
|
||||
(scanned < limit) ? "" : "...", insertMark ? mark : "",
|
||||
(start + scanned + limit > parsePtr->end)
|
||||
? (int) (parsePtr->end - start) - scanned : limit-3,
|
||||
? (int) (parsePtr->end - start) - (int)scanned : (int)limit-3,
|
||||
start + scanned,
|
||||
(start + scanned + limit > parsePtr->end) ? "" : "...");
|
||||
|
||||
@@ -1434,7 +1434,7 @@ ParseExpr(
|
||||
numBytes = parsePtr->end - parsePtr->string;
|
||||
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
|
||||
"\n (parsing expression \"%.*s%s\")",
|
||||
(numBytes < limit) ? numBytes : limit - 3,
|
||||
(numBytes < limit) ? (int)numBytes : (int)limit - 3,
|
||||
parsePtr->string, (numBytes < limit) ? "" : "..."));
|
||||
if (errCode) {
|
||||
Tcl_SetErrorCode(interp, "TCL", "PARSE", "EXPR", errCode,
|
||||
@@ -1471,7 +1471,7 @@ ParseExpr(
|
||||
static void
|
||||
ConvertTreeToTokens(
|
||||
const char *start,
|
||||
int numBytes,
|
||||
size_t numBytes,
|
||||
OpNode *nodes,
|
||||
Tcl_Token *tokenPtr,
|
||||
Tcl_Parse *parsePtr)
|
||||
@@ -1819,7 +1819,7 @@ int
|
||||
Tcl_ParseExpr(
|
||||
Tcl_Interp *interp, /* Used for error reporting. */
|
||||
const char *start, /* Start of source string to parse. */
|
||||
int numBytes, /* Number of bytes in string. If < 0, the
|
||||
size_t numBytes, /* Number of bytes in string. If -1, the
|
||||
* string consists of all bytes up to the
|
||||
* first null character. */
|
||||
Tcl_Parse *parsePtr) /* Structure to fill with information about
|
||||
@@ -1833,7 +1833,7 @@ Tcl_ParseExpr(
|
||||
Tcl_Parse *exprParsePtr = TclStackAlloc(interp, sizeof(Tcl_Parse));
|
||||
/* Holds the Tcl_Tokens of substitutions. */
|
||||
|
||||
if (numBytes < 0) {
|
||||
if (numBytes == TCL_AUTO_LENGTH) {
|
||||
numBytes = (start ? strlen(start) : 0);
|
||||
}
|
||||
|
||||
@@ -1853,7 +1853,7 @@ Tcl_ParseExpr(
|
||||
|
||||
Tcl_FreeParse(exprParsePtr);
|
||||
TclStackFree(interp, exprParsePtr);
|
||||
ckfree(opTree);
|
||||
Tcl_Free(opTree);
|
||||
return code;
|
||||
}
|
||||
|
||||
@@ -1874,17 +1874,16 @@ Tcl_ParseExpr(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
static size_t
|
||||
ParseLexeme(
|
||||
const char *start, /* Start of lexeme to parse. */
|
||||
int numBytes, /* Number of bytes in string. */
|
||||
size_t numBytes, /* Number of bytes in string. */
|
||||
unsigned char *lexemePtr, /* Write code of parsed lexeme to this
|
||||
* storage. */
|
||||
Tcl_Obj **literalPtr) /* Write corresponding literal value to this
|
||||
storage, if non-NULL. */
|
||||
{
|
||||
const char *end;
|
||||
int scanned;
|
||||
Tcl_UniChar ch = 0;
|
||||
Tcl_Obj *literal = NULL;
|
||||
unsigned char byte;
|
||||
@@ -2063,12 +2062,13 @@ ParseLexeme(
|
||||
*/
|
||||
|
||||
if (!TclIsBareword(*start) || *start == '_') {
|
||||
size_t scanned;
|
||||
if (Tcl_UtfCharComplete(start, numBytes)) {
|
||||
scanned = TclUtfToUniChar(start, &ch);
|
||||
} else {
|
||||
char utfBytes[TCL_UTF_MAX];
|
||||
|
||||
memcpy(utfBytes, start, (size_t) numBytes);
|
||||
memcpy(utfBytes, start, numBytes);
|
||||
utfBytes[numBytes] = '\0';
|
||||
scanned = TclUtfToUniChar(utfBytes, &ch);
|
||||
}
|
||||
@@ -2112,7 +2112,7 @@ void
|
||||
TclCompileExpr(
|
||||
Tcl_Interp *interp, /* Used for error reporting. */
|
||||
const char *script, /* The source script to compile. */
|
||||
int numBytes, /* Number of bytes in script. */
|
||||
size_t numBytes, /* Number of bytes in script. */
|
||||
CompileEnv *envPtr, /* Holds resulting instructions. */
|
||||
int optimize) /* 0 for one-off expressions. */
|
||||
{
|
||||
@@ -2150,7 +2150,7 @@ TclCompileExpr(
|
||||
TclStackFree(interp, parsePtr);
|
||||
Tcl_DecrRefCount(funcList);
|
||||
Tcl_DecrRefCount(litList);
|
||||
ckfree(opTree);
|
||||
Tcl_Free(opTree);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+76
-94
@@ -129,10 +129,6 @@ InstructionDesc const tclInstructionTable[] = {
|
||||
{"jumpFalse4", 5, -1, 1, {OPERAND_OFFSET4}},
|
||||
/* Jump relative to (pc + op4) if stktop expr object is false */
|
||||
|
||||
{"lor", 1, -1, 0, {OPERAND_NONE}},
|
||||
/* Logical or: push (stknext || stktop) */
|
||||
{"land", 1, -1, 0, {OPERAND_NONE}},
|
||||
/* Logical and: push (stknext && stktop) */
|
||||
{"bitor", 1, -1, 0, {OPERAND_NONE}},
|
||||
/* Bitwise or: push (stknext | stktop) */
|
||||
{"bitxor", 1, -1, 0, {OPERAND_NONE}},
|
||||
@@ -173,10 +169,6 @@ InstructionDesc const tclInstructionTable[] = {
|
||||
/* Bitwise not: push ~stktop */
|
||||
{"not", 1, 0, 0, {OPERAND_NONE}},
|
||||
/* Logical not: push !stktop */
|
||||
{"callBuiltinFunc1", 2, 1, 1, {OPERAND_UINT1}},
|
||||
/* Call builtin math function with index op1; any args are on stk */
|
||||
{"callFunc1", 2, INT_MIN, 1, {OPERAND_UINT1}},
|
||||
/* Call non-builtin func objv[0]; <objc,objv>=<op1,top op1> */
|
||||
{"tryCvtToNumeric", 1, 0, 0, {OPERAND_NONE}},
|
||||
/* Try converting stktop to first int then double if possible. */
|
||||
|
||||
@@ -186,13 +178,6 @@ InstructionDesc const tclInstructionTable[] = {
|
||||
/* Skip to next iteration of closest enclosing loop; if none, return
|
||||
* TCL_CONTINUE code. */
|
||||
|
||||
{"foreach_start4", 5, 0, 1, {OPERAND_AUX4}},
|
||||
/* Initialize execution of a foreach loop. Operand is aux data index
|
||||
* of the ForeachInfo structure for the foreach command. */
|
||||
{"foreach_step4", 5, +1, 1, {OPERAND_AUX4}},
|
||||
/* "Step" or begin next iteration of foreach loop. Push 0 if to
|
||||
* terminate loop, else push 1. */
|
||||
|
||||
{"beginCatch4", 5, 0, 1, {OPERAND_UINT4}},
|
||||
/* Record start of catch with the operand's exception index. Push the
|
||||
* current stack depth onto a special catch stack. */
|
||||
@@ -340,9 +325,6 @@ InstructionDesc const tclInstructionTable[] = {
|
||||
{"dictNext", 5, +3, 1, {OPERAND_LVT4}},
|
||||
/* Get the next iteration from the iterator in op4's local scalar.
|
||||
* Stack: ... => ... value key doneBool */
|
||||
{"dictDone", 5, 0, 1, {OPERAND_LVT4}},
|
||||
/* Terminate the iterator in op4's local scalar. Use unsetScalar
|
||||
* instead (with 0 for flags). */
|
||||
{"dictUpdateStart", 9, 0, 2, {OPERAND_LVT4, OPERAND_AUX4}},
|
||||
/* Create the variables (described in the aux data referred to by the
|
||||
* second immediate argument) to mirror the state of the dictionary in
|
||||
@@ -853,8 +835,8 @@ TclSetByteCodeFromAny(
|
||||
* instruction generator boundaries.
|
||||
*/
|
||||
|
||||
if (iPtr->extra.optimizer) {
|
||||
(iPtr->extra.optimizer)(&compEnv);
|
||||
if (iPtr->optimizer) {
|
||||
(iPtr->optimizer)(&compEnv);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1132,12 +1114,12 @@ CleanupByteCode(
|
||||
}
|
||||
}
|
||||
|
||||
if (codePtr->localCachePtr && (--codePtr->localCachePtr->refCount == 0)) {
|
||||
if (codePtr->localCachePtr && (codePtr->localCachePtr->refCount-- <= 1)) {
|
||||
TclFreeLocalCache(interp, codePtr->localCachePtr);
|
||||
}
|
||||
|
||||
TclHandleRelease(codePtr->interpHandle);
|
||||
ckfree(codePtr);
|
||||
Tcl_Free(codePtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1320,8 +1302,8 @@ CompileSubstObj(
|
||||
}
|
||||
if (objPtr->typePtr != &substCodeType) {
|
||||
CompileEnv compEnv;
|
||||
int numBytes;
|
||||
const char *bytes = TclGetStringFromObj(objPtr, &numBytes);
|
||||
const char *bytes = TclGetString(objPtr);
|
||||
size_t numBytes = objPtr->length;
|
||||
|
||||
/* TODO: Check for more TIP 280 */
|
||||
TclInitCompileEnv(interp, &compEnv, bytes, numBytes, NULL, 0);
|
||||
@@ -1387,14 +1369,14 @@ ReleaseCmdWordData(
|
||||
Tcl_DecrRefCount(eclPtr->path);
|
||||
}
|
||||
for (i=0 ; i<eclPtr->nuloc ; i++) {
|
||||
ckfree(eclPtr->loc[i].line);
|
||||
Tcl_Free(eclPtr->loc[i].line);
|
||||
}
|
||||
|
||||
if (eclPtr->loc != NULL) {
|
||||
ckfree(eclPtr->loc);
|
||||
Tcl_Free(eclPtr->loc);
|
||||
}
|
||||
|
||||
ckfree(eclPtr);
|
||||
Tcl_Free(eclPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1421,14 +1403,14 @@ TclInitCompileEnv(
|
||||
register CompileEnv *envPtr,/* Points to the CompileEnv structure to
|
||||
* initialize. */
|
||||
const char *stringPtr, /* The source string to be compiled. */
|
||||
int numBytes, /* Number of bytes in source string. */
|
||||
size_t numBytes, /* Number of bytes in source string. */
|
||||
const CmdFrame *invoker, /* Location context invoking the bcc */
|
||||
int word) /* Index of the word in that context getting
|
||||
* compiled */
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
|
||||
assert(tclInstructionTable[LAST_INST_OPCODE+1].name == NULL);
|
||||
assert(tclInstructionTable[LAST_INST_OPCODE].name == NULL);
|
||||
|
||||
envPtr->iPtr = iPtr;
|
||||
envPtr->source = stringPtr;
|
||||
@@ -1473,7 +1455,7 @@ TclInitCompileEnv(
|
||||
* non-compiling evaluator
|
||||
*/
|
||||
|
||||
envPtr->extCmdMapPtr = ckalloc(sizeof(ExtCmdLoc));
|
||||
envPtr->extCmdMapPtr = Tcl_Alloc(sizeof(ExtCmdLoc));
|
||||
envPtr->extCmdMapPtr->loc = NULL;
|
||||
envPtr->extCmdMapPtr->nloc = 0;
|
||||
envPtr->extCmdMapPtr->nuloc = 0;
|
||||
@@ -1628,7 +1610,7 @@ TclFreeCompileEnv(
|
||||
register CompileEnv *envPtr)/* Points to the CompileEnv structure. */
|
||||
{
|
||||
if (envPtr->localLitTable.buckets != envPtr->localLitTable.staticBuckets){
|
||||
ckfree(envPtr->localLitTable.buckets);
|
||||
Tcl_Free(envPtr->localLitTable.buckets);
|
||||
envPtr->localLitTable.buckets = envPtr->localLitTable.staticBuckets;
|
||||
}
|
||||
if (envPtr->iPtr) {
|
||||
@@ -1658,20 +1640,20 @@ TclFreeCompileEnv(
|
||||
}
|
||||
}
|
||||
if (envPtr->mallocedCodeArray) {
|
||||
ckfree(envPtr->codeStart);
|
||||
Tcl_Free(envPtr->codeStart);
|
||||
}
|
||||
if (envPtr->mallocedLiteralArray) {
|
||||
ckfree(envPtr->literalArrayPtr);
|
||||
Tcl_Free(envPtr->literalArrayPtr);
|
||||
}
|
||||
if (envPtr->mallocedExceptArray) {
|
||||
ckfree(envPtr->exceptArrayPtr);
|
||||
ckfree(envPtr->exceptAuxArrayPtr);
|
||||
Tcl_Free(envPtr->exceptArrayPtr);
|
||||
Tcl_Free(envPtr->exceptAuxArrayPtr);
|
||||
}
|
||||
if (envPtr->mallocedCmdMap) {
|
||||
ckfree(envPtr->cmdMapPtr);
|
||||
Tcl_Free(envPtr->cmdMapPtr);
|
||||
}
|
||||
if (envPtr->mallocedAuxDataArray) {
|
||||
ckfree(envPtr->auxDataArrayPtr);
|
||||
Tcl_Free(envPtr->auxDataArrayPtr);
|
||||
}
|
||||
if (envPtr->extCmdMapPtr) {
|
||||
ReleaseCmdWordData(envPtr->extCmdMapPtr);
|
||||
@@ -1798,7 +1780,6 @@ CompileCmdLiteral(
|
||||
Tcl_Obj *cmdObj,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
int numBytes;
|
||||
const char *bytes;
|
||||
Command *cmdPtr;
|
||||
int cmdLitIdx, extraLiteralFlags = LITERAL_CMD_NAME;
|
||||
@@ -1808,8 +1789,8 @@ CompileCmdLiteral(
|
||||
extraLiteralFlags |= LITERAL_UNSHARED;
|
||||
}
|
||||
|
||||
bytes = TclGetStringFromObj(cmdObj, &numBytes);
|
||||
cmdLitIdx = TclRegisterLiteral(envPtr, bytes, numBytes, extraLiteralFlags);
|
||||
bytes = TclGetString(cmdObj);
|
||||
cmdLitIdx = TclRegisterLiteral(envPtr, bytes, cmdObj->length, extraLiteralFlags);
|
||||
|
||||
if (cmdPtr) {
|
||||
TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLitIdx), cmdPtr);
|
||||
@@ -1990,7 +1971,7 @@ CompileCmdCompileProc(
|
||||
|
||||
while (mapPtr->nuloc - 1 > eclIndex) {
|
||||
mapPtr->nuloc--;
|
||||
ckfree(mapPtr->loc[mapPtr->nuloc].line);
|
||||
Tcl_Free(mapPtr->loc[mapPtr->nuloc].line);
|
||||
mapPtr->loc[mapPtr->nuloc].line = NULL;
|
||||
}
|
||||
|
||||
@@ -2108,8 +2089,8 @@ CompileCommandTokens(
|
||||
|
||||
envPtr->line = cmdLine;
|
||||
envPtr->clNext = clNext;
|
||||
ckfree(eclPtr->loc[wlineat].line);
|
||||
ckfree(eclPtr->loc[wlineat].next);
|
||||
Tcl_Free(eclPtr->loc[wlineat].line);
|
||||
Tcl_Free(eclPtr->loc[wlineat].next);
|
||||
eclPtr->loc[wlineat].line = wlines;
|
||||
eclPtr->loc[wlineat].next = NULL;
|
||||
|
||||
@@ -2123,7 +2104,7 @@ TclCompileScript(
|
||||
* serves as context for finding and compiling
|
||||
* commands. May not be NULL. */
|
||||
const char *script, /* The source script to compile. */
|
||||
int numBytes, /* Number of bytes in script. If < 0, the
|
||||
size_t numBytes, /* Number of bytes in script. If -1, the
|
||||
* script consists of all bytes up to the
|
||||
* first null character. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
@@ -2141,7 +2122,7 @@ TclCompileScript(
|
||||
|
||||
/* Each iteration compiles one command from the script. */
|
||||
|
||||
while (numBytes > 0) {
|
||||
while (numBytes + 1 > 1) {
|
||||
Tcl_Parse parse;
|
||||
const char *next;
|
||||
|
||||
@@ -2276,8 +2257,8 @@ TclCompileVarSubst(
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
const char *p, *name = tokenPtr[1].start;
|
||||
int nameBytes = tokenPtr[1].size;
|
||||
int i, localVar, localVarName = 1;
|
||||
size_t i, nameBytes = tokenPtr[1].size;
|
||||
int localVar, localVarName = 1;
|
||||
|
||||
/*
|
||||
* Determine how the variable name should be handled: if it contains any
|
||||
@@ -2351,7 +2332,8 @@ TclCompileTokens(
|
||||
Tcl_DString textBuffer; /* Holds concatenated chars from adjacent
|
||||
* TCL_TOKEN_TEXT, TCL_TOKEN_BS tokens. */
|
||||
char buffer[TCL_UTF_MAX];
|
||||
int i, numObjsToConcat, length, adjust;
|
||||
int i, numObjsToConcat, adjust;
|
||||
size_t length;
|
||||
unsigned char *entryCodeNext = envPtr->codeNext;
|
||||
#define NUM_STATIC_POS 20
|
||||
int isLiteral, maxNumCL, numCL;
|
||||
@@ -2386,7 +2368,7 @@ TclCompileTokens(
|
||||
|
||||
if (isLiteral) {
|
||||
maxNumCL = NUM_STATIC_POS;
|
||||
clPosition = ckalloc(maxNumCL * sizeof(int));
|
||||
clPosition = Tcl_Alloc(maxNumCL * sizeof(int));
|
||||
}
|
||||
|
||||
adjust = 0;
|
||||
@@ -2427,7 +2409,7 @@ TclCompileTokens(
|
||||
|
||||
if (numCL >= maxNumCL) {
|
||||
maxNumCL *= 2;
|
||||
clPosition = ckrealloc(clPosition,
|
||||
clPosition = Tcl_Realloc(clPosition,
|
||||
maxNumCL * sizeof(int));
|
||||
}
|
||||
clPosition[numCL] = clPos;
|
||||
@@ -2485,7 +2467,7 @@ TclCompileTokens(
|
||||
|
||||
default:
|
||||
Tcl_Panic("Unexpected token type in TclCompileTokens: %d; %.*s",
|
||||
tokenPtr->type, tokenPtr->size, tokenPtr->start);
|
||||
tokenPtr->type, (int)tokenPtr->size, tokenPtr->start);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2532,7 +2514,7 @@ TclCompileTokens(
|
||||
*/
|
||||
|
||||
if (maxNumCL) {
|
||||
ckfree(clPosition);
|
||||
Tcl_Free(clPosition);
|
||||
}
|
||||
TclCheckStackDepth(depth+1, envPtr);
|
||||
}
|
||||
@@ -2743,8 +2725,8 @@ PreventCycle(
|
||||
* can be sure we do not have any lingering cycles hiding in
|
||||
* the intrep.
|
||||
*/
|
||||
int numBytes;
|
||||
const char *bytes = TclGetStringFromObj(objPtr, &numBytes);
|
||||
const char *bytes = TclGetString(objPtr);
|
||||
size_t numBytes = objPtr->length;
|
||||
Tcl_Obj *copyPtr = Tcl_NewStringObj(bytes, numBytes);
|
||||
|
||||
Tcl_IncrRefCount(copyPtr);
|
||||
@@ -2801,7 +2783,7 @@ TclInitByteCode(
|
||||
namespacePtr = envPtr->iPtr->globalNsPtr;
|
||||
}
|
||||
|
||||
p = ckalloc(structureSize);
|
||||
p = Tcl_Alloc(structureSize);
|
||||
codePtr = (ByteCode *) p;
|
||||
codePtr->interpHandle = TclHandlePreserve(iPtr->handle);
|
||||
codePtr->compileEpoch = iPtr->compileEpoch;
|
||||
@@ -2948,7 +2930,7 @@ TclFindCompiledLocal(
|
||||
register const char *name, /* Points to first character of the name of a
|
||||
* scalar or array variable. If NULL, a
|
||||
* temporary var should be created. */
|
||||
int nameBytes, /* Number of bytes in the name. */
|
||||
size_t nameBytes, /* Number of bytes in the name. */
|
||||
int create, /* If 1, allocate a local frame entry for the
|
||||
* variable if it is new. */
|
||||
CompileEnv *envPtr) /* Points to the current compile environment*/
|
||||
@@ -2974,7 +2956,7 @@ TclFindCompiledLocal(
|
||||
LocalCache *cachePtr = envPtr->iPtr->varFramePtr->localCachePtr;
|
||||
const char *localName;
|
||||
Tcl_Obj **varNamePtr;
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
if (!cachePtr || !name) {
|
||||
return -1;
|
||||
@@ -3001,8 +2983,8 @@ TclFindCompiledLocal(
|
||||
if (!TclIsVarTemporary(localPtr)) {
|
||||
char *localName = localPtr->name;
|
||||
|
||||
if ((nameBytes == localPtr->nameLength) &&
|
||||
(strncmp(name,localName,(unsigned)nameBytes) == 0)) {
|
||||
if ((nameBytes == (size_t)localPtr->nameLength) &&
|
||||
(strncmp(name,localName,nameBytes) == 0)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -3016,7 +2998,7 @@ TclFindCompiledLocal(
|
||||
|
||||
if (create || (name == NULL)) {
|
||||
localVar = procPtr->numCompiledLocals;
|
||||
localPtr = ckalloc(TclOffset(CompiledLocal, name) + nameBytes + 1);
|
||||
localPtr = Tcl_Alloc(TclOffset(CompiledLocal, name) + nameBytes + 1);
|
||||
if (procPtr->firstLocalPtr == NULL) {
|
||||
procPtr->firstLocalPtr = procPtr->lastLocalPtr = localPtr;
|
||||
} else {
|
||||
@@ -3080,14 +3062,14 @@ TclExpandCodeArray(
|
||||
size_t newBytes = 2 * (envPtr->codeEnd - envPtr->codeStart);
|
||||
|
||||
if (envPtr->mallocedCodeArray) {
|
||||
envPtr->codeStart = ckrealloc(envPtr->codeStart, newBytes);
|
||||
envPtr->codeStart = Tcl_Realloc(envPtr->codeStart, newBytes);
|
||||
} else {
|
||||
/*
|
||||
* envPtr->codeStart isn't a ckalloc'd pointer, so we must code a
|
||||
* ckrealloc equivalent for ourselves.
|
||||
* envPtr->codeStart isn't a Tcl_Alloc'd pointer, so we must code a
|
||||
* Tcl_Realloc equivalent for ourselves.
|
||||
*/
|
||||
|
||||
unsigned char *newPtr = ckalloc(newBytes);
|
||||
unsigned char *newPtr = Tcl_Alloc(newBytes);
|
||||
|
||||
memcpy(newPtr, envPtr->codeStart, currBytes);
|
||||
envPtr->codeStart = newPtr;
|
||||
@@ -3147,14 +3129,14 @@ EnterCmdStartData(
|
||||
size_t newBytes = newElems * sizeof(CmdLocation);
|
||||
|
||||
if (envPtr->mallocedCmdMap) {
|
||||
envPtr->cmdMapPtr = ckrealloc(envPtr->cmdMapPtr, newBytes);
|
||||
envPtr->cmdMapPtr = Tcl_Realloc(envPtr->cmdMapPtr, newBytes);
|
||||
} else {
|
||||
/*
|
||||
* envPtr->cmdMapPtr isn't a ckalloc'd pointer, so we must code a
|
||||
* ckrealloc equivalent for ourselves.
|
||||
* envPtr->cmdMapPtr isn't a Tcl_Alloc'd pointer, so we must code a
|
||||
* Tcl_Realloc equivalent for ourselves.
|
||||
*/
|
||||
|
||||
CmdLocation *newPtr = ckalloc(newBytes);
|
||||
CmdLocation *newPtr = Tcl_Alloc(newBytes);
|
||||
|
||||
memcpy(newPtr, envPtr->cmdMapPtr, currBytes);
|
||||
envPtr->cmdMapPtr = newPtr;
|
||||
@@ -3273,16 +3255,16 @@ EnterCmdWordData(
|
||||
size_t newElems = (currElems ? 2*currElems : 1);
|
||||
size_t newBytes = newElems * sizeof(ECL);
|
||||
|
||||
eclPtr->loc = ckrealloc(eclPtr->loc, newBytes);
|
||||
eclPtr->loc = Tcl_Realloc(eclPtr->loc, newBytes);
|
||||
eclPtr->nloc = newElems;
|
||||
}
|
||||
|
||||
ePtr = &eclPtr->loc[eclPtr->nuloc];
|
||||
ePtr->srcOffset = srcOffset;
|
||||
ePtr->line = ckalloc(numWords * sizeof(int));
|
||||
ePtr->next = ckalloc(numWords * sizeof(int *));
|
||||
ePtr->line = Tcl_Alloc(numWords * sizeof(int));
|
||||
ePtr->next = Tcl_Alloc(numWords * sizeof(int *));
|
||||
ePtr->nline = numWords;
|
||||
wwlines = ckalloc(numWords * sizeof(int));
|
||||
wwlines = Tcl_Alloc(numWords * sizeof(int));
|
||||
|
||||
last = cmd;
|
||||
wordLine = line;
|
||||
@@ -3351,17 +3333,17 @@ TclCreateExceptRange(
|
||||
|
||||
if (envPtr->mallocedExceptArray) {
|
||||
envPtr->exceptArrayPtr =
|
||||
ckrealloc(envPtr->exceptArrayPtr, newBytes);
|
||||
Tcl_Realloc(envPtr->exceptArrayPtr, newBytes);
|
||||
envPtr->exceptAuxArrayPtr =
|
||||
ckrealloc(envPtr->exceptAuxArrayPtr, newBytes2);
|
||||
Tcl_Realloc(envPtr->exceptAuxArrayPtr, newBytes2);
|
||||
} else {
|
||||
/*
|
||||
* envPtr->exceptArrayPtr isn't a ckalloc'd pointer, so we must
|
||||
* code a ckrealloc equivalent for ourselves.
|
||||
* envPtr->exceptArrayPtr isn't a Tcl_Alloc'd pointer, so we must
|
||||
* code a Tcl_Realloc equivalent for ourselves.
|
||||
*/
|
||||
|
||||
ExceptionRange *newPtr = ckalloc(newBytes);
|
||||
ExceptionAux *newPtr2 = ckalloc(newBytes2);
|
||||
ExceptionRange *newPtr = Tcl_Alloc(newBytes);
|
||||
ExceptionAux *newPtr2 = Tcl_Alloc(newBytes2);
|
||||
|
||||
memcpy(newPtr, envPtr->exceptArrayPtr, currBytes);
|
||||
memcpy(newPtr2, envPtr->exceptAuxArrayPtr, currBytes2);
|
||||
@@ -3464,11 +3446,11 @@ TclAddLoopBreakFixup(
|
||||
auxPtr->allocBreakTargets *= 2;
|
||||
auxPtr->allocBreakTargets += 2;
|
||||
if (auxPtr->breakTargets) {
|
||||
auxPtr->breakTargets = ckrealloc(auxPtr->breakTargets,
|
||||
auxPtr->breakTargets = Tcl_Realloc(auxPtr->breakTargets,
|
||||
sizeof(int) * auxPtr->allocBreakTargets);
|
||||
} else {
|
||||
auxPtr->breakTargets =
|
||||
ckalloc(sizeof(int) * auxPtr->allocBreakTargets);
|
||||
Tcl_Alloc(sizeof(int) * auxPtr->allocBreakTargets);
|
||||
}
|
||||
}
|
||||
auxPtr->breakTargets[auxPtr->numBreakTargets - 1] = CurrentOffset(envPtr);
|
||||
@@ -3490,11 +3472,11 @@ TclAddLoopContinueFixup(
|
||||
auxPtr->allocContinueTargets *= 2;
|
||||
auxPtr->allocContinueTargets += 2;
|
||||
if (auxPtr->continueTargets) {
|
||||
auxPtr->continueTargets = ckrealloc(auxPtr->continueTargets,
|
||||
auxPtr->continueTargets = Tcl_Realloc(auxPtr->continueTargets,
|
||||
sizeof(int) * auxPtr->allocContinueTargets);
|
||||
} else {
|
||||
auxPtr->continueTargets =
|
||||
ckalloc(sizeof(int) * auxPtr->allocContinueTargets);
|
||||
Tcl_Alloc(sizeof(int) * auxPtr->allocContinueTargets);
|
||||
}
|
||||
}
|
||||
auxPtr->continueTargets[auxPtr->numContinueTargets - 1] =
|
||||
@@ -3656,12 +3638,12 @@ TclFinalizeLoopExceptionRange(
|
||||
*/
|
||||
|
||||
if (auxPtr->breakTargets) {
|
||||
ckfree(auxPtr->breakTargets);
|
||||
Tcl_Free(auxPtr->breakTargets);
|
||||
auxPtr->breakTargets = NULL;
|
||||
auxPtr->numBreakTargets = 0;
|
||||
}
|
||||
if (auxPtr->continueTargets) {
|
||||
ckfree(auxPtr->continueTargets);
|
||||
Tcl_Free(auxPtr->continueTargets);
|
||||
auxPtr->continueTargets = NULL;
|
||||
auxPtr->numContinueTargets = 0;
|
||||
}
|
||||
@@ -3717,14 +3699,14 @@ TclCreateAuxData(
|
||||
|
||||
if (envPtr->mallocedAuxDataArray) {
|
||||
envPtr->auxDataArrayPtr =
|
||||
ckrealloc(envPtr->auxDataArrayPtr, newBytes);
|
||||
Tcl_Realloc(envPtr->auxDataArrayPtr, newBytes);
|
||||
} else {
|
||||
/*
|
||||
* envPtr->auxDataArrayPtr isn't a ckalloc'd pointer, so we must
|
||||
* code a ckrealloc equivalent for ourselves.
|
||||
* envPtr->auxDataArrayPtr isn't a Tcl_Alloc'd pointer, so we must
|
||||
* code a Tcl_Realloc equivalent for ourselves.
|
||||
*/
|
||||
|
||||
AuxData *newPtr = ckalloc(newBytes);
|
||||
AuxData *newPtr = Tcl_Alloc(newBytes);
|
||||
|
||||
memcpy(newPtr, envPtr->auxDataArrayPtr, currBytes);
|
||||
envPtr->auxDataArrayPtr = newPtr;
|
||||
@@ -3806,14 +3788,14 @@ TclExpandJumpFixupArray(
|
||||
size_t newBytes = newElems * sizeof(JumpFixup);
|
||||
|
||||
if (fixupArrayPtr->mallocedArray) {
|
||||
fixupArrayPtr->fixup = ckrealloc(fixupArrayPtr->fixup, newBytes);
|
||||
fixupArrayPtr->fixup = Tcl_Realloc(fixupArrayPtr->fixup, newBytes);
|
||||
} else {
|
||||
/*
|
||||
* fixupArrayPtr->fixup isn't a ckalloc'd pointer, so we must code a
|
||||
* ckrealloc equivalent for ourselves.
|
||||
* fixupArrayPtr->fixup isn't a Tcl_Alloc'd pointer, so we must code a
|
||||
* Tcl_Realloc equivalent for ourselves.
|
||||
*/
|
||||
|
||||
JumpFixup *newPtr = ckalloc(newBytes);
|
||||
JumpFixup *newPtr = Tcl_Alloc(newBytes);
|
||||
|
||||
memcpy(newPtr, fixupArrayPtr->fixup, currBytes);
|
||||
fixupArrayPtr->fixup = newPtr;
|
||||
@@ -3845,7 +3827,7 @@ TclFreeJumpFixupArray(
|
||||
* free. */
|
||||
{
|
||||
if (fixupArrayPtr->mallocedArray) {
|
||||
ckfree(fixupArrayPtr->fixup);
|
||||
Tcl_Free(fixupArrayPtr->fixup);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3945,7 +3927,7 @@ TclFixupForwardJump(
|
||||
{
|
||||
unsigned char *jumpPc, *p;
|
||||
int firstCmd, lastCmd, firstRange, lastRange, k;
|
||||
unsigned numBytes;
|
||||
size_t numBytes;
|
||||
|
||||
if (jumpDist <= distThreshold) {
|
||||
jumpPc = envPtr->codeStart + jumpFixupPtr->codeOffset;
|
||||
|
||||
+271
-291
@@ -87,7 +87,7 @@ typedef enum {
|
||||
* to a catch PC offset. */
|
||||
} ExceptionRangeType;
|
||||
|
||||
typedef struct ExceptionRange {
|
||||
typedef struct {
|
||||
ExceptionRangeType type; /* The kind of ExceptionRange. */
|
||||
int nestingLevel; /* Static depth of the exception range. Used
|
||||
* to find the most deeply-nested range
|
||||
@@ -162,7 +162,7 @@ typedef struct ExceptionAux {
|
||||
* source offset is not monotonic.
|
||||
*/
|
||||
|
||||
typedef struct CmdLocation {
|
||||
typedef struct {
|
||||
int codeOffset; /* Offset of first byte of command code. */
|
||||
int numCodeBytes; /* Number of bytes for command's code. */
|
||||
int srcOffset; /* Offset of first char of the command. */
|
||||
@@ -180,8 +180,8 @@ typedef struct CmdLocation {
|
||||
* frame and associated information, like the path of a sourced file.
|
||||
*/
|
||||
|
||||
typedef struct ECL {
|
||||
int srcOffset; /* Command location to find the entry. */
|
||||
typedef struct {
|
||||
size_t srcOffset; /* Command location to find the entry. */
|
||||
int nline; /* Number of words in the command */
|
||||
int *line; /* Line information for all words in the
|
||||
* command. */
|
||||
@@ -190,7 +190,7 @@ typedef struct ECL {
|
||||
* lines. */
|
||||
} ECL;
|
||||
|
||||
typedef struct ExtCmdLoc {
|
||||
typedef struct {
|
||||
int type; /* Context type. */
|
||||
int start; /* Starting line for compiled script. Needed
|
||||
* for the extended recompile check in
|
||||
@@ -217,9 +217,9 @@ typedef struct ExtCmdLoc {
|
||||
* the AuxData structure.
|
||||
*/
|
||||
|
||||
typedef ClientData (AuxDataDupProc) (ClientData clientData);
|
||||
typedef void (AuxDataFreeProc) (ClientData clientData);
|
||||
typedef void (AuxDataPrintProc)(ClientData clientData,
|
||||
typedef void *(AuxDataDupProc) (void *clientData);
|
||||
typedef void (AuxDataFreeProc) (void *clientData);
|
||||
typedef void (AuxDataPrintProc)(void *clientData,
|
||||
Tcl_Obj *appendObj, struct ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
|
||||
@@ -266,7 +266,7 @@ typedef struct AuxDataType {
|
||||
typedef struct AuxData {
|
||||
const AuxDataType *type; /* Pointer to the AuxData type associated with
|
||||
* this ClientData. */
|
||||
ClientData clientData; /* The compilation data itself. */
|
||||
void *clientData; /* The compilation data itself. */
|
||||
} AuxData;
|
||||
|
||||
/*
|
||||
@@ -417,7 +417,7 @@ typedef struct ByteCode {
|
||||
* procs are specific to an interpreter so the
|
||||
* code emitted will depend on the
|
||||
* interpreter. */
|
||||
unsigned int compileEpoch; /* Value of iPtr->compileEpoch when this
|
||||
size_t compileEpoch; /* Value of iPtr->compileEpoch when this
|
||||
* ByteCode was compiled. Used to invalidate
|
||||
* code when, e.g., commands with compile
|
||||
* procs are redefined. */
|
||||
@@ -425,11 +425,11 @@ typedef struct ByteCode {
|
||||
* compiled. If the code is executed if a
|
||||
* different namespace, it must be
|
||||
* recompiled. */
|
||||
unsigned int nsEpoch; /* Value of nsPtr->resolverEpoch when this
|
||||
size_t nsEpoch; /* Value of nsPtr->resolverEpoch when this
|
||||
* ByteCode was compiled. Used to invalidate
|
||||
* code when new namespace resolution rules
|
||||
* are put into effect. */
|
||||
unsigned int refCount; /* Reference count: set 1 when created plus 1
|
||||
size_t refCount; /* Reference count: set 1 when created plus 1
|
||||
* for each execution of the code currently
|
||||
* active. This structure can be freed when
|
||||
* refCount becomes zero. */
|
||||
@@ -519,312 +519,292 @@ typedef struct ByteCode {
|
||||
* Opcodes for the Tcl bytecode instructions. These must correspond to the
|
||||
* entries in the table of instruction descriptions, tclInstructionTable, in
|
||||
* tclCompile.c. Also, the order and number of the expression opcodes (e.g.,
|
||||
* INST_LOR) must match the entries in the array operatorStrings in
|
||||
* INST_BITOR) must match the entries in the array operatorStrings in
|
||||
* tclExecute.c.
|
||||
*/
|
||||
|
||||
/* Opcodes 0 to 9 */
|
||||
#define INST_DONE 0
|
||||
#define INST_PUSH1 1
|
||||
#define INST_PUSH4 2
|
||||
#define INST_POP 3
|
||||
#define INST_DUP 4
|
||||
#define INST_STR_CONCAT1 5
|
||||
#define INST_INVOKE_STK1 6
|
||||
#define INST_INVOKE_STK4 7
|
||||
#define INST_EVAL_STK 8
|
||||
#define INST_EXPR_STK 9
|
||||
enum TclInstruction {
|
||||
|
||||
/* Opcodes 10 to 23 */
|
||||
#define INST_LOAD_SCALAR1 10
|
||||
#define INST_LOAD_SCALAR4 11
|
||||
#define INST_LOAD_SCALAR_STK 12
|
||||
#define INST_LOAD_ARRAY1 13
|
||||
#define INST_LOAD_ARRAY4 14
|
||||
#define INST_LOAD_ARRAY_STK 15
|
||||
#define INST_LOAD_STK 16
|
||||
#define INST_STORE_SCALAR1 17
|
||||
#define INST_STORE_SCALAR4 18
|
||||
#define INST_STORE_SCALAR_STK 19
|
||||
#define INST_STORE_ARRAY1 20
|
||||
#define INST_STORE_ARRAY4 21
|
||||
#define INST_STORE_ARRAY_STK 22
|
||||
#define INST_STORE_STK 23
|
||||
/* Opcodes 0 to 9 */
|
||||
INST_DONE = 0,
|
||||
INST_PUSH1,
|
||||
INST_PUSH4,
|
||||
INST_POP,
|
||||
INST_DUP,
|
||||
INST_STR_CONCAT1,
|
||||
INST_INVOKE_STK1,
|
||||
INST_INVOKE_STK4,
|
||||
INST_EVAL_STK,
|
||||
INST_EXPR_STK,
|
||||
|
||||
/* Opcodes 24 to 33 */
|
||||
#define INST_INCR_SCALAR1 24
|
||||
#define INST_INCR_SCALAR_STK 25
|
||||
#define INST_INCR_ARRAY1 26
|
||||
#define INST_INCR_ARRAY_STK 27
|
||||
#define INST_INCR_STK 28
|
||||
#define INST_INCR_SCALAR1_IMM 29
|
||||
#define INST_INCR_SCALAR_STK_IMM 30
|
||||
#define INST_INCR_ARRAY1_IMM 31
|
||||
#define INST_INCR_ARRAY_STK_IMM 32
|
||||
#define INST_INCR_STK_IMM 33
|
||||
/* Opcodes 10 to 23 */
|
||||
INST_LOAD_SCALAR1,
|
||||
INST_LOAD_SCALAR4,
|
||||
INST_LOAD_SCALAR_STK,
|
||||
INST_LOAD_ARRAY1,
|
||||
INST_LOAD_ARRAY4,
|
||||
INST_LOAD_ARRAY_STK,
|
||||
INST_LOAD_STK,
|
||||
INST_STORE_SCALAR1,
|
||||
INST_STORE_SCALAR4,
|
||||
INST_STORE_SCALAR_STK,
|
||||
INST_STORE_ARRAY1,
|
||||
INST_STORE_ARRAY4,
|
||||
INST_STORE_ARRAY_STK,
|
||||
INST_STORE_STK,
|
||||
|
||||
/* Opcodes 34 to 39 */
|
||||
#define INST_JUMP1 34
|
||||
#define INST_JUMP4 35
|
||||
#define INST_JUMP_TRUE1 36
|
||||
#define INST_JUMP_TRUE4 37
|
||||
#define INST_JUMP_FALSE1 38
|
||||
#define INST_JUMP_FALSE4 39
|
||||
/* Opcodes 24 to 33 */
|
||||
INST_INCR_SCALAR1,
|
||||
INST_INCR_SCALAR_STK,
|
||||
INST_INCR_ARRAY1,
|
||||
INST_INCR_ARRAY_STK,
|
||||
INST_INCR_STK,
|
||||
INST_INCR_SCALAR1_IMM,
|
||||
INST_INCR_SCALAR_STK_IMM,
|
||||
INST_INCR_ARRAY1_IMM,
|
||||
INST_INCR_ARRAY_STK_IMM,
|
||||
INST_INCR_STK_IMM,
|
||||
|
||||
/* Opcodes 40 to 64 */
|
||||
#define INST_LOR 40
|
||||
#define INST_LAND 41
|
||||
#define INST_BITOR 42
|
||||
#define INST_BITXOR 43
|
||||
#define INST_BITAND 44
|
||||
#define INST_EQ 45
|
||||
#define INST_NEQ 46
|
||||
#define INST_LT 47
|
||||
#define INST_GT 48
|
||||
#define INST_LE 49
|
||||
#define INST_GE 50
|
||||
#define INST_LSHIFT 51
|
||||
#define INST_RSHIFT 52
|
||||
#define INST_ADD 53
|
||||
#define INST_SUB 54
|
||||
#define INST_MULT 55
|
||||
#define INST_DIV 56
|
||||
#define INST_MOD 57
|
||||
#define INST_UPLUS 58
|
||||
#define INST_UMINUS 59
|
||||
#define INST_BITNOT 60
|
||||
#define INST_LNOT 61
|
||||
#define INST_CALL_BUILTIN_FUNC1 62
|
||||
#define INST_CALL_FUNC1 63
|
||||
#define INST_TRY_CVT_TO_NUMERIC 64
|
||||
/* Opcodes 34 to 39 */
|
||||
INST_JUMP1,
|
||||
INST_JUMP4,
|
||||
INST_JUMP_TRUE1,
|
||||
INST_JUMP_TRUE4,
|
||||
INST_JUMP_FALSE1,
|
||||
INST_JUMP_FALSE4,
|
||||
|
||||
/* Opcodes 65 to 66 */
|
||||
#define INST_BREAK 65
|
||||
#define INST_CONTINUE 66
|
||||
/* Opcodes 42 to 64 */
|
||||
INST_BITOR,
|
||||
INST_BITXOR,
|
||||
INST_BITAND,
|
||||
INST_EQ,
|
||||
INST_NEQ,
|
||||
INST_LT,
|
||||
INST_GT,
|
||||
INST_LE,
|
||||
INST_GE,
|
||||
INST_LSHIFT,
|
||||
INST_RSHIFT,
|
||||
INST_ADD,
|
||||
INST_SUB,
|
||||
INST_MULT,
|
||||
INST_DIV,
|
||||
INST_MOD,
|
||||
INST_UPLUS,
|
||||
INST_UMINUS,
|
||||
INST_BITNOT,
|
||||
INST_LNOT,
|
||||
INST_TRY_CVT_TO_NUMERIC,
|
||||
|
||||
/* Opcodes 67 to 68 */
|
||||
#define INST_FOREACH_START4 67 /* DEPRECATED */
|
||||
#define INST_FOREACH_STEP4 68 /* DEPRECATED */
|
||||
/* Opcodes 65 to 66 */
|
||||
INST_BREAK,
|
||||
INST_CONTINUE,
|
||||
|
||||
/* Opcodes 69 to 72 */
|
||||
#define INST_BEGIN_CATCH4 69
|
||||
#define INST_END_CATCH 70
|
||||
#define INST_PUSH_RESULT 71
|
||||
#define INST_PUSH_RETURN_CODE 72
|
||||
/* Opcodes 69 to 72 */
|
||||
INST_BEGIN_CATCH4,
|
||||
INST_END_CATCH,
|
||||
INST_PUSH_RESULT,
|
||||
INST_PUSH_RETURN_CODE,
|
||||
|
||||
/* Opcodes 73 to 78 */
|
||||
#define INST_STR_EQ 73
|
||||
#define INST_STR_NEQ 74
|
||||
#define INST_STR_CMP 75
|
||||
#define INST_STR_LEN 76
|
||||
#define INST_STR_INDEX 77
|
||||
#define INST_STR_MATCH 78
|
||||
/* Opcodes 73 to 78 */
|
||||
INST_STR_EQ,
|
||||
INST_STR_NEQ,
|
||||
INST_STR_CMP,
|
||||
INST_STR_LEN,
|
||||
INST_STR_INDEX,
|
||||
INST_STR_MATCH,
|
||||
|
||||
/* Opcodes 78 to 81 */
|
||||
#define INST_LIST 79
|
||||
#define INST_LIST_INDEX 80
|
||||
#define INST_LIST_LENGTH 81
|
||||
/* Opcodes 79 to 81 */
|
||||
INST_LIST,
|
||||
INST_LIST_INDEX,
|
||||
INST_LIST_LENGTH,
|
||||
|
||||
/* Opcodes 82 to 87 */
|
||||
#define INST_APPEND_SCALAR1 82
|
||||
#define INST_APPEND_SCALAR4 83
|
||||
#define INST_APPEND_ARRAY1 84
|
||||
#define INST_APPEND_ARRAY4 85
|
||||
#define INST_APPEND_ARRAY_STK 86
|
||||
#define INST_APPEND_STK 87
|
||||
/* Opcodes 82 to 87 */
|
||||
INST_APPEND_SCALAR1,
|
||||
INST_APPEND_SCALAR4,
|
||||
INST_APPEND_ARRAY1,
|
||||
INST_APPEND_ARRAY4,
|
||||
INST_APPEND_ARRAY_STK,
|
||||
INST_APPEND_STK,
|
||||
|
||||
/* Opcodes 88 to 93 */
|
||||
#define INST_LAPPEND_SCALAR1 88
|
||||
#define INST_LAPPEND_SCALAR4 89
|
||||
#define INST_LAPPEND_ARRAY1 90
|
||||
#define INST_LAPPEND_ARRAY4 91
|
||||
#define INST_LAPPEND_ARRAY_STK 92
|
||||
#define INST_LAPPEND_STK 93
|
||||
/* Opcodes 88 to 93 */
|
||||
INST_LAPPEND_SCALAR1,
|
||||
INST_LAPPEND_SCALAR4,
|
||||
INST_LAPPEND_ARRAY1,
|
||||
INST_LAPPEND_ARRAY4,
|
||||
INST_LAPPEND_ARRAY_STK,
|
||||
INST_LAPPEND_STK,
|
||||
|
||||
/* TIP #22 - LINDEX operator with flat arg list */
|
||||
/* TIP #22 - LINDEX operator with flat arg list */
|
||||
INST_LIST_INDEX_MULTI,
|
||||
|
||||
#define INST_LIST_INDEX_MULTI 94
|
||||
/*
|
||||
* TIP #33 - 'lset' command. Code gen also required a Forth-like
|
||||
* OVER operation.
|
||||
*/
|
||||
INST_OVER,
|
||||
INST_LSET_LIST,
|
||||
INST_LSET_FLAT,
|
||||
|
||||
/*
|
||||
* TIP #33 - 'lset' command. Code gen also required a Forth-like
|
||||
* OVER operation.
|
||||
*/
|
||||
/* TIP#90 - 'return' command. */
|
||||
INST_RETURN_IMM,
|
||||
|
||||
#define INST_OVER 95
|
||||
#define INST_LSET_LIST 96
|
||||
#define INST_LSET_FLAT 97
|
||||
/* TIP#123 - exponentiation operator. */
|
||||
INST_EXPON,
|
||||
|
||||
/* TIP#90 - 'return' command. */
|
||||
/* TIP #157 - {*}... (word expansion) language syntax support. */
|
||||
INST_EXPAND_START,
|
||||
INST_EXPAND_STKTOP,
|
||||
INST_INVOKE_EXPANDED,
|
||||
|
||||
#define INST_RETURN_IMM 98
|
||||
/*
|
||||
* TIP #57 - 'lassign' command. Code generation requires immediate
|
||||
* LINDEX and LRANGE operators.
|
||||
*/
|
||||
INST_LIST_INDEX_IMM,
|
||||
INST_LIST_RANGE_IMM,
|
||||
INST_START_CMD,
|
||||
INST_LIST_IN,
|
||||
INST_LIST_NOT_IN,
|
||||
INST_PUSH_RETURN_OPTIONS,
|
||||
INST_RETURN_STK,
|
||||
|
||||
/* TIP#123 - exponentiation operator. */
|
||||
/*
|
||||
* Dictionary (TIP#111) related commands.
|
||||
*/
|
||||
INST_DICT_GET,
|
||||
INST_DICT_SET,
|
||||
INST_DICT_UNSET,
|
||||
INST_DICT_INCR_IMM,
|
||||
INST_DICT_APPEND,
|
||||
INST_DICT_LAPPEND,
|
||||
INST_DICT_FIRST,
|
||||
INST_DICT_NEXT,
|
||||
INST_DICT_UPDATE_START,
|
||||
INST_DICT_UPDATE_END,
|
||||
|
||||
#define INST_EXPON 99
|
||||
/*
|
||||
* Instruction to support jumps defined by tables (instead of the classic
|
||||
* [switch] technique of chained comparisons).
|
||||
*/
|
||||
INST_JUMP_TABLE,
|
||||
|
||||
/* TIP #157 - {*}... (word expansion) language syntax support. */
|
||||
/*
|
||||
* Instructions to support compilation of global, variable, upvar and
|
||||
* [namespace upvar].
|
||||
*/
|
||||
INST_UPVAR,
|
||||
INST_NSUPVAR,
|
||||
INST_VARIABLE,
|
||||
|
||||
#define INST_EXPAND_START 100
|
||||
#define INST_EXPAND_STKTOP 101
|
||||
#define INST_INVOKE_EXPANDED 102
|
||||
/* Instruction to support compiling syntax error to bytecode */
|
||||
INST_SYNTAX,
|
||||
|
||||
/*
|
||||
* TIP #57 - 'lassign' command. Code generation requires immediate
|
||||
* LINDEX and LRANGE operators.
|
||||
*/
|
||||
/* Instruction to reverse N items on top of stack */
|
||||
INST_REVERSE,
|
||||
|
||||
#define INST_LIST_INDEX_IMM 103
|
||||
#define INST_LIST_RANGE_IMM 104
|
||||
/* regexp instruction */
|
||||
INST_REGEXP,
|
||||
|
||||
#define INST_START_CMD 105
|
||||
/* For [info exists] compilation */
|
||||
INST_EXIST_SCALAR,
|
||||
INST_EXIST_ARRAY,
|
||||
INST_EXIST_ARRAY_STK,
|
||||
INST_EXIST_STK,
|
||||
|
||||
#define INST_LIST_IN 106
|
||||
#define INST_LIST_NOT_IN 107
|
||||
/* For [subst] compilation */
|
||||
INST_NOP,
|
||||
INST_RETURN_CODE_BRANCH,
|
||||
|
||||
#define INST_PUSH_RETURN_OPTIONS 108
|
||||
#define INST_RETURN_STK 109
|
||||
/* For [unset] compilation */
|
||||
INST_UNSET_SCALAR,
|
||||
INST_UNSET_ARRAY,
|
||||
INST_UNSET_ARRAY_STK,
|
||||
INST_UNSET_STK,
|
||||
|
||||
/*
|
||||
* Dictionary (TIP#111) related commands.
|
||||
*/
|
||||
/* For [dict with], [dict exists], [dict create] and [dict merge] */
|
||||
INST_DICT_EXPAND,
|
||||
INST_DICT_RECOMBINE_STK,
|
||||
INST_DICT_RECOMBINE_IMM,
|
||||
INST_DICT_EXISTS,
|
||||
INST_DICT_VERIFY,
|
||||
|
||||
#define INST_DICT_GET 110
|
||||
#define INST_DICT_SET 111
|
||||
#define INST_DICT_UNSET 112
|
||||
#define INST_DICT_INCR_IMM 113
|
||||
#define INST_DICT_APPEND 114
|
||||
#define INST_DICT_LAPPEND 115
|
||||
#define INST_DICT_FIRST 116
|
||||
#define INST_DICT_NEXT 117
|
||||
#define INST_DICT_DONE 118
|
||||
#define INST_DICT_UPDATE_START 119
|
||||
#define INST_DICT_UPDATE_END 120
|
||||
/* For [string map] and [regsub] compilation */
|
||||
INST_STR_MAP,
|
||||
INST_STR_FIND,
|
||||
INST_STR_FIND_LAST,
|
||||
INST_STR_RANGE_IMM,
|
||||
INST_STR_RANGE,
|
||||
|
||||
/*
|
||||
* Instruction to support jumps defined by tables (instead of the classic
|
||||
* [switch] technique of chained comparisons).
|
||||
*/
|
||||
/* For operations to do with coroutines and other NRE-manipulators */
|
||||
INST_YIELD,
|
||||
INST_COROUTINE_NAME,
|
||||
INST_TAILCALL,
|
||||
|
||||
#define INST_JUMP_TABLE 121
|
||||
/* For compilation of basic information operations */
|
||||
INST_NS_CURRENT,
|
||||
INST_INFO_LEVEL_NUM,
|
||||
INST_INFO_LEVEL_ARGS,
|
||||
INST_RESOLVE_COMMAND,
|
||||
|
||||
/*
|
||||
* Instructions to support compilation of global, variable, upvar and
|
||||
* [namespace upvar].
|
||||
*/
|
||||
/* For compilation relating to TclOO */
|
||||
INST_TCLOO_SELF,
|
||||
INST_TCLOO_CLASS,
|
||||
INST_TCLOO_NS,
|
||||
INST_TCLOO_IS_OBJECT,
|
||||
|
||||
#define INST_UPVAR 122
|
||||
#define INST_NSUPVAR 123
|
||||
#define INST_VARIABLE 124
|
||||
/* For compilation of [array] subcommands */
|
||||
INST_ARRAY_EXISTS_STK,
|
||||
INST_ARRAY_EXISTS_IMM,
|
||||
INST_ARRAY_MAKE_STK,
|
||||
INST_ARRAY_MAKE_IMM,
|
||||
|
||||
/* Instruction to support compiling syntax error to bytecode */
|
||||
INST_INVOKE_REPLACE,
|
||||
|
||||
#define INST_SYNTAX 125
|
||||
INST_LIST_CONCAT,
|
||||
|
||||
/* Instruction to reverse N items on top of stack */
|
||||
INST_EXPAND_DROP,
|
||||
|
||||
#define INST_REVERSE 126
|
||||
/* New foreach implementation */
|
||||
INST_FOREACH_START,
|
||||
INST_FOREACH_STEP,
|
||||
INST_FOREACH_END,
|
||||
INST_LMAP_COLLECT,
|
||||
|
||||
/* regexp instruction */
|
||||
/* For compilation of [string trim] and related */
|
||||
INST_STR_TRIM,
|
||||
INST_STR_TRIM_LEFT,
|
||||
INST_STR_TRIM_RIGHT,
|
||||
|
||||
#define INST_REGEXP 127
|
||||
INST_CONCAT_STK,
|
||||
|
||||
/* For [info exists] compilation */
|
||||
#define INST_EXIST_SCALAR 128
|
||||
#define INST_EXIST_ARRAY 129
|
||||
#define INST_EXIST_ARRAY_STK 130
|
||||
#define INST_EXIST_STK 131
|
||||
INST_STR_UPPER,
|
||||
INST_STR_LOWER,
|
||||
INST_STR_TITLE,
|
||||
INST_STR_REPLACE,
|
||||
|
||||
/* For [subst] compilation */
|
||||
#define INST_NOP 132
|
||||
#define INST_RETURN_CODE_BRANCH 133
|
||||
INST_ORIGIN_COMMAND,
|
||||
|
||||
/* For [unset] compilation */
|
||||
#define INST_UNSET_SCALAR 134
|
||||
#define INST_UNSET_ARRAY 135
|
||||
#define INST_UNSET_ARRAY_STK 136
|
||||
#define INST_UNSET_STK 137
|
||||
INST_TCLOO_NEXT,
|
||||
INST_TCLOO_NEXT_CLASS,
|
||||
|
||||
/* For [dict with], [dict exists], [dict create] and [dict merge] */
|
||||
#define INST_DICT_EXPAND 138
|
||||
#define INST_DICT_RECOMBINE_STK 139
|
||||
#define INST_DICT_RECOMBINE_IMM 140
|
||||
#define INST_DICT_EXISTS 141
|
||||
#define INST_DICT_VERIFY 142
|
||||
INST_YIELD_TO_INVOKE,
|
||||
|
||||
/* For [string map] and [regsub] compilation */
|
||||
#define INST_STR_MAP 143
|
||||
#define INST_STR_FIND 144
|
||||
#define INST_STR_FIND_LAST 145
|
||||
#define INST_STR_RANGE_IMM 146
|
||||
#define INST_STR_RANGE 147
|
||||
INST_NUM_TYPE,
|
||||
INST_TRY_CVT_TO_BOOLEAN,
|
||||
INST_STR_CLASS,
|
||||
|
||||
/* For operations to do with coroutines and other NRE-manipulators */
|
||||
#define INST_YIELD 148
|
||||
#define INST_COROUTINE_NAME 149
|
||||
#define INST_TAILCALL 150
|
||||
INST_LAPPEND_LIST,
|
||||
INST_LAPPEND_LIST_ARRAY,
|
||||
INST_LAPPEND_LIST_ARRAY_STK,
|
||||
INST_LAPPEND_LIST_STK,
|
||||
|
||||
/* For compilation of basic information operations */
|
||||
#define INST_NS_CURRENT 151
|
||||
#define INST_INFO_LEVEL_NUM 152
|
||||
#define INST_INFO_LEVEL_ARGS 153
|
||||
#define INST_RESOLVE_COMMAND 154
|
||||
INST_CLOCK_READ,
|
||||
|
||||
/* For compilation relating to TclOO */
|
||||
#define INST_TCLOO_SELF 155
|
||||
#define INST_TCLOO_CLASS 156
|
||||
#define INST_TCLOO_NS 157
|
||||
#define INST_TCLOO_IS_OBJECT 158
|
||||
/* The last opcode */
|
||||
LAST_INST_OPCODE
|
||||
};
|
||||
|
||||
/* For compilation of [array] subcommands */
|
||||
#define INST_ARRAY_EXISTS_STK 159
|
||||
#define INST_ARRAY_EXISTS_IMM 160
|
||||
#define INST_ARRAY_MAKE_STK 161
|
||||
#define INST_ARRAY_MAKE_IMM 162
|
||||
|
||||
#define INST_INVOKE_REPLACE 163
|
||||
|
||||
#define INST_LIST_CONCAT 164
|
||||
|
||||
#define INST_EXPAND_DROP 165
|
||||
|
||||
/* New foreach implementation */
|
||||
#define INST_FOREACH_START 166
|
||||
#define INST_FOREACH_STEP 167
|
||||
#define INST_FOREACH_END 168
|
||||
#define INST_LMAP_COLLECT 169
|
||||
|
||||
/* For compilation of [string trim] and related */
|
||||
#define INST_STR_TRIM 170
|
||||
#define INST_STR_TRIM_LEFT 171
|
||||
#define INST_STR_TRIM_RIGHT 172
|
||||
|
||||
#define INST_CONCAT_STK 173
|
||||
|
||||
#define INST_STR_UPPER 174
|
||||
#define INST_STR_LOWER 175
|
||||
#define INST_STR_TITLE 176
|
||||
#define INST_STR_REPLACE 177
|
||||
|
||||
#define INST_ORIGIN_COMMAND 178
|
||||
|
||||
#define INST_TCLOO_NEXT 179
|
||||
#define INST_TCLOO_NEXT_CLASS 180
|
||||
|
||||
#define INST_YIELD_TO_INVOKE 181
|
||||
|
||||
#define INST_NUM_TYPE 182
|
||||
#define INST_TRY_CVT_TO_BOOLEAN 183
|
||||
#define INST_STR_CLASS 184
|
||||
|
||||
#define INST_LAPPEND_LIST 185
|
||||
#define INST_LAPPEND_LIST_ARRAY 186
|
||||
#define INST_LAPPEND_LIST_ARRAY_STK 187
|
||||
#define INST_LAPPEND_LIST_STK 188
|
||||
|
||||
#define INST_CLOCK_READ 189
|
||||
|
||||
/* The last opcode */
|
||||
#define LAST_INST_OPCODE 189
|
||||
|
||||
/*
|
||||
* Table describing the Tcl bytecode instructions: their name (for displaying
|
||||
@@ -862,7 +842,7 @@ typedef enum InstOperandType {
|
||||
|
||||
typedef struct InstructionDesc {
|
||||
const char *name; /* Name of instruction. */
|
||||
int numBytes; /* Total number of bytes for instruction. */
|
||||
size_t numBytes; /* Total number of bytes for instruction. */
|
||||
int stackEffect; /* The worst-case balance stack effect of the
|
||||
* instruction, used for stack requirements
|
||||
* computations. The value INT_MIN signals
|
||||
@@ -1020,7 +1000,7 @@ MODULE_SCOPE const AuxDataType tclJumptableInfoType;
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
int length; /* Size of array */
|
||||
size_t length; /* Size of array */
|
||||
int varIndices[1]; /* Array of variable indices to manage when
|
||||
* processing the start and end of a [dict
|
||||
* update]. There is really more than one
|
||||
@@ -1075,7 +1055,7 @@ MODULE_SCOPE void TclCompileCmdWord(Tcl_Interp *interp,
|
||||
Tcl_Token *tokenPtr, int count,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclCompileExpr(Tcl_Interp *interp, const char *script,
|
||||
int numBytes, CompileEnv *envPtr, int optimize);
|
||||
size_t numBytes, CompileEnv *envPtr, int optimize);
|
||||
MODULE_SCOPE void TclCompileExprWords(Tcl_Interp *interp,
|
||||
Tcl_Token *tokenPtr, int numWords,
|
||||
CompileEnv *envPtr);
|
||||
@@ -1083,7 +1063,7 @@ MODULE_SCOPE void TclCompileInvocation(Tcl_Interp *interp,
|
||||
Tcl_Token *tokenPtr, Tcl_Obj *cmdObj, int numWords,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclCompileScript(Tcl_Interp *interp,
|
||||
const char *script, int numBytes,
|
||||
const char *script, size_t numBytes,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclCompileSyntaxError(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr);
|
||||
@@ -1092,13 +1072,13 @@ MODULE_SCOPE void TclCompileTokens(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclCompileVarSubst(Tcl_Interp *interp,
|
||||
Tcl_Token *tokenPtr, CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclCreateAuxData(ClientData clientData,
|
||||
MODULE_SCOPE int TclCreateAuxData(void *clientData,
|
||||
const AuxDataType *typePtr, CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclCreateExceptRange(ExceptionRangeType type,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE ExecEnv * TclCreateExecEnv(Tcl_Interp *interp, int size);
|
||||
MODULE_SCOPE ExecEnv * TclCreateExecEnv(Tcl_Interp *interp, size_t size);
|
||||
MODULE_SCOPE Tcl_Obj * TclCreateLiteral(Interp *iPtr, const char *bytes,
|
||||
int length, unsigned int hash, int *newPtr,
|
||||
size_t length, size_t hash, int *newPtr,
|
||||
Namespace *nsPtr, int flags,
|
||||
LiteralEntry **globalPtrPtr);
|
||||
MODULE_SCOPE void TclDeleteExecEnv(ExecEnv *eePtr);
|
||||
@@ -1112,8 +1092,8 @@ MODULE_SCOPE ExceptionRange * TclGetExceptionRangeForPc(unsigned char *pc,
|
||||
MODULE_SCOPE void TclExpandJumpFixupArray(JumpFixupArray *fixupArrayPtr);
|
||||
MODULE_SCOPE int TclNRExecuteByteCode(Tcl_Interp *interp,
|
||||
ByteCode *codePtr);
|
||||
MODULE_SCOPE Tcl_Obj * TclFetchLiteral(CompileEnv *envPtr, unsigned int index);
|
||||
MODULE_SCOPE int TclFindCompiledLocal(const char *name, int nameChars,
|
||||
MODULE_SCOPE Tcl_Obj * TclFetchLiteral(CompileEnv *envPtr, size_t index);
|
||||
MODULE_SCOPE int TclFindCompiledLocal(const char *name, size_t nameChars,
|
||||
int create, CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclFixupForwardJump(CompileEnv *envPtr,
|
||||
JumpFixup *jumpFixupPtr, int jumpDist,
|
||||
@@ -1127,7 +1107,7 @@ MODULE_SCOPE ByteCode * TclInitByteCodeObj(Tcl_Obj *objPtr,
|
||||
const Tcl_ObjType *typePtr, CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclInitCompileEnv(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, const char *string,
|
||||
int numBytes, const CmdFrame *invoker, int word);
|
||||
size_t numBytes, const CmdFrame *invoker, int word);
|
||||
MODULE_SCOPE void TclInitJumpFixupArray(JumpFixupArray *fixupArrayPtr);
|
||||
MODULE_SCOPE void TclInitLiteralTable(LiteralTable *tablePtr);
|
||||
MODULE_SCOPE ExceptionRange *TclGetInnermostExceptionRange(CompileEnv *envPtr,
|
||||
@@ -1142,7 +1122,7 @@ MODULE_SCOPE void TclFinalizeLoopExceptionRange(CompileEnv *envPtr,
|
||||
MODULE_SCOPE char * TclLiteralStats(LiteralTable *tablePtr);
|
||||
MODULE_SCOPE int TclLog2(int value);
|
||||
#endif
|
||||
MODULE_SCOPE int TclLocalScalar(const char *bytes, int numBytes,
|
||||
MODULE_SCOPE int TclLocalScalar(const char *bytes, size_t numBytes,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclLocalScalarFromToken(Tcl_Token *tokenPtr,
|
||||
CompileEnv *envPtr);
|
||||
@@ -1154,9 +1134,9 @@ MODULE_SCOPE void TclPrintByteCodeObj(Tcl_Interp *interp,
|
||||
MODULE_SCOPE int TclPrintInstruction(ByteCode *codePtr,
|
||||
const unsigned char *pc);
|
||||
MODULE_SCOPE void TclPrintObject(FILE *outFile,
|
||||
Tcl_Obj *objPtr, int maxChars);
|
||||
Tcl_Obj *objPtr, size_t maxChars);
|
||||
MODULE_SCOPE void TclPrintSource(FILE *outFile,
|
||||
const char *string, int maxChars);
|
||||
const char *string, size_t maxChars);
|
||||
MODULE_SCOPE void TclPushVarName(Tcl_Interp *interp,
|
||||
Tcl_Token *varTokenPtr, CompileEnv *envPtr,
|
||||
int flags, int *localIndexPtr,
|
||||
@@ -1166,16 +1146,16 @@ MODULE_SCOPE void TclReleaseByteCode(ByteCode *codePtr);
|
||||
MODULE_SCOPE void TclReleaseLiteral(Tcl_Interp *interp, Tcl_Obj *objPtr);
|
||||
MODULE_SCOPE void TclInvalidateCmdLiteral(Tcl_Interp *interp,
|
||||
const char *name, Namespace *nsPtr);
|
||||
MODULE_SCOPE int TclSingleOpCmd(ClientData clientData,
|
||||
MODULE_SCOPE int TclSingleOpCmd(void *clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int TclSortingOpCmd(ClientData clientData,
|
||||
MODULE_SCOPE int TclSortingOpCmd(void *clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int TclVariadicOpCmd(ClientData clientData,
|
||||
MODULE_SCOPE int TclVariadicOpCmd(void *clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int TclNoIdentOpCmd(ClientData clientData,
|
||||
MODULE_SCOPE int TclNoIdentOpCmd(void *clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
@@ -1186,12 +1166,12 @@ MODULE_SCOPE int TclWordKnownAtCompileTime(Tcl_Token *tokenPtr,
|
||||
Tcl_Obj *valuePtr);
|
||||
MODULE_SCOPE void TclLogCommandInfo(Tcl_Interp *interp,
|
||||
const char *script, const char *command,
|
||||
int length, const unsigned char *pc,
|
||||
size_t length, const unsigned char *pc,
|
||||
Tcl_Obj **tosPtr);
|
||||
MODULE_SCOPE Tcl_Obj *TclGetInnerContext(Tcl_Interp *interp,
|
||||
const unsigned char *pc, Tcl_Obj **tosPtr);
|
||||
MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
|
||||
MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
|
||||
MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
|
||||
register Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[], int isLambda);
|
||||
|
||||
@@ -1206,7 +1186,7 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
|
||||
/*
|
||||
* Simplified form to access AuxData.
|
||||
*
|
||||
* ClientData TclFetchAuxData(CompileEng *envPtr, int index);
|
||||
* void *TclFetchAuxData(CompileEng *envPtr, int index);
|
||||
*/
|
||||
|
||||
#define TclFetchAuxData(envPtr, index) \
|
||||
@@ -1525,7 +1505,7 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
|
||||
* these macros are:
|
||||
*
|
||||
* static void PushLiteral(CompileEnv *envPtr,
|
||||
* const char *string, int length);
|
||||
* const char *string, size_t length);
|
||||
* static void PushStringLiteral(CompileEnv *envPtr,
|
||||
* const char *string);
|
||||
*/
|
||||
@@ -1533,7 +1513,7 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
|
||||
#define PushLiteral(envPtr, string, length) \
|
||||
TclEmitPush(TclRegisterLiteral(envPtr, string, length, 0), (envPtr))
|
||||
#define PushStringLiteral(envPtr, string) \
|
||||
PushLiteral(envPtr, string, (int) (sizeof(string "") - 1))
|
||||
PushLiteral(envPtr, string, sizeof(string "") - 1)
|
||||
|
||||
/*
|
||||
* Macro to advance to the next token; it is more mnemonic than the address
|
||||
@@ -1549,7 +1529,7 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
|
||||
* Macro to get the offset to the next instruction to be issued. The ANSI C
|
||||
* "prototype" for this macro is:
|
||||
*
|
||||
* static int CurrentOffset(CompileEnv *envPtr);
|
||||
* static ptrdiff_t CurrentOffset(CompileEnv *envPtr);
|
||||
*/
|
||||
|
||||
#define CurrentOffset(envPtr) \
|
||||
|
||||
+5
-5
@@ -31,7 +31,7 @@
|
||||
* the (Tcl_Interp *) in which it is stored, and the encoding.
|
||||
*/
|
||||
|
||||
typedef struct QCCD {
|
||||
typedef struct {
|
||||
Tcl_Obj *pkg;
|
||||
Tcl_Interp *interp;
|
||||
char *encoding;
|
||||
@@ -79,11 +79,11 @@ Tcl_RegisterConfig(
|
||||
Tcl_Obj *pDB, *pkgDict;
|
||||
Tcl_DString cmdName;
|
||||
const Tcl_Config *cfg;
|
||||
QCCD *cdPtr = ckalloc(sizeof(QCCD));
|
||||
QCCD *cdPtr = Tcl_Alloc(sizeof(QCCD));
|
||||
|
||||
cdPtr->interp = interp;
|
||||
if (valEncoding) {
|
||||
cdPtr->encoding = ckalloc(strlen(valEncoding)+1);
|
||||
cdPtr->encoding = Tcl_Alloc(strlen(valEncoding)+1);
|
||||
strcpy(cdPtr->encoding, valEncoding);
|
||||
} else {
|
||||
cdPtr->encoding = NULL;
|
||||
@@ -333,9 +333,9 @@ QueryConfigDelete(
|
||||
Tcl_DictObjRemove(NULL, pDB, pkgName);
|
||||
Tcl_DecrRefCount(pkgName);
|
||||
if (cdPtr->encoding) {
|
||||
ckfree(cdPtr->encoding);
|
||||
Tcl_Free(cdPtr->encoding);
|
||||
}
|
||||
ckfree(cdPtr);
|
||||
Tcl_Free(cdPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+2
-2
@@ -182,9 +182,9 @@ typedef struct Tcl_ObjType {
|
||||
} Tcl_ObjType;
|
||||
|
||||
struct Tcl_Obj {
|
||||
int refCount;
|
||||
size_t refCount;
|
||||
char *bytes;
|
||||
int length;
|
||||
size_t length;
|
||||
Tcl_ObjType *typePtr;
|
||||
union {
|
||||
long longValue;
|
||||
|
||||
+2
-2
@@ -185,8 +185,8 @@ typedef struct DateInfo {
|
||||
int dateDigitCount;
|
||||
} DateInfo;
|
||||
|
||||
#define YYMALLOC ckalloc
|
||||
#define YYFREE(x) (ckfree((void*) (x)))
|
||||
#define YYMALLOC Tcl_Alloc
|
||||
#define YYFREE(x) (Tcl_Free((void*) (x)))
|
||||
|
||||
#define yyDSTmode (info->dateDSTmode)
|
||||
#define yyDayOrdinal (info->dateDayOrdinal)
|
||||
|
||||
+510
-671
File diff suppressed because it is too large
Load Diff
+29
-34
@@ -64,7 +64,7 @@ static void FreeDictInternalRep(Tcl_Obj *dictPtr);
|
||||
static void InvalidateDictChain(Tcl_Obj *dictObj);
|
||||
static int SetDictFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
|
||||
static void UpdateStringOfDict(Tcl_Obj *dictPtr);
|
||||
static Tcl_HashEntry * AllocChainEntry(Tcl_HashTable *tablePtr,void *keyPtr);
|
||||
static Tcl_HashEntry * AllocChainEntry(Tcl_HashTable *tablePtr, void *keyPtr);
|
||||
static inline void InitChainTable(struct Dict *dict);
|
||||
static inline void DeleteChainTable(struct Dict *dict);
|
||||
static inline Tcl_HashEntry *CreateChainEntry(struct Dict *dict,
|
||||
@@ -141,7 +141,7 @@ typedef struct Dict {
|
||||
* the dictionary. Used for doing traversal of
|
||||
* the entries in the order that they are
|
||||
* created. */
|
||||
unsigned int epoch; /* Epoch counter */
|
||||
size_t epoch; /* Epoch counter */
|
||||
size_t refCount; /* Reference counter (see above) */
|
||||
Tcl_Obj *chain; /* Linked list used for invalidating the
|
||||
* string representations of updated nested
|
||||
@@ -229,13 +229,13 @@ AllocChainEntry(
|
||||
Tcl_HashTable *tablePtr,
|
||||
void *keyPtr)
|
||||
{
|
||||
Tcl_Obj *objPtr = keyPtr;
|
||||
Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr;
|
||||
ChainEntry *cPtr;
|
||||
|
||||
cPtr = ckalloc(sizeof(ChainEntry));
|
||||
cPtr = Tcl_Alloc(sizeof(ChainEntry));
|
||||
cPtr->entry.key.objPtr = objPtr;
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
cPtr->entry.clientData = NULL;
|
||||
Tcl_SetHashValue(&cPtr->entry, NULL);
|
||||
cPtr->prevPtr = cPtr->nextPtr = NULL;
|
||||
|
||||
return &cPtr->entry;
|
||||
@@ -364,7 +364,7 @@ DupDictInternalRep(
|
||||
Tcl_Obj *copyPtr)
|
||||
{
|
||||
Dict *oldDict = DICT(srcPtr);
|
||||
Dict *newDict = ckalloc(sizeof(Dict));
|
||||
Dict *newDict = Tcl_Alloc(sizeof(Dict));
|
||||
ChainEntry *cPtr;
|
||||
|
||||
/*
|
||||
@@ -458,7 +458,7 @@ DeleteDict(
|
||||
Dict *dict)
|
||||
{
|
||||
DeleteChainTable(dict);
|
||||
ckfree(dict);
|
||||
Tcl_Free(dict);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -492,7 +492,7 @@ UpdateStringOfDict(
|
||||
Dict *dict = DICT(dictPtr);
|
||||
ChainEntry *cPtr;
|
||||
Tcl_Obj *keyPtr, *valuePtr;
|
||||
int i, length, bytesNeeded = 0;
|
||||
size_t i, length, bytesNeeded = 0;
|
||||
const char *elem;
|
||||
char *dst;
|
||||
|
||||
@@ -501,7 +501,7 @@ UpdateStringOfDict(
|
||||
* is not exposed by any API function...
|
||||
*/
|
||||
|
||||
int numElems = dict->table.numEntries * 2;
|
||||
size_t numElems = dict->table.numEntries * 2;
|
||||
|
||||
/* Handle empty list case first, simplifies what follows */
|
||||
if (numElems == 0) {
|
||||
@@ -517,7 +517,7 @@ UpdateStringOfDict(
|
||||
if (numElems <= LOCAL_SIZE) {
|
||||
flagPtr = localFlags;
|
||||
} else {
|
||||
flagPtr = ckalloc(numElems);
|
||||
flagPtr = Tcl_Alloc(numElems);
|
||||
}
|
||||
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
|
||||
/*
|
||||
@@ -527,22 +527,14 @@ UpdateStringOfDict(
|
||||
|
||||
flagPtr[i] = ( i ? TCL_DONT_QUOTE_HASH : 0 );
|
||||
keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
|
||||
elem = TclGetStringFromObj(keyPtr, &length);
|
||||
elem = TclGetString(keyPtr);
|
||||
length = keyPtr->length;
|
||||
bytesNeeded += TclScanElement(elem, length, flagPtr+i);
|
||||
if (bytesNeeded < 0) {
|
||||
Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
|
||||
}
|
||||
|
||||
flagPtr[i+1] = TCL_DONT_QUOTE_HASH;
|
||||
valuePtr = Tcl_GetHashValue(&cPtr->entry);
|
||||
elem = TclGetStringFromObj(valuePtr, &length);
|
||||
elem = TclGetString(valuePtr);
|
||||
length = valuePtr->length;
|
||||
bytesNeeded += TclScanElement(elem, length, flagPtr+i+1);
|
||||
if (bytesNeeded < 0) {
|
||||
Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
|
||||
}
|
||||
}
|
||||
if (bytesNeeded > INT_MAX - numElems + 1) {
|
||||
Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
|
||||
}
|
||||
bytesNeeded += numElems;
|
||||
|
||||
@@ -551,25 +543,27 @@ UpdateStringOfDict(
|
||||
*/
|
||||
|
||||
dictPtr->length = bytesNeeded - 1;
|
||||
dictPtr->bytes = ckalloc(bytesNeeded);
|
||||
dictPtr->bytes = Tcl_Alloc(bytesNeeded);
|
||||
dst = dictPtr->bytes;
|
||||
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
|
||||
flagPtr[i] |= ( i ? TCL_DONT_QUOTE_HASH : 0 );
|
||||
keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
|
||||
elem = TclGetStringFromObj(keyPtr, &length);
|
||||
elem = TclGetString(keyPtr);
|
||||
length = keyPtr->length;
|
||||
dst += TclConvertElement(elem, length, dst, flagPtr[i]);
|
||||
*dst++ = ' ';
|
||||
|
||||
flagPtr[i+1] |= TCL_DONT_QUOTE_HASH;
|
||||
valuePtr = Tcl_GetHashValue(&cPtr->entry);
|
||||
elem = TclGetStringFromObj(valuePtr, &length);
|
||||
elem = TclGetString(valuePtr);
|
||||
length = valuePtr->length;
|
||||
dst += TclConvertElement(elem, length, dst, flagPtr[i+1]);
|
||||
*dst++ = ' ';
|
||||
}
|
||||
dictPtr->bytes[dictPtr->length] = '\0';
|
||||
|
||||
if (flagPtr != localFlags) {
|
||||
ckfree(flagPtr);
|
||||
Tcl_Free(flagPtr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -600,7 +594,7 @@ SetDictFromAny(
|
||||
{
|
||||
Tcl_HashEntry *hPtr;
|
||||
int isNew;
|
||||
Dict *dict = ckalloc(sizeof(Dict));
|
||||
Dict *dict = Tcl_Alloc(sizeof(Dict));
|
||||
|
||||
InitChainTable(dict);
|
||||
|
||||
@@ -648,7 +642,8 @@ SetDictFromAny(
|
||||
while (nextElem < limit) {
|
||||
Tcl_Obj *keyPtr, *valuePtr;
|
||||
const char *elemStart;
|
||||
int elemSize, literal;
|
||||
size_t elemSize;
|
||||
int literal;
|
||||
|
||||
if (TclFindDictElement(interp, nextElem, (limit - nextElem),
|
||||
&elemStart, &nextElem, &elemSize, &literal) != TCL_OK) {
|
||||
@@ -666,7 +661,7 @@ SetDictFromAny(
|
||||
} else {
|
||||
/* Avoid double copy */
|
||||
TclNewObj(keyPtr);
|
||||
keyPtr->bytes = ckalloc((unsigned) elemSize + 1);
|
||||
keyPtr->bytes = Tcl_Alloc((unsigned) elemSize + 1);
|
||||
keyPtr->length = TclCopyAndCollapse(elemSize, elemStart,
|
||||
keyPtr->bytes);
|
||||
}
|
||||
@@ -682,7 +677,7 @@ SetDictFromAny(
|
||||
} else {
|
||||
/* Avoid double copy */
|
||||
TclNewObj(valuePtr);
|
||||
valuePtr->bytes = ckalloc((unsigned) elemSize + 1);
|
||||
valuePtr->bytes = Tcl_Alloc((unsigned) elemSize + 1);
|
||||
valuePtr->length = TclCopyAndCollapse(elemSize, elemStart,
|
||||
valuePtr->bytes);
|
||||
}
|
||||
@@ -723,7 +718,7 @@ SetDictFromAny(
|
||||
}
|
||||
errorInFindDictElement:
|
||||
DeleteChainTable(dict);
|
||||
ckfree(dict);
|
||||
Tcl_Free(dict);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1375,7 +1370,7 @@ Tcl_NewDictObj(void)
|
||||
|
||||
TclNewObj(dictPtr);
|
||||
TclInvalidateStringRep(dictPtr);
|
||||
dict = ckalloc(sizeof(Dict));
|
||||
dict = Tcl_Alloc(sizeof(Dict));
|
||||
InitChainTable(dict);
|
||||
dict->epoch = 1;
|
||||
dict->chain = NULL;
|
||||
@@ -1425,7 +1420,7 @@ Tcl_DbNewDictObj(
|
||||
|
||||
TclDbNewObj(dictPtr, file, line);
|
||||
TclInvalidateStringRep(dictPtr);
|
||||
dict = ckalloc(sizeof(Dict));
|
||||
dict = Tcl_Alloc(sizeof(Dict));
|
||||
InitChainTable(dict);
|
||||
dict->epoch = 1;
|
||||
dict->chain = NULL;
|
||||
@@ -2039,7 +2034,7 @@ DictInfoCmd(
|
||||
|
||||
statsStr = Tcl_HashStats(&dict->table);
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(statsStr, -1));
|
||||
ckfree(statsStr);
|
||||
Tcl_Free(statsStr);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -267,9 +267,8 @@ DisassembleByteCodeObj(
|
||||
*/
|
||||
|
||||
Tcl_AppendPrintfToObj(bufferObj,
|
||||
"ByteCode %p, refCt %u, epoch %u, interp %p (epoch %u)\n",
|
||||
codePtr, codePtr->refCount, codePtr->compileEpoch, iPtr,
|
||||
iPtr->compileEpoch);
|
||||
"ByteCode %p, refCt %" TCL_Z_MODIFIER "u, epoch %" TCL_Z_MODIFIER "u, interp %p (epoch %" TCL_Z_MODIFIER "u)\n",
|
||||
codePtr, codePtr->refCount, codePtr->compileEpoch, iPtr, iPtr->compileEpoch);
|
||||
Tcl_AppendToObj(bufferObj, " Source ", -1);
|
||||
PrintSourceToObj(bufferObj, codePtr->source,
|
||||
TclMin(codePtr->numSrcBytes, 55));
|
||||
@@ -312,7 +311,7 @@ DisassembleByteCodeObj(
|
||||
int numCompiledLocals = procPtr->numCompiledLocals;
|
||||
|
||||
Tcl_AppendPrintfToObj(bufferObj,
|
||||
" Proc %p, refCt %u, args %d, compiled locals %d\n",
|
||||
" Proc %p, refCt %" TCL_Z_MODIFIER "u, args %d, compiled locals %d\n",
|
||||
procPtr, procPtr->refCount, procPtr->numArgs,
|
||||
numCompiledLocals);
|
||||
if (numCompiledLocals > 0) {
|
||||
@@ -820,15 +819,15 @@ UpdateStringOfInstName(
|
||||
size_t len, inst = (size_t)objPtr->internalRep.wideValue;
|
||||
char *s, buf[TCL_INTEGER_SPACE + 5];
|
||||
|
||||
if (inst > LAST_INST_OPCODE) {
|
||||
sprintf(buf, "inst_%" TCL_Z_MODIFIER "d", inst);
|
||||
if (inst >= LAST_INST_OPCODE) {
|
||||
sprintf(buf, "inst_%" TCL_Z_MODIFIER "u", inst);
|
||||
s = buf;
|
||||
} else {
|
||||
s = (char *) tclInstructionTable[inst].name;
|
||||
}
|
||||
len = strlen(s);
|
||||
/* assert (len < UINT_MAX) */
|
||||
objPtr->bytes = ckalloc(len + 1);
|
||||
objPtr->bytes = Tcl_Alloc(len + 1);
|
||||
memcpy(objPtr->bytes, s, len + 1);
|
||||
objPtr->length = len;
|
||||
}
|
||||
|
||||
+36
-98
@@ -594,14 +594,14 @@ TclInitEncodingSubsystem(void)
|
||||
* code to duplicate the structure of a table encoding here.
|
||||
*/
|
||||
|
||||
dataPtr = ckalloc(sizeof(TableEncodingData));
|
||||
dataPtr = Tcl_Alloc(sizeof(TableEncodingData));
|
||||
memset(dataPtr, 0, sizeof(TableEncodingData));
|
||||
dataPtr->fallback = '?';
|
||||
|
||||
size = 256*(sizeof(unsigned short *) + sizeof(unsigned short));
|
||||
dataPtr->toUnicode = ckalloc(size);
|
||||
dataPtr->toUnicode = Tcl_Alloc(size);
|
||||
memset(dataPtr->toUnicode, 0, size);
|
||||
dataPtr->fromUnicode = ckalloc(size);
|
||||
dataPtr->fromUnicode = Tcl_Alloc(size);
|
||||
memset(dataPtr->fromUnicode, 0, size);
|
||||
|
||||
dataPtr->toUnicode[0] = (unsigned short *) (dataPtr->toUnicode + 256);
|
||||
@@ -675,70 +675,6 @@ TclFinalizeEncodingSubsystem(void)
|
||||
Tcl_MutexUnlock(&encodingMutex);
|
||||
}
|
||||
|
||||
/*
|
||||
*-------------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_GetDefaultEncodingDir --
|
||||
*
|
||||
* Legacy public interface to retrieve first directory in the encoding
|
||||
* searchPath.
|
||||
*
|
||||
* Results:
|
||||
* The directory pathname, as a string, or NULL for an empty encoding
|
||||
* search path.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
const char *
|
||||
Tcl_GetDefaultEncodingDir(void)
|
||||
{
|
||||
int numDirs;
|
||||
Tcl_Obj *first, *searchPath = Tcl_GetEncodingSearchPath();
|
||||
|
||||
Tcl_ListObjLength(NULL, searchPath, &numDirs);
|
||||
if (numDirs == 0) {
|
||||
return NULL;
|
||||
}
|
||||
Tcl_ListObjIndex(NULL, searchPath, 0, &first);
|
||||
|
||||
return TclGetString(first);
|
||||
}
|
||||
|
||||
/*
|
||||
*-------------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_SetDefaultEncodingDir --
|
||||
*
|
||||
* Legacy public interface to set the first directory in the encoding
|
||||
* search path.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Modifies the encoding search path.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
Tcl_SetDefaultEncodingDir(
|
||||
const char *path)
|
||||
{
|
||||
Tcl_Obj *searchPath = Tcl_GetEncodingSearchPath();
|
||||
Tcl_Obj *directory = Tcl_NewStringObj(path, -1);
|
||||
|
||||
searchPath = Tcl_DuplicateObj(searchPath);
|
||||
Tcl_ListObjReplace(NULL, searchPath, 0, 0, 1, &directory);
|
||||
Tcl_SetEncodingSearchPath(searchPath);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
*-------------------------------------------------------------------------
|
||||
*
|
||||
@@ -854,9 +790,9 @@ FreeEncoding(
|
||||
Tcl_DeleteHashEntry(encodingPtr->hPtr);
|
||||
}
|
||||
if (encodingPtr->name) {
|
||||
ckfree(encodingPtr->name);
|
||||
Tcl_Free(encodingPtr->name);
|
||||
}
|
||||
ckfree(encodingPtr);
|
||||
Tcl_Free(encodingPtr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1044,7 +980,7 @@ Tcl_CreateEncoding(
|
||||
const Tcl_EncodingType *typePtr)
|
||||
/* The encoding type. */
|
||||
{
|
||||
Encoding *encodingPtr = ckalloc(sizeof(Encoding));
|
||||
Encoding *encodingPtr = Tcl_Alloc(sizeof(Encoding));
|
||||
encodingPtr->name = NULL;
|
||||
encodingPtr->toUtfProc = typePtr->toUtfProc;
|
||||
encodingPtr->fromUtfProc = typePtr->fromUtfProc;
|
||||
@@ -1076,7 +1012,7 @@ Tcl_CreateEncoding(
|
||||
replaceMe->hPtr = NULL;
|
||||
}
|
||||
|
||||
name = ckalloc(strlen(typePtr->encodingName) + 1);
|
||||
name = Tcl_Alloc(strlen(typePtr->encodingName) + 1);
|
||||
encodingPtr->name = strcpy(name, typePtr->encodingName);
|
||||
encodingPtr->hPtr = hPtr;
|
||||
Tcl_SetHashValue(hPtr, encodingPtr);
|
||||
@@ -1112,7 +1048,7 @@ Tcl_ExternalToUtfDString(
|
||||
Tcl_Encoding encoding, /* The encoding for the source string, or NULL
|
||||
* for the default system encoding. */
|
||||
const char *src, /* Source string in specified encoding. */
|
||||
int srcLen, /* Source string length in bytes, or < 0 for
|
||||
size_t srcLen, /* Source string length in bytes, or -1 for
|
||||
* encoding-specific string length. */
|
||||
Tcl_DString *dstPtr) /* Uninitialized or free DString in which the
|
||||
* converted string is stored. */
|
||||
@@ -1120,7 +1056,8 @@ Tcl_ExternalToUtfDString(
|
||||
char *dst;
|
||||
Tcl_EncodingState state;
|
||||
const Encoding *encodingPtr;
|
||||
int flags, dstLen, result, soFar, srcRead, dstWrote, dstChars;
|
||||
int flags, result, soFar, srcRead, dstWrote, dstChars;
|
||||
size_t dstLen;
|
||||
|
||||
Tcl_DStringInit(dstPtr);
|
||||
dst = Tcl_DStringValue(dstPtr);
|
||||
@@ -1133,7 +1070,7 @@ Tcl_ExternalToUtfDString(
|
||||
|
||||
if (src == NULL) {
|
||||
srcLen = 0;
|
||||
} else if (srcLen < 0) {
|
||||
} else if (srcLen == TCL_AUTO_LENGTH) {
|
||||
srcLen = encodingPtr->lengthProc(src);
|
||||
}
|
||||
|
||||
@@ -1185,8 +1122,8 @@ Tcl_ExternalToUtf(
|
||||
Tcl_Encoding encoding, /* The encoding for the source string, or NULL
|
||||
* for the default system encoding. */
|
||||
const char *src, /* Source string in specified encoding. */
|
||||
int srcLen, /* Source string length in bytes, or < 0 for
|
||||
* encoding-specific string length. */
|
||||
size_t srcLen, /* Source string length in bytes, or -1
|
||||
* for encoding-specific string length. */
|
||||
int flags, /* Conversion control flags. */
|
||||
Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
|
||||
* information used during a piecewise
|
||||
@@ -1195,7 +1132,7 @@ Tcl_ExternalToUtf(
|
||||
* routine under control of flags argument. */
|
||||
char *dst, /* Output buffer in which converted string is
|
||||
* stored. */
|
||||
int dstLen, /* The maximum length of output buffer in
|
||||
size_t dstLen, /* The maximum length of output buffer in
|
||||
* bytes. */
|
||||
int *srcReadPtr, /* Filled with the number of bytes from the
|
||||
* source string that were converted. This may
|
||||
@@ -1223,7 +1160,7 @@ Tcl_ExternalToUtf(
|
||||
|
||||
if (src == NULL) {
|
||||
srcLen = 0;
|
||||
} else if (srcLen < 0) {
|
||||
} else if (srcLen == TCL_AUTO_LENGTH) {
|
||||
srcLen = encodingPtr->lengthProc(src);
|
||||
}
|
||||
if (statePtr == NULL) {
|
||||
@@ -1302,7 +1239,7 @@ Tcl_UtfToExternalDString(
|
||||
Tcl_Encoding encoding, /* The encoding for the converted string, or
|
||||
* NULL for the default system encoding. */
|
||||
const char *src, /* Source string in UTF-8. */
|
||||
int srcLen, /* Source string length in bytes, or < 0 for
|
||||
size_t srcLen, /* Source string length in bytes, or -1 for
|
||||
* strlen(). */
|
||||
Tcl_DString *dstPtr) /* Uninitialized or free DString in which the
|
||||
* converted string is stored. */
|
||||
@@ -1310,7 +1247,8 @@ Tcl_UtfToExternalDString(
|
||||
char *dst;
|
||||
Tcl_EncodingState state;
|
||||
const Encoding *encodingPtr;
|
||||
int flags, dstLen, result, soFar, srcRead, dstWrote, dstChars;
|
||||
int flags, result, soFar, srcRead, dstWrote, dstChars;
|
||||
size_t dstLen;
|
||||
|
||||
Tcl_DStringInit(dstPtr);
|
||||
dst = Tcl_DStringValue(dstPtr);
|
||||
@@ -1323,7 +1261,7 @@ Tcl_UtfToExternalDString(
|
||||
|
||||
if (src == NULL) {
|
||||
srcLen = 0;
|
||||
} else if (srcLen < 0) {
|
||||
} else if (srcLen == TCL_AUTO_LENGTH) {
|
||||
srcLen = strlen(src);
|
||||
}
|
||||
flags = TCL_ENCODING_START | TCL_ENCODING_END;
|
||||
@@ -1377,8 +1315,8 @@ Tcl_UtfToExternal(
|
||||
Tcl_Encoding encoding, /* The encoding for the converted string, or
|
||||
* NULL for the default system encoding. */
|
||||
const char *src, /* Source string in UTF-8. */
|
||||
int srcLen, /* Source string length in bytes, or < 0 for
|
||||
* strlen(). */
|
||||
size_t srcLen, /* Source string length in bytes, or -1
|
||||
* for strlen(). */
|
||||
int flags, /* Conversion control flags. */
|
||||
Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
|
||||
* information used during a piecewise
|
||||
@@ -1387,7 +1325,7 @@ Tcl_UtfToExternal(
|
||||
* routine under control of flags argument. */
|
||||
char *dst, /* Output buffer in which converted string
|
||||
* is stored. */
|
||||
int dstLen, /* The maximum length of output buffer in
|
||||
size_t dstLen, /* The maximum length of output buffer in
|
||||
* bytes. */
|
||||
int *srcReadPtr, /* Filled with the number of bytes from the
|
||||
* source string that were converted. This may
|
||||
@@ -1412,7 +1350,7 @@ Tcl_UtfToExternal(
|
||||
|
||||
if (src == NULL) {
|
||||
srcLen = 0;
|
||||
} else if (srcLen < 0) {
|
||||
} else if (srcLen == TCL_AUTO_LENGTH) {
|
||||
srcLen = strlen(src);
|
||||
}
|
||||
if (statePtr == NULL) {
|
||||
@@ -1742,7 +1680,7 @@ LoadTableEncoding(
|
||||
#undef PAGESIZE
|
||||
#define PAGESIZE (256 * sizeof(unsigned short))
|
||||
|
||||
dataPtr = ckalloc(sizeof(TableEncodingData));
|
||||
dataPtr = Tcl_Alloc(sizeof(TableEncodingData));
|
||||
memset(dataPtr, 0, sizeof(TableEncodingData));
|
||||
|
||||
dataPtr->fallback = fallback;
|
||||
@@ -1754,7 +1692,7 @@ LoadTableEncoding(
|
||||
*/
|
||||
|
||||
size = 256 * sizeof(unsigned short *) + numPages * PAGESIZE;
|
||||
dataPtr->toUnicode = ckalloc(size);
|
||||
dataPtr->toUnicode = Tcl_Alloc(size);
|
||||
memset(dataPtr->toUnicode, 0, size);
|
||||
pageMemPtr = (unsigned short *) (dataPtr->toUnicode + 256);
|
||||
|
||||
@@ -1812,7 +1750,7 @@ LoadTableEncoding(
|
||||
}
|
||||
}
|
||||
size = 256 * sizeof(unsigned short *) + numPages * PAGESIZE;
|
||||
dataPtr->fromUnicode = ckalloc(size);
|
||||
dataPtr->fromUnicode = Tcl_Alloc(size);
|
||||
memset(dataPtr->fromUnicode, 0, size);
|
||||
pageMemPtr = (unsigned short *) (dataPtr->fromUnicode + 256);
|
||||
|
||||
@@ -1908,7 +1846,7 @@ LoadTableEncoding(
|
||||
*/
|
||||
|
||||
for (TclDStringClear(&lineString);
|
||||
(len = Tcl_Gets(chan, &lineString)) >= 0;
|
||||
(len = Tcl_Gets(chan, &lineString)) != -1;
|
||||
TclDStringClear(&lineString)) {
|
||||
const unsigned char *p;
|
||||
int to, from;
|
||||
@@ -2002,7 +1940,7 @@ LoadEscapeEncoding(
|
||||
Tcl_DString lineString;
|
||||
|
||||
Tcl_DStringInit(&lineString);
|
||||
if (Tcl_Gets(chan, &lineString) < 0) {
|
||||
if (Tcl_Gets(chan, &lineString) == TCL_IO_FAILURE) {
|
||||
break;
|
||||
}
|
||||
line = Tcl_DStringValue(&lineString);
|
||||
@@ -2044,13 +1982,13 @@ LoadEscapeEncoding(
|
||||
Tcl_DStringAppend(&escapeData, (char *) &est, sizeof(est));
|
||||
}
|
||||
}
|
||||
ckfree(argv);
|
||||
Tcl_Free(argv);
|
||||
Tcl_DStringFree(&lineString);
|
||||
}
|
||||
|
||||
size = sizeof(EscapeEncodingData) - sizeof(EscapeSubTable)
|
||||
+ Tcl_DStringLength(&escapeData);
|
||||
dataPtr = ckalloc(size);
|
||||
dataPtr = Tcl_Alloc(size);
|
||||
dataPtr->initLen = strlen(init);
|
||||
memcpy(dataPtr->init, init, (unsigned) dataPtr->initLen + 1);
|
||||
dataPtr->finalLen = strlen(final);
|
||||
@@ -3044,11 +2982,11 @@ TableFreeProc(
|
||||
* Make sure we aren't freeing twice on shutdown. [Bug 219314]
|
||||
*/
|
||||
|
||||
ckfree(dataPtr->toUnicode);
|
||||
Tcl_Free(dataPtr->toUnicode);
|
||||
dataPtr->toUnicode = NULL;
|
||||
ckfree(dataPtr->fromUnicode);
|
||||
Tcl_Free(dataPtr->fromUnicode);
|
||||
dataPtr->fromUnicode = NULL;
|
||||
ckfree(dataPtr);
|
||||
Tcl_Free(dataPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3527,7 +3465,7 @@ EscapeFreeProc(
|
||||
subTablePtr++;
|
||||
}
|
||||
}
|
||||
ckfree(dataPtr);
|
||||
Tcl_Free(dataPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3628,7 +3566,7 @@ unilen(
|
||||
static void
|
||||
InitializeEncodingSearchPath(
|
||||
char **valuePtr,
|
||||
unsigned int *lengthPtr,
|
||||
size_t *lengthPtr,
|
||||
Tcl_Encoding *encodingPtr)
|
||||
{
|
||||
const char *bytes;
|
||||
@@ -3665,7 +3603,7 @@ InitializeEncodingSearchPath(
|
||||
bytes = TclGetString(searchPathObj);
|
||||
|
||||
*lengthPtr = searchPathObj->length;
|
||||
*valuePtr = ckalloc(*lengthPtr + 1);
|
||||
*valuePtr = Tcl_Alloc(*lengthPtr + 1);
|
||||
memcpy(*valuePtr, bytes, *lengthPtr + 1);
|
||||
Tcl_DecrRefCount(searchPathObj);
|
||||
}
|
||||
|
||||
+33
-31
@@ -90,7 +90,7 @@ static const Tcl_ObjType ensembleCmdType = {
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
unsigned int epoch; /* Used to confirm when the data in this
|
||||
size_t epoch; /* Used to confirm when the data in this
|
||||
* really structure matches up with the
|
||||
* ensemble. */
|
||||
Command *token; /* Reference to the command for which this
|
||||
@@ -660,12 +660,12 @@ TclCreateEnsembleInNs(
|
||||
EnsembleConfig *ensemblePtr;
|
||||
Tcl_Command token;
|
||||
|
||||
ensemblePtr = ckalloc(sizeof(EnsembleConfig));
|
||||
ensemblePtr = Tcl_Alloc(sizeof(EnsembleConfig));
|
||||
token = TclNRCreateCommandInNs(interp, name,
|
||||
(Tcl_Namespace *) nameNsPtr, TclEnsembleImplementationCmd,
|
||||
NsEnsembleImplementationCmdNR, ensemblePtr, DeleteEnsembleConfig);
|
||||
if (token == NULL) {
|
||||
ckfree(ensemblePtr);
|
||||
Tcl_Free(ensemblePtr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1630,7 +1630,7 @@ TclMakeEnsemble(
|
||||
Tcl_DStringFree(&buf);
|
||||
Tcl_DStringFree(&hiddenBuf);
|
||||
if (nameParts != NULL) {
|
||||
ckfree(nameParts);
|
||||
Tcl_Free(nameParts);
|
||||
}
|
||||
return ensemble;
|
||||
}
|
||||
@@ -1686,7 +1686,7 @@ NsEnsembleImplementationCmdNR(
|
||||
int reparseCount = 0; /* Number of reparses. */
|
||||
Tcl_Obj *errorObj; /* Used for building error messages. */
|
||||
Tcl_Obj *subObj;
|
||||
int subIdx;
|
||||
size_t subIdx;
|
||||
|
||||
/*
|
||||
* Must recheck objc, since numParameters might have changed. Cf. test
|
||||
@@ -1695,7 +1695,7 @@ NsEnsembleImplementationCmdNR(
|
||||
|
||||
restartEnsembleParse:
|
||||
subIdx = 1 + ensemblePtr->numParameters;
|
||||
if (objc < subIdx + 1) {
|
||||
if ((size_t)objc < subIdx + 1) {
|
||||
/*
|
||||
* We don't have a subcommand argument. Make error message.
|
||||
*/
|
||||
@@ -1792,15 +1792,16 @@ NsEnsembleImplementationCmdNR(
|
||||
* it (will be an error for a non-unique
|
||||
* prefix). */
|
||||
char *fullName = NULL; /* Full name of the subcommand. */
|
||||
int stringLength, i;
|
||||
int tableLength = ensemblePtr->subcommandTable.numEntries;
|
||||
size_t stringLength, i;
|
||||
size_t tableLength = ensemblePtr->subcommandTable.numEntries;
|
||||
Tcl_Obj *fix;
|
||||
|
||||
subcmdName = TclGetStringFromObj(subObj, &stringLength);
|
||||
subcmdName = TclGetString(subObj);
|
||||
stringLength = subObj->length;
|
||||
for (i=0 ; i<tableLength ; i++) {
|
||||
register int cmp = strncmp(subcmdName,
|
||||
ensemblePtr->subcommandArrayPtr[i],
|
||||
(unsigned) stringLength);
|
||||
stringLength);
|
||||
|
||||
if (cmp == 0) {
|
||||
if (fullName != NULL) {
|
||||
@@ -1957,7 +1958,7 @@ NsEnsembleImplementationCmdNR(
|
||||
if (ensemblePtr->subcommandTable.numEntries == 1) {
|
||||
Tcl_AppendToObj(errorObj, ensemblePtr->subcommandArrayPtr[0], -1);
|
||||
} else {
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
for (i=0 ; i<ensemblePtr->subcommandTable.numEntries-1 ; i++) {
|
||||
Tcl_AppendToObj(errorObj, ensemblePtr->subcommandArrayPtr[i], -1);
|
||||
@@ -2002,8 +2003,8 @@ TclClearRootEnsemble(
|
||||
int
|
||||
TclInitRewriteEnsemble(
|
||||
Tcl_Interp *interp,
|
||||
int numRemoved,
|
||||
int numInserted,
|
||||
size_t numRemoved,
|
||||
size_t numInserted,
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
@@ -2015,7 +2016,7 @@ TclInitRewriteEnsemble(
|
||||
iPtr->ensembleRewrite.numRemovedObjs = numRemoved;
|
||||
iPtr->ensembleRewrite.numInsertedObjs = numInserted;
|
||||
} else {
|
||||
int numIns = iPtr->ensembleRewrite.numInsertedObjs;
|
||||
size_t numIns = iPtr->ensembleRewrite.numInsertedObjs;
|
||||
|
||||
if (numIns < numRemoved) {
|
||||
iPtr->ensembleRewrite.numRemovedObjs += numRemoved - numIns;
|
||||
@@ -2084,8 +2085,8 @@ FreeER(
|
||||
{
|
||||
Tcl_Obj **tmp = (Tcl_Obj **)data[0];
|
||||
|
||||
ckfree(tmp[2]);
|
||||
ckfree(tmp);
|
||||
Tcl_Free(tmp[2]);
|
||||
Tcl_Free(tmp);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2094,15 +2095,15 @@ TclSpellFix(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Obj *const *objv,
|
||||
int objc,
|
||||
int badIdx,
|
||||
size_t badIdx,
|
||||
Tcl_Obj *bad,
|
||||
Tcl_Obj *fix)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Tcl_Obj *const *search;
|
||||
Tcl_Obj **store;
|
||||
int idx;
|
||||
int size;
|
||||
size_t idx;
|
||||
size_t size;
|
||||
|
||||
if (iPtr->ensembleRewrite.sourceObjs == NULL) {
|
||||
iPtr->ensembleRewrite.sourceObjs = objv;
|
||||
@@ -2156,11 +2157,11 @@ TclSpellFix(
|
||||
if (search[0] == NULL) {
|
||||
store = (Tcl_Obj **) search[2];
|
||||
} else {
|
||||
Tcl_Obj **tmp = ckalloc(3 * sizeof(Tcl_Obj *));
|
||||
Tcl_Obj **tmp = Tcl_Alloc(3 * sizeof(Tcl_Obj *));
|
||||
|
||||
tmp[0] = NULL;
|
||||
tmp[1] = (Tcl_Obj *) iPtr->ensembleRewrite.sourceObjs;
|
||||
tmp[2] = (Tcl_Obj *) ckalloc(size * sizeof(Tcl_Obj *));
|
||||
tmp[2] = (Tcl_Obj *) Tcl_Alloc(size * sizeof(Tcl_Obj *));
|
||||
memcpy(tmp[2], tmp[1], size * sizeof(Tcl_Obj *));
|
||||
|
||||
iPtr->ensembleRewrite.sourceObjs = (Tcl_Obj *const *) tmp;
|
||||
@@ -2391,7 +2392,7 @@ MakeCachedEnsembleCommand(
|
||||
*/
|
||||
|
||||
TclFreeIntRep(objPtr);
|
||||
ensembleCmd = ckalloc(sizeof(EnsembleCmdRep));
|
||||
ensembleCmd = Tcl_Alloc(sizeof(EnsembleCmdRep));
|
||||
objPtr->internalRep.twoPtrValue.ptr1 = ensembleCmd;
|
||||
objPtr->typePtr = &ensembleCmdType;
|
||||
}
|
||||
@@ -2445,7 +2446,7 @@ ClearTable(
|
||||
Tcl_DecrRefCount(prefixObj);
|
||||
hPtr = Tcl_NextHashEntry(&search);
|
||||
}
|
||||
ckfree((char *) ensemblePtr->subcommandArrayPtr);
|
||||
Tcl_Free(ensemblePtr->subcommandArrayPtr);
|
||||
}
|
||||
Tcl_DeleteHashTable(hash);
|
||||
}
|
||||
@@ -2542,7 +2543,8 @@ BuildEnsembleConfig(
|
||||
Tcl_HashSearch search; /* Used for scanning the set of commands in
|
||||
* the namespace that backs up this
|
||||
* ensemble. */
|
||||
int i, j, isNew;
|
||||
size_t i, j;
|
||||
int isNew;
|
||||
Tcl_HashTable *hash = &ensemblePtr->subcommandTable;
|
||||
Tcl_HashEntry *hPtr;
|
||||
Tcl_Obj *mapDict = ensemblePtr->subcommandDict;
|
||||
@@ -2568,7 +2570,7 @@ BuildEnsembleConfig(
|
||||
* as the dict mapping to targets.
|
||||
*/
|
||||
|
||||
for (i = 0; i < subc; i += 2) {
|
||||
for (i = 0; i < (size_t)subc; i += 2) {
|
||||
name = TclGetString(subv[i]);
|
||||
hPtr = Tcl_CreateHashEntry(hash, name, &isNew);
|
||||
if (!isNew) {
|
||||
@@ -2592,7 +2594,7 @@ BuildEnsembleConfig(
|
||||
* Usual case where we can freely act on the list and dict.
|
||||
*/
|
||||
|
||||
for (i = 0; i < subc; i++) {
|
||||
for (i = 0; i < (size_t)subc; i++) {
|
||||
name = TclGetString(subv[i]);
|
||||
hPtr = Tcl_CreateHashEntry(hash, name, &isNew);
|
||||
if (!isNew) {
|
||||
@@ -2710,7 +2712,7 @@ BuildEnsembleConfig(
|
||||
*/
|
||||
|
||||
ensemblePtr->subcommandArrayPtr =
|
||||
ckalloc(sizeof(char *) * hash->numEntries);
|
||||
Tcl_Alloc(sizeof(char *) * hash->numEntries);
|
||||
|
||||
/*
|
||||
* Fill array from both ends as this makes us less likely to end up with
|
||||
@@ -2743,7 +2745,7 @@ BuildEnsembleConfig(
|
||||
hPtr = Tcl_NextHashEntry(&search);
|
||||
}
|
||||
if (hash->numEntries > 1) {
|
||||
qsort(ensemblePtr->subcommandArrayPtr, (unsigned) hash->numEntries,
|
||||
qsort(ensemblePtr->subcommandArrayPtr, hash->numEntries,
|
||||
sizeof(char *), NsEnsembleStringOrder);
|
||||
}
|
||||
}
|
||||
@@ -2803,7 +2805,7 @@ FreeEnsembleCmdRep(
|
||||
if (ensembleCmd->fix) {
|
||||
Tcl_DecrRefCount(ensembleCmd->fix);
|
||||
}
|
||||
ckfree(ensembleCmd);
|
||||
Tcl_Free(ensembleCmd);
|
||||
objPtr->typePtr = NULL;
|
||||
}
|
||||
|
||||
@@ -2831,7 +2833,7 @@ DupEnsembleCmdRep(
|
||||
Tcl_Obj *copyPtr)
|
||||
{
|
||||
EnsembleCmdRep *ensembleCmd = objPtr->internalRep.twoPtrValue.ptr1;
|
||||
EnsembleCmdRep *ensembleCopy = ckalloc(sizeof(EnsembleCmdRep));
|
||||
EnsembleCmdRep *ensembleCopy = Tcl_Alloc(sizeof(EnsembleCmdRep));
|
||||
|
||||
copyPtr->typePtr = &ensembleCmdType;
|
||||
copyPtr->internalRep.twoPtrValue.ptr1 = ensembleCopy;
|
||||
@@ -3149,7 +3151,7 @@ TclCompileEnsemble(
|
||||
|
||||
while (mapPtr->nuloc - 1 > eclIndex) {
|
||||
mapPtr->nuloc--;
|
||||
ckfree(mapPtr->loc[mapPtr->nuloc].line);
|
||||
Tcl_Free(mapPtr->loc[mapPtr->nuloc].line);
|
||||
mapPtr->loc[mapPtr->nuloc].line = NULL;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user