mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
498 Commits
FILEUTILS-
...
FILEUTILS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11135e1307 | ||
|
|
d8a0eef528 | ||
|
|
b7657496c3 | ||
|
|
01c7f17f33 | ||
|
|
a211252152 | ||
|
|
24c0a0a99d | ||
|
|
df521a1b29 | ||
|
|
686a7e9ff3 | ||
|
|
1d738b51d1 | ||
|
|
84c2d0e52e | ||
|
|
6c0c08eb29 | ||
|
|
7de9edecfc | ||
|
|
9e3f43b368 | ||
|
|
d7b702d0d0 | ||
|
|
ed5b1cad23 | ||
|
|
532074e1c7 | ||
|
|
deef42170f | ||
|
|
b808de586b | ||
|
|
ac7f057d98 | ||
|
|
2daa912c53 | ||
|
|
7bf8c634eb | ||
|
|
c091e6fe83 | ||
|
|
dc61111cc6 | ||
|
|
920680fe4f | ||
|
|
c9f0e3d343 | ||
|
|
b4c9bd2b7e | ||
|
|
453be366da | ||
|
|
f51e80f564 | ||
|
|
993a56e8e0 | ||
|
|
d8e4dccdca | ||
|
|
427e67b196 | ||
|
|
90ffddc87e | ||
|
|
8458f55338 | ||
|
|
bf5ef10371 | ||
|
|
d087967041 | ||
|
|
cfb54dec88 | ||
|
|
e1958a7253 | ||
|
|
cf50a06294 | ||
|
|
c96d9a880f | ||
|
|
25bf05e45e | ||
|
|
99b35637c4 | ||
|
|
09b8756e33 | ||
|
|
9c5d11d5c5 | ||
|
|
bf6c2a07af | ||
|
|
c729fe037e | ||
|
|
02cde32c0a | ||
|
|
7741f87086 | ||
|
|
9e630b86cb | ||
|
|
2e19f14a91 | ||
|
|
65b1a6ec82 | ||
|
|
06d1a87e3b | ||
|
|
f417e8b9d4 | ||
|
|
4fb556ee0e | ||
|
|
c850393032 | ||
|
|
61ece919c6 | ||
|
|
843b44b3f7 | ||
|
|
5edb65b5c4 | ||
|
|
a71cb7cad1 | ||
|
|
e2d1b297e7 | ||
|
|
70bea7fd3e | ||
|
|
ec936db8d7 | ||
|
|
2b69ce2d89 | ||
|
|
0a25bc498d | ||
|
|
6cc7e13732 | ||
|
|
0e1c643956 | ||
|
|
2e29b32116 | ||
|
|
082787996c | ||
|
|
edef42bf40 | ||
|
|
efce5c3bdf | ||
|
|
18ac22d2fc | ||
|
|
c20eae80c7 | ||
|
|
6f43239736 | ||
|
|
c6b7de061f | ||
|
|
10d64e02c4 | ||
|
|
852a30165b | ||
|
|
e4d0cf679c | ||
|
|
57c0968203 | ||
|
|
761ed79f4d | ||
|
|
f49ea966c3 | ||
|
|
8c6d49c84d | ||
|
|
061a10d1ff | ||
|
|
787dfe9c83 | ||
|
|
9e3949fa6f | ||
|
|
62b64a0e92 | ||
|
|
37c289ea31 | ||
|
|
297a13a5a3 | ||
|
|
2aae4df6ef | ||
|
|
8670ecb6cb | ||
|
|
1b1bcc5e29 | ||
|
|
03d1ff2dea | ||
|
|
1381664a56 | ||
|
|
3ed45d5062 | ||
|
|
dfd3465715 | ||
|
|
86488adef8 | ||
|
|
3564013e18 | ||
|
|
a019f34623 | ||
|
|
0e2247a55b | ||
|
|
253d68786d | ||
|
|
f6a19e2c78 | ||
|
|
f7880af3db | ||
|
|
ce55ab29b1 | ||
|
|
6bbbdce4d8 | ||
|
|
5027e9d281 | ||
|
|
701e23d1e4 | ||
|
|
516e60ed10 | ||
|
|
61c04cdaed | ||
|
|
3d58b592ed | ||
|
|
71aa0114bb | ||
|
|
cbd698b247 | ||
|
|
bf887b6800 | ||
|
|
d8827d033a | ||
|
|
434df90510 | ||
|
|
483b1367bc | ||
|
|
df694b9339 | ||
|
|
dcd55a5277 | ||
|
|
742600e30d | ||
|
|
62db78c613 | ||
|
|
f439fa811c | ||
|
|
169bead160 | ||
|
|
2ebff08169 | ||
|
|
5b1af11410 | ||
|
|
62ff4ae63c | ||
|
|
9ef5ce0581 | ||
|
|
d21a17dbb4 | ||
|
|
cfd0d53368 | ||
|
|
432e6df3e4 | ||
|
|
95fd28c290 | ||
|
|
2239a0ff2c | ||
|
|
0345ac460a | ||
|
|
8b0f15401b | ||
|
|
af988b5428 | ||
|
|
2e4ebbf522 | ||
|
|
84fd56fe2a | ||
|
|
a23ce11f2a | ||
|
|
a7dea23c83 | ||
|
|
453a3cbd73 | ||
|
|
3da2cfc475 | ||
|
|
22c794bf9b | ||
|
|
0c47bc711f | ||
|
|
cdd0e0a757 | ||
|
|
0bb1cba1bc | ||
|
|
662777cad5 | ||
|
|
b7e1eadbf8 | ||
|
|
685d842096 | ||
|
|
a3e6379a2c | ||
|
|
3e99e73234 | ||
|
|
efcde72ce7 | ||
|
|
7155f1e45a | ||
|
|
59463cd869 | ||
|
|
998842665b | ||
|
|
63a8243257 | ||
|
|
9d806a54bf | ||
|
|
855f6816d6 | ||
|
|
2b53ea5791 | ||
|
|
80768df1f5 | ||
|
|
61f48952f2 | ||
|
|
095d748e53 | ||
|
|
f5df8ad7f0 | ||
|
|
aaa4b67c31 | ||
|
|
4a5b97a91e | ||
|
|
8589763111 | ||
|
|
1ff7800b19 | ||
|
|
fbe115a9e4 | ||
|
|
3f17755a74 | ||
|
|
fbb1fb519f | ||
|
|
dc68d2454e | ||
|
|
80499598c1 | ||
|
|
b6dcafff11 | ||
|
|
219c7a280d | ||
|
|
3f9e8072e8 | ||
|
|
72f8c0a17c | ||
|
|
d679ddd839 | ||
|
|
cded303e29 | ||
|
|
050e7dcf7c | ||
|
|
ad37e45e20 | ||
|
|
2b8279f893 | ||
|
|
ef679d9871 | ||
|
|
3ba504d409 | ||
|
|
c11fa3240a | ||
|
|
ca22f0d886 | ||
|
|
23b298e107 | ||
|
|
6aaf307bc4 | ||
|
|
efcc24f9d4 | ||
|
|
24a8bf2d3e | ||
|
|
ef67832eae | ||
|
|
6eb0392a41 | ||
|
|
6880f434c0 | ||
|
|
6606de8b81 | ||
|
|
08cfef16a2 | ||
|
|
2f235c5843 | ||
|
|
fde72176e8 | ||
|
|
7c43d59107 | ||
|
|
dfb1f6a5b0 | ||
|
|
19ff66c384 | ||
|
|
d7a781ab5a | ||
|
|
48c8542657 | ||
|
|
b73a1b844f | ||
|
|
59f3e7dfea | ||
|
|
78df00cae0 | ||
|
|
745cee714a | ||
|
|
6d16699fff | ||
|
|
ea44cc33ca | ||
|
|
4db847ce3c | ||
|
|
231813e179 | ||
|
|
1c3a5c6ff8 | ||
|
|
72e1d14aec | ||
|
|
584f4d85cf | ||
|
|
9096ee8e42 | ||
|
|
f7c0efdba2 | ||
|
|
a3c0837bc3 | ||
|
|
834b042b93 | ||
|
|
f0e77e8722 | ||
|
|
5c094d2ab2 | ||
|
|
1eb146483f | ||
|
|
1b3c2bbb06 | ||
|
|
edbbc8335c | ||
|
|
48405e4b9c | ||
|
|
f9ae8064f2 | ||
|
|
9ce9d75ddb | ||
|
|
d59ce5651c | ||
|
|
981c203fab | ||
|
|
c0385fb129 | ||
|
|
ac88b78ef3 | ||
|
|
e01fce9e16 | ||
|
|
164bff8dc0 | ||
|
|
7b7b9007db | ||
|
|
c0ad97a781 | ||
|
|
c5a9a5f563 | ||
|
|
b363124be4 | ||
|
|
d06d2de67c | ||
|
|
82f324a6fd | ||
|
|
84f0e8fc80 | ||
|
|
9a27c21fbf | ||
|
|
1fff978392 | ||
|
|
4d87b9a10e | ||
|
|
8fd24dfea9 | ||
|
|
9355314687 | ||
|
|
5c6991f93d | ||
|
|
9e9d7be706 | ||
|
|
49b81671fd | ||
|
|
38429fe661 | ||
|
|
ce0ba9e9d9 | ||
|
|
5b3b5af5b8 | ||
|
|
6a2cf8a297 | ||
|
|
22fd1ff303 | ||
|
|
cb1386ec32 | ||
|
|
da2761cc1a | ||
|
|
1fc1a65968 | ||
|
|
b6f403c606 | ||
|
|
fa59cde3fe | ||
|
|
6f7507be50 | ||
|
|
33df2fe237 | ||
|
|
87c3c9c7c6 | ||
|
|
e622324cbe | ||
|
|
99114dd25a | ||
|
|
e29225aa01 | ||
|
|
8bfd3a7d70 | ||
|
|
f9abdd4a47 | ||
|
|
c7f7a81276 | ||
|
|
f721219e91 | ||
|
|
ded46c159b | ||
|
|
9cc2f64ff3 | ||
|
|
ae3a2c75ff | ||
|
|
24fa66e128 | ||
|
|
b6a0fe5ab0 | ||
|
|
da190d7c06 | ||
|
|
ddd448d549 | ||
|
|
71bd321379 | ||
|
|
93449adfa4 | ||
|
|
21041064bd | ||
|
|
f5443ca875 | ||
|
|
eb771bb870 | ||
|
|
43589db615 | ||
|
|
04a86ff23a | ||
|
|
b32c1f0696 | ||
|
|
94d7c5b58c | ||
|
|
0cb7d9a409 | ||
|
|
81bb7f1df3 | ||
|
|
7fc3b4cf7d | ||
|
|
cef050f076 | ||
|
|
919b805380 | ||
|
|
0e48a577b5 | ||
|
|
b0ead8f2d6 | ||
|
|
5614a7d282 | ||
|
|
9c5fb99864 | ||
|
|
1145211d6b | ||
|
|
0c35411a4f | ||
|
|
8bd9ea509e | ||
|
|
bddb246b90 | ||
|
|
e646635206 | ||
|
|
ea9e600f58 | ||
|
|
78c34dee50 | ||
|
|
56949aaebd | ||
|
|
18d7d6b082 | ||
|
|
0cb75a1a07 | ||
|
|
cc271ce8f3 | ||
|
|
bf73df9811 | ||
|
|
b07a5a108e | ||
|
|
2db8ef7c55 | ||
|
|
634ff11428 | ||
|
|
c3b1ab8af1 | ||
|
|
327a21114a | ||
|
|
df91781926 | ||
|
|
4431579378 | ||
|
|
19afd110b3 | ||
|
|
5b02046b20 | ||
|
|
97a44fbdf0 | ||
|
|
49d59ad66b | ||
|
|
c2bbdeab6d | ||
|
|
0d33861999 | ||
|
|
9c38d004ec | ||
|
|
a302182ac8 | ||
|
|
6b0411ab47 | ||
|
|
65ce4687f5 | ||
|
|
363847ca74 | ||
|
|
d223f01b43 | ||
|
|
3a2b528573 | ||
|
|
14717b8618 | ||
|
|
dc8cd6e39a | ||
|
|
6db0107e71 | ||
|
|
a6f74451d3 | ||
|
|
8d2302724c | ||
|
|
8fa35e89ca | ||
|
|
baad4b697c | ||
|
|
79d411ceba | ||
|
|
52070d3e4a | ||
|
|
85cc6dedf8 | ||
|
|
e3869f58ad | ||
|
|
c34fd6b4a7 | ||
|
|
63d64851b1 | ||
|
|
d68269bb55 | ||
|
|
2aa62088a3 | ||
|
|
f2d4fc8016 | ||
|
|
bf57f4af46 | ||
|
|
dc43a7bb60 | ||
|
|
9d7c2d4f7d | ||
|
|
888da5c359 | ||
|
|
7b0caffd31 | ||
|
|
ed2a7b4e53 | ||
|
|
2a6a20ae20 | ||
|
|
1dce9a3295 | ||
|
|
f6da9983e4 | ||
|
|
e6bc93f49a | ||
|
|
88c0b8d630 | ||
|
|
669ff7331b | ||
|
|
54667de765 | ||
|
|
736ea546d9 | ||
|
|
461aea548a | ||
|
|
e31691fc1d | ||
|
|
8e576e0036 | ||
|
|
b9fa91a205 | ||
|
|
ff438ee87f | ||
|
|
34cd17408c | ||
|
|
138bad1512 | ||
|
|
f0604f17d6 | ||
|
|
3fce6c3270 | ||
|
|
ba36aa0602 | ||
|
|
58a54666a7 | ||
|
|
40178d3a77 | ||
|
|
b9ca4fe720 | ||
|
|
c6afbb198c | ||
|
|
c267424d7b | ||
|
|
053a0e3a8e | ||
|
|
39b1c602aa | ||
|
|
2df9108f70 | ||
|
|
a2d2353f0d | ||
|
|
6af7fe7bf9 | ||
|
|
26abcd14d2 | ||
|
|
2fe9a639e5 | ||
|
|
f1db42afed | ||
|
|
2d329c22c0 | ||
|
|
c3db9f982a | ||
|
|
c01e767ceb | ||
|
|
0d16e71b07 | ||
|
|
2fcce776e8 | ||
|
|
bad1e4b2e1 | ||
|
|
f5a228ae42 | ||
|
|
a40eb86598 | ||
|
|
0136b885fe | ||
|
|
0f7ac75854 | ||
|
|
9fc5987250 | ||
|
|
e71d9696d7 | ||
|
|
6e1306ba8b | ||
|
|
a607901e48 | ||
|
|
01053400d0 | ||
|
|
419b2d26fe | ||
|
|
4ed33b3073 | ||
|
|
ef9ee27d89 | ||
|
|
277da1b998 | ||
|
|
983b8c433c | ||
|
|
d5c69ef797 | ||
|
|
eb8ea6eac5 | ||
|
|
da68f39411 | ||
|
|
2fcc1267b5 | ||
|
|
4ead0cb8df | ||
|
|
f96dc5e195 | ||
|
|
82e166ebbb | ||
|
|
6a9aa3cf98 | ||
|
|
3cf7eece6f | ||
|
|
7dfff499c3 | ||
|
|
52e2de5780 | ||
|
|
c0d6757201 | ||
|
|
3942f87ee3 | ||
|
|
9d07c1872f | ||
|
|
be388d139c | ||
|
|
6e132bee5e | ||
|
|
7d63d3c635 | ||
|
|
08d53c4c6a | ||
|
|
94edd792f7 | ||
|
|
5ab6986171 | ||
|
|
25176dbdef | ||
|
|
b49807bfb2 | ||
|
|
d71367f33e | ||
|
|
bd85887daf | ||
|
|
82988e97cf | ||
|
|
2b374ec2d9 | ||
|
|
3e3b8558d6 | ||
|
|
5c4cb177ef | ||
|
|
71a3fc7989 | ||
|
|
5c9345dbd1 | ||
|
|
287ddc8d05 | ||
|
|
36ac5f1519 | ||
|
|
bde54af30f | ||
|
|
cafbd3477a | ||
|
|
165718775f | ||
|
|
f90d1551cb | ||
|
|
613f0e187f | ||
|
|
ca6da4ffce | ||
|
|
ac517dbe89 | ||
|
|
3ae3622d9e | ||
|
|
27682ba5ce | ||
|
|
8dd3e53122 | ||
|
|
d1187d36da | ||
|
|
0f85045bb3 | ||
|
|
69835e9fb6 | ||
|
|
3ba948db7e | ||
|
|
d1f9e2315b | ||
|
|
d04604664a | ||
|
|
4e9a99dd9a | ||
|
|
3f3df4e600 | ||
|
|
27e780fe97 | ||
|
|
122d3f15ae | ||
|
|
bb3fca40db | ||
|
|
91c40bd499 | ||
|
|
0f4fcb1fbd | ||
|
|
3fbc98bb54 | ||
|
|
240b9c0f89 | ||
|
|
fc13bb65df | ||
|
|
27f3ca3d5a | ||
|
|
f1a7e03bbe | ||
|
|
8d58cbb99e | ||
|
|
3b87431a69 | ||
|
|
d09816b054 | ||
|
|
19c23eefb7 | ||
|
|
ef8d2acace | ||
|
|
f7d6ece6e4 | ||
|
|
90a63a16ec | ||
|
|
ec7ec3773f | ||
|
|
a97f821233 | ||
|
|
b15e832f4d | ||
|
|
e77a16efec | ||
|
|
7fd7c6465e | ||
|
|
7fc23ef625 | ||
|
|
1bd7deb235 | ||
|
|
f2dd2f10c1 | ||
|
|
1af4f2f11d | ||
|
|
1703d0d59c | ||
|
|
7ac1d190bc | ||
|
|
0c3c6b1b0b | ||
|
|
01c3ff5a1e | ||
|
|
1b03d98f62 | ||
|
|
b294d530d4 | ||
|
|
75b6b90fe1 | ||
|
|
7613946ac6 | ||
|
|
5b16f997e8 | ||
|
|
ee041d6d4f | ||
|
|
f89f495c0d | ||
|
|
5e3e9e7a15 | ||
|
|
8d4d2c4cf4 | ||
|
|
36de2ed1e2 | ||
|
|
f42b337a0b | ||
|
|
6cdd12a9f2 | ||
|
|
a0ec87fbf9 | ||
|
|
5c71306463 | ||
|
|
da69105424 | ||
|
|
1ea1c0864c | ||
|
|
a4e98775a4 | ||
|
|
5017930f13 | ||
|
|
73b7370917 | ||
|
|
bca292d9e6 | ||
|
|
6e3b675ea8 | ||
|
|
95efa0587b | ||
|
|
e49ef588db | ||
|
|
5823a999fe | ||
|
|
218c464b91 | ||
|
|
3cc80de466 | ||
|
|
52fa9ac235 | ||
|
|
9b809393be |
@@ -18,7 +18,7 @@ cvs-dist: maintainer-check
|
||||
ver=`echo "$(VERSION)" | sed 's/\./_/g'`; \
|
||||
tag="$$pkg-$$ver"; \
|
||||
echo tag=$$tag; \
|
||||
if cvs -n log -h README| grep -e $$tag > /dev/null; then \
|
||||
if cvs -n log -h README| grep -e $$tag: > /dev/null; then \
|
||||
echo "VERSION not new; not tagging" 1>&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
@@ -37,8 +37,59 @@ my-distcheck: dist
|
||||
&& $(MAKE) dvi \
|
||||
&& $(MAKE) check \
|
||||
&& $(MAKE) distclean
|
||||
cd $(t) && $(TAR) --diff -z -f ../$(distdir).tar.gz
|
||||
cd $(t) && mv $(distdir) $(distdir).old \
|
||||
&& $(TAR) -zxf ../$(distdir).tar.gz
|
||||
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
||||
-rm -rf $(t)
|
||||
@echo "========================"; \
|
||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||
echo "========================"
|
||||
|
||||
THIS_VERSION_REGEXP = $(subst .,\.,$(VERSION))
|
||||
# FIXME: this works only for Gnits-style test releases.
|
||||
PREV_VERSION := $(shell echo $(VERSION)|tr a-z Xa-y)
|
||||
PREV_VERSION_REGEXP := $(shell echo $(PREV_VERSION)|sed 's/\./\\./g')
|
||||
v = Version
|
||||
url-host-prefix = ftp://alpha.gnu.org
|
||||
url = $(url-host-prefix)/gnu/fetish/$(distdir).tar.gz
|
||||
md5 = $(shell md5sum < $(distdir).tar.gz|sed 's/ -//')
|
||||
|
||||
rel-check:
|
||||
tarz=/tmp/rel-check-tarz-$$$$; \
|
||||
md5_tmp=/tmp/rel-check-md5-$$$$; \
|
||||
set -e; \
|
||||
trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
|
||||
wget -q --output-document=$$tarz $(url); \
|
||||
echo "$(md5) -" > $$md5_tmp; \
|
||||
md5sum -c $$md5_tmp < $$tarz
|
||||
|
||||
announcement: NEWS ChangeLog $(distdir).tar.gz
|
||||
@( \
|
||||
echo Subject: $(distdir) released; \
|
||||
echo; \
|
||||
echo FIXME: put comments here; \
|
||||
echo; \
|
||||
echo " $(url)"; \
|
||||
echo; \
|
||||
echo "$(md5) $(distdir).tar.gz"; \
|
||||
echo; \
|
||||
echo NEWS:; \
|
||||
sed -n "/$(THIS_VERSION_REGEXP)/,/$(PREV_VERSION_REGEXP)/p" NEWS \
|
||||
| grep -v '^\['; \
|
||||
echo; \
|
||||
echo ChangeLog entries:; \
|
||||
sed -n "1,/$v $(PREV_VERSION_REGEXP)/p" \
|
||||
ChangeLog; \
|
||||
)
|
||||
|
||||
alpha:
|
||||
$(MAKE) cvs-dist
|
||||
$(MAKE) -s announcement > /tmp/announcement
|
||||
ln $(distdir).tar.gz ../release
|
||||
chmod a-w $(distdir).tar.gz
|
||||
@echo =====================================
|
||||
@echo 'ncftp -u $(url-host-prefix)/fs/share/ftp/gnu/fetish/'
|
||||
@echo '# put $(distdir).tar.gz'
|
||||
@echo '# send the /tmp/announcement e-mail'
|
||||
@echo 'pot-mail $(distdir).tar.gz | bash'
|
||||
@echo =====================================
|
||||
|
||||
9
THANKS
9
THANKS
@@ -2,12 +2,19 @@ This is just a start at listing e-mail addresses of contributors.
|
||||
The rest of the addresses are still in the ChangeLog.
|
||||
|
||||
Achim Blumensath: blume@corona.oche.de
|
||||
aldomel: aldomel@ix.netcom.com
|
||||
Akim Demaille: demaille@inf.enst.fr
|
||||
Andreas Jaeger: jaeger@gnu.org
|
||||
Andreas Schwab: schwab@issan.informatik.uni-dortmund.de
|
||||
Andries Brouwer: Andries.Brouwer@cwi.nl
|
||||
Arne Henrik Juul: arnej@imf.unit.no
|
||||
Bauke Jan Douma: bjdouma@xs4all.nl
|
||||
Bengt Martensson: bengt@mathematik.uni-Bremen.de
|
||||
Bernd Leibing: bernd.leibing@rz.uni-ulm.de
|
||||
Bjorn Helgaas: helgaas@rsn.hp.com
|
||||
Brendan O'Dea: bod@compusol.com.au
|
||||
Charles Karney: karney@pppl.gov
|
||||
Christian von Roques: roques@pond.sub.org
|
||||
Dirk Lattermann: dlatt@t-online.de
|
||||
Don Parsons: dparsons@synapse.kent.edu
|
||||
Eirik Fuller: eirik@netcom.com
|
||||
@@ -29,11 +36,13 @@ Lorne Baker: lbaker@nitro.avint.net
|
||||
Marcus Daniels: marcus@sysc.pdx.edu
|
||||
Mark A. Thomas: thommark@access.digex.net
|
||||
Mark Harris: mark@monitor.designacc.com
|
||||
Mark Kettenis: kettenis@phys.uva.nl
|
||||
Marty Leisner: leisner@sdsp.mc.xerox.com
|
||||
Masami Takikawa: takikawm@CS.ORST.EDU
|
||||
Matthew S. Levine: mslevine@theory.lcs.mit.edu
|
||||
Miles Bader: miles@gnu.ai.mit.edu
|
||||
Noel Cragg: noel@red-bean.com
|
||||
Olav Morkrid: olav@funcom.com
|
||||
Peter Eriksson: peter@ifm.liu.se
|
||||
Paul Eggert: eggert@twinsun.com
|
||||
Philippe De Muyter: phdm@macqel.be
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.3b from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
@@ -32,7 +32,7 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
@@ -281,11 +281,10 @@ distdir: $(DISTFILES)
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
|
||||
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
|
||||
info: $(INFO_DEPS)
|
||||
dvi: $(DVIS)
|
||||
check: all
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
install-exec:
|
||||
@$(NORMAL_INSTALL)
|
||||
@@ -299,25 +298,20 @@ install: install-exec install-data all
|
||||
uninstall: uninstall-info
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(DISTCLEANFILES)
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-vti mostlyclean-aminfo mostlyclean-generic
|
||||
|
||||
clean: clean-vti clean-aminfo clean-generic mostlyclean
|
||||
|
||||
@@ -166,7 +166,7 @@ The GNU shell utilities are mostly compatible with the POSIX.2 standard.
|
||||
@c This paragraph appears in all of fileutils.texi, textutils.texi, and
|
||||
@c sh-utils.texi too -- so be sure to keep them consistent.
|
||||
@cindex bugs, reporting
|
||||
Please report bugs to @samp{sh-utils-bugs@@gnu.org}. Remember
|
||||
Please report bugs to @samp{bug-sh-utils@@gnu.org}. Remember
|
||||
to include the version number, machine architecture, input files, and
|
||||
any other information needed to reproduce the bug: your input, what you
|
||||
expected, what you got, and why it is wrong. Diffs are welcome, but
|
||||
|
||||
1694
doc/texinfo.tex
1694
doc/texinfo.tex
File diff suppressed because it is too large
Load Diff
@@ -35,6 +35,7 @@ START-INFO-DIR-ENTRY
|
||||
* 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.
|
||||
* ptx: (textutils)ptx invocation. Produce permuted indexes.
|
||||
* sort: (textutils)sort invocation. Sort text files.
|
||||
* split: (textutils)split invocation. Split into fixed-size pieces.
|
||||
* sum: (textutils)sum invocation. Print traditional checksum.
|
||||
@@ -117,12 +118,89 @@ This manual documents version @value{VERSION} of the GNU text utilities.
|
||||
* Formatting file contents:: fmt pr fold
|
||||
* Output of parts of files:: head tail split csplit
|
||||
* Summarizing files:: wc sum cksum md5sum
|
||||
* Operating on sorted files:: sort uniq comm
|
||||
* Operating on sorted files:: sort uniq comm ptx
|
||||
* Operating on fields within a line:: cut paste join
|
||||
* Operating on characters:: tr expand unexpand
|
||||
* Opening the software toolbox:: The software tools philosophy.
|
||||
* Index:: General index.
|
||||
|
||||
@detailmenu
|
||||
--- The Detailed Node Listing ---
|
||||
|
||||
Output of entire files
|
||||
|
||||
* cat invocation:: Concatenate and write files.
|
||||
* tac invocation:: Concatenate and write files in reverse.
|
||||
* nl invocation:: Number lines and write files.
|
||||
* od invocation:: Write files in octal or other formats.
|
||||
|
||||
Formatting file contents
|
||||
|
||||
* fmt invocation:: Reformat paragraph text.
|
||||
* pr invocation:: Paginate or columnate files for printing.
|
||||
* fold invocation:: Wrap input lines to fit in specified width.
|
||||
|
||||
Output of parts of files
|
||||
|
||||
* head invocation:: Output the first part of files.
|
||||
* tail invocation:: Output the last part of files.
|
||||
* split invocation:: Split a file into fixed-size pieces.
|
||||
* csplit invocation:: Split a file into context-determined pieces.
|
||||
|
||||
Summarizing 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.
|
||||
|
||||
Operating on sorted files
|
||||
|
||||
* sort invocation:: Sort text files.
|
||||
* uniq invocation:: Uniqify files.
|
||||
* comm invocation:: Compare two sorted files line by line.
|
||||
* ptx invocation:: Produce a permuted index of file contents.
|
||||
|
||||
@code{ptx}: Produce permuted indexes
|
||||
|
||||
* General options in ptx:: Options which affect general program behaviour.
|
||||
* Charset selection in ptx:: Underlying character set considerations.
|
||||
* Input processing in ptx:: Input fields, contexts, and keyword selection.
|
||||
* Output formatting in ptx:: Types of output format, and sizing the fields.
|
||||
* Compatibility in ptx:: The GNU extensions to @code{ptx}
|
||||
|
||||
Operating on fields within a line
|
||||
|
||||
* cut invocation:: Print selected parts of lines.
|
||||
* paste invocation:: Merge lines of files.
|
||||
* join invocation:: Join lines on a common field.
|
||||
|
||||
Operating on characters
|
||||
|
||||
* tr invocation:: Translate, squeeze, and/or delete characters.
|
||||
* expand invocation:: Convert tabs to spaces.
|
||||
* unexpand invocation:: Convert spaces to tabs.
|
||||
|
||||
@code{tr}: Translate, squeeze, and/or delete characters
|
||||
|
||||
* Character sets:: Specifying sets of characters.
|
||||
* Translating:: Changing one characters to another.
|
||||
* Squeezing:: Squeezing repeats and deleting.
|
||||
* Warnings in tr:: Warning messages.
|
||||
|
||||
Opening the software toolbox
|
||||
|
||||
* Toolbox introduction:: Toolbox introduction
|
||||
* I/O redirection:: I/O redirection
|
||||
* The who command:: The @code{who} command
|
||||
* The cut command:: The @code{cut} command
|
||||
* The sort command:: The @code{sort} command
|
||||
* The uniq command:: The @code{uniq} command
|
||||
* Putting the tools together:: Putting the tools together
|
||||
|
||||
@end detailmenu
|
||||
@end menu
|
||||
|
||||
@end ifinfo
|
||||
|
||||
|
||||
@@ -142,7 +220,7 @@ The GNU text utilities are mostly compatible with the @sc{POSIX.2} standard.
|
||||
@c This paragraph appears in all of fileutils.texi, textutils.texi, and
|
||||
@c sh-utils.texi too -- so be sure to keep them consistent.
|
||||
@cindex bugs, reporting
|
||||
Please report bugs to @email{textutils-bugs@@gnu.org}. Remember
|
||||
Please report bugs to @email{bug-textutils@@gnu.org}. Remember
|
||||
to include the version number, machine architecture, input files, and
|
||||
any other information needed to reproduce the bug: your input, what you
|
||||
expected, what you got, and why it is wrong. Diffs are welcome, but
|
||||
@@ -872,10 +950,12 @@ The program accepts the following options. Also see @ref{Common options}.
|
||||
|
||||
@table @samp
|
||||
|
||||
@item +@var{first_page}[@var{:last_page}]
|
||||
@opindex +@var{first_page}[@var{:last_page}]
|
||||
@item +@var{first_page}[:@var{last_page}]
|
||||
@itemx --pages=@var{first_page}[:@var{last_page}]
|
||||
@opindex +@var{first_page}[:@var{last_page}]
|
||||
@opindex --pages
|
||||
Begin printing with page @var{first_page} and stop with
|
||||
@var{last_page}. Missing @samp{:LAST_PAGE} implies end of file. While
|
||||
@var{last_page}. Missing @samp{:@var{last_page}} implies end of file. While
|
||||
estimating the number of skipped pages each form feed in the input file
|
||||
results in a new page. Page counting with and without
|
||||
@samp{+@var{first_page}} is identical. By default, it starts with the
|
||||
@@ -883,7 +963,9 @@ first page of input file (not first page printed). Page numbering may be
|
||||
altered by @samp{-N} option.
|
||||
|
||||
@item -@var{column}
|
||||
@itemx --columns=@var{column}
|
||||
@opindex -@var{column}
|
||||
@opindex --columns
|
||||
@cindex down columns
|
||||
With each single @var{file}, produce @var{column}-column output and
|
||||
print columns down. The column width is automatically estimated from
|
||||
@@ -892,24 +974,32 @@ truncated. The number of lines in the columns on each page will be
|
||||
balanced. @samp{-@var{column}} may not be used with @samp{-m} option.
|
||||
|
||||
@item -a
|
||||
@itemx --across
|
||||
@opindex -a
|
||||
@opindex --across
|
||||
@cindex across columns
|
||||
With each single @var{file}, print columns across rather than down.
|
||||
@var{column} must be greater than one.
|
||||
|
||||
@item -c
|
||||
@itemx --show-control-chars
|
||||
@opindex -c
|
||||
@opindex --show-control-chars
|
||||
Print control characters using hat notation (e.g., @samp{^G}); print
|
||||
other unprintable characters in octal backslash notation. By default,
|
||||
unprintable characters are not changed.
|
||||
|
||||
@item -d
|
||||
@itemx --double-space
|
||||
@opindex -d
|
||||
@opindex --double-space
|
||||
@cindex double spacing
|
||||
Double space the output.
|
||||
|
||||
@item -e[@var{in-tabchar}[@var{in-tabwidth}]]
|
||||
@itemx --expand-tabs[=@var{in-tabchar}[@var{in-tabwidth}]]
|
||||
@opindex -e
|
||||
@opindex --expand-tabs
|
||||
@cindex input tabs
|
||||
Expand tabs to spaces on input. Optional argument @var{in-tabchar} is
|
||||
the input tab character (default is @key{TAB}). Second optional
|
||||
@@ -918,15 +1008,19 @@ is 8).
|
||||
|
||||
@item -f
|
||||
@itemx -F
|
||||
@itemx --form-feed
|
||||
@opindex -F
|
||||
@opindex -f
|
||||
@opindex --form-feed
|
||||
Use a form feed instead of newlines to separate output pages. Default
|
||||
page length of 66 lines is not altered. But the number of lines of text
|
||||
per page changes from 56 to 63 lines.
|
||||
|
||||
|
||||
@item -h @var{HEADER}
|
||||
@itemx --header=@var{HEADER}
|
||||
@opindex -h
|
||||
@opindex --header
|
||||
Replace the file name in the header with the centered string
|
||||
@var{header}. Left-hand-side truncation (marked by a @samp{*}) may occur
|
||||
if the total header line @samp{yy-mm-dd HH:MM HEADER Page nnnn}
|
||||
@@ -935,7 +1029,9 @@ header. Don't use @samp{-h""}. A space between the -h option and the
|
||||
argument is always peremptory.
|
||||
|
||||
@item -i[@var{out-tabchar}[@var{out-tabwidth}]]
|
||||
@itemx --output-tabs[=@var{out-tabchar}[@var{out-tabwidth}]]
|
||||
@opindex -i
|
||||
@opindex --output-tabs
|
||||
@cindex output tabs
|
||||
Replace spaces with tabs on output. Optional argument @var{out-tabchar}
|
||||
is the output tab character (default is @key{TAB}). Second optional
|
||||
@@ -943,7 +1039,9 @@ argument @var{out-tabwidth} is the output tab character's width (default
|
||||
is 8).
|
||||
|
||||
@item -j
|
||||
@itemx --join-lines
|
||||
@opindex -j
|
||||
@opindex --join-lines
|
||||
Merge lines of full length. Used together with the column options
|
||||
@samp{-@var{column}}, @samp{-a -@var{column}} or @samp{-m}. Turns off
|
||||
@samp{-w} line truncation; no column alignment used; may be used with
|
||||
@@ -951,14 +1049,18 @@ Merge lines of full length. Used together with the column options
|
||||
|
||||
|
||||
@item -l @var{page_length}
|
||||
@itemx --length=@var{page_length}
|
||||
@opindex -l
|
||||
@opindex --length
|
||||
Set the page length to @var{page_length} (default 66) lines. If
|
||||
@var{page_length} is less than or equal 10 (and <= 3 with @samp{-f}),
|
||||
the headers and footers are omitted, and all form feeds set in input
|
||||
files are eliminated, as if the @samp{-T} option had been given.
|
||||
|
||||
@item -m
|
||||
@itemx --merge
|
||||
@opindex -m
|
||||
@opindex --merge
|
||||
Merge and print all @var{file}s in parallel, one in each column. If a
|
||||
line is too long to fit in a column, it is truncated (but see
|
||||
@samp{-j}). @samp{-s[@var{separator}]} may be used. Empty pages in some
|
||||
@@ -970,7 +1072,9 @@ line numbers. The default header becomes
|
||||
|
||||
|
||||
@item -n[@var{number-separator}[@var{digits}]]
|
||||
@itemx --number-lines[=@var{number-separator}[@var{digits}]]
|
||||
@opindex -n
|
||||
@opindex --number-lines
|
||||
Precede each column with a line number; with parallel @var{file}s
|
||||
(@samp{-m}), precede only each line with a line number. Optional argument
|
||||
@var{number-separator} is the character to print after each number
|
||||
@@ -980,12 +1084,16 @@ first line of the input file (not with the first line printed, see
|
||||
@samp{-N}).
|
||||
|
||||
@item -N @var{line_number}
|
||||
@itemx --first-line-number=@var{line_number}
|
||||
@opindex -N
|
||||
@opindex --first-line-number
|
||||
Start line counting with no. @var{line_number} at first line of first
|
||||
page printed.
|
||||
|
||||
@item -o @var{n}
|
||||
@itemx --indent=@var{n}
|
||||
@opindex -o
|
||||
@opindex --indent
|
||||
@cindex indenting lines
|
||||
@cindex left margin
|
||||
Indent each line with @var{n} (default is zero) spaces wide, i.e., set
|
||||
@@ -993,12 +1101,16 @@ the left margin. The total page width is @var{n} plus the width set
|
||||
with the @samp{-w} option.
|
||||
|
||||
@item -r
|
||||
@itemx --no-file-warnings
|
||||
@opindex -r
|
||||
@opindex --no-file-warnings
|
||||
Do not print a warning message when an argument @var{file} cannot be
|
||||
opened. (The exit status will still be nonzero, however.)
|
||||
|
||||
@item -s[@var{separator}]
|
||||
@itemx --separator[=@var{separator}]
|
||||
@opindex -s
|
||||
@opindex --separator
|
||||
Separate columns by a string @var{separator}. Don't use
|
||||
@samp{-s @var{separator}}, no space between flag and argument. If this
|
||||
option is omitted altogether, the default is @key{TAB} together with
|
||||
@@ -1007,7 +1119,9 @@ option is omitted altogether, the default is @key{TAB} together with
|
||||
does not affect line truncation or column alignment.
|
||||
|
||||
@item -t
|
||||
@itemx --omit-header
|
||||
@opindex -t
|
||||
@opindex --omit-header
|
||||
Do not print the usual header [and footer] on each page, and do not fill
|
||||
out the bottoms of pages (with blank lines or a form feed). No page
|
||||
structure is produced, but retain form feeds set in the input files. The
|
||||
@@ -1017,16 +1131,22 @@ useful together with other options; e.g.: @samp{-t -e4}, expand
|
||||
Use of @samp{-t} overrides @samp{-h}.
|
||||
|
||||
@item -T
|
||||
@itemx --omit-pagination
|
||||
@opindex -T
|
||||
@opindex --omit-pagination
|
||||
Do not print header [and footer]. In addition eliminate all form feeds
|
||||
set in the input files.
|
||||
|
||||
@item -v
|
||||
@itemx --show-nonprinting
|
||||
@opindex -v
|
||||
@opindex --show-nonprinting
|
||||
Print unprintable characters in octal backslash notation.
|
||||
|
||||
@item -w @var{page_width}
|
||||
@itemx --width=@var{page_width}
|
||||
@opindex -w
|
||||
@opindex --width
|
||||
Set the page width to @var{page_width} (default 72) characters.
|
||||
With/without @samp{-w}, header lines are always truncated to
|
||||
@var{page_width} characters. With @samp{-w}, text lines are truncated,
|
||||
@@ -1738,6 +1858,7 @@ These commands work with (or produce) sorted files.
|
||||
* sort invocation:: Sort text files.
|
||||
* uniq invocation:: Uniqify files.
|
||||
* comm invocation:: Compare two sorted files line by line.
|
||||
* ptx invocation::
|
||||
@end menu
|
||||
|
||||
|
||||
@@ -2188,6 +2309,469 @@ Upon normal completion @code{comm} produces an exit code of zero.
|
||||
If there is an error it exits with nonzero status.
|
||||
|
||||
|
||||
@node ptx invocation
|
||||
@section @code{ptx}: Produce permuted indexes
|
||||
|
||||
@pindex ptx
|
||||
|
||||
@code{ptx} reads a text file and essentially produces a permuted index, with
|
||||
each keyword in its context. The calling sketch is either one of:
|
||||
|
||||
@example
|
||||
ptx [@var{option} @dots{}] [@var{file} @dots{}]
|
||||
ptx -G [@var{option} @dots{}] [@var{input} [@var{output}]]
|
||||
@end example
|
||||
|
||||
The @samp{-G} (or its equivalent: @samp{--traditional}) option disables
|
||||
all GNU extensions and revert to traditional mode, thus introducing some
|
||||
limitations, and changes several of the program's default option values.
|
||||
When @samp{-G} is not specified, GNU extensions are always enabled. GNU
|
||||
extensions to @code{ptx} are documented wherever appropriate in this
|
||||
document. For the full list, see @xref{Compatibility in ptx}.
|
||||
|
||||
Individual options are explained in incoming sections.
|
||||
|
||||
When GNU extensions are enabled, there may be zero, one or several
|
||||
@var{file} after the options. If there is no @var{file}, the program
|
||||
reads the standard input. If there is one or several @var{file}, they
|
||||
give the name of input files which are all read in turn, as if all the
|
||||
input files were concatenated. However, there is a full contextual
|
||||
break between each file and, when automatic referencing is requested,
|
||||
file names and line numbers refer to individual text input files. In
|
||||
all cases, the program produces the permuted index onto the standard
|
||||
output.
|
||||
|
||||
When GNU extensions are @emph{not} enabled, that is, when the program
|
||||
operates in traditional mode, there may be zero, one or two parameters
|
||||
besides the options. If there is no parameters, the program reads the
|
||||
standard input and produces the permuted index onto the standard output.
|
||||
If there is only one parameter, it names the text @var{input} to be read
|
||||
instead of the standard input. If two parameters are given, they give
|
||||
respectively the name of the @var{input} file to read and the name of
|
||||
the @var{output} file to produce. @emph{Be very careful} to note that,
|
||||
in this case, the contents of file given by the second parameter is
|
||||
destroyed. This behaviour is dictated only by System V @code{ptx}
|
||||
compatibility, because GNU Standards discourage output parameters not
|
||||
introduced by an option.
|
||||
|
||||
Note that for @emph{any} file named as the value of an option or as an
|
||||
input text file, a single dash @kbd{-} may be used, in which case
|
||||
standard input is assumed. However, it would not make sense to use this
|
||||
convention more than once per program invocation.
|
||||
|
||||
@menu
|
||||
* General options in ptx:: Options which affect general program behaviour.
|
||||
* Charset selection in ptx:: Underlying character set considerations.
|
||||
* Input processing in ptx:: Input fields, contexts, and keyword selection.
|
||||
* Output formatting in ptx:: Types of output format, and sizing the fields.
|
||||
* Compatibility in ptx::
|
||||
@end menu
|
||||
|
||||
|
||||
@node General options in ptx
|
||||
@subsection General options
|
||||
|
||||
@table @code
|
||||
|
||||
@item -C
|
||||
@itemx --copyright
|
||||
Prints a short note about the Copyright and copying conditions, then
|
||||
exit without further processing.
|
||||
|
||||
@item -G
|
||||
@itemx --traditional
|
||||
As already explained, this option disables all GNU extensions to
|
||||
@code{ptx} and switch to traditional mode.
|
||||
|
||||
@item --help
|
||||
Prints a short help on standard output, then exit without further
|
||||
processing.
|
||||
|
||||
@item --version
|
||||
Prints the program verison on standard output, then exit without further
|
||||
processing.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@node Charset selection in ptx
|
||||
@subsection Charset selection
|
||||
|
||||
As it is setup now, the program assumes that the input file is coded
|
||||
using 8-bit ISO 8859-1 code, also known as Latin-1 character set,
|
||||
@emph{unless} if it is compiled for MS-DOS, in which case it uses the
|
||||
character set of the IBM-PC. (GNU @code{ptx} is not known to work on
|
||||
smaller MS-DOS machines anymore.) Compared to 7-bit ASCII, the set of
|
||||
characters which are letters is then different, this fact alters the
|
||||
behaviour of regular expression matching. Thus, the default regular
|
||||
expression for a keyword allows foreign or diacriticized letters.
|
||||
Keyword sorting, however, is still crude; it obeys the underlying
|
||||
character set ordering quite blindly.
|
||||
|
||||
@table @code
|
||||
|
||||
@item -f
|
||||
@itemx --ignore-case
|
||||
Fold lower case letters to upper case for sorting.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@node Input processing in ptx
|
||||
@subsection Word selection and input processing
|
||||
|
||||
@table @code
|
||||
|
||||
@item -b @var{file}
|
||||
@item --break-file=@var{file}
|
||||
|
||||
This option is an alternative way to option @code{-W} for describing
|
||||
which characters make up words. This option introduces the name of a
|
||||
file which contains a list of characters which can@emph{not} be part of
|
||||
one word, this file is called the @dfn{Break file}. Any character which
|
||||
is not part of the Break file is a word constituent. If both options
|
||||
@code{-b} and @code{-W} are specified, then @code{-W} has precedence and
|
||||
@code{-b} is ignored.
|
||||
|
||||
When GNU extensions are enabled, the only way to avoid newline as a
|
||||
break character is to write all the break characters in the file with no
|
||||
newline at all, not even at the end of the file. When GNU extensions
|
||||
are disabled, spaces, tabs and newlines are always considered as break
|
||||
characters even if not included in the Break file.
|
||||
|
||||
@item -i @var{file}
|
||||
@itemx --ignore-file=@var{file}
|
||||
|
||||
The file associated with this option contains a list of words which will
|
||||
never be taken as keywords in concordance output. It is called the
|
||||
@dfn{Ignore file}. The file contains exactly one word in each line; the
|
||||
end of line separation of words is not subject to the value of the
|
||||
@code{-S} option.
|
||||
|
||||
There is a default Ignore file used by @code{ptx} when this option is
|
||||
not specified, usually found in @file{/usr/local/lib/eign} if this has
|
||||
not been changed at installation time. If you want to deactivate the
|
||||
default Ignore file, specify @code{/dev/null} instead.
|
||||
|
||||
@item -o @var{file}
|
||||
@itemx --only-file=@var{file}
|
||||
|
||||
The file associated with this option contains a list of words which will
|
||||
be retained in concordance output, any word not mentioned in this file
|
||||
is ignored. The file is called the @dfn{Only file}. The file contains
|
||||
exactly one word in each line; the end of line separation of words is
|
||||
not subject to the value of the @code{-S} option.
|
||||
|
||||
There is no default for the Only file. In the case there are both an
|
||||
Only file and an Ignore file, a word will be subject to be a keyword
|
||||
only if it is given in the Only file and not given in the Ignore file.
|
||||
|
||||
@item -r
|
||||
@itemx --references
|
||||
|
||||
On each input line, the leading sequence of non white characters will be
|
||||
taken to be a reference that has the purpose of identifying this input
|
||||
line on the produced permuted index. For more information about reference
|
||||
production, see @xref{Output formatting in ptx}.
|
||||
Using this option changes the default value for option @code{-S}.
|
||||
|
||||
Using this option, the program does not try very hard to remove
|
||||
references from contexts in output, but it succeeds in doing so
|
||||
@emph{when} the context ends exactly at the newline. If option
|
||||
@code{-r} is used with @code{-S} default value, or when GNU extensions
|
||||
are disabled, this condition is always met and references are completely
|
||||
excluded from the output contexts.
|
||||
|
||||
@item -S @var{regexp}
|
||||
@itemx --sentence-regexp=@var{regexp}
|
||||
|
||||
This option selects which regular expression will describe the end of a
|
||||
line or the end of a sentence. In fact, there is other distinction
|
||||
between end of lines or end of sentences than the effect of this regular
|
||||
expression, and input line boundaries have no special significance
|
||||
outside this option. By default, when GNU extensions are enabled and if
|
||||
@code{-r} option is not used, end of sentences are used. In this
|
||||
case, the precise @var{regex} is imported from GNU emacs:
|
||||
|
||||
@example
|
||||
[.?!][]\"')@}]*\\($\\|\t\\| \\)[ \t\n]*
|
||||
@end example
|
||||
|
||||
Whenever GNU extensions are disabled or if @code{-r} option is used, end
|
||||
of lines are used; in this case, the default @var{regexp} is just:
|
||||
|
||||
@example
|
||||
\n
|
||||
@end example
|
||||
|
||||
Using an empty REGEXP is equivalent to completely disabling end of line or end
|
||||
of sentence recognition. In this case, the whole file is considered to
|
||||
be a single big line or sentence. The user might want to disallow all
|
||||
truncation flag generation as well, through option @code{-F ""}.
|
||||
@xref{Regexps, , Syntax of Regular Expressions, emacs, The GNU Emacs
|
||||
Manual}.
|
||||
|
||||
When the keywords happen to be near the beginning of the input line or
|
||||
sentence, this often creates an unused area at the beginning of the
|
||||
output context line; when the keywords happen to be near the end of the
|
||||
input line or sentence, this often creates an unused area at the end of
|
||||
the output context line. The program tries to fill those unused areas
|
||||
by wrapping around context in them; the tail of the input line or
|
||||
sentence is used to fill the unused area on the left of the output line;
|
||||
the head of the input line or sentence is used to fill the unused area
|
||||
on the right of the output line.
|
||||
|
||||
As a matter of convenience to the user, many usual backslashed escape
|
||||
sequences, as found in the C language, are recognized and converted to
|
||||
the corresponding characters by @code{ptx} itself.
|
||||
|
||||
@item -W @var{regexp}
|
||||
@itemx --word-regexp=@var{regexp}
|
||||
|
||||
This option selects which regular expression will describe each keyword.
|
||||
By default, if GNU extensions are enabled, a word is a sequence of
|
||||
letters; the @var{regexp} used is @code{\w+}. When GNU extensions are
|
||||
disabled, a word is by default anything which ends with a space, a tab
|
||||
or a newline; the @var{regexp} used is @code{[^ \t\n]+}.
|
||||
|
||||
An empty REGEXP is equivalent to not using this option, letting the
|
||||
default dive in. @xref{Regexps, , Syntax of Regular Expressions, emacs,
|
||||
The GNU Emacs Manual}.
|
||||
|
||||
As a matter of convenience to the user, many usual backslashed escape
|
||||
sequences, as found in the C language, are recognized and converted to
|
||||
the corresponding characters by @code{ptx} itself.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@node Output formatting in ptx
|
||||
@subsection Output formatting
|
||||
|
||||
Output format is mainly controlled by @code{-O} and @code{-T} options,
|
||||
described in the table below. When neither @code{-O} nor @code{-T} is
|
||||
selected, and if GNU extensions are enabled, the program choose an
|
||||
output format suited for a dumb terminal. Each keyword occurrence is
|
||||
output to the center of one line, surrounded by its left and right
|
||||
contexts. Each field is properly justified, so the concordance output
|
||||
could readily be observed. As a special feature, if automatic
|
||||
references are selected by option @code{-A} and are output before the
|
||||
left context, that is, if option @code{-R} is @emph{not} selected, then
|
||||
a colon is added after the reference; this nicely interfaces with GNU
|
||||
Emacs @code{next-error} processing. In this default output format, each
|
||||
white space character, like newline and tab, is merely changed to
|
||||
exactly one space, with no special attempt to compress consecutive
|
||||
spaces. This might change in the future. Except for those white space
|
||||
characters, every other character of the underlying set of 256
|
||||
characters is transmitted verbatim.
|
||||
|
||||
Output format is further controlled by the following options.
|
||||
|
||||
@table @code
|
||||
|
||||
@item -g @var{number}
|
||||
@itemx --gap-size=@var{number}
|
||||
|
||||
Select the size of the minimum white gap between the fields on the output
|
||||
line.
|
||||
|
||||
@item -w @var{number}
|
||||
@itemx --width=@var{number}
|
||||
|
||||
Select the output maximum width of each final line. If references are
|
||||
used, they are included or excluded from the output maximum width
|
||||
depending on the value of option @code{-R}. If this option is not
|
||||
selected, that is, when references are output before the left context,
|
||||
the output maximum width takes into account the maximum length of all
|
||||
references. If this options is selected, that is, when references are
|
||||
output after the right context, the output maximum width does not take
|
||||
into account the space taken by references, nor the gap that precedes
|
||||
them.
|
||||
|
||||
@item -A
|
||||
@itemx --auto-reference
|
||||
|
||||
Select automatic references. Each input line will have an automatic
|
||||
reference made up of the file name and the line ordinal, with a single
|
||||
colon between them. However, the file name will be empty when standard
|
||||
input is being read. If both @code{-A} and @code{-r} are selected, then
|
||||
the input reference is still read and skipped, but the automatic
|
||||
reference is used at output time, overriding the input reference.
|
||||
|
||||
@item -R
|
||||
@itemx --right-side-refs
|
||||
|
||||
In default output format, when option @code{-R} is not used, any
|
||||
reference produced by the effect of options @code{-r} or @code{-A} are
|
||||
given to the far right of output lines, after the right context. In
|
||||
default output format, when option @code{-R} is specified, references
|
||||
are rather given to the beginning of each output line, before the left
|
||||
context. For any other output format, option @code{-R} is almost
|
||||
ignored, except for the fact that the width of references is @emph{not}
|
||||
taken into account in total output width given by @code{-w} whenever
|
||||
@code{-R} is selected.
|
||||
|
||||
This option is automatically selected whenever GNU extensions are
|
||||
disabled.
|
||||
|
||||
@item -F @var{string}
|
||||
@itemx --flac-truncation=@var{string}
|
||||
|
||||
This option will request that any truncation in the output be reported
|
||||
using the string @var{string}. Most output fields theoretically extend
|
||||
towards the beginning or the end of the current line, or current
|
||||
sentence, as selected with option @code{-S}. But there is a maximum
|
||||
allowed output line width, changeable through option @code{-w}, which is
|
||||
further divided into space for various output fields. When a field has
|
||||
to be truncated because cannot extend until the beginning or the end of
|
||||
the current line to fit in the, then a truncation occurs. By default,
|
||||
the string used is a single slash, as in @code{-F /}.
|
||||
|
||||
@var{string} may have more than one character, as in @code{-F ...}.
|
||||
Also, in the particular case @var{string} is empty (@code{-F ""}),
|
||||
truncation flagging is disabled, and no truncation marks are appended in
|
||||
this case.
|
||||
|
||||
As a matter of convenience to the user, many usual backslashed escape
|
||||
sequences, as found in the C language, are recognized and converted to
|
||||
the corresponding characters by @code{ptx} itself.
|
||||
|
||||
@item -M @var{string}
|
||||
@itemx --macro-name=@var{string}
|
||||
|
||||
Select another @var{string} to be used instead of @samp{xx}, while
|
||||
generating output suitable for @code{nroff}, @code{troff} or @TeX{}.
|
||||
|
||||
@item -O
|
||||
@itemx --format=roff
|
||||
|
||||
Choose an output format suitable for @code{nroff} or @code{troff}
|
||||
processing. Each output line will look like:
|
||||
|
||||
@example
|
||||
.xx "@var{tail}" "@var{before}" "@var{keyword_and_after}" "@var{head}" "@var{ref}"
|
||||
@end example
|
||||
|
||||
so it will be possible to write an @samp{.xx} roff macro to take care of
|
||||
the output typesetting. This is the default output format when GNU
|
||||
extensions are disabled. Option @samp{-M} might be used to change
|
||||
@samp{xx} to another macro name.
|
||||
|
||||
In this output format, each non-graphical character, like newline and
|
||||
tab, is merely changed to exactly one space, with no special attempt to
|
||||
compress consecutive spaces. Each quote character: @kbd{"} is doubled
|
||||
so it will be correctly processed by @code{nroff} or @code{troff}.
|
||||
|
||||
@item -T
|
||||
@itemx --format=tex
|
||||
|
||||
Choose an output format suitable for @TeX{} processing. Each output
|
||||
line will look like:
|
||||
|
||||
@example
|
||||
\xx @{@var{tail}@}@{@var{before}@}@{@var{keyword}@}@{@var{after}@}@{@var{head}@}@{@var{ref}@}
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
so it will be possible to write write a @code{\xx} definition to take
|
||||
care of the output typesetting. Note that when references are not being
|
||||
produced, that is, neither option @code{-A} nor option @code{-r} is
|
||||
selected, the last parameter of each @code{\xx} call is inhibited.
|
||||
Option @samp{-M} might be used to change @samp{xx} to another macro
|
||||
name.
|
||||
|
||||
In this output format, some special characters, like @kbd{$}, @kbd{%},
|
||||
@kbd{&}, @kbd{#} and @kbd{_} are automatically protected with a
|
||||
backslash. Curly brackets @kbd{@{}, @kbd{@}} are also protected with a
|
||||
backslash, but also enclosed in a pair of dollar signs to force
|
||||
mathematical mode. The backslash itself produces the sequence
|
||||
@code{\backslash@{@}}. Circumflex and tilde diacritics produce the
|
||||
sequence @code{^\@{ @}} and @code{~\@{ @}} respectively. Other
|
||||
diacriticized characters of the underlying character set produce an
|
||||
appropriate @TeX{} sequence as far as possible. The other non-graphical
|
||||
characters, like newline and tab, and all others characters which are
|
||||
not part of ASCII, are merely changed to exactly one space, with no
|
||||
special attempt to compress consecutive spaces. Let me know how to
|
||||
improve this special character processing for @TeX{}.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@node Compatibility in ptx
|
||||
@subsection The GNU extensions to @code{ptx}
|
||||
|
||||
This version of @code{ptx} contains a few features which do not exist in
|
||||
System V @code{ptx}. These extra features are suppressed by using the
|
||||
@samp{-G} command line option, unless overridden by other command line
|
||||
options. Some GNU extensions cannot be recovered by overriding, so the
|
||||
simple rule is to avoid @samp{-G} if you care about GNU extensions.
|
||||
Here are the differences between this program and System V @code{ptx}.
|
||||
|
||||
@itemize @bullet
|
||||
|
||||
@item
|
||||
This program can read many input files at once, it always writes the
|
||||
resulting concordance on standard output. On the other end, System V
|
||||
@code{ptx} reads only one file and produce the result on standard output
|
||||
or, if a second @var{file} parameter is given on the command, to that
|
||||
@var{file}.
|
||||
|
||||
Having output parameters not introduced by options is a quite dangerous
|
||||
practice which GNU avoids as far as possible. So, for using @code{ptx}
|
||||
portably between GNU and System V, you should pay attention to always
|
||||
use it with a single input file, and always expect the result on
|
||||
standard output. You might also want to automatically configure in a
|
||||
@samp{-G} option to @code{ptx} calls in products using @code{ptx}, if
|
||||
the configurator finds that the installed @code{ptx} accepts @samp{-G}.
|
||||
|
||||
@item
|
||||
The only options available in System V @code{ptx} are options @samp{-b},
|
||||
@samp{-f}, @samp{-g}, @samp{-i}, @samp{-o}, @samp{-r}, @samp{-t} and
|
||||
@samp{-w}. All other options are GNU extensions and are not repeated in
|
||||
this enumeration. Moreover, some options have a slightly different
|
||||
meaning when GNU extensions are enabled, as explained below.
|
||||
|
||||
@item
|
||||
By default, concordance output is not formatted for @code{troff} or
|
||||
@code{nroff}. It is rather formatted for a dumb terminal. @code{troff}
|
||||
or @code{nroff} output may still be selected through option @code{-O}.
|
||||
|
||||
@item
|
||||
Unless @code{-R} option is used, the maximum reference width is
|
||||
subtracted from the total output line width. With GNU extensions
|
||||
disabled, width of references is not taken into account in the output
|
||||
line width computations.
|
||||
|
||||
@item
|
||||
All 256 characters, even @kbd{NUL}s, are always read and processed from
|
||||
input file with no adverse effect, even if GNU extensions are disabled.
|
||||
However, System V @code{ptx} does not accept 8-bit characters, a few
|
||||
control characters are rejected, and the tilda @kbd{~} is condemned.
|
||||
|
||||
@item
|
||||
Input line length is only limited by available memory, even if GNU
|
||||
extensions are disabled. However, System V @code{ptx} processes only
|
||||
the first 200 characters in each line.
|
||||
|
||||
@item
|
||||
The break (non-word) characters default to be every character except all
|
||||
letters of the underlying character set, diacriticized or not. When GNU
|
||||
extensions are disabled, the break characters default to space, tab and
|
||||
newline only.
|
||||
|
||||
@item
|
||||
The program makes better use of output line width. If GNU extensions
|
||||
are disabled, the program rather tries to imitate System V @code{ptx},
|
||||
but still, there are some slight disposition glitches this program does
|
||||
not completely reproduce.
|
||||
|
||||
@item
|
||||
The user can specify both an Ignore file and an Only file. This is not
|
||||
allowed with System V @code{ptx}.
|
||||
|
||||
@end itemize
|
||||
|
||||
|
||||
@node Operating on fields within a line
|
||||
@chapter Operating on fields within a line
|
||||
|
||||
@@ -2845,7 +3429,6 @@ ones, to tabs.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@c What's GNU?
|
||||
@c Arnold Robbins
|
||||
@node Opening the software toolbox
|
||||
@@ -2856,13 +3439,13 @@ number 2, in the @cite{What's GNU?} column. It was written by Arnold
|
||||
Robbins.
|
||||
|
||||
@menu
|
||||
* Toolbox introduction::
|
||||
* I/O redirection::
|
||||
* The who command::
|
||||
* The cut command::
|
||||
* The sort command::
|
||||
* The uniq command::
|
||||
* Putting the tools together::
|
||||
* Toolbox introduction:: Toolbox introduction
|
||||
* I/O redirection:: I/O redirection
|
||||
* The who command:: The @code{who} command
|
||||
* The cut command:: The @code{cut} command
|
||||
* The sort command:: The @code{sort} command
|
||||
* The uniq command:: The @code{uniq} command
|
||||
* Putting the tools together:: Putting the tools together
|
||||
@end menu
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
Makefile
|
||||
getdate.c
|
||||
posixtm.c
|
||||
safe-stat.h
|
||||
safe-stat.c
|
||||
safe-lstat.c
|
||||
|
||||
@@ -6,7 +6,7 @@ noinst_LIBRARIES = libfu.a
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
|
||||
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
|
||||
libfu_a_SOURCES = getdate.y posixtm.c getopt.c getopt1.c \
|
||||
addext.c argmatch.c backupfile.c basename.c \
|
||||
closeout.c dirname.c exclude.c filemode.c \
|
||||
full-write.c human.c idcache.c \
|
||||
@@ -18,10 +18,10 @@ libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
|
||||
|
||||
noinst_HEADERS = argmatch.h backupfile.h closeout.h \
|
||||
error.h exclude.h fnmatch.h fsusage.h \
|
||||
getdate.h getline.h getopt.h group-member.h human.h long-options.h \
|
||||
error.h exclude.h filemode.h fnmatch.h fsusage.h \
|
||||
getdate.h getline.h getopt.h group-member.h human.h lchown.h long-options.h \
|
||||
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
|
||||
quotearg.h regex.h safe-read.h save-cwd.h savedir.h strverscmp.h \
|
||||
posixtm.h quotearg.h regex.h safe-read.h save-cwd.h savedir.h strverscmp.h \
|
||||
xalloc.h xstrtol.h xstrtoul.h
|
||||
|
||||
BUILT_SOURCES = getdate.c posixtm.c
|
||||
BUILT_SOURCES = getdate.c
|
||||
|
||||
204
lib/Makefile.in
204
lib/Makefile.in
@@ -1,4 +1,4 @@
|
||||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.3b from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
@@ -32,7 +32,7 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
@@ -96,7 +96,7 @@ noinst_LIBRARIES = libfu.a
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
|
||||
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
|
||||
libfu_a_SOURCES = getdate.y posixtm.c getopt.c getopt1.c \
|
||||
addext.c argmatch.c backupfile.c basename.c \
|
||||
closeout.c dirname.c exclude.c filemode.c \
|
||||
full-write.c human.c idcache.c \
|
||||
@@ -108,13 +108,13 @@ libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
|
||||
|
||||
noinst_HEADERS = argmatch.h backupfile.h closeout.h \
|
||||
error.h exclude.h fnmatch.h fsusage.h \
|
||||
getdate.h getline.h getopt.h group-member.h human.h long-options.h \
|
||||
error.h exclude.h filemode.h fnmatch.h fsusage.h \
|
||||
getdate.h getline.h getopt.h group-member.h human.h lchown.h long-options.h \
|
||||
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
|
||||
quotearg.h regex.h safe-read.h save-cwd.h savedir.h strverscmp.h \
|
||||
posixtm.h quotearg.h regex.h safe-read.h save-cwd.h savedir.h strverscmp.h \
|
||||
xalloc.h xstrtol.h xstrtoul.h
|
||||
|
||||
BUILT_SOURCES = getdate.c posixtm.c
|
||||
BUILT_SOURCES = getdate.c
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@@ -134,19 +134,18 @@ hash$U.o path-concat$U.o quotearg$U.o safe-read$U.o save-cwd$U.o \
|
||||
savedir$U.o stripslash$U.o userspec$U.o xgetcwd$U.o xmalloc$U.o \
|
||||
xstrdup$U.o xstrtol$U.o xstrtoul$U.o yesno$U.o
|
||||
AR = ar
|
||||
YLWRAP = $(srcdir)/ylwrap
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in TODO alloca.c chown.c error.c \
|
||||
error.h euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c \
|
||||
getdate.c getgroups.c getline.c group-member.c lchown.c lstat.c \
|
||||
malloc.c memcmp.c memcpy.c memset.c mkdir.c mktime.c mountlist.c \
|
||||
obstack.c obstack.h posixtm.c realloc.c regex.c rename.c rmdir.c \
|
||||
rpmatch.c stat.c stpcpy.c strcasecmp.c strdup.c strftime.c strndup.c \
|
||||
strstr.c strtol.c strtoul.c strverscmp.c ylwrap
|
||||
obstack.c obstack.h realloc.c regex.c rename.c rmdir.c rpmatch.c stat.c \
|
||||
stpcpy.c strcasecmp.c strdup.c strftime.c strndup.c strstr.c strtol.c \
|
||||
strtoul.c strverscmp.c utime.c ylwrap
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
@@ -163,13 +162,13 @@ DEP_FILES = .deps/addext.P .deps/alloca.P .deps/argmatch.P \
|
||||
.deps/isdir.P .deps/lchown.P .deps/long-options.P .deps/lstat.P \
|
||||
.deps/makepath.P .deps/malloc.P .deps/memcmp.P .deps/memcpy.P \
|
||||
.deps/memset.P .deps/mkdir.P .deps/mktime.P .deps/modechange.P \
|
||||
.deps/mountlist.P .deps/obstack.P .deps/path-concat.P .deps/posixtm \
|
||||
.deps/posixtm.P .deps/quotearg.P .deps/realloc.P .deps/regex.P \
|
||||
.deps/rename.P .deps/rmdir.P .deps/rpmatch.P .deps/safe-read.P \
|
||||
.deps/save-cwd.P .deps/savedir.P .deps/stat.P .deps/stpcpy.P \
|
||||
.deps/strcasecmp.P .deps/strdup.P .deps/strftime.P .deps/stripslash.P \
|
||||
.deps/strndup.P .deps/strstr.P .deps/strtol.P .deps/strtoul.P \
|
||||
.deps/strverscmp.P .deps/userspec.P .deps/xgetcwd.P .deps/xmalloc.P \
|
||||
.deps/mountlist.P .deps/obstack.P .deps/path-concat.P .deps/posixtm.P \
|
||||
.deps/quotearg.P .deps/realloc.P .deps/regex.P .deps/rename.P \
|
||||
.deps/rmdir.P .deps/rpmatch.P .deps/safe-read.P .deps/save-cwd.P \
|
||||
.deps/savedir.P .deps/stat.P .deps/stpcpy.P .deps/strcasecmp.P \
|
||||
.deps/strdup.P .deps/strftime.P .deps/stripslash.P .deps/strndup.P \
|
||||
.deps/strstr.P .deps/strtol.P .deps/strtoul.P .deps/strverscmp.P \
|
||||
.deps/userspec.P .deps/utime.P .deps/xgetcwd.P .deps/xmalloc.P \
|
||||
.deps/xstrdup.P .deps/xstrtol.P .deps/xstrtoul.P .deps/yesno.P
|
||||
SOURCES = $(libfu_a_SOURCES)
|
||||
OBJECTS = $(libfu_a_OBJECTS)
|
||||
@@ -211,10 +210,10 @@ distclean-compile:
|
||||
|
||||
maintainer-clean-compile:
|
||||
../src/ansi2knr: ../src/ansi2knr.o
|
||||
cd ../src && $(MAKE) ansi2knr
|
||||
cd ../src && $(MAKE) $(AM_MAKEFLAGS) ansi2knr
|
||||
|
||||
../src/ansi2knr.o:
|
||||
cd ../src && $(MAKE) ansi2knr.o
|
||||
cd ../src && $(MAKE) $(AM_MAKEFLAGS) ansi2knr.o
|
||||
|
||||
|
||||
mostlyclean-kr:
|
||||
@@ -231,148 +230,152 @@ libfu.a: $(libfu_a_OBJECTS) $(libfu_a_DEPENDENCIES)
|
||||
$(AR) cru libfu.a $(libfu_a_OBJECTS) $(libfu_a_LIBADD)
|
||||
$(RANLIB) libfu.a
|
||||
.y.c:
|
||||
$(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS)
|
||||
posixtm.h: posixtm.c
|
||||
$(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
getdate.h: getdate.c
|
||||
|
||||
addext_.c: addext.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/addext.c; then echo $(srcdir)/addext.c; else echo addext.c; fi` | $(ANSI2KNR) > addext_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/addext.c; then echo $(srcdir)/addext.c; else echo addext.c; fi` | $(ANSI2KNR) > addext_.c
|
||||
alloca_.c: alloca.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | $(ANSI2KNR) > alloca_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | $(ANSI2KNR) > alloca_.c
|
||||
argmatch_.c: argmatch.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/argmatch.c; then echo $(srcdir)/argmatch.c; else echo argmatch.c; fi` | $(ANSI2KNR) > argmatch_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argmatch.c; then echo $(srcdir)/argmatch.c; else echo argmatch.c; fi` | $(ANSI2KNR) > argmatch_.c
|
||||
backupfile_.c: backupfile.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/backupfile.c; then echo $(srcdir)/backupfile.c; else echo backupfile.c; fi` | $(ANSI2KNR) > backupfile_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/backupfile.c; then echo $(srcdir)/backupfile.c; else echo backupfile.c; fi` | $(ANSI2KNR) > backupfile_.c
|
||||
basename_.c: basename.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` | $(ANSI2KNR) > basename_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` | $(ANSI2KNR) > basename_.c
|
||||
chown_.c: chown.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/chown.c; then echo $(srcdir)/chown.c; else echo chown.c; fi` | $(ANSI2KNR) > chown_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/chown.c; then echo $(srcdir)/chown.c; else echo chown.c; fi` | $(ANSI2KNR) > chown_.c
|
||||
closeout_.c: closeout.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/closeout.c; then echo $(srcdir)/closeout.c; else echo closeout.c; fi` | $(ANSI2KNR) > closeout_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/closeout.c; then echo $(srcdir)/closeout.c; else echo closeout.c; fi` | $(ANSI2KNR) > closeout_.c
|
||||
dirname_.c: dirname.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` | $(ANSI2KNR) > dirname_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` | $(ANSI2KNR) > dirname_.c
|
||||
error_.c: error.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | $(ANSI2KNR) > error_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | $(ANSI2KNR) > error_.c
|
||||
euidaccess_.c: euidaccess.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/euidaccess.c; then echo $(srcdir)/euidaccess.c; else echo euidaccess.c; fi` | $(ANSI2KNR) > euidaccess_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/euidaccess.c; then echo $(srcdir)/euidaccess.c; else echo euidaccess.c; fi` | $(ANSI2KNR) > euidaccess_.c
|
||||
exclude_.c: exclude.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/exclude.c; then echo $(srcdir)/exclude.c; else echo exclude.c; fi` | $(ANSI2KNR) > exclude_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/exclude.c; then echo $(srcdir)/exclude.c; else echo exclude.c; fi` | $(ANSI2KNR) > exclude_.c
|
||||
fileblocks_.c: fileblocks.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` | $(ANSI2KNR) > fileblocks_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` | $(ANSI2KNR) > fileblocks_.c
|
||||
filemode_.c: filemode.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/filemode.c; then echo $(srcdir)/filemode.c; else echo filemode.c; fi` | $(ANSI2KNR) > filemode_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/filemode.c; then echo $(srcdir)/filemode.c; else echo filemode.c; fi` | $(ANSI2KNR) > filemode_.c
|
||||
fnmatch_.c: fnmatch.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | $(ANSI2KNR) > fnmatch_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | $(ANSI2KNR) > fnmatch_.c
|
||||
fsusage_.c: fsusage.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/fsusage.c; then echo $(srcdir)/fsusage.c; else echo fsusage.c; fi` | $(ANSI2KNR) > fsusage_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fsusage.c; then echo $(srcdir)/fsusage.c; else echo fsusage.c; fi` | $(ANSI2KNR) > fsusage_.c
|
||||
ftruncate_.c: ftruncate.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/ftruncate.c; then echo $(srcdir)/ftruncate.c; else echo ftruncate.c; fi` | $(ANSI2KNR) > ftruncate_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ftruncate.c; then echo $(srcdir)/ftruncate.c; else echo ftruncate.c; fi` | $(ANSI2KNR) > ftruncate_.c
|
||||
full-write_.c: full-write.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/full-write.c; then echo $(srcdir)/full-write.c; else echo full-write.c; fi` | $(ANSI2KNR) > full-write_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/full-write.c; then echo $(srcdir)/full-write.c; else echo full-write.c; fi` | $(ANSI2KNR) > full-write_.c
|
||||
getdate_.c: getdate.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getdate.c; then echo $(srcdir)/getdate.c; else echo getdate.c; fi` | $(ANSI2KNR) > getdate_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getdate.c; then echo $(srcdir)/getdate.c; else echo getdate.c; fi` | $(ANSI2KNR) > getdate_.c
|
||||
getgroups_.c: getgroups.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getgroups.c; then echo $(srcdir)/getgroups.c; else echo getgroups.c; fi` | $(ANSI2KNR) > getgroups_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getgroups.c; then echo $(srcdir)/getgroups.c; else echo getgroups.c; fi` | $(ANSI2KNR) > getgroups_.c
|
||||
getline_.c: getline.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getline.c; then echo $(srcdir)/getline.c; else echo getline.c; fi` | $(ANSI2KNR) > getline_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getline.c; then echo $(srcdir)/getline.c; else echo getline.c; fi` | $(ANSI2KNR) > getline_.c
|
||||
getopt_.c: getopt.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | $(ANSI2KNR) > getopt_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | $(ANSI2KNR) > getopt_.c
|
||||
getopt1_.c: getopt1.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | $(ANSI2KNR) > getopt1_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | $(ANSI2KNR) > getopt1_.c
|
||||
group-member_.c: group-member.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/group-member.c; then echo $(srcdir)/group-member.c; else echo group-member.c; fi` | $(ANSI2KNR) > group-member_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/group-member.c; then echo $(srcdir)/group-member.c; else echo group-member.c; fi` | $(ANSI2KNR) > group-member_.c
|
||||
hash_.c: hash.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` | $(ANSI2KNR) > hash_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` | $(ANSI2KNR) > hash_.c
|
||||
human_.c: human.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/human.c; then echo $(srcdir)/human.c; else echo human.c; fi` | $(ANSI2KNR) > human_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/human.c; then echo $(srcdir)/human.c; else echo human.c; fi` | $(ANSI2KNR) > human_.c
|
||||
idcache_.c: idcache.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/idcache.c; then echo $(srcdir)/idcache.c; else echo idcache.c; fi` | $(ANSI2KNR) > idcache_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/idcache.c; then echo $(srcdir)/idcache.c; else echo idcache.c; fi` | $(ANSI2KNR) > idcache_.c
|
||||
isdir_.c: isdir.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/isdir.c; then echo $(srcdir)/isdir.c; else echo isdir.c; fi` | $(ANSI2KNR) > isdir_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/isdir.c; then echo $(srcdir)/isdir.c; else echo isdir.c; fi` | $(ANSI2KNR) > isdir_.c
|
||||
lchown_.c: lchown.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/lchown.c; then echo $(srcdir)/lchown.c; else echo lchown.c; fi` | $(ANSI2KNR) > lchown_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lchown.c; then echo $(srcdir)/lchown.c; else echo lchown.c; fi` | $(ANSI2KNR) > lchown_.c
|
||||
long-options_.c: long-options.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/long-options.c; then echo $(srcdir)/long-options.c; else echo long-options.c; fi` | $(ANSI2KNR) > long-options_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/long-options.c; then echo $(srcdir)/long-options.c; else echo long-options.c; fi` | $(ANSI2KNR) > long-options_.c
|
||||
lstat_.c: lstat.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` | $(ANSI2KNR) > lstat_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` | $(ANSI2KNR) > lstat_.c
|
||||
makepath_.c: makepath.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/makepath.c; then echo $(srcdir)/makepath.c; else echo makepath.c; fi` | $(ANSI2KNR) > makepath_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/makepath.c; then echo $(srcdir)/makepath.c; else echo makepath.c; fi` | $(ANSI2KNR) > makepath_.c
|
||||
malloc_.c: malloc.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | $(ANSI2KNR) > malloc_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | $(ANSI2KNR) > malloc_.c
|
||||
memcmp_.c: memcmp.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | $(ANSI2KNR) > memcmp_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | $(ANSI2KNR) > memcmp_.c
|
||||
memcpy_.c: memcpy.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | $(ANSI2KNR) > memcpy_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | $(ANSI2KNR) > memcpy_.c
|
||||
memset_.c: memset.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | $(ANSI2KNR) > memset_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | $(ANSI2KNR) > memset_.c
|
||||
mkdir_.c: mkdir.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/mkdir.c; then echo $(srcdir)/mkdir.c; else echo mkdir.c; fi` | $(ANSI2KNR) > mkdir_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mkdir.c; then echo $(srcdir)/mkdir.c; else echo mkdir.c; fi` | $(ANSI2KNR) > mkdir_.c
|
||||
mktime_.c: mktime.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | $(ANSI2KNR) > mktime_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | $(ANSI2KNR) > mktime_.c
|
||||
modechange_.c: modechange.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/modechange.c; then echo $(srcdir)/modechange.c; else echo modechange.c; fi` | $(ANSI2KNR) > modechange_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/modechange.c; then echo $(srcdir)/modechange.c; else echo modechange.c; fi` | $(ANSI2KNR) > modechange_.c
|
||||
mountlist_.c: mountlist.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/mountlist.c; then echo $(srcdir)/mountlist.c; else echo mountlist.c; fi` | $(ANSI2KNR) > mountlist_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mountlist.c; then echo $(srcdir)/mountlist.c; else echo mountlist.c; fi` | $(ANSI2KNR) > mountlist_.c
|
||||
obstack_.c: obstack.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` | $(ANSI2KNR) > obstack_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` | $(ANSI2KNR) > obstack_.c
|
||||
path-concat_.c: path-concat.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/path-concat.c; then echo $(srcdir)/path-concat.c; else echo path-concat.c; fi` | $(ANSI2KNR) > path-concat_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/path-concat.c; then echo $(srcdir)/path-concat.c; else echo path-concat.c; fi` | $(ANSI2KNR) > path-concat_.c
|
||||
posixtm_.c: posixtm.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/posixtm.c; then echo $(srcdir)/posixtm.c; else echo posixtm.c; fi` | $(ANSI2KNR) > posixtm_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/posixtm.c; then echo $(srcdir)/posixtm.c; else echo posixtm.c; fi` | $(ANSI2KNR) > posixtm_.c
|
||||
quotearg_.c: quotearg.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/quotearg.c; then echo $(srcdir)/quotearg.c; else echo quotearg.c; fi` | $(ANSI2KNR) > quotearg_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/quotearg.c; then echo $(srcdir)/quotearg.c; else echo quotearg.c; fi` | $(ANSI2KNR) > quotearg_.c
|
||||
realloc_.c: realloc.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | $(ANSI2KNR) > realloc_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | $(ANSI2KNR) > realloc_.c
|
||||
regex_.c: regex.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | $(ANSI2KNR) > regex_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | $(ANSI2KNR) > regex_.c
|
||||
rename_.c: rename.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/rename.c; then echo $(srcdir)/rename.c; else echo rename.c; fi` | $(ANSI2KNR) > rename_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rename.c; then echo $(srcdir)/rename.c; else echo rename.c; fi` | $(ANSI2KNR) > rename_.c
|
||||
rmdir_.c: rmdir.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/rmdir.c; then echo $(srcdir)/rmdir.c; else echo rmdir.c; fi` | $(ANSI2KNR) > rmdir_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rmdir.c; then echo $(srcdir)/rmdir.c; else echo rmdir.c; fi` | $(ANSI2KNR) > rmdir_.c
|
||||
rpmatch_.c: rpmatch.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/rpmatch.c; then echo $(srcdir)/rpmatch.c; else echo rpmatch.c; fi` | $(ANSI2KNR) > rpmatch_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rpmatch.c; then echo $(srcdir)/rpmatch.c; else echo rpmatch.c; fi` | $(ANSI2KNR) > rpmatch_.c
|
||||
safe-read_.c: safe-read.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/safe-read.c; then echo $(srcdir)/safe-read.c; else echo safe-read.c; fi` | $(ANSI2KNR) > safe-read_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/safe-read.c; then echo $(srcdir)/safe-read.c; else echo safe-read.c; fi` | $(ANSI2KNR) > safe-read_.c
|
||||
save-cwd_.c: save-cwd.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/save-cwd.c; then echo $(srcdir)/save-cwd.c; else echo save-cwd.c; fi` | $(ANSI2KNR) > save-cwd_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/save-cwd.c; then echo $(srcdir)/save-cwd.c; else echo save-cwd.c; fi` | $(ANSI2KNR) > save-cwd_.c
|
||||
savedir_.c: savedir.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` | $(ANSI2KNR) > savedir_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` | $(ANSI2KNR) > savedir_.c
|
||||
stat_.c: stat.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | $(ANSI2KNR) > stat_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | $(ANSI2KNR) > stat_.c
|
||||
stpcpy_.c: stpcpy.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | $(ANSI2KNR) > stpcpy_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | $(ANSI2KNR) > stpcpy_.c
|
||||
strcasecmp_.c: strcasecmp.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strcasecmp.c; then echo $(srcdir)/strcasecmp.c; else echo strcasecmp.c; fi` | $(ANSI2KNR) > strcasecmp_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strcasecmp.c; then echo $(srcdir)/strcasecmp.c; else echo strcasecmp.c; fi` | $(ANSI2KNR) > strcasecmp_.c
|
||||
strdup_.c: strdup.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | $(ANSI2KNR) > strdup_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | $(ANSI2KNR) > strdup_.c
|
||||
strftime_.c: strftime.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` | $(ANSI2KNR) > strftime_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` | $(ANSI2KNR) > strftime_.c
|
||||
stripslash_.c: stripslash.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/stripslash.c; then echo $(srcdir)/stripslash.c; else echo stripslash.c; fi` | $(ANSI2KNR) > stripslash_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stripslash.c; then echo $(srcdir)/stripslash.c; else echo stripslash.c; fi` | $(ANSI2KNR) > stripslash_.c
|
||||
strndup_.c: strndup.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strndup.c; then echo $(srcdir)/strndup.c; else echo strndup.c; fi` | $(ANSI2KNR) > strndup_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strndup.c; then echo $(srcdir)/strndup.c; else echo strndup.c; fi` | $(ANSI2KNR) > strndup_.c
|
||||
strstr_.c: strstr.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | $(ANSI2KNR) > strstr_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | $(ANSI2KNR) > strstr_.c
|
||||
strtol_.c: strtol.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | $(ANSI2KNR) > strtol_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | $(ANSI2KNR) > strtol_.c
|
||||
strtoul_.c: strtoul.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | $(ANSI2KNR) > strtoul_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | $(ANSI2KNR) > strtoul_.c
|
||||
strverscmp_.c: strverscmp.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strverscmp.c; then echo $(srcdir)/strverscmp.c; else echo strverscmp.c; fi` | $(ANSI2KNR) > strverscmp_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strverscmp.c; then echo $(srcdir)/strverscmp.c; else echo strverscmp.c; fi` | $(ANSI2KNR) > strverscmp_.c
|
||||
userspec_.c: userspec.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/userspec.c; then echo $(srcdir)/userspec.c; else echo userspec.c; fi` | $(ANSI2KNR) > userspec_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/userspec.c; then echo $(srcdir)/userspec.c; else echo userspec.c; fi` | $(ANSI2KNR) > userspec_.c
|
||||
utime_.c: utime.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/utime.c; then echo $(srcdir)/utime.c; else echo utime.c; fi` | $(ANSI2KNR) > utime_.c
|
||||
xgetcwd_.c: xgetcwd.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xgetcwd.c; then echo $(srcdir)/xgetcwd.c; else echo xgetcwd.c; fi` | $(ANSI2KNR) > xgetcwd_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xgetcwd.c; then echo $(srcdir)/xgetcwd.c; else echo xgetcwd.c; fi` | $(ANSI2KNR) > xgetcwd_.c
|
||||
xmalloc_.c: xmalloc.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` | $(ANSI2KNR) > xmalloc_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` | $(ANSI2KNR) > xmalloc_.c
|
||||
xstrdup_.c: xstrdup.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xstrdup.c; then echo $(srcdir)/xstrdup.c; else echo xstrdup.c; fi` | $(ANSI2KNR) > xstrdup_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrdup.c; then echo $(srcdir)/xstrdup.c; else echo xstrdup.c; fi` | $(ANSI2KNR) > xstrdup_.c
|
||||
xstrtol_.c: xstrtol.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` | $(ANSI2KNR) > xstrtol_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` | $(ANSI2KNR) > xstrtol_.c
|
||||
xstrtoul_.c: xstrtoul.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoul.c; then echo $(srcdir)/xstrtoul.c; else echo xstrtoul.c; fi` | $(ANSI2KNR) > xstrtoul_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoul.c; then echo $(srcdir)/xstrtoul.c; else echo xstrtoul.c; fi` | $(ANSI2KNR) > xstrtoul_.c
|
||||
yesno_.c: yesno.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` | $(ANSI2KNR) > yesno_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` | $(ANSI2KNR) > yesno_.c
|
||||
addext_.o alloca_.o argmatch_.o backupfile_.o basename_.o chown_.o \
|
||||
closeout_.o dirname_.o error_.o euidaccess_.o exclude_.o fileblocks_.o \
|
||||
filemode_.o fnmatch_.o fsusage_.o ftruncate_.o full-write_.o getdate_.o \
|
||||
@@ -383,8 +386,8 @@ modechange_.o mountlist_.o obstack_.o path-concat_.o posixtm_.o \
|
||||
quotearg_.o realloc_.o regex_.o rename_.o rmdir_.o rpmatch_.o \
|
||||
safe-read_.o save-cwd_.o savedir_.o stat_.o stpcpy_.o strcasecmp_.o \
|
||||
strdup_.o strftime_.o stripslash_.o strndup_.o strstr_.o strtol_.o \
|
||||
strtoul_.o strverscmp_.o userspec_.o xgetcwd_.o xmalloc_.o xstrdup_.o \
|
||||
xstrtol_.o xstrtoul_.o yesno_.o : $(ANSI2KNR)
|
||||
strtoul_.o strverscmp_.o userspec_.o utime_.o xgetcwd_.o xmalloc_.o \
|
||||
xstrdup_.o xstrtol_.o xstrtoul_.o yesno_.o : $(ANSI2KNR)
|
||||
|
||||
tags: TAGS
|
||||
|
||||
@@ -454,7 +457,6 @@ maintainer-clean-depend:
|
||||
info:
|
||||
dvi:
|
||||
check: all
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
install-exec:
|
||||
@$(NORMAL_INSTALL)
|
||||
@@ -468,24 +470,20 @@ install: install-exec install-data all
|
||||
uninstall:
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(DISTCLEANFILES)
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
-test -z "getdatehgetdatec$(BUILT_SOURCES)" || rm -f getdateh getdatec $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \
|
||||
mostlyclean-kr mostlyclean-tags mostlyclean-depend \
|
||||
mostlyclean-generic
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
If not, write to the Free Software Foundation,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef BACKUPFILE_H_
|
||||
# define BACKUPFILE_H_
|
||||
|
||||
/* When to make backup files. */
|
||||
enum backup_type
|
||||
{
|
||||
@@ -33,7 +36,7 @@ enum backup_type
|
||||
numbered
|
||||
};
|
||||
|
||||
#define VALID_BACKUP_TYPE(Type) \
|
||||
# define VALID_BACKUP_TYPE(Type) \
|
||||
((Type) == none \
|
||||
|| (Type) == simple \
|
||||
|| (Type) == numbered_existing \
|
||||
@@ -41,15 +44,17 @@ enum backup_type
|
||||
|
||||
extern char const *simple_backup_suffix;
|
||||
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
char *base_name PARAMS ((char const *));
|
||||
char *find_backup_file_name PARAMS ((char const *, enum backup_type));
|
||||
enum backup_type get_version PARAMS ((char const *));
|
||||
void addext PARAMS ((char *, char const *, int));
|
||||
|
||||
#endif /* ! BACKUPFILE_H_ */
|
||||
|
||||
63
lib/bumpalloc.h
Normal file
63
lib/bumpalloc.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/* BUMP_ALLOC macro - increase table allocation by one element.
|
||||
Copyright (C) 1990, 1991, 1993, 1998 Free Software Foundation, Inc.
|
||||
François Pinard <pinard@iro.umontreal.ca>, 1990.
|
||||
|
||||
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. */
|
||||
|
||||
/*-------------------------------------------------------------------------.
|
||||
| Bump the allocation of the array pointed to by TABLE whenever required. |
|
||||
| The table already has already COUNT elements in it, this macro ensure it |
|
||||
| has enough space to accommodate at least one more element. Space is |
|
||||
| allocated (2 ^ EXPONENT) elements at a time. Each element of the array |
|
||||
| is of type TYPE. |
|
||||
`-------------------------------------------------------------------------*/
|
||||
|
||||
/* Routines `xmalloc' and `xrealloc' are called to do the actual memory
|
||||
management. This implies that the program will abort with an `Memory
|
||||
exhausted!' error if any problem arise.
|
||||
|
||||
To work correctly, at least EXPONENT and TYPE should always be the
|
||||
same for all uses of this macro for any given TABLE. A secure way to
|
||||
achieve this is to never use this macro directly, but use it to define
|
||||
other macros, which would then be TABLE-specific.
|
||||
|
||||
The first time through, COUNT is usually zero. Note that COUNT is not
|
||||
updated by this macro, but it should be update elsewhere, later. This
|
||||
is convenient, because it allows TABLE[COUNT] to refer to the new
|
||||
element at the end. Once its construction is completed, COUNT++ will
|
||||
record it in the table. Calling this macro several times in a row
|
||||
without updating COUNT is a bad thing to do. */
|
||||
|
||||
#define BUMP_ALLOC(Table, Count, Exponent, Type) \
|
||||
BUMP_ALLOC_WITH_SIZE ((Table), (Count), (Exponent), Type, sizeof (Type))
|
||||
|
||||
/* In cases `sizeof TYPE' would not always yield the correct value for
|
||||
the size of each element entry, this macro accepts a supplementary
|
||||
SIZE argument. The EXPONENT, TYPE and SIZE parameters should still
|
||||
have the same value for all macro calls related to a specific TABLE. */
|
||||
|
||||
#define BUMP_ALLOC_WITH_SIZE(Table, Count, Exponent, Type, Size) \
|
||||
do \
|
||||
{ \
|
||||
if (((Count) & (~(~0 << (Exponent)))) == 0) \
|
||||
{ \
|
||||
if ((Count) == 0) \
|
||||
(Table) = (Type *) xmalloc ((1 << (Exponent)) * (Size)); \
|
||||
else \
|
||||
(Table) = (Type *) \
|
||||
xrealloc ((Table), ((Count) + (1 << (Exponent))) * (Size)); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
148
lib/diacrit.c
Normal file
148
lib/diacrit.c
Normal file
@@ -0,0 +1,148 @@
|
||||
/* Diacritics processing for a few character codes.
|
||||
Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
François Pinard <pinard@iro.umontreal.ca>, 1988.
|
||||
|
||||
All this file is a temporary hack, waiting for locales in GNU.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "diacrit.h"
|
||||
|
||||
/* ISO 8859-1 Latin-1 code is used as the underlying character set. If
|
||||
MSDOS is defined, IBM-PC's character set code is used instead. */
|
||||
|
||||
/*--------------------------------------------------------------------.
|
||||
| For each alphabetic character, returns what it would be without its |
|
||||
| possible diacritic symbol. |
|
||||
`--------------------------------------------------------------------*/
|
||||
|
||||
const char diacrit_base[256] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 'A', 'B', 'C', 'D', 'E', 'F', 'G',
|
||||
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
|
||||
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
|
||||
'X', 'Y', 'Z', 0, 0, 0, 0, 0,
|
||||
0, 'a', 'b', 'c', 'd', 'e', 'f', 'g',
|
||||
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
|
||||
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
|
||||
'x', 'y', 'z', 0, 0, 0, 0, 0,
|
||||
|
||||
#ifdef MSDOS
|
||||
|
||||
'C', 'u', 'e', 'a', 'a', 'a', 'a', 'c',
|
||||
'e', 'e', 'e', 'i', 'i', 'i', 'A', 'A',
|
||||
'E', 'e', 'E', 'o', 'o', 'o', 'u', 'u',
|
||||
'y', 'O', 'U', 0, 0, 0, 0, 0,
|
||||
'a', 'i', 'o', 'u', 'n', 'N', 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
||||
#else /* not MSDOS */
|
||||
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'C',
|
||||
'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I',
|
||||
0, 'N', 'O', 'O', 'O', 'O', 'O', 0,
|
||||
'O', 'U', 'U', 'U', 'U', 'Y', 0, 0,
|
||||
'a', 'a', 'a', 'a', 'a', 'a', 'a', 'c',
|
||||
'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i',
|
||||
0, 'n', 'o', 'o', 'o', 'o', 'o', 0,
|
||||
'o', 'u', 'u', 'u', 'u', 'y', 0, 'y',
|
||||
|
||||
#endif /* not MSDOS */
|
||||
};
|
||||
|
||||
/*------------------------------------------------------------------------.
|
||||
| For each alphabetic character, returns a code of what its diacritic is, |
|
||||
| according to the following codes: 1 (eE) over aA for latin diphtongs; 2 |
|
||||
| (') acute accent; 3 (`) grave accent; 4 (^) circumflex accent; 5 (") |
|
||||
| umlaut or diaraesis; 6 (~) tilda; 7 (,) cedilla; 8 (o) covering degree |
|
||||
| symbol; 9 (|) slashed character. |
|
||||
`------------------------------------------------------------------------*/
|
||||
|
||||
const char diacrit_diac[256] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 4, 0,
|
||||
3, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 6, 0,
|
||||
|
||||
#ifdef MSDOS
|
||||
|
||||
7, 5, 2, 4, 5, 3, 8, 7,
|
||||
4, 5, 3, 5, 4, 3, 5, 8,
|
||||
2, 1, 1, 4, 5, 3, 4, 3,
|
||||
5, 5, 5, 0, 0, 0, 0, 0,
|
||||
2, 2, 2, 2, 6, 6, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
||||
#else /* not MSDOS */
|
||||
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
3, 2, 4, 6, 5, 8, 1, 7,
|
||||
3, 2, 4, 5, 3, 2, 4, 5,
|
||||
0, 6, 3, 2, 4, 6, 5, 0,
|
||||
9, 3, 2, 4, 5, 2, 0, 0,
|
||||
3, 2, 4, 6, 5, 8, 1, 7,
|
||||
3, 2, 4, 5, 3, 2, 4, 5,
|
||||
0, 6, 3, 2, 4, 6, 5, 0,
|
||||
9, 3, 2, 4, 5, 2, 0, 0,
|
||||
|
||||
#endif /* not MSDOS */
|
||||
};
|
||||
16
lib/diacrit.h
Normal file
16
lib/diacrit.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/* Diacritics processing for a few character codes.
|
||||
Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
François Pinard <pinard@iro.umontreal.ca>, 1988.
|
||||
|
||||
All this file is a temporary hack, waiting for locales in GNU.
|
||||
*/
|
||||
|
||||
extern const char diacrit_base[]; /* characters without diacritics */
|
||||
extern const char diacrit_diac[]; /* diacritic code for each character */
|
||||
|
||||
/* Returns CHAR without its diacritic. CHAR is known to be alphabetic. */
|
||||
#define tobase(Char) (diacrit_base[(unsigned char) (Char)])
|
||||
|
||||
/* Returns a diacritic code for CHAR. CHAR is known to be alphabetic. */
|
||||
#define todiac(Char) (diacrit_diac[(unsigned char) (Char)])
|
||||
|
||||
264
lib/filemode.c
264
lib/filemode.c
@@ -22,6 +22,8 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "filemode.h"
|
||||
|
||||
#if !S_IRUSR
|
||||
# if S_IREAD
|
||||
# define S_IRUSR S_IREAD
|
||||
@@ -88,10 +90,132 @@
|
||||
# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
|
||||
#endif
|
||||
|
||||
void mode_string ();
|
||||
static char ftypelet ();
|
||||
static void rwx ();
|
||||
static void setst ();
|
||||
/* Look at read, write, and execute bits in BITS and set
|
||||
flags in CHARS accordingly. */
|
||||
|
||||
static void
|
||||
rwx (short unsigned int bits, char *chars)
|
||||
{
|
||||
chars[0] = (bits & S_IRUSR) ? 'r' : '-';
|
||||
chars[1] = (bits & S_IWUSR) ? 'w' : '-';
|
||||
chars[2] = (bits & S_IXUSR) ? 'x' : '-';
|
||||
}
|
||||
|
||||
/* Set the 's' and 't' flags in file attributes string CHARS,
|
||||
according to the file mode BITS. */
|
||||
|
||||
static void
|
||||
setst (short unsigned int bits, char *chars)
|
||||
{
|
||||
#ifdef S_ISUID
|
||||
if (bits & S_ISUID)
|
||||
{
|
||||
if (chars[3] != 'x')
|
||||
/* Set-uid, but not executable by owner. */
|
||||
chars[3] = 'S';
|
||||
else
|
||||
chars[3] = 's';
|
||||
}
|
||||
#endif
|
||||
#ifdef S_ISGID
|
||||
if (bits & S_ISGID)
|
||||
{
|
||||
if (chars[6] != 'x')
|
||||
/* Set-gid, but not executable by group. */
|
||||
chars[6] = 'S';
|
||||
else
|
||||
chars[6] = 's';
|
||||
}
|
||||
#endif
|
||||
#ifdef S_ISVTX
|
||||
if (bits & S_ISVTX)
|
||||
{
|
||||
if (chars[9] != 'x')
|
||||
/* Sticky, but not executable by others. */
|
||||
chars[9] = 'T';
|
||||
else
|
||||
chars[9] = 't';
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Return a character indicating the type of file described by
|
||||
file mode BITS:
|
||||
'd' for directories
|
||||
'b' for block special files
|
||||
'c' for character special files
|
||||
'm' for multiplexor files
|
||||
'M' for an off-line (regular) file
|
||||
'l' for symbolic links
|
||||
's' for sockets
|
||||
'p' for fifos
|
||||
'-' for regular files
|
||||
'?' for any other file type. */
|
||||
|
||||
static char
|
||||
ftypelet (long int bits)
|
||||
{
|
||||
#ifdef S_ISBLK
|
||||
if (S_ISBLK (bits))
|
||||
return 'b';
|
||||
#endif
|
||||
if (S_ISCHR (bits))
|
||||
return 'c';
|
||||
if (S_ISDIR (bits))
|
||||
return 'd';
|
||||
if (S_ISREG (bits))
|
||||
return '-';
|
||||
#ifdef S_ISFIFO
|
||||
if (S_ISFIFO (bits))
|
||||
return 'p';
|
||||
#endif
|
||||
#ifdef S_ISLNK
|
||||
if (S_ISLNK (bits))
|
||||
return 'l';
|
||||
#endif
|
||||
#ifdef S_ISSOCK
|
||||
if (S_ISSOCK (bits))
|
||||
return 's';
|
||||
#endif
|
||||
#ifdef S_ISMPC
|
||||
if (S_ISMPC (bits))
|
||||
return 'm';
|
||||
#endif
|
||||
#ifdef S_ISNWK
|
||||
if (S_ISNWK (bits))
|
||||
return 'n';
|
||||
#endif
|
||||
|
||||
/* The following two tests are for Cray DMF (Data Migration
|
||||
Facility), which is a HSM file system. A migrated file has a
|
||||
`st_dm_mode' that is different from the normal `st_mode', so any
|
||||
tests for migrated files should use the former. */
|
||||
|
||||
#ifdef S_ISOFD
|
||||
if (S_ISOFD (bits))
|
||||
/* off line, with data */
|
||||
return 'M';
|
||||
#endif
|
||||
#ifdef S_ISOFL
|
||||
/* off line, with no data */
|
||||
if (S_ISOFL (bits))
|
||||
return 'M';
|
||||
#endif
|
||||
return '?';
|
||||
}
|
||||
|
||||
/* Like filemodestring, but only the relevant part of the `struct stat'
|
||||
is given as an argument. */
|
||||
|
||||
void
|
||||
mode_string (short unsigned int mode, char *str)
|
||||
{
|
||||
str[0] = ftypelet ((long) mode);
|
||||
rwx ((mode & 0700) << 0, &str[1]);
|
||||
rwx ((mode & 0070) << 3, &str[4]);
|
||||
rwx ((mode & 0007) << 6, &str[7]);
|
||||
setst (mode, str);
|
||||
}
|
||||
|
||||
/* filemodestring - fill in string STR with an ls-style ASCII
|
||||
representation of the st_mode field of file stats block STATP.
|
||||
@@ -130,137 +254,7 @@ static void setst ();
|
||||
'T' if the file is sticky but not executable. */
|
||||
|
||||
void
|
||||
filemodestring (statp, str)
|
||||
struct stat *statp;
|
||||
char *str;
|
||||
filemodestring (struct stat *statp, char *str)
|
||||
{
|
||||
mode_string (statp->st_mode, str);
|
||||
}
|
||||
|
||||
/* Like filemodestring, but only the relevant part of the `struct stat'
|
||||
is given as an argument. */
|
||||
|
||||
void
|
||||
mode_string (mode, str)
|
||||
unsigned short mode;
|
||||
char *str;
|
||||
{
|
||||
str[0] = ftypelet ((long) mode);
|
||||
rwx ((mode & 0700) << 0, &str[1]);
|
||||
rwx ((mode & 0070) << 3, &str[4]);
|
||||
rwx ((mode & 0007) << 6, &str[7]);
|
||||
setst (mode, str);
|
||||
}
|
||||
|
||||
/* Return a character indicating the type of file described by
|
||||
file mode BITS:
|
||||
'd' for directories
|
||||
'b' for block special files
|
||||
'c' for character special files
|
||||
'm' for multiplexor files
|
||||
'l' for symbolic links
|
||||
's' for sockets
|
||||
'p' for fifos
|
||||
'-' for regular files
|
||||
'?' for any other file type. */
|
||||
|
||||
static char
|
||||
ftypelet (bits)
|
||||
long bits;
|
||||
{
|
||||
#ifdef S_ISBLK
|
||||
if (S_ISBLK (bits))
|
||||
return 'b';
|
||||
#endif
|
||||
if (S_ISCHR (bits))
|
||||
return 'c';
|
||||
if (S_ISDIR (bits))
|
||||
return 'd';
|
||||
if (S_ISREG (bits))
|
||||
return '-';
|
||||
#ifdef S_ISFIFO
|
||||
if (S_ISFIFO (bits))
|
||||
return 'p';
|
||||
#endif
|
||||
#ifdef S_ISLNK
|
||||
if (S_ISLNK (bits))
|
||||
return 'l';
|
||||
#endif
|
||||
#ifdef S_ISSOCK
|
||||
if (S_ISSOCK (bits))
|
||||
return 's';
|
||||
#endif
|
||||
#ifdef S_ISMPC
|
||||
if (S_ISMPC (bits))
|
||||
return 'm';
|
||||
#endif
|
||||
#ifdef S_ISNWK
|
||||
if (S_ISNWK (bits))
|
||||
return 'n';
|
||||
#endif
|
||||
|
||||
#ifdef S_ISOFD
|
||||
/* Cray migrated dmf file. */
|
||||
if (S_ISOFD (bits))
|
||||
return 'M';
|
||||
#endif
|
||||
#ifdef S_ISOFL
|
||||
/* Cray migrated dmf file. */
|
||||
if (S_ISOFL (bits))
|
||||
return 'M';
|
||||
#endif
|
||||
return '?';
|
||||
}
|
||||
|
||||
/* Look at read, write, and execute bits in BITS and set
|
||||
flags in CHARS accordingly. */
|
||||
|
||||
static void
|
||||
rwx (bits, chars)
|
||||
unsigned short bits;
|
||||
char *chars;
|
||||
{
|
||||
chars[0] = (bits & S_IRUSR) ? 'r' : '-';
|
||||
chars[1] = (bits & S_IWUSR) ? 'w' : '-';
|
||||
chars[2] = (bits & S_IXUSR) ? 'x' : '-';
|
||||
}
|
||||
|
||||
/* Set the 's' and 't' flags in file attributes string CHARS,
|
||||
according to the file mode BITS. */
|
||||
|
||||
static void
|
||||
setst (bits, chars)
|
||||
unsigned short bits;
|
||||
char *chars;
|
||||
{
|
||||
#ifdef S_ISUID
|
||||
if (bits & S_ISUID)
|
||||
{
|
||||
if (chars[3] != 'x')
|
||||
/* Set-uid, but not executable by owner. */
|
||||
chars[3] = 'S';
|
||||
else
|
||||
chars[3] = 's';
|
||||
}
|
||||
#endif
|
||||
#ifdef S_ISGID
|
||||
if (bits & S_ISGID)
|
||||
{
|
||||
if (chars[6] != 'x')
|
||||
/* Set-gid, but not executable by group. */
|
||||
chars[6] = 'S';
|
||||
else
|
||||
chars[6] = 's';
|
||||
}
|
||||
#endif
|
||||
#ifdef S_ISVTX
|
||||
if (bits & S_ISVTX)
|
||||
{
|
||||
if (chars[9] != 'x')
|
||||
/* Sticky, but not executable by others. */
|
||||
chars[9] = 'T';
|
||||
else
|
||||
chars[9] = 't';
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
9
lib/filemode.h
Normal file
9
lib/filemode.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
void mode_string PARAMS ((short unsigned int mode, char *str));
|
||||
@@ -158,7 +158,7 @@ human_readable (uintmax_t n, char *buf,
|
||||
e *= base;
|
||||
power++;
|
||||
}
|
||||
while (e * base <= amt && power < sizeof suffixes - 1);
|
||||
while (e * base <= damt && power < sizeof suffixes - 1);
|
||||
|
||||
damt /= e;
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
#include "lchown.h"
|
||||
|
||||
/* Work just like chown, except when FILE is a symbolic link.
|
||||
In that case, set errno to ENOSYS and return -1. */
|
||||
|
||||
9
lib/lchown.h
Normal file
9
lib/lchown.h
Normal file
@@ -0,0 +1,9 @@
|
||||
/* Some systems don't have ENOSYS. */
|
||||
#ifndef ENOSYS
|
||||
# ifdef ENOTSUP
|
||||
# define ENOSYS ENOTSUP
|
||||
# else
|
||||
/* Some systems don't have ENOTSUP either. */
|
||||
# define ENOSYS ENOMSG
|
||||
# endif
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/* linebuffer.c -- read arbitrarily long lines
|
||||
Copyright (C) 1986, 1991 Free Software Foundation, Inc.
|
||||
Copyright (C) 1986, 1991, 1998 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
|
||||
@@ -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. */
|
||||
|
||||
/* Written by Richard Stallman. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include "linebuffer.h"
|
||||
|
||||
@@ -27,8 +31,7 @@ void free ();
|
||||
/* Initialize linebuffer LINEBUFFER for use. */
|
||||
|
||||
void
|
||||
initbuffer (linebuffer)
|
||||
struct linebuffer *linebuffer;
|
||||
initbuffer (struct linebuffer *linebuffer)
|
||||
{
|
||||
linebuffer->length = 0;
|
||||
linebuffer->size = 200;
|
||||
@@ -37,19 +40,18 @@ initbuffer (linebuffer)
|
||||
|
||||
/* Read an arbitrarily long line of text from STREAM into LINEBUFFER.
|
||||
Remove any newline. Does not null terminate.
|
||||
Return LINEBUFFER, except at end of file return 0. */
|
||||
Return zero upon error or upon end of file.
|
||||
Otherwise, return LINEBUFFER. */
|
||||
|
||||
struct linebuffer *
|
||||
readline (linebuffer, stream)
|
||||
struct linebuffer *linebuffer;
|
||||
FILE *stream;
|
||||
readline (struct linebuffer *linebuffer, FILE *stream)
|
||||
{
|
||||
int c;
|
||||
char *buffer = linebuffer->buffer;
|
||||
char *p = linebuffer->buffer;
|
||||
char *end = buffer + linebuffer->size; /* Sentinel. */
|
||||
|
||||
if (feof (stream))
|
||||
if (feof (stream) || ferror (stream))
|
||||
{
|
||||
linebuffer->length = 0;
|
||||
return 0;
|
||||
@@ -83,8 +85,7 @@ readline (linebuffer, stream)
|
||||
/* Free linebuffer LINEBUFFER and its data, all allocated with malloc. */
|
||||
|
||||
void
|
||||
freebuffer (linebuffer)
|
||||
struct linebuffer *linebuffer;
|
||||
freebuffer (struct linebuffer *linebuffer)
|
||||
{
|
||||
free (linebuffer->buffer);
|
||||
free (linebuffer);
|
||||
|
||||
21
lib/lstat.c
21
lib/lstat.c
@@ -1,7 +1,7 @@
|
||||
/* Work around the bug in some systems whereby lstat succeeds when
|
||||
given the zero-length file name argument. The lstat from SunOS4.1.4
|
||||
has this bug.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998 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
|
||||
@@ -21,11 +21,6 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Disable the definition of lstat to rpl_lstat (from config.h) in this
|
||||
file. Otherwise, we'd get conflicting prototypes for rpl_lstat on
|
||||
most systems. */
|
||||
#undef lstat
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
@@ -33,16 +28,20 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/* FIXME: describe. */
|
||||
/* This is a wrapper for lstat(2).
|
||||
If FILE is the empty string, fail with errno == ENOENT.
|
||||
Otherwise, return the result of calling the real lstat.
|
||||
|
||||
This works around the bug in some systems whereby lstat succeeds when
|
||||
given the zero-length file name argument. The lstat from SunOS4.1.4
|
||||
has this bug. */
|
||||
|
||||
int
|
||||
rpl_lstat (file, sbuf)
|
||||
const char *file;
|
||||
struct stat *sbuf;
|
||||
rpl_lstat (const char *file, struct stat *sbuf)
|
||||
{
|
||||
if (file && *file == 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
55
lib/mktime.c
55
lib/mktime.c
@@ -1,4 +1,4 @@
|
||||
/* mktime: convert a `struct tm' to a time_t value zzzzzz
|
||||
/* mktime: convert a `struct tm' to a time_t value
|
||||
Copyright (C) 1993-1997, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Paul Eggert (eggert@twinsun.com).
|
||||
|
||||
@@ -28,14 +28,8 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Some systems need this in order to declare localtime_r properly. */
|
||||
#ifndef _REENTRANT
|
||||
# define _REENTRANT 1
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
# define HAVE_LIMITS_H 1
|
||||
# define HAVE_LOCALTIME_R 1
|
||||
# define STDC_HEADERS 1
|
||||
#endif
|
||||
|
||||
@@ -125,14 +119,14 @@ time_t __mktime_internal __P ((struct tm *,
|
||||
|
||||
|
||||
#ifdef _LIBC
|
||||
# define localtime_r __localtime_r
|
||||
# define my_mktime_localtime_r __localtime_r
|
||||
#else
|
||||
# if ! HAVE_LOCALTIME_R && ! defined localtime_r
|
||||
/* Approximate localtime_r as best we can in its absence. */
|
||||
# define localtime_r my_mktime_localtime_r
|
||||
static struct tm *localtime_r __P ((const time_t *, struct tm *));
|
||||
/* If we're a mktime substitute in a GNU program, then prefer
|
||||
localtime to localtime_r, since many localtime_r implementations
|
||||
are buggy. */
|
||||
static struct tm *my_mktime_localtime_r __P ((const time_t *, struct tm *));
|
||||
static struct tm *
|
||||
localtime_r (t, tp)
|
||||
my_mktime_localtime_r (t, tp)
|
||||
const time_t *t;
|
||||
struct tm *tp;
|
||||
{
|
||||
@@ -142,7 +136,6 @@ localtime_r (t, tp)
|
||||
*tp = *l;
|
||||
return tp;
|
||||
}
|
||||
# endif /* ! HAVE_LOCALTIME_R && ! defined (localtime_r) */
|
||||
#endif /* ! _LIBC */
|
||||
|
||||
|
||||
@@ -197,7 +190,7 @@ mktime (tp)
|
||||
__tzset ();
|
||||
#endif
|
||||
|
||||
return __mktime_internal (tp, localtime_r, &localtime_offset);
|
||||
return __mktime_internal (tp, my_mktime_localtime_r, &localtime_offset);
|
||||
}
|
||||
|
||||
/* Use CONVERT to convert *T to a broken down time in *TP.
|
||||
@@ -259,14 +252,14 @@ __mktime_internal (tp, convert, offset)
|
||||
struct tm *(*convert) __P ((const time_t *, struct tm *));
|
||||
time_t *offset;
|
||||
{
|
||||
time_t t, dt, t0;
|
||||
time_t t, dt, t0, t1, t2;
|
||||
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;
|
||||
leap seconds, and oscillations around a spring-forward gap.
|
||||
POSIX.1 prohibits leap seconds, but some hosts have them anyway. */
|
||||
int remaining_probes = 6;
|
||||
|
||||
/* Time requested. Copy it in case CONVERT modifies *TP; this can
|
||||
occur if TP is localtime's returned value and CONVERT is localtime. */
|
||||
@@ -312,15 +305,27 @@ __mktime_internal (tp, convert, offset)
|
||||
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;
|
||||
for (t = t1 = t2 = t0 + *offset;
|
||||
(dt = ydhms_tm_diff (year, yday, hour, min, sec,
|
||||
ranged_convert (convert, &t, &tm)));
|
||||
t += dt)
|
||||
if (--remaining_probes == 0)
|
||||
t1 = t2, t2 = t, t += dt)
|
||||
if (t == t1 && t != t2
|
||||
&& (isdst < 0 || tm.tm_isdst < 0
|
||||
|| (isdst != 0) != (tm.tm_isdst != 0)))
|
||||
/* We can't possibly find a match, as we are oscillating
|
||||
between two values. The requested time probably falls
|
||||
within a spring-forward gap of size DT. Follow the common
|
||||
practice in this case, which is to return a time that is DT
|
||||
away from the requested time, preferring a time whose
|
||||
tm_isdst differs from the requested value. In practice,
|
||||
this is more useful than returning -1. */
|
||||
break;
|
||||
else if (--remaining_probes == 0)
|
||||
return -1;
|
||||
|
||||
/* Check whether tm.tm_isdst has the requested value, if any. */
|
||||
if (0 <= isdst && 0 <= tm.tm_isdst)
|
||||
/* If we have a match, check whether tm.tm_isdst has the requested
|
||||
value, if any. */
|
||||
if (dt == 0 && 0 <= isdst && 0 <= tm.tm_isdst)
|
||||
{
|
||||
int dst_diff = (isdst != 0) - (tm.tm_isdst != 0);
|
||||
if (dst_diff)
|
||||
@@ -531,6 +536,6 @@ main (argc, argv)
|
||||
|
||||
/*
|
||||
Local Variables:
|
||||
compile-command: "gcc -DDEBUG -D__EXTENSIONS__ -DHAVE_LIMITS_H -DHAVE_LOCALTIME_R -DSTDC_HEADERS -Wall -W -O -g mktime.c -o mktime"
|
||||
compile-command: "gcc -DDEBUG -DHAVE_LIMITS_H -DSTDC_HEADERS -Wall -W -O -g mktime.c -o mktime"
|
||||
End:
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* modechange.c -- file mode manipulation
|
||||
Copyright (C) 1989, 1990, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989, 1990, 1997, 1998 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
|
||||
@@ -55,7 +55,22 @@ char *malloc ();
|
||||
|
||||
#define isodigit(c) ((c) >= '0' && (c) <= '7')
|
||||
|
||||
static int oatoi ();
|
||||
/* Return a positive integer containing the value of the ASCII
|
||||
octal number S. If S is not an octal number, return -1. */
|
||||
|
||||
static int
|
||||
oatoi (const char *s)
|
||||
{
|
||||
register int i;
|
||||
|
||||
if (*s == 0)
|
||||
return -1;
|
||||
for (i = 0; isodigit (*s); ++s)
|
||||
i = i * 8 + *s - '0';
|
||||
if (*s)
|
||||
return -1;
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Return a linked list of file mode change operations created from
|
||||
MODE_STRING, an ASCII string that contains either an octal number
|
||||
@@ -71,9 +86,7 @@ static int oatoi ();
|
||||
return MODE_MEMORY_EXHAUSTED if there is insufficient memory. */
|
||||
|
||||
struct mode_change *
|
||||
mode_compile (mode_string, masked_ops)
|
||||
const char *mode_string;
|
||||
unsigned masked_ops;
|
||||
mode_compile (const char *mode_string, unsigned int masked_ops)
|
||||
{
|
||||
struct mode_change *head; /* First element of the linked list. */
|
||||
struct mode_change *change; /* An element of the linked list. */
|
||||
@@ -240,8 +253,7 @@ invalid:
|
||||
of REF_FILE. Return MODE_BAD_REFERENCE if REF_FILE can't be accessed. */
|
||||
|
||||
struct mode_change *
|
||||
mode_create_from_ref (ref_file)
|
||||
const char *ref_file;
|
||||
mode_create_from_ref (const char *ref_file)
|
||||
{
|
||||
struct mode_change *change; /* the only change element */
|
||||
struct stat ref_stats;
|
||||
@@ -269,9 +281,7 @@ mode_create_from_ref (ref_file)
|
||||
The returned value has the S_IFMT bits cleared. */
|
||||
|
||||
unsigned short
|
||||
mode_adjust (oldmode, changes)
|
||||
unsigned oldmode;
|
||||
const struct mode_change *changes;
|
||||
mode_adjust (unsigned int oldmode, const struct mode_change *changes)
|
||||
{
|
||||
unsigned short newmode; /* The adjusted mode and one operand. */
|
||||
unsigned short value; /* The other operand. */
|
||||
@@ -336,8 +346,7 @@ mode_adjust (oldmode, changes)
|
||||
CHANGES. */
|
||||
|
||||
void
|
||||
mode_free (changes)
|
||||
register struct mode_change *changes;
|
||||
mode_free (register struct mode_change *changes)
|
||||
{
|
||||
register struct mode_change *next;
|
||||
|
||||
@@ -348,21 +357,3 @@ mode_free (changes)
|
||||
changes = next;
|
||||
}
|
||||
}
|
||||
|
||||
/* Return a positive integer containing the value of the ASCII
|
||||
octal number S. If S is not an octal number, return -1. */
|
||||
|
||||
static int
|
||||
oatoi (s)
|
||||
char *s;
|
||||
{
|
||||
register int i;
|
||||
|
||||
if (*s == 0)
|
||||
return -1;
|
||||
for (i = 0; isodigit (*s); ++s)
|
||||
i = i * 8 + *s - '0';
|
||||
if (*s)
|
||||
return -1;
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -129,10 +129,10 @@ extern int errno;
|
||||
/* Return the value of the hexadecimal number represented by CP.
|
||||
No prefix (like '0x') or suffix (like 'h') is expected to be
|
||||
part of CP. */
|
||||
/* FIXME: this can overflow */
|
||||
|
||||
static int
|
||||
xatoi (cp)
|
||||
char *cp;
|
||||
xatoi (char *cp)
|
||||
{
|
||||
int val;
|
||||
|
||||
@@ -256,7 +256,7 @@ static char *
|
||||
fsp_to_string (const struct statfs *fsp)
|
||||
{
|
||||
# if defined HAVE_F_FSTYPENAME_IN_STATFS
|
||||
return xstrdup (fsp->f_fstypename);
|
||||
return fsp->f_fstypename;
|
||||
# else
|
||||
return fstype_to_string (fsp->f_type);
|
||||
# endif
|
||||
@@ -266,8 +266,7 @@ fsp_to_string (const struct statfs *fsp)
|
||||
|
||||
#ifdef MOUNTED_VMOUNT /* AIX. */
|
||||
static char *
|
||||
fstype_to_string (t)
|
||||
int t;
|
||||
fstype_to_string (int t)
|
||||
{
|
||||
struct vfs_ent *e;
|
||||
|
||||
@@ -282,13 +281,10 @@ fstype_to_string (t)
|
||||
/* Return a list of the currently mounted filesystems, or NULL on error.
|
||||
Add each entry to the tail of the list so that they stay in order.
|
||||
If NEED_FS_TYPE is nonzero, ensure that the filesystem type fields in
|
||||
the returned list are valid. Otherwise, they might not be.
|
||||
If ALL_FS is zero, do not return entries for filesystems that
|
||||
are automounter (dummy) entries. */
|
||||
the returned list are valid. Otherwise, they might not be. */
|
||||
|
||||
struct mount_entry *
|
||||
read_filesystem_list (need_fs_type, all_fs)
|
||||
int need_fs_type, all_fs;
|
||||
read_filesystem_list (int need_fs_type)
|
||||
{
|
||||
struct mount_entry *mount_list;
|
||||
struct mount_entry *me;
|
||||
@@ -307,17 +303,17 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
|
||||
if(listmntent(&mntlist, KMTAB, NULL, NULL) < 0)
|
||||
return NULL;
|
||||
p = mntlist;
|
||||
while(p){
|
||||
for (p = mntlist; p; p = p->next) {
|
||||
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_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
me->me_dev = -1;
|
||||
*mtail = me;
|
||||
mtail = &me->me_next;
|
||||
p = p->next;
|
||||
}
|
||||
freemntlist(mntlist);
|
||||
}
|
||||
@@ -336,14 +332,12 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
|
||||
while ((mnt = getmntent (fp)))
|
||||
{
|
||||
if (!all_fs && (!strcmp (mnt->mnt_type, "ignore")
|
||||
|| !strcmp (mnt->mnt_type, "auto")))
|
||||
continue;
|
||||
|
||||
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_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
devopt = strstr (mnt->mnt_opts, "dev=");
|
||||
if (devopt)
|
||||
{
|
||||
@@ -373,18 +367,21 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
entries = getmntinfo (&fsp, MNT_NOWAIT);
|
||||
if (entries < 0)
|
||||
return NULL;
|
||||
while (entries-- > 0)
|
||||
for (; entries-- > 0; fsp++)
|
||||
{
|
||||
char *fs_type = fsp_to_string (fsp);
|
||||
|
||||
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
|
||||
me->me_devname = xstrdup (fsp->f_mntfromname);
|
||||
me->me_mountdir = xstrdup (fsp->f_mntonname);
|
||||
me->me_type = fsp_to_string (fsp);
|
||||
me->me_type = fs_type;
|
||||
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
|
||||
|
||||
/* Add to the linked list. */
|
||||
*mtail = me;
|
||||
mtail = &me->me_next;
|
||||
fsp++;
|
||||
}
|
||||
}
|
||||
#endif /* MOUNTED_GETMNTINFO */
|
||||
@@ -396,13 +393,15 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
struct fs_data fsd;
|
||||
|
||||
while (errno = 0,
|
||||
0 <= (val = getmnt (&offset, &fsd, sizeof (fsd), NOSTAT_MANY,
|
||||
(char *) 0)))
|
||||
0 < (val = getmnt (&offset, &fsd, sizeof (fsd), NOSTAT_MANY,
|
||||
(char *) 0)))
|
||||
{
|
||||
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
|
||||
me->me_devname = xstrdup (fsd.fd_req.devname);
|
||||
me->me_mountdir = xstrdup (fsd.fd_req.path);
|
||||
me->me_type = gt_names[fsd.fd_req.fstype];
|
||||
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
me->me_dev = fsd.fd_req.dev;
|
||||
|
||||
/* Add to the linked list. */
|
||||
@@ -439,6 +438,8 @@ 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_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
|
||||
|
||||
/* Add to the linked list. */
|
||||
@@ -484,6 +485,8 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
me->me_type = xstrdup (typebuf);
|
||||
}
|
||||
# endif
|
||||
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
|
||||
/* Add to the linked list. */
|
||||
*mtail = me;
|
||||
@@ -512,6 +515,8 @@ 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_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
|
||||
|
||||
/* Add to the linked list. */
|
||||
@@ -567,14 +572,12 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
{
|
||||
while ((ret = getmntent (fp, &mnt)) == 0)
|
||||
{
|
||||
/* Don't show automounted filesystems twice on e.g., Solaris. */
|
||||
if (!all_fs && MNT_IGNORE (&mnt))
|
||||
continue;
|
||||
|
||||
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
|
||||
me->me_devname = xstrdup (mnt.mnt_special);
|
||||
me->me_mountdir = xstrdup (mnt.mnt_mountp);
|
||||
me->me_type = xstrdup (mnt.mnt_fstype);
|
||||
me->me_dummy = MNT_IGNORE (&mnt) != 0;
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
|
||||
|
||||
/* Add to the linked list. */
|
||||
@@ -618,6 +621,7 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
{
|
||||
char *host, *path;
|
||||
|
||||
me->me_remote = 1;
|
||||
/* Prepend the remote pathname. */
|
||||
host = thisent + vmp->vmt_data[VMT_HOSTNAME].vmt_off;
|
||||
path = thisent + vmp->vmt_data[VMT_OBJECT].vmt_off;
|
||||
@@ -628,11 +632,13 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
}
|
||||
else
|
||||
{
|
||||
me->me_remote = 0;
|
||||
me->me_devname = xstrdup (thisent +
|
||||
vmp->vmt_data[VMT_OBJECT].vmt_off);
|
||||
}
|
||||
me->me_mountdir = xstrdup (thisent + vmp->vmt_data[VMT_STUB].vmt_off);
|
||||
me->me_type = xstrdup (fstype_to_string (vmp->vmt_gfstype));
|
||||
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_dev = (dev_t) -1; /* vmt_fsid might be the info we want. */
|
||||
|
||||
/* Add to the linked list. */
|
||||
@@ -651,10 +657,13 @@ read_filesystem_list (need_fs_type, all_fs)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
*mtail = NULL;
|
||||
|
||||
|
||||
while (mount_list)
|
||||
{
|
||||
me = mount_list->me_next;
|
||||
free (mount_list->me_devname);
|
||||
free (mount_list->me_mountdir);
|
||||
/* FIXME: me_type is not always malloced. */
|
||||
free (mount_list);
|
||||
mount_list = me;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* mountlist.h -- declarations for list of mounted filesystems
|
||||
Copyright (C) 1991, 1992 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 1992, 1998 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
|
||||
@@ -22,11 +22,26 @@ struct mount_entry
|
||||
char *me_mountdir; /* Mount point directory pathname. */
|
||||
char *me_type; /* "nfs", "4.2", etc. */
|
||||
dev_t me_dev; /* Device number of me_mountdir. */
|
||||
unsigned int me_dummy : 1; /* Nonzero for dummy filesystems. */
|
||||
unsigned int me_remote : 1; /* Nonzero for remote fileystems. */
|
||||
struct mount_entry *me_next;
|
||||
};
|
||||
|
||||
#if __STDC__
|
||||
struct mount_entry *read_filesystem_list (int need_fs_type, int all_fs);
|
||||
#else
|
||||
struct mount_entry *read_filesystem_list ();
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
struct mount_entry *read_filesystem_list PARAMS ((int need_fs_type));
|
||||
|
||||
#ifndef ME_DUMMY
|
||||
# define ME_DUMMY(fs_name, fs_type) \
|
||||
(!strcmp (fs_type, "auto") || !strcmp (fs_type, "ignore"))
|
||||
#endif
|
||||
|
||||
#ifndef ME_REMOTE
|
||||
# define ME_REMOTE(fs_name, fs_type) (strchr (fs_name, ':') != 0)
|
||||
#endif
|
||||
|
||||
1135
lib/posixtm.c
1135
lib/posixtm.c
File diff suppressed because it is too large
Load Diff
24
lib/posixtm.h
Normal file
24
lib/posixtm.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef POSIXTM_H_
|
||||
# define POSIXTM_H_
|
||||
|
||||
/* POSIX Date Syntax flags. */
|
||||
# define PDS_LEADING_YEAR 1
|
||||
# define PDS_TRAILING_YEAR 2
|
||||
# define PDS_CENTURY 4
|
||||
# define PDS_SECONDS 8
|
||||
|
||||
# ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
# endif
|
||||
|
||||
time_t
|
||||
posixtime PARAMS ((const char *s, unsigned int syntax_bits));
|
||||
|
||||
struct tm *
|
||||
posixtm PARAMS ((const char *s, unsigned int syntax_bits));
|
||||
|
||||
#endif
|
||||
242
lib/posixtm.y
242
lib/posixtm.y
@@ -1,242 +0,0 @@
|
||||
/* Parse dates for touch.
|
||||
Copyright (C) 1989, 1990, 1991 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 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 HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#else
|
||||
#ifdef _AIX
|
||||
#pragma alloca
|
||||
#else
|
||||
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
|
||||
|
||||
/* Lexical analyzer's current scan position in the input string. */
|
||||
static char *curpos;
|
||||
|
||||
/* The return value. */
|
||||
static struct tm t;
|
||||
|
||||
time_t mktime ();
|
||||
|
||||
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
|
||||
as well as gratuitiously global symbol names, so we can have multiple
|
||||
yacc generated parsers in the same program. Note that these are only
|
||||
the variables produced by yacc. If other parser generators (bison,
|
||||
byacc, etc) produce additional global names that conflict at link time,
|
||||
then those parser generators need to be fixed instead of adding those
|
||||
names to this list. */
|
||||
|
||||
#define yymaxdepth pt_maxdepth
|
||||
#define yyparse pt_parse
|
||||
#define yylex pt_lex
|
||||
#define yyerror pt_error
|
||||
#define yylval pt_lval
|
||||
#define yychar pt_char
|
||||
#define yydebug pt_debug
|
||||
#define yypact pt_pact
|
||||
#define yyr1 pt_r1
|
||||
#define yyr2 pt_r2
|
||||
#define yydef pt_def
|
||||
#define yychk pt_chk
|
||||
#define yypgo pt_pgo
|
||||
#define yyact pt_act
|
||||
#define yyexca pt_exca
|
||||
#define yyerrflag pt_errflag
|
||||
#define yynerrs pt_nerrs
|
||||
#define yyps pt_ps
|
||||
#define yypv pt_pv
|
||||
#define yys pt_s
|
||||
#define yy_yys pt_yys
|
||||
#define yystate pt_state
|
||||
#define yytmp pt_tmp
|
||||
#define yyv pt_v
|
||||
#define yy_yyv pt_yyv
|
||||
#define yyval pt_val
|
||||
#define yylloc pt_lloc
|
||||
#define yyreds pt_reds /* With YYDEBUG defined */
|
||||
#define yytoks pt_toks /* With YYDEBUG defined */
|
||||
#define yylhs pt_yylhs
|
||||
#define yylen pt_yylen
|
||||
#define yydefred pt_yydefred
|
||||
#define yydgoto pt_yydgoto
|
||||
#define yysindex pt_yysindex
|
||||
#define yyrindex pt_yyrindex
|
||||
#define yygindex pt_yygindex
|
||||
#define yytable pt_yytable
|
||||
#define yycheck pt_yycheck
|
||||
|
||||
static int yylex ();
|
||||
static int yyerror ();
|
||||
|
||||
%}
|
||||
|
||||
%token DIGIT
|
||||
|
||||
%%
|
||||
date :
|
||||
digitpair /* month */
|
||||
digitpair /* day */
|
||||
digitpair /* hours */
|
||||
digitpair /* minutes */
|
||||
year
|
||||
seconds {
|
||||
if ($1 >= 1 && $1 <= 12)
|
||||
t.tm_mon = $1 - 1;
|
||||
else {
|
||||
YYABORT;
|
||||
}
|
||||
if ($2 >= 1 && $2 <= 31)
|
||||
t.tm_mday = $2;
|
||||
else {
|
||||
YYABORT;
|
||||
}
|
||||
if ($3 >= 0 && $3 <= 23)
|
||||
t.tm_hour = $3;
|
||||
else {
|
||||
YYABORT;
|
||||
}
|
||||
if ($4 >= 0 && $4 <= 59)
|
||||
t.tm_min = $4;
|
||||
else {
|
||||
YYABORT;
|
||||
}
|
||||
}
|
||||
|
||||
year : digitpair {
|
||||
t.tm_year = $1;
|
||||
/* Deduce the century based on the year.
|
||||
See POSIX.2 section 4.63.3. */
|
||||
if ($1 <= 68)
|
||||
t.tm_year += 100;
|
||||
}
|
||||
| digitpair digitpair {
|
||||
t.tm_year = $1 * 100 + $2;
|
||||
if (t.tm_year < 1900) {
|
||||
YYABORT;
|
||||
} else
|
||||
t.tm_year -= 1900;
|
||||
}
|
||||
| /* empty */ {
|
||||
time_t now;
|
||||
struct tm *tmp;
|
||||
|
||||
/* Use current year. */
|
||||
time (&now);
|
||||
tmp = localtime (&now);
|
||||
t.tm_year = tmp->tm_year;
|
||||
}
|
||||
;
|
||||
|
||||
seconds : /* empty */ {
|
||||
t.tm_sec = 0;
|
||||
}
|
||||
| '.' digitpair {
|
||||
if ($2 >= 0 && $2 <= 61)
|
||||
t.tm_sec = $2;
|
||||
else {
|
||||
YYABORT;
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
digitpair : DIGIT DIGIT {
|
||||
$$ = $1 * 10 + $2;
|
||||
}
|
||||
;
|
||||
%%
|
||||
static int
|
||||
yylex ()
|
||||
{
|
||||
char ch = *curpos++;
|
||||
|
||||
if (ch >= '0' && ch <= '9')
|
||||
{
|
||||
yylval = ch - '0';
|
||||
return DIGIT;
|
||||
}
|
||||
else if (ch == '.' || ch == 0)
|
||||
return ch;
|
||||
else
|
||||
return '?'; /* Cause an error. */
|
||||
}
|
||||
|
||||
static int
|
||||
yyerror ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Parse a POSIX-style date and return it, or (time_t)-1 for an error. */
|
||||
|
||||
time_t
|
||||
posixtime (s)
|
||||
char *s;
|
||||
{
|
||||
curpos = s;
|
||||
/* Let mktime decide whether it is daylight savings time. */
|
||||
t.tm_isdst = -1;
|
||||
if (yyparse ())
|
||||
return (time_t)-1;
|
||||
else
|
||||
return mktime (&t);
|
||||
}
|
||||
|
||||
/* Parse a POSIX-style date and return it, or NULL for an error. */
|
||||
|
||||
struct tm *
|
||||
posixtm (s)
|
||||
char *s;
|
||||
{
|
||||
if (posixtime (s) == -1)
|
||||
return NULL;
|
||||
return &t;
|
||||
}
|
||||
116
lib/regex.c
116
lib/regex.c
@@ -55,10 +55,36 @@
|
||||
/* For platform which support the ISO C amendement 1 functionality we
|
||||
support user defined character classes. */
|
||||
#if WIDE_CHAR_SUPPORT
|
||||
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
|
||||
# include <wchar.h>
|
||||
# include <wctype.h>
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
/* We have to keep the namespace clean. */
|
||||
# define regfree(preg) __regfree (preg)
|
||||
# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
|
||||
# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
|
||||
# define regerror(errcode, preg, errbuf, errbuf_size) \
|
||||
__regerror(errcode, preg, errbuf, errbuf_size)
|
||||
# define re_set_registers(bu, re, nu, st, en) \
|
||||
__re_set_registers (bu, re, nu, st, en)
|
||||
# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
|
||||
__re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
# define re_match(bufp, string, size, pos, regs) \
|
||||
__re_match (bufp, string, size, pos, regs)
|
||||
# define re_search(bufp, string, size, startpos, range, regs) \
|
||||
__re_search (bufp, string, size, startpos, range, regs)
|
||||
# define re_compile_pattern(pattern, length, bufp) \
|
||||
__re_compile_pattern (pattern, length, bufp)
|
||||
# define re_set_syntax(syntax) __re_set_syntax (syntax)
|
||||
# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
|
||||
__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
|
||||
# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
|
||||
|
||||
#define btowc __btowc
|
||||
#endif
|
||||
|
||||
/* This is for other GNU distributions with internationalized messages. */
|
||||
#if HAVE_LIBINTL_H || defined _LIBC
|
||||
# include <libintl.h>
|
||||
@@ -110,8 +136,12 @@ char *realloc ();
|
||||
# ifndef INHIBIT_STRING_HEADER
|
||||
# if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC
|
||||
# include <string.h>
|
||||
# if !defined bzero && !defined _LIBC
|
||||
# define bzero(s, n) (memset (s, '\0', n), (s))
|
||||
# ifndef bzero
|
||||
# ifndef _LIBC
|
||||
# define bzero(s, n) (memset (s, '\0', n), (s))
|
||||
# else
|
||||
# define bzero(s, n) __bzero (s, n)
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# include <strings.h>
|
||||
@@ -195,7 +225,8 @@ init_syntax_once ()
|
||||
STDC_HEADERS is defined, then autoconf has verified that the ctype
|
||||
macros don't need to be guarded with references to isascii. ...
|
||||
Defining isascii to 1 should let any compiler worth its salt
|
||||
eliminate the && through constant folding." */
|
||||
eliminate the && through constant folding."
|
||||
Solaris defines some of these symbols so we must undefine them first. */
|
||||
|
||||
#undef ISASCII
|
||||
#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII)
|
||||
@@ -971,6 +1002,9 @@ re_set_syntax (syntax)
|
||||
#endif /* DEBUG */
|
||||
return ret;
|
||||
}
|
||||
#ifdef _LIBC
|
||||
weak_alias (__re_set_syntax, re_set_syntax)
|
||||
#endif
|
||||
|
||||
/* This table gives an error message for each of the error codes listed
|
||||
in regex.h. Obviously the order here has to be same as there.
|
||||
@@ -1699,7 +1733,11 @@ typedef struct
|
||||
# define CHAR_CLASS_MAX_LENGTH 256
|
||||
# endif
|
||||
|
||||
# define IS_CHAR_CLASS(string) wctype (string)
|
||||
# ifdef _LIBC
|
||||
# define IS_CHAR_CLASS(string) __wctype (string)
|
||||
# else
|
||||
# define IS_CHAR_CLASS(string) wctype (string)
|
||||
# endif
|
||||
#else
|
||||
# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
|
||||
|
||||
@@ -2176,14 +2214,14 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
for (;;)
|
||||
{
|
||||
PATFETCH (c);
|
||||
if (c == ':' || c == ']' || p == pend
|
||||
if ((c == ':' && *p == ']') || p == pend
|
||||
|| c1 == CHAR_CLASS_MAX_LENGTH)
|
||||
break;
|
||||
str[c1++] = c;
|
||||
}
|
||||
str[c1] = '\0';
|
||||
|
||||
/* If isn't a word bracketed by `[:' and:`]':
|
||||
/* If isn't a word bracketed by `[:' and `:]':
|
||||
undo the ending character, the letters, and leave
|
||||
the leading `:' and `[' (but set bits for them). */
|
||||
if (c == ':' && *p == ']')
|
||||
@@ -2194,7 +2232,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
wctype_t wt;
|
||||
int ch;
|
||||
|
||||
wt = wctype (str);
|
||||
wt = IS_CHAR_CLASS (str);
|
||||
if (wt == 0)
|
||||
FREE_STACK_RETURN (REG_ECTYPE);
|
||||
|
||||
@@ -2206,8 +2244,13 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
|
||||
for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
|
||||
{
|
||||
# ifdef _LIBC
|
||||
if (__iswctype (__btowc (ch), wt))
|
||||
SET_LIST_BIT (ch);
|
||||
#else
|
||||
if (iswctype (btowc (ch), wt))
|
||||
SET_LIST_BIT (ch);
|
||||
#endif
|
||||
|
||||
if (translate && (is_upper || is_lower)
|
||||
&& (ISUPPER (ch) || ISLOWER (ch)))
|
||||
@@ -2691,7 +2734,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
|
||||
|
||||
case 'w':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
if (syntax & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
laststart = b;
|
||||
BUF_PUSH (wordchar);
|
||||
@@ -2699,7 +2742,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
|
||||
|
||||
case 'W':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
if (syntax & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
laststart = b;
|
||||
BUF_PUSH (notwordchar);
|
||||
@@ -2707,37 +2750,37 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
|
||||
|
||||
case '<':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
if (syntax & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
BUF_PUSH (wordbeg);
|
||||
break;
|
||||
|
||||
case '>':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
if (syntax & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
BUF_PUSH (wordend);
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
if (syntax & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
BUF_PUSH (wordbound);
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
if (syntax & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
BUF_PUSH (notwordbound);
|
||||
break;
|
||||
|
||||
case '`':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
if (syntax & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
BUF_PUSH (begbuf);
|
||||
break;
|
||||
|
||||
case '\'':
|
||||
if (re_syntax_options & RE_NO_GNU_OPS)
|
||||
if (syntax & RE_NO_GNU_OPS)
|
||||
goto normal_char;
|
||||
BUF_PUSH (endbuf);
|
||||
break;
|
||||
@@ -3375,6 +3418,9 @@ re_compile_fastmap (bufp)
|
||||
RESET_FAIL_STACK ();
|
||||
return 0;
|
||||
} /* re_compile_fastmap */
|
||||
#ifdef _LIBC
|
||||
weak_alias (__re_compile_fastmap, re_compile_fastmap)
|
||||
#endif
|
||||
|
||||
/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
|
||||
ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
|
||||
@@ -3410,6 +3456,9 @@ re_set_registers (bufp, regs, num_regs, starts, ends)
|
||||
regs->start = regs->end = (regoff_t *) 0;
|
||||
}
|
||||
}
|
||||
#ifdef _LIBC
|
||||
weak_alias (__re_set_registers, re_set_registers)
|
||||
#endif
|
||||
|
||||
/* Searching routines. */
|
||||
|
||||
@@ -3426,6 +3475,9 @@ re_search (bufp, string, size, startpos, range, regs)
|
||||
return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
|
||||
regs, size);
|
||||
}
|
||||
#ifdef _LIBC
|
||||
weak_alias (__re_search, re_search)
|
||||
#endif
|
||||
|
||||
|
||||
/* Using the compiled pattern in BUFP->buffer, first tries to match the
|
||||
@@ -3479,7 +3531,11 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
|
||||
|
||||
/* If the search isn't to be a backwards one, don't waste time in a
|
||||
search for a pattern that must be anchored. */
|
||||
if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
|
||||
if (bufp->used > 0 && range > 0
|
||||
&& ((re_opcode_t) bufp->buffer[0] == begbuf
|
||||
/* `begline' is like `begbuf' if it cannot match at newlines. */
|
||||
|| ((re_opcode_t) bufp->buffer[0] == begline
|
||||
&& !bufp->newline_anchor)))
|
||||
{
|
||||
if (startpos > 0)
|
||||
return -1;
|
||||
@@ -3582,6 +3638,9 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
|
||||
}
|
||||
return -1;
|
||||
} /* re_search_2 */
|
||||
#ifdef _LIBC
|
||||
weak_alias (__re_search_2, re_search_2)
|
||||
#endif
|
||||
|
||||
/* This converts PTR, a pointer into one of the search strings `string1'
|
||||
and `string2' into an offset from the beginning of that string. */
|
||||
@@ -3683,6 +3742,9 @@ re_match (bufp, string, size, pos, regs)
|
||||
# endif
|
||||
return result;
|
||||
}
|
||||
# ifdef _LIBC
|
||||
weak_alias (__re_match, re_match)
|
||||
# endif
|
||||
#endif /* not emacs */
|
||||
|
||||
static boolean group_match_null_string_p _RE_ARGS ((unsigned char **p,
|
||||
@@ -3728,6 +3790,9 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
#ifdef _LIBC
|
||||
weak_alias (__re_match_2, re_match_2)
|
||||
#endif
|
||||
|
||||
/* This is a separate function so that we can force an alloca cleanup
|
||||
afterwards. */
|
||||
@@ -5421,6 +5486,9 @@ re_compile_pattern (pattern, length, bufp)
|
||||
return NULL;
|
||||
return gettext (re_error_msgid[(int) ret]);
|
||||
}
|
||||
#ifdef _LIBC
|
||||
weak_alias (__re_compile_pattern, re_compile_pattern)
|
||||
#endif
|
||||
|
||||
/* Entry points compatible with 4.2 BSD regex library. We don't define
|
||||
them unless specifically requested. */
|
||||
@@ -5453,12 +5521,12 @@ re_comp (s)
|
||||
{
|
||||
re_comp_buf.buffer = (unsigned char *) malloc (200);
|
||||
if (re_comp_buf.buffer == NULL)
|
||||
return gettext (re_error_msgid[(int) REG_ESPACE]);
|
||||
return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
|
||||
re_comp_buf.allocated = 200;
|
||||
|
||||
re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
|
||||
if (re_comp_buf.fastmap == NULL)
|
||||
return gettext (re_error_msgid[(int) REG_ESPACE]);
|
||||
return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
|
||||
}
|
||||
|
||||
/* Since `re_exec' always passes NULL for the `regs' argument, we
|
||||
@@ -5591,6 +5659,9 @@ regcomp (preg, pattern, cflags)
|
||||
|
||||
return (int) ret;
|
||||
}
|
||||
#ifdef _LIBC
|
||||
weak_alias (__regcomp, regcomp)
|
||||
#endif
|
||||
|
||||
|
||||
/* regexec searches for a given pattern, specified by PREG, in the
|
||||
@@ -5667,6 +5738,9 @@ regexec (preg, string, nmatch, pmatch, eflags)
|
||||
/* We want zero return to mean success, unlike `re_search'. */
|
||||
return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
|
||||
}
|
||||
#ifdef _LIBC
|
||||
weak_alias (__regexec, regexec)
|
||||
#endif
|
||||
|
||||
|
||||
/* Returns a message corresponding to an error code, ERRCODE, returned
|
||||
@@ -5712,6 +5786,9 @@ regerror (errcode, preg, errbuf, errbuf_size)
|
||||
|
||||
return msg_size;
|
||||
}
|
||||
#ifdef _LIBC
|
||||
weak_alias (__regerror, regerror)
|
||||
#endif
|
||||
|
||||
|
||||
/* Free dynamically allocated space used by PREG. */
|
||||
@@ -5736,5 +5813,8 @@ regfree (preg)
|
||||
free (preg->translate);
|
||||
preg->translate = NULL;
|
||||
}
|
||||
#ifdef _LIBC
|
||||
weak_alias (__regfree, regfree)
|
||||
#endif
|
||||
|
||||
#endif /* not emacs */
|
||||
|
||||
49
lib/regex.h
49
lib/regex.h
@@ -442,11 +442,15 @@ typedef struct
|
||||
|
||||
/* Sets the current default syntax to SYNTAX, and return the old syntax.
|
||||
You can also simply assign to the `re_syntax_options' variable. */
|
||||
extern reg_syntax_t __re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
|
||||
extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
|
||||
|
||||
/* Compile the regular expression PATTERN, with length LENGTH
|
||||
and syntax given by the global `re_syntax_options', into the buffer
|
||||
BUFFER. Return NULL if successful, and an error string if not. */
|
||||
extern const char *__re_compile_pattern
|
||||
_RE_ARGS ((const char *pattern, size_t length,
|
||||
struct re_pattern_buffer *buffer));
|
||||
extern const char *re_compile_pattern
|
||||
_RE_ARGS ((const char *pattern, size_t length,
|
||||
struct re_pattern_buffer *buffer));
|
||||
@@ -455,6 +459,7 @@ extern const char *re_compile_pattern
|
||||
/* Compile a fastmap for the compiled pattern in BUFFER; used to
|
||||
accelerate searches. Return 0 if successful and -2 if was an
|
||||
internal error. */
|
||||
extern int __re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
|
||||
extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
|
||||
|
||||
|
||||
@@ -463,6 +468,9 @@ extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
|
||||
characters. Return the starting position of the match, -1 for no
|
||||
match, or -2 for an internal error. Also return register
|
||||
information in REGS (if REGS and BUFFER->no_sub are nonzero). */
|
||||
extern int __re_search
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
|
||||
int length, int start, int range, struct re_registers *regs));
|
||||
extern int re_search
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
|
||||
int length, int start, int range, struct re_registers *regs));
|
||||
@@ -470,6 +478,10 @@ extern int re_search
|
||||
|
||||
/* Like `re_search', but search in the concatenation of STRING1 and
|
||||
STRING2. Also, stop searching at index START + STOP. */
|
||||
extern int __re_search_2
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
||||
int length1, const char *string2, int length2,
|
||||
int start, int range, struct re_registers *regs, int stop));
|
||||
extern int re_search_2
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
||||
int length1, const char *string2, int length2,
|
||||
@@ -478,12 +490,19 @@ extern int re_search_2
|
||||
|
||||
/* Like `re_search', but return how many characters in STRING the regexp
|
||||
in BUFFER matched, starting at position START. */
|
||||
extern int __re_match
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
|
||||
int length, int start, struct re_registers *regs));
|
||||
extern int re_match
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
|
||||
int length, int start, struct re_registers *regs));
|
||||
|
||||
|
||||
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
|
||||
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));
|
||||
extern int re_match_2
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
|
||||
int length1, const char *string2, int length2,
|
||||
@@ -502,6 +521,9 @@ extern int re_match_2
|
||||
Unless this function is called, the first search or match using
|
||||
PATTERN_BUFFER will allocate its own register data, without
|
||||
freeing the old data. */
|
||||
extern void __re_set_registers
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
|
||||
unsigned num_regs, regoff_t *starts, regoff_t *ends));
|
||||
extern void re_set_registers
|
||||
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
|
||||
unsigned num_regs, regoff_t *starts, regoff_t *ends));
|
||||
@@ -515,14 +537,25 @@ extern int re_exec _RE_ARGS ((const char *));
|
||||
#endif
|
||||
|
||||
/* POSIX compatibility. */
|
||||
extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
|
||||
extern int regexec
|
||||
_RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch,
|
||||
regmatch_t pmatch[], int eflags));
|
||||
extern size_t regerror
|
||||
_RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,
|
||||
size_t errbuf_size));
|
||||
extern void regfree _RE_ARGS ((regex_t *preg));
|
||||
extern int __regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
|
||||
int __cflags));
|
||||
extern int regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
|
||||
int __cflags));
|
||||
|
||||
extern int __regexec _RE_ARGS ((const regex_t *__preg,
|
||||
const char *__string, size_t __nmatch,
|
||||
regmatch_t __pmatch[], int __eflags));
|
||||
extern int regexec _RE_ARGS ((const regex_t *__preg,
|
||||
const char *__string, size_t __nmatch,
|
||||
regmatch_t __pmatch[], int __eflags));
|
||||
|
||||
extern size_t __regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
|
||||
char *__errbuf, size_t __errbuf_size));
|
||||
extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
|
||||
char *__errbuf, size_t __errbuf_size));
|
||||
|
||||
extern void __regfree _RE_ARGS ((regex_t *__preg));
|
||||
extern void regfree _RE_ARGS ((regex_t *__preg));
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -38,7 +38,7 @@ extern int errno;
|
||||
for an error. */
|
||||
|
||||
ssize_t
|
||||
safe_read (int desc, char *ptr, size_t len)
|
||||
safe_read (int desc, void *ptr, size_t len)
|
||||
{
|
||||
ssize_t n_chars;
|
||||
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
#endif
|
||||
|
||||
ssize_t
|
||||
safe_read PARAMS ((int desc, char *ptr, size_t len));
|
||||
safe_read PARAMS ((int desc, void *ptr, size_t len));
|
||||
|
||||
@@ -21,11 +21,6 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Disable the definition of stat to rpl_stat (from config.h) in this
|
||||
file. Otherwise, we'd get conflicting prototypes for rpl_stat on
|
||||
most systems. */
|
||||
#undef stat
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
@@ -42,9 +37,7 @@ extern int errno;
|
||||
has this bug. */
|
||||
|
||||
int
|
||||
rpl_stat (file, sbuf)
|
||||
const char *file;
|
||||
struct stat *sbuf;
|
||||
rpl_stat (const char *file, struct stat *sbuf)
|
||||
{
|
||||
if (file && *file == 0)
|
||||
{
|
||||
|
||||
231
lib/strftime.c
231
lib/strftime.c
@@ -22,11 +22,6 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Some systems need this in order to declare localtime_r properly. */
|
||||
#ifndef _REENTRANT
|
||||
# define _REENTRANT 1
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
# define HAVE_LIMITS_H 1
|
||||
# define HAVE_MBLEN 1
|
||||
@@ -136,7 +131,7 @@ extern char *tzname[];
|
||||
add one for integer division truncation;
|
||||
add one more for a minus sign if t is signed. */
|
||||
#define INT_STRLEN_BOUND(t) \
|
||||
((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 100 + 1 + TYPE_SIGNED (t))
|
||||
((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 + 1 + TYPE_SIGNED (t))
|
||||
|
||||
#define TM_YEAR_BASE 1900
|
||||
|
||||
@@ -149,19 +144,20 @@ extern char *tzname[];
|
||||
|
||||
|
||||
#ifdef _LIBC
|
||||
# define gmtime_r __gmtime_r
|
||||
# define localtime_r __localtime_r
|
||||
# define my_strftime_gmtime_r __gmtime_r
|
||||
# define my_strftime_localtime_r __localtime_r
|
||||
# define tzname __tzname
|
||||
# define tzset __tzset
|
||||
#else
|
||||
# if ! HAVE_LOCALTIME_R
|
||||
# if ! HAVE_TM_GMTOFF
|
||||
/* Approximate gmtime_r as best we can in its absence. */
|
||||
# undef gmtime_r
|
||||
# define gmtime_r my_gmtime_r
|
||||
static struct tm *gmtime_r __P ((const time_t *, struct tm *));
|
||||
|
||||
/* If we're a strftime substitute in a GNU program, then prefer gmtime
|
||||
to gmtime_r, since many gmtime_r implementations are buggy.
|
||||
Similarly for localtime_r. */
|
||||
|
||||
# if ! HAVE_TM_GMTOFF
|
||||
static struct tm *my_strftime_gmtime_r __P ((const time_t *, struct tm *));
|
||||
static struct tm *
|
||||
gmtime_r (t, tp)
|
||||
my_strftime_gmtime_r (t, tp)
|
||||
const time_t *t;
|
||||
struct tm *tp;
|
||||
{
|
||||
@@ -171,14 +167,11 @@ gmtime_r (t, tp)
|
||||
*tp = *l;
|
||||
return tp;
|
||||
}
|
||||
# endif /* ! HAVE_TM_GMTOFF */
|
||||
# endif /* ! HAVE_TM_GMTOFF */
|
||||
|
||||
/* Approximate localtime_r as best we can in its absence. */
|
||||
# undef localtime_r
|
||||
# define localtime_r my_ftime_localtime_r
|
||||
static struct tm *localtime_r __P ((const time_t *, struct tm *));
|
||||
static struct tm *my_strftime_localtime_r __P ((const time_t *, struct tm *));
|
||||
static struct tm *
|
||||
localtime_r (t, tp)
|
||||
my_strftime_localtime_r (t, tp)
|
||||
const time_t *t;
|
||||
struct tm *tp;
|
||||
{
|
||||
@@ -188,7 +181,6 @@ localtime_r (t, tp)
|
||||
*tp = *l;
|
||||
return tp;
|
||||
}
|
||||
# endif /* ! HAVE_LOCALTIME_R */
|
||||
#endif /* ! defined _LIBC */
|
||||
|
||||
|
||||
@@ -376,34 +368,35 @@ static char const month_name[][10] =
|
||||
|
||||
|
||||
#ifdef emacs
|
||||
# define my_strftime emacs_strftime
|
||||
/* Emacs 20.2 uses `-Dstrftime=emacs_strftime' when compiling,
|
||||
because that's how strftime used to be configured.
|
||||
Undo this, since it gets in the way of accessing the underlying strftime,
|
||||
which is needed for things like %Ec in Solaris.
|
||||
The following two lines can be removed once Emacs stops compiling with
|
||||
`-Dstrftime=emacs_strftime'. */
|
||||
# undef strftime
|
||||
size_t strftime __P ((char *, size_t, const char *, const struct tm *));
|
||||
# define my_strftime emacs_strftimeu
|
||||
# define ut_argument , ut
|
||||
# define ut_argument_spec int ut;
|
||||
# define ut_argument_spec_iso , int ut
|
||||
#else
|
||||
# define my_strftime strftime
|
||||
# define ut_argument
|
||||
# define ut_argument_spec
|
||||
# define ut_argument_spec_iso
|
||||
/* We don't have this information in general. */
|
||||
# define ut 0
|
||||
#endif
|
||||
|
||||
#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
|
||||
/* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
|
||||
Work around this bug by copying *tp before it might be munged. */
|
||||
size_t _strftime_copytm __P ((char *, size_t, const char *,
|
||||
const struct tm *));
|
||||
const struct tm * ut_argument_spec_iso));
|
||||
size_t
|
||||
my_strftime (s, maxsize, format, tp)
|
||||
my_strftime (s, maxsize, format, tp ut_argument)
|
||||
char *s;
|
||||
size_t maxsize;
|
||||
const char *format;
|
||||
const struct tm *tp;
|
||||
ut_argument_spec
|
||||
{
|
||||
struct tm tmcopy;
|
||||
tmcopy = *tp;
|
||||
return _strftime_copytm (s, maxsize, format, &tmcopy);
|
||||
return _strftime_copytm (s, maxsize, format, &tmcopy ut_argument);
|
||||
}
|
||||
# undef my_strftime
|
||||
# define my_strftime(S, Maxsize, Format, Tp) \
|
||||
@@ -418,41 +411,44 @@ size_t strftime __P ((char *, size_t, const char *, const struct tm *));
|
||||
anywhere, so to determine how many characters would be
|
||||
written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */
|
||||
size_t
|
||||
my_strftime (s, maxsize, format, tp)
|
||||
my_strftime (s, maxsize, format, tp ut_argument)
|
||||
char *s;
|
||||
size_t maxsize;
|
||||
const char *format;
|
||||
const struct tm *tp;
|
||||
ut_argument_spec
|
||||
{
|
||||
int hour12 = tp->tm_hour;
|
||||
#ifdef _NL_CURRENT
|
||||
const char *const a_wkday = _NL_CURRENT (LC_TIME, ABDAY_1 + tp->tm_wday);
|
||||
const char *const f_wkday = _NL_CURRENT (LC_TIME, DAY_1 + tp->tm_wday);
|
||||
const char *const a_month = _NL_CURRENT (LC_TIME, ABMON_1 + tp->tm_mon);
|
||||
const char *const f_month = _NL_CURRENT (LC_TIME, MON_1 + tp->tm_mon);
|
||||
const char *const ampm = _NL_CURRENT (LC_TIME,
|
||||
hour12 > 11 ? PM_STR : AM_STR);
|
||||
size_t aw_len = strlen (a_wkday);
|
||||
size_t am_len = strlen (a_month);
|
||||
size_t ap_len = strlen (ampm);
|
||||
/* We cannot make the following values variables since we must delay
|
||||
the evaluation of these values until really needed since some
|
||||
expressions might not be valid in every situation. The `struct tm'
|
||||
might be generated by a strptime() call that initialized
|
||||
only a few elements. Dereference the pointers only if the format
|
||||
requires this. Then it is ok to fail if the pointers are invalid. */
|
||||
# define a_wkday _NL_CURRENT (LC_TIME, ABDAY_1 + tp->tm_wday)
|
||||
# define f_wkday _NL_CURRENT (LC_TIME, DAY_1 + tp->tm_wday)
|
||||
# define a_month _NL_CURRENT (LC_TIME, ABMON_1 + tp->tm_mon)
|
||||
# define f_month _NL_CURRENT (LC_TIME, MON_1 + tp->tm_mon)
|
||||
# define ampm _NL_CURRENT (LC_TIME, tp->tm_hour > 11 ? PM_STR : AM_STR)
|
||||
|
||||
# define aw_len strlen (a_wkday)
|
||||
# define am_len strlen (a_month)
|
||||
# define ap_len strlen (ampm)
|
||||
#else
|
||||
# if !HAVE_STRFTIME
|
||||
const char *const f_wkday = weekday_name[tp->tm_wday];
|
||||
const char *const f_month = month_name[tp->tm_mon];
|
||||
const char *const a_wkday = f_wkday;
|
||||
const char *const a_month = f_month;
|
||||
const char *const ampm = "AMPM" + 2 * (hour12 > 11);
|
||||
# define f_wkday (weekday_name[tp->tm_wday])
|
||||
# define f_month (month_name[tp->tm_mon])
|
||||
# define a_wkday f_wkday
|
||||
# define a_month f_month
|
||||
# define ampm ("AMPM" + 2 * (tp->tm_hour > 11))
|
||||
|
||||
size_t aw_len = 3;
|
||||
size_t am_len = 3;
|
||||
size_t ap_len = 2;
|
||||
# endif
|
||||
#endif
|
||||
#if defined _NL_CURRENT || !HAVE_STRFTIME
|
||||
size_t wkday_len = strlen (f_wkday);
|
||||
size_t month_len = strlen (f_month);
|
||||
#endif
|
||||
const char *zone;
|
||||
size_t zonelen;
|
||||
size_t i = 0;
|
||||
char *p = s;
|
||||
const char *f;
|
||||
@@ -468,25 +464,27 @@ my_strftime (s, maxsize, format, tp)
|
||||
zone = (const char *) tp->tm_zone;
|
||||
#endif
|
||||
#if HAVE_TZNAME
|
||||
/* POSIX.1 8.1.1 requires that whenever strftime() is called, the
|
||||
time zone names contained in the external variable `tzname' shall
|
||||
be set as if the tzset() function had been called. */
|
||||
if (ut)
|
||||
{
|
||||
if (! (zone && *zone))
|
||||
zone = "GMT";
|
||||
}
|
||||
else
|
||||
{
|
||||
/* POSIX.1 8.1.1 requires that whenever strftime() is called, the
|
||||
time zone names contained in the external variable `tzname' shall
|
||||
be set as if the tzset() function had been called. */
|
||||
# if HAVE_TZSET
|
||||
tzset ();
|
||||
tzset ();
|
||||
# endif
|
||||
|
||||
if (!(zone && *zone) && tp->tm_isdst >= 0)
|
||||
zone = tzname[tp->tm_isdst];
|
||||
}
|
||||
#endif
|
||||
if (! zone)
|
||||
zone = ""; /* POSIX.2 requires the empty string here. */
|
||||
|
||||
zonelen = strlen (zone);
|
||||
|
||||
if (hour12 > 12)
|
||||
hour12 -= 12;
|
||||
else
|
||||
if (hour12 == 0) hour12 = 12;
|
||||
if (hour12 == 0)
|
||||
hour12 = 12;
|
||||
|
||||
for (f = format; *f != '\0'; ++f)
|
||||
{
|
||||
@@ -552,7 +550,13 @@ my_strftime (s, maxsize, format, tp)
|
||||
if (bytes == 0)
|
||||
break;
|
||||
|
||||
if (bytes == (size_t) -2 || bytes == (size_t) -1)
|
||||
if (bytes == (size_t) -2)
|
||||
{
|
||||
len += strlen (f + len);
|
||||
break;
|
||||
}
|
||||
|
||||
if (bytes == (size_t) -1)
|
||||
{
|
||||
len++;
|
||||
break;
|
||||
@@ -563,6 +567,7 @@ my_strftime (s, maxsize, format, tp)
|
||||
while (! mbsinit (&mbstate));
|
||||
|
||||
cpy (len, f);
|
||||
f += len - 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -672,7 +677,7 @@ my_strftime (s, maxsize, format, tp)
|
||||
to_lowcase = 0;
|
||||
}
|
||||
#if defined _NL_CURRENT || !HAVE_STRFTIME
|
||||
cpy (wkday_len, f_wkday);
|
||||
cpy (strlen (f_wkday), f_wkday);
|
||||
break;
|
||||
#else
|
||||
goto underlying_strftime;
|
||||
@@ -698,7 +703,7 @@ my_strftime (s, maxsize, format, tp)
|
||||
to_lowcase = 0;
|
||||
}
|
||||
#if defined _NL_CURRENT || !HAVE_STRFTIME
|
||||
cpy (month_len, f_month);
|
||||
cpy (strlen (f_month), f_month);
|
||||
break;
|
||||
#else
|
||||
goto underlying_strftime;
|
||||
@@ -722,9 +727,7 @@ my_strftime (s, maxsize, format, tp)
|
||||
subformat:
|
||||
{
|
||||
char *old_start = p;
|
||||
size_t len = my_strftime (NULL, maxsize - i, subfmt, tp);
|
||||
if (len == 0 && *subfmt)
|
||||
return 0;
|
||||
size_t len = my_strftime (NULL, (size_t) -1, subfmt, tp);
|
||||
add (len, my_strftime (p, maxsize - i, subfmt, tp));
|
||||
|
||||
if (to_uppcase)
|
||||
@@ -751,7 +754,7 @@ my_strftime (s, maxsize, format, tp)
|
||||
*u++ = format_char;
|
||||
*u = '\0';
|
||||
len = strftime (ubuf, sizeof ubuf, ufmt, tp);
|
||||
if (len == 0)
|
||||
if (len == 0 && ubuf[0] != '\0')
|
||||
return 0;
|
||||
cpy (len, ubuf);
|
||||
}
|
||||
@@ -1149,7 +1152,16 @@ my_strftime (s, maxsize, format, tp)
|
||||
to_uppcase = 0;
|
||||
to_lowcase = 1;
|
||||
}
|
||||
cpy (zonelen, zone);
|
||||
|
||||
#if HAVE_TZNAME
|
||||
/* The tzset() call might have changed the value. */
|
||||
if (!(zone && *zone) && tp->tm_isdst >= 0)
|
||||
zone = tzname[tp->tm_isdst];
|
||||
#endif
|
||||
if (! zone)
|
||||
zone = ""; /* POSIX.2 requires the empty string here. */
|
||||
|
||||
cpy (strlen (zone), zone);
|
||||
break;
|
||||
|
||||
case 'z': /* GNU extension. */
|
||||
@@ -1161,34 +1173,39 @@ my_strftime (s, maxsize, format, tp)
|
||||
#if HAVE_TM_GMTOFF
|
||||
diff = tp->tm_gmtoff;
|
||||
#else
|
||||
struct tm gtm;
|
||||
struct tm ltm;
|
||||
time_t lt;
|
||||
|
||||
ltm = *tp;
|
||||
lt = mktime (<m);
|
||||
|
||||
if (lt == (time_t) -1)
|
||||
if (ut)
|
||||
diff = 0;
|
||||
else
|
||||
{
|
||||
/* mktime returns -1 for errors, but -1 is also a
|
||||
valid time_t value. Check whether an error really
|
||||
occurred. */
|
||||
struct tm tm;
|
||||
localtime_r (<, &tm);
|
||||
struct tm gtm;
|
||||
struct tm ltm;
|
||||
time_t lt;
|
||||
|
||||
if ((ltm.tm_sec ^ tm.tm_sec)
|
||||
| (ltm.tm_min ^ tm.tm_min)
|
||||
| (ltm.tm_hour ^ tm.tm_hour)
|
||||
| (ltm.tm_mday ^ tm.tm_mday)
|
||||
| (ltm.tm_mon ^ tm.tm_mon)
|
||||
| (ltm.tm_year ^ tm.tm_year))
|
||||
ltm = *tp;
|
||||
lt = mktime (<m);
|
||||
|
||||
if (lt == (time_t) -1)
|
||||
{
|
||||
/* mktime returns -1 for errors, but -1 is also a
|
||||
valid time_t value. Check whether an error really
|
||||
occurred. */
|
||||
struct tm tm;
|
||||
|
||||
if (! my_strftime_localtime_r (<, &tm)
|
||||
|| ((ltm.tm_sec ^ tm.tm_sec)
|
||||
| (ltm.tm_min ^ tm.tm_min)
|
||||
| (ltm.tm_hour ^ tm.tm_hour)
|
||||
| (ltm.tm_mday ^ tm.tm_mday)
|
||||
| (ltm.tm_mon ^ tm.tm_mon)
|
||||
| (ltm.tm_year ^ tm.tm_year)))
|
||||
break;
|
||||
}
|
||||
|
||||
if (! my_strftime_gmtime_r (<, >m))
|
||||
break;
|
||||
|
||||
diff = tm_diff (<m, >m);
|
||||
}
|
||||
|
||||
if (! gmtime_r (<, >m))
|
||||
break;
|
||||
|
||||
diff = tm_diff (<m, >m);
|
||||
#endif
|
||||
|
||||
if (diff < 0)
|
||||
@@ -1221,7 +1238,23 @@ my_strftime (s, maxsize, format, tp)
|
||||
}
|
||||
}
|
||||
|
||||
if (p)
|
||||
if (p && i < maxsize)
|
||||
*p = '\0';
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
#ifdef emacs
|
||||
/* For Emacs we have a separate interface which corresponds to the normal
|
||||
strftime function and does not have the extra information whether the
|
||||
TP arguments comes from a `gmtime' call or not. */
|
||||
size_t
|
||||
emacs_strftime (s, maxsize, format, tp)
|
||||
char *s;
|
||||
size_t maxsize;
|
||||
const char *format;
|
||||
const struct tm *tp;
|
||||
{
|
||||
return my_strftime (s, maxsize, format, tp, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
81
lib/utime.c
Normal file
81
lib/utime.c
Normal file
@@ -0,0 +1,81 @@
|
||||
/* Copyright (C) 1998 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. */
|
||||
|
||||
/* derived from a function in touch.c */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#undef utime
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_UTIME_H
|
||||
# include <utime.h>
|
||||
#endif
|
||||
|
||||
#include "safe-read.h"
|
||||
|
||||
/* Some systems (even some that do have <utime.h>) don't declare this
|
||||
structure anywhere. */
|
||||
#ifndef HAVE_STRUCT_UTIMBUF
|
||||
struct utimbuf
|
||||
{
|
||||
long actime;
|
||||
long modtime;
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Emulate utime (file, NULL) for systems (like 4.3BSD) that do not
|
||||
interpret it to set the access and modification times of FILE to
|
||||
the current time. Return 0 if successful, -1 if not. */
|
||||
|
||||
static int
|
||||
utime_null (const char *file)
|
||||
{
|
||||
#if HAVE_UTIMES_NULL
|
||||
return utimes (file, 0);
|
||||
#else
|
||||
int fd;
|
||||
char c;
|
||||
int status = 0;
|
||||
struct stat sb;
|
||||
|
||||
fd = open (file, O_RDWR, 0666);
|
||||
if (fd < 0
|
||||
|| fstat (fd, &sb) < 0
|
||||
|| safe_read (fd, &c, sizeof (char)) < 0
|
||||
|| lseek (fd, (off_t) 0, SEEK_SET) < 0
|
||||
|| full_write (fd, &c, sizeof (char)) < 0
|
||||
/* Maybe do this -- it's necessary on SunOS4.1.3 with some combination
|
||||
of patches, but that system doesn't use this code: it has utimes.
|
||||
|| fsync (fd) < 0
|
||||
*/
|
||||
|| ftruncate (fd, st.st_size) < 0
|
||||
|| close (fd) < 0)
|
||||
status = -1;
|
||||
return status;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
rpl_utime (const char *file, const struct utimbuf *times)
|
||||
{
|
||||
if (times)
|
||||
return utime (file, times);
|
||||
|
||||
return utime_null (file);
|
||||
}
|
||||
@@ -21,6 +21,10 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Some pre-ANSI implementations (e.g. SunOS 4)
|
||||
need stderr defined if assertion checking is enabled. */
|
||||
#include <stdio.h>
|
||||
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
@@ -65,6 +69,18 @@ extern int errno;
|
||||
# define LONG_MAX TYPE_MAXIMUM (long int)
|
||||
#endif
|
||||
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
# define IN_CTYPE_DOMAIN(c) 1
|
||||
#else
|
||||
# define IN_CTYPE_DOMAIN(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#ifdef isblank
|
||||
# define ISBLANK(c) (IN_CTYPE_DOMAIN (c) && isblank (c))
|
||||
#else
|
||||
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
|
||||
#endif
|
||||
|
||||
#include "xstrtol.h"
|
||||
|
||||
__unsigned long int __strtol ();
|
||||
@@ -103,6 +119,18 @@ __xstrtol (const char *s, char **ptr, int strtol_base,
|
||||
|
||||
p = (ptr ? ptr : &t_ptr);
|
||||
|
||||
#if STRING_TO_UNSIGNED
|
||||
{
|
||||
const char *q = s;
|
||||
while (ISBLANK (*q))
|
||||
{
|
||||
++q;
|
||||
}
|
||||
if (*q == '-')
|
||||
return LONGINT_INVALID;
|
||||
}
|
||||
#endif
|
||||
|
||||
errno = 0;
|
||||
tmp = __strtol (s, p, strtol_base);
|
||||
if (errno != 0)
|
||||
|
||||
107
m4/ChangeLog
107
m4/ChangeLog
@@ -1,3 +1,110 @@
|
||||
1998-11-14 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* lstat.m4: Correct comment. POSIX does not permit it to succeed.
|
||||
* stat.m4: Likewise.
|
||||
|
||||
1998-11-03 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* stat.m4: Rewrite to set HAVE_STAT_EMPTY_STRING_BUG.
|
||||
* lstat.m4: Rewrite to set HAVE_LSTAT_EMPTY_STRING_BUG.
|
||||
|
||||
1998-10-18 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* check-decl.m4 (jm_CHECK_DECL_LOCALTIME_R): Remove macro.
|
||||
|
||||
1998-10-17 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* decl.m4 (jm_CHECK_DECLARATION): Don't hard-code which headers to
|
||||
include, though we still hard-code the `require'-like AC_CHECK_HEADERS
|
||||
calls for those previously hard-coded headers. Instead, take a new
|
||||
parameter.
|
||||
(jm_CHECK_DECLARATIONS): Reflect interface change.
|
||||
* check-decl.m4 (jm_CHECK_DECLS): Likewise.
|
||||
(jm_CHECK_DECL_LOCALTIME_R): New macro.
|
||||
|
||||
* mktime.m4: Test for spring-forward gap before long-running test.
|
||||
|
||||
1998-10-14 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* mktime.m4: Use the more portable "TZ=PST8PDT,M4.1.0,M10.5.0"
|
||||
instead of "TZ=America/Vancouver". From Paul Eggert.
|
||||
|
||||
1998-10-11 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* mktime.m4 (jm_AM_FUNC_MKTIME): New file and macro.
|
||||
This adds a test for a recently added compatibility fix for mktime.c.
|
||||
* jm-mktime.m4: Require jm_AM_FUNC_MKTIME, not AM_FUNC_MKTIME.
|
||||
|
||||
1998-09-27 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* jm-macros.m4 (jm_MACROS): Require jm_FUNC_FNMATCH.
|
||||
|
||||
* fnmatch.m4 (jm_FUNC_FNMATCH): New file/macro. Extracted from
|
||||
../configure.in, including a change from Gordon Matzigkeit to allow
|
||||
cross-compiling for the Hurd.
|
||||
|
||||
* glibc.m4: New file/macro to test for the GNU C Library
|
||||
versions 1 and 2. From Gordon Matzigkeit.
|
||||
Indent.
|
||||
|
||||
1998-09-21 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* chown.m4: Declare locals: before, after. From Andries Brouwer.
|
||||
|
||||
1998-08-18 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
Port nanosecond-resolution times to UnixWare 2.1.2 and
|
||||
pedantic Solaris 2.6.
|
||||
|
||||
* st_mtim.m4 (AC_STRUCT_ST_MTIM_NSEC): Renamed from
|
||||
AC_STRUCT_ST_MTIM.
|
||||
* st_mtim.m4 (AC_STRUCT_ST_MTIM_NSEC):
|
||||
Generate name of ns member, instead of just 1 or undef.
|
||||
Allow for UnixWare 2.1.2 and Solaris 2.6 if in pedantic mode.
|
||||
|
||||
1998-08-15 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* ssize_t.m4 (jm_TYPE_SSIZE_T): Remove file.
|
||||
* check-type.m4: New file. Replacement for AC_CHECK_TYPE.
|
||||
* jm-macros.m4: Use the new AC_CHECK_TYPE(ssize_t, int)
|
||||
instead of jm_TYPE_SSIZE_T.
|
||||
|
||||
1998-08-12 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* st_dm_mode.m4: New file. From Johan Danielsson.
|
||||
|
||||
1998-08-02 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* st_mtim.m4: Use hack to avoid having to put #undef HAVE_ST_MTIM
|
||||
in acconfig.h manually.
|
||||
|
||||
1998-07-31 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* st_mtim.m4: New file.
|
||||
|
||||
1998-07-28 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* utimes.m4: Undef stat.
|
||||
|
||||
1998-07-25 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* utime.m4 (jm_FUNC_UTIME): New file and macro.
|
||||
* utimes.m4 (jm_FUNC_UTIMES_NULL): New file and macro.
|
||||
|
||||
1998-07-09 Manfred Hollstein <manfred@s-direktnet.de>
|
||||
|
||||
* chown.m4 (jm_FUNC_CHOWN): Add a check to verify that the
|
||||
uid and gid actually remain unchanged.
|
||||
|
||||
1998-07-07 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* jm-glibc-io.m4: Remove fclose_unlocked.
|
||||
|
||||
1998-07-04 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* regex.m4: Use syscmd, ifelse, and sysval. Mainly as an exercise
|
||||
to prove that this macro can be used in packages without regex.c.
|
||||
|
||||
1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* gettext.m4 (AM_WITH_NLS): Remove intl/libintl.h if <libintl.h>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
|
||||
##m4-files-begin
|
||||
EXTRA_DIST = README Makefile.am.in assert.m4 check-decl.m4 chown.m4 \
|
||||
const.m4 d-ino.m4 d-type.m4 decl.m4 error.m4 fstypename.m4 getgroups.m4 \
|
||||
getline.m4 getloadavg.m4 gettext.m4 inttypes_h.m4 isc-posix.m4 \
|
||||
jm-glibc-io.m4 jm-macros.m4 jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 \
|
||||
lchown.m4 lcmessage.m4 lfs.m4 ls-mntd-fs.m4 lstat.m4 malloc.m4 memcmp.m4 \
|
||||
perl.m4 prereq.m4 progtest.m4 putenv.m4 readdir.m4 realloc.m4 regex.m4 \
|
||||
ssize_t.m4 stat.m4 strftime.m4 uintmax_t.m4 uptime.m4 utimbuf.m4
|
||||
EXTRA_DIST = README Makefile.am.in assert.m4 check-decl.m4 check-type.m4 \
|
||||
chown.m4 const.m4 d-ino.m4 d-type.m4 decl.m4 error.m4 fnmatch.m4 \
|
||||
fstypename.m4 getgroups.m4 getline.m4 getloadavg.m4 gettext.m4 glibc.m4 \
|
||||
inttypes_h.m4 isc-posix.m4 jm-glibc-io.m4 jm-macros.m4 jm-mktime.m4 \
|
||||
jm-winsz1.m4 jm-winsz2.m4 lchown.m4 lcmessage.m4 lfs.m4 ls-mntd-fs.m4 \
|
||||
lstat.m4 malloc.m4 memcmp.m4 mktime.m4 perl.m4 prereq.m4 progtest.m4 \
|
||||
putenv.m4 readdir.m4 realloc.m4 regex.m4 st_dm_mode.m4 st_mtim.m4 stat.m4 \
|
||||
strftime.m4 uintmax_t.m4 uptime.m4 utimbuf.m4 utime.m4 utimes.m4
|
||||
|
||||
##m4-files-end
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.3b from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
@@ -32,7 +32,7 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
@@ -90,13 +90,14 @@ VERSION = @VERSION@
|
||||
YACC = @YACC@
|
||||
l = @l@
|
||||
|
||||
EXTRA_DIST = README Makefile.am.in assert.m4 check-decl.m4 chown.m4 \
|
||||
const.m4 d-ino.m4 d-type.m4 decl.m4 error.m4 fstypename.m4 getgroups.m4 \
|
||||
getline.m4 getloadavg.m4 gettext.m4 inttypes_h.m4 isc-posix.m4 \
|
||||
jm-glibc-io.m4 jm-macros.m4 jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 \
|
||||
lchown.m4 lcmessage.m4 lfs.m4 ls-mntd-fs.m4 lstat.m4 malloc.m4 memcmp.m4 \
|
||||
perl.m4 prereq.m4 progtest.m4 putenv.m4 readdir.m4 realloc.m4 regex.m4 \
|
||||
ssize_t.m4 stat.m4 strftime.m4 uintmax_t.m4 uptime.m4 utimbuf.m4
|
||||
EXTRA_DIST = README Makefile.am.in assert.m4 check-decl.m4 check-type.m4 \
|
||||
chown.m4 const.m4 d-ino.m4 d-type.m4 decl.m4 error.m4 fnmatch.m4 \
|
||||
fstypename.m4 getgroups.m4 getline.m4 getloadavg.m4 gettext.m4 glibc.m4 \
|
||||
inttypes_h.m4 isc-posix.m4 jm-glibc-io.m4 jm-macros.m4 jm-mktime.m4 \
|
||||
jm-winsz1.m4 jm-winsz2.m4 lchown.m4 lcmessage.m4 lfs.m4 ls-mntd-fs.m4 \
|
||||
lstat.m4 malloc.m4 memcmp.m4 mktime.m4 perl.m4 prereq.m4 progtest.m4 \
|
||||
putenv.m4 readdir.m4 realloc.m4 regex.m4 st_dm_mode.m4 st_mtim.m4 stat.m4 \
|
||||
strftime.m4 uintmax_t.m4 uptime.m4 utimbuf.m4 utime.m4 utimes.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@@ -140,7 +141,6 @@ distdir: $(DISTFILES)
|
||||
info:
|
||||
dvi:
|
||||
check: all
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
install-exec:
|
||||
@$(NORMAL_INSTALL)
|
||||
@@ -154,24 +154,19 @@ install: install-exec install-data all
|
||||
uninstall:
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(DISTCLEANFILES)
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-generic
|
||||
|
||||
clean: clean-generic mostlyclean
|
||||
|
||||
@@ -1,10 +1,29 @@
|
||||
#serial 2
|
||||
#serial 4
|
||||
|
||||
dnl This is just a wrapper function to encapsulate this kludge.
|
||||
dnl Putting it in a separate file like this helps share it between
|
||||
dnl different packages.
|
||||
AC_DEFUN(jm_CHECK_DECLS,
|
||||
[
|
||||
headers='
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STRING_H
|
||||
# if !STDC_HEADERS && HAVE_MEMORY_H
|
||||
# include <memory.h>
|
||||
# endif
|
||||
# include <string.h>
|
||||
#else
|
||||
# ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
'
|
||||
if test x = y; then
|
||||
dnl This code is deliberately never run via ./configure.
|
||||
dnl FIXME: this is a gross hack to make autoheader put entries
|
||||
@@ -14,5 +33,6 @@ AC_DEFUN(jm_CHECK_DECLS,
|
||||
AC_CHECK_FUNCS(DECL_FREE DECL_LSEEK DECL_MALLOC DECL_MEMCHR DECL_REALLOC \
|
||||
DECL_STPCPY DECL_STRSTR)
|
||||
fi
|
||||
jm_CHECK_DECLARATIONS(free lseek malloc memchr realloc stpcpy strstr)
|
||||
jm_CHECK_DECLARATIONS($headers, free lseek malloc \
|
||||
memchr realloc stpcpy strstr)
|
||||
])
|
||||
|
||||
28
m4/check-type.m4
Normal file
28
m4/check-type.m4
Normal file
@@ -0,0 +1,28 @@
|
||||
#serial 1
|
||||
|
||||
dnl Just like AC_CHECK_TYPE from autoconf-2.12, but also checks in unistd.h
|
||||
dnl on systems that have it. Fujitsu UXP/V needs this for ssize_t.
|
||||
|
||||
undefine([AC_CHECK_TYPE])
|
||||
dnl AC_CHECK_TYPE(TYPE, DEFAULT)
|
||||
AC_DEFUN(AC_CHECK_TYPE,
|
||||
[AC_REQUIRE([AC_HEADER_STDC])dnl
|
||||
AC_CHECK_HEADERS(unistd.h)
|
||||
AC_MSG_CHECKING(for $1)
|
||||
AC_CACHE_VAL(ac_cv_type_$1,
|
||||
[AC_EGREP_CPP(dnl
|
||||
changequote(<<,>>)dnl
|
||||
<<$1[^a-zA-Z_0-9]>>dnl
|
||||
changequote([,]), [#include <sys/types.h>
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
|
||||
AC_MSG_RESULT($ac_cv_type_$1)
|
||||
if test $ac_cv_type_$1 = no; then
|
||||
AC_DEFINE($1, $2)
|
||||
fi
|
||||
])
|
||||
14
m4/chown.m4
14
m4/chown.m4
@@ -1,4 +1,4 @@
|
||||
#serial 2
|
||||
#serial 3
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl Determine whether chown accepts arguments of -1 for uid and gid.
|
||||
@@ -17,6 +17,7 @@ AC_DEFUN(jm_FUNC_CHOWN,
|
||||
AC_CACHE_CHECK([for working chown], jm_cv_func_working_chown,
|
||||
[AC_TRY_RUN([
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
# include <fcntl.h>
|
||||
# ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
@@ -26,9 +27,18 @@ AC_DEFUN(jm_FUNC_CHOWN,
|
||||
main ()
|
||||
{
|
||||
char *f = "conftestchown";
|
||||
struct stat before, after;
|
||||
|
||||
if (creat (f, 0600) < 0)
|
||||
exit (1);
|
||||
exit (chown (f, (uid_t) -1, (gid_t) -1) == -1 ? 1 : 0);
|
||||
if (stat (f, &before) < 0)
|
||||
exit (1);
|
||||
if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
|
||||
exit (1);
|
||||
if (stat (f, &after) < 0)
|
||||
exit (1);
|
||||
exit ((before.st_uid == after.st_uid
|
||||
&& before.st_gid == after.st_gid) ? 0 : 1);
|
||||
}
|
||||
],
|
||||
jm_cv_func_working_chown=yes,
|
||||
|
||||
33
m4/decl.m4
33
m4/decl.m4
@@ -1,4 +1,4 @@
|
||||
#serial 2
|
||||
#serial 3
|
||||
|
||||
AC_DEFUN(jm_CHECK_DECLARATION,
|
||||
[
|
||||
@@ -10,24 +10,7 @@ AC_DEFUN(jm_CHECK_DECLARATION,
|
||||
test -z "$ac_cv_header_unistd_h" && AC_CHECK_HEADERS(unistd.h)
|
||||
AC_MSG_CHECKING([whether $1 is declared])
|
||||
AC_CACHE_VAL(jm_cv_func_decl_$1,
|
||||
[AC_TRY_COMPILE([
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STRING_H
|
||||
# if !STDC_HEADERS && HAVE_MEMORY_H
|
||||
# include <memory.h>
|
||||
# endif
|
||||
# include <string.h>
|
||||
#else
|
||||
# ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif],
|
||||
[AC_TRY_COMPILE($2,
|
||||
[
|
||||
#ifndef $1
|
||||
char *(*pfn) = (char *(*)) $1
|
||||
@@ -38,23 +21,23 @@ char *(*pfn) = (char *(*)) $1
|
||||
|
||||
if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$2], , :, [$2])
|
||||
ifelse([$3], , :, [$3])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
ifelse([$3], , , [$3
|
||||
ifelse([$4], , , [$4
|
||||
])dnl
|
||||
fi
|
||||
])dnl
|
||||
|
||||
dnl jm_CHECK_DECLARATIONS(FUNCTION... [, ACTION-IF-DECLARED
|
||||
dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED
|
||||
dnl [, ACTION-IF-NOT-DECLARED]])
|
||||
AC_DEFUN(jm_CHECK_DECLARATIONS,
|
||||
[
|
||||
for jm_func in $1
|
||||
for jm_func in $2
|
||||
do
|
||||
jm_CHECK_DECLARATION($jm_func,
|
||||
jm_CHECK_DECLARATION($jm_func, $1,
|
||||
[
|
||||
jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
|
||||
AC_DEFINE_UNQUOTED($jm_tr_func) $2], $3)dnl
|
||||
AC_DEFINE_UNQUOTED($jm_tr_func) $3], $4)dnl
|
||||
done
|
||||
])
|
||||
|
||||
21
m4/fnmatch.m4
Normal file
21
m4/fnmatch.m4
Normal file
@@ -0,0 +1,21 @@
|
||||
#serial 1
|
||||
|
||||
dnl Determine whether to add fnmatch.o to LIBOBJS and to
|
||||
dnl define fnmatch to rpl_fnmatch.
|
||||
dnl
|
||||
dnl If you use this macro in a package, you should
|
||||
dnl add the following two lines to acconfig.h:
|
||||
dnl /* Define to rpl_fnmatch if the replacement function should be used. */
|
||||
dnl #undef fnmatch
|
||||
dnl
|
||||
|
||||
AC_DEFUN(jm_FUNC_FNMATCH,
|
||||
[
|
||||
AC_REQUIRE([AM_GLIBC])
|
||||
AC_FUNC_FNMATCH
|
||||
if test $ac_cv_func_fnmatch_works = no \
|
||||
&& test $ac_cv_gnu_library = no; then
|
||||
LIBOBJS="$LIBOBJS fnmatch.o"
|
||||
AC_DEFINE_UNQUOTED(fnmatch, rpl_fnmatch)
|
||||
fi
|
||||
])
|
||||
35
m4/glibc.m4
Normal file
35
m4/glibc.m4
Normal file
@@ -0,0 +1,35 @@
|
||||
#serial 2
|
||||
|
||||
dnl From Gordon Matzigkeit.
|
||||
dnl Test for the GNU C Library.
|
||||
dnl FIXME: this should migrate into libit.
|
||||
|
||||
AC_DEFUN(AM_GLIBC,
|
||||
[
|
||||
AC_CACHE_CHECK(whether we are using the GNU C Library,
|
||||
ac_cv_gnu_library,
|
||||
[AC_EGREP_CPP([Thanks for using GNU],
|
||||
[
|
||||
#include <features.h>
|
||||
#ifdef __GNU_LIBRARY__
|
||||
Thanks for using GNU
|
||||
#endif
|
||||
],
|
||||
ac_cv_gnu_library=yes,
|
||||
ac_cv_gnu_library=no)
|
||||
]
|
||||
)
|
||||
AC_CACHE_CHECK(for version 2 of the GNU C Library,
|
||||
ac_cv_glibc,
|
||||
[AC_EGREP_CPP([Thanks for using GNU too],
|
||||
[
|
||||
#include <features.h>
|
||||
#ifdef __GLIBC__
|
||||
Thanks for using GNU too
|
||||
#endif
|
||||
],
|
||||
ac_cv_glibc=yes, ac_cv_glibc=no)
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@@ -8,7 +8,6 @@ dnl
|
||||
AC_DEFUN(jm_FUNC_GLIBC_UNLOCKED_IO,
|
||||
[AC_CHECK_FUNCS( \
|
||||
clearerr_unlocked \
|
||||
fclose_unlocked \
|
||||
feof_unlocked \
|
||||
ferror_unlocked \
|
||||
fflush_unlocked \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 1
|
||||
#serial 2
|
||||
|
||||
dnl Misc type-related macros for fileutils, sh-utils, textutils.
|
||||
|
||||
@@ -11,7 +11,7 @@ AC_DEFUN(jm_MACROS,
|
||||
AC_REQUIRE([jm_ASSERT])
|
||||
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
|
||||
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
|
||||
AC_REQUIRE([jm_TYPE_SSIZE_T])
|
||||
AC_CHECK_TYPE(ssize_t, int)
|
||||
AC_REQUIRE([jm_STRUCT_UTIMBUF])
|
||||
AC_REQUIRE([jm_STRUCT_DIRENT_D_TYPE])
|
||||
AC_REQUIRE([jm_STRUCT_DIRENT_D_INO])
|
||||
@@ -29,4 +29,5 @@ AC_DEFUN(jm_MACROS,
|
||||
AC_REQUIRE([jm_FUNC_READDIR])
|
||||
AC_REQUIRE([jm_FUNC_MEMCMP])
|
||||
AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
|
||||
AC_REQUIRE([jm_FUNC_FNMATCH])
|
||||
])
|
||||
|
||||
@@ -7,12 +7,12 @@ dnl /* Define to rpl_mktime if the replacement function should be used. */
|
||||
dnl #undef mktime
|
||||
dnl
|
||||
AC_DEFUN(jm_FUNC_MKTIME,
|
||||
[AC_REQUIRE([AM_FUNC_MKTIME])dnl
|
||||
[AC_REQUIRE([jm_AM_FUNC_MKTIME])dnl
|
||||
|
||||
dnl mktime.c uses localtime_r if it exists. Check for it.
|
||||
AC_CHECK_FUNCS(localtime_r)
|
||||
|
||||
if test $am_cv_func_working_mktime = no; then
|
||||
if test $jm_am_cv_func_working_mktime = no; then
|
||||
AC_DEFINE_UNQUOTED(mktime, rpl_mktime)
|
||||
fi
|
||||
])
|
||||
|
||||
43
m4/lstat.m4
43
m4/lstat.m4
@@ -1,20 +1,18 @@
|
||||
#serial 1
|
||||
#serial 2
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl Determine whether lstat has the bug that it succeeds when given the
|
||||
dnl zero-length file name argument. The lstat from SunOS4.1.4 does this.
|
||||
dnl zero-length file name argument. The lstat from SunOS4.1.4 and the Hurd
|
||||
dnl (as of 1998-11-01) do this.
|
||||
dnl
|
||||
dnl If it doesn't, arrange to use the replacement function.
|
||||
dnl
|
||||
dnl If you use this macro in a package, you should
|
||||
dnl add the following two lines to acconfig.h:
|
||||
dnl /* Define to rpl_lstat if the replacement function should be used. */
|
||||
dnl #undef lstat
|
||||
dnl If it does, then define HAVE_LSTAT_EMPTY_STRING_BUG and arrange to
|
||||
dnl compile the wrapper function.
|
||||
dnl
|
||||
|
||||
AC_DEFUN(jm_FUNC_LSTAT,
|
||||
[
|
||||
AC_CACHE_CHECK([for working lstat], jm_cv_func_working_lstat,
|
||||
AC_CACHE_CHECK([whether lstat accepts an empty string],
|
||||
jm_cv_func_lstat_empty_string_bug,
|
||||
[AC_TRY_RUN([
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
@@ -23,16 +21,31 @@ AC_DEFUN(jm_FUNC_LSTAT,
|
||||
main ()
|
||||
{
|
||||
struct stat sbuf;
|
||||
exit (lstat ("", &sbuf) == 0 ? 1 : 0);
|
||||
exit (lstat ("", &sbuf) ? 1 : 0);
|
||||
}
|
||||
],
|
||||
jm_cv_func_working_lstat=yes,
|
||||
jm_cv_func_working_lstat=no,
|
||||
jm_cv_func_lstat_empty_string_bug=yes,
|
||||
jm_cv_func_lstat_empty_string_bug=no,
|
||||
dnl When crosscompiling, assume lstat is broken.
|
||||
jm_cv_func_working_lstat=no)
|
||||
jm_cv_func_lstat_empty_string_bug=yes)
|
||||
])
|
||||
if test $jm_cv_func_working_lstat = no; then
|
||||
if test $jm_cv_func_lstat_empty_string_bug = yes; then
|
||||
|
||||
LIBOBJS="$LIBOBJS lstat.o"
|
||||
AC_DEFINE_UNQUOTED(lstat, rpl_lstat)
|
||||
|
||||
if test $jm_cv_func_lstat_empty_string_bug = yes; then
|
||||
if test x = y; then
|
||||
# This code is deliberately never run via ./configure.
|
||||
# FIXME: this is a hack to make autoheader put the corresponding
|
||||
# HAVE_* undef for this symbol in config.h.in. This saves me the
|
||||
# trouble of having to maintain the #undef in acconfig.h manually.
|
||||
AC_CHECK_FUNCS(LSTAT_EMPTY_STRING_BUG)
|
||||
fi
|
||||
# Defining it this way (rather than via AC_DEFINE) short-circuits the
|
||||
# autoheader check -- autoheader doesn't know it's already been taken
|
||||
# care of by the hack above.
|
||||
ac_kludge=HAVE_LSTAT_EMPTY_STRING_BUG
|
||||
AC_DEFINE_UNQUOTED($ac_kludge)
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
166
m4/mktime.m4
Normal file
166
m4/mktime.m4
Normal file
@@ -0,0 +1,166 @@
|
||||
#serial 1001
|
||||
|
||||
dnl Just like mktime.m4 from automake-1.3b, but with an additional test.
|
||||
dnl Renamed to have jm_ prefix and to use jm_ prefix on cache variable names.
|
||||
|
||||
AC_DEFUN(jm_AM_FUNC_MKTIME,
|
||||
[AC_REQUIRE([AC_HEADER_TIME])dnl
|
||||
AC_CHECK_HEADERS(sys/time.h unistd.h)
|
||||
AC_CHECK_FUNCS(alarm)
|
||||
AC_CACHE_CHECK([for working mktime], jm_am_cv_func_working_mktime,
|
||||
[AC_TRY_RUN(
|
||||
changequote(<<, >>)dnl
|
||||
<</* Test program from Paul Eggert (eggert@twinsun.com)
|
||||
and Tony Leneis (tony@plaza.ds.adp.com). */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if !HAVE_ALARM
|
||||
# define alarm(X) /* empty */
|
||||
#endif
|
||||
|
||||
/* Work around redefinition to rpl_putenv by other config tests. */
|
||||
#undef putenv
|
||||
|
||||
static time_t time_t_max;
|
||||
|
||||
/* Values we'll use to set the TZ environment variable. */
|
||||
static const char *const tz_strings[] = {
|
||||
(const char *) 0, "TZ=GMT0", "TZ=JST-9",
|
||||
"TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
|
||||
};
|
||||
#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
|
||||
|
||||
/* Fail if mktime fails to convert a date in the spring-forward gap.
|
||||
Based on a problem report from Andreas Jaeger. */
|
||||
static void
|
||||
spring_forward_gap ()
|
||||
{
|
||||
/* glibc (up to about 1998-10-07) failed this test) */
|
||||
struct tm tm;
|
||||
|
||||
/* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
|
||||
instead of "TZ=America/Vancouver" in order to detect the bug even
|
||||
on systems that don't support the Olson extension, or don't have the
|
||||
full zoneinfo tables installed. */
|
||||
putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
|
||||
tm.tm_year = 98;
|
||||
tm.tm_mon = 3;
|
||||
tm.tm_mday = 5;
|
||||
tm.tm_hour = 2;
|
||||
tm.tm_min = 0;
|
||||
tm.tm_sec = 0;
|
||||
tm.tm_isdst = -1;
|
||||
if (mktime (&tm) == (time_t)-1)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
static void
|
||||
mktime_test (now)
|
||||
time_t now;
|
||||
{
|
||||
struct tm *lt;
|
||||
if ((lt = localtime (&now)) && mktime (lt) != now)
|
||||
exit (1);
|
||||
now = time_t_max - now;
|
||||
if ((lt = localtime (&now)) && mktime (lt) != now)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
static void
|
||||
irix_6_4_bug ()
|
||||
{
|
||||
/* Based on code from Ariel Faigon. */
|
||||
struct tm tm;
|
||||
tm.tm_year = 96;
|
||||
tm.tm_mon = 3;
|
||||
tm.tm_mday = 0;
|
||||
tm.tm_hour = 0;
|
||||
tm.tm_min = 0;
|
||||
tm.tm_sec = 0;
|
||||
tm.tm_isdst = -1;
|
||||
mktime (&tm);
|
||||
if (tm.tm_mon != 2 || tm.tm_mday != 31)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
static void
|
||||
bigtime_test (j)
|
||||
int j;
|
||||
{
|
||||
struct tm tm;
|
||||
time_t now;
|
||||
tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
|
||||
/* This test makes some buggy mktime implementations loop.
|
||||
Give up after 10 seconds. */
|
||||
alarm (10);
|
||||
now = mktime (&tm);
|
||||
alarm (0);
|
||||
if (now != (time_t) -1)
|
||||
{
|
||||
struct tm *lt = localtime (&now);
|
||||
if (! (lt
|
||||
&& lt->tm_year == tm.tm_year
|
||||
&& lt->tm_mon == tm.tm_mon
|
||||
&& lt->tm_mday == tm.tm_mday
|
||||
&& lt->tm_hour == tm.tm_hour
|
||||
&& lt->tm_min == tm.tm_min
|
||||
&& lt->tm_sec == tm.tm_sec
|
||||
&& lt->tm_yday == tm.tm_yday
|
||||
&& lt->tm_wday == tm.tm_wday
|
||||
&& ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
|
||||
== (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
time_t t, delta;
|
||||
int i, j;
|
||||
|
||||
spring_forward_gap ();
|
||||
for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
|
||||
continue;
|
||||
time_t_max--;
|
||||
delta = time_t_max / 997; /* a suitable prime number */
|
||||
for (i = 0; i < N_STRINGS; i++)
|
||||
{
|
||||
if (tz_strings[i])
|
||||
putenv (tz_strings[i]);
|
||||
|
||||
for (t = 0; t <= time_t_max - delta; t += delta)
|
||||
mktime_test (t);
|
||||
mktime_test ((time_t) 60 * 60);
|
||||
mktime_test ((time_t) 60 * 60 * 24);
|
||||
|
||||
for (j = 1; 0 < j; j *= 2)
|
||||
bigtime_test (j);
|
||||
bigtime_test (j - 1);
|
||||
}
|
||||
irix_6_4_bug ();
|
||||
exit (0);
|
||||
}
|
||||
>>,
|
||||
changequote([, ])dnl
|
||||
jm_am_cv_func_working_mktime=yes, jm_am_cv_func_working_mktime=no,
|
||||
dnl When crosscompiling, assume mktime is missing or broken.
|
||||
jm_am_cv_func_working_mktime=no)
|
||||
])
|
||||
if test $jm_am_cv_func_working_mktime = no; then
|
||||
LIBOBJS="$LIBOBJS mktime.o"
|
||||
fi
|
||||
])
|
||||
24
m4/regex.m4
24
m4/regex.m4
@@ -1,15 +1,23 @@
|
||||
#serial 1
|
||||
#serial 2
|
||||
|
||||
dnl From grep.
|
||||
dnl Derived from code in GNU grep.
|
||||
|
||||
AC_DEFUN(jm_WITH_REGEX,
|
||||
[
|
||||
AC_ARG_WITH(included-regex,
|
||||
dnl Even packages that don't use regex.c can use this macro.
|
||||
dnl Of course, for them it doesn't do anything.
|
||||
|
||||
syscmd([test -f lib/regex.c])
|
||||
ifelse(sysval, 0,
|
||||
[
|
||||
AC_ARG_WITH(included-regex,
|
||||
[ --without-included-regex don't compile regex (use with caution)],
|
||||
jm_with_regex=$withval,
|
||||
jm_with_regex=yes)
|
||||
if test "$jm_with_regex" = yes; then
|
||||
LIBOBJS="$LIBOBJS regex.o"
|
||||
fi
|
||||
jm_with_regex=$withval,
|
||||
jm_with_regex=yes)
|
||||
if test "$jm_with_regex" = yes; then
|
||||
LIBOBJS="$LIBOBJS regex.o"
|
||||
fi
|
||||
],
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#serial 1
|
||||
|
||||
dnl From Jim Meyering
|
||||
|
||||
# If ssize_t is not defined in sys/types.h, define it to `int'.
|
||||
|
||||
AC_DEFUN(jm_TYPE_SSIZE_T,
|
||||
[AC_CACHE_CHECK(for ssize_t in sys/types.h, jm_ac_cv_type_ssize_t,
|
||||
[
|
||||
AC_EGREP_HEADER(ssize_t, sys/types.h,
|
||||
jm_ac_cv_type_ssize_t=yes,
|
||||
jm_ac_cv_type_ssize_t=no)
|
||||
if test $jm_ac_cv_type_ssize_t = no; then
|
||||
AC_DEFINE(ssize_t, int)
|
||||
fi
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
25
m4/st_dm_mode.m4
Normal file
25
m4/st_dm_mode.m4
Normal file
@@ -0,0 +1,25 @@
|
||||
# Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member.
|
||||
|
||||
AC_DEFUN(AC_STRUCT_ST_DM_MODE,
|
||||
[AC_CACHE_CHECK([for st_dm_mode in struct stat], ac_cv_struct_st_dm_mode,
|
||||
[AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <sys/stat.h>], [struct stat s; s.st_dm_mode;],
|
||||
ac_cv_struct_st_dm_mode=yes,
|
||||
ac_cv_struct_st_dm_mode=no)])
|
||||
|
||||
if test $ac_cv_struct_st_dm_mode = yes; then
|
||||
if test x = y; then
|
||||
# This code is deliberately never run via ./configure.
|
||||
# FIXME: this is a hack to make autoheader put the corresponding
|
||||
# HAVE_* undef for this symbol in config.h.in. This saves me the
|
||||
# trouble of having to add the #undef in acconfig.h manually.
|
||||
AC_CHECK_FUNCS(ST_DM_MODE)
|
||||
fi
|
||||
# Defining it this way (rather than via AC_DEFINE) short-circuits the
|
||||
# autoheader check -- autoheader doesn't know it's already been taken
|
||||
# care of by the hack above.
|
||||
ac_kludge=HAVE_ST_DM_MODE
|
||||
AC_DEFINE_UNQUOTED($ac_kludge)
|
||||
fi
|
||||
]
|
||||
)
|
||||
30
m4/st_mtim.m4
Normal file
30
m4/st_mtim.m4
Normal file
@@ -0,0 +1,30 @@
|
||||
#serial 3
|
||||
|
||||
dnl From Paul Eggert.
|
||||
|
||||
# Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
|
||||
# if it exists.
|
||||
|
||||
AC_DEFUN(AC_STRUCT_ST_MTIM_NSEC,
|
||||
[AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
|
||||
ac_cv_struct_st_mtim_nsec,
|
||||
[ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
ac_cv_struct_st_mtim_nsec=no
|
||||
# tv_nsec -- the usual case
|
||||
# _tv_nsec -- Solaris 2.6, if
|
||||
# (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
|
||||
# && !defined __EXTENSIONS__)
|
||||
# st__tim.tv_nsec -- UnixWare 2.1.2
|
||||
for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
|
||||
CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
|
||||
AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
|
||||
[ac_cv_struct_st_mtim_nsec=$ac_val; break])
|
||||
done
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"])
|
||||
|
||||
if test $ac_cv_struct_st_mtim_nsec != no; then
|
||||
AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec)
|
||||
fi
|
||||
]
|
||||
)
|
||||
43
m4/stat.m4
43
m4/stat.m4
@@ -1,20 +1,18 @@
|
||||
#serial 1
|
||||
#serial 2
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl Determine whether stat has the bug that it succeeds when given the
|
||||
dnl zero-length file name argument. The stat from SunOS4.1.4 does this.
|
||||
dnl zero-length file name argument. The stat from SunOS4.1.4 and the Hurd
|
||||
dnl (as of 1998-11-01) do this.
|
||||
dnl
|
||||
dnl If it doesn't, arrange to use the replacement function.
|
||||
dnl
|
||||
dnl If you use this macro in a package, you should
|
||||
dnl add the following two lines to acconfig.h:
|
||||
dnl /* Define to rpl_stat if the replacement function should be used. */
|
||||
dnl #undef stat
|
||||
dnl If it does, then define HAVE_STAT_EMPTY_STRING_BUG and arrange to
|
||||
dnl compile the wrapper function.
|
||||
dnl
|
||||
|
||||
AC_DEFUN(jm_FUNC_STAT,
|
||||
[
|
||||
AC_CACHE_CHECK([for working stat], jm_cv_func_working_stat,
|
||||
AC_CACHE_CHECK([whether stat accepts an empty string],
|
||||
jm_cv_func_stat_empty_string_bug,
|
||||
[AC_TRY_RUN([
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
@@ -23,16 +21,31 @@ AC_DEFUN(jm_FUNC_STAT,
|
||||
main ()
|
||||
{
|
||||
struct stat sbuf;
|
||||
exit (stat ("", &sbuf) == 0 ? 1 : 0);
|
||||
exit (stat ("", &sbuf) ? 1 : 0);
|
||||
}
|
||||
],
|
||||
jm_cv_func_working_stat=yes,
|
||||
jm_cv_func_working_stat=no,
|
||||
jm_cv_func_stat_empty_string_bug=yes,
|
||||
jm_cv_func_stat_empty_string_bug=no,
|
||||
dnl When crosscompiling, assume stat is broken.
|
||||
jm_cv_func_working_stat=no)
|
||||
jm_cv_func_stat_empty_string_bug=yes)
|
||||
])
|
||||
if test $jm_cv_func_working_stat = no; then
|
||||
if test $jm_cv_func_stat_empty_string_bug = yes; then
|
||||
|
||||
LIBOBJS="$LIBOBJS stat.o"
|
||||
AC_DEFINE_UNQUOTED(stat, rpl_stat)
|
||||
|
||||
if test $jm_cv_func_stat_empty_string_bug = yes; then
|
||||
if test x = y; then
|
||||
# This code is deliberately never run via ./configure.
|
||||
# FIXME: this is a hack to make autoheader put the corresponding
|
||||
# HAVE_* undef for this symbol in config.h.in. This saves me the
|
||||
# trouble of having to maintain the #undef in acconfig.h manually.
|
||||
AC_CHECK_FUNCS(STAT_EMPTY_STRING_BUG)
|
||||
fi
|
||||
# Defining it this way (rather than via AC_DEFINE) short-circuits the
|
||||
# autoheader check -- autoheader doesn't know it's already been taken
|
||||
# care of by the hack above.
|
||||
ac_kludge=HAVE_STAT_EMPTY_STRING_BUG
|
||||
AC_DEFINE_UNQUOTED($ac_kludge)
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
18
m4/utime.m4
Normal file
18
m4/utime.m4
Normal file
@@ -0,0 +1,18 @@
|
||||
#serial 1
|
||||
|
||||
dnl From Jim Meyering
|
||||
dnl Replace the utime function on systems that need it.
|
||||
|
||||
dnl FIXME
|
||||
|
||||
AC_DEFUN(jm_FUNC_UTIME,
|
||||
[
|
||||
AC_CHECK_HEADERS(utime.h)
|
||||
AC_REQUIRE([jm_STRUCT_UTIMBUF])
|
||||
AC_REQUIRE([AC_FUNC_UTIME_NULL])
|
||||
|
||||
if test $ac_cv_func_utime_null = no; then
|
||||
jm_FUNC_UTIMES_NULL
|
||||
AC_REPLACE_FUNCS(utime)
|
||||
fi
|
||||
])
|
||||
39
m4/utimes.m4
Normal file
39
m4/utimes.m4
Normal file
@@ -0,0 +1,39 @@
|
||||
#serial 2
|
||||
|
||||
dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL.
|
||||
|
||||
AC_DEFUN(jm_FUNC_UTIMES_NULL,
|
||||
[AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
|
||||
[rm -f conftestdata; > conftestdata
|
||||
AC_TRY_RUN([
|
||||
/* In case stat has been defined to rpl_stat, undef it here. */
|
||||
#undef stat
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
main() {
|
||||
struct stat s, t;
|
||||
exit(!(stat ("conftestdata", &s) == 0 && utimes("conftestdata", (long *)0) == 0
|
||||
&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
|
||||
&& t.st_mtime - s.st_mtime < 120));
|
||||
}],
|
||||
ac_cv_func_utimes_null=yes,
|
||||
ac_cv_func_utimes_null=no,
|
||||
ac_cv_func_utimes_null=no)
|
||||
rm -f core core.* *.core])
|
||||
|
||||
if test $ac_cv_func_utimes_null = yes; then
|
||||
if test x = y; then
|
||||
# This code is deliberately never run via ./configure.
|
||||
# FIXME: this is a hack to make autoheader put the corresponding
|
||||
# HAVE_* undef for this symbol in config.h.in. This saves me the
|
||||
# trouble of having to maintain the #undef in acconfig.h manually.
|
||||
AC_CHECK_FUNCS(UTIMES_NULL)
|
||||
fi
|
||||
# Defining it this way (rather than via AC_DEFINE) short-circuits the
|
||||
# autoheader check -- autoheader doesn't know it's already been taken
|
||||
# care of by the hack above.
|
||||
ac_kludge=HAVE_UTIMES_NULL
|
||||
AC_DEFINE_UNQUOTED($ac_kludge)
|
||||
fi
|
||||
]
|
||||
)
|
||||
2
man/basename.x
Normal file
2
man/basename.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/cat.x
Normal file
2
man/cat.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/chgrp.x
Normal file
2
man/chgrp.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
55
man/chmod.x
Normal file
55
man/chmod.x
Normal file
@@ -0,0 +1,55 @@
|
||||
[DESCRIPTION]
|
||||
This manual page
|
||||
documents the GNU version of
|
||||
.BR chmod .
|
||||
.B chmod
|
||||
changes the permissions of each given file according to
|
||||
.IR mode ,
|
||||
which can be either a symbolic representation of changes to make, or
|
||||
an octal number representing the bit pattern for the new permissions.
|
||||
.PP
|
||||
The format of a symbolic mode is
|
||||
`[ugoa...][[+-=][rwxXstugo...]...][,...]'. Multiple symbolic
|
||||
operations can be given, separated by commas.
|
||||
.PP
|
||||
A combination of the letters `ugoa' controls which users' access to
|
||||
the file will be changed: the user who owns it (u), other users in the
|
||||
file's group (g), other users not in the file's group (o), or all
|
||||
users (a). If none of these are given, the effect is as if `a' were
|
||||
given, but bits that are set in the umask are not affected.
|
||||
.PP
|
||||
The operator `+' causes the permissions selected to be added to the
|
||||
existing permissions of each file; `-' causes them to be removed; and
|
||||
`=' causes them to be the only permissions that the file has.
|
||||
.PP
|
||||
The letters `rwxXstugo' select the new permissions for the affected
|
||||
users: read (r), write (w), execute (or access for directories) (x),
|
||||
execute only if the file is a directory or already has execute
|
||||
permission for some user (X), set user or group ID on execution (s),
|
||||
save program text on swap device (t), the permissions that the user
|
||||
who owns the file currently has for it (u), the permissions that other
|
||||
users in the file's group have for it (g), and the permissions that
|
||||
other users not in the file's group have for it (o).
|
||||
.PP
|
||||
A numeric mode is from one to four octal digits (0-7), derived by
|
||||
adding up the bits with values 4, 2, and 1. Any omitted digits are
|
||||
assumed to be leading zeros. The first digit selects the set user ID
|
||||
(4) and set group ID (2) and save text image (1) attributes. The
|
||||
second digit selects permissions for the user who owns the file: read
|
||||
(4), write (2), and execute (1); the third selects permissions for
|
||||
other users in the file's group, with the same values; and the fourth
|
||||
for other users not in the file's group, with the same values.
|
||||
.PP
|
||||
.B chmod
|
||||
never changes the permissions of symbolic links; the
|
||||
.B chmod
|
||||
system call cannot change their permissions. This is not a problem
|
||||
since the permissions of symbolic links are never used.
|
||||
However, for each symbolic link listed on the command line,
|
||||
.B chmod
|
||||
changes the permissions of the pointed-to file.
|
||||
In contrast,
|
||||
.B chmod
|
||||
ignores symbolic links encountered during recursive directory
|
||||
traversals.
|
||||
.SH OPTIONS
|
||||
20
man/chown.x
Normal file
20
man/chown.x
Normal file
@@ -0,0 +1,20 @@
|
||||
[DESCRIPTION]
|
||||
This manual page
|
||||
documents the GNU version of
|
||||
.BR chown .
|
||||
.B chown
|
||||
changes the user and/or group ownership of each given file, according
|
||||
to its first non-option argument, which is interpreted as follows. If
|
||||
only a user name (or numeric user ID) is given, that user is made the
|
||||
owner of each given file, and the files' group is not changed. If the
|
||||
user name is followed by a colon or dot and a group name (or numeric group ID),
|
||||
with no spaces between them, the group ownership of the files is
|
||||
changed as well. If a colon or dot but no group name follows the user name,
|
||||
that user is made the owner of the files and the group of the files is
|
||||
changed to that user's login group. If the colon or dot and group are given,
|
||||
but the user name is omitted, only the group of the files is changed;
|
||||
in this case,
|
||||
.B chown
|
||||
performs the same function as
|
||||
.BR chgrp .
|
||||
.Sh OPTIONS
|
||||
2
man/chroot.x
Normal file
2
man/chroot.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/cksum.x
Normal file
2
man/cksum.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/comm.x
Normal file
2
man/comm.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
18
man/cp.x
Normal file
18
man/cp.x
Normal file
@@ -0,0 +1,18 @@
|
||||
.\" Copyright (C) 1994, 95, 96, 97 Free Software Foundation, Inc.
|
||||
.\"
|
||||
.\" Permission is granted to make and distribute verbatim copies of this
|
||||
.\" manual provided the copyright notice and this permission notice are
|
||||
.\" preserved on all copies.
|
||||
.\"
|
||||
.\" Permission is granted to copy and distribute modified versions of
|
||||
.\" this manual under the conditions for verbatim copying, provided that
|
||||
.\" the entire resulting derived work is distributed under the terms of a
|
||||
.\" permission notice identical to this one.
|
||||
.\"
|
||||
.\" Permission is granted to copy and distribute translations of this
|
||||
.\" manual into another language, under the above conditions for modified
|
||||
.\" versions, except that this permission notice may be stated in a
|
||||
.\" translation approved by the Foundation.
|
||||
.\"
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/csplit.x
Normal file
2
man/csplit.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/cut.x
Normal file
2
man/cut.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/date.x
Normal file
2
man/date.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/dd.x
Normal file
2
man/dd.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
39
man/df.x
Normal file
39
man/df.x
Normal file
@@ -0,0 +1,39 @@
|
||||
.\" Copyright (C) 1994, 95, 96, 97, 98 Free Software Foundation, Inc.
|
||||
.\"
|
||||
.\" Permission is granted to make and distribute verbatim copies of this
|
||||
.\" manual provided the copyright notice and this permission notice are
|
||||
.\" preserved on all copies.
|
||||
.\"
|
||||
.\" Permission is granted to copy and distribute modified versions of
|
||||
.\" this manual under the conditions for verbatim copying, provided that
|
||||
.\" the entire resulting derived work is distributed under the terms of a
|
||||
.\" permission notice identical to this one.
|
||||
.\"
|
||||
.\" Permission is granted to copy and distribute translations of this
|
||||
.\" manual into another language, under the above conditions for modified
|
||||
.\" versions, except that this permission notice may be stated in a
|
||||
.\" translation approved by the Foundation.
|
||||
.\"
|
||||
[DESCRIPTION]
|
||||
This manual page
|
||||
documents the GNU version of
|
||||
.BR df .
|
||||
.B df
|
||||
displays the amount of disk space available on the filesystem
|
||||
containing each file name argument. If no file name is given, the
|
||||
space available on all currently mounted filesystems is shown. Disk
|
||||
space is shown in 1K blocks by default, unless the environment
|
||||
variable POSIXLY_CORRECT is set, in which case 512-byte blocks are
|
||||
used.
|
||||
.PP
|
||||
If an argument is the absolute file name of a disk device node containing a
|
||||
mounted filesystem,
|
||||
.B df
|
||||
shows the space available on that filesystem rather than on the
|
||||
filesystem containing the device node (which is always the root
|
||||
filesystem). This version of
|
||||
.B df
|
||||
cannot show the space available on unmounted filesystems, because on
|
||||
most kinds of systems doing so requires very nonportable intimate
|
||||
knowledge of filesystem structures.
|
||||
.SH OPTIONS
|
||||
2
man/dir.x
Normal file
2
man/dir.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/dircolors.x
Normal file
2
man/dircolors.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
2
man/dirname.x
Normal file
2
man/dirname.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/du.x
Normal file
2
man/du.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
2
man/echo.x
Normal file
2
man/echo.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/env.x
Normal file
2
man/env.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/expand.x
Normal file
2
man/expand.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/expr.x
Normal file
2
man/expr.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/false.x
Normal file
2
man/false.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/fmt.x
Normal file
2
man/fmt.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/fold.x
Normal file
2
man/fold.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/groups.x
Normal file
2
man/groups.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/head.x
Normal file
2
man/head.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
373
man/help2man
Executable file
373
man/help2man
Executable file
@@ -0,0 +1,373 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
# Generate a short man page from --help and --version output.
|
||||
# Copyright © 1997, 98 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 Brendan O'Dea <bod@compusol.com.au>
|
||||
# and François Pinard <pinard@IRO.UMontreal.CA>
|
||||
|
||||
require 5.003;
|
||||
|
||||
use strict;
|
||||
use Getopt::Long;
|
||||
use POSIX 'strftime';
|
||||
|
||||
my $RCS_Id = '$Id: help2man,v 1.3 1998/10/06 04:07:25 meyering Exp $';
|
||||
my $this_program = 'help2man';
|
||||
my $this_version = '0.0';
|
||||
|
||||
if ($RCS_Id =~ /\$Id:\s+(\S+)\s+(\S+)/)
|
||||
{
|
||||
$this_version = $2;
|
||||
($this_program = $1) =~ s/(\.\w+)?,v$//;
|
||||
}
|
||||
|
||||
my $version_info = <<EOT;
|
||||
$this_program $this_version
|
||||
|
||||
Copyright (C) 1997, 98 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
EOT
|
||||
|
||||
my $help_info = <<EOT;
|
||||
`$this_program' generates a man page out of `--help' and `--version' output.
|
||||
|
||||
Usage: $this_program [OPTION]... EXECUTABLE
|
||||
|
||||
--name=STRING use `STRING' as the description for the NAME paragraph
|
||||
--include=FILE include material from `FILE'
|
||||
--opt-include=FILE include material from `FILE' if it exists
|
||||
--output=FILE send output to `FILE'
|
||||
--help print this help, then exit
|
||||
--version print $this_program program version number, then exit
|
||||
|
||||
EXECUTABLE should accept `--help' and `version' options.
|
||||
EOT
|
||||
|
||||
my ($include, $opt_name, $opt_include, $opt_output, $opt_help,
|
||||
$opt_version);
|
||||
|
||||
# Parse options.
|
||||
GetOptions (
|
||||
'name=s' => \$opt_name,
|
||||
'include=s' => \$include,
|
||||
'opt-include=s' => \$opt_include,
|
||||
'output=s' => \$opt_output,
|
||||
help => sub { print $help_info; exit },
|
||||
version => sub { print $version_info; exit },
|
||||
) or die $help_info;
|
||||
|
||||
die $help_info unless @ARGV == 1;
|
||||
|
||||
my %include = ();
|
||||
my @include = (); # to retain order
|
||||
|
||||
# Process include file (if given). Format is:
|
||||
#
|
||||
# [section name]
|
||||
# verbatim text
|
||||
|
||||
if ($include or $opt_include)
|
||||
{
|
||||
if (open INC, $include || $opt_include)
|
||||
{
|
||||
my $sect;
|
||||
|
||||
while (<INC>)
|
||||
{
|
||||
if (/^\[([^]]+)\]/)
|
||||
{
|
||||
$sect = uc $1;
|
||||
$sect =~ s/^\s+//;
|
||||
$sect =~ s/\s+$//;
|
||||
next;
|
||||
}
|
||||
|
||||
# Silently ignore anything before the first
|
||||
# section--allows for comments and revision info.
|
||||
next unless $sect;
|
||||
|
||||
push @include, $sect unless $include{$sect};
|
||||
$include{$sect} ||= '';
|
||||
$include{$sect} .= $_;
|
||||
}
|
||||
|
||||
close INC;
|
||||
|
||||
die "$this_program: no valid information found in `$include'\n"
|
||||
unless %include;
|
||||
|
||||
# Compress trailing blank lines
|
||||
for (keys %include)
|
||||
{
|
||||
$include{$_} =~ s/\n+$//;
|
||||
$include{$_} .= "\n" unless /^NAME$/;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
die "$this_program: can't open `$include' ($!)\n" if $include;
|
||||
}
|
||||
}
|
||||
|
||||
# Turn off localisation of executable's ouput.
|
||||
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
|
||||
|
||||
# Grab help and version paragraphs from executable
|
||||
my @help = split /\n\n+/, `$ARGV[0] --help 2>/dev/null`
|
||||
or die "$this_program: can't get `--help' info from $ARGV[0]\n";
|
||||
|
||||
my @version = split /\n\n+/, `$ARGV[0] --version 2>/dev/null`
|
||||
or die "$this_program: can't get `--version' info from $ARGV[0]\n";
|
||||
|
||||
my $date = strftime "%B %Y", localtime;
|
||||
(my $program = $ARGV[0]) =~ s!.*/!!;
|
||||
my $package = $program;
|
||||
my $version;
|
||||
|
||||
if ($opt_output)
|
||||
{
|
||||
unlink $opt_output
|
||||
or die "$this_program: can't unlink $opt_output ($!)\n"
|
||||
if -e $opt_output;
|
||||
|
||||
open STDOUT, ">$opt_output"
|
||||
or die "$this_program: can't create $opt_output ($!)\n";
|
||||
}
|
||||
|
||||
# The first line of the --version information is assumed to be in one
|
||||
# of the following formats:
|
||||
#
|
||||
# <version>
|
||||
# <program> <version>
|
||||
# GNU <program> <version>
|
||||
# <program> (GNU <package>) <version>
|
||||
# <program> - GNU <package> <version>
|
||||
#
|
||||
# and seperated from any copyright/author details by a blank line.
|
||||
|
||||
$_ = shift @version;
|
||||
|
||||
if (/^(\S+)\s+\((GNU\s+[^)]+)\)\s+(.*)/ or
|
||||
/^(\S+)\s+-\s*(GNU\s+\S+)\s+(.*)/)
|
||||
{
|
||||
$program = $1;
|
||||
$package = $2;
|
||||
$version = $3;
|
||||
}
|
||||
elsif (/^(GNU\s+)?(\S+)\s+(.*)/)
|
||||
{
|
||||
$program = $2;
|
||||
$package = $1 ? "$1$2" : $2;
|
||||
$version = $3;
|
||||
}
|
||||
else
|
||||
{
|
||||
$version = $_;
|
||||
}
|
||||
|
||||
$program =~ s!.*/!!;
|
||||
|
||||
# --name overrides --include contents
|
||||
$include{NAME} = "$program \\- $opt_name" if $opt_name;
|
||||
|
||||
# Default (useless) NAME paragraph
|
||||
$include{NAME} ||= "$program \\- manual page for $program $version";
|
||||
|
||||
# Man pages traditionally have the page title in caps.
|
||||
my $PROGRAM = uc $program;
|
||||
|
||||
# Header.
|
||||
print <<EOT;
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by $this_program $this_version.
|
||||
.TH $PROGRAM 1 "$date" "$package $version" "FSF"
|
||||
.SH NAME
|
||||
$include{NAME}
|
||||
EOT
|
||||
|
||||
my $accumulate = 1;
|
||||
my @description = ();
|
||||
|
||||
sub convert_option;
|
||||
|
||||
# Output converted --help information.
|
||||
for (@help)
|
||||
{
|
||||
chomp;
|
||||
|
||||
if (s/^Usage:\s+\S+\s+(.*)\n?//)
|
||||
{
|
||||
# Turn the usage clause into a synopsis.
|
||||
my $synopsis = '';
|
||||
|
||||
do {
|
||||
my $syn = $1;
|
||||
$syn =~ s/(([][]|\.\.+)+)/\\fR$1\\fI/g;
|
||||
$syn =~ s/^/\\fI/ unless $syn =~ s/^\\fR//;
|
||||
$syn .= '\fR';
|
||||
$syn =~ s/\\fI(\s*)\\fR/$1/g;
|
||||
|
||||
$synopsis .= ".br\n" unless $accumulate;
|
||||
$synopsis .= ".B $program\n";
|
||||
$synopsis .= "$syn\n";
|
||||
$accumulate = 0;
|
||||
} while s/^(?:Usage|\s*or):\s+\S+\s+(.*)\n?//;
|
||||
|
||||
# Include file overrides SYNOPSIS
|
||||
print ".SH SYNOPSIS\n", $include{SYNOPSIS} || $synopsis;
|
||||
|
||||
# Dump any accumulated description text.
|
||||
print ".SH DESCRIPTION\n";
|
||||
print @description;
|
||||
|
||||
# Add additional description text from include file
|
||||
if ($include{DESCRIPTION})
|
||||
{
|
||||
print ".PP\n" unless $include{DESCRIPTION} =~ /^\..P/;
|
||||
print $include{DESCRIPTION};
|
||||
}
|
||||
|
||||
next unless $_;
|
||||
}
|
||||
|
||||
# Accumulate text if the synopsis has not been produced yet.
|
||||
if ($accumulate)
|
||||
{
|
||||
push @description, ".PP\n" if @description;
|
||||
push @description, "$_\n";
|
||||
next;
|
||||
}
|
||||
|
||||
# Catch start of options.
|
||||
if (/^Options:/)
|
||||
{
|
||||
print qq(.SH OPTIONS\n);
|
||||
s/Options://;
|
||||
}
|
||||
|
||||
# Catch bug report text.
|
||||
if (/^Report bugs |^Email bug reports to /)
|
||||
{
|
||||
print qq(.SH "REPORTING BUGS"\n$_\n);
|
||||
next;
|
||||
}
|
||||
|
||||
# Special case for tar 1.12: --label=NAME\nPATTERN.
|
||||
s{(\n[ \t]*)(-V,[ \t]+--label=NAME.*)\n[ \t]+PATTERN[ \t]+}
|
||||
{$1$2$1\\&...=PATTERN };
|
||||
|
||||
# Convert options.
|
||||
s/(\s)(-[][\w=-]+|\\&\S+)/$1 . convert_option $2/ge;
|
||||
|
||||
# Option subsections have second line indented.
|
||||
print qq(.SS "$1"\n) if s/^(\S.*)\n(\s)/$2/;
|
||||
|
||||
# Lines indented more than about 10 spaces may be assumed to be
|
||||
# continuations of the previous line.
|
||||
s/\n {10,}/ /g;
|
||||
|
||||
# Lines following dotted (*) or numbered points may also be
|
||||
# continued if indented to the same level as the text following
|
||||
# the point.
|
||||
1 while s{((?:^|\n)(\s+)(?:[1-9][.)]|\*)(\s+)(?:[^\n]+))\n\2 \3(\S)}
|
||||
{$1 $4}g;
|
||||
|
||||
# Indented paragraph.
|
||||
if (/^\s/)
|
||||
{
|
||||
for (split /\n/)
|
||||
{
|
||||
s/^\s+//;
|
||||
s/([^,])\s+/$1\n/;
|
||||
print ".TP\n$_\n" if $_;
|
||||
}
|
||||
}
|
||||
# Anything else.
|
||||
else
|
||||
{
|
||||
print ".PP\n$_\n";
|
||||
}
|
||||
}
|
||||
|
||||
# Print any include items other than the ones we have already dealt
|
||||
# with.
|
||||
for (@include)
|
||||
{
|
||||
print qq(.SH "$_"\n$include{$_})
|
||||
unless /^(NAME|SYNOPSIS|DESCRIPTION|SEE ALSO)$/;
|
||||
}
|
||||
|
||||
# Refer to the real documentation.
|
||||
if ($include{'SEE ALSO'} or $program ne 'info')
|
||||
{
|
||||
print qq(.SH "SEE ALSO"\n);
|
||||
print $include{'SEE ALSO'}, ".PP\n" if $include{'SEE ALSO'};
|
||||
|
||||
print <<EOT unless $program eq 'info';
|
||||
The full documentation for
|
||||
.B $program
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B $program
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info $program
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
EOT
|
||||
}
|
||||
|
||||
# Output converted --version information.
|
||||
for (@version)
|
||||
{
|
||||
chomp;
|
||||
|
||||
# Convert copyright symbol or (c) to nroff character
|
||||
s/Copyright\s+(?:\xa9|\([Cc]\))/Copyright \\(co/g;
|
||||
|
||||
# Insert appropriate headings for copyright and author
|
||||
if (/^Copyright\s\\/) { print ".SH COPYRIGHT\n" }
|
||||
elsif (/^Written\s+by/) { print ".SH AUTHOR\n" }
|
||||
else { print ".PP\n"; }
|
||||
|
||||
# Insert line breaks before additional copyright messages and the
|
||||
# disclaimer
|
||||
s/(.)\n(Copyright\s|This is free software)/$1\n.br\n$2/g;
|
||||
|
||||
print "$_\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
# Convert option dashes to \- to stop nroff from hyphenating 'em, and
|
||||
# embolden. Option arguments get italicised.
|
||||
sub convert_option
|
||||
{
|
||||
my $option = '\fB' . shift;
|
||||
|
||||
$option =~ s/-/\\-/g;
|
||||
unless ($option =~ s/\[=(.*)\]$/\\fR[=\\fI$1\\fR]/)
|
||||
{
|
||||
$option =~ s/=(.)/\\fR=\\fI$1/;
|
||||
$option =~ s/ (.)/ \\fI$1/;
|
||||
$option .= '\fR';
|
||||
}
|
||||
|
||||
$option;
|
||||
}
|
||||
2
man/hostid.x
Normal file
2
man/hostid.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/hostname.x
Normal file
2
man/hostname.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/id.x
Normal file
2
man/id.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/join.x
Normal file
2
man/join.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/ln.x
Normal file
2
man/ln.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
2
man/logname.x
Normal file
2
man/logname.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/ls.x
Normal file
2
man/ls.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
2
man/md5sum.x
Normal file
2
man/md5sum.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/mkdir.x
Normal file
2
man/mkdir.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
2
man/mkfifo.x
Normal file
2
man/mkfifo.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
2
man/mknod.x
Normal file
2
man/mknod.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
2
man/mv.x
Normal file
2
man/mv.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
2
man/nice.x
Normal file
2
man/nice.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/nl.x
Normal file
2
man/nl.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/nohup.x
Normal file
2
man/nohup.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
2
man/od.x
Normal file
2
man/od.x
Normal file
@@ -0,0 +1,2 @@
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user