Compare commits
973
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ed1ab8041 | ||
|
|
cfe53b8870 | ||
|
|
9efaa4d7f1 | ||
|
|
dc84eca339 | ||
|
|
f15717bcda | ||
|
|
ff316586bc | ||
|
|
109828f090 | ||
|
|
d10368c785 | ||
|
|
0df05b3515 | ||
|
|
84623a09f2 | ||
|
|
1c0ca80fe5 | ||
|
|
c1bda6075e | ||
|
|
17211d39a0 | ||
|
|
37d6f90099 | ||
|
|
24b49c8a4d | ||
|
|
32d6283561 | ||
|
|
b0654427ca | ||
|
|
ff4d10ce27 | ||
|
|
6e6d624ec3 | ||
|
|
34d3750e3c | ||
|
|
3a13b3b940 | ||
|
|
48d0827130 | ||
|
|
1c788e178d | ||
|
|
ef66b6c75b | ||
|
|
be83197ee5 | ||
|
|
1e9e2448c1 | ||
|
|
33918a2b0b | ||
|
|
6459a50433 | ||
|
|
cac264cd19 | ||
|
|
c41f605368 | ||
|
|
fb10e693b2 | ||
|
|
2119ee5eb7 | ||
|
|
8514e60248 | ||
|
|
fd9662ee1c | ||
|
|
b502cdbf57 | ||
|
|
28e7632fe6 | ||
|
|
7f986a59bf | ||
|
|
8ac4aee0fc | ||
|
|
ad823f4eb1 | ||
|
|
f803a65cc1 | ||
|
|
4cecb91655 | ||
|
|
3c0c59407f | ||
|
|
40c3ec35ee | ||
|
|
0b669eacf8 | ||
|
|
a83eef06a3 | ||
|
|
8ce6115cf5 | ||
|
|
f0f85b5e6e | ||
|
|
81060c0741 | ||
|
|
71b64b8e1c | ||
|
|
f109d36b66 | ||
|
|
dd306f5b8f | ||
|
|
b01ac07465 | ||
|
|
69875ee99d | ||
|
|
546165585c | ||
|
|
664168a98e | ||
|
|
fd320780c7 | ||
|
|
59a788a6c4 | ||
|
|
08112f3f91 | ||
|
|
e51ff962f0 | ||
|
|
f3ae2684eb | ||
|
|
591316fa8d | ||
|
|
e3f7f1bad8 | ||
|
|
6c0f70fb0b | ||
|
|
f70e1f98b3 | ||
|
|
3fc1392c92 | ||
|
|
115a3559d7 | ||
|
|
fe00b6dcf6 | ||
|
|
81e7623b78 | ||
|
|
53fc9a5a6e | ||
|
|
ceb9567874 | ||
|
|
579cd0b138 | ||
|
|
ac08e647e9 | ||
|
|
cd1fc2183e | ||
|
|
208927f009 | ||
|
|
e250b6f551 | ||
|
|
7bf5af5c22 | ||
|
|
4a3369807b | ||
|
|
a6528d2ac3 | ||
|
|
92bd8b3a3f | ||
|
|
5039e7ce17 | ||
|
|
5c9a145403 | ||
|
|
e53cbf77bf | ||
|
|
7b6d53fa3b | ||
|
|
ec01eef200 | ||
|
|
a9405cc253 | ||
|
|
17b3cb8739 | ||
|
|
4dfeb77d2e | ||
|
|
f7bdf7cfb1 | ||
|
|
e352e2b742 | ||
|
|
b7c4b811ec | ||
|
|
09fd21b65b | ||
|
|
438dbdc047 | ||
|
|
cb6ae54424 | ||
|
|
1f4f47ccf5 | ||
|
|
195ea285da | ||
|
|
a24454331a | ||
|
|
20d206c4c2 | ||
|
|
d393dc4df7 | ||
|
|
98a93d4ca7 | ||
|
|
accd2800ec | ||
|
|
2b01204e41 | ||
|
|
43e27f10a5 | ||
|
|
293ce687e3 | ||
|
|
2342babe99 | ||
|
|
6ac6380f7a | ||
|
|
38b30033c8 | ||
|
|
43bcedde9b | ||
|
|
2a48060425 | ||
|
|
8e25003fbd | ||
|
|
e7e27b6290 | ||
|
|
947369a720 | ||
|
|
f6bf85fb67 | ||
|
|
69e29e6012 | ||
|
|
94a0658bc2 | ||
|
|
866a79313b | ||
|
|
636e4d4826 | ||
|
|
e6b8f92493 | ||
|
|
7b86373c88 | ||
|
|
194cfb5382 | ||
|
|
fe472174f8 | ||
|
|
9a01f0fa35 | ||
|
|
67f864dc65 | ||
|
|
29577449a1 | ||
|
|
f45a52ad97 | ||
|
|
21b10cef38 | ||
|
|
26bb60bef7 | ||
|
|
d550e5f966 | ||
|
|
167555e6ab | ||
|
|
00a4f18c38 | ||
|
|
8f0b94f037 | ||
|
|
9d34b872ce | ||
|
|
b8b008ad84 | ||
|
|
abc23e6723 | ||
|
|
e4fcd7152b | ||
|
|
3ee0402bd5 | ||
|
|
3fcb054f91 | ||
|
|
5189ce8eae | ||
|
|
a9ba2a08b5 | ||
|
|
768db27d4c | ||
|
|
ebb520a849 | ||
|
|
9e43cbb973 | ||
|
|
a9fc439a35 | ||
|
|
7f917c56f7 | ||
|
|
7a56ff406f | ||
|
|
fb77f1148f | ||
|
|
107d130ce3 | ||
|
|
0266195479 | ||
|
|
bddd146942 | ||
|
|
e42885732a | ||
|
|
1a94f57ab6 | ||
|
|
516be1cd2e | ||
|
|
7b7d6e2116 | ||
|
|
bfbfb2e5d3 | ||
|
|
249c689f2d | ||
|
|
ac45c8d851 | ||
|
|
8da77a52ef | ||
|
|
57849b86a1 | ||
|
|
f0ab6a724c | ||
|
|
be275081a1 | ||
|
|
733b7a43a4 | ||
|
|
0a36b1187d | ||
|
|
bc10bf6d03 | ||
|
|
e14285c3a1 | ||
|
|
32975bd346 | ||
|
|
76e4a71917 | ||
|
|
23520a7648 | ||
|
|
1dc3124160 | ||
|
|
c11add7a17 | ||
|
|
929fdafe13 | ||
|
|
93124d77a6 | ||
|
|
2238887c08 | ||
|
|
5758c119f8 | ||
|
|
245a63f491 | ||
|
|
39aec08fb0 | ||
|
|
66798b2c01 | ||
|
|
52f93c85fd | ||
|
|
fa3cf75311 | ||
|
|
262b6297ea | ||
|
|
d0cfe30a0d | ||
|
|
f0ec68f072 | ||
|
|
5bef31d2da | ||
|
|
f073bc7484 | ||
|
|
e89503a925 | ||
|
|
278837f261 | ||
|
|
d16f803f15 | ||
|
|
779b664e54 | ||
|
|
6e44927248 | ||
|
|
aa4c91c838 | ||
|
|
524b1d9fb2 | ||
|
|
7f62b76887 | ||
|
|
0715d88019 | ||
|
|
f796d62367 | ||
|
|
2061afedcc | ||
|
|
f5ac592def | ||
|
|
06d15abf35 | ||
|
|
2592b1e93b | ||
|
|
1699143ae3 | ||
|
|
0e0be8492f | ||
|
|
f4d0f6366c | ||
|
|
049f2bdf3e | ||
|
|
60fde1d90f | ||
|
|
5cf272491e | ||
|
|
45e00e9df8 | ||
|
|
a7f1b76ad2 | ||
|
|
76b326ce86 | ||
|
|
264c574c23 | ||
|
|
230f0601cc | ||
|
|
0d66de6c27 | ||
|
|
618c49af4d | ||
|
|
87b0db4d91 | ||
|
|
66dd14a480 | ||
|
|
ff741e8b29 | ||
|
|
0aaf6122a5 | ||
|
|
f2963d15d0 | ||
|
|
1674055d7a | ||
|
|
fd253d8677 | ||
|
|
a4abf50c23 | ||
|
|
db325590a7 | ||
|
|
2b83b2c999 | ||
|
|
9f309d56cc | ||
|
|
712f88bef7 | ||
|
|
ee7073e468 | ||
|
|
de2793025f | ||
|
|
ebff38e965 | ||
|
|
4cdb0426f4 | ||
|
|
d85664964a | ||
|
|
264c84606b | ||
|
|
0ca087be13 | ||
|
|
008cd7d2a9 | ||
|
|
a9843e57c2 | ||
|
|
d995661712 | ||
|
|
724de352e3 | ||
|
|
6b0b7154f1 | ||
|
|
d52b3eef80 | ||
|
|
6c69cf8504 | ||
|
|
9cb408090e | ||
|
|
0468c659f5 | ||
|
|
30fd8c842c | ||
|
|
4047fa1ba8 | ||
|
|
517172cbc1 | ||
|
|
0cb06ba3ca | ||
|
|
3b621e98a7 | ||
|
|
6ecf15e4f1 | ||
|
|
213447740b | ||
|
|
5bb0947953 | ||
|
|
01b6b4918f | ||
|
|
db4a945f2e | ||
|
|
e3707dae62 | ||
|
|
643301e722 | ||
|
|
30c146de54 | ||
|
|
be42098b82 | ||
|
|
6149b214e8 | ||
|
|
4af0efa4cb | ||
|
|
18dfd2c466 | ||
|
|
de01488d55 | ||
|
|
ab94b4c534 | ||
|
|
953e3ea899 | ||
|
|
3b1ca15e07 | ||
|
|
c1d3ca8bae | ||
|
|
ffe530a1b2 | ||
|
|
df56e0e1df | ||
|
|
532db685f4 | ||
|
|
1f7a1beab2 | ||
|
|
43d2fdc86c | ||
|
|
1d040a5bae | ||
|
|
7cb8eb7218 | ||
|
|
fcab027ea1 | ||
|
|
7aa8eec897 | ||
|
|
82df9bf8f8 | ||
|
|
0d23451993 | ||
|
|
171bea3624 | ||
|
|
06a30a3a2a | ||
|
|
120f367646 | ||
|
|
5f4ef0229d | ||
|
|
b2d5b24a70 | ||
|
|
dc1ca56b6a | ||
|
|
d753cbc088 | ||
|
|
749efa7f84 | ||
|
|
1971f6ab14 | ||
|
|
591c90cd3e | ||
|
|
f78ef1eea2 | ||
|
|
40b259956c | ||
|
|
430924da25 | ||
|
|
5dfe6151b2 | ||
|
|
6560454489 | ||
|
|
270c9b99d6 | ||
|
|
e1968256d8 | ||
|
|
a5455c136a | ||
|
|
7aa1b00468 | ||
|
|
acfbbfa019 | ||
|
|
3c1b7f78dc | ||
|
|
c903f10ac6 | ||
|
|
840355939d | ||
|
|
478d024dc3 | ||
|
|
80c4d66b21 | ||
|
|
1d4f551278 | ||
|
|
91c115082e | ||
|
|
167c883c08 | ||
|
|
52549ae747 | ||
|
|
cc21b0be2a | ||
|
|
330e4967ab | ||
|
|
e299458ad5 | ||
|
|
a6f978e38d | ||
|
|
39db46fbe1 | ||
|
|
998409ea9b | ||
|
|
dddf36c195 | ||
|
|
4b9763f5f7 | ||
|
|
b5e50e499a | ||
|
|
dfcc8ce6e5 | ||
|
|
b3f8c269fa | ||
|
|
c07c2bb91c | ||
|
|
ec626d9a15 | ||
|
|
30710a3cbd | ||
|
|
1ba4ad76b3 | ||
|
|
1c5831fa43 | ||
|
|
09fa076d29 | ||
|
|
d73c6dbd81 | ||
|
|
3e14eccec5 | ||
|
|
36d06e1e0b | ||
|
|
e29e808f57 | ||
|
|
6c0be70d2b | ||
|
|
9d14ed87d0 | ||
|
|
f397a9ac9d | ||
|
|
3cd49200d7 | ||
|
|
9eb49d9393 | ||
|
|
fd3f2b486c | ||
|
|
4f513496d8 | ||
|
|
823d13656d | ||
|
|
5ed72038da | ||
|
|
1cadacd498 | ||
|
|
4b765a3aff | ||
|
|
bb9b5e7606 | ||
|
|
f460900f9f | ||
|
|
9557127009 | ||
|
|
5c17e4a3f3 | ||
|
|
13e1ca04f2 | ||
|
|
a2db4b22d0 | ||
|
|
35d0992797 | ||
|
|
0f06b1b667 | ||
|
|
d40f0fe1b3 | ||
|
|
b85dcaa1f8 | ||
|
|
ca51d20173 | ||
|
|
b7a2d6b3d5 | ||
|
|
c1c4367262 | ||
|
|
33c3374723 | ||
|
|
6cc6771848 | ||
|
|
8b6ceae325 | ||
|
|
493182df76 | ||
|
|
34aa927a14 | ||
|
|
ea4722d786 | ||
|
|
e14cd07627 | ||
|
|
17c6c5b754 | ||
|
|
7c4cabaaae | ||
|
|
c92e694158 | ||
|
|
baf9ec7e2d | ||
|
|
a352df54ff | ||
|
|
0d231a3919 | ||
|
|
0e59966ac5 | ||
|
|
d98891b0a7 | ||
|
|
bb22d2e869 | ||
|
|
9684712f82 | ||
|
|
7f6ef9991b | ||
|
|
7fba80338f | ||
|
|
00ec998267 | ||
|
|
720183a9af | ||
|
|
14cfbc651c | ||
|
|
55bf49d15f | ||
|
|
5016da417f | ||
|
|
05f25dff9f | ||
|
|
d9db5801cc | ||
|
|
f472165a3d | ||
|
|
cab7f268d6 | ||
|
|
f9c196e0e6 | ||
|
|
204434e4d4 | ||
|
|
42d0a72e21 | ||
|
|
51449d078f | ||
|
|
e6a9f22409 | ||
|
|
d08036b2e4 | ||
|
|
99d517e3cb | ||
|
|
a03c2cb1c2 | ||
|
|
a2e8561972 | ||
|
|
bbe2ea1d0e | ||
|
|
a15ea81906 | ||
|
|
d91e1e6efb | ||
|
|
2705cb22d6 | ||
|
|
f48f2735de | ||
|
|
a541a7be4c | ||
|
|
d12eb85c8f | ||
|
|
201d01f9da | ||
|
|
fb48c78e68 | ||
|
|
4bca76be3b | ||
|
|
6310c709d3 | ||
|
|
690f2c2839 | ||
|
|
a300508fee | ||
|
|
2a52ff28dd | ||
|
|
651f71edfd | ||
|
|
8ca73e50ab | ||
|
|
56e784cb1b | ||
|
|
9598926f42 | ||
|
|
b4012447b0 | ||
|
|
85bdb7cb8e | ||
|
|
a352c6e663 | ||
|
|
711c236648 | ||
|
|
7d6a2292b5 | ||
|
|
18560d970e | ||
|
|
3cb9dde39e | ||
|
|
565b9dca95 | ||
|
|
a2560488bf | ||
|
|
8bd505ac83 | ||
|
|
d44da35f2c | ||
|
|
4c85e21797 | ||
|
|
a757f1e30d | ||
|
|
dc175e403d | ||
|
|
15c92b9300 | ||
|
|
03daf47cf0 | ||
|
|
634e9464b5 | ||
|
|
79214905a2 | ||
|
|
a13bb8b0ca | ||
|
|
5a82fc544e | ||
|
|
69fdd85b74 | ||
|
|
c14dbae8ad | ||
|
|
a812785399 | ||
|
|
2ad2cfc658 | ||
|
|
e152f1757c | ||
|
|
5e45a1d39a | ||
|
|
be285dcca7 | ||
|
|
4e07591402 | ||
|
|
ea2a934216 | ||
|
|
326725ae5d | ||
|
|
dfb89e6d09 | ||
|
|
fc071d71a5 | ||
|
|
7e2905fd74 | ||
|
|
7141714e0b | ||
|
|
4c9b6b2c4b | ||
|
|
e7adb3dadd | ||
|
|
a26b107bd3 | ||
|
|
26cf086c2c | ||
|
|
7169e0abe0 | ||
|
|
250532912f | ||
|
|
6d32ec4c20 | ||
|
|
4c326aa381 | ||
|
|
12ba446acb | ||
|
|
f0a97b5c71 | ||
|
|
cca23e5286 | ||
|
|
af4b36c13d | ||
|
|
9c9af976ae | ||
|
|
c256107a5c | ||
|
|
2c1750c78f | ||
|
|
0d59960edf | ||
|
|
7f5a85dcea | ||
|
|
57dc3221c2 | ||
|
|
507043f8d2 | ||
|
|
f5fb87d341 | ||
|
|
9fca62d042 | ||
|
|
1994f539c3 | ||
|
|
5079cec18e | ||
|
|
80b6a1a464 | ||
|
|
4424192e29 | ||
|
|
326bd29be7 | ||
|
|
418d81804c | ||
|
|
20c87d8e23 | ||
|
|
d4e9b75789 | ||
|
|
932835c1eb | ||
|
|
cd166c904c | ||
|
|
7311081584 | ||
|
|
9c113f21c0 | ||
|
|
f5a587a8d6 | ||
|
|
498a9bf1f9 | ||
|
|
928ceff7c4 | ||
|
|
2232bed6d6 | ||
|
|
65ac602b3d | ||
|
|
2cede8bf26 | ||
|
|
33781b4f56 | ||
|
|
a4d1a762c2 | ||
|
|
dbab2685a1 | ||
|
|
04f23379c6 | ||
|
|
ca6983f6f2 | ||
|
|
9deb7bb1f7 | ||
|
|
9f7678907a | ||
|
|
1acb4994ab | ||
|
|
468aa8f8f0 | ||
|
|
b63a473177 | ||
|
|
12c42f98ca | ||
|
|
0076acc80a | ||
|
|
e99f910b0e | ||
|
|
e599140047 | ||
|
|
dd000ce1a3 | ||
|
|
730530baba | ||
|
|
0bf471f204 | ||
|
|
6cabd70c0d | ||
|
|
7231e548e3 | ||
|
|
5bbb147862 | ||
|
|
e27302a170 | ||
|
|
7ee73a90ca | ||
|
|
f15ef338b9 | ||
|
|
1c6ca85d98 | ||
|
|
97399b2494 | ||
|
|
4dc8aea827 | ||
|
|
298726d3b8 | ||
|
|
c1d51931d9 | ||
|
|
c024f79ece | ||
|
|
5b449103dc | ||
|
|
1de8df2918 | ||
|
|
b3e1525f8a | ||
|
|
9e196fa34a | ||
|
|
71e331a3d7 | ||
|
|
84e4abc973 | ||
|
|
f2b9098a94 | ||
|
|
a5bc6e1045 | ||
|
|
630bd308da | ||
|
|
495791db7a | ||
|
|
fb50a7f7b5 | ||
|
|
4c7dc5ff2d | ||
|
|
c41c767bff | ||
|
|
5680e6571d | ||
|
|
63d413a031 | ||
|
|
efa3f20107 | ||
|
|
ee793dfa1e | ||
|
|
654d14d706 | ||
|
|
e1737976f9 | ||
|
|
083fb81946 | ||
|
|
f857db0e8e | ||
|
|
ea25a2d32d | ||
|
|
0b3e25d9ac | ||
|
|
0f48821995 | ||
|
|
b44555477c | ||
|
|
c1b87fe734 | ||
|
|
4dd5bcda82 | ||
|
|
b8e14e3802 | ||
|
|
41a031557e | ||
|
|
ec76fbd070 | ||
|
|
f7024e99c9 | ||
|
|
c856a8931e | ||
|
|
53e89dcb06 | ||
|
|
f41dac7480 | ||
|
|
6d2fb7b84d | ||
|
|
c54b77dd74 | ||
|
|
6de32c896a | ||
|
|
4f097ce365 | ||
|
|
a45eed2a6c | ||
|
|
3715125afc | ||
|
|
61d8bcc4f6 | ||
|
|
549548bacf | ||
|
|
4f9fc86e5d | ||
|
|
7d5a69fb31 | ||
|
|
5efc8e4cfb | ||
|
|
bfc534cb26 | ||
|
|
bc8811c498 | ||
|
|
ad28973d3c | ||
|
|
2c687a4d1d | ||
|
|
99c0854650 | ||
|
|
e47d494335 | ||
|
|
dd3240d860 | ||
|
|
d2d5ffc3b6 | ||
|
|
5320364a0d | ||
|
|
27b62f923f | ||
|
|
0b4d13b85c | ||
|
|
aca8877841 | ||
|
|
fd87c6a4bb | ||
|
|
38a609f39c | ||
|
|
cd2794b2d3 | ||
|
|
f198eb8b6b | ||
|
|
22f9794cfd | ||
|
|
446d76d5f3 | ||
|
|
b17f64a406 | ||
|
|
10d25a2209 | ||
|
|
e288cc94fa | ||
|
|
9392c28ed8 | ||
|
|
22274089f5 | ||
|
|
e137127ae3 | ||
|
|
d8fdcffdf7 | ||
|
|
889df48bf0 | ||
|
|
afba02fe04 | ||
|
|
77a25a222a | ||
|
|
a8c52ddb7d | ||
|
|
22ab1b1e6c | ||
|
|
e42d35507c | ||
|
|
69a1133f21 | ||
|
|
edceb04b1f | ||
|
|
606fa23238 | ||
|
|
924a7fca6b | ||
|
|
eb2fa54e32 | ||
|
|
0e5cda3a47 | ||
|
|
731ea18a69 | ||
|
|
be98f67f6a | ||
|
|
2e67393129 | ||
|
|
97e600c877 | ||
|
|
aa386ba8fc | ||
|
|
d9e077b2fa | ||
|
|
9a08654b23 | ||
|
|
3dce3e5685 | ||
|
|
99a9e5c7c5 | ||
|
|
d438ca171b | ||
|
|
4a86cf8b00 | ||
|
|
d2444449ec | ||
|
|
0f01f464de | ||
|
|
5fe38b57ea | ||
|
|
c202c057b1 | ||
|
|
f4072f4ef7 | ||
|
|
666cf1c887 | ||
|
|
4bd7d54291 | ||
|
|
b002a51274 | ||
|
|
1e6e700682 | ||
|
|
fc7ca4202e | ||
|
|
68c30819ad | ||
|
|
fa2ae66dcd | ||
|
|
8ddd5fea3c | ||
|
|
980bcbfdbf | ||
|
|
14abfaa3d0 | ||
|
|
d296c39c60 | ||
|
|
54e3729e91 | ||
|
|
8f8f9400f5 | ||
|
|
0103777046 | ||
|
|
d20e8e7e25 | ||
|
|
3a2ad288ca | ||
|
|
6c1d8e4d62 | ||
|
|
5edd5f235f | ||
|
|
6a0b66fc79 | ||
|
|
f3d156bf80 | ||
|
|
2280b62ae3 | ||
|
|
527a481e1a | ||
|
|
ae2a5363a3 | ||
|
|
1e0c16c4db | ||
|
|
a763531949 | ||
|
|
744ac0e8e6 | ||
|
|
54adbbe05c | ||
|
|
9848eb222d | ||
|
|
6e89d3d433 | ||
|
|
f47fbe763a | ||
|
|
fc83e1302a | ||
|
|
2fa58f1e9f | ||
|
|
401fb4fe4f | ||
|
|
b586e6742c | ||
|
|
5bd35202c0 | ||
|
|
b804844729 | ||
|
|
a9032c6dac | ||
|
|
f8715bf730 | ||
|
|
6bce59a249 | ||
|
|
47e4246d76 | ||
|
|
8ab2c9cf62 | ||
|
|
bc7b59b6f6 | ||
|
|
6a1a8526f1 | ||
|
|
e266daa43e | ||
|
|
6e29f3da25 | ||
|
|
50737b35c5 | ||
|
|
449b68a777 | ||
|
|
ad15c7af55 | ||
|
|
f3056f720b | ||
|
|
998384d149 | ||
|
|
c578a1e4fa | ||
|
|
988aec3c94 | ||
|
|
3597e830be | ||
|
|
c0fc8c6aad | ||
|
|
ddd4c15594 | ||
|
|
4c5782603a | ||
|
|
958d0d8617 | ||
|
|
9e82ddc739 | ||
|
|
2a007ddb50 | ||
|
|
ce51daca48 | ||
|
|
712dea6f45 | ||
|
|
5da270361f | ||
|
|
08d3728b1d | ||
|
|
329bb2e68d | ||
|
|
d58bfaf6f3 | ||
|
|
c3948aeea7 | ||
|
|
8c16a043c1 | ||
|
|
c8658d80cf | ||
|
|
6eaa73e23c | ||
|
|
b6f9e488f5 | ||
|
|
a514fc0bbb | ||
|
|
f00ce28128 | ||
|
|
fa618f393f | ||
|
|
c33fbde8df | ||
|
|
ac5b43b095 | ||
|
|
a2aaaad84a | ||
|
|
d6150b3cd3 | ||
|
|
39b03cdb38 | ||
|
|
d7364d1f4b | ||
|
|
d5d003595a | ||
|
|
303fbfc4be | ||
|
|
77bbf50dd0 | ||
|
|
adc1fbb1f1 | ||
|
|
a4232f298f | ||
|
|
da292a768b | ||
|
|
b083441639 | ||
|
|
bc266f9d91 | ||
|
|
9c405af577 | ||
|
|
2632f2d529 | ||
|
|
a98d79021f | ||
|
|
8a2823e5f8 | ||
|
|
49b167a388 | ||
|
|
2ded4dcac5 | ||
|
|
72f5a0b42f | ||
|
|
5821819beb | ||
|
|
745e45d119 | ||
|
|
f336629f65 | ||
|
|
254b4fa35f | ||
|
|
24cfa12d40 | ||
|
|
2c34ced219 | ||
|
|
c4a1ea568e | ||
|
|
1e155ca669 | ||
|
|
2a68cc554f | ||
|
|
7f9190f5db | ||
|
|
2328e4a58e | ||
|
|
d9f1c65e5b | ||
|
|
cf1d1dfbd9 | ||
|
|
026ddaafb8 | ||
|
|
c3d90415a2 | ||
|
|
f4a42dff01 | ||
|
|
0846f65993 | ||
|
|
f30e9cfd65 | ||
|
|
35cf0ba42a | ||
|
|
4a07460db0 | ||
|
|
4af90e27e5 | ||
|
|
63994a73e3 | ||
|
|
86d269ab0a | ||
|
|
912dd9a997 | ||
|
|
2cce06805f | ||
|
|
3929a73ee0 | ||
|
|
3d8bc1b9ce | ||
|
|
30c32418f6 | ||
|
|
802d340dad | ||
|
|
992ba81694 | ||
|
|
2345630acb | ||
|
|
31a63a3247 | ||
|
|
33f3ebf7ec | ||
|
|
7c18228900 | ||
|
|
108d222378 | ||
|
|
d6e3843b5a | ||
|
|
58232a8750 | ||
|
|
7fa698c624 | ||
|
|
29b9dd2e6f | ||
|
|
9d8c640e00 | ||
|
|
2a7ba6468e | ||
|
|
0ebc58865f | ||
|
|
a9fd991fe6 | ||
|
|
5570417141 | ||
|
|
dc9dbe5998 | ||
|
|
a3f11a86e9 | ||
|
|
2c19ef85ed | ||
|
|
5bf4816c29 | ||
|
|
5f9514bba4 | ||
|
|
c48019496e | ||
|
|
b77246e08b | ||
|
|
a3fdbe449b | ||
|
|
4b7066e5b3 | ||
|
|
8ff40f7d46 | ||
|
|
041d53289b | ||
|
|
a72376335b | ||
|
|
fc63e758a4 | ||
|
|
54beae13a7 | ||
|
|
c32336ef0e | ||
|
|
86052f5003 | ||
|
|
5953233f3b | ||
|
|
034fad8f6a | ||
|
|
01db149e3c | ||
|
|
1afc0833ed | ||
|
|
7c1facbfb4 | ||
|
|
d7e1a76e06 | ||
|
|
7d716898d7 | ||
|
|
3b9e37ced8 | ||
|
|
6776429ba1 | ||
|
|
631c17942e | ||
|
|
98496f3c16 | ||
|
|
1b9f0a138d | ||
|
|
889b9a832f | ||
|
|
99c687177a | ||
|
|
162b310610 | ||
|
|
a315170269 | ||
|
|
ff7ff08f29 | ||
|
|
fd4b052c0d | ||
|
|
f5a8aaadf8 | ||
|
|
329faccfd5 | ||
|
|
8d0c814716 | ||
|
|
d326c63806 | ||
|
|
3ae5ed3dfc | ||
|
|
89890a88e6 | ||
|
|
5074a34663 | ||
|
|
32a3c1d678 | ||
|
|
1d52808a73 | ||
|
|
de7ebc2ea1 | ||
|
|
e9fb22cfeb | ||
|
|
a91c7a019d | ||
|
|
676312d822 | ||
|
|
be44843404 | ||
|
|
9118bcfb5f | ||
|
|
8f533db35f | ||
|
|
077504f676 | ||
|
|
d0ff8f4a0d | ||
|
|
43b7af15a7 | ||
|
|
d1a4083e3f | ||
|
|
ac849b98ed | ||
|
|
beb5137192 | ||
|
|
4c162a421c | ||
|
|
de8a9991af | ||
|
|
0e4f559e7f | ||
|
|
fe32483d5c | ||
|
|
e38608eeb3 | ||
|
|
5a7749b042 | ||
|
|
f3b259c158 | ||
|
|
8ed389c37a | ||
|
|
3fc1c2a172 | ||
|
|
8d6601013e | ||
|
|
f00afc4fdd | ||
|
|
5a66f39637 | ||
|
|
87baa32396 | ||
|
|
38160dc3cc | ||
|
|
9be1e807d6 | ||
|
|
b6a51d3251 | ||
|
|
332c5aadfa | ||
|
|
bf9226489d | ||
|
|
3ea27f399f | ||
|
|
5fc479ca03 | ||
|
|
8e51252be8 | ||
|
|
f67e946a67 | ||
|
|
389e7e96e5 | ||
|
|
dfdf436fb2 | ||
|
|
93246519da | ||
|
|
405b29cd1b | ||
|
|
8f7d32c7dd | ||
|
|
43550ce1fa | ||
|
|
d8127f5c3a | ||
|
|
41381425e6 | ||
|
|
a9fd02e864 | ||
|
|
18e4f3d635 | ||
|
|
5a7c86fa32 | ||
|
|
69aedf8b17 | ||
|
|
9d9fcdf383 | ||
|
|
d7e26630c0 | ||
|
|
06bbb3d47b | ||
|
|
5d4efa2510 | ||
|
|
1b8114cd71 | ||
|
|
7ff0cfd5b7 | ||
|
|
13ebaf6ca3 | ||
|
|
c44fa310d2 | ||
|
|
f3c5988996 | ||
|
|
b28beee0fc | ||
|
|
7e79827ba3 | ||
|
|
33632b0955 | ||
|
|
d085d8f0bb | ||
|
|
27fd2bbb61 | ||
|
|
9ec6e380ed | ||
|
|
8f3c64a7cd | ||
|
|
1acefe17b1 | ||
|
|
a3bdd051a3 | ||
|
|
79b3f448c0 | ||
|
|
8665d61608 | ||
|
|
cbeadca761 | ||
|
|
6802d4740c | ||
|
|
22abf1ffa4 | ||
|
|
cda283c652 | ||
|
|
16ee735e92 | ||
|
|
0d8a34fe68 | ||
|
|
b3b2c76fdc | ||
|
|
1813f87d9a | ||
|
|
1e1530a566 | ||
|
|
af55df92b4 | ||
|
|
275904f8cb | ||
|
|
d85bcdef8b | ||
|
|
b89e3d8c83 | ||
|
|
fb040138c9 | ||
|
|
56f2abbf89 | ||
|
|
2cd7aa2260 | ||
|
|
bf1382a38f | ||
|
|
6362d5ced5 | ||
|
|
2d699b3818 | ||
|
|
e9121854f9 | ||
|
|
1a5b1241db | ||
|
|
065fc14cc4 | ||
|
|
8f3937588f | ||
|
|
d068a54395 | ||
|
|
52f3af0bcf | ||
|
|
4958363608 | ||
|
|
8726aabade | ||
|
|
d14ab39047 | ||
|
|
7f35785b2f | ||
|
|
17993c4a6f | ||
|
|
c358ee8f78 | ||
|
|
152c7b4944 | ||
|
|
24a1b4e94f | ||
|
|
35c793de5f | ||
|
|
6e4833d8fd | ||
|
|
ae65a0ee04 | ||
|
|
80a7abf7e5 | ||
|
|
d9415749f8 | ||
|
|
82947d7ebf | ||
|
|
0153d6f564 | ||
|
|
e75152402a | ||
|
|
fe0c007b96 | ||
|
|
1e8a4963fc | ||
|
|
2912ca25d8 | ||
|
|
ce1a26acf5 | ||
|
|
dc6c385849 | ||
|
|
52e96157d2 | ||
|
|
1d9a058eae | ||
|
|
11aba21de9 | ||
|
|
86273355c2 | ||
|
|
632946bbe0 | ||
|
|
b765d541e6 | ||
|
|
1583d8b4ef | ||
|
|
556c0dbc24 | ||
|
|
fc77f0dda4 | ||
|
|
4396d37f6f | ||
|
|
3f40916f38 | ||
|
|
bd089b3935 | ||
|
|
5d5451c6da | ||
|
|
a6c66ef755 | ||
|
|
e3967b9754 | ||
|
|
ae9073b853 | ||
|
|
810e5a0f69 | ||
|
|
a142b502a9 | ||
|
|
1224ff3e01 | ||
|
|
a9f4dacf81 | ||
|
|
f1d0940b8e | ||
|
|
c6ad528613 | ||
|
|
3f58909d20 | ||
|
|
dec6843491 | ||
|
|
b0bd304e08 | ||
|
|
cef22b73ee | ||
|
|
bbdcf41e95 | ||
|
|
eeff0f5146 | ||
|
|
0625bbefb4 | ||
|
|
dbdb35e20e | ||
|
|
f5daf73202 | ||
|
|
b7f809ade5 | ||
|
|
fa1cc2cd3f | ||
|
|
276049980e | ||
|
|
3721613126 | ||
|
|
21ec4f64b2 | ||
|
|
136bf8d460 | ||
|
|
69a117efbe | ||
|
|
ab449cd1d2 | ||
|
|
be3995f91a | ||
|
|
e05045246f | ||
|
|
6ba55114e2 | ||
|
|
9888ccda67 | ||
|
|
3558c04970 | ||
|
|
e0e662b6cd | ||
|
|
fe381e2b84 | ||
|
|
84da3c8113 | ||
|
|
4def430d27 | ||
|
|
9367d3491b | ||
|
|
a4cdc92947 | ||
|
|
0f58a5ca73 | ||
|
|
75b8ba1fa3 | ||
|
|
62c64586b6 | ||
|
|
810eeec19d | ||
|
|
737c82426b | ||
|
|
a3853cafd1 | ||
|
|
bcd1623533 | ||
|
|
73788579a1 | ||
|
|
44952e7c43 | ||
|
|
15b8ba49c1 | ||
|
|
cd1e068061 | ||
|
|
ba1938b59e | ||
|
|
4864626e88 | ||
|
|
7e70c52009 | ||
|
|
dc2e004dcb | ||
|
|
91661a7da0 | ||
|
|
25dac72093 | ||
|
|
9884b5887e | ||
|
|
91407fd3d6 | ||
|
|
658e03b4d7 | ||
|
|
121c6e30ab | ||
|
|
9f89b782ef | ||
|
|
2298ba7ed7 | ||
|
|
8265ea67d6 | ||
|
|
800ce1bfa2 | ||
|
|
dae5abca60 | ||
|
|
cd2d12e256 | ||
|
|
dc465cd88f | ||
|
|
bedeed1c1b | ||
|
|
f61c3bdb28 |
@@ -1,9 +1,12 @@
|
||||
compat/zlib/win32/zdll.lib
|
||||
compat/zlib/win32/zlib1.dll
|
||||
compat/zlib/win64/zdll.lib
|
||||
compat/zlib/win64/zlib1.dll
|
||||
compat/zlib/win64/libz.dll.a
|
||||
compat/zlib/zlib.3.pdf
|
||||
*.a
|
||||
*.bmp
|
||||
*.dll
|
||||
*.exe
|
||||
*.gif
|
||||
*.png
|
||||
*.gz
|
||||
*.jpg
|
||||
*.lib
|
||||
*.pdf
|
||||
*.png
|
||||
*.xlsx
|
||||
*.zip
|
||||
|
||||
@@ -32,7 +32,7 @@ libtommath/pretty.build
|
||||
libtommath/tommath.src
|
||||
libtommath/*.log
|
||||
libtommath/*.pdf
|
||||
libtommath/gen.pl
|
||||
libtommath/*.pl
|
||||
libtommath/*.sh
|
||||
libtommath/doc/*
|
||||
libtommath/tombc/*
|
||||
@@ -64,4 +64,5 @@ win/*.manifest
|
||||
win/pkgs/*
|
||||
win/coffbase.txt
|
||||
win/tcl.hpj
|
||||
win/nmakehlp.out
|
||||
win/nmhlp-out.txt
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.a binary
|
||||
*.bmp binary
|
||||
*.dll binary
|
||||
*.exe binary
|
||||
*.gif binary
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Important Note
|
||||
==========
|
||||
Please do not file issues with Tcl on Github. They are unlikely to be noticed in a timely fashion. Tcl issues are hosted in the [tcl fossil repository on core.tcl.tk](https://core.tcl.tk/tcl/tktnew); please post them there.
|
||||
@@ -0,0 +1,3 @@
|
||||
Important Note
|
||||
==========
|
||||
Please do not file pull requests with Tcl on Github. They are unlikely to be noticed in a timely fashion. Tcl issues (including patches) are hosted in the [tcl fossil repository on core.tcl.tk](https://core.tcl.tk/tcl/tktnew); please post them there.
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>tcl8.6</name>
|
||||
<name>tcl9</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
|
||||
+121
-66
@@ -1,7 +1,8 @@
|
||||
sudo: false
|
||||
language: c
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- binutils-mingw-w64-i686
|
||||
- binutils-mingw-w64-x86-64
|
||||
@@ -10,77 +11,67 @@ addons:
|
||||
- gcc-mingw-w64-i686
|
||||
- gcc-mingw-w64-x86-64
|
||||
- gcc-multilib
|
||||
homebrew:
|
||||
packages:
|
||||
- libtommath
|
||||
update: true
|
||||
matrix:
|
||||
jobs:
|
||||
include:
|
||||
# Testing on Linux with various compilers
|
||||
# Testing on Linux GCC
|
||||
- name: "Linux/GCC/Shared"
|
||||
os: linux
|
||||
dist: bionic
|
||||
dist: focal
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC/Shared: UTF_MAX=4"
|
||||
- name: "Linux/GCC/Shared: UTF_MAX=3"
|
||||
os: linux
|
||||
dist: bionic
|
||||
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: bionic
|
||||
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: bionic
|
||||
dist: focal
|
||||
compiler: gcc
|
||||
env:
|
||||
- CFGOPT="--disable-shared"
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC/Debug"
|
||||
os: linux
|
||||
dist: bionic
|
||||
dist: focal
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="--enable-symbols"
|
||||
- name: "Linux/GCC/Mem-Debug"
|
||||
os: linux
|
||||
dist: bionic
|
||||
dist: focal
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="--enable-symbols=mem"
|
||||
# Older versions of GCC...
|
||||
- name: "Linux/GCC 7/Shared"
|
||||
# C++ build.
|
||||
- name: "Linux/G++/Shared"
|
||||
os: linux
|
||||
dist: bionic
|
||||
compiler: gcc-7
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-7
|
||||
dist: focal
|
||||
compiler: g++
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC 6/Shared"
|
||||
- CFGOPT="CC=g++ CFLAGS=-Dregister=dont+use+register"
|
||||
# Newer/Older versions of GCC
|
||||
- name: "Linux/GCC 10/Shared"
|
||||
os: linux
|
||||
dist: bionic
|
||||
compiler: gcc-6
|
||||
dist: focal
|
||||
compiler: gcc-10
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-6
|
||||
- g++-10
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/GCC 5/Shared"
|
||||
@@ -89,44 +80,42 @@ matrix:
|
||||
compiler: gcc-5
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-5
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
# Clang
|
||||
# Testing on Linux Clang
|
||||
- name: "Linux/Clang/Shared"
|
||||
os: linux
|
||||
dist: bionic
|
||||
dist: focal
|
||||
compiler: clang
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/Clang/Static"
|
||||
os: linux
|
||||
dist: bionic
|
||||
dist: focal
|
||||
compiler: clang
|
||||
env:
|
||||
- CFGOPT="--disable-shared"
|
||||
- BUILD_DIR=unix
|
||||
- name: "Linux/Clang/Debug"
|
||||
os: linux
|
||||
dist: bionic
|
||||
dist: focal
|
||||
compiler: clang
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="--enable-symbols"
|
||||
- name: "Linux/Clang/Mem-Debug"
|
||||
os: linux
|
||||
dist: bionic
|
||||
dist: focal
|
||||
compiler: clang
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="--enable-symbols=mem"
|
||||
# Testing on Mac, various styles
|
||||
- name: "macOS/Xcode 11.5/Shared"
|
||||
- name: "macOS/Clang/Xcode 12/Shared"
|
||||
os: osx
|
||||
osx_image: xcode11.5
|
||||
osx_image: xcode12.2
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
@@ -134,34 +123,62 @@ matrix:
|
||||
- make all
|
||||
# The styles=develop avoids some weird problems on OSX
|
||||
- make test styles=develop
|
||||
- name: "macOS/Xcode 11.5/Shared/Unix-like"
|
||||
- name: "macOS/Clang/Xcode 12/Shared/Unix-like"
|
||||
os: osx
|
||||
osx_image: xcode11.5
|
||||
osx_image: xcode12.2
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
# Older MacOS versions
|
||||
- name: "macOS/Xcode 11/Shared"
|
||||
- CFGOPT="--enable-dtrace"
|
||||
- name: "macOS/Clang/Xcode 12/Shared/libtommath"
|
||||
os: osx
|
||||
osx_image: xcode11
|
||||
osx_image: xcode12.2
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
- name: "macOS/Xcode 10/Shared"
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- libtommath
|
||||
- name: "macOS/Clang++/Xcode 12/Shared"
|
||||
os: osx
|
||||
osx_image: xcode12.2
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
- CFGOPT="CC=clang++ --enable-framework --enable-dtrace CFLAGS=-Dregister=dont+use+register CPPFLAGS=-D__private_extern__=extern"
|
||||
script:
|
||||
- make all tcltest
|
||||
# Newer MacOS versions
|
||||
- name: "macOS/Clang/Xcode 12/Universal Apps/Shared"
|
||||
os: osx
|
||||
osx_image: xcode12u
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
# Older MacOS versions
|
||||
- name: "macOS/Clang/Xcode 11/Shared"
|
||||
os: osx
|
||||
osx_image: xcode11.7
|
||||
env:
|
||||
- BUILD_DIR=macosx
|
||||
install: []
|
||||
script: *mactest
|
||||
- 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.2
|
||||
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:
|
||||
@@ -172,7 +189,7 @@ matrix:
|
||||
# Doesn't run tests because wine is only an imperfect Windows emulation
|
||||
- name: "Linux-cross-Windows/GCC/Shared/no test"
|
||||
os: linux
|
||||
dist: bionic
|
||||
dist: focal
|
||||
compiler: x86_64-w64-mingw32-gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
@@ -186,7 +203,7 @@ matrix:
|
||||
# Doesn't run tests because wine is only an imperfect Windows emulation
|
||||
- name: "Linux-cross-Windows-32/GCC/Shared/no test"
|
||||
os: linux
|
||||
dist: bionic
|
||||
dist: focal
|
||||
compiler: i686-w64-mingw32-gcc
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
@@ -200,21 +217,23 @@ matrix:
|
||||
- BUILD_DIR=win
|
||||
- VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build"
|
||||
before_install: &vcpreinst
|
||||
- rm -rf tests/safe-stock8*.test
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
|
||||
- PATH="$PATH:$VCDIR"
|
||||
- cd ${BUILD_DIR}
|
||||
install: []
|
||||
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: UTF_MAX=4"
|
||||
- name: "Windows/MSVC/Shared: NO_DEPRECATED"
|
||||
os: windows
|
||||
compiler: cl
|
||||
env: *vcenv
|
||||
before_install: *vcpreinst
|
||||
install: []
|
||||
script:
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc test
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=nodep' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=nodep' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC/Static"
|
||||
os: windows
|
||||
compiler: cl
|
||||
@@ -252,15 +271,15 @@ matrix:
|
||||
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: UTF_MAX=4"
|
||||
- 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 'OPTS=utfmax' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=utfmax' '-f' makefile.vc test
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=nodep' '-f' makefile.vc all tcltest
|
||||
- cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=nodep' '-f' makefile.vc test
|
||||
- name: "Windows/MSVC-x86/Static"
|
||||
os: windows
|
||||
compiler: cl
|
||||
@@ -296,15 +315,33 @@ matrix:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="--enable-64bit"
|
||||
before_install: &makepreinst
|
||||
- choco install -y make
|
||||
- rm -rf tests/safe-stock8*.test
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
|
||||
- choco install -y make zip
|
||||
- cd ${BUILD_DIR}
|
||||
- name: "Windows/GCC/Shared: UTF_MAX=4"
|
||||
- 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/G++/Shared"
|
||||
os: windows
|
||||
compiler: g++
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="CC=g++ --enable-64bit"
|
||||
before_install: *makepreinst
|
||||
script:
|
||||
- make all tcltest
|
||||
- name: "Windows/GCC/Static"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
@@ -333,13 +370,29 @@ matrix:
|
||||
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/G++-x86/Shared"
|
||||
os: windows
|
||||
compiler: g++
|
||||
env:
|
||||
- BUILD_DIR=win
|
||||
- CFGOPT="CC=g++"
|
||||
before_install: *makepreinst
|
||||
script:
|
||||
- make all tcltest
|
||||
- name: "Windows/GCC-x86/Static"
|
||||
os: windows
|
||||
compiler: gcc
|
||||
@@ -364,13 +417,15 @@ matrix:
|
||||
# "make dist" only
|
||||
- name: "Linux: make dist"
|
||||
os: linux
|
||||
dist: bionic
|
||||
dist: focal
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_DIR=unix
|
||||
script:
|
||||
- make dist
|
||||
before_install:
|
||||
- rm -rf tests/safe-stock8*.test
|
||||
- touch generic/tclStubInit.c generic/tclOOStubInit.c generic/tclOOScript.h
|
||||
- cd ${BUILD_DIR}
|
||||
install:
|
||||
- mkdir "$HOME/install dir"
|
||||
@@ -378,6 +433,6 @@ install:
|
||||
before_script:
|
||||
- export ERROR_ON_FAILURES=1
|
||||
script:
|
||||
- make all tcltest
|
||||
- make all tcltest || echo "Something wrong, maybe a hickup, let's try again"
|
||||
- make test
|
||||
- make install
|
||||
|
||||
+2
-2
@@ -351,7 +351,7 @@
|
||||
|
||||
* mac/tclMacFile.c: fixed bug in permission checking code
|
||||
|
||||
* mac/tclMacLoad.c: corrected utf8 handling, comparison of package
|
||||
* mac/tclMacLoad.c: corrected utf-8 handling, comparison of package
|
||||
names to code fragment names changed to only match on the length of
|
||||
package name, this allows for fragment names with version numbers
|
||||
appended.
|
||||
@@ -3525,7 +3525,7 @@
|
||||
* generic/tclVar.c (Tcl_UnsetObjCmd): Rewrote argument parser to avoid
|
||||
a read off the end of the argument array that could occur when
|
||||
executing something like [unset -nocomplain] was executed. Improved
|
||||
the error message given when too few arguments are given (-nocomplain
|
||||
the error message given when not enough arguments are given (-nocomplain
|
||||
should obviously be *before* --, not after it) and also modified the
|
||||
test suite to take account of that and the documentation to use the
|
||||
same improvement. [Bug 405769]
|
||||
|
||||
+1
-1
@@ -1753,7 +1753,7 @@
|
||||
|
||||
2002-07-05 Reinhard Max <max@suse.de>
|
||||
|
||||
* generic/tclClock.c (FormatClock): Convert the format string to UTF8
|
||||
* generic/tclClock.c (FormatClock): Convert the format string to utf-8
|
||||
before calling TclpStrftime, so that non-ASCII characters don't get
|
||||
mangled when the result string is being converted back.
|
||||
* tests/clock.test: Added a test for that.
|
||||
|
||||
+2
-2
@@ -2302,7 +2302,7 @@
|
||||
934511].
|
||||
|
||||
* doc/CrtCommand.3: Added note that the arguments given to the command
|
||||
proc of a Tcl_CreateCommand are in utf8 since Tcl 8.1. Closing [Patch
|
||||
proc of a Tcl_CreateCommand are in utf-8 since Tcl 8.1. Closing [Patch
|
||||
414778].
|
||||
|
||||
* doc/ChnlStack.3: Removed the declaration that the interp argument to
|
||||
@@ -2873,7 +2873,7 @@
|
||||
2004-06-02 Jeff Hobbs <jeffh@ActiveState.com>
|
||||
|
||||
* win/tclWinFile.c (TclpFindExecutable): when using GetModuleFileNameA
|
||||
(Win9x), convert from CP_ACP to WCHAR then convert back to utf8.
|
||||
(Win9x), convert from CP_ACP to WCHAR then convert back to utf-8.
|
||||
Adjunct to 2004-04-07 fix.
|
||||
|
||||
2004-06-02 David Gravereaux <davygrvy@pobox.com>
|
||||
|
||||
+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,11 +1,11 @@
|
||||
# README: Tcl
|
||||
|
||||
This is the **Tcl 8.6.10** source distribution.
|
||||
This is the **Tcl 9.0a2** source distribution.
|
||||
|
||||
You can get any source release of Tcl from [our distribution
|
||||
site](https://sourceforge.net/projects/tcl/files/Tcl/).
|
||||
|
||||
[](https://travis-ci.org/tcltk/tcl)
|
||||
[](https://travis-ci.org/tcltk/tcl)
|
||||
|
||||
## Contents
|
||||
1. [Introduction](#intro)
|
||||
@@ -43,7 +43,7 @@ and selling it either in whole or in part. See the file
|
||||
## <a id="doc">2.</a> Documentation
|
||||
Extensive documentation is available at our website.
|
||||
The home page for this release, including new features, is
|
||||
[here](https://www.tcl.tk/software/tcltk/8.6.html).
|
||||
[here](https://www.tcl.tk/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.
|
||||
@@ -53,8 +53,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 --- http://core.tcl.tk/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)
|
||||
@@ -8941,7 +8990,153 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
|
||||
|
||||
2019-11-15 (bug)[135804] segfault in [next] after destroy (coulter,sebres)
|
||||
|
||||
2019-11-18 (bug)[13657a] application/json us text, not binary (noe,nijtmans)
|
||||
=> http 2.9.1
|
||||
|
||||
- Released 8.6.10, Nov 21, 2019 - details at http://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-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 --- http://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 --- http://core.tcl-lang.org/tcl/ for details -
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
+7
-6
@@ -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";
|
||||
register char *a, *b;
|
||||
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
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
* This file isn't complete in the ANSI-C sense; it only declares things
|
||||
* that are needed by Tcl. This file is needed even on many systems with
|
||||
* their own stdlib.h (e.g. SunOS) because not all stdlib.h files declare
|
||||
* all the procedures needed here (such as strtod).
|
||||
* all the procedures needed here (such as strtol/strtoul).
|
||||
*
|
||||
* Copyright (c) 1991 The Regents of the University of California.
|
||||
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
||||
|
||||
+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 **argv);
|
||||
extern int execve(const char *path, char **argv, char **envp);
|
||||
extern int execvpw(const char *file, char **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 seteuidw(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;
|
||||
|
||||
+4
-9
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorCodeVA, Tcl_SetErrorLine, Tcl_GetErrorLine, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
|
||||
Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorLine, Tcl_GetErrorLine, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -30,8 +30,6 @@ int
|
||||
.sp
|
||||
\fBTcl_SetErrorCode\fR(\fIinterp, element, element, ... \fB(char *) NULL\fR)
|
||||
.sp
|
||||
\fBTcl_SetErrorCodeVA\fR(\fIinterp, argList\fR)
|
||||
.sp
|
||||
\fBTcl_GetErrorLine\fR(\fIinterp\fR)
|
||||
.sp
|
||||
\fBTcl_SetErrorLine\fR(\fIinterp, lineNum\fR)
|
||||
@@ -60,10 +58,10 @@ unless \fIlength\fR is negative.
|
||||
.AP Tcl_Obj *objPtr in
|
||||
A message to be appended to the \fB\-errorinfo\fR return option
|
||||
in the form of a Tcl_Obj value.
|
||||
.AP int length in
|
||||
.AP size_t length in
|
||||
The number of bytes to copy from \fImessage\fR when
|
||||
appending to the \fB\-errorinfo\fR return option.
|
||||
If negative, all bytes up to the first null byte are used.
|
||||
If 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 char *element in
|
||||
@@ -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);
|
||||
@@ -245,9 +243,6 @@ The procedure \fBTcl_SetErrorCode\fR is also used to set the
|
||||
record instead of a value. Otherwise, it is similar to
|
||||
\fBTcl_SetObjErrorCode\fR in behavior.
|
||||
.PP
|
||||
\fBTcl_SetErrorCodeVA\fR is the same as \fBTcl_SetErrorCode\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument list.
|
||||
.PP
|
||||
The procedure \fBTcl_GetErrorLine\fR is used to read the integer value
|
||||
of the \fB\-errorline\fR return option without the overhead of a full
|
||||
call to \fBTcl_GetReturnOptions\fR. Likewise, \fBTcl_SetErrorLine\fR
|
||||
|
||||
+8
-27
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc, ckalloc, ckfree, ckrealloc, attemptckalloc, attemptckrealloc \- allocate or free heap memory
|
||||
Tcl_Alloc, Tcl_Free, Tcl_Realloc, Tcl_AttemptAlloc, Tcl_AttemptRealloc \- allocate or free heap memory
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -19,29 +19,14 @@ char *
|
||||
void
|
||||
\fBTcl_Free\fR(\fIptr\fR)
|
||||
.sp
|
||||
char *
|
||||
void *
|
||||
\fBTcl_Realloc\fR(\fIptr, size\fR)
|
||||
.sp
|
||||
char *
|
||||
void *
|
||||
\fBTcl_AttemptAlloc\fR(\fIsize\fR)
|
||||
.sp
|
||||
char *
|
||||
void *
|
||||
\fBTcl_AttemptRealloc\fR(\fIptr, size\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBckalloc\fR(\fIsize\fR)
|
||||
.sp
|
||||
void
|
||||
\fBckfree\fR(\fIptr\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBckrealloc\fR(\fIptr, size\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBattemptckalloc\fR(\fIsize\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBattemptckrealloc\fR(\fIptr, size\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS char *size
|
||||
.AP "unsigned int" size in
|
||||
@@ -79,14 +64,10 @@ allocation fails, these functions will return NULL. Note that on some
|
||||
platforms, but not all, attempting to allocate a zero-sized block of
|
||||
memory will also cause these functions to return NULL.
|
||||
.PP
|
||||
The procedures \fBckalloc\fR, \fBckfree\fR, \fBckrealloc\fR,
|
||||
\fBattemptckalloc\fR, and \fBattemptckrealloc\fR are implemented
|
||||
as macros. Normally, they are synonyms for the corresponding
|
||||
procedures documented on this page. When Tcl and all modules
|
||||
calling Tcl are compiled with \fBTCL_MEM_DEBUG\fR defined, however,
|
||||
these macros are redefined to be special debugging versions
|
||||
of these procedures. To support Tcl's memory debugging within a
|
||||
module, use the macros rather than direct calls to \fBTcl_Alloc\fR, etc.
|
||||
When a module or Tcl itself is compiled with \fBTCL_MEM_DEBUG\fR defined,
|
||||
the procedures \fBTcl_Alloc\fR, \fBTcl_Free\fR, \fBTcl_Realloc\fR,
|
||||
\fBTcl_AttemptAlloc\fR, and \fBTcl_AttempRealloc\fR are implemented
|
||||
as macros, redefined to be special debugging versions of these procedures.
|
||||
|
||||
.SH KEYWORDS
|
||||
alloc, allocation, free, malloc, memory, realloc, TCL_MEM_DEBUG
|
||||
|
||||
+1
-2
@@ -30,8 +30,7 @@ or \fBTCL_RETURN\fR, then Tcl normally converts this into a \fBTCL_ERROR\fR
|
||||
return with an appropriate message. The particular script
|
||||
evaluation procedures of Tcl that act in the manner are
|
||||
\fBTcl_EvalObjEx\fR, \fBTcl_EvalObjv\fR, \fBTcl_Eval\fR, \fBTcl_EvalEx\fR,
|
||||
\fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR, \fBTcl_VarEval\fR and
|
||||
\fBTcl_VarEvalVA\fR.
|
||||
\fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR and \fBTcl_VarEval\fR.
|
||||
.PP
|
||||
However, if \fBTcl_AllowExceptions\fR is invoked immediately before
|
||||
calling one of those a procedures, then arbitrary completion
|
||||
|
||||
+3
-3
@@ -13,7 +13,7 @@ Tcl_GetAssocData, Tcl_SetAssocData, Tcl_DeleteAssocData \- manage associations o
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_GetAssocData\fR(\fIinterp, key, delProcPtr\fR)
|
||||
.sp
|
||||
\fBTcl_SetAssocData\fR(\fIinterp, key, delProc, clientData\fR)
|
||||
@@ -31,7 +31,7 @@ Procedure to call when \fIinterp\fR is deleted.
|
||||
.AP Tcl_InterpDeleteProc **delProcPtr in
|
||||
Pointer to location in which to store address of current deletion procedure
|
||||
for association. Ignored if NULL.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value associated with the given key in this
|
||||
interpreter. This data is owned by the caller.
|
||||
.BE
|
||||
@@ -64,7 +64,7 @@ the type \fBTcl_InterpDeleteProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_InterpDeleteProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
.CE
|
||||
.PP
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ int
|
||||
.AS Tcl_AsyncHandler clientData
|
||||
.AP Tcl_AsyncProc *proc in
|
||||
Procedure to invoke to handle an asynchronous event.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
One-word value to pass to \fIproc\fR.
|
||||
.AP Tcl_AsyncHandler async in
|
||||
Token for asynchronous event handler.
|
||||
@@ -84,7 +84,7 @@ type \fBTcl_AsyncProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_AsyncProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIcode\fR);
|
||||
.CE
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1989-1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_Backslash 3 "8.1" Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_Backslash \- parse a backslash sequence
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
char
|
||||
\fBTcl_Backslash\fR(\fIsrc, countPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS char *countPtr out
|
||||
.AP char *src in
|
||||
Pointer to a string starting with a backslash.
|
||||
.AP int *countPtr out
|
||||
If \fIcountPtr\fR is not NULL, \fI*countPtr\fR gets filled
|
||||
in with number of characters in the backslash sequence, including
|
||||
the backslash character.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The use of \fBTcl_Backslash\fR is deprecated in favor of
|
||||
\fBTcl_UtfBackslash\fR.
|
||||
.PP
|
||||
This is a utility procedure provided for backwards compatibility with
|
||||
non-internationalized Tcl extensions. It parses a backslash sequence and
|
||||
returns the low byte of the Unicode character corresponding to the sequence.
|
||||
\fBTcl_Backslash\fR modifies \fI*countPtr\fR to contain the number of
|
||||
characters in the backslash sequence.
|
||||
.PP
|
||||
See the Tcl manual entry for information on the valid backslash sequences.
|
||||
All of the sequences described in the Tcl manual entry are supported by
|
||||
\fBTcl_Backslash\fR.
|
||||
.SH "SEE ALSO"
|
||||
Tcl(n), Tcl_UtfBackslash(3)
|
||||
|
||||
.SH KEYWORDS
|
||||
backslash, parse
|
||||
+2
-2
@@ -29,8 +29,8 @@ unsigned char *
|
||||
.AP "const unsigned char" *bytes in
|
||||
The array of bytes used to initialize or set a byte-array value. May be NULL
|
||||
even if \fIlength\fR is non-zero.
|
||||
.AP int length in
|
||||
The length of the array of bytes. It must be >= 0.
|
||||
.AP size_t length in
|
||||
The length of the array of bytes.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
For \fBTcl_SetByteArrayObj\fR, this points to the value to be converted to
|
||||
byte-array type. For \fBTcl_GetByteArrayFromObj\fR and
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ Tcl_CallWhenDeleted, Tcl_DontCallWhenDeleted \- Arrange for callback when interp
|
||||
Interpreter with which to associated callback.
|
||||
.AP Tcl_InterpDeleteProc *proc in
|
||||
Procedure to call when \fIinterp\fR is deleted.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -38,7 +38,7 @@ type \fBTcl_InterpDeleteProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_InterpDeleteProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR);
|
||||
.CE
|
||||
.PP
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ ORed combination of flag bits that specify additional options.
|
||||
For \fBTcl_CancelEval\fR, only \fBTCL_CANCEL_UNWIND\fR is currently
|
||||
supported. For \fBTcl_Canceled\fR, only \fBTCL_LEAVE_ERR_MSG\fR and
|
||||
\fBTCL_CANCEL_UNWIND\fR are currently supported.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Currently reserved for future use.
|
||||
It should be set to NULL.
|
||||
.BE
|
||||
|
||||
+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
|
||||
|
||||
+7
-7
@@ -41,12 +41,12 @@ Tcl_Object
|
||||
int
|
||||
\fBTcl_ObjectDeleted\fR(\fIobject\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_ObjectGetMetadata\fR(\fIobject, metaTypePtr\fR)
|
||||
.sp
|
||||
\fBTcl_ObjectSetMetadata\fR(\fIobject, metaTypePtr, metadata\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_ClassGetMetadata\fR(\fIclass, metaTypePtr\fR)
|
||||
.sp
|
||||
\fBTcl_ClassSetMetadata\fR(\fIclass, metaTypePtr, metadata\fR)
|
||||
@@ -56,7 +56,7 @@ Tcl_ObjectMapMethodNameProc
|
||||
.sp
|
||||
\fBTcl_ObjectSetMethodNameMapper\fR(\fIobject\fR, \fImethodNameMapper\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS ClientData metadata in/out
|
||||
.AS void *metadata in/out
|
||||
.AP Tcl_Interp *interp in/out
|
||||
Interpreter providing the context for looking up or creating an object, and
|
||||
into whose result error messages will be written on failure.
|
||||
@@ -85,7 +85,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
|
||||
@@ -185,7 +185,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 +198,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
|
||||
|
||||
+36
-36
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateSlave, Tcl_GetSlave, Tcl_GetMaster, Tcl_GetInterpPath, Tcl_CreateAlias, Tcl_CreateAliasObj, Tcl_GetAlias, Tcl_GetAliasObj, Tcl_ExposeCommand, Tcl_HideCommand \- manage multiple Tcl interpreters, aliases and hidden commands
|
||||
Tcl_IsSafe, Tcl_MakeSafe, Tcl_CreateChild, Tcl_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
|
||||
@@ -20,31 +20,31 @@ int
|
||||
\fBTcl_MakeSafe\fR(\fIinterp\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_CreateSlave\fR(\fIinterp, name, isSafe\fR)
|
||||
\fBTcl_CreateChild\fR(\fIinterp, name, isSafe\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetSlave\fR(\fIinterp, name\fR)
|
||||
\fBTcl_GetChild\fR(\fIinterp, name\fR)
|
||||
.sp
|
||||
Tcl_Interp *
|
||||
\fBTcl_GetMaster\fR(\fIinterp\fR)
|
||||
\fBTcl_GetParent\fR(\fIinterp\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetInterpPath\fR(\finterp, slaveInterp\fR)
|
||||
\fBTcl_GetInterpPath\fR(\fIinterp, childInterp\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_CreateAlias\fR(\fIslaveInterp, slaveCmd, targetInterp, targetCmd,
|
||||
\fBTcl_CreateAlias\fR(\fIchildInterp, childCmd, targetInterp, targetCmd,
|
||||
argc, argv\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_CreateAliasObj\fR(\fIslaveInterp, slaveCmd, targetInterp, targetCmd,
|
||||
\fBTcl_CreateAliasObj\fR(\fIchildInterp, childCmd, targetInterp, targetCmd,
|
||||
objc, objv\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetAlias\fR(\fIinterp, slaveCmd, targetInterpPtr, targetCmdPtr,
|
||||
\fBTcl_GetAlias\fR(\fIinterp, childCmd, targetInterpPtr, targetCmdPtr,
|
||||
argcPtr, argvPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetAliasObj\fR(\fIinterp, slaveCmd, targetInterpPtr, targetCmdPtr,
|
||||
\fBTcl_GetAliasObj\fR(\fIinterp, childCmd, targetInterpPtr, targetCmdPtr,
|
||||
objcPtr, objvPtr\fR)
|
||||
.sp
|
||||
int
|
||||
@@ -57,16 +57,16 @@ int
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which to execute the specified command.
|
||||
.AP "const char" *name in
|
||||
Name of slave interpreter to create or manipulate.
|
||||
Name of child interpreter to create or manipulate.
|
||||
.AP int isSafe in
|
||||
If non-zero, a
|
||||
.QW safe
|
||||
slave that is suitable for running untrusted code
|
||||
is created, otherwise a trusted slave is created.
|
||||
.AP Tcl_Interp *slaveInterp in
|
||||
child that is suitable for running untrusted code
|
||||
is created, otherwise a trusted child is created.
|
||||
.AP Tcl_Interp *childInterp in
|
||||
Interpreter to use for creating the source command for an alias (see
|
||||
below).
|
||||
.AP "const char" *slaveCmd in
|
||||
.AP "const char" *childCmd in
|
||||
Name of source command for alias.
|
||||
.AP Tcl_Interp *targetInterp in
|
||||
Interpreter that contains the target command for an alias.
|
||||
@@ -121,17 +121,17 @@ interpreter. The return value for those procedures that return an \fBint\fR
|
||||
is either \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fBTCL_ERROR\fR is returned
|
||||
then the interpreter's result contains an error message.
|
||||
.PP
|
||||
\fBTcl_CreateSlave\fR creates a new interpreter as a slave of \fIinterp\fR.
|
||||
It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which
|
||||
allows \fIinterp\fR to manipulate the new slave.
|
||||
If \fIisSafe\fR is zero, the command creates a trusted slave in which Tcl
|
||||
\fBTcl_CreateChild\fR creates a new interpreter as a child of \fIinterp\fR.
|
||||
It also creates a child command named \fIname\fR in \fIinterp\fR which
|
||||
allows \fIinterp\fR to manipulate the new child.
|
||||
If \fIisSafe\fR is zero, the command creates a trusted child in which Tcl
|
||||
code has access to all the Tcl commands.
|
||||
If it is \fB1\fR, the command creates a
|
||||
.QW safe
|
||||
slave in which Tcl code has access only to set of Tcl commands defined as
|
||||
child in which Tcl code has access only to set of Tcl commands defined as
|
||||
.QW "Safe Tcl" ;
|
||||
see the manual entry for the Tcl \fBinterp\fR command for details.
|
||||
If the creation of the new slave interpreter failed, \fBNULL\fR is returned.
|
||||
If the creation of the new child interpreter failed, \fBNULL\fR is returned.
|
||||
.PP
|
||||
\fBTcl_IsSafe\fR returns \fB1\fR if \fIinterp\fR is
|
||||
.QW safe
|
||||
@@ -147,34 +147,34 @@ from \fIinterp\fR. However, it cannot know what parts of an extension
|
||||
or application are safe and does not make any attempt to remove those
|
||||
parts, so safety is not guaranteed after calling \fBTcl_MakeSafe\fR.
|
||||
Callers will want to take care with their use of \fBTcl_MakeSafe\fR
|
||||
to avoid false claims of safety. For many situations, \fBTcl_CreateSlave\fR
|
||||
to avoid false claims of safety. For many situations, \fBTcl_CreateChild\fR
|
||||
may be a better choice, since it creates interpreters in a known-safe state.
|
||||
.PP
|
||||
\fBTcl_GetSlave\fR returns a pointer to a slave interpreter of
|
||||
\fIinterp\fR. The slave interpreter is identified by \fIslaveName\fR.
|
||||
If no such slave interpreter exists, \fBNULL\fR is returned.
|
||||
\fBTcl_GetChild\fR returns a pointer to a child interpreter of
|
||||
\fIinterp\fR. The child interpreter is identified by \fIname\fR.
|
||||
If no such child interpreter exists, \fBNULL\fR is returned.
|
||||
.PP
|
||||
\fBTcl_GetMaster\fR returns a pointer to the master interpreter of
|
||||
\fIinterp\fR. If \fIinterp\fR has no master (it is a
|
||||
\fBTcl_GetParent\fR returns a pointer to the parent interpreter of
|
||||
\fIinterp\fR. If \fIinterp\fR has no parent (it is a
|
||||
top-level interpreter) then \fBNULL\fR is returned.
|
||||
.PP
|
||||
\fBTcl_GetInterpPath\fR stores in the result of \fIaskingInterp\fR
|
||||
the relative path between \fIaskingInterp\fR and \fIslaveInterp\fR;
|
||||
\fIslaveInterp\fR must be a slave of \fIaskingInterp\fR. If the computation
|
||||
\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
|
||||
of the relative path succeeds, \fBTCL_OK\fR is returned, else
|
||||
\fBTCL_ERROR\fR is returned and an error message is stored as the
|
||||
result of \fIaskingInterp\fR.
|
||||
result of \fIinterp\fR.
|
||||
.PP
|
||||
\fBTcl_CreateAlias\fR creates a command named \fIslaveCmd\fR in
|
||||
\fIslaveInterp\fR that when invoked, will cause the command \fItargetCmd\fR
|
||||
\fBTcl_CreateAlias\fR creates a command named \fIchildCmd\fR in
|
||||
\fIchildInterp\fR that when invoked, will cause the command \fItargetCmd\fR
|
||||
to be invoked in \fItargetInterp\fR. The arguments specified by the strings
|
||||
contained in \fIargv\fR are always prepended to any arguments supplied in the
|
||||
invocation of \fIslaveCmd\fR and passed to \fItargetCmd\fR.
|
||||
invocation of \fIchildCmd\fR and passed to \fItargetCmd\fR.
|
||||
This operation returns \fBTCL_OK\fR if it succeeds, or \fBTCL_ERROR\fR if
|
||||
it fails; in that case, an error message is left in the value result
|
||||
of \fIslaveInterp\fR.
|
||||
of \fIchildInterp\fR.
|
||||
Note that there are no restrictions on the ancestry relationship (as
|
||||
created by \fBTcl_CreateSlave\fR) between \fIslaveInterp\fR and
|
||||
created by \fBTcl_CreateChild\fR) between \fIchildInterp\fR and
|
||||
\fItargetInterp\fR. Any two interpreters can be used, without any
|
||||
restrictions on how they are related.
|
||||
.PP
|
||||
@@ -233,4 +233,4 @@ interp
|
||||
|
||||
.SH KEYWORDS
|
||||
alias, command, exposed commands, hidden commands, interpreter, invoke,
|
||||
master, slave
|
||||
parent, child
|
||||
|
||||
+52
-166
@@ -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 *
|
||||
@@ -75,9 +75,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 +84,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 +122,7 @@ by any other channel. Can be NULL, in which case the channel is
|
||||
created without a name. If the created channel is assigned to one
|
||||
of the standard channels (\fBstdin\fR, \fBstdout\fR or \fBstderr\fR),
|
||||
the assigned channel name will be the name of the standard channel.
|
||||
.AP ClientData instanceData in
|
||||
.AP void *instanceData in
|
||||
Arbitrary one-word value to be associated with this channel. This
|
||||
value is passed to procedures in \fItypePtr\fR when they are invoked.
|
||||
.AP int mask in
|
||||
@@ -139,7 +133,7 @@ The channel to operate on.
|
||||
.AP int direction in
|
||||
\fBTCL_READABLE\fR means the input handle is wanted; \fBTCL_WRITABLE\fR
|
||||
means the output handle is wanted.
|
||||
.AP ClientData *handlePtr out
|
||||
.AP void **handlePtr out
|
||||
Points to the location where the desired OS-specific handle should be
|
||||
stored.
|
||||
.AP int size in
|
||||
@@ -286,16 +280,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
|
||||
@@ -315,10 +306,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;
|
||||
@@ -347,9 +338,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,
|
||||
@@ -372,25 +362,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
|
||||
@@ -399,7 +373,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
|
||||
@@ -426,22 +400,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
|
||||
@@ -450,35 +425,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
|
||||
@@ -487,7 +447,7 @@ internal buffer. \fIInputProc\fR must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverInputProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
char *\fIbuf\fR,
|
||||
int \fIbufSize\fR,
|
||||
int *\fIerrorCodePtr\fR);
|
||||
@@ -531,7 +491,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);
|
||||
@@ -561,17 +521,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 Tcl_WideInt \fBTcl_DriverWideSeekProc\fR(
|
||||
void *\fIinstanceData\fR,
|
||||
Tcl_WideInt \fIoffset\fR,
|
||||
int \fIseekMode\fR,
|
||||
int *\fIerrorCodePtr\fR);
|
||||
.CE
|
||||
@@ -590,30 +550,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
|
||||
@@ -622,7 +560,7 @@ the generic layer to set a channel type specific option on a channel.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverSetOptionProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
const char *\fIoptionName\fR,
|
||||
const char *\fInewValue\fR);
|
||||
@@ -663,7 +601,7 @@ channel. \fIgetOptionProc\fR must match the following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverGetOptionProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
const char *\fIoptionName\fR,
|
||||
Tcl_DString *\fIoptionValue\fR);
|
||||
@@ -701,7 +639,7 @@ notice events of interest on this channel.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_DriverWatchProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
int \fImask\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -732,9 +670,9 @@ the generic layer to retrieve a device-specific handle from the channel.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverGetHandleProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
int \fIdirection\fR,
|
||||
ClientData *\fIhandlePtr\fR);
|
||||
void **\fIhandlePtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fIInstanceData\fR is the same as the value passed to
|
||||
@@ -761,7 +699,7 @@ It should be set to NULL.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverFlushProc\fR(
|
||||
ClientData \fIinstanceData\fR);
|
||||
void *\fIinstanceData\fR);
|
||||
.CE
|
||||
.PP
|
||||
This value can be retrieved with \fBTcl_ChannelFlushProc\fR, which returns
|
||||
@@ -776,7 +714,7 @@ that occur on the underlying (stacked) channel.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverHandlerProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
int \fIinterestMask\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -805,7 +743,7 @@ might be maintaining using the calling thread as the associate. See
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_DriverThreadActionProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
int \fIaction\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -822,7 +760,7 @@ length. It can be NULL.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_DriverTruncateProc\fR(
|
||||
ClientData \fIinstanceData\fR,
|
||||
void *\fIinstanceData\fR,
|
||||
Tcl_WideInt \fIlength\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -870,58 +808,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
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ a zero value to temporarily disable an existing handler.
|
||||
.AP Tcl_FileProc *proc in
|
||||
Procedure to invoke whenever the channel indicated by \fIchannel\fR meets
|
||||
the conditions specified by \fImask\fR.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -48,7 +48,7 @@ what it means for a channel to be readable or writable.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_ChannelProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
int \fImask\fR);
|
||||
.CE
|
||||
.PP
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ void
|
||||
The channel for which to create or delete a close callback.
|
||||
.AP Tcl_CloseProc *proc in
|
||||
The procedure to call as the callback.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -38,7 +38,7 @@ Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CloseProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR is the same as the value provided in the call to
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@ Name of command.
|
||||
.AP Tcl_CmdProc *proc in
|
||||
Implementation of new command: \fIproc\fR will be called whenever
|
||||
\fIcmdName\fR is invoked as a command.
|
||||
.AP ClientData clientData in
|
||||
.AP voie *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR and \fIdeleteProc\fR.
|
||||
.AP Tcl_CmdDeleteProc *deleteProc in
|
||||
Procedure to call before \fIcmdName\fR is deleted from the interpreter;
|
||||
@@ -75,7 +75,7 @@ and it returns NULL.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_CmdProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIargc\fR,
|
||||
const char *\fIargv\fR[]);
|
||||
@@ -131,7 +131,7 @@ result that match the type \fBTcl_CmdDeleteProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CmdDeleteProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR argument will be the same as the \fIclientData\fR
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ a handler.
|
||||
.AP Tcl_FileProc *proc in
|
||||
Procedure to invoke whenever the file or device indicated
|
||||
by \fIfile\fR meets the conditions specified by \fImask\fR.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -51,7 +51,7 @@ type \fBTcl_FileProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_FileProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
int \fImask\fR);
|
||||
.CE
|
||||
.PP
|
||||
|
||||
@@ -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
|
||||
+38
-11
@@ -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_DeleteCommand, Tcl_DeleteCommandFromToken, Tcl_GetCommandInfo, Tcl_GetCommandInfoFromToken, Tcl_SetCommandInfo, Tcl_SetCommandInfoFromToken, Tcl_GetCommandName, Tcl_GetCommandFullName, Tcl_GetCommandFromObj, Tcl_RegisterCommandTypeName, Tcl_GetCommandTypeName \- implement new commands in C
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -42,6 +42,14 @@ void
|
||||
.sp
|
||||
Tcl_Command
|
||||
\fBTcl_GetCommandFromObj\fR(\fIinterp, objPtr\fR)
|
||||
.sp
|
||||
.VS "info cmdtype feature"
|
||||
void
|
||||
\fBTcl_RegisterCommandTypeName\fR(\fIproc, typeName\fR)
|
||||
.sp
|
||||
const char *
|
||||
\fBTcl_GetCommandTypeName\fR(\fItoken\fR)
|
||||
.VE "info cmdtype feature"
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_CmdDeleteProc *deleteProc in/out
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -51,7 +59,7 @@ Name of command.
|
||||
.AP Tcl_ObjCmdProc *proc in
|
||||
Implementation of the new command: \fIproc\fR will be called whenever
|
||||
\fIcmdName\fR is invoked as a command.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR and \fIdeleteProc\fR.
|
||||
.AP Tcl_CmdDeleteProc *deleteProc in
|
||||
Procedure to call before \fIcmdName\fR is deleted from the interpreter;
|
||||
@@ -65,6 +73,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 +102,7 @@ and it returns NULL.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_ObjCmdProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const \fIobjv\fR[]);
|
||||
@@ -164,7 +175,7 @@ result that match the type \fBTcl_CmdDeleteProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CmdDeleteProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR argument will be the same as the \fIclientData\fR
|
||||
@@ -206,11 +217,11 @@ A \fBTcl_CmdInfo\fR structure has the following fields:
|
||||
typedef struct Tcl_CmdInfo {
|
||||
int \fIisNativeObjectProc\fR;
|
||||
Tcl_ObjCmdProc *\fIobjProc\fR;
|
||||
ClientData \fIobjClientData\fR;
|
||||
void *\fIobjClientData\fR;
|
||||
Tcl_CmdProc *\fIproc\fR;
|
||||
ClientData \fIclientData\fR;
|
||||
void *\fIclientData\fR;
|
||||
Tcl_CmdDeleteProc *\fIdeleteProc\fR;
|
||||
ClientData \fIdeleteData\fR;
|
||||
void *\fIdeleteData\fR;
|
||||
Tcl_Namespace *\fInamespacePtr\fR;
|
||||
} \fBTcl_CmdInfo\fR;
|
||||
.CE
|
||||
@@ -236,7 +247,7 @@ otherwise, this is a compatibility procedure
|
||||
registered by \fBTcl_CreateObjCommand\fR
|
||||
that simply calls the command's
|
||||
value-based procedure after converting its string arguments to Tcl values.
|
||||
The field \fIdeleteData\fR is the ClientData value
|
||||
The field \fIdeleteData\fR is the clientData value
|
||||
to pass to \fIdeleteProc\fR; it is normally the same as
|
||||
\fIclientData\fR but may be set independently using the
|
||||
\fBTcl_SetCommandInfo\fR procedure.
|
||||
@@ -250,7 +261,7 @@ from \fBTcl_CreateObjCommand\fR in place of the command name. If the
|
||||
and fills in the structure designated by \fIinfoPtr\fR.
|
||||
.PP
|
||||
\fBTcl_SetCommandInfo\fR is used to modify the procedures and
|
||||
ClientData values associated with a command.
|
||||
clientData values associated with a command.
|
||||
Its \fIcmdName\fR argument is the name of a command in \fIinterp\fR.
|
||||
\fIcmdName\fR may include \fB::\fR namespace qualifiers
|
||||
to identify a command in a particular namespace.
|
||||
@@ -266,9 +277,9 @@ copies the information from \fI*infoPtr\fR to Tcl's internal structure
|
||||
for the command and returns 1.
|
||||
.PP
|
||||
Note that \fBTcl_SetCommandInfo\fR and
|
||||
\fBTcl_SetCommandInfoFromToken\fR both allow the ClientData for a
|
||||
\fBTcl_SetCommandInfoFromToken\fR both allow the clientData for a
|
||||
command's deletion procedure to be given a different value than the
|
||||
ClientData for its command procedure.
|
||||
clientData for its command procedure.
|
||||
.PP
|
||||
Note that neither \fBTcl_SetCommandInfo\fR nor
|
||||
\fBTcl_SetCommandInfoFromToken\fR will change a command's namespace.
|
||||
@@ -296,6 +307,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
|
||||
.VS "info cmdtype feature"
|
||||
\fBTcl_RegisterCommandTypeName\fR is used to associate a name (the
|
||||
\fItypeName\fR argument) with a particular implementation function so that it
|
||||
can then be looked up with \fBTcl_GetCommandTypeName\fR, which in turn is
|
||||
called with a command token that information is wanted for and which returns
|
||||
the name of the type that was registered for the implementation function used
|
||||
for that command. (The lookup functionality is surfaced virtually directly in Tcl via
|
||||
\fBinfo cmdtype\fR.) If there is no function registered for a particular
|
||||
function, the result will be the string literal
|
||||
.QW \fBnative\fR .
|
||||
The registration of a name can be undone by registering a mapping to NULL
|
||||
instead. The result from \fBTcl_GetCommandTypeName\fR will be exactly that
|
||||
string which was registered, and not a copy; use of a compile-time constant
|
||||
string is \fIstrongly recommended\fR.
|
||||
.VE "info cmdtype feature"
|
||||
.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
|
||||
|
||||
+6
-6
@@ -41,7 +41,7 @@ details of the calling sequence.
|
||||
.AP Tcl_CmdTraceProc *proc in
|
||||
Procedure to call for each command that is executed. See below for
|
||||
details on the calling sequence.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIobjProc\fR or \fIproc\fR.
|
||||
.AP Tcl_CmdObjTraceDeleteProc *deleteProc in
|
||||
Procedure to call when the trace is deleted. See below for details of
|
||||
@@ -66,7 +66,7 @@ interpreter.
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_CmdObjTraceProc\fR(
|
||||
\fBClientData\fR \fIclientData\fR,
|
||||
\fBvoid *\fR \fIclientData\fR,
|
||||
\fBTcl_Interp\fR* \fIinterp\fR,
|
||||
int \fIlevel\fR,
|
||||
const char *\fIcommand\fR,
|
||||
@@ -77,7 +77,7 @@ typedef int \fBTcl_CmdObjTraceProc\fR(
|
||||
.PP
|
||||
The \fIclientData\fR and \fIinterp\fR parameters are copies of the
|
||||
corresponding arguments given to \fBTcl_CreateTrace\fR.
|
||||
\fIClientData\fR typically points to an application-specific data
|
||||
\fIclientData\fR typically points to an application-specific data
|
||||
structure that describes what to do when \fIobjProc\fR is invoked. The
|
||||
\fIlevel\fR parameter gives the nesting level of the command (1 for
|
||||
top-level commands passed to \fBTcl_Eval\fR by the application, 2 for
|
||||
@@ -144,7 +144,7 @@ When \fBTcl_DeleteTrace\fR is called, the interpreter invokes the
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CmdObjTraceDeleteProc\fR(
|
||||
\fBClientData\fR \fIclientData\fR);
|
||||
\fBvoid *\fR \fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR parameter will be the same as the
|
||||
@@ -160,12 +160,12 @@ match the type \fBTcl_CmdTraceProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CmdTraceProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIlevel\fR,
|
||||
char *\fIcommand\fR,
|
||||
Tcl_CmdProc *\fIcmdProc\fR,
|
||||
ClientData \fIcmdClientData\fR,
|
||||
void *\fIcmdClientData\fR,
|
||||
int \fIargc\fR,
|
||||
const char *\fIargv\fR[]);
|
||||
.CE
|
||||
|
||||
+5
-11
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringTrunc, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult \- manipulate dynamic strings
|
||||
Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult \- manipulate dynamic strings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -26,7 +26,7 @@ char *
|
||||
.sp
|
||||
\fBTcl_DStringEndSublist\fR(\fIdsPtr\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_DStringLength\fR(\fIdsPtr\fR)
|
||||
.sp
|
||||
char *
|
||||
@@ -34,8 +34,6 @@ char *
|
||||
.sp
|
||||
\fBTcl_DStringSetLength\fR(\fIdsPtr, newLength\fR)
|
||||
.sp
|
||||
\fBTcl_DStringTrunc\fR(\fIdsPtr, newLength\fR)
|
||||
.sp
|
||||
\fBTcl_DStringFree\fR(\fIdsPtr\fR)
|
||||
.sp
|
||||
\fBTcl_DStringResult\fR(\fIinterp, dsPtr\fR)
|
||||
@@ -49,10 +47,10 @@ Pointer to structure that is used to manage a dynamic string.
|
||||
Pointer to characters to append to dynamic string.
|
||||
.AP "const char" *element in
|
||||
Pointer to characters to append as list element to dynamic string.
|
||||
.AP int length in
|
||||
Number of bytes from \fIbytes\fR to add to dynamic string. If -1,
|
||||
.AP size_t length in
|
||||
Number of bytes from \fIbytes\fR to add to dynamic string. If 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.
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ Tcl_DoWhenIdle, Tcl_CancelIdleCall \- invoke a procedure when there are no pendi
|
||||
.AS Tcl_IdleProc clientData
|
||||
.AP Tcl_IdleProc *proc in
|
||||
Procedure to invoke.
|
||||
.AP ClientData clientData in
|
||||
.AP coid *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
@@ -43,7 +43,7 @@ type \fBTcl_IdleProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_IdleProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
|
||||
|
||||
@@ -43,7 +43,7 @@ is not defined, these functions are all no-ops.
|
||||
\fBTcl_DumpActiveMemory\fR will output a list of all currently
|
||||
allocated memory to the specified file. The information output for
|
||||
each allocated block of memory is: starting and ending addresses
|
||||
(excluding guard zone), size, source file where \fBckalloc\fR was
|
||||
(excluding guard zone), size, source file where \fBTcl_Alloc\fR was
|
||||
called to allocate the block and line number in that file. It is
|
||||
especially useful to call \fBTcl_DumpActiveMemory\fR after the Tcl
|
||||
interpreter has been deleted.
|
||||
@@ -55,8 +55,8 @@ by \fBTcl_Main\fR.
|
||||
\fBTcl_ValidateAllMemory\fR forces a validation of the guard zones of
|
||||
all currently allocated blocks of memory. Normally validation of a
|
||||
block occurs when its freed, unless full validation is enabled, in
|
||||
which case validation of all blocks occurs when \fBckalloc\fR and
|
||||
\fBckfree\fR are called. This function forces the validation to occur
|
||||
which case validation of all blocks occurs when \fBTcl_Alloc\fR and
|
||||
\fBTcl_Free\fR are called. This function forces the validation to occur
|
||||
at any point.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
|
||||
+7
-34
@@ -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
|
||||
@@ -36,12 +36,6 @@ 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
|
||||
@@ -62,12 +56,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 +73,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
|
||||
@@ -255,12 +243,6 @@ 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
|
||||
@@ -287,7 +269,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 +296,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 +327,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 +359,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 +384,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
|
||||
|
||||
@@ -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)
|
||||
.
|
||||
|
||||
+4
-20
@@ -10,7 +10,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval, Tcl_VarEvalVA \- execute Tcl scripts
|
||||
Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval \- execute Tcl scripts
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -38,9 +38,6 @@ int
|
||||
.sp
|
||||
int
|
||||
\fBTcl_VarEval\fR(\fIinterp, part, part, ... \fB(char *) NULL\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_VarEvalVA\fR(\fIinterp, argList\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp **termPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -67,9 +64,6 @@ first null byte are used.
|
||||
Points to first byte of script to execute (null-terminated and UTF-8).
|
||||
.AP char *part in
|
||||
String forming part of a Tcl script.
|
||||
.AP va_list argList in
|
||||
An argument list which must have been initialized using
|
||||
\fBva_start\fR, and cleared using \fBva_end\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
@@ -128,16 +122,10 @@ might be a UTF-8 special code. The string is parsed and executed directly
|
||||
bytecodes. In situations where it is known that the script will never be
|
||||
executed again, \fBTcl_Eval\fR may be faster than \fBTcl_EvalObjEx\fR.
|
||||
\fBTcl_Eval\fR returns a completion code and result just like
|
||||
\fBTcl_EvalObjEx\fR. Note: for backward compatibility with versions before
|
||||
Tcl 8.0, \fBTcl_Eval\fR copies the value result in \fIinterp\fR to
|
||||
\fIinterp->result\fR (use is deprecated) where it can be accessed directly.
|
||||
This makes \fBTcl_Eval\fR somewhat slower than \fBTcl_EvalEx\fR, which
|
||||
does not do the copy.
|
||||
\fBTcl_EvalObjEx\fR.
|
||||
.PP
|
||||
\fBTcl_EvalEx\fR is an extended version of \fBTcl_Eval\fR that takes
|
||||
additional arguments \fInumBytes\fR and \fIflags\fR. For the
|
||||
efficiency reason given above, \fBTcl_EvalEx\fR is generally preferred
|
||||
over \fBTcl_Eval\fR.
|
||||
additional arguments \fInumBytes\fR and \fIflags\fR.
|
||||
.PP
|
||||
\fBTcl_GlobalEval\fR and \fBTcl_GlobalEvalObj\fR are older procedures
|
||||
that are now deprecated. They are similar to \fBTcl_EvalEx\fR and
|
||||
@@ -150,13 +138,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
|
||||
|
||||
+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
|
||||
|
||||
+17
-27
@@ -20,7 +20,7 @@ int
|
||||
int
|
||||
\fBTcl_FSUnregister\fR(\fIfsPtr\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_FSData\fR(\fIfsPtr\fR)
|
||||
.sp
|
||||
void
|
||||
@@ -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)
|
||||
@@ -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,7 +144,6 @@ Tcl_Obj *
|
||||
Tcl_StatBuf *
|
||||
\fBTcl_AllocStatBuf\fR()
|
||||
.sp
|
||||
.VS 8.6
|
||||
Tcl_WideInt
|
||||
\fBTcl_GetAccessTimeFromStat\fR(\fIstatPtr\fR)
|
||||
.sp
|
||||
@@ -185,7 +182,6 @@ Tcl_WideUInt
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetUserIdFromStat\fR(\fIstatPtr\fR)
|
||||
.VE 8.6
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_GlobTypeData **srcPathPtr out
|
||||
.AP "const Tcl_Filesystem" *fsPtr in
|
||||
@@ -212,7 +208,7 @@ this structure will be returned. This parameter may be NULL.
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use either for results, evaluation, or reporting error
|
||||
messages.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
The native description of the path value to create.
|
||||
.AP Tcl_Obj *firstPtr in
|
||||
The first of two path values to compare. The value may be converted
|
||||
@@ -249,7 +245,7 @@ Name of a procedure to look up in the file's symbol table
|
||||
Filled with the init function for this code.
|
||||
.AP Tcl_PackageInitProc **proc2Ptr out
|
||||
Filled with the safe-init function for this code.
|
||||
.AP ClientData *clientDataPtr out
|
||||
.AP void **clientDataPtr out
|
||||
Filled with the clientData value to pass to this code's unload
|
||||
function when it is called.
|
||||
.AP Tcl_LoadHandle *loadHandlePtr out
|
||||
@@ -418,7 +414,7 @@ caller (with a reference count of 0).
|
||||
the encoding identified by \fIencodingName\fR and evaluates
|
||||
its contents as a Tcl script. It returns the same information as
|
||||
\fBTcl_EvalObjEx\fR.
|
||||
If \fIencodingName\fR is NULL, the system encoding is used for
|
||||
If \fIencodingName\fR is NULL, the utf-8 encoding is used for
|
||||
reading the file contents.
|
||||
If the file could not be read then a Tcl error is returned to describe
|
||||
why the file could not be read.
|
||||
@@ -434,7 +430,7 @@ or
|
||||
which will be safely substituted by the Tcl interpreter into
|
||||
.QW ^Z .
|
||||
\fBTcl_FSEvalFile\fR is a simpler version of
|
||||
\fBTcl_FSEvalFileEx\fR that always uses the system encoding
|
||||
\fBTcl_FSEvalFileEx\fR that always uses the utf-8 encoding
|
||||
when reading the file.
|
||||
.PP
|
||||
\fBTcl_FSLoadFile\fR dynamically loads a binary code file into memory and
|
||||
@@ -444,20 +440,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 +716,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 +783,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 +810,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 +831,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 +1008,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 +1018,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 +1028,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 +1039,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 +1050,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
|
||||
@@ -1350,11 +1340,11 @@ is considered to be owned by the filesystem (not by Tcl's core), but
|
||||
should be given a reference count for Tcl. Tcl will use the contents of the
|
||||
list and then decrement that reference count. This allows filesystems to
|
||||
choose whether they actually want to retain a
|
||||
.QW "master list"
|
||||
.QW "global list"
|
||||
of volumes
|
||||
or not (if not, they generate the list on the fly and pass it to Tcl
|
||||
with a reference count of 1 and then forget about the list, if yes, then
|
||||
they simply increment the reference count of their master list and pass it
|
||||
they simply increment the reference count of their global list and pass it
|
||||
to Tcl which will copy the contents and then decrement the count back
|
||||
to where it was).
|
||||
.PP
|
||||
|
||||
+2
-1
@@ -58,6 +58,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
|
||||
|
||||
+13
-6
@@ -27,19 +27,22 @@ Interpreter to use for error reporting; if NULL, then no message is
|
||||
provided on errors.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
The string value of this value is used to search through \fItablePtr\fR.
|
||||
The internal representation is modified to hold the index of the matching
|
||||
If the \fBTCL_INDEX_TEMP_TABLE\fR flag is not specified,
|
||||
the internal representation is modified to hold the index of the matching
|
||||
table entry.
|
||||
.AP "const char *const" *tablePtr in
|
||||
An array of null-terminated strings. The end of the array is marked
|
||||
by a NULL string pointer.
|
||||
Note that references to the \fItablePtr\fR may be retained in the
|
||||
Note that, unless the \fBTCL_INDEX_TEMP_TABLE\fR flag is specified,
|
||||
references to the \fItablePtr\fR may be retained in the
|
||||
internal representation of \fIobjPtr\fR, so this should represent the
|
||||
address of a statically-allocated array.
|
||||
.AP "const void" *structTablePtr in
|
||||
An array of arbitrary type, typically some \fBstruct\fR type.
|
||||
The first member of the structure must be a null-terminated string.
|
||||
The size of the structure is given by \fIoffset\fR.
|
||||
Note that references to the \fIstructTablePtr\fR may be retained in the
|
||||
Note that, unless the \fBTCL_INDEX_TEMP_TABLE\fR flag is specified,
|
||||
references to the \fIstructTablePtr\fR may be retained in the
|
||||
internal representation of \fIobjPtr\fR, so this should represent the
|
||||
address of a statically-allocated array of structures.
|
||||
.AP int offset in
|
||||
@@ -50,7 +53,8 @@ Null-terminated string describing what is being looked up, such as
|
||||
\fBoption\fR. This string is included in error messages.
|
||||
.AP int flags in
|
||||
OR-ed combination of bits providing additional information for
|
||||
operation. The only bit that is currently defined is \fBTCL_EXACT\fR.
|
||||
operation. The only bits that are currently defined are \fBTCL_EXACT\fR
|
||||
and \fBTCL_INDEX_TEMP_TABLE\fR.
|
||||
.AP int *indexPtr out
|
||||
The index of the string in \fItablePtr\fR that matches the value of
|
||||
\fIobjPtr\fR is returned here.
|
||||
@@ -76,7 +80,8 @@ error message to indicate what was being looked up. For example,
|
||||
if \fImsg\fR is \fBoption\fR the error message will have a form like
|
||||
.QW "\fBbad option \N'34'firt\N'34': must be first, second, or third\fR" .
|
||||
.PP
|
||||
If \fBTcl_GetIndexFromObj\fR completes successfully it modifies the
|
||||
If the \fBTCL_INDEX_TEMP_TABLE\fR was not specified, when
|
||||
\fBTcl_GetIndexFromObj\fR completes successfully it modifies the
|
||||
internal representation of \fIobjPtr\fR to hold the address of
|
||||
the table and the index of the matching entry. If \fBTcl_GetIndexFromObj\fR
|
||||
is invoked again with the same \fIobjPtr\fR and \fItablePtr\fR
|
||||
@@ -84,7 +89,9 @@ arguments (e.g. during a reinvocation of a Tcl command), it returns
|
||||
the matching index immediately without having to redo the lookup
|
||||
operation. Note: \fBTcl_GetIndexFromObj\fR assumes that the entries
|
||||
in \fItablePtr\fR are static: they must not change between
|
||||
invocations. If the value of \fIobjPtr\fR is the empty string,
|
||||
invocations. This caching mechanism can be disallowed by specifying
|
||||
the \fBTCL_INDEX_TEMP_TABLE\fR flag.
|
||||
If the value of \fIobjPtr\fR is the empty string,
|
||||
\fBTcl_GetIndexFromObj\fR will treat it as a non-matching value
|
||||
and return \fBTCL_ERROR\fR.
|
||||
.PP
|
||||
|
||||
+4
-4
@@ -57,15 +57,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
|
||||
|
||||
+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
|
||||
|
||||
+5
-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
|
||||
|
||||
+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,31 @@
|
||||
'\"
|
||||
'\" 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
|
||||
void
|
||||
\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
|
||||
\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 unicode 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
|
||||
+17
-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, intPtr\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 int 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
|
||||
@@ -97,7 +102,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, \fB__int64\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 +120,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
|
||||
|
||||
-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
@@ -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
|
||||
@@ -116,7 +116,7 @@ execution of the callbacks is unspecified) execution in the limited
|
||||
interpreter is stopped by raising an error and setting a flag that
|
||||
prevents the \fBcatch\fR command in that interpreter from trapping
|
||||
that error. It is up to the context that started execution in that
|
||||
interpreter (typically a master interpreter) to handle the error.
|
||||
interpreter (typically the main interpreter) to handle the error.
|
||||
.SH "LIMIT CHECKING API"
|
||||
.PP
|
||||
To check the resource limits for an interpreter, call
|
||||
@@ -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_BYTES\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_BYTES\fR instead.
|
||||
.VE "TIP 312"
|
||||
.RE
|
||||
.TP
|
||||
\fBTCL_LINK_BYTES\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
|
||||
|
||||
+38
-20
@@ -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)
|
||||
@@ -56,7 +61,7 @@ Tcl_Object
|
||||
int
|
||||
\fBTcl_ObjectContextSkippedArgs\fR(\fIcontext\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS ClientData clientData in
|
||||
.AS void *clientData in
|
||||
.AP Tcl_Interp *interp in/out
|
||||
The interpreter holding the object or class to create or update a method in.
|
||||
.AP Tcl_Object object in
|
||||
@@ -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.
|
||||
@@ -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
|
||||
|
||||
@@ -49,7 +49,7 @@ in the same way as the \fIproc\fR argument to \fBTcl_CreateObjCommand\fR(3)
|
||||
(\fIq.v.\fR).
|
||||
.AP Tcl_ObjCmdProc *nreProc in
|
||||
Called instead of \fIproc\fR when a trampoline is already in use.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value passed to \fIproc\fR, \fInreProc\fR, \fIdeleteProc\fR
|
||||
and \fIobjProc\fR.
|
||||
.AP Tcl_CmdDeleteProc *deleteProc in/out
|
||||
@@ -72,10 +72,10 @@ Pointer to an unshared Tcl_Obj where the result of the evaluation is stored if
|
||||
the return code is TCL_OK.
|
||||
.AP Tcl_NRPostProc *postProcPtr in
|
||||
A function to push.
|
||||
.AP ClientData data0 in
|
||||
.AP ClientData data1 in
|
||||
.AP ClientData data2 in
|
||||
.AP ClientData data3 in
|
||||
.AP void *data0 in
|
||||
.AP void *data1 in
|
||||
.AP void *data2 in
|
||||
.AP void *data3 in
|
||||
\fIdata0\fR through \fIdata3\fR are four one-word values that will be passed
|
||||
to the function designated by \fIpostProcPtr\fR when it is invoked.
|
||||
.BE
|
||||
@@ -130,7 +130,7 @@ a message as the interpreter's result.
|
||||
.CS
|
||||
typedef int
|
||||
\fBTcl_NRPostProc\fR(
|
||||
\fBClientData\fR \fIdata\fR[],
|
||||
\fBvoid *\fR \fIdata\fR[],
|
||||
\fBTcl_Interp\fR *\fIinterp\fR,
|
||||
int \fIresult\fR);
|
||||
.CE
|
||||
@@ -146,7 +146,7 @@ stack, to evalute a script:
|
||||
.CS
|
||||
int
|
||||
\fITheCmdOldObjProc\fR(
|
||||
ClientData clientData,
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -177,7 +177,7 @@ call \fITheCmdNRObjProc\fR:
|
||||
.CS
|
||||
int
|
||||
\fITheCmdOldObjProc\fR(
|
||||
ClientData clientData,
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -190,7 +190,7 @@ int
|
||||
.CS
|
||||
int
|
||||
\fITheCmdNRObjProc\fR
|
||||
ClientData clientData,
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
@@ -211,7 +211,7 @@ int
|
||||
.CS
|
||||
int
|
||||
\fITheCmdNRPostProc\fR(
|
||||
ClientData data[],
|
||||
void *data[],
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
|
||||
+2
-2
@@ -57,7 +57,7 @@ The interpreter in which the namespace exists and where name lookups
|
||||
are performed. Also where error result messages are written.
|
||||
.AP "const char" *name in
|
||||
The name of the namespace or command to be created or accessed.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
A context pointer by the creator of the namespace. Not interpreted by
|
||||
Tcl at all.
|
||||
.AP Tcl_NamespaceDeleteProc *deleteProc in
|
||||
@@ -117,7 +117,7 @@ the global namespace.)
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_NamespaceDeleteProc\fR(
|
||||
ClientData \fIclientData\fR);
|
||||
void *\fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
\fBTcl_DeleteNamespace\fR deletes a namespace, calling the
|
||||
|
||||
+18
-28
@@ -38,7 +38,7 @@ Tcl_ThreadId
|
||||
void
|
||||
\fBTcl_DeleteEvents\fR(\fIdeleteProc, clientData\fR)
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_InitNotifier\fR()
|
||||
.sp
|
||||
void
|
||||
@@ -78,7 +78,7 @@ Procedure to invoke to prepare for event wait in \fBTcl_DoOneEvent\fR.
|
||||
Procedure for \fBTcl_DoOneEvent\fR to invoke after waiting for
|
||||
events. Checks to see if any events have occurred and, if so,
|
||||
queues them.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIsetupProc\fR, \fIcheckProc\fR, or
|
||||
\fIdeleteProc\fR.
|
||||
.AP "const Tcl_Time" *timePtr in
|
||||
@@ -89,7 +89,7 @@ is NULL, it means there is no maximum wait time: wait forever if
|
||||
necessary.
|
||||
.AP Tcl_Event *evPtr in
|
||||
An event to add to the event queue. The storage for the event must
|
||||
have been allocated by the caller using \fBTcl_Alloc\fR or \fBckalloc\fR.
|
||||
have been allocated by the caller using \fBTcl_Alloc\fR.
|
||||
.AP Tcl_QueuePosition position in
|
||||
Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR,
|
||||
\fBTCL_QUEUE_HEAD\fR, or \fBTCL_QUEUE_MARK\fR.
|
||||
@@ -132,22 +132,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 +225,7 @@ the event source.
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_EventSetupProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
int \fIflags\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -308,7 +303,7 @@ following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_EventCheckProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
int \fIflags\fR);
|
||||
.CE
|
||||
.PP
|
||||
@@ -399,15 +394,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 +419,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 +489,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
|
||||
|
||||
+2
-2
@@ -111,9 +111,9 @@ which is defined as follows.
|
||||
.PP
|
||||
.CS
|
||||
typedef struct Tcl_Obj {
|
||||
int \fIrefCount\fR;
|
||||
size_t \fIrefCount\fR;
|
||||
char *\fIbytes\fR;
|
||||
int \fIlength\fR;
|
||||
size_t \fIlength\fR;
|
||||
const Tcl_ObjType *\fItypePtr\fR;
|
||||
union {
|
||||
long \fIlongValue\fR;
|
||||
|
||||
+2
-2
@@ -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,
|
||||
|
||||
+13
-13
@@ -53,28 +53,28 @@ int
|
||||
int
|
||||
\fBTcl_Read\fR(\fIchannel, readBuf, bytesToRead\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_GetsObj\fR(\fIchannel, lineObjPtr\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_Gets\fR(\fIchannel, lineRead\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_Ungets\fR(\fIchannel, input, inputLen, addAtEnd\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_WriteObj\fR(\fIchannel, writeObjPtr\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_WriteChars\fR(\fIchannel, charBuf, bytesToWrite\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_Write\fR(\fIchannel, byteBuf, bytesToWrite\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_ReadRaw\fR(\fIchannel, readBuf, bytesToRead\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_WriteRaw\fR(\fIchannel, byteBuf, bytesToWrite\fR)
|
||||
.sp
|
||||
int
|
||||
@@ -134,7 +134,7 @@ input of the invoking process; likewise for \fBTCL_STDOUT\fR and
|
||||
redirect stdio handles to override the stdio handles for which
|
||||
\fBTCL_STDIN\fR, \fBTCL_STDOUT\fR and \fBTCL_STDERR\fR have been set. If it
|
||||
is set, then such redirections cause an error.
|
||||
.AP ClientData handle in
|
||||
.AP void *handle in
|
||||
Operating system specific handle for I/O to a file. For Unix this is a
|
||||
file descriptor, for Windows it is a HANDLE.
|
||||
.AP int readOrWrite in
|
||||
@@ -154,7 +154,7 @@ from a procedure such as \fBTcl_OpenFileChannel\fR.
|
||||
.AP Tcl_Obj *readObjPtr in/out
|
||||
A pointer to a Tcl value in which to store the characters read from the
|
||||
channel.
|
||||
.AP int charsToRead in
|
||||
.AP size_t charsToRead in
|
||||
The number of characters to read from the channel. If the channel's encoding
|
||||
is \fBbinary\fR, this is equivalent to the number of bytes to read from the
|
||||
channel.
|
||||
@@ -163,7 +163,7 @@ If non-zero, data read from the channel will be appended to the value.
|
||||
Otherwise, the data will replace the existing contents of the value.
|
||||
.AP char *readBuf out
|
||||
A buffer in which to store the bytes read from the channel.
|
||||
.AP int bytesToRead in
|
||||
.AP size_t bytesToRead in
|
||||
The number of bytes to read from the channel. The buffer \fIreadBuf\fR must
|
||||
be large enough to hold this many bytes.
|
||||
.AP Tcl_Obj *lineObjPtr in/out
|
||||
@@ -176,7 +176,7 @@ channel. Must have been initialized by the caller. The line read will be
|
||||
appended to any data already in the dynamic string.
|
||||
.AP "const char" *input in
|
||||
The input to add to a channel buffer.
|
||||
.AP int inputLen in
|
||||
.AP size_t inputLen in
|
||||
Length of the input
|
||||
.AP int addAtEnd in
|
||||
Flag indicating whether the input should be added to the end or
|
||||
@@ -187,7 +187,7 @@ A pointer to a Tcl value whose contents will be output to the channel.
|
||||
A buffer containing the characters to output to the channel.
|
||||
.AP "const char" *byteBuf in
|
||||
A buffer containing the bytes to output to the channel.
|
||||
.AP int bytesToWrite in
|
||||
.AP size_t bytesToWrite in
|
||||
The number of bytes to consume from \fIcharBuf\fR or \fIbyteBuf\fR and
|
||||
output to the channel.
|
||||
.AP Tcl_WideInt offset in
|
||||
|
||||
+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
|
||||
|
||||
+14
-5
@@ -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
|
||||
@@ -16,10 +16,10 @@ void
|
||||
\fBTcl_Panic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_PanicVA\fR(\fIformat\fR, \fIargList\fR)
|
||||
\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:
|
||||
@@ -75,14 +83,15 @@ 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 safely by stub-enabled extensions, so its
|
||||
symbol is not included in the stub table.
|
||||
.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
|
||||
|
||||
+4
-4
@@ -31,7 +31,7 @@ The array of arguments to be parsed.
|
||||
Pointer to a variable that will hold the array of unprocessed arguments.
|
||||
Should be NULL if no return of unprocessed arguments is required. If
|
||||
\fIobjcPtr\fR is updated to a non-zero value, the array returned through this
|
||||
must be deallocated using \fBckfree\fR.
|
||||
must be deallocated using \fBTcl_Free\fR.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
@@ -84,7 +84,7 @@ typedef struct {
|
||||
void *\fIsrcPtr\fR;
|
||||
void *\fIdstPtr\fR;
|
||||
const char *\fIhelpStr\fR;
|
||||
ClientData \fIclientData\fR;
|
||||
void *\fIclientData\fR;
|
||||
} \fBTcl_ArgvInfo\fR;
|
||||
.CE
|
||||
.PP
|
||||
@@ -127,7 +127,7 @@ have the following signature:
|
||||
.PP
|
||||
.CS
|
||||
typedef int (\fBTcl_ArgvFuncProc\fR)(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Obj *\fIobjPtr\fR,
|
||||
void *\fIdstPtr\fR);
|
||||
.CE
|
||||
@@ -149,7 +149,7 @@ function will have the following signature:
|
||||
.PP
|
||||
.CS
|
||||
typedef int (\fBTcl_ArgvGenFuncProc\fR)(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIobjc\fR,
|
||||
Tcl_Obj *const *\fIobjv\fR,
|
||||
|
||||
+7
-21
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_ParseVar, Tcl_FreeParse, Tcl_EvalTokens, Tcl_EvalTokensStandard \- parse Tcl scripts and expressions
|
||||
Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_ParseVar, Tcl_FreeParse, Tcl_EvalTokensStandard \- parse Tcl scripts and expressions
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -33,20 +33,16 @@ const char *
|
||||
.sp
|
||||
\fBTcl_FreeParse\fR(\fIusedParsePtr\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_EvalTokens\fR(\fIinterp, tokenPtr, numTokens\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_EvalTokensStandard\fR(\fIinterp, tokenPtr, numTokens\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *usedParsePtr out
|
||||
.AP Tcl_Interp *interp out
|
||||
For procedures other than \fBTcl_FreeParse\fR, \fBTcl_EvalTokens\fR
|
||||
and \fBTcl_EvalTokensStandard\fR, used only for error reporting;
|
||||
For procedures other than \fBTcl_FreeParse\fR and
|
||||
\fBTcl_EvalTokensStandard\fR, used only for error reporting;
|
||||
if NULL, then no error messages are left after errors.
|
||||
For \fBTcl_EvalTokens\fR and \fBTcl_EvalTokensStandard\fR,
|
||||
determines the context for evaluating the
|
||||
script and also is used for error reporting; must not be NULL.
|
||||
For \fBTcl_EvalTokensStandard\fR, determines the context for evaluating
|
||||
the script and also is used for error reporting; must not be NULL.
|
||||
.AP "const char" *start in
|
||||
Pointer to first character in string to parse.
|
||||
.AP int numBytes in
|
||||
@@ -191,16 +187,6 @@ code with one of the values \fBTCL_OK\fR, \fBTCL_ERROR\fR,
|
||||
some other integer value originating in an extension.
|
||||
In addition, a result value or error message is left in \fIinterp\fR's
|
||||
result; it can be retrieved using \fBTcl_GetObjResult\fR.
|
||||
.PP
|
||||
\fBTcl_EvalTokens\fR differs from \fBTcl_EvalTokensStandard\fR only in
|
||||
the return convention used: it returns the result in a new Tcl_Obj.
|
||||
The reference count of the value returned as result has been
|
||||
incremented, so the caller must
|
||||
invoke \fBTcl_DecrRefCount\fR when it is finished with the value.
|
||||
If an error or other exception occurs while evaluating the tokens
|
||||
(such as a reference to a non-existent variable) then the return value
|
||||
is NULL and an error message is left in \fIinterp\fR's result. The use
|
||||
of \fBTcl_EvalTokens\fR is deprecated.
|
||||
.SH "TCL_PARSE STRUCTURE"
|
||||
.PP
|
||||
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
|
||||
@@ -222,8 +208,8 @@ typedef struct Tcl_Parse {
|
||||
typedef struct Tcl_Token {
|
||||
int \fItype\fR;
|
||||
const char *\fIstart\fR;
|
||||
int \fIsize\fR;
|
||||
int \fInumComponents\fR;
|
||||
size_t \fIsize\fR;
|
||||
size_t \fInumComponents\fR;
|
||||
} \fBTcl_Token\fR;
|
||||
.CE
|
||||
.PP
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ Tcl_Preserve, Tcl_Release, Tcl_EventuallyFree \- avoid freeing storage while it
|
||||
\fBTcl_EventuallyFree\fR(\fIclientData, freeProc\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_FreeProc clientData
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Token describing structure to be freed or reallocated. Usually a pointer
|
||||
to memory for structure.
|
||||
.AP Tcl_FreeProc *freeProc in
|
||||
@@ -91,7 +91,7 @@ reasons, but the value is the same.
|
||||
.PP
|
||||
When the \fIclientData\fR argument to \fBTcl_EventuallyFree\fR
|
||||
refers to storage allocated and returned by a prior call to
|
||||
\fBTcl_Alloc\fR, \fBckalloc\fR, or another function of the Tcl library,
|
||||
\fBTcl_Alloc\fR or another function of the Tcl library,
|
||||
then the \fIfreeProc\fR argument should be given the special value of
|
||||
\fBTCL_DYNAMIC\fR.
|
||||
.PP
|
||||
|
||||
+2
-7
@@ -18,10 +18,7 @@ Tcl_PrintDouble \- Convert floating value to string
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *interp out
|
||||
.AP Tcl_Interp *interp in
|
||||
Before Tcl 8.0, the \fBtcl_precision\fR variable in this interpreter
|
||||
controlled the conversion. As of Tcl 8.0, this argument is ignored and
|
||||
the conversion is controlled by the \fBtcl_precision\fR variable
|
||||
that is now shared by all interpreters.
|
||||
This argument is ignored.
|
||||
.AP double value in
|
||||
Floating-point value to be converted.
|
||||
.AP char *dst out
|
||||
@@ -41,9 +38,7 @@ so that it does not look like an integer. Where \fB%g\fR would
|
||||
generate an integer with no decimal point, \fBTcl_PrintDouble\fR adds
|
||||
.QW .0 .
|
||||
.PP
|
||||
If the \fBtcl_precision\fR value is non-zero, the result will have
|
||||
precisely that many digits of significance. If the value is zero
|
||||
(the default), the result will have the fewest digits needed to
|
||||
The result will have the fewest digits needed to
|
||||
represent the number in such a way that \fBTcl_NewDoubleObj\fR
|
||||
will generate the same number when presented with the given string.
|
||||
IEEE semantics of rounding to even apply to the conversion.
|
||||
|
||||
+1
-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)
|
||||
|
||||
+8
-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
|
||||
|
||||
+36
-71
@@ -1,6 +1,7 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1997 by 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.
|
||||
@@ -9,7 +10,9 @@
|
||||
.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
|
||||
Tcl_SaveInterpState, Tcl_RestoreInterpState, Tcl_DiscardInterpState,
|
||||
Tcl_SaveResult, Tcl_RestoreResult, Tcl_DiscardResult \- Save and restore the
|
||||
state of an an interpreter.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -30,91 +33,53 @@ int
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_InterpState savedPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter for which state should be saved.
|
||||
The interpreter for the operation.
|
||||
.AP int status in
|
||||
Return code value to save as part of interpreter state.
|
||||
The return code for the state.
|
||||
.AP Tcl_InterpState state in
|
||||
Saved state token to be restored or discarded.
|
||||
A token for saved state.
|
||||
.AP Tcl_SavedResult *savedPtr in
|
||||
Pointer to location where interpreter result should be saved or restored.
|
||||
A pointer to storage for saved state.
|
||||
.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.
|
||||
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
|
||||
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.
|
||||
\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
|
||||
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).
|
||||
\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
|
||||
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.
|
||||
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.
|
||||
.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.
|
||||
\fBTcl_SaveResult\fR, \fBTcl_RestoreResult\fR, and \fBTcl_DiscardResult\fR are
|
||||
deprecated. Instead use \fBTcl_SaveInterpState\fR,
|
||||
\fBTcl_RestoreInterpState\fR, and \fBTcl_DiscardInterpState\fR, which are more
|
||||
capable.
|
||||
.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.
|
||||
\fBTcl_SaveResult\fR moves the result of \fIinterp\fR to the location
|
||||
\fIstatePtr\fR points to and returns the interpreter result to its initial
|
||||
state. It does not save options such as \fB\-errorcode\fR or
|
||||
\fB\-errorinfo\fR.
|
||||
.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_RestoreResult\fR clears any existing result or error in \fIinterp\fR and
|
||||
moves the result from \fIstatePtr\fR back to \fIinterp\fR. \fIstatePtr\fR is
|
||||
then in an undefined state and must not be used until passed again 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_DiscardResult\fR releases the state stored at \fBstatePtr\fR, which is
|
||||
then in an undefined state and must not be used until passed again 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.
|
||||
If a saved result is not restored, \fBTcl_DiscardResult\fR must be called to
|
||||
release it.
|
||||
.SH KEYWORDS
|
||||
result, state, interp
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ New limit for nested calls to \fBTcl_Eval\fR for \fIinterp\fR.
|
||||
.PP
|
||||
At any given time Tcl enforces a limit on the number of recursive
|
||||
calls that may be active for \fBTcl_Eval\fR and related procedures
|
||||
such as \fBTcl_GlobalEval\fR.
|
||||
such as \fBTcl_EvalEx\fR.
|
||||
Any call to \fBTcl_Eval\fR that exceeds this depth is aborted with
|
||||
an error.
|
||||
By default the recursion limit is 1000.
|
||||
|
||||
+2
-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
|
||||
|
||||
+5
-5
@@ -20,16 +20,16 @@ int
|
||||
char *
|
||||
\fBTcl_Merge\fR(\fIargc, argv\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_ScanElement\fR(\fIsrc, flagsPtr\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_ScanCountedElement\fR(\fIsrc, length, flagsPtr\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_ConvertElement\fR(\fIsrc, dst, flags\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_ConvertCountedElement\fR(\fIsrc, length, dst, flags\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "const char *const" ***argvPtr out
|
||||
@@ -55,7 +55,7 @@ String that is to become an element of a list.
|
||||
.AP int *flagsPtr in
|
||||
Pointer to word to fill in with information about \fIsrc\fR.
|
||||
The value of *\fIflagsPtr\fR must be passed to \fBTcl_ConvertElement\fR.
|
||||
.AP int length in
|
||||
.AP size_t length in
|
||||
Number of bytes in string \fIsrc\fR.
|
||||
.AP char *dst in
|
||||
Place to copy converted list element. Must contain enough characters
|
||||
|
||||
@@ -64,6 +64,9 @@ the event of an error it should set the interpreter's result to point to an
|
||||
error message. The result or error from the initialization procedure will
|
||||
be returned as the result of the \fBload\fR command that caused the
|
||||
initialization procedure to be invoked.
|
||||
.PP
|
||||
\fBTcl_StaticPackage\fR can not be safely used by stub-enabled extensions,
|
||||
so its symbol is not included in the stub table.
|
||||
.SH KEYWORDS
|
||||
initialization procedure, package, static linking
|
||||
.SH "SEE ALSO"
|
||||
|
||||
+14
-21
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendStringsToObjVA, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
|
||||
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -37,7 +37,7 @@ Tcl_UniChar *
|
||||
Tcl_UniChar *
|
||||
\fBTcl_GetUnicode\fR(\fIobjPtr\fR)
|
||||
.sp
|
||||
Tcl_UniChar
|
||||
int
|
||||
\fBTcl_GetUniChar\fR(\fIobjPtr, index\fR)
|
||||
.sp
|
||||
int
|
||||
@@ -59,9 +59,6 @@ void
|
||||
\fBTcl_AppendStringsToObj\fR(\fIobjPtr, string, string, ... \fB(char *) NULL\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_AppendStringsToObjVA\fR(\fIobjPtr, argList\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_AppendLimitedToObj\fR(\fIobjPtr, bytes, length, limit, ellipsis\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
@@ -90,29 +87,29 @@ Tcl_Obj *
|
||||
Points to the first byte of an array of UTF-8-encoded bytes
|
||||
used to set or append to a string value.
|
||||
This byte array may contain embedded null characters
|
||||
unless \fInumChars\fR is negative. (Applications needing null bytes
|
||||
unless \fInumChars\fR is TCL_INDEX_NONE. (Applications needing null bytes
|
||||
should represent them as the two-byte sequence \fI\e300\e200\fR, use
|
||||
\fBTcl_ExternalToUtf\fR to convert, or \fBTcl_NewByteArrayObj\fR if
|
||||
the string is a collection of uninterpreted bytes.)
|
||||
.AP int length in
|
||||
.AP size_t length in
|
||||
The number of bytes to copy from \fIbytes\fR when
|
||||
initializing, setting, or appending to a string value.
|
||||
If negative, all bytes up to the first null are used.
|
||||
If TCL_INDEX_NONE, all bytes up to the first null are used.
|
||||
.AP "const Tcl_UniChar" *unicode in
|
||||
Points to the first byte of an array of Unicode characters
|
||||
used to set or append to a string value.
|
||||
This byte array may contain embedded null characters
|
||||
unless \fInumChars\fR is negative.
|
||||
.AP int numChars in
|
||||
.AP size_t numChars in
|
||||
The number of Unicode characters to copy from \fIunicode\fR when
|
||||
initializing, setting, or appending to a string value.
|
||||
If negative, all characters up to the first null character are used.
|
||||
.AP int index in
|
||||
If TCL_INDEX_NONE, all characters up to the first null character are used.
|
||||
.AP size_t index in
|
||||
The index of the Unicode character to return.
|
||||
.AP int first in
|
||||
.AP size_t first in
|
||||
The index of the first Unicode character in the Unicode range to be
|
||||
returned as a new value.
|
||||
.AP int last in
|
||||
.AP size_t last in
|
||||
The index of the last Unicode character in the Unicode range to be
|
||||
returned as a new value.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
@@ -127,7 +124,7 @@ Null-terminated string value to append to \fIobjPtr\fR.
|
||||
.AP va_list argList in
|
||||
An argument list which must have been initialized using
|
||||
\fBva_start\fR, and cleared using \fBva_end\fR.
|
||||
.AP int limit in
|
||||
.AP size_t limit in
|
||||
Maximum number of bytes to be appended.
|
||||
.AP "const char" *ellipsis in
|
||||
Suffix to append when the limit leads to string truncation.
|
||||
@@ -140,7 +137,7 @@ Format control string including % conversion specifiers.
|
||||
The number of elements to format or concatenate.
|
||||
.AP Tcl_Obj *objv[] in
|
||||
The array of values to format or concatenate.
|
||||
.AP int newLength in
|
||||
.AP size_t newLength in
|
||||
New length for the string value of \fIobjPtr\fR, not including the
|
||||
final null character.
|
||||
.BE
|
||||
@@ -204,8 +201,8 @@ where the caller does not need the length of the unicode string
|
||||
representation.
|
||||
.PP
|
||||
\fBTcl_GetUniChar\fR returns the \fIindex\fR'th character in the
|
||||
value's Unicode representation. The index is assumed to be in the
|
||||
appropriate range.
|
||||
value's Unicode representation. If the index is out of range or
|
||||
it references a low surrogate preceded by a high surrogate, it returns -1;
|
||||
.PP
|
||||
\fBTcl_GetRange\fR returns a newly created value comprised of the
|
||||
characters between \fIfirst\fR and \fIlast\fR (inclusive) in the
|
||||
@@ -247,10 +244,6 @@ values may contain internal null characters). Any number of
|
||||
\fIstring\fR arguments may be provided, but the last argument
|
||||
must be a NULL pointer to indicate the end of the list.
|
||||
.PP
|
||||
\fBTcl_AppendStringsToObjVA\fR is the same as \fBTcl_AppendStringsToObj\fR
|
||||
except that instead of taking a variable number of arguments it takes an
|
||||
argument list.
|
||||
.PP
|
||||
\fBTcl_AppendLimitedToObj\fR is similar to \fBTcl_AppendToObj\fR
|
||||
except that it imposes a limit on how many bytes are appended.
|
||||
This can be handy when the string to be appended might be
|
||||
|
||||
+6
-6
@@ -34,7 +34,7 @@ and the Tcl \fBmemory\fR command can be used to validate and examine
|
||||
memory usage.
|
||||
.SH "GUARD ZONES"
|
||||
.PP
|
||||
When memory debugging is enabled, whenever a call to \fBckalloc\fR is
|
||||
When memory debugging is enabled, whenever a call to \fBTcl_Alloc\fR is
|
||||
made, slightly more memory than requested is allocated so the memory
|
||||
debugging code can keep track of the allocated memory, and eight-byte
|
||||
.QW "guard zones"
|
||||
@@ -44,7 +44,7 @@ C #define \fBLOW_GUARD_SIZE\fR and #define \fBHIGH_GUARD_SIZE\fR
|
||||
in the file \fIgeneric/tclCkalloc.c\fR \(em it can
|
||||
be extended if you suspect large overwrite problems, at some cost in
|
||||
performance.) A known pattern is written into the guard zones and, on
|
||||
a call to \fBckfree\fR, the guard zones of the space being freed are
|
||||
a call to \fBTcl_Free\fR, the guard zones of the space being freed are
|
||||
checked to see if either zone has been modified in any way. If one
|
||||
has been, the guard bytes and their new contents are identified, and a
|
||||
.QW "low guard failed"
|
||||
@@ -53,7 +53,7 @@ or
|
||||
message is issued. The
|
||||
.QW "guard failed"
|
||||
message includes the address of the memory packet and
|
||||
the file name and line number of the code that called \fBckfree\fR.
|
||||
the file name and line number of the code that called \fBTcl_Free\fR.
|
||||
This allows you to detect the common sorts of one-off problems, where
|
||||
not enough space was allocated to contain the data written, for
|
||||
example.
|
||||
@@ -66,15 +66,15 @@ suspect (or know) that corruption is occurring before the Tcl
|
||||
interpreter comes up far enough for you to issue commands, you can set
|
||||
\fBMEM_VALIDATE\fR define, recompile tclCkalloc.c and rebuild Tcl.
|
||||
This will enable memory validation from the first call to
|
||||
\fBckalloc\fR, again, at a large performance impact.
|
||||
\fBTcl_Alloc\fR, again, at a large performance impact.
|
||||
.PP
|
||||
If you are desperate and validating memory on every call to
|
||||
\fBckalloc\fR and \fBckfree\fR is not enough, you can explicitly call
|
||||
\fBTcl_Alloc\fR and \fBTcl_Free\fR is not enough, you can explicitly call
|
||||
\fBTcl_ValidateAllMemory\fR directly at any point. It takes a \fIchar
|
||||
*\fR and an \fIint\fR which are normally the filename and line number
|
||||
of the caller, but they can actually be anything you want. Remember
|
||||
to remove the calls after you find the problem.
|
||||
.SH "SEE ALSO"
|
||||
ckalloc, memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
|
||||
Tcl_Alloc, memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
|
||||
.SH KEYWORDS
|
||||
memory, debug
|
||||
|
||||
@@ -28,10 +28,10 @@ First, the Tcl interpreter breaks the command into \fIwords\fR
|
||||
and performs substitutions as described below.
|
||||
These substitutions are performed in the same way for all
|
||||
commands.
|
||||
Secondly, the first word is used to locate a command procedure to
|
||||
carry out the command, then all of the words of the command are
|
||||
passed to the command procedure.
|
||||
The command procedure is free to interpret each of its words
|
||||
Secondly, the first word is used to locate a routine to
|
||||
carry out the command, and the remaining words of the command are
|
||||
passed to that routine.
|
||||
The routine is free to interpret each of its words
|
||||
in any way it likes, such as an integer, variable name, list,
|
||||
or Tcl script.
|
||||
Different commands interpret their words differently.
|
||||
@@ -223,7 +223,10 @@ before this range overflows, or when the maximum of eight digits
|
||||
is reached. The upper bits of the Unicode character will be 0.
|
||||
.RS
|
||||
.PP
|
||||
The range U+010000\(enU+10FFFD is reserved for the future.
|
||||
The range U+00D800\(enU+00DFFF is reserved for surrogates, which
|
||||
are illegal on its own. Therefore, such sequences will result in
|
||||
the replacement character U+FFFD. Surrogate pairs should be
|
||||
encoded as single \e\fBU\fIhhhhhhhh\fR character.
|
||||
.RE
|
||||
.PP
|
||||
Backslash substitution is not performed on words enclosed in braces,
|
||||
|
||||
+4
-4
@@ -88,7 +88,7 @@ The initial value for the checksum algorithm.
|
||||
.AP "unsigned char" *bytes in
|
||||
An array of bytes to run the checksum algorithm over, or NULL to get the
|
||||
recommended initial value for the checksum algorithm.
|
||||
.AP int length in
|
||||
.AP size_t length in
|
||||
The number of bytes in the array.
|
||||
.AP int mode in
|
||||
What mode to operate the stream in. Should be either
|
||||
@@ -107,9 +107,9 @@ if the currently compressed data must be made available for access using
|
||||
into a state where the decompressor can recover from on corruption, or
|
||||
\fBTCL_ZLIB_FINALIZE\fR to ensure that the stream is finished and that any
|
||||
trailer demanded by the format is written.
|
||||
.AP int count in
|
||||
The maximum number of bytes to get from the stream, or -1 to get all remaining
|
||||
bytes from the stream's buffers.
|
||||
.AP size_t count in
|
||||
The maximum number of bytes to get from the stream, or TCL_INDEX_NONE to get
|
||||
all remaining bytes from the stream's buffers.
|
||||
.AP Tcl_Obj *compDict in
|
||||
A byte array value that is the compression dictionary to use with the stream.
|
||||
Note that this is \fInot a Tcl dictionary\fR, and it is recommended that this
|
||||
|
||||
+8
-6
@@ -79,7 +79,7 @@ against the standard Tcl library. Extensions (stub-enabled or
|
||||
not) are not intended to call \fBTcl_Main\fR.
|
||||
.PP
|
||||
\fBTcl_Main\fR is not thread-safe. It should only be called by
|
||||
a single master thread of a multi-threaded application. This
|
||||
a single main thread of a multi-threaded application. This
|
||||
restriction is not a problem with normal use described above.
|
||||
.PP
|
||||
\fBTcl_Main\fR and therefore all applications based upon it, like
|
||||
@@ -112,7 +112,7 @@ The file name and encoding values managed by the routines
|
||||
\fBTcl_SetStartupScript\fR and \fBTcl_GetStartupScript\fR
|
||||
are stored per-thread. Although the storage and retrieval
|
||||
functions of these routines work in any thread, only those
|
||||
calls in the same master thread as \fBTcl_Main\fR can have
|
||||
calls in the same main thread as \fBTcl_Main\fR can have
|
||||
any influence on it.
|
||||
.PP
|
||||
The caller of \fBTcl_Main\fR may call \fBTcl_SetStartupScript\fR
|
||||
@@ -126,7 +126,7 @@ a \fIstartup script\fR, and \fIname\fR is taken to be the name
|
||||
of the encoding of the contents of that file. \fBTcl_Main\fR
|
||||
then calls \fBTcl_SetStartupScript\fR with these values.
|
||||
.PP
|
||||
\fBTcl_Main\fR then defines in its master interpreter
|
||||
\fBTcl_Main\fR then defines in its main interpreter
|
||||
the Tcl variables \fIargc\fR, \fIargv\fR, \fIargv0\fR, and
|
||||
\fItcl_interactive\fR, as described in the documentation for \fBtclsh\fR.
|
||||
.PP
|
||||
@@ -154,9 +154,9 @@ When the \fIappInitProc\fR is finished, \fBTcl_Main\fR calls
|
||||
been requested, if any. If a startup script has been provided,
|
||||
\fBTcl_Main\fR attempts to evaluate it. Otherwise, interactive
|
||||
mode begins with examination of the variable \fItcl_rcFileName\fR
|
||||
in the master interpreter. If that variable exists and holds the
|
||||
in the main interpreter. If that variable exists and holds the
|
||||
name of a readable file, the contents of that file are evaluated
|
||||
in the master interpreter. Then interactive operations begin,
|
||||
in the main interpreter. Then interactive operations begin,
|
||||
with prompts and command evaluation results written to the standard
|
||||
output channel, and commands read from the standard input channel
|
||||
and then evaluated. The prompts written to the standard output
|
||||
@@ -164,7 +164,7 @@ channel may be customized by defining the Tcl variables \fItcl_prompt1\fR
|
||||
and \fItcl_prompt2\fR as described in the documentation for \fBtclsh\fR.
|
||||
The prompts and command evaluation results are written to the standard
|
||||
output channel only if the Tcl variable \fItcl_interactive\fR in the
|
||||
master interpreter holds a non-zero integer value.
|
||||
main interpreter holds a non-zero integer value.
|
||||
.PP
|
||||
\fBTcl_SetMainLoop\fR allows setting an event loop procedure to be run.
|
||||
This allows, for example, Tk to be dynamically loaded and set its event
|
||||
@@ -189,6 +189,8 @@ procedure (if any) returns. In non-interactive mode, after
|
||||
\fBTcl_Main\fR evaluates the startup script, and the main loop
|
||||
procedure (if any) returns, \fBTcl_Main\fR will also evaluate
|
||||
the \fBexit\fR command.
|
||||
.PP
|
||||
\fBTcl_Main\fR can not be used in stub-enabled extensions.
|
||||
.SH "SEE ALSO"
|
||||
tclsh(1), Tcl_GetStdChannel(3), Tcl_StandardChannels(3), Tcl_AppInit(3),
|
||||
exit(n), encoding(n)
|
||||
|
||||
+12
-6
@@ -45,7 +45,9 @@ int
|
||||
.AP Tcl_Condition *condPtr in
|
||||
A condition variable, which must be associated with a mutex lock.
|
||||
.AP Tcl_Mutex *mutexPtr in
|
||||
A mutex lock.
|
||||
.VS TIP509
|
||||
A recursive mutex lock.
|
||||
.VE TIP509
|
||||
.AP "const Tcl_Time" *timePtr in
|
||||
A time limit on the condition wait. NULL to wait forever.
|
||||
Note that a polling value of 0 seconds does not make much sense.
|
||||
@@ -65,7 +67,7 @@ Id of the thread waited upon.
|
||||
.AP Tcl_ThreadCreateProc *proc in
|
||||
This procedure will act as the \fBmain()\fR of the newly created
|
||||
thread. The specified \fIclientData\fR will be its sole argument.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary information. Passed as sole argument to the \fIproc\fR.
|
||||
.AP int stackSize in
|
||||
The size of the stack given to the new thread.
|
||||
@@ -140,8 +142,12 @@ of code by calling \fBTcl_MutexLock\fR and \fBTcl_MutexUnlock\fR.
|
||||
If one thread holds a mutex, any other thread calling \fBTcl_MutexLock\fR will
|
||||
block until \fBTcl_MutexUnlock\fR is called.
|
||||
A mutex can be destroyed after its use by calling \fBTcl_MutexFinalize\fR.
|
||||
The result of locking a mutex twice from the same thread is undefined.
|
||||
On some platforms it will result in a deadlock.
|
||||
.VS TIP509
|
||||
Mutexes are reentrant: they can be locked several times from the same
|
||||
thread. However there must be exactly one call to
|
||||
\fBTcl_MutexUnlock\fR for each call to \fBTcl_MutexLock\fR in order
|
||||
for a thread to release a mutex completely.
|
||||
.VE TIP509
|
||||
The \fBTcl_MutexLock\fR, \fBTcl_MutexUnlock\fR and \fBTcl_MutexFinalize\fR
|
||||
procedures are defined as empty macros if not compiling with threads enabled.
|
||||
For declaration of mutexes the \fBTCL_DECLARE_MUTEX\fR macro should be used.
|
||||
@@ -202,7 +208,7 @@ value and then finishes.
|
||||
.CS
|
||||
static \fBTcl_ThreadCreateType\fR
|
||||
MyThreadImplFunc(
|
||||
ClientData clientData)
|
||||
void *clientData)
|
||||
{
|
||||
int i, limit = (int) clientData;
|
||||
for (i=0 ; i<limit ; i++) {
|
||||
@@ -217,7 +223,7 @@ would do this:
|
||||
.PP
|
||||
.CS
|
||||
int limit = 1000000000;
|
||||
ClientData limitData = (void*)((intptr_t) limit);
|
||||
void *limitData = (void*)((intptr_t) limit);
|
||||
Tcl_ThreadId id; \fI/* holds identity of thread created */\fR
|
||||
int result;
|
||||
|
||||
|
||||
+3
-10
@@ -13,13 +13,13 @@ Tcl_UniCharToUpper, Tcl_UniCharToLower, Tcl_UniCharToTitle, Tcl_UtfToUpper, Tcl_
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
Tcl_UniChar
|
||||
int
|
||||
\fBTcl_UniCharToUpper\fR(\fIch\fR)
|
||||
.sp
|
||||
Tcl_UniChar
|
||||
int
|
||||
\fBTcl_UniCharToLower\fR(\fIch\fR)
|
||||
.sp
|
||||
Tcl_UniChar
|
||||
int
|
||||
\fBTcl_UniCharToTitle\fR(\fIch\fR)
|
||||
.sp
|
||||
int
|
||||
@@ -78,12 +78,5 @@ turns each character in the string into its lower-case equivalent.
|
||||
turns the first character in the string into its title-case equivalent
|
||||
and all following characters into their lower-case equivalents.
|
||||
|
||||
.SH BUGS
|
||||
.PP
|
||||
At this time, the case conversions are only defined for the Unicode
|
||||
plane 0 characters. The result for Unicode characters above 0xFFFF
|
||||
is undefined, but - actually - only the lower 16 bits of the
|
||||
character value is handled.
|
||||
|
||||
.SH KEYWORDS
|
||||
utf, unicode, toupper, tolower, totitle, case
|
||||
|
||||
+5
-5
@@ -13,7 +13,7 @@ Tcl_CommandTraceInfo, Tcl_TraceCommand, Tcl_UntraceCommand \- monitor renames an
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_CommandTraceInfo(\fIinterp, cmdName, flags, proc, prevClientData\fB)\fR
|
||||
.sp
|
||||
int
|
||||
@@ -32,9 +32,9 @@ OR'ed collection of the values \fBTCL_TRACE_RENAME\fR and
|
||||
\fBTCL_TRACE_DELETE\fR.
|
||||
.AP Tcl_CommandTraceProc *proc in
|
||||
Procedure to call when specified operations occur to \fIcmdName\fR.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary argument to pass to \fIproc\fR.
|
||||
.AP ClientData prevClientData in
|
||||
.AP void *prevClientData in
|
||||
If non-NULL, gives last value returned by \fBTcl_CommandTraceInfo\fR,
|
||||
so this call will return information about next trace. If NULL, this
|
||||
call will return information about first trace.
|
||||
@@ -65,7 +65,7 @@ match the type \fBTcl_CommandTraceProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CommandTraceProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
const char *\fIoldName\fR,
|
||||
const char *\fInewName\fR,
|
||||
@@ -74,7 +74,7 @@ typedef void \fBTcl_CommandTraceProc\fR(
|
||||
.PP
|
||||
The \fIclientData\fR and \fIinterp\fR parameters will have the same
|
||||
values as those passed to \fBTcl_TraceCommand\fR when the trace was
|
||||
created. \fIClientData\fR typically points to an application-specific
|
||||
created. \fIclientData\fR typically points to an application-specific
|
||||
data structure that describes what to do when \fIproc\fR is invoked.
|
||||
\fIOldName\fR gives the name of the command being renamed, and
|
||||
\fInewName\fR gives the name that the command is being renamed to (or
|
||||
|
||||
+21
-31
@@ -5,7 +5,7 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_TraceVar 3 7.4 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_TraceVar 3 9.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
@@ -24,13 +24,13 @@ int
|
||||
.sp
|
||||
\fBTcl_UntraceVar2(\fIinterp, name1, name2, flags, proc, clientData\fB)\fR
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_VarTraceInfo(\fIinterp, varName, flags, proc, prevClientData\fB)\fR
|
||||
.sp
|
||||
ClientData
|
||||
void *
|
||||
\fBTcl_VarTraceInfo2(\fIinterp, name1, name2, flags, proc, prevClientData\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_VarTraceProc prevClientData
|
||||
.AS void *prevClientData
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter containing variable.
|
||||
.AP "const char" *varName in
|
||||
@@ -46,7 +46,7 @@ Not all flags are used by all
|
||||
procedures. See below for more information.
|
||||
.AP Tcl_VarTraceProc *proc in
|
||||
Procedure to invoke whenever one of the traced operations occurs.
|
||||
.AP ClientData clientData in
|
||||
.AP void *clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR.
|
||||
.AP "const char" *name1 in
|
||||
Name of scalar or array variable (without array index).
|
||||
@@ -54,7 +54,7 @@ Name of scalar or array variable (without array index).
|
||||
For a trace on an element of an array, gives the index of the
|
||||
element. For traces on scalar variables or on whole arrays,
|
||||
is NULL.
|
||||
.AP ClientData prevClientData in
|
||||
.AP void *prevClientData in
|
||||
If non-NULL, gives last value returned by \fBTcl_VarTraceInfo\fR or
|
||||
\fBTcl_VarTraceInfo2\fR, so this call will return information about
|
||||
next trace. If NULL, this call will return information about first
|
||||
@@ -95,7 +95,7 @@ Invoke \fIproc\fR whenever an attempt is made to modify the variable.
|
||||
Invoke \fIproc\fR whenever the variable is unset.
|
||||
A variable may be unset either explicitly by an \fBunset\fR command,
|
||||
or implicitly when a procedure returns (its local variables are
|
||||
automatically unset) or when the interpreter is deleted (all
|
||||
automatically unset) or when the interpreter or namespace is deleted (all
|
||||
variables are automatically unset).
|
||||
.TP
|
||||
\fBTCL_TRACE_ARRAY\fR
|
||||
@@ -107,7 +107,7 @@ before an array set, but that will trigger write traces.
|
||||
\fBTCL_TRACE_RESULT_DYNAMIC\fR
|
||||
The result of invoking the \fIproc\fR is a dynamically allocated
|
||||
string that will be released by the Tcl library via a call to
|
||||
\fBckfree\fR. Must not be specified at the same time as
|
||||
\fBTcl_Free\fR. Must not be specified at the same time as
|
||||
\fBTCL_TRACE_RESULT_OBJECT\fR.
|
||||
.TP
|
||||
\fBTCL_TRACE_RESULT_OBJECT\fR
|
||||
@@ -124,7 +124,7 @@ It should have arguments and result that match the type
|
||||
.PP
|
||||
.CS
|
||||
typedef char *\fBTcl_VarTraceProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
void *\fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
char *\fIname1\fR,
|
||||
char *\fIname2\fR,
|
||||
@@ -134,7 +134,7 @@ typedef char *\fBTcl_VarTraceProc\fR(
|
||||
The \fIclientData\fR and \fIinterp\fR parameters will
|
||||
have the same values as those passed to \fBTcl_TraceVar\fR when the
|
||||
trace was created.
|
||||
\fIClientData\fR typically points to an application-specific
|
||||
\fIclientData\fR typically points to an application-specific
|
||||
data structure that describes what to do when \fIproc\fR
|
||||
is invoked.
|
||||
\fIName1\fR and \fIname2\fR give the name of the traced variable
|
||||
@@ -160,10 +160,6 @@ The bit \fBTCL_TRACE_DESTROYED\fR will be set in \fIflags\fR if the trace is
|
||||
about to be destroyed; this information may be useful to \fIproc\fR
|
||||
so that it can clean up its own internal data structures (see
|
||||
the section \fBTCL_TRACE_DESTROYED\fR below for more details).
|
||||
Lastly, the bit \fBTCL_INTERP_DESTROYED\fR will be set if the entire
|
||||
interpreter is being destroyed.
|
||||
When this bit is set, \fIproc\fR must be especially careful in
|
||||
the things it does (see the section \fBTCL_INTERP_DESTROYED\fR below).
|
||||
The trace procedure's return value should normally be NULL; see
|
||||
\fBERROR RETURNS\fR below for information on other possibilities.
|
||||
.PP
|
||||
@@ -312,7 +308,7 @@ The return value must be a pointer to a static character string
|
||||
containing an error message,
|
||||
unless (\fIexactly\fR one of) the \fBTCL_TRACE_RESULT_DYNAMIC\fR and
|
||||
\fBTCL_TRACE_RESULT_OBJECT\fR flags is set, which specify that the result is
|
||||
either a dynamic string (to be released with \fBckfree\fR) or a
|
||||
either a dynamic string (to be released with \fBTcl_Free\fR) or a
|
||||
Tcl_Obj* (cast to char* and to be released with
|
||||
\fBTcl_DecrRefCount\fR) containing the error message.
|
||||
If a trace procedure returns an error, no further traces are
|
||||
@@ -330,6 +326,16 @@ During unset traces, the return value is ignored and all relevant
|
||||
trace procedures will always be invoked.
|
||||
.SH "RESTRICTIONS"
|
||||
.PP
|
||||
Because operations on variables may take place as part of the deletion
|
||||
of the interp that contains them, \fIproc\fR must be careful about checking
|
||||
what the \fIinterp\fR parameter can be used to do.
|
||||
The routine \fBTcl_InterpDeleted\fR is an important tool for this.
|
||||
When \fBTcl_InterpDeleted\fR returns 1, \fIproc\fR will not be able
|
||||
to invoke any scripts in \fIinterp\fR. You may encounter old code using
|
||||
a deprecated flag value \fBTCL_INTERP_DESTROYED\fR to signal this
|
||||
condition, but Tcl 9 no longer supports this. Any supported code
|
||||
must be converted to stop using it.
|
||||
.PP
|
||||
A trace procedure can be called at any time, even when there
|
||||
are partially formed results stored in the interpreter. If
|
||||
the trace procedure does anything that could damage this result (such
|
||||
@@ -354,24 +360,8 @@ Traces on a variable are always removed whenever the variable
|
||||
is deleted; the only time \fBTCL_TRACE_DESTROYED\fR is not set is for
|
||||
a whole-array trace invoked when only a single element of an
|
||||
array is unset.
|
||||
.SH "TCL_INTERP_DESTROYED"
|
||||
.PP
|
||||
When an interpreter is destroyed, unset traces are called for
|
||||
all of its variables.
|
||||
The \fBTCL_INTERP_DESTROYED\fR bit will be set in the \fIflags\fR
|
||||
argument passed to the trace procedures.
|
||||
Trace procedures must be extremely careful in what they do if
|
||||
the \fBTCL_INTERP_DESTROYED\fR bit is set.
|
||||
It is not safe for the procedures to invoke any Tcl procedures
|
||||
on the interpreter, since its state is partially deleted.
|
||||
All that trace procedures should do under these circumstances is
|
||||
to clean up and free their own internal data structures.
|
||||
.SH BUGS
|
||||
.PP
|
||||
Tcl does not do any error checking to prevent trace procedures
|
||||
from misusing the interpreter during traces with \fBTCL_INTERP_DESTROYED\fR
|
||||
set.
|
||||
.PP
|
||||
Array traces are not yet integrated with the Tcl \fBinfo exists\fR command,
|
||||
nor is there Tcl-level access to array traces.
|
||||
.SH "SEE ALSO"
|
||||
|
||||
@@ -48,7 +48,7 @@ int
|
||||
.SH ARGUMENTS
|
||||
.AS int ch
|
||||
.AP int ch in
|
||||
The Tcl_UniChar to be examined.
|
||||
The Unicode character to be examined.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharNcasecmp, Tcl_UniCharCaseMatch, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings
|
||||
Tcl_UniChar, Tcl_UniCharToUtf, Tcl_UtfToUniChar, Tcl_UtfToChar16, Tcl_UtfToWChar, Tcl_UniCharToUtfDString, Tcl_UtfToUniCharDString, Tcl_Char16ToUtfDString, Tcl_UtfToWCharDString, Tcl_UtfToChar16DString, Tcl_UniCharLen, Tcl_UniCharNcmp, Tcl_UniCharNcasecmp, Tcl_UniCharCaseMatch, Tcl_UtfNcmp, Tcl_UtfNcasecmp, Tcl_UtfCharComplete, Tcl_NumUtfChars, Tcl_UtfFindFirst, Tcl_UtfFindLast, Tcl_UtfNext, Tcl_UtfPrev, Tcl_UniCharAtIndex, Tcl_UtfAtIndex, Tcl_UtfBackslash \- routines for manipulating UTF-8 strings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -21,29 +21,47 @@ int
|
||||
int
|
||||
\fBTcl_UtfToUniChar\fR(\fIsrc, chPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UtfToChar16\fR(\fIsrc, uPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UtfToWChar\fR(\fIsrc, wPtr\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_UniCharToUtfDString\fR(\fIuniStr, uniLength, dsPtr\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_Char16ToUtfDString\fR(\fIuStr, uniLength, dsPtr\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_WCharToUtfDString\fR(\fIwStr, uniLength, dsPtr\fR)
|
||||
.sp
|
||||
Tcl_UniChar *
|
||||
\fBTcl_UtfToUniCharDString\fR(\fIsrc, length, dsPtr\fR)
|
||||
.sp
|
||||
unsigned short *
|
||||
\fBTcl_UtfToChar16DString\fR(\fIsrc, length, dsPtr\fR)
|
||||
.sp
|
||||
wchar_t *
|
||||
\fBTcl_UtfToWCharDString\fR(\fIsrc, length, dsPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UniCharLen\fR(\fIuniStr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UniCharNcmp\fR(\fIucs, uct, numChars\fR)
|
||||
\fBTcl_UniCharNcmp\fR(\fIucs, uct, uniLength\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UniCharNcasecmp\fR(\fIucs, uct, numChars\fR)
|
||||
\fBTcl_UniCharNcasecmp\fR(\fIucs, uct, uniLength\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UniCharCaseMatch\fR(\fIuniStr, uniPattern, nocase\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UtfNcmp\fR(\fIcs, ct, numChars\fR)
|
||||
\fBTcl_UtfNcmp\fR(\fIcs, ct, length\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UtfNcasecmp\fR(\fIcs, ct, numChars\fR)
|
||||
\fBTcl_UtfNcasecmp\fR(\fIcs, ct, length\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UtfCharComplete\fR(\fIsrc, length\fR)
|
||||
@@ -63,23 +81,27 @@ const char *
|
||||
const char *
|
||||
\fBTcl_UtfPrev\fR(\fIsrc, start\fR)
|
||||
.sp
|
||||
Tcl_UniChar
|
||||
int
|
||||
\fBTcl_UniCharAtIndex\fR(\fIsrc, index\fR)
|
||||
.sp
|
||||
const char *
|
||||
\fBTcl_UtfAtIndex\fR(\fIsrc, index\fR)
|
||||
.sp
|
||||
int
|
||||
size_t
|
||||
\fBTcl_UtfBackslash\fR(\fIsrc, readPtr, dst\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "const Tcl_UniChar" *uniPattern in/out
|
||||
.AP char *buf out
|
||||
Buffer in which the UTF-8 representation of the Tcl_UniChar is stored. At most
|
||||
\fBTCL_UTF_MAX\fR bytes are stored in the buffer.
|
||||
4 bytes are stored in the buffer.
|
||||
.AP int ch in
|
||||
The Unicode character to be converted or examined.
|
||||
.AP Tcl_UniChar *chPtr out
|
||||
Filled with the Tcl_UniChar represented by the head of the UTF-8 string.
|
||||
.AP unsigned short *uPtr out
|
||||
Filled with the utf-16 represented by the head of the UTF-8 string.
|
||||
.AP wchar_t *wPtr out
|
||||
Filled with the wchar_t represented by the head of the UTF-8 string.
|
||||
.AP "const char" *src in
|
||||
Pointer to a UTF-8 string.
|
||||
.AP "const char" *cs in
|
||||
@@ -94,26 +116,33 @@ A null-terminated Unicode string.
|
||||
A null-terminated Unicode string.
|
||||
.AP "const Tcl_UniChar" *uniPattern in
|
||||
A null-terminated Unicode string.
|
||||
.AP int length in
|
||||
.AP "const unsigned short" *uStr in
|
||||
A null-terminated UTF-16 string.
|
||||
.AP "const wchar_t" *wStr in
|
||||
A null-terminated wchar_t string.
|
||||
.AP "const unsigned short" *utf16s in
|
||||
A null-terminated utf-16 string.
|
||||
.AP "const unsigned short" *utf16t in
|
||||
A null-terminated utf-16 string.
|
||||
.AP "const unsigned short" *utf16Pattern in
|
||||
A null-terminated utf-16 string.
|
||||
.AP size_t length in
|
||||
The length of the UTF-8 string in bytes (not UTF-8 characters). If
|
||||
negative, all bytes up to the first null byte are used.
|
||||
.AP int uniLength in
|
||||
The length of the Unicode string in characters. Must be greater than or
|
||||
equal to 0.
|
||||
.AP size_t uniLength in
|
||||
The length of the Unicode string in characters.
|
||||
.AP "Tcl_DString" *dsPtr in/out
|
||||
A pointer to a previously initialized \fBTcl_DString\fR.
|
||||
.AP "unsigned long" numChars in
|
||||
The number of characters to compare.
|
||||
.AP "const char" *start in
|
||||
Pointer to the beginning of a UTF-8 string.
|
||||
.AP int index in
|
||||
.AP size_t index in
|
||||
The index of a character (not byte) in the UTF-8 string.
|
||||
.AP int *readPtr out
|
||||
If non-NULL, filled with the number of bytes in the backslash sequence,
|
||||
including the backslash character.
|
||||
.AP char *dst out
|
||||
Buffer in which the bytes represented by the backslash sequence are stored.
|
||||
At most \fBTCL_UTF_MAX\fR bytes are stored in the buffer.
|
||||
At most 4 bytes are stored in the buffer.
|
||||
.AP int nocase in
|
||||
Specifies whether the match should be done case-sensitive (0) or
|
||||
case-insensitive (1).
|
||||
@@ -121,18 +150,21 @@ case-insensitive (1).
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These routines convert between UTF-8 strings and Tcl_UniChars. A
|
||||
Tcl_UniChar is a Unicode character represented as an unsigned, fixed-size
|
||||
quantity. A UTF-8 character is a Unicode character represented as
|
||||
a varying-length sequence of up to \fBTCL_UTF_MAX\fR bytes. A multibyte UTF-8
|
||||
sequence consists of a lead byte followed by some number of trail bytes.
|
||||
These routines convert between UTF-8 strings and Unicode/Utf-16 characters.
|
||||
A UTF-8 character is a Unicode character represented as a varying-length
|
||||
sequence of up to \fB4\fR bytes. A multibyte UTF-8 sequence
|
||||
consists of a lead byte followed by some number of trail bytes.
|
||||
.PP
|
||||
\fBTCL_UTF_MAX\fR is the maximum number of bytes that it takes to
|
||||
represent one Unicode character in the UTF-8 representation.
|
||||
\fBTCL_UTF_MAX\fR is the maximum number of bytes that \fBTcl_UtfToUniChar\fR
|
||||
can consume in a single call.
|
||||
.PP
|
||||
\fBTcl_UniCharToUtf\fR stores the Tcl_UniChar \fIch\fR as a UTF-8 string
|
||||
\fBTcl_UniCharToUtf\fR stores the character \fIch\fR as a UTF-8 string
|
||||
in starting at \fIbuf\fR. The return value is the number of bytes stored
|
||||
in \fIbuf\fR.
|
||||
in \fIbuf\fR. If ch is a high surrogate (range U+D800 - U+DBFF), then
|
||||
the return value will be 1 and a single byte in the range 0xF0 - 0xF4
|
||||
will be stored. If you still want to produce UTF-8 output for it (even
|
||||
though knowing it's an illegal code-point on its own), just call
|
||||
\fBTcl_UniCharToUtf\fR again specifying ch = -1.
|
||||
.PP
|
||||
\fBTcl_UtfToUniChar\fR reads one UTF-8 character starting at \fIsrc\fR
|
||||
and stores it as a Tcl_UniChar in \fI*chPtr\fR. The return value is the
|
||||
@@ -140,13 +172,15 @@ number of bytes read from \fIsrc\fR. The caller must ensure that the
|
||||
source buffer is long enough such that this routine does not run off the
|
||||
end and dereference non-existent or random memory; if the source buffer
|
||||
is known to be null-terminated, this will not happen. If the input is
|
||||
a byte in the range 0x80 - 0x9F, \fBTcl_UtfToUniChar\fR assumes the
|
||||
cp1252 encoding, stores the corresponding Tcl_UniChar in \fI*chPtr\fR
|
||||
and returns 1. If the input is otherwise
|
||||
not in proper UTF-8 format, \fBTcl_UtfToUniChar\fR will store the first
|
||||
byte of \fIsrc\fR in \fI*chPtr\fR as a Tcl_UniChar between 0x0080 and
|
||||
byte of \fIsrc\fR in \fI*chPtr\fR as a Tcl_UniChar between 0x00A0 and
|
||||
0x00FF and return 1.
|
||||
.PP
|
||||
\fBTcl_UniCharToUtfDString\fR converts the given Unicode string
|
||||
to UTF-8, storing the result in a previously initialized \fBTcl_DString\fR.
|
||||
You must specify \fIuniLength\fR, the length of the given Unicode string.
|
||||
The return value is a pointer to the UTF-8 representation of the
|
||||
Unicode string. Storage for the return value is appended to the
|
||||
end of the \fBTcl_DString\fR.
|
||||
@@ -169,7 +203,7 @@ the number of Unicode characters (not bytes) in that string.
|
||||
\fBTcl_UniCharNcmp\fR and \fBTcl_UniCharNcasecmp\fR correspond to
|
||||
\fBstrncmp\fR and \fBstrncasecmp\fR, respectively, for Unicode characters.
|
||||
They accept two null-terminated Unicode strings and the number of characters
|
||||
to compare. Both strings are assumed to be at least \fInumChars\fR characters
|
||||
to compare. Both strings are assumed to be at least \fIuniLength\fR characters
|
||||
long. \fBTcl_UniCharNcmp\fR compares the two strings character-by-character
|
||||
according to the Unicode character ordering. It returns an integer greater
|
||||
than, equal to, or less than 0 if the first string is greater than, equal
|
||||
@@ -183,7 +217,7 @@ be case sensitive and returns whether the string matches the pattern.
|
||||
.PP
|
||||
\fBTcl_UtfNcmp\fR corresponds to \fBstrncmp\fR for UTF-8 strings. It
|
||||
accepts two null-terminated UTF-8 strings and the number of characters
|
||||
to compare. (Both strings are assumed to be at least \fInumChars\fR
|
||||
to compare. (Both strings are assumed to be at least \fIlength\fR
|
||||
characters long.) \fBTcl_UtfNcmp\fR compares the two strings
|
||||
character-by-character according to the Unicode character ordering.
|
||||
It returns an integer greater than, equal to, or less than 0 if the
|
||||
@@ -200,7 +234,7 @@ of \fIlength\fR bytes is long enough to be decoded by
|
||||
\fBTcl_UtfToUniChar\fR, or 0 otherwise. This function does not guarantee
|
||||
that the UTF-8 string is properly formed. This routine is used by
|
||||
procedures that are operating on a byte at a time and need to know if a
|
||||
full Tcl_UniChar has been seen.
|
||||
full Unicode character has been seen.
|
||||
.PP
|
||||
\fBTcl_NumUtfChars\fR corresponds to \fBstrlen\fR for UTF-8 strings. It
|
||||
returns the number of Tcl_UniChars that are represented by the UTF-8 string
|
||||
@@ -208,12 +242,12 @@ returns the number of Tcl_UniChars that are represented by the UTF-8 string
|
||||
length is negative, all bytes up to the first null byte are used.
|
||||
.PP
|
||||
\fBTcl_UtfFindFirst\fR corresponds to \fBstrchr\fR for UTF-8 strings. It
|
||||
returns a pointer to the first occurrence of the Tcl_UniChar \fIch\fR
|
||||
returns a pointer to the first occurrence of the Unicode character \fIch\fR
|
||||
in the null-terminated UTF-8 string \fIsrc\fR. The null terminator is
|
||||
considered part of the UTF-8 string.
|
||||
.PP
|
||||
\fBTcl_UtfFindLast\fR corresponds to \fBstrrchr\fR for UTF-8 strings. It
|
||||
returns a pointer to the last occurrence of the Tcl_UniChar \fIch\fR
|
||||
returns a pointer to the last occurrence of the Unicode character \fIch\fR
|
||||
in the null-terminated UTF-8 string \fIsrc\fR. The null terminator is
|
||||
considered part of the UTF-8 string.
|
||||
.PP
|
||||
@@ -246,21 +280,22 @@ byte \fIsrc[0]\fR nor the byte \fIstart[-1]\fR nor the byte
|
||||
\fIsrc[-\fBTCL_UTF_MAX\fI-1]\fR.
|
||||
.PP
|
||||
\fBTcl_UniCharAtIndex\fR corresponds to a C string array dereference or the
|
||||
Pascal Ord() function. It returns the Tcl_UniChar represented at the
|
||||
Pascal Ord() function. It returns the Unicode character represented at the
|
||||
specified character (not byte) \fIindex\fR in the UTF-8 string
|
||||
\fIsrc\fR. The source string must contain at least \fIindex\fR
|
||||
characters. Behavior is undefined if a negative \fIindex\fR is given.
|
||||
characters. If \fIindex\fR is TCL_INDEX_NONE or \fIindex\fR points
|
||||
to the second half of a surrogate pair, it returns -1.
|
||||
.PP
|
||||
\fBTcl_UtfAtIndex\fR returns a pointer to the specified character (not
|
||||
byte) \fIindex\fR in the UTF-8 string \fIsrc\fR. The source string must
|
||||
contain at least \fIindex\fR characters. This is equivalent to calling
|
||||
\fBTcl_UtfToUniChar\fR \fIindex\fR times. If a negative \fIindex\fR is given,
|
||||
\fBTcl_UtfToUniChar\fR \fIindex\fR times. If \fIindex\fR is TCL_INDEX_NONE,
|
||||
the return pointer points to the first character in the source string.
|
||||
.PP
|
||||
\fBTcl_UtfBackslash\fR is a utility procedure used by several of the Tcl
|
||||
commands. It parses a backslash sequence and stores the properly formed
|
||||
UTF-8 character represented by the backslash sequence in the output
|
||||
buffer \fIdst\fR. At most \fBTCL_UTF_MAX\fR bytes are stored in the buffer.
|
||||
buffer \fIdst\fR. At most 4 bytes are stored in the buffer.
|
||||
\fBTcl_UtfBackslash\fR modifies \fI*readPtr\fR to contain the number
|
||||
of bytes in the backslash sequence, including the backslash character.
|
||||
The return value is the number of bytes stored in the output buffer.
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
'\"
|
||||
'\" Copyright (c) 2018 Donal K. Fellows
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH abstract n 0.3 TclOO "TclOO Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
oo::abstract \- a class that does not allow direct instances of itself
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
package require TclOO
|
||||
|
||||
\fBoo::abstract\fI method \fR?\fIarg ...\fR?
|
||||
.fi
|
||||
.SH "CLASS HIERARCHY"
|
||||
.nf
|
||||
\fBoo::object\fR
|
||||
\(-> \fBoo::class\fR
|
||||
\(-> \fBoo::abstract\fR
|
||||
.fi
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
Abstract classes are classes that can contain definitions, but which cannot be
|
||||
directly manufactured; they are intended to only ever be inherited from and
|
||||
instantiated indirectly. The characteristic methods of \fBoo::class\fR
|
||||
(\fBcreate\fR and \fBnew\fR) are not exported by an instance of
|
||||
\fBoo::abstract\fR.
|
||||
.PP
|
||||
Note that \fBoo::abstract\fR is not itself an instance of \fBoo::abstract\fR.
|
||||
.SS CONSTRUCTOR
|
||||
The \fBoo::abstract\fR class does not define an explicit constructor; this
|
||||
means that it is effectively the same as the constructor of the
|
||||
\fBoo::class\fR class.
|
||||
.SS DESTRUCTOR
|
||||
The \fBoo::abstract\fR class does not define an explicit destructor;
|
||||
destroying an instance of it is just like destroying an ordinary class (and
|
||||
will destroy all its subclasses).
|
||||
.SS "EXPORTED METHODS"
|
||||
The \fBoo::abstract\fR class defines no new exported methods.
|
||||
.SS "NON-EXPORTED METHODS"
|
||||
The \fBoo::abstract\fR class explicitly states that \fBcreate\fR,
|
||||
\fBcreateWithNamespace\fR, and \fBnew\fR are unexported.
|
||||
.SH EXAMPLES
|
||||
.PP
|
||||
This example defines a simple class hierarchy and creates a new instance of
|
||||
it. It then invokes a method of the object before destroying the hierarchy and
|
||||
showing that the destruction is transitive.
|
||||
.PP
|
||||
.CS
|
||||
\fBoo::abstract\fR create fruit {
|
||||
method eat {} {
|
||||
puts "yummy!"
|
||||
}
|
||||
}
|
||||
oo::class create banana {
|
||||
superclass fruit
|
||||
method peel {} {
|
||||
puts "skin now off"
|
||||
}
|
||||
}
|
||||
set b [banana \fBnew\fR]
|
||||
$b peel \fI\(-> prints 'skin now off'\fR
|
||||
$b eat \fI\(-> prints 'yummy!'\fR
|
||||
set f [fruit new] \fI\(-> error 'unknown method "new"...'\fR
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
oo::define(n), oo::object(n)
|
||||
.SH KEYWORDS
|
||||
abstract class, class, metaclass, object
|
||||
.\" Local variables:
|
||||
.\" mode: nroff
|
||||
.\" fill-column: 78
|
||||
.\" End:
|
||||
+9
-3
@@ -20,6 +20,11 @@ Append all of the \fIvalue\fR arguments to the current value
|
||||
of variable \fIvarName\fR. If \fIvarName\fR does not exist,
|
||||
it is given a value equal to the concatenation of all the
|
||||
\fIvalue\fR arguments.
|
||||
.VS TIP508
|
||||
If \fIvarName\fR indicate an element that does not exist of an array that has
|
||||
a default value set, the concatenation of the default value and all the
|
||||
\fIvalue\fR arguments will be stored in the array element.
|
||||
.VE TIP508
|
||||
The result of this command is the new value stored in variable
|
||||
\fIvarName\fR.
|
||||
This command provides an efficient way to build up long
|
||||
@@ -44,6 +49,7 @@ puts $var
|
||||
concat(n), lappend(n)
|
||||
.SH KEYWORDS
|
||||
append, variable
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" End:
|
||||
.\" Local variables:
|
||||
.\" mode: nroff
|
||||
.\" fill-column: 78
|
||||
.\" End:
|
||||
|
||||
+61
-1
@@ -5,7 +5,7 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH array n 8.3 Tcl "Tcl Built-In Commands"
|
||||
.TH array n 8.7 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
@@ -36,6 +36,53 @@ with an empty name, since the return value from
|
||||
\fBarray nextelement\fR will not indicate whether the search
|
||||
has been completed.
|
||||
.TP
|
||||
\fBarray default \fIsubcommand arrayName args...\fR
|
||||
.VS TIP508
|
||||
Manages the default value of the array. Arrays initially have no default
|
||||
value, but this command allows you to set one; the default value will be
|
||||
returned when reading from an element of the array \fIarrayName\fR if the read
|
||||
would otherwise result in an error. Note that this may cause the \fBappend\fR,
|
||||
\fBdict\fR, \fBincr\fR and \fBlappend\fR commands to change their behavior in
|
||||
relation to non-existing array elements.
|
||||
.RS
|
||||
.PP
|
||||
The \fIsubcommand\fR argument controls what exact operation will be performed
|
||||
on the default value of \fIarrayName\fR. Supported \fIsubcommand\fRs are:
|
||||
.VE TIP508
|
||||
.TP
|
||||
\fBarray default exists \fIarrayName\fR
|
||||
.VS TIP508
|
||||
This returns a boolean value indicating whether a default value has been set
|
||||
for the array \fIarrayName\fR. Returns a false value if \fIarrayName\fR does
|
||||
not exist. Raises an error if \fIarrayName\fR is an existing variable that is
|
||||
not an array.
|
||||
.VE TIP508
|
||||
.TP
|
||||
\fBarray default get \fIarrayName\fR
|
||||
.VS TIP508
|
||||
This returns the current default value for the array \fIarrayName\fR. Raises
|
||||
an error if \fIarrayName\fR is an existing variable that is not an array, or
|
||||
if \fIarrayName\fR is an array without a default value.
|
||||
.VE TIP508
|
||||
.TP
|
||||
\fBarray default set \fIarrayName value\fR
|
||||
.VS TIP508
|
||||
This sets the default value for the array \fIarrayName\fR to \fIvalue\fR.
|
||||
Returns the empty string. Raises an error if \fIarrayName\fR is an existing
|
||||
variable that is not an array, or if \fIarrayName\fR is an illegal name for an
|
||||
array. If \fIarrayName\fR does not currently exist, it is created as an empty
|
||||
array as well as having its default value set.
|
||||
.VE TIP508
|
||||
.TP
|
||||
\fBarray default unset \fIarrayName\fR
|
||||
.VS TIP508
|
||||
This removes the default value for the array \fIarrayName\fR and returns the
|
||||
empty string. Does nothing if \fIarrayName\fR does not have a default
|
||||
value. Raises an error if \fIarrayName\fR is an existing variable that is not
|
||||
an array.
|
||||
.VE TIP508
|
||||
.RE
|
||||
.TP
|
||||
\fBarray donesearch \fIarrayName searchId\fR
|
||||
This command terminates an array search and destroys all the
|
||||
state associated with that search. \fISearchId\fR indicates
|
||||
@@ -47,6 +94,15 @@ been the return value from a previous invocation of
|
||||
Returns 1 if \fIarrayName\fR is an array variable, 0 if there
|
||||
is no variable by that name or if it is a scalar variable.
|
||||
.TP
|
||||
\fBarray for {\fIkeyVariable valueVariable\fB} \fIarrayName body\fP
|
||||
The first argument is a two element list of variable names for the
|
||||
key and value of each entry in the array. The second argument is the
|
||||
array name to iterate over. The third argument is the body to execute
|
||||
for each key and value returned.
|
||||
The ordering of the returned keys is undefined.
|
||||
If an array element is deleted or a new array element is inserted during
|
||||
the \fIarray for\fP process, the command will terminate with an error.
|
||||
.TP
|
||||
\fBarray get \fIarrayName\fR ?\fIpattern\fR?
|
||||
Returns a list containing pairs of elements. The first
|
||||
element in each pair is the name of an element in \fIarrayName\fR
|
||||
@@ -185,3 +241,7 @@ foreach color [lsort [\fBarray names\fR colorcount]] {
|
||||
list(n), string(n), variable(n), trace(n), foreach(n)
|
||||
.SH KEYWORDS
|
||||
array, element names, search
|
||||
.\" Local variables:
|
||||
.\" mode: nroff
|
||||
.\" fill-column: 78
|
||||
.\" End:
|
||||
|
||||
+272
-90
@@ -12,12 +12,10 @@
|
||||
.SH NAME
|
||||
binary \- Insert and extract fields from binary strings
|
||||
.SH SYNOPSIS
|
||||
.VS 8.6
|
||||
\fBbinary decode \fIformat\fR ?\fI\-option value ...\fR? \fIdata\fR
|
||||
.br
|
||||
\fBbinary encode \fIformat\fR ?\fI\-option value ...\fR? \fIdata\fR
|
||||
.br
|
||||
.VE 8.6
|
||||
\fBbinary format \fIformatString \fR?\fIarg arg ...\fR?
|
||||
.br
|
||||
\fBbinary scan \fIstring formatString \fR?\fIvarName varName ...\fR?
|
||||
@@ -31,11 +29,9 @@ architecture, it might produce an 8-byte binary string consisting of
|
||||
two 4-byte integers, one for each of the numbers. The subcommand
|
||||
\fBbinary scan\fR, does the opposite: it extracts data
|
||||
from a binary string and returns it as ordinary Tcl string values.
|
||||
.VS 8.6
|
||||
The \fBbinary encode\fR and \fBbinary decode\fR subcommands convert
|
||||
binary data to or from string encodings such as base64 (used in MIME
|
||||
messages for example).
|
||||
.VE 8.6
|
||||
.PP
|
||||
Note that other operations on binary data, such as taking a subsequence of it,
|
||||
getting its length, or reinterpreting it as a string in some encoding, are
|
||||
@@ -44,7 +40,6 @@ done by other Tcl commands (respectively \fBstring range\fR,
|
||||
binary string in Tcl is merely one where all the characters it contains are in
|
||||
the range \eu0000\-\eu00FF.
|
||||
.SH "BINARY ENCODE AND DECODE"
|
||||
.VS 8.6
|
||||
.PP
|
||||
When encoding binary data as a readable string, the starting binary data is
|
||||
passed to the \fBbinary encode\fR command, together with the name of the
|
||||
@@ -135,7 +130,6 @@ between the encoder and decoder.
|
||||
Note that neither the encoder nor the decoder handle the header and footer of
|
||||
the uuencode format.
|
||||
.RE
|
||||
.VE 8.6
|
||||
.SH "BINARY FORMAT"
|
||||
.PP
|
||||
The \fBbinary format\fR command generates a binary string whose layout
|
||||
@@ -150,7 +144,9 @@ Most field specifiers consume one argument to obtain the value to be
|
||||
formatted. The type character specifies how the value is to be
|
||||
formatted. The \fIcount\fR typically indicates how many items of the
|
||||
specified type are taken from the value. If present, the \fIcount\fR
|
||||
is a non-negative decimal integer or \fB*\fR, which normally indicates
|
||||
is a non-negative decimal integer or
|
||||
.QW \fB*\fR ,
|
||||
which normally indicates
|
||||
that all of the items in the value are to be used. If the number of
|
||||
arguments does not match the number of fields in the format string
|
||||
that consume arguments, then an error is generated. The flag character
|
||||
@@ -158,6 +154,7 @@ is ignored for \fBbinary format\fR.
|
||||
.PP
|
||||
Here is a small example to clarify the relation between the field
|
||||
specifiers and the arguments:
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR d3d {1.0 2.0 3.0 4.0} 0.1
|
||||
.CE
|
||||
@@ -185,29 +182,63 @@ not part of the ISO 8859\-1 character set.)
|
||||
If \fIarg\fR has fewer than \fIcount\fR bytes, then additional zero
|
||||
bytes are used to pad out the field. If \fIarg\fR is longer than the
|
||||
specified length, the extra characters will be ignored. If
|
||||
\fIcount\fR is \fB*\fR, then all of the bytes in \fIarg\fR will be
|
||||
\fIcount\fR is
|
||||
.QW \fB*\fR ,
|
||||
then all of the bytes in \fIarg\fR will be
|
||||
formatted. If \fIcount\fR is omitted, then one character will be
|
||||
formatted. For example,
|
||||
formatted. For example, the command:
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR a7a*a alpha bravo charlie
|
||||
.CE
|
||||
will return a string equivalent to \fBalpha\e000\e000bravoc\fR,
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fBalpha\e000\e000bravoc\fR
|
||||
.CE
|
||||
.PP
|
||||
the command:
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR a* [encoding convertto utf-8 \eu20ac]
|
||||
.CE
|
||||
will return a string equivalent to \fB\e342\e202\e254\fR (which is the
|
||||
UTF-8 byte sequence for a Euro-currency character) and
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\e342\e202\e254\fR
|
||||
.CE
|
||||
.PP
|
||||
(which is the
|
||||
UTF-8 byte sequence for a Euro-currency character), and the command:
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR a* [encoding convertto iso8859-15 \eu20ac]
|
||||
.CE
|
||||
will return a string equivalent to \fB\e244\fR (which is the ISO
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\e244\fR
|
||||
.CE
|
||||
.PP
|
||||
(which is the ISO
|
||||
8859\-15 byte sequence for a Euro-currency character). Contrast these
|
||||
last two with:
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR a* \eu20ac
|
||||
.CE
|
||||
which returns a string equivalent to \fB\e254\fR (i.e. \fB\exac\fR) by
|
||||
.PP
|
||||
which returns a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\e254\fR
|
||||
.CE
|
||||
.PP
|
||||
(i.e. \fB\exac\fR) by
|
||||
truncating the high-bits of the character, and which is probably not
|
||||
what is desired.
|
||||
.RE
|
||||
@@ -215,42 +246,62 @@ what is desired.
|
||||
This form is the same as \fBa\fR except that spaces are used for
|
||||
padding instead of nulls. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR A6A*A alpha bravo charlie
|
||||
.CE
|
||||
will return \fBalpha bravoc\fR.
|
||||
.PP
|
||||
will return
|
||||
.PP
|
||||
.CS
|
||||
\fBalpha bravoc\fR
|
||||
.CE
|
||||
.RE
|
||||
.IP \fBb\fR 5
|
||||
Stores a string of \fIcount\fR binary digits in low-to-high order
|
||||
within each byte in the output string. \fIArg\fR must contain a
|
||||
within each byte in the output binary string. \fIArg\fR must contain a
|
||||
sequence of \fB1\fR and \fB0\fR characters. The resulting bytes are
|
||||
emitted in first to last order with the bits being formatted in
|
||||
low-to-high order within each byte. If \fIarg\fR has fewer than
|
||||
\fIcount\fR digits, then zeros will be used for the remaining bits.
|
||||
If \fIarg\fR has more than the specified number of digits, the extra
|
||||
digits will be ignored. If \fIcount\fR is \fB*\fR, then all of the
|
||||
digits will be ignored. If \fIcount\fR is
|
||||
.QW \fB*\fR ,
|
||||
then all of the
|
||||
digits in \fIarg\fR will be formatted. If \fIcount\fR is omitted,
|
||||
then one digit will be formatted. If the number of bits formatted
|
||||
does not end at a byte boundary, the remaining bits of the last byte
|
||||
will be zeros. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR b5b* 11100 111000011010
|
||||
.CE
|
||||
will return a string equivalent to \fB\ex07\ex87\ex05\fR.
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\ex07\ex87\ex05\fR
|
||||
.CE
|
||||
.RE
|
||||
.IP \fBB\fR 5
|
||||
This form is the same as \fBb\fR except that the bits are stored in
|
||||
high-to-low order within each byte. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR B5B* 11100 111000011010
|
||||
.CE
|
||||
will return a string equivalent to \fB\exe0\exe1\exa0\fR.
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\exe0\exe1\exa0\fR
|
||||
.CE
|
||||
.RE
|
||||
.IP \fBH\fR 5
|
||||
Stores a string of \fIcount\fR hexadecimal digits in high-to-low
|
||||
within each byte in the output string. \fIArg\fR must contain a
|
||||
within each byte in the output binary string. \fIArg\fR must contain a
|
||||
sequence of characters in the set
|
||||
.QW 0123456789abcdefABCDEF .
|
||||
The resulting bytes are emitted in first to last order with the hex digits
|
||||
@@ -258,43 +309,66 @@ being formatted in high-to-low order within each byte. If \fIarg\fR
|
||||
has fewer than \fIcount\fR digits, then zeros will be used for the
|
||||
remaining digits. If \fIarg\fR has more than the specified number of
|
||||
digits, the extra digits will be ignored. If \fIcount\fR is
|
||||
\fB*\fR, then all of the digits in \fIarg\fR will be formatted. If
|
||||
.QW \fB*\fR ,
|
||||
then all of the digits in \fIarg\fR will be formatted. If
|
||||
\fIcount\fR is omitted, then one digit will be formatted. If the
|
||||
number of digits formatted does not end at a byte boundary, the
|
||||
remaining bits of the last byte will be zeros. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR H3H*H2 ab DEF 987
|
||||
.CE
|
||||
will return a string equivalent to \fB\exab\ex00\exde\exf0\ex98\fR.
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\exab\ex00\exde\exf0\ex98\fR
|
||||
.CE
|
||||
.RE
|
||||
.IP \fBh\fR 5
|
||||
This form is the same as \fBH\fR except that the digits are stored in
|
||||
low-to-high order within each byte. This is seldom required. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR h3h*h2 AB def 987
|
||||
.CE
|
||||
will return a string equivalent to \fB\exba\ex00\exed\ex0f\ex89\fR.
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\exba\ex00\exed\ex0f\ex89\fR
|
||||
.CE
|
||||
.RE
|
||||
.IP \fBc\fR 5
|
||||
Stores one or more 8-bit integer values in the output string. If no
|
||||
\fIcount\fR is specified, then \fIarg\fR must consist of an integer
|
||||
value. If \fIcount\fR is specified, \fIarg\fR must consist of a list
|
||||
containing at least that many integers. The low-order 8 bits of each integer
|
||||
are stored as a one-byte value at the cursor position. If \fIcount\fR
|
||||
is \fB*\fR, then all of the integers in the list are formatted. If the
|
||||
are stored as a one-byte value at the cursor position. If \fIcount\fR is
|
||||
.QW \fB*\fR ,
|
||||
then all of the integers in the list are formatted. If the
|
||||
number of elements in the list is greater
|
||||
than \fIcount\fR, then the extra elements are ignored. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR c3cc* {3 -3 128 1} 260 {2 5}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
\fB\ex03\exfd\ex80\ex04\ex02\ex05\fR, whereas
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\ex03\exfd\ex80\ex04\ex02\ex05\fR
|
||||
.CE
|
||||
.PP
|
||||
whereas:
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR c {2 5}
|
||||
.CE
|
||||
.PP
|
||||
will generate an error.
|
||||
.RE
|
||||
.IP \fBs\fR 5
|
||||
@@ -304,22 +378,32 @@ low-order 16-bits of each integer are stored as a two-byte value at
|
||||
the cursor position with the least significant byte stored first. For
|
||||
example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR s3 {3 -3 258 1}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
\fB\ex03\ex00\exfd\exff\ex02\ex01\fR.
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\ex03\ex00\exfd\exff\ex02\ex01\fR
|
||||
.CE
|
||||
.RE
|
||||
.IP \fBS\fR 5
|
||||
This form is the same as \fBs\fR except that it stores one or more
|
||||
16-bit integers in big-endian byte order in the output string. For
|
||||
example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR S3 {3 -3 258 1}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
\fB\ex00\ex03\exff\exfd\ex01\ex02\fR.
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\ex00\ex03\exff\exfd\ex01\ex02\fR
|
||||
.CE
|
||||
.RE
|
||||
.IP \fBt\fR 5
|
||||
This form (mnemonically \fItiny\fR) is the same as \fBs\fR and \fBS\fR
|
||||
@@ -334,22 +418,32 @@ low-order 32-bits of each integer are stored as a four-byte value at
|
||||
the cursor position with the least significant byte stored first. For
|
||||
example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR i3 {3 -3 65536 1}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\ex03\ex00\ex00\ex00\exfd\exff\exff\exff\ex00\ex00\ex01\ex00\fR
|
||||
.CE
|
||||
.RE
|
||||
.IP \fBI\fR 5
|
||||
This form is the same as \fBi\fR except that it stores one or more one
|
||||
or more 32-bit integers in big-endian byte order in the output string.
|
||||
For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR I3 {3 -3 65536 1}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\ex00\ex00\ex00\ex03\exff\exff\exff\exfd\ex00\ex01\ex00\ex00\fR
|
||||
.CE
|
||||
.RE
|
||||
.IP \fBn\fR 5
|
||||
This form (mnemonically \fInumber\fR or \fInormal\fR) is the same as
|
||||
@@ -365,20 +459,24 @@ low-order 64-bits of each integer are stored as an eight-byte value at
|
||||
the cursor position with the least significant byte stored first. For
|
||||
example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR w 7810179016327718216
|
||||
.CE
|
||||
will return the string \fBHelloTcl\fR
|
||||
.PP
|
||||
will return the binary string \fBHelloTcl\fR.
|
||||
.RE
|
||||
.IP \fBW\fR 5
|
||||
This form is the same as \fBw\fR except that it stores one or more one
|
||||
or more 64-bit integers in big-endian byte order in the output string.
|
||||
For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR Wc 4785469626960341345 110
|
||||
.CE
|
||||
will return the string \fBBigEndian\fR
|
||||
.PP
|
||||
will return the binary string \fBBigEndian\fR
|
||||
.RE
|
||||
.IP \fBm\fR 5
|
||||
This form (mnemonically the mirror of \fBw\fR) is the same as \fBw\fR
|
||||
@@ -401,11 +499,16 @@ double-precision floating point numbers internally, there may be some
|
||||
loss of precision in the conversion to single-precision. For example,
|
||||
on a Windows system running on an Intel Pentium processor,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR f2 {1.6 3.4}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
\fB\excd\excc\excc\ex3f\ex9a\ex99\ex59\ex40\fR.
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\excd\excc\excc\ex3f\ex9a\ex99\ex59\ex40\fR
|
||||
.CE
|
||||
.RE
|
||||
.IP \fBr\fR 5
|
||||
This form (mnemonically \fIreal\fR) is the same as \fBf\fR except that
|
||||
@@ -422,11 +525,16 @@ or more double-precision floating point numbers in the machine's native
|
||||
representation in the output string. For example, on a
|
||||
Windows system running on an Intel Pentium processor,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR d1 {1.6}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
\fB\ex9a\ex99\ex99\ex99\ex99\ex99\exf9\ex3f\fR.
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fB\ex9a\ex99\ex99\ex99\ex99\ex99\exf9\ex3f\fR
|
||||
.CE
|
||||
.RE
|
||||
.IP \fBq\fR 5
|
||||
This form (mnemonically the mirror of \fBd\fR) is the same as \fBd\fR
|
||||
@@ -439,26 +547,37 @@ This form is the same as \fBq\fR except that it stores the
|
||||
double-precision floating point numbers in big-endian order.
|
||||
.IP \fBx\fR 5
|
||||
Stores \fIcount\fR null bytes in the output string. If \fIcount\fR is
|
||||
not specified, stores one null byte. If \fIcount\fR is \fB*\fR,
|
||||
not specified, stores one null byte. If \fIcount\fR is
|
||||
.QW \fB*\fR ,
|
||||
generates an error. This type does not consume an argument. For
|
||||
example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR a3xa3x2a3 abc def ghi
|
||||
.CE
|
||||
will return a string equivalent to \fBabc\e000def\e000\e000ghi\fR.
|
||||
.PP
|
||||
will return a binary string equivalent to:
|
||||
.PP
|
||||
.CS
|
||||
\fBabc\e000def\e000\e000ghi\fR
|
||||
.CE
|
||||
.RE
|
||||
.IP \fBX\fR 5
|
||||
Moves the cursor back \fIcount\fR bytes in the output string. If
|
||||
\fIcount\fR is \fB*\fR or is larger than the current cursor position,
|
||||
\fIcount\fR is
|
||||
.QW \fB*\fR
|
||||
or is larger than the current cursor position,
|
||||
then the cursor is positioned at location 0 so that the next byte
|
||||
stored will be the first byte in the result string. If \fIcount\fR is
|
||||
omitted then the cursor is moved back one byte. This type does not
|
||||
consume an argument. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR a3X*a3X2a3 abc def ghi
|
||||
.CE
|
||||
.PP
|
||||
will return \fBdghi\fR.
|
||||
.RE
|
||||
.IP \fB@\fR 5
|
||||
@@ -467,14 +586,22 @@ specified by \fIcount\fR. Position 0 refers to the first byte in the
|
||||
output string. If \fIcount\fR refers to a position beyond the last
|
||||
byte stored so far, then null bytes will be placed in the uninitialized
|
||||
locations and the cursor will be placed at the specified location. If
|
||||
\fIcount\fR is \fB*\fR, then the cursor is moved to the current end of
|
||||
\fIcount\fR is
|
||||
.QW \fB*\fR ,
|
||||
then the cursor is moved to the current end of
|
||||
the output string. If \fIcount\fR is omitted, then an error will be
|
||||
generated. This type does not consume an argument. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary format\fR a5@2a1@*a3@10a1 abcde f ghi j
|
||||
.CE
|
||||
will return \fBabfdeghi\e000\e000j\fR.
|
||||
.PP
|
||||
will return
|
||||
.PP
|
||||
.CS
|
||||
\fBabfdeghi\e000\e000j\fR
|
||||
.CE
|
||||
.RE
|
||||
.SH "BINARY SCAN"
|
||||
.PP
|
||||
@@ -496,8 +623,9 @@ argument to obtain the variable into which the scanned values should
|
||||
be placed. The type character specifies how the binary data is to be
|
||||
interpreted. The \fIcount\fR typically indicates how many items of
|
||||
the specified type are taken from the data. If present, the
|
||||
\fIcount\fR is a non-negative decimal integer or \fB*\fR, which
|
||||
normally indicates that all of the remaining items in the data are to
|
||||
\fIcount\fR is a non-negative decimal integer or
|
||||
.QW \fB*\fR ,
|
||||
which normally indicates that all of the remaining items in the data are to
|
||||
be used. If there are not enough bytes left after the current cursor
|
||||
position to satisfy the current field specifier, then the
|
||||
corresponding variable is left untouched and \fBbinary scan\fR returns
|
||||
@@ -511,6 +639,7 @@ is accepted for all field types but is ignored for non-integer fields.
|
||||
A similar example as with \fBbinary format\fR should explain the
|
||||
relation between field specifiers and arguments in case of the binary
|
||||
scan subcommand:
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR $bytes s3s first second
|
||||
.CE
|
||||
@@ -522,12 +651,15 @@ If \fIbytes\fR contains fewer than 8 bytes (i.e. four 2-byte
|
||||
integers), no assignment to \fIsecond\fR will be made, and if
|
||||
\fIbytes\fR contains fewer than 6 bytes (i.e. three 2-byte integers),
|
||||
no assignment to \fIfirst\fR will be made. Hence:
|
||||
.PP
|
||||
.CS
|
||||
puts [\fBbinary scan\fR abcdefg s3s first second]
|
||||
puts $first
|
||||
puts $second
|
||||
.CE
|
||||
.PP
|
||||
will print (assuming neither variable is set previously):
|
||||
.PP
|
||||
.CS
|
||||
1
|
||||
25185 25699 26213
|
||||
@@ -539,14 +671,17 @@ It is \fIimportant\fR to note that the \fBc\fR, \fBs\fR, and \fBS\fR
|
||||
long data size values. In doing this, values that have their high
|
||||
bit set (0x80 for chars, 0x8000 for shorts, 0x80000000 for ints),
|
||||
will be sign extended. Thus the following will occur:
|
||||
.PP
|
||||
.CS
|
||||
set signShort [\fBbinary format\fR s1 0x8000]
|
||||
\fBbinary scan\fR $signShort s1 val; \fI# val == 0xFFFF8000\fR
|
||||
.CE
|
||||
.PP
|
||||
If you require unsigned values you can include the
|
||||
.QW u
|
||||
flag character following
|
||||
the field type. For example, to read an unsigned short value:
|
||||
.PP
|
||||
.CS
|
||||
set signShort [\fBbinary format\fR s1 0x8000]
|
||||
\fBbinary scan\fR $signShort su1 val; \fI# val == 0x00008000\fR
|
||||
@@ -557,8 +692,9 @@ reading bytes from the current position. The cursor is initially
|
||||
at position 0 at the beginning of the data. The type may be any one of
|
||||
the following characters:
|
||||
.IP \fBa\fR 5
|
||||
The data is a byte string of length \fIcount\fR. If \fIcount\fR
|
||||
is \fB*\fR, then all of the remaining bytes in \fIstring\fR will be
|
||||
The data is a byte string of length \fIcount\fR. If \fIcount\fR is
|
||||
.QW \fB*\fR ,
|
||||
then all of the remaining bytes in \fIstring\fR will be
|
||||
scanned into the variable. If \fIcount\fR is omitted, then one
|
||||
byte will be scanned.
|
||||
All bytes scanned will be interpreted as being characters in the
|
||||
@@ -567,24 +703,30 @@ needed if the string is not a binary string or a string encoded in ISO
|
||||
8859\-1.
|
||||
For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR abcde\e000fghi a6a10 var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB1\fR with the string equivalent to \fBabcde\e000\fR
|
||||
stored in \fIvar1\fR and \fIvar2\fR left unmodified, and
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \e342\e202\e254 a* var1
|
||||
set var2 [encoding convertfrom utf-8 $var1]
|
||||
.CE
|
||||
.PP
|
||||
will store a Euro-currency character in \fIvar2\fR.
|
||||
.RE
|
||||
.IP \fBA\fR 5
|
||||
This form is the same as \fBa\fR, except trailing blanks and nulls are stripped from
|
||||
the scanned value before it is stored in the variable. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR "abc efghi \e000" A* var1
|
||||
.CE
|
||||
.PP
|
||||
will return \fB1\fR with \fBabc efghi\fR stored in \fIvar1\fR.
|
||||
.RE
|
||||
.IP \fBb\fR 5
|
||||
@@ -595,13 +737,16 @@ and
|
||||
.QW 0
|
||||
characters. The data bytes are scanned in first to last order with
|
||||
the bits being taken in low-to-high order within each byte. Any extra
|
||||
bits in the last byte are ignored. If \fIcount\fR is \fB*\fR, then
|
||||
all of the remaining bits in \fIstring\fR will be scanned. If
|
||||
bits in the last byte are ignored. If \fIcount\fR is
|
||||
.QW \fB*\fR ,
|
||||
then all of the remaining bits in \fIstring\fR will be scanned. If
|
||||
\fIcount\fR is omitted, then one bit will be scanned. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \ex07\ex87\ex05 b5b* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB11100\fR stored in \fIvar1\fR and
|
||||
\fB1110000110100000\fR stored in \fIvar2\fR.
|
||||
.RE
|
||||
@@ -609,9 +754,11 @@ will return \fB2\fR with \fB11100\fR stored in \fIvar1\fR and
|
||||
This form is the same as \fBb\fR, except the bits are taken in
|
||||
high-to-low order within each byte. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \ex70\ex87\ex05 B5B* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB01110\fR stored in \fIvar1\fR and
|
||||
\fB1000011100000101\fR stored in \fIvar2\fR.
|
||||
.RE
|
||||
@@ -622,13 +769,16 @@ high-to-low order represented as a sequence of characters in the set
|
||||
The data bytes are scanned in first to last
|
||||
order with the hex digits being taken in high-to-low order within each
|
||||
byte. Any extra bits in the last byte are ignored. If \fIcount\fR is
|
||||
\fB*\fR, then all of the remaining hex digits in \fIstring\fR will be
|
||||
.QW \fB*\fR ,
|
||||
then all of the remaining hex digits in \fIstring\fR will be
|
||||
scanned. If \fIcount\fR is omitted, then one hex digit will be
|
||||
scanned. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \ex07\exC6\ex05\ex1f\ex34 H3H* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB07c\fR stored in \fIvar1\fR and
|
||||
\fB051f34\fR stored in \fIvar2\fR.
|
||||
.RE
|
||||
@@ -636,9 +786,11 @@ will return \fB2\fR with \fB07c\fR stored in \fIvar1\fR and
|
||||
This form is the same as \fBH\fR, except the digits are taken in
|
||||
reverse (low-to-high) order within each byte. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \ex07\ex86\ex05\ex12\ex34 h3h* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB706\fR stored in \fIvar1\fR and
|
||||
\fB502143\fR stored in \fIvar2\fR.
|
||||
.PP
|
||||
@@ -647,135 +799,151 @@ multiple bytes in order should use the \fBH\fR format.
|
||||
.RE
|
||||
.IP \fBc\fR 5
|
||||
The data is turned into \fIcount\fR 8-bit signed integers and stored
|
||||
in the corresponding variable as a list. If \fIcount\fR is \fB*\fR,
|
||||
in the corresponding variable as a list, or as unsigned if \fBu\fR is placed
|
||||
immediately after the \fBc\fR. If \fIcount\fR is
|
||||
.QW \fB*\fR ,
|
||||
then all of the remaining bytes in \fIstring\fR will be scanned. If
|
||||
\fIcount\fR is omitted, then one 8-bit integer will be scanned. For
|
||||
example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \ex07\ex86\ex05 c2c* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB7 -122\fR stored in \fIvar1\fR and \fB5\fR
|
||||
stored in \fIvar2\fR. Note that the integers returned are signed, but
|
||||
they can be converted to unsigned 8-bit quantities using an expression
|
||||
like:
|
||||
.CS
|
||||
set num [expr { $num & 0xFF }]
|
||||
.CE
|
||||
stored in \fIvar2\fR. Note that the integers returned are signed unless
|
||||
\fBcu\fR in place of \fBc\fR.
|
||||
.RE
|
||||
.IP \fBs\fR 5
|
||||
The data is interpreted as \fIcount\fR 16-bit signed integers
|
||||
represented in little-endian byte order. The integers are stored in
|
||||
the corresponding variable as a list. If \fIcount\fR is \fB*\fR, then
|
||||
all of the remaining bytes in \fIstring\fR will be scanned. If
|
||||
represented in little-endian byte order, or as unsigned if \fBu\fR is placed
|
||||
immediately after the \fBs\fR. The integers are stored in
|
||||
the corresponding variable as a list. If \fIcount\fR is
|
||||
.QW \fB*\fR ,
|
||||
then all of the remaining bytes in \fIstring\fR will be scanned. If
|
||||
\fIcount\fR is omitted, then one 16-bit integer will be scanned. For
|
||||
example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \ex05\ex00\ex07\ex00\exf0\exff s2s* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB5 7\fR stored in \fIvar1\fR and \fB\-16\fR
|
||||
stored in \fIvar2\fR. Note that the integers returned are signed, but
|
||||
they can be converted to unsigned 16-bit quantities using an expression
|
||||
like:
|
||||
.CS
|
||||
set num [expr { $num & 0xFFFF }]
|
||||
.CE
|
||||
stored in \fIvar2\fR. Note that the integers returned are signed unless
|
||||
\fBsu\fR is used in place of \fBs\fR.
|
||||
.RE
|
||||
.IP \fBS\fR 5
|
||||
This form is the same as \fBs\fR except that the data is interpreted
|
||||
as \fIcount\fR 16-bit signed integers represented in big-endian byte
|
||||
as \fIcount\fR 16-bit integers represented in big-endian byte
|
||||
order. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \ex00\ex05\ex00\ex07\exff\exf0 S2S* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB5 7\fR stored in \fIvar1\fR and \fB\-16\fR
|
||||
stored in \fIvar2\fR.
|
||||
.RE
|
||||
.IP \fBt\fR 5
|
||||
The data is interpreted as \fIcount\fR 16-bit signed integers
|
||||
represented in the native byte order of the machine running the Tcl
|
||||
script. It is otherwise identical to \fBs\fR and \fBS\fR.
|
||||
script, or as unsigned if \fBu\fR is placed
|
||||
immediately after the \fBt\fR. It is otherwise identical to \fBs\fR and \fBS\fR.
|
||||
To determine what the native byte order of the machine is, refer to
|
||||
the \fBbyteOrder\fR element of the \fBtcl_platform\fR array.
|
||||
.IP \fBi\fR 5
|
||||
The data is interpreted as \fIcount\fR 32-bit signed integers
|
||||
represented in little-endian byte order. The integers are stored in
|
||||
the corresponding variable as a list. If \fIcount\fR is \fB*\fR, then
|
||||
all of the remaining bytes in \fIstring\fR will be scanned. If
|
||||
represented in little-endian byte order, or as unsigned if \fBu\fR is placed
|
||||
immediately after the \fBi\fR. The integers are stored in
|
||||
the corresponding variable as a list. If \fIcount\fR is
|
||||
.QW \fB*\fR ,
|
||||
then all of the remaining bytes in \fIstring\fR will be scanned. If
|
||||
\fIcount\fR is omitted, then one 32-bit integer will be scanned. For
|
||||
example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
set str \ex05\ex00\ex00\ex00\ex07\ex00\ex00\ex00\exf0\exff\exff\exff
|
||||
\fBbinary scan\fR $str i2i* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB5 7\fR stored in \fIvar1\fR and \fB\-16\fR
|
||||
stored in \fIvar2\fR. Note that the integers returned are signed, but
|
||||
they can be converted to unsigned 32-bit quantities using an expression
|
||||
like:
|
||||
.CS
|
||||
set num [expr { $num & 0xFFFFFFFF }]
|
||||
.CE
|
||||
stored in \fIvar2\fR. Note that the integers returned are signed unless
|
||||
\fBiu\fR is used in place of \fBi\fR.
|
||||
.RE
|
||||
.IP \fBI\fR 5
|
||||
This form is the same as \fBI\fR except that the data is interpreted
|
||||
as \fIcount\fR 32-bit signed integers represented in big-endian byte
|
||||
order. For example,
|
||||
order, or as unsigned if \fBu\fR is placed
|
||||
immediately after the \fBI\fR. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
set str \ex00\ex00\ex00\ex05\ex00\ex00\ex00\ex07\exff\exff\exff\exf0
|
||||
\fBbinary scan\fR $str I2I* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB5 7\fR stored in \fIvar1\fR and \fB\-16\fR
|
||||
stored in \fIvar2\fR.
|
||||
.RE
|
||||
.IP \fBn\fR 5
|
||||
The data is interpreted as \fIcount\fR 32-bit signed integers
|
||||
represented in the native byte order of the machine running the Tcl
|
||||
script. It is otherwise identical to \fBi\fR and \fBI\fR.
|
||||
script, or as unsigned if \fBu\fR is placed
|
||||
immediately after the \fBn\fR. It is otherwise identical to \fBi\fR and \fBI\fR.
|
||||
To determine what the native byte order of the machine is, refer to
|
||||
the \fBbyteOrder\fR element of the \fBtcl_platform\fR array.
|
||||
.IP \fBw\fR 5
|
||||
The data is interpreted as \fIcount\fR 64-bit signed integers
|
||||
represented in little-endian byte order. The integers are stored in
|
||||
the corresponding variable as a list. If \fIcount\fR is \fB*\fR, then
|
||||
all of the remaining bytes in \fIstring\fR will be scanned. If
|
||||
represented in little-endian byte order, or as unsigned if \fBu\fR is placed
|
||||
immediately after the \fBw\fR. The integers are stored in
|
||||
the corresponding variable as a list. If \fIcount\fR is
|
||||
.QW \fB*\fR ,
|
||||
then all of the remaining bytes in \fIstring\fR will be scanned. If
|
||||
\fIcount\fR is omitted, then one 64-bit integer will be scanned. For
|
||||
example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
set str \ex05\ex00\ex00\ex00\ex07\ex00\ex00\ex00\exf0\exff\exff\exff
|
||||
\fBbinary scan\fR $str wi* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB30064771077\fR stored in \fIvar1\fR and
|
||||
\fB\-16\fR stored in \fIvar2\fR. Note that the integers returned are
|
||||
signed and cannot be represented by Tcl as unsigned values.
|
||||
\fB\-16\fR stored in \fIvar2\fR.
|
||||
.RE
|
||||
.IP \fBW\fR 5
|
||||
This form is the same as \fBw\fR except that the data is interpreted
|
||||
as \fIcount\fR 64-bit signed integers represented in big-endian byte
|
||||
order. For example,
|
||||
order, or as unsigned if \fBu\fR is placed
|
||||
immediately after the \fBW\fR. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
set str \ex00\ex00\ex00\ex05\ex00\ex00\ex00\ex07\exff\exff\exff\exf0
|
||||
\fBbinary scan\fR $str WI* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB21474836487\fR stored in \fIvar1\fR and \fB\-16\fR
|
||||
stored in \fIvar2\fR.
|
||||
.RE
|
||||
.IP \fBm\fR 5
|
||||
The data is interpreted as \fIcount\fR 64-bit signed integers
|
||||
represented in the native byte order of the machine running the Tcl
|
||||
script. It is otherwise identical to \fBw\fR and \fBW\fR.
|
||||
script, or as unsigned if \fBu\fR is placed
|
||||
immediately after the \fBm\fR. It is otherwise identical to \fBw\fR and \fBW\fR.
|
||||
To determine what the native byte order of the machine is, refer to
|
||||
the \fBbyteOrder\fR element of the \fBtcl_platform\fR array.
|
||||
.IP \fBf\fR 5
|
||||
The data is interpreted as \fIcount\fR single-precision floating point
|
||||
numbers in the machine's native representation. The floating point
|
||||
numbers are stored in the corresponding variable as a list. If
|
||||
\fIcount\fR is \fB*\fR, then all of the remaining bytes in
|
||||
\fIcount\fR is
|
||||
.QW \fB*\fR ,
|
||||
then all of the remaining bytes in
|
||||
\fIstring\fR will be scanned. If \fIcount\fR is omitted, then one
|
||||
single-precision floating point number will be scanned. The size of a
|
||||
floating point number may vary across architectures, so the number of
|
||||
@@ -784,9 +952,11 @@ valid floating point number, the resulting value is undefined and
|
||||
compiler dependent. For example, on a Windows system running on an
|
||||
Intel Pentium processor,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \ex3f\excc\excc\excd f var1
|
||||
.CE
|
||||
.PP
|
||||
will return \fB1\fR with \fB1.6000000238418579\fR stored in
|
||||
\fIvar1\fR.
|
||||
.RE
|
||||
@@ -806,9 +976,11 @@ as \fIcount\fR double-precision floating point numbers in the
|
||||
machine's native representation. For example, on a Windows system
|
||||
running on an Intel Pentium processor,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \ex9a\ex99\ex99\ex99\ex99\ex99\exf9\ex3f d var1
|
||||
.CE
|
||||
.PP
|
||||
will return \fB1\fR with \fB1.6000000000000001\fR
|
||||
stored in \fIvar1\fR.
|
||||
.RE
|
||||
@@ -824,28 +996,36 @@ order. This conversion is not portable to the minority of systems not
|
||||
using IEEE floating point representations.
|
||||
.IP \fBx\fR 5
|
||||
Moves the cursor forward \fIcount\fR bytes in \fIstring\fR. If
|
||||
\fIcount\fR is \fB*\fR or is larger than the number of bytes after the
|
||||
\fIcount\fR is
|
||||
.QW \fB*\fR
|
||||
or is larger than the number of bytes after the
|
||||
current cursor position, then the cursor is positioned after
|
||||
the last byte in \fIstring\fR. If \fIcount\fR is omitted, then the
|
||||
cursor is moved forward one byte. Note that this type does not
|
||||
consume an argument. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \ex01\ex02\ex03\ex04 x2H* var1
|
||||
.CE
|
||||
.PP
|
||||
will return \fB1\fR with \fB0304\fR stored in \fIvar1\fR.
|
||||
.RE
|
||||
.IP \fBX\fR 5
|
||||
Moves the cursor back \fIcount\fR bytes in \fIstring\fR. If
|
||||
\fIcount\fR is \fB*\fR or is larger than the current cursor position,
|
||||
\fIcount\fR is
|
||||
.QW \fB*\fR
|
||||
or is larger than the current cursor position,
|
||||
then the cursor is positioned at location 0 so that the next byte
|
||||
scanned will be the first byte in \fIstring\fR. If \fIcount\fR
|
||||
is omitted then the cursor is moved back one byte. Note that this
|
||||
type does not consume an argument. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \ex01\ex02\ex03\ex04 c2XH* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB1 2\fR stored in \fIvar1\fR and \fB020304\fR
|
||||
stored in \fIvar2\fR.
|
||||
.RE
|
||||
@@ -856,9 +1036,11 @@ by \fIcount\fR. Note that position 0 refers to the first byte in
|
||||
\fIstring\fR, then the cursor is positioned after the last byte. If
|
||||
\fIcount\fR is omitted, then an error will be generated. For example,
|
||||
.RS
|
||||
.PP
|
||||
.CS
|
||||
\fBbinary scan\fR \ex01\ex02\ex03\ex04 c2@1H* var1 var2
|
||||
.CE
|
||||
.PP
|
||||
will return \fB2\fR with \fB1 2\fR stored in \fIvar1\fR and \fB020304\fR
|
||||
stored in \fIvar2\fR.
|
||||
.RE
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user