mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
1454 Commits
FILEUTILS-
...
FILEUTILS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7f77ef1cf | ||
|
|
31053908a0 | ||
|
|
0c7040607d | ||
|
|
d81cbf71b4 | ||
|
|
b339cb8d84 | ||
|
|
d8880083a6 | ||
|
|
96cdeb978e | ||
|
|
b2cc136736 | ||
|
|
b394529747 | ||
|
|
edfafcd7b7 | ||
|
|
1c75eb6a98 | ||
|
|
814dc35407 | ||
|
|
99fe905035 | ||
|
|
ccf556a616 | ||
|
|
d96a2d9e14 | ||
|
|
8e11d5dfae | ||
|
|
f64f586fdc | ||
|
|
6f8e1b2134 | ||
|
|
8888bceb65 | ||
|
|
78315499ba | ||
|
|
e666e3459e | ||
|
|
6a9d144a66 | ||
|
|
f34578f297 | ||
|
|
1dc643390a | ||
|
|
ea3702aa6d | ||
|
|
59b9296742 | ||
|
|
bf3b759a61 | ||
|
|
bc24ebbed0 | ||
|
|
10ac9ed1ba | ||
|
|
f28de0cbe3 | ||
|
|
d7477dbf0c | ||
|
|
b4062862f6 | ||
|
|
4ddff14202 | ||
|
|
c98881bb59 | ||
|
|
9016aac157 | ||
|
|
8c5a8ba959 | ||
|
|
62a6b18a77 | ||
|
|
0f39512ec6 | ||
|
|
77becb06e1 | ||
|
|
2ff0c1870c | ||
|
|
9438eff8ec | ||
|
|
4097b92a07 | ||
|
|
7c695a0e5a | ||
|
|
85cddd3119 | ||
|
|
3661c96081 | ||
|
|
d4368d4802 | ||
|
|
34c992c065 | ||
|
|
e904744174 | ||
|
|
47e8713900 | ||
|
|
5637dfa191 | ||
|
|
ce5730d5c2 | ||
|
|
f1a405c1e9 | ||
|
|
7f88c2b896 | ||
|
|
eaa41b023f | ||
|
|
0867d4efd3 | ||
|
|
b12923594b | ||
|
|
4f208e731c | ||
|
|
26b61d5962 | ||
|
|
955f5eb1f4 | ||
|
|
0e02a64c99 | ||
|
|
545c237530 | ||
|
|
3cc1863ab3 | ||
|
|
815261aefc | ||
|
|
f599541be9 | ||
|
|
c62a6dbaa9 | ||
|
|
74388abca3 | ||
|
|
e044081627 | ||
|
|
d1320b7277 | ||
|
|
6ac49bdf47 | ||
|
|
c74ae79fd9 | ||
|
|
4b29186f72 | ||
|
|
94435a6401 | ||
|
|
1e26d4455a | ||
|
|
3683b0b3ef | ||
|
|
2d30458a75 | ||
|
|
9cde1990ab | ||
|
|
3fc07d456b | ||
|
|
73ca459085 | ||
|
|
85219ddf0f | ||
|
|
f471847cac | ||
|
|
edbc415595 | ||
|
|
e4c1c5efca | ||
|
|
c830d53afb | ||
|
|
4526777121 | ||
|
|
97df7b0013 | ||
|
|
9c28acb705 | ||
|
|
7b9e7765ee | ||
|
|
14c6c66b64 | ||
|
|
58b136578a | ||
|
|
139408f867 | ||
|
|
d2c6e7cba9 | ||
|
|
62e0054a8d | ||
|
|
a5be9924f2 | ||
|
|
f709048a82 | ||
|
|
d1f996b486 | ||
|
|
d3900b79bc | ||
|
|
34d871d67d | ||
|
|
71066e34b9 | ||
|
|
4be8ee6d75 | ||
|
|
63a48d0278 | ||
|
|
b8d66b1704 | ||
|
|
d64ae4c1be | ||
|
|
1a9771061b | ||
|
|
5c8eaa8139 | ||
|
|
4cfd024d37 | ||
|
|
5e053a624b | ||
|
|
e3625e3032 | ||
|
|
4c9586c01b | ||
|
|
d9be56f638 | ||
|
|
57592bb00e | ||
|
|
d4fc1b970c | ||
|
|
c609fd3e0a | ||
|
|
e9d17da073 | ||
|
|
82e99127d2 | ||
|
|
c609ba2d13 | ||
|
|
6a52479e0a | ||
|
|
1cd5fb882c | ||
|
|
27586e4d1b | ||
|
|
bfe2a56ac6 | ||
|
|
c9fff51897 | ||
|
|
7e294bac78 | ||
|
|
3d672b27ca | ||
|
|
8726a1e79e | ||
|
|
7aea26b817 | ||
|
|
a8676a3282 | ||
|
|
e8f7310474 | ||
|
|
3e1ecd65dd | ||
|
|
b0ed797534 | ||
|
|
3329d17b3e | ||
|
|
41e757beb6 | ||
|
|
efe35c166d | ||
|
|
2f70dd59c6 | ||
|
|
d57a5cc166 | ||
|
|
7216f62cad | ||
|
|
f2be7b3cc4 | ||
|
|
5c0b9744ab | ||
|
|
b0a21fce4c | ||
|
|
3649121dff | ||
|
|
383690a5f2 | ||
|
|
90ce25327c | ||
|
|
840c73b381 | ||
|
|
7ec03a4414 | ||
|
|
0ba429223d | ||
|
|
7d234bb98e | ||
|
|
a0d34ce173 | ||
|
|
1a6ee7a625 | ||
|
|
34ac19cd34 | ||
|
|
a79e4f054a | ||
|
|
ad1a0015be | ||
|
|
2592c30822 | ||
|
|
5e6706b750 | ||
|
|
77f32e0b49 | ||
|
|
a0810c6cae | ||
|
|
a023f4519e | ||
|
|
0055d0a4cc | ||
|
|
416715cf93 | ||
|
|
730ec4650a | ||
|
|
98b9e6e30b | ||
|
|
9d76e7ffbb | ||
|
|
d9f30fc643 | ||
|
|
597e0b2a8e | ||
|
|
56cd9b9a02 | ||
|
|
12d30b5cd0 | ||
|
|
c64c32d89e | ||
|
|
7d490ad462 | ||
|
|
0347f76632 | ||
|
|
b012712ff5 | ||
|
|
6f1a0acdbd | ||
|
|
b32398d02c | ||
|
|
ea15a1e0e5 | ||
|
|
c7066e8caa | ||
|
|
fa674d651c | ||
|
|
5220e9a46b | ||
|
|
afddedbd9f | ||
|
|
b98971b7a0 | ||
|
|
9cccef82ce | ||
|
|
f6d73bdb80 | ||
|
|
91c0d0de6a | ||
|
|
283b1a297d | ||
|
|
26259134ee | ||
|
|
39cf848828 | ||
|
|
8dd548d895 | ||
|
|
daa3462c64 | ||
|
|
b7bf84fd73 | ||
|
|
a62273dca5 | ||
|
|
32f7fc5503 | ||
|
|
99708d72f6 | ||
|
|
ec4159d6f6 | ||
|
|
3c39169751 | ||
|
|
1a68c9ac75 | ||
|
|
e7a59c2594 | ||
|
|
1ddf714c24 | ||
|
|
69a2d6bce1 | ||
|
|
408cfc09b2 | ||
|
|
eebe6a6c0c | ||
|
|
abd282bf34 | ||
|
|
441ebad5cc | ||
|
|
26a8544c83 | ||
|
|
4fd0132dfc | ||
|
|
bd3627904b | ||
|
|
a1ab7fb789 | ||
|
|
0e4f0390ef | ||
|
|
b741c592c5 | ||
|
|
81d574033a | ||
|
|
aa49f63378 | ||
|
|
1a038cb55e | ||
|
|
1c892790d9 | ||
|
|
bd51f25754 | ||
|
|
406c6613bb | ||
|
|
c5449cea5a | ||
|
|
7cc00778d1 | ||
|
|
1dc1d2996a | ||
|
|
3cf0da722f | ||
|
|
7532e57941 | ||
|
|
5b8cad3534 | ||
|
|
e1df5e7167 | ||
|
|
1d8ed38329 | ||
|
|
c87d06546a | ||
|
|
afe669874a | ||
|
|
ee2e84bb6f | ||
|
|
d5aa78b540 | ||
|
|
2a5f4c45e1 | ||
|
|
0fa3eb4d22 | ||
|
|
b10f778bf5 | ||
|
|
e9ed1c0601 | ||
|
|
729bd79cb8 | ||
|
|
402b4612f8 | ||
|
|
a044608569 | ||
|
|
d660831c5a | ||
|
|
9ba877cf28 | ||
|
|
e22b1e56e6 | ||
|
|
cd2e2180d9 | ||
|
|
6932ade12e | ||
|
|
c49c9a04e1 | ||
|
|
b294dd43a1 | ||
|
|
7ce576ff06 | ||
|
|
733c16465d | ||
|
|
981f5ba012 | ||
|
|
0e180c8f19 | ||
|
|
005ed75540 | ||
|
|
52211041ad | ||
|
|
304295c24c | ||
|
|
a56da10982 | ||
|
|
1089f9b929 | ||
|
|
ccd0e2e27a | ||
|
|
96a39fa3f6 | ||
|
|
08ffff5615 | ||
|
|
16efa02b77 | ||
|
|
7f26c2724a | ||
|
|
81b7ecbc14 | ||
|
|
bd6aa3080a | ||
|
|
7f1cf81aba | ||
|
|
3af4a12ae3 | ||
|
|
deee2015f3 | ||
|
|
9d06a0075d | ||
|
|
1d791a1487 | ||
|
|
998e5ad1c0 | ||
|
|
67c2366944 | ||
|
|
bb952869e7 | ||
|
|
35b1d6a948 | ||
|
|
63dece38a1 | ||
|
|
3904fb599e | ||
|
|
7b7b289e2d | ||
|
|
f8939357a3 | ||
|
|
5f79c9e91b | ||
|
|
16c56c7d73 | ||
|
|
8c074a6577 | ||
|
|
2feeeb5972 | ||
|
|
89495b81dd | ||
|
|
a5c67e1c05 | ||
|
|
b288e0f8f5 | ||
|
|
5d3af013b0 | ||
|
|
b734adb860 | ||
|
|
88db35dd77 | ||
|
|
6efc03fd41 | ||
|
|
befcaa08e8 | ||
|
|
59834c2c06 | ||
|
|
ed48dc8cae | ||
|
|
f3bcc28b21 | ||
|
|
e549af7279 | ||
|
|
e5c3e23ec4 | ||
|
|
03cc8c8ca3 | ||
|
|
dc84f5c5c9 | ||
|
|
e0ac832842 | ||
|
|
ff1fc50954 | ||
|
|
9e10989282 | ||
|
|
4bca95c431 | ||
|
|
f60dafdac2 | ||
|
|
ee9cf50a0f | ||
|
|
e023911555 | ||
|
|
b19da298ac | ||
|
|
7efa2ba5c4 | ||
|
|
19bff1c02d | ||
|
|
fd984b9655 | ||
|
|
6014da9e30 | ||
|
|
e5e6e34ead | ||
|
|
e8b07e3796 | ||
|
|
1b5bb5c05a | ||
|
|
1df37f767c | ||
|
|
77973edc33 | ||
|
|
48e4b51e96 | ||
|
|
9c53920ae6 | ||
|
|
993b49a693 | ||
|
|
bf72a5728f | ||
|
|
48209ca1ba | ||
|
|
7cb6a4e2f1 | ||
|
|
7d026dd508 | ||
|
|
178f23fbb7 | ||
|
|
75b93231ca | ||
|
|
23684f8383 | ||
|
|
4b8b59894b | ||
|
|
ade337e1a8 | ||
|
|
d38f60e27c | ||
|
|
bf75b72e46 | ||
|
|
dbd0c33f24 | ||
|
|
4d7a57cf34 | ||
|
|
1c2c9330d9 | ||
|
|
836935c5e6 | ||
|
|
2e789ea9b2 | ||
|
|
a4a64560c0 | ||
|
|
65f957107e | ||
|
|
e9d60dc000 | ||
|
|
c58cd08bf9 | ||
|
|
900a826cf8 | ||
|
|
7fe510422e | ||
|
|
1ba9563160 | ||
|
|
4bef2ec5f7 | ||
|
|
c98ea50c21 | ||
|
|
78697777d7 | ||
|
|
83696460f0 | ||
|
|
bb8acb3640 | ||
|
|
4f29f1aeb2 | ||
|
|
36a4ba8ba3 | ||
|
|
aaafa60129 | ||
|
|
866e778210 | ||
|
|
805484b693 | ||
|
|
a10e992cbc | ||
|
|
44b11d6e67 | ||
|
|
108f50670d | ||
|
|
5885cbf0d2 | ||
|
|
640cdd2df4 | ||
|
|
a4d13e4b8f | ||
|
|
12beb90e58 | ||
|
|
4623f5dca3 | ||
|
|
b124be4eb1 | ||
|
|
c8feafc2a5 | ||
|
|
84b6d13a3c | ||
|
|
fb604ebdf4 | ||
|
|
778dd49f55 | ||
|
|
3e0fdc1a0b | ||
|
|
c4610f8bb6 | ||
|
|
824081f660 | ||
|
|
417bda1b99 | ||
|
|
dbb6fa88fd | ||
|
|
013f2fe433 | ||
|
|
de75384c2b | ||
|
|
9d691ba42f | ||
|
|
744ef2d96f | ||
|
|
0d978396d7 | ||
|
|
581db2ffeb | ||
|
|
0d1de84756 | ||
|
|
c4f9b63aea | ||
|
|
0472107417 | ||
|
|
e1de1d3a93 | ||
|
|
46b486ab5b | ||
|
|
68bd38e8a0 | ||
|
|
b5c86e8130 | ||
|
|
bd54740062 | ||
|
|
8596e37d97 | ||
|
|
5eb689ade0 | ||
|
|
195f8a213e | ||
|
|
4d6b56a932 | ||
|
|
62a9c01c6d | ||
|
|
12dd329a29 | ||
|
|
4a7000742c | ||
|
|
f41e1ff806 | ||
|
|
fa5ef15197 | ||
|
|
2b1f600cbd | ||
|
|
0396e35b5a | ||
|
|
9824efff73 | ||
|
|
7fbe57368e | ||
|
|
21c0d8f1f0 | ||
|
|
316490baea | ||
|
|
bd77322580 | ||
|
|
09cf102456 | ||
|
|
f8514af7a6 | ||
|
|
6b4aadc588 | ||
|
|
e2e512d2d6 | ||
|
|
a7d29c59fa | ||
|
|
b2e339dc25 | ||
|
|
e7342330e5 | ||
|
|
3f868304cf | ||
|
|
2926167cfa | ||
|
|
84448306a4 | ||
|
|
b97436b18b | ||
|
|
db07df5448 | ||
|
|
4adeb81260 | ||
|
|
9684207d04 | ||
|
|
b467d6d513 | ||
|
|
36454232a5 | ||
|
|
ce85352146 | ||
|
|
7786c6e2cf | ||
|
|
4bd1ffa49a | ||
|
|
38762b8f78 | ||
|
|
7b2cea5ab2 | ||
|
|
b0d3bfa316 | ||
|
|
1672bf6d27 | ||
|
|
8736952b0b | ||
|
|
bd1fc1c256 | ||
|
|
bb4d193ac7 | ||
|
|
7379bd7274 | ||
|
|
1372968ab0 | ||
|
|
d2b4bca42e | ||
|
|
6dceaa1d9d | ||
|
|
b288652bbd | ||
|
|
2b37242292 | ||
|
|
afd2d8e4cf | ||
|
|
c18996947c | ||
|
|
23b80c8e30 | ||
|
|
3b92bd0090 | ||
|
|
14bc2891a8 | ||
|
|
1ebe204c2f | ||
|
|
27725d0745 | ||
|
|
8977920253 | ||
|
|
41b9ee8834 | ||
|
|
c4d50b0133 | ||
|
|
bb389bead8 | ||
|
|
326cc336af | ||
|
|
cd53ea93c5 | ||
|
|
aec69ce220 | ||
|
|
b2d08f91db | ||
|
|
50cdbb37c8 | ||
|
|
e81d02baf1 | ||
|
|
b73817cc6e | ||
|
|
0fefdeb526 | ||
|
|
8dfac9573a | ||
|
|
369361ae70 | ||
|
|
1afd3473fb | ||
|
|
117fb47f99 | ||
|
|
1bff89846b | ||
|
|
ba87d08c0e | ||
|
|
d9c0413f79 | ||
|
|
216777ea17 | ||
|
|
325411e109 | ||
|
|
e5aecd47c4 | ||
|
|
c84a7a232e | ||
|
|
16c5d19ce5 | ||
|
|
ac96f15bf3 | ||
|
|
0c0537fdce | ||
|
|
f58702e8f9 | ||
|
|
80c03e37ba | ||
|
|
71e65bb036 | ||
|
|
522141076e | ||
|
|
408a47499e | ||
|
|
30a65b1aa3 | ||
|
|
0a3fdd250a | ||
|
|
b617aa5f3f | ||
|
|
8b0cf1dde4 | ||
|
|
d392de74de | ||
|
|
e5b4feb70a | ||
|
|
af41baeb91 | ||
|
|
5540d977f4 | ||
|
|
98b663a29b | ||
|
|
e3c3d0b385 | ||
|
|
cfda609a21 | ||
|
|
229598b807 | ||
|
|
4c6221ee37 | ||
|
|
d76f7a7ce4 | ||
|
|
fc05e28803 | ||
|
|
0bbec4b26e | ||
|
|
93cff2fae1 | ||
|
|
ec0f2c34d3 | ||
|
|
e26d180b8c | ||
|
|
cb0cd6afdb | ||
|
|
b95e3d2f47 | ||
|
|
b5eadff384 | ||
|
|
a0321a68c0 | ||
|
|
9ed0e96ba7 | ||
|
|
087f809fe7 | ||
|
|
dd6c617d24 | ||
|
|
b4e8fc709e | ||
|
|
487366d091 | ||
|
|
6099222717 | ||
|
|
608e780536 | ||
|
|
0f73666749 | ||
|
|
e72e877181 | ||
|
|
4063f0aea3 | ||
|
|
0c8d33de03 | ||
|
|
e94070eb22 | ||
|
|
8aef0cde12 | ||
|
|
d355dcec62 | ||
|
|
c0a9e11235 | ||
|
|
8469bec1cc | ||
|
|
28a71c3409 | ||
|
|
85c407a740 | ||
|
|
2a01f209a6 | ||
|
|
1137a26bcf | ||
|
|
8157b18b8a | ||
|
|
c8c25a4610 | ||
|
|
031e782bb9 | ||
|
|
289ee58ce3 | ||
|
|
53af79cfe4 | ||
|
|
57beda9b45 | ||
|
|
0f3ff1725d | ||
|
|
7188179fc0 | ||
|
|
6544a589ed | ||
|
|
79ae2a4af9 | ||
|
|
b952290dc3 | ||
|
|
737f1f03a5 | ||
|
|
cf83dc5456 | ||
|
|
652ad8aaa3 | ||
|
|
5e969c1033 | ||
|
|
e42cc5be8a | ||
|
|
8cb05a6bfa | ||
|
|
4fb75ded4c | ||
|
|
1c883e2882 | ||
|
|
d6bf80ccc7 | ||
|
|
cd536776a0 | ||
|
|
f51eb4a5cc | ||
|
|
de40301f0a | ||
|
|
aa41cdbb65 | ||
|
|
4d02bdd9b0 | ||
|
|
41e8b21fb7 | ||
|
|
fe9da7ee9b | ||
|
|
bd8218fbe9 | ||
|
|
d52bc68220 | ||
|
|
090cd9f443 | ||
|
|
b6c83bbaa0 | ||
|
|
5946c46972 | ||
|
|
20522f2f5d | ||
|
|
7b297f76c4 | ||
|
|
3c467c0d22 | ||
|
|
b2ae052c6d | ||
|
|
8ee7e2c0c8 | ||
|
|
3270b340e8 | ||
|
|
22978078f7 | ||
|
|
53e41464fd | ||
|
|
86f7daf592 | ||
|
|
91e12f541f | ||
|
|
176a02c5d9 | ||
|
|
c6836cfdda | ||
|
|
090a56eb9c | ||
|
|
8c0d3621b3 | ||
|
|
86d6d4c47c | ||
|
|
f1d4b41340 | ||
|
|
ab8cec12c9 | ||
|
|
3bd31fac90 | ||
|
|
31f9f9f24c | ||
|
|
e7b4a0bced | ||
|
|
a3b44d2fd5 | ||
|
|
55dcae1c8d | ||
|
|
a01eaef0fd | ||
|
|
9da759a317 | ||
|
|
d2d2d043ff | ||
|
|
afd4dcf3b2 | ||
|
|
9b7bbe7b0b | ||
|
|
d84462d473 | ||
|
|
e3579cb231 | ||
|
|
1a34934e94 | ||
|
|
c2705c1e62 | ||
|
|
63d49273c4 | ||
|
|
2df44bba5b | ||
|
|
4b17c0b9ac | ||
|
|
71d6f09173 | ||
|
|
5faf3cd5fb | ||
|
|
b4a30ded4c | ||
|
|
e1dc14d3a1 | ||
|
|
4c8f853735 | ||
|
|
6225a43223 | ||
|
|
abda80a05a | ||
|
|
6ab8d020db | ||
|
|
5daa998b30 | ||
|
|
5840eaec8d | ||
|
|
4a6d0824c9 | ||
|
|
166523ca2b | ||
|
|
04a5f54547 | ||
|
|
8f47502291 | ||
|
|
fb71b69665 | ||
|
|
f8a5744b34 | ||
|
|
e3fa3463d6 | ||
|
|
a712177a4b | ||
|
|
b9ad7b9a9c | ||
|
|
47e20014b0 | ||
|
|
2f4e768ff4 | ||
|
|
f1aea23023 | ||
|
|
4734b96d4e | ||
|
|
faf0038376 | ||
|
|
dd7aea80f7 | ||
|
|
4ff1b892d0 | ||
|
|
22125a047d | ||
|
|
b2191ea8e1 | ||
|
|
971c5b1379 | ||
|
|
2d8de9b8ab | ||
|
|
271a7e6bb3 | ||
|
|
573c16a666 | ||
|
|
bae16cb45b | ||
|
|
b80225264a | ||
|
|
dcc145f13a | ||
|
|
51958e82aa | ||
|
|
ca0a087f3d | ||
|
|
22dc22c127 | ||
|
|
a56783bbb4 | ||
|
|
699808bcad | ||
|
|
7176037aa2 | ||
|
|
55447abbdf | ||
|
|
2c226bf49d | ||
|
|
8a623ebc61 | ||
|
|
fce70ef38b | ||
|
|
9622bd6207 | ||
|
|
f177941b93 | ||
|
|
a2c6905133 | ||
|
|
3df9acbfc9 | ||
|
|
9f58b3b3d5 | ||
|
|
e6b5a4d682 | ||
|
|
1fb27efd70 | ||
|
|
d4a3e63ec8 | ||
|
|
f64964aa1d | ||
|
|
97775c5655 | ||
|
|
483e2421c9 | ||
|
|
ac4a274dcf | ||
|
|
8b3d87d197 | ||
|
|
bee873f407 | ||
|
|
7b33a9910c | ||
|
|
d60264342d | ||
|
|
3cd2c9e1c8 | ||
|
|
c94ffee869 | ||
|
|
7da69e79df | ||
|
|
a79461545e | ||
|
|
32e36bd888 | ||
|
|
15e49fdbfb | ||
|
|
1b0419e8fd | ||
|
|
bd395b3bfc | ||
|
|
b7c1e2526a | ||
|
|
9300fb41f8 | ||
|
|
c434fa5195 | ||
|
|
7f504f2317 | ||
|
|
cafa5c1c2d | ||
|
|
73a90d1006 | ||
|
|
d4e2205ea9 | ||
|
|
8e9d1adf75 | ||
|
|
2f6c94da4c | ||
|
|
68898bb9a7 | ||
|
|
812fdadfca | ||
|
|
0e307a526c | ||
|
|
c1997cb5c3 | ||
|
|
74445dae42 | ||
|
|
fcf3192814 | ||
|
|
916861c0e8 | ||
|
|
437e9a0bc4 | ||
|
|
389c4049b3 | ||
|
|
a9ec4db8f2 | ||
|
|
9cda4e6527 | ||
|
|
cf1bd0e401 | ||
|
|
419daeb511 | ||
|
|
5555b3c9db | ||
|
|
482d5be531 | ||
|
|
87afdbeb7d | ||
|
|
a84f4f6087 | ||
|
|
12da649245 | ||
|
|
22aec49d4c | ||
|
|
6580f24783 | ||
|
|
a3c143bd82 | ||
|
|
07e148c8e7 | ||
|
|
8455ea2e13 | ||
|
|
95439d0f33 | ||
|
|
aa7d0d8c85 | ||
|
|
3ce3cb772d | ||
|
|
e08a28e045 | ||
|
|
6ea9602009 | ||
|
|
ea11fd8868 | ||
|
|
346b0368cf | ||
|
|
175585876f | ||
|
|
1ecd1b9c52 | ||
|
|
30f76e827e | ||
|
|
8b9e784e1e | ||
|
|
5a5938db82 | ||
|
|
3c57cea2ce | ||
|
|
0143b2901f | ||
|
|
527b07a1ad | ||
|
|
347c2d6d30 | ||
|
|
9af8f15624 | ||
|
|
c17caa0c0f | ||
|
|
77da45645d | ||
|
|
8b2c88998b | ||
|
|
4cf126f7ce | ||
|
|
1c4ecd2a95 | ||
|
|
56d10407e7 | ||
|
|
f3194fe603 | ||
|
|
f59d1dac46 | ||
|
|
359f885aae | ||
|
|
272f8d891e | ||
|
|
25f22cdc5d | ||
|
|
af781b708c | ||
|
|
0a9eb68f77 | ||
|
|
59d334f4d4 | ||
|
|
e6eece1575 | ||
|
|
8fbeb80792 | ||
|
|
dc98736719 | ||
|
|
3f4c6398be | ||
|
|
7e4384f810 | ||
|
|
fdd4dd9b35 | ||
|
|
bba8ab25f1 | ||
|
|
aa05c43a5f | ||
|
|
69e6145e1e | ||
|
|
fb19d01b96 | ||
|
|
b380f45a13 | ||
|
|
8e12bada8a | ||
|
|
ade410fae0 | ||
|
|
6d668c6160 | ||
|
|
78273e9d23 | ||
|
|
2b5207bc59 | ||
|
|
deeb3e0c49 | ||
|
|
2b00449aa7 | ||
|
|
98d8740ccd | ||
|
|
56bc01ab4a | ||
|
|
1d43796211 | ||
|
|
e8a641509f | ||
|
|
674180c97f | ||
|
|
c264e159a4 | ||
|
|
a5a67731da | ||
|
|
d7bf7dee47 | ||
|
|
3032beba73 | ||
|
|
50b029f4d9 | ||
|
|
c07d15973c | ||
|
|
5beebbd8da | ||
|
|
763d748cf2 | ||
|
|
0e442c97a5 | ||
|
|
2411847f16 | ||
|
|
874f418e03 | ||
|
|
0126f74936 | ||
|
|
7d956ece8c | ||
|
|
ee708ff4aa | ||
|
|
c1f1f8ac3a | ||
|
|
0aa556c39c | ||
|
|
b76ab178d1 | ||
|
|
dfbe6788b4 | ||
|
|
1d2c0959c9 | ||
|
|
fc0f5b4539 | ||
|
|
49af3f858e | ||
|
|
0528939c0a | ||
|
|
a2d90c1616 | ||
|
|
5ac0cdbfce | ||
|
|
b8654f033b | ||
|
|
f60c8ea48b | ||
|
|
dafd2cb4e2 | ||
|
|
f970591c5a | ||
|
|
d729e4cab7 | ||
|
|
cccb23f01b | ||
|
|
199923e3cc | ||
|
|
706389d9df | ||
|
|
bba21e6815 | ||
|
|
0f459ed24c | ||
|
|
c1a0ddea63 | ||
|
|
337e927dae | ||
|
|
d8ab22727f | ||
|
|
505b859fe9 | ||
|
|
e6cfa98486 | ||
|
|
93bd527109 | ||
|
|
d283aef5ca | ||
|
|
be333ac3a5 | ||
|
|
62b978f77c | ||
|
|
84e64a529a | ||
|
|
b4a20010e6 | ||
|
|
b8b9306a9a | ||
|
|
5ec32b62e5 | ||
|
|
c659704b20 | ||
|
|
ce339a4a50 | ||
|
|
53ff5566ce | ||
|
|
c1bf67ee67 | ||
|
|
5dbe03ea6c | ||
|
|
a2b6134e37 | ||
|
|
d82c2c9274 | ||
|
|
cc6711057e | ||
|
|
c60619245a | ||
|
|
a7b3ea4189 | ||
|
|
7057c83fd4 | ||
|
|
737ea4d4f9 | ||
|
|
ac22df9290 | ||
|
|
a33c222135 | ||
|
|
f6d1e06932 | ||
|
|
447a13cdd4 | ||
|
|
727a9ed970 | ||
|
|
5d5979d9a8 | ||
|
|
5eb19629b0 | ||
|
|
cbfdc4fd51 | ||
|
|
24c0303794 | ||
|
|
d9422a21e0 | ||
|
|
4be30f34c2 | ||
|
|
4da76e0c6f | ||
|
|
39c92b4dc4 | ||
|
|
c74a04a26f | ||
|
|
aedf3f9fc5 | ||
|
|
7e76b8b7da | ||
|
|
d9fe359377 | ||
|
|
c32c5775be | ||
|
|
3220407d48 | ||
|
|
45c51b256a | ||
|
|
c1505fc01f | ||
|
|
cca1377d96 | ||
|
|
8024d6459c | ||
|
|
78732c5421 | ||
|
|
0e199278c1 | ||
|
|
9d22ab92f9 | ||
|
|
8a6f26dfd6 | ||
|
|
43b84ec02e | ||
|
|
dadd9cf997 | ||
|
|
dacd5d7572 | ||
|
|
a8b09f0b0a | ||
|
|
7670167015 | ||
|
|
7f00439ebe | ||
|
|
a6263137d7 | ||
|
|
efb6a6917b | ||
|
|
987f70fee5 | ||
|
|
42a0e84308 | ||
|
|
564707901d | ||
|
|
70a316cc3d | ||
|
|
7ef62e1fda | ||
|
|
118e780f0d | ||
|
|
3c5b5b8b03 | ||
|
|
0a6412bea9 | ||
|
|
4a8b8d5f68 | ||
|
|
e00bceb7f2 | ||
|
|
58dce30461 | ||
|
|
3583bcd14d | ||
|
|
3191649a85 | ||
|
|
4325d27ddd | ||
|
|
834a0cf023 | ||
|
|
778abcac1e | ||
|
|
741c894274 | ||
|
|
651e543fd6 | ||
|
|
ae56578d18 | ||
|
|
74ca57dfe8 | ||
|
|
91aab55475 | ||
|
|
fa9c4632bb | ||
|
|
3d1c60aba7 | ||
|
|
399abab9bc | ||
|
|
908040f25e | ||
|
|
ac906fde2f | ||
|
|
57dcd53d86 | ||
|
|
45479ef311 | ||
|
|
21fb4595e6 | ||
|
|
43c812bc6a | ||
|
|
86110845b2 | ||
|
|
f9045181fd | ||
|
|
850ad58630 | ||
|
|
a95c870766 | ||
|
|
56d806cf6f | ||
|
|
c2efd628df | ||
|
|
5eceb4fed1 | ||
|
|
38457c3dac | ||
|
|
fee163dd57 | ||
|
|
f954f74302 | ||
|
|
0271d97259 | ||
|
|
9cb8617078 | ||
|
|
7c5f9f7faa | ||
|
|
053855b040 | ||
|
|
a5b5719d3b | ||
|
|
01b69091e2 | ||
|
|
d30fa5d58e | ||
|
|
b54cd94fe7 | ||
|
|
5de0b392f2 | ||
|
|
3613700a38 | ||
|
|
318a497768 | ||
|
|
7b428cdeda | ||
|
|
b28595b502 | ||
|
|
f9714aa24d | ||
|
|
a9ff449aa6 | ||
|
|
236c02759b | ||
|
|
777948e773 | ||
|
|
6e45576dd6 | ||
|
|
2bc35b0348 | ||
|
|
818d29db9b | ||
|
|
47f70113d4 | ||
|
|
2fa0c16e5e | ||
|
|
8060afb088 | ||
|
|
a1bc39d130 | ||
|
|
e6fae6c23f | ||
|
|
adb160df0f | ||
|
|
74a776f9ae | ||
|
|
12ea18c68d | ||
|
|
f870ecb4a6 | ||
|
|
6d6bfafbdd | ||
|
|
7178674807 | ||
|
|
1954f681c6 | ||
|
|
bb6a548712 | ||
|
|
403816eb85 | ||
|
|
adb7c216b2 | ||
|
|
92d78458e0 | ||
|
|
dd5db06467 | ||
|
|
b13e6b03cc | ||
|
|
a2b8387b70 | ||
|
|
4229a555fc | ||
|
|
688833b80e | ||
|
|
ca0246a4c1 | ||
|
|
c1cdafa1b4 | ||
|
|
ed960988ee | ||
|
|
3ee97d4d5b | ||
|
|
b34f300eaf | ||
|
|
2e5cc5e04e | ||
|
|
182c784a99 | ||
|
|
b14b621029 | ||
|
|
8825dba4e7 | ||
|
|
9922b56ffb | ||
|
|
6681674e3c | ||
|
|
99f35e8204 | ||
|
|
c46f149efd | ||
|
|
644d185dea | ||
|
|
6fc4ae7a28 | ||
|
|
3f92a4421a | ||
|
|
7a4a5dd66c | ||
|
|
fe456215a6 | ||
|
|
65957278ab | ||
|
|
6f2e1d1ce2 | ||
|
|
51078dff7f | ||
|
|
03824c9e29 | ||
|
|
10c96c43ac | ||
|
|
8e8fd5439a | ||
|
|
d3bcbd9968 | ||
|
|
6526b37460 | ||
|
|
9379b5aed5 | ||
|
|
f2794b3c5d | ||
|
|
f090816a3f | ||
|
|
d385bbc985 | ||
|
|
715765a548 | ||
|
|
de0fdbb080 | ||
|
|
e6800f5073 | ||
|
|
e1ff4d762b | ||
|
|
ffccedee33 | ||
|
|
8ddd60a387 | ||
|
|
eaf359df0c | ||
|
|
ff6400a018 | ||
|
|
a74458a36e | ||
|
|
e6c847ea05 | ||
|
|
c7d28e2bd8 | ||
|
|
898f3e5757 | ||
|
|
c239e82816 | ||
|
|
aaa9cb7c22 | ||
|
|
73d802bead | ||
|
|
29b0ceae9f | ||
|
|
b21af8a7dd | ||
|
|
7a888be2e5 | ||
|
|
815b5ca1d5 | ||
|
|
76118226b6 | ||
|
|
091c054eed | ||
|
|
3d2a9041f9 | ||
|
|
aeb85812a1 | ||
|
|
3a3b589b06 | ||
|
|
20c8b4db54 | ||
|
|
c44dd6ddad | ||
|
|
446976666c | ||
|
|
c997ad6f05 | ||
|
|
27a6efc25b | ||
|
|
557514f55c | ||
|
|
5ba09e9ace | ||
|
|
60ae95f973 | ||
|
|
9a181424ac | ||
|
|
4e3478c9d6 | ||
|
|
3803547285 | ||
|
|
cbdd4ce994 | ||
|
|
3749705b11 | ||
|
|
c940655b0f | ||
|
|
db18c4898e | ||
|
|
5d78a2a235 | ||
|
|
268ddc7d50 | ||
|
|
dee715bb6f | ||
|
|
edac0ff420 | ||
|
|
3f10c64fca | ||
|
|
d706ee318c | ||
|
|
a4d2c17357 | ||
|
|
6f37efd8b2 | ||
|
|
746c5e5528 | ||
|
|
6ff9e537fe | ||
|
|
b12057e3bd | ||
|
|
34e1cf8304 | ||
|
|
178d3b59d5 | ||
|
|
ce4e2493ee | ||
|
|
85f9983c19 | ||
|
|
9cb56e2980 | ||
|
|
c5134a9b13 | ||
|
|
475d6600c1 | ||
|
|
3dbdcab168 | ||
|
|
756fe67e60 | ||
|
|
23d07a32b2 | ||
|
|
9f82a64eb6 | ||
|
|
79b86f69e6 | ||
|
|
4d81490eb3 | ||
|
|
28a24ea3be | ||
|
|
6a4e9d5422 | ||
|
|
777d5f0ba8 | ||
|
|
9e7cf8346d | ||
|
|
1f37d82ce4 | ||
|
|
baf2a7b0fe | ||
|
|
73d5e9c5dd | ||
|
|
daf7870cb0 | ||
|
|
796e41bedf | ||
|
|
816194943b | ||
|
|
2eabfeeea8 | ||
|
|
5715c04ceb | ||
|
|
dd05029135 | ||
|
|
78362fb43a | ||
|
|
1723365c85 | ||
|
|
7e9524d7b9 | ||
|
|
c4b593538b | ||
|
|
0b2ebf9875 | ||
|
|
aa35ed104c | ||
|
|
737a7a7116 | ||
|
|
4634a5c628 | ||
|
|
c33725a845 | ||
|
|
e70623f196 | ||
|
|
862593b1f7 | ||
|
|
215318944a | ||
|
|
58e02de834 | ||
|
|
e02a4a825a | ||
|
|
73c74c0303 | ||
|
|
2d882a7200 | ||
|
|
d2a3720ad0 | ||
|
|
e6777f1523 | ||
|
|
41d5fb8189 | ||
|
|
3480c29030 | ||
|
|
a5c268a9f9 | ||
|
|
4f3121b654 | ||
|
|
73b2951ffe | ||
|
|
46505987ea | ||
|
|
bf58f8aea9 | ||
|
|
6c52fbcdfd | ||
|
|
e76eb59d84 | ||
|
|
5b093c28e1 | ||
|
|
9d3b949aa6 | ||
|
|
a468d7579f | ||
|
|
4eb32cb4f2 | ||
|
|
8f08533808 | ||
|
|
3b69e6514c | ||
|
|
9018ec3d41 | ||
|
|
5d16193294 | ||
|
|
61b305d30d | ||
|
|
efc9004234 | ||
|
|
ba733f2d38 | ||
|
|
34a122edc8 | ||
|
|
a5afd877aa | ||
|
|
1289479fce | ||
|
|
7bfb13dea7 | ||
|
|
744d31d57a | ||
|
|
a58305d61e | ||
|
|
3bd2561144 | ||
|
|
156a61c86d | ||
|
|
5850877aea | ||
|
|
847dcc878b | ||
|
|
84791e75cc | ||
|
|
e30230223c | ||
|
|
884e63790c | ||
|
|
a0b8bf89d3 | ||
|
|
c3e64b1b2d | ||
|
|
2131b2e9d5 | ||
|
|
6981af01ee | ||
|
|
863c253425 | ||
|
|
08d800d44e | ||
|
|
e23e3f656a | ||
|
|
4ad4b8aaec | ||
|
|
0f32a82524 | ||
|
|
2a0d3143dd | ||
|
|
6e867c19c9 | ||
|
|
c78152220a | ||
|
|
be2519d4dd | ||
|
|
9800c1597f | ||
|
|
2bf12371d8 | ||
|
|
7243acff2a | ||
|
|
bfa30819b9 | ||
|
|
ac5e053d8f | ||
|
|
13751495a1 | ||
|
|
1d2f218bff | ||
|
|
00b953713e | ||
|
|
ed4a024430 | ||
|
|
53398947a1 | ||
|
|
5e14cce7ae | ||
|
|
27276e481d | ||
|
|
7949927db6 | ||
|
|
634853cee6 | ||
|
|
0f100b0d3f | ||
|
|
83adf65c37 | ||
|
|
67b467223a | ||
|
|
2e6b75c735 | ||
|
|
0ec5eacc92 | ||
|
|
b024130dc2 | ||
|
|
aff66fa170 | ||
|
|
92e8245d90 | ||
|
|
c300ac7a4d | ||
|
|
67b836ed72 | ||
|
|
388569f846 | ||
|
|
981d081027 | ||
|
|
6a7bd50a0b | ||
|
|
f280d719f3 | ||
|
|
1d39399861 | ||
|
|
008d74220b | ||
|
|
0f0189167b | ||
|
|
bf6bcd3c16 | ||
|
|
b439039b9b | ||
|
|
2cada8c970 | ||
|
|
360b2870d8 | ||
|
|
b669dbd1ad | ||
|
|
b81692a8a9 | ||
|
|
dfa0cede72 | ||
|
|
add1d7c11f | ||
|
|
221ef68cc3 | ||
|
|
a7190a7381 | ||
|
|
f721ed2bf4 | ||
|
|
6dde9c58fe | ||
|
|
f1a5372cbc | ||
|
|
c22b040b21 | ||
|
|
0c5abc43a0 | ||
|
|
d5f4d5f22e | ||
|
|
2a5c6dea54 | ||
|
|
05d30f2715 | ||
|
|
c8d085374c | ||
|
|
9ceb93e7ff | ||
|
|
b808e70940 | ||
|
|
654ad9e596 | ||
|
|
8cff7ef2b9 | ||
|
|
137cf55755 | ||
|
|
ddc22e05ab | ||
|
|
42fcbf3950 | ||
|
|
11f5ed65ba | ||
|
|
99cf57df5f | ||
|
|
b71a140977 | ||
|
|
e49897affc | ||
|
|
2ef6cb6073 | ||
|
|
4db03fe797 | ||
|
|
8506a6bc2a | ||
|
|
8303c90f14 | ||
|
|
a530d04879 | ||
|
|
4a99368c87 | ||
|
|
46faa9979f | ||
|
|
c038102c6a | ||
|
|
23cfe44342 | ||
|
|
b3d7a51157 | ||
|
|
23f91764bc | ||
|
|
2ab1921d24 | ||
|
|
1c2d713cab | ||
|
|
395224e372 | ||
|
|
43cdd09d2d | ||
|
|
de6c7a9b78 | ||
|
|
7d7530446c | ||
|
|
208fa17ad0 | ||
|
|
5a1b7d267a | ||
|
|
1bcceb8ba4 | ||
|
|
e0bcf6c00d | ||
|
|
0a5f63aee2 | ||
|
|
2008517b36 | ||
|
|
517bef6ccd | ||
|
|
e2db29a312 | ||
|
|
a3fa97f5e3 | ||
|
|
7fc45bccbd | ||
|
|
7d3a280b7a | ||
|
|
be60b8e319 | ||
|
|
4090d52520 | ||
|
|
1f88c647cd | ||
|
|
08b596b409 | ||
|
|
e625640bd0 | ||
|
|
a6a2dbc63c | ||
|
|
5c3c1931dd | ||
|
|
d75c1aaea1 | ||
|
|
f1a905664b | ||
|
|
5cf455d736 | ||
|
|
8ef322d66f | ||
|
|
1d5b09348e | ||
|
|
5782ca8976 | ||
|
|
623ce837c7 | ||
|
|
73f21f7813 | ||
|
|
a8377ab773 | ||
|
|
5106e930d1 | ||
|
|
74b4707ea6 | ||
|
|
99b8fcfb0d | ||
|
|
5df13c9b0a | ||
|
|
5eeef11a3b | ||
|
|
cfbca54a71 | ||
|
|
f0f6a9c44e | ||
|
|
cc1a9180a7 | ||
|
|
155639bf0f | ||
|
|
c0f51577fd | ||
|
|
efac765819 | ||
|
|
1c7a2ac60f | ||
|
|
f4b094e098 | ||
|
|
e984b74461 | ||
|
|
c1e61448b3 | ||
|
|
2f077ef41f | ||
|
|
cfc48b6ee9 | ||
|
|
073c4cb543 | ||
|
|
8bacb0720c | ||
|
|
da8c36f53f | ||
|
|
83cf5efca9 | ||
|
|
4d9669b8d9 | ||
|
|
18573f3eb2 | ||
|
|
57ec0f45c9 | ||
|
|
a7830ac93b | ||
|
|
488bd9911e | ||
|
|
7956c15081 | ||
|
|
0402200daf | ||
|
|
dc0708fa82 | ||
|
|
7b9ad5a22f | ||
|
|
c4e9f56745 | ||
|
|
b69a467146 | ||
|
|
75cce0c815 | ||
|
|
546754d2e9 | ||
|
|
e8f8b7a82d | ||
|
|
c54a604289 | ||
|
|
f52e14c576 | ||
|
|
a0aef26c06 | ||
|
|
4d4a6210f7 | ||
|
|
a5ad9a2579 | ||
|
|
79d6ddd36a | ||
|
|
18da62e303 | ||
|
|
77469b714b | ||
|
|
1fbac54162 | ||
|
|
cf14c509f3 | ||
|
|
02bde8d334 | ||
|
|
e99f534046 | ||
|
|
aeac9910cb | ||
|
|
f84513b43e | ||
|
|
34fc818d7e | ||
|
|
f1e1eb58be | ||
|
|
3d6c17e94f | ||
|
|
ef3e297950 | ||
|
|
5cf3719e7b | ||
|
|
b36e366ef4 | ||
|
|
c2b86aabe0 | ||
|
|
849a1c46cf | ||
|
|
7c863aef95 | ||
|
|
cc7705fe6f | ||
|
|
e97b60d16a | ||
|
|
1b1382a3a9 | ||
|
|
ff0e048521 | ||
|
|
0af7afd19f | ||
|
|
24aec7f87f | ||
|
|
acb7c4ee48 | ||
|
|
5796c221a1 | ||
|
|
dde28b7ffe | ||
|
|
dfa21e5966 | ||
|
|
8014db4d68 | ||
|
|
c6394074a8 | ||
|
|
83ce0dcba6 | ||
|
|
9a69ea769a | ||
|
|
3044600151 | ||
|
|
da6d91f64b | ||
|
|
c6ca8a1528 | ||
|
|
8108bc26d6 | ||
|
|
908b4d6cb9 | ||
|
|
0683df4bf8 | ||
|
|
05907fc584 | ||
|
|
ca56751421 | ||
|
|
dd084ce340 | ||
|
|
92278a462b | ||
|
|
ca56be1e3e | ||
|
|
09f8e7fb03 | ||
|
|
c2e9e7a31b | ||
|
|
49f397e6e7 | ||
|
|
6161f25abc | ||
|
|
0898b54377 | ||
|
|
6f1c4b7a75 | ||
|
|
b7b00aad08 | ||
|
|
ec2a94a410 | ||
|
|
4796ddfe36 | ||
|
|
31856b16c3 | ||
|
|
6732422b97 | ||
|
|
2b3ce6fab9 | ||
|
|
b951477c80 | ||
|
|
0bf332a016 | ||
|
|
3e12088cf0 | ||
|
|
c0d94c89ec | ||
|
|
dd3a088973 | ||
|
|
5c15113c49 | ||
|
|
553eb65acd | ||
|
|
0c43179cf9 | ||
|
|
b031f89b29 | ||
|
|
b7df779b8b | ||
|
|
96ed803f48 | ||
|
|
fd798dd6fe | ||
|
|
dd8b68966f | ||
|
|
72ce8c67c5 | ||
|
|
22132a47aa | ||
|
|
0705aa7388 | ||
|
|
762769cf3b | ||
|
|
82eae6c9b5 | ||
|
|
86f04e3bb3 | ||
|
|
ce5f4177bc | ||
|
|
48f3bca87e | ||
|
|
adf0ec7008 | ||
|
|
5b4dde5a7b | ||
|
|
2224409994 | ||
|
|
30d11429a9 | ||
|
|
c4176dd559 | ||
|
|
47d5042d1e | ||
|
|
6df632b672 | ||
|
|
6875b205d6 | ||
|
|
47306242ec | ||
|
|
83780d95f0 | ||
|
|
5b804afa6a | ||
|
|
83b9d5e9ef | ||
|
|
a2b0b9846d | ||
|
|
a0ad16498b | ||
|
|
aa084c8407 | ||
|
|
ac821ab1ef | ||
|
|
6e146d4216 | ||
|
|
e4a96fff58 | ||
|
|
aa6cde5ca1 | ||
|
|
05a5e42609 | ||
|
|
11a013bf87 | ||
|
|
de4de17bc5 | ||
|
|
b0302bb3a6 | ||
|
|
334f8dcbb7 | ||
|
|
47eaf4a1e8 | ||
|
|
1e30b2f8c4 | ||
|
|
84df8be864 | ||
|
|
f05befc26c | ||
|
|
96e22ecc78 | ||
|
|
9eb195d6a5 | ||
|
|
40f0f4d2e8 | ||
|
|
4fa07774d6 | ||
|
|
7567c84e76 | ||
|
|
a87c771012 | ||
|
|
a2535fc95f | ||
|
|
d2aaf842b4 | ||
|
|
13e93efe91 | ||
|
|
af1033c63c | ||
|
|
768f92072f | ||
|
|
8b92864e1d | ||
|
|
d97d668b69 | ||
|
|
5d1c0a2af5 | ||
|
|
b1c9ce6621 | ||
|
|
aec547d764 | ||
|
|
185c59d3bd | ||
|
|
f1c5cfd5f2 | ||
|
|
c848009e29 | ||
|
|
a0d766c204 | ||
|
|
c1f248d670 | ||
|
|
9b1d63b4a3 | ||
|
|
c7262bbe86 | ||
|
|
008028896b | ||
|
|
c5716550a6 | ||
|
|
b43f5fb25b | ||
|
|
013277d331 | ||
|
|
09eedba01f | ||
|
|
ca59b76b50 | ||
|
|
b9485b8d52 | ||
|
|
66b9285a6f | ||
|
|
470e773e76 | ||
|
|
039942bfc1 | ||
|
|
a94e341d85 | ||
|
|
db98ca11cf | ||
|
|
22a5274de9 | ||
|
|
2ee6cf8ea0 | ||
|
|
baf81e4974 | ||
|
|
bda4a5e5b7 | ||
|
|
0598102472 | ||
|
|
4aba8a55f2 | ||
|
|
6f6a35a9a1 | ||
|
|
d691ea7ebc | ||
|
|
ca63ca90ab | ||
|
|
43dd57eba9 | ||
|
|
6dd358e12d | ||
|
|
c73aa6b629 | ||
|
|
63b348b3a9 | ||
|
|
6181f175e3 | ||
|
|
5a52e61271 | ||
|
|
e74c290ac7 | ||
|
|
5ea57c875d | ||
|
|
492b177ca5 | ||
|
|
daa976fff6 | ||
|
|
871d176f15 | ||
|
|
fc2e23b1ad | ||
|
|
1cde2ceb5c | ||
|
|
539457f1ae | ||
|
|
b6ff24fb7f | ||
|
|
da20dc044a | ||
|
|
a42c7fe2d1 | ||
|
|
b792f7aa0e | ||
|
|
9242af95a3 | ||
|
|
9583179c1b | ||
|
|
d9dee002e6 | ||
|
|
434b809272 | ||
|
|
4feb3b1e06 | ||
|
|
14390d1fed | ||
|
|
8831ffbec4 | ||
|
|
45d4def5e4 | ||
|
|
b9c1393e5f | ||
|
|
c5bf4b6c9c | ||
|
|
3ac64eda17 | ||
|
|
148f37c34e | ||
|
|
9845d179b3 | ||
|
|
11b87d29cc | ||
|
|
bc7210e563 | ||
|
|
e1ab53f969 | ||
|
|
790196a645 | ||
|
|
b5c8c81d4d | ||
|
|
91a709b210 | ||
|
|
5e25ee19e4 | ||
|
|
70390f60ec | ||
|
|
c22889019c | ||
|
|
06ea91f2f3 | ||
|
|
3c7699600f | ||
|
|
c8c90bb532 | ||
|
|
6f63d53e1b | ||
|
|
cd1dbbcfc1 | ||
|
|
4bbadbb14a | ||
|
|
cc61df7131 | ||
|
|
965c0bf39d | ||
|
|
6fc3c211ec | ||
|
|
c25dcdd843 | ||
|
|
e387fd1471 | ||
|
|
1c7bc6028a | ||
|
|
74f061de82 | ||
|
|
47b91b8948 | ||
|
|
2d73c959cc | ||
|
|
9a17340b10 | ||
|
|
a9de4d485a | ||
|
|
111cb717e8 | ||
|
|
6a45f61547 | ||
|
|
026d10d369 | ||
|
|
d832bf77eb | ||
|
|
de97a7099c | ||
|
|
1d15980fb6 | ||
|
|
b3303ba072 | ||
|
|
eddb25aa26 | ||
|
|
40c6966137 | ||
|
|
4de6eab547 | ||
|
|
caa2df2274 | ||
|
|
4c8c0b69ba | ||
|
|
527d04d44b | ||
|
|
9a12d05216 | ||
|
|
77c46a6b42 | ||
|
|
744393f0f4 | ||
|
|
6f200d7982 | ||
|
|
12e85d31e2 | ||
|
|
17821cc15e | ||
|
|
0bcd6e68a9 | ||
|
|
528390fa58 | ||
|
|
a719a87508 | ||
|
|
a1fa4eff25 | ||
|
|
f344b7fab6 | ||
|
|
eca98f76ac | ||
|
|
f30618bac7 | ||
|
|
dc4a18b537 | ||
|
|
9801e9cde1 | ||
|
|
1b16c152bd | ||
|
|
3ed71a2fdd | ||
|
|
0e15d57a89 | ||
|
|
c253d247ca | ||
|
|
656fac3d80 | ||
|
|
dde2c138e9 | ||
|
|
7823351d6b | ||
|
|
b23b6bbcf7 | ||
|
|
800e219a2d | ||
|
|
ecf0d31b72 | ||
|
|
c3f476d467 | ||
|
|
7f3e86b27b | ||
|
|
b0453a43c0 |
223
ABOUT-NLS
Normal file
223
ABOUT-NLS
Normal file
@@ -0,0 +1,223 @@
|
||||
Notes on the GNU Translation Project
|
||||
************************************
|
||||
|
||||
GNU is going international! The GNU Translation Project is a way to
|
||||
get maintainers, translators, and users all together, so that GNU will
|
||||
gradually become able to speak many languages. A few packages already
|
||||
provide translations for their messages.
|
||||
|
||||
If you found this `ABOUT-NLS' file inside a GNU distribution, you
|
||||
may assume that the distributed package does use GNU `gettext'
|
||||
internally, itself available at your nearest GNU archive site. But you
|
||||
do *not* need to install GNU `gettext' prior to configuring, installing
|
||||
or using this package with messages translated.
|
||||
|
||||
Installers will find here some useful hints. These notes also
|
||||
explain how users should proceed for getting the programs to use the
|
||||
available translations. They tell how people wanting to contribute and
|
||||
work at translations should contact the appropriate team.
|
||||
|
||||
When reporting bugs in the `intl/' directory or bugs which may be
|
||||
related to internationalization, you should tell about the version of
|
||||
`gettext' which is used. The information can be found in the
|
||||
`intl/VERSION' file, in internationalized packages.
|
||||
|
||||
One advise in advance
|
||||
=====================
|
||||
|
||||
If you want to exploit the full power of internationalization, you
|
||||
should configure it using
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to force usage of internationalizing routines provided within this
|
||||
package, despite the existence of internationalizing capabilities in
|
||||
the operating system where this package is being installed. So far, no
|
||||
prior implementation provides as many useful features (such as locale
|
||||
alias or message inheritance). It is also not possible to offer this
|
||||
additional functionality on top of a `catgets' implementation. Future
|
||||
versions of GNU `gettext' will very likely convey even more
|
||||
functionality. So it might be a good idea to change to GNU `gettext'
|
||||
as soon as possible.
|
||||
|
||||
INSTALL Matters
|
||||
===============
|
||||
|
||||
Some GNU packages are "localizable" when properly installed; the
|
||||
programs they contain can be made to speak your own native language.
|
||||
Most such packages use GNU `gettext'. Other packages have their own
|
||||
ways to internationalization, predating GNU `gettext'.
|
||||
|
||||
By default, this package will be installed to allow translation of
|
||||
messages. It will automatically detect whether the system provides
|
||||
usable `catgets' (if using this is selected by the installer) or
|
||||
`gettext' functions. If neither is available, the GNU `gettext' own
|
||||
library will be used. This library is wholly contained within this
|
||||
package, usually in the `intl/' subdirectory, so prior installation of
|
||||
the GNU `gettext' package is *not* required. Installers may use
|
||||
special options at configuration time for changing the default
|
||||
behaviour. The commands:
|
||||
|
||||
./configure --with-included-gettext
|
||||
./configure --with-catgets
|
||||
./configure --disable-nls
|
||||
|
||||
will respectively bypass any pre-existing `catgets' or `gettext' to use
|
||||
the internationalizing routines provided within this package, enable
|
||||
the use of the `catgets' functions (if found on the locale system), or
|
||||
else, *totally* disable translation of messages.
|
||||
|
||||
When you already have GNU `gettext' installed on your system and run
|
||||
configure without an option for your new package, `configure' will
|
||||
probably detect the previously built and installed `libintl.a' file and
|
||||
will decide to use this. This might be not what is desirable. You
|
||||
should use the more recent version of the GNU `gettext' library. I.e.
|
||||
if the file `intl/VERSION' shows that the library which comes with this
|
||||
package is more recent, you should use
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to prevent auto-detection.
|
||||
|
||||
By default the configuration process will not test for the `catgets'
|
||||
function and therefore they will not be used. The reasons are already
|
||||
given above: the emulation on top of `catgets' cannot provide all the
|
||||
extensions provided by the GNU `gettext' library. If you nevertheless
|
||||
want to use the `catgets' functions use
|
||||
|
||||
./configure --with-catgets
|
||||
|
||||
to enable the test for `catgets' (this causes no harm if `catgets' is
|
||||
not available on your system). If you really select this option we
|
||||
would like to hear about the reasons because we cannot think of any
|
||||
good one ourself.
|
||||
|
||||
Internationalized packages have usually many `po/LL.po' files, where
|
||||
LL gives an ISO 639 two-letter code identifying the language. Unless
|
||||
translations have been forbidden at `configure' time by using the
|
||||
`--disable-nls' switch, all available translations are installed
|
||||
together with the package. However, the environment variable `LINGUAS'
|
||||
may be set, prior to configuration, to limit the installed set.
|
||||
`LINGUAS' should then contain a space separated list of two-letter
|
||||
codes, stating which languages are allowed.
|
||||
|
||||
Using This Package
|
||||
==================
|
||||
|
||||
As a user, if your language has been installed for this package, you
|
||||
only have to set the `LANG' environment variable to the appropriate
|
||||
ISO 639 `LL' two-letter code prior to using the programs in the
|
||||
package. For example, let's suppose that you speak German. At the
|
||||
shell prompt, merely execute `setenv LANG de' (in `csh'),
|
||||
`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This
|
||||
can be done from your `.login' or `.profile' file, once and for all.
|
||||
|
||||
An operating system might already offer message localization for
|
||||
many of its programs, while other programs (whether GNU or not) have
|
||||
been installed locally with the full capabilities of GNU `gettext'.
|
||||
Just using `gettext' extended syntax for `LANG' would break proper
|
||||
localization of already available operating system programs. In this
|
||||
case, users should set both `LANGUAGE' and `LANG' variables in their
|
||||
environment, as programs using GNU `gettext' give preference to
|
||||
`LANGUAGE'. For example, some Swedish users would rather read
|
||||
translations in German than English for when Swedish is not available.
|
||||
This is easily accomplished by setting `LANGUAGE' to `sv:de' while
|
||||
leaving `LANG' to `sv'.
|
||||
|
||||
Translating Teams
|
||||
=================
|
||||
|
||||
For the GNU Translation Project to be a success, we need interested
|
||||
people who like their own language and write it well, and who are also
|
||||
able to synergize with other translators speaking the same language.
|
||||
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:
|
||||
|
||||
Arabic `ar', Chinese `zh', Czech `cs', Danish `da', Dutch `nl',
|
||||
English `en', Esperanto `eo', Finnish `fi', French `fr', German
|
||||
`de', Greek `el', Hebrew `he', Hungarian `hu', Irish `ga', Italian
|
||||
`it', Indonesian `id', Japanese `ja', Korean `ko', Latin `la',
|
||||
Norwegian `no', Persian `fa', Polish `pl', Portuguese `pt',
|
||||
Russian `ru', Slovenian `sl', Spanish `es', Swedish `sv', Telugu
|
||||
`te', Turkish `tr' and Ukrainian `uk'.
|
||||
|
||||
For example, you may reach the Chinese translation team by writing to
|
||||
`zh@li.org'.
|
||||
|
||||
If you'd like to volunteer to *work* at translating messages, you
|
||||
should become a member of the translating team for your own language.
|
||||
The subscribing address is *not* the same as the list itself, it has
|
||||
`-request' appended. For example, speakers of Swedish can send a
|
||||
message to `sv-request@li.org', having this message body:
|
||||
|
||||
subscribe
|
||||
|
||||
Keep in mind that team members are expected to participate
|
||||
*actively* in translations, or at solving translational difficulties,
|
||||
rather than merely lurking around. If your team does not exist yet and
|
||||
you want to start one, or if you are unsure about what to do or how to
|
||||
get started, please write to `gnu-translation@gnu.ai.mit.edu' to reach
|
||||
the GNU coordinator for all translator teams.
|
||||
|
||||
The English team is special. It works at improving and uniformizing
|
||||
the terminology used in GNU. Proven linguistic skill are praised more
|
||||
than programming skill, here. For the time being, please avoid
|
||||
subscribing to the English team unless explicitly invited to do so.
|
||||
|
||||
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
|
||||
which languages PO files have been submitted to translation
|
||||
coordination.
|
||||
|
||||
cs de en es fi fr ja ko nl no pl pt sl sv
|
||||
.-------------------------------------------.
|
||||
bash | [] [] | 2
|
||||
bison | [] [] | 2
|
||||
clisp | [] [] [] | 3
|
||||
cpio | [] [] [] | 3
|
||||
diffutils | [] [] [] | 3
|
||||
enscript | [] [] [] [] [] | 5
|
||||
fileutils | [] [] [] [] [] [] | 6
|
||||
findutils | [] [] [] [] [] | 5
|
||||
flex | [] | 1
|
||||
gcal | [] | 1
|
||||
gettext | [] [] [] [] [] [] [] [] [] | 10
|
||||
glibc | [] [] [] | 3
|
||||
grep | [] [] [] [] [] [] [] | 7
|
||||
hello | [] [] [] [] [] [] [] [] | 8
|
||||
m4 | [] [] [] [] [] | 5
|
||||
make | [] [] | 2
|
||||
mkid | [] [] | 2
|
||||
music | [] | 1
|
||||
ptx | [] [] [] [] [] | 5
|
||||
recode | [] [] [] [] [] [] [] | 7
|
||||
sh-utils | [] [] | 2
|
||||
sharutils | [] [] [] [] | 4
|
||||
tar | [] [] [] [] [] [] [] [] | 8
|
||||
textutils | [] [] [] [] [] | 5
|
||||
wdiff | [] [] [] [] [] | 5
|
||||
`-------------------------------------------'
|
||||
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
|
||||
|
||||
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
|
||||
used for implementing regional variants of languages, or language
|
||||
dialects.
|
||||
|
||||
For a PO file in the matrix above to be effective, the package to
|
||||
which it applies should also have been internationalized and
|
||||
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.
|
||||
|
||||
6
COPYING
6
COPYING
@@ -2,7 +2,7 @@
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
@@ -304,8 +304,8 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
|
||||
250
INSTALL
250
INSTALL
@@ -1,111 +1,181 @@
|
||||
This is a generic INSTALL file for utilities distributions.
|
||||
If this package does not come with, e.g., installable documentation or
|
||||
data files, please ignore the references to them below.
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
To compile this package:
|
||||
These are generic installation instructions.
|
||||
|
||||
1. Configure the package for your system. In the directory that this
|
||||
file is in, type `./configure'. If you're using `csh' on an old
|
||||
version of System V, you might need to type `sh configure' instead to
|
||||
prevent `csh' from trying to execute `configure' itself.
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation, and
|
||||
creates the Makefile(s) (one in each subdirectory of the source
|
||||
directory). In some packages it creates a C header file containing
|
||||
system-dependent definitions. It also creates a file `config.status'
|
||||
that you can run in the future to recreate the current configuration.
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
Running `configure' takes a minute or two. While it is running, it
|
||||
prints some messages that tell what it is doing. If you don't want to
|
||||
see the messages, run `configure' with its standard output redirected
|
||||
to `/dev/null'; for example, `./configure >/dev/null'.
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
To compile the package in a different directory from the one
|
||||
containing the source code, you must use a version of make that
|
||||
supports the VPATH variable, such as GNU make. `cd' to the directory
|
||||
where you want the object files and executables to go and run
|
||||
`configure'. `configure' automatically checks for the source code in
|
||||
the directory that `configure' is in and in `..'. If for some reason
|
||||
`configure' is not in the source code directory that you are
|
||||
configuring, then it will report that it can't find the source code.
|
||||
In that case, run `configure' with the option `--srcdir=DIR', where
|
||||
DIR is the directory that contains the source code.
|
||||
The simplest way to compile this package is:
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
/usr/local/bin, /usr/local/lib, /usr/local/man, etc. You can specify
|
||||
an installation prefix other than /usr/local by giving `configure' the
|
||||
option `--prefix=PATH'. Alternately, you can do so by giving a value
|
||||
for the `prefix' variable when you run `make', e.g.,
|
||||
make prefix=/usr/gnu
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If
|
||||
you give `configure' the option `--exec_prefix=PATH' or set the
|
||||
`make' variable `exec_prefix' to PATH, the package will use PATH as
|
||||
the prefix for installing programs and libraries. Data files and
|
||||
documentation will still use the regular prefix. Normally, all files
|
||||
are installed using the regular prefix.
|
||||
Running `configure' takes a while. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
You can tell `configure' to figure out the configuration for your
|
||||
system, and record it in `config.status', without actually configuring
|
||||
the package (creating `Makefile's and perhaps a configuration header
|
||||
file). To do this, give `configure' the `--no-create' option. Later,
|
||||
you can run `./config.status' to actually configure the package. This
|
||||
option is useful mainly in `Makefile' rules for updating `config.status'
|
||||
and `Makefile'. You can also give `config.status' the `--recheck'
|
||||
option, which makes it re-run `configure' with the same arguments you
|
||||
used before. This is useful if you change `configure'.
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
`configure' ignores any other arguments that you give it.
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
If your system requires unusual options for compilation or linking
|
||||
that `configure' doesn't know about, you can give `configure' initial
|
||||
values for some variables by setting them in the environment. In
|
||||
Bourne-compatible shells, you can do that on the command line like
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC='gcc -traditional' DEFS=-D_POSIX_SOURCE ./configure
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
The `make' variables that you might want to override with environment
|
||||
variables when running `configure' are:
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
(For these variables, any value given in the environment overrides the
|
||||
value that `configure' would choose:)
|
||||
CC C compiler program.
|
||||
Default is `cc', or `gcc' if `gcc' is in your PATH.
|
||||
INSTALL Program to use to install files.
|
||||
Default is `install' if you have it, `cp' otherwise.
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
(For these variables, any value given in the environment is added to
|
||||
the value that `configure' chooses:)
|
||||
DEFS Configuration options, in the form `-Dfoo -Dbar ...'
|
||||
LIBS Libraries to link with, in the form `-lfoo -lbar ...'
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you need to do unusual things to compile the package, we encourage
|
||||
you to figure out how `configure' could check whether to do them, and
|
||||
mail diffs or instructions to the address given in the README so we
|
||||
can include them in the next release.
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
2. Type `make' to compile the package. If you want, you can override
|
||||
the `make' variables CFLAGS and LDFLAGS like this:
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
make CFLAGS=-O2 LDFLAGS=-s
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
3. If the package comes with self-tests and you want to run them,
|
||||
type `make check'. If you're not sure whether there are any, try it;
|
||||
if `make' responds with something like
|
||||
make: *** No way to make target `check'. Stop.
|
||||
then the package does not come with self-tests.
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
4. Type `make install' to install programs, data files, and
|
||||
documentation.
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source directory by typing `make clean'. To also remove the
|
||||
Makefile(s), the header file containing system-dependent definitions
|
||||
(if the package uses one), and `config.status' (all the files that
|
||||
`configure' created), type `make distclean'.
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made.
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
|
||||
The file `configure.in' is used as a template to create `configure' by
|
||||
a program called `autoconf'. You will only need it if you want to
|
||||
regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Makefile
|
||||
fileutils.info
|
||||
version.texi
|
||||
fileutils.info*
|
||||
fileutils.log
|
||||
fileutils.dvi
|
||||
fileutils.aux
|
||||
@@ -15,3 +16,5 @@ fileutils.cm
|
||||
fileutils.fl
|
||||
fileutils.op
|
||||
fileutils.cps
|
||||
stamp-vti
|
||||
version.texi
|
||||
|
||||
6
doc/Makefile.am
Normal file
6
doc/Makefile.am
Normal file
@@ -0,0 +1,6 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
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
|
||||
261
doc/Makefile.in
261
doc/Makefile.in
@@ -1,103 +1,224 @@
|
||||
# Makefile for GNU file utilities documentation.
|
||||
# Copyright (C) 1994, 1995 Free Software Foundation, Inc.
|
||||
# Makefile.in generated automatically by automake 1.1e from Makefile.am
|
||||
|
||||
# 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.
|
||||
# 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.
|
||||
|
||||
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
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@
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
prefix = @prefix@
|
||||
infodir = $(prefix)/info
|
||||
DIST_COMMON = Makefile.am Makefile.in mdate-sh stamp-vti texinfo.tex \
|
||||
version.texi
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
DISTFILES = Makefile.in texinfo.tex fileutils.texi fileutils.info \
|
||||
version.texi perm.texi getdate.texi
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
all: fileutils.info
|
||||
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)
|
||||
|
||||
info: fileutils.info
|
||||
TAR = tar
|
||||
default: all
|
||||
|
||||
version.texi: ../src/version.c
|
||||
sed -e '/version_string/!d' \
|
||||
-e 's/[^0-9.]*\([0-9.a-z]*\).*/@set VERSION \1/' \
|
||||
-e q $(srcdir)/../src/version.c \
|
||||
> $@-t
|
||||
echo '@set RELEASEDATE '`date '+%B %Y'` >> $@-t
|
||||
mv $@-t $@
|
||||
|
||||
$(srcdir)/Makefile.in: @MAINT@Makefile.am $(top_srcdir)/configure.in
|
||||
cd $(top_srcdir) && automake $(subdir)/Makefile
|
||||
|
||||
Makefile: $(top_builddir)/config.status Makefile.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
||||
|
||||
version.texi: @MAINT@stamp-vti
|
||||
|
||||
stamp-vti: fileutils.texi $(top_srcdir)/configure.in
|
||||
echo "@set UPDATED `cd $(srcdir) \
|
||||
&& $(SHELL) ./mdate-sh fileutils.texi`" > vti.tmp
|
||||
echo "@set EDITION $(VERSION)" >> vti.tmp
|
||||
echo "@set VERSION $(VERSION)" >> vti.tmp
|
||||
cmp -s vti.tmp $(srcdir)/version.texi || cp vti.tmp $(srcdir)/version.texi
|
||||
rm vti.tmp
|
||||
echo timestamp > $(srcdir)/stamp-vti
|
||||
|
||||
mostlyclean-vti:
|
||||
rm -f vti.tmp
|
||||
|
||||
clean-vti:
|
||||
|
||||
distclean-vti:
|
||||
|
||||
maintainer-clean-vti:
|
||||
@MAINT@rm -f stamp-vti version.texi
|
||||
|
||||
fileutils.info: fileutils.texi version.texi
|
||||
$(MAKEINFO) -I$(srcdir) --no-split fileutils.texi --output=$@
|
||||
fileutils.dvi: fileutils.texi version.texi
|
||||
|
||||
dvi: fileutils.dvi
|
||||
|
||||
fileutils.dvi: fileutils.texi version.texi texinfo.tex
|
||||
$(TEXI2DVI) $(srcdir)/fileutils.texi
|
||||
.texi.info:
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
installdirs:
|
||||
$(srcdir)/../mkinstalldirs $(infodir)
|
||||
.texi.dvi:
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $<
|
||||
|
||||
install: install-exec install-data
|
||||
install-exec:
|
||||
install-data: all installdirs
|
||||
cd $(srcdir) && for file in fileutils.info; do \
|
||||
$(INSTALL_DATA) $$file $(infodir)/$$file; \
|
||||
.texinfo.info:
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.texinfo.dvi:
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $<
|
||||
|
||||
install-info: $(INFO_DEPS)
|
||||
$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(infodir)
|
||||
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 \
|
||||
$(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile; \
|
||||
else : ; fi; \
|
||||
done; \
|
||||
done
|
||||
|
||||
uninstall:
|
||||
rm -f $(infodir)/fileutils.info
|
||||
|
||||
check:
|
||||
|
||||
texclean:
|
||||
rm -f *.aux *.cp *.dvi *.fn *.ky *.log *.pg *.toc *.tp *.vr \
|
||||
*.fl *.cm *.op *.cps
|
||||
|
||||
mostlyclean: texclean
|
||||
|
||||
clean: mostlyclean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for use by maintainers;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
rm -f fileutils.info version.texi
|
||||
|
||||
distdir = ../`cat ../distname`/$(subdir)
|
||||
dist: $(DISTFILES)
|
||||
for file in $(DISTFILES); do \
|
||||
ln $$file $(distdir) \
|
||||
|| { echo copying $$file instead; cp -p $$file $(distdir);}; \
|
||||
uninstall-info:
|
||||
cd $(srcdir) && for file in *.info*; do \
|
||||
rm -f $(infodir)/$$file; \
|
||||
done
|
||||
|
||||
mostlyclean-info:
|
||||
rm -f fileutils.aux fileutils.cp fileutils.cps fileutils.dvi \
|
||||
fileutils.fn fileutils.fns fileutils.ky fileutils.log \
|
||||
fileutils.pg fileutils.toc fileutils.tp fileutils.vr \
|
||||
fileutils.op
|
||||
|
||||
clean-info:
|
||||
|
||||
distclean-info:
|
||||
|
||||
maintainer-clean-info:
|
||||
rm -f $(INFOS)
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = doc
|
||||
Makefile: ../config.status Makefile.in
|
||||
cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
||||
distdir: $(DEP_DISTFILES)
|
||||
@for file in `cd $(srcdir) && echo $(DISTFILES)`; do \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $(srcdir)/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir)/$$file; \
|
||||
done
|
||||
info: $(INFO_DEPS)
|
||||
|
||||
.PHONY: all check clean dist distclean dvi info install install-data \
|
||||
install-exec installdirs maintainer-clean mostlyclean texclean uninstall
|
||||
dvi: $(DVIS)
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
check: all
|
||||
|
||||
installcheck:
|
||||
|
||||
install-exec:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install-data: install-info
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
uninstall: uninstall-info
|
||||
|
||||
all: $(INFO_DEPS) Makefile
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(infodir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
distclean: distclean-vti distclean-info distclean-generic clean
|
||||
rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-vti maintainer-clean-info \
|
||||
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 \
|
||||
distclean-info clean-info maintainer-clean-info tags distdir info dvi \
|
||||
check 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.
|
||||
.NOEXPORT:
|
||||
|
||||
@@ -11,6 +11,30 @@
|
||||
@cindex date input formats
|
||||
@findex getdate
|
||||
|
||||
@quotation
|
||||
Our units of temporal measurement, from seconds on up to months, are so
|
||||
complicated, asymmetrical and disjunctive so as to make coherent mental
|
||||
reckoning in time all but impossible. Indeed, had some tyrannical god
|
||||
contrived to enslave our minds to time, to make it all but impossible
|
||||
for us to escape subjection to sodden routines and unpleasant surprises,
|
||||
he could hardly have done better than handing down our present system.
|
||||
It is like a set of trapezoidal building blocks, with no vertical or
|
||||
horizontal surfaces, like a language in which the simplest thought
|
||||
demands ornate constructions, useless particles and lengthy
|
||||
circumlocutions. Unlike the more successful patterns of language and
|
||||
science, which enable us to face experience boldly or at least
|
||||
level-headedly, our system of temporal calculation silently and
|
||||
persistently encourages our terror of time.
|
||||
|
||||
@dots{} It is as though architects had to measure length in feet, width
|
||||
in meters and height in ells; as though basic instruction manuals
|
||||
demanded a knowledge of five different languages. It is no wonder then
|
||||
that we often look into our own immediate past or future, last Tuesday
|
||||
or a week from Sunday, with feelings of helpless confusion. @dots{}
|
||||
|
||||
--- Robert Grudin, @cite{Time and the Art of Living}.
|
||||
@end quotation
|
||||
|
||||
This section describes the textual date representations that GNU
|
||||
programs accept. These are the strings you, as a user, can supply as
|
||||
arguments to the various programs. The C interface (via the
|
||||
@@ -94,7 +118,7 @@ specified differently, depending on whether the month is specified
|
||||
numerically or literally. All these strings specify the same calendar date:
|
||||
|
||||
@example
|
||||
1970-9-17 # ISO 8601.
|
||||
1970-09-17 # ISO 8601.
|
||||
70-9-17 # This century assumed by default.
|
||||
70-09-17 # Leading zeros are ignored.
|
||||
9/17/72 # Common U.S. writing.
|
||||
@@ -120,9 +144,10 @@ Here are the rules.
|
||||
@cindex date format, ISO 8601
|
||||
For numeric months, the ISO 8601 format
|
||||
@samp{@var{year}-@var{month}-@var{day}} is allowed, where @var{year} is
|
||||
any positive number, @var{month} is a number between 1 and 12, and
|
||||
@var{day} is a number between 1 and 31. If @var{year} is less than 100,
|
||||
then 1900 is added to it to force a date in this century. The construct
|
||||
any positive number, @var{month} is a number between 01 and 12, and
|
||||
@var{day} is a number between 01 and 31. A leading zero must be present
|
||||
if a number is less than ten. If @var{year} is less than 100, then 1900
|
||||
is added to it to force a date in this century. The construct
|
||||
@samp{@var{month}/@var{day}/@var{year}}, popular in the United States,
|
||||
is accepted. Also @samp{@var{month}/@var{day}}, omitting the year.
|
||||
|
||||
|
||||
91
doc/mdate-sh
Executable file
91
doc/mdate-sh
Executable file
@@ -0,0 +1,91 @@
|
||||
#!/bin/sh
|
||||
# mdate-sh - get modification time of a file and pretty-print it
|
||||
# Copyright (C) 1995 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
|
||||
# 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.
|
||||
|
||||
# Prevent date giving response in another language.
|
||||
LANG=C
|
||||
export LANG
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
LC_TIME=C
|
||||
export LC_TIME
|
||||
|
||||
# Get the extended ls output of the file.
|
||||
if ls -L /dev/null 1>/dev/null 2>&1; then
|
||||
set - `ls -L -l $1`
|
||||
else
|
||||
set - `ls -l $1`
|
||||
fi
|
||||
# The month is at least the fourth argument.
|
||||
# (3 shifts here, the next inside the loop)
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
|
||||
# Find the month. Next argument is day, followed by the year or time.
|
||||
month=
|
||||
until test $month
|
||||
do
|
||||
shift
|
||||
case $1 in
|
||||
Jan) month=January; nummonth=1;;
|
||||
Feb) month=February; nummonth=2;;
|
||||
Mar) month=March; nummonth=3;;
|
||||
Apr) month=April; nummonth=4;;
|
||||
May) month=May; nummonth=5;;
|
||||
Jun) month=June; nummonth=6;;
|
||||
Jul) month=July; nummonth=7;;
|
||||
Aug) month=August; nummonth=8;;
|
||||
Sep) month=September; nummonth=9;;
|
||||
Oct) month=October; nummonth=10;;
|
||||
Nov) month=November; nummonth=11;;
|
||||
Dec) month=December; nummonth=12;;
|
||||
esac
|
||||
done
|
||||
|
||||
day=$2
|
||||
|
||||
# Here we have to deal with the problem that the ls output gives either
|
||||
# the time of day or the year.
|
||||
case $3 in
|
||||
*:*) set `date`; eval year=\$$#
|
||||
case $2 in
|
||||
Jan) nummonthtod=1;;
|
||||
Feb) nummonthtod=2;;
|
||||
Mar) nummonthtod=3;;
|
||||
Apr) nummonthtod=4;;
|
||||
May) nummonthtod=5;;
|
||||
Jun) nummonthtod=6;;
|
||||
Jul) nummonthtod=7;;
|
||||
Aug) nummonthtod=8;;
|
||||
Sep) nummonthtod=9;;
|
||||
Oct) nummonthtod=10;;
|
||||
Nov) nummonthtod=11;;
|
||||
Dec) nummonthtod=12;;
|
||||
esac
|
||||
# For the first six month of the year the time notation can also
|
||||
# be used for files modified in the last year.
|
||||
if (expr $nummonth \> $nummonthtod) > /dev/null;
|
||||
then
|
||||
year=`expr $year - 1`
|
||||
fi;;
|
||||
*) year=$3;;
|
||||
esac
|
||||
|
||||
# The result.
|
||||
echo $day $month $year
|
||||
@@ -217,17 +217,14 @@ og-rxw
|
||||
|
||||
@cindex copying existing permissions
|
||||
@cindex permissions, copying existing
|
||||
You can base part of a file's permissions on part of its existing
|
||||
permissions. To do this, instead of using @samp{r}, @samp{w}, or
|
||||
@samp{x} after the operator, you use the letter @samp{u}, @samp{g}, or
|
||||
@samp{o}. For example, the mode
|
||||
|
||||
You can base a file's permissions on its existing permissions. To do
|
||||
this, instead of using @samp{r}, @samp{w}, or @samp{x} after the
|
||||
operator, you use the letter @samp{u}, @samp{g}, or @samp{o}. For
|
||||
example, the mode
|
||||
@example
|
||||
o+g
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
@c FIXME describe the ls -l notation for showing permissions.
|
||||
adds the permissions for users who are in a file's group to the
|
||||
permissions that other users have for the file. Thus, if the file
|
||||
started out as mode 664 (@samp{rw-rw-r--}), the above mode would change
|
||||
|
||||
@@ -28,36 +28,39 @@
|
||||
@ifinfo
|
||||
@format
|
||||
START-INFO-DIR-ENTRY
|
||||
* Shell utilities: (sh-utils). GNU shell utilities.
|
||||
* basename: (sh-utils)basename invocation. Strip directory and suffix.
|
||||
* date: (sh-utils)date invocation. Print/set system date and time.
|
||||
* dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
|
||||
* echo: (sh-utils)echo invocation. Print a line of text.
|
||||
* env: (sh-utils)env invocation. Modify the environment.
|
||||
* expr: (sh-utils)expr invocation. Evaluate expressions.
|
||||
* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
|
||||
* groups: (sh-utils)groups invocation. Print group names a user is in.
|
||||
* hostname: (sh-utils)hostname invocation. Print or set system name.
|
||||
* id: (sh-utils)id invocation. Print real/effective uid/gid.
|
||||
* logname: (sh-utils)logname invocation. Print current login name.
|
||||
* nice: (sh-utils)nice invocation. Modify scheduling priority.
|
||||
* nohup: (sh-utils)nohup invocation. Immunize to hangups.
|
||||
* pathchk: (sh-utils)pathchk invocation. Check file name portability.
|
||||
* printenv: (sh-utils)printenv invocation. Print environment variables.
|
||||
* printf: (sh-utils)printf invocation. Format and print data.
|
||||
* pwd: (sh-utils)pwd invocation. Print working directory.
|
||||
* sleep: (sh-utils)sleep invocation. Delay for a specified time.
|
||||
* stty: (sh-utils)stty invocation. Print/change terminal settings.
|
||||
* su: (sh-utils)su invocation. Modify user and group id.
|
||||
* tee: (sh-utils)tee invocation. Redirect to multiple files.
|
||||
* test: (sh-utils)test invocation. File/string tests.
|
||||
* true: (sh-utils)true invocation. Do nothing, successfully.
|
||||
* tty: (sh-utils)tty invocation. Print terminal name.
|
||||
* uname: (sh-utils)uname invocation. Print system information.
|
||||
* users: (sh-utils)users invocation. Print current user names.
|
||||
* who: (sh-utils)who invocation. Print who is logged in.
|
||||
* whoami: (sh-utils)whoami invocation. Print effective user id.
|
||||
* yes: (sh-utils)yes invocation. Print a string indefinitely.
|
||||
* Shell utilities: (sh-utils). GNU shell utilities.
|
||||
* basename: (sh-utils)basename invocation. Strip directory and suffix.
|
||||
* chroot: (sh-utils)chroot invocation. Specify the root directory.
|
||||
* date: (sh-utils)date invocation. Print/set system date and time.
|
||||
* dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
|
||||
* echo: (sh-utils)echo invocation. Print a line of text.
|
||||
* env: (sh-utils)env invocation. Modify the environment.
|
||||
* expr: (sh-utils)expr invocation. Evaluate expressions.
|
||||
* factor: (sh-utils)factor invocation. Print prime factors
|
||||
* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
|
||||
* groups: (sh-utils)groups invocation. Print group names a user is in.
|
||||
* hostname: (sh-utils)hostname invocation. Print or set system name.
|
||||
* id: (sh-utils)id invocation. Print real/effective uid/gid.
|
||||
* logname: (sh-utils)logname invocation. Print current login name.
|
||||
* nice: (sh-utils)nice invocation. Modify scheduling priority.
|
||||
* nohup: (sh-utils)nohup invocation. Immunize to hangups.
|
||||
* pathchk: (sh-utils)pathchk invocation. Check file name portability.
|
||||
* printenv: (sh-utils)printenv invocation. Print environment variables.
|
||||
* printf: (sh-utils)printf invocation. Format and print data.
|
||||
* pwd: (sh-utils)pwd invocation. Print working directory.
|
||||
* seq: (sh-utils)seq invocation. Print numeric sequences
|
||||
* sleep: (sh-utils)sleep invocation. Delay for a specified time.
|
||||
* stty: (sh-utils)stty invocation. Print/change terminal settings.
|
||||
* su: (sh-utils)su invocation. Modify user and group id.
|
||||
* tee: (sh-utils)tee invocation. Redirect to multiple files.
|
||||
* test: (sh-utils)test invocation. File/string tests.
|
||||
* true: (sh-utils)true invocation. Do nothing, successfully.
|
||||
* tty: (sh-utils)tty invocation. Print terminal name.
|
||||
* uname: (sh-utils)uname invocation. Print system information.
|
||||
* users: (sh-utils)users invocation. Print current user names.
|
||||
* who: (sh-utils)who invocation. Print who is logged in.
|
||||
* whoami: (sh-utils)whoami invocation. Print effective user id.
|
||||
* yes: (sh-utils)yes invocation. Print a string indefinitely.
|
||||
END-INFO-DIR-ENTRY
|
||||
@end format
|
||||
@end ifinfo
|
||||
@@ -65,7 +68,7 @@ END-INFO-DIR-ENTRY
|
||||
@ifinfo
|
||||
This file documents the GNU shell utilities.
|
||||
|
||||
Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994, 95, 96 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@@ -92,12 +95,12 @@ by the Foundation.
|
||||
@titlepage
|
||||
@title GNU @code{sh-utils}
|
||||
@subtitle A set of shell utilities
|
||||
@subtitle for version @value{VERSION}, @value{RELEASEDATE}
|
||||
@subtitle for version @value{VERSION}, @value{UPDATED}
|
||||
@author David MacKenzie et al.
|
||||
|
||||
@page
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1994 Free Software Foundation, Inc.
|
||||
Copyright @copyright{} 1994, 95, 96 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@@ -126,18 +129,21 @@ This manual minimally documents version @value{VERSION} of the GNU shell
|
||||
utilities.
|
||||
|
||||
@menu
|
||||
* Introduction:: Caveats, overview, and authors.
|
||||
* Introduction:: Caveats, overview, and authors.
|
||||
* Common options:: Common options.
|
||||
* Date input formats:: Specifying date strings.
|
||||
|
||||
* Date input formats:: Specifying date strings.
|
||||
* Printing text:: echo printf yes
|
||||
* Conditions:: false true test expr
|
||||
* Redirection:: tee
|
||||
* File name manipulation:: dirname basename pathchk
|
||||
* Working context:: pwd stty printenv tty
|
||||
* Working context:: pwd stty printenv tty
|
||||
* User information:: id logname whoami groups users who
|
||||
* System context:: date uname hostname
|
||||
* Modified command invocation:: env nice nohup su
|
||||
* Modified command invocation:: chroot env nice nohup su
|
||||
* Delaying:: sleep
|
||||
* Numeric operations:: factor seq
|
||||
|
||||
* Index:: General index.
|
||||
@end menu
|
||||
@end ifinfo
|
||||
@@ -245,15 +251,13 @@ This section describes commands that display text strings.
|
||||
@cindex text, displaying
|
||||
@cindex arbitrary text, displaying
|
||||
|
||||
Synopsis:
|
||||
@code{echo} writes each given @var{string} to standard output, with a
|
||||
space between each and a newline after the last one. Synopsis:
|
||||
|
||||
@example
|
||||
echo [@var{option}]@dots{} [@var{string}]@dots{}
|
||||
@end example
|
||||
|
||||
@code{echo} writes each given @var{string} to standard output, with a
|
||||
space between each and a newline after the last one.
|
||||
|
||||
The program accepts the following options. Also see @ref{Common options}.
|
||||
|
||||
@table @samp
|
||||
@@ -298,7 +302,7 @@ a valid octal number, it is printed literally.
|
||||
@section @code{printf}: Format and print data
|
||||
|
||||
@pindex printf
|
||||
Synopsis:
|
||||
@code{printf} does formatted printing of text. Synopsis:
|
||||
|
||||
@example
|
||||
printf @var{format} [@var{argument}]@dots{}
|
||||
@@ -423,7 +427,7 @@ is also allowed: @code{test} returns true if the argument is not null.
|
||||
@menu
|
||||
* File type tests:: -[bcdfhLpSt]
|
||||
* Access permission tests:: -[gkruwxOG]
|
||||
* File characteristics tests:: -e -s -nt -ot -ef
|
||||
* File characteristics tests:: -e -s -nt -ot -ef
|
||||
* String tests:: -z -n = !=
|
||||
* Numeric tests:: -eq -ne -lt -le -gt -ge
|
||||
* Connectives for test:: ! -a -o
|
||||
@@ -599,7 +603,7 @@ True if the length of @var{string} is zero.
|
||||
@itemx @var{string}
|
||||
@opindex -n
|
||||
@cindex nonzero-length string check
|
||||
True if the length of @var{string} is non-zero.
|
||||
True if the length of @var{string} is nonzero.
|
||||
|
||||
@item @var{string1} = @var{string2}
|
||||
@opindex =
|
||||
@@ -699,9 +703,9 @@ Operands are either numbers or strings. @code{expr} coerces
|
||||
anything appearing in an operand position to an integer or a string
|
||||
depending on the operation being applied to it.
|
||||
|
||||
Strings are not quoted for @code{expr}, though you may need to quote
|
||||
them to protect characters with special meaning to the shell, e.g.,
|
||||
spaces.
|
||||
Strings are not quoted for @code{expr} itself, though you may need to
|
||||
quote them to protect characters with special meaning to the shell,
|
||||
e.g., spaces.
|
||||
|
||||
@cindex parentheses for grouping
|
||||
Operators may given as infix symbols or prefix keywords. Parentheses
|
||||
@@ -869,7 +873,7 @@ To add 1 to the shell variable @code{foo}, in Bourne-compatible shells:
|
||||
foo=`expr $foo + 1`
|
||||
@end example
|
||||
|
||||
To print the non-directory part of the file name stored in
|
||||
To print the non-directory part of the file name stored in
|
||||
@code{$fname}, which need not contain a @code{/}.
|
||||
@example
|
||||
expr $fname : '.*/\(^.*\)' '^|' $fname
|
||||
@@ -897,11 +901,11 @@ to change the input source or output destination of a command. But one
|
||||
useful redirection is performed by a separate command, not by the shell;
|
||||
it's described here.
|
||||
|
||||
|
||||
@menu
|
||||
* tee invocation:: Redirect output to multiple files.
|
||||
@end menu
|
||||
|
||||
|
||||
@node tee invocation
|
||||
@section @code{tee}: Redirect output to multiple files
|
||||
|
||||
@@ -912,9 +916,7 @@ it's described here.
|
||||
|
||||
The @code{tee} command copies standard input to standard output and also
|
||||
to any files given as arguments. This is useful when you want not only
|
||||
to send some data down a pipe, but also to save a copy.
|
||||
|
||||
Synopsis:
|
||||
to send some data down a pipe, but also to save a copy. Synopsis:
|
||||
|
||||
@example
|
||||
tee [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
@@ -969,16 +971,16 @@ This section describes commands that manipulate file names.
|
||||
@cindex file names, stripping directory and suffix
|
||||
@cindex leading directory components, stripping
|
||||
|
||||
Synopsis:
|
||||
@code{basename} removes any leading directory components from
|
||||
@var{name}. Synopsis:
|
||||
|
||||
@example
|
||||
basename @var{name} [@var{suffix}]
|
||||
@end example
|
||||
|
||||
The @code{basename} command removes any leading directory components
|
||||
from @var{name}. If @var{suffix} is specified and is identical
|
||||
to the end of @var{name}, it is removed from @var{name} as well.
|
||||
@code{basename} prints the result on standard output.
|
||||
If @var{suffix} is specified and is identical to the end of @var{name},
|
||||
it is removed from @var{name} as well. @code{basename} prints the
|
||||
result on standard output.
|
||||
|
||||
The only options are @samp{--help} and @samp{--version}. @xref{Common
|
||||
options}.
|
||||
@@ -992,15 +994,15 @@ options}.
|
||||
@cindex stripping non-directory suffix
|
||||
@cindex non-directory suffix, stripping
|
||||
|
||||
Synopsis:
|
||||
@code{dirname} prints all but the final slash-delimited component of
|
||||
a string (presumably a filename). Synopsis:
|
||||
|
||||
@example
|
||||
dirname @var{name}
|
||||
@end example
|
||||
|
||||
@code{dirname} prints all but the final slash-delimited component
|
||||
of @var{name}. If @var{name} is a single component,
|
||||
@code{dirname} prints @samp{.} (meaning the current directory).
|
||||
If @var{name} is a single component, @code{dirname} prints @samp{.}
|
||||
(meaning the current directory).
|
||||
|
||||
The only options are @samp{--help} and @samp{--version}. @xref{Common
|
||||
options}.
|
||||
@@ -1014,7 +1016,7 @@ options}.
|
||||
@cindex valid file names, checking for
|
||||
@cindex portable file names, checking for
|
||||
|
||||
Synopsis:
|
||||
@code{pathchk} checks portability of filenames. Synopsis:
|
||||
|
||||
@example
|
||||
pathchk [@var{option}]@dots{} @var{name}@dots{}
|
||||
@@ -1108,6 +1110,14 @@ The only options are a lone @samp{--help} or
|
||||
@cindex terminal settings
|
||||
@cindex line settings of terminal
|
||||
|
||||
@code{stty} prints or changes terminal characteristics, such as baud rate.
|
||||
Synopses:
|
||||
|
||||
@example
|
||||
stty [@var{setting}]@dots{}
|
||||
stty [@var{option}]
|
||||
@end example
|
||||
|
||||
If given no arguments, @code{stty} prints the baud rate, line
|
||||
discipline number (on systems that support it), and line settings
|
||||
that have been changed from the values set by @samp{stty sane}.
|
||||
@@ -1117,13 +1127,6 @@ standard input.
|
||||
@code{stty} accepts many non-option arguments that change aspects of
|
||||
the terminal line operation, as described below.
|
||||
|
||||
Synopses:
|
||||
|
||||
@example
|
||||
stty [@var{setting}]@dots{}
|
||||
stty [@var{option}]
|
||||
@end example
|
||||
|
||||
The program accepts the following options. Also see @ref{Common options}.
|
||||
|
||||
@table @samp
|
||||
@@ -1232,7 +1235,7 @@ Enable RTS/CTS flow control. Non-POSIX. May be negated.
|
||||
@item ignbrk
|
||||
@opindex ignbrk
|
||||
@cindex breaks, ignoring
|
||||
Ignore breaks. May be negated.
|
||||
Ignore break characters. May be negated.
|
||||
|
||||
@item brkint
|
||||
@opindex brkint
|
||||
@@ -1242,7 +1245,7 @@ Make breaks cause an interrupt signal. May be negated.
|
||||
@item ignpar
|
||||
@opindex ignpar
|
||||
@cindex parity, ignoring
|
||||
Ignore parity errors. May be negated.
|
||||
Ignore characters with parity errors. May be negated.
|
||||
|
||||
@item parmrk
|
||||
@opindex parmrk
|
||||
@@ -1277,7 +1280,7 @@ Translate carriage return to newline. May be negated.
|
||||
@opindex ixon
|
||||
@kindex C-s/C-q flow control
|
||||
@cindex XON/XOFF flow control
|
||||
Enable XON/XOFF flow control (that is, @key{CTRL-s}/@key{CTRL-Q}). May
|
||||
Enable XON/XOFF flow control (that is, @kbd{CTRL-S}/@kbd{CTRL-Q}). May
|
||||
be negated.
|
||||
|
||||
@item ixoff
|
||||
@@ -1591,7 +1594,7 @@ They are set with the syntax @samp{name value}, where the names are
|
||||
listed below and the value can be given either literally, in hat
|
||||
notation (@samp{^@var{c}}), or as an integer which may start with
|
||||
@samp{0x} to indicate hexadecimal, @samp{0} to indicate octal, or
|
||||
any other digit to indicate decimal.
|
||||
any other digit to indicate decimal.
|
||||
|
||||
@cindex disabling special characters
|
||||
@kindex u@r{, and disabling special characters}
|
||||
@@ -1599,7 +1602,7 @@ For GNU stty, giving a value of @code{^-} or @code{undef} disables that
|
||||
special character. (This is incompatible with Ultrix @code{stty},
|
||||
which uses a value of @samp{u} to disable a special character. GNU
|
||||
@code{stty} treats a value @samp{u} like any other, namely to set that
|
||||
special character to @key{u}.)
|
||||
special character to @key{U}.)
|
||||
|
||||
@table @samp
|
||||
|
||||
@@ -1735,7 +1738,7 @@ of: 0 50 75 110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600
|
||||
@cindex printing all or some environment variables
|
||||
@cindex environment variables, printing
|
||||
|
||||
Synopsis:
|
||||
@code{printenv} prints environment variable values. Synopsis:
|
||||
|
||||
@example
|
||||
printenv [@var{option}] [@var{variable}]@dots{}
|
||||
@@ -1765,9 +1768,8 @@ Exit status:
|
||||
@cindex print terminal file name
|
||||
@cindex terminal file name, printing
|
||||
|
||||
@code{tty} prints the file name of the tty connected to its standard
|
||||
input. It prints @samp{not a tty} if standard input is not a tty.
|
||||
|
||||
@code{tty} prints the file name of the terminal connected to its standard
|
||||
input. It prints @samp{not a tty} if standard input is not a terminal.
|
||||
Synopsis:
|
||||
|
||||
@example
|
||||
@@ -1792,8 +1794,8 @@ Print nothing; only return an exit status.
|
||||
Exit status:
|
||||
|
||||
@display
|
||||
0 if standard input is a tty
|
||||
1 if standard input is not a tty
|
||||
0 if standard input is a terminal
|
||||
1 if standard input is not a terminal
|
||||
2 if given incorrect arguments
|
||||
3 if a write error occurs
|
||||
@end display
|
||||
@@ -1826,10 +1828,8 @@ logins, groups, and so forth.
|
||||
@cindex effective uid and gid, printing
|
||||
@cindex printing real and effective uid and gid
|
||||
|
||||
@noindent @code{id} prints information about the given user, or the process
|
||||
running it if no user is specified.
|
||||
|
||||
Synopsis:
|
||||
@code{id} prints information about the given user, or the process
|
||||
running it if no user is specified. Synopsis:
|
||||
|
||||
@example
|
||||
id [@var{option}]@dots{} [@var{username}]
|
||||
@@ -1923,11 +1923,9 @@ options}.
|
||||
@cindex supplementary groups, printing
|
||||
|
||||
@code{groups} prints the names of the primary and any supplementary
|
||||
groups that each given @var{username}, or the current process if none
|
||||
are given, is in. If user names are given, the name of each user is
|
||||
printed before the list of that user's groups.
|
||||
|
||||
Synopsis:
|
||||
groups for each given @var{username}, or the current process if no names
|
||||
are given. If names are given, the name of each user is printed before
|
||||
the list of that user's groups. Synopsis:
|
||||
|
||||
@example
|
||||
groups [@var{username}]@dots{}
|
||||
@@ -1951,9 +1949,7 @@ options}.
|
||||
names of users currently logged in to the current host. Each user name
|
||||
corresponds to a login session, so if a user has more than one login
|
||||
session, that user's name will appear the same number of times in the
|
||||
output.
|
||||
|
||||
Synopsis:
|
||||
output. Synopsis:
|
||||
|
||||
@example
|
||||
users [@var{file}]
|
||||
@@ -1976,6 +1972,7 @@ options}.
|
||||
@cindex printing current user information
|
||||
@cindex information, about current users
|
||||
|
||||
@code{who} prints information about users who are currently logged on.
|
||||
Synopsis:
|
||||
|
||||
@example
|
||||
@@ -2085,10 +2082,8 @@ information.
|
||||
@cindex time, printing or setting
|
||||
@cindex printing the current time
|
||||
|
||||
@code{date} with no arguments prints the current time and date, in
|
||||
the format of the @samp{%c} directive (described below).
|
||||
|
||||
Synopses:
|
||||
@code{date} with no arguments prints the current time and date, in the
|
||||
format of the @samp{%c} directive (described below). Synopses:
|
||||
|
||||
@example
|
||||
date [@var{option}]@dots{} [+@var{format}]
|
||||
@@ -2107,10 +2102,10 @@ directives, which start with @samp{%}, characters in the format string
|
||||
are printed unchanged. The directives are described below.
|
||||
|
||||
@menu
|
||||
* Time directives:: %[HIklMprsSTXZ]
|
||||
* Time directives:: %[HIklMprsSTXzZ]
|
||||
* Date directives:: %[aAbBcdDhjmUwWxyY]
|
||||
* Literal directives:: %[%nt]
|
||||
* Padding:: Pad with zeroes, spaces (%_), or nothing (%-).
|
||||
* Padding:: Pad with zeroes, spaces (%_), or nothing (%-).
|
||||
* Setting the time:: Changing the system clock.
|
||||
* Options for date:: Instead of the current time.
|
||||
* Examples of date:: Examples.
|
||||
@@ -2144,16 +2139,25 @@ time, 12-hour (hh:mm:ss [AP]M)
|
||||
@cindex seconds since the epoch
|
||||
@cindex beginning of time
|
||||
seconds since the epoch, i.e., 1 January 1970 00:00:00 UTC (a
|
||||
GNU extension)
|
||||
GNU extension).
|
||||
Note that this value is the number of seconds between the epoch
|
||||
and the current date as defined by the localtime system call.
|
||||
It isn't changed by the @samp{--date} option.
|
||||
@item %S
|
||||
second (00@dots{}61)
|
||||
@item %T
|
||||
time, 24-hour (hh:mm:ss)
|
||||
@item %X
|
||||
locale's time representation (%H:%M:%S)
|
||||
@item %z
|
||||
RFC-822 style numeric time zone (e.g., -0600 or +0100), or nothing if no
|
||||
time zone is determinable. This value reflects the @emph{current} time
|
||||
zone. It isn't changed by the @samp{--date} option.
|
||||
@item %Z
|
||||
timezone (e.g., EDT), or nothing if no timezone is
|
||||
determinable
|
||||
time zone (e.g., EDT), or nothing if no timezone is
|
||||
determinable.
|
||||
Note that this value reflects the @emph{current} time zone.
|
||||
It isn't changed by the @samp{--date} option.
|
||||
@end table
|
||||
|
||||
|
||||
@@ -2187,11 +2191,19 @@ day of year (001@dots{}366)
|
||||
@item %m
|
||||
month (01@dots{}12)
|
||||
@item %U
|
||||
week number of year with Sunday as first day of week (00@dots{}53)
|
||||
week number of year with Sunday as first day of week (00@dots{}53).
|
||||
Days in a new year preceding the first Sunday are in week zero.
|
||||
@item %V
|
||||
week number of year with Monday as first day of the week as a decimal
|
||||
(01@dots{}53). If the week containing January 1 has four or more days in
|
||||
the new year, then it is considered week 1; otherwise, it is week 53 of
|
||||
the previous year, and the next week is week 1. (See the ISO 8601: 1988
|
||||
standard.)
|
||||
@item %w
|
||||
day of week (0@dots{}6) with 0 corresponding to Sunday
|
||||
@item %W
|
||||
week number of year with Monday as first day of week (00@dots{}53)
|
||||
week number of year with Monday as first day of week (00@dots{}53).
|
||||
Days in a new year preceding the first Monday are in week zero.
|
||||
@item %x
|
||||
locale's date representation (mm/dd/yy)
|
||||
@item %y
|
||||
@@ -2330,6 +2342,20 @@ input. This is useful when you have many dates to process, because the
|
||||
system overhead of starting up the @code{date} executable many times can
|
||||
be considerable.
|
||||
|
||||
@itemx --rfc-822
|
||||
@opindex -R
|
||||
@opindex --rfc-822
|
||||
Display the time and date using the RFC-822-specified
|
||||
format, @samp{%a, %_d %b %Y %H:%M:%S %z}.
|
||||
If @samp{--utc} is also specified, use @samp{GMT} in place of @samp{%z}.
|
||||
|
||||
@item -r @var{file}
|
||||
@itemx --reference=@var{file}
|
||||
@opindex -r
|
||||
@opindex --reference
|
||||
Display the time and date reference according to the last modification
|
||||
time of @var{file}, instead of the current time and date.
|
||||
|
||||
@item -s @var{datestr}
|
||||
@itemx --set=@var{datestr}
|
||||
@opindex -s
|
||||
@@ -2410,6 +2436,14 @@ To set the system clock forward by two minutes:
|
||||
date --set='+2 minutes'
|
||||
@end example
|
||||
|
||||
@item
|
||||
To print the date in the format specified by RFC-822,
|
||||
use @samp{date --rfc}. I just did and saw this:
|
||||
|
||||
@example
|
||||
Mon, 25 Mar 1996 23:34:17 -0600
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
|
||||
@@ -2422,9 +2456,7 @@ date --set='+2 minutes'
|
||||
|
||||
@code{uname} prints information about the machine and operating system
|
||||
it is run on. If no options are given, @code{uname} acts as if the
|
||||
@code{-s} option were given.
|
||||
|
||||
Synopsis:
|
||||
@code{-s} option were given. Synopsis:
|
||||
|
||||
@example
|
||||
uname [@var{option}]@dots{}
|
||||
@@ -2509,9 +2541,7 @@ Print the operating system version.
|
||||
With no arguments, @code{hostname} prints the name of the current host
|
||||
system. With one argument, it sets the current host name to the
|
||||
specified string. You must have appropriate privileges to set the host
|
||||
name.
|
||||
|
||||
Synopsis:
|
||||
name. Synopsis:
|
||||
|
||||
@example
|
||||
hostname [@var{name}]
|
||||
@@ -2533,6 +2563,7 @@ different than the current one: a modified environment, as a different
|
||||
user, etc.
|
||||
|
||||
@menu
|
||||
* chroot invocation:: Modify the root directory.
|
||||
* env invocation:: Modify environment variables.
|
||||
* nice invocation:: Modify scheduling priority.
|
||||
* nohup invocation:: Immunize to hangups.
|
||||
@@ -2540,17 +2571,42 @@ user, etc.
|
||||
@end menu
|
||||
|
||||
|
||||
@node chroot invocation
|
||||
@section @code{chroot}: Run a command with a different root directory
|
||||
|
||||
@pindex chroot
|
||||
@cindex running a program in a specified root directory
|
||||
@cindex root directory, running a program in a specified
|
||||
|
||||
@code{chroot} runs a command with a specified root directory.
|
||||
On many systems, only the super-user can do this.
|
||||
Synopses:
|
||||
|
||||
@example
|
||||
chroot @var{newroot} [@var{command} [@var{args}]@dots{}]
|
||||
chroot @var{option}
|
||||
@end example
|
||||
|
||||
Ordinarily, filenames are looked up starting at the root of the
|
||||
directory structure, i.e., @file{/}. @code{chroot} changes the root to
|
||||
the directory @var{newroot} (which must exist) and then runs
|
||||
@var{command} with optional @var{args}. If @var{command} is not
|
||||
specified, the default is the value of the @code{SHELL} environment
|
||||
variable or @code{/bin/sh} if not set, invoked with the @samp{-i} option.
|
||||
|
||||
The only options are @samp{--help} and @samp{--version}. @xref{Common
|
||||
options}.
|
||||
|
||||
|
||||
@node env invocation
|
||||
@section @code{env}: Run a command in a modified environment
|
||||
|
||||
@pindex env
|
||||
@cindex environment, running a program in a modified
|
||||
@cindex modified environment, running a program in
|
||||
@cindex modified environment, running a program in a
|
||||
@cindex running a program in a modified environment
|
||||
|
||||
@code{env} runs a command with an environment modified as specified
|
||||
by the command line arguments.
|
||||
|
||||
Synopses:
|
||||
@code{env} runs a command with a modified environment. Synopses:
|
||||
|
||||
@example
|
||||
env [@var{option}]@dots{} [@var{name}=@var{value}]@dots{} @c
|
||||
@@ -2605,6 +2661,13 @@ Start with an empty environment, ignoring the inherited environment.
|
||||
@cindex priority, modifying
|
||||
@cindex appropriate privileges
|
||||
|
||||
@code{nice} prints or modifies the scheduling priority of a job.
|
||||
Synopsis:
|
||||
|
||||
@example
|
||||
nice [@var{option}]@dots{} [@var{command} [@var{arg}]@dots{}]
|
||||
@end example
|
||||
|
||||
If no arguments are given, @code{nice} prints the current scheduling
|
||||
priority, which it inherited. Otherwise, @code{nice} runs the given
|
||||
@var{command} with its scheduling priority adjusted. If no
|
||||
@@ -2613,12 +2676,6 @@ priority, which it inherited. Otherwise, @code{nice} runs the given
|
||||
adjustment. The priority can be adjusted by @code{nice} over the range
|
||||
of -20 (the highest priority) to 19 (the lowest).
|
||||
|
||||
Synopsis:
|
||||
|
||||
@example
|
||||
nice [@var{option}]@dots{} [@var{command} [@var{arg}]@dots{}]
|
||||
@end example
|
||||
|
||||
@cindex conflicts with shell built-ins
|
||||
@cindex built-in shell commands, conflicts with
|
||||
Because most shells have a built-in command by the same name, using the
|
||||
@@ -2644,24 +2701,24 @@ Add @var{adjustment} instead of 10 to the command's priority.
|
||||
@pindex nohup
|
||||
@cindex hangups, immunity to
|
||||
@cindex immunity to hangups
|
||||
@cindex logging out and continuing to run
|
||||
|
||||
@flindex nohup.out
|
||||
@code{nohup} runs the given @var{command} with hangup signals ignored,
|
||||
so that the command can continue running in the background after you log
|
||||
out.
|
||||
|
||||
Synopsis:
|
||||
out. Synopsis:
|
||||
|
||||
@example
|
||||
nohup @var{command} [@var{arg}]@dots{}
|
||||
@end example
|
||||
|
||||
@flindex nohup.out
|
||||
Also, the scheduling priority is increased by 5. If standard output is a
|
||||
tty, it and standard error are redirected so that they are appended to
|
||||
the file @file{nohup.out}; if that cannot be written to, they are
|
||||
appended to the file @file{$HOME/nohup.out}. If that cannot be written
|
||||
to, the command is not run.
|
||||
@code{nohup} increases the scheduling priority of @var{command} by 5, so
|
||||
it has a slightly smaller change to run. If standard output is a terminal,
|
||||
it and standard error are redirected so that they are appended to the
|
||||
file @file{nohup.out}; if that cannot be written to, they are appended
|
||||
to the file @file{$HOME/nohup.out}. If that cannot be written to, the
|
||||
command is not run.
|
||||
|
||||
If @code{nohup} creates either @file{nohup.out} or
|
||||
@file{$HOME/nohup.out}, it creates it with no ``group'' or ``other''
|
||||
@@ -2687,9 +2744,7 @@ options}.
|
||||
|
||||
@code{su} allows one user to temporarily become another user. It runs a
|
||||
command (often an interactive shell) with the real and effective user
|
||||
id, group id, and supplemental groups of a given @var{user}.
|
||||
|
||||
Synopsis:
|
||||
id, group id, and supplemental groups of a given @var{user}. Synopsis:
|
||||
|
||||
@example
|
||||
su [@var{option}]@dots{} [@var{user} [@var{arg}]@dots{}]
|
||||
@@ -2831,7 +2886,7 @@ might find this idea strange at first.
|
||||
@cindex delaying commands
|
||||
@cindex commands for delaying
|
||||
|
||||
Perhaps @code{wait} or other commands should be described here also?
|
||||
@c Perhaps @code{wait} or other commands should be described here also?
|
||||
|
||||
@menu
|
||||
* sleep invocation:: Delay for a specified time.
|
||||
@@ -2846,7 +2901,6 @@ Perhaps @code{wait} or other commands should be described here also?
|
||||
|
||||
@code{sleep} pauses for an amount of time specified by the sum of
|
||||
the values of the command line arguments.
|
||||
|
||||
Synopsis:
|
||||
|
||||
@example
|
||||
@@ -2872,6 +2926,82 @@ The only options are @samp{--help} and @samp{--version}. @xref{Common
|
||||
options}.
|
||||
|
||||
|
||||
@node Numeric operations
|
||||
@chapter Numeric operations
|
||||
|
||||
@cindex numeric operations
|
||||
These programs do numerically-related operations.
|
||||
|
||||
@menu
|
||||
* factor invocation:: Show factors of numbers.
|
||||
* seq invocation:: Print sequences of numbers.
|
||||
@end menu
|
||||
|
||||
|
||||
@node factor invocation
|
||||
@section @code{factor}: Print prime factors
|
||||
|
||||
@pindex factor
|
||||
@cindex prime factors
|
||||
|
||||
@code{factor} prints prime factors. Synopses:
|
||||
|
||||
@example
|
||||
factor [@var{number}]@dots{}
|
||||
factor @var{option}
|
||||
@end example
|
||||
|
||||
If no @var{number} is specified on the command line, @code{factor} reads
|
||||
numbers from standard input, delimited by newlines, tabs, or spaces.
|
||||
|
||||
The only options are @samp{--help} and @samp{--version}. @xref{Common
|
||||
options}.
|
||||
|
||||
|
||||
@node seq invocation
|
||||
@section @code{seq}: Print numeric sequences
|
||||
|
||||
@pindex seq
|
||||
@cindex numeric sequences
|
||||
@cindex sequence of numbers
|
||||
|
||||
@code{seq} prints a sequence of numbers to standard output. Synopses:
|
||||
|
||||
@example
|
||||
seq [@var{option}]@dots{} [@var{first} [@var{step}]] @var{last}@dots{}
|
||||
@end example
|
||||
|
||||
@code{seq} prints the numbers from @var{first} to @var{last} by
|
||||
@var{step}. By default, @var{first} and @var{step} are both 1, and each
|
||||
number is printed on its own line. All numbers can be reals, not just
|
||||
integers.
|
||||
|
||||
The program accepts the following options. Also see @ref{Common options}.
|
||||
|
||||
@table @samp
|
||||
@item -f @var{format}
|
||||
@itemx --format=@var{format}
|
||||
@opindex -f @var{format}
|
||||
@opindex --format=@var{format}
|
||||
@cindex formatting of numbers in @code{seq}
|
||||
Print all numbers using @var{format}; default @samp{%g}.
|
||||
@var{format} must contain exactly one of the standarding float output
|
||||
formats @samp{%e}, @samp{%f}, or @samp{%g}.
|
||||
|
||||
@item -s @var{string}
|
||||
@itemx --separator=@var{string}
|
||||
@cindex separator for numbers in @code{seq}
|
||||
Separate numbers with @var{string}; default is a newline.
|
||||
The output always terminates with a newline.
|
||||
|
||||
@item -w
|
||||
@itemx --equal-width
|
||||
Print all numbers with the same width, by padding with leading zeroes.
|
||||
(To have other kinds of padding, use @samp{--format}).
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@node Index
|
||||
@unnumbered Index
|
||||
|
||||
|
||||
770
doc/texinfo.tex
770
doc/texinfo.tex
File diff suppressed because it is too large
Load Diff
@@ -26,31 +26,31 @@
|
||||
@ifinfo
|
||||
@format
|
||||
START-INFO-DIR-ENTRY
|
||||
* Text utilities: (textutils). GNU text utilities.
|
||||
* cat: (textutils)cat invocation. Concatenate and write files.
|
||||
* cksum: (textutils)cksum invocation. Print POSIX CRC checksum.
|
||||
* comm: (textutils)comm invocation. Compare sorted files by line.
|
||||
* csplit: (textutils)csplit invocation. Split by context.
|
||||
* cut: (textutils)cut invocation. Print selected parts of lines.
|
||||
* expand: (textutils)expand invocation. Convert tabs to spaces.
|
||||
* fmt: (textutils)fmt invocation. Reformat paragraph text.
|
||||
* fold: (textutils)fold invocation. Wrap long input lines.
|
||||
* head: (textutils)head invocation. Output the first part of files.
|
||||
* join: (textutils)join invocation. Join lines on a common field.
|
||||
* md5sum: (textutils)md5sum invocation. Print or check message-digests.
|
||||
* nl: (textutils)nl invocation. Number lines and write files.
|
||||
* od: (textutils)od invocation. Dump files in octal, etc.
|
||||
* paste: (textutils)paste invocation. Merge lines of files.
|
||||
* pr: (textutils)pr invocation. Paginate or columnate files.
|
||||
* sort: (textutils)sort invocation. Sort text files.
|
||||
* split: (textutils)split invocation. Split into fixed-size pieces.
|
||||
* sum: (textutils)sum invocation. Print traditional checksum.
|
||||
* tac: (textutils)tac invocation. Reverse files.
|
||||
* tail: (textutils)tail invocation. Output the last part of files.
|
||||
* tr: (textutils)tr invocation. Translate characters.
|
||||
* unexpand: (textutils)unexpand invocation. Convert spaces to tabs.
|
||||
* uniq: (textutils)uniq invocation. Uniqify files.
|
||||
* wc: (textutils)wc invocation. Byte, word, and line counts.
|
||||
* Text utilities: (textutils). GNU text utilities.
|
||||
* cat: (textutils)cat invocation. Concatenate and write files.
|
||||
* cksum: (textutils)cksum invocation. Print @sc{POSIX} CRC checksum.
|
||||
* comm: (textutils)comm invocation. Compare sorted files by line.
|
||||
* csplit: (textutils)csplit invocation. Split by context.
|
||||
* cut: (textutils)cut invocation. Print selected parts of lines.
|
||||
* expand: (textutils)expand invocation. Convert tabs to spaces.
|
||||
* fmt: (textutils)fmt invocation. Reformat paragraph text.
|
||||
* fold: (textutils)fold invocation. Wrap long input lines.
|
||||
* head: (textutils)head invocation. Output the first part of files.
|
||||
* join: (textutils)join invocation. Join lines on a common field.
|
||||
* md5sum: (textutils)md5sum invocation. Print or check message-digests.
|
||||
* nl: (textutils)nl invocation. Number lines and write files.
|
||||
* od: (textutils)od invocation. Dump files in octal, etc.
|
||||
* paste: (textutils)paste invocation. Merge lines of files.
|
||||
* pr: (textutils)pr invocation. Paginate or columnate files.
|
||||
* sort: (textutils)sort invocation. Sort text files.
|
||||
* split: (textutils)split invocation. Split into fixed-size pieces.
|
||||
* sum: (textutils)sum invocation. Print traditional checksum.
|
||||
* tac: (textutils)tac invocation. Reverse files.
|
||||
* tail: (textutils)tail invocation. Output the last part of files.
|
||||
* tr: (textutils)tr invocation. Translate characters.
|
||||
* unexpand: (textutils)unexpand invocation. Convert spaces to tabs.
|
||||
* uniq: (textutils)uniq invocation. Uniqify files.
|
||||
* wc: (textutils)wc invocation. Byte, word, and line counts.
|
||||
END-INFO-DIR-ENTRY
|
||||
@end format
|
||||
@end ifinfo
|
||||
@@ -58,7 +58,7 @@ END-INFO-DIR-ENTRY
|
||||
@ifinfo
|
||||
This file documents the GNU text utilities.
|
||||
|
||||
Copyright (C) 1994, 95 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994, 95, 96 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@@ -85,12 +85,12 @@ by the Foundation.
|
||||
@titlepage
|
||||
@title GNU @code{textutils}
|
||||
@subtitle A set of text utilities
|
||||
@subtitle for version @value{VERSION}, @value{RELEASEDATE}
|
||||
@subtitle for version @value{VERSION}, @value{UPDATED}
|
||||
@author David MacKenzie et al.
|
||||
|
||||
@page
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1994, 95 Free Software Foundation, Inc.
|
||||
Copyright @copyright{} 1994, 95, 96 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@@ -145,7 +145,7 @@ involved in improving this manual. The entire GNU community will
|
||||
benefit.
|
||||
|
||||
@cindex POSIX.2
|
||||
The GNU text utilities are mostly compatible with the POSIX.2 standard.
|
||||
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.
|
||||
@@ -478,9 +478,9 @@ Separate the line number from the text line in the output with
|
||||
@var{string} (default is @key{TAB}).
|
||||
|
||||
@item -v @var{number}
|
||||
@itemx --first-page=@var{number}
|
||||
@itemx --starting-line-number=@var{number}
|
||||
@opindex -v
|
||||
@opindex --first-page
|
||||
@opindex --starting-line-number
|
||||
Set the initial line number on each logical page to @var{number} (default 1).
|
||||
|
||||
@item -w @var{number}
|
||||
@@ -650,8 +650,8 @@ is not given at all, the default is 16.
|
||||
|
||||
@end table
|
||||
|
||||
The next several options map the old, pre-POSIX format specification
|
||||
options to the corresponding POSIX format specs. GNU @code{od} accepts
|
||||
The next several options map the old, pre-@sc{POSIX} format specification
|
||||
options to the corresponding @sc{POSIX} format specs. GNU @code{od} accepts
|
||||
any combination of old- and new-style options. Format specification
|
||||
options accumulate.
|
||||
|
||||
@@ -733,7 +733,7 @@ address.
|
||||
These commands reformat the contents of files.
|
||||
|
||||
@menu
|
||||
* fmt invocation:: Reformat paragraph text.
|
||||
* fmt invocation:: Reformat paragraph text.
|
||||
* pr invocation:: Paginate or columnate files for printing.
|
||||
* fold invocation:: Wrap input lines to fit in specified width.
|
||||
@end menu
|
||||
@@ -827,7 +827,7 @@ room to balance line lengths.
|
||||
@item -p @var{prefix}
|
||||
@itemx --prefix=@var{prefix}
|
||||
Only lines beginning with @var{prefix} (possibly preceded by whitespace)
|
||||
are subject to formatting. The prefix and any preceding whitespace is
|
||||
are subject to formatting. The prefix and any preceding whitespace are
|
||||
stripped for the formatting and then re-attached to each formatted output
|
||||
line. One use is to format certain kinds of program comments, while
|
||||
leaving the code unchanged.
|
||||
@@ -1054,7 +1054,7 @@ head [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
head -@var{number} [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
@end example
|
||||
|
||||
If more than one @var{file} is specicified, @code{head} prints a
|
||||
If more than one @var{file} is specified, @code{head} prints a
|
||||
one-line header consisting of
|
||||
@example
|
||||
==> @var{file name} <==
|
||||
@@ -1259,6 +1259,10 @@ 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}
|
||||
@opindex --verbose
|
||||
Write a diagnostic to standard error just before each output file is opened.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@@ -1312,7 +1316,7 @@ file, so that section of the input file is effectively ignored.
|
||||
Repeat the previous pattern @var{repeat-count} additional
|
||||
times. @var{repeat-count} can either be a positive integer or an
|
||||
asterisk, meaning repeat as many times as necessary until the input is
|
||||
exausted.
|
||||
exhausted.
|
||||
|
||||
@end table
|
||||
|
||||
@@ -1403,7 +1407,7 @@ contents of files.
|
||||
* wc invocation:: Print byte, word, and line counts.
|
||||
* sum invocation:: Print checksum and block counts.
|
||||
* cksum invocation:: Print CRC checksum and byte counts.
|
||||
* md5sum invocation:: Print or check message-digests.
|
||||
* md5sum invocation:: Print or check message-digests.
|
||||
@end menu
|
||||
|
||||
|
||||
@@ -1535,13 +1539,13 @@ cksum [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
@code{cksum} prints the CRC checksum for each file along with the number
|
||||
of bytes in the file, and the filename unless no arguments were given.
|
||||
|
||||
@code{cksum} is typically used to ensure that files have been
|
||||
@code{cksum} is typically used to ensure that files
|
||||
transferred by unreliable means (e.g., netnews) have not been corrupted,
|
||||
by comparing the @code{cksum} output for the received files with the
|
||||
@code{cksum} output for the original files (typically given in the
|
||||
distribution).
|
||||
|
||||
The CRC algorithm is specified by the POSIX.2 standard. It is not
|
||||
The CRC algorithm is specified by the @sc{POSIX.2} standard. It is not
|
||||
compatible with the BSD or System V @code{sum} algorithms (see the
|
||||
previous section); it is more robust.
|
||||
|
||||
@@ -1568,7 +1572,6 @@ consistent. Synopsis:
|
||||
@example
|
||||
md5sum [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
md5sum [@var{option}]@dots{} --check [@var{file}]
|
||||
md5sum [@var{option}]@dots{} --string=@var{string} @dots{}
|
||||
@end example
|
||||
|
||||
For each @var{file}, @samp{md5sum} outputs the MD5 checksum, a flag
|
||||
@@ -1603,13 +1606,27 @@ For each such line, @code{md5sum} reads the named file and computes its
|
||||
MD5 checksum. Then, if the computed message digest does not match the
|
||||
one on the line with the filename, the file is noted as having
|
||||
failed the test. Otherwise, the file passes the test.
|
||||
By default, for each valid line, one line is written to standard
|
||||
output indicating whether the named file passed the test.
|
||||
After all checks have been performed, if there were any failures,
|
||||
a warning is issued to standard error.
|
||||
Use the @samp{--status} option to inhibit that output.
|
||||
If any listed file cannot be opened or read, if any valid line has
|
||||
an MD5 checksum inconsistent with the associated file, or if no valid
|
||||
line is found, @code{md5sum} exits with nonzero status. Otherwise,
|
||||
it exits successfully.
|
||||
|
||||
@item -s
|
||||
@itemx --string=@var{string}
|
||||
@opindex -s
|
||||
@opindex --string
|
||||
Compute the message digest for @var{string}, instead of for a file. The
|
||||
result is the same as for a file that contains exactly @var{string}.
|
||||
@itemx --status
|
||||
@opindex --status
|
||||
@cindex verifying MD5 checksums
|
||||
This option is useful only when verifying checksums.
|
||||
When verifying checksums, don't generate the default one-line-per-file
|
||||
diagnostic and don't output the warning summarizing any failures.
|
||||
Failures to open or read a file still evoke individual diagnostics to
|
||||
standard error.
|
||||
If all listed files are readable and are consistent with the associated
|
||||
MD5 checksums, exit successfully. Otherwise exit with a status code
|
||||
indicating there was a failure.
|
||||
|
||||
@item -t
|
||||
@itemx --text
|
||||
@@ -1619,11 +1636,14 @@ result is the same as for a file that contains exactly @var{string}.
|
||||
Treat all input files as text files. This is the reverse of
|
||||
@samp{--binary}.
|
||||
|
||||
@item -v
|
||||
@itemx --verbose
|
||||
@opindex -v
|
||||
@opindex --verbose
|
||||
Print progress information.
|
||||
@item -w
|
||||
@itemx --warn
|
||||
@opindex -w
|
||||
@opindex --warn
|
||||
@cindex verifying MD5 checksums
|
||||
When verifying checksums, warn about improperly formated MD5 checksum lines.
|
||||
This option is useful only if all but a few lines in the checked input
|
||||
are valid.
|
||||
|
||||
@end table
|
||||
|
||||
@@ -1669,6 +1689,7 @@ mode:
|
||||
@cindex checking for sortedness
|
||||
Check whether the given files are already sorted: if they are not all
|
||||
sorted, print an error message and exit with a status of 1.
|
||||
Otherwise, exit successfully.
|
||||
|
||||
@item -m
|
||||
@opindex -m
|
||||
@@ -1702,6 +1723,8 @@ input line length or restrictions on bytes allowed within lines. In
|
||||
addition, if the final byte of an input file is not a newline, GNU
|
||||
@code{sort} silently supplies one.
|
||||
|
||||
Upon any error, @code{sort} exits with a status of @samp{2}.
|
||||
|
||||
@vindex TMPDIR
|
||||
If the environment variable @code{TMPDIR} is set, @code{sort} uses its
|
||||
value as the directory for temporary files instead of @file{/tmp}. The
|
||||
@@ -1734,6 +1757,18 @@ letters, digits and blanks when sorting.
|
||||
Fold lowercase characters into the equivalent uppercase characters when
|
||||
sorting so that, for example, @samp{b} and @samp{B} sort as equal.
|
||||
|
||||
@item -g
|
||||
@opindex -g
|
||||
@cindex general numeric sort
|
||||
Sort numerically, but use strtod(3) to arrive at the numeric values.
|
||||
This allows floating point numbers to be specified in scientific notation,
|
||||
like @code{1.0e-34} and @code{10e100}. Use this option only if there
|
||||
is no alternative; it is much slower than @samp{-n} and numbers with
|
||||
too many significant digits will be compared as if they had been
|
||||
truncated. In addition, numbers outside the range of representable
|
||||
double precision floating point numbers are treated as if they were
|
||||
zeroes; overflow and underflow are not reported.
|
||||
|
||||
@item -i
|
||||
@opindex -i
|
||||
@cindex unprintable characters, ignoring
|
||||
@@ -1755,6 +1790,21 @@ Sort numerically: the number begins each line; specifically, it consists
|
||||
of optional whitespace, an optional @samp{-} sign, and zero or more
|
||||
digits, optionally followed by a decimal point and zero or more digits.
|
||||
|
||||
@code{sort -n} uses what might be considered an unconventional method
|
||||
to compare strings representing floating point numbers. Rather than
|
||||
first converting each string to the C @code{double} type and then
|
||||
comparing those values, sort aligns the decimal points in the two
|
||||
strings and compares the strings a character at a time. One benefit
|
||||
of using this approach is its speed. In practice this is much more
|
||||
efficient than performing the two corresponding string-to-double (or even
|
||||
string-to-integer) conversions and then comparing doubles. In addition,
|
||||
there is no corresponding loss of precision. Converting each string to
|
||||
@code{double} before comparison would limit precision to about 16 digits
|
||||
on most systems.
|
||||
|
||||
Neither a leading @samp{+} nor exponential notation is recognized.
|
||||
To compare such strings numerically, use the @samp{-g} option.
|
||||
|
||||
@item -r
|
||||
@opindex -r
|
||||
@cindex reverse sorting
|
||||
@@ -1796,11 +1846,21 @@ check that no pair of consecutive lines compares equal.
|
||||
@item -k @var{pos1}[,@var{pos2}]
|
||||
@opindex -k
|
||||
@cindex sort field
|
||||
The recommended, POSIX, option for specifying a sort field. The field
|
||||
The recommended, @sc{POSIX}, option for specifying a sort field. The field
|
||||
consists of the line between @var{pos1} and @var{pos2} (or the end of
|
||||
the line, if @var{pos2} is omitted), inclusive. Fields and character
|
||||
positions are numbered starting with 1. See below.
|
||||
|
||||
@item -z
|
||||
@opindex -z
|
||||
@cindex sort zero-terminated lines
|
||||
Treat the input as a set of lines, each terminated by a zero byte (@sc{ASCII}
|
||||
@sc{NUL} (Null) character) instead of a @sc{ASCII} @sc{LF} (Line Feed.)
|
||||
This option can be useful in conjunction with @samp{perl -0} or
|
||||
@samp{find -print0} and @samp{xargs -0} which do the same in order to
|
||||
reliably handle arbitrary pathnames (even those which contain Line Feed
|
||||
characters.)
|
||||
|
||||
@item +@var{pos1}[-@var{pos2}]
|
||||
The obsolete, traditional option for specifying a sort field. The field
|
||||
consists of the line between @var{pos1} and up to but @emph{not including}
|
||||
@@ -1815,9 +1875,9 @@ options}.
|
||||
|
||||
Historical (BSD and System V) implementations of @code{sort} have
|
||||
differed in their interpretation of some options, particularly
|
||||
@samp{-b}, @samp{-f}, and @samp{-n}. GNU sort follows the POSIX
|
||||
@samp{-b}, @samp{-f}, and @samp{-n}. GNU sort follows the @sc{POSIX}
|
||||
behavior, which is usually (but not always!) like the System V behavior.
|
||||
According to POSIX, @samp{-n} no longer implies @samp{-b}. For
|
||||
According to @sc{POSIX}, @samp{-n} no longer implies @samp{-b}. For
|
||||
consistency, @samp{-M} has been changed in the same way. This may
|
||||
affect the meaning of character positions in field specifications in
|
||||
obscure cases. The only fix is to add an explicit @samp{-b}.
|
||||
@@ -1838,14 +1898,11 @@ appended to it, in which case the global ordering options are not used
|
||||
for that particular field. The @samp{-b} option may be independently
|
||||
attached to either or both of the @samp{+@var{pos}} and
|
||||
@samp{-@var{pos}} parts of a field specification, and if it is inherited
|
||||
from the global options it will be attached to both. If a @samp{-n} or
|
||||
@samp{-M} option is used, thus implying a @samp{-b} option, the
|
||||
@samp{-b} option is taken to apply to both the @samp{+@var{pos}} and the
|
||||
@samp{-@var{pos}} parts of a key specification. Keys may span multiple
|
||||
fields.
|
||||
from the global options it will be attached to both.
|
||||
Keys may span multiple fields.
|
||||
|
||||
Here are some examples to illustrate various combinations of options.
|
||||
In them, the POSIX @samp{-k} option is used to specify sort keys rather
|
||||
In them, the @sc{POSIX} @samp{-k} option is used to specify sort keys rather
|
||||
than the obsolete @samp{+@var{pos1}-@var{pos2}} syntax.
|
||||
|
||||
@itemize @bullet
|
||||
@@ -1902,6 +1959,16 @@ An alternative is to use the global numeric modifier @samp{-n}.
|
||||
sort -t : -n -k 5b,5 -k 3,3 /etc/passwd
|
||||
@end example
|
||||
|
||||
@item
|
||||
Generate a tags file in case insensitive sorted order.
|
||||
@example
|
||||
find src -type f -print0 | sort -t / -z -f | xargs -0 etags --append
|
||||
@end example
|
||||
|
||||
The use of @samp{-print0}, @samp{-z}, and @samp{-0} in this case mean
|
||||
that pathnames that contain Line Feed characters will not get broken up
|
||||
by the sort operation.
|
||||
|
||||
Finally, to ignore both leading and trailing white space, you
|
||||
could have applied the @samp{b} modifier to the field-end specifier
|
||||
for the first key,
|
||||
@@ -1974,6 +2041,12 @@ the field and character skipping options, fields are skipped over first.
|
||||
@opindex --count
|
||||
Print the number of times each line occurred along with the line.
|
||||
|
||||
@item -i
|
||||
@itemx --ignore-case
|
||||
@opindex -i
|
||||
@opindex --ignore-case
|
||||
Ignore differences in case when comparing lines.
|
||||
|
||||
@item -d
|
||||
@itemx --repeated
|
||||
@opindex -d
|
||||
@@ -2021,6 +2094,9 @@ The input files must be sorted before @code{comm} can be used.
|
||||
With no options, @code{comm} produces three column output. Column one
|
||||
contains lines unique to @var{file1}, column two contains lines unique
|
||||
to @var{file2}, and column three contains lines common to both files.
|
||||
Columns are separated by @key{TAB}.
|
||||
@c FIXME: when there's an option to supply an alternative separator
|
||||
@c string, append `by default' to the above sentence.
|
||||
|
||||
@opindex -1
|
||||
@opindex -2
|
||||
@@ -2095,7 +2171,7 @@ For @samp{-f}, fields are separated by the first character in @var{delim}
|
||||
|
||||
@item -n
|
||||
@opindex -n
|
||||
Do not split multibyte characters (no-op for now).
|
||||
Do not split multi-byte characters (no-op for now).
|
||||
|
||||
@item -s
|
||||
@itemx --only-delimited
|
||||
@@ -2163,7 +2239,9 @@ Either @var{file1} or @var{file2} (but not both) can be @samp{-},
|
||||
meaning standard input. @var{file1} and @var{file2} should be already
|
||||
sorted in increasing order (not numerically) on the join fields; unless
|
||||
the @samp{-t} option is given, they should be sorted ignoring blanks at
|
||||
the start of the line, as in @code{sort -b}.
|
||||
the start of the join field, as in @code{sort -b}. If the
|
||||
@samp{--ignore-case} option is given, lines should be sorted without
|
||||
regard to the case of characters in the join field, as in @code{sort -f}.
|
||||
|
||||
The defaults are: the join field is the first field in each line;
|
||||
fields in the input are separated by one or more blanks, with leading
|
||||
@@ -2185,6 +2263,14 @@ Print a line for each unpairable line in file @var{file-number} (either
|
||||
Replace those output fields that are missing in the input with
|
||||
@var{string}.
|
||||
|
||||
@item -i
|
||||
@itemx --ignore-case
|
||||
@opindex -i
|
||||
@opindex --ignore-case
|
||||
Ignore differences in case when comparing keys.
|
||||
With this option, the lines of the input files must be ordered in the same way.
|
||||
Use @samp{sort -f} to produce this ordering.
|
||||
|
||||
@item -1 @var{field}
|
||||
@itemx -j1 @var{field}
|
||||
@opindex -1
|
||||
@@ -2202,18 +2288,33 @@ Equivalent to @samp{-1 @var{field} -2 @var{field}}.
|
||||
|
||||
@item -o @var{field-list}@dots{}
|
||||
Construct each output line according to the format in @var{field-list}.
|
||||
Each element in @var{field-list} consists of a file number (either 1 or
|
||||
2), a period, and a field number (a positive integer). The elements in
|
||||
the list are separated by commas or blanks. Multiple @var{field-list}
|
||||
Each element in @var{field-list} is either the single character @samp{0} or
|
||||
has the form @var{m.n} where the file number, @var{m}, is @samp{1} or
|
||||
@samp{2} and @var{n} is a positive field number.
|
||||
|
||||
A field specification of @samp{0} denotes the join field.
|
||||
In most cases, the functionality of the @samp{0} field spec
|
||||
may be reproduced using the explicit @var{m.n} that corresponds
|
||||
to the join field. However, when printing unpairable lines
|
||||
(using either of the @samp{-a} or @samp{-v} options), there is no way
|
||||
to specify the join field using @var{m.n} in @var{field-list}
|
||||
if there are unpairable lines in both files.
|
||||
To give @code{join} that functionality, @sc{POSIX} invented the @samp{0}
|
||||
field specification notation.
|
||||
|
||||
The elements in @var{field-list}
|
||||
are separated by commas or blanks. Multiple @var{field-list}
|
||||
arguments can be given after a single @samp{-o} option; the values
|
||||
of all lists given with @samp{-o} are concatenated together.
|
||||
All output lines -- including those printed because of any -a or -v
|
||||
option -- are subject to the specified @var{field-list}.
|
||||
|
||||
@item -t @var{char}
|
||||
Use character @var{char} as the input and output field separator.
|
||||
|
||||
@item -v @var{file-number}
|
||||
Print a line for each unpairable line in file @var{file-number}
|
||||
(either 1 or 2), instead of the normal output.
|
||||
(either @samp{1} or @samp{2}), instead of the normal output.
|
||||
|
||||
@end table
|
||||
|
||||
@@ -2441,7 +2542,7 @@ typically have the same length. If @var{set1} is shorter than
|
||||
@var{set2}, the extra characters at the end of @var{set2} are ignored.
|
||||
|
||||
On the other hand, making @var{set1} longer than @var{set2} is not
|
||||
portable; POSIX.2 says that the result is undefined. In this situation,
|
||||
portable; @sc{POSIX.2} says that the result is undefined. In this situation,
|
||||
BSD @code{tr} pads @var{set2} to the length of @var{set1} by repeating
|
||||
the last character of @var{set2} as many times as necessary. System V
|
||||
@code{tr} truncates @var{set1} to the length of @var{set2}.
|
||||
@@ -2521,7 +2622,7 @@ tr -s '\n'
|
||||
@vindex POSIXLY_CORRECT
|
||||
Setting the environment variable @code{POSIXLY_CORRECT} turns off the
|
||||
following warning and error messages, for strict compliance with
|
||||
POSIX.2. Otherwise, the following diagnostics are issued:
|
||||
@sc{POSIX.2}. Otherwise, the following diagnostics are issued:
|
||||
|
||||
@enumerate
|
||||
|
||||
@@ -2529,7 +2630,7 @@ POSIX.2. Otherwise, the following diagnostics are issued:
|
||||
When the @samp{--delete} option is given but @samp{--squeeze-repeats}
|
||||
is not, and @var{set2} is given, GNU @code{tr} by default prints
|
||||
a usage message and exits, because @var{set2} would not be used.
|
||||
The POSIX specification says that @var{set2} must be ignored in
|
||||
The @sc{POSIX} specification says that @var{set2} must be ignored in
|
||||
this case. Silently ignoring arguments is a bad idea.
|
||||
|
||||
@item
|
||||
@@ -2540,7 +2641,7 @@ value 400 octal does not fit into a single byte.
|
||||
@end enumerate
|
||||
|
||||
GNU @code{tr} does not provide complete BSD or System V compatibility.
|
||||
For example, it is impossible to disable interpretation of the POSIX
|
||||
For example, it is impossible to disable interpretation of the @sc{POSIX}
|
||||
constructs @samp{[:alpha:]}, @samp{[=c=]}, and @samp{[c*10]}. Also, GNU
|
||||
@code{tr} does not delete zero bytes automatically, unlike traditional
|
||||
Unix versions, which provide no way to preserve zero bytes.
|
||||
@@ -2644,8 +2745,8 @@ ones, to tabs.
|
||||
@end table
|
||||
|
||||
|
||||
@c What's GNU?
|
||||
@c Arnold Robbins
|
||||
@c What's GNU?
|
||||
@c Arnold Robbins
|
||||
@node Opening the software toolbox
|
||||
@chapter Opening the software toolbox
|
||||
|
||||
@@ -3199,7 +3300,7 @@ much more efficient and do more than these programs do. Nevertheless, as
|
||||
exposition of good programming style, and evangelism for a still-valuable
|
||||
philosophy, these books are unparalleled, and I recommend them highly.
|
||||
|
||||
Acknowledgement: I would like to express my gratitude to Brian Kernighan
|
||||
Acknowledgment: I would like to express my gratitude to Brian Kernighan
|
||||
of Bell Labs, the original Software Toolsmith, for reviewing this column.
|
||||
|
||||
|
||||
|
||||
@@ -5,3 +5,6 @@ safe-stat.h
|
||||
safe-stat.c
|
||||
safe-lstat.c
|
||||
safe-lstat.h
|
||||
getdate.tab.c
|
||||
.deps
|
||||
group_member.c
|
||||
|
||||
46
lib/Makefile.am
Normal file
46
lib/Makefile.am
Normal file
@@ -0,0 +1,46 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
noinst_LIBRARIES = fu
|
||||
|
||||
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
|
||||
|
||||
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 \
|
||||
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@
|
||||
|
||||
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 \
|
||||
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
|
||||
362
lib/Makefile.in
362
lib/Makefile.in
@@ -1,107 +1,287 @@
|
||||
# Makefile for library files used by GNU file utilities.
|
||||
# Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
# Makefile.in generated automatically by automake 1.1e from Makefile.am
|
||||
|
||||
# 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.
|
||||
# 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.
|
||||
|
||||
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
CC = @CC@
|
||||
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@
|
||||
|
||||
noinst_LIBRARIES = fu
|
||||
|
||||
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
|
||||
|
||||
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 \
|
||||
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@
|
||||
|
||||
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 \
|
||||
save-cwd.h xstrtol.h xstrtoul.h
|
||||
|
||||
BUILT_SOURCES = getdate.c posixtm.c
|
||||
mkinstalldirs = $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
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)
|
||||
AR = ar
|
||||
RANLIB = @RANLIB@
|
||||
DEFS = @DEFS@
|
||||
CC = @CC@
|
||||
CFLAGS = @CFLAGS@
|
||||
YACC = @YACC@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LINK = $(CC) $(LDFLAGS) -o $@
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
|
||||
exec_prefix = @exec_prefix@
|
||||
libdir = $(exec_prefix)/lib
|
||||
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
|
||||
|
||||
SOURCES = getdate.y posixtm.y \
|
||||
argmatch.c backupfile.c basename.c dirname.c euidaccess.c \
|
||||
error.c filemode.c fsusage.c full-write.c getopt.c getopt1.c \
|
||||
getversion.c group-member.c idcache.c isdir.c makepath.c \
|
||||
modechange.c mountlist.c obstack.c safe-read.c savedir.c \
|
||||
stripslash.c xgetcwd.c xmalloc.c xstrdup.c userspec.c yesno.c \
|
||||
fileblocks.c fnmatch.c ftruncate.c mkdir.c mktime.c rename.c rmdir.c \
|
||||
save-cwd.c stpcpy.c \
|
||||
strdup.c strstr.c strtol.c alloca.c long-options.c \
|
||||
memcmp.c memcpy.c memset.c xstrtol.c xstrtoul.c
|
||||
|
||||
OBJECTS = getdate.o posixtm.o \
|
||||
argmatch.o backupfile.o basename.o dirname.o \
|
||||
error.o filemode.o full-write.o getopt.o getopt1.o \
|
||||
getversion.o group-member.o idcache.o isdir.o long-options.o makepath.o \
|
||||
modechange.o obstack.o safe-read.o save-cwd.o savedir.o \
|
||||
stripslash.o xgetcwd.o xmalloc.o xstrdup.o userspec.o yesno.o \
|
||||
xstrtol.o xstrtoul.o @LIBOBJS@ @ALLOCA@
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
DISTFILES = Makefile.in backupfile.h getopt.h long-options.h modechange.h \
|
||||
fnmatch.h fsusage.h group-member.h makepath.h mountlist.h obstack.h pathmax.h \
|
||||
save-cwd.h getdate.c posixtm.c error.h xstrtol.h xstrtoul.h $(SOURCES)
|
||||
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)
|
||||
|
||||
all: libfu.a
|
||||
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 \
|
||||
.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)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o
|
||||
default: all
|
||||
|
||||
|
||||
$(srcdir)/Makefile.in: @MAINT@Makefile.am $(top_srcdir)/configure.in
|
||||
cd $(top_srcdir) && automake $(subdir)/Makefile
|
||||
|
||||
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)
|
||||
|
||||
distclean-noinstLIBRARIES:
|
||||
|
||||
maintainer-clean-noinstLIBRARIES:
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CPPFLAGS) $(DEFS) -I.. -I$(srcdir) $(CFLAGS) $<
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
rm -f *.o core
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
$(fu_OBJECTS): ../config.h
|
||||
|
||||
libfu.a: $(fu_OBJECTS) $(fu_DEPENDENCIES)
|
||||
rm -f libfu.a
|
||||
$(AR) cru libfu.a $(fu_OBJECTS) $(fu_LIBADD)
|
||||
$(RANLIB) libfu.a
|
||||
|
||||
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
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = lib
|
||||
Makefile: ../config.status Makefile.in
|
||||
cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
||||
|
||||
installdirs:
|
||||
|
||||
install install-exec install-data: all
|
||||
|
||||
uninstall:
|
||||
|
||||
TAGS: $(SOURCES)
|
||||
etags $(SOURCES)
|
||||
|
||||
check:
|
||||
|
||||
clean:
|
||||
rm -f *.a *.o
|
||||
|
||||
mostlyclean: clean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile *.tab.c tposixtm.c
|
||||
|
||||
maintainer-clean: distclean
|
||||
rm -f TAGS getdate.c posixtm.c
|
||||
|
||||
distdir = ../`cat ../distname`/$(subdir)
|
||||
dist: $(DISTFILES)
|
||||
for file in $(DISTFILES); do \
|
||||
ln $$file $(distdir) \
|
||||
|| { echo copying $$file instead; cp -p $$file $(distdir);}; \
|
||||
distdir: $(DEP_DISTFILES)
|
||||
@for file in `cd $(srcdir) && echo $(DISTFILES)`; do \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $(srcdir)/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir)/$$file; \
|
||||
done
|
||||
|
||||
libfu.a: $(OBJECTS)
|
||||
rm -f $@
|
||||
$(AR) cr $@ $(OBJECTS)
|
||||
-$(RANLIB) $@
|
||||
MKDEP = gcc -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
|
||||
-include .deps/.P
|
||||
.deps/.P: $(BUILT_SOURCES)
|
||||
test -d .deps || mkdir .deps
|
||||
echo > $@
|
||||
|
||||
-include $(DEP_FILES)
|
||||
$(DEP_FILES): .deps/.P
|
||||
|
||||
mostlyclean-depend:
|
||||
|
||||
clean-depend:
|
||||
|
||||
distclean-depend:
|
||||
|
||||
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
|
||||
info:
|
||||
|
||||
dvi:
|
||||
|
||||
check: all
|
||||
|
||||
installcheck:
|
||||
|
||||
install-exec:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install-data:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
uninstall:
|
||||
|
||||
all: $(LIBFILES) $(HEADERS) 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)
|
||||
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
|
||||
|
||||
maintainer-clean-generic:
|
||||
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \
|
||||
mostlyclean-tags mostlyclean-depend mostlyclean-generic
|
||||
|
||||
clean: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
|
||||
clean-generic mostlyclean
|
||||
|
||||
distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \
|
||||
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
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
|
||||
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 \
|
||||
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: getdate.y
|
||||
getdate.c: @MAINT@getdate.y
|
||||
@echo expect 10 shift/reduce conflicts
|
||||
$(YACC) $(srcdir)/getdate.y
|
||||
mv y.tab.c getdate.c
|
||||
@@ -110,33 +290,15 @@ getdate.c: getdate.y
|
||||
# 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: posixtm.y getdate.c
|
||||
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
|
||||
|
||||
rename.o: rename.c
|
||||
$(CC) -c $(CPPFLAGS) -DMVDIR="\"$(libdir)/mvdir\"" $(DEFS) \
|
||||
-I.. -I$(srcdir) $(CFLAGS) $(srcdir)/rename.c
|
||||
|
||||
$(OBJECTS): ../config.h
|
||||
|
||||
backupfile.o getversion.o: backupfile.h
|
||||
fnmatch.o: fnmatch.h
|
||||
fsusage.o: fsusage.h
|
||||
getopt1.o: getopt.h
|
||||
modechange.o: modechange.h
|
||||
mountlist.o: mountlist.h
|
||||
xgetcwd.o: pathmax.h
|
||||
makepath.o: makepath.h
|
||||
obstack.o: obstack.h
|
||||
group-member.o: group-member.h
|
||||
|
||||
.PHONY: all check clean dist distclean install install-data install-exec \
|
||||
installdirs maintainer-clean mostlyclean uninstall
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
# 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:
|
||||
|
||||
@@ -12,20 +12,20 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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@ai.mit.edu> */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef STDC_HEADERS
|
||||
#include <string.h>
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
extern char *program_name;
|
||||
@@ -37,8 +37,8 @@ extern char *program_name;
|
||||
|
||||
int
|
||||
argmatch (arg, optlist)
|
||||
char *arg;
|
||||
char **optlist;
|
||||
const char *arg;
|
||||
const char *const *optlist;
|
||||
{
|
||||
int i; /* Temporary index in OPTLIST. */
|
||||
size_t arglen; /* Length of ARG. */
|
||||
@@ -76,8 +76,8 @@ argmatch (arg, optlist)
|
||||
|
||||
void
|
||||
invalid_arg (kind, value, problem)
|
||||
char *kind;
|
||||
char *value;
|
||||
const char *kind;
|
||||
const char *value;
|
||||
int problem;
|
||||
{
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
|
||||
18
lib/argmatch.h
Normal file
18
lib/argmatch.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef ARGMATCH_H
|
||||
#define ARGMATCH_H 1
|
||||
|
||||
#ifndef __P
|
||||
# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
|
||||
# define __P(args) args
|
||||
# else
|
||||
# define __P(args) ()
|
||||
# endif /* GCC. */
|
||||
#endif /* Not __P. */
|
||||
|
||||
int
|
||||
argmatch __P ((const char *arg, const char *const *optlist));
|
||||
|
||||
void
|
||||
invalid_arg __P ((const char *kind, const char *value, int problem));
|
||||
|
||||
#endif /* ARGMATCH_H */
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* David MacKenzie <djm@gnu.ai.mit.edu>.
|
||||
Some algorithms adapted from GNU Emacs. */
|
||||
@@ -63,12 +63,12 @@ char *malloc ();
|
||||
#endif
|
||||
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
# define ISASCII(c) 1
|
||||
# define IN_CTYPE_DOMAIN(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii(c)
|
||||
# define IN_CTYPE_DOMAIN(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#define ISDIGIT(c) (ISASCII ((unsigned char) (c)) \
|
||||
#define ISDIGIT(c) (IN_CTYPE_DOMAIN ((unsigned char) (c)) \
|
||||
&& isdigit ((unsigned char) (c)))
|
||||
|
||||
#if defined (HAVE_UNISTD_H)
|
||||
@@ -105,7 +105,7 @@ static int version_number ();
|
||||
|
||||
char *
|
||||
find_backup_file_name (file)
|
||||
char *file;
|
||||
const char *file;
|
||||
{
|
||||
char *dir;
|
||||
char *base_versions;
|
||||
@@ -137,13 +137,14 @@ find_backup_file_name (file)
|
||||
|
||||
static int
|
||||
max_backup_version (file, dir)
|
||||
char *file, *dir;
|
||||
const char *file;
|
||||
const char *dir;
|
||||
{
|
||||
DIR *dirp;
|
||||
struct dirent *dp;
|
||||
int highest_version;
|
||||
int this_version;
|
||||
int file_name_length;
|
||||
size_t file_name_length;
|
||||
|
||||
dirp = opendir (dir);
|
||||
if (!dirp)
|
||||
@@ -171,7 +172,7 @@ max_backup_version (file, dir)
|
||||
|
||||
static char *
|
||||
make_version_name (file, version)
|
||||
char *file;
|
||||
const char *file;
|
||||
int version;
|
||||
{
|
||||
char *backup_name;
|
||||
@@ -189,12 +190,12 @@ make_version_name (file, version)
|
||||
|
||||
static int
|
||||
version_number (base, backup, base_length)
|
||||
char *base;
|
||||
char *backup;
|
||||
const char *base;
|
||||
const char *backup;
|
||||
int base_length;
|
||||
{
|
||||
int version;
|
||||
char *p;
|
||||
const char *p;
|
||||
|
||||
version = 0;
|
||||
if (!strncmp (base, backup, base_length) && ISDIGIT (backup[base_length]))
|
||||
@@ -212,7 +213,8 @@ version_number (base, backup, base_length)
|
||||
|
||||
static char *
|
||||
concat (str1, str2)
|
||||
char *str1, *str2;
|
||||
const char *str1;
|
||||
const char *str2;
|
||||
{
|
||||
char *newstr;
|
||||
int str1_length = strlen (str1);
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* When to make backup files. */
|
||||
enum backup_type
|
||||
@@ -36,7 +36,7 @@ extern enum backup_type backup_type;
|
||||
extern char *simple_backup_suffix;
|
||||
|
||||
#ifdef __STDC__
|
||||
char *find_backup_file_name (char *file);
|
||||
char *find_backup_file_name (const char *file);
|
||||
#else
|
||||
char *find_backup_file_name ();
|
||||
#endif
|
||||
|
||||
@@ -12,30 +12,27 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#ifndef strrchr
|
||||
#define strrchr rindex
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Return NAME with any leading path stripped off. */
|
||||
/* Return NAME with any leading path stripped off.
|
||||
Don't use strrchr/rindex. */
|
||||
|
||||
char *
|
||||
basename (name)
|
||||
const char *name;
|
||||
{
|
||||
char *base;
|
||||
const char *base = name;
|
||||
|
||||
base = strrchr (name, '/');
|
||||
return base ? base + 1 : (char *) name;
|
||||
while (*name)
|
||||
{
|
||||
if (*name == '/')
|
||||
base = name + 1;
|
||||
++name;
|
||||
}
|
||||
return (char *) base;
|
||||
}
|
||||
|
||||
80
lib/canon-host.c
Normal file
80
lib/canon-host.c
Normal file
@@ -0,0 +1,80 @@
|
||||
/* Host name canonicalization
|
||||
|
||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
|
||||
Written by Miles Bader <miles@gnu.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 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
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
/* Returns the canonical hostname associated with HOST (allocated in a static
|
||||
buffer), or 0 if it can't be determined. */
|
||||
char *
|
||||
canon_host (host)
|
||||
char *host;
|
||||
{
|
||||
#ifdef HAVE_GETHOSTBYNAME
|
||||
struct hostent *he = gethostbyname (host);
|
||||
|
||||
if (he)
|
||||
{
|
||||
# ifdef HAVE_GETHOSTBYADDR
|
||||
char *addr = 0;
|
||||
|
||||
/* Try and get an ascii version of the numeric host address. */
|
||||
switch (he->h_addrtype)
|
||||
{
|
||||
# ifdef HAVE_INET_NTOA
|
||||
case AF_INET:
|
||||
addr = inet_ntoa (*(struct in_addr *) he->h_addr);
|
||||
break;
|
||||
# endif /* HAVE_INET_NTOA */
|
||||
}
|
||||
|
||||
if (addr && strcmp (he->h_name, addr) == 0)
|
||||
/* gethostbyname() cheated! Lookup the host name via the address
|
||||
this time to get the actual host name. */
|
||||
he = gethostbyaddr (he->h_addr, he->h_length, he->h_addrtype);
|
||||
# endif /* HAVE_GETHOSTBYADDR */
|
||||
|
||||
if (he)
|
||||
return (char *) (he->h_name);
|
||||
}
|
||||
#endif /* HAVE_GETHOSTBYNAME */
|
||||
return 0;
|
||||
}
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
|
||||
138
lib/error.c
138
lib/error.c
@@ -1,29 +1,29 @@
|
||||
/* error.c -- error handler for noninteractive utilities
|
||||
Copyright (C) 1990, 91, 92, 93, 94, 95 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
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, 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
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if HAVE_VPRINTF || HAVE_DOPRNT
|
||||
#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
|
||||
# if __STDC__
|
||||
# include <stdarg.h>
|
||||
# define VA_START(args, lastarg) va_start(args, lastarg)
|
||||
@@ -36,30 +36,46 @@
|
||||
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS
|
||||
#if STDC_HEADERS || _LIBC
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#else
|
||||
void exit ();
|
||||
#endif
|
||||
|
||||
/* This variable is incremented each time `error' is called. */
|
||||
unsigned int error_message_count;
|
||||
#ifndef _
|
||||
# define _(String) String
|
||||
#endif
|
||||
|
||||
/* 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. */
|
||||
void (*error_print_progname) () = NULL;
|
||||
void (*error_print_progname) (
|
||||
#if __STDC__ - 0
|
||||
void
|
||||
#endif
|
||||
);
|
||||
|
||||
/* This variable is incremented each time `error' is called. */
|
||||
unsigned int error_message_count;
|
||||
|
||||
#ifdef _LIBC
|
||||
/* In the GNU C library, there is a predefined variable for this. */
|
||||
|
||||
# define program_name program_invocation_name
|
||||
# include <errno.h>
|
||||
|
||||
#else
|
||||
|
||||
/* The calling program should define program_name and set it to the
|
||||
name of the executing program. */
|
||||
extern char *program_name;
|
||||
|
||||
#if HAVE_STRERROR
|
||||
# ifndef strerror /* On some systems, sterror is a macro */
|
||||
# if HAVE_STRERROR
|
||||
# ifndef strerror /* On some systems, strerror is a macro */
|
||||
char *strerror ();
|
||||
# endif
|
||||
#else
|
||||
# endif
|
||||
# else
|
||||
static char *
|
||||
private_strerror (errnum)
|
||||
int errnum;
|
||||
@@ -69,10 +85,11 @@ private_strerror (errnum)
|
||||
|
||||
if (errnum > 0 && errnum <= sys_nerr)
|
||||
return sys_errlist[errnum];
|
||||
return "Unknown system error";
|
||||
return _("Unknown system error");
|
||||
}
|
||||
#define strerror private_strerror
|
||||
#endif
|
||||
# define strerror private_strerror
|
||||
# endif /* HAVE_STRERROR */
|
||||
#endif /* _LIBC */
|
||||
|
||||
/* Print the program name and error message MESSAGE, which is a printf-style
|
||||
format string with optional args.
|
||||
@@ -105,7 +122,75 @@ error (status, errnum, message, va_alist)
|
||||
|
||||
#ifdef VA_START
|
||||
VA_START (args, message);
|
||||
# if HAVE_VPRINTF
|
||||
# if HAVE_VPRINTF || _LIBC
|
||||
vfprintf (stderr, message, args);
|
||||
# else
|
||||
_doprnt (message, args, stderr);
|
||||
# endif
|
||||
va_end (args);
|
||||
#else
|
||||
fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
#endif
|
||||
|
||||
++error_message_count;
|
||||
if (errnum)
|
||||
fprintf (stderr, ": %s", strerror (errnum));
|
||||
putc ('\n', stderr);
|
||||
fflush (stderr);
|
||||
if (status)
|
||||
exit (status);
|
||||
}
|
||||
|
||||
/* Sometimes we want to have at most one error per line. This
|
||||
variable controls whether this mode is selected or not. */
|
||||
int error_one_per_line;
|
||||
|
||||
void
|
||||
#if defined(VA_START) && __STDC__
|
||||
error_at_line (int status, int errnum, const char *file_name,
|
||||
unsigned int line_number, const char *message, ...)
|
||||
#else
|
||||
error_at_line (status, errnum, file_name, line_number, message, va_alist)
|
||||
int status;
|
||||
int errnum;
|
||||
const char *file_name;
|
||||
unsigned int line_number;
|
||||
char *message;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
#ifdef VA_START
|
||||
va_list args;
|
||||
#endif
|
||||
|
||||
if (error_one_per_line)
|
||||
{
|
||||
static const char *old_file_name;
|
||||
static unsigned int old_line_number;
|
||||
|
||||
if (old_line_number == line_number &&
|
||||
(file_name == old_file_name || !strcmp (old_file_name, file_name)))
|
||||
/* Simply return and print nothing. */
|
||||
return;
|
||||
|
||||
old_file_name = file_name;
|
||||
old_line_number = line_number;
|
||||
}
|
||||
|
||||
if (error_print_progname)
|
||||
(*error_print_progname) ();
|
||||
else
|
||||
{
|
||||
fflush (stdout);
|
||||
fprintf (stderr, "%s:", program_name);
|
||||
}
|
||||
|
||||
if (file_name != NULL)
|
||||
fprintf (stderr, "%s:%d: ", file_name, line_number);
|
||||
|
||||
#ifdef VA_START
|
||||
VA_START (args, message);
|
||||
# if HAVE_VPRINTF || _LIBC
|
||||
vfprintf (stderr, message, args);
|
||||
# else
|
||||
_doprnt (message, args, stderr);
|
||||
@@ -116,7 +201,6 @@ error (status, errnum, message, va_alist)
|
||||
#endif
|
||||
|
||||
++error_message_count;
|
||||
|
||||
if (errnum)
|
||||
fprintf (stderr, ": %s", strerror (errnum));
|
||||
putc ('\n', stderr);
|
||||
|
||||
73
lib/error.h
73
lib/error.h
@@ -1,44 +1,65 @@
|
||||
/* error.h -- declaration for error-reporting function
|
||||
Copyright (C) 1995 Software Foundation, Inc.
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, 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_
|
||||
# define _error_h_
|
||||
|
||||
#ifndef __attribute__
|
||||
# ifndef __attribute__
|
||||
/* This feature is available in gcc versions 2.5 and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
/* The __-protected variants of `format' and `printf' attributes
|
||||
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __format__ format
|
||||
# define __printf__ printf
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __format__ format
|
||||
# define __printf__ printf
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __STDC__
|
||||
void error (int, int, const char *, ...) \
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
#else
|
||||
# if defined (__STDC__) && __STDC__
|
||||
|
||||
/* Print a message with `fprintf (stderr, FORMAT, ...)';
|
||||
if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
|
||||
If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
|
||||
|
||||
extern void error (int status, int errnum, const char *format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
|
||||
extern void error_at_line (int status, int errnum, const char *fname,
|
||||
unsigned int lineno, const char *format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 5, 6)));
|
||||
|
||||
/* 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. */
|
||||
extern void (*error_print_progname) (void);
|
||||
|
||||
# else
|
||||
void error ();
|
||||
#endif
|
||||
void error_at_line ();
|
||||
extern void (*error_print_progname) ();
|
||||
# endif
|
||||
|
||||
/* This variable is incremented each time `error' is called. */
|
||||
extern unsigned int error_message_count;
|
||||
|
||||
/* Sometimes we want to have at most one error per line. This
|
||||
variable controls whether this mode is selected or not. */
|
||||
extern int error_one_per_line;
|
||||
|
||||
#endif /* _error_h_ */
|
||||
|
||||
229
lib/euidaccess.c
229
lib/euidaccess.c
@@ -1,61 +1,65 @@
|
||||
/* euidaccess -- check if effective user id can access file
|
||||
Copyright (C) 1990, 1991 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1991, 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 file is part of the GNU C Library.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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.
|
||||
|
||||
/* Written by David MacKenzie and Torbjorn Granlund. */
|
||||
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. */
|
||||
|
||||
/* Written by David MacKenzie and Torbjorn Granlund.
|
||||
Adapted for GNU C library by Roland McGrath. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef S_IEXEC
|
||||
#ifndef S_IXUSR
|
||||
#define S_IXUSR S_IEXEC
|
||||
#endif
|
||||
#ifndef S_IXGRP
|
||||
#define S_IXGRP (S_IEXEC >> 3)
|
||||
#endif
|
||||
#ifndef S_IXOTH
|
||||
#define S_IXOTH (S_IEXEC >> 6)
|
||||
#endif
|
||||
# ifndef S_IXUSR
|
||||
# define S_IXUSR S_IEXEC
|
||||
# endif
|
||||
# ifndef S_IXGRP
|
||||
# define S_IXGRP (S_IEXEC >> 3)
|
||||
# endif
|
||||
# ifndef S_IXOTH
|
||||
# define S_IXOTH (S_IEXEC >> 6)
|
||||
# endif
|
||||
#endif /* S_IEXEC */
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#if defined (HAVE_UNISTD_H) || defined (_LIBC)
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef _POSIX_VERSION
|
||||
#include <limits.h>
|
||||
#if !defined(NGROUPS_MAX) || NGROUPS_MAX < 1
|
||||
#undef NGROUPS_MAX
|
||||
#define NGROUPS_MAX sysconf (_SC_NGROUPS_MAX)
|
||||
#endif /* NGROUPS_MAX */
|
||||
# include <limits.h>
|
||||
# if !defined(NGROUPS_MAX) || NGROUPS_MAX < 1
|
||||
# undef NGROUPS_MAX
|
||||
# define NGROUPS_MAX sysconf (_SC_NGROUPS_MAX)
|
||||
# endif /* NGROUPS_MAX */
|
||||
|
||||
#else /* not _POSIX_VERSION */
|
||||
uid_t getuid ();
|
||||
gid_t getgid ();
|
||||
uid_t geteuid ();
|
||||
gid_t getegid ();
|
||||
#include <sys/param.h>
|
||||
#if !defined(NGROUPS_MAX) && defined(NGROUPS)
|
||||
#define NGROUPS_MAX NGROUPS
|
||||
#endif /* not NGROUPS_MAX and NGROUPS */
|
||||
# include <sys/param.h>
|
||||
# if !defined(NGROUPS_MAX) && defined(NGROUPS)
|
||||
# define NGROUPS_MAX NGROUPS
|
||||
# endif /* not NGROUPS_MAX and NGROUPS */
|
||||
#endif /* not POSIX_VERSION */
|
||||
|
||||
#include <errno.h>
|
||||
@@ -64,16 +68,34 @@ extern int errno;
|
||||
#endif
|
||||
|
||||
#if defined(EACCES) && !defined(EACCESS)
|
||||
#define EACCESS EACCES
|
||||
# define EACCESS EACCES
|
||||
#endif
|
||||
|
||||
#ifndef F_OK
|
||||
#define F_OK 0
|
||||
#define X_OK 1
|
||||
#define W_OK 2
|
||||
#define R_OK 4
|
||||
# define F_OK 0
|
||||
# define X_OK 1
|
||||
# define W_OK 2
|
||||
# define R_OK 4
|
||||
#endif
|
||||
|
||||
#if !defined (S_IROTH) && defined (R_OK)
|
||||
# define S_IROTH R_OK
|
||||
#endif
|
||||
|
||||
#if !defined (S_IWOTH) && defined (W_OK)
|
||||
# define S_IWOTH W_OK
|
||||
#endif
|
||||
|
||||
#if !defined (S_IXOTH) && defined (X_OK)
|
||||
# define S_IXOTH X_OK
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
|
||||
# define group_member __group_member
|
||||
|
||||
#else
|
||||
|
||||
/* The user's real user id. */
|
||||
static uid_t uid;
|
||||
|
||||
@@ -86,67 +108,17 @@ static uid_t euid;
|
||||
/* The user's effective group id. */
|
||||
static gid_t egid;
|
||||
|
||||
int group_member ();
|
||||
|
||||
/* Nonzero if UID, GID, EUID, and EGID have valid values. */
|
||||
static int have_ids = 0;
|
||||
|
||||
/* Like euidaccess, except that a pointer to a filled-in stat structure
|
||||
describing the file is provided instead of a filename.
|
||||
Because this function is almost guaranteed to fail on systems that
|
||||
use ACLs, a third argument *PATH may be used. If it is non-NULL,
|
||||
it is assumed to be the name of the file corresponding to STATP.
|
||||
Then, if the user is not running set-uid or set-gid, use access
|
||||
instead of attempting a manual and non-portable comparison. */
|
||||
# ifdef HAVE_GETGROUPS
|
||||
int group_member ();
|
||||
# else
|
||||
# define group_member(gid) 0
|
||||
# endif
|
||||
|
||||
int
|
||||
eaccess_stat (statp, mode, path)
|
||||
const struct stat *statp;
|
||||
int mode;
|
||||
const char *path;
|
||||
{
|
||||
int granted;
|
||||
|
||||
mode &= (X_OK | W_OK | R_OK); /* Clear any bogus bits. */
|
||||
|
||||
if (mode == F_OK)
|
||||
return 0; /* The file exists. */
|
||||
|
||||
if (have_ids == 0)
|
||||
{
|
||||
have_ids = 1;
|
||||
uid = getuid ();
|
||||
gid = getgid ();
|
||||
euid = geteuid ();
|
||||
egid = getegid ();
|
||||
}
|
||||
|
||||
if (path && uid == euid && gid == egid)
|
||||
{
|
||||
return access (path, mode);
|
||||
}
|
||||
|
||||
/* The super-user can read and write any file, and execute any file
|
||||
that anyone can execute. */
|
||||
if (euid == 0 && ((mode & X_OK) == 0
|
||||
|| (statp->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))))
|
||||
return 0;
|
||||
|
||||
if (euid == statp->st_uid)
|
||||
granted = (unsigned) (statp->st_mode & (mode << 6)) >> 6;
|
||||
else if (egid == statp->st_gid
|
||||
#ifdef HAVE_GETGROUPS
|
||||
|| group_member (statp->st_gid)
|
||||
#endif
|
||||
)
|
||||
granted = (unsigned) (statp->st_mode & (mode << 3)) >> 3;
|
||||
else
|
||||
granted = (statp->st_mode & mode);
|
||||
if (granted == mode)
|
||||
return 0;
|
||||
errno = EACCESS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* Return 0 if the user has permission of type MODE on file PATH;
|
||||
otherwise, return -1 and set `errno' to EACCESS.
|
||||
@@ -160,7 +132,12 @@ euidaccess (path, mode)
|
||||
int mode;
|
||||
{
|
||||
struct stat stats;
|
||||
int granted;
|
||||
|
||||
#ifdef _LIBC
|
||||
uid_t uid = getuid (), euid = geteuid ();
|
||||
gid_t gid = getgid (), egid = getegid ();
|
||||
#else
|
||||
if (have_ids == 0)
|
||||
{
|
||||
have_ids = 1;
|
||||
@@ -169,45 +146,37 @@ euidaccess (path, mode)
|
||||
euid = geteuid ();
|
||||
egid = getegid ();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (uid == euid && gid == egid)
|
||||
{
|
||||
return access (path, mode);
|
||||
}
|
||||
/* If we are not set-uid or set-gid, access does the same. */
|
||||
return access (path, mode);
|
||||
|
||||
if (stat (path, &stats))
|
||||
return -1;
|
||||
|
||||
return eaccess_stat (&stats, mode, path);
|
||||
}
|
||||
|
||||
#ifdef TEST
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
void error ();
|
||||
|
||||
char *program_name;
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
char *file;
|
||||
int mode;
|
||||
int err;
|
||||
|
||||
program_name = argv[0];
|
||||
if (argc < 3)
|
||||
abort ();
|
||||
file = argv[1];
|
||||
mode = atoi (argv[2]);
|
||||
|
||||
err = euidaccess (file, mode);
|
||||
printf ("%d\n", err);
|
||||
if (err != 0)
|
||||
error (0, errno, "%s", file);
|
||||
exit (0);
|
||||
}
|
||||
mode &= (X_OK | W_OK | R_OK); /* Clear any bogus bits. */
|
||||
#if R_OK != S_IROTH || W_OK != S_IWOTH || X_OK != S_IXOTH
|
||||
?error Oops, portability assumptions incorrect.
|
||||
#endif
|
||||
|
||||
if (mode == F_OK)
|
||||
return 0; /* The file exists. */
|
||||
|
||||
/* The super-user can read and write any file, and execute any file
|
||||
that anyone can execute. */
|
||||
if (euid == 0 && ((mode & X_OK) == 0
|
||||
|| (stats.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))))
|
||||
return 0;
|
||||
|
||||
if (euid == stats.st_uid)
|
||||
granted = (unsigned) (stats.st_mode & (mode << 6)) >> 6;
|
||||
else if (egid == stats.st_gid || group_member (stats.st_gid))
|
||||
granted = (unsigned) (stats.st_mode & (mode << 3)) >> 3;
|
||||
else
|
||||
granted = (stats.st_mode & mode);
|
||||
if (granted == mode)
|
||||
return 0;
|
||||
errno = EACCESS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -12,32 +12,32 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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 Brian L. Matthews, blm@6sceng.UUCP. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if !defined (HAVE_ST_BLOCKS) && !defined(_POSIX_SOURCE)
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#if !defined (HAVE_ST_BLOCKS) && !defined(_POSIX_VERSION)
|
||||
# include <sys/types.h>
|
||||
# include <sys/param.h>
|
||||
|
||||
#ifndef NINDIR
|
||||
# ifndef NINDIR
|
||||
/* Some SysV's, like Irix, seem to lack these. Hope they're correct. */
|
||||
/* Size of a indirect block, in bytes. */
|
||||
#ifndef BSIZE
|
||||
#define BSIZE 1024
|
||||
#endif
|
||||
# ifndef BSIZE
|
||||
# define BSIZE 1024
|
||||
# endif
|
||||
|
||||
/* Number of inode pointers per indirect block. */
|
||||
#define NINDIR (BSIZE/sizeof(daddr_t))
|
||||
#endif /* !NINDIR */
|
||||
# define NINDIR (BSIZE/sizeof(daddr_t))
|
||||
# endif /* !NINDIR */
|
||||
|
||||
/* Number of direct block addresses in an inode. */
|
||||
#define NDIR 10
|
||||
# define NDIR 10
|
||||
|
||||
/* Return the number of 512-byte blocks in a file of SIZE bytes. */
|
||||
|
||||
@@ -63,4 +63,8 @@ st_blocks (size)
|
||||
|
||||
return datablks + indrblks;
|
||||
}
|
||||
#else
|
||||
/* This declaration is solely to ensure that after preprocessing
|
||||
this file is never empty. */
|
||||
extern int textutils_fileblocks_unused;
|
||||
#endif
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
|
||||
@@ -14,8 +14,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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
|
||||
@@ -1,48 +1,57 @@
|
||||
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
|
||||
This 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.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
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
|
||||
Library General Public License for more details.
|
||||
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 this library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, 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 _FNMATCH_H
|
||||
|
||||
#define _FNMATCH_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||
#undef __P
|
||||
#define __P(args) args
|
||||
#define __P(protos) protos
|
||||
#else /* Not C++ or ANSI C. */
|
||||
#undef __P
|
||||
#define __P(args) ()
|
||||
#undef const
|
||||
#define const
|
||||
#define __P(protos) ()
|
||||
/* We can get away without defining `const' here only because in this file
|
||||
it is used only inside the prototype for `fnmatch', which is elided in
|
||||
non-ANSI C where `const' is problematical. */
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
/* Bits set in the FLAGS argument to `fnmatch'. */
|
||||
#define FNM_PATHNAME (1 << 0)/* No wildcard can ever match `/'. */
|
||||
#define FNM_NOESCAPE (1 << 1)/* Backslashes don't quote special chars. */
|
||||
#define FNM_PERIOD (1 << 2)/* Leading `.' is matched only explicitly. */
|
||||
#define FNM_TARPATH (1 << 4)/* Ignore `/...' after a match. */
|
||||
#define __FNM_FLAGS (FNM_PATHNAME|FNM_NOESCAPE|FNM_PERIOD|FNM_TARPATH)
|
||||
|
||||
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_SOURCE)
|
||||
#define FNM_FILE_NAME FNM_PATHNAME
|
||||
/* We #undef these before defining them because some losing systems
|
||||
(HP-UX A.08.07 for example) define these in <unistd.h>. */
|
||||
#undef FNM_PATHNAME
|
||||
#undef FNM_NOESCAPE
|
||||
#undef FNM_PERIOD
|
||||
|
||||
/* Bits set in the FLAGS argument to `fnmatch'. */
|
||||
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
|
||||
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
|
||||
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
|
||||
|
||||
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
|
||||
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
|
||||
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
|
||||
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
|
||||
#endif
|
||||
|
||||
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
|
||||
@@ -50,12 +59,11 @@ extern "C"
|
||||
|
||||
/* Match STRING against the filename pattern PATTERN,
|
||||
returning zero if it matches, FNM_NOMATCH if not. */
|
||||
extern int fnmatch __P ((const char *__pattern, const char *__string,
|
||||
int __flags));
|
||||
extern int fnmatch __P ((const char *__pattern, const char *__string,
|
||||
int __flags));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* fnmatch.h */
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
@@ -37,7 +37,11 @@ int statfs ();
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_FILSYS_H
|
||||
#ifdef 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. */
|
||||
#endif
|
||||
|
||||
@@ -73,7 +77,7 @@ adjust_blocks (blocks, fromsize, tosize)
|
||||
abort ();
|
||||
if (fromsize <= 0)
|
||||
return -1;
|
||||
|
||||
|
||||
if (fromsize == tosize) /* E.g., from 512 to 512. */
|
||||
return blocks;
|
||||
else if (fromsize > tosize) /* E.g., from 2048 to 512. */
|
||||
@@ -90,7 +94,8 @@ adjust_blocks (blocks, fromsize, tosize)
|
||||
|
||||
int
|
||||
get_fs_usage (path, disk, fsp)
|
||||
char *path, *disk;
|
||||
const char *path;
|
||||
const char *disk;
|
||||
struct fs_usage *fsp;
|
||||
{
|
||||
#if defined (STAT_STATFS3_OSF1)
|
||||
@@ -144,6 +149,21 @@ get_fs_usage (path, disk, fsp)
|
||||
|
||||
if (statfs (path, &fsd) < 0)
|
||||
return -1;
|
||||
|
||||
#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
|
||||
the values are not truncated. The correct counts are stored in
|
||||
undocumented spare fields. */
|
||||
if (fsd.f_blocks == 0x1fffff && fsd.f_spare[0] > 0)
|
||||
{
|
||||
fsd.f_blocks = fsd.f_spare[0];
|
||||
fsd.f_bfree = fsd.f_spare[1];
|
||||
fsd.f_bavail = fsd.f_spare[2];
|
||||
}
|
||||
#endif /* STATFS_TRUNCATES_BLOCK_COUNTS */
|
||||
|
||||
#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_bsize, 512)
|
||||
#endif
|
||||
|
||||
@@ -163,8 +183,11 @@ 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
|
||||
# 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. */
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Space usage statistics for a filesystem. Blocks are 512-byte. */
|
||||
struct fs_usage
|
||||
@@ -25,8 +25,13 @@ struct fs_usage
|
||||
long fsu_ffree; /* Free file nodes. */
|
||||
};
|
||||
|
||||
#if __STDC__
|
||||
int get_fs_usage (char *path, char *disk, struct fs_usage *fsp);
|
||||
#ifndef __P
|
||||
#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
|
||||
#define __P(args) args
|
||||
#else
|
||||
int get_fs_usage ();
|
||||
#endif
|
||||
#define __P(args) ()
|
||||
#endif /* GCC. */
|
||||
#endif /* Not __P. */
|
||||
|
||||
int get_fs_usage __P ((const char *path, const char *disk,
|
||||
struct fs_usage *fsp));
|
||||
|
||||
@@ -12,20 +12,20 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Copied largely from GNU C's cccp.c.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
|
||||
#ifdef FORCE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Since the code of getdate.y is not included in the Emacs executable
|
||||
@@ -30,6 +34,17 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if defined (STDC_HEADERS) || !defined (isascii)
|
||||
# define ISASCII(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#define ISSPACE(c) (ISASCII (c) && isspace (c))
|
||||
#define ISALPHA(c) (ISASCII (c) && isalpha (c))
|
||||
#define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||
#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
|
||||
|
||||
#if defined (vms)
|
||||
#include <types.h>
|
||||
#include <time.h>
|
||||
@@ -90,6 +105,7 @@ static int yylex ();
|
||||
static int yyerror ();
|
||||
|
||||
#define EPOCH 1970
|
||||
#define DOOMSDAY 2038
|
||||
#define HOUR(x) ((time_t)(x) * 60)
|
||||
#define SECSPERDAY (24L * 60L * 60L)
|
||||
|
||||
@@ -242,7 +258,7 @@ day : tDAY {
|
||||
yyDayOrdinal = 1;
|
||||
yyDayNumber = $1;
|
||||
}
|
||||
| tUNUMBER tDAY { /* FIXME */
|
||||
| tUNUMBER tDAY {
|
||||
yyDayOrdinal = $1;
|
||||
yyDayNumber = $2;
|
||||
}
|
||||
@@ -279,7 +295,6 @@ date : tUNUMBER '/' tUNUMBER {
|
||||
yyYear = $4;
|
||||
}
|
||||
| tUNUMBER tMONTH {
|
||||
/* FIXME: `date -d 'next october'' is interpreted as 2 october. */
|
||||
yyMonth = $2;
|
||||
yyDay = $1;
|
||||
}
|
||||
@@ -315,10 +330,10 @@ relunit : tUNUMBER tMINUTE_UNIT {
|
||||
| tSEC_UNIT {
|
||||
yyRelSeconds++;
|
||||
}
|
||||
| tSNUMBER tMONTH_UNIT { /* FIXME */
|
||||
| tSNUMBER tMONTH_UNIT {
|
||||
yyRelMonth += $1 * $2;
|
||||
}
|
||||
| tUNUMBER tMONTH_UNIT { /* FIXME */
|
||||
| tUNUMBER tMONTH_UNIT {
|
||||
yyRelMonth += $1 * $2;
|
||||
}
|
||||
| tMONTH_UNIT {
|
||||
@@ -613,11 +628,13 @@ Convert (Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode)
|
||||
|
||||
if (Year < 0)
|
||||
Year = -Year;
|
||||
if (Year < 100)
|
||||
if (Year < DOOMSDAY-2000)
|
||||
Year += 2000;
|
||||
else if (Year < 100)
|
||||
Year += 1900;
|
||||
DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)
|
||||
? 29 : 28;
|
||||
if (Year < EPOCH || Year > 2037
|
||||
if (Year < EPOCH || Year >= DOOMSDAY
|
||||
|| Month < 1 || Month > 12
|
||||
/* Lint fluff: "conversion from long may lose accuracy" */
|
||||
|| Day < 1 || Day > DaysInMonth[(int)--Month])
|
||||
@@ -682,7 +699,7 @@ RelativeMonth (Start, RelMonth)
|
||||
if (RelMonth == 0)
|
||||
return 0;
|
||||
tm = localtime (&Start);
|
||||
Month = 12 * tm->tm_year + tm->tm_mon + RelMonth;
|
||||
Month = 12 * (1900 + tm->tm_year) + tm->tm_mon + RelMonth;
|
||||
Year = Month / 12;
|
||||
Month = Month % 12 + 1;
|
||||
return DSTcorrect (Start,
|
||||
@@ -704,7 +721,7 @@ LookupWord (buff)
|
||||
|
||||
/* Make it lowercase. */
|
||||
for (p = buff; *p; p++)
|
||||
if (isupper (*p))
|
||||
if (ISUPPER (*p))
|
||||
*p = tolower (*p);
|
||||
|
||||
if (strcmp (buff, "am") == 0 || strcmp (buff, "a.m.") == 0) {
|
||||
@@ -745,7 +762,7 @@ LookupWord (buff)
|
||||
return tp->type;
|
||||
}
|
||||
|
||||
if (strcmp (buff, "dst") == 0)
|
||||
if (strcmp (buff, "dst") == 0)
|
||||
return tDST;
|
||||
|
||||
for (tp = UnitsTable; tp->name; tp++)
|
||||
@@ -773,7 +790,7 @@ LookupWord (buff)
|
||||
}
|
||||
|
||||
/* Military timezones. */
|
||||
if (buff[1] == '\0' && isalpha (*buff)) {
|
||||
if (buff[1] == '\0' && ISALPHA (*buff)) {
|
||||
for (tp = MilitaryTable; tp->name; tp++)
|
||||
if (strcmp (buff, tp->name) == 0) {
|
||||
yylval.Number = tp->value;
|
||||
@@ -809,27 +826,27 @@ yylex ()
|
||||
int sign;
|
||||
|
||||
for ( ; ; ) {
|
||||
while (isspace (*yyInput))
|
||||
while (ISSPACE (*yyInput))
|
||||
yyInput++;
|
||||
|
||||
if (isdigit (c = *yyInput) || c == '-' || c == '+') {
|
||||
if (ISDIGIT (c = *yyInput) || c == '-' || c == '+') {
|
||||
if (c == '-' || c == '+') {
|
||||
sign = c == '-' ? -1 : 1;
|
||||
if (!isdigit (*++yyInput))
|
||||
if (!ISDIGIT (*++yyInput))
|
||||
/* skip the '-' sign */
|
||||
continue;
|
||||
}
|
||||
else
|
||||
sign = 0;
|
||||
for (yylval.Number = 0; isdigit (c = *yyInput++); )
|
||||
for (yylval.Number = 0; ISDIGIT (c = *yyInput++); )
|
||||
yylval.Number = 10 * yylval.Number + c - '0';
|
||||
yyInput--;
|
||||
if (sign < 0)
|
||||
yylval.Number = -yylval.Number;
|
||||
return sign ? tSNUMBER : tUNUMBER;
|
||||
}
|
||||
if (isalpha (c)) {
|
||||
for (p = buff; isalpha (c = *yyInput++) || c == '.'; )
|
||||
if (ISALPHA (c)) {
|
||||
for (p = buff; ISALPHA (c = *yyInput++) || c == '.'; )
|
||||
if (p < &buff[sizeof buff - 1])
|
||||
*p++ = c;
|
||||
*p = '\0';
|
||||
@@ -896,7 +913,7 @@ get_date (p, now)
|
||||
|
||||
if (! (tm = localtime (&ftz.time)))
|
||||
return -1;
|
||||
|
||||
|
||||
ftz.timezone = difftm (&gmt, tm) / 60;
|
||||
if (tm->tm_isdst)
|
||||
ftz.timezone += 60;
|
||||
|
||||
@@ -12,13 +12,17 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* David MacKenzie <djm@gnu.ai.mit.edu> */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNAME
|
||||
#include <sys/utsname.h>
|
||||
# include <sys/utsname.h>
|
||||
#endif
|
||||
|
||||
/* Put up to LEN chars of the host name into NAME.
|
||||
|
||||
155
lib/getline.c
Normal file
155
lib/getline.c
Normal file
@@ -0,0 +1,155 @@
|
||||
/* getline.c -- Replacement for GNU C library function getline
|
||||
|
||||
Copyright (C) 1993, 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 of the
|
||||
License, 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 Jan Brittenson, bson@gnu.ai.mit.edu. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* The `getdelim' function is only declared if the following symbol
|
||||
is defined. */
|
||||
#define _GNU_SOURCE 1
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined __GNU_LIBRARY__ && HAVE_GETDELIM
|
||||
|
||||
int
|
||||
getline (lineptr, n, stream)
|
||||
char **lineptr;
|
||||
size_t *n;
|
||||
FILE *stream;
|
||||
{
|
||||
return getdelim (lineptr, n, '\n', stream);
|
||||
}
|
||||
|
||||
|
||||
#else /* ! have getdelim */
|
||||
|
||||
# define NDEBUG
|
||||
# include <assert.h>
|
||||
|
||||
# if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
# else
|
||||
char *malloc (), *realloc ();
|
||||
# endif
|
||||
|
||||
/* Always add at least this many bytes when extending the buffer. */
|
||||
# define MIN_CHUNK 64
|
||||
|
||||
/* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR
|
||||
+ OFFSET (and null-terminate it). *LINEPTR is a pointer returned from
|
||||
malloc (or NULL), pointing to *N characters of space. It is realloc'd
|
||||
as necessary. Return the number of characters read (not including the
|
||||
null terminator), or -1 on error or EOF. */
|
||||
|
||||
int
|
||||
getstr (lineptr, n, stream, terminator, offset)
|
||||
char **lineptr;
|
||||
size_t *n;
|
||||
FILE *stream;
|
||||
char terminator;
|
||||
size_t offset;
|
||||
{
|
||||
int nchars_avail; /* Allocated but unused chars in *LINEPTR. */
|
||||
char *read_pos; /* Where we're reading into *LINEPTR. */
|
||||
int ret;
|
||||
|
||||
if (!lineptr || !n || !stream)
|
||||
return -1;
|
||||
|
||||
if (!*lineptr)
|
||||
{
|
||||
*n = MIN_CHUNK;
|
||||
*lineptr = malloc (*n);
|
||||
if (!*lineptr)
|
||||
return -1;
|
||||
}
|
||||
|
||||
nchars_avail = *n - offset;
|
||||
read_pos = *lineptr + offset;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
register int c = getc (stream);
|
||||
|
||||
/* We always want at least one char left in the buffer, since we
|
||||
always (unless we get an error while reading the first char)
|
||||
NUL-terminate the line buffer. */
|
||||
|
||||
assert(*n - nchars_avail == read_pos - *lineptr);
|
||||
if (nchars_avail < 2)
|
||||
{
|
||||
if (*n > MIN_CHUNK)
|
||||
*n *= 2;
|
||||
else
|
||||
*n += MIN_CHUNK;
|
||||
|
||||
nchars_avail = *n + *lineptr - read_pos;
|
||||
*lineptr = realloc (*lineptr, *n);
|
||||
if (!*lineptr)
|
||||
return -1;
|
||||
read_pos = *n - nchars_avail + *lineptr;
|
||||
assert(*n - nchars_avail == read_pos - *lineptr);
|
||||
}
|
||||
|
||||
if (c == EOF || ferror (stream))
|
||||
{
|
||||
/* Return partial line, if any. */
|
||||
if (read_pos == *lineptr)
|
||||
return -1;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
*read_pos++ = c;
|
||||
nchars_avail--;
|
||||
|
||||
if (c == terminator)
|
||||
/* Return the line. */
|
||||
break;
|
||||
}
|
||||
|
||||
/* Done - NUL terminate and return the number of chars read. */
|
||||
*read_pos = '\0';
|
||||
|
||||
ret = read_pos - (*lineptr + offset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
getline (lineptr, n, stream)
|
||||
char **lineptr;
|
||||
size_t *n;
|
||||
FILE *stream;
|
||||
{
|
||||
return getstr (lineptr, n, stream, '\n', 0);
|
||||
}
|
||||
|
||||
int
|
||||
getdelim (lineptr, n, delimiter, stream)
|
||||
char **lineptr;
|
||||
size_t *n;
|
||||
int delimiter;
|
||||
FILE *stream;
|
||||
{
|
||||
return getstr (lineptr, n, stream, delimiter, 0);
|
||||
}
|
||||
#endif
|
||||
36
lib/getline.h
Normal file
36
lib/getline.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/* 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. */
|
||||
|
||||
#ifndef _getline_h_
|
||||
# define _getline_h_ 1
|
||||
|
||||
# include <stdio.h>
|
||||
|
||||
# ifndef PARAMS
|
||||
# if defined (__GNUC__) || __STDC__
|
||||
# define PARAMS(args) args
|
||||
# else
|
||||
# define PARAMS(args) ()
|
||||
# endif /* GCC. */
|
||||
# endif /* Not PARAMS. */
|
||||
|
||||
int
|
||||
getline PARAMS ((char **_lineptr, size_t *_n, FILE *_stream));
|
||||
|
||||
int
|
||||
getdelim PARAMS ((char **_lineptr, size_t *_n, int _delimiter, FILE *_stream));
|
||||
|
||||
#endif
|
||||
1014
lib/getloadavg.c
Normal file
1014
lib/getloadavg.c
Normal file
File diff suppressed because it is too large
Load Diff
130
lib/getopt.c
130
lib/getopt.c
@@ -3,7 +3,7 @@
|
||||
"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
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
Foundation, 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>. */
|
||||
@@ -53,18 +53,37 @@
|
||||
|
||||
/* 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
|
||||
#include <unixlib.h>
|
||||
#if HAVE_STRING_H - 0
|
||||
#include <string.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
/* It's not Unix, really. See? Capital letters. */
|
||||
#include <windows.h>
|
||||
#define getpid() GetCurrentProcessId()
|
||||
#endif
|
||||
|
||||
#ifndef _
|
||||
/* This is for other GNU distributions with internationalized messages.
|
||||
The GNU C Library itself does not yet support such messages. */
|
||||
#if HAVE_LIBINTL_H
|
||||
When compiling libc, the _ macro is predefined. */
|
||||
#ifdef HAVE_LIBINTL_H
|
||||
# include <libintl.h>
|
||||
# define _(msgid) gettext (msgid)
|
||||
#else
|
||||
# define gettext(msgid) (msgid)
|
||||
# define _(msgid) (msgid)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* This version of `getopt' appears to the caller like standard Unix `getopt'
|
||||
@@ -163,7 +182,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
|
||||
@@ -214,6 +233,12 @@ extern int strlen (const char *);
|
||||
static int first_nonopt;
|
||||
static int last_nonopt;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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.
|
||||
@@ -223,6 +248,10 @@ static int last_nonopt;
|
||||
`first_nonopt' and `last_nonopt' are relocated so that they describe
|
||||
the new indices of the non-options in ARGV after they are moved. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
static void exchange (char **);
|
||||
#endif
|
||||
|
||||
static void
|
||||
exchange (argv)
|
||||
char **argv;
|
||||
@@ -281,6 +310,9 @@ exchange (argv)
|
||||
|
||||
/* Initialize the internal data when the first call is made. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
static const char *_getopt_initialize (const char *);
|
||||
#endif
|
||||
static const char *
|
||||
_getopt_initialize (optstring)
|
||||
const char *optstring;
|
||||
@@ -312,6 +344,21 @@ _getopt_initialize (optstring)
|
||||
else
|
||||
ordering = PERMUTE;
|
||||
|
||||
if (posixly_correct == NULL)
|
||||
{
|
||||
/* Bash 2.0 puts a special variable in the environment for each
|
||||
command it runs, specifying which ARGV elements are the results of
|
||||
file name wildcard expansion and therefore should not be
|
||||
considered as options. */
|
||||
char var[100];
|
||||
sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ());
|
||||
nonoption_flags = getenv (var);
|
||||
if (nonoption_flags == NULL)
|
||||
nonoption_flags_len = 0;
|
||||
else
|
||||
nonoption_flags_len = strlen (nonoption_flags);
|
||||
}
|
||||
|
||||
return optstring;
|
||||
}
|
||||
|
||||
@@ -388,10 +435,24 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
optind = 1; /* Don't scan ARGV[0], the program name. */
|
||||
}
|
||||
|
||||
/* 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. */
|
||||
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|
||||
|| (optind < nonoption_flags_len \
|
||||
&& nonoption_flags[optind] == '1'))
|
||||
|
||||
if (nextchar == NULL || *nextchar == '\0')
|
||||
{
|
||||
/* Advance to the next ARGV-element. */
|
||||
|
||||
/* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
|
||||
moved back by the user (who may also have changed the arguments). */
|
||||
if (last_nonopt > optind)
|
||||
last_nonopt = optind;
|
||||
if (first_nonopt > optind)
|
||||
first_nonopt = optind;
|
||||
|
||||
if (ordering == PERMUTE)
|
||||
{
|
||||
/* If we have just processed some options following some non-options,
|
||||
@@ -405,8 +466,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
/* Skip any additional non-options
|
||||
and extend the range of non-options previously skipped. */
|
||||
|
||||
while (optind < argc
|
||||
&& (argv[optind][0] != '-' || argv[optind][1] == '\0'))
|
||||
while (optind < argc && NONOPTION_P)
|
||||
optind++;
|
||||
last_nonopt = optind;
|
||||
}
|
||||
@@ -444,7 +504,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
/* If we have come to a non-option and did not permute it,
|
||||
either stop the scan or describe it to the caller and pass it by. */
|
||||
|
||||
if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
|
||||
if (NONOPTION_P)
|
||||
{
|
||||
if (ordering == REQUIRE_ORDER)
|
||||
return EOF;
|
||||
@@ -476,8 +536,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
|
||||
if (longopts != NULL
|
||||
&& (argv[optind][1] == '-'
|
||||
|| (long_only && (argv[optind][2]
|
||||
|| !my_index (optstring, argv[optind][1])))))
|
||||
|| (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
|
||||
{
|
||||
char *nameend;
|
||||
const struct option *p;
|
||||
@@ -490,8 +549,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
|
||||
/* Do nothing. */ ;
|
||||
|
||||
#ifdef lint
|
||||
indfound = 0; /* Avoid spurious compiler warning. */
|
||||
#ifdef lint /* Suppress `used before initialized' warning. */
|
||||
indfound = 0;
|
||||
#endif
|
||||
|
||||
/* Test all long options for either exact match
|
||||
@@ -521,10 +580,11 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
if (ambig && !exact)
|
||||
{
|
||||
if (opterr)
|
||||
fprintf (stderr, gettext ("%s: option `%s' is ambiguous\n"),
|
||||
fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
|
||||
argv[0], argv[optind]);
|
||||
nextchar += strlen (nextchar);
|
||||
optind++;
|
||||
optopt = 0;
|
||||
return '?';
|
||||
}
|
||||
|
||||
@@ -541,18 +601,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
gettext ("%s: option `--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
gettext ("%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);
|
||||
|
||||
optopt = pfound->val;
|
||||
return '?';
|
||||
}
|
||||
}
|
||||
@@ -564,9 +626,10 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
if (opterr)
|
||||
fprintf (stderr,
|
||||
gettext ("%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] == ':' ? ':' : '?';
|
||||
}
|
||||
}
|
||||
@@ -592,15 +655,16 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
if (argv[optind][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr, gettext ("%s: unrecognized option `--%s'\n"),
|
||||
fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
|
||||
argv[0], nextchar);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr, gettext ("%s: unrecognized option `%c%s'\n"),
|
||||
fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
|
||||
argv[0], argv[optind][0], nextchar);
|
||||
}
|
||||
nextchar = (char *) "";
|
||||
optind++;
|
||||
optopt = 0;
|
||||
return '?';
|
||||
}
|
||||
}
|
||||
@@ -621,10 +685,10 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
if (posixly_correct)
|
||||
/* 1003.2 specifies the format of this message. */
|
||||
fprintf (stderr, gettext ("%s: illegal option -- %c\n"),
|
||||
fprintf (stderr, _("%s: illegal option -- %c\n"),
|
||||
argv[0], c);
|
||||
else
|
||||
fprintf (stderr, gettext ("%s: invalid option -- %c\n"),
|
||||
fprintf (stderr, _("%s: invalid option -- %c\n"),
|
||||
argv[0], c);
|
||||
}
|
||||
optopt = c;
|
||||
@@ -660,8 +724,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
/* 1003.2 specifies the format of this message. */
|
||||
fprintf (stderr,
|
||||
gettext ("%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] == ':')
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _GETOPT_H
|
||||
#define _GETOPT_H 1
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
|
||||
@@ -12,44 +12,33 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h> /* grp.h on alpha OSF1 V2.0 uses "FILE *". */
|
||||
#include <grp.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* Even though SunOS 4, Ultrix 4, and 386BSD are mostly POSIX.1 compliant,
|
||||
their getgroups system call (except in the `System V' environment, which
|
||||
is troublesome in other ways) fills in an array of int, not gid_t
|
||||
(which is `short' on those systems). We do the same, for consistency.
|
||||
Kludge, kludge. */
|
||||
|
||||
#ifdef _POSIX_VERSION
|
||||
#if !defined(sun) && !defined(ultrix) && !defined(__386BSD__)
|
||||
#define GETGROUPS_T gid_t
|
||||
#else /* sun or ultrix or 386BSD */
|
||||
#define GETGROUPS_T int
|
||||
#endif /* sun or ultrix or 386BSD */
|
||||
#else /* not _POSIX_VERSION */
|
||||
#define GETGROUPS_T int
|
||||
#endif /* not _POSIX_VERSION */
|
||||
|
||||
/* setgrent, getgrent, and endgrent are not specified by POSIX.1,
|
||||
so header files might not declare them.
|
||||
If you don't have them at all, we can't implement this function.
|
||||
You lose! */
|
||||
struct group *getgrent ();
|
||||
|
||||
#if defined(USG) || defined(STDC_HEADERS)
|
||||
#include <string.h>
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
# include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
/* Like `getgroups', but for user USERNAME instead of for
|
||||
|
||||
@@ -12,25 +12,25 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef SHELLS_FILE
|
||||
/* File containing a list of nonrestricted shells, one per line. */
|
||||
#define SHELLS_FILE "/etc/shells"
|
||||
# define SHELLS_FILE "/etc/shells"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
char *malloc ();
|
||||
char *realloc ();
|
||||
|
||||
@@ -12,15 +12,19 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "backupfile.h"
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
int argmatch ();
|
||||
@@ -28,12 +32,12 @@ void invalid_arg ();
|
||||
|
||||
extern char *program_name;
|
||||
|
||||
static char *backup_args[] =
|
||||
static const char *const backup_args[] =
|
||||
{
|
||||
"never", "simple", "nil", "existing", "t", "numbered", 0
|
||||
};
|
||||
|
||||
static enum backup_type backup_types[] =
|
||||
static const enum backup_type backup_types[] =
|
||||
{
|
||||
simple, simple, numbered_existing, numbered_existing, numbered, numbered
|
||||
};
|
||||
|
||||
@@ -12,22 +12,22 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "group-member.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef _group_member_h_
|
||||
#define _group_member_h_ 1
|
||||
# define _group_member_h_ 1
|
||||
|
||||
int
|
||||
group_member ();
|
||||
|
||||
@@ -12,15 +12,19 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
|
||||
#if defined(USG) || defined(STDC_HEADERS)
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
@@ -199,7 +203,7 @@ getgidbyname (group)
|
||||
group_alist = tail;
|
||||
return &tail->id.g;
|
||||
}
|
||||
|
||||
|
||||
tail->next = nogroup_alist;
|
||||
nogroup_alist = tail;
|
||||
return 0;
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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@comco.com) */
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
|
||||
@@ -12,58 +12,57 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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> and
|
||||
Jim Meyering <meyering@cs.utexas.edu>. */
|
||||
/* Written by David MacKenzie <djm@gnu.ai.mit.edu> and Jim Meyering. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define alloca __builtin_alloca
|
||||
#if __GNUC__
|
||||
# define alloca __builtin_alloca
|
||||
#else
|
||||
#ifdef HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#else
|
||||
#ifdef _AIX
|
||||
# if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# else
|
||||
# ifdef _AIX
|
||||
#pragma alloca
|
||||
#else
|
||||
# else
|
||||
char *alloca ();
|
||||
#endif
|
||||
#endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISDIR
|
||||
#if STAT_MACROS_BROKEN
|
||||
# undef S_ISDIR
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
|
||||
#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
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ERRNO_H
|
||||
#include <errno.h>
|
||||
#if HAVE_ERRNO_H
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#if __STDC__
|
||||
#undef __P
|
||||
#define __P(args) args
|
||||
# undef __P
|
||||
# define __P(args) args
|
||||
#else
|
||||
#define __P(args) ()
|
||||
# define __P(args) ()
|
||||
#endif
|
||||
|
||||
int
|
||||
make_path __P ((const char *_argpath,
|
||||
int _mode,
|
||||
int _parent_mode,
|
||||
uid_t _owner,
|
||||
gid_t _group,
|
||||
int _preserve_existing,
|
||||
const char *_verbose_fmt_string));
|
||||
make_path __P ((const char *_argpath,
|
||||
int _mode,
|
||||
int _parent_mode,
|
||||
uid_t _owner,
|
||||
gid_t _group,
|
||||
int _preserve_existing,
|
||||
const char *_verbose_fmt_string));
|
||||
|
||||
@@ -13,8 +13,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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>. */
|
||||
|
||||
|
||||
61
lib/memcasecmp.c
Normal file
61
lib/memcasecmp.c
Normal file
@@ -0,0 +1,61 @@
|
||||
/* Case-insensitive buffer comparator.
|
||||
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. */
|
||||
|
||||
/* Jim Meyering (meyering@na-net.ornl.gov) */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
#define IN_CTYPE_DOMAIN(c) 1
|
||||
#else
|
||||
#define IN_CTYPE_DOMAIN(c) isascii(c)
|
||||
#endif
|
||||
#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
|
||||
|
||||
#if _LIBC || STDC_HEADERS
|
||||
# define TOLOWER(c) tolower (c)
|
||||
#else
|
||||
# define TOLOWER(c) (ISUPPER (c) ? tolower (c) : (c))
|
||||
#endif
|
||||
|
||||
#include "memcasecmp.h"
|
||||
|
||||
/* Like memcmp, but ignore differences in case. */
|
||||
|
||||
int
|
||||
memcasecmp (vs1, vs2, n)
|
||||
const void *vs1;
|
||||
const void *vs2;
|
||||
size_t n;
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned char *s1 = (unsigned char *) vs1;
|
||||
unsigned char *s2 = (unsigned char *) vs2;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
unsigned char u1 = *s1++;
|
||||
unsigned char u2 = *s2++;
|
||||
if (TOLOWER (u1) != TOLOWER (u2))
|
||||
return TOLOWER (u1) - TOLOWER (u2);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
9
lib/memcasecmp.h
Normal file
9
lib/memcasecmp.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#undef __P
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# define __P(args) args
|
||||
#else
|
||||
# define __P(args) ()
|
||||
#endif
|
||||
|
||||
int
|
||||
memcasecmp __P((const void *vs1, const void *vs2, size_t n));
|
||||
@@ -20,7 +20,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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
|
||||
@@ -15,8 +15,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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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"
|
||||
|
||||
@@ -4,21 +4,25 @@
|
||||
By David MacKenzie <djm@gnu.ai.mit.edu>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
void
|
||||
void *
|
||||
memmove (dest, source, length)
|
||||
char *dest;
|
||||
const char *source;
|
||||
unsigned length;
|
||||
{
|
||||
char *d0 = dest;
|
||||
if (source < dest)
|
||||
/* Moving from low mem to hi mem; start at end. */
|
||||
for (source += length, dest += length; length; --length)
|
||||
*--dest = *--source;
|
||||
else if (source != dest)
|
||||
/* Moving from hi mem to low mem; start at beginning. */
|
||||
for (; length; --length)
|
||||
*dest++ = *source++;
|
||||
{
|
||||
/* Moving from hi mem to low mem; start at beginning. */
|
||||
for (; length; --length)
|
||||
*dest++ = *source++;
|
||||
}
|
||||
return (void *) d0;
|
||||
}
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
char *
|
||||
memset (str, c, len)
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
|
||||
807
lib/mktime.c
807
lib/mktime.c
@@ -1,45 +1,54 @@
|
||||
/* Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
||||
Contributed by Noel Cragg (noel@cs.oberlin.edu), with fixes by
|
||||
Michael E. Calwas (calwas@ttd.teradyne.com) and
|
||||
Wade Hampton (tasi029@tmn.com).
|
||||
/* 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.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
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, 675 Mass Ave, Cambridge, MA 02139, 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. */
|
||||
|
||||
/* Define this to have a standalone program to test this implementation of
|
||||
mktime. */
|
||||
/* #define DEBUG */
|
||||
/* #define DEBUG 1 */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
/* Assume that leap seconds are possible, unless told otherwise.
|
||||
If the host has a `zic' command with a `-L leapsecondfilename' option,
|
||||
then it supports leap seconds; otherwise it probably doesn't. */
|
||||
#ifndef LEAP_SECONDS_POSSIBLE
|
||||
#define LEAP_SECONDS_POSSIBLE 1
|
||||
#endif
|
||||
|
||||
#include <sys/types.h> /* Some systems define `time_t' here. */
|
||||
#include <time.h>
|
||||
|
||||
|
||||
#ifndef __isleap
|
||||
/* Nonzero if YEAR is a leap year (every 4 years,
|
||||
except every 100th isn't, and every 400th is). */
|
||||
#define __isleap(year) \
|
||||
((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
|
||||
#if __STDC__ || __GNU_LIBRARY__ || STDC_HEADERS
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
#include <stdio.h>
|
||||
#if __STDC__ || __GNU_LIBRARY__ || STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
/* Make it work even if the system's libc has its own mktime routine. */
|
||||
#define mktime my_mktime
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef __P
|
||||
#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
|
||||
#define __P(args) args
|
||||
@@ -48,456 +57,352 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#endif /* GCC. */
|
||||
#endif /* Not __P. */
|
||||
|
||||
/* How many days are in each month. */
|
||||
const unsigned short int __mon_lengths[2][12] =
|
||||
#ifndef CHAR_BIT
|
||||
#define CHAR_BIT 8
|
||||
#endif
|
||||
|
||||
#ifndef INT_MIN
|
||||
#define INT_MIN (~0 << (sizeof (int) * CHAR_BIT - 1))
|
||||
#endif
|
||||
#ifndef INT_MAX
|
||||
#define INT_MAX (~0 - INT_MIN)
|
||||
#endif
|
||||
|
||||
#ifndef TIME_T_MIN
|
||||
#define TIME_T_MIN (0 < (time_t) -1 ? (time_t) 0 \
|
||||
: ~ (time_t) 0 << (sizeof (time_t) * CHAR_BIT - 1))
|
||||
#endif
|
||||
#ifndef TIME_T_MAX
|
||||
#define TIME_T_MAX (~ (time_t) 0 - TIME_T_MIN)
|
||||
#endif
|
||||
|
||||
#define TM_YEAR_BASE 1900
|
||||
#define EPOCH_YEAR 1970
|
||||
|
||||
#ifndef __isleap
|
||||
/* Nonzero if YEAR is a leap year (every 4 years,
|
||||
except every 100th isn't, and every 400th is). */
|
||||
#define __isleap(year) \
|
||||
((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
|
||||
#endif
|
||||
|
||||
/* How many days come before each month (0-12). */
|
||||
const unsigned short int __mon_yday[2][13] =
|
||||
{
|
||||
/* Normal years. */
|
||||
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
|
||||
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
|
||||
/* Leap years. */
|
||||
{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
|
||||
{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
|
||||
};
|
||||
|
||||
|
||||
static int times_through_search; /* This library routine should never
|
||||
hang -- make sure we always return
|
||||
when we're searching for a value */
|
||||
static time_t ydhms_tm_diff __P ((int, int, int, int, int, const struct tm *));
|
||||
time_t __mktime_internal __P ((struct tm *,
|
||||
struct tm *(*) (const time_t *, struct tm *),
|
||||
time_t *));
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
int debugging_enabled = 0;
|
||||
|
||||
/* Print the values in a `struct tm'. */
|
||||
static void
|
||||
printtm (it)
|
||||
struct tm *it;
|
||||
{
|
||||
printf ("%02d/%02d/%04d %02d:%02d:%02d (%s) yday:%03d dst:%d gmtoffset:%ld",
|
||||
it->tm_mon + 1,
|
||||
it->tm_mday,
|
||||
it->tm_year + 1900,
|
||||
it->tm_hour,
|
||||
it->tm_min,
|
||||
it->tm_sec,
|
||||
it->tm_zone,
|
||||
it->tm_yday,
|
||||
it->tm_isdst,
|
||||
it->tm_gmtoff);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static time_t
|
||||
dist_tm (t1, t2)
|
||||
struct tm *t1;
|
||||
struct tm *t2;
|
||||
{
|
||||
time_t distance = 0;
|
||||
unsigned long int v1, v2;
|
||||
int diff_flag = 0;
|
||||
|
||||
v1 = v2 = 0;
|
||||
|
||||
#define doit(x, secs) \
|
||||
v1 += t1->x * secs; \
|
||||
v2 += t2->x * secs; \
|
||||
if (!diff_flag) \
|
||||
{ \
|
||||
if (t1->x < t2->x) \
|
||||
diff_flag = -1; \
|
||||
else if (t1->x > t2->x) \
|
||||
diff_flag = 1; \
|
||||
}
|
||||
|
||||
doit (tm_year, 31536000); /* Okay, not all years have 365 days. */
|
||||
doit (tm_mon, 2592000); /* Okay, not all months have 30 days. */
|
||||
doit (tm_mday, 86400);
|
||||
doit (tm_hour, 3600);
|
||||
doit (tm_min, 60);
|
||||
doit (tm_sec, 1);
|
||||
|
||||
#undef doit
|
||||
|
||||
/* We should also make sure that the sign of DISTANCE is correct -- if
|
||||
DIFF_FLAG is positive, the distance should be positive and vice versa. */
|
||||
|
||||
distance = (v1 > v2) ? (v1 - v2) : (v2 - v1);
|
||||
if (diff_flag < 0)
|
||||
distance = -distance;
|
||||
|
||||
if (times_through_search > 20) /* Arbitrary # of calls, but makes sure we
|
||||
never hang if there's a problem with
|
||||
this algorithm. */
|
||||
{
|
||||
distance = diff_flag;
|
||||
}
|
||||
|
||||
/* We need this DIFF_FLAG business because it is forseeable that the
|
||||
distance may be zero when, in actuality, the two structures are
|
||||
different. This is usually the case when the dates are 366 days apart
|
||||
and one of the years is a leap year. */
|
||||
|
||||
if (distance == 0 && diff_flag)
|
||||
distance = 86400 * diff_flag;
|
||||
|
||||
return distance;
|
||||
}
|
||||
|
||||
|
||||
/* MKTIME converts the values in a struct tm to a time_t. The values
|
||||
in tm_wday and tm_yday are ignored; other values can be put outside
|
||||
of legal ranges since they will be normalized. This routine takes
|
||||
care of that normalization. */
|
||||
|
||||
void
|
||||
do_normalization (tmptr)
|
||||
struct tm *tmptr;
|
||||
{
|
||||
|
||||
#define normalize(foo,x,y,bar); \
|
||||
while (tmptr->foo < x) \
|
||||
{ \
|
||||
tmptr->bar--; \
|
||||
tmptr->foo = (y - (x - tmptr->foo) + 1); \
|
||||
} \
|
||||
while (tmptr->foo > y) \
|
||||
{ \
|
||||
tmptr->foo = (x + (tmptr->foo - y) - 1); \
|
||||
tmptr->bar++; \
|
||||
}
|
||||
|
||||
normalize (tm_sec, 0, 59, tm_min);
|
||||
normalize (tm_min, 0, 59, tm_hour);
|
||||
normalize (tm_hour, 0, 23, tm_mday);
|
||||
|
||||
/* Do the month first, so day range can be found. */
|
||||
normalize (tm_mon, 0, 11, tm_year);
|
||||
|
||||
/* Since the day range modifies the month, we should be careful how
|
||||
we reference the array of month lengths -- it is possible that
|
||||
the month will go negative, hence the modulo...
|
||||
|
||||
Also, tm_year is the year - 1900, so we have to 1900 to have it
|
||||
work correctly. */
|
||||
|
||||
normalize (tm_mday, 1,
|
||||
__mon_lengths[__isleap (tmptr->tm_year + 1900)]
|
||||
[((tmptr->tm_mon < 0)
|
||||
? (12 + (tmptr->tm_mon % 12))
|
||||
: (tmptr->tm_mon % 12)) ],
|
||||
tm_mon);
|
||||
|
||||
/* Do the month again, because the day may have pushed it out of range. */
|
||||
normalize (tm_mon, 0, 11, tm_year);
|
||||
|
||||
/* Do the day again, because the month may have changed the range. */
|
||||
normalize (tm_mday, 1,
|
||||
__mon_lengths[__isleap (tmptr->tm_year + 1900)]
|
||||
[((tmptr->tm_mon < 0)
|
||||
? (12 + (tmptr->tm_mon % 12))
|
||||
: (tmptr->tm_mon % 12)) ],
|
||||
tm_mon);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (debugging_enabled)
|
||||
{
|
||||
printf (" After normalizing:\n ");
|
||||
printtm (tmptr);
|
||||
putchar ('\n');
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Here's where the work gets done. */
|
||||
|
||||
#define BAD_STRUCT_TM ((time_t) -1)
|
||||
|
||||
time_t
|
||||
_mktime_internal (timeptr, producer)
|
||||
struct tm *timeptr;
|
||||
struct tm *(*producer) __P ((const time_t *));
|
||||
{
|
||||
struct tm our_tm; /* our working space */
|
||||
struct tm *me = &our_tm; /* a pointer to the above */
|
||||
time_t result; /* the value we return */
|
||||
|
||||
*me = *timeptr; /* copy the struct tm that was passed
|
||||
in by the caller */
|
||||
|
||||
|
||||
/***************************/
|
||||
/* Normalize the structure */
|
||||
/***************************/
|
||||
|
||||
/* This routine assumes that the value of TM_ISDST is -1, 0, or 1.
|
||||
If the user didn't pass it in that way, fix it. */
|
||||
|
||||
if (me->tm_isdst > 0)
|
||||
me->tm_isdst = 1;
|
||||
else if (me->tm_isdst < 0)
|
||||
me->tm_isdst = -1;
|
||||
|
||||
do_normalization (me);
|
||||
|
||||
/* Get out of here if it's not possible to represent this struct.
|
||||
If any of the values in the normalized struct tm are negative,
|
||||
our algorithms won't work. Luckily, we only need to check the
|
||||
year at this point; normalization guarantees that all values will
|
||||
be in correct ranges EXCEPT the year. */
|
||||
|
||||
if (me->tm_year < 0)
|
||||
return BAD_STRUCT_TM;
|
||||
|
||||
/*************************************************/
|
||||
/* Find the appropriate time_t for the structure */
|
||||
/*************************************************/
|
||||
|
||||
/* Modified b-search -- make intelligent guesses as to where the
|
||||
time might lie along the timeline, assuming that our target time
|
||||
lies a linear distance (w/o considering time jumps of a
|
||||
particular region).
|
||||
|
||||
Assume that time does not fluctuate at all along the timeline --
|
||||
e.g., assume that a day will always take 86400 seconds, etc. --
|
||||
and come up with a hypothetical value for the time_t
|
||||
representation of the struct tm TARGET, in relation to the guess
|
||||
variable -- it should be pretty close!
|
||||
|
||||
After testing this, the maximum number of iterations that I had
|
||||
on any number that I tried was 3! Not bad.
|
||||
|
||||
The reason this is not a subroutine is that we will modify some
|
||||
fields in the struct tm (yday and mday). I've never felt good
|
||||
about side-effects when writing structured code... */
|
||||
|
||||
{
|
||||
struct tm *guess_tm;
|
||||
time_t guess = 0;
|
||||
time_t distance = 0;
|
||||
time_t last_distance = 0;
|
||||
|
||||
times_through_search = 0;
|
||||
|
||||
do
|
||||
{
|
||||
guess += distance;
|
||||
|
||||
times_through_search++;
|
||||
|
||||
guess_tm = (*producer) (&guess);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (debugging_enabled)
|
||||
{
|
||||
printf (" Guessing time_t == %d\n ", (int) guess);
|
||||
printtm (guess_tm);
|
||||
putchar ('\n');
|
||||
}
|
||||
#endif
|
||||
|
||||
/* How far is our guess from the desired struct tm? */
|
||||
distance = dist_tm (me, guess_tm);
|
||||
|
||||
/* Handle periods of time where a period of time is skipped.
|
||||
For example, 2:15 3 April 1994 does not exist, because DST
|
||||
is in effect. The distance function will alternately
|
||||
return values of 3600 and -3600, because it doesn't know
|
||||
that the requested time doesn't exist. In these situations
|
||||
(even if the skip is not exactly an hour) the distances
|
||||
returned will be the same, but alternating in sign. We
|
||||
want the later time, so check to see that the distance is
|
||||
oscillating and we've chosen the correct of the two
|
||||
possibilities.
|
||||
|
||||
Useful: 3 Apr 94 765356300, 30 Oct 94 783496000 */
|
||||
|
||||
if ((distance == -last_distance) && (distance < last_distance))
|
||||
{
|
||||
/* If the caller specified that the DST flag was off, it's
|
||||
not possible to represent this time. */
|
||||
if (me->tm_isdst == 0)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf (" Distance is oscillating -- dst flag nixes struct!\n");
|
||||
#endif
|
||||
return BAD_STRUCT_TM;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
printf (" Distance is oscillating -- chose the later time.\n");
|
||||
#endif
|
||||
distance = 0;
|
||||
}
|
||||
|
||||
if ((distance == 0) && (me->tm_isdst != -1)
|
||||
&& (me->tm_isdst != guess_tm->tm_isdst))
|
||||
{
|
||||
/* If we're in this code, we've got the right time but the
|
||||
wrong daylight savings flag. We need to move away from
|
||||
the time that we have and approach the other time from
|
||||
the other direction. That is, if I've requested the
|
||||
non-DST version of a time and I get the DST version
|
||||
instead, I want to put us forward in time and search
|
||||
backwards to get the other time. I checked all of the
|
||||
configuration files for the tz package -- no entry
|
||||
saves more than two hours, so I think we'll be safe by
|
||||
moving 24 hours in one direction. IF THE AMOUNT OF
|
||||
TIME SAVED IN THE CONFIGURATION FILES CHANGES, THIS
|
||||
VALUE MAY NEED TO BE ADJUSTED. Luckily, we can never
|
||||
have more than one level of overlaps, or this would
|
||||
never work. */
|
||||
|
||||
#define SKIP_VALUE 86400
|
||||
|
||||
if (guess_tm->tm_isdst == 0)
|
||||
/* we got the later one, but want the earlier one */
|
||||
distance = -SKIP_VALUE;
|
||||
else
|
||||
distance = SKIP_VALUE;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf (" Got the right time, wrong DST value -- adjusting\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
last_distance = distance;
|
||||
|
||||
} while (distance != 0);
|
||||
|
||||
/* Check to see that the dst flag matches */
|
||||
|
||||
if (me->tm_isdst != -1)
|
||||
{
|
||||
if (me->tm_isdst != guess_tm->tm_isdst)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf (" DST flag doesn't match! FIXME?\n");
|
||||
#endif
|
||||
return BAD_STRUCT_TM;
|
||||
}
|
||||
}
|
||||
|
||||
result = guess; /* Success! */
|
||||
|
||||
/* On successful completion, the values of tm_wday and tm_yday
|
||||
have to be set appropriately. */
|
||||
|
||||
/* me->tm_yday = guess_tm->tm_yday;
|
||||
me->tm_mday = guess_tm->tm_mday; */
|
||||
|
||||
*me = *guess_tm;
|
||||
}
|
||||
|
||||
/* Update the caller's version of the structure */
|
||||
|
||||
*timeptr = *me;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
time_t
|
||||
#ifdef DEBUG /* make it work even if the system's
|
||||
libc has it's own mktime routine */
|
||||
my_mktime (timeptr)
|
||||
#if ! HAVE_LOCALTIME_R && ! defined (localtime_r)
|
||||
#ifdef _LIBC
|
||||
#define localtime_r __localtime_r
|
||||
#else
|
||||
mktime (timeptr)
|
||||
#endif
|
||||
struct tm *timeptr;
|
||||
/* Approximate localtime_r as best we can in its absence. */
|
||||
#define localtime_r my_localtime_r
|
||||
static struct tm *localtime_r __P ((const time_t *, struct tm *));
|
||||
static struct tm *
|
||||
localtime_r (t, tp)
|
||||
const time_t *t;
|
||||
struct tm *tp;
|
||||
{
|
||||
return _mktime_internal (timeptr, localtime);
|
||||
struct tm *l = localtime (t);
|
||||
if (! l)
|
||||
return 0;
|
||||
*tp = *l;
|
||||
return tp;
|
||||
}
|
||||
#endif /* ! _LIBC */
|
||||
#endif /* ! HAVE_LOCALTIME_R && ! defined (localtime_r) */
|
||||
|
||||
|
||||
/* Yield the difference between (YEAR-YDAY HOUR:MIN:SEC) and (*TP),
|
||||
measured in seconds, ignoring leap seconds.
|
||||
YEAR uses the same numbering as TM->tm_year.
|
||||
All values are in range, except possibly YEAR.
|
||||
If overflow occurs, yield the low order bits of the correct answer. */
|
||||
static time_t
|
||||
ydhms_tm_diff (year, yday, hour, min, sec, tp)
|
||||
int year, yday, hour, min, sec;
|
||||
const struct tm *tp;
|
||||
{
|
||||
time_t ay = year + (time_t) (TM_YEAR_BASE - 1);
|
||||
time_t by = tp->tm_year + (time_t) (TM_YEAR_BASE - 1);
|
||||
time_t intervening_leap_days =
|
||||
(ay/4 - by/4) - (ay/100 - by/100) + (ay/400 - by/400);
|
||||
time_t years = ay - by;
|
||||
time_t days = (365 * years + intervening_leap_days
|
||||
+ (yday - tp->tm_yday));
|
||||
return (60 * (60 * (24 * days + (hour - tp->tm_hour))
|
||||
+ (min - tp->tm_min))
|
||||
+ (sec - tp->tm_sec));
|
||||
}
|
||||
|
||||
|
||||
/* Convert *TP to a time_t value. */
|
||||
time_t
|
||||
mktime (tp)
|
||||
struct tm *tp;
|
||||
{
|
||||
static time_t localtime_offset;
|
||||
return __mktime_internal (tp, localtime_r, &localtime_offset);
|
||||
}
|
||||
|
||||
/* Convert *TP to a time_t value, inverting
|
||||
the monotonic and mostly-unit-linear conversion function CONVERT.
|
||||
Use *OFFSET to keep track of a guess at the offset of the result,
|
||||
compared to what the result would be for UTC without leap seconds.
|
||||
If *OFFSET's guess is correct, only one CONVERT call is needed. */
|
||||
time_t
|
||||
__mktime_internal (tp, convert, offset)
|
||||
struct tm *tp;
|
||||
struct tm *(*convert) __P ((const time_t *, struct tm *));
|
||||
time_t *offset;
|
||||
{
|
||||
time_t t, dt, t0;
|
||||
struct tm tm;
|
||||
|
||||
/* The maximum number of probes (calls to CONVERT) should be enough
|
||||
to handle any combinations of time zone rule changes, solar time,
|
||||
and leap seconds. Posix.1 prohibits leap seconds, but some hosts
|
||||
have them anyway. */
|
||||
int remaining_probes = 4;
|
||||
|
||||
/* Time requested. Copy it in case CONVERT modifies *TP; this can
|
||||
occur if TP is localtime's returned value and CONVERT is localtime. */
|
||||
int sec = tp->tm_sec;
|
||||
int min = tp->tm_min;
|
||||
int hour = tp->tm_hour;
|
||||
int mday = tp->tm_mday;
|
||||
int mon = tp->tm_mon;
|
||||
int year_requested = tp->tm_year;
|
||||
int isdst = tp->tm_isdst;
|
||||
|
||||
/* Ensure that mon is in range, and set year accordingly. */
|
||||
int mon_remainder = mon % 12;
|
||||
int negative_mon_remainder = mon_remainder < 0;
|
||||
int mon_years = mon / 12 - negative_mon_remainder;
|
||||
int year = year_requested + mon_years;
|
||||
|
||||
/* The other values need not be in range:
|
||||
the remaining code handles minor overflows correctly,
|
||||
assuming int and time_t arithmetic wraps around.
|
||||
Major overflows are caught at the end. */
|
||||
|
||||
/* Calculate day of year from year, month, and day of month.
|
||||
The result need not be in range. */
|
||||
int yday = ((__mon_yday[__isleap (year + TM_YEAR_BASE)]
|
||||
[mon_remainder + 12 * negative_mon_remainder])
|
||||
+ mday - 1);
|
||||
|
||||
#if LEAP_SECONDS_POSSIBLE
|
||||
/* Handle out-of-range seconds specially,
|
||||
since ydhms_tm_diff assumes every minute has 60 seconds. */
|
||||
int sec_requested = sec;
|
||||
if (sec < 0)
|
||||
sec = 0;
|
||||
if (59 < sec)
|
||||
sec = 59;
|
||||
#endif
|
||||
|
||||
/* Invert CONVERT by probing. First assume the same offset as last time.
|
||||
Then repeatedly use the error to improve the guess. */
|
||||
|
||||
tm.tm_year = EPOCH_YEAR - TM_YEAR_BASE;
|
||||
tm.tm_yday = tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
|
||||
t0 = ydhms_tm_diff (year, yday, hour, min, sec, &tm);
|
||||
|
||||
for (t = t0 + *offset;
|
||||
(dt = ydhms_tm_diff (year, yday, hour, min, sec, (*convert) (&t, &tm)));
|
||||
t += dt)
|
||||
if (--remaining_probes == 0)
|
||||
return -1;
|
||||
|
||||
/* Check whether tm.tm_isdst has the requested value, if any. */
|
||||
if (0 <= isdst && 0 <= tm.tm_isdst)
|
||||
{
|
||||
int dst_diff = (isdst != 0) - (tm.tm_isdst != 0);
|
||||
if (dst_diff)
|
||||
{
|
||||
/* Move two hours in the direction indicated by the disagreement,
|
||||
probe some more, and switch to a new time if found.
|
||||
The largest known fallback due to daylight savings is two hours:
|
||||
once, in Newfoundland, 1988-10-30 02:00 -> 00:00. */
|
||||
time_t ot = t - 2 * 60 * 60 * dst_diff;
|
||||
while (--remaining_probes != 0)
|
||||
{
|
||||
struct tm otm;
|
||||
if (! (dt = ydhms_tm_diff (year, yday, hour, min, sec,
|
||||
(*convert) (&ot, &otm))))
|
||||
{
|
||||
t = ot;
|
||||
tm = otm;
|
||||
break;
|
||||
}
|
||||
if ((ot += dt) == t)
|
||||
break; /* Avoid a redundant probe. */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*offset = t - t0;
|
||||
|
||||
#if LEAP_SECONDS_POSSIBLE
|
||||
if (sec_requested != tm.tm_sec)
|
||||
{
|
||||
/* Adjust time to reflect the tm_sec requested, not the normalized value.
|
||||
Also, repair any damage from a false match due to a leap second. */
|
||||
t += sec_requested - sec + (sec == 0 && tm.tm_sec == 60);
|
||||
(*convert) (&t, &tm);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3)
|
||||
{
|
||||
/* time_t isn't large enough to rule out overflows in ydhms_tm_diff,
|
||||
so check for major overflows. A gross check suffices,
|
||||
since if t has overflowed, it is off by a multiple of
|
||||
TIME_T_MAX - TIME_T_MIN + 1. So ignore any component of
|
||||
the difference that is bounded by a small value. */
|
||||
|
||||
double dyear = (double) year_requested + mon_years - tm.tm_year;
|
||||
double dday = 366 * dyear + mday;
|
||||
double dsec = 60 * (60 * (24 * dday + hour) + min) + sec_requested;
|
||||
|
||||
if (TIME_T_MAX / 3 - TIME_T_MIN / 3 < (dsec < 0 ? - dsec : dsec))
|
||||
return -1;
|
||||
}
|
||||
|
||||
*tp = tm;
|
||||
return t;
|
||||
}
|
||||
|
||||
#ifdef weak_alias
|
||||
weak_alias (mktime, timelocal)
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
#if DEBUG
|
||||
|
||||
static int
|
||||
not_equal_tm (a, b)
|
||||
struct tm *a;
|
||||
struct tm *b;
|
||||
{
|
||||
return ((a->tm_sec ^ b->tm_sec)
|
||||
| (a->tm_min ^ b->tm_min)
|
||||
| (a->tm_hour ^ b->tm_hour)
|
||||
| (a->tm_mday ^ b->tm_mday)
|
||||
| (a->tm_mon ^ b->tm_mon)
|
||||
| (a->tm_year ^ b->tm_year)
|
||||
| (a->tm_mday ^ b->tm_mday)
|
||||
| (a->tm_yday ^ b->tm_yday)
|
||||
| (a->tm_isdst ^ b->tm_isdst));
|
||||
}
|
||||
|
||||
static void
|
||||
print_tm (tp)
|
||||
struct tm *tp;
|
||||
{
|
||||
printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d",
|
||||
tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday,
|
||||
tp->tm_hour, tp->tm_min, tp->tm_sec,
|
||||
tp->tm_yday, tp->tm_wday, tp->tm_isdst);
|
||||
}
|
||||
|
||||
static int
|
||||
check_result (tk, tmk, tl, tml)
|
||||
time_t tk;
|
||||
struct tm tmk;
|
||||
time_t tl;
|
||||
struct tm tml;
|
||||
{
|
||||
if (tk != tl || not_equal_tm (&tmk, &tml))
|
||||
{
|
||||
printf ("mktime (");
|
||||
print_tm (&tmk);
|
||||
printf (")\nyields (");
|
||||
print_tm (&tml);
|
||||
printf (") == %ld, should be %ld\n", (long) tl, (long) tk);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
char **argv;
|
||||
{
|
||||
int time;
|
||||
int result_time;
|
||||
struct tm *tmptr;
|
||||
|
||||
if (argc == 1)
|
||||
int status = 0;
|
||||
struct tm tm, tmk, tml;
|
||||
time_t tk, tl;
|
||||
char trailer;
|
||||
|
||||
if ((argc == 3 || argc == 4)
|
||||
&& (sscanf (argv[1], "%d-%d-%d%c",
|
||||
&tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer)
|
||||
== 3)
|
||||
&& (sscanf (argv[2], "%d:%d:%d%c",
|
||||
&tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer)
|
||||
== 3))
|
||||
{
|
||||
long q;
|
||||
|
||||
printf ("starting long test...\n");
|
||||
|
||||
for (q = 10000000; q < 1000000000; q += 599)
|
||||
{
|
||||
struct tm *tm = localtime ((time_t *) &q);
|
||||
if ((q % 10000) == 0) { printf ("%ld\n", q); fflush (stdout); }
|
||||
if (q != my_mktime (tm))
|
||||
{ printf ("failed for %ld\n", q); fflush (stdout); }
|
||||
}
|
||||
|
||||
printf ("test finished\n");
|
||||
|
||||
exit (0);
|
||||
tm.tm_year -= TM_YEAR_BASE;
|
||||
tm.tm_mon--;
|
||||
tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]);
|
||||
tmk = tm;
|
||||
tl = mktime (&tmk);
|
||||
tml = *localtime (&tl);
|
||||
printf ("mktime returns %ld == ", (long) tl);
|
||||
print_tm (&tmk);
|
||||
printf ("\n");
|
||||
status = check_result (tl, tmk, tl, tml);
|
||||
}
|
||||
|
||||
if (argc != 2)
|
||||
else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0))
|
||||
{
|
||||
printf ("wrong # of args\n");
|
||||
exit (0);
|
||||
time_t from = atol (argv[1]);
|
||||
time_t by = atol (argv[2]);
|
||||
time_t to = atol (argv[3]);
|
||||
|
||||
if (argc == 4)
|
||||
for (tl = from; tl <= to; tl += by)
|
||||
{
|
||||
tml = *localtime (&tl);
|
||||
tmk = tml;
|
||||
tk = mktime (&tmk);
|
||||
status |= check_result (tk, tmk, tl, tml);
|
||||
}
|
||||
else
|
||||
for (tl = from; tl <= to; tl += by)
|
||||
{
|
||||
/* Null benchmark. */
|
||||
tml = *localtime (&tl);
|
||||
tmk = tml;
|
||||
tk = tl;
|
||||
status |= check_result (tk, tmk, tl, tml);
|
||||
}
|
||||
}
|
||||
|
||||
debugging_enabled = 1; /* We want to see the info */
|
||||
else
|
||||
printf ("Usage:\
|
||||
\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\
|
||||
\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\
|
||||
\t%s FROM BY TO - # Do not test those values (for benchmark).\n",
|
||||
argv[0], argv[0], argv[0]);
|
||||
|
||||
++argv;
|
||||
time = atoi (*argv);
|
||||
|
||||
tmptr = localtime ((time_t *) &time);
|
||||
printf ("Localtime tells us that a time_t of %d represents\n ", time);
|
||||
printtm (tmptr);
|
||||
putchar ('\n');
|
||||
|
||||
printf (" Given localtime's return val, mktime returns %d which is\n ",
|
||||
(int) my_mktime (tmptr));
|
||||
printtm (tmptr);
|
||||
putchar ('\n');
|
||||
|
||||
#if 0
|
||||
tmptr->tm_sec -= 20;
|
||||
tmptr->tm_min -= 20;
|
||||
tmptr->tm_hour -= 20;
|
||||
tmptr->tm_mday -= 20;
|
||||
tmptr->tm_mon -= 20;
|
||||
tmptr->tm_year -= 20;
|
||||
tmptr->tm_gmtoff -= 20000; /* This has no effect! */
|
||||
tmptr->tm_zone = NULL; /* Nor does this! */
|
||||
tmptr->tm_isdst = -1;
|
||||
#endif
|
||||
|
||||
tmptr->tm_hour += 1;
|
||||
tmptr->tm_isdst = -1;
|
||||
|
||||
printf ("\n\nchanged ranges: ");
|
||||
printtm (tmptr);
|
||||
putchar ('\n');
|
||||
|
||||
result_time = my_mktime (tmptr);
|
||||
printf ("\nmktime: %d\n", result_time);
|
||||
|
||||
tmptr->tm_isdst = 0;
|
||||
|
||||
printf ("\n\nchanged ranges: ");
|
||||
printtm (tmptr);
|
||||
putchar ('\n');
|
||||
|
||||
result_time = my_mktime (tmptr);
|
||||
printf ("\nmktime: %d\n", result_time);
|
||||
return status;
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
/*
|
||||
Local Variables:
|
||||
compile-command: "gcc -g mktime.c -o mktime -DDEBUG"
|
||||
compile-command: "gcc -DDEBUG=1 -Wall -O -g mktime.c -o mktime"
|
||||
End:
|
||||
*/
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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@ai.mit.edu> */
|
||||
|
||||
@@ -24,30 +24,30 @@
|
||||
changing the mode of many files, this probably results in a
|
||||
performance gain. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include "modechange.h"
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
char *malloc ();
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
# define NULL 0
|
||||
#endif
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISDIR
|
||||
#if STAT_MACROS_BROKEN
|
||||
# undef S_ISDIR
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
|
||||
#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
|
||||
|
||||
/* Return newly allocated memory to hold one element of type TYPE. */
|
||||
@@ -72,7 +72,7 @@ static int oatoi ();
|
||||
|
||||
struct mode_change *
|
||||
mode_compile (mode_string, masked_ops)
|
||||
register char *mode_string;
|
||||
const char *mode_string;
|
||||
unsigned masked_ops;
|
||||
{
|
||||
struct mode_change *head; /* First element of the linked list. */
|
||||
@@ -244,7 +244,7 @@ invalid:
|
||||
unsigned short
|
||||
mode_adjust (oldmode, changes)
|
||||
unsigned oldmode;
|
||||
register struct mode_change *changes;
|
||||
const struct mode_change *changes;
|
||||
{
|
||||
unsigned short newmode; /* The adjusted mode and one operand. */
|
||||
unsigned short value; /* The other operand. */
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Masks for the `flags' field in a `struct mode_change'. */
|
||||
|
||||
@@ -44,12 +44,14 @@ struct mode_change
|
||||
#define MODE_INVALID (struct mode_change *) 0
|
||||
#define MODE_MEMORY_EXHAUSTED (struct mode_change *) 1
|
||||
|
||||
#ifdef __STDC__
|
||||
struct mode_change *mode_compile (char *, unsigned);
|
||||
unsigned short mode_adjust (unsigned, struct mode_change *);
|
||||
void mode_free (struct mode_change *);
|
||||
#else
|
||||
struct mode_change *mode_compile ();
|
||||
unsigned short mode_adjust ();
|
||||
void mode_free ();
|
||||
#endif
|
||||
#ifndef __P
|
||||
# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
|
||||
# define __P(args) args
|
||||
# else
|
||||
# define __P(args) ()
|
||||
# endif /* GCC. */
|
||||
#endif /* Not __P. */
|
||||
|
||||
struct mode_change *mode_compile __P ((const char *, unsigned));
|
||||
unsigned short mode_adjust __P ((unsigned, const struct mode_change *));
|
||||
void mode_free __P ((struct mode_change *));
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
@@ -80,6 +80,10 @@ void error ();
|
||||
#include <sys/statfs.h>
|
||||
#endif
|
||||
|
||||
#ifdef MOUNTED_LISTMNTENT
|
||||
#include <mntent.h>
|
||||
#endif
|
||||
|
||||
#ifdef MOUNTED_GETMNTENT2 /* SVR4. */
|
||||
#include <sys/mnttab.h>
|
||||
#endif
|
||||
@@ -195,6 +199,36 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
me->me_next = NULL;
|
||||
mount_list = mtail = me;
|
||||
|
||||
#ifdef MOUNTED_LISTMNTENT
|
||||
{
|
||||
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.
|
||||
*/
|
||||
|
||||
if(listmntent(&mntlist, KMTAB, NULL, NULL) < 0)
|
||||
return NULL;
|
||||
p = mntlist;
|
||||
while(p){
|
||||
mnt = p->ment;
|
||||
me = (struct mount_entry*) xmalloc(sizeof (struct mount_entry));
|
||||
me->me_devname = xstrdup(mnt->mnt_fsname);
|
||||
me->me_mountdir = xstrdup(mnt->mnt_dir);
|
||||
me->me_type = xstrdup(mnt->mnt_type);
|
||||
me->me_dev = -1;
|
||||
me->me_next = NULL;
|
||||
mtail->me_next = me;
|
||||
mtail = me;
|
||||
p = p->next;
|
||||
}
|
||||
freemntlist(mntlist);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */
|
||||
{
|
||||
struct mntent *mnt;
|
||||
@@ -225,7 +259,7 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
me->me_dev = xatoi (devopt + 4);
|
||||
}
|
||||
else
|
||||
me->me_dev = -1; /* Magic; means not known yet. */
|
||||
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
|
||||
me->me_next = NULL;
|
||||
|
||||
/* Add to the linked list. */
|
||||
@@ -256,7 +290,7 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
#else
|
||||
me->me_type = fstype_to_string (fsp->f_type);
|
||||
#endif
|
||||
me->me_dev = -1; /* Magic; means not known yet. */
|
||||
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
|
||||
me->me_next = NULL;
|
||||
|
||||
/* Add to the linked list. */
|
||||
@@ -317,7 +351,7 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
me->me_devname = xstrdup (stats[counter].f_mntfromname);
|
||||
me->me_mountdir = xstrdup (stats[counter].f_mntonname);
|
||||
me->me_type = mnt_names[stats[counter].f_type];
|
||||
me->me_dev = -1; /* Magic; means not known yet. */
|
||||
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
|
||||
me->me_next = NULL;
|
||||
|
||||
/* Add to the linked list. */
|
||||
@@ -350,7 +384,7 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
strcpy (me->me_devname + 5, mnt.mt_dev);
|
||||
#endif
|
||||
me->me_mountdir = xstrdup (mnt.mt_filsys);
|
||||
me->me_dev = -1; /* Magic; means not known yet. */
|
||||
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
|
||||
me->me_type = "";
|
||||
#ifdef GETFSTYP /* SVR3. */
|
||||
if (need_fs_type)
|
||||
@@ -384,7 +418,7 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
me->me_devname = xstrdup ( (*ent)->mt_resource);
|
||||
me->me_mountdir = xstrdup( (*ent)->mt_directory);
|
||||
me->me_type = xstrdup ((*ent)->mt_fstype);
|
||||
me->me_dev = -1; /* Magic; means not known yet. */
|
||||
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
|
||||
me->me_next = NULL;
|
||||
|
||||
/* Add to the linked list. */
|
||||
@@ -412,7 +446,7 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
me->me_devname = xstrdup (mnt.mnt_special);
|
||||
me->me_mountdir = xstrdup (mnt.mnt_mountp);
|
||||
me->me_type = xstrdup (mnt.mnt_fstype);
|
||||
me->me_dev = -1; /* Magic; means not known yet. */
|
||||
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
|
||||
me->me_next = NULL;
|
||||
|
||||
/* Add to the linked list. */
|
||||
@@ -464,7 +498,7 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
}
|
||||
me->me_mountdir = xstrdup (thisent + vmp->vmt_data[VMT_STUB].vmt_off);
|
||||
me->me_type = xstrdup (fstype_to_string (vmp->vmt_gfstype));
|
||||
me->me_dev = -1; /* vmt_fsid might be the info we want. */
|
||||
me->me_dev = (dev_t) -1; /* vmt_fsid might be the info we want. */
|
||||
me->me_next = NULL;
|
||||
|
||||
/* Add to the linked list. */
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, 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 mount table entry. */
|
||||
struct mount_entry
|
||||
|
||||
@@ -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, 675 Mass Ave, Cambridge, MA 02139, 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"
|
||||
|
||||
@@ -31,7 +31,7 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#define POINTER void *
|
||||
#else
|
||||
#define POINTER char *
|
||||
@@ -267,7 +267,7 @@ _obstack_newchunk (h, length)
|
||||
This is here for debugging.
|
||||
If you use it in a program, you are probably losing. */
|
||||
|
||||
#ifdef __STDC__
|
||||
#if defined (__STDC__) && __STDC__
|
||||
/* Suppress -Wmissing-prototypes warning. We don't want to declare this in
|
||||
obstack.h because it is just for debugging. */
|
||||
int _obstack_allocated_p (struct obstack *h, POINTER obj);
|
||||
@@ -374,7 +374,7 @@ obstack_free (h, obj)
|
||||
/* Now define the functional versions of the obstack macros.
|
||||
Define them to simply use the corresponding macros to do the job. */
|
||||
|
||||
#ifdef __STDC__
|
||||
#if defined (__STDC__) && __STDC__
|
||||
/* These function definitions do not work with non-ANSI preprocessors;
|
||||
they won't pass through the macro names in parentheses. */
|
||||
|
||||
|
||||
@@ -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, 675 Mass Ave, Cambridge, MA 02139, 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:
|
||||
|
||||
|
||||
61
lib/path-concat.c
Normal file
61
lib/path-concat.c
Normal file
@@ -0,0 +1,61 @@
|
||||
/* path-concat.c -- concatenate two arbitrary pathnames
|
||||
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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
char *malloc ();
|
||||
char *stpcpy ();
|
||||
|
||||
/* Concatenate two pathname components, DIR and BASE, in newly-allocated
|
||||
storage and return the result. Return 0 if out of memory. Add a slash
|
||||
between DIR and BASE in the result if neither would contribute one.
|
||||
If each would contribute at least one, elide one from the end of DIR.
|
||||
Otherwise, simply concatenate DIR and BASE. In any case, if
|
||||
BASE_IN_RESULT is non-NULL, set *BASE_IN_RESULT to point to the copy of
|
||||
BASE in the returned concatenation. */
|
||||
|
||||
char *
|
||||
path_concat (dir, base, base_in_result)
|
||||
const char *dir;
|
||||
const char *base;
|
||||
char **base_in_result;
|
||||
{
|
||||
char *p;
|
||||
char *p_concat;
|
||||
|
||||
p_concat = malloc (strlen (dir) + strlen (base) + 2);
|
||||
if (!p_concat)
|
||||
return 0;
|
||||
|
||||
p = stpcpy (p_concat, dir);
|
||||
|
||||
if (*(p - 1) == '/' && *base == '/')
|
||||
--p;
|
||||
else if (*(p - 1) != '/' && *base != '/')
|
||||
p = stpcpy (p, "/");
|
||||
|
||||
if (base_in_result)
|
||||
*base_in_result = p;
|
||||
|
||||
stpcpy (p, base);
|
||||
|
||||
return p_concat;
|
||||
}
|
||||
9
lib/path-concat.h
Normal file
9
lib/path-concat.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#if __STDC__
|
||||
# undef __P
|
||||
# define __P(args) args
|
||||
#else
|
||||
# define __P(args) ()
|
||||
#endif
|
||||
|
||||
char *
|
||||
path_concat __P ((const char *dir, const char *base, char **base_in_result));
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _PATHMAX_H
|
||||
#define _PATHMAX_H
|
||||
|
||||
@@ -12,28 +12,50 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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 Kingdon and David MacKenzie. */
|
||||
%{
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
/* The following block of alloca-related preprocessor directives is here
|
||||
solely to allow compilation by non GNU-C compilers of the C parser
|
||||
produced from this file by old versions of bison. Newer versions of
|
||||
bison include a block similar to this one in bison.simple. */
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define alloca __builtin_alloca
|
||||
#else
|
||||
#ifdef sparc
|
||||
#ifdef HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#else
|
||||
#ifdef _AIX
|
||||
#pragma alloca
|
||||
#else
|
||||
char *alloca ();
|
||||
void *alloca ();
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef TM_IN_SYS_TIME
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
/* Some old versions of bison generate parsers that use bcopy.
|
||||
That loses on systems that don't provide the function, so we have
|
||||
to redefine it here. */
|
||||
#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy)
|
||||
#define bcopy(from, to, len) memcpy ((to), (from), (len))
|
||||
#endif
|
||||
|
||||
#define YYDEBUG 1
|
||||
|
||||
|
||||
18
lib/putenv.c
18
lib/putenv.c
@@ -15,13 +15,13 @@ 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, 675 Mass Ave, Cambridge, MA 02139, 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 <errno.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Define-away any (possibly conflicting) prototype of putenv.
|
||||
@@ -29,26 +29,26 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#define putenv _sys_putenv
|
||||
|
||||
#if defined (__GNU_LIBRARY__) || defined (HAVE_STDLIB_H)
|
||||
#include <stdlib.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#if defined (__GNU_LIBRARY__) || defined (HAVE_STRING_H)
|
||||
#include <string.h>
|
||||
# include <string.h>
|
||||
#endif
|
||||
#if defined (__GNU_LIBRARY__) || defined (HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#undef putenv
|
||||
|
||||
#if !defined (__GNU_LIBRARY__) && !defined (HAVE_STRCHR)
|
||||
#define strchr index
|
||||
# define strchr index
|
||||
#endif
|
||||
#if !defined (__GNU_LIBRARY__) && !defined (HAVE_MEMCPY)
|
||||
#define memcpy(d,s,n) bcopy ((s), (d), (n))
|
||||
# define memcpy(d,s,n) bcopy ((s), (d), (n))
|
||||
#endif
|
||||
|
||||
#if HAVE_GNU_LD
|
||||
#define environ __environ
|
||||
# define environ __environ
|
||||
#else
|
||||
extern char **environ;
|
||||
#endif
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
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. */
|
||||
|
||||
@@ -28,23 +28,23 @@
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#if defined (STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
#include <string.h>
|
||||
# include <string.h>
|
||||
/* An ANSI string.h and pre-ANSI memory.h might conflict. */
|
||||
#if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
|
||||
#include <memory.h>
|
||||
#endif /* not STDC_HEADERS and HAVE_MEMORY_H */
|
||||
# if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
|
||||
# include <memory.h>
|
||||
# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
|
||||
#else /* not STDC_HEADERS and not HAVE_STRING_H */
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
/* memory.h and strings.h conflict on some systems. */
|
||||
#endif /* not STDC_HEADERS and not HAVE_STRING_H */
|
||||
|
||||
@@ -58,7 +58,8 @@ void *xrealloc ();
|
||||
/* Initialize a tokenbuffer. */
|
||||
|
||||
void
|
||||
init_tokenbuffer (token_buffer *tokenbuffer)
|
||||
init_tokenbuffer (tokenbuffer)
|
||||
token_buffer *tokenbuffer;
|
||||
{
|
||||
tokenbuffer->size = INITIAL_TOKEN_LENGTH;
|
||||
tokenbuffer->buffer = ((char *) xmalloc (INITIAL_TOKEN_LENGTH));
|
||||
@@ -76,8 +77,11 @@ init_tokenbuffer (token_buffer *tokenbuffer)
|
||||
and on files that aren't newline-terminated. */
|
||||
|
||||
long
|
||||
readtoken (FILE *stream, const char *delim, int n_delim,
|
||||
token_buffer *tokenbuffer)
|
||||
readtoken (stream, delim, n_delim, tokenbuffer)
|
||||
FILE *stream;
|
||||
const char *delim;
|
||||
int n_delim;
|
||||
token_buffer *tokenbuffer;
|
||||
{
|
||||
char *p;
|
||||
int c, i, n;
|
||||
@@ -160,9 +164,14 @@ readtoken (FILE *stream, const char *delim, int n_delim,
|
||||
%%% realloc() of `tokens' just before returning? */
|
||||
|
||||
int
|
||||
readtokens (FILE *stream, int projected_n_tokens,
|
||||
const char *delim, int n_delim,
|
||||
char ***tokens_out, long **token_lengths)
|
||||
readtokens (stream, projected_n_tokens, delim, n_delim,
|
||||
tokens_out, token_lengths)
|
||||
FILE *stream;
|
||||
int projected_n_tokens;
|
||||
const char *delim;
|
||||
int n_delim;
|
||||
char ***tokens_out;
|
||||
long **token_lengths;
|
||||
{
|
||||
token_buffer tb, *token = &tb;
|
||||
int token_length;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifndef H_READTOKENS_H
|
||||
#define H_READTOKENS_H
|
||||
# define H_READTOKENS_H
|
||||
|
||||
#ifndef INITIAL_TOKEN_LENGTH
|
||||
#define INITIAL_TOKEN_LENGTH 20
|
||||
#endif
|
||||
# ifndef INITIAL_TOKEN_LENGTH
|
||||
# define INITIAL_TOKEN_LENGTH 20
|
||||
# endif
|
||||
|
||||
#ifndef TOKENBUFFER_DEFINED
|
||||
#define TOKENBUFFER_DEFINED
|
||||
# ifndef TOKENBUFFER_DEFINED
|
||||
# define TOKENBUFFER_DEFINED
|
||||
struct tokenbuffer
|
||||
{
|
||||
long size;
|
||||
@@ -14,16 +14,23 @@ struct tokenbuffer
|
||||
};
|
||||
typedef struct tokenbuffer token_buffer;
|
||||
|
||||
#endif /* not TOKENBUFFER_DEFINED */
|
||||
# endif /* not TOKENBUFFER_DEFINED */
|
||||
|
||||
void init_tokenbuffer (token_buffer *tokenbuffer);
|
||||
# undef __P
|
||||
# if defined (__STDC__) && __STDC__
|
||||
# define __P(x) x
|
||||
# else
|
||||
# define __P(x) ()
|
||||
# endif
|
||||
|
||||
void init_tokenbuffer __P ((token_buffer *tokenbuffer));
|
||||
|
||||
long
|
||||
readtoken (FILE *stream, const char *delim, int n_delim,
|
||||
token_buffer *tokenbuffer);
|
||||
readtoken __P ((FILE *stream, const char *delim, int n_delim,
|
||||
token_buffer *tokenbuffer));
|
||||
int
|
||||
readtokens (FILE *stream, int projected_n_tokens,
|
||||
readtokens __P ((FILE *stream, int projected_n_tokens,
|
||||
const char *delim, int n_delim,
|
||||
char ***tokens_out, long **token_lengths);
|
||||
char ***tokens_out, long **token_lengths));
|
||||
|
||||
#endif /* not H_READTOKENS_H */
|
||||
|
||||
4338
lib/regex.c
4338
lib/regex.c
File diff suppressed because it is too large
Load Diff
34
lib/regex.h
34
lib/regex.h
@@ -14,8 +14,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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef __REGEXP_LIBRARY_H__
|
||||
#define __REGEXP_LIBRARY_H__
|
||||
@@ -42,7 +42,7 @@ typedef unsigned reg_syntax_t;
|
||||
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
|
||||
|
||||
/* If this bit is not set, then + and ? are operators, and \+ and \? are
|
||||
literals.
|
||||
literals.
|
||||
If set, then \+ and \? are operators and + and ? are literals. */
|
||||
#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
|
||||
|
||||
@@ -58,7 +58,7 @@ typedef unsigned reg_syntax_t;
|
||||
^ is an anchor if it is at the beginning of a regular
|
||||
expression or after an open-group or an alternation operator;
|
||||
$ is an anchor if it is at the end of a regular expression, or
|
||||
before a close-group or an alternation operator.
|
||||
before a close-group or an alternation operator.
|
||||
|
||||
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
|
||||
POSIX draft 11.2 says that * etc. in leading positions is undefined.
|
||||
@@ -69,7 +69,7 @@ typedef unsigned reg_syntax_t;
|
||||
/* If this bit is set, then special characters are always special
|
||||
regardless of where they are in the pattern.
|
||||
If this bit is not set, then special characters are special only in
|
||||
some contexts; otherwise they are ordinary. Specifically,
|
||||
some contexts; otherwise they are ordinary. Specifically,
|
||||
* + ? and intervals are only special when not after the beginning,
|
||||
open-group, or alternation operator. */
|
||||
#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
|
||||
@@ -91,7 +91,7 @@ typedef unsigned reg_syntax_t;
|
||||
#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
|
||||
|
||||
/* If this bit is set, either \{...\} or {...} defines an
|
||||
interval, depending on RE_NO_BK_BRACES.
|
||||
interval, depending on RE_NO_BK_BRACES.
|
||||
If not set, \{, \}, {, and } are literals. */
|
||||
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
|
||||
|
||||
@@ -116,7 +116,7 @@ typedef unsigned reg_syntax_t;
|
||||
If not set, then \<digit> is a back-reference. */
|
||||
#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
|
||||
|
||||
/* If this bit is set, then | is an alternation operator, and \| is literal.
|
||||
/* If this bit is set, then | is an alternation operator, and \| is literal.
|
||||
If not set, then \| is an alternation operator, and | is literal. */
|
||||
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
|
||||
|
||||
@@ -142,7 +142,7 @@ extern reg_syntax_t re_syntax_options;
|
||||
|
||||
/* Define combinations of the above bits for the standard possibilities.
|
||||
(The [[[ comments delimit what gets put into the Texinfo file, so
|
||||
don't delete them!) */
|
||||
don't delete them!) */
|
||||
/* [[[begin syntaxes]]] */
|
||||
#define RE_SYNTAX_EMACS 0
|
||||
|
||||
@@ -209,7 +209,7 @@ extern reg_syntax_t re_syntax_options;
|
||||
#ifdef RE_DUP_MAX
|
||||
#undef RE_DUP_MAX
|
||||
#endif
|
||||
#define RE_DUP_MAX ((1 << 15) - 1)
|
||||
#define RE_DUP_MAX ((1 << 15) - 1)
|
||||
|
||||
|
||||
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
|
||||
@@ -221,7 +221,7 @@ extern reg_syntax_t re_syntax_options;
|
||||
/* If this bit is set, then ignore case when matching.
|
||||
If not set, then case is significant. */
|
||||
#define REG_ICASE (REG_EXTENDED << 1)
|
||||
|
||||
|
||||
/* If this bit is set, then anchors do not match at newline
|
||||
characters in the string.
|
||||
If not set, then anchors do match at newlines. */
|
||||
@@ -260,7 +260,7 @@ typedef enum
|
||||
REG_EESCAPE, /* Trailing backslash. */
|
||||
REG_ESUBREG, /* Invalid back reference. */
|
||||
REG_EBRACK, /* Unmatched left bracket. */
|
||||
REG_EPAREN, /* Parenthesis imbalance. */
|
||||
REG_EPAREN, /* Parenthesis imbalance. */
|
||||
REG_EBRACE, /* Unmatched \{. */
|
||||
REG_BADBR, /* Invalid contents of \{\}. */
|
||||
REG_ERANGE, /* Invalid range end. */
|
||||
@@ -279,6 +279,10 @@ typedef enum
|
||||
compiled, the `re_nsub' field is available. All other fields are
|
||||
private to the regex routines. */
|
||||
|
||||
#ifndef RE_TRANSLATE_TYPE
|
||||
#define RE_TRANSLATE_TYPE char *
|
||||
#endif
|
||||
|
||||
struct re_pattern_buffer
|
||||
{
|
||||
/* [[[begin pattern_buffer]]] */
|
||||
@@ -291,7 +295,7 @@ struct re_pattern_buffer
|
||||
unsigned long allocated;
|
||||
|
||||
/* Number of bytes actually used in `buffer'. */
|
||||
unsigned long used;
|
||||
unsigned long used;
|
||||
|
||||
/* Syntax setting with which the pattern was compiled. */
|
||||
reg_syntax_t syntax;
|
||||
@@ -305,7 +309,7 @@ struct re_pattern_buffer
|
||||
comparing them, or zero for no translation. The translation
|
||||
is applied to a pattern when it is compiled and to a string
|
||||
when it is matched. */
|
||||
char *translate;
|
||||
RE_TRANSLATE_TYPE translate;
|
||||
|
||||
/* Number of subexpressions found by the compiler. */
|
||||
size_t re_nsub;
|
||||
@@ -335,7 +339,7 @@ struct re_pattern_buffer
|
||||
unsigned no_sub : 1;
|
||||
|
||||
/* If set, a beginning-of-line anchor doesn't match at the
|
||||
beginning of the string. */
|
||||
beginning of the string. */
|
||||
unsigned not_bol : 1;
|
||||
|
||||
/* Similarly for an end-of-line anchor. */
|
||||
@@ -442,7 +446,7 @@ extern int re_match
|
||||
|
||||
|
||||
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
|
||||
extern int re_match_2
|
||||
extern int re_match_2
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
||||
int length1, const char *string2, int length2,
|
||||
int start, struct re_registers *regs, int stop));
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
|
||||
87
lib/rpmatch.c
Normal file
87
lib/rpmatch.c
Normal file
@@ -0,0 +1,87 @@
|
||||
/* rpmatch - determine whether string value is affirmation or negative
|
||||
response according to current locale's data
|
||||
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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS || _LIBC
|
||||
# include <stddef.h>
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
# ifndef NULL
|
||||
# define NULL 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <regex.h>
|
||||
|
||||
#if ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
# define _(Text) gettext (Text)
|
||||
#else
|
||||
# define _(Text) Text
|
||||
#endif
|
||||
|
||||
static int
|
||||
try (response, pattern, match, nomatch, lastp, re)
|
||||
const char *response;
|
||||
const char *pattern;
|
||||
const int match;
|
||||
const int nomatch;
|
||||
const char **lastp;
|
||||
regex_t *re;
|
||||
{
|
||||
if (pattern != *lastp)
|
||||
{
|
||||
/* The pattern has changed. */
|
||||
if (*lastp)
|
||||
{
|
||||
/* Free the old compiled pattern. */
|
||||
regfree (re);
|
||||
*lastp = NULL;
|
||||
}
|
||||
/* Compile the pattern and cache it for future runs. */
|
||||
if (regcomp (re, pattern, REG_EXTENDED) != 0)
|
||||
return -1;
|
||||
*lastp = pattern;
|
||||
}
|
||||
|
||||
/* See if the regular expression matches RESPONSE. */
|
||||
return regexec (re, response, 0, NULL, 0) == 0 ? match : nomatch;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
rpmatch (response)
|
||||
const char *response;
|
||||
{
|
||||
/* Match against one of the response patterns, compiling the pattern
|
||||
first if necessary. */
|
||||
|
||||
/* We cache the response patterns and compiled regexps here. */
|
||||
static const char *yesexpr, *noexpr;
|
||||
static regex_t yesre, nore;
|
||||
int result;
|
||||
|
||||
return ((result = try (response, _("^[yY]"), 1, 0,
|
||||
&yesexpr, &yesre))
|
||||
? result
|
||||
: try (response, _("^[nN]"), 0, -1, &noexpr, &nore));
|
||||
}
|
||||
@@ -12,18 +12,18 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
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>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
/* save-cwd.c -- Save and restore current working directory.
|
||||
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. */
|
||||
|
||||
/* Written by Jim Meyering <meyering@na-net.ornl.gov>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>. */
|
||||
|
||||
|
||||
129
lib/setenv.c
Normal file
129
lib/setenv.c
Normal file
@@ -0,0 +1,129 @@
|
||||
/* Copyright (C) 1992, 1995 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 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
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#if _LIBC || HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#if _LIBC || HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#if _LIBC || HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_GNU_LD
|
||||
# define __environ environ
|
||||
#endif
|
||||
|
||||
int
|
||||
setenv (name, value, replace)
|
||||
const char *name;
|
||||
const char *value;
|
||||
int replace;
|
||||
{
|
||||
register char **ep;
|
||||
register size_t size;
|
||||
const size_t namelen = strlen (name);
|
||||
const size_t vallen = strlen (value) + 1;
|
||||
|
||||
size = 0;
|
||||
for (ep = __environ; *ep != NULL; ++ep)
|
||||
if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
|
||||
break;
|
||||
else
|
||||
++size;
|
||||
|
||||
if (*ep == NULL)
|
||||
{
|
||||
static char **last_environ;
|
||||
char **new_environ;
|
||||
if (__environ == last_environ)
|
||||
/* We allocated this space; we can extend it. */
|
||||
new_environ = (char **) realloc (last_environ,
|
||||
(size + 2) * sizeof (char *));
|
||||
else
|
||||
new_environ = (char **) malloc ((size + 2) * sizeof (char *));
|
||||
|
||||
if (new_environ == NULL)
|
||||
return -1;
|
||||
|
||||
new_environ[size] = malloc (namelen + 1 + vallen);
|
||||
if (new_environ[size] == NULL)
|
||||
{
|
||||
free ((char *) new_environ);
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (__environ != last_environ)
|
||||
memcpy ((char *) new_environ, (char *) __environ,
|
||||
size * sizeof (char *));
|
||||
|
||||
memcpy (new_environ[size], name, namelen);
|
||||
new_environ[size][namelen] = '=';
|
||||
memcpy (&new_environ[size][namelen + 1], value, vallen);
|
||||
|
||||
new_environ[size + 1] = NULL;
|
||||
|
||||
last_environ = __environ = new_environ;
|
||||
}
|
||||
else if (replace)
|
||||
{
|
||||
size_t len = strlen (*ep);
|
||||
if (len + 1 < namelen + 1 + vallen)
|
||||
{
|
||||
/* The existing string is too short; malloc a new one. */
|
||||
char *new = malloc (namelen + 1 + vallen);
|
||||
if (new == NULL)
|
||||
return -1;
|
||||
*ep = new;
|
||||
}
|
||||
memcpy (*ep, name, namelen);
|
||||
(*ep)[namelen] = '=';
|
||||
memcpy (&(*ep)[namelen + 1], value, vallen);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
unsetenv (name)
|
||||
const char *name;
|
||||
{
|
||||
const size_t len = strlen (name);
|
||||
char **ep;
|
||||
|
||||
for (ep = __environ; *ep; ++ep)
|
||||
if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
|
||||
{
|
||||
/* Found it. Remove this pointer by moving later ones back. */
|
||||
char **dp = ep;
|
||||
do
|
||||
dp[0] = dp[1];
|
||||
while (*dp++);
|
||||
/* Continue the loop in case NAME appears again. */
|
||||
}
|
||||
}
|
||||
17
lib/setenv.h
Normal file
17
lib/setenv.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef SETENV_H
|
||||
# define SETENV_H 1
|
||||
|
||||
# undef __P
|
||||
# if defined (__STDC__) && __STDC__
|
||||
# define __P(x) x
|
||||
# else
|
||||
# define __P(x) ()
|
||||
# endif
|
||||
|
||||
int
|
||||
setenv __P ((const char *name, const char *value, int replace));
|
||||
|
||||
void
|
||||
unsetenv __P ((const char *name));
|
||||
|
||||
#endif /* SETENV_H */
|
||||
@@ -12,11 +12,15 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* David MacKenzie <djm@ai.mit.edu> */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
|
||||
@@ -11,20 +11,20 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
# include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#ifndef strchr
|
||||
#define strchr index
|
||||
#endif
|
||||
# include <strings.h>
|
||||
# ifndef strchr
|
||||
# define strchr index
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Return the length of the maximum inital segment of S
|
||||
|
||||
12
lib/strdup.c
12
lib/strdup.c
@@ -12,8 +12,12 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <string.h>
|
||||
@@ -23,10 +27,6 @@ char *malloc ();
|
||||
char *strcpy ();
|
||||
#endif
|
||||
|
||||
#if !__STDC__
|
||||
#define const
|
||||
#endif
|
||||
|
||||
/* Return a newly allocated copy of STR,
|
||||
or 0 if out of memory. */
|
||||
|
||||
|
||||
1245
lib/strftime.c
1245
lib/strftime.c
File diff suppressed because it is too large
Load Diff
@@ -12,13 +12,17 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if defined(STDC_HEADERS) || defined(USG)
|
||||
#include <string.h>
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
# include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
/* Remove trailing slashes from PATH.
|
||||
|
||||
49
lib/strndup.c
Normal file
49
lib/strndup.c
Normal file
@@ -0,0 +1,49 @@
|
||||
/* Copyright (C) 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 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
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
char *malloc ();
|
||||
#endif
|
||||
|
||||
/* Duplicate S, returning an identical malloc'd string. */
|
||||
char *
|
||||
strndup (s, n)
|
||||
const char *s;
|
||||
size_t n;
|
||||
{
|
||||
char *new = malloc (n + 1);
|
||||
|
||||
if (new == NULL)
|
||||
return NULL;
|
||||
|
||||
memcpy (new, s, n);
|
||||
new[n] = '\0';
|
||||
|
||||
return new;
|
||||
}
|
||||
39
lib/strpbrk.c
Normal file
39
lib/strpbrk.c
Normal file
@@ -0,0 +1,39 @@
|
||||
/* Copyright (C) 1991, 1994 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 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
|
||||
|
||||
/* Find the first ocurrence in S of any character in ACCEPT. */
|
||||
char *
|
||||
strpbrk (s, accept)
|
||||
register const char *s;
|
||||
register const char *accept;
|
||||
{
|
||||
while (*s != '\0')
|
||||
{
|
||||
const char *a = accept;
|
||||
while (*a != '\0')
|
||||
if (*a++ == *s)
|
||||
return (char *) s;
|
||||
++s;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
139
lib/strstr.c
139
lib/strstr.c
@@ -1,49 +1,116 @@
|
||||
/* strstr.c -- return the offset of one string within another
|
||||
Copyright (C) 1989, 1990 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, 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. */
|
||||
|
||||
/* Author:
|
||||
Mike Rendell Department of Computer Science
|
||||
michael@garfield.mun.edu Memorial University of Newfoundland
|
||||
..!uunet!garfield!michael St. John's, Nfld., Canada
|
||||
(709) 737-4550 A1C 5S7
|
||||
*/
|
||||
/*
|
||||
* My personal strstr() implementation that beats most other algorithms.
|
||||
* Until someone tells me otherwise, I assume that this is the
|
||||
* fastest implementation of strstr() in C.
|
||||
* I deliberately chose not to comment it. You should have at least
|
||||
* as much fun trying to understand it, as I had to write it :-).
|
||||
*
|
||||
* Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */
|
||||
|
||||
/* Return the starting address of string S2 in S1;
|
||||
return 0 if it is not found. */
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef unsigned chartype;
|
||||
|
||||
char *
|
||||
strstr (s1, s2)
|
||||
char *s1;
|
||||
char *s2;
|
||||
strstr (phaystack, pneedle)
|
||||
const char *phaystack;
|
||||
const char *pneedle;
|
||||
{
|
||||
int i;
|
||||
char *p1;
|
||||
char *p2;
|
||||
char *s = s1;
|
||||
register const unsigned char *haystack, *needle;
|
||||
register chartype b, c;
|
||||
|
||||
for (p2 = s2, i = 0; *s; p2 = s2, i++, s++)
|
||||
haystack = (const unsigned char *) phaystack;
|
||||
needle = (const unsigned char *) pneedle;
|
||||
|
||||
b = *needle;
|
||||
if (b != '\0')
|
||||
{
|
||||
for (p1 = s; *p1 && *p2 && *p1 == *p2; p1++, p2++)
|
||||
;
|
||||
if (!*p2)
|
||||
break;
|
||||
}
|
||||
if (!*p2)
|
||||
return s1 + i;
|
||||
haystack--; /* possible ANSI violation */
|
||||
do
|
||||
{
|
||||
c = *++haystack;
|
||||
if (c == '\0')
|
||||
goto ret0;
|
||||
}
|
||||
while (c != b);
|
||||
|
||||
c = *++needle;
|
||||
if (c == '\0')
|
||||
goto foundneedle;
|
||||
++needle;
|
||||
goto jin;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
register chartype a;
|
||||
register const unsigned char *rhaystack, *rneedle;
|
||||
|
||||
do
|
||||
{
|
||||
a = *++haystack;
|
||||
if (a == '\0')
|
||||
goto ret0;
|
||||
if (a == b)
|
||||
break;
|
||||
a = *++haystack;
|
||||
if (a == '\0')
|
||||
goto ret0;
|
||||
shloop: }
|
||||
while (a != b);
|
||||
|
||||
jin: a = *++haystack;
|
||||
if (a == '\0')
|
||||
goto ret0;
|
||||
|
||||
if (a != c)
|
||||
goto shloop;
|
||||
|
||||
rhaystack = haystack-- + 1;
|
||||
rneedle = needle;
|
||||
a = *rneedle;
|
||||
|
||||
if (*rhaystack == a)
|
||||
do
|
||||
{
|
||||
if (a == '\0')
|
||||
goto foundneedle;
|
||||
++rhaystack;
|
||||
a = *++needle;
|
||||
if (*rhaystack != a)
|
||||
break;
|
||||
if (a == '\0')
|
||||
goto foundneedle;
|
||||
++rhaystack;
|
||||
a = *++needle;
|
||||
}
|
||||
while (*rhaystack == a);
|
||||
|
||||
needle = rneedle; /* took the register-poor aproach */
|
||||
|
||||
if (a == '\0')
|
||||
break;
|
||||
}
|
||||
}
|
||||
foundneedle:
|
||||
return (char*) haystack;
|
||||
ret0:
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -11,8 +11,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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
|
||||
173
lib/strtol.c
173
lib/strtol.c
@@ -1,21 +1,22 @@
|
||||
/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
|
||||
/* 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, 675 Mass Ave, Cambridge, MA 02139, 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>
|
||||
@@ -33,7 +34,7 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#if HAVE_LIMITS_H
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
@@ -56,18 +57,41 @@ extern int errno;
|
||||
# define UNSIGNED 0
|
||||
# define INT LONG int
|
||||
#else
|
||||
# define strtol strtoul
|
||||
# define INT unsigned LONG int
|
||||
#endif
|
||||
|
||||
/* Determine the name. */
|
||||
#if UNSIGNED
|
||||
# ifdef USE_WIDE_CHAR
|
||||
# ifdef QUAD
|
||||
# define strtol wcstouq
|
||||
# else
|
||||
# define strtol wcstoul
|
||||
# endif
|
||||
# else
|
||||
# ifdef QUAD
|
||||
# define strtol strtouq
|
||||
# else
|
||||
# define strtol strtoul
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# ifdef USE_WIDE_CHAR
|
||||
# ifdef QUAD
|
||||
# define strtol wcstoq
|
||||
# else
|
||||
# define strtol wcstol
|
||||
# endif
|
||||
# else
|
||||
# ifdef QUAD
|
||||
# define strtol strtoq
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* If QUAD is defined, we are defining `strtoq' or `strtouq',
|
||||
operating on `long long int's. */
|
||||
#ifdef QUAD
|
||||
# if UNSIGNED
|
||||
# define strtoul strtouq
|
||||
# else
|
||||
# define strtol strtoq
|
||||
# endif
|
||||
# define LONG long long
|
||||
# undef LONG_MIN
|
||||
# define LONG_MIN LONG_LONG_MIN
|
||||
@@ -83,13 +107,41 @@ extern int errno;
|
||||
# endif
|
||||
#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
|
||||
#endif
|
||||
|
||||
#ifdef USE_WIDE_CHAR
|
||||
# include <wchar.h>
|
||||
# include <wctype.h>
|
||||
# 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)
|
||||
#else
|
||||
# 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)
|
||||
#endif
|
||||
|
||||
#ifdef __STDC__
|
||||
# define INTERNAL(x) INTERNAL1(x)
|
||||
# define INTERNAL1(x) __##x##_internal
|
||||
# define WEAKNAME(x) WEAKNAME1(x)
|
||||
# define WEAKNAME1(x) __##x
|
||||
#else
|
||||
# define INTERNAL(x) __/**/x/**/_internal
|
||||
# define WEAKNAME(x) __/**/x
|
||||
#endif
|
||||
|
||||
#ifdef USE_NUMBER_GROUPING
|
||||
@@ -107,8 +159,8 @@ extern int errno;
|
||||
|
||||
INT
|
||||
INTERNAL (strtol) (nptr, endptr, base, group)
|
||||
const char *nptr;
|
||||
char **endptr;
|
||||
const STRING_TYPE *nptr;
|
||||
STRING_TYPE **endptr;
|
||||
int base;
|
||||
int group;
|
||||
{
|
||||
@@ -116,9 +168,9 @@ INTERNAL (strtol) (nptr, endptr, base, group)
|
||||
register unsigned LONG int cutoff;
|
||||
register unsigned int cutlim;
|
||||
register unsigned LONG int i;
|
||||
register const char *s;
|
||||
register unsigned char c;
|
||||
const char *save, *end;
|
||||
register const STRING_TYPE *s;
|
||||
register UCHAR_TYPE c;
|
||||
const STRING_TYPE *save, *end;
|
||||
int overflow;
|
||||
|
||||
#ifdef USE_NUMBER_GROUPING
|
||||
@@ -150,21 +202,21 @@ INTERNAL (strtol) (nptr, endptr, base, group)
|
||||
if (base < 0 || base == 1 || base > 36)
|
||||
base = 10;
|
||||
|
||||
s = nptr;
|
||||
save = s = nptr;
|
||||
|
||||
/* Skip white space. */
|
||||
while (isspace (*s))
|
||||
while (ISSPACE (*s))
|
||||
++s;
|
||||
if (*s == '\0')
|
||||
if (*s == L_('\0'))
|
||||
goto noconv;
|
||||
|
||||
/* Check for a sign. */
|
||||
if (*s == '-')
|
||||
if (*s == L_('-'))
|
||||
{
|
||||
negative = 1;
|
||||
++s;
|
||||
}
|
||||
else if (*s == '+')
|
||||
else if (*s == L_('+'))
|
||||
{
|
||||
negative = 0;
|
||||
++s;
|
||||
@@ -172,14 +224,14 @@ INTERNAL (strtol) (nptr, endptr, base, group)
|
||||
else
|
||||
negative = 0;
|
||||
|
||||
if (base == 16 && s[0] == '0' && toupper (s[1]) == 'X')
|
||||
if (base == 16 && s[0] == L_('0') && TOUPPER (s[1]) == L_('X'))
|
||||
s += 2;
|
||||
|
||||
/* If BASE is zero, figure it out ourselves. */
|
||||
if (base == 0)
|
||||
if (*s == '0')
|
||||
if (*s == L_('0'))
|
||||
{
|
||||
if (toupper (s[1]) == 'X')
|
||||
if (TOUPPER (s[1]) == L_('X'))
|
||||
{
|
||||
s += 2;
|
||||
base = 16;
|
||||
@@ -198,9 +250,9 @@ INTERNAL (strtol) (nptr, endptr, base, group)
|
||||
{
|
||||
/* Find the end of the digit string and check its grouping. */
|
||||
end = s;
|
||||
for (c = *end; c != '\0'; c = *++end)
|
||||
if (c != thousands && !isdigit (c) &&
|
||||
(!isalpha (c) || toupper (c) - 'A' + 10 >= base))
|
||||
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))
|
||||
break;
|
||||
if (*s == thousands)
|
||||
end = s;
|
||||
@@ -216,14 +268,14 @@ INTERNAL (strtol) (nptr, endptr, base, group)
|
||||
|
||||
overflow = 0;
|
||||
i = 0;
|
||||
for (c = *s; c != '\0'; c = *++s)
|
||||
for (c = *s; c != L_('\0'); c = *++s)
|
||||
{
|
||||
if (s == end)
|
||||
break;
|
||||
if (isdigit (c))
|
||||
c -= '0';
|
||||
else if (isalpha (c))
|
||||
c = toupper (c) - 'A' + 10;
|
||||
if (c >= L_('0') && c <= L_('9'))
|
||||
c -= L_('0');
|
||||
else if (ISALPHA (c))
|
||||
c = TOUPPER (c) - L_('A') + 10;
|
||||
else
|
||||
break;
|
||||
if (c >= base)
|
||||
@@ -245,13 +297,15 @@ INTERNAL (strtol) (nptr, endptr, base, group)
|
||||
/* Store in ENDPTR the address of one character
|
||||
past the last character we converted. */
|
||||
if (endptr != NULL)
|
||||
*endptr = (char *) s;
|
||||
*endptr = (STRING_TYPE *) s;
|
||||
|
||||
#if !UNSIGNED
|
||||
/* Check for a value that is within the range of
|
||||
`unsigned LONG int', but outside the range of `LONG int'. */
|
||||
if (i > (negative ?
|
||||
-(unsigned LONG int) LONG_MIN : (unsigned LONG int) LONG_MAX))
|
||||
if (overflow == 0
|
||||
&& i > (negative
|
||||
? -((unsigned LONG int) (LONG_MIN + 1)) + 1
|
||||
: (unsigned LONG int) LONG_MAX))
|
||||
overflow = 1;
|
||||
#endif
|
||||
|
||||
@@ -269,22 +323,39 @@ INTERNAL (strtol) (nptr, endptr, base, group)
|
||||
return (negative ? -i : i);
|
||||
|
||||
noconv:
|
||||
/* There was no number to convert. */
|
||||
/* 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
|
||||
hexadecimal digits. This is no error case. We return 0 and
|
||||
ENDPTR points to the `x`. */
|
||||
if (endptr != NULL)
|
||||
*endptr = (char *) nptr;
|
||||
if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X')
|
||||
&& save[-2] == L_('0'))
|
||||
*endptr = (STRING_TYPE *) &save[-1];
|
||||
else
|
||||
/* There was no number to convert. */
|
||||
*endptr = (STRING_TYPE *) nptr;
|
||||
|
||||
return 0L;
|
||||
}
|
||||
|
||||
/* External user entry point. */
|
||||
|
||||
#ifdef weak_symbol
|
||||
weak_symbol (strtol)
|
||||
#undef __P
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# define __P(args) args
|
||||
#else
|
||||
# define __P(args) ()
|
||||
#endif
|
||||
|
||||
/* Prototype. */
|
||||
INT strtol __P ((const STRING_TYPE *nptr, STRING_TYPE **endptr,
|
||||
int base));
|
||||
|
||||
|
||||
INT
|
||||
strtol (nptr, endptr, base)
|
||||
const char *nptr;
|
||||
char **endptr;
|
||||
const STRING_TYPE *nptr;
|
||||
STRING_TYPE **endptr;
|
||||
int base;
|
||||
{
|
||||
return INTERNAL (strtol) (nptr, endptr, base, 0);
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
/* Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
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,
|
||||
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
|
||||
Library General Public License for more details.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, 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 UNSIGNED 1
|
||||
|
||||
#include "strtol.c"
|
||||
#include <strtol.c>
|
||||
|
||||
@@ -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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>. */
|
||||
|
||||
@@ -63,9 +63,12 @@ struct group *getgrnam ();
|
||||
struct group *getgrgid ();
|
||||
#endif
|
||||
|
||||
#ifdef _POSIX_SOURCE
|
||||
#define endpwent()
|
||||
#define endgrent()
|
||||
#ifndef HAVE_ENDGRENT
|
||||
# define endgrent() ((void) 0)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ENDPWENT
|
||||
# define endpwent() ((void) 0)
|
||||
#endif
|
||||
|
||||
/* Perform the equivalent of the statement `dest = strdup (src);',
|
||||
|
||||
@@ -12,20 +12,13 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if defined (CONFIG_BROKETS)
|
||||
/* We use <config.h> instead of "config.h" so that a compilation
|
||||
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
|
||||
(which it would do because it found this file in $srcdir). */
|
||||
#include <config.h>
|
||||
#else
|
||||
#include "config.h"
|
||||
#endif
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -36,9 +29,9 @@ extern int errno;
|
||||
#include <sys/types.h>
|
||||
#include "pathmax.h"
|
||||
|
||||
#if !defined(_POSIX_VERSION) && !defined(HAVE_GETCWD)
|
||||
#ifndef HAVE_GETCWD
|
||||
char *getwd ();
|
||||
#define getcwd(buf, max) getwd (buf)
|
||||
# define getcwd(buf, max) getwd (buf)
|
||||
#else
|
||||
char *getcwd ();
|
||||
#endif
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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 */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -28,7 +28,7 @@ char *xmalloc ();
|
||||
char *xrealloc ();
|
||||
|
||||
#ifndef INITIAL_HOSTNAME_LENGTH
|
||||
#define INITIAL_HOSTNAME_LENGTH 33
|
||||
# define INITIAL_HOSTNAME_LENGTH 33
|
||||
#endif
|
||||
|
||||
char *
|
||||
|
||||
@@ -12,23 +12,23 @@
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if __STDC__
|
||||
#define VOID void
|
||||
# define VOID void
|
||||
#else
|
||||
#define VOID char
|
||||
# define VOID char
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#if STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
VOID *malloc ();
|
||||
VOID *realloc ();
|
||||
@@ -44,7 +44,7 @@ void free ();
|
||||
#endif
|
||||
|
||||
#ifndef EXIT_FAILURE
|
||||
#define EXIT_FAILURE 1
|
||||
# define EXIT_FAILURE 1
|
||||
#endif
|
||||
|
||||
/* Exit value when the requested amount of memory is not available.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user