mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
760 Commits
FILEUTILS-
...
FILEUTILS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e48314ac1b | ||
|
|
7c94dda02d | ||
|
|
fe6c711f48 | ||
|
|
2c7c121c13 | ||
|
|
7a8b837062 | ||
|
|
25eb22e88f | ||
|
|
7f798f5f4f | ||
|
|
9d502e7240 | ||
|
|
c1ecd3afea | ||
|
|
a95088a5ea | ||
|
|
fb43ebcbae | ||
|
|
73ed11f2b7 | ||
|
|
6390686aab | ||
|
|
3e0c759c3a | ||
|
|
10f565971b | ||
|
|
e1ea22da05 | ||
|
|
1e71247ea0 | ||
|
|
46f650f6b0 | ||
|
|
74bca24efe | ||
|
|
e385fd1e4c | ||
|
|
239899ae58 | ||
|
|
2a3863e2b8 | ||
|
|
bd30083472 | ||
|
|
01839f9f82 | ||
|
|
6f807a8598 | ||
|
|
94439345f5 | ||
|
|
e9dc554349 | ||
|
|
68ed0308cf | ||
|
|
fb04070061 | ||
|
|
9200311684 | ||
|
|
dd374cd779 | ||
|
|
71076df2d8 | ||
|
|
a1a27df129 | ||
|
|
fd685e41d6 | ||
|
|
c672fc6df6 | ||
|
|
0a735b7b9e | ||
|
|
5aaadded9d | ||
|
|
a8bcd782c4 | ||
|
|
2be7ff8311 | ||
|
|
0894db7b3f | ||
|
|
d58a074dea | ||
|
|
d73bc3ca57 | ||
|
|
186d893f27 | ||
|
|
edeada009c | ||
|
|
18195dd699 | ||
|
|
338b31ba60 | ||
|
|
562eb3d16d | ||
|
|
175fb661e0 | ||
|
|
50c04a9d3e | ||
|
|
8a66d0dd57 | ||
|
|
1f678023d5 | ||
|
|
b66a30133f | ||
|
|
598a7bda46 | ||
|
|
0800b55642 | ||
|
|
5ac433d292 | ||
|
|
b22469537b | ||
|
|
591844b387 | ||
|
|
2611844743 | ||
|
|
c04fc60484 | ||
|
|
ffb626613a | ||
|
|
3452006a53 | ||
|
|
161422b9b2 | ||
|
|
2091adbbb1 | ||
|
|
ccbf5f37f1 | ||
|
|
ef2b6836fd | ||
|
|
44386ac6ff | ||
|
|
5c7e1b6bee | ||
|
|
3266134b2a | ||
|
|
63571532a2 | ||
|
|
82b01ee905 | ||
|
|
48569d6b98 | ||
|
|
211fe36692 | ||
|
|
8dd8bb78b1 | ||
|
|
d64cc3c1ef | ||
|
|
db7201835d | ||
|
|
74cb2ee314 | ||
|
|
6d24eee926 | ||
|
|
aeb7c0bc47 | ||
|
|
940f23f4a4 | ||
|
|
f3f1cae097 | ||
|
|
fbe50426e2 | ||
|
|
8011a147de | ||
|
|
3cca257a3b | ||
|
|
de96d28c57 | ||
|
|
783fb6b2a6 | ||
|
|
b969dad022 | ||
|
|
c1db691c12 | ||
|
|
5f9c33edfe | ||
|
|
10d7644859 | ||
|
|
6cb5a99aa7 | ||
|
|
f696bb6737 | ||
|
|
8a9acec293 | ||
|
|
7eeedf8385 | ||
|
|
4c066c3552 | ||
|
|
6e5149f0ab | ||
|
|
af12dd6260 | ||
|
|
f8e40348be | ||
|
|
be8f2b0de2 | ||
|
|
279f065a06 | ||
|
|
c7837e95d2 | ||
|
|
9130f4b9d2 | ||
|
|
5aa14aeef0 | ||
|
|
61976fe88d | ||
|
|
0868a7d0bd | ||
|
|
48be557ad6 | ||
|
|
371f45401c | ||
|
|
9b9213f122 | ||
|
|
4c3d7d6a8b | ||
|
|
720d1c1c5e | ||
|
|
0dac1e107c | ||
|
|
31a8ced738 | ||
|
|
eb07a88b9e | ||
|
|
0503b28076 | ||
|
|
f45eaa5782 | ||
|
|
2f00343264 | ||
|
|
323c9cfee7 | ||
|
|
676a608318 | ||
|
|
39d1a08208 | ||
|
|
9ca6f19a2d | ||
|
|
0acd885d83 | ||
|
|
9110853f39 | ||
|
|
4ffe108e39 | ||
|
|
7290a43da9 | ||
|
|
9cfc701536 | ||
|
|
b0a020d50b | ||
|
|
36942690e1 | ||
|
|
afda328772 | ||
|
|
8a752e8696 | ||
|
|
8bd5d9e607 | ||
|
|
6885aee87b | ||
|
|
e4c57a939b | ||
|
|
b802aa3f55 | ||
|
|
8f915aadf8 | ||
|
|
662e8b4a03 | ||
|
|
3dd86270c6 | ||
|
|
ce7c0d5468 | ||
|
|
9ae64058d2 | ||
|
|
92de89ed2c | ||
|
|
5f0b9f1d99 | ||
|
|
8ebfd37293 | ||
|
|
cb6351aa82 | ||
|
|
a518e28429 | ||
|
|
7de0d8e233 | ||
|
|
839c312d49 | ||
|
|
783bace690 | ||
|
|
31d836282b | ||
|
|
bc73cf3351 | ||
|
|
731cbc77fb | ||
|
|
2bd16e646e | ||
|
|
7f2c13e703 | ||
|
|
635a7c3186 | ||
|
|
42d1927306 | ||
|
|
ba246b0f36 | ||
|
|
13ff080b78 | ||
|
|
06a5782edd | ||
|
|
12f377da25 | ||
|
|
c423a2d74a | ||
|
|
04a1a572f4 | ||
|
|
1ba3bd3896 | ||
|
|
fb59a28b16 | ||
|
|
ab48b17dca | ||
|
|
d2ca2163c6 | ||
|
|
5ae342e1a9 | ||
|
|
6c635d1f27 | ||
|
|
42640f71df | ||
|
|
0b83b3090b | ||
|
|
4b583d1691 | ||
|
|
a182aa4e5a | ||
|
|
22ca9b17a5 | ||
|
|
04916b80de | ||
|
|
d7d7ae76b2 | ||
|
|
da7809f65c | ||
|
|
b7d3a68ce5 | ||
|
|
8794c292e7 | ||
|
|
ece3b1d144 | ||
|
|
8087dd5668 | ||
|
|
1a622aa2d9 | ||
|
|
1ea9952168 | ||
|
|
4df74fe308 | ||
|
|
68545c98ed | ||
|
|
4650315342 | ||
|
|
fbfde91f6a | ||
|
|
e3f1d80dd9 | ||
|
|
5e58599e6e | ||
|
|
c22036ab86 | ||
|
|
34ffd87f30 | ||
|
|
cea704d6da | ||
|
|
ddf8459662 | ||
|
|
8320e65164 | ||
|
|
f42460fb09 | ||
|
|
24a118665e | ||
|
|
3bcffe04d7 | ||
|
|
79523152dd | ||
|
|
35aaa568cd | ||
|
|
85da146bd2 | ||
|
|
ae8ee650ea | ||
|
|
4a11d01711 | ||
|
|
f76a4b618e | ||
|
|
c8c91b5e20 | ||
|
|
70155d8013 | ||
|
|
af14a04c19 | ||
|
|
6e62afaaed | ||
|
|
9190f77006 | ||
|
|
5d845a1678 | ||
|
|
f6c32178c7 | ||
|
|
ff5cd3f6a3 | ||
|
|
b3d8117527 | ||
|
|
103713c42b | ||
|
|
c84fb64144 | ||
|
|
8e02fb10ab | ||
|
|
1b47ed2714 | ||
|
|
dcd02c8008 | ||
|
|
a80c49322b | ||
|
|
3982e9cdf8 | ||
|
|
a5b6fae599 | ||
|
|
b660d78cf5 | ||
|
|
c86883a62a | ||
|
|
e36197cd8f | ||
|
|
2185c1f3d8 | ||
|
|
48a76e855c | ||
|
|
19b5a4f761 | ||
|
|
9dbd283b1e | ||
|
|
4376f9f2ce | ||
|
|
37fea371b7 | ||
|
|
bb02f48670 | ||
|
|
64cd458e0a | ||
|
|
bc9aded4b9 | ||
|
|
a611c6cbf6 | ||
|
|
68c33eea03 | ||
|
|
fec6a430da | ||
|
|
1266fc26ee | ||
|
|
41a41dd48e | ||
|
|
e59e2e803c | ||
|
|
52c7e3147e | ||
|
|
8829551700 | ||
|
|
e95fe088e1 | ||
|
|
e13281014a | ||
|
|
aac56cabe4 | ||
|
|
df5f33a5bf | ||
|
|
0799786a33 | ||
|
|
6621f0a9a9 | ||
|
|
d5b9b29ac6 | ||
|
|
022a19b21f | ||
|
|
12133d7f01 | ||
|
|
58dfd6b442 | ||
|
|
5fc47138b1 | ||
|
|
4a2b289e7c | ||
|
|
bab072f3aa | ||
|
|
8679e372cd | ||
|
|
b0690ba414 | ||
|
|
ed354b6490 | ||
|
|
81d1fa5cb6 | ||
|
|
421e75544b | ||
|
|
7466f41075 | ||
|
|
1e7d4b9c70 | ||
|
|
6a13b75511 | ||
|
|
ebefd435aa | ||
|
|
b3335ab809 | ||
|
|
d293e5f03c | ||
|
|
0a470f01de | ||
|
|
b181d31372 | ||
|
|
b3a49ee8d0 | ||
|
|
35b886ad7b | ||
|
|
cecde31171 | ||
|
|
ae6c43a3ab | ||
|
|
17432bd066 | ||
|
|
c835f92a61 | ||
|
|
89b765e32c | ||
|
|
3752e13942 | ||
|
|
858afc04d2 | ||
|
|
5fecd9e4d5 | ||
|
|
ae5ee331f1 | ||
|
|
954c7bc4cc | ||
|
|
625dc74361 | ||
|
|
b26beb4996 | ||
|
|
0b3d661480 | ||
|
|
33448d128a | ||
|
|
b3ef6f599d | ||
|
|
72f95044eb | ||
|
|
859f8587f8 | ||
|
|
24e15328df | ||
|
|
357c53621f | ||
|
|
fd688bcc5f | ||
|
|
e8c6c8175b | ||
|
|
561e4c139e | ||
|
|
507288d2c7 | ||
|
|
6c47524481 | ||
|
|
300c151b8b | ||
|
|
3c7e9fec08 | ||
|
|
7235fb47cc | ||
|
|
8ef2abf7e9 | ||
|
|
5e55e49972 | ||
|
|
48a255beb0 | ||
|
|
17a2ec94a8 | ||
|
|
e7f8503138 | ||
|
|
f789ddbdda | ||
|
|
1f1bd53b86 | ||
|
|
3a2afe3311 | ||
|
|
20b960db10 | ||
|
|
8fd3e8664b | ||
|
|
1b25f1c2cd | ||
|
|
8569e32ec8 | ||
|
|
1321f30e73 | ||
|
|
290ee99712 | ||
|
|
3008ad90f4 | ||
|
|
8c5b30bc1e | ||
|
|
f0fa287b4f | ||
|
|
4ecb3b28f1 | ||
|
|
ea93e0b7ad | ||
|
|
7603401c86 | ||
|
|
90d97b9703 | ||
|
|
4091022393 | ||
|
|
338061e307 | ||
|
|
6a99b4cc40 | ||
|
|
86d6c36d09 | ||
|
|
a7f5043de8 | ||
|
|
5110583f3e | ||
|
|
813c8e8bb6 | ||
|
|
7d72c942bb | ||
|
|
f17cc2e29c | ||
|
|
4f4111709c | ||
|
|
beed39a03c | ||
|
|
d5f09a0fd1 | ||
|
|
3692f57123 | ||
|
|
d3d5565035 | ||
|
|
3e39947b49 | ||
|
|
c8a3fc9bed | ||
|
|
d43b4dcaf8 | ||
|
|
54f9b87874 | ||
|
|
1c28626053 | ||
|
|
6c674869b3 | ||
|
|
888a5250a5 | ||
|
|
d468c227b0 | ||
|
|
52314f2cd8 | ||
|
|
8d2b4f9786 | ||
|
|
b44299cfd7 | ||
|
|
5ea5ea9d2c | ||
|
|
7d21f2f4d0 | ||
|
|
73db5c12b9 | ||
|
|
53ac4c028b | ||
|
|
916a46a980 | ||
|
|
8b59538e69 | ||
|
|
eb34cbfc13 | ||
|
|
4360d0f52d | ||
|
|
e74a22ebb7 | ||
|
|
fcc65666b5 | ||
|
|
a16b0a142f | ||
|
|
5c39a3b65b | ||
|
|
4885753994 | ||
|
|
156de2ae7a | ||
|
|
40f8a7ad2b | ||
|
|
8f477a9072 | ||
|
|
d5ce3b1c3c | ||
|
|
54d0c0bb5a | ||
|
|
09c73133aa | ||
|
|
17fe725ebb | ||
|
|
c02f8ed500 | ||
|
|
90b901cd1c | ||
|
|
73c7efa3ee | ||
|
|
e155f4bf01 | ||
|
|
1d3c57118b | ||
|
|
195b5ebbe7 | ||
|
|
ba788477a8 | ||
|
|
6846ffa9d9 | ||
|
|
4fb3a6f765 | ||
|
|
5460d4a9c8 | ||
|
|
7f5d303c61 | ||
|
|
a65bae921e | ||
|
|
89cf1fc2cf | ||
|
|
a13947a7a3 | ||
|
|
ddc2531899 | ||
|
|
80729c5841 | ||
|
|
83ada8596c | ||
|
|
2a1d6f9b5f | ||
|
|
f2ac53d4ea | ||
|
|
f31b9b9fee | ||
|
|
acc8601b65 | ||
|
|
8dd5415e02 | ||
|
|
8a4da0e3ff | ||
|
|
95f9b268e9 | ||
|
|
d2ad9d8cf4 | ||
|
|
0ccd71dd94 | ||
|
|
1c7be9d1bb | ||
|
|
c9893d18e3 | ||
|
|
fb1f09c76e | ||
|
|
b1cc662215 | ||
|
|
f86a3c16d3 | ||
|
|
6d244887aa | ||
|
|
f86df3250c | ||
|
|
65a915647c | ||
|
|
2882d4477d | ||
|
|
2793223907 | ||
|
|
a5937bbc71 | ||
|
|
d0cac59c72 | ||
|
|
ed0923a11c | ||
|
|
42096600e3 | ||
|
|
523fb680f6 | ||
|
|
3f36b30756 | ||
|
|
4a1512e4b2 | ||
|
|
ad44ac84c8 | ||
|
|
c7975ba578 | ||
|
|
62a92dec57 | ||
|
|
a37e7e6b78 | ||
|
|
d5718682cc | ||
|
|
81e3dc9283 | ||
|
|
daa3f22091 | ||
|
|
b87899c834 | ||
|
|
4accfeb4e0 | ||
|
|
377b0c7942 | ||
|
|
4331f5f978 | ||
|
|
fb19eec511 | ||
|
|
b712dcba25 | ||
|
|
caad57f5d0 | ||
|
|
807b8b05c2 | ||
|
|
5f3fa7a284 | ||
|
|
c1032f08e5 | ||
|
|
0aa0b007b0 | ||
|
|
c6973beeec | ||
|
|
d99d106c55 | ||
|
|
61f8fa059c | ||
|
|
9279ffdf29 | ||
|
|
0682a5efe9 | ||
|
|
dc68073b21 | ||
|
|
78c6df8fb8 | ||
|
|
f03282e857 | ||
|
|
7e9e29f392 | ||
|
|
28f8f53bb6 | ||
|
|
ab8182fa71 | ||
|
|
d740a98d4a | ||
|
|
40e0727bed | ||
|
|
a387531246 | ||
|
|
be44044a29 | ||
|
|
ae9d905134 | ||
|
|
bcb8610977 | ||
|
|
ac66871c65 | ||
|
|
3fa102417e | ||
|
|
59b58a58f6 | ||
|
|
f46bcc918b | ||
|
|
784928401d | ||
|
|
1a62ae1a5c | ||
|
|
952a4436eb | ||
|
|
a098f5b9b6 | ||
|
|
5d691b7b74 | ||
|
|
84ee79c745 | ||
|
|
4b091b8a14 | ||
|
|
c51d0a5a9b | ||
|
|
29ea1d5db9 | ||
|
|
b910477e63 | ||
|
|
2f74178b8b | ||
|
|
fe171f7d8f | ||
|
|
b0244698f9 | ||
|
|
7c0ec3e569 | ||
|
|
4677a7e42f | ||
|
|
520f4efee9 | ||
|
|
0d43bad18e | ||
|
|
0dd914edd1 | ||
|
|
161db26bd1 | ||
|
|
a992c841ae | ||
|
|
9299cf1e78 | ||
|
|
970083559f | ||
|
|
459453639e | ||
|
|
0e0ae2b348 | ||
|
|
cb7fcc32ff | ||
|
|
d7e8ccb6f3 | ||
|
|
a811674834 | ||
|
|
fa9f16326a | ||
|
|
c13ff9b8bc | ||
|
|
bded355394 | ||
|
|
f43bd3fafc | ||
|
|
e298f1f300 | ||
|
|
8102404465 | ||
|
|
bef51e36a4 | ||
|
|
5425625fb3 | ||
|
|
94d1ea4fa9 | ||
|
|
9645d076db | ||
|
|
b683d9194f | ||
|
|
38da840313 | ||
|
|
b36e061e8a | ||
|
|
0d3f6a6665 | ||
|
|
aa00ea2e88 | ||
|
|
aad274a82b | ||
|
|
fc949b713e | ||
|
|
fbc246ca8f | ||
|
|
789a8aa03a | ||
|
|
179a2c3034 | ||
|
|
a27d168615 | ||
|
|
29fa517ae4 | ||
|
|
4b7c7e9d33 | ||
|
|
daf9bddd16 | ||
|
|
9b3733bd9a | ||
|
|
a4f0dde547 | ||
|
|
e604ed756f | ||
|
|
1cf3018183 | ||
|
|
138d155fb8 | ||
|
|
4d091498a4 | ||
|
|
1e3de0b6d9 | ||
|
|
25a9b70b2e | ||
|
|
45bf8ec9d0 | ||
|
|
4a253e5be0 | ||
|
|
71a04268b5 | ||
|
|
6c6ea1a14d | ||
|
|
9691c2050b | ||
|
|
2876587b55 | ||
|
|
1eb3a8c9ba | ||
|
|
39fd156a8e | ||
|
|
f137758903 | ||
|
|
895c2213db | ||
|
|
50720fb367 | ||
|
|
f6516b6dd3 | ||
|
|
564001a9e7 | ||
|
|
25abc2a9b4 | ||
|
|
70196747af | ||
|
|
04e102f64f | ||
|
|
432ebf7912 | ||
|
|
84b3a78396 | ||
|
|
9eb9f31c3a | ||
|
|
7f82c56f15 | ||
|
|
5582e6dad3 | ||
|
|
2e55854100 | ||
|
|
8114f3fcdb | ||
|
|
45c541daa1 | ||
|
|
17c0c658f1 | ||
|
|
b8e689dc67 | ||
|
|
87b19e8a11 | ||
|
|
a1c6ed64c0 | ||
|
|
f2c14100c3 | ||
|
|
1a58046071 | ||
|
|
b3b3cf98c6 | ||
|
|
30bf49ce02 | ||
|
|
a5ecd84c1f | ||
|
|
9b29731f08 | ||
|
|
a140942848 | ||
|
|
1291b1652a | ||
|
|
1b5b75d13e | ||
|
|
f1af346ad5 | ||
|
|
431bbb9c57 | ||
|
|
7d62b5ce1c | ||
|
|
a345a56001 | ||
|
|
b5f8cdecfb | ||
|
|
fa53b43c97 | ||
|
|
23bce5b115 | ||
|
|
da952f6227 | ||
|
|
31926f3a37 | ||
|
|
a71e22991b | ||
|
|
d74d789bea | ||
|
|
950325ee23 | ||
|
|
c941e1742d | ||
|
|
0bd1289ad1 | ||
|
|
febf70b73f | ||
|
|
b5a71af82a | ||
|
|
876c63c92f | ||
|
|
b3ca6696cd | ||
|
|
24e88142ba | ||
|
|
f9cd2cf6e2 | ||
|
|
0a1ac00ad6 | ||
|
|
e5947e883e | ||
|
|
679918ec84 | ||
|
|
a9b6fe5c83 | ||
|
|
8619a0d598 | ||
|
|
d34e6897d8 | ||
|
|
55681891e5 | ||
|
|
3772a9e885 | ||
|
|
1220685f78 | ||
|
|
f3129d9b19 | ||
|
|
b0fd7c9185 | ||
|
|
7d70c26629 | ||
|
|
ac96de6db4 | ||
|
|
1f49981a1f | ||
|
|
d09ffcb711 | ||
|
|
33b2a8a1ae | ||
|
|
32969f8571 | ||
|
|
4abe75d3b1 | ||
|
|
e623bf9a03 | ||
|
|
0815914f28 | ||
|
|
70cf07775b | ||
|
|
06382a007d | ||
|
|
d7749da3e9 | ||
|
|
84b8cf9fcf | ||
|
|
c673119b0b | ||
|
|
45d223328e | ||
|
|
b8ad9be908 | ||
|
|
2be918d5cd | ||
|
|
db69dbe9ab | ||
|
|
4215f6b53a | ||
|
|
e1298617bf | ||
|
|
720341312b | ||
|
|
ed44302c4a | ||
|
|
c3b3d48cd4 | ||
|
|
a73047bde4 | ||
|
|
20862d675d | ||
|
|
17e8314c79 | ||
|
|
ee791d8ca1 | ||
|
|
0c410767ab | ||
|
|
3896da90cc | ||
|
|
0ed25421c6 | ||
|
|
194f3d7f5a | ||
|
|
e028e025df | ||
|
|
8978c64869 | ||
|
|
0fd3107ec7 | ||
|
|
0416bd8ed0 | ||
|
|
d63a1efe26 | ||
|
|
43294523f4 | ||
|
|
625354dd9e | ||
|
|
dc14f81457 | ||
|
|
32f42e0a34 | ||
|
|
263773a385 | ||
|
|
6afff604a4 | ||
|
|
7b4f54f83f | ||
|
|
24b532175e | ||
|
|
543f479cc8 | ||
|
|
4b1e41570b | ||
|
|
d0fa9d9689 | ||
|
|
4516e9ec55 | ||
|
|
d15f56325a | ||
|
|
1dde8333c1 | ||
|
|
ac22b4589d | ||
|
|
2f03e544e1 | ||
|
|
412cc2f3fc | ||
|
|
3cbc95de84 | ||
|
|
b3d2d7745e | ||
|
|
66d52e0b28 | ||
|
|
5ba02801bd | ||
|
|
03c0cd6569 | ||
|
|
c12be5c1d8 | ||
|
|
d565995d9b | ||
|
|
9fd1b85231 | ||
|
|
350690112e | ||
|
|
d0acd7bfa5 | ||
|
|
4ba06c4102 | ||
|
|
cb84de4217 | ||
|
|
7111d93669 | ||
|
|
97f0f916a2 | ||
|
|
42e52b5017 | ||
|
|
8ce9769e2f | ||
|
|
7d969dab50 | ||
|
|
d7074bc0e4 | ||
|
|
e24c0713be | ||
|
|
9b3498acb2 | ||
|
|
ffc5c802c4 | ||
|
|
12b4578595 | ||
|
|
e98991ee51 | ||
|
|
10076ae36a | ||
|
|
c96ca77338 | ||
|
|
e82e83086c | ||
|
|
70ef71caf5 | ||
|
|
56d2307664 | ||
|
|
e98dee7cdd | ||
|
|
f3701815f7 | ||
|
|
cf3c9c6a11 | ||
|
|
beb67dc954 | ||
|
|
242f2fa2e1 | ||
|
|
3d91b69385 | ||
|
|
41dfaf296a | ||
|
|
bc2d814543 | ||
|
|
8cb23387cb | ||
|
|
82fa812558 | ||
|
|
1487a7da95 | ||
|
|
1751c454c2 | ||
|
|
da59dde0bb | ||
|
|
6099958eda | ||
|
|
ffd5a79535 | ||
|
|
320268ae6d | ||
|
|
e45d62703e | ||
|
|
6ed9fd4b58 | ||
|
|
d0909b6911 | ||
|
|
a64289005d | ||
|
|
e42dca4684 | ||
|
|
51293cdf6f | ||
|
|
4d0af9ead4 | ||
|
|
eed23c25dc | ||
|
|
8204d34b97 | ||
|
|
d80da392e0 | ||
|
|
4c53aee40c | ||
|
|
3d35ef8670 | ||
|
|
5921df05c5 | ||
|
|
1a7260cada | ||
|
|
969950e526 | ||
|
|
fb9ee923ba | ||
|
|
8af03634e6 | ||
|
|
e5e9f3ee5d | ||
|
|
62ae6ccc22 | ||
|
|
c3830e800f | ||
|
|
7200c7fd2e | ||
|
|
d16bea8f84 | ||
|
|
ae0dc43e79 | ||
|
|
c6500ed364 | ||
|
|
2a5b5534ab | ||
|
|
2dc3ad1a76 | ||
|
|
1e2d02ace5 | ||
|
|
fde482ef0e | ||
|
|
9de1f7a589 | ||
|
|
983e0032e0 | ||
|
|
60cb394696 | ||
|
|
c5c0528abe | ||
|
|
fecbdd9ab1 | ||
|
|
5b2210ce71 | ||
|
|
3df36d5e2f | ||
|
|
a49fa29fed | ||
|
|
bb3ecf85bc | ||
|
|
b5a2377dc2 | ||
|
|
46b5894b8f | ||
|
|
1a68844645 | ||
|
|
dc522f984c | ||
|
|
8573fc6ac9 | ||
|
|
d4cf394f30 | ||
|
|
79f3064bfa | ||
|
|
900e16e5d5 | ||
|
|
dfc9fc2202 | ||
|
|
1b5b3bf6e2 | ||
|
|
cb806c0218 | ||
|
|
0e6d3d87e4 | ||
|
|
4b08923fe8 | ||
|
|
2edcf647de | ||
|
|
0a713ad019 | ||
|
|
7026c59810 | ||
|
|
4c4eb1ab6c | ||
|
|
638d6e19f0 | ||
|
|
27d2263af1 | ||
|
|
320b9cc697 | ||
|
|
28e0bda43b | ||
|
|
04af619ed2 | ||
|
|
255931762f | ||
|
|
f98969cf69 | ||
|
|
7c17502e74 | ||
|
|
4a2eda04aa | ||
|
|
ed43629995 | ||
|
|
c177b96b17 | ||
|
|
c5de1e3532 | ||
|
|
148ec1ad9c | ||
|
|
a13e04ed9d | ||
|
|
98564790bd | ||
|
|
f04044ed86 | ||
|
|
09711894fe | ||
|
|
4f28f318d8 | ||
|
|
e22c80dcf0 | ||
|
|
b350b74916 | ||
|
|
3400ffe3f2 | ||
|
|
fdd16fdb62 | ||
|
|
6f67177fae | ||
|
|
2c035a7cfd | ||
|
|
be4153d2a8 | ||
|
|
630b771f1b | ||
|
|
de05a873ec | ||
|
|
3361bd2bca | ||
|
|
1c6698b17d | ||
|
|
a3edb3f940 | ||
|
|
9b34a4a7c6 | ||
|
|
56c8b44ec6 | ||
|
|
50c823be8a | ||
|
|
4909374105 | ||
|
|
2a91869144 | ||
|
|
41bf50ecb3 | ||
|
|
349c3796be | ||
|
|
717429e4bc | ||
|
|
6c81b98e46 | ||
|
|
cf64a504d8 | ||
|
|
ec693397f0 | ||
|
|
04838c31ce | ||
|
|
fa3bbe8eb2 | ||
|
|
39c406f18a |
55
ABOUT-NLS
55
ABOUT-NLS
@@ -134,7 +134,8 @@ Each translation team has its own mailing list, courtesy of Linux
|
||||
International. You may reach your translation team at the address
|
||||
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
|
||||
language. Language codes are *not* the same as the country codes given
|
||||
in ISO 3166. The following translation teams exist, as of August 1996:
|
||||
in ISO 3166. The following translation teams exist, as of December
|
||||
1996:
|
||||
|
||||
Arabic `ar', Chinese `zh', Czech `cs', Danish `da', Dutch `nl',
|
||||
English `en', Esperanto `eo', Finnish `fi', French `fr', German
|
||||
@@ -172,40 +173,42 @@ Available Packages
|
||||
|
||||
Languages are not equally supported in all GNU packages. The
|
||||
following matrix shows the current state of GNU internationalization,
|
||||
as of August 1996. The matrix shows, in regard of each package, for
|
||||
as of December 1996. The matrix shows, in regard of each package, for
|
||||
which languages PO files have been submitted to translation
|
||||
coordination.
|
||||
|
||||
cs de en es fi fr ja ko nl no pl pt sl sv
|
||||
Ready PO files cs de en es fi fr ja ko nl no pl pt sl sv
|
||||
.-------------------------------------------.
|
||||
bash | [] [] | 2
|
||||
bison | [] [] | 2
|
||||
bash | [] [] [] | 3
|
||||
bison | [] [] [] | 3
|
||||
clisp | [] [] [] | 3
|
||||
cpio | [] [] [] | 3
|
||||
diffutils | [] [] [] | 3
|
||||
cpio | [] [] [] [] | 4
|
||||
diffutils | [] [] [] [] | 4
|
||||
enscript | [] [] [] [] [] | 5
|
||||
fileutils | [] [] [] [] [] [] | 6
|
||||
findutils | [] [] [] [] [] | 5
|
||||
flex | [] | 1
|
||||
gcal | [] | 1
|
||||
gettext | [] [] [] [] [] [] [] [] [] | 10
|
||||
glibc | [] [] [] | 3
|
||||
grep | [] [] [] [] [] [] [] | 7
|
||||
hello | [] [] [] [] [] [] [] [] | 8
|
||||
fileutils | [] [] [] [] [] [] [] [] | 8
|
||||
findutils | [] [] [] [] [] [] | 6
|
||||
flex | [] [] | 2
|
||||
gcal | [] [] [] | 3
|
||||
gettext | [] [] [] [] [] [] [] [] [] [] | 11
|
||||
grep | [] [] [] [] [] [] [] [] | 8
|
||||
hello | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
id-utils | [] [] | 2
|
||||
indent | | 0
|
||||
libc | [] [] [] [] [] [] | 6
|
||||
m4 | [] [] [] [] [] | 5
|
||||
make | [] [] | 2
|
||||
mkid | [] [] | 2
|
||||
make | [] [] [] [] [] | 5
|
||||
music | [] | 1
|
||||
ptx | [] [] [] [] [] | 5
|
||||
ptx | [] [] [] [] [] [] [] [] | 8
|
||||
recode | [] [] [] [] [] [] [] | 7
|
||||
sh-utils | [] [] | 2
|
||||
sh-utils | [] [] [] [] [] | 5
|
||||
sharutils | [] [] [] [] | 4
|
||||
tar | [] [] [] [] [] [] [] [] | 8
|
||||
textutils | [] [] [] [] [] | 5
|
||||
wdiff | [] [] [] [] [] | 5
|
||||
tar | [] [] [] [] [] [] [] [] [] | 9
|
||||
texinfo | | 0
|
||||
textutils | [] [] [] [] [] [] | 6
|
||||
wdiff | [] [] [] [] [] [] [] [] | 8
|
||||
`-------------------------------------------'
|
||||
cs de en es fi fr ja ko nl no pl pt sl sv
|
||||
1 18 1 4 1 22 1 7 16 3 10 3 6 12 105
|
||||
14 languages cs de en es fi fr ja ko nl no pl pt sl sv
|
||||
27 packages 1 21 1 11 1 24 1 8 20 7 14 6 7 14 136
|
||||
|
||||
Some counters in the preceding matrix are higher than the number of
|
||||
visible blocks let us expect. This is because a few extra PO files are
|
||||
@@ -218,6 +221,6 @@ distributed as such by its maintainer. There might be an observable
|
||||
lag between the mere existence a PO file and its wide availability in a
|
||||
GNU distribution.
|
||||
|
||||
If August 1996 seems to be old, you may fetch a more recent copy of
|
||||
this `ABOUT-NLS' file on most GNU archive sites.
|
||||
If December 1996 seems to be old, you may fetch a more recent copy
|
||||
of this `ABOUT-NLS' file on most GNU archive sites.
|
||||
|
||||
|
||||
21
THANKS
Normal file
21
THANKS
Normal file
@@ -0,0 +1,21 @@
|
||||
This is just a start at listing e-mail addresses of contributors.
|
||||
The rest of the addresses are still in the ChangeLog.
|
||||
|
||||
Arne Henrik Juul arnej@imf.unit.no
|
||||
Bauke Jan Douma: bjdouma@xs4all.nl
|
||||
Charles Karney: karney@pppl.gov
|
||||
Eirik Fuller: eirik@netcom.com
|
||||
Emile LeBlanc: leblanc@math.toronto.edu
|
||||
Galen Hazelwood: galenh@micron.net
|
||||
James Antill: jmanti%essex.ac.uk@seralph21.essex.ac.uk
|
||||
Jesse Thilo: jgt2@eecs.lehigh.edu
|
||||
Joakim Rosqvist: dvljrt@cs.umu.se
|
||||
Marcus Daniels: marcus@sysc.pdx.edu
|
||||
Mark A. Thomas: thommark@access.digex.net
|
||||
Miles Bader: miles@gnu.ai.mit.edu
|
||||
Peter Eriksson: peter@ifm.liu.se
|
||||
Ross Ridge: rridge@calum.csclub.uwaterloo.ca
|
||||
Santiago Vila Doncel: sanvila@ctv.es
|
||||
Thomas Bushnell, n/BSG: thomas@gnu.ai.mit.edu
|
||||
Tony Leneis: tony@plaza.ds.adp.com
|
||||
Wayne Stewart: wstewa@atl.com
|
||||
@@ -4,3 +4,9 @@ info_TEXINFOS = fileutils.texi
|
||||
# FIXME: remove texinfo.tex when automake has been fixed to include it
|
||||
# automatically
|
||||
EXTRA_DIST = perm.texi getdate.texi texinfo.tex
|
||||
|
||||
# Tell makeinfo to put everything in a single info file: sh-utils.info.
|
||||
# Otherwise, it would also generate files with names like sh-utils.info-[123],
|
||||
# and those names all map to one 14-byte name (sh-utils.info-) on some crufty
|
||||
# old systems.
|
||||
MAKEINFO = makeinfo --no-split
|
||||
|
||||
114
doc/Makefile.in
114
doc/Makefile.in
@@ -1,4 +1,4 @@
|
||||
# Makefile.in generated automatically by automake 1.1e from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.1l from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
@@ -37,44 +37,56 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
YACC = @YACC@
|
||||
GENCAT = @GENCAT@
|
||||
PERL = @PERL@
|
||||
MV = @MV@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
CC = @CC@
|
||||
RANLIB = @RANLIB@
|
||||
LN = @LN@
|
||||
RM = @RM@
|
||||
|
||||
info_TEXINFOS = fileutils.texi
|
||||
|
||||
# FIXME: remove texinfo.tex when automake has been fixed to include it
|
||||
# automatically
|
||||
EXTRA_DIST = perm.texi getdate.texi texinfo.tex
|
||||
mkinstalldirs = $(top_srcdir)/mkinstalldirs
|
||||
|
||||
# Tell makeinfo to put everything in a single info file: sh-utils.info.
|
||||
# Otherwise, it would also generate files with names like sh-utils.info-[123],
|
||||
# and those names all map to one 14-byte name (sh-utils.info-) on some crufty
|
||||
# old systems.
|
||||
MAKEINFO = makeinfo --no-split
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
|
||||
MAKEINFO = makeinfo
|
||||
TEXI2DVI = texi2dvi
|
||||
INFOS = fileutils.info fileutils.info[-0-9]*
|
||||
INFO_DEPS = fileutils.info
|
||||
DVIS = fileutils.dvi
|
||||
TEXINFOS = fileutils.texi
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in mdate-sh stamp-vti texinfo.tex \
|
||||
DIST_COMMON = Makefile.am Makefile.in mdate-sh stamp-vti texinfo.tex \
|
||||
version.texi
|
||||
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
|
||||
$(TEXINFOS) $(INFOS) $(MANS) $(EXTRA_DIST) $(DATA)
|
||||
DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
|
||||
$(TEXINFOS) $(INFO_DEPS) $(MANS) $(EXTRA_DIST) $(DATA)
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) \
|
||||
$(TEXINFOS) $(MANS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
default: all
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .texi .texinfo .info .dvi .ps
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL)
|
||||
cd $(top_srcdir) && automake --gnu doc/Makefile
|
||||
|
||||
$(srcdir)/Makefile.in: @MAINT@Makefile.am $(top_srcdir)/configure.in
|
||||
cd $(top_srcdir) && automake $(subdir)/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
Makefile: $(top_builddir)/config.status Makefile.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
||||
|
||||
version.texi: @MAINT@stamp-vti
|
||||
|
||||
@@ -101,12 +113,15 @@ fileutils.info: fileutils.texi version.texi
|
||||
fileutils.dvi: fileutils.texi version.texi
|
||||
|
||||
|
||||
DVIPS = dvips
|
||||
|
||||
.texi.info:
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.texi.dvi:
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $<
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.texinfo.info:
|
||||
cd $(srcdir) \
|
||||
@@ -114,21 +129,45 @@ fileutils.dvi: fileutils.texi version.texi
|
||||
|
||||
.texinfo.dvi:
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $<
|
||||
.dvi.ps:
|
||||
$(DVIPS) $< -o $@
|
||||
|
||||
install-info: $(INFO_DEPS)
|
||||
install-info-am: $(INFO_DEPS)
|
||||
$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(infodir)
|
||||
for file in $(INFO_DEPS); do \
|
||||
@for file in $(INFO_DEPS); do \
|
||||
for ifile in `cd $(srcdir) && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
|
||||
if test -f $(srcdir)/$$ifile; then \
|
||||
echo "$(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile"; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile; \
|
||||
else : ; fi; \
|
||||
done; \
|
||||
done
|
||||
$(POST_INSTALL)
|
||||
@if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
||||
for file in $(INFO_DEPS); do \
|
||||
echo "install-info --info-dir=$(infodir) $(infodir)/$$file";\
|
||||
install-info --info-dir=$(infodir) $(infodir)/$$file; :;\
|
||||
done; \
|
||||
else : ; fi
|
||||
|
||||
uninstall-info:
|
||||
cd $(srcdir) && for file in *.info*; do \
|
||||
rm -f $(infodir)/$$file; \
|
||||
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
||||
ii=yes; \
|
||||
else ii=; fi; \
|
||||
for file in $(INFO_DEPS); do \
|
||||
(cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
|
||||
test -z $ii || install-info --info-dir=$(infodir) --remove $$file; \
|
||||
done
|
||||
|
||||
dist-info: $(INFO_DEPS)
|
||||
for base in $(INFO_DEPS); do \
|
||||
d=$(srcdir); \
|
||||
for file in `cd $$d && eval echo $$base*`; do \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done; \
|
||||
done
|
||||
|
||||
mostlyclean-info:
|
||||
@@ -142,7 +181,7 @@ clean-info:
|
||||
distclean-info:
|
||||
|
||||
maintainer-clean-info:
|
||||
rm -f $(INFOS)
|
||||
for i in $(INFO_DEPS); do rm -f `eval echo $$i*`; done
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
@@ -150,24 +189,23 @@ TAGS:
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = doc
|
||||
distdir: $(DEP_DISTFILES)
|
||||
@for file in `cd $(srcdir) && echo $(DISTFILES)`; do \
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $(srcdir)/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir)/$$file; \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
$(MAKE) distdir="$(distdir)" dist-info
|
||||
info: $(INFO_DEPS)
|
||||
|
||||
dvi: $(DVIS)
|
||||
|
||||
check: all
|
||||
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
|
||||
install-exec:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install-data: install-info
|
||||
install-data: install-info-am
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@@ -188,36 +226,34 @@ mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
distclean-generic:
|
||||
rm -f Makefile $(DISTCLEANFILES)
|
||||
rm -f config.cache config.log $(CONFIG_HEADER) stamp-h
|
||||
rm -f config.cache config.log stamp-h
|
||||
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-vti mostlyclean-info mostlyclean-generic
|
||||
|
||||
clean: clean-vti clean-info clean-generic mostlyclean
|
||||
clean: clean-vti clean-info clean-generic mostlyclean
|
||||
|
||||
distclean: distclean-vti distclean-info distclean-generic clean
|
||||
distclean: distclean-vti distclean-info distclean-generic clean
|
||||
rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-vti maintainer-clean-info \
|
||||
maintainer-clean-generic distclean
|
||||
maintainer-clean-generic distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default mostlyclean-vti distclean-vti clean-vti \
|
||||
maintainer-clean-vti install-info uninstall-info mostlyclean-info \
|
||||
maintainer-clean-vti install-info-am uninstall-info mostlyclean-info \
|
||||
distclean-info clean-info maintainer-clean-info tags distdir info dvi \
|
||||
check installcheck install-exec install-data install uninstall all \
|
||||
installcheck install-exec install-data install uninstall all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .texi .texinfo .info .dvi
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
@ifinfo
|
||||
@set Francois Franc,ois
|
||||
@end ifinfo
|
||||
@tex
|
||||
@set Francois Fran\noexpand\ptexc cois
|
||||
@end tex
|
||||
|
||||
@node Date input formats
|
||||
@chapter Date input formats
|
||||
|
||||
@@ -77,7 +70,7 @@ many flavors of items:
|
||||
@item time zone items
|
||||
@item day of the week items
|
||||
@item relative items
|
||||
@item pure numbers.
|
||||
@item pure numbers.
|
||||
@end itemize
|
||||
|
||||
@noindent We describe each of these item types in turn, below.
|
||||
@@ -113,7 +106,7 @@ zeros on numbers are ignored.
|
||||
|
||||
@cindex calendar date item
|
||||
|
||||
A @dfn{calendar date item} specifies a day of the year. It is
|
||||
A @dfn{calendar date item} specifies a day of the year. It is
|
||||
specified differently, depending on whether the month is specified
|
||||
numerically or literally. All these strings specify the same calendar date:
|
||||
|
||||
@@ -503,6 +496,6 @@ and others.
|
||||
|
||||
@cindex Pinard, F.
|
||||
@cindex Berry, K.
|
||||
This chapter was originally produced by @value{Francois} Pinard
|
||||
This chapter was originally produced by Fran@,{c}ois Pinard
|
||||
(@samp{pinard@@iro.umontreal.ca}) from the @file{getdate.y} source code,
|
||||
and then edited by K.@: Berry (@samp{kb@@cs.umb.edu}).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
# mdate-sh - get modification time of a file and pretty-print it
|
||||
# Copyright (C) 1995 Software Foundation, Inc.
|
||||
# mdate-sh - get modification time of a file and pretty-print it.
|
||||
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
# Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -18,12 +18,7 @@
|
||||
@syncodeindex pg cp
|
||||
@syncodeindex vr cp
|
||||
|
||||
@ifinfo
|
||||
@set Francois Franc,ois
|
||||
@end ifinfo
|
||||
@tex
|
||||
@set Francois Fran\noexpand\ptexc cois
|
||||
@end tex
|
||||
@set Francois Fran@,{c}ois
|
||||
|
||||
@ifinfo
|
||||
@format
|
||||
@@ -172,7 +167,7 @@ The GNU shell utilities are mostly compatible with the POSIX.2 standard.
|
||||
@c This paragraph appears in all of fileutils.texi, textutils.texi, and
|
||||
@c sh-utils.texi too -- so be sure to keep them consistent.
|
||||
@cindex bugs, reporting
|
||||
Please report bugs to @samp{bug-gnu-utils@@prep.ai.mit.edu}. Remember
|
||||
Please report bugs to @samp{sh-utils-bugs@@gnu.ai.mit.edu}. Remember
|
||||
to include the version number, machine architecture, input files, and
|
||||
any other information needed to reproduce the bug: your input, what you
|
||||
expected, what you got, and why it is wrong. Diffs are welcome, but
|
||||
@@ -184,7 +179,7 @@ sometimes difficult to infer. @xref{Bugs, , , gcc, GNU CC}.
|
||||
@cindex Meyering, Jim
|
||||
@c Sorry, but the @value trick doesn't work with TeX in indexing
|
||||
@c commands, and I don't want to fix it right now. --karl.
|
||||
@cindex Pinard, Francois
|
||||
@cindex Pinard, @value{Francois}
|
||||
@cindex Berry, Karl
|
||||
@cindex Stallman, Richard
|
||||
This manual is based on the Unix man pages in the distribution, which
|
||||
@@ -724,7 +719,7 @@ Exit status:
|
||||
@menu
|
||||
* Relations for expr:: | & < <= = == != >= >
|
||||
* Numeric expressions:: + - * / %
|
||||
* String expressions:: : match substr index length
|
||||
* String expressions:: <colon> match substr index length
|
||||
* Examples of expr:: Examples.
|
||||
@end menu
|
||||
|
||||
@@ -2504,6 +2499,13 @@ Print the machine (hardware) type.
|
||||
@cindex network node name
|
||||
Print the machine's network node hostname.
|
||||
|
||||
@item -p
|
||||
@itemx --processor
|
||||
@opindex -p
|
||||
@opindex --processor
|
||||
@cindex host processor type
|
||||
Print the machine's processor type
|
||||
|
||||
@item -r
|
||||
@itemx --release
|
||||
@opindex -r
|
||||
|
||||
449
doc/texinfo.tex
449
doc/texinfo.tex
@@ -35,7 +35,7 @@
|
||||
|
||||
% This automatically updates the version number based on RCS.
|
||||
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
|
||||
\deftexinfoversion$Revision: 1.11 $
|
||||
\deftexinfoversion$Revision: 1.12 $
|
||||
\message{Loading texinfo package [Version \texinfoversion]:}
|
||||
|
||||
% If in a .fmt file, print the version number
|
||||
@@ -46,20 +46,20 @@
|
||||
|
||||
% Save some parts of plain tex whose names we will redefine.
|
||||
|
||||
\let\ptextilde=\~
|
||||
\let\ptexb=\b
|
||||
\let\ptexbullet=\bullet
|
||||
\let\ptexc=\c
|
||||
\let\ptexcomma=\,
|
||||
\let\ptexdot=\.
|
||||
\let\ptexdots=\dots
|
||||
\let\ptexend=\end
|
||||
\let\ptexequiv = \equiv
|
||||
\let\ptexi=\i
|
||||
\let\ptexlbrace=\{
|
||||
\let\ptexrbrace=\}
|
||||
\let\ptexdots=\dots
|
||||
\let\ptexdot=\.
|
||||
\let\ptexstar=\*
|
||||
\let\ptexend=\end
|
||||
\let\ptexbullet=\bullet
|
||||
\let\ptexb=\b
|
||||
\let\ptexc=\c
|
||||
\let\ptexi=\i
|
||||
\let\ptext=\t
|
||||
\let\ptexl=\l
|
||||
\let\ptexL=\L
|
||||
\let\ptextilde=\~
|
||||
|
||||
% Be sure we're in horizontal mode when doing a tie, since we make space
|
||||
% equivalent to this in @example-like environments. Otherwise, a space
|
||||
@@ -104,10 +104,9 @@
|
||||
\hyphenation{eshell}
|
||||
|
||||
% Margin to add to right of even pages, to left of odd pages.
|
||||
\newdimen \bindingoffset \bindingoffset=0pt
|
||||
\newdimen \normaloffset \normaloffset=\hoffset
|
||||
\newdimen \bindingoffset
|
||||
\newdimen \normaloffset
|
||||
\newdimen\pagewidth \newdimen\pageheight
|
||||
\pagewidth=\hsize \pageheight=\vsize
|
||||
|
||||
% Sometimes it is convenient to have everything in the transcript file
|
||||
% and nothing on the terminal. We don't just call \tracingall here,
|
||||
@@ -128,7 +127,7 @@
|
||||
\newdimen\cornerlong \newdimen\cornerthick
|
||||
\newdimen \topandbottommargin
|
||||
\newdimen \outerhsize \newdimen \outervsize
|
||||
\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
|
||||
\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
|
||||
\outerhsize=7in
|
||||
%\outervsize=9.5in
|
||||
% Alternative @smallbook page size is 9.25in
|
||||
@@ -138,15 +137,24 @@
|
||||
%---------------------End change-----------------------
|
||||
|
||||
% \onepageout takes a vbox as an argument. Note that \pagecontents
|
||||
% does insertions itself, but you have to call it yourself.
|
||||
% does insertions, but you have to call it yourself.
|
||||
\chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
|
||||
\def\onepageout#1{\hoffset=\normaloffset
|
||||
\ifodd\pageno \advance\hoffset by \bindingoffset
|
||||
\else \advance\hoffset by -\bindingoffset\fi
|
||||
{\escapechar=`\\\relax % makes sure backslash is used in output files.
|
||||
\shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
|
||||
{\let\hsize=\pagewidth \makefootline}}}%
|
||||
\advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
|
||||
\def\onepageout#1{%
|
||||
\hoffset=\normaloffset
|
||||
\ifodd\pageno \advance\hoffset by \bindingoffset
|
||||
\else \advance\hoffset by -\bindingoffset\fi
|
||||
{%
|
||||
\escapechar = `\\ % use backslash in output files.
|
||||
\indexdummies
|
||||
\shipout\vbox{%
|
||||
{\let\hsize=\pagewidth \makeheadline}%
|
||||
\pagebody{#1}%
|
||||
{\let\hsize=\pagewidth \makefootline}%
|
||||
}%
|
||||
}%
|
||||
\advancepageno
|
||||
\ifnum\outputpenalty>-20000 \else\dosupereject\fi
|
||||
}
|
||||
|
||||
%%%% For @cropmarks command %%%%
|
||||
|
||||
@@ -158,8 +166,8 @@
|
||||
%
|
||||
\def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
|
||||
{\escapechar=`\\\relax % makes sure backslash is used in output files.
|
||||
\shipout
|
||||
\vbox to \outervsize{\hsize=\outerhsize
|
||||
\shipout
|
||||
\vbox to \outervsize{\hsize=\outerhsize
|
||||
\vbox{\line{\ewtop\hfill\ewtop}}
|
||||
\nointerlineskip
|
||||
\line{\vbox{\moveleft\cornerthick\nstop}
|
||||
@@ -167,19 +175,19 @@
|
||||
\vbox{\moveright\cornerthick\nstop}}
|
||||
\vskip \topandbottommargin
|
||||
\centerline{\ifodd\pageno\hskip\bindingoffset\fi
|
||||
\vbox{
|
||||
{\let\hsize=\pagewidth \makeheadline}
|
||||
\pagebody{#1}
|
||||
{\let\hsize=\pagewidth \makefootline}}
|
||||
\ifodd\pageno\else\hskip\bindingoffset\fi}
|
||||
\vskip \topandbottommargin plus1fill minus1fill
|
||||
\vbox{
|
||||
{\let\hsize=\pagewidth \makeheadline}
|
||||
\pagebody{#1}
|
||||
{\let\hsize=\pagewidth \makefootline}}
|
||||
\ifodd\pageno\else\hskip\bindingoffset\fi}
|
||||
\vskip \topandbottommargin plus1fill minus1fill
|
||||
\boxmaxdepth\cornerthick
|
||||
\line{\vbox{\moveleft\cornerthick\nsbot}
|
||||
\hfill
|
||||
\vbox{\moveright\cornerthick\nsbot}}
|
||||
\nointerlineskip
|
||||
\vbox{\line{\ewbot\hfill\ewbot}}
|
||||
}}
|
||||
}}
|
||||
\advancepageno
|
||||
\ifnum\outputpenalty>-20000 \else\dosupereject\fi}
|
||||
%
|
||||
@@ -367,11 +375,43 @@
|
||||
%\def\'{{'}}
|
||||
|
||||
% Used to generate quoted braces.
|
||||
|
||||
\def\mylbrace {{\tt \char '173}}
|
||||
\def\myrbrace {{\tt \char '175}}
|
||||
\let\{=\mylbrace
|
||||
\let\}=\myrbrace
|
||||
\begingroup
|
||||
% Definitions to produce actual \{ & \} command in an index.
|
||||
\catcode`\{ = 12 \catcode`\} = 12
|
||||
\catcode`\[ = 1 \catcode`\] = 2
|
||||
\catcode`\@ = 0 \catcode`\\ = 12
|
||||
@gdef@lbracecmd[\{]%
|
||||
@gdef@rbracecmd[\}]%
|
||||
@endgroup
|
||||
|
||||
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
|
||||
% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
|
||||
\let\, = \c
|
||||
\let\dotaccent = \.
|
||||
\def\ringaccent#1{{\accent23 #1}}
|
||||
\let\tieaccent = \t
|
||||
\let\ubaraccent = \b
|
||||
\let\udotaccent = \d
|
||||
|
||||
% Other special characters: @questiondown @exclamdown
|
||||
% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
|
||||
\def\questiondown{?`}
|
||||
\def\exclamdown{!`}
|
||||
|
||||
% Dotless i and dotless j, used for accents.
|
||||
\def\imacro{i}
|
||||
\def\jmacro{j}
|
||||
\def\dotless#1{%
|
||||
\def\temp{#1}%
|
||||
\ifx\temp\imacro \ptexi
|
||||
\else\ifx\temp\jmacro \j
|
||||
\else \errmessage{@dotless can be used only with i or j}%
|
||||
\fi\fi
|
||||
}
|
||||
|
||||
% @: forces normal size whitespace following.
|
||||
\def\:{\spacefactor=1000 }
|
||||
@@ -726,6 +766,7 @@ where each line of input produces a line of output.}
|
||||
\immediate\write16{If you are running another version of TeX, relax.}
|
||||
\immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
|
||||
\immediate\write16{ Then upgrade your TeX installation if you can.}
|
||||
\immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
|
||||
\immediate\write16{If you are stuck with version 3.0, run the}
|
||||
\immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
|
||||
\immediate\write16{ to use a workaround.}
|
||||
@@ -831,9 +872,9 @@ where each line of input produces a line of output.}
|
||||
% @value{foo} gets the text saved in variable foo.
|
||||
%
|
||||
\def\value#1{\expandafter
|
||||
\ifx\csname SET#1\endcsname\relax
|
||||
{\{No value for ``#1''\}}
|
||||
\else \csname SET#1\endcsname \fi}
|
||||
\ifx\csname SET#1\endcsname\relax
|
||||
{\{No value for ``#1''\}}
|
||||
\else \csname SET#1\endcsname \fi}
|
||||
|
||||
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
|
||||
% with @set.
|
||||
@@ -933,6 +974,7 @@ where each line of input produces a line of output.}
|
||||
\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
|
||||
\global\let\lastnode=\relax}
|
||||
|
||||
% @refill is a no-op.
|
||||
\let\refill=\relax
|
||||
|
||||
% @setfilename is done at the beginning of every texinfo file.
|
||||
@@ -995,7 +1037,7 @@ where each line of input produces a line of output.}
|
||||
\fi
|
||||
% Support font families that don't use the same naming scheme as CM.
|
||||
\def\rmshape{r}
|
||||
\def\rmbshape{bx} %where the normal face is bold
|
||||
\def\rmbshape{bx} %where the normal face is bold
|
||||
\def\bfshape{b}
|
||||
\def\bxshape{bx}
|
||||
\def\ttshape{tt}
|
||||
@@ -1082,9 +1124,9 @@ where each line of input produces a line of output.}
|
||||
% \setfont\ssectt\ttshape{10}{\magstep1}
|
||||
% \setfont\ssecsf\sfshape{10}{\magstep1}
|
||||
|
||||
%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
|
||||
%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
|
||||
%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
|
||||
%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
|
||||
%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
|
||||
%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
|
||||
%\setfont\ssectt\ttshape{10}{1315}
|
||||
%\setfont\ssecsf\sfshape{10}{1315}
|
||||
|
||||
@@ -1287,12 +1329,15 @@ where each line of input produces a line of output.}
|
||||
|
||||
\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
|
||||
|
||||
\def\l#1{{\li #1}\null} %
|
||||
% @l was never documented to mean ``switch to the Lisp font'',
|
||||
% and it is not used as such in any manual I can find. We need it for
|
||||
% Polish suppressed-l. --karl, 22sep96.
|
||||
%\def\l#1{{\li #1}\null}
|
||||
|
||||
\def\r#1{{\rm #1}} % roman font
|
||||
\def\r#1{{\rm #1}} % roman font
|
||||
% Use of \lowercase was suggested.
|
||||
\def\sc#1{{\smallcaps#1}} % smallcaps font
|
||||
\def\ii#1{{\it #1}} % italic font
|
||||
\def\sc#1{{\smallcaps#1}} % smallcaps font
|
||||
\def\ii#1{{\it #1}} % italic font
|
||||
|
||||
% @pounds{} is a sterling sign.
|
||||
\def\pounds{{\it\$}}
|
||||
@@ -1311,7 +1356,7 @@ where each line of input produces a line of output.}
|
||||
|
||||
\def\shorttitlepage{\parsearg\shorttitlepagezzz}
|
||||
\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
|
||||
\endgroup\page\hbox{}\page}
|
||||
\endgroup\page\hbox{}\page}
|
||||
|
||||
\def\titlepage{\begingroup \parindent=0pt \textfonts
|
||||
\let\subtitlerm=\tenrm
|
||||
@@ -1328,9 +1373,9 @@ where each line of input produces a line of output.}
|
||||
% Now you can print the title using @title.
|
||||
\def\title{\parsearg\titlezzz}%
|
||||
\def\titlezzz##1{\leftline{\titlefont{##1}}
|
||||
% print a rule at the page bottom also.
|
||||
\finishedtitlepagefalse
|
||||
\vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
|
||||
% print a rule at the page bottom also.
|
||||
\finishedtitlepagefalse
|
||||
\vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
|
||||
% No rule at page bottom unless we print one at the top with @title.
|
||||
\finishedtitlepagetrue
|
||||
%
|
||||
@@ -1348,7 +1393,7 @@ where each line of input produces a line of output.}
|
||||
\let\oldpage = \page
|
||||
\def\page{%
|
||||
\iffinishedtitlepage\else
|
||||
\finishtitlepage
|
||||
\finishtitlepage
|
||||
\fi
|
||||
\oldpage
|
||||
\let\page = \oldpage
|
||||
@@ -1436,12 +1481,12 @@ where each line of input produces a line of output.}
|
||||
%
|
||||
}% unbind the catcode of @.
|
||||
|
||||
% @headings double turns headings on for double-sided printing.
|
||||
% @headings single turns headings on for single-sided printing.
|
||||
% @headings off turns them off.
|
||||
% @headings on same as @headings double, retained for compatibility.
|
||||
% @headings after turns on double-sided headings after this page.
|
||||
% @headings doubleafter turns on double-sided headings after this page.
|
||||
% @headings double turns headings on for double-sided printing.
|
||||
% @headings single turns headings on for single-sided printing.
|
||||
% @headings off turns them off.
|
||||
% @headings on same as @headings double, retained for compatibility.
|
||||
% @headings after turns on double-sided headings after this page.
|
||||
% @headings doubleafter turns on double-sided headings after this page.
|
||||
% @headings singleafter turns on single-sided headings after this page.
|
||||
% By default, they are off at the start of a document,
|
||||
% and turned `on' after @end titlepage.
|
||||
@@ -1929,7 +1974,8 @@ July\or August\or September\or October\or November\or December\fi
|
||||
% We don't need this so we don't use it.
|
||||
\else
|
||||
\global\advance\colcount by1
|
||||
\setbox0=\hbox{#1}%
|
||||
\setbox0=\hbox{#1 }% Add a normal word space as a separator;
|
||||
% typically that is always in the input, anyway.
|
||||
\expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
|
||||
\fi%
|
||||
\fi%
|
||||
@@ -1990,7 +2036,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
% In either case we will make \leftskip=\multitablecolspace:
|
||||
\leftskip=\multitablecolspace
|
||||
\fi
|
||||
\noindent##}\cr%
|
||||
\noindent##\multistrut}\cr%
|
||||
% \everycr will reset column counter, \colcount, at the end of
|
||||
% each line. Every column entry will cause \colcount to advance by one.
|
||||
% The table preamble
|
||||
@@ -2003,11 +2049,10 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
|
||||
% If so, do nothing. If not, give it an appropriate dimension based on
|
||||
% current baselineskip.
|
||||
\setbox0=\vbox{Xy}
|
||||
\ifdim\multitablelinespace=0pt
|
||||
%% strut to put in table in case some entry doesn't have descenders,
|
||||
%% to keep lines equally spaced
|
||||
\gdef\multistrut{\vrule height\ht0 depth\dp0 width0pt\relax}
|
||||
\let\multistrut = \strut
|
||||
%% Test to see if parskip is larger than space between lines of
|
||||
%% table. If not, do nothing.
|
||||
%% If so, set to same dimension as multitablelinespace.
|
||||
@@ -2038,14 +2083,14 @@ width0pt\relax} \fi
|
||||
% It automatically defines \fooindex such that
|
||||
% \fooindex ...rest of line... puts an entry in the index foo.
|
||||
% It also defines \fooindfile to be the number of the output channel for
|
||||
% the file that accumulates this index. The file's extension is foo.
|
||||
% the file that accumulates this index. The file's extension is foo.
|
||||
% The name of an index should be no more than 2 characters long
|
||||
% for the sake of vms.
|
||||
|
||||
\def\newindex #1{
|
||||
\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
|
||||
\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
|
||||
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
|
||||
\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
|
||||
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
|
||||
\noexpand\doindex {#1}}
|
||||
}
|
||||
|
||||
@@ -2057,8 +2102,8 @@ width0pt\relax} \fi
|
||||
|
||||
\def\newcodeindex #1{
|
||||
\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
|
||||
\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
|
||||
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
|
||||
\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
|
||||
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
|
||||
\noexpand\docodeindex {#1}}
|
||||
}
|
||||
|
||||
@@ -2069,7 +2114,7 @@ width0pt\relax} \fi
|
||||
\def\synindex #1 #2 {%
|
||||
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
|
||||
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
|
||||
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
|
||||
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
|
||||
\noexpand\doindex {#2}}%
|
||||
}
|
||||
|
||||
@@ -2078,7 +2123,7 @@ width0pt\relax} \fi
|
||||
\def\syncodeindex #1 #2 {%
|
||||
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
|
||||
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
|
||||
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
|
||||
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
|
||||
\noexpand\docodeindex {#2}}%
|
||||
}
|
||||
|
||||
@@ -2126,24 +2171,31 @@ width0pt\relax} \fi
|
||||
\def\L{\realbackslash L}%
|
||||
\def\ss{\realbackslash ss}%
|
||||
% Take care of texinfo commands likely to appear in an index entry.
|
||||
% (Must be a way to avoid doing expansion at all, and thus not have to
|
||||
% laboriously list every single command here.)
|
||||
\def\@{@}% will be @@ when we switch to @ as escape char.
|
||||
%\let\{ = \lbracecmd
|
||||
%\let\} = \rbracecmd
|
||||
\def\_{{\realbackslash _}}%
|
||||
\def\w{\realbackslash w }%
|
||||
\def\bf{\realbackslash bf }%
|
||||
\def\rm{\realbackslash rm }%
|
||||
%\def\rm{\realbackslash rm }%
|
||||
\def\sl{\realbackslash sl }%
|
||||
\def\sf{\realbackslash sf}%
|
||||
\def\tt{\realbackslash tt}%
|
||||
\def\gtr{\realbackslash gtr}%
|
||||
\def\less{\realbackslash less}%
|
||||
\def\hat{\realbackslash hat}%
|
||||
\def\char{\realbackslash char}%
|
||||
%\def\char{\realbackslash char}%
|
||||
\def\TeX{\realbackslash TeX}%
|
||||
\def\dots{\realbackslash dots }%
|
||||
\def\copyright{\realbackslash copyright }%
|
||||
\def\tclose##1{\realbackslash tclose {##1}}%
|
||||
\def\code##1{\realbackslash code {##1}}%
|
||||
\def\dotless##1{\realbackslash dotless {##1}}%
|
||||
\def\samp##1{\realbackslash samp {##1}}%
|
||||
\def\t##1{\realbackslash r {##1}}%
|
||||
\def\,##1{\realbackslash ,{##1}}%
|
||||
\def\t##1{\realbackslash t {##1}}%
|
||||
\def\r##1{\realbackslash r {##1}}%
|
||||
\def\i##1{\realbackslash i {##1}}%
|
||||
\def\b##1{\realbackslash b {##1}}%
|
||||
@@ -2171,6 +2223,7 @@ width0pt\relax} \fi
|
||||
|
||||
\def\indexnofonts{%
|
||||
% Just ignore accents.
|
||||
\let\,=\indexdummyfont
|
||||
\let\"=\indexdummyfont
|
||||
\let\`=\indexdummyfont
|
||||
\let\'=\indexdummyfont
|
||||
@@ -2183,6 +2236,7 @@ width0pt\relax} \fi
|
||||
\let\u=\indexdummyfont
|
||||
\let\v=\indexdummyfont
|
||||
\let\H=\indexdummyfont
|
||||
\let\dotless=\indexdummyfont
|
||||
% Take care of the plain tex special European modified letters.
|
||||
\def\oe{oe}%
|
||||
\def\ae{ae}%
|
||||
@@ -2216,6 +2270,7 @@ width0pt\relax} \fi
|
||||
\let\var=\indexdummyfont
|
||||
\let\TeX=\indexdummytex
|
||||
\let\dots=\indexdummydots
|
||||
\def\@{@}%
|
||||
}
|
||||
|
||||
% To define \realbackslash, we must make \ not be an escape.
|
||||
@@ -2231,29 +2286,37 @@ width0pt\relax} \fi
|
||||
% workhorse for all \fooindexes
|
||||
% #1 is name of index, #2 is stuff to put there
|
||||
\def\doind #1#2{%
|
||||
% Put the index entry in the margin if desired.
|
||||
\ifx\SETmarginindex\relax\else%
|
||||
\insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
|
||||
\fi%
|
||||
{\count10=\lastpenalty %
|
||||
{\indexdummies % Must do this here, since \bf, etc expand at this stage
|
||||
\escapechar=`\\%
|
||||
{\let\folio=0% Expand all macros now EXCEPT \folio
|
||||
\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
|
||||
% so it will be output as is; and it will print as backslash in the indx.
|
||||
%
|
||||
% Now process the index-string once, with all font commands turned off,
|
||||
% to get the string to sort the index by.
|
||||
{\indexnofonts
|
||||
\xdef\temp1{#2}%
|
||||
}%
|
||||
% Now produce the complete index entry. We process the index-string again,
|
||||
% this time with font commands expanded, to get what to print in the index.
|
||||
\edef\temp{%
|
||||
\write \csname#1indfile\endcsname{%
|
||||
\realbackslash entry {\temp1}{\folio}{#2}}}%
|
||||
\temp }%
|
||||
}\penalty\count10}}
|
||||
% Put the index entry in the margin if desired.
|
||||
\ifx\SETmarginindex\relax\else
|
||||
\insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
|
||||
\fi
|
||||
{%
|
||||
\count255=\lastpenalty
|
||||
{%
|
||||
\indexdummies % Must do this here, since \bf, etc expand at this stage
|
||||
\escapechar=`\\
|
||||
{%
|
||||
\let\folio=0 % We will expand all macros now EXCEPT \folio.
|
||||
\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
|
||||
% so it will be output as is; and it will print as backslash.
|
||||
%
|
||||
% First process the index-string with all font commands turned off
|
||||
% to get the string to sort by.
|
||||
{\indexnofonts \xdef\indexsorttmp{#2}}%
|
||||
%
|
||||
% Now produce the complete index entry, with both the sort key and the
|
||||
% original text, including any font commands.
|
||||
\toks0 = {#2}%
|
||||
\edef\temp{%
|
||||
\write\csname#1indfile\endcsname{%
|
||||
\realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
|
||||
}%
|
||||
\temp
|
||||
}%
|
||||
}%
|
||||
\penalty\count255
|
||||
}%
|
||||
}
|
||||
|
||||
\def\dosubind #1#2#3{%
|
||||
{\count10=\lastpenalty %
|
||||
@@ -2325,6 +2388,8 @@ width0pt\relax} \fi
|
||||
% character. It would be better to use @, but that's too big a change
|
||||
% to make right now.
|
||||
\catcode`\\ = 0
|
||||
\catcode`\@ = 11
|
||||
\escapechar = `\\
|
||||
\begindoublecolumns
|
||||
%
|
||||
% See if the index file exists and is nonempty.
|
||||
@@ -2440,15 +2505,15 @@ width0pt\relax} \fi
|
||||
\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
|
||||
}}
|
||||
|
||||
%% Define two-column mode, which is used in indexes.
|
||||
%% Adapted from the TeXbook, page 416.
|
||||
\catcode `\@=11
|
||||
% Define two-column mode, which we use to typeset indexes.
|
||||
% Adapted from the TeXbook, page 416, which is to say,
|
||||
% the manmac.tex format used to print the TeXbook itself.
|
||||
\catcode`\@=11
|
||||
|
||||
\newbox\partialpage
|
||||
|
||||
\newdimen\doublecolumnhsize
|
||||
|
||||
\def\begindoublecolumns{\begingroup
|
||||
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
|
||||
% Grab any single-column material above us.
|
||||
\output = {\global\setbox\partialpage
|
||||
=\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}%
|
||||
@@ -2481,48 +2546,47 @@ width0pt\relax} \fi
|
||||
% Double the \vsize as well. (We don't need a separate register here,
|
||||
% since nobody clobbers \vsize.)
|
||||
\vsize = 2\vsize
|
||||
\doublecolumnpagegoal
|
||||
}
|
||||
|
||||
\def\enddoublecolumns{\eject \endgroup \pagegoal=\vsize \unvbox\partialpage}
|
||||
|
||||
\def\doublecolumnsplit{\splittopskip=\topskip \splitmaxdepth=\maxdepth
|
||||
\global\dimen@=\pageheight \global\advance\dimen@ by-\ht\partialpage
|
||||
\global\setbox1=\vsplit255 to\dimen@ \global\setbox0=\vbox{\unvbox1}
|
||||
\global\setbox3=\vsplit255 to\dimen@ \global\setbox2=\vbox{\unvbox3}
|
||||
\ifdim\ht0>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi
|
||||
\ifdim\ht2>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi
|
||||
}
|
||||
\def\doublecolumnpagegoal{%
|
||||
\dimen@=\vsize \advance\dimen@ by-2\ht\partialpage \global\pagegoal=\dimen@
|
||||
}
|
||||
\def\pagesofar{\unvbox\partialpage %
|
||||
\hsize=\doublecolumnhsize % have to restore this since output routine
|
||||
\wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
|
||||
\def\doublecolumnout{%
|
||||
\setbox5=\copy255
|
||||
{\vbadness=10000 \doublecolumnsplit}
|
||||
\ifvbox255
|
||||
\setbox0=\vtop to\dimen@{\unvbox0}
|
||||
\setbox2=\vtop to\dimen@{\unvbox2}
|
||||
\onepageout\pagesofar \unvbox255 \penalty\outputpenalty
|
||||
\else
|
||||
\setbox0=\vbox{\unvbox5}
|
||||
\ifvbox0
|
||||
\dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
|
||||
\divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth
|
||||
{\vbadness=10000
|
||||
\loop \global\setbox5=\copy0
|
||||
\setbox1=\vsplit5 to\dimen@
|
||||
\setbox3=\vsplit5 to\dimen@
|
||||
\ifvbox5 \global\advance\dimen@ by1pt \repeat
|
||||
\setbox0=\vbox to\dimen@{\unvbox1}
|
||||
\setbox2=\vbox to\dimen@{\unvbox3}
|
||||
\global\setbox\partialpage=\vbox{\pagesofar}
|
||||
\doublecolumnpagegoal
|
||||
}
|
||||
\fi
|
||||
\fi
|
||||
\splittopskip=\topskip \splitmaxdepth=\maxdepth
|
||||
% Get the available space for the double columns -- the normal
|
||||
% (undoubled) page height minus any material left over from the
|
||||
% previous page.
|
||||
\dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
|
||||
% box0 will be the left-hand column, box1 the right.
|
||||
\setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
|
||||
\onepageout\pagesofar
|
||||
\unvbox255 \penalty\outputpenalty
|
||||
}
|
||||
\def\pagesofar{%
|
||||
% The contents of the output page -- any previous material,
|
||||
% followed by the two boxes we just split.
|
||||
\unvbox\partialpage
|
||||
\hsize = \doublecolumnhsize
|
||||
\wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}%
|
||||
}
|
||||
\def\enddoublecolumns{%
|
||||
\output={\balancecolumns}\eject % split what we have
|
||||
\endgroup
|
||||
% Back to normal single-column typesetting, but take account of the
|
||||
% fact that we just accumulated some stuff on the output page.
|
||||
\pagegoal=\vsize
|
||||
}
|
||||
\def\balancecolumns{%
|
||||
% Called on the last page of the double column material.
|
||||
\setbox0=\vbox{\unvbox255}%
|
||||
\dimen@ = \ht0
|
||||
\advance\dimen@ by \topskip
|
||||
\advance\dimen@ by-\baselineskip
|
||||
\divide\dimen@ by 2
|
||||
\splittopskip = \topskip
|
||||
% Loop until we get a decent breakpoint.
|
||||
{\vbadness=10000 \loop \global\setbox3=\copy0
|
||||
\global\setbox1=\vsplit3 to\dimen@
|
||||
\ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}%
|
||||
\setbox0=\vbox to\dimen@{\unvbox1}%
|
||||
\setbox2=\vbox to\dimen@{\unvbox3}%
|
||||
\pagesofar
|
||||
}
|
||||
\catcode `\@=\other
|
||||
|
||||
@@ -2887,10 +2951,10 @@ width0pt\relax} \fi
|
||||
|
||||
% NOTE on use of \vbox for chapter headings, section headings, and
|
||||
% such:
|
||||
% 1) We use \vbox rather than the earlier \line to permit
|
||||
% overlong headings to fold.
|
||||
% 2) \hyphenpenalty is set to 10000 because hyphenation in a
|
||||
% heading is obnoxious; this forbids it.
|
||||
% 1) We use \vbox rather than the earlier \line to permit
|
||||
% overlong headings to fold.
|
||||
% 2) \hyphenpenalty is set to 10000 because hyphenation in a
|
||||
% heading is obnoxious; this forbids it.
|
||||
% 3) Likewise, headings look best if no \parindent is used, and
|
||||
% if justification is not attempted. Hence \raggedright.
|
||||
|
||||
@@ -3069,12 +3133,12 @@ width0pt\relax} \fi
|
||||
\contentsalignmacro
|
||||
\immediate\closeout \contentsfile
|
||||
\ifnum \pageno>0
|
||||
\pageno = -1 % Request roman numbered pages.
|
||||
\pageno = -1 % Request roman numbered pages.
|
||||
\fi
|
||||
% Don't need to put `Contents' or `Short Contents' in the headline.
|
||||
% It is abundantly clear what they are.
|
||||
\unnumbchapmacro{#1}\def\thischapter{}%
|
||||
\begingroup % Set up to handle contents files properly.
|
||||
\begingroup % Set up to handle contents files properly.
|
||||
\catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
|
||||
\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
|
||||
\raggedbottom % Worry more about breakpoints than the bottom.
|
||||
@@ -3100,6 +3164,7 @@ width0pt\relax} \fi
|
||||
\secfonts
|
||||
\let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
|
||||
\rm
|
||||
\hyphenpenalty = 10000
|
||||
\advance\baselineskip by 1pt % Open it up a little.
|
||||
\def\secentry ##1##2##3##4{}
|
||||
\def\unnumbsecentry ##1##2{}
|
||||
@@ -3143,7 +3208,7 @@ width0pt\relax} \fi
|
||||
% This space should be plenty, since a single number is .5em, and the
|
||||
% widest letter (M) is 1em, at least in the Computer Modern fonts.
|
||||
% (This space doesn't include the extra space that gets added after
|
||||
% the label; that gets put in in \shortchapentry above.)
|
||||
% the label; that gets put in by \shortchapentry above.)
|
||||
\advance\dimen0 by 1.1em
|
||||
\hbox to \dimen0{#1\hfil}%
|
||||
}
|
||||
@@ -3164,22 +3229,21 @@ width0pt\relax} \fi
|
||||
\dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
|
||||
\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
|
||||
|
||||
|
||||
% This parameter controls the indentation of the various levels.
|
||||
\newdimen\tocindent \tocindent = 3pc
|
||||
|
||||
% Now for the actual typesetting. In all these, #1 is the text and #2 is the
|
||||
% page number.
|
||||
%
|
||||
% If the toc has to be broken over pages, we would want to be at chapters
|
||||
% If the toc has to be broken over pages, we want it to be at chapters
|
||||
% if at all possible; hence the \penalty.
|
||||
\def\dochapentry#1#2{%
|
||||
\penalty-300 \vskip\baselineskip
|
||||
\penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
|
||||
\begingroup
|
||||
\chapentryfonts
|
||||
\tocentry{#1}{\dopageno{#2}}%
|
||||
\endgroup
|
||||
\nobreak\vskip .25\baselineskip
|
||||
\nobreak\vskip .25\baselineskip plus.1\baselineskip
|
||||
}
|
||||
|
||||
\def\dosecentry#1#2{\begingroup
|
||||
@@ -3204,7 +3268,7 @@ width0pt\relax} \fi
|
||||
%
|
||||
% \turnoffactive is for the sake of @" used for umlauts.
|
||||
\def\tocentry#1#2{\begingroup
|
||||
\hyphenpenalty = 10000
|
||||
\vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
|
||||
\entry{\turnoffactive #1}{\turnoffactive #2}%
|
||||
\endgroup}
|
||||
|
||||
@@ -3229,8 +3293,6 @@ width0pt\relax} \fi
|
||||
\newbox\pushcharbox \newbox\bullbox
|
||||
\newbox\equivbox \newbox\errorbox
|
||||
|
||||
\let\ptexequiv = \equiv
|
||||
|
||||
%{\tentt
|
||||
%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
|
||||
%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
|
||||
@@ -3277,7 +3339,7 @@ width0pt\relax} \fi
|
||||
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
|
||||
\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
|
||||
\catcode `\%=14
|
||||
\catcode 43=12
|
||||
\catcode 43=12 % plus
|
||||
\catcode`\"=12
|
||||
\catcode`\==12
|
||||
\catcode`\|=12
|
||||
@@ -3285,6 +3347,7 @@ width0pt\relax} \fi
|
||||
\catcode`\>=12
|
||||
\escapechar=`\\
|
||||
%
|
||||
\let\,=\ptexcomma
|
||||
\let\~=\ptextilde
|
||||
\let\{=\ptexlbrace
|
||||
\let\}=\ptexrbrace
|
||||
@@ -3295,8 +3358,7 @@ width0pt\relax} \fi
|
||||
\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}
|
||||
\def\@{@}%
|
||||
\let\bullet=\ptexbullet
|
||||
\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
|
||||
\let\L=\ptexL
|
||||
\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext
|
||||
%
|
||||
\let\Etex=\endgroup}
|
||||
|
||||
@@ -3355,50 +3417,50 @@ width0pt\relax} \fi
|
||||
\def\cbl{{\circle\char'012\hskip -6pt}}
|
||||
\def\cbr{{\hskip 6pt\circle\char'011}}
|
||||
\def\carttop{\hbox to \cartouter{\hskip\lskip
|
||||
\ctl\leaders\hrule height\circthick\hfil\ctr
|
||||
\hskip\rskip}}
|
||||
\ctl\leaders\hrule height\circthick\hfil\ctr
|
||||
\hskip\rskip}}
|
||||
\def\cartbot{\hbox to \cartouter{\hskip\lskip
|
||||
\cbl\leaders\hrule height\circthick\hfil\cbr
|
||||
\hskip\rskip}}
|
||||
\cbl\leaders\hrule height\circthick\hfil\cbr
|
||||
\hskip\rskip}}
|
||||
%
|
||||
\newskip\lskip\newskip\rskip
|
||||
|
||||
\long\def\cartouche{%
|
||||
\begingroup
|
||||
\lskip=\leftskip \rskip=\rightskip
|
||||
\leftskip=0pt\rightskip=0pt %we want these *outside*.
|
||||
\cartinner=\hsize \advance\cartinner by-\lskip
|
||||
\advance\cartinner by-\rskip
|
||||
\cartouter=\hsize
|
||||
\advance\cartouter by 18pt % allow for 3pt kerns on either
|
||||
% side, and for 6pt waste from
|
||||
% each corner char
|
||||
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
|
||||
% Flag to tell @lisp, etc., not to narrow margin.
|
||||
\let\nonarrowing=\comment
|
||||
\vbox\bgroup
|
||||
\baselineskip=0pt\parskip=0pt\lineskip=0pt
|
||||
\carttop
|
||||
\hbox\bgroup
|
||||
\hskip\lskip
|
||||
\vrule\kern3pt
|
||||
\vbox\bgroup
|
||||
\hsize=\cartinner
|
||||
\kern3pt
|
||||
\begingroup
|
||||
\baselineskip=\normbskip
|
||||
\lineskip=\normlskip
|
||||
\parskip=\normpskip
|
||||
\vskip -\parskip
|
||||
\lskip=\leftskip \rskip=\rightskip
|
||||
\leftskip=0pt\rightskip=0pt %we want these *outside*.
|
||||
\cartinner=\hsize \advance\cartinner by-\lskip
|
||||
\advance\cartinner by-\rskip
|
||||
\cartouter=\hsize
|
||||
\advance\cartouter by 18pt % allow for 3pt kerns on either
|
||||
% side, and for 6pt waste from
|
||||
% each corner char
|
||||
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
|
||||
% Flag to tell @lisp, etc., not to narrow margin.
|
||||
\let\nonarrowing=\comment
|
||||
\vbox\bgroup
|
||||
\baselineskip=0pt\parskip=0pt\lineskip=0pt
|
||||
\carttop
|
||||
\hbox\bgroup
|
||||
\hskip\lskip
|
||||
\vrule\kern3pt
|
||||
\vbox\bgroup
|
||||
\hsize=\cartinner
|
||||
\kern3pt
|
||||
\begingroup
|
||||
\baselineskip=\normbskip
|
||||
\lineskip=\normlskip
|
||||
\parskip=\normpskip
|
||||
\vskip -\parskip
|
||||
\def\Ecartouche{%
|
||||
\endgroup
|
||||
\kern3pt
|
||||
\egroup
|
||||
\kern3pt\vrule
|
||||
\hskip\rskip
|
||||
\egroup
|
||||
\cartbot
|
||||
\egroup
|
||||
\endgroup
|
||||
\kern3pt
|
||||
\egroup
|
||||
\kern3pt\vrule
|
||||
\hskip\rskip
|
||||
\egroup
|
||||
\cartbot
|
||||
\egroup
|
||||
\endgroup
|
||||
}}
|
||||
|
||||
@@ -4441,6 +4503,11 @@ width0pt\relax} \fi
|
||||
\global\pageheight=\vsize
|
||||
}
|
||||
|
||||
\bindingoffset=0pt
|
||||
\normaloffset=\hoffset
|
||||
\pagewidth=\hsize
|
||||
\pageheight=\vsize
|
||||
|
||||
% Allow control of the text dimensions. Parameters in order: textheight;
|
||||
% textwidth; voffset; hoffset; binding offset; topskip.
|
||||
% All require a dimension;
|
||||
|
||||
@@ -16,13 +16,6 @@
|
||||
@syncodeindex pg cp
|
||||
@syncodeindex vr cp
|
||||
|
||||
@ifinfo
|
||||
@set Francois Franc,ois
|
||||
@end ifinfo
|
||||
@tex
|
||||
@set Francois Fran\noexpand\ptexc cois
|
||||
@end tex
|
||||
|
||||
@ifinfo
|
||||
@format
|
||||
START-INFO-DIR-ENTRY
|
||||
@@ -150,7 +143,7 @@ The GNU text utilities are mostly compatible with the @sc{POSIX.2} standard.
|
||||
@c This paragraph appears in all of fileutils.texi, textutils.texi, and
|
||||
@c sh-utils.texi too -- so be sure to keep them consistent.
|
||||
@cindex bugs, reporting
|
||||
Please report bugs to @samp{bug-gnu-utils@@prep.ai.mit.edu}. Remember
|
||||
Please report bugs to @samp{textutils-bugs@@gnu.ai.mit.edu}. Remember
|
||||
to include the version number, machine architecture, input files, and
|
||||
any other information needed to reproduce the bug: your input, what you
|
||||
expected, what you got, and why it is wrong. Diffs are welcome, but
|
||||
@@ -160,7 +153,7 @@ sometimes difficult to infer. @xref{Bugs, , , gcc, GNU CC}.
|
||||
This manual is based on the Unix man pages in the distribution, which
|
||||
were originally written by David MacKenzie and updated by Jim Meyering.
|
||||
The original @code{fmt} man page was written by Ross Paterson.
|
||||
@value{Francois} Pinard did the initial conversion to Texinfo format.
|
||||
Fran@,{c}ois Pinard did the initial conversion to Texinfo format.
|
||||
Karl Berry did the indexing, some reorganization, and editing of the results.
|
||||
Richard Stallman contributed his usual invaluable insights to the
|
||||
overall process.
|
||||
@@ -841,10 +834,12 @@ leaving the code unchanged.
|
||||
@pindex pr
|
||||
@cindex printing, preparing files for
|
||||
@cindex multicolumn output, generating
|
||||
@cindex merging files in parallel
|
||||
|
||||
@code{pr} writes each @var{file} (@samp{-} means standard input), or
|
||||
standard input if none are given, to standard output, paginating and
|
||||
optionally outputting in multicolumn format. Synopsis:
|
||||
optionally outputting in multicolumn format; optionally merges all
|
||||
@var{file}s, printing all in parallel, one per column. Synopsis:
|
||||
|
||||
@example
|
||||
pr [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
@@ -852,33 +847,50 @@ pr [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
|
||||
By default, a 5-line header is printed: two blank lines; a line with the
|
||||
date, the file name, and the page count; and two more blank lines. A
|
||||
five line footer (entirely) is also printed.
|
||||
footer of five blank lines is also printed. With the @samp{-f} option, a
|
||||
3-line header is printed: the leading two blank lines are omitted; no
|
||||
footer used. The default @var{page_length} in both cases is 66 lines.
|
||||
The text line of the header takes up the full @var{page_width} in the
|
||||
form @samp{yy-mm-dd HH:MM string Page nnnn}. String is a centered
|
||||
string.
|
||||
|
||||
Form feeds in the input cause page breaks in the output.
|
||||
Form feeds in the input cause page breaks in the output. Multiple form
|
||||
feeds produce empty pages.
|
||||
|
||||
Columns have equal width, separated by an optional string (default
|
||||
space). Lines will always be truncated to line width (default 72),
|
||||
unless you use the @samp{-j} option. For single column output no line
|
||||
truncation occurs by default. Use @samp{-w} option to truncate lines
|
||||
in that case.
|
||||
|
||||
The program accepts the following options. Also see @ref{Common options}.
|
||||
|
||||
@table @samp
|
||||
|
||||
@item +@var{page}
|
||||
Begin printing with page @var{page}.
|
||||
@item +@var{first_page}[@var{:last_page}]
|
||||
@opindex +@var{first_page}[@var{:last_page}]
|
||||
Begin printing with page @var{first_page} and stop with
|
||||
@var{last_page}. Missing @samp{:LAST_PAGE} implies end of file. While
|
||||
estimating the number of skipped pages each form feed in the input file
|
||||
results in a new page. Page counting with and without
|
||||
@samp{+@var{first_page}} is identical. By default, it starts with the
|
||||
first page of input file (not first page printed). Page numbering may be
|
||||
altered by @samp{-N} option.
|
||||
|
||||
@item -@var{column}
|
||||
@opindex -@var{column}
|
||||
Produce @var{column}-column output and print columns down. The column
|
||||
width is automatically decreased as @var{column} increases; unless you
|
||||
use the @samp{-w} option to increase the page width as well, this option
|
||||
might well cause some input to be truncated.
|
||||
@cindex down columns
|
||||
With each single @var{file}, produce @var{column}-column output and
|
||||
print columns down. The column width is automatically estimated from
|
||||
@var{page_width}. This option might well cause some columns to be
|
||||
truncated. The number of lines in the columns on each page will be
|
||||
balanced. @samp{-@var{column}} may not be used with @samp{-m} option.
|
||||
|
||||
@item -a
|
||||
@opindex -a
|
||||
@cindex across columns
|
||||
Print columns across rather than down.
|
||||
|
||||
@item -b
|
||||
@opindex -b
|
||||
@cindex balancing columns
|
||||
Balance columns on the last page.
|
||||
With each single @var{file}, print columns across rather than down.
|
||||
@var{column} must be greater than one.
|
||||
|
||||
@item -c
|
||||
@opindex -c
|
||||
@@ -903,11 +915,19 @@ is 8).
|
||||
@itemx -F
|
||||
@opindex -F
|
||||
@opindex -f
|
||||
Use a formfeed instead of newlines to separate output pages.
|
||||
Use a form feed instead of newlines to separate output pages. Default
|
||||
page length of 66 lines is not altered. But the number of lines of text
|
||||
per page changes from 56 to 63 lines.
|
||||
|
||||
@item -h @var{header}
|
||||
|
||||
@item -h @var{HEADER}
|
||||
@opindex -h
|
||||
Replace the file name in the header with the string @var{header}.
|
||||
Replace the file name in the header with the centered string
|
||||
@var{header}. Left-hand-side truncation (marked by a @samp{*}) may occur
|
||||
if the total header line @samp{yy-mm-dd HH:MM HEADER Page nnnn}
|
||||
becomes larger than @var{page_width}. @samp{-h ""} prints a blank line
|
||||
header. Don't use @samp{-h""}. A space between the -h option and the
|
||||
argument is always peremptory.
|
||||
|
||||
@item -i[@var{out-tabchar}[@var{out-tabwidth}]]
|
||||
@opindex -i
|
||||
@@ -917,30 +937,54 @@ is the output tab character (default is @key{TAB}). Second optional
|
||||
argument @var{out-tabwidth} is the output tab character's width (default
|
||||
is 8).
|
||||
|
||||
@item -l @var{n}
|
||||
@item -j
|
||||
@opindex -j
|
||||
Merge lines of full length. Used together with the column options
|
||||
@samp{-@var{column}}, @samp{-a -@var{column}} or @samp{-m}. Turns off
|
||||
@samp{-w} line truncation; no column alignment used; may be used with
|
||||
@samp{-s[@var{separator}]}.
|
||||
|
||||
|
||||
@item -l @var{page_length}
|
||||
@opindex -l
|
||||
Set the page length to @var{n} (default 66) lines. If @var{n} is less
|
||||
than 10, the headers and footers are omitted, as if the @samp{-t} option
|
||||
had been given.
|
||||
Set the page length to @var{page_length} (default 66) lines. If
|
||||
@var{page_length} is less than or equal 10 (and <= 3 with @samp{-f}),
|
||||
the headers and footers are omitted, and all form feeds set in input
|
||||
files are eliminated, as if the @samp{-T} option had been given.
|
||||
|
||||
@item -m
|
||||
@opindex -m
|
||||
Print all files in parallel, one in each column.
|
||||
Merge and print all @var{file}s in parallel, one in each column. If a
|
||||
line is too long to fit in a column, it is truncated (but see
|
||||
@samp{-j}). @samp{-s[@var{separator}]} may be used. Empty pages in some
|
||||
@var{file}s (form feeds set) produce empty columns, still marked by
|
||||
@var{separator}. Completely empty common pages show no separators or
|
||||
line numbers. The default header becomes
|
||||
@samp{yy-mm-dd HH:MM <blanks> Page nnnn}; may be used with
|
||||
@samp{-h @var{header}} to fill up the middle part.
|
||||
|
||||
|
||||
@item -n[@var{number-separator}[@var{digits}]]
|
||||
@opindex -n
|
||||
Precede each column with a line number; with parallel files (@samp{-m}),
|
||||
precede each line with a line number. Optional argument
|
||||
Precede each column with a line number; with parallel @var{file}s
|
||||
(@samp{-m}), precede only each line with a line number. Optional argument
|
||||
@var{number-separator} is the character to print after each number
|
||||
(default is @key{TAB}). Optional argument @var{digits} is the number of
|
||||
digits per line number (default is 5).
|
||||
digits per line number (default is 5). Default line counting starts with
|
||||
first line of the input file (not with the first line printed, see
|
||||
@samp{-N}).
|
||||
|
||||
@item -N @var{line_number}
|
||||
@opindex -N
|
||||
Start line counting with no. @var{line_number} at first line of first
|
||||
page printed.
|
||||
|
||||
@item -o @var{n}
|
||||
@opindex -o
|
||||
@cindex indenting lines
|
||||
@cindex left margin
|
||||
Indent each line with @var{n} (default is zero) spaces wide, i.e., set
|
||||
the left margin. The total page width is @samp{n} plus the width set
|
||||
the left margin. The total page width is @var{n} plus the width set
|
||||
with the @samp{-w} option.
|
||||
|
||||
@item -r
|
||||
@@ -948,25 +992,44 @@ with the @samp{-w} option.
|
||||
Do not print a warning message when an argument @var{file} cannot be
|
||||
opened. (The exit status will still be nonzero, however.)
|
||||
|
||||
@item -s[@var{c}]
|
||||
@item -s[@var{separator}]
|
||||
@opindex -s
|
||||
Separate columns by the single character @var{c}. If @var{c} is
|
||||
omitted, the default is space; if this option is omitted altogether, the
|
||||
default is @key{TAB}.
|
||||
Separate columns by a string @var{separator}. Don't use
|
||||
@samp{-s @var{separator}}, no space between flag and argument. If this
|
||||
option is omitted altogether, the default is a space, same as
|
||||
@samp{-s" "}. With @samp{-s} only, no separator is used, same as
|
||||
@samp{-s""}. @samp{-s} does not affect line truncation or column
|
||||
alignment.
|
||||
|
||||
@item -t
|
||||
@opindex -t
|
||||
Do not print the usual 5-line header and the 5-line footer on each page,
|
||||
and do not fill out the bottoms of pages (with blank lines or
|
||||
formfeeds).
|
||||
Do not print the usual header [and footer] on each page, and do not fill
|
||||
out the bottoms of pages (with blank lines or a form feed). No page
|
||||
structure is produced, but retain form feeds set in the input files. The
|
||||
predefined page layout is not changed. @samp{-t} or @samp{-T} may be
|
||||
useful together with other options; e.g.: @samp{-t -e4}, expand
|
||||
@key{TAB} in the input file to 4 spaces but do not do any other changes.
|
||||
Use of @samp{-t} overrides @samp{-h}.
|
||||
|
||||
@item -T
|
||||
@opindex -T
|
||||
Do not print header [and footer]. In addition eliminate all form feeds
|
||||
set in the input files.
|
||||
|
||||
@item -v
|
||||
@opindex -v
|
||||
Print unprintable characters in octal backslash notation.
|
||||
|
||||
@item -w @var{n}
|
||||
@item -w @var{page_width}
|
||||
@opindex -w
|
||||
Set the page width to @var{n} (default is 72) columns.
|
||||
Set the page width to @var{page_width} (default 72) characters.
|
||||
With/without @samp{-w}, header lines are always truncated to
|
||||
@var{page_width} characters. With @samp{-w}, text lines are truncated,
|
||||
unless @samp{-j} is used. Without @samp{-w} together with one of the
|
||||
column options @samp{-@var{column}}, @samp{-a -@var{column}} or
|
||||
@samp{-m}, default truncation of text lines to 72 characters is used.
|
||||
Without @samp{-w} and without any of the column options, no line
|
||||
truncation is used. That's equivalent to @samp{-w 72 -j}.
|
||||
|
||||
@end table
|
||||
|
||||
@@ -1259,7 +1322,7 @@ less than @var{bytes} bytes of the line are left, then continue
|
||||
normally. @var{bytes} has the same format as for the @samp{--bytes}
|
||||
option.
|
||||
|
||||
@itemx --verbose=@var{bytes}
|
||||
@itemx --verbose
|
||||
@opindex --verbose
|
||||
Write a diagnostic to standard error just before each output file is opened.
|
||||
|
||||
|
||||
@@ -7,4 +7,3 @@ safe-lstat.c
|
||||
safe-lstat.h
|
||||
getdate.tab.c
|
||||
.deps
|
||||
group_member.c
|
||||
|
||||
@@ -1,46 +1,25 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
noinst_LIBRARIES = fu
|
||||
noinst_LIBRARIES = libfu.a
|
||||
|
||||
EXTRA_DIST = alloca.c basename.c error.c euidaccess.c fnmatch.c fsusage.c \
|
||||
ftruncate.c getdate.y group-member.c memcmp.c memcpy.c memset.c \
|
||||
mkdir.c mktime.c mountlist.c obstack.c posixtm.y regex.c rx.c \
|
||||
rename.c rmdir.c rpmatch.c \
|
||||
stpcpy.c strcasecmp.c strdup.c strndup.c strstr.c strtol.c strtoul.c
|
||||
## FIXME: Remove mvdir.c, and rmdir.c when
|
||||
## automake is fixed -- probably for 1.1g
|
||||
EXTRA_DIST = mkdir.c rmdir.c getline.c mktime.c strftime.c getgroups.c
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir)
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
|
||||
fu_SOURCES = getdate.c getline.c getopt.c getopt1.c posixtm.c \
|
||||
argmatch.c backupfile.c \
|
||||
dirname.c fileblocks.c filemode.c \
|
||||
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
|
||||
argmatch.c backupfile.c dirname.c filemode.c \
|
||||
full-write.c getversion.c idcache.c \
|
||||
isdir.c long-options.c makepath.c modechange.c path-concat.c \
|
||||
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
|
||||
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
|
||||
|
||||
fu_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
|
||||
|
||||
noinst_HEADERS = argmatch.h backupfile.h error.h fnmatch.h fsusage.h \
|
||||
getline.h getopt.h group-member.h long-options.h makepath.h modechange.h \
|
||||
mountlist.h obstack.h path-concat.h pathmax.h regex.h rx.h \
|
||||
getdate.h getline.h getopt.h group-member.h long-options.h \
|
||||
makepath.h modechange.h mountlist.h path-concat.h pathmax.h \
|
||||
save-cwd.h xstrtol.h xstrtoul.h
|
||||
|
||||
BUILT_SOURCES = getdate.c posixtm.c
|
||||
|
||||
# Since this directory contains two parsers, we have to be careful to avoid
|
||||
# running two $(YACC)s during parallel makes. See below.
|
||||
getdate.c: @MAINT@getdate.y
|
||||
@echo expect 10 shift/reduce conflicts
|
||||
$(YACC) $(srcdir)/getdate.y
|
||||
mv y.tab.c getdate.c
|
||||
|
||||
# Make the rename atomic, in case sed is interrupted and later rerun.
|
||||
# The artificial dependency on getdate.c keeps the two parsers from being
|
||||
# built in parallel. Enforcing this little bit of sequentiality lets
|
||||
# everyone (even those without bison) still run mostly parallel builds.
|
||||
posixtm.c: @MAINT@posixtm.y getdate.c
|
||||
$(YACC) $(srcdir)/posixtm.y
|
||||
mv y.tab.c posixtm.tab.c
|
||||
sed -e 's/yy/zz/g' posixtm.tab.c > tposixtm.c
|
||||
mv tposixtm.c posixtm.c
|
||||
rm -f posixtm.tab.c
|
||||
|
||||
194
lib/Makefile.in
194
lib/Makefile.in
@@ -1,4 +1,4 @@
|
||||
# Makefile.in generated automatically by automake 1.1e from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.1l from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
@@ -37,102 +37,111 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
YACC = @YACC@
|
||||
GENCAT = @GENCAT@
|
||||
PERL = @PERL@
|
||||
MV = @MV@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
CC = @CC@
|
||||
RANLIB = @RANLIB@
|
||||
LN = @LN@
|
||||
RM = @RM@
|
||||
|
||||
noinst_LIBRARIES = fu
|
||||
noinst_LIBRARIES = libfu.a
|
||||
|
||||
EXTRA_DIST = alloca.c basename.c error.c euidaccess.c fnmatch.c fsusage.c \
|
||||
ftruncate.c getdate.y group-member.c memcmp.c memcpy.c memset.c \
|
||||
mkdir.c mktime.c mountlist.c obstack.c posixtm.y regex.c rx.c \
|
||||
rename.c rmdir.c rpmatch.c \
|
||||
stpcpy.c strcasecmp.c strdup.c strndup.c strstr.c strtol.c strtoul.c
|
||||
EXTRA_DIST = mkdir.c rmdir.c getline.c mktime.c strftime.c getgroups.c
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir)
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
|
||||
fu_SOURCES = getdate.c getline.c getopt.c getopt1.c posixtm.c \
|
||||
argmatch.c backupfile.c \
|
||||
dirname.c fileblocks.c filemode.c \
|
||||
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
|
||||
argmatch.c backupfile.c dirname.c filemode.c \
|
||||
full-write.c getversion.c idcache.c \
|
||||
isdir.c long-options.c makepath.c modechange.c path-concat.c \
|
||||
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
|
||||
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
|
||||
|
||||
fu_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
|
||||
|
||||
noinst_HEADERS = argmatch.h backupfile.h error.h fnmatch.h fsusage.h \
|
||||
getline.h getopt.h group-member.h long-options.h makepath.h modechange.h \
|
||||
mountlist.h obstack.h path-concat.h pathmax.h regex.h rx.h \
|
||||
getdate.h getline.h getopt.h group-member.h long-options.h \
|
||||
makepath.h modechange.h mountlist.h path-concat.h pathmax.h \
|
||||
save-cwd.h xstrtol.h xstrtoul.h
|
||||
|
||||
BUILT_SOURCES = getdate.c posixtm.c
|
||||
mkinstalldirs = $(top_srcdir)/mkinstalldirs
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
|
||||
noinst_LIBFILES = libfu.a
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I..
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
fu_DEPENDENCIES = @LIBOBJS@ @ALLOCA@
|
||||
fu_OBJECTS = getdate.o getline.o getopt.o getopt1.o posixtm.o argmatch.o \
|
||||
backupfile.o dirname.o fileblocks.o filemode.o full-write.o \
|
||||
getversion.o idcache.o isdir.o long-options.o makepath.o modechange.o \
|
||||
path-concat.o safe-read.o save-cwd.o savedir.o stripslash.o userspec.o \
|
||||
xgetcwd.o xmalloc.o xstrdup.o xstrtol.o xstrtoul.o yesno.o
|
||||
EXTRA_fu_SOURCES =
|
||||
LIBFILES = $(pkglib_LIBFILES) $(noinst_LIBFILES) $(check_LIBFILES) \
|
||||
$(lib_LIBFILES)
|
||||
libfu_a_OBJECTS = getdate.o posixtm.o getopt.o getopt1.o argmatch.o \
|
||||
backupfile.o dirname.o filemode.o full-write.o getversion.o idcache.o \
|
||||
isdir.o long-options.o makepath.o modechange.o path-concat.o \
|
||||
safe-read.o save-cwd.o savedir.o stripslash.o userspec.o xgetcwd.o \
|
||||
xmalloc.o xstrdup.o xstrtol.o xstrtoul.o yesno.o
|
||||
AR = ar
|
||||
RANLIB = @RANLIB@
|
||||
CC = @CC@
|
||||
INTERLOCK = ./interlock
|
||||
YLWRAP = ./ylwrap
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LINK = $(CC) $(LDFLAGS) -o $@
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in alloca.c error.c fileblocks.c \
|
||||
fnmatch.c fsusage.c ftruncate.c getline.c mountlist.c obstack.c regex.c \
|
||||
regex.h rx.c rx.h
|
||||
DIST_COMMON = Makefile.am Makefile.in alloca.c basename.c error.c \
|
||||
error.h euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c \
|
||||
getdate.c getgroups.c getline.c group-member.c interlock memcmp.c \
|
||||
memcpy.c memset.c mkdir.c mktime.c mountlist.c obstack.c obstack.h \
|
||||
posixtm.c regex.c regex.h rename.c rmdir.c rpmatch.c rx.c rx.h stpcpy.c \
|
||||
strcasecmp.c strdup.c strftime.c strndup.c strstr.c strtol.c strtoul.c \
|
||||
ylwrap
|
||||
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
|
||||
$(TEXINFOS) $(INFOS) $(MANS) $(EXTRA_DIST) $(DATA)
|
||||
DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
|
||||
$(TEXINFOS) $(INFO_DEPS) $(MANS) $(EXTRA_DIST) $(DATA)
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) \
|
||||
$(TEXINFOS) $(MANS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
DEP_FILES = .deps/alloca.P .deps/argmatch.P .deps/backupfile.P \
|
||||
.deps/dirname.P .deps/error.P .deps/fileblocks.P .deps/filemode.P \
|
||||
.deps/fnmatch.P .deps/fsusage.P .deps/ftruncate.P .deps/full-write.P \
|
||||
.deps/getdate.P .deps/getline.P .deps/getopt.P .deps/getopt1.P \
|
||||
.deps/getversion.P .deps/idcache.P .deps/isdir.P .deps/long-options.P \
|
||||
.deps/makepath.P .deps/modechange.P .deps/mountlist.P .deps/obstack.P \
|
||||
.deps/path-concat.P .deps/posixtm.P .deps/regex.P .deps/rx.P \
|
||||
.deps/safe-read.P .deps/save-cwd.P .deps/savedir.P .deps/stripslash.P \
|
||||
DEP_FILES = .deps/alloca.P .deps/argmatch.P .deps/backupfile.P \
|
||||
.deps/basename.P .deps/dirname.P .deps/error.P .deps/euidaccess.P \
|
||||
.deps/fileblocks.P .deps/filemode.P .deps/fnmatch.P .deps/fsusage.P \
|
||||
.deps/ftruncate.P .deps/full-write.P .deps/getdate.P .deps/getgroups.P \
|
||||
.deps/getline.P .deps/getopt.P .deps/getopt1.P .deps/getversion.P \
|
||||
.deps/group-member.P .deps/idcache.P .deps/isdir.P .deps/long-options.P \
|
||||
.deps/makepath.P .deps/memcmp.P .deps/memcpy.P .deps/memset.P \
|
||||
.deps/mkdir.P .deps/mktime.P .deps/modechange.P .deps/mountlist.P \
|
||||
.deps/obstack.P .deps/path-concat.P .deps/posixtm.P .deps/regex.P \
|
||||
.deps/rename.P .deps/rmdir.P .deps/rpmatch.P .deps/rx.P \
|
||||
.deps/safe-read.P .deps/save-cwd.P .deps/savedir.P .deps/stpcpy.P \
|
||||
.deps/strcasecmp.P .deps/strdup.P .deps/strftime.P .deps/stripslash.P \
|
||||
.deps/strndup.P .deps/strstr.P .deps/strtol.P .deps/strtoul.P \
|
||||
.deps/userspec.P .deps/xgetcwd.P .deps/xmalloc.P .deps/xstrdup.P \
|
||||
.deps/xstrtol.P .deps/xstrtoul.P .deps/yesno.P
|
||||
SOURCES = $(fu_SOURCES)
|
||||
OBJECTS = $(fu_OBJECTS)
|
||||
SOURCES = $(libfu_a_SOURCES)
|
||||
OBJECTS = $(libfu_a_OBJECTS)
|
||||
|
||||
default: all
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .y
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL)
|
||||
cd $(top_srcdir) && automake --gnu lib/Makefile
|
||||
|
||||
$(srcdir)/Makefile.in: @MAINT@Makefile.am $(top_srcdir)/configure.in
|
||||
cd $(top_srcdir) && automake $(subdir)/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
Makefile: $(top_builddir)/config.status Makefile.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
||||
|
||||
mostlyclean-noinstLIBRARIES:
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
test -z "$(noinst_LIBFILES)" || rm -f $(noinst_LIBFILES)
|
||||
test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
|
||||
distclean-noinstLIBRARIES:
|
||||
|
||||
@@ -150,20 +159,28 @@ distclean-compile:
|
||||
rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
$(fu_OBJECTS): ../config.h
|
||||
$(libfu_a_OBJECTS): ../config.h
|
||||
|
||||
libfu.a: $(fu_OBJECTS) $(fu_DEPENDENCIES)
|
||||
libfu.a: $(libfu_a_OBJECTS) $(libfu_a_DEPENDENCIES)
|
||||
rm -f libfu.a
|
||||
$(AR) cru libfu.a $(fu_OBJECTS) $(fu_LIBADD)
|
||||
$(AR) cru libfu.a $(libfu_a_OBJECTS) $(libfu_a_LIBADD)
|
||||
$(RANLIB) libfu.a
|
||||
.y.c:
|
||||
$(SHELL) $(INTERLOCK) =yacclockdir $(YLWRAP) "$(YACC)" y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS) $<
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES)
|
||||
here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS)
|
||||
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES)
|
||||
here=`pwd` && cd $(srcdir) && etags $(ETAGS_ARGS) $(SOURCES) $(HEADERS) -o $$here/TAGS
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list="$(SUBDIRS)"; for subdir in $$list; do \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
done; \
|
||||
test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$$tags" \
|
||||
|| cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) -o $$here/TAGS
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
@@ -177,17 +194,18 @@ maintainer-clean-tags:
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = lib
|
||||
distdir: $(DEP_DISTFILES)
|
||||
@for file in `cd $(srcdir) && echo $(DISTFILES)`; do \
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $(srcdir)/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir)/$$file; \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
|
||||
MKDEP = gcc -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
|
||||
-include .deps/.P
|
||||
.deps/.P: $(BUILT_SOURCES)
|
||||
.deps/.P:
|
||||
test -d .deps || mkdir .deps
|
||||
echo > $@
|
||||
|
||||
@@ -204,21 +222,15 @@ maintainer-clean-depend:
|
||||
rm -rf .deps
|
||||
|
||||
.deps/%.P: $(srcdir)/%.c
|
||||
$(MKDEP) $< > $@-tmp
|
||||
if test -n "$o"; then \
|
||||
sed 's/\.o:/$$o:/' $@-tmp > $@; \
|
||||
rm $@-tmp; \
|
||||
else \
|
||||
mv $@-tmp $@; \
|
||||
fi
|
||||
@echo "Computing dependencies for $<..."
|
||||
@o='o'; \
|
||||
test -n "$o" && o='$$o'; \
|
||||
$(MKDEP) $< | sed "s/^\(.*\)\.o:/\1.$$o \1.l$$o:/" > $@
|
||||
info:
|
||||
|
||||
dvi:
|
||||
|
||||
check: all
|
||||
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
|
||||
install-exec:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
@@ -230,7 +242,7 @@ install: install-exec install-data all
|
||||
|
||||
uninstall:
|
||||
|
||||
all: $(LIBFILES) $(HEADERS) Makefile
|
||||
all: $(LIBRARIES) $(BUILT_SOURCES) $(HEADERS) Makefile
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
|
||||
@@ -242,11 +254,11 @@ mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
distclean-generic:
|
||||
rm -f Makefile $(DISTCLEANFILES)
|
||||
rm -f config.cache config.log $(CONFIG_HEADER) stamp-h
|
||||
rm -f config.cache config.log stamp-h
|
||||
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
@@ -255,16 +267,16 @@ mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \
|
||||
mostlyclean-tags mostlyclean-depend mostlyclean-generic
|
||||
|
||||
clean: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
|
||||
clean-generic mostlyclean
|
||||
clean-generic mostlyclean
|
||||
|
||||
distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \
|
||||
distclean-depend distclean-generic clean
|
||||
distclean-depend distclean-generic clean
|
||||
rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-noinstLIBRARIES \
|
||||
maintainer-clean-compile maintainer-clean-tags \
|
||||
maintainer-clean-depend maintainer-clean-generic \
|
||||
distclean
|
||||
distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
@@ -273,32 +285,12 @@ clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
|
||||
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
|
||||
distclean-depend clean-depend maintainer-clean-depend info dvi check \
|
||||
distclean-depend clean-depend maintainer-clean-depend info dvi \
|
||||
installcheck install-exec install-data install uninstall all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Since this directory contains two parsers, we have to be careful to avoid
|
||||
# running two $(YACC)s during parallel makes. See below.
|
||||
getdate.c: @MAINT@getdate.y
|
||||
@echo expect 10 shift/reduce conflicts
|
||||
$(YACC) $(srcdir)/getdate.y
|
||||
mv y.tab.c getdate.c
|
||||
|
||||
# Make the rename atomic, in case sed is interrupted and later rerun.
|
||||
# The artificial dependency on getdate.c keeps the two parsers from being
|
||||
# built in parallel. Enforcing this little bit of sequentiality lets
|
||||
# everyone (even those without bison) still run mostly parallel builds.
|
||||
posixtm.c: @MAINT@posixtm.y getdate.c
|
||||
$(YACC) $(srcdir)/posixtm.y
|
||||
mv y.tab.c posixtm.tab.c
|
||||
sed -e 's/yy/zz/g' posixtm.tab.c > tposixtm.c
|
||||
mv tposixtm.c posixtm.c
|
||||
rm -f posixtm.tab.c
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
||||
496
lib/alloca.c
496
lib/alloca.c
@@ -1,37 +1,42 @@
|
||||
/*
|
||||
alloca -- (mostly) portable public-domain implementation -- D A Gwyn
|
||||
/* alloca.c -- allocate automatically reclaimed memory
|
||||
(Mostly) portable public-domain implementation -- D A Gwyn
|
||||
|
||||
last edit: 86/05/30 rms
|
||||
include config.h, since on VMS it renames some symbols.
|
||||
Use xmalloc instead of malloc.
|
||||
This implementation of the PWB library alloca function,
|
||||
which is used to allocate space off the run-time stack so
|
||||
that it is automatically reclaimed upon procedure exit,
|
||||
was inspired by discussions with J. Q. Johnson of Cornell.
|
||||
J.Otto Tennant <jot@cray.com> contributed the Cray support.
|
||||
|
||||
This implementation of the PWB library alloca() function,
|
||||
which is used to allocate space off the run-time stack so
|
||||
that it is automatically reclaimed upon procedure exit,
|
||||
was inspired by discussions with J. Q. Johnson of Cornell.
|
||||
There are some preprocessor constants that can
|
||||
be defined when compiling for your specific system, for
|
||||
improved efficiency; however, the defaults should be okay.
|
||||
|
||||
It should work under any C implementation that uses an
|
||||
actual procedure stack (as opposed to a linked list of
|
||||
frames). There are some preprocessor constants that can
|
||||
be defined when compiling for your specific system, for
|
||||
improved efficiency; however, the defaults should be okay.
|
||||
The general concept of this implementation is to keep
|
||||
track of all alloca-allocated blocks, and reclaim any
|
||||
that are found to be deeper in the stack than the current
|
||||
invocation. This heuristic does not reclaim storage as
|
||||
soon as it becomes invalid, but it will do so eventually.
|
||||
|
||||
The general concept of this implementation is to keep
|
||||
track of all alloca()-allocated blocks, and reclaim any
|
||||
that are found to be deeper in the stack than the current
|
||||
invocation. This heuristic does not reclaim storage as
|
||||
soon as it becomes invalid, but it will do so eventually.
|
||||
As a special case, alloca(0) reclaims storage without
|
||||
allocating any. It is a good idea to use alloca(0) in
|
||||
your main control loop, etc. to force garbage collection. */
|
||||
|
||||
As a special case, alloca(0) reclaims storage without
|
||||
allocating any. It is a good idea to use alloca(0) in
|
||||
your main control loop, etc. to force garbage collection.
|
||||
*/
|
||||
#ifndef lint
|
||||
static char SCCSid[] = "@(#)alloca.c 1.1"; /* for the "what" utility */
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef emacs
|
||||
#include "config.h"
|
||||
#include "blockinput.h"
|
||||
#endif
|
||||
|
||||
/* If compiling with GCC 2, this file's not needed. */
|
||||
#if !defined (__GNUC__) || __GNUC__ < 2
|
||||
|
||||
/* If someone has defined alloca as a macro,
|
||||
there must be some other way alloca is supposed to work. */
|
||||
#ifndef alloca
|
||||
|
||||
#ifdef emacs
|
||||
#ifdef static
|
||||
/* actually, only want this if static is defined as ""
|
||||
-- this is for usg, in which emacs must undefine static
|
||||
@@ -45,72 +50,90 @@ lose
|
||||
#endif /* static */
|
||||
#endif /* emacs */
|
||||
|
||||
#ifndef alloca /* If compiling with GCC, this file's not needed. */
|
||||
/* If your stack is a linked list of frames, you have to
|
||||
provide an "address metric" ADDRESS_FUNCTION macro. */
|
||||
|
||||
#ifdef __STDC__
|
||||
typedef void *pointer; /* generic pointer type */
|
||||
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||
long i00afunc ();
|
||||
#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
|
||||
#else
|
||||
typedef char *pointer; /* generic pointer type */
|
||||
#define ADDRESS_FUNCTION(arg) &(arg)
|
||||
#endif
|
||||
|
||||
#define NULL 0 /* null pointer constant */
|
||||
#if __STDC__
|
||||
typedef void *pointer;
|
||||
#else
|
||||
typedef char *pointer;
|
||||
#endif
|
||||
|
||||
extern void free();
|
||||
extern pointer xmalloc();
|
||||
#define NULL 0
|
||||
|
||||
/*
|
||||
Define STACK_DIRECTION if you know the direction of stack
|
||||
growth for your system; otherwise it will be automatically
|
||||
deduced at run-time.
|
||||
/* Different portions of Emacs need to call different versions of
|
||||
malloc. The Emacs executable needs alloca to call xmalloc, because
|
||||
ordinary malloc isn't protected from input signals. On the other
|
||||
hand, the utilities in lib-src need alloca to call malloc; some of
|
||||
them are very simple, and don't have an xmalloc routine.
|
||||
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
Non-Emacs programs expect this to call xmalloc.
|
||||
|
||||
Callers below should use malloc. */
|
||||
|
||||
#ifndef emacs
|
||||
#define malloc xmalloc
|
||||
#endif
|
||||
extern pointer malloc ();
|
||||
|
||||
/* Define STACK_DIRECTION if you know the direction of stack
|
||||
growth for your system; otherwise it will be automatically
|
||||
deduced at run-time.
|
||||
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
|
||||
#ifndef STACK_DIRECTION
|
||||
#define STACK_DIRECTION 0 /* direction unknown */
|
||||
#define STACK_DIRECTION 0 /* Direction unknown. */
|
||||
#endif
|
||||
|
||||
#if STACK_DIRECTION != 0
|
||||
|
||||
#define STACK_DIR STACK_DIRECTION /* known at compile-time */
|
||||
#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
|
||||
|
||||
#else /* STACK_DIRECTION == 0; need run-time code */
|
||||
#else /* STACK_DIRECTION == 0; need run-time code. */
|
||||
|
||||
static int stack_dir; /* 1 or -1 once known */
|
||||
static int stack_dir; /* 1 or -1 once known. */
|
||||
#define STACK_DIR stack_dir
|
||||
|
||||
static void
|
||||
find_stack_direction (/* void */)
|
||||
find_stack_direction ()
|
||||
{
|
||||
static char *addr = NULL; /* address of first
|
||||
`dummy', once known */
|
||||
auto char dummy; /* to get stack address */
|
||||
static char *addr = NULL; /* Address of first `dummy', once known. */
|
||||
auto char dummy; /* To get stack address. */
|
||||
|
||||
if (addr == NULL)
|
||||
{ /* initial entry */
|
||||
addr = &dummy;
|
||||
{ /* Initial entry. */
|
||||
addr = ADDRESS_FUNCTION (dummy);
|
||||
|
||||
find_stack_direction (); /* recurse once */
|
||||
find_stack_direction (); /* Recurse once. */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Second entry. */
|
||||
if (ADDRESS_FUNCTION (dummy) > addr)
|
||||
stack_dir = 1; /* Stack grew upward. */
|
||||
else
|
||||
stack_dir = -1; /* Stack grew downward. */
|
||||
}
|
||||
else /* second entry */
|
||||
if (&dummy > addr)
|
||||
stack_dir = 1; /* stack grew upward */
|
||||
else
|
||||
stack_dir = -1; /* stack grew downward */
|
||||
}
|
||||
|
||||
#endif /* STACK_DIRECTION == 0 */
|
||||
#endif /* STACK_DIRECTION == 0 */
|
||||
|
||||
/*
|
||||
An "alloca header" is used to:
|
||||
(a) chain together all alloca()ed blocks;
|
||||
(b) keep track of stack depth.
|
||||
/* An "alloca header" is used to:
|
||||
(a) chain together all alloca'ed blocks;
|
||||
(b) keep track of stack depth.
|
||||
|
||||
It is very important that sizeof(header) agree with malloc()
|
||||
alignment chunk size. The following default should work okay.
|
||||
*/
|
||||
It is very important that sizeof(header) agree with malloc
|
||||
alignment chunk size. The following default should work okay. */
|
||||
|
||||
#ifndef ALIGN_SIZE
|
||||
#define ALIGN_SIZE sizeof(double)
|
||||
@@ -118,77 +141,352 @@ find_stack_direction (/* void */)
|
||||
|
||||
typedef union hdr
|
||||
{
|
||||
char align[ALIGN_SIZE]; /* to force sizeof(header) */
|
||||
char align[ALIGN_SIZE]; /* To force sizeof(header). */
|
||||
struct
|
||||
{
|
||||
union hdr *next; /* for chaining headers */
|
||||
char *deep; /* for stack depth measure */
|
||||
union hdr *next; /* For chaining headers. */
|
||||
char *deep; /* For stack depth measure. */
|
||||
} h;
|
||||
} header;
|
||||
|
||||
/*
|
||||
alloca( size ) returns a pointer to at least `size' bytes of
|
||||
storage which will be automatically reclaimed upon exit from
|
||||
the procedure that called alloca(). Originally, this space
|
||||
was supposed to be taken from the current stack frame of the
|
||||
caller, but that method cannot be made to work for some
|
||||
implementations of C, for example under Gould's UTX/32.
|
||||
*/
|
||||
static header *last_alloca_header = NULL; /* -> last alloca header. */
|
||||
|
||||
static header *last_alloca_header = NULL; /* -> last alloca header */
|
||||
/* Return a pointer to at least SIZE bytes of storage,
|
||||
which will be automatically reclaimed upon exit from
|
||||
the procedure that called alloca. Originally, this space
|
||||
was supposed to be taken from the current stack frame of the
|
||||
caller, but that method cannot be made to work for some
|
||||
implementations of C, for example under Gould's UTX/32. */
|
||||
|
||||
pointer
|
||||
alloca (size) /* returns pointer to storage */
|
||||
unsigned size; /* # bytes to allocate */
|
||||
alloca (size)
|
||||
unsigned size;
|
||||
{
|
||||
auto char probe; /* probes stack depth: */
|
||||
register char *depth = &probe;
|
||||
auto char probe; /* Probes stack depth: */
|
||||
register char *depth = ADDRESS_FUNCTION (probe);
|
||||
|
||||
#if STACK_DIRECTION == 0
|
||||
if (STACK_DIR == 0) /* unknown growth direction */
|
||||
if (STACK_DIR == 0) /* Unknown growth direction. */
|
||||
find_stack_direction ();
|
||||
#endif
|
||||
|
||||
/* Reclaim garbage, defined as all alloca()ed storage that
|
||||
was allocated from deeper in the stack than currently. */
|
||||
/* Reclaim garbage, defined as all alloca'd storage that
|
||||
was allocated from deeper in the stack than currently. */
|
||||
|
||||
{
|
||||
register header *hp; /* traverses linked list */
|
||||
register header *hp; /* Traverses linked list. */
|
||||
|
||||
#ifdef emacs
|
||||
BLOCK_INPUT;
|
||||
#endif
|
||||
|
||||
for (hp = last_alloca_header; hp != NULL;)
|
||||
if ((STACK_DIR > 0 && hp->h.deep > depth)
|
||||
|| (STACK_DIR < 0 && hp->h.deep < depth))
|
||||
{
|
||||
register header *np = hp->h.next;
|
||||
register header *np = hp->h.next;
|
||||
|
||||
free ((pointer) hp); /* collect garbage */
|
||||
free ((pointer) hp); /* Collect garbage. */
|
||||
|
||||
hp = np; /* -> next header */
|
||||
hp = np; /* -> next header. */
|
||||
}
|
||||
else
|
||||
break; /* rest are not deeper */
|
||||
break; /* Rest are not deeper. */
|
||||
|
||||
last_alloca_header = hp; /* -> last valid storage */
|
||||
last_alloca_header = hp; /* -> last valid storage. */
|
||||
|
||||
#ifdef emacs
|
||||
UNBLOCK_INPUT;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (size == 0)
|
||||
return NULL; /* no allocation required */
|
||||
return NULL; /* No allocation required. */
|
||||
|
||||
/* Allocate combined header + user data storage. */
|
||||
/* Allocate combined header + user data storage. */
|
||||
|
||||
{
|
||||
register pointer new = xmalloc (sizeof (header) + size);
|
||||
/* address of header */
|
||||
register pointer new = malloc (sizeof (header) + size);
|
||||
/* Address of header. */
|
||||
|
||||
((header *)new)->h.next = last_alloca_header;
|
||||
((header *)new)->h.deep = depth;
|
||||
((header *) new)->h.next = last_alloca_header;
|
||||
((header *) new)->h.deep = depth;
|
||||
|
||||
last_alloca_header = (header *)new;
|
||||
last_alloca_header = (header *) new;
|
||||
|
||||
/* User storage begins just after header. */
|
||||
/* User storage begins just after header. */
|
||||
|
||||
return (pointer)((char *)new + sizeof(header));
|
||||
return (pointer) ((char *) new + sizeof (header));
|
||||
}
|
||||
}
|
||||
|
||||
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||
|
||||
#ifdef DEBUG_I00AFUNC
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifndef CRAY_STACK
|
||||
#define CRAY_STACK
|
||||
#ifndef CRAY2
|
||||
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
|
||||
struct stack_control_header
|
||||
{
|
||||
long shgrow:32; /* Number of times stack has grown. */
|
||||
long shaseg:32; /* Size of increments to stack. */
|
||||
long shhwm:32; /* High water mark of stack. */
|
||||
long shsize:32; /* Current size of stack (all segments). */
|
||||
};
|
||||
|
||||
/* The stack segment linkage control information occurs at
|
||||
the high-address end of a stack segment. (The stack
|
||||
grows from low addresses to high addresses.) The initial
|
||||
part of the stack segment linkage control information is
|
||||
0200 (octal) words. This provides for register storage
|
||||
for the routine which overflows the stack. */
|
||||
|
||||
struct stack_segment_linkage
|
||||
{
|
||||
long ss[0200]; /* 0200 overflow words. */
|
||||
long sssize:32; /* Number of words in this segment. */
|
||||
long ssbase:32; /* Offset to stack base. */
|
||||
long:32;
|
||||
long sspseg:32; /* Offset to linkage control of previous
|
||||
segment of stack. */
|
||||
long:32;
|
||||
long sstcpt:32; /* Pointer to task common address block. */
|
||||
long sscsnm; /* Private control structure number for
|
||||
microtasking. */
|
||||
long ssusr1; /* Reserved for user. */
|
||||
long ssusr2; /* Reserved for user. */
|
||||
long sstpid; /* Process ID for pid based multi-tasking. */
|
||||
long ssgvup; /* Pointer to multitasking thread giveup. */
|
||||
long sscray[7]; /* Reserved for Cray Research. */
|
||||
long ssa0;
|
||||
long ssa1;
|
||||
long ssa2;
|
||||
long ssa3;
|
||||
long ssa4;
|
||||
long ssa5;
|
||||
long ssa6;
|
||||
long ssa7;
|
||||
long sss0;
|
||||
long sss1;
|
||||
long sss2;
|
||||
long sss3;
|
||||
long sss4;
|
||||
long sss5;
|
||||
long sss6;
|
||||
long sss7;
|
||||
};
|
||||
|
||||
#else /* CRAY2 */
|
||||
/* The following structure defines the vector of words
|
||||
returned by the STKSTAT library routine. */
|
||||
struct stk_stat
|
||||
{
|
||||
long now; /* Current total stack size. */
|
||||
long maxc; /* Amount of contiguous space which would
|
||||
be required to satisfy the maximum
|
||||
stack demand to date. */
|
||||
long high_water; /* Stack high-water mark. */
|
||||
long overflows; /* Number of stack overflow ($STKOFEN) calls. */
|
||||
long hits; /* Number of internal buffer hits. */
|
||||
long extends; /* Number of block extensions. */
|
||||
long stko_mallocs; /* Block allocations by $STKOFEN. */
|
||||
long underflows; /* Number of stack underflow calls ($STKRETN). */
|
||||
long stko_free; /* Number of deallocations by $STKRETN. */
|
||||
long stkm_free; /* Number of deallocations by $STKMRET. */
|
||||
long segments; /* Current number of stack segments. */
|
||||
long maxs; /* Maximum number of stack segments so far. */
|
||||
long pad_size; /* Stack pad size. */
|
||||
long current_address; /* Current stack segment address. */
|
||||
long current_size; /* Current stack segment size. This
|
||||
number is actually corrupted by STKSTAT to
|
||||
include the fifteen word trailer area. */
|
||||
long initial_address; /* Address of initial segment. */
|
||||
long initial_size; /* Size of initial segment. */
|
||||
};
|
||||
|
||||
/* The following structure describes the data structure which trails
|
||||
any stack segment. I think that the description in 'asdef' is
|
||||
out of date. I only describe the parts that I am sure about. */
|
||||
|
||||
struct stk_trailer
|
||||
{
|
||||
long this_address; /* Address of this block. */
|
||||
long this_size; /* Size of this block (does not include
|
||||
this trailer). */
|
||||
long unknown2;
|
||||
long unknown3;
|
||||
long link; /* Address of trailer block of previous
|
||||
segment. */
|
||||
long unknown5;
|
||||
long unknown6;
|
||||
long unknown7;
|
||||
long unknown8;
|
||||
long unknown9;
|
||||
long unknown10;
|
||||
long unknown11;
|
||||
long unknown12;
|
||||
long unknown13;
|
||||
long unknown14;
|
||||
};
|
||||
|
||||
#endif /* CRAY2 */
|
||||
#endif /* not CRAY_STACK */
|
||||
|
||||
#ifdef CRAY2
|
||||
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
||||
I doubt that "lint" will like this much. */
|
||||
|
||||
static long
|
||||
i00afunc (long *address)
|
||||
{
|
||||
struct stk_stat status;
|
||||
struct stk_trailer *trailer;
|
||||
long *block, size;
|
||||
long result = 0;
|
||||
|
||||
/* We want to iterate through all of the segments. The first
|
||||
step is to get the stack status structure. We could do this
|
||||
more quickly and more directly, perhaps, by referencing the
|
||||
$LM00 common block, but I know that this works. */
|
||||
|
||||
STKSTAT (&status);
|
||||
|
||||
/* Set up the iteration. */
|
||||
|
||||
trailer = (struct stk_trailer *) (status.current_address
|
||||
+ status.current_size
|
||||
- 15);
|
||||
|
||||
/* There must be at least one stack segment. Therefore it is
|
||||
a fatal error if "trailer" is null. */
|
||||
|
||||
if (trailer == 0)
|
||||
abort ();
|
||||
|
||||
/* Discard segments that do not contain our argument address. */
|
||||
|
||||
while (trailer != 0)
|
||||
{
|
||||
block = (long *) trailer->this_address;
|
||||
size = trailer->this_size;
|
||||
if (block == 0 || size == 0)
|
||||
abort ();
|
||||
trailer = (struct stk_trailer *) trailer->link;
|
||||
if ((block <= address) && (address < (block + size)))
|
||||
break;
|
||||
}
|
||||
|
||||
/* Set the result to the offset in this segment and add the sizes
|
||||
of all predecessor segments. */
|
||||
|
||||
result = address - block;
|
||||
|
||||
if (trailer == 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
if (trailer->this_size <= 0)
|
||||
abort ();
|
||||
result += trailer->this_size;
|
||||
trailer = (struct stk_trailer *) trailer->link;
|
||||
}
|
||||
while (trailer != 0);
|
||||
|
||||
/* We are done. Note that if you present a bogus address (one
|
||||
not in any segment), you will get a different number back, formed
|
||||
from subtracting the address of the first block. This is probably
|
||||
not what you want. */
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
#else /* not CRAY2 */
|
||||
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
|
||||
Determine the number of the cell within the stack,
|
||||
given the address of the cell. The purpose of this
|
||||
routine is to linearize, in some sense, stack addresses
|
||||
for alloca. */
|
||||
|
||||
static long
|
||||
i00afunc (long address)
|
||||
{
|
||||
long stkl = 0;
|
||||
|
||||
long size, pseg, this_segment, stack;
|
||||
long result = 0;
|
||||
|
||||
struct stack_segment_linkage *ssptr;
|
||||
|
||||
/* Register B67 contains the address of the end of the
|
||||
current stack segment. If you (as a subprogram) store
|
||||
your registers on the stack and find that you are past
|
||||
the contents of B67, you have overflowed the segment.
|
||||
|
||||
B67 also points to the stack segment linkage control
|
||||
area, which is what we are really interested in. */
|
||||
|
||||
stkl = CRAY_STACKSEG_END ();
|
||||
ssptr = (struct stack_segment_linkage *) stkl;
|
||||
|
||||
/* If one subtracts 'size' from the end of the segment,
|
||||
one has the address of the first word of the segment.
|
||||
|
||||
If this is not the first segment, 'pseg' will be
|
||||
nonzero. */
|
||||
|
||||
pseg = ssptr->sspseg;
|
||||
size = ssptr->sssize;
|
||||
|
||||
this_segment = stkl - size;
|
||||
|
||||
/* It is possible that calling this routine itself caused
|
||||
a stack overflow. Discard stack segments which do not
|
||||
contain the target address. */
|
||||
|
||||
while (!(this_segment <= address && address <= stkl))
|
||||
{
|
||||
#ifdef DEBUG_I00AFUNC
|
||||
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
|
||||
#endif
|
||||
if (pseg == 0)
|
||||
break;
|
||||
stkl = stkl - pseg;
|
||||
ssptr = (struct stack_segment_linkage *) stkl;
|
||||
size = ssptr->sssize;
|
||||
pseg = ssptr->sspseg;
|
||||
this_segment = stkl - size;
|
||||
}
|
||||
|
||||
result = address - this_segment;
|
||||
|
||||
/* If you subtract pseg from the current end of the stack,
|
||||
you get the address of the previous stack segment's end.
|
||||
This seems a little convoluted to me, but I'll bet you save
|
||||
a cycle somewhere. */
|
||||
|
||||
while (pseg != 0)
|
||||
{
|
||||
#ifdef DEBUG_I00AFUNC
|
||||
fprintf (stderr, "%011o %011o\n", pseg, size);
|
||||
#endif
|
||||
stkl = stkl - pseg;
|
||||
ssptr = (struct stack_segment_linkage *) stkl;
|
||||
size = ssptr->sssize;
|
||||
pseg = ssptr->sspseg;
|
||||
result += size;
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
|
||||
#endif /* not CRAY2 */
|
||||
#endif /* CRAY */
|
||||
|
||||
#endif /* no alloca */
|
||||
#endif /* not GCC version 2 */
|
||||
|
||||
@@ -68,8 +68,17 @@ char *malloc ();
|
||||
# define IN_CTYPE_DOMAIN(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#define ISDIGIT(c) (IN_CTYPE_DOMAIN ((unsigned char) (c)) \
|
||||
&& isdigit ((unsigned char) (c)))
|
||||
#define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
|
||||
|
||||
/* ISDIGIT differs from ISDIGIT_LOCALE, as follows:
|
||||
- Its arg may be any int or unsigned int; it need not be an unsigned char.
|
||||
- It's guaranteed to evaluate its argument exactly once.
|
||||
- It's typically faster.
|
||||
Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
|
||||
only '0' through '9' are digits. Prefer ISDIGIT to ISDIGIT_LOCALE unless
|
||||
it's important to use the locale's definition of `digit' even when the
|
||||
host does not conform to Posix. */
|
||||
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
|
||||
|
||||
#if defined (HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
31
lib/error.c
31
lib/error.c
@@ -1,23 +1,23 @@
|
||||
/* error.c -- error handler for noninteractive utilities
|
||||
Copyright (C) 1990, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -47,6 +47,9 @@ void exit ();
|
||||
# define _(String) String
|
||||
#endif
|
||||
|
||||
/* Get prototypes for the functions defined here. */
|
||||
#include <error.h>
|
||||
|
||||
/* If NULL, error will flush stdout, then print on stderr the program
|
||||
name, a colon and a space. Otherwise, error will call this
|
||||
function without parameters instead. */
|
||||
@@ -65,7 +68,7 @@ unsigned int error_message_count;
|
||||
# define program_name program_invocation_name
|
||||
# include <errno.h>
|
||||
|
||||
#else
|
||||
#else /* not _LIBC */
|
||||
|
||||
/* The calling program should define program_name and set it to the
|
||||
name of the executing program. */
|
||||
@@ -89,7 +92,7 @@ private_strerror (errnum)
|
||||
}
|
||||
# define strerror private_strerror
|
||||
# endif /* HAVE_STRERROR */
|
||||
#endif /* _LIBC */
|
||||
#endif /* not _LIBC */
|
||||
|
||||
/* Print the program name and error message MESSAGE, which is a printf-style
|
||||
format string with optional args.
|
||||
|
||||
28
lib/error.h
28
lib/error.h
@@ -1,22 +1,22 @@
|
||||
/* error.h -- declaration for error-reporting function
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _error_h_
|
||||
# define _error_h_
|
||||
#ifndef ERROR_H_
|
||||
# define ERROR_H_
|
||||
|
||||
# ifndef __attribute__
|
||||
/* This feature is available in gcc versions 2.5 and later. */
|
||||
@@ -62,4 +62,4 @@ extern unsigned int error_message_count;
|
||||
variable controls whether this mode is selected or not. */
|
||||
extern int error_one_per_line;
|
||||
|
||||
#endif /* _error_h_ */
|
||||
#endif /* not ERROR_H_ */
|
||||
|
||||
@@ -198,6 +198,17 @@ ftypelet (bits)
|
||||
if (S_ISNWK (bits))
|
||||
return 'n';
|
||||
#endif
|
||||
|
||||
#ifdef S_ISOFD
|
||||
/* Cray migrated dmf file. */
|
||||
if (S_ISOFD (bits))
|
||||
return 'M';
|
||||
#endif
|
||||
#ifdef S_ISOFL
|
||||
/* Cray migrated dmf file. */
|
||||
if (S_ISOFL (bits))
|
||||
return 'M';
|
||||
#endif
|
||||
return '?';
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,38 @@
|
||||
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <fnmatch.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if defined (STDC_HEADERS) || !defined (isascii)
|
||||
# define ISASCII(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||
|
||||
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
@@ -37,9 +45,9 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
||||
|
||||
|
||||
#ifndef errno
|
||||
# ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* Match STRING against the filename pattern PATTERN, returning zero if
|
||||
it matches, nonzero if not. */
|
||||
@@ -53,7 +61,7 @@ fnmatch (pattern, string, flags)
|
||||
register char c;
|
||||
|
||||
/* Note that this evalutes C many times. */
|
||||
#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
|
||||
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||
|
||||
while ((c = *p++) != '\0')
|
||||
{
|
||||
@@ -197,6 +205,8 @@ fnmatch (pattern, string, flags)
|
||||
return 0;
|
||||
|
||||
return FNM_NOMATCH;
|
||||
|
||||
# undef FOLD
|
||||
}
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
|
||||
158
lib/fsusage.c
158
lib/fsusage.c
@@ -1,5 +1,5 @@
|
||||
/* fsusage.c -- return space usage of mounted filesystems
|
||||
Copyright (C) 1991, 1992 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -15,8 +15,8 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -25,40 +25,40 @@
|
||||
|
||||
int statfs ();
|
||||
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#if HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#if HAVE_SYS_MOUNT_H
|
||||
# include <sys/mount.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_VFS_H
|
||||
#include <sys/vfs.h>
|
||||
#if HAVE_SYS_VFS_H
|
||||
# include <sys/vfs.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_FS_S5PARAM_H /* Fujitsu UXP/V */
|
||||
#include <sys/fs/s5param.h>
|
||||
#if HAVE_SYS_FS_S5PARAM_H /* Fujitsu UXP/V */
|
||||
# include <sys/fs/s5param.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_FILSYS_H) && !defined(_CRAY)
|
||||
#include <sys/filsys.h> /* SVR2. */
|
||||
#if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY)
|
||||
# include <sys/filsys.h> /* SVR2 */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#if HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_STATFS_H
|
||||
#include <sys/statfs.h>
|
||||
#if HAVE_SYS_STATFS_H
|
||||
# include <sys/statfs.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DUSTAT_H /* AIX PS/2. */
|
||||
#include <sys/dustat.h>
|
||||
#if HAVE_DUSTAT_H /* AIX PS/2 */
|
||||
# include <sys/dustat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_STATVFS_H /* SVR4. */
|
||||
#include <sys/statvfs.h>
|
||||
#if HAVE_SYS_STATVFS_H /* SVR4 */
|
||||
# include <sys/statvfs.h>
|
||||
int statvfs ();
|
||||
#endif
|
||||
|
||||
@@ -78,11 +78,11 @@ adjust_blocks (blocks, fromsize, tosize)
|
||||
if (fromsize <= 0)
|
||||
return -1;
|
||||
|
||||
if (fromsize == tosize) /* E.g., from 512 to 512. */
|
||||
if (fromsize == tosize) /* e.g., from 512 to 512 */
|
||||
return blocks;
|
||||
else if (fromsize > tosize) /* E.g., from 2048 to 512. */
|
||||
else if (fromsize > tosize) /* e.g., from 2048 to 512 */
|
||||
return blocks * (fromsize / tosize);
|
||||
else /* E.g., from 256 to 512. */
|
||||
else /* e.g., from 256 to 512 */
|
||||
return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
|
||||
}
|
||||
|
||||
@@ -90,42 +90,56 @@ adjust_blocks (blocks, fromsize, tosize)
|
||||
the filesystem on which PATH resides.
|
||||
DISK is the device on which PATH is mounted, for space-getting
|
||||
methods that need to know it.
|
||||
Return 0 if successful, -1 if not. */
|
||||
|
||||
Return 0 if successful, -1 if not. When returning -1, ensure that
|
||||
ERRNO is either a system error value, or zero if DISK is NULL
|
||||
on a system that requires a non-NULL value. */
|
||||
int
|
||||
get_fs_usage (path, disk, fsp)
|
||||
const char *path;
|
||||
const char *disk;
|
||||
struct fs_usage *fsp;
|
||||
{
|
||||
#if defined (STAT_STATFS3_OSF1)
|
||||
#ifdef STAT_STATFS3_OSF1
|
||||
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_fsize, 512)
|
||||
|
||||
struct statfs fsd;
|
||||
|
||||
if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
|
||||
return -1;
|
||||
#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_fsize, 512)
|
||||
|
||||
#endif /* STAT_STATFS3_OSF1 */
|
||||
|
||||
#ifdef STAT_STATFS2_FS_DATA /* Ultrix. */
|
||||
#ifdef STAT_STATFS2_FS_DATA /* Ultrix */
|
||||
# define CONVERT_BLOCKS(B) adjust_blocks ((B), 1024, 512)
|
||||
|
||||
struct fs_data fsd;
|
||||
|
||||
if (statfs (path, &fsd) != 1)
|
||||
return -1;
|
||||
#define CONVERT_BLOCKS(b) adjust_blocks ((b), 1024, 512)
|
||||
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.fd_req.btot);
|
||||
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.fd_req.bfree);
|
||||
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.fd_req.bfreen);
|
||||
fsp->fsu_files = fsd.fd_req.gtot;
|
||||
fsp->fsu_ffree = fsd.fd_req.gfree;
|
||||
#endif
|
||||
|
||||
#ifdef STAT_READ_FILSYS /* SVR2. */
|
||||
#ifndef SUPERBOFF
|
||||
#define SUPERBOFF (SUPERB * 512)
|
||||
#endif
|
||||
#endif /* STAT_STATFS2_FS_DATA */
|
||||
|
||||
#ifdef STAT_READ_FILSYS /* SVR2 */
|
||||
# ifndef SUPERBOFF
|
||||
# define SUPERBOFF (SUPERB * 512)
|
||||
# endif
|
||||
# define CONVERT_BLOCKS(B) \
|
||||
adjust_blocks ((B), (fsd.s_type == Fs2b ? 1024 : 512), 512)
|
||||
|
||||
struct filsys fsd;
|
||||
int fd;
|
||||
|
||||
if (! disk)
|
||||
{
|
||||
errno = 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
fd = open (disk, O_RDONLY);
|
||||
if (fd < 0)
|
||||
return -1;
|
||||
@@ -136,21 +150,24 @@ get_fs_usage (path, disk, fsp)
|
||||
return -1;
|
||||
}
|
||||
close (fd);
|
||||
#define CONVERT_BLOCKS(b) adjust_blocks ((b), (fsd.s_type == Fs2b ? 1024 : 512), 512)
|
||||
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.s_fsize);
|
||||
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.s_tfree);
|
||||
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.s_tfree);
|
||||
fsp->fsu_files = (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1);
|
||||
fsp->fsu_ffree = fsd.s_tinode;
|
||||
#endif
|
||||
|
||||
#ifdef STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX. */
|
||||
#endif /* STAT_READ_FILSYS */
|
||||
|
||||
#ifdef STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX */
|
||||
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_bsize, 512)
|
||||
|
||||
struct statfs fsd;
|
||||
|
||||
if (statfs (path, &fsd) < 0)
|
||||
return -1;
|
||||
|
||||
#ifdef STATFS_TRUNCATES_BLOCK_COUNTS
|
||||
# ifdef STATFS_TRUNCATES_BLOCK_COUNTS
|
||||
|
||||
/* In SunOS 4.1.2, 4.1.3, and 4.1.3_U1, the block counts in the
|
||||
struct statfs are truncated to 2GB. These conditions detect that
|
||||
truncation, presumably without botching the 4.1.1 case, in which
|
||||
@@ -162,20 +179,35 @@ get_fs_usage (path, disk, fsp)
|
||||
fsd.f_bfree = fsd.f_spare[1];
|
||||
fsd.f_bavail = fsd.f_spare[2];
|
||||
}
|
||||
#endif /* STATFS_TRUNCATES_BLOCK_COUNTS */
|
||||
# endif /* STATFS_TRUNCATES_BLOCK_COUNTS */
|
||||
|
||||
#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_bsize, 512)
|
||||
#endif
|
||||
#endif /* STAT_STATFS2_BSIZE */
|
||||
|
||||
#ifdef STAT_STATFS2_FSIZE /* 4.4BSD */
|
||||
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_fsize, 512)
|
||||
|
||||
#ifdef STAT_STATFS2_FSIZE /* 4.4BSD. */
|
||||
struct statfs fsd;
|
||||
|
||||
if (statfs (path, &fsd) < 0)
|
||||
return -1;
|
||||
#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_fsize, 512)
|
||||
#endif
|
||||
|
||||
#ifdef STAT_STATFS4 /* SVR3, Dynix, Irix, AIX. */
|
||||
#endif /* STAT_STATFS2_FSIZE */
|
||||
|
||||
#ifdef STAT_STATFS4 /* SVR3, Dynix, Irix, AIX */
|
||||
# if _AIX || defined(_CRAY)
|
||||
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_bsize, 512)
|
||||
# ifdef _CRAY
|
||||
# define f_bavail f_bfree
|
||||
# endif
|
||||
# else
|
||||
# define CONVERT_BLOCKS(B) (B)
|
||||
# ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx */
|
||||
# ifndef DOLPHIN /* DOLPHIN 3.8.alfa/7.18 has f_bavail */
|
||||
# define f_bavail f_bfree
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
struct statfs fsd;
|
||||
|
||||
if (statfs (path, &fsd, sizeof fsd, 0) < 0)
|
||||
@@ -183,38 +215,31 @@ get_fs_usage (path, disk, fsp)
|
||||
/* Empirically, the block counts on most SVR3 and SVR3-derived
|
||||
systems seem to always be in terms of 512-byte blocks,
|
||||
no matter what value f_bsize has. */
|
||||
# if _AIX || defined(_CRAY)
|
||||
# define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_bsize, 512)
|
||||
# ifdef _CRAY
|
||||
# define f_bavail f_bfree
|
||||
# endif
|
||||
# else
|
||||
# define CONVERT_BLOCKS(b) (b)
|
||||
# ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx. */
|
||||
# ifndef DOLPHIN /* DOLPHIN 3.8.alfa/7.18 has f_bavail */
|
||||
# define f_bavail f_bfree
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef STAT_STATVFS /* SVR4. */
|
||||
#endif /* STAT_STATFS4 */
|
||||
|
||||
#ifdef STAT_STATVFS /* SVR4 */
|
||||
# define CONVERT_BLOCKS(B) \
|
||||
adjust_blocks ((B), fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize, 512)
|
||||
|
||||
struct statvfs fsd;
|
||||
|
||||
if (statvfs (path, &fsd) < 0)
|
||||
return -1;
|
||||
/* f_frsize isn't guaranteed to be supported. */
|
||||
#define CONVERT_BLOCKS(b) \
|
||||
adjust_blocks ((b), fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize, 512)
|
||||
#endif
|
||||
|
||||
#if !defined(STAT_STATFS2_FS_DATA) && !defined(STAT_READ_FILSYS) /* !Ultrix && !SVR2. */
|
||||
#endif /* STAT_STATVFS */
|
||||
|
||||
#if !defined(STAT_STATFS2_FS_DATA) && !defined(STAT_READ_FILSYS)
|
||||
/* !Ultrix && !SVR2 */
|
||||
|
||||
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks);
|
||||
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree);
|
||||
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail);
|
||||
fsp->fsu_files = fsd.f_files;
|
||||
fsp->fsu_ffree = fsd.f_ffree;
|
||||
#endif
|
||||
|
||||
#endif /* not STAT_STATFS2_FS_DATA && not STAT_READ_FILSYS */
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -245,4 +270,5 @@ statfs (path, fsb)
|
||||
fsb->f_fsid.val[1] = fsd.du_pckno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _AIX && _I386 */
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
Copied largely from GNU C's cccp.c.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
46
lib/getdate.h
Normal file
46
lib/getdate.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
# ifndef PARAMS
|
||||
# if defined (__GNUC__) || __STDC__
|
||||
# define PARAMS(args) args
|
||||
# else
|
||||
# define PARAMS(args) ()
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#if defined (vms)
|
||||
# include <types.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# include <sys/types.h>
|
||||
# ifdef TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
# else
|
||||
# ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif /* defined (vms) */
|
||||
|
||||
time_t get_date PARAMS ((const char *p, const time_t *now));
|
||||
919
lib/getdate.y
919
lib/getdate.y
File diff suppressed because it is too large
Load Diff
59
lib/getgroups.c
Normal file
59
lib/getgroups.c
Normal file
@@ -0,0 +1,59 @@
|
||||
/* provide consistent interface to getgroups for systems that don't allow N==0
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* written by Jim Meyering */
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
char *xmalloc ();
|
||||
|
||||
/* On at least Ultrix 4.3 and NextStep 3.2, getgroups (0, 0) always fails.
|
||||
On other systems, it returns the number of supplemental groups for the
|
||||
process is returned.
|
||||
This function handles that special case and lets the system-
|
||||
provided function handle all others. */
|
||||
|
||||
int
|
||||
getgroups (n, group)
|
||||
size_t n;
|
||||
GETGROUPS_T *group;
|
||||
{
|
||||
int n_groups;
|
||||
GETGROUPS_T *gbuf;
|
||||
|
||||
#undef getgroups
|
||||
|
||||
if (n != 0)
|
||||
return getgroups (n, group);
|
||||
|
||||
n = 20;
|
||||
gbuf = NULL;
|
||||
while (1)
|
||||
{
|
||||
gbuf = (GETGROUPS_T *) xrealloc (gbuf, n * sizeof (GETGROUPS_T));
|
||||
n_groups = getgroups (n, gbuf);
|
||||
if (n_groups < n)
|
||||
break;
|
||||
n += 10;
|
||||
}
|
||||
|
||||
free (gbuf);
|
||||
|
||||
return n_groups;
|
||||
}
|
||||
@@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _getline_h_
|
||||
# define _getline_h_ 1
|
||||
#ifndef GETLINE_H_
|
||||
# define GETLINE_H_ 1
|
||||
|
||||
# include <stdio.h>
|
||||
|
||||
@@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
# define PARAMS(args) args
|
||||
# else
|
||||
# define PARAMS(args) ()
|
||||
# endif /* GCC. */
|
||||
# endif /* Not PARAMS. */
|
||||
# endif
|
||||
# endif
|
||||
|
||||
int
|
||||
getline PARAMS ((char **_lineptr, size_t *_n, FILE *_stream));
|
||||
@@ -33,4 +33,4 @@ getline PARAMS ((char **_lineptr, size_t *_n, FILE *_stream));
|
||||
int
|
||||
getdelim PARAMS ((char **_lineptr, size_t *_n, int _delimiter, FILE *_stream));
|
||||
|
||||
#endif
|
||||
#endif /* not GETLINE_H_ */
|
||||
|
||||
762
lib/getloadavg.c
762
lib/getloadavg.c
File diff suppressed because it is too large
Load Diff
275
lib/getopt.c
275
lib/getopt.c
@@ -3,22 +3,26 @@
|
||||
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
|
||||
before changing it!
|
||||
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
||||
Ditto for AIX 3.2 and <stdlib.h>. */
|
||||
@@ -48,18 +52,24 @@
|
||||
program understand `configure --with-gnu-libc' and omit the object files,
|
||||
it is simpler to just do this in the source for each such file. */
|
||||
|
||||
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
||||
#define GETOPT_INTERFACE_VERSION 2
|
||||
#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
|
||||
#include <gnu-versions.h>
|
||||
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
|
||||
#define ELIDE_CODE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ELIDE_CODE
|
||||
|
||||
|
||||
/* This needs to come after some library #include
|
||||
to get __GNU_LIBRARY__ defined. */
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#ifdef __GNU_LIBRARY__
|
||||
/* Don't include stdlib.h for non-GNU C libraries because some of them
|
||||
contain conflicting prototypes for getopt. */
|
||||
#include <stdlib.h>
|
||||
#if defined (_LIBC) || defined (HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif /* GNU C library. */
|
||||
|
||||
#ifdef VMS
|
||||
@@ -69,7 +79,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) && !defined (__CYGWIN32__)
|
||||
/* It's not Unix, really. See? Capital letters. */
|
||||
#include <windows.h>
|
||||
#define getpid() GetCurrentProcessId()
|
||||
@@ -116,14 +126,20 @@ char *optarg = NULL;
|
||||
|
||||
On entry to `getopt', zero means this is the first call; initialize.
|
||||
|
||||
When `getopt' returns EOF, this is the index of the first of the
|
||||
When `getopt' returns -1, this is the index of the first of the
|
||||
non-option elements that the caller should itself scan.
|
||||
|
||||
Otherwise, `optind' communicates from one call to the next
|
||||
how much of ARGV has been scanned so far. */
|
||||
|
||||
/* XXX 1003.2 says this must be 1 before any call. */
|
||||
int optind = 0;
|
||||
/* 1003.2 says this must be 1 before any call. */
|
||||
int optind = 1;
|
||||
|
||||
/* Formerly, initialization of getopt depended on optind==0, which
|
||||
causes problems with re-calling getopt as programs generally don't
|
||||
know that. */
|
||||
|
||||
int __getopt_initialized = 0;
|
||||
|
||||
/* The next char to be scanned in the option-element
|
||||
in which the last option character we returned was found.
|
||||
@@ -172,7 +188,7 @@ int optopt = '?';
|
||||
|
||||
The special argument `--' forces an end of option-scanning regardless
|
||||
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
|
||||
`--' can cause `getopt' to return EOF with `optind' != ARGC. */
|
||||
`--' can cause `getopt' to return -1 with `optind' != ARGC. */
|
||||
|
||||
static enum
|
||||
{
|
||||
@@ -182,7 +198,7 @@ static enum
|
||||
/* Value of POSIXLY_CORRECT environment variable. */
|
||||
static char *posixly_correct;
|
||||
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#ifdef __GNU_LIBRARY__
|
||||
/* We want to avoid inclusion of string.h with non-GNU libraries
|
||||
because there are many ways it can cause trouble.
|
||||
On some systems, it contains special magic macros that don't work
|
||||
@@ -233,12 +249,31 @@ extern int strlen (const char *);
|
||||
static int first_nonopt;
|
||||
static int last_nonopt;
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Bash 2.0 gives us an environment variable containing flags
|
||||
indicating ARGV elements that should not be considered arguments. */
|
||||
|
||||
static const char *nonoption_flags;
|
||||
static int nonoption_flags_len;
|
||||
|
||||
static int original_argc;
|
||||
static char *const *original_argv;
|
||||
|
||||
/* Make sure the environment variable bash 2.0 puts in the environment
|
||||
is valid for the getopt call we must make sure that the ARGV passed
|
||||
to getopt is that one passed to the process. */
|
||||
static void store_args (int argc, char *const *argv) __attribute__ ((unused));
|
||||
static void
|
||||
store_args (int argc, char *const *argv)
|
||||
{
|
||||
/* XXX This is no good solution. We should rather copy the args so
|
||||
that we can compare them later. But we must not use malloc(3). */
|
||||
original_argc = argc;
|
||||
original_argv = argv;
|
||||
}
|
||||
text_set_element (__libc_subinit, store_args);
|
||||
#endif
|
||||
|
||||
/* Exchange two adjacent subsequences of ARGV.
|
||||
One subsequence is elements [first_nonopt,last_nonopt)
|
||||
which contains all the non-options that have been skipped so far.
|
||||
@@ -311,10 +346,12 @@ exchange (argv)
|
||||
/* Initialize the internal data when the first call is made. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
static const char *_getopt_initialize (const char *);
|
||||
static const char *_getopt_initialize (int, char *const *, const char *);
|
||||
#endif
|
||||
static const char *
|
||||
_getopt_initialize (optstring)
|
||||
_getopt_initialize (argc, argv, optstring)
|
||||
int argc;
|
||||
char *const *argv;
|
||||
const char *optstring;
|
||||
{
|
||||
/* Start processing options with ARGV-element 1 (since ARGV-element 0
|
||||
@@ -344,7 +381,9 @@ _getopt_initialize (optstring)
|
||||
else
|
||||
ordering = PERMUTE;
|
||||
|
||||
if (posixly_correct == NULL)
|
||||
#ifdef _LIBC
|
||||
if (posixly_correct == NULL
|
||||
&& argc == original_argc && argv == original_argv)
|
||||
{
|
||||
/* Bash 2.0 puts a special variable in the environment for each
|
||||
command it runs, specifying which ARGV elements are the results of
|
||||
@@ -358,6 +397,9 @@ _getopt_initialize (optstring)
|
||||
else
|
||||
nonoption_flags_len = strlen (nonoption_flags);
|
||||
}
|
||||
else
|
||||
nonoption_flags_len = 0;
|
||||
#endif
|
||||
|
||||
return optstring;
|
||||
}
|
||||
@@ -375,7 +417,7 @@ _getopt_initialize (optstring)
|
||||
updating `optind' and `nextchar' so that the next call to `getopt' can
|
||||
resume the scan with the following option character or ARGV-element.
|
||||
|
||||
If there are no more option characters, `getopt' returns `EOF'.
|
||||
If there are no more option characters, `getopt' returns -1.
|
||||
Then `optind' is the index in ARGV of the first ARGV-element
|
||||
that is not an option. (The ARGV-elements have been permuted
|
||||
so that those that are not options now come last.)
|
||||
@@ -429,18 +471,24 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
optarg = NULL;
|
||||
|
||||
if (optind == 0)
|
||||
if (!__getopt_initialized || optind == 0)
|
||||
{
|
||||
optstring = _getopt_initialize (optstring);
|
||||
optstring = _getopt_initialize (argc, argv, optstring);
|
||||
optind = 1; /* Don't scan ARGV[0], the program name. */
|
||||
__getopt_initialized = 1;
|
||||
}
|
||||
|
||||
/* Test whether ARGV[optind] points to a non-option argument.
|
||||
Either it does not have option syntax, or there is an environment flag
|
||||
from the shell indicating it is not an option. */
|
||||
from the shell indicating it is not an option. The later information
|
||||
is only used when the used in the GNU libc. */
|
||||
#ifdef _LIBC
|
||||
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|
||||
|| (optind < nonoption_flags_len \
|
||||
&& nonoption_flags[optind] == '1'))
|
||||
#else
|
||||
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
|
||||
#endif
|
||||
|
||||
if (nextchar == NULL || *nextchar == '\0')
|
||||
{
|
||||
@@ -498,7 +546,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
that we previously skipped, so the caller will digest them. */
|
||||
if (first_nonopt != last_nonopt)
|
||||
optind = first_nonopt;
|
||||
return EOF;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* If we have come to a non-option and did not permute it,
|
||||
@@ -507,7 +555,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
if (NONOPTION_P)
|
||||
{
|
||||
if (ordering == REQUIRE_ORDER)
|
||||
return EOF;
|
||||
return -1;
|
||||
optarg = argv[optind++];
|
||||
return 1;
|
||||
}
|
||||
@@ -543,22 +591,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
const struct option *pfound = NULL;
|
||||
int exact = 0;
|
||||
int ambig = 0;
|
||||
int indfound;
|
||||
int indfound = -1;
|
||||
int option_index;
|
||||
|
||||
for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
|
||||
/* Do nothing. */ ;
|
||||
|
||||
#ifdef lint /* Suppress `used before initialized' warning. */
|
||||
indfound = 0;
|
||||
#endif
|
||||
|
||||
/* Test all long options for either exact match
|
||||
or abbreviated matches. */
|
||||
for (p = longopts, option_index = 0; p->name; p++, option_index++)
|
||||
if (!strncmp (p->name, nextchar, nameend - nextchar))
|
||||
{
|
||||
if (nameend - nextchar == strlen (p->name))
|
||||
if ((unsigned int) (nameend - nextchar)
|
||||
== (unsigned int) strlen (p->name))
|
||||
{
|
||||
/* Exact match found. */
|
||||
pfound = p;
|
||||
@@ -601,16 +646,16 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
|
||||
nextchar += strlen (nextchar);
|
||||
|
||||
@@ -626,8 +671,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
if (opterr)
|
||||
fprintf (stderr,
|
||||
_("%s: option `%s' requires an argument\n"),
|
||||
argv[0], argv[optind - 1]);
|
||||
_("%s: option `%s' requires an argument\n"),
|
||||
argv[0], argv[optind - 1]);
|
||||
nextchar += strlen (nextchar);
|
||||
optopt = pfound->val;
|
||||
return optstring[0] == ':' ? ':' : '?';
|
||||
@@ -694,6 +739,130 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
optopt = c;
|
||||
return '?';
|
||||
}
|
||||
/* Convenience. Treat POSIX -W foo same as long option --foo */
|
||||
if (temp[0] == 'W' && temp[1] == ';')
|
||||
{
|
||||
char *nameend;
|
||||
const struct option *p;
|
||||
const struct option *pfound = NULL;
|
||||
int exact = 0;
|
||||
int ambig = 0;
|
||||
int indfound = 0;
|
||||
int option_index;
|
||||
|
||||
/* This is an option that requires an argument. */
|
||||
if (*nextchar != '\0')
|
||||
{
|
||||
optarg = nextchar;
|
||||
/* If we end this ARGV-element by taking the rest as an arg,
|
||||
we must advance to the next element now. */
|
||||
optind++;
|
||||
}
|
||||
else if (optind == argc)
|
||||
{
|
||||
if (opterr)
|
||||
{
|
||||
/* 1003.2 specifies the format of this message. */
|
||||
fprintf (stderr, _("%s: option requires an argument -- %c\n"),
|
||||
argv[0], c);
|
||||
}
|
||||
optopt = c;
|
||||
if (optstring[0] == ':')
|
||||
c = ':';
|
||||
else
|
||||
c = '?';
|
||||
return c;
|
||||
}
|
||||
else
|
||||
/* We already incremented `optind' once;
|
||||
increment it again when taking next ARGV-elt as argument. */
|
||||
optarg = argv[optind++];
|
||||
|
||||
/* optarg is now the argument, see if it's in the
|
||||
table of longopts. */
|
||||
|
||||
for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
|
||||
/* Do nothing. */ ;
|
||||
|
||||
/* Test all long options for either exact match
|
||||
or abbreviated matches. */
|
||||
for (p = longopts, option_index = 0; p->name; p++, option_index++)
|
||||
if (!strncmp (p->name, nextchar, nameend - nextchar))
|
||||
{
|
||||
if ((unsigned int) (nameend - nextchar) == strlen (p->name))
|
||||
{
|
||||
/* Exact match found. */
|
||||
pfound = p;
|
||||
indfound = option_index;
|
||||
exact = 1;
|
||||
break;
|
||||
}
|
||||
else if (pfound == NULL)
|
||||
{
|
||||
/* First nonexact match found. */
|
||||
pfound = p;
|
||||
indfound = option_index;
|
||||
}
|
||||
else
|
||||
/* Second or later nonexact match found. */
|
||||
ambig = 1;
|
||||
}
|
||||
if (ambig && !exact)
|
||||
{
|
||||
if (opterr)
|
||||
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
|
||||
argv[0], argv[optind]);
|
||||
nextchar += strlen (nextchar);
|
||||
optind++;
|
||||
return '?';
|
||||
}
|
||||
if (pfound != NULL)
|
||||
{
|
||||
option_index = indfound;
|
||||
if (*nameend)
|
||||
{
|
||||
/* Don't test has_arg with >, because some C compilers don't
|
||||
allow it to be used on enums. */
|
||||
if (pfound->has_arg)
|
||||
optarg = nameend + 1;
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
fprintf (stderr, _("\
|
||||
%s: option `-W %s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
|
||||
nextchar += strlen (nextchar);
|
||||
return '?';
|
||||
}
|
||||
}
|
||||
else if (pfound->has_arg == 1)
|
||||
{
|
||||
if (optind < argc)
|
||||
optarg = argv[optind++];
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
fprintf (stderr,
|
||||
_("%s: option `%s' requires an argument\n"),
|
||||
argv[0], argv[optind - 1]);
|
||||
nextchar += strlen (nextchar);
|
||||
return optstring[0] == ':' ? ':' : '?';
|
||||
}
|
||||
}
|
||||
nextchar += strlen (nextchar);
|
||||
if (longind != NULL)
|
||||
*longind = option_index;
|
||||
if (pfound->flag)
|
||||
{
|
||||
*(pfound->flag) = pfound->val;
|
||||
return 0;
|
||||
}
|
||||
return pfound->val;
|
||||
}
|
||||
nextchar = NULL;
|
||||
return 'W'; /* Let the application handle it. */
|
||||
}
|
||||
if (temp[1] == ':')
|
||||
{
|
||||
if (temp[2] == ':')
|
||||
@@ -724,8 +893,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
/* 1003.2 specifies the format of this message. */
|
||||
fprintf (stderr,
|
||||
_("%s: option requires an argument -- %c\n"),
|
||||
argv[0], c);
|
||||
_("%s: option requires an argument -- %c\n"),
|
||||
argv[0], c);
|
||||
}
|
||||
optopt = c;
|
||||
if (optstring[0] == ':')
|
||||
@@ -756,7 +925,7 @@ getopt (argc, argv, optstring)
|
||||
0);
|
||||
}
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
#endif /* Not ELIDE_CODE. */
|
||||
|
||||
#ifdef TEST
|
||||
|
||||
@@ -776,7 +945,7 @@ main (argc, argv)
|
||||
int this_option_optind = optind ? optind : 1;
|
||||
|
||||
c = getopt (argc, argv, "abc:d:0123456789");
|
||||
if (c == EOF)
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c)
|
||||
|
||||
28
lib/getopt.h
28
lib/getopt.h
@@ -1,19 +1,23 @@
|
||||
/* Declarations for getopt.
|
||||
Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _GETOPT_H
|
||||
#define _GETOPT_H 1
|
||||
@@ -36,7 +40,7 @@ extern char *optarg;
|
||||
|
||||
On entry to `getopt', zero means this is the first call; initialize.
|
||||
|
||||
When `getopt' returns EOF, this is the index of the first of the
|
||||
When `getopt' returns -1, this is the index of the first of the
|
||||
non-option elements that the caller should itself scan.
|
||||
|
||||
Otherwise, `optind' communicates from one call to the next
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
@@ -40,15 +43,21 @@
|
||||
program understand `configure --with-gnu-libc' and omit the object files,
|
||||
it is simpler to just do this in the source for each such file. */
|
||||
|
||||
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
||||
#define GETOPT_INTERFACE_VERSION 2
|
||||
#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
|
||||
#include <gnu-versions.h>
|
||||
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
|
||||
#define ELIDE_CODE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ELIDE_CODE
|
||||
|
||||
|
||||
/* This needs to come after some library #include
|
||||
to get __GNU_LIBRARY__ defined. */
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
char *getenv ();
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
@@ -83,7 +92,7 @@ getopt_long_only (argc, argv, options, long_options, opt_index)
|
||||
}
|
||||
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
#endif /* Not ELIDE_CODE. */
|
||||
|
||||
#ifdef TEST
|
||||
|
||||
@@ -114,7 +123,7 @@ main (argc, argv)
|
||||
|
||||
c = getopt_long (argc, argv, "abc:d:0123456789",
|
||||
long_options, &option_index);
|
||||
if (c == EOF)
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c)
|
||||
|
||||
@@ -177,7 +177,7 @@ readname (name, size, stream)
|
||||
/* Skip blank space. */
|
||||
while ((c = getc (stream)) != EOF && isspace (c))
|
||||
/* Do nothing. */ ;
|
||||
|
||||
|
||||
while (c != EOF && !isspace (c))
|
||||
{
|
||||
(*name)[name_index++] = c;
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
|
||||
/* Written by David MacKenzie <djm@gnu.ai.mit.edu> */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "backupfile.h"
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ group_member (gid)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
free_group_info (gi);
|
||||
|
||||
return found;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _group_member_h_
|
||||
# define _group_member_h_ 1
|
||||
#ifndef GROUP_MEMBER_H_
|
||||
# define GROUP_MEMBER_H_ 1
|
||||
|
||||
int
|
||||
group_member ();
|
||||
|
||||
#endif /* _group_member_h_ */
|
||||
#endif /* GROUP_MEMBER_H_ */
|
||||
|
||||
46
lib/interlock
Executable file
46
lib/interlock
Executable file
@@ -0,0 +1,46 @@
|
||||
#! /bin/sh
|
||||
|
||||
# interlock - wrap program invocation in lock to allow
|
||||
# parallel builds to work.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>, Aug 10 1996
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Usage:
|
||||
# interlock lock-dir-name program args-to-program...
|
||||
|
||||
dirname="$1"
|
||||
program="$2"
|
||||
|
||||
shift
|
||||
shift
|
||||
|
||||
while (mkdir $dirname > /dev/null 2>&1 && exit 1 || exit 0); do
|
||||
# Wait a bit.
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# Race condition here: if interrupted after the loop but before this
|
||||
# trap, the lock can be left around.
|
||||
trap "rmdir $dirname > /dev/null 2>&1" 1 2 3 15
|
||||
|
||||
# We have the lock, so run the program.
|
||||
$program ${1+"$@"}
|
||||
ret=$?
|
||||
|
||||
# Release the lock.
|
||||
rmdir $dirname > /dev/null 2>&1
|
||||
|
||||
exit $ret
|
||||
@@ -12,8 +12,8 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* A `struct linebuffer' holds a line of text. */
|
||||
|
||||
@@ -24,20 +24,21 @@ struct linebuffer
|
||||
char *buffer;
|
||||
};
|
||||
|
||||
#undef __P
|
||||
#undef PARAMS
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#define __P(x) x
|
||||
# define PARAMS(Args) Args
|
||||
#else
|
||||
#define __P(x) ()
|
||||
# define PARAMS(Args) ()
|
||||
#endif
|
||||
|
||||
/* Initialize linebuffer LINEBUFFER for use. */
|
||||
void initbuffer __P ((struct linebuffer *linebuffer));
|
||||
void initbuffer PARAMS ((struct linebuffer *linebuffer));
|
||||
|
||||
/* Read an arbitrarily long line of text from STREAM into LINEBUFFER.
|
||||
Remove any newline. Does not null terminate.
|
||||
Return LINEBUFFER, except at end of file return 0. */
|
||||
struct linebuffer *readline __P ((struct linebuffer *linebuffer, FILE *stream));
|
||||
struct linebuffer *readline PARAMS ((struct linebuffer *linebuffer,
|
||||
FILE *stream));
|
||||
|
||||
/* Free linebuffer LINEBUFFER and its data, all allocated with malloc. */
|
||||
void freebuffer __P ((struct linebuffer *));
|
||||
void freebuffer PARAMS ((struct linebuffer *));
|
||||
|
||||
@@ -36,19 +36,18 @@ static struct option const long_options[] =
|
||||
Be careful not to gobble up `--'. */
|
||||
|
||||
void
|
||||
parse_long_options (argc, argv, command_name, version_string, usage)
|
||||
parse_long_options (argc, argv, command_name, package, version, usage)
|
||||
int argc;
|
||||
char **argv;
|
||||
const char *command_name;
|
||||
const char *version_string;
|
||||
const char *package;
|
||||
const char *version;
|
||||
void (*usage)();
|
||||
{
|
||||
int c;
|
||||
int saved_opterr;
|
||||
int saved_optind;
|
||||
|
||||
saved_opterr = opterr;
|
||||
saved_optind = optind;
|
||||
|
||||
/* Don't print an error message for unrecognized options. */
|
||||
opterr = 0;
|
||||
@@ -62,7 +61,7 @@ parse_long_options (argc, argv, command_name, version_string, usage)
|
||||
(*usage) (0);
|
||||
|
||||
case 'v':
|
||||
printf ("%s - %s\n", command_name, version_string);
|
||||
printf ("%s (%s) %s\n", command_name, package, version);
|
||||
exit (0);
|
||||
|
||||
default:
|
||||
@@ -74,6 +73,7 @@ parse_long_options (argc, argv, command_name, version_string, usage)
|
||||
/* Restore previous value. */
|
||||
opterr = saved_opterr;
|
||||
|
||||
/* Restore optind in case it has advanced past a leading `--'. */
|
||||
optind = saved_optind;
|
||||
/* Reset this to zero so that getopt internals get initialized from
|
||||
the probably-new parameters when/if getopt is called later. */
|
||||
optind = 0;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,31 @@
|
||||
#undef __P
|
||||
/* long-options.h -- declaration for --help- and --version-handling function.
|
||||
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
#undef PARAMS
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#define __P(args) args
|
||||
# define PARAMS(Args) Args
|
||||
#else
|
||||
#define __P(args) ()
|
||||
# define PARAMS(Args) ()
|
||||
#endif
|
||||
|
||||
void
|
||||
parse_long_options __P ((int _argc, char **_argv, const char *_command_name,
|
||||
const char *_version_string, void (*_usage) (int)));
|
||||
parse_long_options PARAMS ((int _argc, char **_argv,
|
||||
const char *_command_name,
|
||||
const char *_package,
|
||||
const char *_version, void (*_usage) (int)));
|
||||
|
||||
@@ -44,7 +44,7 @@ char *alloca ();
|
||||
|
||||
#if STAT_MACROS_BROKEN
|
||||
# undef S_ISDIR
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#if __STDC__
|
||||
# undef __P
|
||||
# define __P(args) args
|
||||
#if __STDC__
|
||||
# define __P(Args) Args
|
||||
#else
|
||||
# define __P(args) ()
|
||||
# define __P(Args) ()
|
||||
#endif
|
||||
|
||||
int
|
||||
|
||||
183
lib/md5.c
183
lib/md5.c
@@ -1,11 +1,13 @@
|
||||
/* md5.c - Functions to compute MD5 message digest of files or memory blocks
|
||||
according to the definition of MD5 in RFC 1321 from April 1992.
|
||||
Copyright (C) 1995 Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -16,7 +18,7 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>. */
|
||||
/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
@@ -24,7 +26,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#if STDC_HEADERS
|
||||
#if STDC_HEADERS || defined _LIBC
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#else
|
||||
@@ -35,6 +37,13 @@
|
||||
|
||||
#include "md5.h"
|
||||
|
||||
#ifdef _LIBC
|
||||
# include <endian.h>
|
||||
# if __BYTE_ORDER == __BIG_ENDIAN
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
# define SWAP(n) \
|
||||
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
|
||||
@@ -58,10 +67,16 @@ md5_init_ctx (ctx)
|
||||
ctx->B = 0xefcdab89;
|
||||
ctx->C = 0x98badcfe;
|
||||
ctx->D = 0x10325476;
|
||||
|
||||
ctx->total[0] = ctx->total[1] = 0;
|
||||
ctx->buflen = 0;
|
||||
}
|
||||
|
||||
/* Put result from CTX in first 16 bytes following RESBUF. The result must
|
||||
be in little endian byte order. */
|
||||
/* Put result from CTX in first 16 bytes following RESBUF. The result
|
||||
must be in little endian byte order.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
void *
|
||||
md5_read_ctx (ctx, resbuf)
|
||||
const struct md5_ctx *ctx;
|
||||
@@ -75,6 +90,39 @@ md5_read_ctx (ctx, resbuf)
|
||||
return resbuf;
|
||||
}
|
||||
|
||||
/* Process the remaining bytes in the internal buffer and the usual
|
||||
prolog according to the standard and write the result to RESBUF.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
void *
|
||||
md5_finish_ctx (ctx, resbuf)
|
||||
struct md5_ctx *ctx;
|
||||
void *resbuf;
|
||||
{
|
||||
/* Take yet unprocessed bytes into account. */
|
||||
md5_uint32 bytes = ctx->buflen;
|
||||
size_t pad;
|
||||
|
||||
/* Now count remaining bytes. */
|
||||
ctx->total[0] += bytes;
|
||||
if (ctx->total[0] < bytes)
|
||||
++ctx->total[1];
|
||||
|
||||
pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
|
||||
memcpy (&ctx->buffer[bytes], fillbuf, pad);
|
||||
|
||||
/* Put the 64-bit file length in *bits* at the end of the buffer. */
|
||||
*(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
|
||||
*(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
|
||||
(ctx->total[0] >> 29));
|
||||
|
||||
/* Process last bytes. */
|
||||
md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
|
||||
|
||||
return md5_read_ctx (ctx, resbuf);
|
||||
}
|
||||
|
||||
/* Compute MD5 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
beginning at RESBLOCK. */
|
||||
@@ -86,16 +134,12 @@ md5_stream (stream, resblock)
|
||||
/* Important: BLOCKSIZE must be a multiple of 64. */
|
||||
#define BLOCKSIZE 4096
|
||||
struct md5_ctx ctx;
|
||||
md5_uint32 len[2];
|
||||
char buffer[BLOCKSIZE + 72];
|
||||
size_t pad, sum;
|
||||
size_t sum;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
md5_init_ctx (&ctx);
|
||||
|
||||
len[0] = 0;
|
||||
len[1] = 0;
|
||||
|
||||
/* Iterate over full file contents. */
|
||||
while (1)
|
||||
{
|
||||
@@ -108,7 +152,7 @@ md5_stream (stream, resblock)
|
||||
/* Read block. Take care for partial reads. */
|
||||
do
|
||||
{
|
||||
n = fread (buffer, 1, BLOCKSIZE - sum, stream);
|
||||
n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
|
||||
|
||||
sum += n;
|
||||
}
|
||||
@@ -116,13 +160,6 @@ md5_stream (stream, resblock)
|
||||
if (n == 0 && ferror (stream))
|
||||
return 1;
|
||||
|
||||
/* RFC 1321 specifies the possible length of the file up to 2^64 bits.
|
||||
Here we only compute the number of bytes. Do a double word
|
||||
increment. */
|
||||
len[0] += sum;
|
||||
if (len[0] < sum)
|
||||
++len[1];
|
||||
|
||||
/* If end of file is reached, end the loop. */
|
||||
if (n == 0)
|
||||
break;
|
||||
@@ -133,27 +170,12 @@ md5_stream (stream, resblock)
|
||||
md5_process_block (buffer, BLOCKSIZE, &ctx);
|
||||
}
|
||||
|
||||
/* We can copy 64 byte because the buffer is always big enough. FILLBUF
|
||||
contains the needed bits. */
|
||||
memcpy (&buffer[sum], fillbuf, 64);
|
||||
|
||||
/* Compute amount of padding bytes needed. Alignment is done to
|
||||
(N + PAD) % 64 == 56
|
||||
There is always at least one byte padded. I.e. even the alignment
|
||||
is correctly aligned 64 padding bytes are added. */
|
||||
pad = sum & 63;
|
||||
pad = pad >= 56 ? 64 + 56 - pad : 56 - pad;
|
||||
|
||||
/* Put the 64-bit file length in *bits* at the end of the buffer. */
|
||||
*(md5_uint32 *) &buffer[sum + pad] = SWAP (len[0] << 3);
|
||||
*(md5_uint32 *) &buffer[sum + pad + 4] = SWAP ((len[1] << 3)
|
||||
| (len[0] >> 29));
|
||||
|
||||
/* Process last bytes. */
|
||||
md5_process_block (buffer, sum + pad + 8, &ctx);
|
||||
/* Add the last bytes if necessary. */
|
||||
if (sum > 0)
|
||||
md5_process_bytes (buffer, sum, &ctx);
|
||||
|
||||
/* Construct result in desired memory. */
|
||||
md5_read_ctx (&ctx, resblock);
|
||||
md5_finish_ctx (&ctx, resblock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -168,37 +190,61 @@ md5_buffer (buffer, len, resblock)
|
||||
void *resblock;
|
||||
{
|
||||
struct md5_ctx ctx;
|
||||
char restbuf[64 + 72];
|
||||
size_t blocks = len & ~63;
|
||||
size_t pad, rest;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
md5_init_ctx (&ctx);
|
||||
|
||||
/* Process whole buffer but last len % 64 bytes. */
|
||||
md5_process_block (buffer, blocks, &ctx);
|
||||
|
||||
/* REST bytes are not processed yet. */
|
||||
rest = len - blocks;
|
||||
/* Copy to own buffer. */
|
||||
memcpy (restbuf, &buffer[blocks], rest);
|
||||
/* Append needed fill bytes at end of buffer. We can copy 64 byte
|
||||
because the buffer is always big enough. */
|
||||
memcpy (&restbuf[rest], fillbuf, 64);
|
||||
|
||||
/* PAD bytes are used for padding to correct alignment. Note that
|
||||
always at least one byte is padded. */
|
||||
pad = rest >= 56 ? 64 + 56 - rest : 56 - rest;
|
||||
|
||||
/* Put length of buffer in *bits* in last eight bytes. */
|
||||
*(md5_uint32 *) &restbuf[rest + pad] = (md5_uint32) SWAP (len << 3);
|
||||
*(md5_uint32 *) &restbuf[rest + pad + 4] = (md5_uint32) SWAP (len >> 29);
|
||||
|
||||
/* Process last bytes. */
|
||||
md5_process_block (restbuf, rest + pad + 8, &ctx);
|
||||
md5_process_bytes (buffer, len, &ctx);
|
||||
|
||||
/* Put result in desired memory area. */
|
||||
return md5_read_ctx (&ctx, resblock);
|
||||
return md5_finish_ctx (&ctx, resblock);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
md5_process_bytes (buffer, len, ctx)
|
||||
const void *buffer;
|
||||
size_t len;
|
||||
struct md5_ctx *ctx;
|
||||
{
|
||||
/* When we already have some bits in our internal buffer concatenate
|
||||
both inputs first. */
|
||||
if (ctx->buflen != 0)
|
||||
{
|
||||
size_t left_over = ctx->buflen;
|
||||
size_t add = 128 - left_over > len ? len : 128 - left_over;
|
||||
|
||||
memcpy (&ctx->buffer[left_over], buffer, add);
|
||||
ctx->buflen += add;
|
||||
|
||||
if (left_over + add > 64)
|
||||
{
|
||||
md5_process_block (ctx->buffer, (left_over + add) & ~63, ctx);
|
||||
/* The regions in the following copy operation cannot overlap. */
|
||||
memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
|
||||
(left_over + add) & 63);
|
||||
ctx->buflen = (left_over + add) & 63;
|
||||
}
|
||||
|
||||
buffer = (const char *) buffer + add;
|
||||
len -= add;
|
||||
}
|
||||
|
||||
/* Process available complete blocks. */
|
||||
if (len > 64)
|
||||
{
|
||||
md5_process_block (buffer, len & ~63, ctx);
|
||||
buffer = (const char *) buffer + (len & ~63);
|
||||
len &= 63;
|
||||
}
|
||||
|
||||
/* Move remaining bytes in internal buffer. */
|
||||
if (len > 0)
|
||||
{
|
||||
memcpy (ctx->buffer, buffer, len);
|
||||
ctx->buflen = len;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -229,6 +275,13 @@ md5_process_block (buffer, len, ctx)
|
||||
md5_uint32 C = ctx->C;
|
||||
md5_uint32 D = ctx->D;
|
||||
|
||||
/* First increment the byte count. RFC 1321 specifies the possible
|
||||
length of the file up to 2^64 bits. Here we only compute the
|
||||
number of bytes. Do a double word increment. */
|
||||
ctx->total[0] += len;
|
||||
if (ctx->total[0] < len)
|
||||
++ctx->total[1];
|
||||
|
||||
/* Process all bytes in the buffer with 64 bytes in each round of
|
||||
the loop. */
|
||||
while (words < endp)
|
||||
|
||||
107
lib/md5.h
107
lib/md5.h
@@ -1,23 +1,25 @@
|
||||
/* md5.h - Declaration of functions and data types used for MD5 sum
|
||||
computing library functions.
|
||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _MD5_H
|
||||
#define _MD5_H
|
||||
#define _MD5_H 1
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -32,33 +34,38 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
the resulting executable. Locally running cross-compiled executables
|
||||
is usually not possible. */
|
||||
|
||||
#if defined __STDC__ && __STDC__
|
||||
# define UINT_MAX_32_BITS 4294967295U
|
||||
#ifdef _LIBC
|
||||
# include <sys/types.h>
|
||||
typedef u_int32_t md5_uint32;
|
||||
#else
|
||||
# define UINT_MAX_32_BITS 0xFFFFFFFF
|
||||
#endif
|
||||
# if defined __STDC__ && __STDC__
|
||||
# define UINT_MAX_32_BITS 4294967295U
|
||||
# else
|
||||
# define UINT_MAX_32_BITS 0xFFFFFFFF
|
||||
# endif
|
||||
|
||||
/* If UINT_MAX isn't defined, assume it's a 32-bit type.
|
||||
This should be valid for all systems GNU cares about because
|
||||
that doesn't include 16-bit systems, and only modern systems
|
||||
(that certainly have <limits.h>) have 64+-bit integral types. */
|
||||
|
||||
#ifndef UINT_MAX
|
||||
# define UINT_MAX UINT_MAX_32_BITS
|
||||
#endif
|
||||
# ifndef UINT_MAX
|
||||
# define UINT_MAX UINT_MAX_32_BITS
|
||||
# endif
|
||||
|
||||
#if UINT_MAX == UINT_MAX_32_BITS
|
||||
typedef unsigned int md5_uint32;
|
||||
#else
|
||||
# if USHRT_MAX == UINT_MAX_32_BITS
|
||||
typedef unsigned short md5_uint32;
|
||||
# if UINT_MAX == UINT_MAX_32_BITS
|
||||
typedef unsigned int md5_uint32;
|
||||
# else
|
||||
# if ULONG_MAX == UINT_MAX_32_BITS
|
||||
typedef unsigned long md5_uint32;
|
||||
# if USHRT_MAX == UINT_MAX_32_BITS
|
||||
typedef unsigned short md5_uint32;
|
||||
# else
|
||||
/* The following line is intended to evoke an error.
|
||||
Using #error is not portable enough. */
|
||||
"Cannot determine unsigned 32-bit data type."
|
||||
# if ULONG_MAX == UINT_MAX_32_BITS
|
||||
typedef unsigned long md5_uint32;
|
||||
# else
|
||||
/* The following line is intended to evoke an error.
|
||||
Using #error is not portable enough. */
|
||||
"Cannot determine unsigned 32-bit data type."
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
@@ -77,6 +84,10 @@ struct md5_ctx
|
||||
md5_uint32 B;
|
||||
md5_uint32 C;
|
||||
md5_uint32 D;
|
||||
|
||||
md5_uint32 total[2];
|
||||
md5_uint32 buflen;
|
||||
char buffer[128];
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -86,30 +97,50 @@ struct md5_ctx
|
||||
|
||||
/* Initialize structure containing state of computation.
|
||||
(RFC 1321, 3.3: Step 3) */
|
||||
void md5_init_ctx __P ((struct md5_ctx *ctx));
|
||||
extern void md5_init_ctx __P ((struct md5_ctx *ctx));
|
||||
|
||||
/* Starting with the result of former calls of this function (or the
|
||||
initialzation function update the context for the next LEN bytes
|
||||
initialization function update the context for the next LEN bytes
|
||||
starting at BUFFER.
|
||||
It is necessary that LEN is a multiple of 64!!! */
|
||||
void md5_process_block __P ((const void *buffer, size_t len,
|
||||
struct md5_ctx *ctx));
|
||||
extern void md5_process_block __P ((const void *buffer, size_t len,
|
||||
struct md5_ctx *ctx));
|
||||
|
||||
/* Starting with the result of former calls of this function (or the
|
||||
initialization function update the context for the next LEN bytes
|
||||
starting at BUFFER.
|
||||
It is NOT required that LEN is a multiple of 64. */
|
||||
extern void md5_process_bytes __P ((const void *buffer, size_t len,
|
||||
struct md5_ctx *ctx));
|
||||
|
||||
/* Process the remaining bytes in the buffer and put result from CTX
|
||||
in first 16 bytes following RESBUF. The result is always in little
|
||||
endian byte order, so that a byte-wise output yields to the wanted
|
||||
ASCII representation of the message digest.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf));
|
||||
|
||||
|
||||
/* Put result from CTX in first 16 bytes following RESBUF. The result is
|
||||
always in little endian byte order, so that a byte-wise output yields
|
||||
to the wanted ASCII representation of the message digest. */
|
||||
void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf));
|
||||
to the wanted ASCII representation of the message digest.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf));
|
||||
|
||||
|
||||
/* Compute MD5 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
beginning at RESBLOCK. */
|
||||
int md5_stream __P ((FILE *stream, void *resblock));
|
||||
extern int md5_stream __P ((FILE *stream, void *resblock));
|
||||
|
||||
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
void *md5_buffer __P ((const char *buffer, size_t len, void *resblock));
|
||||
extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock));
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#undef __P
|
||||
#undef PARAMS
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# define __P(args) args
|
||||
# define PARAMS(Args) Args
|
||||
#else
|
||||
# define __P(args) ()
|
||||
# define PARAMS(Args) ()
|
||||
#endif
|
||||
|
||||
int
|
||||
memcasecmp __P((const void *vs1, const void *vs2, size_t n));
|
||||
memcasecmp PARAMS ((const void *vs1, const void *vs2, size_t n));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1993, 1995 Free Software Foundation, Inc.
|
||||
Contributed by Torbjorn Granlund (tege@sics.se).
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
@@ -364,3 +364,10 @@ memcmp (s1, s2, len)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef weak_alias
|
||||
#undef bcmp
|
||||
weak_alias (memcmp, bcmp)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
if the source overlaps with the destination.
|
||||
Return DESTADDR. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
char *
|
||||
memcpy (destaddr, srcaddr, len)
|
||||
char *destaddr;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
In the public domain.
|
||||
By David MacKenzie <djm@gnu.ai.mit.edu>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
12
lib/mkdir.c
12
lib/mkdir.c
@@ -1,4 +1,4 @@
|
||||
/* mkdir.c -- BSD compatible make directory function for System V
|
||||
/* BSD compatible make directory function for System V
|
||||
Copyright (C) 1988, 1990 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -15,8 +15,8 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -26,12 +26,12 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISDIR
|
||||
#if STAT_MACROS_BROKEN
|
||||
# undef S_ISDIR
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
/* mkdir adapted from GNU tar. */
|
||||
|
||||
26
lib/mktime.c
26
lib/mktime.c
@@ -1,22 +1,22 @@
|
||||
/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
Contributed by Paul Eggert (eggert@twinsun.com).
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 59 Temple Place -
|
||||
Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Define this to have a standalone program to test this implementation of
|
||||
mktime. */
|
||||
|
||||
@@ -44,7 +44,7 @@ char *malloc ();
|
||||
|
||||
#if STAT_MACROS_BROKEN
|
||||
# undef S_ISDIR
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
|
||||
@@ -46,11 +46,11 @@ struct mode_change
|
||||
|
||||
#ifndef __P
|
||||
# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
|
||||
# define __P(args) args
|
||||
# define __P(Args) Args
|
||||
# else
|
||||
# define __P(args) ()
|
||||
# endif /* GCC. */
|
||||
#endif /* Not __P. */
|
||||
# define __P(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
struct mode_change *mode_compile __P ((const char *, unsigned));
|
||||
unsigned short mode_adjust __P ((unsigned, const struct mode_change *));
|
||||
|
||||
@@ -134,10 +134,6 @@ fstype_to_string (t)
|
||||
{
|
||||
switch (t)
|
||||
{
|
||||
case MOUNT_UFS:
|
||||
return "ufs";
|
||||
case MOUNT_NFS:
|
||||
return "nfs";
|
||||
#ifdef MOUNT_PC
|
||||
case MOUNT_PC:
|
||||
return "pc";
|
||||
@@ -157,6 +153,70 @@ fstype_to_string (t)
|
||||
#ifdef MOUNT_TMP
|
||||
case MOUNT_TMP:
|
||||
return "tmp";
|
||||
#endif
|
||||
#ifdef MOUNT_UFS
|
||||
case MOUNT_UFS:
|
||||
return "ufs" ;
|
||||
#endif
|
||||
#ifdef MOUNT_NFS
|
||||
case MOUNT_NFS:
|
||||
return "nfs" ;
|
||||
#endif
|
||||
#ifdef MOUNT_MSDOS
|
||||
case MOUNT_MSDOS:
|
||||
return "msdos" ;
|
||||
#endif
|
||||
#ifdef MOUNT_LFS
|
||||
case MOUNT_LFS:
|
||||
return "lfs" ;
|
||||
#endif
|
||||
#ifdef MOUNT_LOFS
|
||||
case MOUNT_LOFS:
|
||||
return "lofs" ;
|
||||
#endif
|
||||
#ifdef MOUNT_FDESC
|
||||
case MOUNT_FDESC:
|
||||
return "fdesc" ;
|
||||
#endif
|
||||
#ifdef MOUNT_PORTAL
|
||||
case MOUNT_PORTAL:
|
||||
return "portal" ;
|
||||
#endif
|
||||
#ifdef MOUNT_NULL
|
||||
case MOUNT_NULL:
|
||||
return "null" ;
|
||||
#endif
|
||||
#ifdef MOUNT_UMAP
|
||||
case MOUNT_UMAP:
|
||||
return "umap" ;
|
||||
#endif
|
||||
#ifdef MOUNT_KERNFS
|
||||
case MOUNT_KERNFS:
|
||||
return "kernfs" ;
|
||||
#endif
|
||||
#ifdef MOUNT_PROCFS
|
||||
case MOUNT_PROCFS:
|
||||
return "procfs" ;
|
||||
#endif
|
||||
#ifdef MOUNT_AFS
|
||||
case MOUNT_AFS:
|
||||
return "afs" ;
|
||||
#endif
|
||||
#ifdef MOUNT_CD9660
|
||||
case MOUNT_CD9660:
|
||||
return "cd9660" ;
|
||||
#endif
|
||||
#ifdef MOUNT_UNION
|
||||
case MOUNT_UNION:
|
||||
return "union" ;
|
||||
#endif
|
||||
#ifdef MOUNT_DEVFS
|
||||
case MOUNT_DEVFS:
|
||||
return "devfs" ;
|
||||
#endif
|
||||
#ifdef MOUNT_EXT2FS
|
||||
case MOUNT_EXT2FS:
|
||||
return "ext2fs" ;
|
||||
#endif
|
||||
default:
|
||||
return "?";
|
||||
@@ -204,7 +264,7 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
struct tabmntent *mntlist, *p;
|
||||
struct mntent *mnt;
|
||||
struct mount_entry *me;
|
||||
|
||||
|
||||
/* the third and fourth arguments could be used to filter mounts,
|
||||
but Crays doesn't seem to have any mounts that we want to
|
||||
remove. Specifically, automount create normal NFS mounts.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* obstack.c - subroutines used implicitly by object stack macros
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93,94,96 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -12,23 +12,35 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "obstack.h"
|
||||
|
||||
/* This is just to get __GNU_LIBRARY__ defined. */
|
||||
#include <stdio.h>
|
||||
/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
|
||||
incremented whenever callers compiled using an old obstack.h can no
|
||||
longer properly call the functions in this obstack.c. */
|
||||
#define OBSTACK_INTERFACE_VERSION 1
|
||||
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
Library, but also included in many other GNU distributions. Compiling
|
||||
actually compiling the library itself, and the installed library
|
||||
supports the same library interface we do. This code is part of the GNU
|
||||
C Library, but also included in many other GNU distributions. Compiling
|
||||
and linking in this code is a waste when using the GNU C library
|
||||
(especially if it is a shared library). Rather than having every GNU
|
||||
program understand `configure --with-gnu-libc' and omit the object files,
|
||||
it is simpler to just do this in the source for each such file. */
|
||||
program understand `configure --with-gnu-libc' and omit the object
|
||||
files, it is simpler to just do this in the source for each such file. */
|
||||
|
||||
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
||||
#include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */
|
||||
#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
|
||||
#include <gnu-versions.h>
|
||||
#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
|
||||
#define ELIDE_CODE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef ELIDE_CODE
|
||||
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
@@ -69,14 +81,14 @@ struct obstack *_obstack;
|
||||
#define CALL_CHUNKFUN(h, size) \
|
||||
(((h) -> use_extra_arg) \
|
||||
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
|
||||
: (*(h)->chunkfun) ((size)))
|
||||
: (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size)))
|
||||
|
||||
#define CALL_FREEFUN(h, old_chunk) \
|
||||
do { \
|
||||
if ((h) -> use_extra_arg) \
|
||||
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
|
||||
else \
|
||||
(*(h)->freefun) ((old_chunk)); \
|
||||
(*(void (*) ()) (h)->freefun) ((old_chunk)); \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -482,4 +494,4 @@ POINTER (obstack_copy0) (obstack, pointer, length)
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
#endif /* !ELIDE_CODE */
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* obstack.h - object stack macros
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93,94,96 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -12,8 +12,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Summary:
|
||||
|
||||
@@ -102,11 +102,16 @@ Summary:
|
||||
|
||||
#ifndef __OBSTACK_H__
|
||||
#define __OBSTACK_H__
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy)
|
||||
# define bcopy(from, to, len) memcpy ((to), (from), (len))
|
||||
#endif
|
||||
|
||||
|
||||
/* We use subtraction of (char *)0 instead of casting to int
|
||||
because on word-addressable machines a simple cast to int
|
||||
may ignore the byte-within-word field of the pointer. */
|
||||
@@ -136,21 +141,18 @@ Summary:
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef HAVE_PTRDIFF_T
|
||||
# define ptrdiff_t off_t
|
||||
#endif
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#define PTR_INT_TYPE ptrdiff_t
|
||||
#else
|
||||
#define PTR_INT_TYPE long
|
||||
#endif
|
||||
|
||||
#if HAVE_STRING_H || STDC_HEADERS
|
||||
# include <string.h>
|
||||
# ifndef bcopy
|
||||
# define bcopy(s, d, n) memcpy ((d), (s), (n))
|
||||
# endif
|
||||
#else /* HAVE_STRING_H || STDC_HEADERS */
|
||||
# include <strings.h>
|
||||
#endif /* not (HAVE_STRING_H || STDC_HEADERS) */
|
||||
|
||||
struct _obstack_chunk /* Lives at front of each chunk. */
|
||||
{
|
||||
char *limit; /* 1 past end of this chunk */
|
||||
@@ -167,9 +169,18 @@ struct obstack /* control current object in current chunk */
|
||||
char *chunk_limit; /* address of char after current chunk */
|
||||
PTR_INT_TYPE temp; /* Temporary for some macros. */
|
||||
int alignment_mask; /* Mask of alignment for each object. */
|
||||
#if defined (__STDC__) && __STDC__
|
||||
/* These prototypes vary based on `use_extra_arg', and we use
|
||||
casts to the prototypeless function type in all assignments,
|
||||
but having prototypes here quiets -Wstrict-prototypes. */
|
||||
struct _obstack_chunk *(*chunkfun) (void *, long);
|
||||
void (*freefun) (void *, struct _obstack_chunk *);
|
||||
void *extra_arg; /* first arg for chunk alloc/dealloc funcs */
|
||||
#else
|
||||
struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */
|
||||
void (*freefun) (); /* User's function to free a chunk. */
|
||||
char *extra_arg; /* first arg for chunk alloc/dealloc funcs */
|
||||
#endif
|
||||
unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
|
||||
unsigned maybe_empty_object:1;/* There is a possibility that the current
|
||||
chunk contains a zero-length object. This
|
||||
@@ -184,9 +195,10 @@ struct obstack /* control current object in current chunk */
|
||||
extern void _obstack_newchunk (struct obstack *, int);
|
||||
extern void _obstack_free (struct obstack *, void *);
|
||||
extern int _obstack_begin (struct obstack *, int, int,
|
||||
void *(*) (), void (*) ());
|
||||
void *(*) (long), void (*) (void *));
|
||||
extern int _obstack_begin_1 (struct obstack *, int, int,
|
||||
void *(*) (), void (*) (), void *);
|
||||
void *(*) (void *, long),
|
||||
void (*) (void *, void *), void *);
|
||||
#else
|
||||
extern void _obstack_newchunk ();
|
||||
extern void _obstack_free ();
|
||||
@@ -255,6 +267,34 @@ int obstack_chunk_size (struct obstack *obstack);
|
||||
|
||||
#define obstack_alignment_mask(h) ((h)->alignment_mask)
|
||||
|
||||
/* To prevent prototype warnings provide complete argument list in
|
||||
standard C version. */
|
||||
#if defined (__STDC__) && __STDC__
|
||||
|
||||
#define obstack_init(h) \
|
||||
_obstack_begin ((h), 0, 0, \
|
||||
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
|
||||
|
||||
#define obstack_begin(h, size) \
|
||||
_obstack_begin ((h), (size), 0, \
|
||||
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
|
||||
|
||||
#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
|
||||
_obstack_begin ((h), (size), (alignment), \
|
||||
(void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun))
|
||||
|
||||
#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
|
||||
_obstack_begin_1 ((h), (size), (alignment), \
|
||||
(void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun), (arg))
|
||||
|
||||
#define obstack_chunkfun(h, newchunkfun) \
|
||||
((h) -> chunkfun = (struct _obstack_chunk *(*)(long)) (newchunkfun))
|
||||
|
||||
#define obstack_freefun(h, newfreefun) \
|
||||
((h) -> freefun = (void (*)(void *)) (newfreefun))
|
||||
|
||||
#else
|
||||
|
||||
#define obstack_init(h) \
|
||||
_obstack_begin ((h), 0, 0, \
|
||||
(void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
|
||||
@@ -277,11 +317,13 @@ int obstack_chunk_size (struct obstack *obstack);
|
||||
#define obstack_freefun(h, newfreefun) \
|
||||
((h) -> freefun = (void (*)()) (newfreefun))
|
||||
|
||||
#endif
|
||||
|
||||
#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar)
|
||||
|
||||
#define obstack_blank_fast(h,n) ((h)->next_free += (n))
|
||||
|
||||
#if defined (__GNUC__) && defined (__STDC__)
|
||||
#if defined (__GNUC__) && defined (__STDC__) && __STDC__
|
||||
/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
|
||||
does not implement __extension__. But that compiler doesn't define
|
||||
__GNUC_MINOR__. */
|
||||
|
||||
@@ -67,9 +67,56 @@ static struct tm t;
|
||||
|
||||
time_t mktime ();
|
||||
|
||||
#define yyparse posixtime_yyparse
|
||||
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
|
||||
as well as gratuitiously global symbol names, so we can have multiple
|
||||
yacc generated parsers in the same program. Note that these are only
|
||||
the variables produced by yacc. If other parser generators (bison,
|
||||
byacc, etc) produce additional global names that conflict at link time,
|
||||
then those parser generators need to be fixed instead of adding those
|
||||
names to this list. */
|
||||
|
||||
#define yymaxdepth pt_maxdepth
|
||||
#define yyparse pt_parse
|
||||
#define yylex pt_lex
|
||||
#define yyerror pt_error
|
||||
#define yylval pt_lval
|
||||
#define yychar pt_char
|
||||
#define yydebug pt_debug
|
||||
#define yypact pt_pact
|
||||
#define yyr1 pt_r1
|
||||
#define yyr2 pt_r2
|
||||
#define yydef pt_def
|
||||
#define yychk pt_chk
|
||||
#define yypgo pt_pgo
|
||||
#define yyact pt_act
|
||||
#define yyexca pt_exca
|
||||
#define yyerrflag pt_errflag
|
||||
#define yynerrs pt_nerrs
|
||||
#define yyps pt_ps
|
||||
#define yypv pt_pv
|
||||
#define yys pt_s
|
||||
#define yy_yys pt_yys
|
||||
#define yystate pt_state
|
||||
#define yytmp pt_tmp
|
||||
#define yyv pt_v
|
||||
#define yy_yyv pt_yyv
|
||||
#define yyval pt_val
|
||||
#define yylloc pt_lloc
|
||||
#define yyreds pt_reds /* With YYDEBUG defined */
|
||||
#define yytoks pt_toks /* With YYDEBUG defined */
|
||||
#define yylhs pt_yylhs
|
||||
#define yylen pt_yylen
|
||||
#define yydefred pt_yydefred
|
||||
#define yydgoto pt_yydgoto
|
||||
#define yysindex pt_yysindex
|
||||
#define yyrindex pt_yyrindex
|
||||
#define yygindex pt_yygindex
|
||||
#define yytable pt_yytable
|
||||
#define yycheck pt_yycheck
|
||||
|
||||
static int yylex ();
|
||||
static int yyerror ();
|
||||
|
||||
%}
|
||||
|
||||
%token DIGIT
|
||||
|
||||
23
lib/rename.c
23
lib/rename.c
@@ -1,4 +1,4 @@
|
||||
/* rename.c -- BSD compatible directory function for System V
|
||||
/* BSD compatible rename and directory rename function for System V.
|
||||
Copyright (C) 1988, 1990 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -15,8 +15,8 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -26,12 +26,12 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISDIR
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
#if STAT_MACROS_BROKEN
|
||||
# undef S_ISDIR
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
/* Rename file FROM to file TO.
|
||||
@@ -67,6 +67,12 @@ rename (from, to)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef MVDIR
|
||||
|
||||
/* If MVDIR is defined, it should be the full filename of a setuid root
|
||||
program able to link and unlink directories. If MVDIR is not defined,
|
||||
then the capability of renaming directories may be missing. */
|
||||
|
||||
if (S_ISDIR (from_stats.st_mode))
|
||||
{
|
||||
/* Need a setuid root process to link and unlink directories. */
|
||||
@@ -90,6 +96,9 @@ rename (from, to)
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
#endif /* MVDIR */
|
||||
|
||||
{
|
||||
if (link (from, to))
|
||||
return -1;
|
||||
|
||||
12
lib/rmdir.c
12
lib/rmdir.c
@@ -1,4 +1,4 @@
|
||||
/* rmdir.c -- BSD compatible remove directory function for System V
|
||||
/* BSD compatible remove directory function for System V
|
||||
Copyright (C) 1988, 1990 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -15,8 +15,8 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -27,12 +27,12 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISDIR
|
||||
#if STAT_MACROS_BROKEN
|
||||
# undef S_ISDIR
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
/* rmdir adapted from GNU tar. */
|
||||
|
||||
@@ -30,7 +30,11 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <regex.h>
|
||||
#ifdef WITH_REGEX
|
||||
# include <regex.h>
|
||||
#else
|
||||
# include <rx.h>
|
||||
#endif
|
||||
|
||||
#if ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
|
||||
|
||||
400
lib/strftime.c
400
lib/strftime.c
@@ -1,20 +1,21 @@
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
@@ -24,14 +25,18 @@ Cambridge, MA 02139, USA. */
|
||||
# define HAVE_LIMITS_H 1
|
||||
# define HAVE_MBLEN 1
|
||||
# define HAVE_MBRLEN 1
|
||||
# define HAVE_STRUCT_ERA_ENTRY 1
|
||||
# define HAVE_TM_GMTOFF 1
|
||||
# define HAVE_TM_ZONE 1
|
||||
# define HAVE_TZNAME 1
|
||||
# define HAVE_TZSET 1
|
||||
# define MULTIBYTE_IS_FORMAT_SAFE 1
|
||||
# define STDC_HEADERS 1
|
||||
# include <ansidecl.h>
|
||||
# include "../locale/localeinfo.h"
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h> /* Some systems define `time_t' here. */
|
||||
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
@@ -44,6 +49,9 @@ Cambridge, MA 02139, USA. */
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
#if HAVE_TZNAME
|
||||
extern char *tzname[];
|
||||
#endif
|
||||
|
||||
/* Do multibyte processing if multibytes are supported, unless
|
||||
multibyte sequences are safe in formats. Multibyte sequences are
|
||||
@@ -74,27 +82,31 @@ Cambridge, MA 02139, USA. */
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#else
|
||||
# define memcpy(d, s, n) bcopy (s, d, n)
|
||||
# define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||
#endif
|
||||
|
||||
#ifndef __P
|
||||
#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
|
||||
#define __P(args) args
|
||||
#else
|
||||
#define __P(args) ()
|
||||
#endif /* GCC. */
|
||||
# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
|
||||
# define __P(args) args
|
||||
# else
|
||||
# define __P(args) ()
|
||||
# endif /* GCC. */
|
||||
#endif /* Not __P. */
|
||||
|
||||
#ifndef PTR
|
||||
#ifdef __STDC__
|
||||
#define PTR void *
|
||||
#else
|
||||
#define PTR char *
|
||||
#endif
|
||||
# ifdef __STDC__
|
||||
# define PTR void *
|
||||
# else
|
||||
# define PTR char *
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CHAR_BIT
|
||||
#define CHAR_BIT 8
|
||||
# define CHAR_BIT 8
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
# define NULL 0
|
||||
#endif
|
||||
|
||||
#define TYPE_SIGNED(t) ((t) -1 < 0)
|
||||
@@ -112,7 +124,7 @@ Cambridge, MA 02139, USA. */
|
||||
#ifndef __isleap
|
||||
/* Nonzero if YEAR is a leap year (every 4 years,
|
||||
except every 100th isn't, and every 400th is). */
|
||||
#define __isleap(year) \
|
||||
# define __isleap(year) \
|
||||
((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
|
||||
#endif
|
||||
|
||||
@@ -120,11 +132,14 @@ Cambridge, MA 02139, USA. */
|
||||
#ifdef _LIBC
|
||||
# define gmtime_r __gmtime_r
|
||||
# define localtime_r __localtime_r
|
||||
extern int __tz_compute __P ((time_t timer, const struct tm *tm));
|
||||
# define tzname __tzname
|
||||
# define tzset __tzset
|
||||
#else
|
||||
# if ! HAVE_LOCALTIME_R
|
||||
# if ! HAVE_TM_GMTOFF
|
||||
/* Approximate gmtime_r as best we can in its absence. */
|
||||
#define gmtime_r my_gmtime_r
|
||||
# define gmtime_r my_gmtime_r
|
||||
static struct tm *gmtime_r __P ((const time_t *, struct tm *));
|
||||
static struct tm *
|
||||
gmtime_r (t, tp)
|
||||
@@ -140,7 +155,7 @@ gmtime_r (t, tp)
|
||||
# endif /* ! HAVE_TM_GMTOFF */
|
||||
|
||||
/* Approximate localtime_r as best we can in its absence. */
|
||||
#define localtime_r my_localtime_r
|
||||
# define localtime_r my_localtime_r
|
||||
static struct tm *localtime_r __P ((const time_t *, struct tm *));
|
||||
static struct tm *
|
||||
localtime_r (t, tp)
|
||||
@@ -157,20 +172,95 @@ localtime_r (t, tp)
|
||||
#endif /* ! defined (_LIBC) */
|
||||
|
||||
|
||||
#define add(n, f) \
|
||||
#if !defined (memset) && !defined (HAVE_MEMSET) && !defined (_LIBC)
|
||||
/* Some systems lack the `memset' function and we don't want to
|
||||
introduce additional dependencies. */
|
||||
static const char spaces[16] = " ";
|
||||
|
||||
# define memset_space(P, Len) \
|
||||
do { \
|
||||
int _len = (Len); \
|
||||
\
|
||||
do \
|
||||
{ \
|
||||
int _this = _len > 16 ? 16 : _len; \
|
||||
memcpy ((P), spaces, _this); \
|
||||
(P) += _this; \
|
||||
_len -= _this; \
|
||||
} \
|
||||
while (_len > 0); \
|
||||
} while (0)
|
||||
#else
|
||||
# define memset_space(P, Len) memset ((P), ' ', (Len))
|
||||
#endif
|
||||
|
||||
#define add(n, f) \
|
||||
do \
|
||||
{ \
|
||||
i += (n); \
|
||||
if (i >= maxsize) \
|
||||
int _n = (n); \
|
||||
int _delta = width - _n; \
|
||||
int _incr = _n + (_delta > 0 ? _delta : 0); \
|
||||
if (i + _incr >= maxsize) \
|
||||
return 0; \
|
||||
else \
|
||||
if (p) \
|
||||
{ \
|
||||
f; \
|
||||
p += (n); \
|
||||
} \
|
||||
if (p) \
|
||||
{ \
|
||||
if (_delta > 0) \
|
||||
memset_space (p, _delta); \
|
||||
f; \
|
||||
p += _n; \
|
||||
} \
|
||||
i += _incr; \
|
||||
} while (0)
|
||||
#define cpy(n, s) add ((n), memcpy((PTR) p, (PTR) (s), (n)))
|
||||
|
||||
#define cpy(n, s) \
|
||||
add ((n), \
|
||||
if (to_lowcase) \
|
||||
memcpy_lowcase (p, (s), _n); \
|
||||
else if (to_uppcase) \
|
||||
memcpy_uppcase (p, (s), _n); \
|
||||
else \
|
||||
memcpy ((PTR) p, (PTR) (s), _n))
|
||||
|
||||
|
||||
|
||||
#ifdef _LIBC
|
||||
# define TOUPPER(Ch) toupper (Ch)
|
||||
# define TOLOWER(Ch) tolower (Ch)
|
||||
#else
|
||||
# define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch))
|
||||
# define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
|
||||
#endif
|
||||
/* We don't use `isdigit' here since the locale dependent
|
||||
interpretation is not what we want here. We only need to accept
|
||||
the arabic digits in the ASCII range. One day there is perhaps a
|
||||
more reliable way to accept other sets of digits. */
|
||||
#define ISDIGIT(Ch) ((unsigned int) (Ch) - '0' <= 9)
|
||||
|
||||
static char *memcpy_lowcase __P ((char *dest, const char *src, size_t len));
|
||||
|
||||
static char *
|
||||
memcpy_lowcase (dest, src, len)
|
||||
char *dest;
|
||||
const char *src;
|
||||
size_t len;
|
||||
{
|
||||
while (len-- > 0)
|
||||
dest[len] = TOLOWER (src[len]);
|
||||
return dest;
|
||||
}
|
||||
|
||||
static char *memcpy_uppcase __P ((char *dest, const char *src, size_t len));
|
||||
|
||||
static char *
|
||||
memcpy_uppcase (dest, src, len)
|
||||
char *dest;
|
||||
const char *src;
|
||||
size_t len;
|
||||
{
|
||||
while (len-- > 0)
|
||||
dest[len] = TOUPPER (src[len]);
|
||||
return dest;
|
||||
}
|
||||
|
||||
#if ! HAVE_TM_GMTOFF
|
||||
/* Yield the difference between *A and *B,
|
||||
@@ -181,14 +271,17 @@ tm_diff (a, b)
|
||||
const struct tm *a;
|
||||
const struct tm *b;
|
||||
{
|
||||
int ay = a->tm_year + TM_YEAR_BASE - 1;
|
||||
int by = b->tm_year + TM_YEAR_BASE - 1;
|
||||
/* Divide years by 100, rounding towards minus infinity. */
|
||||
int ac = ay / 100 - (ay % 100 < 0);
|
||||
int bc = by / 100 - (by % 100 < 0);
|
||||
int intervening_leap_days =
|
||||
((ay >> 2) - (by >> 2)) - (ac - bc) + ((ac >> 2) - (bc >> 2));
|
||||
int years = ay - by;
|
||||
/* Compute intervening leap days correctly even if year is negative.
|
||||
Take care to avoid int overflow in leap day calculations,
|
||||
but it's OK to assume that A and B are close to each other. */
|
||||
int a4 = (a->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (a->tm_year & 3);
|
||||
int b4 = (b->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (b->tm_year & 3);
|
||||
int a100 = a4 / 25 - (a4 % 25 < 0);
|
||||
int b100 = b4 / 25 - (b4 % 25 < 0);
|
||||
int a400 = a100 >> 2;
|
||||
int b400 = b100 >> 2;
|
||||
int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
|
||||
int years = a->tm_year - b->tm_year;
|
||||
int days = (365 * years + intervening_leap_days
|
||||
+ (a->tm_yday - b->tm_yday));
|
||||
return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))
|
||||
@@ -236,6 +329,31 @@ static char const month_name[][10] =
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
|
||||
/* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
|
||||
Work around this bug by copying *tp before it might be munged. */
|
||||
size_t _strftime_copytm __P ((char *, size_t, const char *,
|
||||
const struct tm *));
|
||||
size_t
|
||||
strftime (s, maxsize, format, tp)
|
||||
char *s;
|
||||
size_t maxsize;
|
||||
const char *format;
|
||||
const struct tm *tp;
|
||||
{
|
||||
struct tm tmcopy;
|
||||
tmcopy = *tp;
|
||||
return _strftime_copytm (s, maxsize, format, &tmcopy);
|
||||
}
|
||||
# ifdef strftime
|
||||
# undef strftime
|
||||
# endif
|
||||
# define strftime _strftime_copytm
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Write information from TP into S according to the format
|
||||
string FORMAT, writing no more that MAXSIZE characters
|
||||
(including the terminating '\0') and returning number of
|
||||
@@ -247,7 +365,7 @@ strftime (s, maxsize, format, tp)
|
||||
char *s;
|
||||
size_t maxsize;
|
||||
const char *format;
|
||||
register const struct tm *tp;
|
||||
const struct tm *tp;
|
||||
{
|
||||
int hour12 = tp->tm_hour;
|
||||
#ifdef _NL_CURRENT
|
||||
@@ -257,12 +375,9 @@ strftime (s, maxsize, format, tp)
|
||||
const char *const f_month = _NL_CURRENT (LC_TIME, MON_1 + tp->tm_mon);
|
||||
const char *const ampm = _NL_CURRENT (LC_TIME,
|
||||
hour12 > 11 ? PM_STR : AM_STR);
|
||||
size_t aw_len = strlen(a_wkday);
|
||||
size_t am_len = strlen(a_month);
|
||||
size_t aw_len = strlen (a_wkday);
|
||||
size_t am_len = strlen (a_month);
|
||||
size_t ap_len = strlen (ampm);
|
||||
|
||||
const char *alt_digits = _NL_CURRENT (LC_TIME, ALT_DIGITS);
|
||||
const char *end_alt_digits = _NL_CURRENT (LC_TIME, ALT_DIGITS + 1);
|
||||
#else
|
||||
const char *const f_wkday = weekday_name[tp->tm_wday];
|
||||
const char *const f_month = month_name[tp->tm_mon];
|
||||
@@ -277,15 +392,30 @@ strftime (s, maxsize, format, tp)
|
||||
size_t month_len = strlen (f_month);
|
||||
const char *zone;
|
||||
size_t zonelen;
|
||||
register size_t i = 0;
|
||||
register char *p = s;
|
||||
register const char *f;
|
||||
size_t i = 0;
|
||||
char *p = s;
|
||||
const char *f;
|
||||
|
||||
zone = 0;
|
||||
#if HAVE_TM_ZONE
|
||||
zone = NULL;
|
||||
#if !defined _LIBC && HAVE_TM_ZONE
|
||||
/* XXX We have some problems here. First, the string pointed to by
|
||||
tm_zone is dynamically allocated while loading the zone data. But
|
||||
when another zone is loaded since the information in TP were
|
||||
computed this would be a stale pointer.
|
||||
The second problem is the POSIX test suite which assumes setting
|
||||
the environment variable TZ to a new value before calling strftime()
|
||||
will influence the result (the %Z format) even if the information in
|
||||
TP is computed with a totally different time zone. --drepper@gnu */
|
||||
zone = (const char *) tp->tm_zone;
|
||||
#endif
|
||||
#if HAVE_TZNAME
|
||||
/* POSIX.1 8.1.1 requires that whenever strftime() is called, the
|
||||
time zone names contained in the external variable `tzname' shall
|
||||
be set as if the tzset() function had been called. */
|
||||
# if HAVE_TZSET
|
||||
tzset ();
|
||||
# endif
|
||||
|
||||
if (!(zone && *zone) && tp->tm_isdst >= 0)
|
||||
zone = tzname[tp->tm_isdst];
|
||||
#endif
|
||||
@@ -311,6 +441,9 @@ strftime (s, maxsize, format, tp)
|
||||
char buf[1 + (sizeof (int) < sizeof (time_t)
|
||||
? INT_STRLEN_BOUND (time_t)
|
||||
: INT_STRLEN_BOUND (int))];
|
||||
int width = -1;
|
||||
int to_lowcase = 0;
|
||||
int to_uppcase = 0;
|
||||
|
||||
#if DO_MULTIBYTE
|
||||
|
||||
@@ -385,20 +518,43 @@ strftime (s, maxsize, format, tp)
|
||||
|
||||
#endif /* ! DO_MULTIBYTE */
|
||||
|
||||
/* Check for flags that can modify a number format. */
|
||||
++f;
|
||||
switch (*f)
|
||||
/* Check for flags that can modify a format. */
|
||||
pad = 0;
|
||||
while (1)
|
||||
{
|
||||
case '_':
|
||||
case '-':
|
||||
pad = *f++;
|
||||
break;
|
||||
switch (*++f)
|
||||
{
|
||||
/* This influences the number formats. */
|
||||
case '_':
|
||||
case '-':
|
||||
case '0':
|
||||
pad = *f;
|
||||
continue;
|
||||
|
||||
default:
|
||||
pad = 0;
|
||||
/* This changes textual output. */
|
||||
case '^':
|
||||
to_uppcase = 1;
|
||||
continue;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* As a GNU extension we allow to specify the field width. */
|
||||
if (ISDIGIT (*f))
|
||||
{
|
||||
width = 0;
|
||||
do
|
||||
{
|
||||
width *= 10;
|
||||
width += *f - '0';
|
||||
++f;
|
||||
}
|
||||
while (ISDIGIT (*f));
|
||||
}
|
||||
|
||||
/* Check for modifiers. */
|
||||
switch (*f)
|
||||
{
|
||||
@@ -420,9 +576,6 @@ strftime (s, maxsize, format, tp)
|
||||
#define DO_NUMBER_SPACEPAD(d, v) \
|
||||
digits = d; number_value = v; goto do_number_spacepad
|
||||
|
||||
case '\0': /* GNU extension: % at end of format. */
|
||||
--f;
|
||||
/* Fall through. */
|
||||
case '%':
|
||||
if (modifier != 0)
|
||||
goto bad_format;
|
||||
@@ -462,23 +615,40 @@ strftime (s, maxsize, format, tp)
|
||||
&& *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT)) != '\0'))
|
||||
subfmt = _NL_CURRENT (LC_TIME, D_T_FMT);
|
||||
#else
|
||||
subfmt = "%a %b %e %H:%M:%S %Z %Y";
|
||||
subfmt = "%a %b %e %H:%M:%S %Y";
|
||||
#endif
|
||||
|
||||
subformat:
|
||||
{
|
||||
size_t len = strftime (p, maxsize - i, subfmt, tp);
|
||||
char *old_start = p;
|
||||
size_t len = strftime (NULL, maxsize - i, subfmt, tp);
|
||||
if (len == 0 && *subfmt)
|
||||
return 0;
|
||||
add (len, ;);
|
||||
add (len, strftime (p, maxsize - i, subfmt, tp));
|
||||
|
||||
if (to_uppcase)
|
||||
while (old_start < p)
|
||||
{
|
||||
*old_start = TOUPPER (*old_start);
|
||||
++old_start;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'C': /* POSIX.2 extension. */
|
||||
if (modifier == 'O')
|
||||
goto bad_format;
|
||||
#ifdef _NL_CURRENT
|
||||
/* XXX %EC is not implemented yet. */
|
||||
#if HAVE_STRUCT_ERA_ENTRY
|
||||
if (modifier == 'E')
|
||||
{
|
||||
struct era_entry *era = _nl_get_era_entry (tp);
|
||||
if (era)
|
||||
{
|
||||
size_t len = strlen (era->name_fmt);
|
||||
cpy (len, era->name_fmt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
{
|
||||
int year = tp->tm_year + TM_YEAR_BASE;
|
||||
@@ -517,26 +687,21 @@ strftime (s, maxsize, format, tp)
|
||||
jump to one of these two labels. */
|
||||
|
||||
do_number_spacepad:
|
||||
/* Force `_' flag. */
|
||||
pad = '_';
|
||||
/* Force `_' flag unless overwritten by `0' flag. */
|
||||
if (pad != '0')
|
||||
pad = '_';
|
||||
|
||||
do_number:
|
||||
/* Format the number according to the MODIFIER flag. */
|
||||
|
||||
#ifdef _NL_CURRENT
|
||||
if (modifier == 'O')
|
||||
if (modifier == 'O' && 0 <= number_value)
|
||||
{
|
||||
/* ALT_DIGITS is the first entry in an array with
|
||||
alternative digit symbols. We have to find string
|
||||
number NUMBER_VALUE, but must not look beyond
|
||||
END_ALT_DIGITS. */
|
||||
int run = number_value;
|
||||
const char *cp = alt_digits;
|
||||
/* Get the locale specific alternate representation of
|
||||
the number NUMBER_VALUE. If none exist NULL is returned. */
|
||||
const char *cp = _nl_get_alt_digit (number_value);
|
||||
|
||||
while (run > 0 && cp < end_alt_digits)
|
||||
cp = strchr (cp, '\0') + 1;
|
||||
|
||||
if (cp < end_alt_digits)
|
||||
if (cp != NULL)
|
||||
{
|
||||
size_t digitlen = strlen (cp);
|
||||
if (digitlen != 0)
|
||||
@@ -634,6 +799,10 @@ strftime (s, maxsize, format, tp)
|
||||
add (1, *p = '\n');
|
||||
break;
|
||||
|
||||
case 'P':
|
||||
to_lowcase = 1;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case 'p':
|
||||
cpy (ap_len, ampm);
|
||||
break;
|
||||
@@ -644,22 +813,24 @@ strftime (s, maxsize, format, tp)
|
||||
|
||||
case 'r': /* POSIX.2 extension. */
|
||||
#ifdef _NL_CURRENT
|
||||
subfmt = _NL_CURRENT (LC_TIME, T_FMT_AMPM);
|
||||
#else
|
||||
subfmt = "%I:%M:%S %p";
|
||||
if (*(subfmt = _NL_CURRENT (LC_TIME, T_FMT_AMPM)) == '\0')
|
||||
#endif
|
||||
subfmt = "%I:%M:%S %p";
|
||||
goto subformat;
|
||||
|
||||
case 'S':
|
||||
if (modifier == 'E')
|
||||
return 0;
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER (2, tp->tm_sec);
|
||||
|
||||
case 's': /* GNU extension. */
|
||||
{
|
||||
struct tm ltm = *tp;
|
||||
time_t t = mktime (<m);
|
||||
struct tm ltm;
|
||||
time_t t;
|
||||
|
||||
ltm = *tp;
|
||||
t = mktime (<m);
|
||||
|
||||
/* Generate string value for T using time_t arithmetic;
|
||||
this works even if sizeof (long) < sizeof (time_t). */
|
||||
@@ -773,10 +944,16 @@ strftime (s, maxsize, format, tp)
|
||||
DO_NUMBER (1, tp->tm_wday);
|
||||
|
||||
case 'Y':
|
||||
#ifdef _NL_CURRENT
|
||||
if (modifier == 'E'
|
||||
&& *(subfmt = _NL_CURRENT (LC_TIME, ERA_YEAR)) != '\0')
|
||||
goto subformat;
|
||||
#if HAVE_STRUCT_ERA_ENTRY
|
||||
if (modifier == 'E')
|
||||
{
|
||||
struct era_entry *era = _nl_get_era_entry (tp);
|
||||
if (era)
|
||||
{
|
||||
subfmt = strchr (era->name_fmt, '\0') + 1;
|
||||
goto subformat;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (modifier == 'O')
|
||||
goto bad_format;
|
||||
@@ -784,13 +961,22 @@ strftime (s, maxsize, format, tp)
|
||||
DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
|
||||
|
||||
case 'y':
|
||||
#ifdef _NL_CURRENT
|
||||
/* XXX %Ey is not implemented yet. */
|
||||
#if HAVE_STRUCT_ERA_ENTRY
|
||||
if (modifier == 'E')
|
||||
{
|
||||
struct era_entry *era = _nl_get_era_entry (tp);
|
||||
if (era)
|
||||
{
|
||||
int delta = tp->tm_year - era->start_date[0];
|
||||
DO_NUMBER (1, (era->offset
|
||||
+ (era->direction == '-' ? -delta : delta)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
DO_NUMBER (2, (tp->tm_year % 100 + 100) % 100);
|
||||
|
||||
case 'Z':
|
||||
cpy(zonelen, zone);
|
||||
cpy (zonelen, zone);
|
||||
break;
|
||||
|
||||
case 'z': /* GNU extension. */
|
||||
@@ -803,8 +989,11 @@ strftime (s, maxsize, format, tp)
|
||||
diff = tp->tm_gmtoff;
|
||||
#else
|
||||
struct tm gtm;
|
||||
struct tm ltm = *tp;
|
||||
time_t lt = mktime (<m);
|
||||
struct tm ltm;
|
||||
time_t lt;
|
||||
|
||||
ltm = *tp;
|
||||
lt = mktime (<m);
|
||||
|
||||
if (lt == (time_t) -1)
|
||||
{
|
||||
@@ -841,6 +1030,9 @@ strftime (s, maxsize, format, tp)
|
||||
DO_NUMBER (4, (diff / 60) * 100 + diff % 60);
|
||||
}
|
||||
|
||||
case '\0': /* GNU extension: % at end of format. */
|
||||
--f;
|
||||
/* Fall through. */
|
||||
default:
|
||||
/* Unknown format; output the format, including the '%',
|
||||
since this is most likely the right thing to do if a
|
||||
@@ -848,7 +1040,7 @@ strftime (s, maxsize, format, tp)
|
||||
bad_format:
|
||||
{
|
||||
int flen;
|
||||
for (flen = 2; f[1 - flen] != '%'; flen++)
|
||||
for (flen = 1; f[1 - flen] != '%'; flen++)
|
||||
continue;
|
||||
cpy (flen, &f[1 - flen]);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
24
lib/strtod.c
24
lib/strtod.c
@@ -14,8 +14,8 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
@@ -26,21 +26,21 @@ extern int errno;
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef HAVE_FLOAT_H
|
||||
#include <float.h>
|
||||
#if HAVE_FLOAT_H
|
||||
# include <float.h>
|
||||
#else
|
||||
#define DBL_MAX 1.7976931348623159e+308
|
||||
#define DBL_MIN 2.2250738585072010e-308
|
||||
# define DBL_MAX 1.7976931348623159e+308
|
||||
# define DBL_MIN 2.2250738585072010e-308
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#else
|
||||
#define NULL 0
|
||||
#ifndef HUGE_VAL
|
||||
#define HUGE_VAL HUGE
|
||||
#endif
|
||||
# define NULL 0
|
||||
# ifndef HUGE_VAL
|
||||
# define HUGE_VAL HUGE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Convert NPTR to a double. If ENDPTR is not NULL, a pointer to the
|
||||
|
||||
106
lib/strtol.c
106
lib/strtol.c
@@ -1,24 +1,23 @@
|
||||
/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
|
||||
/* strtol - Convert string representation of a number into an integer value.
|
||||
Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -33,6 +32,9 @@ USA. */
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
#ifndef __set_errno
|
||||
# define __set_errno(Val) errno = (Val)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
@@ -41,6 +43,7 @@ extern int errno;
|
||||
#ifdef STDC_HEADERS
|
||||
# include <stddef.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#else
|
||||
# ifndef NULL
|
||||
# define NULL 0
|
||||
@@ -108,40 +111,38 @@ extern int errno;
|
||||
#else
|
||||
# define LONG long
|
||||
|
||||
# ifndef ULONG_MAX
|
||||
# define ULONG_MAX ((unsigned long) ~(unsigned long) 0)
|
||||
# endif
|
||||
# ifndef LONG_MAX
|
||||
# define LONG_MAX ((long int) (ULONG_MAX >> 1))
|
||||
# endif
|
||||
#ifndef ULONG_MAX
|
||||
# define ULONG_MAX ((unsigned long) ~(unsigned long) 0)
|
||||
#endif
|
||||
#ifndef LONG_MAX
|
||||
# define LONG_MAX ((long int) (ULONG_MAX >> 1))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_WIDE_CHAR
|
||||
# include <wchar.h>
|
||||
# include <wctype.h>
|
||||
# define L_(ch) L##ch
|
||||
# define L_(Ch) L##Ch
|
||||
# define UCHAR_TYPE wint_t
|
||||
# define STRING_TYPE wchar_t
|
||||
# define ISSPACE(ch) iswspace (ch)
|
||||
# define ISALPHA(ch) iswalpha (ch)
|
||||
# define TOUPPER(ch) towupper (ch)
|
||||
# define ISSPACE(Ch) iswspace (Ch)
|
||||
# define ISALPHA(Ch) iswalpha (Ch)
|
||||
# define TOUPPER(Ch) towupper (Ch)
|
||||
#else
|
||||
# define L_(ch) ch
|
||||
# define L_(Ch) Ch
|
||||
# define UCHAR_TYPE unsigned char
|
||||
# define STRING_TYPE char
|
||||
# define ISSPACE(ch) isspace (ch)
|
||||
# define ISALPHA(ch) isalpha (ch)
|
||||
# define TOUPPER(ch) toupper (ch)
|
||||
# define ISSPACE(Ch) isspace (Ch)
|
||||
# define ISALPHA(Ch) isalpha (Ch)
|
||||
# define TOUPPER(Ch) toupper (Ch)
|
||||
#endif
|
||||
|
||||
#ifdef __STDC__
|
||||
# define INTERNAL(x) INTERNAL1(x)
|
||||
# define INTERNAL1(x) __##x##_internal
|
||||
# define WEAKNAME(x) WEAKNAME1(x)
|
||||
# define WEAKNAME1(x) __##x
|
||||
# define INTERNAL(X) INTERNAL1(X)
|
||||
# define INTERNAL1(X) __##X##_internal
|
||||
# define WEAKNAME(X) WEAKNAME1(X)
|
||||
#else
|
||||
# define INTERNAL(x) __/**/x/**/_internal
|
||||
# define WEAKNAME(x) __/**/x
|
||||
# define INTERNAL(X) __/**/X/**/_internal
|
||||
#endif
|
||||
|
||||
#ifdef USE_NUMBER_GROUPING
|
||||
@@ -251,8 +252,9 @@ INTERNAL (strtol) (nptr, endptr, base, group)
|
||||
/* Find the end of the digit string and check its grouping. */
|
||||
end = s;
|
||||
for (c = *end; c != L_('\0'); c = *++end)
|
||||
if (c != thousands && (c < L_('0') || c > L_('9'))
|
||||
&& (!ISALPHA (c) || TOUPPER (c) - L_('A') + 10 >= base))
|
||||
if ((wchar_t) c != thousands
|
||||
&& ((wchar_t) c < L_('0') || (wchar_t) c > L_('9'))
|
||||
&& (!ISALPHA (c) || (int) (TOUPPER (c) - L_('A') + 10) >= base))
|
||||
break;
|
||||
if (*s == thousands)
|
||||
end = s;
|
||||
@@ -278,7 +280,7 @@ INTERNAL (strtol) (nptr, endptr, base, group)
|
||||
c = TOUPPER (c) - L_('A') + 10;
|
||||
else
|
||||
break;
|
||||
if (c >= base)
|
||||
if ((int) c >= base)
|
||||
break;
|
||||
/* Check for overflow. */
|
||||
if (i > cutoff || (i == cutoff && c > cutlim))
|
||||
@@ -311,7 +313,7 @@ INTERNAL (strtol) (nptr, endptr, base, group)
|
||||
|
||||
if (overflow)
|
||||
{
|
||||
errno = ERANGE;
|
||||
__set_errno (ERANGE);
|
||||
#if UNSIGNED
|
||||
return ULONG_MAX;
|
||||
#else
|
||||
@@ -324,7 +326,7 @@ INTERNAL (strtol) (nptr, endptr, base, group)
|
||||
|
||||
noconv:
|
||||
/* We must handle a special case here: the base is 0 or 16 and the
|
||||
first two characters and '0' and 'x', but the rest are no
|
||||
first two characters are '0' and 'x', but the rest are no
|
||||
hexadecimal digits. This is no error case. We return 0 and
|
||||
ENDPTR points to the `x`. */
|
||||
if (endptr != NULL)
|
||||
@@ -340,19 +342,23 @@ noconv:
|
||||
|
||||
/* External user entry point. */
|
||||
|
||||
#undef __P
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# define __P(args) args
|
||||
#else
|
||||
# define __P(args) ()
|
||||
#endif
|
||||
#if _LIBC - 0 == 0
|
||||
# undef PARAMS
|
||||
# if defined (__STDC__) && __STDC__
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
|
||||
/* Prototype. */
|
||||
INT strtol __P ((const STRING_TYPE *nptr, STRING_TYPE **endptr,
|
||||
int base));
|
||||
INT strtol PARAMS ((const STRING_TYPE *nptr, STRING_TYPE **endptr, int base));
|
||||
#endif
|
||||
|
||||
|
||||
INT
|
||||
#ifdef weak_function
|
||||
weak_function
|
||||
#endif
|
||||
strtol (nptr, endptr, base)
|
||||
const STRING_TYPE *nptr;
|
||||
STRING_TYPE **endptr;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* xgetcwd.c -- return current directory with unlimited length
|
||||
Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -26,14 +26,15 @@
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "pathmax.h"
|
||||
|
||||
#ifndef HAVE_GETCWD
|
||||
char *getwd ();
|
||||
# define getcwd(buf, max) getwd (buf)
|
||||
#else
|
||||
#if HAVE_GETCWD
|
||||
char *getcwd ();
|
||||
#else
|
||||
char *getwd ();
|
||||
# define getcwd(Buf, Max) getwd (Buf)
|
||||
#endif
|
||||
|
||||
/* Amount to increase buffer size by in each try. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* xgethostname.c -- return current hostname with unlimited length
|
||||
Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -15,7 +15,7 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by Jim Meyering, meyering@comco.com */
|
||||
/* written by Jim Meyering */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
@@ -23,12 +23,23 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <errno.h>
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#include "error.h"
|
||||
|
||||
#ifndef EXIT_FAILURE
|
||||
# define EXIT_FAILURE 1
|
||||
#endif
|
||||
|
||||
int gethostname ();
|
||||
char *xmalloc ();
|
||||
char *xrealloc ();
|
||||
|
||||
#ifndef INITIAL_HOSTNAME_LENGTH
|
||||
# define INITIAL_HOSTNAME_LENGTH 33
|
||||
# define INITIAL_HOSTNAME_LENGTH 34
|
||||
#endif
|
||||
|
||||
char *
|
||||
@@ -42,10 +53,20 @@ xgethostname ()
|
||||
hostname = xmalloc (size);
|
||||
while (1)
|
||||
{
|
||||
hostname[size - 1] = '\0';
|
||||
/* Use size - 2 here rather than size - 1 to work around the bug
|
||||
in SunOS5.5's gethostname whereby it NUL-terminates HOSTNAME
|
||||
even when the name is longer than the supplied buffer. */
|
||||
int k = size - 2;
|
||||
|
||||
errno = 0;
|
||||
hostname[k] = '\0';
|
||||
err = gethostname (hostname, size);
|
||||
if (err == 0 && hostname[size - 1] == '\0')
|
||||
if (err == 0 && hostname[k] == '\0')
|
||||
break;
|
||||
#ifdef ENAMETOOLONG
|
||||
else if (err != 0 && errno != ENAMETOOLONG && errno != 0)
|
||||
error (EXIT_FAILURE, errno, "gethostname");
|
||||
#endif
|
||||
size *= 2;
|
||||
hostname = xrealloc (hostname, size);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* xmalloc.c -- malloc with out of memory checking
|
||||
Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -15,7 +15,7 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -30,23 +30,35 @@
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
VOID *calloc ();
|
||||
VOID *malloc ();
|
||||
VOID *realloc ();
|
||||
void free ();
|
||||
#endif
|
||||
|
||||
/* This is for other GNU distributions with internationalized messages.
|
||||
The GNU C Library itself does not yet support such messages. */
|
||||
#if HAVE_LIBINTL_H
|
||||
#if ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
# define _(Text) gettext (Text)
|
||||
#else
|
||||
# define gettext(msgid) (msgid)
|
||||
# define textdomain(Domain)
|
||||
# define _(Text) Text
|
||||
#endif
|
||||
|
||||
#include "error.h"
|
||||
|
||||
#ifndef EXIT_FAILURE
|
||||
# define EXIT_FAILURE 1
|
||||
#endif
|
||||
|
||||
/* Prototypes for functions defined here. */
|
||||
#if defined (__STDC__) && __STDC__
|
||||
static VOID *fixup_null_alloc (size_t n);
|
||||
VOID *xmalloc (size_t n);
|
||||
VOID *xcalloc (size_t n, size_t s);
|
||||
VOID *xrealloc (VOID *p, size_t n);
|
||||
#endif
|
||||
|
||||
|
||||
/* Exit value when the requested amount of memory is not available.
|
||||
The caller may set it to some other value. */
|
||||
int xmalloc_exit_failure = EXIT_FAILURE;
|
||||
@@ -67,7 +79,7 @@ fixup_null_alloc (n)
|
||||
if (n == 0)
|
||||
p = malloc ((size_t) 1);
|
||||
if (p == 0)
|
||||
error (xmalloc_exit_failure, 0, gettext ("Memory exhausted"));
|
||||
error (xmalloc_exit_failure, 0, _("Memory exhausted"));
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -85,6 +97,20 @@ xmalloc (n)
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Allocate memory for N elements of S bytes, with error checking. */
|
||||
|
||||
VOID *
|
||||
xcalloc (n, s)
|
||||
size_t n, s;
|
||||
{
|
||||
VOID *p;
|
||||
|
||||
p = calloc (n, s);
|
||||
if (p == 0)
|
||||
p = fixup_null_alloc (n);
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Change the size of an allocated block of memory P to N bytes,
|
||||
with error checking.
|
||||
If P is NULL, run xmalloc. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* xstrdup.c -- copy a string with out of memory checking
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -15,16 +15,22 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
#include <string.h>
|
||||
# include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
char *xmalloc (size_t);
|
||||
char *xstrdup (char *string);
|
||||
#else
|
||||
char *xmalloc ();
|
||||
#endif
|
||||
|
||||
/* Return a newly allocated copy of STRING. */
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
#ifndef XSTRTOD_H
|
||||
# define XSTRTOD_H 1
|
||||
|
||||
# ifndef __P
|
||||
# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
|
||||
# define __P(args) args
|
||||
# else
|
||||
# define __P(args) ()
|
||||
# endif /* GCC. */
|
||||
# endif /* Not __P. */
|
||||
#undef PARAMS
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# define PARAMS(Args) Args
|
||||
#else
|
||||
# define PARAMS(Args) ()
|
||||
#endif
|
||||
|
||||
int
|
||||
xstrtod __P ((const char *str, const char **ptr, double *result));
|
||||
xstrtod PARAMS ((const char *str, const char **ptr, double *result));
|
||||
|
||||
#endif /* XSTRTOD_H */
|
||||
#endif /* not XSTRTOD_H */
|
||||
|
||||
@@ -15,17 +15,17 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Jim Meyering (meyering@na-net.ornl.gov) */
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
@@ -91,19 +91,21 @@ __xstrtol (s, ptr, base, val, valid_suffixes)
|
||||
return LONGINT_OVERFLOW;
|
||||
if (*p == s)
|
||||
return LONGINT_INVALID;
|
||||
|
||||
/* Let valid_suffixes == NULL mean `allow any suffix'. */
|
||||
/* FIXME: update all callers except the one in tail.c changing
|
||||
last parameter NULL to `""'. */
|
||||
if (!valid_suffixes)
|
||||
{
|
||||
if (**p == '\0')
|
||||
{
|
||||
*val = tmp;
|
||||
return LONGINT_OK;
|
||||
}
|
||||
else
|
||||
return LONGINT_INVALID_SUFFIX_CHAR;
|
||||
*val = tmp;
|
||||
return LONGINT_OK;
|
||||
}
|
||||
|
||||
if (**p != '\0' && strchr (valid_suffixes, **p))
|
||||
if (**p != '\0')
|
||||
{
|
||||
if (!strchr (valid_suffixes, **p))
|
||||
return LONGINT_INVALID_SUFFIX_CHAR;
|
||||
|
||||
switch (**p)
|
||||
{
|
||||
case 'b':
|
||||
@@ -143,8 +145,8 @@ __xstrtol (s, ptr, base, val, valid_suffixes)
|
||||
|
||||
#ifdef TESTING_XSTRTO
|
||||
|
||||
#include <stdio.h>
|
||||
#include "error.h"
|
||||
# include <stdio.h>
|
||||
# include "error.h"
|
||||
|
||||
char *program_name;
|
||||
|
||||
@@ -172,4 +174,5 @@ main (int argc, char** argv)
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
|
||||
#endif /* TESTING_XSTRTO */
|
||||
|
||||
@@ -1,66 +1,69 @@
|
||||
#ifndef _xstrtol_h_
|
||||
#define _xstrtol_h_ 1
|
||||
#ifndef XSTRTOL_H_
|
||||
# define XSTRTOL_H_ 1
|
||||
|
||||
#if STRING_TO_UNSIGNED
|
||||
# define __xstrtol xstrtoul
|
||||
# define __strtol strtoul
|
||||
# define __unsigned unsigned
|
||||
# define __ZLONG_MAX ULONG_MAX
|
||||
#else
|
||||
# define __xstrtol xstrtol
|
||||
# define __strtol strtol
|
||||
# define __unsigned /* empty */
|
||||
# define __ZLONG_MAX LONG_MAX
|
||||
#endif
|
||||
# if STRING_TO_UNSIGNED
|
||||
# define __xstrtol xstrtoul
|
||||
# define __strtol strtoul
|
||||
# define __unsigned unsigned
|
||||
# define __ZLONG_MAX ULONG_MAX
|
||||
# else
|
||||
# define __xstrtol xstrtol
|
||||
# define __strtol strtol
|
||||
# define __unsigned /* empty */
|
||||
# define __ZLONG_MAX LONG_MAX
|
||||
# endif
|
||||
|
||||
#undef __P
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#define __P(x) x
|
||||
#else
|
||||
#define __P(x) ()
|
||||
#endif
|
||||
# undef PARAMS
|
||||
# if defined (__STDC__) && __STDC__
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
|
||||
#ifndef _STRTOL_ERROR
|
||||
enum strtol_error
|
||||
{
|
||||
LONGINT_OK, LONGINT_INVALID, LONGINT_INVALID_SUFFIX_CHAR, LONGINT_OVERFLOW
|
||||
};
|
||||
typedef enum strtol_error strtol_error;
|
||||
#endif
|
||||
|
||||
strtol_error
|
||||
__xstrtol __P ((const char *s, char **ptr, int base,
|
||||
__unsigned long int *val, const char *valid_suffixes));
|
||||
__xstrtol PARAMS ((const char *s, char **ptr, int base,
|
||||
__unsigned long int *val, const char *valid_suffixes));
|
||||
|
||||
#define _STRTOL_ERROR(exit_code, str, argument_type_string, err) \
|
||||
#undef _STRTOL_ERROR
|
||||
# define _STRTOL_ERROR(Exit_code, Str, Argument_type_string, Err) \
|
||||
do \
|
||||
{ \
|
||||
switch ((err)) \
|
||||
switch ((Err)) \
|
||||
{ \
|
||||
case LONGINT_OK: \
|
||||
abort (); \
|
||||
\
|
||||
case LONGINT_INVALID: \
|
||||
error ((exit_code), 0, "invalid %s `%s'", \
|
||||
(argument_type_string), (str)); \
|
||||
error ((Exit_code), 0, "invalid %s `%s'", \
|
||||
(Argument_type_string), (Str)); \
|
||||
break; \
|
||||
\
|
||||
case LONGINT_INVALID_SUFFIX_CHAR: \
|
||||
error ((exit_code), 0, "invalid character following %s `%s'", \
|
||||
(argument_type_string), (str)); \
|
||||
error ((Exit_code), 0, "invalid character following %s `%s'", \
|
||||
(Argument_type_string), (Str)); \
|
||||
break; \
|
||||
\
|
||||
case LONGINT_OVERFLOW: \
|
||||
/* FIXME: make this message dependent on STRING_TO_UNSIGNED */\
|
||||
error ((exit_code), 0, "%s `%s' larger than maximum long int",\
|
||||
(argument_type_string), (str)); \
|
||||
error ((Exit_code), 0, "%s `%s' larger than maximum long int",\
|
||||
(Argument_type_string), (Str)); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define STRTOL_FATAL_ERROR(str, argument_type_string, err) \
|
||||
_STRTOL_ERROR (2, str, argument_type_string, err)
|
||||
# define STRTOL_FATAL_ERROR(Str, Argument_type_string, Err) \
|
||||
_STRTOL_ERROR (2, Str, Argument_type_string, Err)
|
||||
|
||||
#define STRTOL_FAIL_WARN(str, argument_type_string, err) \
|
||||
_STRTOL_ERROR (0, str, argument_type_string, err)
|
||||
# define STRTOL_FAIL_WARN(Str, Argument_type_string, Err) \
|
||||
_STRTOL_ERROR (0, Str, Argument_type_string, Err)
|
||||
|
||||
#endif /* _xstrtol_h_ */
|
||||
#endif /* not XSTRTOL_H_ */
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
#ifndef _xstrtoul_h_
|
||||
# define _xstrtoul_h_ 1
|
||||
#ifndef XSTRTOUL_H_
|
||||
# define XSTRTOUL_H_ 1
|
||||
|
||||
# define STRING_TO_UNSIGNED 1
|
||||
|
||||
/* Undefine this symbol so we can include xstrtol.h a second time.
|
||||
Otherwise, a program that wanted both xstrtol.h and xstrtoul.h
|
||||
would never get the declaration corresponding to the header file
|
||||
included after the first one. */
|
||||
# undef XSTRTOL_H_
|
||||
# include "xstrtol.h"
|
||||
|
||||
#endif /* _xstrtoul_h_ */
|
||||
#endif /* not XSTRTOUL_H_ */
|
||||
|
||||
62
lib/ylwrap
Executable file
62
lib/ylwrap
Executable file
@@ -0,0 +1,62 @@
|
||||
#! /bin/sh
|
||||
# ylwrap - wrapper for lex/yacc invocations.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>, Aug 11 1996
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Usage:
|
||||
# ylwrap PROG [OUTPUT DESIRED]... -- [ARGS]...
|
||||
# * PROG is program to run.
|
||||
# * OUTPUT is file PROG generates
|
||||
# * DESIRED is file we actually want
|
||||
# * ARGS are passed to PROG
|
||||
# Any number of OUTPUT,DESIRED pairs may be used.
|
||||
|
||||
# The program to run.
|
||||
prog="$1"
|
||||
shift
|
||||
|
||||
pairlist=
|
||||
while test "$#" -ne 0; do
|
||||
if test "$1" = "--"; then
|
||||
break
|
||||
fi
|
||||
pairlist="$pairlist $1"
|
||||
shift
|
||||
done
|
||||
|
||||
$prog ${1+"$@"} || exit $?
|
||||
|
||||
set X $pairlist
|
||||
shift
|
||||
status=0
|
||||
first=yes
|
||||
while test "$#" -ne 0; do
|
||||
if test -f "$1"; then
|
||||
mv "$1" "$2" || status=$?
|
||||
else
|
||||
# A missing file is only an error for the first file. This is a
|
||||
# blatant hack to let us support using "yacc -d". If -d is not
|
||||
# specified, we don't want an error when the header file is
|
||||
# "missing".
|
||||
if test $first = yes; then
|
||||
status=1
|
||||
fi
|
||||
fi
|
||||
shift
|
||||
shift
|
||||
first=no
|
||||
done
|
||||
exit $status
|
||||
1
m4/.cvsignore
Normal file
1
m4/.cvsignore
Normal file
@@ -0,0 +1 @@
|
||||
Makefile
|
||||
11
m4/Makefile.am
Normal file
11
m4/Makefile.am
Normal file
@@ -0,0 +1,11 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
# Generate this list with
|
||||
# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
|
||||
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
|
||||
EXTRA_DIST = README \
|
||||
ccstdc.m4 dmalloc.m4 error.m4 getgroups.m4 getline.m4 getloadavg.m4 \
|
||||
gettext.m4 header.m4 init.m4 install.m4 jm-mktime.m4 jm-winsz1.m4 \
|
||||
jm-winsz2.m4 lcmessage.m4 lispdir.m4 maintainer.m4 memcmp.m4 mktime.m4 \
|
||||
obstack.m4 progtest.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strftime.m4 \
|
||||
strtod.m4 termios.m4 uptime.m4 winsz.m4
|
||||
149
m4/Makefile.in
Normal file
149
m4/Makefile.in
Normal file
@@ -0,0 +1,149 @@
|
||||
# Makefile.in generated automatically by automake 1.1l from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy, distribute and modify it.
|
||||
|
||||
# Generate this list with
|
||||
# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
|
||||
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
RANLIB = @RANLIB@
|
||||
GENCAT = @GENCAT@
|
||||
PERL = @PERL@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
CC = @CC@
|
||||
|
||||
EXTRA_DIST = README \
|
||||
ccstdc.m4 dmalloc.m4 error.m4 getgroups.m4 getline.m4 getloadavg.m4 \
|
||||
gettext.m4 header.m4 init.m4 install.m4 jm-mktime.m4 jm-winsz1.m4 \
|
||||
jm-winsz2.m4 lcmessage.m4 lispdir.m4 maintainer.m4 memcmp.m4 mktime.m4 \
|
||||
obstack.m4 progtest.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strftime.m4 \
|
||||
strtod.m4 termios.m4 uptime.m4 winsz.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_COMMON = README Makefile.am Makefile.in README
|
||||
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) \
|
||||
$(TEXINFOS) $(MANS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
default: all
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL)
|
||||
cd $(top_srcdir) && automake --gnu m4/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = m4
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
info:
|
||||
dvi:
|
||||
check: all
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
install-exec:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install-data:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
uninstall:
|
||||
|
||||
all: Makefile
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
rm -f Makefile $(DISTCLEANFILES)
|
||||
rm -f config.cache config.log stamp-h
|
||||
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-generic
|
||||
|
||||
clean: clean-generic mostlyclean
|
||||
|
||||
distclean: distclean-generic clean
|
||||
rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-generic distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default tags distdir info dvi installcheck install-exec \
|
||||
install-data install uninstall all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
9
m4/README
Normal file
9
m4/README
Normal file
@@ -0,0 +1,9 @@
|
||||
These files are used by a program called aclocal (part of the GNU automake
|
||||
package). aclocal uses these files to create aclocal.m4 which is in turn
|
||||
used by autoconf to create the configure script at the the top level in
|
||||
this distribution.
|
||||
|
||||
Some of these files are copies of the ones in the automake-1.1l
|
||||
distribution. Others are specific to this package.
|
||||
Eventually, I expect that aclocal will evolve so that this directory
|
||||
can contain only the .m4 files specific to this package.
|
||||
61
m4/ccstdc.m4
Normal file
61
m4/ccstdc.m4
Normal file
@@ -0,0 +1,61 @@
|
||||
## ----------------------------------------- ##
|
||||
## ANSIfy the C compiler whenever possible. ##
|
||||
## From Franc,ois Pinard ##
|
||||
## ----------------------------------------- ##
|
||||
|
||||
# serial 1
|
||||
|
||||
# @defmac AC_PROG_CC_STDC
|
||||
# @maindex PROG_CC_STDC
|
||||
# @ovindex CC
|
||||
# If the C compiler in not in ANSI C mode by default, try to add an option
|
||||
# to output variable @code{CC} to make it so. This macro tries various
|
||||
# options that select ANSI C on some system or another. It considers the
|
||||
# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
|
||||
# handles function prototypes correctly.
|
||||
#
|
||||
# If you use this macro, you should check after calling it whether the C
|
||||
# compiler has been set to accept ANSI C; if not, the shell variable
|
||||
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
|
||||
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
|
||||
# program @code{ansi2knr}, which comes with Ghostscript.
|
||||
# @end defmac
|
||||
|
||||
AC_DEFUN(AM_PROG_CC_STDC,
|
||||
[AC_REQUIRE([AC_PROG_CC])
|
||||
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
|
||||
AC_CACHE_VAL(am_cv_prog_cc_stdc,
|
||||
[am_cv_prog_cc_stdc=no
|
||||
ac_save_CC="$CC"
|
||||
# Don't try gcc -ansi; that turns off useful extensions and
|
||||
# breaks some systems' header files.
|
||||
# AIX -qlanglvl=ansi
|
||||
# Ultrix and OSF/1 -std1
|
||||
# HP-UX -Aa -D_HPUX_SOURCE
|
||||
# SVR4 -Xc -D__EXTENSIONS__
|
||||
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
|
||||
do
|
||||
CC="$ac_save_CC $ac_arg"
|
||||
AC_TRY_COMPILE(
|
||||
[#if !defined(__STDC__) || __STDC__ != 1
|
||||
choke me
|
||||
#endif
|
||||
/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
|
||||
#ifdef _SEQUENT_
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
], [
|
||||
int test (int i, double x);
|
||||
struct s1 {int (*f) (int a);};
|
||||
struct s2 {int (*f) (double a);};],
|
||||
[am_cv_prog_cc_stdc="$ac_arg"; break])
|
||||
done
|
||||
CC="$ac_save_CC"
|
||||
])
|
||||
AC_MSG_RESULT($am_cv_prog_cc_stdc)
|
||||
case "x$am_cv_prog_cc_stdc" in
|
||||
x|xno) ;;
|
||||
*) CC="$CC $am_cv_prog_cc_stdc" ;;
|
||||
esac
|
||||
])
|
||||
21
m4/dmalloc.m4
Normal file
21
m4/dmalloc.m4
Normal file
@@ -0,0 +1,21 @@
|
||||
## ----------------------------------- ##
|
||||
## Check if --with-dmalloc was given. ##
|
||||
## From Franc,ois Pinard ##
|
||||
## ----------------------------------- ##
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_WITH_DMALLOC,
|
||||
[AC_MSG_CHECKING(if malloc debugging is wanted)
|
||||
AC_ARG_WITH(dmalloc,
|
||||
[ --with-dmalloc use dmalloc, as in
|
||||
ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz],
|
||||
[if test "$withval" = yes; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(WITH_DMALLOC)
|
||||
LIBS="$LIBS -ldmalloc"
|
||||
LDFLAGS="$LDFLAGS -g"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi], [AC_MSG_RESULT(no)])
|
||||
])
|
||||
13
m4/error.m4
Normal file
13
m4/error.m4
Normal file
@@ -0,0 +1,13 @@
|
||||
dnl From Jim Meyering. Use this if you use the GNU error.[ch].
|
||||
dnl FIXME: Migrate into libit
|
||||
|
||||
AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
|
||||
[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
|
||||
[AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
|
||||
am_cv_lib_error_at_line=yes,
|
||||
am_cv_lib_error_at_line=no)])
|
||||
if test $am_cv_lib_error_at_line = no; then
|
||||
LIBOBJS="$LIBOBJS error.o"
|
||||
fi
|
||||
AC_SUBST(LIBOBJS)dnl
|
||||
])
|
||||
49
m4/getgroups.m4
Normal file
49
m4/getgroups.m4
Normal file
@@ -0,0 +1,49 @@
|
||||
#serial 2
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl If you use this macro in a package, you should
|
||||
dnl add the following two lines to acconfig.h:
|
||||
dnl /* Define to rpl_getgroups if the replacement function should be used. */
|
||||
dnl #undef getgroups
|
||||
dnl
|
||||
dnl Invoking code should check $GETGROUPS_LIB something like this:
|
||||
dnl jm_FUNC_GETGROUPS
|
||||
dnl test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
|
||||
dnl
|
||||
|
||||
AC_DEFUN(jm_FUNC_GETGROUPS,
|
||||
[AC_REQUIRE([AC_TYPE_GETGROUPS])dnl
|
||||
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
|
||||
AC_CHECK_FUNCS(getgroups)
|
||||
|
||||
# If we don't yet have getgroups, see if it's in -lbsd.
|
||||
# This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1.
|
||||
if test $ac_cv_func_getgroups = no; then
|
||||
jm_cv_sys_getgroups_saved_lib="$LIBS"
|
||||
AC_CHECK_LIB(bsd, getgroups, [GETGROUPS_LIB=-lbsd])
|
||||
LIBS="$jm_cv_sys_getgroups_saved_lib"
|
||||
fi
|
||||
|
||||
# Run the program to test the functionality of the system-supplied
|
||||
# getgroups function only if there is such a function.
|
||||
if test $ac_cv_func_getgroups = yes; then
|
||||
AC_CACHE_CHECK([for working getgroups], jm_cv_func_working_getgroups,
|
||||
[AC_TRY_RUN([
|
||||
int
|
||||
main ()
|
||||
{
|
||||
/* On Ultrix 4.3, getgroups (0, 0) always fails. */
|
||||
exit (getgroups (0, 0) == -1 ? 1 : 0);
|
||||
}
|
||||
],
|
||||
jm_cv_func_working_getgroups=yes,
|
||||
jm_cv_func_working_getgroups=no,
|
||||
dnl When crosscompiling, assume getgroups is broken.
|
||||
jm_cv_func_working_getgroups=no)
|
||||
])
|
||||
if test $jm_cv_func_working_getgroups = no; then
|
||||
LIBOBJS="$LIBOBJS getgroups.o"
|
||||
AC_DEFINE_UNQUOTED(getgroups, rpl_getgroups)
|
||||
fi
|
||||
fi
|
||||
])
|
||||
45
m4/getline.m4
Normal file
45
m4/getline.m4
Normal file
@@ -0,0 +1,45 @@
|
||||
#serial 1
|
||||
|
||||
dnl See if there's a working, system-supplied version of the getline function.
|
||||
dnl We can't just to AC_REPLACE_FUNCS(getline) because some systems
|
||||
dnl have a function by that name in -linet that doesn't have anything
|
||||
dnl to do with the function we need.
|
||||
AC_DEFUN(AM_FUNC_GETLINE,
|
||||
[dnl
|
||||
am_getline_needs_run_time_check=no
|
||||
am_cv_func_working_getline=yes
|
||||
AC_CHECK_FUNC(getline,
|
||||
dnl Found it in some library. Verify that it works.
|
||||
am_getline_needs_run_time_check=yes,
|
||||
am_cv_func_working_getline=no)
|
||||
if test $am_getline_needs_run_time_check = yes; then
|
||||
AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
|
||||
[echo fooN |tr -d '\012'|tr N '\012' > conftestdata
|
||||
AC_TRY_RUN([
|
||||
# include <stdio.h>
|
||||
# include <sys/types.h>
|
||||
# if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
# endif
|
||||
int main ()
|
||||
{ /* Based on a test program from Karl Heuer. */
|
||||
char *line = NULL;
|
||||
size_t siz = 0;
|
||||
int len;
|
||||
FILE *in = fopen ("./conftestdata", "r");
|
||||
if (!in)
|
||||
return 1;
|
||||
len = getline (&line, &siz, in);
|
||||
exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
|
||||
}
|
||||
], am_cv_func_working_getline=yes dnl The library version works.
|
||||
, am_cv_func_working_getline=no dnl The library version does NOT work.
|
||||
, am_cv_func_working_getline=no dnl We're cross compiling.
|
||||
)])
|
||||
fi
|
||||
|
||||
if test $am_cv_func_working_getline = no; then
|
||||
LIBOBJS="$LIBOBJS getline.o"
|
||||
AC_SUBST(LIBOBJS)dnl
|
||||
fi
|
||||
])
|
||||
127
m4/getloadavg.m4
Normal file
127
m4/getloadavg.m4
Normal file
@@ -0,0 +1,127 @@
|
||||
#serial 3
|
||||
|
||||
AC_DEFUN(AM_FUNC_GETLOADAVG,
|
||||
[ac_have_func=no # yes means we've found a way to get the load average.
|
||||
|
||||
am_cv_saved_LIBS="$LIBS"
|
||||
|
||||
# On HPUX9, an unprivileged user can get load averages through this function.
|
||||
AC_CHECK_FUNCS(pstat_getdynamic)
|
||||
|
||||
# Solaris has libkstat which does not require root.
|
||||
AC_CHECK_LIB(kstat, kstat_open)
|
||||
if test $ac_cv_lib_kstat_kstat_open = yes ; then ac_have_func=yes ; fi
|
||||
|
||||
# Some systems with -lutil have (and need) -lkvm as well, some do not.
|
||||
# On Solaris, -lkvm requires nlist from -lelf, so check that first
|
||||
# to get the right answer into the cache.
|
||||
# For kstat on solaris, we need libelf to force the definition of SVR4 below.
|
||||
AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS")
|
||||
if test $ac_have_func = no; then
|
||||
AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS")
|
||||
# Check for the 4.4BSD definition of getloadavg.
|
||||
AC_CHECK_LIB(util, getloadavg,
|
||||
[LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes])
|
||||
fi
|
||||
|
||||
if test $ac_have_func = no; then
|
||||
# There is a commonly available library for RS/6000 AIX.
|
||||
# Since it is not a standard part of AIX, it might be installed locally.
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-L/usr/local/lib $LIBS"
|
||||
AC_CHECK_LIB(getloadavg, getloadavg,
|
||||
LIBS="-lgetloadavg $LIBS", LIBS="$ac_save_LIBS")
|
||||
fi
|
||||
|
||||
# Make sure it is really in the library, if we think we found it.
|
||||
AC_REPLACE_FUNCS(getloadavg)
|
||||
|
||||
if test $ac_cv_func_getloadavg = yes; then
|
||||
AC_DEFINE(HAVE_GETLOADAVG)
|
||||
ac_have_func=yes
|
||||
else
|
||||
AC_DEFINE(C_GETLOADAVG)
|
||||
# Figure out what our getloadavg.c needs.
|
||||
ac_have_func=no
|
||||
AC_CHECK_HEADER(sys/dg_sys_info.h,
|
||||
[ac_have_func=yes; AC_DEFINE(DGUX)
|
||||
AC_CHECK_LIB(dgc, dg_sys_info)])
|
||||
|
||||
# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
|
||||
# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
|
||||
# Irix 4.0.5F has the header but not the library.
|
||||
if test $ac_have_func = no && test $ac_cv_lib_elf_elf_begin = yes; then
|
||||
ac_have_func=yes; AC_DEFINE(SVR4)
|
||||
fi
|
||||
|
||||
if test $ac_have_func = no; then
|
||||
AC_CHECK_HEADER(inq_stats/cpustats.h,
|
||||
[ac_have_func=yes; AC_DEFINE(UMAX)
|
||||
AC_DEFINE(UMAX4_3)])
|
||||
fi
|
||||
|
||||
if test $ac_have_func = no; then
|
||||
AC_CHECK_HEADER(sys/cpustats.h,
|
||||
[ac_have_func=yes; AC_DEFINE(UMAX)])
|
||||
fi
|
||||
|
||||
if test $ac_have_func = no; then
|
||||
AC_CHECK_HEADERS(mach/mach.h)
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADER(nlist.h,
|
||||
[AC_DEFINE(NLIST_STRUCT)
|
||||
AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
|
||||
[AC_TRY_COMPILE([#include <nlist.h>],
|
||||
[struct nlist n; n.n_un.n_name = 0;],
|
||||
ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
|
||||
if test $ac_cv_struct_nlist_n_un = yes; then
|
||||
AC_DEFINE(NLIST_NAME_UNION)
|
||||
fi
|
||||
])dnl
|
||||
fi # Do not have getloadavg in system libraries.
|
||||
|
||||
# Some definitions of getloadavg require that the program be installed setgid.
|
||||
dnl FIXME Don't hardwire the path of getloadavg.c in the top-level directory.
|
||||
AC_CACHE_CHECK(whether getloadavg requires setgid,
|
||||
ac_cv_func_getloadavg_setgid,
|
||||
[AC_EGREP_CPP([Yowza Am I SETGID yet],
|
||||
[#include "$srcdir/lib/getloadavg.c"
|
||||
#ifdef LDAV_PRIVILEGED
|
||||
Yowza Am I SETGID yet
|
||||
#endif],
|
||||
ac_cv_func_getloadavg_setgid=yes, ac_cv_func_getloadavg_setgid=no)])
|
||||
if test $ac_cv_func_getloadavg_setgid = yes; then
|
||||
NEED_SETGID=true; AC_DEFINE(GETLOADAVG_PRIVILEGED)
|
||||
else
|
||||
NEED_SETGID=false
|
||||
fi
|
||||
AC_SUBST(NEED_SETGID)dnl
|
||||
|
||||
if test $ac_cv_func_getloadavg_setgid = yes; then
|
||||
AC_CACHE_CHECK(group of /dev/kmem, ac_cv_group_kmem,
|
||||
changequote(<<, >>)dnl
|
||||
<<
|
||||
# On Solaris, /dev/kmem is a symlink. Get info on the real file.
|
||||
ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
|
||||
# If we got an error (system does not support symlinks), try without -L.
|
||||
test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
|
||||
ac_cv_group_kmem=`echo $ac_ls_output \
|
||||
| sed -ne 's/[ ][ ]*/ /g;
|
||||
s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/;
|
||||
/ /s/.* //;p;'`
|
||||
>>
|
||||
changequote([, ])dnl
|
||||
)
|
||||
KMEM_GROUP=$ac_cv_group_kmem
|
||||
fi
|
||||
AC_SUBST(KMEM_GROUP)dnl
|
||||
|
||||
if test x = "x$am_cv_saved_LIBS"; then
|
||||
GETLOADAVG_LIBS="$LIBS"
|
||||
else
|
||||
GETLOADAVG_LIBS=`echo "$LIBS"|sed "s!$am_cv_saved_LIBS!!"`
|
||||
fi
|
||||
AC_SUBST(GETLOADAVG_LIBS)dnl
|
||||
LIBS="$am_cv_saved_LIBS"
|
||||
])
|
||||
286
m4/gettext.m4
Normal file
286
m4/gettext.m4
Normal file
@@ -0,0 +1,286 @@
|
||||
# Macro to add for using GNU gettext.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1995.
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_WITH_NLS,
|
||||
[AC_MSG_CHECKING([whether NLS is requested])
|
||||
dnl Default is enabled NLS
|
||||
AC_ARG_ENABLE(nls,
|
||||
[ --disable-nls do not use Native Language Support],
|
||||
USE_NLS=$enableval, USE_NLS=yes)
|
||||
AC_MSG_RESULT($USE_NLS)
|
||||
AC_SUBST(USE_NLS)
|
||||
|
||||
USE_INCLUDED_LIBINTL=no
|
||||
|
||||
dnl If we use NLS figure out what method
|
||||
if test "$USE_NLS" = "yes"; then
|
||||
AC_DEFINE(ENABLE_NLS)
|
||||
AC_MSG_CHECKING([whether included gettext is requested])
|
||||
AC_ARG_WITH(included-gettext,
|
||||
[ --with-included-gettext use the GNU gettext library included here],
|
||||
nls_cv_force_use_gnu_gettext=$withval,
|
||||
nls_cv_force_use_gnu_gettext=no)
|
||||
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
|
||||
|
||||
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
|
||||
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
|
||||
dnl User does not insist on using GNU NLS library. Figure out what
|
||||
dnl to use. If gettext or catgets are available (in this order) we
|
||||
dnl use this. Else we have to fall back to GNU NLS library.
|
||||
dnl catgets is only used if permitted by option --with-catgets.
|
||||
nls_cv_header_intl=
|
||||
nls_cv_header_libgt=
|
||||
CATOBJEXT=NONE
|
||||
|
||||
AC_CHECK_HEADER(libintl.h,
|
||||
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
|
||||
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
|
||||
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
|
||||
|
||||
if test "$gt_cv_func_gettext_libc" != "yes"; then
|
||||
AC_CHECK_LIB(intl, bindtextdomain,
|
||||
[AC_CACHE_CHECK([for gettext in libintl],
|
||||
gt_cv_func_gettext_libintl,
|
||||
[AC_TRY_LINK([], [return (int) gettext ("")],
|
||||
gt_cv_func_gettext_libintl=yes,
|
||||
gt_cv_func_gettext_libintl=no)])])
|
||||
fi
|
||||
|
||||
if test "$gt_cv_func_gettext_libc" = "yes" \
|
||||
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
|
||||
AC_DEFINE(HAVE_GETTEXT)
|
||||
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
|
||||
if test "$MSGFMT" != "no"; then
|
||||
AC_CHECK_FUNCS(dcgettext)
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
|
||||
return _nl_msg_cat_cntr],
|
||||
[CATOBJEXT=.gmo
|
||||
DATADIRNAME=share],
|
||||
[CATOBJEXT=.mo
|
||||
DATADIRNAME=lib])
|
||||
INSTOBJEXT=.mo
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$CATOBJEXT" = "NONE"; then
|
||||
AC_MSG_CHECKING([whether catgets can be used])
|
||||
AC_ARG_WITH(catgets,
|
||||
[ --with-catgets use catgets functions if available],
|
||||
nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
|
||||
AC_MSG_RESULT($nls_cv_use_catgets)
|
||||
|
||||
if test "$nls_cv_use_catgets" = "yes"; then
|
||||
dnl No gettext in C library. Try catgets next.
|
||||
AC_CHECK_LIB(i, main)
|
||||
AC_CHECK_FUNC(catgets,
|
||||
[AC_DEFINE(HAVE_CATGETS)
|
||||
INTLOBJS="\$(CATOBJS)"
|
||||
AC_PATH_PROG(GENCAT, gencat, no)dnl
|
||||
if test "$GENCAT" != "no"; then
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
|
||||
if test "$GMSGFMT" = "no"; then
|
||||
AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
|
||||
fi
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
CATOBJEXT=.cat
|
||||
INSTOBJEXT=.cat
|
||||
DATADIRNAME=lib
|
||||
INTLDEPS="../intl/libintl.a"
|
||||
INTLLIBS=$INTLDEPS
|
||||
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
|
||||
nls_cv_header_intl=intl/libintl.h
|
||||
nls_cv_header_libgt=intl/libgettext.h
|
||||
fi])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$CATOBJEXT" = "NONE"; then
|
||||
dnl Neither gettext nor catgets in included in the C library.
|
||||
dnl Fall back on GNU gettext library.
|
||||
nls_cv_use_gnu_gettext=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$nls_cv_use_gnu_gettext" = "yes"; then
|
||||
dnl Mark actions used to generate GNU NLS library.
|
||||
INTLOBJS="\$(GETTOBJS)"
|
||||
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
AC_SUBST(MSGFMT)
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
CATOBJEXT=.gmo
|
||||
INSTOBJEXT=.mo
|
||||
DATADIRNAME=share
|
||||
INTLDEPS="../intl/libintl.a"
|
||||
INTLLIBS=$INTLDEPS
|
||||
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
|
||||
nls_cv_header_intl=intl/libintl.h
|
||||
nls_cv_header_libgt=intl/libgettext.h
|
||||
fi
|
||||
|
||||
dnl Test whether we really found GNU xgettext.
|
||||
if test "$XGETTEXT" != ":"; then
|
||||
dnl If it is no GNU xgettext we define it as : so that the
|
||||
dnl Makefiles still can work.
|
||||
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
|
||||
: ;
|
||||
else
|
||||
AC_MSG_RESULT(
|
||||
[found xgettext programs is not GNU xgettext; ignore it])
|
||||
XGETTEXT=":"
|
||||
fi
|
||||
fi
|
||||
|
||||
# We need to process the po/ directory.
|
||||
POSUB=po
|
||||
else
|
||||
DATADIRNAME=share
|
||||
nls_cv_header_intl=intl/libintl.h
|
||||
nls_cv_header_libgt=intl/libgettext.h
|
||||
fi
|
||||
|
||||
# If this is used in GNU gettext we have to set USE_NLS to `yes'
|
||||
# because some of the sources are only built for this goal.
|
||||
if test "$PACKAGE" = gettext; then
|
||||
USE_NLS=yes
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
fi
|
||||
|
||||
dnl These rules are solely for the distribution goal. While doing this
|
||||
dnl we only have to keep exactly one list of the available catalogs
|
||||
dnl in configure.in.
|
||||
for lang in $ALL_LINGUAS; do
|
||||
GMOFILES="$GMOFILES $lang.gmo"
|
||||
POFILES="$POFILES $lang.po"
|
||||
done
|
||||
|
||||
dnl Make all variables we use known to autoconf.
|
||||
AC_SUBST(USE_INCLUDED_LIBINTL)
|
||||
AC_SUBST(CATALOGS)
|
||||
AC_SUBST(CATOBJEXT)
|
||||
AC_SUBST(DATADIRNAME)
|
||||
AC_SUBST(GMOFILES)
|
||||
AC_SUBST(INSTOBJEXT)
|
||||
AC_SUBST(INTLDEPS)
|
||||
AC_SUBST(INTLLIBS)
|
||||
AC_SUBST(INTLOBJS)
|
||||
AC_SUBST(POFILES)
|
||||
AC_SUBST(POSUB)
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_GNU_GETTEXT,
|
||||
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_HEADER_STDC])dnl
|
||||
AC_REQUIRE([AC_C_CONST])dnl
|
||||
AC_REQUIRE([AC_C_INLINE])dnl
|
||||
AC_REQUIRE([AC_TYPE_OFF_T])dnl
|
||||
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
|
||||
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
|
||||
AC_REQUIRE([AC_FUNC_MMAP])dnl
|
||||
|
||||
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
|
||||
unistd.h values.h])
|
||||
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
|
||||
__argz_count __argz_stringify __argz_next])
|
||||
|
||||
if test "${ac_cv_func_stpcpy+set}" != "set"; then
|
||||
AC_CHECK_FUNCS(stpcpy)
|
||||
fi
|
||||
if test "${ac_cv_func_stpcpy}" = "yes"; then
|
||||
AC_DEFINE(HAVE_STPCPY)
|
||||
fi
|
||||
|
||||
AM_LC_MESSAGES
|
||||
AM_WITH_NLS
|
||||
|
||||
if test "x$CATOBJEXT" != "x"; then
|
||||
if test "x$ALL_LINGUAS" = "x"; then
|
||||
LINGUAS=
|
||||
else
|
||||
AC_MSG_CHECKING(for catalogs to be installed)
|
||||
NEW_LINGUAS=
|
||||
for lang in ${LINGUAS=$ALL_LINGUAS}; do
|
||||
case "$ALL_LINGUAS" in
|
||||
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
|
||||
esac
|
||||
done
|
||||
LINGUAS=$NEW_LINGUAS
|
||||
AC_MSG_RESULT($LINGUAS)
|
||||
fi
|
||||
|
||||
dnl Construct list of names of catalog files to be constructed.
|
||||
if test -n "$LINGUAS"; then
|
||||
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Determine which catalog format we have (if any is needed)
|
||||
dnl For now we know about two different formats:
|
||||
dnl Linux libc-5 and the normal X/Open format
|
||||
test -d intl || mkdir intl
|
||||
if test "$CATOBJEXT" = ".cat"; then
|
||||
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
|
||||
|
||||
dnl Transform the SED scripts while copying because some dumb SEDs
|
||||
dnl cannot handle comments.
|
||||
sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
|
||||
fi
|
||||
dnl po2tbl.sed is always needed.
|
||||
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
|
||||
$srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
|
||||
|
||||
dnl In the intl/Makefile.in we have a special dependency which makes
|
||||
dnl only sense for gettext. We comment this out for non-gettext
|
||||
dnl packages.
|
||||
if test "$PACKAGE" = "gettext"; then
|
||||
GT_NO="#NO#"
|
||||
GT_YES=
|
||||
else
|
||||
GT_NO=
|
||||
GT_YES="#YES#"
|
||||
fi
|
||||
AC_SUBST(GT_NO)
|
||||
AC_SUBST(GT_YES)
|
||||
|
||||
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
|
||||
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
|
||||
dnl Try to locate is.
|
||||
MKINSTALLDIRS=
|
||||
if test $ac_aux_dir; then
|
||||
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
|
||||
fi
|
||||
if test -z $MKINSTALLDIRS; then
|
||||
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
|
||||
fi
|
||||
AC_SUBST(MKINSTALLDIRS)
|
||||
|
||||
dnl Generate list of files to be processed by xgettext which will
|
||||
dnl be included in po/Makefile.
|
||||
test -d po || mkdir po
|
||||
if test "x$srcdir" != "x."; then
|
||||
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
|
||||
posrcprefix="$srcdir/"
|
||||
else
|
||||
posrcprefix="../$srcdir/"
|
||||
fi
|
||||
else
|
||||
posrcprefix="../"
|
||||
fi
|
||||
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
|
||||
< $srcdir/po/POTFILES.in > po/POTFILES
|
||||
])
|
||||
12
m4/header.m4
Normal file
12
m4/header.m4
Normal file
@@ -0,0 +1,12 @@
|
||||
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
||||
|
||||
AC_DEFUN(AM_CONFIG_HEADER,
|
||||
[AC_PREREQ([2.12])
|
||||
AC_CONFIG_HEADER([$1])
|
||||
dnl When config.status generates a header, we must update the stamp-h file.
|
||||
dnl This file resides in the same directory as the config header
|
||||
dnl that is generated. We must strip everything past the first ":",
|
||||
dnl and everything past the last "/".
|
||||
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
||||
test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl
|
||||
changequote([,]))])
|
||||
20
m4/init.m4
Normal file
20
m4/init.m4
Normal file
@@ -0,0 +1,20 @@
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl Usage:
|
||||
dnl AM_INIT_AUTOMAKE(package,version)
|
||||
|
||||
AC_DEFUN(AM_INIT_AUTOMAKE,
|
||||
[AC_REQUIRE([AM_PROG_INSTALL])
|
||||
PACKAGE=[$1]
|
||||
AC_SUBST(PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
||||
VERSION=[$2]
|
||||
AC_SUBST(VERSION)
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
|
||||
AM_SANITY_CHECK
|
||||
AC_ARG_PROGRAM
|
||||
AC_PROG_MAKE_SET])
|
||||
13
m4/install.m4
Normal file
13
m4/install.m4
Normal file
@@ -0,0 +1,13 @@
|
||||
## --------------------------------------------------------- ##
|
||||
## Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
|
||||
## substitution. ##
|
||||
## From Franc,ois Pinard ##
|
||||
## --------------------------------------------------------- ##
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_PROG_INSTALL,
|
||||
[AC_REQUIRE([AC_PROG_INSTALL])
|
||||
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
|
||||
AC_SUBST(INSTALL_SCRIPT)dnl
|
||||
])
|
||||
14
m4/jm-mktime.m4
Normal file
14
m4/jm-mktime.m4
Normal file
@@ -0,0 +1,14 @@
|
||||
#serial 1
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl If you use this macro in a package, you should
|
||||
dnl add the following two lines to acconfig.h:
|
||||
dnl /* Define to rpl_mktime if the replacement function should be used. */
|
||||
dnl #undef mktime
|
||||
dnl
|
||||
AC_DEFUN(jm_FUNC_MKTIME,
|
||||
[AC_REQUIRE([AM_FUNC_MKTIME])dnl
|
||||
if test $am_cv_func_working_mktime = no; then
|
||||
AC_DEFINE_UNQUOTED(mktime, rpl_mktime)
|
||||
fi
|
||||
])
|
||||
19
m4/jm-winsz1.m4
Normal file
19
m4/jm-winsz1.m4
Normal file
@@ -0,0 +1,19 @@
|
||||
dnl From Jim Meyering.
|
||||
#serial 1
|
||||
AC_DEFUN(jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H,
|
||||
[AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
|
||||
AC_CACHE_CHECK([whether use of TIOCGWINSZ requires termios.h],
|
||||
jm_cv_sys_tiocgwinsz_needs_termios_h,
|
||||
[jm_cv_sys_tiocgwinsz_needs_termios_h=no
|
||||
|
||||
if test $am_cv_sys_posix_termios = yes; then
|
||||
AC_EGREP_CPP([yes],
|
||||
[#include <sys/types.h>
|
||||
# include <termios.h>
|
||||
# ifdef TIOCGWINSZ
|
||||
yes
|
||||
# endif
|
||||
], jm_cv_sys_tiocgwinsz_needs_termios_h=yes)
|
||||
fi
|
||||
])
|
||||
])
|
||||
22
m4/jm-winsz2.m4
Normal file
22
m4/jm-winsz2.m4
Normal file
@@ -0,0 +1,22 @@
|
||||
#serial 2
|
||||
|
||||
AC_DEFUN(jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
|
||||
[AC_REQUIRE([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H])
|
||||
AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
|
||||
jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
|
||||
[jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
|
||||
|
||||
if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no; then
|
||||
AC_EGREP_CPP([yes],
|
||||
[#include <sys/types.h>
|
||||
# include <sys/ioctl.h>
|
||||
# ifdef TIOCGWINSZ
|
||||
yes
|
||||
# endif
|
||||
], jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
|
||||
fi
|
||||
])
|
||||
if test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
|
||||
AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
|
||||
fi
|
||||
])
|
||||
14
m4/lcmessage.m4
Normal file
14
m4/lcmessage.m4
Normal file
@@ -0,0 +1,14 @@
|
||||
# Check whether LC_MESSAGES is available in <locale.h>.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1995.
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_LC_MESSAGES,
|
||||
[if test $ac_cv_header_locale_h = yes; then
|
||||
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
|
||||
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
|
||||
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
|
||||
if test $am_cv_val_LC_MESSAGES = yes; then
|
||||
AC_DEFINE(HAVE_LC_MESSAGES)
|
||||
fi
|
||||
fi])
|
||||
38
m4/lispdir.m4
Normal file
38
m4/lispdir.m4
Normal file
@@ -0,0 +1,38 @@
|
||||
## ------------------------
|
||||
## Emacs LISP file handling
|
||||
## From Ulrich Drepper
|
||||
## ------------------------
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_PATH_LISPDIR,
|
||||
[# If set to t, that means we are running in a shell under Emacs.
|
||||
# If you have an Emacs named "t", then use the full path.
|
||||
test "$EMACS" = t && EMACS=
|
||||
AC_PATH_PROG(EMACS, emacs xemacs, no)
|
||||
if test $EMACS != "no"; then
|
||||
AC_MSG_CHECKING([where .elc files should go])
|
||||
dnl Set default value
|
||||
lispdir="\$(datadir)/emacs/site-lisp"
|
||||
if test "x$prefix" = "xNONE"; then
|
||||
if test -d $ac_default_prefix/share/emacs/site-lisp; then
|
||||
lispdir="\$(prefix)/share/emacs/site-lisp"
|
||||
else
|
||||
if test -d $ac_default_prefix/lib/emacs/site-lisp; then
|
||||
lispdir="\$(prefix)/lib/emacs/site-lisp"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if test -d $prefix/share/emacs/site-lisp; then
|
||||
lispdir="\$(prefix)/share/emacs/site-lisp"
|
||||
else
|
||||
if test -d $prefix/lib/emacs/site-lisp; then
|
||||
lispdir="\$(prefix)/lib/emacs/site-lisp"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT($lispdir)
|
||||
ELCFILES="\$(ELCFILES)"
|
||||
fi
|
||||
AC_SUBST(lispdir)
|
||||
AC_SUBST(ELCFILES)])
|
||||
22
m4/maintainer.m4
Normal file
22
m4/maintainer.m4
Normal file
@@ -0,0 +1,22 @@
|
||||
# Add --enable-maintainer-mode option to configure.
|
||||
# From Jim Meyering
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_MAINTAINER_MODE,
|
||||
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
||||
dnl maintainer-mode is disabled by default
|
||||
AC_ARG_ENABLE(maintainer-mode,
|
||||
[ --enable-maintainer-mode enable make rules and dependencies not useful
|
||||
(and sometimes confusing) to the casual installer],
|
||||
USE_MAINTAINER_MODE=$enableval,
|
||||
USE_MAINTAINER_MODE=no)
|
||||
AC_MSG_RESULT($USE_MAINTAINER_MODE)
|
||||
if test $USE_MAINTAINER_MODE = yes; then
|
||||
MAINT=
|
||||
else
|
||||
MAINT='#M#'
|
||||
fi
|
||||
AC_SUBST(MAINT)dnl
|
||||
]
|
||||
)
|
||||
13
m4/memcmp.m4
Normal file
13
m4/memcmp.m4
Normal file
@@ -0,0 +1,13 @@
|
||||
#serial 1
|
||||
|
||||
dnl If you use this macro in a package, you should
|
||||
dnl add the following two lines to acconfig.h:
|
||||
dnl /* Define to rpl_memcmp if the replacement function should be used. */
|
||||
dnl #undef memcmp
|
||||
dnl
|
||||
AC_DEFUN(jm_FUNC_MEMCMP,
|
||||
[AC_REQUIRE([AC_FUNC_MEMCMP])dnl
|
||||
if test $ac_cv_func_memcmp_clean = no; then
|
||||
AC_DEFINE_UNQUOTED(memcmp, rpl_memcmp)
|
||||
fi
|
||||
])
|
||||
75
m4/mktime.m4
Normal file
75
m4/mktime.m4
Normal file
@@ -0,0 +1,75 @@
|
||||
#serial 2
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl FIXME: this should migrate into libit.
|
||||
|
||||
AC_DEFUN(AM_FUNC_MKTIME,
|
||||
[AC_REQUIRE([AC_HEADER_TIME])dnl
|
||||
AC_CHECK_HEADERS(sys/time.h)
|
||||
AC_CACHE_CHECK([for working mktime], am_cv_func_working_mktime,
|
||||
[AC_TRY_RUN(
|
||||
changequote(<<, >>)dnl
|
||||
<</* Test program from Paul Eggert (eggert@twinsun.com)
|
||||
and Tony Leneis (tony@plaza.ds.adp.com). */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static time_t time_t_max;
|
||||
|
||||
/* Values we'll use to set the TZ environment variable. */
|
||||
static const char *const tz_strings[] = {
|
||||
NULL, "GMT0", "JST-9", "EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
|
||||
};
|
||||
#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
|
||||
|
||||
static void
|
||||
mktime_test (now)
|
||||
time_t now;
|
||||
{
|
||||
if (mktime (localtime (&now)) != now)
|
||||
exit (1);
|
||||
now = time_t_max - now;
|
||||
if (mktime (localtime (&now)) != now)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
time_t t, delta;
|
||||
int i;
|
||||
|
||||
for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
|
||||
continue;
|
||||
time_t_max--;
|
||||
delta = time_t_max / 997; /* a suitable prime number */
|
||||
for (i = 0; i < N_STRINGS; i++)
|
||||
{
|
||||
if (tz_strings[i])
|
||||
putenv (tz_strings[i]);
|
||||
|
||||
for (t = 0; t <= time_t_max - delta; t += delta)
|
||||
mktime_test (t);
|
||||
mktime_test ((time_t) 60 * 60);
|
||||
mktime_test ((time_t) 60 * 60 * 24);
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
>>,
|
||||
changequote([, ])dnl
|
||||
am_cv_func_working_mktime=yes, am_cv_func_working_mktime=no,
|
||||
dnl When crosscompiling, assume mktime is missing or broken.
|
||||
am_cv_func_working_mktime=no)
|
||||
])
|
||||
if test $am_cv_func_working_mktime = no; then
|
||||
LIBOBJS="$LIBOBJS mktime.o"
|
||||
fi
|
||||
])
|
||||
15
m4/obstack.m4
Normal file
15
m4/obstack.m4
Normal file
@@ -0,0 +1,15 @@
|
||||
dnl From Jim Meyering.
|
||||
dnl FIXME: migrate into libit.
|
||||
|
||||
AC_DEFUN(AM_FUNC_OBSTACK,
|
||||
[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
|
||||
[AC_TRY_LINK([#include "obstack.h"],
|
||||
[struct obstack *mem;obstack_free(mem,(char *) 0)],
|
||||
am_cv_func_obstack=yes,
|
||||
am_cv_func_obstack=no)])
|
||||
if test $am_cv_func_obstack = yes; then
|
||||
AC_DEFINE(HAVE_OBSTACK)
|
||||
else
|
||||
LIBOBJS="$LIBOBJS obstack.o"
|
||||
fi
|
||||
])
|
||||
42
m4/progtest.m4
Normal file
42
m4/progtest.m4
Normal file
@@ -0,0 +1,42 @@
|
||||
# Search path for a program which passes the given test.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
|
||||
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
|
||||
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
|
||||
[# Extract the first word of "$2", so it can be a program name with args.
|
||||
set dummy $2; ac_word=[$]2
|
||||
AC_MSG_CHECKING([for $ac_word])
|
||||
AC_CACHE_VAL(ac_cv_path_$1,
|
||||
[case "[$]$1" in
|
||||
/*)
|
||||
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in ifelse([$5], , $PATH, [$5]); do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
if [$3]; then
|
||||
ac_cv_path_$1="$ac_dir/$ac_word"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
dnl If no 4th arg is given, leave the cache variable unset,
|
||||
dnl so AC_PATH_PROGS will keep looking.
|
||||
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
|
||||
])dnl
|
||||
;;
|
||||
esac])dnl
|
||||
$1="$ac_cv_path_$1"
|
||||
if test -n "[$]$1"; then
|
||||
AC_MSG_RESULT([$]$1)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_SUBST($1)dnl
|
||||
])
|
||||
25
m4/protos.m4
Normal file
25
m4/protos.m4
Normal file
@@ -0,0 +1,25 @@
|
||||
## ------------------------------- ##
|
||||
## Check for function prototypes. ##
|
||||
## From Franc,ois Pinard ##
|
||||
## ------------------------------- ##
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_C_PROTOTYPES,
|
||||
[AC_REQUIRE([AM_PROG_CC_STDC])
|
||||
AC_BEFORE([$0], [AC_C_INLINE])
|
||||
AC_MSG_CHECKING([for function prototypes])
|
||||
if test "$am_cv_prog_cc_stdc" != no; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(PROTOTYPES)
|
||||
U= ANSI2KNR=
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
U=_ ANSI2KNR=./ansi2knr
|
||||
# Ensure some checks needed by ansi2knr itself.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(string.h)
|
||||
fi
|
||||
AC_SUBST(U)dnl
|
||||
AC_SUBST(ANSI2KNR)dnl
|
||||
])
|
||||
12
m4/ptrdiff.m4
Normal file
12
m4/ptrdiff.m4
Normal file
@@ -0,0 +1,12 @@
|
||||
# From Ulrich Drepper.
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_TYPE_PTRDIFF_T,
|
||||
[AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t,
|
||||
[AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
|
||||
am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)])
|
||||
if test $am_cv_type_ptrdiff_t = yes; then
|
||||
AC_DEFINE(HAVE_PTRDIFF_T)
|
||||
fi
|
||||
])
|
||||
37
m4/regex.m4
Normal file
37
m4/regex.m4
Normal file
@@ -0,0 +1,37 @@
|
||||
## --------------------------------- ##
|
||||
## Check if --with-regex was given. ##
|
||||
## --------------------------------- ##
|
||||
|
||||
# serial 1
|
||||
|
||||
# The idea is to distribute rx.[hc] and regex.[hc] together, for a while.
|
||||
# The WITH_REGEX symbol (which should also be documented in acconfig.h)
|
||||
# is used to decide which of regex.h or rx.h should be included in the
|
||||
# application. If `./configure --with-regex' is given (the default), the
|
||||
# package will use gawk's regex. If `./configure --without-regex', a
|
||||
# check is made to see if rx is already installed, as with newer Linux'es.
|
||||
# If not found, the package will use the rx from the distribution.
|
||||
# If found, the package will use the system's rx which, on Linux at least,
|
||||
# will result in a smaller executable file.
|
||||
|
||||
AC_DEFUN(AM_WITH_REGEX,
|
||||
[AC_MSG_CHECKING(which of GNU rx or gawk's regex is wanted)
|
||||
AC_ARG_WITH(regex,
|
||||
[ --without-regex use GNU rx in lieu of gawk's regex for matching],
|
||||
[test "$withval" = yes && am_with_regex=1],
|
||||
[am_with_regex=1])
|
||||
if test -n "$am_with_regex"; then
|
||||
AC_MSG_RESULT(regex)
|
||||
AC_DEFINE(WITH_REGEX)
|
||||
AC_CACHE_CHECK([for GNU regex in libc], am_cv_gnu_regex,
|
||||
AC_TRY_LINK([], [extern int re_max_failures; re_max_failures = 1],
|
||||
am_cv_gnu_regex=yes, am_cv_gnu_regex=no))
|
||||
if test $am_cv_gnu_regex = no; then
|
||||
LIBOBJS="$LIBOBJS regex.o"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(rx)
|
||||
AC_CHECK_FUNC(re_rx_search, , [LIBOBJS="$LIBOBJS rx.o"])
|
||||
fi
|
||||
AC_SUBST(LIBOBJS)dnl
|
||||
])
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user