Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9708a0e08 | ||
|
|
ccb5ae0529 | ||
|
|
5ae2506499 | ||
|
|
f833c48881 | ||
|
|
12d41d9775 | ||
|
|
a8896d0fd0 | ||
|
|
b184464e94 | ||
|
|
dd5c058db2 | ||
|
|
9cfb05d5b2 | ||
|
|
0343f605e6 | ||
|
|
c74a310d21 | ||
|
|
500e1529f1 | ||
|
|
c08af43916 | ||
|
|
106d95266d | ||
|
|
31489aa2fa | ||
|
|
72bac6d72c | ||
|
|
ef9867bd58 | ||
|
|
c541afcd1a | ||
|
|
94f27cdf49 | ||
|
|
3405e90b04 | ||
|
|
a344103b2d | ||
|
|
7da0627e83 | ||
|
|
7972edd0e2 | ||
|
|
c0b6a93d8f | ||
|
|
59dd8794c5 | ||
|
|
19d02aa031 | ||
|
|
f748e43a22 | ||
|
|
b3790dd8a3 | ||
|
|
39c9836950 | ||
|
|
d9174b0f8d | ||
|
|
a76f86e565 | ||
|
|
4656afb575 | ||
|
|
51448d4167 | ||
|
|
ce85e0375a | ||
|
|
79d18dcb7e | ||
|
|
e50b4e4c59 | ||
|
|
a11e803c73 | ||
|
|
7593fce230 | ||
|
|
6cda753ae0 | ||
|
|
c5a0eca4bc | ||
|
|
ef08150c11 | ||
|
|
1d1c1fb982 | ||
|
|
6d00490627 | ||
|
|
20af6b5bdd | ||
|
|
5bcff4802f | ||
|
|
e245507505 | ||
|
|
ca67362ec8 | ||
|
|
e960c97fad | ||
|
|
09b7fc60ad | ||
|
|
e7e044e968 | ||
|
|
5ba73ded05 | ||
|
|
c4ac9665cb | ||
|
|
a64794ef40 | ||
|
|
f685c98a41 | ||
|
|
0f77e154ab | ||
|
|
2901b939cc | ||
|
|
138fdcf62c | ||
|
|
0bb9723a64 | ||
|
|
bef79e3c75 | ||
|
|
1ce12936bb | ||
|
|
cbd41f6910 | ||
|
|
4addfd1f1e | ||
|
|
ce39701283 | ||
|
|
45952551e2 | ||
|
|
58462852c6 | ||
|
|
01b1e3aadf | ||
|
|
8edc9b3888 | ||
|
|
24b2e0513d | ||
|
|
6552a88de1 | ||
|
|
688a002466 | ||
|
|
a1b8aa387d | ||
|
|
b758c501cf | ||
|
|
7a961752a9 | ||
|
|
5bef9acff1 | ||
|
|
d6c7097242 | ||
|
|
f284e2a2d8 | ||
|
|
bc48d7a26e | ||
|
|
d4c0a2c2ae | ||
|
|
8c301f2c53 | ||
|
|
75ba8ac33b | ||
|
|
6b05e4086f | ||
|
|
622fa7382f | ||
|
|
0d0cf6602a | ||
|
|
763c581edb | ||
|
|
b2c3781bb0 | ||
|
|
f2b3bc2aa5 | ||
|
|
23900950d5 | ||
|
|
d2a2b049b7 | ||
|
|
3f7f7c5584 | ||
|
|
131bf290a5 | ||
|
|
a2b119cac8 | ||
|
|
6def8b0f58 | ||
|
|
8958065cc3 | ||
|
|
ae9355b9f2 | ||
|
|
bff6ed619c | ||
|
|
1f8db5d00d | ||
|
|
22febb8eb7 | ||
|
|
56de8426b7 | ||
|
|
bd8e0ee8b7 | ||
|
|
e502bcacc7 | ||
|
|
8317204bd3 | ||
|
|
a79de57d37 | ||
|
|
afd31e9f77 | ||
|
|
5e4013330a | ||
|
|
891c0fbcaa | ||
|
|
9f59ec07c0 | ||
|
|
2799ad9f6c | ||
|
|
6b3bcba42d | ||
|
|
12f23af545 | ||
|
|
4b6d8abfe4 | ||
|
|
7d93750b87 | ||
|
|
2f60311d12 | ||
|
|
ded4be46c9 | ||
|
|
a9fba66be5 | ||
|
|
15f8c1d28b | ||
|
|
948f556e52 | ||
|
|
837ca69779 | ||
|
|
d80b660921 | ||
|
|
9dd5a63f35 | ||
|
|
5d7d542b25 | ||
|
|
65254e27f9 | ||
|
|
78476931a0 | ||
|
|
36fcd880b6 | ||
|
|
a019958ca7 | ||
|
|
3cb6c489a3 | ||
|
|
4b1d6e9ae2 | ||
|
|
00199ad335 | ||
|
|
1310a7e2b4 | ||
|
|
dfa6b32e11 | ||
|
|
7a0c0b2034 | ||
|
|
ca8b1a6887 | ||
|
|
f852823f2d | ||
|
|
c5b5c4f8a4 | ||
|
|
3f371a5084 | ||
|
|
2d5ed059a0 | ||
|
|
d278fba314 | ||
|
|
fbbee7fe2a | ||
|
|
55cc9137eb | ||
|
|
5d3af5f627 | ||
|
|
f9753a5e41 | ||
|
|
b01f9536cb | ||
|
|
9e7c607db1 | ||
|
|
d03849d2cd | ||
|
|
b2befe7629 | ||
|
|
dcb351dbe0 | ||
|
|
a5a978ca98 | ||
|
|
bec9630530 | ||
|
|
eea655f851 | ||
|
|
3d27e0eb5c | ||
|
|
414f4c9f7c | ||
|
|
f67437d6f3 | ||
|
|
5e19480500 | ||
|
|
447a4d740e | ||
|
|
cef8229a3a | ||
|
|
e91c9f74d8 | ||
|
|
03a9eede3b | ||
|
|
6cd7c9e3c2 | ||
|
|
42bd6877bc | ||
|
|
487067a6d1 | ||
|
|
9548cf370e | ||
|
|
e5a0178736 | ||
|
|
93e50d1448 | ||
|
|
69ac37dbae | ||
|
|
27e907b473 | ||
|
|
c31e41a91d | ||
|
|
300b6e7e76 | ||
|
|
0a9f0f3598 | ||
|
|
5a103eaacb | ||
|
|
8b5a187d44 | ||
|
|
7694cd7bef | ||
|
|
e6a7cce3f1 | ||
|
|
7d3fcc3fb5 | ||
|
|
9634f3a9ed | ||
|
|
28121876fd | ||
|
|
3dab933938 | ||
|
|
40d1955bc6 | ||
|
|
f68a36c8be | ||
|
|
a0ee4e463e | ||
|
|
1080644af8 | ||
|
|
f7d30cbf99 | ||
|
|
b9209ab689 | ||
|
|
04723a6f3e | ||
|
|
d8213dd66a | ||
|
|
107106ad02 | ||
|
|
3e959978b2 | ||
|
|
53a604750d | ||
|
|
c2e46517d8 | ||
|
|
0b7d58de0e | ||
|
|
196a720845 | ||
|
|
34de786a93 | ||
|
|
74cf960de8 | ||
|
|
3636d805fc | ||
|
|
1a5bf4932e | ||
|
|
80965aae21 | ||
|
|
d347d3e4ff | ||
|
|
1900149ee6 | ||
|
|
622d68eaef | ||
|
|
eb48fd5bf7 | ||
|
|
6dc3f732c1 | ||
|
|
0adb13141f | ||
|
|
9ca4f08e3a | ||
|
|
0e8c4944f3 | ||
|
|
51748fd064 | ||
|
|
93fa9836fd | ||
|
|
71a981267a | ||
|
|
d72c457096 | ||
|
|
ca650aeafc | ||
|
|
dda585be8b | ||
|
|
1421703af9 | ||
|
|
24aa257810 | ||
|
|
33195f9318 | ||
|
|
21178dbbd4 | ||
|
|
2a68bfa441 | ||
|
|
d15e74d08c | ||
|
|
a59905b256 | ||
|
|
867a57806b | ||
|
|
6a34b586f6 | ||
|
|
bfb9fc538c | ||
|
|
b246adbfbd | ||
|
|
0fb01a32c6 | ||
|
|
e0716f3a83 | ||
|
|
606baf39a5 | ||
|
|
e473aab63f | ||
|
|
a68d5e71e2 | ||
|
|
d00000e816 | ||
|
|
85c05d7a3d | ||
|
|
ed4c583b06 | ||
|
|
6a3c75c37f | ||
|
|
9a87f872f4 | ||
|
|
74275b1fb2 | ||
|
|
e716de755c | ||
|
|
49c9b2444c | ||
|
|
092e5f9f72 | ||
|
|
ac4769c769 | ||
|
|
14a73a2125 | ||
|
|
c92ec0f79d | ||
|
|
01f391fe61 | ||
|
|
14a90662d8 | ||
|
|
7ceee1b319 | ||
|
|
0f9d17b141 | ||
|
|
fc463ed38b | ||
|
|
716fc0545e | ||
|
|
5d066cf169 | ||
|
|
9d536c3831 | ||
|
|
1f3227e47d | ||
|
|
20ba5858ce | ||
|
|
b237b6f208 | ||
|
|
6944eab64c | ||
|
|
8b385f576d | ||
|
|
177828f77f | ||
|
|
0ef6cc44a3 | ||
|
|
14f546efca | ||
|
|
2e6ebdc591 | ||
|
|
58467a7afe | ||
|
|
0e29fdc280 | ||
|
|
260c5156ed | ||
|
|
aec87aa3e1 | ||
|
|
289ab3d633 | ||
|
|
4076c637ad | ||
|
|
7b46c41c05 | ||
|
|
5dcbe3cfeb | ||
|
|
a312d4a759 | ||
|
|
3befacd1fa | ||
|
|
0c5c7cc5eb | ||
|
|
ce9541840d | ||
|
|
3baa5a5c2b | ||
|
|
d171543388 | ||
|
|
b5fa09c673 | ||
|
|
bf9bd6f5fe | ||
|
|
75c6fd3ecb | ||
|
|
284f73c56c | ||
|
|
95b9c7ea08 | ||
|
|
7b28b96939 | ||
|
|
4968ffa1ce | ||
|
|
9e810a5045 | ||
|
|
aca6eed0f3 | ||
|
|
105dbed51f | ||
|
|
0371b9ed8d | ||
|
|
ddde6c7c50 | ||
|
|
7a073b3366 | ||
|
|
184e43e860 | ||
|
|
4469be4f10 | ||
|
|
3663035507 | ||
|
|
fbc66143c5 | ||
|
|
440683ce1e | ||
|
|
126f9f6dda | ||
|
|
a267b4feeb | ||
|
|
c6289e39ad | ||
|
|
fd14473a4c | ||
|
|
2e97ff6575 | ||
|
|
55d9cca97f | ||
|
|
7506b1b86f | ||
|
|
0b00b0f11d | ||
|
|
28ea8b92a6 | ||
|
|
393743bb70 | ||
|
|
83b951fbc6 | ||
|
|
a194e805e6 | ||
|
|
bd7acf159e | ||
|
|
872d25e128 | ||
|
|
f18eb707ea | ||
|
|
436a48c900 | ||
|
|
c2626689e1 | ||
|
|
62043b6882 | ||
|
|
d6a5f77a66 | ||
|
|
c36fa478b2 | ||
|
|
f5846ef8f5 | ||
|
|
74efc29448 | ||
|
|
a6b22dc4b3 | ||
|
|
9fd4244e4f | ||
|
|
fcfbc3a606 | ||
|
|
8f0f3b1165 | ||
|
|
6b095954a1 | ||
|
|
e681ade127 | ||
|
|
32439d945e | ||
|
|
b34f06a4af | ||
|
|
14086d3b4a | ||
|
|
330bdbdece | ||
|
|
370f7dfa40 | ||
|
|
1c7b977c44 | ||
|
|
1b1f3ea6b7 | ||
|
|
77334ba0ad | ||
|
|
458c4d727e | ||
|
|
f3e9e16aa8 | ||
|
|
e777b5ba8f | ||
|
|
6cd305a239 | ||
|
|
ff752c7b91 | ||
|
|
4f0a7b4379 | ||
|
|
a890c6f587 | ||
|
|
2d2a526d32 | ||
|
|
d288bedb47 | ||
|
|
e121721b0d | ||
|
|
b07f60b43b | ||
|
|
36d126e09d | ||
|
|
8ad68e4ae6 | ||
|
|
0a58662e2a | ||
|
|
6ed82bc4e5 | ||
|
|
c6e1d19c9e | ||
|
|
fc474844a7 | ||
|
|
e1b9a033d7 | ||
|
|
a81159df88 | ||
|
|
d6b88eb797 | ||
|
|
673f931995 | ||
|
|
34d4a98d7c | ||
|
|
d28f51fb1e | ||
|
|
1a8f9e37f4 | ||
|
|
05c97af259 | ||
|
|
85287d9e67 | ||
|
|
4cbc02c80f | ||
|
|
e6cdfb9835 | ||
|
|
bf28325f97 | ||
|
|
0e0e0f9ad3 | ||
|
|
04fca9a30c | ||
|
|
8c2e8d8313 | ||
|
|
3be920cf8f | ||
|
|
c0ad0edfe0 | ||
|
|
3239564179 | ||
|
|
ceb4d1ae2e | ||
|
|
d2ed22d022 | ||
|
|
607e3a5ba3 | ||
|
|
0eddd55ab6 | ||
|
|
5c0c8a2c84 | ||
|
|
d12caa5cd9 | ||
|
|
558466820c | ||
|
|
c603f00cf1 | ||
|
|
37386d726b | ||
|
|
a03f6be693 | ||
|
|
9fd874b4fa | ||
|
|
cdecc6d509 | ||
|
|
4c66b6ec43 | ||
|
|
67be0a6752 | ||
|
|
d041253d88 | ||
|
|
ad1c9644ec | ||
|
|
79d5320ceb | ||
|
|
5b6aa149be | ||
|
|
e2d3a22117 | ||
|
|
f0db029a8a | ||
|
|
e388abbb03 | ||
|
|
a10ceedaec | ||
|
|
c7522c3f93 | ||
|
|
57807a30bb | ||
|
|
15640f9240 | ||
|
|
b9413619f6 | ||
|
|
6a866ef98b | ||
|
|
cd5e1b2e6c | ||
|
|
191d1f5847 | ||
|
|
46cf6812fc | ||
|
|
007dfc95a9 | ||
|
|
c453ac8b82 | ||
|
|
792b2f5aff | ||
|
|
cd3fd901aa | ||
|
|
16510ceb16 | ||
|
|
585d7c7548 | ||
|
|
ead37ca168 | ||
|
|
9cc16840e8 | ||
|
|
70d6ba8746 | ||
|
|
5573c07b32 | ||
|
|
e03ac7f9c6 | ||
|
|
41516d6ea0 | ||
|
|
d55b84c0f9 | ||
|
|
5da91af337 | ||
|
|
20bb6aaf3f | ||
|
|
32835dc33e | ||
|
|
e1d37a6c49 | ||
|
|
2da690df06 | ||
|
|
7fda2c560a | ||
|
|
5f0c436646 | ||
|
|
bca70ca3ac | ||
|
|
7e2bd5e505 | ||
|
|
7443a97bd1 | ||
|
|
19f8c3bb6b | ||
|
|
d9b5be0959 | ||
|
|
abf853d0bb | ||
|
|
5a0a3c6422 | ||
|
|
dc58da9c45 | ||
|
|
6cf74d1492 | ||
|
|
b437bfcd3a | ||
|
|
21d39f41b1 | ||
|
|
4f32050725 | ||
|
|
614375d561 | ||
|
|
33fa3f7f1f | ||
|
|
1e381fd90d | ||
|
|
d06b33cd94 | ||
|
|
74f8d5493b | ||
|
|
b3500c7657 | ||
|
|
3ed0b91895 | ||
|
|
1aa64a54f7 | ||
|
|
f4cb160b56 | ||
|
|
e2d1dc1485 | ||
|
|
603b76f910 | ||
|
|
1bca425d6d | ||
|
|
e2dae42575 | ||
|
|
dc471da433 | ||
|
|
8c034cf9ce | ||
|
|
20e8a0591a | ||
|
|
cf371f4ceb | ||
|
|
858a9e5502 | ||
|
|
254c149a17 | ||
|
|
18da054782 | ||
|
|
f0a6c93a0e | ||
|
|
5e5b9a0994 | ||
|
|
4d9dc8039f | ||
|
|
5efd0904e3 | ||
|
|
8e84ff6bb0 | ||
|
|
17775db55f | ||
|
|
2f0f646a07 | ||
|
|
143111498e | ||
|
|
addfa7b662 | ||
|
|
ec609cef01 | ||
|
|
688186d726 | ||
|
|
85da0b0875 | ||
|
|
8b4623feb4 | ||
|
|
66ebfaa06d | ||
|
|
10cc2ae8fd | ||
|
|
42dd6088a6 | ||
|
|
2d455c75b9 | ||
|
|
abe4d4223d | ||
|
|
176e98222e | ||
|
|
8d919c0d03 | ||
|
|
29dd909281 | ||
|
|
2dd98970cf | ||
|
|
fc14df8b55 | ||
|
|
529ef6feb2 | ||
|
|
9934337df5 | ||
|
|
47c1e7680e | ||
|
|
bc198d0133 | ||
|
|
7fd9e2f5fd | ||
|
|
6203b90b2a | ||
|
|
192a96c334 | ||
|
|
267ce5dd65 | ||
|
|
c42f34e333 | ||
|
|
e0b98db0d7 | ||
|
|
916d72ec1c | ||
|
|
24b5ca41d9 | ||
|
|
daf1875e01 | ||
|
|
839d38fbba | ||
|
|
b00b14a7fd | ||
|
|
da40e7deb9 | ||
|
|
de7a5967d0 | ||
|
|
e52c7c3a41 | ||
|
|
ff9ac0bfbd | ||
|
|
9a1e8d3202 | ||
|
|
dc113d8f28 | ||
|
|
9a179b6418 | ||
|
|
2439b064ea | ||
|
|
cb579a693a | ||
|
|
83338ca1ed | ||
|
|
b4eda6649f | ||
|
|
c0481e8305 | ||
|
|
328212a8ec | ||
|
|
c35f73ae26 | ||
|
|
6b01089ea3 | ||
|
|
90b60f2084 | ||
|
|
6fa6c0b201 | ||
|
|
228c1134e2 | ||
|
|
eb3d10d523 | ||
|
|
7754129cab | ||
|
|
515f8ab044 | ||
|
|
d2518017c7 | ||
|
|
4e9c7a9ae0 | ||
|
|
e4e7ee53a4 | ||
|
|
12afabecd7 | ||
|
|
13384df4af | ||
|
|
2da979cd8e | ||
|
|
13c23e7627 | ||
|
|
8f94fc24ac | ||
|
|
b2135d370a | ||
|
|
af346e6e70 | ||
|
|
f5ba1ba55f | ||
|
|
25b5f03d7a | ||
|
|
9e77fc653d | ||
|
|
62933f5324 | ||
|
|
ea4d395360 | ||
|
|
f0c979fba7 | ||
|
|
33683032c2 | ||
|
|
12039fa008 | ||
|
|
c0b4b17c11 | ||
|
|
eb4b6b9d49 | ||
|
|
4b57621b7a | ||
|
|
b2ce09bd9e | ||
|
|
91d2dee101 | ||
|
|
1fd08ea7d0 | ||
|
|
aa5c8dabee | ||
|
|
ccd2ac73e9 | ||
|
|
6d64f87088 | ||
|
|
2da45449d7 | ||
|
|
7f01d26c89 | ||
|
|
387ec0ad0a | ||
|
|
db9786102c | ||
|
|
25c9cb2e55 | ||
|
|
2310d12319 | ||
|
|
5131efcb13 | ||
|
|
34288c7bfb | ||
|
|
d4470195f5 | ||
|
|
bd7c6ae5d3 | ||
|
|
be522119ab | ||
|
|
c2350850a9 | ||
|
|
59814de67b | ||
|
|
a034ecec4f | ||
|
|
f4e50b43c7 | ||
|
|
269b0fd3c4 | ||
|
|
91c060ce82 | ||
|
|
41c87a4bf5 | ||
|
|
a41449f1cd | ||
|
|
393e14cb3d | ||
|
|
7c405a789e | ||
|
|
cd56027275 | ||
|
|
4e2efebfb6 | ||
|
|
86691e22e4 | ||
|
|
790c4449ac | ||
|
|
1cf5b65db2 | ||
|
|
20aa103e7b | ||
|
|
2f414ecd74 | ||
|
|
8d65c702fa | ||
|
|
f484f2ebf5 | ||
|
|
8320295018 | ||
|
|
595c3bb71f | ||
|
|
640839dd01 | ||
|
|
132576b7dd | ||
|
|
31f8d4fe43 | ||
|
|
c297ad4104 | ||
|
|
424c53931b | ||
|
|
a3ea58d94b | ||
|
|
a60733d7ea | ||
|
|
3674905dbd | ||
|
|
9336a020ee | ||
|
|
6b55b10a00 | ||
|
|
1d4256a37e | ||
|
|
b0874b989e | ||
|
|
9d171e0b8b | ||
|
|
aa59356ae9 | ||
|
|
066a66253f | ||
|
|
898e72c904 | ||
|
|
0e71e665cb | ||
|
|
9e72f54150 | ||
|
|
64a63fa7c5 | ||
|
|
5ef498d3ec | ||
|
|
b78fe450ce | ||
|
|
ebf3d00e75 | ||
|
|
2a491f190d | ||
|
|
2ae930bbe4 | ||
|
|
6d4603bb45 | ||
|
|
2384f8aa81 | ||
|
|
bf70c2d93b | ||
|
|
d51b6f7045 | ||
|
|
1d76a99d63 | ||
|
|
fabaafee56 | ||
|
|
57b2b2606f | ||
|
|
9fccffbdfa | ||
|
|
3df7fe883e | ||
|
|
1ff4bd27f4 | ||
|
|
2f8db2f926 | ||
|
|
7974d5f010 | ||
|
|
9b6113c6b1 | ||
|
|
14d065088b | ||
|
|
946598bb9f | ||
|
|
8a3c1f7a68 | ||
|
|
b456ce6d74 | ||
|
|
5aa22835cf | ||
|
|
294105b452 | ||
|
|
e16ffc4a1e | ||
|
|
5db5b84aef | ||
|
|
5ad300bf4a | ||
|
|
6ebde0d075 | ||
|
|
5c49161ab0 | ||
|
|
4a20ed377e | ||
|
|
232f84b9dc | ||
|
|
c355f9a6cf | ||
|
|
a6fb6b32ca | ||
|
|
b988139b8a | ||
|
|
11766bbb13 | ||
|
|
c053495b3e | ||
|
|
355be4d5f2 | ||
|
|
78d1e3a624 | ||
|
|
0bdd633abc | ||
|
|
d36655ac53 | ||
|
|
ca4bfa2564 | ||
|
|
6487dd7257 | ||
|
|
01abe6a8b4 | ||
|
|
5f8f24a948 | ||
|
|
5ea6733979 | ||
|
|
bb0f1f8083 | ||
|
|
178df447b7 | ||
|
|
daf02b80dd | ||
|
|
35c8341ccb | ||
|
|
0cbabbe0d8 | ||
|
|
26e99bad85 | ||
|
|
105bdf44be | ||
|
|
c43ea691ad | ||
|
|
573a1e9219 | ||
|
|
7a44e1418d | ||
|
|
27975e7b9b | ||
|
|
ccabfb8506 | ||
|
|
a9fa4bed1f | ||
|
|
8f87675b83 | ||
|
|
d3517188b2 | ||
|
|
e3b234e709 | ||
|
|
474c08922f | ||
|
|
d7db2aab5a | ||
|
|
a8ddc9d2a2 | ||
|
|
de7e7bc0ba | ||
|
|
ba767ab772 | ||
|
|
a24682c16d | ||
|
|
998ceebf50 | ||
|
|
9e4e020313 | ||
|
|
420a7fc15d | ||
|
|
94394a076d | ||
|
|
bde9c622c0 | ||
|
|
887f84bb45 | ||
|
|
21b4101075 | ||
|
|
6187c67f3b | ||
|
|
55031f3989 | ||
|
|
778ad9fdfa | ||
|
|
9aebf1d8a6 | ||
|
|
98974ab123 | ||
|
|
e396c1dd36 | ||
|
|
82fccbc6dc | ||
|
|
b5d8216129 | ||
|
|
3c3ebea410 | ||
|
|
a383c56d6c | ||
|
|
54c3c4bc9b | ||
|
|
062bd7ee8f | ||
|
|
cacfaf16ec | ||
|
|
830603d46e | ||
|
|
7d89acd1b2 | ||
|
|
7b9852676d | ||
|
|
016ec0a646 | ||
|
|
4c6744bbc9 | ||
|
|
d307130311 | ||
|
|
59f20f23bd | ||
|
|
a83edfe07c | ||
|
|
8e201fe70a | ||
|
|
501eda93e6 | ||
|
|
d3abc6b0f4 | ||
|
|
d3662a9dca | ||
|
|
a77fa7db73 | ||
|
|
c0d3b18e36 | ||
|
|
77a24f6300 | ||
|
|
af645c77b7 | ||
|
|
43ea8e68e8 | ||
|
|
3073ed65fb | ||
|
|
f235d36b43 | ||
|
|
ad9c975e41 | ||
|
|
757c909881 | ||
|
|
42cd1c73d2 | ||
|
|
706ec57375 | ||
|
|
b668019660 | ||
|
|
aabe2cbb33 | ||
|
|
1391eda7db | ||
|
|
776820c81f | ||
|
|
cb0acd5a7d | ||
|
|
82a85e5b1e | ||
|
|
080dedf1a3 | ||
|
|
2a97dea66c | ||
|
|
9b8a5d56d2 | ||
|
|
bcedb2cdf6 | ||
|
|
4717ea14fd | ||
|
|
05de893f6f | ||
|
|
9ad31cfcf3 | ||
|
|
d78db33c23 | ||
|
|
c9e33a6348 | ||
|
|
60308ec482 | ||
|
|
e0f543167d | ||
|
|
e9f9cac4be | ||
|
|
e9e4041670 | ||
|
|
3185a0b150 | ||
|
|
a2a0ca2a17 | ||
|
|
b19862400b | ||
|
|
a5055aa3db | ||
|
|
2ceb66085c | ||
|
|
e59865fa40 | ||
|
|
02131d1f1b | ||
|
|
08666ed474 | ||
|
|
b488f3edf6 | ||
|
|
1b24926d6b | ||
|
|
e3074edc8a | ||
|
|
1a08f93391 | ||
|
|
a824edfe93 | ||
|
|
0fd2a17f4f | ||
|
|
230aa0cc4b | ||
|
|
bba42d0251 | ||
|
|
17058912aa | ||
|
|
c890584ff7 | ||
|
|
6bad0fe2c0 | ||
|
|
06feee5328 | ||
|
|
0d094ff62a | ||
|
|
f2815760c5 | ||
|
|
fb22b96143 | ||
|
|
1b7f4189f0 | ||
|
|
b64759fbc4 | ||
|
|
50e33715ba | ||
|
|
976ba568c7 | ||
|
|
4d813970d4 | ||
|
|
79e2759633 | ||
|
|
a18c844695 | ||
|
|
e0834d672a | ||
|
|
ada13727e6 | ||
|
|
142088c232 | ||
|
|
356b2f5829 | ||
|
|
b7691676aa | ||
|
|
9e0d60b4a2 | ||
|
|
0839b91fcf | ||
|
|
969bd53c8a | ||
|
|
52aab51e7f | ||
|
|
3398002e97 | ||
|
|
4e13b91290 | ||
|
|
ba68516ddb | ||
|
|
574e588e3f | ||
|
|
ab138d729b | ||
|
|
eeb4747a4d | ||
|
|
b1d03f8f36 | ||
|
|
0f4f22fb0d | ||
|
|
586ba27475 | ||
|
|
4d4cf2d35a | ||
|
|
a6ad8c5f1b | ||
|
|
4ca3e59e50 | ||
|
|
541671a2f1 | ||
|
|
a52e71f534 | ||
|
|
2ccefe1d82 | ||
|
|
05389ab996 | ||
|
|
e2c60c3b2f | ||
|
|
35e1e904e5 | ||
|
|
40970bda37 | ||
|
|
cbed1606a6 | ||
|
|
3173a6ebc5 | ||
|
|
1b03667a27 | ||
|
|
5c24bebd2b | ||
|
|
e51e79f343 | ||
|
|
03fd40904f | ||
|
|
13bcd282e3 | ||
|
|
26e714137a | ||
|
|
a457b16dfc | ||
|
|
9372c6c29f | ||
|
|
7ad70bd837 | ||
|
|
f942af920c | ||
|
|
b1098ebef4 | ||
|
|
4f523fda09 | ||
|
|
516f8e365d |
@@ -10,7 +10,6 @@ compat/zlib/zlib.map
|
||||
libtommath/*.dsp
|
||||
libtommath/*.sln
|
||||
libtommath/*.vcproj
|
||||
tools/tcl.hpj.in
|
||||
tools/tcl.wse.in
|
||||
win/buildall.vc.bat
|
||||
win/coffbase.txt
|
||||
@@ -20,4 +19,3 @@ win/rules-ext.vc
|
||||
win/targets.vc
|
||||
win/tcl.dsp
|
||||
win/tcl.dsw
|
||||
win/tcl.hpj.in
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
tools/tcl.hpj.in
|
||||
tools/tcl.wse.in
|
||||
win/buildall.vc.bat
|
||||
win/coffbase.txt
|
||||
win/makefile.vc
|
||||
win/rules.vc
|
||||
win/tcl.dsp
|
||||
win/tcl.dsw
|
||||
win/tcl.hpj.in
|
||||
win/tcl.dsw
|
||||
@@ -0,0 +1,6 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
@@ -9,12 +9,12 @@ jobs:
|
||||
matrix:
|
||||
cfgopt:
|
||||
- ""
|
||||
- "CFLAGS=-DTCL_UTF_MAX=3"
|
||||
- "CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
- "--disable-shared"
|
||||
- "--enable-symbols"
|
||||
- "--enable-symbols=mem"
|
||||
- "--enable-symbols=all"
|
||||
- "CFLAGS=-DTCL_UTF_MAX=4"
|
||||
- "CFLAGS=-DTCL_UTF_MAX=6"
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare
|
||||
run: |
|
||||
touch tclStubInit.c tclOOStubInit.c
|
||||
touch tclStubInit.c tclOOStubInit.c tclOOScript.h
|
||||
working-directory: generic
|
||||
- name: Configure ${{ matrix.cfgopt }}
|
||||
run: |
|
||||
|
||||
@@ -14,10 +14,12 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare
|
||||
run: |
|
||||
touch tclStubInit.c tclOOStubInit.c
|
||||
touch tclStubInit.c tclOOStubInit.c tclOOScript.h
|
||||
working-directory: generic
|
||||
- name: Build
|
||||
run: make all
|
||||
env:
|
||||
CFLAGS: -arch x86_64 -arch arm64e
|
||||
- name: Run Tests
|
||||
run: make test styles=develop
|
||||
env:
|
||||
@@ -42,17 +44,20 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare
|
||||
run: |
|
||||
touch tclStubInit.c tclOOStubInit.c
|
||||
touch tclStubInit.c tclOOStubInit.c tclOOScript.h
|
||||
mkdir "$HOME/install dir"
|
||||
working-directory: generic
|
||||
- name: Configure ${{ matrix.cfgopt }}
|
||||
# Note that macOS is always a 64 bit platform
|
||||
run: ./configure --enable-64bit --enable-dtrace --enable-framework ${CFGOPT} "--prefix=$HOME/install" || (cat config.log && exit 1)
|
||||
run: ./configure --enable-dtrace --enable-framework ${CFGOPT} "--prefix=$HOME/install" || (cat config.log && exit 1)
|
||||
env:
|
||||
CFLAGS: -arch x86_64 -arch arm64e
|
||||
CFGOPT: ${{ matrix.cfgopt }}
|
||||
- name: Build
|
||||
run: |
|
||||
make all tcltest
|
||||
env:
|
||||
CFLAGS: -arch x86_64 -arch arm64e
|
||||
- name: Run Tests
|
||||
run: |
|
||||
make test
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
name: Build Binaries
|
||||
on: [push]
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
linux:
|
||||
name: Linux
|
||||
runs-on: ubuntu-20.04
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare
|
||||
run: |
|
||||
touch generic/tclStubInit.c generic/tclOOStubInit.c
|
||||
mkdir 1dist
|
||||
echo "VER_PATH=$(cd tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV
|
||||
working-directory: .
|
||||
- name: Configure
|
||||
run: ./configure --disable-symbols --disable-shared --enable-zipfs
|
||||
working-directory: unix
|
||||
- name: Build
|
||||
run: |
|
||||
make tclsh
|
||||
make shell SCRIPT="$VER_PATH $GITHUB_ENV"
|
||||
echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV
|
||||
working-directory: unix
|
||||
- name: Package
|
||||
run: |
|
||||
cp ../unix/tclsh tclsh${TCL_PATCHLEVEL}_snapshot
|
||||
chmod +x tclsh${TCL_PATCHLEVEL}_snapshot
|
||||
tar -cf tclsh${TCL_PATCHLEVEL}_snapshot.tar tclsh${TCL_PATCHLEVEL}_snapshot
|
||||
working-directory: 1dist
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Tclsh ${{ env.TCL_PATCHLEVEL }} Linux single-file build (snapshot)
|
||||
path: 1dist/*.tar
|
||||
macos:
|
||||
name: macOS
|
||||
runs-on: macos-11
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Checkout create-dmg
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: create-dmg/create-dmg
|
||||
ref: v1.0.8
|
||||
path: create-dmg
|
||||
- name: Prepare
|
||||
run: |
|
||||
mkdir 1dist
|
||||
touch generic/tclStubInit.c generic/tclOOStubInit.c || true
|
||||
wget https://github.com/culler/macher/releases/download/v1.3/macher
|
||||
sudo cp macher /usr/local/bin
|
||||
sudo chmod a+x /usr/local/bin/macher
|
||||
echo "VER_PATH=$(cd tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV
|
||||
echo "CREATE_DMG=$(cd create-dmg;pwd)/create-dmg" >> $GITHUB_ENV
|
||||
echo "CFLAGS=-arch x86_64 -arch arm64e" >> $GITHUB_ENV
|
||||
- name: Configure
|
||||
run: ./configure --disable-symbols --disable-shared --enable-zipfs
|
||||
working-directory: unix
|
||||
- name: Build
|
||||
run: |
|
||||
make tclsh
|
||||
make shell SCRIPT="$VER_PATH $GITHUB_ENV"
|
||||
echo "TCL_BIN=`pwd`/tclsh" >> $GITHUB_ENV
|
||||
echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV
|
||||
working-directory: unix
|
||||
- name: Package
|
||||
run: |
|
||||
mkdir contents
|
||||
cp $TCL_BIN contents/tclsh${TCL_PATCHLEVEL}_snapshot
|
||||
chmod +x contents/tclsh${TCL_PATCHLEVEL}_snapshot
|
||||
cat > contents/README.txt <<EOF
|
||||
This is a single-file executable developer preview of Tcl $TCL_PATCHLEVEL
|
||||
|
||||
It is not intended as an official release at all, so it is unsigned and unnotarized.
|
||||
Use strictly at your own risk.
|
||||
|
||||
To run it, you need to copy the executable out and run:
|
||||
xattr -d com.apple.quarantine tclsh${TCL_PATCHLEVEL}_snapshot
|
||||
to mark the executable as runnable on your machine.
|
||||
EOF
|
||||
$CREATE_DMG \
|
||||
--volname "Tcl $TCL_PATCHLEVEL (snapshot)" \
|
||||
--window-pos 200 120 \
|
||||
--window-size 800 400 \
|
||||
"Tcl-$TCL_PATCHLEVEL-(snapshot).dmg" \
|
||||
"contents/"
|
||||
working-directory: 1dist
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Tclsh ${{ env.TCL_PATCHLEVEL }} macOS single-file build (snapshot)
|
||||
path: 1dist/*.dmg
|
||||
win:
|
||||
name: Windows
|
||||
runs-on: windows-2019
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
env:
|
||||
CC: gcc
|
||||
CFGOPT: --disable-symbols --disable-shared
|
||||
steps:
|
||||
- name: Install MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: UCRT64
|
||||
install: git mingw-w64-ucrt-x86_64-toolchain make zip
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare
|
||||
run: |
|
||||
touch generic/tclStubInit.c generic/tclOOStubInit.c
|
||||
echo "VER_PATH=$(cd tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV
|
||||
mkdir 1dist
|
||||
working-directory: .
|
||||
- name: Configure
|
||||
run: ./configure $CFGOPT
|
||||
working-directory: win
|
||||
- name: Build
|
||||
run: |
|
||||
make binaries libraries
|
||||
echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV
|
||||
working-directory: win
|
||||
- name: Get Exact Version
|
||||
run: |
|
||||
./tclsh*.exe $VER_PATH $GITHUB_ENV
|
||||
working-directory: win
|
||||
- name: Set Executable Name
|
||||
run: |
|
||||
cp ../win/tclsh*.exe tclsh${TCL_PATCHLEVEL}_snapshot.exe
|
||||
working-directory: 1dist
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Tclsh ${{ env.TCL_PATCHLEVEL }} Windows single-file build (snapshot)
|
||||
path: '1dist/*_snapshot.exe'
|
||||
@@ -15,7 +15,9 @@ jobs:
|
||||
matrix:
|
||||
cfgopt:
|
||||
- ""
|
||||
- "OPTS=static,msvcrt"
|
||||
- "OPTS=utf16"
|
||||
- "CHECKS=nodep"
|
||||
- "OPTS=static"
|
||||
- "OPTS=symbols"
|
||||
- "OPTS=symbols STATS=compdbg,memdbg"
|
||||
# Using powershell means we need to explicitly stop on failure
|
||||
@@ -52,6 +54,8 @@ jobs:
|
||||
matrix:
|
||||
cfgopt:
|
||||
- ""
|
||||
- "CFLAGS=-DTCL_UTF_MAX=3"
|
||||
- "CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
- "--disable-shared"
|
||||
- "--enable-symbols"
|
||||
- "--enable-symbols=mem"
|
||||
@@ -67,7 +71,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare
|
||||
run: |
|
||||
touch tclStubInit.c tclOOStubInit.c
|
||||
touch tclStubInit.c tclOOStubInit.c tclOOScript.h
|
||||
mkdir "${HOME}/install dir"
|
||||
working-directory: generic
|
||||
- name: Configure ${{ matrix.cfgopt }}
|
||||
@@ -81,3 +85,6 @@ jobs:
|
||||
run: make tcltest
|
||||
- name: Run Tests
|
||||
run: make test
|
||||
|
||||
# If you add builds with Wine, be sure to define the environment variable
|
||||
# CI_USING_WINE when running them so that broken tests know not to run.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>tcl8.6</name>
|
||||
<name>tcl9</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
|
||||
+66
-32
@@ -20,20 +20,20 @@ jobs:
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC/Shared: UTF_MAX=4"
|
||||
- name: "Linux/GCC/Shared: UTF_MAX=3"
|
||||
os: linux
|
||||
dist: focal
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=4
|
||||
- name: "Linux/GCC/Shared: UTF_MAX=6"
|
||||
- CFGOPT="CFLAGS=-DTCL_UTF_MAX=3"
|
||||
- name: "Linux/GCC/Shared: NO_DEPRECATED"
|
||||
os: linux
|
||||
dist: focal
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT=CFLAGS=-DTCL_UTF_MAX=6
|
||||
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
- name: "Linux/GCC/Static"
|
||||
os: linux
|
||||
dist: focal
|
||||
@@ -105,7 +105,7 @@ jobs:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="--enable-symbols=mem"
|
||||
# Testing on Mac, various styles
|
||||
- name: "macOS/Xcode 12/Shared"
|
||||
- name: "macOS/Clang/Xcode 12/Shared"
|
||||
os: osx
|
||||
osx_image: xcode12.2
|
||||
env:
|
||||
@@ -115,14 +115,25 @@ jobs:
|
||||
- make all
|
||||
# The styles=develop avoids some weird problems on OSX
|
||||
- make test styles=develop
|
||||
- name: "macOS/Xcode 12/Shared/Unix-like"
|
||||
- name: "macOS/Clang/Xcode 12/Shared/Unix-like"
|
||||
os: osx
|
||||
osx_image: xcode12.2
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="--enable-dtrace"
|
||||
- name: "macOS/Clang/Xcode 12/Shared/libtommath"
|
||||
os: osx
|
||||
osx_image: xcode12.2
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- libtommath
|
||||
# Newer MacOS versions
|
||||
- name: "macOS/Xcode 12/Universal Apps/Shared"
|
||||
- name: "macOS/Clang/Xcode 12/Universal Apps/Shared"
|
||||
os: osx
|
||||
osx_image: xcode12u
|
||||
env:
|
||||
@@ -130,28 +141,28 @@ jobs:
|
||||
install: []
|
||||
script: *mactest
|
||||
# Older MacOS versions
|
||||
- name: "macOS/Xcode 11/Shared"
|
||||
- name: "macOS/Clang/Xcode 11/Shared"
|
||||
os: osx
|
||||
osx_image: xcode11.7
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
- name: "macOS/Xcode 10/Shared"
|
||||
- name: "macOS/Clang/Xcode 10/Shared"
|
||||
os: osx
|
||||
osx_image: xcode10.3
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
- name: "macOS/Xcode 9/Shared"
|
||||
- name: "macOS/Clang/Xcode 9/Shared"
|
||||
os: osx
|
||||
osx_image: xcode9.4
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
- name: "macOS/Xcode 8/Shared"
|
||||
- name: "macOS/Clang/Xcode 8/Shared"
|
||||
os: osx
|
||||
osx_image: xcode8.3
|
||||
env:
|
||||
@@ -190,13 +201,22 @@ jobs:
|
||||
- BUILD_DIR=win
|
||||
- VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build"
|
||||
before_install: &vcpreinst
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
|
||||
- PATH="$PATH:$VCDIR"
|
||||
- cd ${BUILD_DIR}
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/Shared: NO_DEPRECATED"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'CHECKS=nodep' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'CHECKS=nodep' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/Static"
|
||||
os: windows
|
||||
compiler: cl
|
||||
@@ -204,17 +224,8 @@ jobs:
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/StaticPackage"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc test
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/Debug"
|
||||
os: windows
|
||||
compiler: cl
|
||||
@@ -243,6 +254,15 @@ jobs:
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake '-f' makefile.vc test
|
||||
- name: "Windows/MSVC-x86/Shared: NO_DEPRECATED"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'CHECKS=nodep' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'CHECKS=nodep' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC-x86/Static"
|
||||
os: windows
|
||||
compiler: cl
|
||||
@@ -250,8 +270,8 @@ jobs:
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc test
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC-x86/Debug"
|
||||
os: windows
|
||||
compiler: cl
|
||||
@@ -278,15 +298,22 @@ jobs:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit"
|
||||
before_install: &makepreinst
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c
|
||||
- choco install -y make
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
|
||||
- choco install -y make zip
|
||||
- cd ${BUILD_DIR}
|
||||
- name: "Windows/GCC/Shared: UTF_MAX=4"
|
||||
- name: "Windows/GCC/Shared: UTF_MAX=3"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit CFLAGS=-DTCL_UTF_MAX=4"
|
||||
- CFGOPT="--enable-64bit CFLAGS=-DTCL_UTF_MAX=3"
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/GCC/Shared: NO_DEPRECATED"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/GCC/Static"
|
||||
os: windows
|
||||
@@ -316,12 +343,19 @@ jobs:
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/GCC-x86/Shared: UTF_MAX=4"
|
||||
- name: "Windows/GCC-x86/Shared: UTF_MAX=3"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="CFLAGS=-DTCL_UTF_MAX=4"
|
||||
- CFGOPT="CFLAGS=-DTCL_UTF_MAX=3"
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/GCC-x86/Shared: NO_DEPRECATED"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="CFLAGS=-DTCL_NO_DEPRECATED=1"
|
||||
before_install: *makepreinst
|
||||
- name: "Windows/GCC-x86/Static"
|
||||
os: windows
|
||||
@@ -354,7 +388,7 @@ jobs:
|
||||
script:
|
||||
- make dist
|
||||
before_install:
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
|
||||
- cd ${BUILD_DIR}
|
||||
install:
|
||||
- mkdir "$HOME/install dir"
|
||||
|
||||
+1
-1
@@ -1426,7 +1426,7 @@
|
||||
initialization assumptions of the TIP 280 code in CompileWord().
|
||||
|
||||
* generic/tclCompExpr.c: Suppress the attempt to convert to
|
||||
numeric when pre-compiling a constant expresion indicates an error.
|
||||
numeric when pre-compiling a constant expression indicates an error.
|
||||
|
||||
2007-08-22 Miguel Sofer <msofer@users.sf.net>
|
||||
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
# README: Tcl
|
||||
|
||||
This is the **Tcl 8.6.12** source distribution.
|
||||
This is the **Tcl 9.0a4** source distribution.
|
||||
|
||||
You can get any source release of Tcl from [our distribution
|
||||
site](https://sourceforge.net/projects/tcl/files/Tcl/).
|
||||
|
||||
8.6 (production release, daily build)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux%22+branch%3Acore-8-6-branch)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows%22+branch%3Acore-8-6-branch)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22macOS%22+branch%3Acore-8-6-branch)
|
||||
<br>
|
||||
8.7 (in development, daily build))
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux%22+branch%3Acore-8-branch)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows%22+branch%3Acore-8-branch)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22macOS%22+branch%3Acore-8-branch)
|
||||
<br>
|
||||
9.0 (in development, daily build))
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux%22+branch%3Amain)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows%22+branch%3Amain)
|
||||
[](https://github.com/tcltk/tcl/actions?query=workflow%3A%22macOS%22+branch%3Amain)
|
||||
|
||||
## Contents
|
||||
1. [Introduction](#intro)
|
||||
@@ -45,7 +56,7 @@ and selling it either in whole or in part. See the file
|
||||
## <a id="doc">2.</a> Documentation
|
||||
Extensive documentation is available on our website.
|
||||
The home page for this release, including new features, is
|
||||
[here](https://www.tcl-lang.org/software/tcltk/8.6.html).
|
||||
[here](https://www.tcl-lang.org/software/tcltk/9.0.html).
|
||||
Detailed release notes can be found at the
|
||||
[file distributions page](https://sourceforge.net/projects/tcl/files/Tcl/)
|
||||
by clicking on the relevant version.
|
||||
@@ -55,8 +66,8 @@ Xchange](https://www.tcl-lang.org/about/).
|
||||
There have been many Tcl books on the market. Many are mentioned in
|
||||
[the Wiki](https://wiki.tcl-lang.org/_/ref?N=25206).
|
||||
|
||||
The complete set of reference manual entries for Tcl 8.6 is [online,
|
||||
here](https://www.tcl-lang.org/man/tcl8.6/).
|
||||
The complete set of reference manual entries for Tcl 9.0 is [online,
|
||||
here](https://www.tcl-lang.org/man/tcl9.0/).
|
||||
|
||||
### <a id="doc.unix">2a.</a> Unix Documentation
|
||||
The `doc` subdirectory in this release contains a complete set of
|
||||
|
||||
@@ -8796,6 +8796,55 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
|
||||
|
||||
--- Released 8.6.7, August 9, 2017 --- https://core.tcl-lang.org/tcl/ for details
|
||||
|
||||
Changes to 8.7a1 include all changes to the 8.6 line through 8.6.7,
|
||||
plus the following, which focuses on the high-level feature changes
|
||||
in this changeset (new minor version) rather than bug fixes:
|
||||
|
||||
2016-03-17 (bug)[0b8c38] socket accept callbacks always in global ns (porter)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2016-07-01 Hack accommodations for legacy Itcl 3 disabled (porter)
|
||||
|
||||
2016-07-12 Make TCL_HASH_TYPE build-time configurable (nijtmans)
|
||||
|
||||
2016-07-19 (bug)[0363f0] Partial array search ID reform (porter)
|
||||
|
||||
2016-07-19 (feature removed) Tcl_ObjType "array search" unregistered (porter)
|
||||
*** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("array search") ***
|
||||
|
||||
2016-10-04 Server socket on port 0 chooses port supporting IPv4 * IPv6 (max)
|
||||
|
||||
2016-11-25 [array names -regexp] supports backrefs (goth)
|
||||
|
||||
2017-01-04 (TIP 456) New routine Tcl_OpenTcpServerEx() (limeboy)
|
||||
|
||||
2017-01-04 (TIP 459) New subcommand [package files] (nijtmans)
|
||||
|
||||
2017-01-16 threaded allocator initialization repair (vasiljevic,nijtmans)
|
||||
|
||||
2017-01-30 Add to Win shell builtins: assoc ftype move (ashok)
|
||||
|
||||
2017-03-31 TCL_MEM_DEBUG facilities better support 64-bit memory (nijtmans)
|
||||
|
||||
2017-04-13 \u escaped content in msg files converted to true utf-8 (nijtmans)
|
||||
|
||||
2017-05-18 (TIP 458) New epoll or kqueue notifiers are default (alborboz)
|
||||
|
||||
2017-05-31 Purge build support for SunOS-4.* (stu)
|
||||
|
||||
2017-06-22 (TIP 463) New option [regsub ... -command ...] (fellows)
|
||||
|
||||
2017-06-22 (TIP 470) Tcl_GetDefineContextObject();[oo::define [self]] (fellows)
|
||||
=> TclOO 1.2.0
|
||||
|
||||
2017-06-23 (TIP 472) Support 0d as prefix of decimal numbers (iyer,griffin)
|
||||
|
||||
2017-08-31 (bug)[2a9465] http state 100 continue handling broken (oehlmann)
|
||||
|
||||
2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter)
|
||||
|
||||
--- Released 8.7a1, September 8, 2017 --- https://core.tcl-lang.org/tcl/ for details
|
||||
|
||||
2017-08-10 [array names -regexp] supports backrefs (goth)
|
||||
|
||||
2017-08-10 Fix gcc build failures due to #pragma placement (cassoff,fellows)
|
||||
@@ -8946,6 +8995,158 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
|
||||
|
||||
- Released 8.6.10, Nov 21, 2019 - details at https://core.tcl-lang.org/tcl/ -
|
||||
|
||||
Changes to 8.7a3 include all changes to the 8.6 line through 8.6.10,
|
||||
plus the following, which focuses on the high-level feature changes
|
||||
in this changeset (new minor version) rather than bug fixes:
|
||||
|
||||
2017-11-01 (bug)[3c32a3] crash deleting class mixed into instance (coulter)
|
||||
|
||||
2017-11-03 [TIP 345] eliminate the encoding 'identity' (porter)
|
||||
|
||||
2017-11-04 (bug)[0d902e] [string first] on ASCII stored as Unicode (fellows)
|
||||
|
||||
2017-11-17 [TIP 422] Mark all Tcl_*VA() routines deprecated. (nijtmans)
|
||||
|
||||
2017-11-20 (support) Ended use of the obsolete values.h header (culler)
|
||||
|
||||
2017-11-30 (bug)[8e1e31] [lsort] ordering of U+0000 (nijtmans)
|
||||
|
||||
2017-12-07 [TIP 487] Terminate support for pre-XP Windows (nijtmans)
|
||||
|
||||
2017-12-08 [TIP 477] Reform of nmake build (nadkarni)
|
||||
|
||||
2017-12-20 (bug)[ba1419] Crash: complex ensemble delete, namespace-7.8 (coulter)
|
||||
|
||||
2018-01-17 [TIP 485] Removal of many deprecated features (nijtmans)
|
||||
|
||||
2018-01-27 (bug) Crash in [join $l $l], join-4.1 (porter)
|
||||
|
||||
2018-02-06 [TIP 493] Cease Distribution of http 1.0 (porter)
|
||||
|
||||
2018-02-06 [TIP 484] internal rep for native ints are all 64-bit (nijtmans)
|
||||
|
||||
2018-02-14 [TIP 476] Scan/Printf consistency (nijtmans)
|
||||
|
||||
2018-03-05 [TIP 351] [lsearch] striding
|
||||
|
||||
2018-03-05 [TIPs 330,336] tighten access to Interp fields (porter)
|
||||
|
||||
2018-03-12 [TIP 462] [::tcl::process]
|
||||
|
||||
2018-03-12 [TIP 490] add oo support for msgcat => msgcat 1.7.0 (oehlmann)
|
||||
|
||||
2018-03-12 [TIP 499] custom locale preference list (oehlmann)
|
||||
=> msgcat 1.7.0
|
||||
|
||||
2018-03-20 [TIP 503] End CONST84 support for Tcl 8.3 (porter)
|
||||
|
||||
2018-03-30 Refactored [lrange] (spjuth)
|
||||
|
||||
2018-04-20 [TIP 389] Unicode beyond BMP (nijtmans)
|
||||
|
||||
2018-04-20 [TIP 421] [array for]
|
||||
|
||||
2018-05-11 [TIP 425] Windows panic callback use of UTF-8
|
||||
|
||||
2018-05-17 [TIP 491] Phase out --disable-threads support
|
||||
|
||||
2018-06-03 [TIP 500] TclOO Private Methods and Variables
|
||||
|
||||
2018-07-26 (bug)[ba921a] [string cat] of bytearrays (coulter,porter)
|
||||
|
||||
2018-09-02 [TIP 478] Many new features in TclOO (lester,fellows)
|
||||
|
||||
2018-09-04 (bug)[540bed] [binary format w] from bignum (nijtmans)
|
||||
|
||||
2018-09-12 [TIP 430] zipfs and embedded script library (woods)
|
||||
|
||||
2018-09-26 [TIP 508] [array default] (bonnet,fellows)
|
||||
|
||||
2018-09-27 [TIP 515] level value reform (nijtmans)
|
||||
|
||||
2018-09-27 [TIP 516] More OO slot operations (fellows)
|
||||
|
||||
2018-09-27 [TIP 426] [info cmdtype] (fellows)
|
||||
|
||||
2018-09-28 [TIP 509] Cross platform reentrant mutex
|
||||
|
||||
2018-10-08 [TIP 514] native integers are 64-bit
|
||||
|
||||
2018-10-12 [TIP 502] index value reform (porter)
|
||||
|
||||
2018-11-06 [TIP 406] http cookies (fellows)
|
||||
|
||||
2018-11-06 [TIP 445] Tcl_ObjType utilities (migrate to Tcl 9) (porter)
|
||||
|
||||
2018-11-06 [TIP 501] [string is dict]
|
||||
|
||||
2018-11-06 [TIP 519] inline export/unexport option for [oo::define]
|
||||
|
||||
2018-11-06 [TIP 523] [lpop]
|
||||
|
||||
2018-11-06 [TIP 524] TclOO custom dialects
|
||||
|
||||
2018-11-06 [TIP 506] Tcl_(Incr|Decr)RefCount macros -> functions (porter)
|
||||
|
||||
2018-11-15 [TIP 512] No stub for Tcl_SetExitProc()
|
||||
|
||||
2019-04-08 (bug)[45b9fa] crash in [try] (coulter)
|
||||
|
||||
2019-04-14 [TIP 160] terminal and serial channel controls
|
||||
|
||||
2019-04-14 [TIP 312] more types for Tcl_LinkVar
|
||||
|
||||
2019-04-14 [TIP 367] [lremove]
|
||||
|
||||
2019-04-14 [TIP 504] [string insert]
|
||||
|
||||
2019-04-16 [TIP 342] [dict getwithdefault]
|
||||
|
||||
2019-04-23 (bug)[67a5ea] make [chan postevent] asynchronous
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2019-05-25 [TIP 431] [file tempdir]
|
||||
|
||||
2019-05-25 [TIP 383] [coroinject], [coroprobe]
|
||||
|
||||
2019-05-31 [TIP 544] Tcl_GetIntForIndex()
|
||||
|
||||
2019-06-12 Replace TclOffset() with offsetof()
|
||||
|
||||
2019-06-15 [TIP 461] string compare operators for [expr]
|
||||
|
||||
2019-06-16 [TIP 521] floating point classification functions for [expr]
|
||||
|
||||
2019-06-20 (bug)[6bdadf] crash multi-arg traced [lappend] (fellows)
|
||||
|
||||
2019-06-28 [TIP 547] New encodings utf-16, ucs-2
|
||||
|
||||
2019-09-14 [TIP 414] Tcl_InitSubsystems()
|
||||
|
||||
2019-09-14 [TIP 548] wchar_t conversion functions
|
||||
|
||||
- Released 8.7a3, Nov 21, 2019 --- https://core.tcl-lang.org/tcl/ for details -
|
||||
|
||||
Changes to 9.0a1 include all changes to the 8.7 line through 8.7a3,
|
||||
plus the following, which focuses on the high-level feature changes
|
||||
in this changeset (new minor version) rather than bug fixes:
|
||||
|
||||
2017-11-03 [TIP 114] Leading zero integer no longer means octal
|
||||
|
||||
2017-11-03 [TIP 278] Revise variable name resolution, solve "Creative Writing"
|
||||
|
||||
2017-11-03 [TIPs 330,336] Encapsulate struct Tcl_Interp
|
||||
|
||||
2017-11-17 [TIP 422] Remove all Tcl_*VA() routines
|
||||
|
||||
2017-12-15 [TIP 488] Disable magic $::tcl_precision
|
||||
|
||||
2018-10-08 [TIP 494] Increased support for size_t value ranges
|
||||
|
||||
2019-05-31 [TIP 537] 64-bit indices in regexp matching
|
||||
|
||||
- Released 9.0a1, Nov 25, 2019 --- https://core.tcl-lang.org/tcl/ for details -
|
||||
|
||||
2019-12-03 (bug)[3cd9be] Corner case in surrogate handling (nijtmans)
|
||||
|
||||
2019-12-09 (new) Add tcltest::(Setup|Eval|Cleanup|)Test (coulter,sebres)
|
||||
@@ -9075,6 +9276,102 @@ See RFC 2045
|
||||
|
||||
- Released 8.6.11, Dec 31, 2020 - details at https://core.tcl-lang.org/tcl/ -
|
||||
|
||||
Changes to 8.7a5 include all changes to the 8.6 line through 8.6.11,
|
||||
plus the following, which focuses on the high-level feature changes
|
||||
in this changeset (new minor version) rather than bug fixes:
|
||||
|
||||
2019-12-13 [TIP 538] Externalize libtommath
|
||||
|
||||
2020-01-20 [TIP 542] Support for switchable Full Unicode support
|
||||
|
||||
2020-01-21 [TIP 543] Eliminate `TCL_INTERP_DESTROYED` flag value
|
||||
|
||||
2020-01-24 [TIP 559] Eliminate public routine `Tcl_FreeResult
|
||||
|
||||
2020-01-31 (new) Implement 64-bit seek on Zip channels. (nijtmans)
|
||||
|
||||
2020-02-28 [TIP 557] C++ support for Tcl
|
||||
|
||||
2020-02-28 [TIP 562] Deprecate channel types 1-4
|
||||
|
||||
2020-03-11 (bug)[234d6c] Segfault in [set l {}; lpop l] (sebres)
|
||||
|
||||
2020-03-12 (bug) Crash in tests binary-79.[12] (porter)
|
||||
|
||||
2020-03-13 [TIP 569] Eliminate Comments That Serve Lint
|
||||
|
||||
2020-04-06 (bug)[dd010c] [string trim*] on astral characters (porter,nijtmans)
|
||||
|
||||
2020-05-30 [TIP 551] Permit underscore in numerical literals in source code
|
||||
|
||||
2020-07-03 [TIP 578] Death to TCL_DBGX
|
||||
|
||||
2020-08-11 (bug)[e87000] Win32 crash in [fconfigure stdout] (werner,nijtmans)
|
||||
|
||||
2020-09-06 (bug)[c1a376] deletion trace on imported ensemble (coulter)
|
||||
|
||||
2020-09-13 [TIP 585] Promote the INDEX_TEMP_TABLE flag of Tcl_GetIndexFromObj*() to the public interface
|
||||
|
||||
2020-09-15 (bug)[b5777d] crash in [string index abcd 0-0x10000000000000000]
|
||||
|
||||
2020-09-19 [b9ecf3] revised stork mgmt [uplevel [list $cmd ...]] (coulter)
|
||||
|
||||
2020-10-23 [TIP 587] Default utf-8 for source command
|
||||
|
||||
2020-10-27 (bug)[11229b] test string-31.26.* (porter)
|
||||
|
||||
2020-11-08 [TIP 582] Comments in Expressions
|
||||
|
||||
2020-11-16 [TIP 586] C String Parsing Support for binary scan
|
||||
|
||||
2020-12-07 [TIP 590] Recommend lowercase Package Names
|
||||
|
||||
2021-01-06 Bump to tcltest 2.5.4
|
||||
|
||||
2021-01-15 [TIP 481] `Tcl_GetStringFromObj()` with `size_t` length parameter
|
||||
|
||||
2021-01-15 [TIP 592] End support: Windows XP, Server 2003, Vista, Server 2008
|
||||
|
||||
2021-01-25 tzdata updated to Olson's tzdata2021a (nijtmans)
|
||||
|
||||
2021-01-29 (bug)[113be1] zipfs on mac
|
||||
|
||||
2021-03-15 [TIP 575] Switchable Tcl_UtfCharComplete()/Tcl_UtfNext()/Tcl_UtfPrev()
|
||||
|
||||
2021-03-19 (new)[0221b9] Drop TCL_WINDOW_EVENTS from Tcl's [update idletasks]
|
||||
|
||||
2021-03-30 (new)[4b4830] [chan truncate] for reflected channels
|
||||
|
||||
2021-04-30 [TIP 597] "string is unicode" and better utf-8/utf-16/cesu-8 encodings
|
||||
|
||||
2021-04-09 [TIP 598] export TclWinConvertError
|
||||
|
||||
2021-05-15 (bug)[463b7a] segfault from Tcl_Unload (coulter)
|
||||
|
||||
2021-05-15 (bug)[fb2a41] tclZipfs.c free all memory (coulter)
|
||||
|
||||
2021-05-18 (bug)[688fcc,28027d] namespace teardown reform (coulter)
|
||||
|
||||
- Released 8.7a5, Jun 18, 2021 --- https://core.tcl-lang.org/tcl/ for details -
|
||||
|
||||
Changes to 9.0a3 include all changes to the 8.7 line through 8.7a5,
|
||||
plus the following, which focuses on the high-level feature changes
|
||||
in this changeset (new major version) rather than bug fixes:
|
||||
|
||||
Many of the TIPs in Tcl 8.7 mentioned above are extended further in 9.0
|
||||
|
||||
2020-02-28 [TIP 497] Full support for Unicode planes 1-16
|
||||
|
||||
2020-08-21 (bug)[43b434] improper calls to stat64()
|
||||
|
||||
2021-04-08 [TIP 595] Unicode-aware loadable library handling.
|
||||
|
||||
2021-04-30 [TIP 596] Stubs support for embedding Tcl in apps
|
||||
|
||||
Many internal changes to broaden support for sizes beyond 32-bits.
|
||||
|
||||
- Released 9.0a3, Jun 23, 2021 --- https://core.tcl-lang.org/tcl/ for details -
|
||||
|
||||
2021-02-02 (new) support for MacOS Big Sur updates (nijtmans)
|
||||
=> platform 1.0.17
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
|
||||
struct sockaddr_in *sin = (struct sockaddr_in *)sa;
|
||||
struct hostent *hp;
|
||||
char tmpserv[16];
|
||||
(void)salen;
|
||||
|
||||
if (sa->sa_family != AF_UNSPEC && sa->sa_family != AF_INET)
|
||||
return (EAI_FAMILY);
|
||||
@@ -153,7 +154,7 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
|
||||
{
|
||||
struct addrinfo *ai;
|
||||
|
||||
ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
|
||||
ai = (struct addrinfo *)malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
|
||||
if (ai == NULL)
|
||||
return (NULL);
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
* float.h --
|
||||
*
|
||||
* This is a dummy header file to #include in Tcl when there
|
||||
* is no float.h in /usr/include. Right now this file is empty:
|
||||
* Tcl contains #ifdefs to deal with the lack of definitions;
|
||||
* all it needs is for the #include statement to work.
|
||||
*
|
||||
* Copyright (c) 1993 The Regents of the University of California.
|
||||
* Copyright (c) 1994 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
+6
-5
@@ -13,6 +13,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -32,19 +33,19 @@
|
||||
|
||||
int
|
||||
mkstemp(
|
||||
char *template) /* Template for filename. */
|
||||
char *tmpl) /* Template for filename. */
|
||||
{
|
||||
static const char alphanumerics[] =
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
char *a, *b;
|
||||
int fd, count, alphanumericsLen = strlen(alphanumerics); /* == 62 */
|
||||
|
||||
a = template + strlen(template);
|
||||
while (a > template && *(a-1) == 'X') {
|
||||
a = tmpl + strlen(tmpl);
|
||||
while (a > tmpl && *(a-1) == 'X') {
|
||||
a--;
|
||||
}
|
||||
|
||||
if (a == template) {
|
||||
if (a == tmpl) {
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
@@ -71,7 +72,7 @@ mkstemp(
|
||||
* Template is now realized; try to open (with correct options).
|
||||
*/
|
||||
|
||||
fd = open(template, O_RDWR|O_CREAT|O_EXCL, 0600);
|
||||
fd = open(tmpl, O_RDWR|O_CREAT|O_EXCL, 0600);
|
||||
} while (fd == -1 && errno == EEXIST && --count > 0);
|
||||
|
||||
return fd;
|
||||
|
||||
+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((char *)dirp);
|
||||
Tcl_Free(dirp);
|
||||
}
|
||||
|
||||
+919
@@ -0,0 +1,919 @@
|
||||
/* A portable stdint.h
|
||||
****************************************************************************
|
||||
* BSD License:
|
||||
****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2005-2016 Paul Hsieh
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************
|
||||
*
|
||||
* Version 0.1.16.0
|
||||
*
|
||||
* The ANSI C standard committee, for the C99 standard, specified the
|
||||
* inclusion of a new standard include file called stdint.h. This is
|
||||
* a very useful and long desired include file which contains several
|
||||
* very precise definitions for integer scalar types that is critically
|
||||
* important for making several classes of applications portable
|
||||
* including cryptography, hashing, variable length integer libraries
|
||||
* and so on. But for most developers its likely useful just for
|
||||
* programming sanity.
|
||||
*
|
||||
* The problem is that some compiler vendors chose to ignore the C99
|
||||
* standard and some older compilers have no opportunity to be updated.
|
||||
* Because of this situation, simply including stdint.h in your code
|
||||
* makes it unportable.
|
||||
*
|
||||
* So that's what this file is all about. It's an attempt to build a
|
||||
* single universal include file that works on as many platforms as
|
||||
* possible to deliver what stdint.h is supposed to. Even compilers
|
||||
* that already come with stdint.h can use this file instead without
|
||||
* any loss of functionality. A few things that should be noted about
|
||||
* this file:
|
||||
*
|
||||
* 1) It is not guaranteed to be portable and/or present an identical
|
||||
* interface on all platforms. The extreme variability of the
|
||||
* ANSI C standard makes this an impossibility right from the
|
||||
* very get go. Its really only meant to be useful for the vast
|
||||
* majority of platforms that possess the capability of
|
||||
* implementing usefully and precisely defined, standard sized
|
||||
* integer scalars. Systems which are not intrinsically 2s
|
||||
* complement may produce invalid constants.
|
||||
*
|
||||
* 2) There is an unavoidable use of non-reserved symbols.
|
||||
*
|
||||
* 3) Other standard include files are invoked.
|
||||
*
|
||||
* 4) This file may come in conflict with future platforms that do
|
||||
* include stdint.h. The hope is that one or the other can be
|
||||
* used with no real difference.
|
||||
*
|
||||
* 5) In the current version, if your platform can't represent
|
||||
* int32_t, int16_t and int8_t, it just dumps out with a compiler
|
||||
* error.
|
||||
*
|
||||
* 6) 64 bit integers may or may not be defined. Test for their
|
||||
* presence with the test: #ifdef INT64_MAX or #ifdef UINT64_MAX.
|
||||
* Note that this is different from the C99 specification which
|
||||
* requires the existence of 64 bit support in the compiler. If
|
||||
* this is not defined for your platform, yet it is capable of
|
||||
* dealing with 64 bits then it is because this file has not yet
|
||||
* been extended to cover all of your system's capabilities.
|
||||
*
|
||||
* 7) (u)intptr_t may or may not be defined. Test for its presence
|
||||
* with the test: #ifdef PTRDIFF_MAX. If this is not defined
|
||||
* for your platform, then it is because this file has not yet
|
||||
* been extended to cover all of your system's capabilities, not
|
||||
* because its optional.
|
||||
*
|
||||
* 8) The following might not been defined even if your platform is
|
||||
* capable of defining it:
|
||||
*
|
||||
* WCHAR_MIN
|
||||
* WCHAR_MAX
|
||||
* (u)int64_t
|
||||
* PTRDIFF_MIN
|
||||
* PTRDIFF_MAX
|
||||
* (u)intptr_t
|
||||
*
|
||||
* 9) The following have not been defined:
|
||||
*
|
||||
* WINT_MIN
|
||||
* WINT_MAX
|
||||
*
|
||||
* 10) The criteria for defining (u)int_least(*)_t isn't clear,
|
||||
* except for systems which don't have a type that precisely
|
||||
* defined 8, 16, or 32 bit types (which this include file does
|
||||
* not support anyways). Default definitions have been given.
|
||||
*
|
||||
* 11) The criteria for defining (u)int_fast(*)_t isn't something I
|
||||
* would trust to any particular compiler vendor or the ANSI C
|
||||
* committee. It is well known that "compatible systems" are
|
||||
* commonly created that have very different performance
|
||||
* characteristics from the systems they are compatible with,
|
||||
* especially those whose vendors make both the compiler and the
|
||||
* system. Default definitions have been given, but its strongly
|
||||
* recommended that users never use these definitions for any
|
||||
* reason (they do *NOT* deliver any serious guarantee of
|
||||
* improved performance -- not in this file, nor any vendor's
|
||||
* stdint.h).
|
||||
*
|
||||
* 12) The following macros:
|
||||
*
|
||||
* PRINTF_INTMAX_MODIFIER
|
||||
* PRINTF_INT64_MODIFIER
|
||||
* PRINTF_INT32_MODIFIER
|
||||
* PRINTF_INT16_MODIFIER
|
||||
* PRINTF_LEAST64_MODIFIER
|
||||
* PRINTF_LEAST32_MODIFIER
|
||||
* PRINTF_LEAST16_MODIFIER
|
||||
* PRINTF_INTPTR_MODIFIER
|
||||
*
|
||||
* are strings which have been defined as the modifiers required
|
||||
* for the "d", "u" and "x" printf formats to correctly output
|
||||
* (u)intmax_t, (u)int64_t, (u)int32_t, (u)int16_t, (u)least64_t,
|
||||
* (u)least32_t, (u)least16_t and (u)intptr_t types respectively.
|
||||
* PRINTF_INTPTR_MODIFIER is not defined for some systems which
|
||||
* provide their own stdint.h. PRINTF_INT64_MODIFIER is not
|
||||
* defined if INT64_MAX is not defined. These are an extension
|
||||
* beyond what C99 specifies must be in stdint.h.
|
||||
*
|
||||
* In addition, the following macros are defined:
|
||||
*
|
||||
* PRINTF_INTMAX_HEX_WIDTH
|
||||
* PRINTF_INT64_HEX_WIDTH
|
||||
* PRINTF_INT32_HEX_WIDTH
|
||||
* PRINTF_INT16_HEX_WIDTH
|
||||
* PRINTF_INT8_HEX_WIDTH
|
||||
* PRINTF_INTMAX_DEC_WIDTH
|
||||
* PRINTF_INT64_DEC_WIDTH
|
||||
* PRINTF_INT32_DEC_WIDTH
|
||||
* PRINTF_INT16_DEC_WIDTH
|
||||
* PRINTF_UINT8_DEC_WIDTH
|
||||
* PRINTF_UINTMAX_DEC_WIDTH
|
||||
* PRINTF_UINT64_DEC_WIDTH
|
||||
* PRINTF_UINT32_DEC_WIDTH
|
||||
* PRINTF_UINT16_DEC_WIDTH
|
||||
* PRINTF_UINT8_DEC_WIDTH
|
||||
*
|
||||
* Which specifies the maximum number of characters required to
|
||||
* print the number of that type in either hexadecimal or decimal.
|
||||
* These are an extension beyond what C99 specifies must be in
|
||||
* stdint.h.
|
||||
*
|
||||
* Compilers tested (all with 0 warnings at their highest respective
|
||||
* settings): Borland Turbo C 2.0, WATCOM C/C++ 11.0 (16 bits and 32
|
||||
* bits), Microsoft Visual C++ 6.0 (32 bit), Microsoft Visual Studio
|
||||
* .net (VC7), Intel C++ 4.0, GNU gcc v3.3.3
|
||||
*
|
||||
* This file should be considered a work in progress. Suggestions for
|
||||
* improvements, especially those which increase coverage are strongly
|
||||
* encouraged.
|
||||
*
|
||||
* Acknowledgements
|
||||
*
|
||||
* The following people have made significant contributions to the
|
||||
* development and testing of this file:
|
||||
*
|
||||
* Chris Howie
|
||||
* John Steele Scott
|
||||
* Dave Thorup
|
||||
* John Dill
|
||||
* Florian Wobbe
|
||||
* Christopher Sean Morrison
|
||||
* Mikkel Fahnoe Jorgensen
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <limits.h>
|
||||
#include <signal.h>
|
||||
|
||||
/*
|
||||
* For gcc with _STDINT_H, fill in the PRINTF_INT*_MODIFIER macros, and
|
||||
* do nothing else. On the Mac OS X version of gcc this is _STDINT_H_.
|
||||
*/
|
||||
|
||||
#if ((defined(__SUNPRO_C) && __SUNPRO_C >= 0x570) || (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (__GNUC__ > 3 || defined(_STDINT_H) || defined(_STDINT_H_) || defined (__UINT_FAST64_TYPE__)) )) && !defined (_PSTDINT_H_INCLUDED)
|
||||
#include <stdint.h>
|
||||
#define _PSTDINT_H_INCLUDED
|
||||
# if defined(__GNUC__) && (defined(__x86_64__) || defined(__ppc64__)) && !(defined(__APPLE__) && defined(__MACH__))
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "l"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
# else
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# if (UINT_MAX == UINT32_MAX)
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# else
|
||||
# define PRINTF_INT32_MODIFIER "l"
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER "h"
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_MODIFIER
|
||||
# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
|
||||
# endif
|
||||
# ifndef PRINTF_INT64_HEX_WIDTH
|
||||
# define PRINTF_INT64_HEX_WIDTH "16"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT64_HEX_WIDTH
|
||||
# define PRINTF_UINT64_HEX_WIDTH "16"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_HEX_WIDTH
|
||||
# define PRINTF_INT32_HEX_WIDTH "8"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT32_HEX_WIDTH
|
||||
# define PRINTF_UINT32_HEX_WIDTH "8"
|
||||
# endif
|
||||
# ifndef PRINTF_INT16_HEX_WIDTH
|
||||
# define PRINTF_INT16_HEX_WIDTH "4"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT16_HEX_WIDTH
|
||||
# define PRINTF_UINT16_HEX_WIDTH "4"
|
||||
# endif
|
||||
# ifndef PRINTF_INT8_HEX_WIDTH
|
||||
# define PRINTF_INT8_HEX_WIDTH "2"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT8_HEX_WIDTH
|
||||
# define PRINTF_UINT8_HEX_WIDTH "2"
|
||||
# endif
|
||||
# ifndef PRINTF_INT64_DEC_WIDTH
|
||||
# define PRINTF_INT64_DEC_WIDTH "19"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT64_DEC_WIDTH
|
||||
# define PRINTF_UINT64_DEC_WIDTH "20"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_DEC_WIDTH
|
||||
# define PRINTF_INT32_DEC_WIDTH "10"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT32_DEC_WIDTH
|
||||
# define PRINTF_UINT32_DEC_WIDTH "10"
|
||||
# endif
|
||||
# ifndef PRINTF_INT16_DEC_WIDTH
|
||||
# define PRINTF_INT16_DEC_WIDTH "5"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT16_DEC_WIDTH
|
||||
# define PRINTF_UINT16_DEC_WIDTH "5"
|
||||
# endif
|
||||
# ifndef PRINTF_INT8_DEC_WIDTH
|
||||
# define PRINTF_INT8_DEC_WIDTH "3"
|
||||
# endif
|
||||
# ifndef PRINTF_UINT8_DEC_WIDTH
|
||||
# define PRINTF_UINT8_DEC_WIDTH "3"
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_HEX_WIDTH
|
||||
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_UINTMAX_HEX_WIDTH
|
||||
# define PRINTF_UINTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_DEC_WIDTH
|
||||
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_UINTMAX_DEC_WIDTH
|
||||
# define PRINTF_UINTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Something really weird is going on with Open Watcom. Just pull some of
|
||||
* these duplicated definitions from Open Watcom's stdint.h file for now.
|
||||
*/
|
||||
|
||||
# if defined (__WATCOMC__) && __WATCOMC__ >= 1250
|
||||
# if !defined (INT64_C)
|
||||
# define INT64_C(x) (x + (INT64_MAX - INT64_MAX))
|
||||
# endif
|
||||
# if !defined (UINT64_C)
|
||||
# define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX))
|
||||
# endif
|
||||
# if !defined (INT32_C)
|
||||
# define INT32_C(x) (x + (INT32_MAX - INT32_MAX))
|
||||
# endif
|
||||
# if !defined (UINT32_C)
|
||||
# define UINT32_C(x) (x + (UINT32_MAX - UINT32_MAX))
|
||||
# endif
|
||||
# if !defined (INT16_C)
|
||||
# define INT16_C(x) (x)
|
||||
# endif
|
||||
# if !defined (UINT16_C)
|
||||
# define UINT16_C(x) (x)
|
||||
# endif
|
||||
# if !defined (INT8_C)
|
||||
# define INT8_C(x) (x)
|
||||
# endif
|
||||
# if !defined (UINT8_C)
|
||||
# define UINT8_C(x) (x)
|
||||
# endif
|
||||
# if !defined (UINT64_MAX)
|
||||
# define UINT64_MAX 18446744073709551615ULL
|
||||
# endif
|
||||
# if !defined (INT64_MAX)
|
||||
# define INT64_MAX 9223372036854775807LL
|
||||
# endif
|
||||
# if !defined (UINT32_MAX)
|
||||
# define UINT32_MAX 4294967295UL
|
||||
# endif
|
||||
# if !defined (INT32_MAX)
|
||||
# define INT32_MAX 2147483647L
|
||||
# endif
|
||||
# if !defined (INTMAX_MAX)
|
||||
# define INTMAX_MAX INT64_MAX
|
||||
# endif
|
||||
# if !defined (INTMAX_MIN)
|
||||
# define INTMAX_MIN INT64_MIN
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* I have no idea what is the truly correct thing to do on older Solaris.
|
||||
* From some online discussions, this seems to be what is being
|
||||
* recommended. For people who actually are developing on older Solaris,
|
||||
* what I would like to know is, does this define all of the relevant
|
||||
* macros of a complete stdint.h? Remember, in pstdint.h 64 bit is
|
||||
* considered optional.
|
||||
*/
|
||||
|
||||
#if (defined(__SUNPRO_C) && __SUNPRO_C >= 0x420) && !defined(_PSTDINT_H_INCLUDED)
|
||||
#include <sys/inttypes.h>
|
||||
#define _PSTDINT_H_INCLUDED
|
||||
#endif
|
||||
|
||||
#ifndef _PSTDINT_H_INCLUDED
|
||||
#define _PSTDINT_H_INCLUDED
|
||||
|
||||
#ifndef SIZE_MAX
|
||||
# define SIZE_MAX ((size_t)-1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Deduce the type assignments from limits.h under the assumption that
|
||||
* integer sizes in bits are powers of 2, and follow the ANSI
|
||||
* definitions.
|
||||
*/
|
||||
|
||||
#ifndef UINT8_MAX
|
||||
# define UINT8_MAX 0xff
|
||||
#endif
|
||||
#if !defined(uint8_t) && !defined(_UINT8_T) && !defined(vxWorks)
|
||||
# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S)
|
||||
typedef unsigned char uint8_t;
|
||||
# define UINT8_C(v) ((uint8_t) v)
|
||||
# else
|
||||
# error "Platform not supported"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef INT8_MAX
|
||||
# define INT8_MAX 0x7f
|
||||
#endif
|
||||
#ifndef INT8_MIN
|
||||
# define INT8_MIN INT8_C(0x80)
|
||||
#endif
|
||||
#if !defined(int8_t) && !defined(_INT8_T) && !defined(vxWorks)
|
||||
# if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S)
|
||||
typedef signed char int8_t;
|
||||
# define INT8_C(v) ((int8_t) v)
|
||||
# else
|
||||
# error "Platform not supported"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT16_MAX
|
||||
# define UINT16_MAX 0xffff
|
||||
#endif
|
||||
#if !defined(uint16_t) && !defined(_UINT16_T) && !defined(vxWorks)
|
||||
#if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S)
|
||||
typedef unsigned int uint16_t;
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER ""
|
||||
# endif
|
||||
# define UINT16_C(v) ((uint16_t) (v))
|
||||
#elif (USHRT_MAX == UINT16_MAX)
|
||||
typedef unsigned short uint16_t;
|
||||
# define UINT16_C(v) ((uint16_t) (v))
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER "h"
|
||||
# endif
|
||||
#else
|
||||
#error "Platform not supported"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef INT16_MAX
|
||||
# define INT16_MAX 0x7fff
|
||||
#endif
|
||||
#ifndef INT16_MIN
|
||||
# define INT16_MIN INT16_C(0x8000)
|
||||
#endif
|
||||
#if !defined(int16_t) && !defined(_INT16_T) && !defined(vxWorks)
|
||||
#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S)
|
||||
typedef signed int int16_t;
|
||||
# define INT16_C(v) ((int16_t) (v))
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER ""
|
||||
# endif
|
||||
#elif (SHRT_MAX == INT16_MAX)
|
||||
typedef signed short int16_t;
|
||||
# define INT16_C(v) ((int16_t) (v))
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER "h"
|
||||
# endif
|
||||
#else
|
||||
#error "Platform not supported"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT32_MAX
|
||||
# define UINT32_MAX (0xffffffffUL)
|
||||
#endif
|
||||
#if !defined(uint32_t) && !defined(_UINT32_T) && !defined(vxWorks)
|
||||
#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)
|
||||
typedef unsigned long uint32_t;
|
||||
# define UINT32_C(v) v ## UL
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER "l"
|
||||
# endif
|
||||
#elif (UINT_MAX == UINT32_MAX)
|
||||
typedef unsigned int uint32_t;
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
# define UINT32_C(v) v ## U
|
||||
#elif (USHRT_MAX == UINT32_MAX)
|
||||
typedef unsigned short uint32_t;
|
||||
# define UINT32_C(v) ((unsigned short) (v))
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
#else
|
||||
#error "Platform not supported"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef INT32_MAX
|
||||
# define INT32_MAX (0x7fffffffL)
|
||||
#endif
|
||||
#ifndef INT32_MIN
|
||||
# define INT32_MIN INT32_C(0x80000000)
|
||||
#endif
|
||||
#if !defined(int32_t) && !defined(_INT32_T) && !defined(vxWorks)
|
||||
#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)
|
||||
typedef signed long int32_t;
|
||||
# define INT32_C(v) v ## L
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER "l"
|
||||
# endif
|
||||
#elif (INT_MAX == INT32_MAX)
|
||||
typedef signed int int32_t;
|
||||
# define INT32_C(v) v
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
#elif (SHRT_MAX == INT32_MAX)
|
||||
typedef signed short int32_t;
|
||||
# define INT32_C(v) ((short) (v))
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
#else
|
||||
#error "Platform not supported"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The macro stdint_int64_defined is temporarily used to record
|
||||
* whether or not 64 integer support is available. It must be
|
||||
* defined for any 64 integer extensions for new platforms that are
|
||||
* added.
|
||||
*/
|
||||
|
||||
#undef stdint_int64_defined
|
||||
#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S)
|
||||
# if (__STDC__ && __STDC_VERSION__ >= 199901L) || defined (S_SPLINT_S)
|
||||
# define stdint_int64_defined
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
# define UINT64_C(v) v ## ULL
|
||||
# define INT64_C(v) v ## LL
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined (stdint_int64_defined)
|
||||
# if defined(__GNUC__) && !defined(vxWorks)
|
||||
# define stdint_int64_defined
|
||||
__extension__ typedef long long int64_t;
|
||||
__extension__ typedef unsigned long long uint64_t;
|
||||
# define UINT64_C(v) v ## ULL
|
||||
# define INT64_C(v) v ## LL
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S)
|
||||
# define stdint_int64_defined
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
# define UINT64_C(v) v ## ULL
|
||||
# define INT64_C(v) v ## LL
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC)
|
||||
# define stdint_int64_defined
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
# define UINT64_C(v) v ## UI64
|
||||
# define INT64_C(v) v ## I64
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "I64"
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined (LONG_LONG_MAX) && defined (INT64_C)
|
||||
# define LONG_LONG_MAX INT64_C (9223372036854775807)
|
||||
#endif
|
||||
#ifndef ULONG_LONG_MAX
|
||||
# define ULONG_LONG_MAX UINT64_C (18446744073709551615)
|
||||
#endif
|
||||
|
||||
#if !defined (INT64_MAX) && defined (INT64_C)
|
||||
# define INT64_MAX INT64_C (9223372036854775807)
|
||||
#endif
|
||||
#if !defined (INT64_MIN) && defined (INT64_C)
|
||||
# define INT64_MIN INT64_C (-9223372036854775808)
|
||||
#endif
|
||||
#if !defined (UINT64_MAX) && defined (INT64_C)
|
||||
# define UINT64_MAX UINT64_C (18446744073709551615)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Width of hexadecimal for number field.
|
||||
*/
|
||||
|
||||
#ifndef PRINTF_INT64_HEX_WIDTH
|
||||
# define PRINTF_INT64_HEX_WIDTH "16"
|
||||
#endif
|
||||
#ifndef PRINTF_INT32_HEX_WIDTH
|
||||
# define PRINTF_INT32_HEX_WIDTH "8"
|
||||
#endif
|
||||
#ifndef PRINTF_INT16_HEX_WIDTH
|
||||
# define PRINTF_INT16_HEX_WIDTH "4"
|
||||
#endif
|
||||
#ifndef PRINTF_INT8_HEX_WIDTH
|
||||
# define PRINTF_INT8_HEX_WIDTH "2"
|
||||
#endif
|
||||
#ifndef PRINTF_INT64_DEC_WIDTH
|
||||
# define PRINTF_INT64_DEC_WIDTH "19"
|
||||
#endif
|
||||
#ifndef PRINTF_INT32_DEC_WIDTH
|
||||
# define PRINTF_INT32_DEC_WIDTH "10"
|
||||
#endif
|
||||
#ifndef PRINTF_INT16_DEC_WIDTH
|
||||
# define PRINTF_INT16_DEC_WIDTH "5"
|
||||
#endif
|
||||
#ifndef PRINTF_INT8_DEC_WIDTH
|
||||
# define PRINTF_INT8_DEC_WIDTH "3"
|
||||
#endif
|
||||
#ifndef PRINTF_UINT64_DEC_WIDTH
|
||||
# define PRINTF_UINT64_DEC_WIDTH "20"
|
||||
#endif
|
||||
#ifndef PRINTF_UINT32_DEC_WIDTH
|
||||
# define PRINTF_UINT32_DEC_WIDTH "10"
|
||||
#endif
|
||||
#ifndef PRINTF_UINT16_DEC_WIDTH
|
||||
# define PRINTF_UINT16_DEC_WIDTH "5"
|
||||
#endif
|
||||
#ifndef PRINTF_UINT8_DEC_WIDTH
|
||||
# define PRINTF_UINT8_DEC_WIDTH "3"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Ok, lets not worry about 128 bit integers for now. Moore's law says
|
||||
* we don't need to worry about that until about 2040 at which point
|
||||
* we'll have bigger things to worry about.
|
||||
*/
|
||||
|
||||
#ifdef stdint_int64_defined
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
# define INTMAX_MAX INT64_MAX
|
||||
# define INTMAX_MIN INT64_MIN
|
||||
# define UINTMAX_MAX UINT64_MAX
|
||||
# define UINTMAX_C(v) UINT64_C(v)
|
||||
# define INTMAX_C(v) INT64_C(v)
|
||||
# ifndef PRINTF_INTMAX_MODIFIER
|
||||
# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_HEX_WIDTH
|
||||
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_DEC_WIDTH
|
||||
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
|
||||
# endif
|
||||
#else
|
||||
typedef int32_t intmax_t;
|
||||
typedef uint32_t uintmax_t;
|
||||
# define INTMAX_MAX INT32_MAX
|
||||
# define UINTMAX_MAX UINT32_MAX
|
||||
# define UINTMAX_C(v) UINT32_C(v)
|
||||
# define INTMAX_C(v) INT32_C(v)
|
||||
# ifndef PRINTF_INTMAX_MODIFIER
|
||||
# define PRINTF_INTMAX_MODIFIER PRINTF_INT32_MODIFIER
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_HEX_WIDTH
|
||||
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT32_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_DEC_WIDTH
|
||||
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT32_DEC_WIDTH
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Because this file currently only supports platforms which have
|
||||
* precise powers of 2 as bit sizes for the default integers, the
|
||||
* least definitions are all trivial. Its possible that a future
|
||||
* version of this file could have different definitions.
|
||||
*/
|
||||
|
||||
#ifndef stdint_least_defined
|
||||
typedef int8_t int_least8_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
# define PRINTF_LEAST32_MODIFIER PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_LEAST16_MODIFIER PRINTF_INT16_MODIFIER
|
||||
# define UINT_LEAST8_MAX UINT8_MAX
|
||||
# define INT_LEAST8_MAX INT8_MAX
|
||||
# define UINT_LEAST16_MAX UINT16_MAX
|
||||
# define INT_LEAST16_MAX INT16_MAX
|
||||
# define UINT_LEAST32_MAX UINT32_MAX
|
||||
# define INT_LEAST32_MAX INT32_MAX
|
||||
# define INT_LEAST8_MIN INT8_MIN
|
||||
# define INT_LEAST16_MIN INT16_MIN
|
||||
# define INT_LEAST32_MIN INT32_MIN
|
||||
# ifdef stdint_int64_defined
|
||||
typedef int64_t int_least64_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
# define PRINTF_LEAST64_MODIFIER PRINTF_INT64_MODIFIER
|
||||
# define UINT_LEAST64_MAX UINT64_MAX
|
||||
# define INT_LEAST64_MAX INT64_MAX
|
||||
# define INT_LEAST64_MIN INT64_MIN
|
||||
# endif
|
||||
#endif
|
||||
#undef stdint_least_defined
|
||||
|
||||
/*
|
||||
* The ANSI C committee has defined *int*_fast*_t types as well. This,
|
||||
* of course, defies rationality -- you can't know what will be fast
|
||||
* just from the type itself. Even for a given architecture, compatible
|
||||
* implementations might have different performance characteristics.
|
||||
* Developers are warned to stay away from these types when using this
|
||||
* or any other stdint.h.
|
||||
*/
|
||||
|
||||
typedef int_least8_t int_fast8_t;
|
||||
typedef uint_least8_t uint_fast8_t;
|
||||
typedef int_least16_t int_fast16_t;
|
||||
typedef uint_least16_t uint_fast16_t;
|
||||
typedef int_least32_t int_fast32_t;
|
||||
typedef uint_least32_t uint_fast32_t;
|
||||
#define UINT_FAST8_MAX UINT_LEAST8_MAX
|
||||
#define INT_FAST8_MAX INT_LEAST8_MAX
|
||||
#define UINT_FAST16_MAX UINT_LEAST16_MAX
|
||||
#define INT_FAST16_MAX INT_LEAST16_MAX
|
||||
#define UINT_FAST32_MAX UINT_LEAST32_MAX
|
||||
#define INT_FAST32_MAX INT_LEAST32_MAX
|
||||
#define INT_FAST8_MIN INT_LEAST8_MIN
|
||||
#define INT_FAST16_MIN INT_LEAST16_MIN
|
||||
#define INT_FAST32_MIN INT_LEAST32_MIN
|
||||
#ifdef stdint_int64_defined
|
||||
typedef int_least64_t int_fast64_t;
|
||||
typedef uint_least64_t uint_fast64_t;
|
||||
# define UINT_FAST64_MAX UINT_LEAST64_MAX
|
||||
# define INT_FAST64_MAX INT_LEAST64_MAX
|
||||
# define INT_FAST64_MIN INT_LEAST64_MIN
|
||||
#endif
|
||||
|
||||
#undef stdint_int64_defined
|
||||
|
||||
/*
|
||||
* Whatever piecemeal, per compiler thing we can do about the wchar_t
|
||||
* type limits.
|
||||
*/
|
||||
|
||||
#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__) && !defined(vxWorks)
|
||||
# include <wchar.h>
|
||||
# ifndef WCHAR_MIN
|
||||
# define WCHAR_MIN 0
|
||||
# endif
|
||||
# ifndef WCHAR_MAX
|
||||
# define WCHAR_MAX ((wchar_t)-1)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Whatever piecemeal, per compiler/platform thing we can do about the
|
||||
* (u)intptr_t types and limits.
|
||||
*/
|
||||
|
||||
#if (defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)) || defined (_UINTPTR_T)
|
||||
# define STDINT_H_UINTPTR_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef STDINT_H_UINTPTR_T_DEFINED
|
||||
# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64) || defined (__ppc64__)
|
||||
# define stdint_intptr_bits 64
|
||||
# elif defined (__WATCOMC__) || defined (__TURBOC__)
|
||||
# if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
|
||||
# define stdint_intptr_bits 16
|
||||
# else
|
||||
# define stdint_intptr_bits 32
|
||||
# endif
|
||||
# elif defined (__i386__) || defined (_WIN32) || defined (WIN32) || defined (__ppc64__)
|
||||
# define stdint_intptr_bits 32
|
||||
# elif defined (__INTEL_COMPILER)
|
||||
/* TODO -- what did Intel do about x86-64? */
|
||||
# else
|
||||
/* #error "This platform might not be supported yet" */
|
||||
# endif
|
||||
|
||||
# ifdef stdint_intptr_bits
|
||||
# define stdint_intptr_glue3_i(a,b,c) a##b##c
|
||||
# define stdint_intptr_glue3(a,b,c) stdint_intptr_glue3_i(a,b,c)
|
||||
# ifndef PRINTF_INTPTR_MODIFIER
|
||||
# define PRINTF_INTPTR_MODIFIER stdint_intptr_glue3(PRINTF_INT,stdint_intptr_bits,_MODIFIER)
|
||||
# endif
|
||||
# ifndef PTRDIFF_MAX
|
||||
# define PTRDIFF_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
|
||||
# endif
|
||||
# ifndef PTRDIFF_MIN
|
||||
# define PTRDIFF_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
|
||||
# endif
|
||||
# ifndef UINTPTR_MAX
|
||||
# define UINTPTR_MAX stdint_intptr_glue3(UINT,stdint_intptr_bits,_MAX)
|
||||
# endif
|
||||
# ifndef INTPTR_MAX
|
||||
# define INTPTR_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
|
||||
# endif
|
||||
# ifndef INTPTR_MIN
|
||||
# define INTPTR_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
|
||||
# endif
|
||||
# ifndef INTPTR_C
|
||||
# define INTPTR_C(x) stdint_intptr_glue3(INT,stdint_intptr_bits,_C)(x)
|
||||
# endif
|
||||
# ifndef UINTPTR_C
|
||||
# define UINTPTR_C(x) stdint_intptr_glue3(UINT,stdint_intptr_bits,_C)(x)
|
||||
# endif
|
||||
typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t;
|
||||
typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t;
|
||||
# else
|
||||
/* TODO -- This following is likely wrong for some platforms, and does
|
||||
nothing for the definition of uintptr_t. */
|
||||
typedef ptrdiff_t intptr_t;
|
||||
# endif
|
||||
# define STDINT_H_UINTPTR_T_DEFINED
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Assumes sig_atomic_t is signed and we have a 2s complement machine.
|
||||
*/
|
||||
|
||||
#ifndef SIG_ATOMIC_MAX
|
||||
# define SIG_ATOMIC_MAX ((((sig_atomic_t) 1) << (sizeof (sig_atomic_t)*CHAR_BIT-1)) - 1)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (__TEST_PSTDINT_FOR_CORRECTNESS)
|
||||
|
||||
/*
|
||||
* Please compile with the maximum warning settings to make sure macros are
|
||||
* not defined more than once.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define glue3_aux(x,y,z) x ## y ## z
|
||||
#define glue3(x,y,z) glue3_aux(x,y,z)
|
||||
|
||||
#define DECLU(bits) glue3(uint,bits,_t) glue3(u,bits,) = glue3(UINT,bits,_C) (0);
|
||||
#define DECLI(bits) glue3(int,bits,_t) glue3(i,bits,) = glue3(INT,bits,_C) (0);
|
||||
|
||||
#define DECL(us,bits) glue3(DECL,us,) (bits)
|
||||
|
||||
#define TESTUMAX(bits) glue3(u,bits,) = ~glue3(u,bits,); if (glue3(UINT,bits,_MAX) != glue3(u,bits,)) printf ("Something wrong with UINT%d_MAX\n", bits)
|
||||
|
||||
#define REPORTERROR(msg) { err_n++; if (err_first <= 0) err_first = __LINE__; printf msg; }
|
||||
|
||||
#define X_SIZE_MAX ((size_t)-1)
|
||||
|
||||
int main () {
|
||||
int err_n = 0;
|
||||
int err_first = 0;
|
||||
DECL(I,8)
|
||||
DECL(U,8)
|
||||
DECL(I,16)
|
||||
DECL(U,16)
|
||||
DECL(I,32)
|
||||
DECL(U,32)
|
||||
#ifdef INT64_MAX
|
||||
DECL(I,64)
|
||||
DECL(U,64)
|
||||
#endif
|
||||
intmax_t imax = INTMAX_C(0);
|
||||
uintmax_t umax = UINTMAX_C(0);
|
||||
char str0[256], str1[256];
|
||||
|
||||
sprintf (str0, "%" PRINTF_INT32_MODIFIER "d", INT32_C(2147483647));
|
||||
if (0 != strcmp (str0, "2147483647")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0));
|
||||
if (atoi(PRINTF_INT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_INT32_DEC_WIDTH : %s\n", PRINTF_INT32_DEC_WIDTH));
|
||||
sprintf (str0, "%" PRINTF_INT32_MODIFIER "u", UINT32_C(4294967295));
|
||||
if (0 != strcmp (str0, "4294967295")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0));
|
||||
if (atoi(PRINTF_UINT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_UINT32_DEC_WIDTH : %s\n", PRINTF_UINT32_DEC_WIDTH));
|
||||
#ifdef INT64_MAX
|
||||
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d", INT64_C(9223372036854775807));
|
||||
if (0 != strcmp (str1, "9223372036854775807")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1));
|
||||
if (atoi(PRINTF_INT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_INT64_DEC_WIDTH : %s, %d\n", PRINTF_INT64_DEC_WIDTH, (int) strlen(str1)));
|
||||
sprintf (str1, "%" PRINTF_INT64_MODIFIER "u", UINT64_C(18446744073709550591));
|
||||
if (0 != strcmp (str1, "18446744073709550591")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1));
|
||||
if (atoi(PRINTF_UINT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_UINT64_DEC_WIDTH : %s, %d\n", PRINTF_UINT64_DEC_WIDTH, (int) strlen(str1)));
|
||||
#endif
|
||||
|
||||
sprintf (str0, "%d %x\n", 0, ~0);
|
||||
|
||||
sprintf (str1, "%d %x\n", i8, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i8 : %s\n", str1));
|
||||
sprintf (str1, "%u %x\n", u8, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u8 : %s\n", str1));
|
||||
sprintf (str1, "%d %x\n", i16, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i16 : %s\n", str1));
|
||||
sprintf (str1, "%u %x\n", u16, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u16 : %s\n", str1));
|
||||
sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n", i32, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i32 : %s\n", str1));
|
||||
sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n", u32, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u32 : %s\n", str1));
|
||||
#ifdef INT64_MAX
|
||||
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n", i64, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i64 : %s\n", str1));
|
||||
#endif
|
||||
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n", imax, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with imax : %s\n", str1));
|
||||
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n", umax, ~0);
|
||||
if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with umax : %s\n", str1));
|
||||
|
||||
TESTUMAX(8);
|
||||
TESTUMAX(16);
|
||||
TESTUMAX(32);
|
||||
#ifdef INT64_MAX
|
||||
TESTUMAX(64);
|
||||
#endif
|
||||
|
||||
#define STR(v) #v
|
||||
#define Q(v) printf ("sizeof " STR(v) " = %u\n", (unsigned) sizeof (v));
|
||||
if (err_n) {
|
||||
printf ("pstdint.h is not correct. Please use sizes below to correct it:\n");
|
||||
}
|
||||
|
||||
Q(int)
|
||||
Q(unsigned)
|
||||
Q(long int)
|
||||
Q(short int)
|
||||
Q(int8_t)
|
||||
Q(int16_t)
|
||||
Q(int32_t)
|
||||
#ifdef INT64_MAX
|
||||
Q(int64_t)
|
||||
#endif
|
||||
|
||||
#if UINT_MAX < X_SIZE_MAX
|
||||
printf ("UINT_MAX < X_SIZE_MAX\n");
|
||||
#else
|
||||
printf ("UINT_MAX >= X_SIZE_MAX\n");
|
||||
#endif
|
||||
printf ("%" PRINTF_INT64_MODIFIER "u vs %" PRINTF_INT64_MODIFIER "u\n", UINT_MAX, X_SIZE_MAX);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
#endif
|
||||
+2
-6
@@ -21,19 +21,15 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
extern void * memchr(const void *s, int c, size_t n);
|
||||
#else
|
||||
extern char * memchr(const void *s, int c, size_t n);
|
||||
#endif
|
||||
extern int memcmp(const void *s1, const void *s2, size_t n);
|
||||
extern char * memcpy(void *t, const void *f, size_t n);
|
||||
extern void * memcpy(void *t, const void *f, size_t n);
|
||||
#ifdef NO_MEMMOVE
|
||||
#define memmove(d,s,n) (bcopy((s), (d), (n)))
|
||||
#else
|
||||
extern char * memmove(void *t, const void *f, size_t n);
|
||||
#endif
|
||||
extern char * memset(void *s, int c, size_t n);
|
||||
extern void * memset(void *s, int c, size_t n);
|
||||
|
||||
extern int strcasecmp(const char *s1, const char *s2);
|
||||
extern char * strcat(char *dst, const char *src);
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* unistd.h --
|
||||
*
|
||||
* Macros, constants and prototypes for Posix conformance.
|
||||
*
|
||||
* Copyright 1989 Regents of the University of California Permission to use,
|
||||
* copy, modify, and distribute this software and its documentation for any
|
||||
* purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies. The University of California makes
|
||||
* no representations about the suitability of this software for any purpose.
|
||||
* It is provided "as is" without express or implied warranty.
|
||||
*/
|
||||
|
||||
#ifndef _UNISTD
|
||||
#define _UNISTD
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef NULL
|
||||
# define NULL 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Strict POSIX stuff goes here. Extensions go down below, in the ifndef
|
||||
* _POSIX_SOURCE section.
|
||||
*/
|
||||
|
||||
extern void _exit(int status);
|
||||
extern int access(const char *path, int mode);
|
||||
extern int chdir(const char *path);
|
||||
extern int chown(const char *path, uid_t owner, gid_t group);
|
||||
extern int close(int fd);
|
||||
extern int dup(int oldfd);
|
||||
extern int dup2(int oldfd, int newfd);
|
||||
extern int execl(const char *path, ...);
|
||||
extern int execle(const char *path, ...);
|
||||
extern int execlp(const char *file, ...);
|
||||
extern int execv(const char *path, char *const argv[]);
|
||||
extern int execve(const char *path, char *const argv[], char *const *envp);
|
||||
extern int execvp(const char *file, char *const argv[]);
|
||||
extern pid_t fork(void);
|
||||
extern char * getcwd(char *buf, size_t size);
|
||||
extern gid_t getegid(void);
|
||||
extern uid_t geteuid(void);
|
||||
extern gid_t getgid(void);
|
||||
extern int getgroups(int bufSize, int *buffer);
|
||||
extern pid_t getpid(void);
|
||||
extern uid_t getuid(void);
|
||||
extern int isatty(int fd);
|
||||
extern long lseek(int fd, long offset, int whence);
|
||||
extern int pipe(int *fildes);
|
||||
extern int read(int fd, char *buf, size_t size);
|
||||
extern int setgid(gid_t group);
|
||||
extern int setuid(uid_t user);
|
||||
extern unsigned sleep(unsigned seconds);
|
||||
extern char * ttyname(int fd);
|
||||
extern int unlink(const char *path);
|
||||
extern int write(int fd, const char *buf, size_t size);
|
||||
|
||||
#ifndef _POSIX_SOURCE
|
||||
extern char * crypt(const char *, const char *);
|
||||
extern int fchown(int fd, uid_t owner, gid_t group);
|
||||
extern int flock(int fd, int operation);
|
||||
extern int ftruncate(int fd, unsigned long length);
|
||||
extern int ioctl(int fd, int request, ...);
|
||||
extern int readlink(const char *path, char *buf, int bufsize);
|
||||
extern int setegid(gid_t group);
|
||||
extern int seteuid(uid_t user);
|
||||
extern int setreuid(int ruid, int euid);
|
||||
extern int symlink(const char *, const char *);
|
||||
extern int ttyslot(void);
|
||||
extern int truncate(const char *path, unsigned long length);
|
||||
extern int vfork(void);
|
||||
#endif /* _POSIX_SOURCE */
|
||||
|
||||
#endif /* _UNISTD */
|
||||
+2
-2
@@ -100,7 +100,7 @@ waitpid(
|
||||
} else {
|
||||
prevPtr->nextPtr = waitPtr->nextPtr;
|
||||
}
|
||||
ckfree((char *) 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;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+24
-13
@@ -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)
|
||||
@@ -56,14 +54,14 @@ For \fBTcl_AddObjErrorInfo\fR,
|
||||
this points to the first byte of an array of \fIlength\fR bytes
|
||||
containing a string to append to the \fB\-errorinfo\fR return option.
|
||||
This byte array may contain embedded null bytes
|
||||
unless \fIlength\fR is negative.
|
||||
unless \fIlength\fR is TCL_INDEX_NONE.
|
||||
.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 TCL_INDEX_NONE, 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 "const char" *element in
|
||||
@@ -78,8 +76,8 @@ The line number of a script where an error occurred.
|
||||
Pointer to first character in script containing command (must be <= command)
|
||||
.AP "const char" *command in
|
||||
Pointer to first character in command that generated the error
|
||||
.AP int commandLength in
|
||||
Number of bytes in command; -1 means use all bytes up to first null byte
|
||||
.AP size_t commandLength in
|
||||
Number of bytes in command; TCL_INDEX_NONE means use all bytes up to first null byte
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
@@ -119,7 +117,7 @@ retrieve the stack trace when script evaluation returns
|
||||
\fBTCL_ERROR\fR, like so:
|
||||
.PP
|
||||
.CS
|
||||
int code = Tcl_Eval(interp, script);
|
||||
int code = Tcl_EvalEx(interp, script, -1, 0);
|
||||
if (code == TCL_ERROR) {
|
||||
Tcl_Obj *options = \fBTcl_GetReturnOptions\fR(interp, code);
|
||||
Tcl_Obj *key = Tcl_NewStringObj("-errorinfo", -1);
|
||||
@@ -229,7 +227,7 @@ embedded null bytes. This is essentially never a good idea.
|
||||
If the \fImessage\fR needs to contain the null character \fBU+0000\fR,
|
||||
Tcl's usual internal encoding rules should be used to avoid
|
||||
the need for a null byte. If the \fBTcl_AddObjErrorInfo\fR
|
||||
interface is used at all, it should be with a negative \fIlength\fR value.
|
||||
interface is used at all, it should be with a TCL_INDEX_NONE \fIlength\fR value.
|
||||
.PP
|
||||
The procedure \fBTcl_SetObjErrorCode\fR is used to set the
|
||||
\fB\-errorcode\fR return option to the list value \fIerrorObjPtr\fR
|
||||
@@ -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
|
||||
@@ -305,6 +300,22 @@ The global variables \fBerrorInfo\fR and
|
||||
\fBerrorCode\fR are not modified by \fBTcl_ResetResult\fR
|
||||
so they continue to hold a record of information about the
|
||||
most recent error seen in an interpreter.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The result of \fBTcl_GetReturnOptions\fR will have at least one
|
||||
reference to it from the Tcl interpreter. If not using it immediately,
|
||||
you should use \fBTcl_IncrRefCount\fR to add your own reference.
|
||||
.PP
|
||||
The \fIoptions\fR argument to \fBTcl_SetReturnOptions\fR will have a
|
||||
reference added by the Tcl interpreter; it may safely be called with a
|
||||
zero-reference value.
|
||||
.PP
|
||||
\fBTcl_AppendObjToErrorInfo\fR only reads its \fIobjPtr\fR argument;
|
||||
it does not modify its reference count at all.
|
||||
.PP
|
||||
The \fIerrorObjPtr\fR argument to \fBTcl_SetObjErrorCode\fR will have a
|
||||
reference added by the Tcl interpreter; it may safely be called with a
|
||||
zero-reference value.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_DecrRefCount(3), Tcl_IncrRefCount(3), Tcl_Interp(3), Tcl_ResetResult(3),
|
||||
Tcl_SetErrno(3), errorCode(n), errorInfo(n)
|
||||
|
||||
+13
-29
@@ -4,11 +4,11 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_Alloc 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_Alloc 3 9.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc, Tcl_GetMemoryInfo, ckalloc, ckfree, ckrealloc, attemptckalloc, attemptckrealloc \- allocate or free heap memory
|
||||
Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc, Tcl_GetMemoryInfo \- allocate or free heap memory
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -19,32 +19,17 @@ 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
|
||||
void
|
||||
\fBTcl_GetMemoryInfo\fR(\fIdsPtr\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
|
||||
@@ -84,18 +69,17 @@ 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.
|
||||
|
||||
\fBTcl_GetMemoryInfo\fR appends a list-of-lists of memory stats to the
|
||||
provided DString. This function cannot be used in stub-enabled extensions,
|
||||
and it is only available if Tcl is compiled with the threaded memory allocator.
|
||||
and it is only available if Tcl is compiled with the threaded memory allocator
|
||||
When used in stub-enabled embedders, the stubs table must be first initialized
|
||||
using one of \fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR,
|
||||
\fBTcl_FindExecutable\fR or \fBTclZipfs_AppHook\fR.
|
||||
|
||||
.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
|
||||
|
||||
+25
-14
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_AsyncCreate, Tcl_AsyncMark, Tcl_AsyncInvoke, Tcl_AsyncDelete, Tcl_AsyncReady \- handle asynchronous events
|
||||
Tcl_AsyncCreate, Tcl_AsyncMark, Tcl_AsyncMarkFromSignal, Tcl_AsyncInvoke, Tcl_AsyncDelete, Tcl_AsyncReady \- handle asynchronous events
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -17,11 +17,16 @@ Tcl_AsyncCreate, Tcl_AsyncMark, Tcl_AsyncInvoke, Tcl_AsyncDelete, Tcl_AsyncReady
|
||||
Tcl_AsyncHandler
|
||||
\fBTcl_AsyncCreate\fR(\fIproc, clientData\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_AsyncMark\fR(\fIasync\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_AsyncMarkFromSignal\fR(\fIasync\fR, \fIsigNumber\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_AsyncInvoke\fR(\fIinterp, code\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_AsyncDelete\fR(\fIasync\fR)
|
||||
.sp
|
||||
int
|
||||
@@ -30,10 +35,12 @@ 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.
|
||||
.AP int sigNumber in
|
||||
POSIX signal number, when used in a signal context.
|
||||
.AP Tcl_Interp *interp in
|
||||
Tcl interpreter in which command was being evaluated when handler was
|
||||
invoked, or NULL if handler was invoked when there was no interpreter
|
||||
@@ -60,10 +67,11 @@ to a clean state, such as after the current Tcl command completes.
|
||||
.PP
|
||||
\fBTcl_AsyncCreate\fR, \fBTcl_AsyncDelete\fR, and \fBTcl_AsyncReady\fR
|
||||
are thread sensitive. They access and/or set a thread-specific data
|
||||
structure in the event of a core built with \fI\-\-enable\-threads\fR. The token
|
||||
created by \fBTcl_AsyncCreate\fR contains the needed thread information it
|
||||
was called from so that calling \fBTcl_AsyncMark\fR(\fItoken\fR) will only yield
|
||||
the origin thread into the asynchronous handler.
|
||||
structure in the event of a core built with \fI\-\-enable\-threads\fR.
|
||||
The token created by \fBTcl_AsyncCreate\fR contains the needed thread
|
||||
information it was called from so that calling \fBTcl_AsyncMarkFromSignal\fR
|
||||
or \fBTcl_AsyncMark\fR with this token will only yield the origin
|
||||
thread into the asynchronous handler.
|
||||
.PP
|
||||
\fBTcl_AsyncCreate\fR creates an asynchronous handler and returns
|
||||
a token for it.
|
||||
@@ -72,19 +80,22 @@ any occurrences of the asynchronous event that it is intended
|
||||
to handle (it is not safe to create a handler at the time of
|
||||
an event).
|
||||
When an asynchronous event occurs the code that detects the event
|
||||
(such as a signal handler) should call \fBTcl_AsyncMark\fR with the
|
||||
token for the handler.
|
||||
\fBTcl_AsyncMark\fR will mark the handler as ready to execute, but it
|
||||
will not invoke the handler immediately.
|
||||
Tcl will call the \fIproc\fR associated with the handler later, when
|
||||
the world is in a safe state, and \fIproc\fR can then carry out
|
||||
the actions associated with the asynchronous event.
|
||||
(such as a POSIX signal handler) should call \fBTcl_AsyncMarkFromSignal\fR
|
||||
with the token for the handler and the POSIX signal number. The
|
||||
return value of this function is true, when the handler will be
|
||||
marked, false otherwise.
|
||||
For non-signal contexts, \fBTcl_AsyncMark\fR serves the same purpose.
|
||||
\fBTcl_AsyncMarkFromSignal\fR and \fBTcl_AsyncMark\fR will mark
|
||||
the handler as ready to execute, but will not invoke the handler
|
||||
immediately. Tcl will call the \fIproc\fR associated with the
|
||||
handler later, when the world is in a safe state, and \fIproc\fR
|
||||
can then carry out the actions associated with the asynchronous event.
|
||||
\fIProc\fR should have arguments and result that match the
|
||||
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 "const 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
|
||||
+34
-7
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_NewBooleanObj, Tcl_SetBooleanObj, Tcl_GetBooleanFromObj \- store/retrieve boolean value in a Tcl_Obj
|
||||
Tcl_NewBooleanObj, Tcl_SetBooleanObj, Tcl_GetBooleanFromObj, Tcl_GetBoolFromObj \- store/retrieve boolean value in a Tcl_Obj
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -20,7 +20,10 @@ Tcl_Obj *
|
||||
\fBTcl_SetBooleanObj\fR(\fIobjPtr, intValue\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetBooleanFromObj\fR(\fIinterp, objPtr, intPtr\fR)
|
||||
\fBTcl_GetBooleanFromObj\fR(\fIinterp, objPtr, boolPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetBoolFromObj\fR(\fIinterp, objPtr, flags. charPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp intValue in/out
|
||||
.AP int intValue in
|
||||
@@ -32,9 +35,16 @@ retrieve a boolean value.
|
||||
If a boolean value cannot be retrieved,
|
||||
an error message is left in the interpreter's result value
|
||||
unless \fIinterp\fR is NULL.
|
||||
.AP int *intPtr out
|
||||
.AP "bool \&| int" *boolPtr out
|
||||
Points to place where \fBTcl_GetBooleanFromObj\fR
|
||||
stores the boolean value (0 or 1) obtained from \fIobjPtr\fR.
|
||||
.AP char *charPtr out
|
||||
Points to place where \fBTcl_GetBoolFromObj\fR
|
||||
stores the boolean value (0 or 1) obtained from \fIobjPtr\fR.
|
||||
.AP int flags in
|
||||
0 or TCL_NULL_OK. If TCL_NULL_OK
|
||||
is used, then the empty string or NULL will result in \fBTcl_GetBoolFromObj\fR
|
||||
return TCL_OK, the *charPtr filled with the value \fB'\exFF'\fR;
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
@@ -61,13 +71,13 @@ any former value stored in \fI*objPtr\fR.
|
||||
from the value stored in \fI*objPtr\fR.
|
||||
If \fIobjPtr\fR holds a string value recognized by \fBTcl_GetBoolean\fR,
|
||||
then the recognized boolean value is written at the address given
|
||||
by \fIintPtr\fR.
|
||||
by \fIboolPtr\fR.
|
||||
If \fIobjPtr\fR holds any value recognized as
|
||||
a number by Tcl, then if that value is zero a 0 is written at
|
||||
the address given by \fIintPtr\fR and if that
|
||||
value is non-zero a 1 is written at the address given by \fIintPtr\fR.
|
||||
the address given by \fIboolPtr\fR and if that
|
||||
value is non-zero a 1 is written at the address given by \fIboolPtr\fR.
|
||||
In all cases where a value is written at the address given
|
||||
by \fIintPtr\fR, \fBTcl_GetBooleanFromObj\fR returns \fBTCL_OK\fR.
|
||||
by \fIboolPtr\fR, \fBTcl_GetBooleanFromObj\fR returns \fBTCL_OK\fR.
|
||||
If the value of \fIobjPtr\fR does not meet any of the conditions
|
||||
above, then \fBTCL_ERROR\fR is returned and an error message is
|
||||
left in the interpreter's result unless \fIinterp\fR is NULL.
|
||||
@@ -76,6 +86,11 @@ fields of \fI*objPtr\fR so that future calls to
|
||||
\fBTcl_GetBooleanFromObj\fR on the same \fIobjPtr\fR can be
|
||||
performed more efficiently.
|
||||
.PP
|
||||
\fBTcl_GetBoolFromObj\fR functions almost the same as
|
||||
\fBTcl_GetBooleanFromObj\fR, but it has an additional parameter
|
||||
\fBflags\fR, which can be used to specify whether the empty
|
||||
string or NULL is accepted as valid.
|
||||
.PP
|
||||
Note that the routines \fBTcl_GetBooleanFromObj\fR and
|
||||
\fBTcl_GetBoolean\fR are not functional equivalents.
|
||||
The set of values for which \fBTcl_GetBooleanFromObj\fR
|
||||
@@ -88,6 +103,18 @@ will lead to a \fBTCL_OK\fR return (and the boolean value 1),
|
||||
while the same value passed to \fBTcl_GetBoolean\fR will lead to
|
||||
a \fBTCL_ERROR\fR return.
|
||||
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_NewBooleanObj\fR always returns a zero-reference object, much
|
||||
like \fBTcl_NewObj\fR.
|
||||
.PP
|
||||
\fBTcl_SetBooleanObj\fR does not modify the reference count of its
|
||||
\fIobjPtr\fR argument, but does require that the object be unshared.
|
||||
.PP
|
||||
\fBTcl_GetBooleanFromObj\fR does not modify the reference count of its
|
||||
\fIobjPtr\fR argument; it only reads. Note however that this function
|
||||
may set the interpreter result; if that is the only place that
|
||||
is holding a reference to the object, it will be deleted.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_NewObj, Tcl_IsShared, Tcl_GetBoolean
|
||||
|
||||
|
||||
+139
-54
@@ -4,88 +4,173 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_ByteArrayObj 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_ByteArrayObj 3 9.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength \- manipulate Tcl values as a arrays of bytes
|
||||
Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetBytesFromObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength \- manipulate a Tcl value as an array of bytes
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_NewByteArrayObj\fR(\fIbytes, length\fR)
|
||||
\fBTcl_NewByteArrayObj\fR(\fIbytes, numBytes\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_SetByteArrayObj\fR(\fIobjPtr, bytes, length\fR)
|
||||
\fBTcl_SetByteArrayObj\fR(\fIobjPtr, bytes, numBytes\fR)
|
||||
.sp
|
||||
.VS TIP568
|
||||
unsigned char *
|
||||
\fBTcl_GetBytesFromObj\fR(\fIinterp, objPtr, numBytesPtr\fR)
|
||||
.VE TIP568
|
||||
.sp
|
||||
unsigned char *
|
||||
\fBTcl_GetByteArrayFromObj\fR(\fIobjPtr, lengthPtr\fR)
|
||||
\fBTcl_GetByteArrayFromObj\fR(\fIobjPtr, numBytesPtr\fR)
|
||||
.sp
|
||||
unsigned char *
|
||||
\fBTcl_SetByteArrayLength\fR(\fIobjPtr, length\fR)
|
||||
\fBTcl_SetByteArrayLength\fR(\fIobjPtr, numBytes\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "const unsigned char" *lengthPtr in/out
|
||||
.AS "const unsigned char" *numBytesPtr in/out
|
||||
.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.
|
||||
even if \fInumBytes\fR is non-zero.
|
||||
.AP size_t numBytes in
|
||||
The number of bytes in the array.
|
||||
.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
|
||||
\fBTcl_SetByteArrayLength\fR, this points to the value from which to get
|
||||
the byte-array value; if \fIobjPtr\fR does not already point to a byte-array
|
||||
value, it will be converted to one.
|
||||
.AP int *lengthPtr out
|
||||
If non-NULL, filled with the length of the array of bytes in the value.
|
||||
For \fBTcl_SetByteArrayObj\fR, this points to an unshared value to be
|
||||
overwritten by a byte-array value. For \fBTcl_GetBytesFromObj\fR,
|
||||
\fBTcl_GetByteArrayFromObj\fR and \fBTcl_SetByteArrayLength\fR, this points
|
||||
to the value from which to extract an array of bytes.
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting.
|
||||
.AP "size_t \&| int" *numBytesPtr out
|
||||
Points to space where the number of bytes in the array may be written.
|
||||
Caller may pass NULL when it does not need this information.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are used to create, modify, and read Tcl byte-array values
|
||||
from C code. Byte-array values are typically used to hold the
|
||||
results of binary IO operations or data structures created with the
|
||||
\fBbinary\fR command. In Tcl, an array of bytes is not equivalent to a
|
||||
string. Conceptually, a string is an array of Unicode characters, while a
|
||||
byte-array is an array of 8-bit quantities with no implicit meaning.
|
||||
Accessor functions are provided to get the string representation of a
|
||||
byte-array or to convert an arbitrary value to a byte-array. Obtaining the
|
||||
These routines are used to create, modify, store, transfer, and retrieve
|
||||
arbitrary binary data in Tcl values. Specifically, data that can be
|
||||
represented as a sequence of arbitrary byte values is supported.
|
||||
This includes data read from binary channels, values created by the
|
||||
\fBbinary\fR command, encrypted data, or other information representable as
|
||||
a finite byte sequence.
|
||||
.PP
|
||||
A byte is an 8-bit quantity with no inherent meaning. When the 8 bits are
|
||||
interpreted as an integer value, the range of possible values is (0-255).
|
||||
The C type best suited to store a byte is the \fBunsigned char\fR.
|
||||
An \fBunsigned char\fR array of size \fIN\fR stores an aribtrary binary
|
||||
value of size \fIN\fR bytes. We call this representation a byte-array.
|
||||
Here we document the routines that allow us to operate on Tcl values as
|
||||
byte-arrays.
|
||||
.PP
|
||||
All Tcl values must correspond to a string representation.
|
||||
When a byte-array value must be processed as a string, the sequence
|
||||
of \fIN\fR bytes is transformed into the corresponding sequence
|
||||
of \fIN\fR characters, where each byte value transforms to the same
|
||||
character codepoint value in the range (U+0000 - U+00FF). Obtaining the
|
||||
string representation of a byte-array value (by calling
|
||||
\fBTcl_GetStringFromObj\fR) produces a properly formed UTF-8 sequence with a
|
||||
one-to-one mapping between the bytes in the internal representation and the
|
||||
UTF-8 characters in the string representation.
|
||||
\fBTcl_GetStringFromObj\fR) produces this string in Tcl's usual
|
||||
Modified UTF-8 encoding.
|
||||
.PP
|
||||
\fBTcl_NewByteArrayObj\fR and \fBTcl_SetByteArrayObj\fR will
|
||||
create a new value of byte-array type or modify an existing value to have a
|
||||
byte-array type. Both of these procedures set the value's type to be
|
||||
byte-array and set the value's internal representation to a copy of the
|
||||
array of bytes given by \fIbytes\fR. \fBTcl_NewByteArrayObj\fR returns a
|
||||
pointer to a newly allocated value with a reference count of zero.
|
||||
\fBTcl_SetByteArrayObj\fR invalidates any old string representation and, if
|
||||
the value is not already a byte-array value, frees any old internal
|
||||
representation. If \fIbytes\fR is NULL then the new byte array contains
|
||||
arbitrary values.
|
||||
\fBTcl_NewByteArrayObj\fR and \fBTcl_SetByteArrayObj\fR
|
||||
create a new value or overwrite an existing unshared value, respectively,
|
||||
to hold a byte-array value of \fInumBytes\fR bytes. When a caller
|
||||
passes a non-NULL value of \fIbytes\fR, it must point to memory from
|
||||
which \fInumBytes\fR bytes can be read. These routines
|
||||
allocate \fInumBytes\fR bytes of memory, copy \fInumBytes\fR
|
||||
bytes from \fIbytes\fR into it, and keep the result in the internal
|
||||
representation of the new or overwritten value.
|
||||
When the caller passes a NULL value of \fIbytes\fR, the data copying
|
||||
step is skipped, and the bytes stored in the value are undefined.
|
||||
A \fIbytes\fR value of NULL is useful only when the caller will arrange
|
||||
to write known contents into the byte-array through a pointer retrieved
|
||||
by a call to one of the routines explained below. \fBTcl_NewByteArrayObj\fR
|
||||
returns a pointer to the created value with a reference count of zero.
|
||||
\fBTcl_SetByteArrayObj\fR overwrites and invalidates any old contents
|
||||
of the unshared \fIobjPtr\fR as appropriate, and keeps its reference
|
||||
count (0 or 1) unchanged. The value produced by these routines has no
|
||||
string representation. Any memory allocation failure may cause a panic.
|
||||
.PP
|
||||
\fBTcl_GetByteArrayFromObj\fR converts a Tcl value to byte-array type and
|
||||
returns a pointer to the value's new internal representation as an array of
|
||||
bytes. The length of this array is stored in \fIlengthPtr\fR if
|
||||
\fIlengthPtr\fR is non-NULL. The storage for the array of bytes is owned by
|
||||
the value and should not be freed. The contents of the array may be
|
||||
modified by the caller only if the value is not shared and the caller
|
||||
invalidates the string representation.
|
||||
\fBTcl_GetBytesFromObj\fR performs the opposite function of
|
||||
\fBTcl_SetByteArrayObj\fR, providing access to read a byte-array from
|
||||
a Tcl value that was previously written into it. When \fIobjPtr\fR
|
||||
is a value previously produced by \fBTcl_NewByteArrayObj\fR or
|
||||
\fBTcl_SetByteArrayObj\fR, then \fBTcl_GetBytesFromObj\fR returns
|
||||
a pointer to the byte-array kept in the value's internal representation.
|
||||
If the caller provides a non-NULL value for \fInumBytesPtr\fR, it must
|
||||
point to memory where \fBTcl_GetBytesFromObj\fR can write the number
|
||||
of bytes in the value's internal byte-array. With both pieces of
|
||||
information, the caller is able to retrieve any information about the
|
||||
contents of that byte-array that it seeks. When \fIobjPtr\fR does
|
||||
not already contain an internal byte-array, \fBTcl_GetBytesFromObj\fR
|
||||
will try to create one from the value's string representation. Any
|
||||
string value that does not include any character codepoints outside
|
||||
the range (U+0000 - U+00FF) will successfully translate to a unique
|
||||
byte-array value. With the created byte-array, the routine returns
|
||||
as before. For any string representation which does contain
|
||||
a forbidden character codepoint, the conversion fails, and
|
||||
\fBTcl_GetBytesFromObj\fR returns NULL to signal that failure. On
|
||||
failure, nothing will be written to \fInumBytesPtr\fR, and if
|
||||
the \fIinterp\fR argument is non-NULL, then error messages and
|
||||
codes are left in it recording the error.
|
||||
.PP
|
||||
\fBTcl_SetByteArrayLength\fR converts the Tcl value to byte-array type
|
||||
and changes the length of the value's internal representation as an
|
||||
array of bytes. If \fIlength\fR is greater than the space currently
|
||||
allocated for the array, the array is reallocated to the new length; the
|
||||
newly allocated bytes at the end of the array have arbitrary values. If
|
||||
\fIlength\fR is less than the space currently allocated for the array,
|
||||
the length of array is reduced to the new length. The return value is a
|
||||
pointer to the value's new array of bytes.
|
||||
\fBTcl_GetByteArrayFromObj\fR performs exactly the same function as
|
||||
\fBTcl_GetBytesFromObj\fR does when called with the \fIinterp\fR
|
||||
argument passed the value NULL. This is incompatible with the
|
||||
way \fBTcl_GetByteArrayFromObj\fR functioned in Tcl 8.
|
||||
\fBTcl_GetBytesFromObj\fR is the more capable interface and should
|
||||
usually be favored for use over \fBTcl_GetByteArrayFromObj\fR.
|
||||
.PP
|
||||
On success, both \fBTcl_GetByteFromObj\fR and \fBTcl_GetByteArrayFromObj\fR
|
||||
return a pointer into the internal representation of a \fBTcl_Obj\fR.
|
||||
That pointer must not be freed by the caller, and should not be retained
|
||||
for use beyond the known time the internal representation of the value
|
||||
has not been disturbed. The pointer may be used to overwrite the byte
|
||||
contents of the internal representation, so long as the value is unshared
|
||||
and any string representation is invalidated.
|
||||
.PP
|
||||
On success, both \fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR
|
||||
write the number of bytes in the byte-array value of \fIobjPtr\fR
|
||||
to the space pointed to by \fInumBytesPtr\fR. This space may be of type
|
||||
\fBsize_t\fR or of type \fBint\fR. It is recommended that callers provide
|
||||
a \fBsize_t\fR space for this purpose. If the caller provides only
|
||||
an \fBint\fR space and the number of bytes in the byte-array value of
|
||||
\fIobjPtr\fR is greater than \fBINT_MAX\fR, the routine will fail due
|
||||
to being unable to correctly report the byte-array size to the caller.
|
||||
The ability to provide an \fBint\fR space is best considered a migration
|
||||
aid for codebases constrained to continue operating with Tcl releases
|
||||
older than 8.7.
|
||||
.PP
|
||||
\fBTcl_SetByteArrayLength\fR enables a caller to change the size of a
|
||||
byte-array in the internal representation of an unshared \fIobjPtr\fR to
|
||||
become \fInumBytes\fR bytes. This is most often useful after the
|
||||
bytes of the internal byte-array have been directly overwritten and it
|
||||
has been discovered that the required size differs from the first
|
||||
estimate used in the allocation. \fBTcl_SetByteArrayLength\fR returns
|
||||
a pointer to the resized byte-array. Because resizing the byte-array
|
||||
changes the internal representation, \fBTcl_SetByteArrayLength\fR
|
||||
also invalidates any string representation in \fIobjPtr\fR. If resizing
|
||||
grows the byte-array, the new byte values are undefined. If \fIobjPtr\fR
|
||||
does not already possess an internal byte-array, one is produced in the
|
||||
same way that \fBTcl_GetBytesFromObj\fR does, also returning NULL
|
||||
when any characters of the value in \fIobjPtr\fR (up to
|
||||
\fInumBytes\fR of them) are not valid bytes.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_NewByteArrayObj\fR always returns a zero-reference object, much
|
||||
like \fBTcl_NewObj\fR.
|
||||
.PP
|
||||
\fBTcl_SetByteArrayObj\fR and \fBTcl_SetByteArrayLength\fR do not modify the
|
||||
reference count of their \fIobjPtr\fR arguments, but do require that the
|
||||
object be unshared.
|
||||
.PP
|
||||
\fBTcl_GetBytesFromObj\fR and \fBTcl_GetByteArrayFromObj\fR do not modify
|
||||
the reference count of \fIobjPtr\fR; they only read.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tcl_GetStringFromObj, Tcl_NewObj, Tcl_IncrRefCount, Tcl_DecrRefCount
|
||||
|
||||
.SH KEYWORDS
|
||||
value, binary data, byte array, utf, unicode, internationalization
|
||||
value, binary data, byte array, utf, unicode
|
||||
|
||||
+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
|
||||
|
||||
+9
-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
|
||||
@@ -67,6 +67,14 @@ other procedures. If an error is returned and this bit is set in
|
||||
result, where it can be retrieved with \fBTcl_GetObjResult\fR or
|
||||
\fBTcl_GetStringResult\fR. If this flag bit is not set then no error
|
||||
message is left and the interpreter's result will not be modified.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_CancelEval\fR always decrements the reference count of its
|
||||
\fIresultObjPtr\fR argument (if that is non-NULL). It is expected to
|
||||
be usually called with an object with zero reference count. If the
|
||||
object is shared with some other location (including the Tcl
|
||||
evaluation stack) it should have its reference count incremented
|
||||
before calling this function.
|
||||
.SH "SEE ALSO"
|
||||
interp(n), Tcl_Eval(3),
|
||||
TIP 285
|
||||
|
||||
+3
-6
@@ -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
|
||||
@@ -49,11 +49,8 @@ I/O channels. Examples include compression and encryption modules. These
|
||||
functions transparently stack and unstack a new channel on top of an
|
||||
existing one. Any number of channels can be stacked together.
|
||||
.PP
|
||||
The implementation of the Tcl channel code was rewritten in 8.3.2 to
|
||||
correct some problems with the previous implementation with regard to
|
||||
stacked channels. Anyone using stacked channels or creating stacked
|
||||
channel drivers should update to the new \fBTCL_CHANNEL_VERSION_2\fR
|
||||
\fBTcl_ChannelType\fR structure. See \fBTcl_CreateChannel\fR for details.
|
||||
The \fBTcl_ChannelType\fR version currently supported is
|
||||
\fBTCL_CHANNEL_VERSION_5\fR. See \fBTcl_CreateChannel\fR for details.
|
||||
.PP
|
||||
\fBTcl_StackChannel\fR stacks a new \fIchannel\fR on an existing channel
|
||||
with the same name that was registered for \fIchannel\fR by
|
||||
|
||||
+47
-9
@@ -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)
|
||||
@@ -55,8 +55,16 @@ Tcl_ObjectMapMethodNameProc
|
||||
\fBTcl_ObjectGetMethodNameMapper\fR(\fIobject\fR)
|
||||
.sp
|
||||
\fBTcl_ObjectSetMethodNameMapper\fR(\fIobject\fR, \fImethodNameMapper\fR)
|
||||
.sp
|
||||
.VS "TIP 605"
|
||||
Tcl_Class
|
||||
\fBTcl_GetClassOfObject\fR(\fIobject\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_GetObjectClassName\fR(\fIinterp\fR, \fIobject\fR)
|
||||
.VE "TIP 605"
|
||||
.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.
|
||||
@@ -73,11 +81,11 @@ automatically selected.
|
||||
The name of the namespace to create for the object's private use, or NULL if a
|
||||
new unused name is to be automatically selected. The namespace must not
|
||||
already exist.
|
||||
.AP int objc in
|
||||
.AP size_t objc in
|
||||
The number of elements in the \fIobjv\fR array.
|
||||
.AP "Tcl_Obj *const" *objv in
|
||||
The arguments to the command to create the instance of the class.
|
||||
.AP int skip in
|
||||
.AP size_t skip in
|
||||
The number of arguments at the start of the argument array, \fIobjv\fR, that
|
||||
are not arguments to any constructors. This allows the generation of correct
|
||||
error messages even when complicated calling patterns are used (e.g., via the
|
||||
@@ -85,7 +93,7 @@ error messages even when complicated calling patterns are used (e.g., via the
|
||||
.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
|
||||
@@ -114,6 +122,13 @@ function. Note that the Tcl_Obj reference returned by \fBTcl_GetObjectName\fR
|
||||
is a shared reference. You can also get whether the object has been marked for
|
||||
deletion with \fBTcl_ObjectDeleted\fR (it returns true if deletion of the
|
||||
object has begun); this can be useful during the processing of methods.
|
||||
.VS "TIP 605"
|
||||
The class of an object can be retrieved with \fBTcl_GetClassOfObject\fR, and
|
||||
the name of the class of an object with \fBTcl_GetObjectClassName\fR; note
|
||||
that these two \fImay\fR return NULL during deletion of an object (this is
|
||||
transient, and only occurs when the object is a long way through being
|
||||
deleted).
|
||||
.VE "TIP 605"
|
||||
.PP
|
||||
Instances of classes are created using \fBTcl_NewObjectInstance\fR, which
|
||||
creates an object from any class (and which is internally called by both
|
||||
@@ -185,7 +200,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
|
||||
@@ -198,8 +213,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
|
||||
@@ -241,6 +256,29 @@ NULL if the whole chain is to be processed (the argument itself is never
|
||||
NULL); this variable may be updated by the callback. The \fImethodNameObj\fR
|
||||
parameter gives an unshared object containing the name of the method being
|
||||
invoked, as provided by the user; this object may be updated by the callback.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The \fIobjPtr\fR argument to \fBTcl_GetObjectFromObj\fR will not have its
|
||||
reference count manipulated, but this function may modify the interpreter
|
||||
result (to report any error) so interpreter results should not be fed into
|
||||
this without an additional reference being used.
|
||||
.PP
|
||||
The result of \fBTcl_GetObjectName\fR is a value that is owned by the object
|
||||
that is regenerated when this function is first called after the object is
|
||||
renamed. If the value is to be retained at all, the caller should increment
|
||||
the reference count.
|
||||
.PP
|
||||
The first \fIobjc\fR values in the \fIobjv\fR argument to
|
||||
\fBTcl_NewObjectInstance\fR are the arguments to pass to the constructor. They
|
||||
must have a reference count of at least 1, and may have their reference counts
|
||||
changed during the running of the constructor. Constructors may modify the
|
||||
interpreter result, which consequently means that interpreter results should
|
||||
not be used as arguments without an additional reference being taken.
|
||||
.PP
|
||||
The \fImethodNameObj\fR argument to a Tcl_ObjectMapMethodNameProc
|
||||
implementation will be a value with a reference count of at least 1 where at
|
||||
least one reference is not held by the interpreter result. It is expected that
|
||||
method name mappers will only read their \fImethodNameObj\fR arguments.
|
||||
.SH "SEE ALSO"
|
||||
Method(3), oo::class(n), oo::copy(n), oo::define(n), oo::object(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ const char *
|
||||
\fBTcl_Concat\fR(\fIargc, argv\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "const char *const" argv[]
|
||||
.AP int argc in
|
||||
.AP size_t argc in
|
||||
Number of strings.
|
||||
.AP "const char *const" argv[] in
|
||||
Array of strings to concatenate. Must have \fIargc\fR entries.
|
||||
|
||||
+19
-53
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateChild, Tcl_CreateSlave, Tcl_GetChild, Tcl_GetSlave, Tcl_GetParent, Tcl_GetMaster, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands
|
||||
Tcl_IsSafe, Tcl_CreateChild, Tcl_GetChild, Tcl_GetParent, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -16,32 +16,14 @@ Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateChild, Tcl_CreateSlave, Tcl_GetChild, Tcl_Ge
|
||||
int
|
||||
\fBTcl_IsSafe\fR(\fIinterp\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_MakeSafe\fR(\fIinterp\fR)
|
||||
.sp
|
||||
.VS "TIP 581"
|
||||
Tcl_Interp *
|
||||
\fBTcl_CreateChild\fR(\fIinterp, name, isSafe\fR)
|
||||
.VE "TIP 581"
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_CreateSlave\fR(\fIinterp, name, isSafe\fR)
|
||||
.sp
|
||||
.VS "TIP 581"
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetChild\fR(\fIinterp, name\fR)
|
||||
.VE "TIP 581"
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetSlave\fR(\fIinterp, name\fR)
|
||||
.sp
|
||||
.VS "TIP 581"
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetParent\fR(\fIinterp\fR)
|
||||
.VE "TIP 581"
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetMaster\fR(\fIinterp\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetInterpPath\fR(\fIinterp, childInterp\fR)
|
||||
@@ -87,12 +69,12 @@ Name of source command for alias.
|
||||
Interpreter that contains the target command for an alias.
|
||||
.AP "const char" *targetCmd in
|
||||
Name of target command for alias in \fItargetInterp\fR.
|
||||
.AP int argc in
|
||||
.AP size_t argc in
|
||||
Count of additional arguments to pass to the alias command.
|
||||
.AP "const char *const" *argv in
|
||||
Vector of strings, the additional arguments to pass to the alias command.
|
||||
This storage is owned by the caller.
|
||||
.AP int objc in
|
||||
.AP size_t objc in
|
||||
Count of additional value arguments to pass to the aliased command.
|
||||
.AP Tcl_Obj **objv in
|
||||
Vector of Tcl_Obj structures, the additional value arguments to pass to
|
||||
@@ -136,8 +118,8 @@ interpreter. The return value for those procedures that return an \fBint\fR
|
||||
is either \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fBTCL_ERROR\fR is returned
|
||||
then the interpreter's result contains an error message.
|
||||
.PP
|
||||
\fBTcl_CreateSlave\fR creates a new interpreter as a child of \fIinterp\fR.
|
||||
It also creates a child command named \fIchildName\fR in \fIinterp\fR which
|
||||
\fBTcl_CreateChild\fR creates a new interpreter as a child of \fIinterp\fR.
|
||||
It also creates a child command named \fIname\fR in \fIinterp\fR which
|
||||
allows \fIinterp\fR to manipulate the new child.
|
||||
If \fIisSafe\fR is zero, the command creates a trusted child in which Tcl
|
||||
code has access to all the Tcl commands.
|
||||
@@ -148,43 +130,19 @@ child in which Tcl code has access only to set of Tcl commands defined as
|
||||
see the manual entry for the Tcl \fBinterp\fR command for details.
|
||||
If the creation of the new child interpreter failed, \fBNULL\fR is returned.
|
||||
.PP
|
||||
.VS "TIP 581"
|
||||
\fBTcl_CreateChild\fR is a synonym for \fBTcl_CreateSlave\fR.
|
||||
.VE "TIP 581"
|
||||
.PP
|
||||
\fBTcl_IsSafe\fR returns \fB1\fR if \fIinterp\fR is
|
||||
.QW safe
|
||||
(was created with the \fBTCL_SAFE_INTERPRETER\fR flag specified),
|
||||
\fB0\fR otherwise.
|
||||
.PP
|
||||
\fBTcl_MakeSafe\fR marks \fIinterp\fR as
|
||||
.QW safe ,
|
||||
so that future
|
||||
calls to \fBTcl_IsSafe\fR will return 1. It also removes all known
|
||||
potentially-unsafe core functionality (both commands and variables)
|
||||
from \fIinterp\fR. However, it cannot know what parts of an extension
|
||||
or application are safe and does not make any attempt to remove those
|
||||
parts, so safety is not guaranteed after calling \fBTcl_MakeSafe\fR.
|
||||
Callers will want to take care with their use of \fBTcl_MakeSafe\fR
|
||||
to avoid false claims of safety. For many situations, \fBTcl_CreateSlave\fR
|
||||
may be a better choice, since it creates interpreters in a known-safe state.
|
||||
.PP
|
||||
\fBTcl_GetSlave\fR returns a pointer to a child interpreter of
|
||||
\fIinterp\fR. The child interpreter is identified by \fIchildName\fR.
|
||||
\fBTcl_GetChild\fR returns a pointer to a child interpreter of
|
||||
\fIinterp\fR. The child interpreter is identified by \fIname\fR.
|
||||
If no such child interpreter exists, \fBNULL\fR is returned.
|
||||
.PP
|
||||
.VS "TIP 581"
|
||||
\fBTcl_GetChild\fR is a synonym for \fBTcl_GetSlave\fR.
|
||||
.VE "TIP 581"
|
||||
.PP
|
||||
\fBTcl_GetMaster\fR returns a pointer to the master interpreter of
|
||||
\fIinterp\fR. If \fIinterp\fR has no master (it is a
|
||||
\fBTcl_GetParent\fR returns a pointer to the parent interpreter of
|
||||
\fIinterp\fR. If \fIinterp\fR has no parent (it is a
|
||||
top-level interpreter) then \fBNULL\fR is returned.
|
||||
.PP
|
||||
.VS "TIP 581"
|
||||
\fBTcl_GetParent\fR is a synonym for \fBTcl_GetMaster\fR.
|
||||
.VE "TIP 581"
|
||||
.PP
|
||||
\fBTcl_GetInterpPath\fR stores in the result of \fIinterp\fR
|
||||
the relative path between \fIinterp\fR and \fIchildInterp\fR;
|
||||
\fIchildInterp\fR must be a child of \fIinterp\fR. If the computation
|
||||
@@ -201,7 +159,7 @@ This operation returns \fBTCL_OK\fR if it succeeds, or \fBTCL_ERROR\fR if
|
||||
it fails; in that case, an error message is left in the value result
|
||||
of \fIchildInterp\fR.
|
||||
Note that there are no restrictions on the ancestry relationship (as
|
||||
created by \fBTcl_CreateSlave\fR) between \fIchildInterp\fR and
|
||||
created by \fBTcl_CreateChild\fR) between \fIchildInterp\fR and
|
||||
\fItargetInterp\fR. Any two interpreters can be used, without any
|
||||
restrictions on how they are related.
|
||||
.PP
|
||||
@@ -255,8 +213,16 @@ any script evaluation mechanism will fail.
|
||||
.PP
|
||||
For a description of the Tcl interface to multiple interpreters, see
|
||||
\fIinterp(n)\fR.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_CreateAliasObj\fR increments the reference counts of the values
|
||||
in its \fIobjv\fR argument. (That reference lasts the same length of
|
||||
time as the owning alias.)
|
||||
.PP
|
||||
\fBTcl_GetAliasObj\fR returns (via its \fIobjvPtr\fR argument) a
|
||||
pointer to values that it holds a reference to.
|
||||
.SH "SEE ALSO"
|
||||
interp
|
||||
interp(n)
|
||||
|
||||
.SH KEYWORDS
|
||||
alias, command, exposed commands, hidden commands, interpreter, invoke,
|
||||
|
||||
+69
-168
@@ -9,7 +9,7 @@
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChannelName, Tcl_GetChannelHandle, Tcl_GetChannelMode, Tcl_GetChannelBufferSize, Tcl_SetChannelBufferSize, Tcl_NotifyChannel, Tcl_BadChannelOption, Tcl_ChannelName, Tcl_ChannelVersion, Tcl_ChannelBlockModeProc, Tcl_ChannelCloseProc, Tcl_ChannelClose2Proc, Tcl_ChannelInputProc, Tcl_ChannelOutputProc, Tcl_ChannelSeekProc, Tcl_ChannelWideSeekProc, Tcl_ChannelTruncateProc, Tcl_ChannelSetOptionProc, Tcl_ChannelGetOptionProc, Tcl_ChannelWatchProc, Tcl_ChannelGetHandleProc, Tcl_ChannelFlushProc, Tcl_ChannelHandlerProc, Tcl_ChannelThreadActionProc, Tcl_IsChannelShared, Tcl_IsChannelRegistered, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting, Tcl_ClearChannelHandlers, Tcl_GetChannelThread, Tcl_ChannelBuffered \- procedures for creating and manipulating channels
|
||||
Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChannelName, Tcl_GetChannelHandle, Tcl_GetChannelMode, Tcl_GetChannelBufferSize, Tcl_SetChannelBufferSize, Tcl_NotifyChannel, Tcl_BadChannelOption, Tcl_ChannelName, Tcl_ChannelVersion, Tcl_ChannelBlockModeProc, Tcl_ChannelClose2Proc, Tcl_ChannelInputProc, Tcl_ChannelOutputProc, Tcl_ChannelWideSeekProc, Tcl_ChannelTruncateProc, Tcl_ChannelSetOptionProc, Tcl_ChannelGetOptionProc, Tcl_ChannelWatchProc, Tcl_ChannelGetHandleProc, Tcl_ChannelFlushProc, Tcl_ChannelHandlerProc, Tcl_ChannelThreadActionProc, Tcl_IsChannelShared, Tcl_IsChannelRegistered, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting, Tcl_ClearChannelHandlers, Tcl_GetChannelThread, Tcl_ChannelBuffered \- procedures for creating and manipulating channels
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -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 *
|
||||
@@ -35,6 +35,11 @@ Tcl_ThreadId
|
||||
int
|
||||
\fBTcl_GetChannelMode\fR(\fIchannel\fR)
|
||||
.sp
|
||||
.VS 8.7
|
||||
int
|
||||
\fBTcl_RemoveChannelMode\fR(\fIinterp, channel, mode\fR)
|
||||
.VE 8.7
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetChannelBufferSize\fR(\fIchannel\fR)
|
||||
.sp
|
||||
@@ -75,9 +80,6 @@ Tcl_ChannelTypeVersion
|
||||
Tcl_DriverBlockModeProc *
|
||||
\fBTcl_ChannelBlockModeProc\fR(\fItypePtr\fR)
|
||||
.sp
|
||||
Tcl_DriverCloseProc *
|
||||
\fBTcl_ChannelCloseProc\fR(\fItypePtr\fR)
|
||||
.sp
|
||||
Tcl_DriverClose2Proc *
|
||||
\fBTcl_ChannelClose2Proc\fR(\fItypePtr\fR)
|
||||
.sp
|
||||
@@ -87,9 +89,6 @@ Tcl_DriverInputProc *
|
||||
Tcl_DriverOutputProc *
|
||||
\fBTcl_ChannelOutputProc\fR(\fItypePtr\fR)
|
||||
.sp
|
||||
Tcl_DriverSeekProc *
|
||||
\fBTcl_ChannelSeekProc\fR(\fItypePtr\fR)
|
||||
.sp
|
||||
Tcl_DriverWideSeekProc *
|
||||
\fBTcl_ChannelWideSeekProc\fR(\fItypePtr\fR)
|
||||
.sp
|
||||
@@ -128,7 +127,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,10 +138,10 @@ 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
|
||||
.AP size_t size in
|
||||
The size, in bytes, of buffers to allocate in this channel.
|
||||
.AP int mask in
|
||||
An OR-ed combination of \fBTCL_READABLE\fR, \fBTCL_WRITABLE\fR
|
||||
@@ -243,6 +242,16 @@ events to the correct event queue even for a multi-threaded core.
|
||||
and \fBTCL_WRITABLE\fR, indicating whether the channel is open for input
|
||||
and output.
|
||||
.PP
|
||||
.VS 8.7
|
||||
.PP
|
||||
\fBTcl_RemoveChannelMode\fR removes an access privilege from the
|
||||
channel, either \fBTCL_READABLE\fR or \fBTCL_WRITABLE\fR, and returns
|
||||
a regular Tcl result code, \fBTCL_OK\fR, or \fBTCL_ERROR\fR. The
|
||||
function throws an error if either an invalid mode is specified or the
|
||||
result of the removal would be an inaccessible channel. In that case
|
||||
an error message is left in the interp argument, if not NULL.
|
||||
.VE 8.7
|
||||
.PP
|
||||
\fBTcl_GetChannelBufferSize\fR returns the size, in bytes, of buffers
|
||||
allocated to store input or output in \fIchannel\fR. If the value was not set
|
||||
by a previous call to \fBTcl_SetChannelBufferSize\fR, described below, then
|
||||
@@ -287,16 +296,13 @@ name is registered in the (thread)-global list of all channels (result
|
||||
(thread)global list of all channels (of the current thread).
|
||||
Application to a channel still registered in some interpreter
|
||||
is not allowed.
|
||||
Also notifies the driver if the \fBTcl_ChannelType\fR version is
|
||||
\fBTCL_CHANNEL_VERSION_4\fR (or higher), and
|
||||
Also notifies the driver if
|
||||
\fBTcl_DriverThreadActionProc\fR is defined for it.
|
||||
.PP
|
||||
\fBTcl_SpliceChannel\fR adds the specified \fIchannel\fR to the
|
||||
(thread)global list of all channels (of the current thread).
|
||||
Application to a channel registered in some interpreter is not allowed.
|
||||
Also notifies the driver if the \fBTcl_ChannelType\fR version is
|
||||
\fBTCL_CHANNEL_VERSION_4\fR (or higher), and
|
||||
\fBTcl_DriverThreadActionProc\fR is defined for it.
|
||||
Also notifies the driver if \fBTcl_DriverThreadActionProc\fR is defined for it.
|
||||
.PP
|
||||
\fBTcl_ClearChannelHandlers\fR removes all channel handlers and event
|
||||
scripts associated with the specified \fIchannel\fR, thus shutting
|
||||
@@ -316,10 +322,10 @@ The \fBTcl_ChannelType\fR structure contains the following fields:
|
||||
typedef struct Tcl_ChannelType {
|
||||
const char *\fItypeName\fR;
|
||||
Tcl_ChannelTypeVersion \fIversion\fR;
|
||||
Tcl_DriverCloseProc *\fIcloseProc\fR;
|
||||
void *\fIcloseProc\fR; /* Not used any more*/
|
||||
Tcl_DriverInputProc *\fIinputProc\fR;
|
||||
Tcl_DriverOutputProc *\fIoutputProc\fR;
|
||||
Tcl_DriverSeekProc *\fIseekProc\fR;
|
||||
void *\fIseekProc\fR; /* Not used any more */
|
||||
Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
|
||||
Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
|
||||
Tcl_DriverWatchProc *\fIwatchProc\fR;
|
||||
@@ -348,9 +354,8 @@ The user should only use the above structure for \fBTcl_ChannelType\fR
|
||||
instantiation. When referencing fields in a \fBTcl_ChannelType\fR
|
||||
structure, the following functions should be used to obtain the values:
|
||||
\fBTcl_ChannelName\fR, \fBTcl_ChannelVersion\fR,
|
||||
\fBTcl_ChannelBlockModeProc\fR, \fBTcl_ChannelCloseProc\fR,
|
||||
\fBTcl_ChannelClose2Proc\fR, \fBTcl_ChannelInputProc\fR,
|
||||
\fBTcl_ChannelOutputProc\fR, \fBTcl_ChannelSeekProc\fR,
|
||||
\fBTcl_ChannelBlockModeProc\fR, \fBTcl_ChannelClose2Proc\fR,
|
||||
\fBTcl_ChannelInputProc\fR, \fBTcl_ChannelOutputProc\fR,
|
||||
\fBTcl_ChannelWideSeekProc\fR, \fBTcl_ChannelThreadActionProc\fR,
|
||||
\fBTcl_ChannelTruncateProc\fR,
|
||||
\fBTcl_ChannelSetOptionProc\fR, \fBTcl_ChannelGetOptionProc\fR,
|
||||
@@ -373,25 +378,9 @@ a pointer to the string.
|
||||
.PP
|
||||
|
||||
The \fIversion\fR field should be set to the version of the structure
|
||||
that you require. \fBTCL_CHANNEL_VERSION_2\fR is the minimum recommended.
|
||||
\fBTCL_CHANNEL_VERSION_3\fR must be set to specify the \fIwideSeekProc\fR member.
|
||||
\fBTCL_CHANNEL_VERSION_4\fR must be set to specify the \fIthreadActionProc\fR member
|
||||
(includes \fIwideSeekProc\fR).
|
||||
\fBTCL_CHANNEL_VERSION_5\fR must be set to specify the
|
||||
\fItruncateProc\fR members (includes
|
||||
\fIwideSeekProc\fR and \fIthreadActionProc\fR).
|
||||
If it is not set to any of these, then this
|
||||
\fBTcl_ChannelType\fR is assumed to have the original structure. See
|
||||
\fBOLD CHANNEL TYPES\fR for more details. While Tcl will recognize
|
||||
and function with either structures, stacked channels must be of at
|
||||
least \fBTCL_CHANNEL_VERSION_2\fR to function correctly.
|
||||
that you require. \fBTCL_CHANNEL_VERSION_5\fR is the minimum supported.
|
||||
.PP
|
||||
This value can be retrieved with \fBTcl_ChannelVersion\fR, which returns
|
||||
one of
|
||||
\fBTCL_CHANNEL_VERSION_5\fR,
|
||||
\fBTCL_CHANNEL_VERSION_4\fR,
|
||||
\fBTCL_CHANNEL_VERSION_3\fR,
|
||||
\fBTCL_CHANNEL_VERSION_2\fR or \fBTCL_CHANNEL_VERSION_1\fR.
|
||||
This value can be retrieved with \fBTcl_ChannelVersion\fR.
|
||||
.SS BLOCKMODEPROC
|
||||
.PP
|
||||
The \fIblockModeProc\fR field contains the address of a function called by
|
||||
@@ -400,7 +389,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
|
||||
@@ -427,22 +416,23 @@ blocking mode is acceptable to it, and should this also document for
|
||||
the user so that the blocking mode of the channel is not changed to an
|
||||
unacceptable value. Any confusion here may lead the interpreter into a
|
||||
(spurious and difficult to find) deadlock.
|
||||
.SS "CLOSEPROC AND CLOSE2PROC"
|
||||
.SS "CLOSE2PROC"
|
||||
.PP
|
||||
The \fIcloseProc\fR field contains the address of a function called by the
|
||||
The \fIclose2Proc\fR field contains the address of a function called by the
|
||||
generic layer to clean up driver-related information when the channel is
|
||||
closed. \fICloseProc\fR must match the following prototype:
|
||||
closed. \fIClose2Proc\fR must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverCloseProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
typedef int \fBTcl_DriverClose2Proc\fR(
|
||||
void *\fIinstanceData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIflags\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIinstanceData\fR argument is the same as the value provided to
|
||||
\fBTcl_CreateChannel\fR when the channel was created. The function should
|
||||
release any storage maintained by the channel driver for this channel, and
|
||||
close the input and output devices encapsulated by this channel. All queued
|
||||
If \fIflags\fR is 0, the \fIinstanceData\fR argument is the same as the value
|
||||
provided to \fBTcl_CreateChannel\fR when the channel was created. The function
|
||||
should release any storage maintained by the channel driver for this channel,
|
||||
and close the input and output devices encapsulated by this channel. All queued
|
||||
output will have been flushed to the device before this function is called,
|
||||
and no further driver operations will be invoked on this instance after
|
||||
calling the \fIcloseProc\fR. If the close operation is successful, the
|
||||
@@ -451,35 +441,20 @@ error code. In addition, if an error occurs and \fIinterp\fR is not NULL,
|
||||
the procedure should store an error message in the interpreter's result.
|
||||
.PP
|
||||
Alternatively, channels that support closing the read and write sides
|
||||
independently may set \fIcloseProc\fR to \fBTCL_CLOSE2PROC\fR and set
|
||||
\fIclose2Proc\fR to the address of a function that matches the
|
||||
following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverClose2Proc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIflags\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclose2Proc\fR will be called with \fIflags\fR set to an OR'ed
|
||||
independently may accept other flag values than 0.
|
||||
Then \fIclose2Proc\fR will be called with \fIflags\fR set to an OR'ed
|
||||
combination of \fBTCL_CLOSE_READ\fR or \fBTCL_CLOSE_WRITE\fR to
|
||||
indicate that the driver should close the read and/or write side of
|
||||
the channel. The channel driver may be invoked to perform
|
||||
additional operations on the channel after \fIclose2Proc\fR is
|
||||
called to close one or both sides of the channel. If \fIflags\fR is
|
||||
\fB0\fR (zero), the driver should close the channel in the manner
|
||||
described above for \fIcloseProc\fR. No further operations will be
|
||||
invoked on this instance after \fIclose2Proc\fR is called with all
|
||||
flags cleared. In all cases, the \fIclose2Proc\fR function should
|
||||
return zero if the close operation was successful; otherwise it should
|
||||
return a nonzero POSIX error code. In addition, if an error occurs and
|
||||
\fIinterp\fR is not NULL, the procedure should store an error message
|
||||
in the interpreter's result.
|
||||
called to close one or both sides of the channel. In all cases, the
|
||||
\fIclose2Proc\fR function should return zero if the close operation was
|
||||
successful; otherwise it should return a nonzero POSIX error code.
|
||||
In addition, if an error occurs and \fIinterp\fR is not NULL, the procedure
|
||||
should store an error message in the interpreter's result.
|
||||
.PP
|
||||
The \fIcloseProc\fR and \fIclose2Proc\fR values can be retrieved with
|
||||
\fBTcl_ChannelCloseProc\fR or \fBTcl_ChannelClose2Proc\fR, which
|
||||
return a pointer to the respective function.
|
||||
The \fIclose2Proc\fR value can be retrieved with \fBTcl_ChannelClose2Proc\fR,
|
||||
which returns a pointer to the function.
|
||||
.SS INPUTPROC
|
||||
.PP
|
||||
The \fIinputProc\fR field contains the address of a function called by the
|
||||
@@ -488,7 +463,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);
|
||||
@@ -532,7 +507,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);
|
||||
@@ -562,17 +537,17 @@ without writing any data.
|
||||
.PP
|
||||
This value can be retrieved with \fBTcl_ChannelOutputProc\fR, which returns
|
||||
a pointer to the function.
|
||||
.SS "SEEKPROC AND WIDESEEKPROC"
|
||||
.SS "WIDESEEKPROC"
|
||||
.PP
|
||||
The \fIseekProc\fR field contains the address of a function called by the
|
||||
The \fIwideSeekProc\fR field contains the address of a function called by the
|
||||
generic layer to move the access point at which subsequent input or output
|
||||
operations will be applied. \fISeekProc\fR must match the following
|
||||
operations will be applied. \fIWideSeekProc\fR must match the following
|
||||
prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverSeekProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
long \fIoffset\fR,
|
||||
typedef long long \fBTcl_DriverWideSeekProc\fR(
|
||||
void *\fIinstanceData\fR,
|
||||
long long \fIoffset\fR,
|
||||
int \fIseekMode\fR,
|
||||
int *\fIerrorCodePtr\fR);
|
||||
.CE
|
||||
@@ -591,30 +566,8 @@ does not implement seeking.
|
||||
The return value is the new access point or -1 in case of error. If an
|
||||
error occurred, the function should not move the access point.
|
||||
.PP
|
||||
If there is a non-NULL \fIseekProc\fR field, the \fIwideSeekProc\fR
|
||||
field may contain the address of an alternative function to use which
|
||||
handles wide (i.e. larger than 32-bit) offsets, so allowing seeks
|
||||
within files larger than 2GB. The \fIwideSeekProc\fR will be called
|
||||
in preference to the \fIseekProc\fR, but both must be defined if the
|
||||
\fIwideSeekProc\fR is defined. \fIWideSeekProc\fR must match the
|
||||
following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef Tcl_WideInt \fBTcl_DriverWideSeekProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
Tcl_WideInt \fIoffset\fR,
|
||||
int \fIseekMode\fR,
|
||||
int *\fIerrorCodePtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
The arguments and return values mean the same thing as with
|
||||
\fIseekProc\fR above, except that the type of offsets and the return
|
||||
type are different.
|
||||
.PP
|
||||
The \fIseekProc\fR value can be retrieved with
|
||||
\fBTcl_ChannelSeekProc\fR, which returns a pointer to the function,
|
||||
and similarly the \fIwideSeekProc\fR can be retrieved with
|
||||
\fBTcl_ChannelWideSeekProc\fR.
|
||||
The \fIwideSseekProc\fR value can be retrieved with
|
||||
\fBTcl_ChannelWideSeekProc\fR, which returns a pointer to the function.
|
||||
.SS SETOPTIONPROC
|
||||
.PP
|
||||
The \fIsetOptionProc\fR field contains the address of a function called by
|
||||
@@ -623,7 +576,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);
|
||||
@@ -664,7 +617,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);
|
||||
@@ -702,7 +655,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
|
||||
@@ -733,9 +686,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
|
||||
@@ -762,7 +715,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
|
||||
@@ -777,7 +730,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
|
||||
@@ -806,7 +759,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
|
||||
@@ -823,8 +776,8 @@ length. It can be NULL.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverTruncateProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
Tcl_WideInt \fIlength\fR);
|
||||
void *\fIinstanceData\fR,
|
||||
long long \fIlength\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIInstanceData\fR is the same as the value passed to
|
||||
@@ -871,58 +824,6 @@ The function takes good care of inserting minus signs before
|
||||
each option, commas after, and an
|
||||
.QW or
|
||||
before the last option.
|
||||
.SH "OLD CHANNEL TYPES"
|
||||
The original (8.3.1 and below) \fBTcl_ChannelType\fR structure contains
|
||||
the following fields:
|
||||
.PP
|
||||
.CS
|
||||
typedef struct Tcl_ChannelType {
|
||||
const char *\fItypeName\fR;
|
||||
Tcl_DriverBlockModeProc *\fIblockModeProc\fR;
|
||||
Tcl_DriverCloseProc *\fIcloseProc\fR;
|
||||
Tcl_DriverInputProc *\fIinputProc\fR;
|
||||
Tcl_DriverOutputProc *\fIoutputProc\fR;
|
||||
Tcl_DriverSeekProc *\fIseekProc\fR;
|
||||
Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
|
||||
Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
|
||||
Tcl_DriverWatchProc *\fIwatchProc\fR;
|
||||
Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
|
||||
Tcl_DriverClose2Proc *\fIclose2Proc\fR;
|
||||
} \fBTcl_ChannelType\fR;
|
||||
.CE
|
||||
.PP
|
||||
It is still possible to create channel with the above structure. The
|
||||
internal channel code will determine the version. It is imperative to use
|
||||
the new \fBTcl_ChannelType\fR structure if you are creating a stacked
|
||||
channel driver, due to problems with the earlier stacked channel
|
||||
implementation (in 8.2.0 to 8.3.1).
|
||||
.PP
|
||||
Prior to 8.4.0 (i.e. during the later releases of 8.3 and early part
|
||||
of the 8.4 development cycle) the \fBTcl_ChannelType\fR structure
|
||||
contained the following fields:
|
||||
.PP
|
||||
.CS
|
||||
typedef struct Tcl_ChannelType {
|
||||
const char *\fItypeName\fR;
|
||||
Tcl_ChannelTypeVersion \fIversion\fR;
|
||||
Tcl_DriverCloseProc *\fIcloseProc\fR;
|
||||
Tcl_DriverInputProc *\fIinputProc\fR;
|
||||
Tcl_DriverOutputProc *\fIoutputProc\fR;
|
||||
Tcl_DriverSeekProc *\fIseekProc\fR;
|
||||
Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
|
||||
Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
|
||||
Tcl_DriverWatchProc *\fIwatchProc\fR;
|
||||
Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
|
||||
Tcl_DriverClose2Proc *\fIclose2Proc\fR;
|
||||
Tcl_DriverBlockModeProc *\fIblockModeProc\fR;
|
||||
Tcl_DriverFlushProc *\fIflushProc\fR;
|
||||
Tcl_DriverHandlerProc *\fIhandlerProc\fR;
|
||||
Tcl_DriverTruncateProc *\fItruncateProc\fR;
|
||||
} \fBTcl_ChannelType\fR;
|
||||
.CE
|
||||
.PP
|
||||
When the above structure is registered as a channel type, the
|
||||
\fIversion\fR field should always be \fBTCL_CHANNEL_VERSION_2\fR.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_Close(3), Tcl_OpenFileChannel(3), Tcl_SetErrno(3), Tcl_QueueEvent(3), Tcl_StackChannel(3), Tcl_GetStdChannel(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
+3
-3
@@ -29,10 +29,10 @@ Tcl channel such as returned by \fBTcl_CreateChannel\fR.
|
||||
Conditions under which \fIproc\fR should be called: OR-ed combination of
|
||||
\fBTCL_READABLE\fR, \fBTCL_WRITABLE\fR and \fBTCL_EXCEPTION\fR. Specify
|
||||
a zero value to temporarily disable an existing handler.
|
||||
.AP Tcl_FileProc *proc in
|
||||
.AP Tcl_ChannelProc *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
|
||||
|
||||
@@ -22,10 +22,8 @@ Tcl_Interp *
|
||||
int
|
||||
\fBTcl_InterpDeleted\fR(\fIinterp\fR)
|
||||
.sp
|
||||
.VS 8.6
|
||||
int
|
||||
\fBTcl_InterpActive\fR(\fIinterp\fR)
|
||||
.VE 8.6
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *interp
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -70,14 +68,12 @@ deleted and when the whole interpreter is being deleted. In the former case
|
||||
the callback may recreate the data being deleted, but this would lead to an
|
||||
infinite loop if the interpreter were being deleted.
|
||||
.PP
|
||||
.VS 8.6
|
||||
\fBTcl_InterpActive\fR is useful for determining whether there is any
|
||||
execution of scripts ongoing in an interpreter, which is a useful piece of
|
||||
information when Tcl is embedded in a garbage-collected environment and it
|
||||
becomes necessary to determine whether the interpreter is a candidate for
|
||||
deletion. The function returns a true value if the interpreter has at least
|
||||
one active execution running inside it, and a false value otherwise.
|
||||
.VE 8.6
|
||||
.SH "INTERPRETERS AND MEMORY MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_DeleteInterp\fR can be called at any time on an interpreter that may
|
||||
@@ -138,12 +134,10 @@ All uses of interpreters in Tcl and Tk have already been protected.
|
||||
Extension writers should ensure that their code also properly protects any
|
||||
additional interpreters used, as described above.
|
||||
.PP
|
||||
.VS 8.6
|
||||
Note that the protection mechanisms do not work well with conventional garbage
|
||||
collection systems. When in such a managed environment, \fBTcl_InterpActive\fR
|
||||
should be used to determine when an interpreter is a candidate for deletion
|
||||
due to inactivity.
|
||||
.VE 8.6
|
||||
.SH "SEE ALSO"
|
||||
Tcl_Preserve(3), Tcl_Release(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
@@ -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
|
||||
+58
-16
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_CreateObjCommand, Tcl_DeleteCommand, Tcl_DeleteCommandFromToken, Tcl_GetCommandInfo, Tcl_GetCommandInfoFromToken, Tcl_SetCommandInfo, Tcl_SetCommandInfoFromToken, Tcl_GetCommandName, Tcl_GetCommandFullName, Tcl_GetCommandFromObj \- implement new commands in C
|
||||
Tcl_CreateObjCommand, Tcl_CreateObjCommand2, Tcl_DeleteCommand, Tcl_DeleteCommandFromToken, Tcl_GetCommandInfo, Tcl_GetCommandInfoFromToken, Tcl_SetCommandInfo, Tcl_SetCommandInfoFromToken, Tcl_GetCommandName, Tcl_GetCommandFullName, Tcl_GetCommandFromObj \- implement new commands in C
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -16,6 +16,9 @@ Tcl_CreateObjCommand, Tcl_DeleteCommand, Tcl_DeleteCommandFromToken, Tcl_GetComm
|
||||
Tcl_Command
|
||||
\fBTcl_CreateObjCommand\fR(\fIinterp, cmdName, proc, clientData, deleteProc\fR)
|
||||
.sp
|
||||
Tcl_Command
|
||||
\fBTcl_CreateObjCommand2\fR(\fIinterp, cmdName, proc2, clientData, deleteProc\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_DeleteCommand\fR(\fIinterp, cmdName\fR)
|
||||
.sp
|
||||
@@ -42,6 +45,7 @@ void
|
||||
.sp
|
||||
Tcl_Command
|
||||
\fBTcl_GetCommandFromObj\fR(\fIinterp, objPtr\fR)
|
||||
.sp
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_CmdDeleteProc *deleteProc in/out
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -51,7 +55,10 @@ 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 Tcl_ObjCmdProc2 *proc2 in
|
||||
Implementation of the new command: \fIproc2\fR will be called whenever
|
||||
\fIcmdName\fR is invoked as a command.
|
||||
.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;
|
||||
@@ -65,6 +72,9 @@ Pointer to structure containing various information about a
|
||||
Tcl command.
|
||||
.AP Tcl_Obj *objPtr in
|
||||
Value containing the name of a Tcl command.
|
||||
.AP "const char" *typeName in
|
||||
Indicates the name of the type of command implementation associated
|
||||
with a particular \fIproc\fR, or NULL to break the association.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
@@ -91,7 +101,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[]);
|
||||
@@ -164,12 +174,23 @@ 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
|
||||
argument passed to \fBTcl_CreateObjCommand\fR.
|
||||
.PP
|
||||
\fBTcl_CreateObjCommand2\fR does the same as \fBTcl_CreateObjCommand\fR,
|
||||
except its \fIproc2\fR argument is of type \fBTcl_ObjCmdProc2\fR.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_ObjCmdProc2\fR(
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
size_t \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[]);
|
||||
.CE
|
||||
.PP
|
||||
\fBTcl_DeleteCommand\fR deletes a command from a command interpreter.
|
||||
Once the call completes, attempts to invoke \fIcmdName\fR in
|
||||
\fIinterp\fR will result in errors.
|
||||
@@ -206,21 +227,26 @@ 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;
|
||||
Tcl_ObjCmdProc2 *\fIobjProc2\fR;
|
||||
void *\fIobjClientData2\fR;
|
||||
} \fBTcl_CmdInfo\fR;
|
||||
.CE
|
||||
.PP
|
||||
The \fIisNativeObjectProc\fR field has the value 1
|
||||
if \fBTcl_CreateObjCommand\fR was called to register the command;
|
||||
it is 0 if only \fBTcl_CreateCommand\fR was called.
|
||||
The \fIisNativeObjectProc\fR field has the value 2 if
|
||||
\fBTcl_CreateObjCommand2\fR was called to register the command;
|
||||
it has the value 1 if \fBTcl_CreateObjCommand\fR was called to
|
||||
register the command; it is 0 if only \fBTcl_CreateCommand\fR was called.
|
||||
It allows a program to determine whether it is faster to
|
||||
call \fIobjProc\fR or \fIproc\fR:
|
||||
\fIobjProc\fR is normally faster
|
||||
call \fIobjProc2\fR, \fIobjProc\fR or \fIproc\fR:
|
||||
\fIobjProc2\fR/\fIobjProc\fR is normally faster
|
||||
if \fIisNativeObjectProc\fR has the value 2;
|
||||
\fIobjProc\fR/\fIobjProc\fR is normally faster
|
||||
if \fIisNativeObjectProc\fR has the value 1.
|
||||
The fields \fIobjProc\fR and \fIobjClientData\fR
|
||||
have the same meaning as the \fIproc\fR and \fIclientData\fR
|
||||
@@ -236,7 +262,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.
|
||||
@@ -250,7 +276,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.
|
||||
@@ -266,9 +292,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.
|
||||
@@ -296,6 +322,22 @@ is appended to the value specified by \fIobjPtr\fR.
|
||||
specified by the name in a \fBTcl_Obj\fR.
|
||||
The command name is resolved relative to the current namespace.
|
||||
Returns NULL if the command is not found.
|
||||
.PP
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
When the \fIproc\fR passed to \fBTcl_CreateObjCommand\fR is called,
|
||||
the values in its \fIobjv\fR argument will have a reference count of
|
||||
at least 1, with that guaranteed reference being from the Tcl
|
||||
evaluation stack. You should not call \fBTcl_DecrRefCount\fR on any of
|
||||
those values unless you call \fBTcl_IncrRefCount\fR on them first.
|
||||
Also, when the \fIproc\fR is called, the interpreter result is
|
||||
guaranteed to be an empty string value with a reference count of 1.
|
||||
.PP
|
||||
\fBTcl_GetCommandFullName\fR does not modify the reference count of its
|
||||
\fIobjPtr\fR argument, but does require that the object be unshared.
|
||||
.PP
|
||||
\fBTcl_GetCommandFromObj\fR does not modify the reference count of its
|
||||
\fIobjPtr\fR argument; it only reads.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_CreateCommand(3), Tcl_ResetResult(3), Tcl_SetObjResult(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
+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
|
||||
|
||||
+23
-8
@@ -10,7 +10,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_CreateTrace, Tcl_CreateObjTrace, Tcl_DeleteTrace \- arrange for command execution to be traced
|
||||
Tcl_CreateTrace, Tcl_CreateObjTrace, Tcl_CreateObjTrace2, Tcl_DeleteTrace \- arrange for command execution to be traced
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -21,6 +21,9 @@ Tcl_Trace
|
||||
Tcl_Trace
|
||||
\fBTcl_CreateObjTrace\fR(\fIinterp, level, flags, objProc, clientData, deleteProc\fR)
|
||||
.sp
|
||||
Tcl_Trace
|
||||
\fBTcl_CreateObjTrace2\fR(\fIinterp, level, flags, objProc2, clientData, deleteProc\fR)
|
||||
.sp
|
||||
\fBTcl_DeleteTrace\fR(\fIinterp, trace\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_CmdObjTraceDeleteProc *deleteProc
|
||||
@@ -38,11 +41,14 @@ Flags governing the trace execution. See below for details.
|
||||
.AP Tcl_CmdObjTraceProc *objProc in
|
||||
Procedure to call for each command that is executed. See below for
|
||||
details of the calling sequence.
|
||||
.AP Tcl_CmdObjTraceProc2 *objProc2 in
|
||||
Procedure to call for each command that is executed. See below for
|
||||
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
|
||||
Arbitrary one-word value to pass to \fIobjProc\fR or \fIproc\fR.
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIobjProc\fR, \fIobjProc2\fR or \fIproc\fR.
|
||||
.AP Tcl_CmdObjTraceDeleteProc *deleteProc in
|
||||
Procedure to call when the trace is deleted. See below for details of
|
||||
the calling sequence. A NULL pointer is permissible and results in no
|
||||
@@ -66,7 +72,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 +83,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
|
||||
@@ -140,7 +146,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
|
||||
@@ -156,12 +162,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
|
||||
@@ -183,5 +189,14 @@ There is no way to be notified when the trace created by
|
||||
\fBTcl_CreateTrace\fR is deleted. There is no way for the \fIproc\fR
|
||||
associated with a call to \fBTcl_CreateTrace\fR to abort execution of
|
||||
\fIcommand\fR.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
When the \fIproc\fR passed to \fBTcl_CreateObjTrace\fR is called,
|
||||
the values in its \fIobjv\fR argument will have a reference count of
|
||||
at least 1, with that guaranteed reference being from the Tcl
|
||||
evaluation stack. You should not call \fBTcl_DecrRefCount\fR on any of
|
||||
those values unless you call \fBTcl_IncrRefCount\fR on them first.
|
||||
.SH "SEE ALSO"
|
||||
trace(n)
|
||||
.SH KEYWORDS
|
||||
command, create, delete, interpreter, trace
|
||||
|
||||
+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 TCL_INDEX_NONE,
|
||||
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.
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ Tcl_Pid
|
||||
\fBTcl_WaitPid\fR(\fIpid, statusPtr, options\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Pid *statusPtr out
|
||||
.AP int numPids in
|
||||
.AP size_t numPids in
|
||||
Number of process ids contained in the array pointed to by \fIpidPtr\fR.
|
||||
.AP int *pidPtr in
|
||||
Address of array containing \fInumPids\fR process ids.
|
||||
|
||||
+71
-3
@@ -70,7 +70,7 @@ Points to a variable that will have the value from a key/value pair
|
||||
placed within it. For \fBTcl_DictObjFirst\fR and
|
||||
\fBTcl_DictObjNext\fR, this may be NULL to indicate that the caller is
|
||||
not interested in the value.
|
||||
.AP int *sizePtr out
|
||||
.AP "size_t \&| int" *sizePtr out
|
||||
Points to a variable that will have the number of key/value pairs
|
||||
contained within the dictionary placed within it.
|
||||
.AP Tcl_DictSearch *searchPtr in/out
|
||||
@@ -84,7 +84,7 @@ returned, the search record \fImust\fR be passed to
|
||||
Points to a variable that will have a non-zero value written into it
|
||||
when the enumeration of the key/value pairs in a dictionary has
|
||||
completed, and a zero otherwise.
|
||||
.AP int keyc in
|
||||
.AP size_t keyc in
|
||||
Indicates the number of keys that will be supplied in the \fIkeyv\fR
|
||||
array.
|
||||
.AP "Tcl_Obj *const" *keyv in
|
||||
@@ -138,7 +138,8 @@ converted to a dictionary.
|
||||
\fBTcl_DictObjSize\fR updates the given variable with the number of
|
||||
key/value pairs currently in the given dictionary. The result of this
|
||||
procedure is \fBTCL_OK\fR, or \fBTCL_ERROR\fR if the \fIdictPtr\fR cannot be
|
||||
converted to a dictionary.
|
||||
converted to a dictionary or if \fIsizePtr\fR points to a variable of type
|
||||
\fBint\fR and the dict contains more than 2**31 key/value pairs.
|
||||
.PP
|
||||
\fBTcl_DictObjFirst\fR commences an iteration across all the key/value
|
||||
pairs in the given dictionary, placing the key and value in the
|
||||
@@ -190,6 +191,73 @@ path as this is easy to construct from repeated use of
|
||||
dictionaries are created for non-terminal keys where they do not
|
||||
already exist. With \fBTcl_DictObjRemoveKeyList\fR, all non-terminal
|
||||
keys must exist and have dictionaries as their values.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_NewDictObj\fR always returns a zero-reference object, much like
|
||||
\fBTcl_NewObj\fR.
|
||||
.PP
|
||||
\fBTcl_DictObjPut\fR does not modify the reference count of its \fIdictPtr\fR
|
||||
argument, but does require that the object be unshared. If
|
||||
\fBTcl_DictObjPut\fR returns \fBTCL_ERROR\fR it does not manipulate any
|
||||
reference counts; but if it returns \fBTCL_OK\fR then it definitely increments
|
||||
the reference count of \fIvaluePtr\fR and may increment the reference count of
|
||||
\fIkeyPtr\fR; the latter case happens exactly when the key did not previously
|
||||
exist in the dictionary. Note however that this function may set the
|
||||
interpreter result; if that is the only place that is holding a reference to
|
||||
an object, it will be deleted.
|
||||
.PP
|
||||
\fBTcl_DictObjGet\fR only reads from its \fIdictPtr\fR and \fIkeyPtr\fR
|
||||
arguments, and does not manipulate their reference counts at all. If the
|
||||
\fIvaluePtrPtr\fR argument is not set to NULL (and the function doesn't return
|
||||
\fBTCL_ERROR\fR), it will be set to a value with a reference count of at least
|
||||
1, with a reference owned by the dictionary. Note however that this function
|
||||
may set the interpreter result; if that is the only place that is holding a
|
||||
reference to an object, it will be deleted.
|
||||
.PP
|
||||
\fBTcl_DictObjRemove\fR does not modify the reference count of its
|
||||
\fIdictPtr\fR argument, but does require that the object be unshared. It does
|
||||
not manipulate the reference count of its \fIkeyPtr\fR argument at all. Note
|
||||
however that this function may set the interpreter result; if that is the only
|
||||
place that is holding a reference to an object, it will be deleted.
|
||||
.PP
|
||||
\fBTcl_DictObjSize\fR does not modify the reference count of its \fIdictPtr\fR
|
||||
argument; it only reads. Note however that this function may set the
|
||||
interpreter result; if that is the only place that is holding a reference to
|
||||
the dictionary object, it will be deleted.
|
||||
.PP
|
||||
\fBTcl_DictObjFirst\fR does not modify the reference count of its
|
||||
\fIdictPtr\fR argument; it only reads. The variables given by the
|
||||
\fIkeyPtrPtr\fR and \fIvaluePtrPtr\fR arguments (if not NULL) will be updated
|
||||
to contain references to the relevant values in the dictionary; their
|
||||
reference counts will be at least 1 (due to the dictionary holding a reference
|
||||
to them). It may also manipulate internal references; these are not exposed to
|
||||
user code, but require a matching \fBTcl_DictObjDone\fR call. Note however
|
||||
that this function may set the interpreter result; if that is the only place
|
||||
that is holding a reference to the dictionary object, it will be deleted.
|
||||
.PP
|
||||
Similarly for \fBTcl_DictObjNext\fR; the variables given by the
|
||||
\fIkeyPtrPtr\fR and \fIvaluePtrPtr\fR arguments (if not NULL) will be updated
|
||||
to contain references to the relevant values in the dictionary; their
|
||||
reference counts will be at least 1 (due to the dictionary holding a reference
|
||||
to them).
|
||||
.PP
|
||||
\fBTcl_DictObjDone\fR does not manipulate (user-visible) reference counts.
|
||||
.PP
|
||||
\fBTcl_DictObjPutKeyList\fR is similar to \fBTcl_DictObjPut\fR; it does not
|
||||
modify the reference count of its \fIdictPtr\fR argument, but does require
|
||||
that the object be unshared. It may increment the reference count of any value
|
||||
passed in the \fIkeyv\fR argument, and will increment the reference count of
|
||||
the \fIvaluePtr\fR argument on success. It is recommended that values passed
|
||||
via \fIkeyv\fR and \fIvaluePtr\fR do not have zero reference counts. Note
|
||||
however that this function may set the interpreter result; if that is the only
|
||||
place that is holding a reference to an object, it will be deleted.
|
||||
.PP
|
||||
\fBTcl_DictObjRemoveKeyList\fR is similar to \fBTcl_DictObjRemove\fR; it does
|
||||
not modify the reference count of its \fIdictPtr\fR argument, but does require
|
||||
that the object be unshared, and does not modify the reference counts of any
|
||||
of the values passed in the \fIkeyv\fR argument. Note however that this
|
||||
function may set the interpreter result; if that is the only place that is
|
||||
holding a reference to an object, it will be deleted.
|
||||
.SH EXAMPLE
|
||||
Using the dictionary iteration interface to search determine if there
|
||||
is a key that maps to itself:
|
||||
|
||||
+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
|
||||
|
||||
@@ -58,6 +58,18 @@ and if \fIinterp\fR is non-NULL, an error message is left in \fIinterp\fR.
|
||||
The \fBTcl_ObjType\fR of \fIobjPtr\fR may be changed to make subsequent
|
||||
calls to \fBTcl_GetDoubleFromObj\fR more efficient.
|
||||
'\" TODO: add discussion of treatment of NaN value
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_NewDoubleObj\fR always returns a zero-reference object, much
|
||||
like \fBTcl_NewObj\fR.
|
||||
.PP
|
||||
\fBTcl_SetDoubleObj\fR does not modify the reference count of its
|
||||
\fIobjPtr\fR argument, but does require that the object be unshared.
|
||||
.PP
|
||||
\fBTcl_GetDoubleFromObj\fR does not modify the reference count of its
|
||||
\fIobjPtr\fR argument; it only reads. Note however that this function
|
||||
may set the interpreter result; if that is the only place that
|
||||
is holding a reference to the object, it will be deleted.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult
|
||||
.SH KEYWORDS
|
||||
|
||||
@@ -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"
|
||||
|
||||
+50
-39
@@ -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_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
|
||||
@@ -25,9 +25,15 @@ int
|
||||
char *
|
||||
\fBTcl_ExternalToUtfDString\fR(\fIencoding, src, srcLen, dstPtr\fR)
|
||||
.sp
|
||||
size_t
|
||||
\fBTcl_ExternalToUtfDStringEx\fR(\fIencoding, src, srcLen, flags, dstPtr\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_UtfToExternalDString\fR(\fIencoding, src, srcLen, dstPtr\fR)
|
||||
.sp
|
||||
size_t
|
||||
\fBTcl_UtfToExternalDStringEx\fR(\fIencoding, src, srcLen, flags, dstPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_ExternalToUtf\fR(\fIinterp, encoding, src, srcLen, flags, statePtr,
|
||||
dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr\fR)
|
||||
@@ -36,16 +42,13 @@ int
|
||||
\fBTcl_UtfToExternal\fR(\fIinterp, encoding, src, srcLen, flags, statePtr,
|
||||
dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_WinTCharToUtf\fR(\fItsrc, srcLen, dstPtr\fR)
|
||||
.sp
|
||||
TCHAR *
|
||||
\fBTcl_WinUtfToTChar\fR(\fIsrc, srcLen, dstPtr\fR)
|
||||
.sp
|
||||
const char *
|
||||
\fBTcl_GetEncodingName\fR(\fIencoding\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetEncodingNulLength\fR(\fIencoding\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_SetSystemEncoding\fR(\fIinterp, name\fR)
|
||||
.sp
|
||||
const char *
|
||||
@@ -62,12 +65,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
|
||||
@@ -85,11 +82,11 @@ Points to storage where encoding token is to be written.
|
||||
.AP "const char" *src in
|
||||
For the \fBTcl_ExternalToUtf\fR functions, an array of bytes in the
|
||||
specified encoding that are to be converted to UTF-8. For the
|
||||
\fBTcl_UtfToExternal\fR and \fBTcl_WinUtfToTChar\fR functions, an array of
|
||||
\fBTcl_UtfToExternal\fR function, an array of
|
||||
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
|
||||
@@ -105,10 +102,15 @@ converted. \fBTCL_ENCODING_END\fR signifies that the source buffer is the last
|
||||
block in a (potentially multi-block) input stream, telling the conversion
|
||||
routine to perform any finalization that needs to occur after the last
|
||||
byte is converted and then to reset to an initial state.
|
||||
\fBTCL_ENCODING_STOPONERROR\fR signifies that the conversion routine should
|
||||
return immediately upon reading a source character that does not exist in
|
||||
the target encoding; otherwise a default fallback character will
|
||||
automatically be substituted.
|
||||
\fBTCL_ENCODING_NOCOMPLAIN\fR signifies that the conversion routine should
|
||||
not return immediately upon reading a source character that does not exist in
|
||||
the target encoding, but it will substitute a default fallback character for
|
||||
all of such characters. The flag \fBTCL_ENCODING_STOPONERROR\fR has no effect,
|
||||
it only has meaning in Tcl 8.x. The flag \fBTCL_ENCODING_STRICT\fR makes the
|
||||
encoder/decoder more strict in what it considers to be an invalid byte
|
||||
sequence. The flag \fBTCL_ENCODING_MODIFIED\fR makes
|
||||
\fBTcl_UtfToExternalDStringEx\fR and \fBTcl_UtfToExternal\fR produce the byte
|
||||
sequence \exC0\ex80 in stead of \ex00, for the utf-8/cesu-8 encoders.
|
||||
.AP Tcl_EncodingState *statePtr in/out
|
||||
Used when converting a (generally long or indefinite length) byte stream
|
||||
in a piece-by-piece fashion. The conversion routine stores its current
|
||||
@@ -208,6 +210,11 @@ When converting, if any of the characters in the source buffer cannot be
|
||||
represented in the target encoding, a default fallback character will be
|
||||
used. The return value is a pointer to the value stored in the DString.
|
||||
.PP
|
||||
\fBTcl_ExternalToUtfDStringEx\fR is the same as \fBTcl_ExternalToUtfDString\fR,
|
||||
but it has an additional flags parameter. The return value is the index of
|
||||
the first byte in the input string causing a conversion error.
|
||||
Or TCL_INDEX_NONE if all is OK.
|
||||
.PP
|
||||
\fBTcl_ExternalToUtf\fR converts a source buffer \fIsrc\fR from the specified
|
||||
\fIencoding\fR into UTF-8. Up to \fIsrcLen\fR bytes are converted from the
|
||||
source buffer and up to \fIdstLen\fR converted bytes are stored in \fIdst\fR.
|
||||
@@ -234,7 +241,7 @@ if the input stream has been damaged or if the input encoding method was
|
||||
misidentified.
|
||||
.IP \fBTCL_CONVERT_UNKNOWN\fR 29
|
||||
The source buffer contained a character that could not be represented in
|
||||
the target encoding and \fBTCL_ENCODING_STOPONERROR\fR was specified.
|
||||
the target encoding and \fBTCL_ENCODING_NOCOMPLAIN\fR was not specified.
|
||||
.RE
|
||||
.LP
|
||||
\fBTcl_UtfToExternalDString\fR converts a source buffer \fIsrc\fR from UTF-8
|
||||
@@ -246,6 +253,11 @@ characters in the source buffer cannot be represented in the target
|
||||
encoding, a default fallback character will be used. The return value is
|
||||
a pointer to the value stored in the DString.
|
||||
.PP
|
||||
\fBTcl_UtfToExternalDStringEx\fR is the same as \fBTcl_UtfToExternalDString\fR,
|
||||
but it has an additional flags parameter. The return value is the index of
|
||||
the first byte of an utf-8 byte-sequence in the input string causing a
|
||||
conversion error. Or TCL_INDEX_NONE if all is OK.
|
||||
.PP
|
||||
\fBTcl_UtfToExternal\fR converts a source buffer \fIsrc\fR from UTF-8 into
|
||||
the specified \fIencoding\fR. Up to \fIsrcLen\fR bytes are converted from
|
||||
the source buffer and up to \fIdstLen\fR converted bytes are stored in
|
||||
@@ -255,18 +267,15 @@ is filled with the corresponding number of bytes that were stored in
|
||||
\fIdst\fR. The return values are the same as the return values for
|
||||
\fBTcl_ExternalToUtf\fR.
|
||||
.PP
|
||||
\fBTcl_WinUtfToTChar\fR and \fBTcl_WinTCharToUtf\fR are
|
||||
Windows-only convenience
|
||||
functions for converting between UTF-8 and Windows strings
|
||||
based on the TCHAR type which is by convention
|
||||
a Unicode character on Windows NT.
|
||||
.PP
|
||||
\fBTcl_GetEncodingName\fR is roughly the inverse of \fBTcl_GetEncoding\fR.
|
||||
Given an \fIencoding\fR, the return value is the \fIname\fR argument that
|
||||
was used to create the encoding. The string returned by
|
||||
\fBTcl_GetEncodingName\fR is only guaranteed to persist until the
|
||||
\fIencoding\fR is deleted. The caller must not modify this string.
|
||||
.PP
|
||||
\fBTcl_GetEncodingNulLength\fR returns the length of the terminating
|
||||
nul byte sequence for strings in the specified encoding.
|
||||
.PP
|
||||
\fBTcl_SetSystemEncoding\fR sets the default encoding that should be used
|
||||
whenever the user passes a NULL value for the \fIencoding\fR argument to
|
||||
any of the other encoding functions. If \fIname\fR is NULL, the system
|
||||
@@ -287,7 +296,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 +323,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 +354,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 +386,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 +411,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
|
||||
@@ -550,5 +550,16 @@ been loaded, it attempts to load an encoding file called \fIname\fB.enc\fR
|
||||
from the \fBencoding\fR subdirectory of each directory that Tcl searches
|
||||
for its script library. If the encoding file exists, but is
|
||||
malformed, an error message will be left in \fIinterp\fR.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_GetEncodingFromObj\fR does not modify the reference count of its
|
||||
\fIobjPtr\fR argument; it only reads. Note however that this function may set
|
||||
the interpreter result; if that is the only place that is holding a reference
|
||||
to the object, it will be deleted.
|
||||
.PP
|
||||
\fBTcl_GetEncodingSearchPath\fR returns an object with a reference count of at
|
||||
least 1.
|
||||
.SH "SEE ALSO"
|
||||
encoding(n)
|
||||
.SH KEYWORDS
|
||||
utf, encoding, convert
|
||||
|
||||
+21
-4
@@ -36,13 +36,11 @@ int
|
||||
int
|
||||
\fBTcl_SetEnsembleMappingDict\fR(\fIinterp, token, dictObj\fR)
|
||||
.sp
|
||||
.VS 8.6
|
||||
int
|
||||
\fBTcl_GetEnsembleParameterList\fR(\fIinterp, token, listObjPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_SetEnsembleParameterList\fR(\fIinterp, token, listObj\fR)
|
||||
.VE 8.6
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetEnsembleSubcommandList\fR(\fIinterp, token, listObjPtr\fR)
|
||||
@@ -163,7 +161,6 @@ All command names in prefixes set via \fBTcl_SetEnsembleMappingDict\fR
|
||||
must be fully qualified.
|
||||
.TP
|
||||
\fBformal pre-subcommand parameter list\fR (read-write)
|
||||
.VS 8.6
|
||||
A list of formal parameter names (the names only being used when generating
|
||||
error messages) that come at invocation of the ensemble between the name of
|
||||
the ensemble and the subcommand argument. NULL (the default) is equivalent to
|
||||
@@ -174,7 +171,6 @@ respectively. The result of both of those functions is a Tcl result code
|
||||
ensemble) and the
|
||||
dictionary obtained from \fBTcl_GetEnsembleParameterList\fR should always be
|
||||
treated as immutable even if it is unshared.
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fBsubcommand list\fR (read-write)
|
||||
.
|
||||
@@ -213,6 +209,27 @@ namespace whose list of exported commands is used if both the mapping
|
||||
dictionary and the subcommand list properties are NULL. May be read
|
||||
using \fBTcl_GetEnsembleNamespace\fR which returns a Tcl result code
|
||||
(\fBTCL_OK\fR, or \fBTCL_ERROR\fR if the token does not refer to an ensemble).
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_FindEnsemble\fR does not modify the reference count of its
|
||||
\fIcmdNameObj\fR argument; it only reads. Note however that this function may
|
||||
set the interpreter result; if that is the only place that is holding a
|
||||
reference to the object, it will be deleted.
|
||||
.PP
|
||||
The ensemble property getters (\fBTcl_GetEnsembleMappingDict\fR,
|
||||
\fBTcl_GetEnsembleParameterList\fR, \fBTcl_GetEnsembleSubcommandList\fR, and
|
||||
\fBTcl_GetEnsembleUnknownHandler\fR) do not manipulate the reference count of
|
||||
the values they provide out; if those are non-NULL, they will have a reference
|
||||
count of at least 1. Note that these functions may set the interpreter
|
||||
result.
|
||||
.PP
|
||||
The ensemble property setters (\fBTcl_SetEnsembleMappingDict\fR,
|
||||
\fBTcl_SetEnsembleParameterList\fR, \fBTcl_SetEnsembleSubcommandList\fR, and
|
||||
\fBTcl_SetEnsembleUnknownHandler\fR) will increment the reference count of the
|
||||
new value of the property they are given if they succeed (and decrement the
|
||||
reference count of the old value of the property, if relevant). If the
|
||||
property setters return \fBTCL_ERROR\fR, the reference count of the Tcl_Obj
|
||||
argument is left unchanged.
|
||||
.SH "SEE ALSO"
|
||||
namespace(n), Tcl_DeleteCommandFromToken(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
+21
-25
@@ -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
|
||||
@@ -53,7 +50,7 @@ ORed combination of flag bits that specify additional options.
|
||||
\fBTCL_EVAL_GLOBAL\fR and \fBTCL_EVAL_DIRECT\fR are currently supported.
|
||||
.AP "const char" *fileName in
|
||||
Name of a file containing a Tcl script.
|
||||
.AP int objc in
|
||||
.AP size_t objc in
|
||||
The number of values in the array pointed to by \fIobjv\fR;
|
||||
this is also the number of words in the command.
|
||||
.AP Tcl_Obj **objv in
|
||||
@@ -67,9 +64,6 @@ first null byte are used.
|
||||
Points to first byte of script to execute (null-terminated and UTF-8).
|
||||
.AP "const 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
|
||||
@@ -99,13 +93,11 @@ its contents as a Tcl script. It returns the same information as
|
||||
If the file could not be read then a Tcl error is returned to describe
|
||||
why the file could not be read.
|
||||
The eofchar for files is
|
||||
.QW \e32
|
||||
.QW \ex1A
|
||||
(^Z) for all platforms. If you require a
|
||||
.QW ^Z
|
||||
in code for string comparison, you can use
|
||||
.QW \e032
|
||||
or
|
||||
.QW \eu001a ,
|
||||
.QW \ex1A ,
|
||||
which will be safely substituted by the Tcl interpreter into
|
||||
.QW ^Z .
|
||||
.PP
|
||||
@@ -128,16 +120,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
|
||||
@@ -150,13 +136,9 @@ equivalent to using the \fBTCL_EVAL_GLOBAL\fR flag (see below).
|
||||
of any length, concatenates them into a single string,
|
||||
then calls \fBTcl_Eval\fR to execute that string as a Tcl command.
|
||||
It returns the result of the command and also modifies
|
||||
\fIinterp->result\fR in the same way as \fBTcl_Eval\fR.
|
||||
the interpreter result 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
|
||||
@@ -206,6 +188,20 @@ the \fBreturn\fR, \fBbreak\fR, or \fBcontinue\fR command was
|
||||
invoked in an inappropriate place.
|
||||
This means that top-level applications should never see a return code
|
||||
from \fBTcl_EvalObjEx\fR other than \fBTCL_OK\fR or \fBTCL_ERROR\fR.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_EvalObjEx\fR and \fBTcl_GlobalEvalObj\fR both increment and
|
||||
decrement the reference count of their \fIobjPtr\fR argument; you must
|
||||
not pass them any value with a reference count of zero. They also
|
||||
manipulate the interpreter result; you must not count on the
|
||||
interpreter result to hold the reference count of any value over
|
||||
these calls.
|
||||
.PP
|
||||
\fBTcl_EvalObjv\fR may increment and decrement the reference count of
|
||||
any value passed via its \fIobjv\fR argument; you must not pass any
|
||||
value with a reference count of zero. This function also manipulates
|
||||
the interpreter result; you must not count on the interpreter result
|
||||
to hold the reference count of any value over this call.
|
||||
|
||||
.SH KEYWORDS
|
||||
execute, file, global, result, script, value
|
||||
|
||||
+6
-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,9 @@ 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.
|
||||
.PP
|
||||
\fBTcl_SetExitProc\fR can not be used in stub-enabled extensions.
|
||||
.SH "SEE ALSO"
|
||||
exit(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
@@ -98,6 +98,15 @@ containing the expression's value at \fI*resultPtrPtr\fR.
|
||||
In this case, the caller is responsible for calling
|
||||
\fBTcl_DecrRefCount\fR to decrement the value's reference count
|
||||
when it is finished with the value.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_ExprLongObj\fR, \fBTcl_ExprDoubleObj\fR,
|
||||
\fBTcl_ExprBooleanObj\fR, and \fBTcl_ExprObj\fR all increment and
|
||||
decrement the reference count of their \fIobjPtr\fR arguments; you
|
||||
must not pass them any value with a reference count of zero. They also
|
||||
manipulate the interpreter result; you must not count on the
|
||||
interpreter result to hold the reference count of any value over these
|
||||
calls.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tcl_ExprLong, Tcl_ExprDouble, Tcl_ExprBoolean, Tcl_ExprString, Tcl_GetObjResult
|
||||
|
||||
+190
-44
@@ -20,7 +20,7 @@ int
|
||||
int
|
||||
\fBTcl_FSUnregister\fR(\fIfsPtr\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_FSData\fR(\fIfsPtr\fR)
|
||||
.sp
|
||||
void
|
||||
@@ -45,7 +45,7 @@ int
|
||||
\fBTcl_FSDeleteFile\fR(\fIpathPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_FSRemoveDirectory\fR(\fIpathPtr, int recursive, errorPtr\fR)
|
||||
\fBTcl_FSRemoveDirectory\fR(\fIpathPtr, recursive, errorPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_FSRenameFile\fR(\fIsrcPathPtr, destPathPtr\fR)
|
||||
@@ -63,10 +63,8 @@ int
|
||||
\fBTcl_FSLoadFile\fR(\fIinterp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr,
|
||||
loadHandlePtr, unloadProcPtr\fR)
|
||||
.sp
|
||||
.VS 8.6
|
||||
int
|
||||
\fBTcl_FSUnloadFile\fR(\fIinterp, loadHandle\fR)
|
||||
.VE 8.6
|
||||
.sp
|
||||
int
|
||||
\fBTcl_FSMatchInDirectory\fR(\fIinterp, resultPtr, pathPtr, pattern, types\fR)
|
||||
@@ -81,10 +79,10 @@ int
|
||||
\fBTcl_FSUtime\fR(\fIpathPtr, tval\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_FSFileAttrsGet\fR(\fIinterp, int index, pathPtr, objPtrRef\fR)
|
||||
\fBTcl_FSFileAttrsGet\fR(\fIinterp, index, pathPtr, objPtrRef\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_FSFileAttrsSet\fR(\fIinterp, int index, pathPtr, Tcl_Obj *objPtr\fR)
|
||||
\fBTcl_FSFileAttrsSet\fR(\fIinterp, index, pathPtr, objPtr\fR)
|
||||
.sp
|
||||
const char *const *
|
||||
\fBTcl_FSFileAttrStrings\fR(\fIpathPtr, objPtrRef\fR)
|
||||
@@ -125,7 +123,7 @@ Tcl_Obj *
|
||||
int
|
||||
\fBTcl_FSConvertToPathType\fR(\fIinterp, pathPtr\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_FSGetInternalRep\fR(\fIpathPtr, fsPtr\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
@@ -146,17 +144,16 @@ Tcl_Obj *
|
||||
Tcl_StatBuf *
|
||||
\fBTcl_AllocStatBuf\fR()
|
||||
.sp
|
||||
.VS 8.6
|
||||
Tcl_WideInt
|
||||
long long
|
||||
\fBTcl_GetAccessTimeFromStat\fR(\fIstatPtr\fR)
|
||||
.sp
|
||||
unsigned
|
||||
\fBTcl_GetBlockSizeFromStat\fR(\fIstatPtr\fR)
|
||||
.sp
|
||||
Tcl_WideUInt
|
||||
unsigned long long
|
||||
\fBTcl_GetBlocksFromStat\fR(\fIstatPtr\fR)
|
||||
.sp
|
||||
Tcl_WideInt
|
||||
long long
|
||||
\fBTcl_GetChangeTimeFromStat\fR(\fIstatPtr\fR)
|
||||
.sp
|
||||
int
|
||||
@@ -177,15 +174,14 @@ int
|
||||
unsigned
|
||||
\fBTcl_GetModeFromStat\fR(\fIstatPtr\fR)
|
||||
.sp
|
||||
Tcl_WideInt
|
||||
long long
|
||||
\fBTcl_GetModificationTimeFromStat\fR(\fIstatPtr\fR)
|
||||
.sp
|
||||
Tcl_WideUInt
|
||||
unsigned long long
|
||||
\fBTcl_GetSizeFromStat\fR(\fIstatPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetUserIdFromStat\fR(\fIstatPtr\fR)
|
||||
.VE 8.6
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_GlobTypeData **srcPathPtr out
|
||||
.AP "const Tcl_Filesystem" *fsPtr in
|
||||
@@ -201,6 +197,8 @@ rename operation.
|
||||
.AP Tcl_Obj *destPathPtr in
|
||||
As for \fIpathPtr\fR, but used for the destination filename for a copy or
|
||||
rename operation.
|
||||
.AP int recursive in
|
||||
Whether to remove subdirectories and their contents as well.
|
||||
.AP "const char" *encodingName in
|
||||
The encoding of the data stored in the
|
||||
file identified by \fIpathPtr\fR and to be evaluated.
|
||||
@@ -212,7 +210,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
|
||||
@@ -222,12 +220,16 @@ The second of two path values to compare. The value may be converted
|
||||
to \fBpath\fR type.
|
||||
.AP Tcl_Obj *listObj in
|
||||
The list of path elements to operate on with a \fBjoin\fR operation.
|
||||
.AP int elements in
|
||||
If non-negative, the number of elements in the \fIlistObj\fR which should
|
||||
be joined together. If negative, then all elements are joined.
|
||||
.AP size_t elements in
|
||||
The number of elements in the \fIlistObj\fR which should
|
||||
be joined together. If TCL_INDEX_NONE, then all elements are joined.
|
||||
.AP Tcl_Obj **errorPtr out
|
||||
In the case of an error, filled with a value containing the name of
|
||||
the file which caused an error in the various copy/rename operations.
|
||||
.AP int index in
|
||||
The index of the attribute in question.
|
||||
.AP Tcl_Obj *objPtr in
|
||||
The value to set in the operation.
|
||||
.AP Tcl_Obj **objPtrRef out
|
||||
Filled with a value containing the result of the operation.
|
||||
.AP Tcl_Obj *resultPtr out
|
||||
@@ -245,11 +247,11 @@ The structure that contains the result of a stat or lstat operation.
|
||||
Name of a procedure to look up in the file's symbol table
|
||||
.AP "const char" *sym2 in
|
||||
Name of a procedure to look up in the file's symbol table
|
||||
.AP Tcl_PackageInitProc **proc1Ptr out
|
||||
.AP Tcl_LibraryInitProc **proc1Ptr out
|
||||
Filled with the init function for this code.
|
||||
.AP Tcl_PackageInitProc **proc2Ptr out
|
||||
.AP Tcl_LibraryInitProc **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
|
||||
@@ -267,11 +269,11 @@ allowed for the \fImode\fR argument to the Tcl \fBopen\fR command.
|
||||
.AP int permissions in
|
||||
POSIX-style permission flags such as 0644. If a new file is created, these
|
||||
permissions will be set on the created file.
|
||||
.AP int *lenPtr out
|
||||
.AP "size_t \&| int" *lenPtr out
|
||||
If non-NULL, filled with the number of elements in the split path.
|
||||
.AP Tcl_Obj *basePtr in
|
||||
The base path on to which to join the given elements. May be NULL.
|
||||
.AP int objc in
|
||||
.AP size_t objc in
|
||||
The number of elements in \fIobjv\fR.
|
||||
.AP "Tcl_Obj *const" objv[] in
|
||||
The elements to join to the given base path.
|
||||
@@ -418,23 +420,21 @@ caller (with a reference count of 0).
|
||||
the encoding identified by \fIencodingName\fR and evaluates
|
||||
its contents as a Tcl script. It returns the same information as
|
||||
\fBTcl_EvalObjEx\fR.
|
||||
If \fIencodingName\fR is NULL, the system encoding is used for
|
||||
If \fIencodingName\fR is NULL, the utf-8 encoding is used for
|
||||
reading the file contents.
|
||||
If the file could not be read then a Tcl error is returned to describe
|
||||
why the file could not be read.
|
||||
The eofchar for files is
|
||||
.QW \e32
|
||||
.QW \ex1A
|
||||
(^Z) for all platforms.
|
||||
If you require a
|
||||
.QW ^Z
|
||||
in code for string comparison, you can use
|
||||
.QW \e032
|
||||
or
|
||||
.QW \eu001a ,
|
||||
.QW \ex1A ,
|
||||
which will be safely substituted by the Tcl interpreter into
|
||||
.QW ^Z .
|
||||
\fBTcl_FSEvalFile\fR is a simpler version of
|
||||
\fBTcl_FSEvalFileEx\fR that always uses the system encoding
|
||||
\fBTcl_FSEvalFileEx\fR that always uses the utf-8 encoding
|
||||
when reading the file.
|
||||
.PP
|
||||
\fBTcl_FSLoadFile\fR dynamically loads a binary code file into memory and
|
||||
@@ -444,20 +444,16 @@ belongs will be called. If that filesystem does not implement this
|
||||
function (most virtual filesystems will not, because of OS limitations
|
||||
in dynamically loading binary code), Tcl will attempt to copy the file
|
||||
to a temporary directory and load that temporary file.
|
||||
.VS 8.6
|
||||
\fBTcl_FSUnloadFile\fR reverses the operation, asking for the library
|
||||
indicated by the \fIloadHandle\fR to be removed from the process. Note that,
|
||||
unlike with the \fBunload\fR command, this does not give the library any
|
||||
opportunity to clean up.
|
||||
.VE 8.6
|
||||
.PP
|
||||
Both the above functions return a standard Tcl completion code. If an error
|
||||
occurs, an error message is left in the \fIinterp\fR's result.
|
||||
.PP
|
||||
.VS 8.6
|
||||
The token provided via the variable indicated by \fIloadHandlePtr\fR may be
|
||||
used with \fBTcl_FindSymbol\fR.
|
||||
.VE 8.6
|
||||
.PP
|
||||
\fBTcl_FSMatchInDirectory\fR is used by the globbing code to search a
|
||||
directory for all files which match a given pattern. The appropriate
|
||||
@@ -724,7 +720,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,11 +787,10 @@ 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
|
||||
.VS 8.6
|
||||
The portable fields of a \fITcl_StatBuf\fR may be read using the following
|
||||
functions, each of which returns the value of the corresponding field listed
|
||||
in the table below. Note that on some platforms there may be other fields in
|
||||
@@ -819,7 +814,6 @@ for a full description of these fields.
|
||||
\fBTcl_GetBlocksFromStat\fR st_blocks
|
||||
\fBTcl_GetBlockSizeFromStat\fR st_blksize
|
||||
.DE
|
||||
.VE 8.6
|
||||
.SH "THE VIRTUAL FILESYSTEM API"
|
||||
.PP
|
||||
A filesystem provides a \fBTcl_Filesystem\fR structure that contains
|
||||
@@ -841,7 +835,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 +1012,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 +1022,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 +1032,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 +1043,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 +1054,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
|
||||
@@ -1638,6 +1632,158 @@ typedef int \fBTcl_FSChdirProc\fR(
|
||||
The \fBTcl_FSChdirProc\fR changes the applications current working
|
||||
directory to the value specified in \fIpathPtr\fR. The function returns
|
||||
-1 on error or 0 on success.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.SS "PUBLIC API CALLS"
|
||||
.PP
|
||||
For all of these functions, \fIpathPtr\fR (including the \fIsrcPathPtr\fR and
|
||||
\fIdestPathPtr\fR arguments to \fBTcl_FSCopyFile\fR,
|
||||
\fBTcl_FSCopyDirectory\fR, and \fBTcl_FSRenameFile\fR, the \fIfirstPtr\fR and
|
||||
\fIsecondPtr\fR arguments to \fBTcl_FSEqualPaths\fR, and the \fIlinkNamePtr\fR
|
||||
and \fItoPtr\fR arguments to \fBTcl_FSLink\fR) must not be a zero reference
|
||||
count value; references may be retained in internal caches even for
|
||||
theoretically read-only operations. These functions may also manipulate the
|
||||
interpreter result (if they take and are given a non-NULL \fIinterp\fR
|
||||
argument); you must not count on the interpreter result to hold the reference
|
||||
count of any argument value over these calls and should manage your own
|
||||
references there. However, references held by the arguments to a Tcl command
|
||||
\fIare\fR suitable for reference count management purposes for the duration of
|
||||
the implementation of that command.
|
||||
.PP
|
||||
The \fIerrorPtr\fR argument to \fBTcl_FSCopyDirectory\fR and
|
||||
\fBTcl_FSRemoveDirectory\fR is, when an object is set into it at all, set to
|
||||
an object with a non-zero reference count that should be passed to
|
||||
\fBTcl_DecrRefCount\fR when no longer needed.
|
||||
.PP
|
||||
\fBTcl_FSListVolumes\fR always returns a zero-reference object, much
|
||||
like \fBTcl_NewObj\fR.
|
||||
.PP
|
||||
\fBTcl_FSLink\fR always returns a non-zero-reference object when it is
|
||||
asked to read; you must call \fBTcl_DecrRefCount\fR on the object
|
||||
once you no longer need it.
|
||||
.PP
|
||||
\fBTcl_FSGetCwd\fR always returns a non-zero-reference object; you
|
||||
must call \fBTcl_DecrRefCount\fR on the object once you no longer need
|
||||
it.
|
||||
.PP
|
||||
\fBTcl_FSPathSeparator\fR always returns a zero-reference object, much
|
||||
like \fBTcl_NewObj\fR.
|
||||
.PP
|
||||
\fBTcl_FSJoinPath\fR always returns a zero-reference object, much
|
||||
like \fBTcl_NewObj\fR. Its \fIlistObj\fR argument can have any reference
|
||||
count; it is only read by this function.
|
||||
.PP
|
||||
\fBTcl_FSSplitPath\fR always returns a zero-reference object, much
|
||||
like \fBTcl_NewObj\fR.
|
||||
.PP
|
||||
\fBTcl_FSGetNormalizedPath\fR returns an object with a non-zero
|
||||
reference count where Tcl is the owner. You should increment its
|
||||
reference count if you want to retain it, but do not need to if you
|
||||
are just using the value immediately.
|
||||
.PP
|
||||
\fBTcl_FSJoinToPath\fR always returns a zero-reference object, much like
|
||||
\fBTcl_NewObj\fR. Its \fIbasePtr\fR argument follows the rules above for
|
||||
\fIpathPtr\fR, as do the values in the \fIobjv\fR argument.
|
||||
.PP
|
||||
\fBTcl_FSGetTranslatedPath\fR returns a non-zero-reference object (or
|
||||
NULL in the error case); you must call \fBTcl_DecrRefCount\fR on the
|
||||
object once you no longer need it.
|
||||
.PP
|
||||
\fBTcl_FSNewNativePath\fR always returns a zero-reference object (or
|
||||
NULL), much like \fBTcl_NewObj\fR.
|
||||
.PP
|
||||
\fBTcl_FSFileSystemInfo\fR always returns a zero-reference object (or
|
||||
NULL), much like \fBTcl_NewObj\fR.
|
||||
.PP
|
||||
The \fIobjPtr\fR and \fIobjPtrRef\fR arguments to \fBTcl_FSFileAttrsGet\fR,
|
||||
\fBTcl_FSFileAttrsSet\fR and \fBTcl_FSFileAttrStrings\fR are conventional Tcl
|
||||
values; the \fIobjPtr\fR argument will be read but not retained, and the
|
||||
\fIobjPtrRef\fR argument will have (on success) a zero-reference value written
|
||||
into it (as with \fBTcl_NewObj\fR). \fBTcl_FSFileAttrsGet\fR and
|
||||
\fBTcl_FSFileAttrsSet\fR may also manipulate the interpreter result.
|
||||
.PP
|
||||
The \fIresultPtr\fR argument to \fBTcl_FSMatchInDirectory\fR will not have its
|
||||
reference count manipulated, but it should have a reference count of no more
|
||||
than 1, and should not be the current interpreter result (as the function may
|
||||
overwrite that on error).
|
||||
.SS "VIRTUAL FILESYSTEM INTERFACE"
|
||||
.PP
|
||||
For all virtual filesystem implementation functions, any \fIpathPtr\fR
|
||||
arguments should not have their reference counts manipulated. If they take an
|
||||
\fIinterp\fR argument, they may set an error message in that, but must not
|
||||
manipulate the \fIpathPtr\fR afterwards. Aside from that:
|
||||
.TP
|
||||
\fIinternalToNormalizedProc\fR
|
||||
.
|
||||
This should return a zero-reference count value, as if allocated with
|
||||
\fBTcl_NewObj\fR.
|
||||
.TP
|
||||
\fInormalizePathProc\fR
|
||||
.
|
||||
Unlike with other API implementation functions, the \fIpathPtr\fR argument
|
||||
here is guaranteed to be an unshared object that should be updated. Its
|
||||
reference count should not be modified.
|
||||
.TP
|
||||
\fIfilesystemPathTypeProc\fR
|
||||
.
|
||||
The return value (if non-NULL) either has a reference count of zero or needs
|
||||
to be maintained (on a per-thread basis) by the filesystem. Tcl will increment
|
||||
the reference count of the value if it wishes to retain it.
|
||||
.TP
|
||||
\fIfilesystemSeparatorProc\fR
|
||||
.
|
||||
The return value should be a value with reference count of zero.
|
||||
.TP
|
||||
\fImatchInDirectoryProc\fR
|
||||
.
|
||||
The \fIresultPtr\fR argument should be assumed to hold a list that can be
|
||||
appended to (i.e., that has a reference count no greater than 1). No reference
|
||||
to it should be retained.
|
||||
.TP
|
||||
\fIlinkProc\fR
|
||||
.
|
||||
If \fItoPtr\fR is NULL, this should return a value with reference count 1 that
|
||||
has just been allocated and passed to \fBTcl_IncrRefCount\fR. If \fItoPtr\fR
|
||||
is not NULL, it should be returned on success.
|
||||
.TP
|
||||
\fIlistVolumesProc\fR
|
||||
.
|
||||
The result value should be a list (if non-NULL); it will have its reference
|
||||
count decremented once (with \fBTcl_DecrRefCount\fR) by Tcl once done.
|
||||
.TP
|
||||
\fIfileAttrStringsProc\fR
|
||||
.
|
||||
If the result is NULL, the \fIobjPtrRef\fR should have a list value written to
|
||||
it; that list will have its reference count both incremented (with
|
||||
\fBTcl_IncrRefCount\fR) and decremented (with \fBTcl_DecrRefCount\fR).
|
||||
.TP
|
||||
\fIfileAttrsGetProc\fR
|
||||
.
|
||||
The \fIobjPtrRef\fR argument should have (on non-error return) a zero
|
||||
reference count value written to it (allocated as if with \fBTcl_NewObj\fR).
|
||||
.TP
|
||||
\fIfileAttrsSetProc\fR
|
||||
.
|
||||
The \fIobjPtr\fR argument should either just be read or its reference count
|
||||
incremented to retain it.
|
||||
.TP
|
||||
\fIremoveDirectoryProc\fR
|
||||
.
|
||||
If an error is being reported, the problem filename reported via
|
||||
\fIerrorPtr\fR should be newly allocated (as if with \fBTcl_NewObj\fR) and
|
||||
have a reference count of 1 (i.e., have been passed to
|
||||
\fBTcl_IncrRefCount\fR).
|
||||
.TP
|
||||
\fIcopyDirectoryProc\fR
|
||||
.
|
||||
If an error is being reported, the problem filename reported via
|
||||
\fIerrorPtr\fR should be newly allocated (as if with \fBTcl_NewObj\fR) and
|
||||
have a reference count of 1 (i.e., have been passed to
|
||||
\fBTcl_IncrRefCount\fR).
|
||||
.TP
|
||||
\fIgetCwdProc\fR
|
||||
.
|
||||
The result will be passed to \fBTcl_DecrRefCount\fR by the implementation of
|
||||
\fBTcl_FSGetCwd\fR after it has been normalized.
|
||||
.SH "SEE ALSO"
|
||||
cd(n), file(n), filename(n), load(n), open(n), pwd(n), source(n), unload(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+6
-2
@@ -13,7 +13,7 @@ Tcl_FindExecutable, Tcl_GetNameOfExecutable \- identify or return the name of th
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
void
|
||||
const char *
|
||||
\fBTcl_FindExecutable\fR(\fIargv0\fR)
|
||||
.sp
|
||||
const char *
|
||||
@@ -35,6 +35,9 @@ Tcl. For example, it is needed on some platforms in the
|
||||
implementation of the \fBload\fR command.
|
||||
It is also returned by the \fBinfo nameofexecutable\fR command.
|
||||
.PP
|
||||
The result of \fBTcl_FindExecutable\fR is the full Tcl version with
|
||||
build information (e.g., \fB9.0.0+abcdef...abcdef.gcc-1002\fR).
|
||||
.PP
|
||||
On UNIX platforms this procedure is typically invoked as the very
|
||||
first thing in the application's main program; it must be passed
|
||||
\fIargv[0]\fR as its argument. It is important not to change the
|
||||
@@ -58,6 +61,7 @@ internal full path name of the executable file as computed by
|
||||
equivalent to the \fBinfo nameofexecutable\fR command. NULL
|
||||
is returned if the internal full path name has not been
|
||||
computed or unknown.
|
||||
|
||||
.PP
|
||||
\fBTcl_FindExecutable\fR can not be used in stub-enabled extensions.
|
||||
.SH KEYWORDS
|
||||
binary, executable file
|
||||
|
||||
+28
-11
@@ -27,19 +27,22 @@ Interpreter to use for error reporting; if NULL, then no message is
|
||||
provided on errors.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
The string value of this value is used to search through \fItablePtr\fR.
|
||||
The internal representation is modified to hold the index of the matching
|
||||
If the \fBTCL_INDEX_TEMP_TABLE\fR flag is not specified,
|
||||
the internal representation is modified to hold the index of the matching
|
||||
table entry.
|
||||
.AP "const char *const" *tablePtr in
|
||||
An array of null-terminated strings. The end of the array is marked
|
||||
by a NULL string pointer.
|
||||
Note that references to the \fItablePtr\fR may be retained in the
|
||||
Note that, unless the \fBTCL_INDEX_TEMP_TABLE\fR flag is specified,
|
||||
references to the \fItablePtr\fR may be retained in the
|
||||
internal representation of \fIobjPtr\fR, so this should represent the
|
||||
address of a statically-allocated array.
|
||||
.AP "const void" *structTablePtr in
|
||||
An array of arbitrary type, typically some \fBstruct\fR type.
|
||||
The first member of the structure must be a null-terminated string.
|
||||
The size of the structure is given by \fIoffset\fR.
|
||||
Note that references to the \fIstructTablePtr\fR may be retained in the
|
||||
Note that, unless the \fBTCL_INDEX_TEMP_TABLE\fR flag is specified,
|
||||
references to the \fIstructTablePtr\fR may be retained in the
|
||||
internal representation of \fIobjPtr\fR, so this should represent the
|
||||
address of a statically-allocated array of structures.
|
||||
.AP int offset in
|
||||
@@ -50,10 +53,13 @@ Null-terminated string describing what is being looked up, such as
|
||||
\fBoption\fR. This string is included in error messages.
|
||||
.AP int flags in
|
||||
OR-ed combination of bits providing additional information for
|
||||
operation. The only bit that is currently defined is \fBTCL_EXACT\fR.
|
||||
.AP int *indexPtr out
|
||||
The index of the string in \fItablePtr\fR that matches the value of
|
||||
\fIobjPtr\fR is returned here.
|
||||
operation. The only bits that are currently defined are \fBTCL_EXACT\fR
|
||||
, \fBTCL_INDEX_TEMP_TABLE\fR, and \fBTCL_NULL_OK\fR.
|
||||
.AP enum|char|short|int|long *indexPtr out
|
||||
If not (int *)NULL, the index of the string in \fItablePtr\fR that
|
||||
matches the value of \fIobjPtr\fR is returned here. The variable can
|
||||
be any integer type, signed or unsigned, char, short, long or
|
||||
long long. It can also be an enum.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
@@ -66,8 +72,8 @@ the strings in \fItablePtr\fR to find a match. A match occurs if
|
||||
\fItablePtr\fR, or if it is a non-empty unique abbreviation
|
||||
for exactly one of the strings in \fItablePtr\fR and the
|
||||
\fBTCL_EXACT\fR flag was not specified; in either case
|
||||
the index of the matching entry is stored at \fI*indexPtr\fR
|
||||
and \fBTCL_OK\fR is returned.
|
||||
\fBTCL_OK\fR is returned. If \fIindexPtr\fR is not NULL the index
|
||||
of the matching entry is stored at \fI*indexPtr\fR.
|
||||
.PP
|
||||
If there is no matching entry,
|
||||
\fBTCL_ERROR\fR is returned and an error message is left in \fIinterp\fR's
|
||||
@@ -76,7 +82,8 @@ error message to indicate what was being looked up. For example,
|
||||
if \fImsg\fR is \fBoption\fR the error message will have a form like
|
||||
.QW "\fBbad option \N'34'firt\N'34': must be first, second, or third\fR" .
|
||||
.PP
|
||||
If \fBTcl_GetIndexFromObj\fR completes successfully it modifies the
|
||||
If the \fBTCL_INDEX_TEMP_TABLE\fR was not specified, when
|
||||
\fBTcl_GetIndexFromObj\fR completes successfully it modifies the
|
||||
internal representation of \fIobjPtr\fR to hold the address of
|
||||
the table and the index of the matching entry. If \fBTcl_GetIndexFromObj\fR
|
||||
is invoked again with the same \fIobjPtr\fR and \fItablePtr\fR
|
||||
@@ -84,7 +91,11 @@ arguments (e.g. during a reinvocation of a Tcl command), it returns
|
||||
the matching index immediately without having to redo the lookup
|
||||
operation. Note: \fBTcl_GetIndexFromObj\fR assumes that the entries
|
||||
in \fItablePtr\fR are static: they must not change between
|
||||
invocations. If the value of \fIobjPtr\fR is the empty string,
|
||||
invocations. This caching mechanism can be disallowed by specifying
|
||||
the \fBTCL_INDEX_TEMP_TABLE\fR flag.
|
||||
If the \fBTCL_NULL_OK\fR flag was specified, objPtr is allowed
|
||||
to be NULL or the empty string. The resulting index is -1.
|
||||
Otherwise, if the value of \fIobjPtr\fR is the empty string,
|
||||
\fBTcl_GetIndexFromObj\fR will treat it as a non-matching value
|
||||
and return \fBTCL_ERROR\fR.
|
||||
.PP
|
||||
@@ -98,6 +109,12 @@ array of characters at \fItablePtr\fR+\fIoffset\fR bytes, etc.)
|
||||
This is particularly useful when processing things like
|
||||
\fBTk_ConfigurationSpec\fR, whose string keys are in the same place in
|
||||
each of several array elements.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_GetIndexFromObj\fR and \fBTcl_GetIndexFromObjStruct\fR do not modify
|
||||
the reference count of their \fIobjPtr\fR arguments; they only read. Note
|
||||
however that these functions may set the interpreter result; if that is the
|
||||
only place that is holding a reference to the object, it will be deleted.
|
||||
.SH "SEE ALSO"
|
||||
prefix(n), Tcl_WrongNumArgs(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
+17
-4
@@ -22,6 +22,9 @@ int
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetBoolean\fR(\fIinterp, src, intPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetBool\fR(\fIinterp, src, flags, charPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *doublePtr out
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -33,6 +36,12 @@ Points to place to store integer value converted from \fIsrc\fR.
|
||||
.AP double *doublePtr out
|
||||
Points to place to store double-precision floating-point
|
||||
value converted from \fIsrc\fR.
|
||||
.AP char *charPtr out
|
||||
Points to place to store boolean value (0 or 1) value converted from \fIsrc\fR.
|
||||
.AP int flags in
|
||||
0 or TCL_NULL_OK. If TCL_NULL_OK
|
||||
is used, then the empty string or NULL will result in \fBTcl_GetBool\fR
|
||||
return TCL_OK, the *charPtr filled with the value \fB'\exFF'\fR;
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
@@ -55,15 +64,15 @@ after the optional white space and sign are
|
||||
.QW \fB0x\fR
|
||||
then \fIsrc\fR is expected to be in hexadecimal form; otherwise,
|
||||
if the first such characters are
|
||||
.QW \fB0d\fR
|
||||
then \fIsrc\fR is expected to be in decimal form; otherwise,
|
||||
if the first such characters are
|
||||
.QW \fB0o\fR
|
||||
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
|
||||
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
|
||||
@@ -94,6 +103,10 @@ If \fIsrc\fR is any of \fB1\fR, \fBtrue\fR, \fByes\fR, or \fBon\fR,
|
||||
then 1 is stored at \fI*intPtr\fR.
|
||||
Any of these values may be abbreviated, and upper-case spellings
|
||||
are also acceptable.
|
||||
.PP
|
||||
\fBTcl_GetBool\fR functions almost the same as \fBTcl_GetBoolean\fR,
|
||||
but it has an additional parameter \fBflags\fR, which can be used
|
||||
to specify whether the empty string or NULL is accepted as valid.
|
||||
|
||||
.SH KEYWORDS
|
||||
boolean, conversion, double, floating-point, integer
|
||||
|
||||
+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
|
||||
|
||||
+1
-2
@@ -15,14 +15,13 @@ Tcl_GetVersion \- get the version of the library at runtime
|
||||
.sp
|
||||
\fBTcl_GetVersion\fR(\fImajor, minor, patchLevel, type\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_ReleaseType *patchLevel out
|
||||
.AP int *major out
|
||||
Major version number of the Tcl library.
|
||||
.AP int *minor out
|
||||
Minor version number of the Tcl library.
|
||||
.AP int *patchLevel out
|
||||
The patch level of the Tcl library (or alpha or beta number).
|
||||
.AP Tcl_ReleaseType *type out
|
||||
.AP int *type out
|
||||
The type of release, also indicates the type of patch level. Can be
|
||||
one of \fBTCL_ALPHA_RELEASE\fR, \fBTCL_BETA_RELEASE\fR, or
|
||||
\fBTCL_FINAL_RELEASE\fR.
|
||||
|
||||
+19
-11
@@ -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.
|
||||
@@ -281,7 +275,7 @@ The \fIhashKeyProc\fR member contains the address of a function called to
|
||||
calculate a hash value for the key.
|
||||
.PP
|
||||
.CS
|
||||
typedef unsigned int \fBTcl_HashKeyProc\fR(
|
||||
typedef TCL_HASH_TYPE \fBTcl_HashKeyProc\fR(
|
||||
Tcl_HashTable *\fItablePtr\fR,
|
||||
void *\fIkeyPtr\fR);
|
||||
.CE
|
||||
@@ -330,5 +324,19 @@ typedef void \fBTcl_FreeHashEntryProc\fR(
|
||||
If this is NULL then \fBTcl_Free\fR is used to free the space for the entry.
|
||||
Tcl_Obj* keys use this function to decrement the reference count on the
|
||||
value.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
When a hash table is created with \fBTcl_InitCustomHashTable\fR, the
|
||||
\fBTcl_CreateHashEntry\fR function will increment the reference count of its
|
||||
\fIkey\fR argument when it creates a key (but not if there is an existing
|
||||
matching key). The reference count of the key will be decremented when the
|
||||
corresponding hash entry is deleted, whether with \fBTcl_DeleteHashEntry\fR or
|
||||
with \fBTcl_DeleteHashTable\fR. The \fBTcl_GetHashKey\fR function will return
|
||||
the key without further modifying its reference count.
|
||||
.PP
|
||||
Custom hash tables that use a Tcl_Obj* as key will generally need to do
|
||||
something similar in their \fIallocEntryProc\fR.
|
||||
.SH "SEE ALSO"
|
||||
Dict(3)
|
||||
.SH KEYWORDS
|
||||
hash table, key, lookup, search, value
|
||||
|
||||
+17
-1
@@ -2,7 +2,7 @@
|
||||
'\" Copyright (c) 1998-2000 Scriptics Corporation.
|
||||
'\" All rights reserved.
|
||||
'\"
|
||||
.TH Tcl_Init 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_Init 3 9.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
@@ -13,10 +13,15 @@ Tcl_Init \- find and source initialization script
|
||||
.sp
|
||||
int
|
||||
\fBTcl_Init\fR(\fIinterp\fR)
|
||||
.sp
|
||||
const char *
|
||||
\fBTcl_SetPreInitScript\fR(\fIscriptPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *interp
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to initialize.
|
||||
.AP "const char" *scriptPtr in
|
||||
Address of the initialization script.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
@@ -26,6 +31,17 @@ Interpreter to initialize.
|
||||
path.
|
||||
.PP
|
||||
\fBTcl_Init\fR is typically called from \fBTcl_AppInit\fR procedures.
|
||||
.PP
|
||||
\fBTcl_SetPreInitScript\fR registers the pre-initialization script and
|
||||
returns the former (now replaced) script pointer.
|
||||
A value of \fINULL\fR may be passed to not register any script.
|
||||
The pre-initialization script is executed by \fBTcl_Init\fR before accessing
|
||||
the file system. The purpose is to typically prepare a custom file system
|
||||
(like an embedded zip-file) to be activated before the search.
|
||||
|
||||
When used in stub-enabled embedders, the stubs table must be first initialized
|
||||
using one of \fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR, \fBTcl_FindExecutable\fR
|
||||
or \fBTclZipfs_AppHook\fR before \fBTcl_SetPreInitScript\fR may be called.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tcl_AppInit, Tcl_Main
|
||||
|
||||
+6
-6
@@ -23,11 +23,11 @@ Tcl interpreter handle.
|
||||
A version string consisting of one or more decimal numbers
|
||||
separated by dots.
|
||||
.AP int exact in
|
||||
Non-zero means that only the particular version specified by
|
||||
1 means that only the particular version specified by
|
||||
\fIversion\fR is acceptable.
|
||||
Zero means that versions newer than \fIversion\fR are also
|
||||
0 means that versions newer than \fIversion\fR are also
|
||||
acceptable as long as they have the same major version number
|
||||
as \fIversion\fR.
|
||||
as \fIversion\fR. Other bits have no effect.
|
||||
.BE
|
||||
.SH INTRODUCTION
|
||||
.PP
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
'\"
|
||||
'\" Copyright (c) 2018 Tcl Core Team
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_InitSubsystems 3 8.7 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_InitSubsystems \- initialize the Tcl library.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
const char *
|
||||
\fBTcl_InitSubsystems\fR(\fIvoid\fR)
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The \fBTcl_InitSubsystems\fR procedure initializes the Tcl
|
||||
library. This procedure is typically invoked as the very
|
||||
first thing in the application's main program.
|
||||
.PP
|
||||
The result of \fBTcl_InitSubsystems\fR is the full Tcl version with
|
||||
build information (e.g., \fB9.0.0+abcdef...abcdef.gcc-1002\fR).
|
||||
.PP
|
||||
\fBTcl_InitSubsystems\fR is very similar in use to
|
||||
\fBTcl_FindExecutable\fR. It can be used when Tcl is
|
||||
used as utility library, no other encodings than utf-8,
|
||||
iso8859-1 or utf-16 are used, and no interest exists in the
|
||||
value of \fBinfo nameofexecutable\fR. The system encoding will not
|
||||
be extracted from the environment, but falls back to utf-8.
|
||||
.SH KEYWORDS
|
||||
binary, executable file
|
||||
+40
-2
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_NewIntObj, Tcl_NewLongObj, Tcl_NewWideIntObj, Tcl_SetIntObj, Tcl_SetLongObj, Tcl_SetWideIntObj, Tcl_GetIntFromObj, Tcl_GetLongFromObj, Tcl_GetWideIntFromObj, Tcl_NewBignumObj, Tcl_SetBignumObj, Tcl_GetBignumFromObj, Tcl_TakeBignumFromObj \- manipulate Tcl values as integers
|
||||
Tcl_NewIntObj, Tcl_NewLongObj, Tcl_NewWideIntObj, Tcl_SetIntObj, Tcl_SetLongObj, Tcl_SetWideIntObj, Tcl_GetIntFromObj, Tcl_GetIntForIndex, Tcl_GetLongFromObj, Tcl_GetWideIntFromObj, Tcl_NewBignumObj, Tcl_SetBignumObj, Tcl_GetBignumFromObj, Tcl_TakeBignumFromObj \- manipulate Tcl values as integers
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -32,6 +32,9 @@ int
|
||||
\fBTcl_GetIntFromObj\fR(\fIinterp, objPtr, intPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetIntForIndex\fR(\fIinterp, objPtr, endValue, indexPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetLongFromObj\fR(\fIinterp, objPtr, longPtr\fR)
|
||||
.sp
|
||||
int
|
||||
@@ -55,6 +58,8 @@ int
|
||||
\fBTcl_InitBignumFromDouble\fR(\fIinterp, doubleValue, bigValue\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_WideInt doubleValue in/out
|
||||
.AP size_t endValue in
|
||||
\fBTcl_GetIntForIndex\fR will return this when the input value is "end".
|
||||
.AP int intValue in
|
||||
Integer value used to initialize or set a Tcl value.
|
||||
.AP long longValue in
|
||||
@@ -75,6 +80,8 @@ retrieval fails.
|
||||
Points to place to store the integer value retrieved from \fIobjPtr\fR.
|
||||
.AP long *longPtr out
|
||||
Points to place to store the long integer value retrieved from \fIobjPtr\fR.
|
||||
.AP size_t *indexPtr out
|
||||
Points to place to store the size_t value retrieved from \fIobjPtr\fR.
|
||||
.AP Tcl_WideInt *widePtr out
|
||||
Points to place to store the wide integer value retrieved from \fIobjPtr\fR.
|
||||
.AP mp_int *bigValue in/out
|
||||
@@ -97,7 +104,7 @@ are provided by the C language standard. The \fBTcl_WideInt\fR type is a
|
||||
typedef defined to be whatever signed integral type covers at least the
|
||||
64-bit integer range (-9223372036854775808 to 9223372036854775807). Depending
|
||||
on the platform and the C compiler, the actual type might be
|
||||
\fBlong int\fR, \fBlong long int\fR, \fB__int64\fR, or something else.
|
||||
\fBlong long int\fR, or something else.
|
||||
The \fBmp_int\fR type is a multiple-precision integer type defined
|
||||
by the LibTomMath multiple-precision integer library.
|
||||
.PP
|
||||
@@ -115,6 +122,16 @@ violates Tcl's copy-on-write policy. Any existing string representation
|
||||
or internal representation in the unshared Tcl value will be freed
|
||||
as a consequence of setting the new value.
|
||||
.PP
|
||||
The \fBTcl_GetIntForIndex\fR routine attempts to retrieve an index
|
||||
value from the Tcl value \fIobjPtr\fR. If the attempt succeeds,
|
||||
then \fBTCL_OK\fR is returned, and the value is written to the
|
||||
storage provided by the caller. The attempt might fail if
|
||||
\fIobjPtr\fR does not hold an index value. If the attempt fails,
|
||||
then \fBTCL_ERROR\fR is returned, and if \fIinterp\fR is non-NULL,
|
||||
an error message is left in \fIinterp\fR. The \fBTcl_ObjType\fR
|
||||
of \fIobjPtr\fR may be changed to make subsequent calls to the
|
||||
same routine more efficient.
|
||||
.PP
|
||||
The \fBTcl_GetIntFromObj\fR, \fBTcl_GetLongFromObj\fR,
|
||||
\fBTcl_GetWideIntFromObj\fR, \fBTcl_GetBignumFromObj\fR, and
|
||||
\fBTcl_TakeBignumFromObj\fR routines attempt to retrieve an integral
|
||||
@@ -145,6 +162,27 @@ If anything later in the caller requires
|
||||
The \fBTcl_InitBignumFromDouble\fR routine is a utility procedure
|
||||
that extracts the integer part of \fIdoubleValue\fR and stores that
|
||||
integer value in the \fBmp_int\fR value \fIbigValue\fR.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_NewIntObj\fR, \fBTcl_NewLongObj\fR, \fBTcl_NewWideIntObj\fR, and
|
||||
\fBTcl_NewBignumObj\fR always return a zero-reference object, much like
|
||||
\fBTcl_NewObj\fR.
|
||||
.PP
|
||||
\fBTcl_SetIntObj\fR, \fBTcl_SetLongObj\fR, \fBTcl_SetWideIntObj\fR, and
|
||||
\fBTcl_SetBignumObj\fR do not modify the reference count of their \fIobjPtr\fR
|
||||
arguments, but do require that the object be unshared.
|
||||
.PP
|
||||
\fBTcl_GetIntFromObj\fR, \fBTcl_GetIntForIndex\fR, \fBTcl_GetLongFromObj\fR,
|
||||
\fBTcl_GetWideIntFromObj\fR, \fBTcl_GetBignumFromObj\fR, and
|
||||
\fBTcl_TakeBignumFromObj\fR do not modify the reference count of their
|
||||
\fIobjPtr\fR arguments; they only read. Note however that this function may
|
||||
set the interpreter result; if that is the only place that is holding a
|
||||
reference to the object, it will be deleted. Also note that if
|
||||
\fBTcl_TakeBignumFromObj\fR is given an unshared value, the value of that
|
||||
object may be modified; it is intended to be used when the value is
|
||||
.QW consumed
|
||||
by the operation at this point.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult
|
||||
.SH KEYWORDS
|
||||
|
||||
-134
@@ -1,134 +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_Interp 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_Interp \- client-visible fields of interpreter structures
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
typedef struct {
|
||||
char *\fIresult\fR;
|
||||
Tcl_FreeProc *\fIfreeProc\fR;
|
||||
int \fIerrorLine\fR;
|
||||
} \fBTcl_Interp\fR;
|
||||
|
||||
typedef void \fBTcl_FreeProc\fR(
|
||||
char *\fIblockPtr\fR);
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The \fBTcl_CreateInterp\fR procedure returns a pointer to a Tcl_Interp
|
||||
structure. Callers of \fBTcl_CreateInterp\fR should use this pointer
|
||||
as an opaque token, suitable for nothing other than passing back to
|
||||
other routines in the Tcl interface. Accessing fields directly through
|
||||
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,
|
||||
and by \fBTcl_Eval\fR back to its callers.
|
||||
The \fIresult\fR field points to the string that represents the
|
||||
result or error message, and the \fIfreeProc\fR field tells how
|
||||
to dispose of the storage for the string when it is not needed anymore.
|
||||
The easiest way for command procedures to manipulate these
|
||||
fields is to call procedures like \fBTcl_SetResult\fR
|
||||
or \fBTcl_AppendResult\fR; they
|
||||
will hide all the details of managing the fields.
|
||||
The description below is for those procedures that manipulate the
|
||||
fields directly.
|
||||
.PP
|
||||
Whenever a command procedure returns, it must ensure
|
||||
that the \fIresult\fR field of its interpreter points to the string
|
||||
being returned by the command.
|
||||
The \fIresult\fR field must always point to a valid string.
|
||||
If a command wishes to return no result then \fIinterp->result\fR
|
||||
should point to an empty string.
|
||||
Normally, results are assumed to be statically allocated,
|
||||
which means that the contents will not change before the next time
|
||||
\fBTcl_Eval\fR is called or some other command procedure is invoked.
|
||||
In this case, the \fIfreeProc\fR field must be zero.
|
||||
Alternatively, a command procedure may dynamically
|
||||
allocate its return value (e.g. using \fBTcl_Alloc\fR)
|
||||
and store a pointer to it in \fIinterp->result\fR.
|
||||
In this case, the command procedure must also set \fIinterp->freeProc\fR
|
||||
to the address of a procedure that can free the value, or \fBTCL_DYNAMIC\fR
|
||||
if the storage was allocated directly by Tcl or by a call to
|
||||
\fBTcl_Alloc\fR.
|
||||
If \fIinterp->freeProc\fR is non-zero, then Tcl will call \fIfreeProc\fR
|
||||
to free the space pointed to by \fIinterp->result\fR before it
|
||||
invokes the next command.
|
||||
If a client procedure overwrites \fIinterp->result\fR when
|
||||
\fIinterp->freeProc\fR is non-zero, then it is responsible for calling
|
||||
\fIfreeProc\fR to free the old \fIinterp->result\fR (the \fBTcl_FreeResult\fR
|
||||
macro should be used for this purpose).
|
||||
.PP
|
||||
\fIFreeProc\fR should have arguments and result that match the
|
||||
\fBTcl_FreeProc\fR declaration above: it receives a single
|
||||
argument which is a pointer to the result value to free.
|
||||
In most applications \fBTCL_DYNAMIC\fR is the only non-zero value ever
|
||||
used for \fIfreeProc\fR.
|
||||
However, an application may store a different procedure address
|
||||
in \fIfreeProc\fR in order to use an alternate memory allocator
|
||||
or in order to do other cleanup when the result memory is freed.
|
||||
.PP
|
||||
As part of processing each command, \fBTcl_Eval\fR initializes
|
||||
\fIinterp->result\fR
|
||||
and \fIinterp->freeProc\fR just before calling the command procedure for
|
||||
the command. The \fIfreeProc\fR field will be initialized to zero,
|
||||
and \fIinterp->result\fR will point to an empty string. Commands that
|
||||
do not return any value can simply leave the fields alone.
|
||||
Furthermore, the empty string pointed to by \fIresult\fR is actually
|
||||
part of an array of \fBTCL_RESULT_SIZE\fR characters (approximately 200).
|
||||
If a command wishes to return a short string, it can simply copy
|
||||
it to the area pointed to by \fIinterp->result\fR. Or, it can use
|
||||
the sprintf procedure to generate a short result string at the location
|
||||
pointed to by \fIinterp->result\fR.
|
||||
.PP
|
||||
It is a general convention in Tcl-based applications that the result
|
||||
of an interpreter is normally in the initialized state described
|
||||
in the previous paragraph.
|
||||
Procedures that manipulate an interpreter's result (e.g. by
|
||||
returning an error) will generally assume that the result
|
||||
has been initialized when the procedure is called.
|
||||
If such a procedure is to be called after the result has been
|
||||
changed, then \fBTcl_ResetResult\fR should be called first to
|
||||
reset the result to its initialized state. The direct use of
|
||||
\fIinterp->result\fR is strongly deprecated (see \fBTcl_SetResult\fR).
|
||||
.PP
|
||||
The \fIerrorLine\fR
|
||||
field is valid only after \fBTcl_Eval\fR returns
|
||||
a \fBTCL_ERROR\fR return code. In this situation the \fIerrorLine\fR
|
||||
field identifies the line number of the command being executed when
|
||||
the error occurred. The line numbers are relative to the command
|
||||
being executed: 1 means the first line of the command passed to
|
||||
\fBTcl_Eval\fR, 2 means the second line, and so on.
|
||||
The \fIerrorLine\fR field is typically used in conjunction with
|
||||
\fBTcl_AddErrorInfo\fR to report information about where an error
|
||||
occurred.
|
||||
\fIErrorLine\fR should not normally be modified except by \fBTcl_Eval\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
free, initialized, interpreter, malloc, result
|
||||
+4
-4
@@ -65,7 +65,7 @@ its limits checked.
|
||||
.AP int type in
|
||||
The type of limit that the operation refers to. This must be either
|
||||
\fBTCL_LIMIT_COMMANDS\fR or \fBTCL_LIMIT_TIME\fR.
|
||||
.AP int commandLimit in
|
||||
.AP size_t commandLimit in
|
||||
The maximum number of commands (as reported by \fBinfo cmdcount\fR)
|
||||
that may be executed in the interpreter.
|
||||
.AP Tcl_Time *timeLimitPtr in/out
|
||||
@@ -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
|
||||
|
||||
+112
-36
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_LinkVar, Tcl_UnlinkVar, Tcl_UpdateLinkedVar \- link Tcl variable to C variable
|
||||
Tcl_LinkArray, Tcl_LinkVar, Tcl_UnlinkVar, Tcl_UpdateLinkedVar \- link Tcl variable to C variable
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -17,27 +17,52 @@ Tcl_LinkVar, Tcl_UnlinkVar, Tcl_UpdateLinkedVar \- link Tcl variable to C variab
|
||||
int
|
||||
\fBTcl_LinkVar\fR(\fIinterp, varName, addr, type\fR)
|
||||
.sp
|
||||
.VS "TIP 312"
|
||||
int
|
||||
\fBTcl_LinkArray\fR(\fIinterp, varName, addr, type, size\fR)
|
||||
.VE "TIP 312"
|
||||
.sp
|
||||
\fBTcl_UnlinkVar\fR(\fIinterp, varName\fR)
|
||||
.sp
|
||||
\fBTcl_UpdateLinkedVar\fR(\fIinterp, varName\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp writable
|
||||
.AS Tcl_Interp varName in
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter that contains \fIvarName\fR.
|
||||
Also used by \fBTcl_LinkVar\fR to return error messages.
|
||||
.AP "const char" *varName in
|
||||
Name of global variable.
|
||||
.AP char *addr in
|
||||
.AP void *addr in
|
||||
Address of C variable that is to be linked to \fIvarName\fR.
|
||||
.sp
|
||||
.VS "TIP 312"
|
||||
In \fBTcl_LinkArray\fR, may be NULL to tell Tcl to create the storage
|
||||
for the array in the variable.
|
||||
.VE "TIP 312"
|
||||
.AP int type in
|
||||
Type of C variable. Must be one of \fBTCL_LINK_INT\fR,
|
||||
Type of C variable for \fBTcl_LinkVar\fR or type of array element for
|
||||
\fBTcl_LinkArray\fR. Must be one of \fBTCL_LINK_INT\fR,
|
||||
\fBTCL_LINK_UINT\fR, \fBTCL_LINK_CHAR\fR, \fBTCL_LINK_UCHAR\fR,
|
||||
\fBTCL_LINK_SHORT\fR, \fBTCL_LINK_USHORT\fR, \fBTCL_LINK_LONG\fR,
|
||||
\fBTCL_LINK_ULONG\fR, \fBTCL_LINK_WIDE_INT\fR,
|
||||
\fBTCL_LINK_WIDE_UINT\fR, \fBTCL_LINK_FLOAT\fR,
|
||||
\fBTCL_LINK_DOUBLE\fR, \fBTCL_LINK_BOOLEAN\fR, or
|
||||
\fBTCL_LINK_STRING\fR, optionally OR'ed with \fBTCL_LINK_READ_ONLY\fR
|
||||
to make Tcl variable read-only.
|
||||
\fBTCL_LINK_WIDE_UINT\fR, \fBTCL_LINK_FLOAT\fR, \fBTCL_LINK_DOUBLE\fR,
|
||||
\fBTCL_LINK_BOOLEAN\fR, or one of the extra ones listed below.
|
||||
.sp
|
||||
In \fBTcl_LinkVar\fR, the additional linked type \fBTCL_LINK_STRING\fR may be
|
||||
used.
|
||||
.sp
|
||||
.VS "TIP 312"
|
||||
In \fBTcl_LinkArray\fR, the additional linked types \fBTCL_LINK_CHARS\fR and
|
||||
\fBTCL_LINK_BINARY\fR may be used.
|
||||
.VE "TIP 312"
|
||||
.sp
|
||||
All the above for both functions may be
|
||||
optionally OR'ed with \fBTCL_LINK_READ_ONLY\fR to make the Tcl
|
||||
variable read-only.
|
||||
.AP size_t size in
|
||||
.VS "TIP 312"
|
||||
The number of elements in the C array. Must be greater than zero.
|
||||
.VE "TIP 312"
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
@@ -52,130 +77,179 @@ while setting up the link (e.g. because \fIvarName\fR is the
|
||||
name of array) then \fBTCL_ERROR\fR is returned and the interpreter's result
|
||||
contains an error message.
|
||||
.PP
|
||||
.VS "TIP 312"
|
||||
\fBTcl_LinkArray\fR is similar, but for arrays of fixed size (given by
|
||||
the \fIsize\fR argument). When asked to allocate the backing C array
|
||||
storage (via the \fIaddr\fR argument being NULL), it writes the
|
||||
address that it allocated to the Tcl interpreter result.
|
||||
.VE "TIP 312"
|
||||
.PP
|
||||
The \fItype\fR argument specifies the type of the C variable,
|
||||
or the type of the elements of the C array,
|
||||
and must have one of the following values, optionally OR'ed with
|
||||
\fBTCL_LINK_READ_ONLY\fR:
|
||||
.TP
|
||||
\fBTCL_LINK_INT\fR
|
||||
The C variable is of type \fBint\fR.
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBint\fR.
|
||||
Any value written into the Tcl variable must have a proper integer
|
||||
form acceptable to \fBTcl_GetIntFromObj\fR; attempts to write
|
||||
non-integer values into \fIvarName\fR will be rejected with
|
||||
Tcl errors. Incomplete integer representations (like the empty
|
||||
string, '+', '-' or the hex/octal/binary prefix) are accepted
|
||||
string, '+', '-' or the hex/octal/decimal/binary prefix) are accepted
|
||||
as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_UINT\fR
|
||||
The C variable is of type \fBunsigned int\fR.
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBunsigned int\fR.
|
||||
Any value written into the Tcl variable must have a proper unsigned
|
||||
integer form acceptable to \fBTcl_GetWideIntFromObj\fR and in the
|
||||
platform's defined range for the \fBunsigned int\fR type; attempts to
|
||||
write non-integer values (or values outside the range) into
|
||||
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
|
||||
representations (like the empty string, '+', '-' or the hex/octal/binary
|
||||
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
|
||||
prefix) are accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_CHAR\fR
|
||||
The C variable is of type \fBchar\fR.
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBchar\fR.
|
||||
Any value written into the Tcl variable must have a proper integer
|
||||
form acceptable to \fBTcl_GetIntFromObj\fR and be in the range of the
|
||||
\fBchar\fR datatype; attempts to write non-integer or out-of-range
|
||||
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
|
||||
integer representations (like the empty string, '+', '-' or the
|
||||
hex/octal/binary prefix) are accepted as if they are valid too.
|
||||
hex/octal/decimal/binary prefix) are accepted as if they are valid too.
|
||||
.RS
|
||||
.PP
|
||||
.VS "TIP 312"
|
||||
If using an array of these, consider using \fBTCL_LINK_CHARS\fR instead.
|
||||
.VE "TIP 312"
|
||||
.RE
|
||||
.TP
|
||||
\fBTCL_LINK_CHARS\fR
|
||||
.VS "TIP 312"
|
||||
The C array is of type \fBchar *\fR and is mapped into Tcl as a string.
|
||||
Any value written into the Tcl variable must have the same length as
|
||||
the underlying storage. Only supported with \fBTcl_LinkArray\fR.
|
||||
.VE "TIP 312"
|
||||
.TP
|
||||
\fBTCL_LINK_UCHAR\fR
|
||||
The C variable is of type \fBunsigned char\fR.
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBunsigned char\fR.
|
||||
Any value written into the Tcl variable must have a proper unsigned
|
||||
integer form acceptable to \fBTcl_GetIntFromObj\fR and in the
|
||||
platform's defined range for the \fBunsigned char\fR type; attempts to
|
||||
write non-integer values (or values outside the range) into
|
||||
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
|
||||
representations (like the empty string, '+', '-' or the hex/octal/binary
|
||||
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
|
||||
prefix) are accepted as if they are valid too.
|
||||
.RS
|
||||
.PP
|
||||
.VS "TIP 312"
|
||||
If using an array of these, consider using \fBTCL_LINK_BINARY\fR instead.
|
||||
.VE "TIP 312"
|
||||
.RE
|
||||
.TP
|
||||
\fBTCL_LINK_BINARY\fR
|
||||
.VS "TIP 312"
|
||||
The C array is of type \fBunsigned char *\fR and is mapped into Tcl
|
||||
as a bytearray.
|
||||
Any value written into the Tcl variable must have the same length as
|
||||
the underlying storage. Only supported with \fBTcl_LinkArray\fR.
|
||||
.VE "TIP 312"
|
||||
.TP
|
||||
\fBTCL_LINK_SHORT\fR
|
||||
The C variable is of type \fBshort\fR.
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBshort\fR.
|
||||
Any value written into the Tcl variable must have a proper integer
|
||||
form acceptable to \fBTcl_GetIntFromObj\fR and be in the range of the
|
||||
\fBshort\fR datatype; attempts to write non-integer or out-of-range
|
||||
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
|
||||
integer representations (like the empty string, '+', '-' or the
|
||||
hex/octal/binary prefix) are accepted as if they are valid too.
|
||||
hex/octal/decimal/binary prefix) are accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_USHORT\fR
|
||||
The C variable is of type \fBunsigned short\fR.
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBunsigned short\fR.
|
||||
Any value written into the Tcl variable must have a proper unsigned
|
||||
integer form acceptable to \fBTcl_GetIntFromObj\fR and in the
|
||||
platform's defined range for the \fBunsigned short\fR type; attempts to
|
||||
write non-integer values (or values outside the range) into
|
||||
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
|
||||
representations (like the empty string, '+', '-' or the hex/octal/binary
|
||||
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
|
||||
prefix) are accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_LONG\fR
|
||||
The C variable is of type \fBlong\fR.
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBlong\fR.
|
||||
Any value written into the Tcl variable must have a proper integer
|
||||
form acceptable to \fBTcl_GetLongFromObj\fR; attempts to write
|
||||
non-integer or out-of-range
|
||||
values into \fIvarName\fR will be rejected with Tcl errors. Incomplete
|
||||
integer representations (like the empty string, '+', '-' or the
|
||||
hex/octal/binary prefix) are accepted as if they are valid too.
|
||||
hex/octal/decimal/binary prefix) are accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_ULONG\fR
|
||||
The C variable is of type \fBunsigned long\fR.
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBunsigned long\fR.
|
||||
Any value written into the Tcl variable must have a proper unsigned
|
||||
integer form acceptable to \fBTcl_GetWideIntFromObj\fR and in the
|
||||
platform's defined range for the \fBunsigned long\fR type; attempts to
|
||||
write non-integer values (or values outside the range) into
|
||||
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
|
||||
representations (like the empty string, '+', '-' or the hex/octal/binary
|
||||
representations (like the empty string, '+', '-' or the hex/octal/decimal/binary
|
||||
prefix) are accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_DOUBLE\fR
|
||||
The C variable is of type \fBdouble\fR.
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBdouble\fR.
|
||||
Any value written into the Tcl variable must have a proper real
|
||||
form acceptable to \fBTcl_GetDoubleFromObj\fR; attempts to write
|
||||
non-real values into \fIvarName\fR will be rejected with
|
||||
Tcl errors. Incomplete integer or real representations (like the
|
||||
empty string, '.', '+', '-' or the hex/octal/binary prefix) are
|
||||
empty string, '.', '+', '-' or the hex/octal/decimal/binary prefix) are
|
||||
accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_FLOAT\fR
|
||||
The C variable is of type \fBfloat\fR.
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBfloat\fR.
|
||||
Any value written into the Tcl variable must have a proper real
|
||||
form acceptable to \fBTcl_GetDoubleFromObj\fR and must be within the
|
||||
range acceptable for a \fBfloat\fR; attempts to
|
||||
write non-real values (or values outside the range) into
|
||||
\fIvarName\fR will be rejected with Tcl errors. Incomplete integer
|
||||
or real representations (like the empty string, '.', '+', '-' or
|
||||
the hex/octal/binary prefix) are accepted as if they are valid too.
|
||||
the hex/octal/decimal/binary prefix) are accepted as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_WIDE_INT\fR
|
||||
The C variable is of type \fBTcl_WideInt\fR (which is an integer type
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBTcl_WideInt\fR
|
||||
(which is an integer type
|
||||
at least 64-bits wide on all platforms that can support it.)
|
||||
Any value written into the Tcl variable must have a proper integer
|
||||
form acceptable to \fBTcl_GetWideIntFromObj\fR; attempts to write
|
||||
non-integer values into \fIvarName\fR will be rejected with
|
||||
Tcl errors. Incomplete integer representations (like the empty
|
||||
string, '+', '-' or the hex/octal/binary prefix) are accepted
|
||||
string, '+', '-' or the hex/octal/decimal/binary prefix) are accepted
|
||||
as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_WIDE_UINT\fR
|
||||
The C variable is of type \fBTcl_WideUInt\fR (which is an unsigned
|
||||
integer type at least 64-bits wide on all platforms that can support
|
||||
it.)
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBTcl_WideUInt\fR
|
||||
(which is an unsigned integer type at least 64-bits wide on all platforms that
|
||||
can support it.)
|
||||
Any value written into the Tcl variable must have a proper unsigned
|
||||
integer form acceptable to \fBTcl_GetWideIntFromObj\fR (it will be
|
||||
cast to unsigned);
|
||||
.\" FIXME! Use bignums instead.
|
||||
attempts to write non-integer values into \fIvarName\fR will be
|
||||
rejected with Tcl errors. Incomplete integer representations (like
|
||||
the empty string, '+', '-' or the hex/octal/binary prefix) are accepted
|
||||
the empty string, '+', '-' or the hex/octal/decimal/binary prefix) are accepted
|
||||
as if they are valid too.
|
||||
.TP
|
||||
\fBTCL_LINK_BOOLEAN\fR
|
||||
The C variable is of type \fBint\fR.
|
||||
.
|
||||
The C variable, or each element of the C array, is of type \fBint\fR.
|
||||
If its value is zero then it will read from Tcl as
|
||||
.QW 0 ;
|
||||
otherwise it will read from Tcl as
|
||||
@@ -188,15 +262,17 @@ non-boolean values into \fIvarName\fR will be rejected with
|
||||
Tcl errors.
|
||||
.TP
|
||||
\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.
|
||||
If the C variable contains a NULL pointer then the Tcl variable
|
||||
will read as
|
||||
.QW NULL .
|
||||
This is only supported by \fBTcl_LinkVar\fR.
|
||||
.PP
|
||||
If the \fBTCL_LINK_READ_ONLY\fR flag is present in \fItype\fR then the
|
||||
variable will be read-only from Tcl, so that its value can only be
|
||||
|
||||
+40
-11
@@ -59,13 +59,13 @@ points to the Tcl value that will be appended to \fIlistPtr\fR.
|
||||
For \fBTcl_SetListObj\fR,
|
||||
this points to the Tcl value that will be converted to a list value
|
||||
containing the \fIobjc\fR elements of the array referenced by \fIobjv\fR.
|
||||
.AP int *objcPtr in
|
||||
.AP "size_t \&| int" *objcPtr in
|
||||
Points to location where \fBTcl_ListObjGetElements\fR
|
||||
stores the number of element values in \fIlistPtr\fR.
|
||||
.AP Tcl_Obj ***objvPtr out
|
||||
A location where \fBTcl_ListObjGetElements\fR stores a pointer to an array
|
||||
of pointers to the element values of \fIlistPtr\fR.
|
||||
.AP int objc in
|
||||
.AP size_t objc in
|
||||
The number of Tcl values that \fBTcl_NewListObj\fR
|
||||
will insert into a new list value,
|
||||
and \fBTcl_ListObjReplace\fR will insert into \fIlistPtr\fR.
|
||||
@@ -76,21 +76,21 @@ An array of pointers to values.
|
||||
\fBTcl_NewListObj\fR will insert these values into a new list value
|
||||
and \fBTcl_ListObjReplace\fR will insert them into an existing \fIlistPtr\fR.
|
||||
Each value will become a separate list element.
|
||||
.AP int *lengthPtr out
|
||||
.AP "size_t \&| int" *lengthPtr out
|
||||
Points to location where \fBTcl_ListObjLength\fR
|
||||
stores the length of the list.
|
||||
.AP int index in
|
||||
.AP size_t index in
|
||||
Index of the list element that \fBTcl_ListObjIndex\fR
|
||||
is to return.
|
||||
The first element has index 0.
|
||||
.AP Tcl_Obj **objPtrPtr out
|
||||
Points to place where \fBTcl_ListObjIndex\fR is to store
|
||||
a pointer to the resulting list element value.
|
||||
.AP int first in
|
||||
.AP size_t first in
|
||||
Index of the starting list element that \fBTcl_ListObjReplace\fR
|
||||
is to replace.
|
||||
The list's first element has index 0.
|
||||
.AP int count in
|
||||
.AP size_t count in
|
||||
The number of elements that \fBTcl_ListObjReplace\fR
|
||||
is to replace.
|
||||
.BE
|
||||
@@ -153,7 +153,9 @@ address \fIobjcPtr\fR. Similarly, it returns the array pointer by storing
|
||||
it in the address \fIobjvPtr\fR.
|
||||
The memory pointed to is managed by Tcl and should not be freed or written
|
||||
to by the caller. If the list is empty, 0 is stored at \fIobjcPtr\fR
|
||||
and NULL at \fIobjvPtr\fR.
|
||||
and NULL at \fIobjvPtr\fR. If \fIobjcPtr\fR points to a variable
|
||||
of type \fBint\fR and the list contains more than 2**31 elements, the
|
||||
function returns \fBTCL_ERROR\fR.
|
||||
If \fIlistPtr\fR is not already a list value, \fBTcl_ListObjGetElements\fR
|
||||
will attempt to convert it to one; if the conversion fails, it returns
|
||||
\fBTCL_ERROR\fR and leaves an error message in the interpreter's result
|
||||
@@ -162,7 +164,9 @@ Otherwise it returns \fBTCL_OK\fR after storing the count and array pointer.
|
||||
.PP
|
||||
\fBTcl_ListObjLength\fR returns the number of elements in the list value
|
||||
referenced by \fIlistPtr\fR.
|
||||
It returns this count by storing an integer in the address \fIlengthPtr\fR.
|
||||
It returns this count by storing a value in the address \fIlengthPtr\fR.
|
||||
If \fIlengthPtr\fR points to a variable of type \fBint\fR and the list
|
||||
contains more than 2**31 elements, the function returns \fBTCL_ERROR\fR.
|
||||
If the value is not already a list value,
|
||||
\fBTcl_ListObjLength\fR will attempt to convert it to one;
|
||||
if the conversion fails, it returns \fBTCL_ERROR\fR
|
||||
@@ -180,7 +184,7 @@ if the conversion fails, it returns \fBTCL_ERROR\fR
|
||||
and leaves an error message in the interpreter's result value
|
||||
if \fIinterp\fR is not NULL.
|
||||
If the index is out of range,
|
||||
that is, \fIindex\fR is negative or
|
||||
that is, \fIindex\fR is TCL_INDEX_NONE or
|
||||
greater than or equal to the number of elements in the list,
|
||||
\fBTcl_ListObjIndex\fR stores a NULL in \fIobjPtrPtr\fR
|
||||
and returns \fBTCL_OK\fR.
|
||||
@@ -199,13 +203,13 @@ and leaves an error message in the interpreter's result value
|
||||
if \fIinterp\fR is not NULL.
|
||||
Otherwise, it returns \fBTCL_OK\fR after replacing the values.
|
||||
If \fIobjv\fR is NULL, no new elements are added.
|
||||
If the argument \fIfirst\fR is zero or negative,
|
||||
If the argument \fIfirst\fR is zero or TCL_INDEX_NONE,
|
||||
it refers to the first element.
|
||||
If \fIfirst\fR is greater than or equal to the
|
||||
number of elements in the list, then no elements are deleted;
|
||||
the new elements are appended to the list.
|
||||
\fIcount\fR gives the number of elements to replace.
|
||||
If \fIcount\fR is zero or negative then no elements are deleted;
|
||||
If \fIcount\fR is zero or TCL_INDEX_NONE then no elements are deleted;
|
||||
the new elements are simply inserted before the one
|
||||
designated by \fIfirst\fR.
|
||||
\fBTcl_ListObjReplace\fR invalidates \fIlistPtr\fR's
|
||||
@@ -246,6 +250,31 @@ with a NULL \fIobjvPtr\fR:
|
||||
result = \fBTcl_ListObjReplace\fR(interp, listPtr, first, count,
|
||||
0, NULL);
|
||||
.CE
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
\fBTcl_NewListObj\fR always returns a zero-reference object, much like
|
||||
\fBTcl_NewObj\fR. If a non-NULL \fIobjv\fR argument is given, the reference
|
||||
counts of the first \fIobjc\fR values in that array are incremented.
|
||||
.PP
|
||||
\fBTcl_SetListObj\fR does not modify the reference count of its \fIobjPtr\fR
|
||||
argument, but does require that the object be unshared. The reference counts
|
||||
of the first \fIobjc\fR values in the \fIobjv\fR array are incremented.
|
||||
.PP
|
||||
\fBTcl_ListObjGetElements\fR, \fBTcl_ListObjIndex\fR, and
|
||||
\fBTcl_ListObjLength\fR do not modify the reference count of their
|
||||
\fIlistPtr\fR arguments; they only read. Note however that these three
|
||||
functions may set the interpreter result; if that is the only place that is
|
||||
holding a reference to the object, it will be deleted.
|
||||
.PP
|
||||
\fBTcl_ListObjAppendList\fR, \fBTcl_ListObjAppendElement\fR, and
|
||||
\fBTcl_ListObjReplace\fR require an unshared \fIlistPtr\fR argument.
|
||||
\fBTcl_ListObjAppendList\fR only reads its \fIelemListPtr\fR argument.
|
||||
\fBTcl_ListObjAppendElement\fR increments the reference count of its
|
||||
\fIobjPtr\fR on success. \fBTcl_ListObjReplace\fR increments the reference
|
||||
count of the first \fIobjc\fR values in the \fIobjv\fR array on success. Note
|
||||
however that all these three functions may set the interpreter result on
|
||||
failure; if that is the only place that is holding a reference to the object,
|
||||
it will be deleted.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_NewObj(3), Tcl_DecrRefCount(3), Tcl_IncrRefCount(3), Tcl_GetObjResult(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
@@ -60,6 +60,10 @@ be unloaded with \fBTcl_FSUnloadFile\fR.
|
||||
the symbol cannot be found, it returns NULL and sets an error message in the
|
||||
given \fIinterp\fR (if that is non-NULL). Note that it is unsafe to use this
|
||||
operation on a handle that has been passed to \fBTcl_FSUnloadFile\fR.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The reference count of the \fIpathPtr\fR argument to \fBTcl_LoadFile\fR may be
|
||||
incremented. As such, it should not be given a zero reference count value.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_FSLoadFile(3), Tcl_FSUnloadFile(3), load(n), unload(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+66
-24
@@ -9,18 +9,18 @@
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
Tcl_ClassSetConstructor, Tcl_ClassSetDestructor, Tcl_MethodDeclarerClass, Tcl_MethodDeclarerObject, Tcl_MethodIsPublic, Tcl_MethodIsType, Tcl_MethodName, Tcl_NewInstanceMethod, Tcl_NewMethod, Tcl_ObjectContextInvokeNext, Tcl_ObjectContextIsFiltering, Tcl_ObjectContextMethod, Tcl_ObjectContextObject, Tcl_ObjectContextSkippedArgs \- manipulate methods and method-call contexts
|
||||
Tcl_ClassSetConstructor, Tcl_ClassSetDestructor, Tcl_MethodDeclarerClass, Tcl_MethodDeclarerObject, Tcl_MethodIsPublic, Tcl_MethodIsPrivate, Tcl_MethodIsType, Tcl_MethodName, Tcl_NewInstanceMethod, Tcl_NewMethod, Tcl_ObjectContextInvokeNext, Tcl_ObjectContextIsFiltering, Tcl_ObjectContextMethod, Tcl_ObjectContextObject, Tcl_ObjectContextSkippedArgs \- manipulate methods and method-call contexts
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tclOO.h>\fR
|
||||
.sp
|
||||
Tcl_Method
|
||||
\fBTcl_NewMethod\fR(\fIinterp, class, nameObj, isPublic,
|
||||
methodTypePtr, clientData\fR)
|
||||
\fBTcl_NewMethod\fR(\fIinterp, class, nameObj, flags, methodTypePtr,
|
||||
clientData\fR)
|
||||
.sp
|
||||
Tcl_Method
|
||||
\fBTcl_NewInstanceMethod\fR(\fIinterp, object, nameObj, isPublic,
|
||||
methodTypePtr, clientData\fR)
|
||||
\fBTcl_NewInstanceMethod\fR(\fIinterp, object, nameObj, flags, methodTypePtr,
|
||||
clientData\fR)
|
||||
.sp
|
||||
\fBTcl_ClassSetConstructor\fR(\fIinterp, class, method\fR)
|
||||
.sp
|
||||
@@ -35,8 +35,13 @@ Tcl_Object
|
||||
Tcl_Obj *
|
||||
\fBTcl_MethodName\fR(\fImethod\fR)
|
||||
.sp
|
||||
.VS TIP500
|
||||
int
|
||||
\fBTcl_MethodIsPublic\fR(\fImethod\fR)
|
||||
.VE TIP500
|
||||
.sp
|
||||
int
|
||||
\fBTcl_MethodIsPrivate\fR(\fImethod\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_MethodIsType\fR(\fImethod, methodTypePtr, clientDataPtr\fR)
|
||||
@@ -53,10 +58,10 @@ Tcl_Method
|
||||
Tcl_Object
|
||||
\fBTcl_ObjectContextObject\fR(\fIcontext\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\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
|
||||
@@ -66,17 +71,22 @@ The class to create the method in.
|
||||
.AP Tcl_Obj *nameObj in
|
||||
The name of the method to create. Should not be NULL unless creating
|
||||
constructors or destructors.
|
||||
.AP int isPublic in
|
||||
A flag saying what the visibility of the method is. The only supported public
|
||||
values of this flag are 0 for a non-exported method, and 1 for an exported
|
||||
method.
|
||||
.AP int flags in
|
||||
A flag saying (currently) what the visibility of the method is. The supported
|
||||
public values of this flag are \fBTCL_OO_METHOD_PUBLIC\fR (which is fixed at 1
|
||||
for backward compatibility) for an exported method,
|
||||
\fBTCL_OO_METHOD_UNEXPORTED\fR (which is fixed at 0 for backward
|
||||
compatibility) for a non-exported method,
|
||||
.VS TIP500
|
||||
and \fBTCL_OO_METHOD_PRIVATE\fR for a private method.
|
||||
.VE TIP500
|
||||
.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.
|
||||
@@ -85,11 +95,11 @@ A reference to a method to query.
|
||||
.AP Tcl_ObjectContext context in
|
||||
A reference to a method-call context. Note that client code \fImust not\fR
|
||||
retain a reference to a context.
|
||||
.AP int objc in
|
||||
.AP size_t objc in
|
||||
The number of arguments to pass to the method implementation.
|
||||
.AP "Tcl_Obj *const" *objv in
|
||||
An array of arguments to pass to the method implementation.
|
||||
.AP int skip in
|
||||
.AP size_t skip in
|
||||
The number of arguments passed to the method implementation that do not
|
||||
represent "real" arguments.
|
||||
.BE
|
||||
@@ -105,8 +115,12 @@ Given a method, the entity that declared it can be found using
|
||||
attached to (or NULL if the method is not attached to any class) and
|
||||
\fBTcl_MethodDeclarerObject\fR which returns the object that the method is
|
||||
attached to (or NULL if the method is not attached to an object). The name of
|
||||
the method can be retrieved with \fBTcl_MethodName\fR and whether the method
|
||||
is exported is retrieved with \fBTcl_MethodIsPublic\fR. The type of the method
|
||||
the method can be retrieved with \fBTcl_MethodName\fR, whether the method
|
||||
is exported is retrieved with \fBTcl_MethodIsPublic\fR,
|
||||
.VS TIP500
|
||||
and whether the method is private is retrieved with \fBTcl_MethodIsPrivate\fR.
|
||||
.VE TIP500
|
||||
The type of the method
|
||||
can also be introspected upon to a limited degree; the function
|
||||
\fBTcl_MethodIsType\fR returns whether a method is of a particular type,
|
||||
assigning the per-method \fIclientData\fR to the variable pointed to by
|
||||
@@ -117,8 +131,12 @@ Methods are created by \fBTcl_NewMethod\fR and \fBTcl_NewInstanceMethod\fR,
|
||||
which
|
||||
create a method attached to a class or an object respectively. In both cases,
|
||||
the \fInameObj\fR argument gives the name of the method to create, the
|
||||
\fIisPublic\fR argument states whether the method should be exported
|
||||
initially, the \fImethodTypePtr\fR argument describes the implementation of
|
||||
\fIflags\fR argument states whether the method should be exported
|
||||
initially
|
||||
.VS TIP500
|
||||
or be marked as a private method,
|
||||
.VE TIP500
|
||||
the \fImethodTypePtr\fR argument describes the implementation of
|
||||
the method (see the \fBMETHOD TYPES\fR section below) and the \fIclientData\fR
|
||||
argument gives some implementation-specific data that is passed on to the
|
||||
implementation of the method when it is called.
|
||||
@@ -195,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,
|
||||
@@ -216,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
|
||||
@@ -230,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
|
||||
@@ -240,8 +258,32 @@ also return TCL_ERROR; it should return TCL_OK otherwise.
|
||||
The \fIoldClientData\fR field to a Tcl_CloneProc gives the value from the
|
||||
method being copied from, and the \fInewClientDataPtr\fR field will point to
|
||||
a variable in which to write the value for the method being copied to.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The \fInameObj\fR argument to \fBTcl_NewMethod\fR and
|
||||
\fBTcl_NewInstanceMethod\fR (when non-NULL) will have its reference count
|
||||
incremented if there is no existing method with that name in that
|
||||
class/object.
|
||||
.PP
|
||||
The result of \fBTcl_MethodName\fR is a value with a reference count of at
|
||||
least one. It should not be modified without first duplicating it (with
|
||||
\fBTcl_DuplicateObj\fR).
|
||||
.PP
|
||||
The values in the first \fIobjc\fR values of the \fIobjv\fR argument to
|
||||
\fBTcl_ObjectContextInvokeNext\fR are assumed to have a reference count of at
|
||||
least 1; the containing array is assumed to endure until the next method
|
||||
implementation (see \fBnext\fR) returns. Be aware that methods may
|
||||
\fByield\fR; if any post-call actions are desired (e.g., decrementing the
|
||||
reference count of values passed in here), they must be scheduled with
|
||||
\fBTcl_NRAddCallback\fR.
|
||||
.PP
|
||||
The \fIcallProc\fR of the \fBTcl_MethodType\fR structure takes values of at
|
||||
least reference count 1 in its \fIobjv\fR argument. It may add its own
|
||||
references, but must not decrement the reference count below that level; the
|
||||
caller of the method will decrement the reference count once the method
|
||||
returns properly (and the reference will be held if the method \fByield\fRs).
|
||||
.SH "SEE ALSO"
|
||||
Class(3), oo::class(n), oo::define(n), oo::object(n)
|
||||
Class(3), NRE(3), oo::class(n), oo::define(n), oo::object(n)
|
||||
.SH KEYWORDS
|
||||
constructor, method, object
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_NRCreateCommand, Tcl_NRCallObjProc, Tcl_NREvalObj, Tcl_NREvalObjv, Tcl_NRCmdSwap, Tcl_NRExprObj, Tcl_NRAddCallback \- Non-Recursive (stackless) evaluation of Tcl scripts.
|
||||
Tcl_NRCreateCommand, Tcl_NRCreateCommand2, Tcl_NRCallObjProc, Tcl_NRCallObjProc2, Tcl_NREvalObj, Tcl_NREvalObjv, Tcl_NRCmdSwap, Tcl_NRExprObj, Tcl_NRAddCallback \- Non-Recursive (stackless) evaluation of Tcl scripts.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -18,10 +18,17 @@ Tcl_Command
|
||||
\fBTcl_NRCreateCommand\fR(\fIinterp, cmdName, proc, nreProc, clientData,
|
||||
deleteProc\fR)
|
||||
.sp
|
||||
Tcl_Command
|
||||
\fBTcl_NRCreateCommand2\fR(\fIinterp, cmdName, proc2, nreProc2, clientData,
|
||||
deleteProc\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_NRCallObjProc\fR(\fIinterp, nreProc, clientData, objc, objv\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_NRCallObjProc2\fR(\fIinterp, nreProc2, clientData, objc, objv\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_NREvalObj\fR(\fIinterp, objPtr, flags\fR)
|
||||
.sp
|
||||
int
|
||||
@@ -47,15 +54,22 @@ Called in order to evaluate a command. Is often just a small wrapper that uses
|
||||
\fBTcl_NRCallObjProc\fR to call \fInreProc\fR using a new trampoline. Behaves
|
||||
in the same way as the \fIproc\fR argument to \fBTcl_CreateObjCommand\fR(3)
|
||||
(\fIq.v.\fR).
|
||||
.AP Tcl_ObjCmdProc2 *proc2 in
|
||||
Called in order to evaluate a command. Is often just a small wrapper that uses
|
||||
\fBTcl_NRCallObjProc2\fR to call \fInreProc2\fR using a new trampoline. Behaves
|
||||
in the same way as the \fIproc2\fR argument to \fBTcl_CreateObjCommand2\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 Tcl_ObjCmdProc2 *nreProc2 in
|
||||
Called instead of \fIproc2\fR when a trampoline is already in use.
|
||||
.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
|
||||
Called before \fIcmdName\fR is deleted from the interpreter, allowing for
|
||||
command-specific cleanup. May be NULL.
|
||||
.AP int objc in
|
||||
.AP size_t objc in
|
||||
Number of items in \fIobjv\fR.
|
||||
.AP Tcl_Obj **objv in
|
||||
Words in the command.
|
||||
@@ -72,10 +86,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
|
||||
@@ -104,6 +118,9 @@ first deleted. If \fIinterp\fR is in the process of being deleted
|
||||
\fBTcl_NRCreateCommand\fR does not create any command, does not delete any
|
||||
command, and returns NULL.
|
||||
.PP
|
||||
\fBTcl_NRCreateCommand2\fR, is an alternative to \fBTcl_NRCreateCommand\fR
|
||||
in the same way as \fBTcl_CreateObjCommand2\fR.
|
||||
.PP
|
||||
\fBTcl_NREvalObj\fR pushes a function that is like \fBTcl_EvalObjEx\fR but
|
||||
consumes no space on the C stack.
|
||||
.PP
|
||||
@@ -130,7 +147,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 +163,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 +194,7 @@ call \fITheCmdNRObjProc\fR:
|
||||
.CS
|
||||
int
|
||||
\fITheCmdOldObjProc\fR(
|
||||
ClientData clientData,
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -190,7 +207,7 @@ int
|
||||
.CS
|
||||
int
|
||||
\fITheCmdNRObjProc\fR
|
||||
ClientData clientData,
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -211,7 +228,7 @@ int
|
||||
.CS
|
||||
int
|
||||
\fITheCmdNRPostProc\fR(
|
||||
ClientData data[],
|
||||
void *data[],
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
@@ -227,6 +244,25 @@ int
|
||||
Any function comprising a routine can push other functions, making it possible
|
||||
implement looping and sequencing constructs using the function stack.
|
||||
.PP
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The first \fIobjc\fR values in the \fIobjv\fR array passed to the functions
|
||||
\fBTcl_NRCallObjProc\fR, \fBTcl_NREvalObjv\fR, and \fBTcl_NRCmdSwap\fR should
|
||||
have a reference count of at least 1; they may have additional references
|
||||
taken during the execution.
|
||||
.PP
|
||||
The \fIobjPtr\fR argument to \fBTcl_NREvalObj\fR and \fBTcl_NRExprObj\fR
|
||||
should have a reference count of at least 1, and may have additional
|
||||
references taken to it during execution.
|
||||
.PP
|
||||
The \fIresultObj\fR argument to \fBTcl_NRExprObj\fR should be an unshared
|
||||
object.
|
||||
.PP
|
||||
Use \fBTcl_NRAddCallback\fR to schedule any required final decrementing of the
|
||||
reference counts of arguments to any of the other functions on this page, as
|
||||
with any other post-processing step in the non-recursive execution engine.
|
||||
.PP
|
||||
The
|
||||
.SH "SEE ALSO"
|
||||
Tcl_CreateCommand(3), Tcl_CreateObjCommand(3), Tcl_EvalObjEx(3), Tcl_GetCommandFromObj(3), Tcl_ExprObj(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
+16
-4
@@ -46,10 +46,10 @@ Tcl_Command
|
||||
\fBTcl_FindCommand\fR(\fIinterp, name, contextNsPtr, flags\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_GetNamespaceUnknownHandler(\fIinterp, nsPtr\fR)
|
||||
\fBTcl_GetNamespaceUnknownHandler\fR(\fIinterp, nsPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_SetNamespaceUnknownHandler(\fIinterp, nsPtr, handlerPtr\fR)
|
||||
\fBTcl_SetNamespaceUnknownHandler\fR(\fIinterp, nsPtr, handlerPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_NamespaceDeleteProc allowOverwrite in/out
|
||||
.AP Tcl_Interp *interp in/out
|
||||
@@ -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
|
||||
@@ -159,6 +159,18 @@ for the namespace, or NULL if none is set.
|
||||
\fBTcl_SetNamespaceUnknownHandler\fR sets the unknown command handler for
|
||||
the namespace. If \fIhandlerPtr\fR is NULL, then the handler is reset to
|
||||
its default.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The \fIobjPtr\fR argument to \fBTcl_AppendExportList\fR should be an
|
||||
unshared object, as it will be modified by this function. The
|
||||
reference count of \fIobjPtr\fR will not be altered.
|
||||
.PP
|
||||
\fBTcl_GetNamespaceUnknownHandler\fR returns a possibly shared value.
|
||||
Its reference count should be incremented if the value is to be
|
||||
retained.
|
||||
.PP
|
||||
The \fIhandlerPtr\fR argument to \fBTcl_SetNamespaceUnknownHandler\fR
|
||||
will have its reference count incremented if it is a non-empty list.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_CreateCommand(3), Tcl_ListObjAppendList(3), Tcl_SetVar(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
+29
-34
@@ -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,10 +89,11 @@ 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.
|
||||
.AP Tcl_QueuePosition position in
|
||||
have been allocated by the caller using \fBTcl_Alloc\fR.
|
||||
.AP int position in
|
||||
Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR,
|
||||
\fBTCL_QUEUE_HEAD\fR, or \fBTCL_QUEUE_MARK\fR.
|
||||
\fBTCL_QUEUE_HEAD\fR, \fBTCL_QUEUE_MARK\fR, and whether to do
|
||||
an alert if the queue is empty: \fBTCL_QUEUE_ALERT_IF_EMPTY\fR.
|
||||
.AP Tcl_ThreadId threadId in
|
||||
A unique identifier for a thread.
|
||||
.AP Tcl_EventDeleteProc *deleteProc in
|
||||
@@ -103,7 +104,7 @@ passed to \fBTcl_DoOneEvent\fR.
|
||||
.AP int mode in
|
||||
Indicates whether events should be serviced by \fBTcl_ServiceAll\fR.
|
||||
Must be one of \fBTCL_SERVICE_NONE\fR or \fBTCL_SERVICE_ALL\fR.
|
||||
.AP Tcl_NotifierProcs* notifierProcPtr in
|
||||
.AP const Tcl_NotifierProcs* notifierProcPtr in
|
||||
Structure of function pointers describing notifier procedures that are
|
||||
to replace the ones installed in the executable. See
|
||||
\fBREPLACING THE NOTIFIER\fR for details.
|
||||
@@ -132,22 +133,17 @@ higher-level software that they have occurred. The procedures
|
||||
and \fBTcl_SetMaxBlockTime\fR, \fBTcl_QueueEvent\fR, and
|
||||
\fBTcl_DeleteEvents\fR are used primarily by event sources.
|
||||
.IP [2]
|
||||
The event queue: for non-threaded applications,
|
||||
there is a single queue for the whole application,
|
||||
containing events that have been detected but not yet serviced. Event
|
||||
sources place events onto the queue so that they may be processed in
|
||||
order at appropriate times during the event loop. The event queue
|
||||
guarantees a fair discipline of event handling, so that no event
|
||||
source can starve the others. It also allows events to be saved for
|
||||
servicing at a future time. Threaded applications work in a
|
||||
similar manner, except that there is a separate event queue for
|
||||
each thread containing a Tcl interpreter.
|
||||
The event queue: there is a single queue for each thread containing
|
||||
a Tcl interpreter, containing events that have been detected but not
|
||||
yet serviced. Event sources place events onto the queue so that they
|
||||
may be processed in order at appropriate times during the event loop.
|
||||
The event queue guarantees a fair discipline of event handling, so that
|
||||
no event source can starve the others. It also allows events to be
|
||||
saved for servicing at a future time.
|
||||
\fBTcl_QueueEvent\fR is used (primarily
|
||||
by event sources) to add events to the event queue and
|
||||
by event sources) to add events to the current thread's event queue and
|
||||
\fBTcl_DeleteEvents\fR is used to remove events from the queue without
|
||||
processing them. In a threaded application, \fBTcl_QueueEvent\fR adds
|
||||
an event to the current thread's queue, and \fBTcl_ThreadQueueEvent\fR
|
||||
adds an event to a queue in a specific thread.
|
||||
processing them.
|
||||
.IP [3]
|
||||
The event loop: in order to detect and process events, the application
|
||||
enters a loop that waits for events to occur, places them on the event
|
||||
@@ -230,7 +226,7 @@ the event source.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_EventSetupProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
int \fIflags\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -308,7 +304,7 @@ following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_EventCheckProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
int \fIflags\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -345,14 +341,14 @@ and should not be modified by the event source.
|
||||
.PP
|
||||
An event may be added to the queue at any of three positions, depending
|
||||
on the \fIposition\fR argument to \fBTcl_QueueEvent\fR:
|
||||
.IP \fBTCL_QUEUE_TAIL\fR 24
|
||||
.IP \fBTCL_QUEUE_TAIL\fR 32
|
||||
Add the event at the back of the queue, so that all other pending
|
||||
events will be serviced first. This is almost always the right
|
||||
place for new events.
|
||||
.IP \fBTCL_QUEUE_HEAD\fR 24
|
||||
.IP \fBTCL_QUEUE_HEAD\fR 32
|
||||
Add the event at the front of the queue, so that it will be serviced
|
||||
before all other queued events.
|
||||
.IP \fBTCL_QUEUE_MARK\fR 24
|
||||
.IP \fBTCL_QUEUE_MARK\fR 32
|
||||
Add the event at the front of the queue, unless there are other
|
||||
events at the front whose position is \fBTCL_QUEUE_MARK\fR; if so,
|
||||
add the new event just after all other \fBTCL_QUEUE_MARK\fR events.
|
||||
@@ -360,6 +356,10 @@ This value of \fIposition\fR is used to insert an ordered sequence of
|
||||
events at the front of the queue, such as a series of
|
||||
Enter and Leave events synthesized during a grab or ungrab operation
|
||||
in Tk.
|
||||
.IP \fBTCL_QUEUE_ALERT_IF_EMPTY\fR 32
|
||||
When used in \fBTcl_ThreadQueueEvent\fR
|
||||
arranges for an automatic call of \fBTcl_ThreadAlert\fR when the queue was
|
||||
empty.
|
||||
.PP
|
||||
When it is time to handle an event from the queue (steps 1 and 4
|
||||
above) \fBTcl_ServiceEvent\fR will invoke the \fIproc\fR specified
|
||||
@@ -399,15 +399,11 @@ 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
|
||||
Threaded applications work in a
|
||||
similar manner, except that there is a separate event queue for
|
||||
each thread containing a Tcl interpreter.
|
||||
Calling \fBTcl_QueueEvent\fR in a multithreaded application adds
|
||||
an event to the current thread's queue.
|
||||
Calling \fBTcl_QueueEvent\fR adds an event to the current thread's queue.
|
||||
To add an event to another thread's queue, use \fBTcl_ThreadQueueEvent\fR.
|
||||
\fBTcl_ThreadQueueEvent\fR accepts as an argument a Tcl_ThreadId argument,
|
||||
which uniquely identifies a thread in a Tcl application. To obtain the
|
||||
@@ -428,7 +424,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
|
||||
@@ -498,8 +494,7 @@ under Unix it happens when \fBTcl_WaitForEvent\fR would have waited
|
||||
forever because there were no active event sources and the timeout was
|
||||
infinite.
|
||||
.PP
|
||||
\fBTcl_AlertNotifier\fR is used in multithreaded applications to allow
|
||||
any thread to
|
||||
\fBTcl_AlertNotifier\fR is used to allow any thread to
|
||||
.QW "wake up"
|
||||
the notifier to alert it to new events on its
|
||||
queue. \fBTcl_AlertNotifier\fR requires as an argument the notifier
|
||||
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
'\"
|
||||
'\" Contribution from Don Porter, NIST, 2022. (not subject to US copyright)
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_GetNumber 3 8.7 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_GetNumber, Tcl_GetNumberFromObj \- get numeric value from Tcl value
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
\fB#include <tclTomMath.h>\fR
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetNumber\fR(\fIinterp, bytes, numBytes, clientDataPtr, typePtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetNumberFromObj\fR(\fIinterp, objPtr, clientDataPtr, typePtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp clientDataPtr out
|
||||
.AP Tcl_Interp *interp out
|
||||
When non-NULL, error information is recorded here when the value is not
|
||||
in any of the numeric formats recognized by Tcl.
|
||||
.AP "const char" *bytes in
|
||||
Points to first byte of the string value to be examined.
|
||||
.AP size_t numBytes in
|
||||
The number of bytes, starting at \fIbytes\fR, that should be examined.
|
||||
If the value \fBTCL_INDEX_NONE\fR is provided, then all bytes should
|
||||
be examined until the first \fBNUL\fR byte terminates examination.
|
||||
.AP "void *" *clientDataPtr out
|
||||
Points to space where a pointer value may be written through which a numeric
|
||||
value is available to read.
|
||||
.AP int *typePtr out
|
||||
Points to space where a value may be written reporting what type of
|
||||
numeric storage is available to read.
|
||||
.AP Tcl_Obj *objPtr in
|
||||
A Tcl value to be examined.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures enable callers to retrieve a numeric value from a
|
||||
Tcl value in a numeric format recognized by Tcl.
|
||||
.PP
|
||||
Tcl recognizes many values as numbers. Several examples include:
|
||||
\fB"0"\fR, \fB" +1"\fR, \fB"-2 "\fR, \fB" 3 "\fR, \fB"0xdad1"\fR, \fB"0d09"\fR,
|
||||
\fB"1_000_000"\fR, \fB"4.0"\fR, \fB"1e-7"\fR, \fB"NaN"\fR, or \fB"Inf"\fR.
|
||||
When built-in Tcl commands act on these values as numbers, they are converted
|
||||
to a numeric representation for efficient handling in C code. Tcl makes
|
||||
use of three C types to store these representations: \fBdouble\fR,
|
||||
\fBTcl_WideInt\fR, and \fBmp_int\fR. The \fBdouble\fR type is provided by the
|
||||
C language standard. The \fBTcl_WideInt\fR type is declared in the Tcl
|
||||
header file, \fBtcl.h\fR, and is equivalent to the C standard type
|
||||
\fBlong long\fR on most platforms. The \fBmp_int\fR type is declared in the
|
||||
header file \fBtclTomMath.h\fR, and implemented by the LibTomMath
|
||||
multiple-precision integer library, included with Tcl.
|
||||
.PP
|
||||
The routines \fBTcl_GetNumber\fR and \fBTcl_GetNumberFromObj\fR perform
|
||||
the same function. They differ only in how the arguments present the Tcl
|
||||
value to be examined. \fBTcl_GetNumber\fR accepts a counted string
|
||||
value in the arguments \fIbytes\fR and \fInumBytes\fR (or a
|
||||
\fBNUL\fR-terminated string value when \fInumBytes\fR is
|
||||
\fBTCL_INDEX_NONE\fR). \fBTcl_GetNumberFromObj\fR accepts the Tcl value
|
||||
in \fIobjPtr\fR.
|
||||
.PP
|
||||
Both routines examine the Tcl value and determine whether Tcl recognizes
|
||||
it as a number. If not, both routines return \fBTCL_ERROR\fR and (when
|
||||
\fIinterp\fR is not NULL) record an error message and error code
|
||||
in \fIinterp\fR.
|
||||
.PP
|
||||
If Tcl does recognize the examined value as a number, both routines return
|
||||
\fBTCL_OK\fR, and use the pointer arguments \fIclientDataPtr\fR
|
||||
and \fItypePtr\fR (which may not be NULL) to report information the
|
||||
caller can use to retrieve the numeric representation. Both routines
|
||||
write to *\fIclientDataPtr\fR a pointer to the internal storage location
|
||||
where Tcl holds the converted numeric value.
|
||||
.PP
|
||||
When the converted numeric value is stored as a \fBdouble\fR,
|
||||
a call to math library routine \fBisnan\fR determines whether that
|
||||
value is not a number (NaN). If so, both \fBTcl_GetNumber\fR and
|
||||
\fBTcl_GetNumberFromObj\fR write the value \fBTCL_NUMBER_NAN\fR
|
||||
to *\fItypePtr\fR. If not, both routines write the value
|
||||
\fBTCL_NUMBER_DOUBLE\fR to *\fItypePtr\fR. These routines report
|
||||
different type values in these cases because \fBTcl_GetDoubleFromObj\fR
|
||||
raises an error on NaN values. For both reported type values,
|
||||
the storage pointer may be cast to type \fBconst double *\fR and
|
||||
the \fBdouble\fR numeric value may be read through it.
|
||||
.PP
|
||||
When the converted numeric value is stored as a \fBTcl_WideInt\fR,
|
||||
both \fBTcl_GetNumber\fR and \fBTcl_GetNumberFromObj\fR write the
|
||||
value \fBTCL_NUMBER_INT\fR to *\fItypePtr\fR.
|
||||
The storage pointer may be cast to type \fBconst Tcl_WideInt *\fR and
|
||||
the \fBTcl_WideInt\fR numeric value may be read through it.
|
||||
.PP
|
||||
When the converted numeric value is stored as an \fBmp_int\fR,
|
||||
both \fBTcl_GetNumber\fR and \fBTcl_GetNumberFromObj\fR write the
|
||||
value \fBTCL_NUMBER_BIG\fR to *\fItypePtr\fR.
|
||||
The storage pointer may be cast to type \fBconst mp_int *\fR and
|
||||
the \fBmp_int\fR numeric value may be read through it.
|
||||
.PP
|
||||
Future releases of Tcl might expand or revise the recognition of
|
||||
values as numbers. If additional storage representations are
|
||||
adopted, these routines will add new values to be written to
|
||||
*\fItypePtr\fR to identify them. Callers should consider how
|
||||
they should react to unknown values written to *\fItypePtr\fR.
|
||||
.PP
|
||||
When callers of these routines read numeric values through the
|
||||
reported storage pointer, they are accessing memory that belongs
|
||||
to the Tcl library. The Tcl library has the power to overwrite
|
||||
or free this memory. The storage pointer reported by a call to
|
||||
\fBTcl_GetNumber\fR or \fBTcl_GetNumberFromObj\fR should not be
|
||||
used after the same thread has possibly returned control to the
|
||||
Tcl library. If longer term access to the numeric value is needed,
|
||||
it should be copied into memory controlled by the caller. Callers
|
||||
must not attempt to write through or free the storage pointer.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_GetDouble, Tcl_GetDoubleFromObj, Tcl_GetWideIntFromObj
|
||||
.SH KEYWORDS
|
||||
double, double value, double type, integer, integer value, integer type,
|
||||
internal representation, value, value type, string representation
|
||||
+8
-3
@@ -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;
|
||||
@@ -283,7 +283,12 @@ to reduce storage requirements.
|
||||
Reference counting is used to determine when a value is
|
||||
no longer needed and can safely be freed.
|
||||
A value just created by \fBTcl_NewObj\fR or \fBTcl_NewStringObj\fR
|
||||
has \fIrefCount\fR 0.
|
||||
has \fIrefCount\fR 0, meaning that the object can often be given to a function
|
||||
like \fBTcl_SetObjResult\fR, \fBTcl_ListObjAppendElement\fR, or
|
||||
\fBTcl_DictObjPut\fR (as a value) without explicit reference management, all
|
||||
of which are common use cases. (The latter two require that the the target
|
||||
list or dictionary be well-formed, but that is often easy to arrange when the
|
||||
value is being initially constructed.)
|
||||
The macro \fBTcl_IncrRefCount\fR increments the reference count
|
||||
when a new reference to the value is created.
|
||||
The macro \fBTcl_DecrRefCount\fR decrements the count
|
||||
|
||||
+24
-2
@@ -184,8 +184,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,
|
||||
@@ -248,6 +248,28 @@ The \fIfreeIntRepProc\fR implementation must not access the
|
||||
uses of that field during value deletion. The defined tasks for
|
||||
the \fIfreeIntRepProc\fR have no need to consult the \fIbytes\fR
|
||||
member.
|
||||
.PP
|
||||
Note that if a subsidiary value has its reference count reduced to zero
|
||||
during the running of a \fIfreeIntRepProc\fR, that value may be not freed
|
||||
immediately, in order to limit stack usage. However, the value will be freed
|
||||
before the outermost current \fBTcl_DecrRefCount\fR returns.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The \fIobjPtr\fR argument to \fBTcl_AppendAllObjTypes\fR should be an unshared
|
||||
value; this function will not modify the reference count of that value, but
|
||||
will modify its contents. If \fIobjPtr\fR is not (interpretable as) a list,
|
||||
this function will set the interpreter result and produce an error; using an
|
||||
unshared empty value is strongly recommended.
|
||||
.PP
|
||||
The \fIobjPtr\fR argument to \fBTcl_ConvertToType\fR can have any non-zero
|
||||
reference count; this function will not modify the reference count, but may
|
||||
write to the interpreter result on error so values that originate from there
|
||||
should have an additional reference made before calling this.
|
||||
.PP
|
||||
None of the callback functions in the \fBTcl_ObjType\fR structure should
|
||||
modify the reference count of their arguments, but if the values contain
|
||||
subsidiary values (e.g., the elements of a list or the keys of a dictionary)
|
||||
then those subsidiary values may have their reference counts modified.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_NewObj(3), Tcl_DecrRefCount(3), Tcl_IncrRefCount(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
+36
-18
@@ -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
|
||||
@@ -92,10 +92,10 @@ int
|
||||
int
|
||||
\fBTcl_OutputBuffered\fR(\fIchannel\fR)
|
||||
.sp
|
||||
Tcl_WideInt
|
||||
long long
|
||||
\fBTcl_Seek\fR(\fIchannel, offset, seekMode\fR)
|
||||
.sp
|
||||
Tcl_WideInt
|
||||
long long
|
||||
\fBTcl_Tell\fR(\fIchannel\fR)
|
||||
.sp
|
||||
int
|
||||
@@ -119,7 +119,7 @@ allowed for the \fImode\fR argument to the Tcl \fBopen\fR command.
|
||||
.AP int permissions in
|
||||
POSIX-style permission flags such as 0644. If a new file is created, these
|
||||
permissions will be set on the created file.
|
||||
.AP int argc in
|
||||
.AP size_t argc in
|
||||
The number of elements in \fIargv\fR.
|
||||
.AP "const char" **argv in
|
||||
Arguments for constructing a command pipeline. These values have the same
|
||||
@@ -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,10 +187,10 @@ 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
|
||||
.AP "long long" offset in
|
||||
How far to move the access point in the channel at which the next input or
|
||||
output operation will be applied, measured in bytes from the position
|
||||
given by \fIseekMode\fR. May be either positive or negative.
|
||||
@@ -198,7 +198,7 @@ given by \fIseekMode\fR. May be either positive or negative.
|
||||
Relative to which point to seek; used with \fIoffset\fR to calculate the new
|
||||
access point for the channel. Legal values are \fBSEEK_SET\fR,
|
||||
\fBSEEK_CUR\fR, and \fBSEEK_END\fR.
|
||||
.AP Tcl_WideInt length in
|
||||
.AP "long long" length in
|
||||
The (non-negative) length to truncate the channel the channel to.
|
||||
.AP "const char" *optionName in
|
||||
The name of an option applicable to this channel, such as \fB\-blocking\fR.
|
||||
@@ -641,6 +641,24 @@ the channel was created with \fBTcl_OpenFileChannel\fR,
|
||||
\fBTcl_OpenCommandChannel\fR, or \fBTcl_MakeFileChannel\fR. Other
|
||||
channel types may return a different type of handle on Windows
|
||||
platforms.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The \fIreadObjPtr\fR argument to \fBTcl_ReadChars\fR must be an unshared
|
||||
value; it will be modified by this function. Using the interpreter result for
|
||||
this purpose is \fIstrongly\fR not recommended; the preferred pattern is to
|
||||
use a new value from \fBTcl_NewObj\fR to receive the data and only to pass it
|
||||
to \fBTcl_SetObjResult\fR if this function succeeds.
|
||||
.PP
|
||||
The \fIlineObjPtr\fR argument to \fBTcl_GetsObj\fR must be an unshared value;
|
||||
it will be modified by this function. Using the interpreter result for this
|
||||
purpose is \fIstrongly\fR not recommended; the preferred pattern is to use a
|
||||
new value from \fBTcl_NewObj\fR to receive the data and only to pass it to
|
||||
\fBTcl_SetObjResult\fR if this function succeeds.
|
||||
.PP
|
||||
The \fIwriteObjPtr\fR argument to \fBTcl_WriteObj\fR should be a value with
|
||||
any reference count. This function will not modify the reference count. Using
|
||||
the interpreter result without adding an additional reference to it is not
|
||||
recommended.
|
||||
.SH "SEE ALSO"
|
||||
DString(3), fconfigure(n), filename(n), fopen(3), Tcl_CreateChannel(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
+19
-5
@@ -4,12 +4,12 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_OpenTcpClient 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_OpenTcpClient 3 8.7 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
Tcl_OpenTcpClient, Tcl_MakeTcpClientChannel, Tcl_OpenTcpServer \- procedures to open channels using TCP sockets
|
||||
Tcl_OpenTcpClient, Tcl_MakeTcpClientChannel, Tcl_OpenTcpServer, Tcl_OpenTcpServerEx \- procedures to open channels using TCP sockets
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h> \fR
|
||||
@@ -23,6 +23,9 @@ Tcl_Channel
|
||||
Tcl_Channel
|
||||
\fBTcl_OpenTcpServer\fR(\fIinterp, port, myaddr, proc, clientData\fR)
|
||||
.sp
|
||||
Tcl_Channel
|
||||
\fBTcl_OpenTcpServerEx\fR(\fIinterp, service, myaddr, flags, proc, clientData\fR)
|
||||
.sp
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_TcpAcceptProc clientData
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -30,6 +33,9 @@ Tcl interpreter to use for error reporting. If non-NULL and an
|
||||
error occurs, an error message is left in the interpreter's result.
|
||||
.AP int port in
|
||||
A port number to connect to as a client or to listen on as a server.
|
||||
.AP "const char" *service in
|
||||
A string specifying the port number to connect to as a client or to listen on as
|
||||
a server.
|
||||
.AP "const char" *host in
|
||||
A string specifying a host name or address for the remote end of the connection.
|
||||
.AP int myport in
|
||||
@@ -41,12 +47,15 @@ for the local end of the connection. If NULL, a default interface is
|
||||
chosen.
|
||||
.AP int async in
|
||||
If nonzero, the client socket is connected asynchronously to the server.
|
||||
.AP ClientData sock in
|
||||
.AP "unsigned int" flags in
|
||||
ORed combination of \fBTCL_TCPSERVER\fR flags that specify additional
|
||||
informations about the socket being created.
|
||||
.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
|
||||
@@ -118,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);
|
||||
@@ -158,6 +167,11 @@ register it, use \fBTcl_RegisterChannel\fR.
|
||||
If one of the standard channels, \fBstdin\fR, \fBstdout\fR or \fBstderr\fR was
|
||||
previously closed, the act of creating the new channel also assigns it as a
|
||||
replacement for the standard channel.
|
||||
.SS TCL_OPENTCPSERVEREX
|
||||
.PP
|
||||
\fBTcl_OpenTcpServerEx\fR behaviour is identical to \fBTcl_OpenTcpServer\fR but
|
||||
gives more flexibility to the user by providing a mean to further customize some
|
||||
aspects of the socket via the \fIflags\fR parameter.
|
||||
.SH "PLATFORM ISSUES"
|
||||
.PP
|
||||
On Unix platforms, the socket handle is a Unix file descriptor as
|
||||
|
||||
+17
-6
@@ -7,7 +7,7 @@
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc \- report fatal error and abort
|
||||
Tcl_Panic, Tcl_SetPanicProc, Tcl_ConsolePanic \- report fatal error and abort
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -15,11 +15,11 @@ Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc \- report fatal error and abort
|
||||
void
|
||||
\fBTcl_Panic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_PanicVA\fR(\fIformat\fR, \fIargList\fR)
|
||||
const char *
|
||||
\fBTcl_SetPanicProc\fR(\fIpanicProc\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_SetPanicProc\fR(\fIpanicProc\fR)
|
||||
\fBTcl_ConsolePanic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR)
|
||||
.sp
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_PanicProc *panicProc
|
||||
@@ -54,6 +54,14 @@ message is sent to the debugger instead. If the windows executable
|
||||
does not have a stderr channel (e.g. \fBwish.exe\fR), then a
|
||||
system dialog box is used to display the panic message.
|
||||
.PP
|
||||
If your application doesn't use \fBTcl_Main\fR or \fBTk_Main\fR
|
||||
and you want to implicitly use the stderr channel of your
|
||||
application's C runtime (instead of the stderr channel of the
|
||||
C runtime used by Tcl), you can call \fBTcl_SetPanicProc\fR
|
||||
with \fBTcl_ConsolePanic\fR as its argument. On platforms which
|
||||
only have one C runtime (almost all platforms except Windows)
|
||||
\fBTcl_ConsolePanic\fR is equivalent to NULL.
|
||||
.PP
|
||||
\fBTcl_SetPanicProc\fR may be used to modify the behavior of
|
||||
\fBTcl_Panic\fR. The \fIpanicProc\fR argument should match the
|
||||
type \fBTcl_PanicProc\fR:
|
||||
@@ -71,18 +79,21 @@ making calls into the Tcl library, or into other libraries that may
|
||||
call the Tcl library, since the original call to \fBTcl_Panic\fR
|
||||
indicates the Tcl library is not in a state of reliable operation.
|
||||
.PP
|
||||
The result of \fBTcl_SetPanicProc\fR is the full Tcl version with build
|
||||
information (e.g., \fB9.0.0+abcdef...abcdef.gcc-1002\fR).
|
||||
.PP
|
||||
The typical use of \fBTcl_SetPanicProc\fR arranges for the error message
|
||||
to be displayed or reported in a manner more suitable for the
|
||||
application or the platform.
|
||||
.PP
|
||||
\fBTcl_SetPanicProc\fR can not be used in stub-enabled extensions.
|
||||
.PP
|
||||
Although the primary callers of \fBTcl_Panic\fR are the procedures of
|
||||
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
|
||||
|
||||
+11
-5
@@ -21,7 +21,7 @@ int
|
||||
Where to store error messages.
|
||||
.AP "const Tcl_ArgvInfo" *argTable in
|
||||
Pointer to array of option descriptors.
|
||||
.AP int *objcPtr in/out
|
||||
.AP "size_t \&| int" *objcPtr in/out
|
||||
A pointer to variable holding number of arguments in \fIobjv\fR. Will be
|
||||
modified to hold number of arguments left in the unprocessed argument list
|
||||
stored in \fIremObjv\fR.
|
||||
@@ -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,
|
||||
@@ -189,6 +189,12 @@ will be stored at \fIdstPtr\fR; the string inside will have a lifetime linked
|
||||
to the lifetime of the string representation of the argument value that it
|
||||
came from, and so should be copied if it needs to be retained. The
|
||||
\fIsrcPtr\fR and \fIclientData\fR fields are ignored.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The values in the \fIobjv\fR argument to \fBTcl_ParseArgsObjv\fR will not have
|
||||
their reference counts modified by this function. The interpreter result may
|
||||
be modified on error; the values passed should not be the interpreter result
|
||||
with no further reference added.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_GetIndexFromObj(3), Tcl_Main(3), Tcl_CreateObjCommand(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
+12
-26
@@ -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,23 +33,19 @@ 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
|
||||
.AP size_t numBytes in
|
||||
Number of bytes in string to parse, not including any terminating null
|
||||
character. If less than 0 then the script consists of all characters
|
||||
following \fIstart\fR up to the first null character.
|
||||
@@ -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,
|
||||
@@ -210,20 +196,20 @@ return parse information in two data structures, Tcl_Parse and Tcl_Token:
|
||||
.CS
|
||||
typedef struct Tcl_Parse {
|
||||
const char *\fIcommentStart\fR;
|
||||
int \fIcommentSize\fR;
|
||||
size_t \fIcommentSize\fR;
|
||||
const char *\fIcommandStart\fR;
|
||||
int \fIcommandSize\fR;
|
||||
int \fInumWords\fR;
|
||||
size_t \fIcommandSize\fR;
|
||||
size_t \fInumWords\fR;
|
||||
Tcl_Token *\fItokenPtr\fR;
|
||||
int \fInumTokens\fR;
|
||||
size_t \fInumTokens\fR;
|
||||
...
|
||||
} \fBTcl_Parse\fR;
|
||||
|
||||
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
|
||||
|
||||
+6
-2
@@ -55,7 +55,7 @@ Pointer to place to store the value associated with the matching
|
||||
package. It is only changed if the pointer is not NULL and the
|
||||
function completed successfully. The storage can be any pointer
|
||||
type with the same size as a void pointer.
|
||||
.AP int objc in
|
||||
.AP size_t objc in
|
||||
Number of requirements.
|
||||
.AP Tcl_Obj* objv[] in
|
||||
Array of requirements.
|
||||
@@ -91,7 +91,11 @@ functions.
|
||||
\fBTcl_PkgRequireProc\fR is the form of \fBpackage require\fR handling
|
||||
multiple requirements. The other forms are present for backward
|
||||
compatibility and translate their invocations to this form.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The requirements values given (in the \fIobjv\fR argument) to
|
||||
\fBTcl_PkgRequireProc\fR must have non-zero reference counts.
|
||||
.SH KEYWORDS
|
||||
package, present, provide, require, version
|
||||
.SH "SEE ALSO"
|
||||
package(n), Tcl_StaticPackage(3)
|
||||
package(n), Tcl_StaticLibrary(3)
|
||||
|
||||
+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.
|
||||
|
||||
+7
-3
@@ -31,9 +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
|
||||
(or \fBTcl_GlobalEvalObj\fR if the \fBTCL_EVAL_GLOBAL\fR bit is set
|
||||
in \fIflags\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)
|
||||
@@ -46,6 +44,12 @@ allow the user to re-issue recently invoked commands.
|
||||
If the \fIflags\fR argument contains the \fBTCL_NO_EVAL\fR bit then
|
||||
the command is recorded without being evaluated.
|
||||
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The reference count of the \fIcmdPtr\fR argument to \fBTcl_RecordAndEvalObj\fR
|
||||
must be at least 1. This function will modify the interpreter result; do not
|
||||
use an existing result as \fIcmdPtr\fR directly without incrementing its
|
||||
reference count.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_EvalObjEx, Tcl_GetObjResult
|
||||
|
||||
|
||||
+4
-4
@@ -28,7 +28,7 @@ configuration as ASCII string. This means that this information is in
|
||||
UTF-8 too. Must not be NULL.
|
||||
.AP "const Tcl_Config" *configuration in
|
||||
Refers to an array of Tcl_Config entries containing the information
|
||||
embedded in the binary library. Must not be NULL. The end of the array
|
||||
embedded in the library. Must not be NULL. The end of the array
|
||||
is signaled by either a key identical to NULL, or a key referring to
|
||||
the empty string.
|
||||
.AP "const char" *valEncoding in
|
||||
@@ -40,10 +40,10 @@ too. Must not be NULL.
|
||||
.PP
|
||||
The function described here has its base in TIP 59 and provides
|
||||
extensions with support for the embedding of configuration
|
||||
information into their binary library and the generation of a
|
||||
information into their library and the generation of a
|
||||
Tcl-level interface for querying this information.
|
||||
.PP
|
||||
To embed configuration information into their binary library an
|
||||
To embed configuration information into their library an
|
||||
extension has to define a non-volatile array of Tcl_Config entries in
|
||||
one if its source files and then call \fBTcl_RegisterConfig\fR to
|
||||
register that information.
|
||||
@@ -108,4 +108,4 @@ typedef struct Tcl_Config {
|
||||
.\" No cross references yet.
|
||||
.\" .SH "SEE ALSO"
|
||||
.SH KEYWORDS
|
||||
embedding, configuration, binary library
|
||||
embedding, configuration, library
|
||||
|
||||
+24
-8
@@ -64,7 +64,7 @@ identifies the beginning of the larger string.
|
||||
If it is not the same as \fItext\fR, then no
|
||||
.QW \fB^\fR
|
||||
matches will be allowed.
|
||||
.AP int index in
|
||||
.AP size_t index in
|
||||
Specifies which range is desired: 0 means the range of the entire
|
||||
match, 1 or greater means the range that matched a parenthesized
|
||||
sub-expression.
|
||||
@@ -80,14 +80,14 @@ OR-ed combination of the compilation flags \fBTCL_REG_ADVANCED\fR,
|
||||
\fBTCL_REG_QUOTE\fR, \fBTCL_REG_NOCASE\fR, \fBTCL_REG_NEWLINE\fR,
|
||||
\fBTCL_REG_NLSTOP\fR, \fBTCL_REG_NLANCH\fR, \fBTCL_REG_NOSUB\fR, and
|
||||
\fBTCL_REG_CANMATCH\fR. See below for more information.
|
||||
.AP int offset in
|
||||
.AP size_t offset in
|
||||
The character offset into the text where matching should begin.
|
||||
The value of the offset has no impact on \fB^\fR matches. This
|
||||
behavior is controlled by \fIeflags\fR.
|
||||
.AP int nmatches in
|
||||
.AP size_t nmatches in
|
||||
The number of matching subexpressions that should be remembered for
|
||||
later use. If this value is 0, then no subexpression match
|
||||
information will be computed. If the value is \-1, then
|
||||
information will be computed. If the value is TCL_INDEX_NONE, then
|
||||
all of the matching subexpressions will be remembered. Any other
|
||||
value will be taken as the maximum number of subexpressions to
|
||||
remember.
|
||||
@@ -337,9 +337,9 @@ defined as follows:
|
||||
.PP
|
||||
.CS
|
||||
typedef struct Tcl_RegExpInfo {
|
||||
int \fInsubs\fR;
|
||||
size_t \fInsubs\fR;
|
||||
Tcl_RegExpIndices *\fImatches\fR;
|
||||
long \fIextendStart\fR;
|
||||
size_t \fIextendStart\fR;
|
||||
} \fBTcl_RegExpInfo\fR;
|
||||
.CE
|
||||
.PP
|
||||
@@ -355,8 +355,8 @@ follows:
|
||||
.PP
|
||||
.CS
|
||||
typedef struct Tcl_RegExpIndices {
|
||||
long \fIstart\fR;
|
||||
long \fIend\fR;
|
||||
size_t \fIstart\fR;
|
||||
size_t \fIend\fR;
|
||||
} \fBTcl_RegExpIndices\fR;
|
||||
.CE
|
||||
.PP
|
||||
@@ -377,6 +377,22 @@ If no match was found, then it indicates the earliest point at which a
|
||||
match might occur if additional text is appended to the string. If it
|
||||
is no match is possible even with further text, this field will be set
|
||||
to \-1.
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The \fItextObj\fR and \fIpatObj\fR arguments to \fBTcl_RegExpMatchObj\fR must
|
||||
have reference counts of at least 1. Note however that this function may set
|
||||
the interpreter result; neither argument should be the direct interpreter
|
||||
result without an additional reference being taken.
|
||||
.PP
|
||||
The \fIpatObj\fR argument to \fBTcl_GetRegExpFromObj\fR must have a reference
|
||||
count of at least 1. Note however that this function may set the interpreter
|
||||
result; the argument should not be the direct interpreter result without an
|
||||
additional reference being taken.
|
||||
.PP
|
||||
The \fItextObj\fR argument to \fBTcl_RegExpExecObj\fR must have a reference
|
||||
count of at least 1. Note however that this function may set the interpreter
|
||||
result; the argument should not be the direct interpreter result without an
|
||||
additional reference being taken.
|
||||
.SH "SEE ALSO"
|
||||
re_syntax(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1997 Sun Microsystems, Inc.
|
||||
'\" Contributions from Don Porter, NIST, 2004. (not subject to US copyright)
|
||||
'\" Copyright (c) 2018 Nathan Coulter.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_SaveInterpState 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_SaveInterpState, Tcl_RestoreInterpState, Tcl_DiscardInterpState \- Save and restore the
|
||||
state of an an interpreter.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
Tcl_InterpState
|
||||
\fBTcl_SaveInterpState\fR(\fIinterp, status\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_RestoreInterpState\fR(\fIinterp, state\fR)
|
||||
.sp
|
||||
\fBTcl_DiscardInterpState\fR(\fIstate\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_InterpState savedPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
The interpreter for the operation.
|
||||
.AP int status in
|
||||
The return code for the state.
|
||||
.AP Tcl_InterpState state in
|
||||
A token for saved state.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These routines save the state of an interpreter before a call to a routine such
|
||||
as \fBTcl_Eval\fR, and restore the state afterwards.
|
||||
.PP
|
||||
\fBTcl_SaveInterpState\fR saves the parts of \fIinterp\fR that comprise the
|
||||
result of a script, including the resulting value, the return code passed as
|
||||
\fIstatus\fR, and any options such as \fB\-errorinfo\fR and \fB\-errorcode\fR.
|
||||
It returns a token for the saved state. The interpreter result is not reset
|
||||
and no interpreter state is changed.
|
||||
.PP
|
||||
\fBTcl_RestoreInterpState\fR restores the state indicated by \fIstate\fR and
|
||||
returns the \fIstatus\fR originally passed in the corresponding call to
|
||||
\fBTcl_SaveInterpState\fR.
|
||||
.PP
|
||||
If a saved state is not restored, \fBTcl_DiscardInterpState\fR must be called
|
||||
to release it. A token used to discard or restore state must not be used
|
||||
again.
|
||||
.SH KEYWORDS
|
||||
result, state, interp
|
||||
@@ -1,120 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1997 Sun Microsystems, Inc.
|
||||
'\" Contributions from Don Porter, NIST, 2004. (not subject to US copyright)
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_SaveResult 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_SaveInterpState, Tcl_RestoreInterpState, Tcl_DiscardInterpState, Tcl_SaveResult, Tcl_RestoreResult, Tcl_DiscardResult \- save and restore an interpreter's state
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
Tcl_InterpState
|
||||
\fBTcl_SaveInterpState\fR(\fIinterp, status\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_RestoreInterpState\fR(\fIinterp, state\fR)
|
||||
.sp
|
||||
\fBTcl_DiscardInterpState\fR(\fIstate\fR)
|
||||
.sp
|
||||
\fBTcl_SaveResult\fR(\fIinterp, savedPtr\fR)
|
||||
.sp
|
||||
\fBTcl_RestoreResult\fR(\fIinterp, savedPtr\fR)
|
||||
.sp
|
||||
\fBTcl_DiscardResult\fR(\fIsavedPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_InterpState savedPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter for which state should be saved.
|
||||
.AP int status in
|
||||
Return code value to save as part of interpreter state.
|
||||
.AP Tcl_InterpState state in
|
||||
Saved state token to be restored or discarded.
|
||||
.AP Tcl_SavedResult *savedPtr in
|
||||
Pointer to location where interpreter result should be saved or restored.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These routines allows a C procedure to take a snapshot of the current
|
||||
state of an interpreter so that it can be restored after a call
|
||||
to \fBTcl_Eval\fR or some other routine that modifies the interpreter
|
||||
state. There are two triplets of routines meant to work together.
|
||||
.PP
|
||||
The first triplet stores the snapshot of interpreter state in
|
||||
an opaque token returned by \fBTcl_SaveInterpState\fR. That token
|
||||
value may then be passed back to one of \fBTcl_RestoreInterpState\fR
|
||||
or \fBTcl_DiscardInterpState\fR, depending on whether the interp
|
||||
state is to be restored. So long as one of the latter two routines
|
||||
is called, Tcl will take care of memory management.
|
||||
.PP
|
||||
The second triplet stores the snapshot of only the interpreter
|
||||
result (not its complete state) in memory allocated by the caller.
|
||||
These routines are passed a pointer to \fBTcl_SavedResult\fR
|
||||
that is used to store enough information to restore the interpreter result.
|
||||
\fBTcl_SavedResult\fR can be allocated on the stack of the calling
|
||||
procedure. These routines do not save the state of any error
|
||||
information in the interpreter (e.g. the \fB\-errorcode\fR or
|
||||
\fB\-errorinfo\fR return options, when an error is in progress).
|
||||
.PP
|
||||
Because the routines \fBTcl_SaveInterpState\fR,
|
||||
\fBTcl_RestoreInterpState\fR, and \fBTcl_DiscardInterpState\fR perform
|
||||
a superset of the functions provided by the other routines,
|
||||
any new code should only make use of the more powerful routines.
|
||||
The older, weaker routines \fBTcl_SaveResult\fR, \fBTcl_RestoreResult\fR,
|
||||
and \fBTcl_DiscardResult\fR continue to exist only for the sake
|
||||
of existing programs that may already be using them.
|
||||
.PP
|
||||
\fBTcl_SaveInterpState\fR takes a snapshot of those portions of
|
||||
interpreter state that make up the full result of script evaluation.
|
||||
This include the interpreter result, the return code (passed in
|
||||
as the \fIstatus\fR argument, and any return options, including
|
||||
\fB\-errorinfo\fR and \fB\-errorcode\fR when an error is in progress.
|
||||
This snapshot is returned as an opaque token of type \fBTcl_InterpState\fR.
|
||||
The call to \fBTcl_SaveInterpState\fR does not itself change the
|
||||
state of the interpreter. Unlike \fBTcl_SaveResult\fR, it does
|
||||
not reset the interpreter.
|
||||
.PP
|
||||
\fBTcl_RestoreInterpState\fR accepts a \fBTcl_InterpState\fR token
|
||||
previously returned by \fBTcl_SaveInterpState\fR and restores the
|
||||
state of the interp to the state held in that snapshot. The return
|
||||
value of \fBTcl_RestoreInterpState\fR is the status value originally
|
||||
passed to \fBTcl_SaveInterpState\fR when the snapshot token was
|
||||
created.
|
||||
.PP
|
||||
\fBTcl_DiscardInterpState\fR is called to release a \fBTcl_InterpState\fR
|
||||
token previously returned by \fBTcl_SaveInterpState\fR when that
|
||||
snapshot is not to be restored to an interp.
|
||||
.PP
|
||||
The \fBTcl_InterpState\fR token returned by \fBTcl_SaveInterpState\fR
|
||||
must eventually be passed to either \fBTcl_RestoreInterpState\fR
|
||||
or \fBTcl_DiscardInterpState\fR to avoid a memory leak. Once
|
||||
the \fBTcl_InterpState\fR token is passed to one of them, the
|
||||
token is no longer valid and should not be used anymore.
|
||||
.PP
|
||||
\fBTcl_SaveResult\fR moves the string and value results
|
||||
of \fIinterp\fR into the location specified by \fIstatePtr\fR.
|
||||
\fBTcl_SaveResult\fR clears the result for \fIinterp\fR and
|
||||
leaves the result in its normal empty initialized state.
|
||||
.PP
|
||||
\fBTcl_RestoreResult\fR moves the string and value results from
|
||||
\fIstatePtr\fR back into \fIinterp\fR. Any result or error that was
|
||||
already in the interpreter will be cleared. The \fIstatePtr\fR is left
|
||||
in an uninitialized state and cannot be used until another call to
|
||||
\fBTcl_SaveResult\fR.
|
||||
.PP
|
||||
\fBTcl_DiscardResult\fR releases the saved interpreter state
|
||||
stored at \fBstatePtr\fR. The state structure is left in an
|
||||
uninitialized state and cannot be used until another call to
|
||||
\fBTcl_SaveResult\fR.
|
||||
.PP
|
||||
Once \fBTcl_SaveResult\fR is called to save the interpreter
|
||||
result, either \fBTcl_RestoreResult\fR or
|
||||
\fBTcl_DiscardResult\fR must be called to properly clean up the
|
||||
memory associated with the saved state.
|
||||
.SH KEYWORDS
|
||||
result, state, interp
|
||||
+12
-7
@@ -35,20 +35,20 @@ Refers to the Tcl interpreter whose bypass area is accessed.
|
||||
.AP Tcl_Obj* msg in
|
||||
Error message put into a bypass area. A list of return options and values,
|
||||
followed by a string message. Both message and the option/value information
|
||||
are optional.
|
||||
are optional. This \fImust\fR be a well-formed list.
|
||||
.AP Tcl_Obj** msgPtr out
|
||||
Reference to a place where the message stored in the accessed bypass area can
|
||||
be stored in.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The current definition of a Tcl channel driver does not permit the direct
|
||||
The standard definition of a Tcl channel driver does not permit the direct
|
||||
return of arbitrary error messages, except for the setting and retrieval of
|
||||
channel options. All other functions are restricted to POSIX error codes.
|
||||
.PP
|
||||
The functions described here overcome this limitation. Channel drivers are
|
||||
allowed to use \fBTcl_SetChannelError\fR and \fBTcl_SetChannelErrorInterp\fR
|
||||
to place arbitrary error messages in \fBbypass areas\fR defined for channels
|
||||
to place arbitrary error messages in \fIbypass areas\fR defined for channels
|
||||
and interpreters. And the generic I/O layer uses \fBTcl_GetChannelError\fR and
|
||||
\fBTcl_GetChannelErrorInterp\fR to look for messages in the bypass areas and
|
||||
arrange for their return as errors. The POSIX error codes set by a driver are
|
||||
@@ -87,14 +87,10 @@ the value.
|
||||
Which functions of a channel driver are allowed to use which bypass function
|
||||
is listed below, as is which functions of the public channel API may leave a
|
||||
messages in the bypass areas.
|
||||
.IP \fBTcl_DriverCloseProc\fR
|
||||
May use \fBTcl_SetChannelErrorInterp\fR, and only this function.
|
||||
.IP \fBTcl_DriverInputProc\fR
|
||||
May use \fBTcl_SetChannelError\fR, and only this function.
|
||||
.IP \fBTcl_DriverOutputProc\fR
|
||||
May use \fBTcl_SetChannelError\fR, and only this function.
|
||||
.IP \fBTcl_DriverSeekProc\fR
|
||||
May use \fBTcl_SetChannelError\fR, and only this function.
|
||||
.IP \fBTcl_DriverWideSeekProc\fR
|
||||
May use \fBTcl_SetChannelError\fR, and only this function.
|
||||
.IP \fBTcl_DriverSetOptionProc\fR
|
||||
@@ -134,6 +130,15 @@ leave all their error information in the interpreter result.
|
||||
.ta 1.9i 4i
|
||||
\fBTcl_Close\fR \fBTcl_UnstackChannel\fR \fBTcl_UnregisterChannel\fR
|
||||
.DE
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The \fImsg\fR argument to \fBTcl_SetChannelError\fR and
|
||||
\fBTcl_SetChannelErrorInterp\fR, if not NULL, may have any reference count;
|
||||
these functions will copy.
|
||||
.PP
|
||||
\fBTcl_GetChannelError\fR and \fBTcl_GetChannelErrorInterp\fR write a value
|
||||
reference into their \fImsgPtr\fR, but do not manipulate its reference count.
|
||||
The reference count will be at least 1 (unless the reference is NULL).
|
||||
.SH "SEE ALSO"
|
||||
Tcl_Close(3), Tcl_OpenFileChannel(3), Tcl_SetErrno(3)
|
||||
.SH KEYWORDS
|
||||
|
||||
+3
-3
@@ -14,14 +14,14 @@ Tcl_SetRecursionLimit \- set maximum allowable nesting depth in interpreter
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_SetRecursionLimit\fR(\fIinterp, depth\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *interp
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter whose recursion limit is to be set.
|
||||
Must be greater than zero.
|
||||
.AP int depth in
|
||||
.AP size_t depth in
|
||||
New limit for nested calls to \fBTcl_Eval\fR for \fIinterp\fR.
|
||||
.BE
|
||||
|
||||
@@ -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.
|
||||
|
||||
+29
-40
@@ -5,11 +5,11 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_SetResult 3 8.6 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_SetResult 3 8.7 Tcl "Tcl Library Procedures"
|
||||
.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 \- manipulate Tcl result
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -26,17 +26,11 @@ 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
|
||||
\fBTcl_TransferResult\fR(\fIsourceInterp, code, targetInterp\fR)
|
||||
.VE 8.6
|
||||
.sp
|
||||
\fBTcl_AppendElement\fR(\fIinterp, element\fR)
|
||||
.sp
|
||||
\fBTcl_FreeResult\fR(\fIinterp\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_FreeProc sourceInterp out
|
||||
.AP Tcl_Interp *interp out
|
||||
@@ -57,17 +51,11 @@ Address of procedure to call to release storage at
|
||||
An argument list which must have been initialized using
|
||||
\fBva_start\fR, and cleared using \fBva_end\fR.
|
||||
.AP Tcl_Interp *sourceInterp in
|
||||
.VS 8.6
|
||||
Interpreter that the result and return options should be transferred from.
|
||||
.VE 8.6
|
||||
.AP Tcl_Interp *targetInterp in
|
||||
.VS 8.6
|
||||
Interpreter that the result and return options should be transferred to.
|
||||
.VE 8.6
|
||||
.AP int code in
|
||||
.VS 8.6
|
||||
Return code value that controls transfer of return options.
|
||||
.VE 8.6
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
@@ -151,10 +139,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 transfers interpreter state from \fIsourceInterp\fR
|
||||
to \fItargetInterp\fR. The two interpreters must have been created in the
|
||||
same thread. If \fIsourceInterp\fR and \fItargetInterp\fR are the same,
|
||||
@@ -163,7 +147,6 @@ from \fIsourceInterp\fR to \fItargetInterp\fR, and resets the result
|
||||
in \fIsourceInterp\fR. It also moves the return options dictionary as
|
||||
controlled by the return code value \fIcode\fR in the same manner
|
||||
as \fBTcl_GetReturnOptions\fR.
|
||||
.VE 8.6
|
||||
.SH "DEPRECATED INTERFACES"
|
||||
.SS "OLD STRING PROCEDURES"
|
||||
.PP
|
||||
@@ -192,27 +175,6 @@ single character
|
||||
or ends in the characters
|
||||
.QW " {" )
|
||||
then no space is added.
|
||||
.PP
|
||||
\fBTcl_FreeResult\fR performs part of the work
|
||||
of \fBTcl_ResetResult\fR.
|
||||
It frees up the memory associated with \fIinterp\fR's result.
|
||||
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
|
||||
@@ -252,6 +214,33 @@ typedef void \fBTcl_FreeProc\fR(
|
||||
.PP
|
||||
When \fIfreeProc\fR is called, its \fIblockPtr\fR will be set to
|
||||
the value of \fIresult\fR passed to \fBTcl_SetResult\fR.
|
||||
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The interpreter result is one of the main places that owns references to
|
||||
values, along with the bytecode execution stack, argument lists, variables,
|
||||
and the list and dictionary collection values.
|
||||
.PP
|
||||
\fBTcl_SetObjResult\fR takes a value with an arbitrary reference count
|
||||
\fI(specifically including zero)\fR and guarantees to increment the reference
|
||||
count. If code wishes to continue using the value after setting it as the
|
||||
result, it should add its own reference to it with \fBTcl_IncrRefCount\fR.
|
||||
.PP
|
||||
\fBTcl_GetObjResult\fR returns the current interpreter result value. This will
|
||||
have a reference count of at least 1. If the caller wishes to keep the
|
||||
interpreter result value, it should increment its reference count.
|
||||
.PP
|
||||
\fBTcl_GetStringResult\fR does not manipulate reference counts, but the string
|
||||
it returns is owned by (and has a lifetime controlled by) the current
|
||||
interpreter result value; it should be copied instead of being relied upon to
|
||||
persist after the next Tcl API call, as most Tcl operations can modify the
|
||||
interpreter result.
|
||||
.PP
|
||||
\fBTcl_SetResult\fR, \fBTcl_AppendResult\fR, \fBTcl_AppendResultVA\fR,
|
||||
\fBTcl_AppendElement\fR, and \fBTcl_ResetResult\fR all modify the interpreter
|
||||
result. They may cause the old interpreter result to have its reference count
|
||||
decremented and a new interpreter result to be allocated. After they have been
|
||||
called, the reference count of the interpreter result is guaranteed to be 1.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp,
|
||||
Tcl_GetReturnOptions
|
||||
|
||||
@@ -242,6 +242,27 @@ but the array remains.
|
||||
If an array name is specified without an index, then the entire
|
||||
array is removed.
|
||||
|
||||
.SH "REFERENCE COUNT MANAGEMENT"
|
||||
.PP
|
||||
The result of \fBTcl_SetVar2Ex\fR, \fBTcl_ObjSetVar2\fR, \fBTcl_GetVar2Ex\fR,
|
||||
and \fBTcl_ObjGetVar2\fR is (if non-NULL) a value with a reference of at least
|
||||
1, where that reference is held by the variable that the function has just
|
||||
operated upon.
|
||||
.PP
|
||||
The \fInewValuePtr\fR argument to \fBTcl_SetVar2Ex\fR and \fBTcl_ObjSetVar2\fR
|
||||
may be an arbitrary reference count value; its reference count will be
|
||||
incremented on success. However, it is recommended to not use a zero reference
|
||||
count value, as that makes correct handling of the error case tricky.
|
||||
.PP
|
||||
The \fIpart1\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR can
|
||||
have any reference count; these functions never modify it. It is recommended
|
||||
to not use a zero reference count for this argument.
|
||||
.PP
|
||||
The \fIpart2\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR, if
|
||||
non-NULL, should not have a zero reference count as these functions may
|
||||
retain a reference to it (particularly when it is used to create an array
|
||||
element that did not previously exist).
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tcl_GetObjResult, Tcl_GetStringResult, Tcl_TraceVar
|
||||
|
||||
|
||||
+13
-11
@@ -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
|
||||
@@ -38,14 +38,14 @@ Interpreter to use for error reporting. If NULL, then no error message
|
||||
is left.
|
||||
.AP "const char" *list in
|
||||
Pointer to a string with proper list structure.
|
||||
.AP int *argcPtr out
|
||||
.AP "size_t \&| int" *argcPtr out
|
||||
Filled in with number of elements in \fIlist\fR.
|
||||
.AP "const char" ***argvPtr out
|
||||
\fI*argvPtr\fR will be filled in with the address of an array of
|
||||
pointers to the strings that are the extracted elements of \fIlist\fR.
|
||||
There will be \fI*argcPtr\fR valid entries in the array, followed by
|
||||
a NULL entry.
|
||||
.AP int argc in
|
||||
.AP size_t argc in
|
||||
Number of elements in \fIargv\fR.
|
||||
.AP "const char *const" *argv in
|
||||
Array of strings to merge together into a single list.
|
||||
@@ -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
|
||||
@@ -81,7 +81,8 @@ For example, suppose that you have called \fBTcl_SplitList\fR with
|
||||
the following code:
|
||||
.PP
|
||||
.CS
|
||||
int argc, code;
|
||||
size_t argc;
|
||||
int code;
|
||||
char *string;
|
||||
char **argv;
|
||||
\&...
|
||||
@@ -92,12 +93,13 @@ Then you should eventually free the storage with a call like the
|
||||
following:
|
||||
.PP
|
||||
.CS
|
||||
Tcl_Free((char *) argv);
|
||||
Tcl_Free(argv);
|
||||
.CE
|
||||
.PP
|
||||
\fBTcl_SplitList\fR normally returns \fBTCL_OK\fR, which means the list was
|
||||
successfully parsed.
|
||||
If there was a syntax error in \fIlist\fR, then \fBTCL_ERROR\fR is returned
|
||||
successfully parsed. If \fIsizePtr\fR points to a variable of type
|
||||
\fBint\fR and the list contains more than 2**31 key/value pairs, or there was
|
||||
a syntax error in \fIlist\fR, then \fBTCL_ERROR\fR is returned
|
||||
and the interpreter's result will point to an error message describing the
|
||||
problem (if \fIinterp\fR was not NULL).
|
||||
If \fBTCL_ERROR\fR is returned then no memory is allocated and \fI*argvPtr\fR
|
||||
|
||||
+4
-4
@@ -25,14 +25,14 @@ Tcl_PathType
|
||||
.AP "const char" *path in
|
||||
File path in a form appropriate for the current platform (see the
|
||||
\fBfilename\fR manual entry for acceptable forms for path names).
|
||||
.AP int *argcPtr out
|
||||
.AP "size_t \&| int" *argcPtr out
|
||||
Filled in with number of path elements in \fIpath\fR.
|
||||
.AP "const char" ***argvPtr out
|
||||
\fI*argvPtr\fR will be filled in with the address of an array of
|
||||
pointers to the strings that are the extracted elements of \fIpath\fR.
|
||||
There will be \fI*argcPtr\fR valid entries in the array, followed by
|
||||
a NULL entry.
|
||||
.AP int argc in
|
||||
.AP size_t argc in
|
||||
Number of elements in \fIargv\fR.
|
||||
.AP "const char *const" *argv in
|
||||
Array of path elements to merge together into a single path.
|
||||
@@ -61,7 +61,7 @@ For example, suppose that you have called \fBTcl_SplitPath\fR with the
|
||||
following code:
|
||||
.PP
|
||||
.CS
|
||||
int argc;
|
||||
size_t argc;
|
||||
char *path;
|
||||
char **argv;
|
||||
\&...
|
||||
@@ -72,7 +72,7 @@ Then you should eventually free the storage with a call like the
|
||||
following:
|
||||
.PP
|
||||
.CS
|
||||
Tcl_Free((char *) argv);
|
||||
Tcl_Free(argv);
|
||||
.CE
|
||||
.PP
|
||||
\fBTcl_JoinPath\fR is the inverse of \fBTcl_SplitPath\fR: it takes a
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user