mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
356 Commits
FILEUTILS-
...
FILEUTILS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c726bc5709 | ||
|
|
585b65b676 | ||
|
|
b815641481 | ||
|
|
84d222f735 | ||
|
|
001e1b4302 | ||
|
|
dd2934197b | ||
|
|
ad174925d9 | ||
|
|
2aacc55e9b | ||
|
|
6f050de759 | ||
|
|
45d32cef80 | ||
|
|
3f51edcdec | ||
|
|
59c9c4036b | ||
|
|
ef2860263b | ||
|
|
d6b76c3f75 | ||
|
|
efa242bee1 | ||
|
|
8ea818e214 | ||
|
|
9bd57c9f22 | ||
|
|
0d457a6aee | ||
|
|
2722883a87 | ||
|
|
8105878c15 | ||
|
|
231c5aec0f | ||
|
|
e4e242e839 | ||
|
|
da8b83f81a | ||
|
|
df610e05ba | ||
|
|
9dab634c13 | ||
|
|
e5154f74b1 | ||
|
|
67786e0fb6 | ||
|
|
c84011e059 | ||
|
|
e36f49348b | ||
|
|
e786c1a0eb | ||
|
|
c057d35836 | ||
|
|
d9b628359a | ||
|
|
29b1eab1af | ||
|
|
9abd463ffb | ||
|
|
b54c86e8bc | ||
|
|
b885f7cbca | ||
|
|
7006d5fed6 | ||
|
|
976664803c | ||
|
|
3fdd4e6cd2 | ||
|
|
42755ceb62 | ||
|
|
8f03befb52 | ||
|
|
78af2f9732 | ||
|
|
88b4a9a940 | ||
|
|
045ebed00c | ||
|
|
24a7456cc0 | ||
|
|
b17e1af41c | ||
|
|
349b13e33a | ||
|
|
7b1d31a9b1 | ||
|
|
085866c1a3 | ||
|
|
4f75855c2e | ||
|
|
d649910685 | ||
|
|
e3e1698c6b | ||
|
|
b49e060cda | ||
|
|
e769659852 | ||
|
|
33d7cba8a7 | ||
|
|
65b2d6c97e | ||
|
|
2f3c1a3561 | ||
|
|
d8b68fc0c5 | ||
|
|
06ffb13ff0 | ||
|
|
3e62291a3c | ||
|
|
10972f68e8 | ||
|
|
15aac9a45d | ||
|
|
43fd950ef9 | ||
|
|
6c4002b2b5 | ||
|
|
816ee7dc0d | ||
|
|
916c762152 | ||
|
|
0d7fe8a4de | ||
|
|
841c6fbfe0 | ||
|
|
859bfc78b1 | ||
|
|
21ae3d911c | ||
|
|
4520ff31e2 | ||
|
|
92ce634177 | ||
|
|
6d89cf5f12 | ||
|
|
83a4462018 | ||
|
|
2b416bd83e | ||
|
|
96ab6a541a | ||
|
|
571a29d870 | ||
|
|
20f1f8b063 | ||
|
|
4e1e8c600d | ||
|
|
d816bb4f14 | ||
|
|
ce60ef7400 | ||
|
|
6e98d78fd4 | ||
|
|
2c5862c808 | ||
|
|
268db2760a | ||
|
|
0062e8f915 | ||
|
|
057743741f | ||
|
|
3f2774c8b4 | ||
|
|
3e0c559579 | ||
|
|
e7d6615b76 | ||
|
|
91df5bbc48 | ||
|
|
4cc5661b42 | ||
|
|
19a98e3edc | ||
|
|
50e17793c8 | ||
|
|
8a0a50e6b0 | ||
|
|
a42054dd57 | ||
|
|
24da56f990 | ||
|
|
d8e6937773 | ||
|
|
e1b2b2337d | ||
|
|
60c77b6c28 | ||
|
|
c7b3d3e91b | ||
|
|
60c1207b74 | ||
|
|
d344aaa129 | ||
|
|
83c2cfa04d | ||
|
|
53c7a54a58 | ||
|
|
e81bcd87cb | ||
|
|
10d98345b4 | ||
|
|
e17b601d5e | ||
|
|
f5d8ee465e | ||
|
|
51c06c49cf | ||
|
|
bbf4d37373 | ||
|
|
9bb85624cf | ||
|
|
9b5402ec48 | ||
|
|
77728e4f4b | ||
|
|
9db889c372 | ||
|
|
caace05438 | ||
|
|
cd7f8d6e9b | ||
|
|
bf598c02ba | ||
|
|
3954a4f441 | ||
|
|
506343b223 | ||
|
|
2f8dc98340 | ||
|
|
d015aad1f2 | ||
|
|
a99c3df843 | ||
|
|
e78bc7655d | ||
|
|
a519a07f25 | ||
|
|
02efcd60ed | ||
|
|
39e2377300 | ||
|
|
cda5bf9db9 | ||
|
|
27c8d53a3a | ||
|
|
3e7e7d0792 | ||
|
|
a5b0ca6f24 | ||
|
|
1f62fd20a3 | ||
|
|
254fc64f64 | ||
|
|
9dc7d5d2ae | ||
|
|
45af919ce6 | ||
|
|
89c9e683a3 | ||
|
|
d20d0fc27d | ||
|
|
5b7e895b65 | ||
|
|
2e97d27586 | ||
|
|
a155c3d684 | ||
|
|
3489f267a4 | ||
|
|
3fc7024e49 | ||
|
|
30b522371a | ||
|
|
88013e3cb4 | ||
|
|
7c8a2cdacf | ||
|
|
876f399d50 | ||
|
|
05ffec210e | ||
|
|
163f7f9c20 | ||
|
|
8fbf79b4e0 | ||
|
|
08b5c3046c | ||
|
|
551b879bf1 | ||
|
|
bd1eee0315 | ||
|
|
72f7eb4e63 | ||
|
|
fef313b2b0 | ||
|
|
464e2ce05d | ||
|
|
a48999494d | ||
|
|
d5d061ee9b | ||
|
|
b44e91e99d | ||
|
|
ce3668f3c1 | ||
|
|
44fa09dc5e | ||
|
|
808b938840 | ||
|
|
83d4d74a88 | ||
|
|
0d38a270a4 | ||
|
|
3f017c26ca | ||
|
|
4c946943ea | ||
|
|
7dd872d963 | ||
|
|
b7d50ca523 | ||
|
|
fe18d63a65 | ||
|
|
6668e39160 | ||
|
|
d738449858 | ||
|
|
7254d243f2 | ||
|
|
91da5cedc7 | ||
|
|
1187f5eb7f | ||
|
|
5bcc1fd7fd | ||
|
|
e4c9ae3c6b | ||
|
|
d1121fa4c0 | ||
|
|
713c315978 | ||
|
|
8cc46c2a18 | ||
|
|
518f85fc40 | ||
|
|
48990a9078 | ||
|
|
69a3ee0b49 | ||
|
|
8ed3137f52 | ||
|
|
d4257e63c7 | ||
|
|
7154d646cb | ||
|
|
b388203a65 | ||
|
|
66c7b3c41d | ||
|
|
ac7b3c4fa9 | ||
|
|
b402870080 | ||
|
|
1cbe202b0a | ||
|
|
d618576e0e | ||
|
|
51fe35760e | ||
|
|
8bbe8ab5d4 | ||
|
|
ba51843a2c | ||
|
|
397d9be228 | ||
|
|
dddfcab3b3 | ||
|
|
00ea94587f | ||
|
|
49875c1593 | ||
|
|
7b9c4d3d03 | ||
|
|
3783d6be57 | ||
|
|
632ebfa209 | ||
|
|
29cc8bf4f3 | ||
|
|
50892edd61 | ||
|
|
72193ba149 | ||
|
|
854b5197ad | ||
|
|
d90641d9d8 | ||
|
|
300be5a250 | ||
|
|
3911fadcf9 | ||
|
|
382ca69cec | ||
|
|
9fc10dc6c3 | ||
|
|
f0a8ebf596 | ||
|
|
53c085b7e5 | ||
|
|
faa759b349 | ||
|
|
398e92a2ec | ||
|
|
3483943ebc | ||
|
|
108b074aea | ||
|
|
19fcb4356c | ||
|
|
c4b7f217a5 | ||
|
|
cb04f85936 | ||
|
|
902bbe7707 | ||
|
|
c9a9ec9b53 | ||
|
|
840a08ccde | ||
|
|
5fbcd963df | ||
|
|
953c42bd52 | ||
|
|
765122f558 | ||
|
|
e46a424ce9 | ||
|
|
095c92bc46 | ||
|
|
7957dcc00a | ||
|
|
108f8f2d04 | ||
|
|
39463d50ed | ||
|
|
4a46351e06 | ||
|
|
8aca15bac0 | ||
|
|
1ddffff8c0 | ||
|
|
e7683a577a | ||
|
|
3063e56f2e | ||
|
|
eb3a4daa24 | ||
|
|
b6844f1931 | ||
|
|
a636450727 | ||
|
|
6456a7d8ac | ||
|
|
a57d5061ff | ||
|
|
45e8e5c550 | ||
|
|
69412999dc | ||
|
|
85b39cb589 | ||
|
|
9f358e6830 | ||
|
|
defb2bdef8 | ||
|
|
6e577f0b56 | ||
|
|
c157e5fbef | ||
|
|
ca6cf35a5e | ||
|
|
ede420f14a | ||
|
|
52a2ff839c | ||
|
|
821a0823b1 | ||
|
|
e52d8736b1 | ||
|
|
5c0ee776d4 | ||
|
|
465ebf7c37 | ||
|
|
18ad404d02 | ||
|
|
28cb02fc78 | ||
|
|
cbf0181378 | ||
|
|
bca2db9877 | ||
|
|
aa71be25c0 | ||
|
|
cd053a291e | ||
|
|
fa4148be50 | ||
|
|
5695f8ea2d | ||
|
|
18d159d47e | ||
|
|
0bb2acd9da | ||
|
|
7a8b4afa3e | ||
|
|
3a0352ad9a | ||
|
|
55569d4f9f | ||
|
|
eeef5c523d | ||
|
|
e8ab1c28f8 | ||
|
|
df4ba7d9ca | ||
|
|
e832812173 | ||
|
|
ac648dbc8a | ||
|
|
c75ccba2d3 | ||
|
|
a33adfebb2 | ||
|
|
b50b941826 | ||
|
|
6ec5bace8a | ||
|
|
b48e78e3b7 | ||
|
|
33179975d7 | ||
|
|
d4a8891aef | ||
|
|
fcbfefa513 | ||
|
|
fcf6405f2d | ||
|
|
0ecb6ace02 | ||
|
|
6d42c7e9d7 | ||
|
|
6684ffa826 | ||
|
|
bfbc3ce20c | ||
|
|
0f5f23cb9e | ||
|
|
93494dde07 | ||
|
|
be3b9520ad | ||
|
|
c2c6f081c5 | ||
|
|
36b10d9f21 | ||
|
|
72c0980585 | ||
|
|
58647fd63d | ||
|
|
6eb5e899e1 | ||
|
|
a01c762a81 | ||
|
|
c29025e6ed | ||
|
|
b3582e7533 | ||
|
|
12f49aa1ae | ||
|
|
f31f7e1c75 | ||
|
|
d34d42ca05 | ||
|
|
6974d67aa2 | ||
|
|
85d9447441 | ||
|
|
45c381f4ba | ||
|
|
184c0062a4 | ||
|
|
7024c7d55c | ||
|
|
d84a21ea2d | ||
|
|
2f6fa9d160 | ||
|
|
4ac374c8e5 | ||
|
|
17070ae7bf | ||
|
|
a1cc8f5961 | ||
|
|
27caa20d7b | ||
|
|
757555a4dc | ||
|
|
ada5e63612 | ||
|
|
a8d20df6b2 | ||
|
|
4a28ea9bd6 | ||
|
|
e4a1ead494 | ||
|
|
ad1a2f76ce | ||
|
|
a7a6111f81 | ||
|
|
7c579a0231 | ||
|
|
6630a24b7a | ||
|
|
6429ffabbb | ||
|
|
e558629ce1 | ||
|
|
fefa8511b8 | ||
|
|
347db9ce77 | ||
|
|
92da57a7be | ||
|
|
4078ae8de8 | ||
|
|
3086193091 | ||
|
|
823425b310 | ||
|
|
e03fc9bc82 | ||
|
|
64379c5cd8 | ||
|
|
d4825df6cf | ||
|
|
cb3b5ed486 | ||
|
|
7ee8ed7e37 | ||
|
|
a991132f3e | ||
|
|
7f0867df00 | ||
|
|
6354d07ea0 | ||
|
|
3216105fbb | ||
|
|
8d5c4784b8 | ||
|
|
ec47f73107 | ||
|
|
94cd0c09f6 | ||
|
|
db3440d444 | ||
|
|
e8bec0725e | ||
|
|
8598c54bb1 | ||
|
|
e457645eac | ||
|
|
a14303dbc9 | ||
|
|
84ad5c47c8 | ||
|
|
998b3a148c | ||
|
|
71ee764f1e | ||
|
|
07a6f7a9e2 | ||
|
|
0f5ca22215 | ||
|
|
fc50286759 | ||
|
|
0a1fd1d2ad | ||
|
|
7a04e95c62 | ||
|
|
938e7fe7ef | ||
|
|
d8ab75cedc | ||
|
|
650b182278 | ||
|
|
f31f7889fb | ||
|
|
b1f2e5a7fd | ||
|
|
34141257cf |
166
ABOUT-NLS
166
ABOUT-NLS
@@ -1,16 +1,16 @@
|
||||
Notes on the GNU Translation Project
|
||||
************************************
|
||||
Notes on the Free Translation Project
|
||||
*************************************
|
||||
|
||||
GNU is going international! The GNU Translation Project is a way to
|
||||
get maintainers, translators, and users all together, so that GNU will
|
||||
gradually become able to speak many languages. A few packages already
|
||||
provide translations for their messages.
|
||||
Free software is going international! The Free Translation Project
|
||||
is a way to get maintainers of free software, translators, and users all
|
||||
together, so that will gradually become able to speak many languages.
|
||||
A few packages already provide translations for their messages.
|
||||
|
||||
If you found this `ABOUT-NLS' file inside a GNU distribution, you
|
||||
may assume that the distributed package does use GNU `gettext'
|
||||
internally, itself available at your nearest GNU archive site. But you
|
||||
do *not* need to install GNU `gettext' prior to configuring, installing
|
||||
or using this package with messages translated.
|
||||
If you found this `ABOUT-NLS' file inside a distribution, you may
|
||||
assume that the distributed package does use GNU `gettext' internally,
|
||||
itself available at your nearest GNU archive site. But you do *not*
|
||||
need to install GNU `gettext' prior to configuring, installing or using
|
||||
this package with messages translated.
|
||||
|
||||
Installers will find here some useful hints. These notes also
|
||||
explain how users should proceed for getting the programs to use the
|
||||
@@ -31,19 +31,23 @@ should configure it using
|
||||
./configure --with-included-gettext
|
||||
|
||||
to force usage of internationalizing routines provided within this
|
||||
package, despite the existence of internationalizing capabilities in
|
||||
the operating system where this package is being installed. So far, no
|
||||
prior implementation provides as many useful features (such as locale
|
||||
alias or message inheritance). It is also not possible to offer this
|
||||
additional functionality on top of a `catgets' implementation. Future
|
||||
versions of GNU `gettext' will very likely convey even more
|
||||
functionality. So it might be a good idea to change to GNU `gettext'
|
||||
as soon as possible.
|
||||
package, despite the existence of internationalizing capabilities in the
|
||||
operating system where this package is being installed. So far, only
|
||||
the `gettext' implementation in the GNU C library version 2 provides as
|
||||
many features (such as locale alias or message inheritance) as the
|
||||
implementation here. It is also not possible to offer this additional
|
||||
functionality on top of a `catgets' implementation. Future versions of
|
||||
GNU `gettext' will very likely convey even more functionality. So it
|
||||
might be a good idea to change to GNU `gettext' as soon as possible.
|
||||
|
||||
So you need not provide this option if you are using GNU libc 2 or
|
||||
you have installed a recent copy of the GNU gettext package with the
|
||||
included `libintl'.
|
||||
|
||||
INSTALL Matters
|
||||
===============
|
||||
|
||||
Some GNU packages are "localizable" when properly installed; the
|
||||
Some packages are "localizable" when properly installed; the
|
||||
programs they contain can be made to speak your own native language.
|
||||
Most such packages use GNU `gettext'. Other packages have their own
|
||||
ways to internationalization, predating GNU `gettext'.
|
||||
@@ -113,37 +117,35 @@ shell prompt, merely execute `setenv LANG de' (in `csh'),
|
||||
can be done from your `.login' or `.profile' file, once and for all.
|
||||
|
||||
An operating system might already offer message localization for
|
||||
many of its programs, while other programs (whether GNU or not) have
|
||||
been installed locally with the full capabilities of GNU `gettext'.
|
||||
Just using `gettext' extended syntax for `LANG' would break proper
|
||||
localization of already available operating system programs. In this
|
||||
case, users should set both `LANGUAGE' and `LANG' variables in their
|
||||
environment, as programs using GNU `gettext' give preference to
|
||||
`LANGUAGE'. For example, some Swedish users would rather read
|
||||
translations in German than English for when Swedish is not available.
|
||||
This is easily accomplished by setting `LANGUAGE' to `sv:de' while
|
||||
leaving `LANG' to `sv'.
|
||||
many of its programs, while other programs have been installed locally
|
||||
with the full capabilities of GNU `gettext'. Just using `gettext'
|
||||
extended syntax for `LANG' would break proper localization of already
|
||||
available operating system programs. In this case, users should set
|
||||
both `LANGUAGE' and `LANG' variables in their environment, as programs
|
||||
using GNU `gettext' give preference to `LANGUAGE'. For example, some
|
||||
Swedish users would rather read translations in German than English for
|
||||
when Swedish is not available. This is easily accomplished by setting
|
||||
`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
|
||||
|
||||
Translating Teams
|
||||
=================
|
||||
|
||||
For the GNU Translation Project to be a success, we need interested
|
||||
For the Free Translation Project to be a success, we need interested
|
||||
people who like their own language and write it well, and who are also
|
||||
able to synergize with other translators speaking the same language.
|
||||
Each translation team has its own mailing list, courtesy of Linux
|
||||
International. You may reach your translation team at the address
|
||||
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
|
||||
language. Language codes are *not* the same as the country codes given
|
||||
in ISO 3166. The following translation teams exist, as of February
|
||||
in ISO 3166. The following translation teams exist, as of December
|
||||
1997:
|
||||
|
||||
Arabic `ar', Chinese `zh', Czech `cs', Danish `da', Dutch `nl',
|
||||
English `en', Esperanto `eo', Finnish `fi', French `fr', German
|
||||
`de', Greek `el', Hebrew `he', Hungarian `hu', Irish `ga', Italian
|
||||
`it', Indonesian `id', Japanese `ja', Korean `ko', Latin `la',
|
||||
Norwegian `no', Persian `fa', Polish `pl', Portuguese `pt',
|
||||
Russian `ru', Slovenian `sl', Spanish `es', Swedish `sv', Telugu
|
||||
`te', Turkish `tr' and Ukrainian `uk'.
|
||||
Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
|
||||
Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
|
||||
`hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
|
||||
Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
|
||||
`pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
|
||||
Swedish `sv', and Turkish `tr'.
|
||||
|
||||
For example, you may reach the Chinese translation team by writing to
|
||||
`zh@li.org'.
|
||||
@@ -160,55 +162,53 @@ message to `sv-request@li.org', having this message body:
|
||||
*actively* in translations, or at solving translational difficulties,
|
||||
rather than merely lurking around. If your team does not exist yet and
|
||||
you want to start one, or if you are unsure about what to do or how to
|
||||
get started, please write to `gnu-translation@gnu.ai.mit.edu' to reach
|
||||
the GNU coordinator for all translator teams.
|
||||
get started, please write to `translation@iro.umontreal.ca' to reach the
|
||||
coordinator for all translator teams.
|
||||
|
||||
The English team is special. It works at improving and uniformizing
|
||||
the terminology used in GNU. Proven linguistic skill are praised more
|
||||
than programming skill, here. For the time being, please avoid
|
||||
subscribing to the English team unless explicitly invited to do so.
|
||||
the terminology in use. Proven linguistic skill are praised more than
|
||||
programming skill, here.
|
||||
|
||||
Available Packages
|
||||
==================
|
||||
|
||||
Languages are not equally supported in all GNU packages. The
|
||||
following matrix shows the current state of GNU internationalization,
|
||||
as of February 1997. The matrix shows, in regard of each package, for
|
||||
which languages PO files have been submitted to translation
|
||||
coordination.
|
||||
Languages are not equally supported in all packages. The following
|
||||
matrix shows the current state of internationalization, as of December
|
||||
1997. The matrix shows, in regard of each package, for which languages
|
||||
PO files have been submitted to translation coordination.
|
||||
|
||||
Ready PO files cs de en es fi fr ja ko nl no pl pt sl sv
|
||||
.-------------------------------------------.
|
||||
bash | [] [] [] | 3
|
||||
bison | [] [] [] | 3
|
||||
clisp | [] [] [] | 3
|
||||
cpio | [] [] [] [] [] | 5
|
||||
diffutils | [] [] [] [] | 4
|
||||
enscript | [] [] [] [] [] | 5
|
||||
fileutils | [] [] [] [] [] [] [] [] | 8
|
||||
findutils | [] [] [] [] [] [] [] | 7
|
||||
flex | [] [] [] | 3
|
||||
gcal | [] [] [] | 3
|
||||
gettext | [] [] [] [] [] [] [] [] [] [] | 11
|
||||
grep | [] [] [] [] [] [] [] [] | 8
|
||||
hello | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
id-utils | [] [] | 2
|
||||
indent | [] [] | 2
|
||||
libc | [] [] [] [] [] [] [] | 7
|
||||
m4 | [] [] [] [] [] | 5
|
||||
make | [] [] [] [] [] [] | 6
|
||||
music | [] | 1
|
||||
ptx | [] [] [] [] [] [] [] [] | 8
|
||||
recode | [] [] [] [] [] [] [] [] | 8
|
||||
sh-utils | [] [] [] [] [] | 5
|
||||
sharutils | [] [] [] [] [] | 5
|
||||
tar | [] [] [] [] [] [] [] [] [] | 9
|
||||
texinfo | | 0
|
||||
textutils | [] [] [] [] [] [] | 6
|
||||
wdiff | [] [] [] [] [] [] [] [] | 8
|
||||
`-------------------------------------------'
|
||||
14 languages cs de en es fi fr ja ko nl no pl pt sl sv
|
||||
27 packages 1 22 1 14 1 25 1 10 20 7 14 7 7 15 145
|
||||
Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv
|
||||
.----------------------------------------------------.
|
||||
bash | [] [] [] | 3
|
||||
bison | [] [] [] | 3
|
||||
clisp | [] [] [] [] | 4
|
||||
cpio | [] [] [] [] [] [] | 6
|
||||
diffutils | [] [] [] [] [] | 5
|
||||
enscript | [] [] [] [] [] [] | 6
|
||||
fileutils | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
findutils | [] [] [] [] [] [] [] [] [] | 9
|
||||
flex | [] [] [] [] | 4
|
||||
gcal | [] [] [] [] [] | 5
|
||||
gettext | [] [] [] [] [] [] [] [] [] [] [] | 12
|
||||
grep | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
hello | [] [] [] [] [] [] [] [] [] [] [] | 11
|
||||
id-utils | [] [] [] | 3
|
||||
indent | [] [] [] [] [] | 5
|
||||
libc | [] [] [] [] [] [] [] | 7
|
||||
m4 | [] [] [] [] [] [] | 6
|
||||
make | [] [] [] [] [] [] | 6
|
||||
music | [] [] | 2
|
||||
ptx | [] [] [] [] [] [] [] [] | 8
|
||||
recode | [] [] [] [] [] [] [] [] [] | 9
|
||||
sh-utils | [] [] [] [] [] [] [] [] | 8
|
||||
sharutils | [] [] [] [] [] [] | 6
|
||||
tar | [] [] [] [] [] [] [] [] [] [] [] | 11
|
||||
texinfo | [] [] [] | 3
|
||||
textutils | [] [] [] [] [] [] [] [] [] | 9
|
||||
wdiff | [] [] [] [] [] [] [] [] | 8
|
||||
`----------------------------------------------------'
|
||||
17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv
|
||||
27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179
|
||||
|
||||
Some counters in the preceding matrix are higher than the number of
|
||||
visible blocks let us expect. This is because a few extra PO files are
|
||||
@@ -219,8 +219,8 @@ dialects.
|
||||
which it applies should also have been internationalized and
|
||||
distributed as such by its maintainer. There might be an observable
|
||||
lag between the mere existence a PO file and its wide availability in a
|
||||
GNU distribution.
|
||||
distribution.
|
||||
|
||||
If February 1997 seems to be old, you may fetch a more recent copy
|
||||
If December 1997 seems to be old, you may fetch a more recent copy
|
||||
of this `ABOUT-NLS' file on most GNU archive sites.
|
||||
|
||||
|
||||
20
GNUmakefile
20
GNUmakefile
@@ -1,7 +1,23 @@
|
||||
# Having a separate GNUmakefile lets me `include' the dynamically
|
||||
# generated rules created via Makefile.maint as well as Makefile.maint itself.
|
||||
# This makefile is used only if you run GNU Make.
|
||||
# It is necessary if you modify files in the m4/ directory or
|
||||
# want to build targets usually of interest only to the maintainer.
|
||||
# It is necessary if you want to build targets usually of interest
|
||||
# only to the maintainer.
|
||||
|
||||
have-Makefile := $(shell test -f Makefile && echo yes)
|
||||
|
||||
# If the user runs GNU make but has not yet run ./configure,
|
||||
# give them a diagnostic.
|
||||
ifeq ($(have-Makefile),yes)
|
||||
|
||||
include Makefile
|
||||
include $(srcdir)/Makefile.maint
|
||||
|
||||
else
|
||||
|
||||
all:
|
||||
@echo There seems to be no Makefile in this directory.
|
||||
@echo "You must run ./configure before running \`make'."
|
||||
@exit 1
|
||||
|
||||
endif
|
||||
|
||||
@@ -32,7 +32,7 @@ my-distcheck: dist
|
||||
mkdir $(t)
|
||||
GZIP=$(GZIP) $(TAR) -C $(t) -zxf $(distdir).tar.gz
|
||||
cd $(t)/$(distdir) \
|
||||
&& ./configure --disable-gettext \
|
||||
&& ./configure --disable-nls \
|
||||
&& $(MAKE) \
|
||||
&& $(MAKE) dvi \
|
||||
&& $(MAKE) check \
|
||||
@@ -42,21 +42,3 @@ my-distcheck: dist
|
||||
@echo "========================"; \
|
||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||
echo "========================"
|
||||
|
||||
acdir = m4
|
||||
aclocal-files: configure.in m4/Makefile.am
|
||||
echo "acfiles = \\" > $@-tmp
|
||||
(cd $(srcdir) && find $(acdir) -type f -name '*.m4' -print) \
|
||||
| sed 's!^!$(top_srcdir)/!' \
|
||||
| tr '\012' ' ' \
|
||||
| fmt \
|
||||
| sed -e 's/$$/ \\/' -e '$$s/..$$//' \
|
||||
>> $@-tmp
|
||||
echo >> $@-tmp
|
||||
mv $@-tmp $@
|
||||
|
||||
include aclocal-files
|
||||
|
||||
# Override default rule to use --acdir option
|
||||
$(srcdir)/aclocal.m4: configure.in $(acfiles)
|
||||
cd $(srcdir) && aclocal -I $(acdir)
|
||||
|
||||
3
THANKS
3
THANKS
@@ -8,9 +8,11 @@ Bauke Jan Douma: bjdouma@xs4all.nl
|
||||
Bengt Martensson: bengt@mathematik.uni-Bremen.de
|
||||
Bjorn Helgaas: helgaas@rsn.hp.com
|
||||
Charles Karney: karney@pppl.gov
|
||||
Dirk Lattermann: dlatt@t-online.de
|
||||
Eirik Fuller: eirik@netcom.com
|
||||
Eli Zaretskii: eliz@is.elta.co.il
|
||||
Emile LeBlanc: leblanc@math.toronto.edu
|
||||
François Pinard: pinard@iro.umontreal.ca
|
||||
Galen Hazelwood: galenh@micron.net
|
||||
Greg McGary: gkm@eng.ascend.com
|
||||
Hugh Daniel: hugh@xanadu.com
|
||||
@@ -20,6 +22,7 @@ Jesse Thilo: jgt2@eecs.lehigh.edu
|
||||
Joakim Rosqvist: dvljrt@cs.umu.se
|
||||
John Gatewood Ham: zappaman@alphabox.compsci.buu.ac.th
|
||||
Kjetil Torgrim Homme: kjetilho@ifi.uio.no
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Makefile.in generated automatically by automake 1.2d from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -32,6 +32,8 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
@@ -66,6 +68,7 @@ GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GT_NO = @GT_NO@
|
||||
GT_YES = @GT_YES@
|
||||
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
@@ -111,14 +114,14 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
default: all
|
||||
all: Makefile $(INFO_DEPS)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .dvi .info .ps .texi .texinfo
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -179,26 +182,40 @@ DVIPS = dvips
|
||||
.texinfo.dvi:
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.txi.info:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.txi.dvi:
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.txi:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
.dvi.ps:
|
||||
$(DVIPS) $< -o $@
|
||||
|
||||
install-info-am: $(INFO_DEPS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(infodir)
|
||||
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
||||
@for file in $(INFO_DEPS); do \
|
||||
d=$(srcdir); \
|
||||
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
|
||||
if test -f $$d/$$ifile; then \
|
||||
echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
|
||||
$(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
|
||||
echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
|
||||
$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
|
||||
else : ; fi; \
|
||||
done; \
|
||||
done
|
||||
@$(POST_INSTALL)
|
||||
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
|
||||
for file in $(INFO_DEPS); do \
|
||||
echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
|
||||
install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
|
||||
echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
|
||||
install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
|
||||
done; \
|
||||
else : ; fi
|
||||
|
||||
@@ -209,11 +226,11 @@ uninstall-info:
|
||||
else ii=; fi; \
|
||||
for file in $(INFO_DEPS); do \
|
||||
test -z "$ii" \
|
||||
|| install-info --info-dir=$(infodir) --remove $$file; \
|
||||
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
|
||||
done
|
||||
$(NORMAL_UNINSTALL)
|
||||
@$(NORMAL_UNINSTALL)
|
||||
for file in $(INFO_DEPS); do \
|
||||
(cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
|
||||
(cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
|
||||
done
|
||||
|
||||
dist-info: $(INFO_DEPS)
|
||||
@@ -281,12 +298,10 @@ install: install-exec install-data all
|
||||
|
||||
uninstall: uninstall-info
|
||||
|
||||
all: Makefile $(INFO_DEPS)
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(infodir)
|
||||
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
@@ -315,11 +330,11 @@ maintainer-clean: maintainer-clean-vti maintainer-clean-aminfo \
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default mostlyclean-vti distclean-vti clean-vti \
|
||||
maintainer-clean-vti install-info-am uninstall-info mostlyclean-aminfo \
|
||||
distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir info \
|
||||
dvi installcheck install-exec install-data install uninstall all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
.PHONY: mostlyclean-vti distclean-vti clean-vti maintainer-clean-vti \
|
||||
install-info-am uninstall-info mostlyclean-aminfo distclean-aminfo \
|
||||
clean-aminfo maintainer-clean-aminfo tags distdir info dvi installcheck \
|
||||
install-exec install-data install uninstall all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
|
||||
@@ -467,15 +467,15 @@ year.
|
||||
@cindex MacKenzie, David
|
||||
@cindex Meyering, Jim
|
||||
@code{getdate} was originally implemented by Steven M. Bellovin
|
||||
(@samp{smb@@research.att.com}) while at the University of North Carolina
|
||||
(@email{smb@@research.att.com}) while at the University of North Carolina
|
||||
at Chapel Hill. The code was later tweaked by a couple of people on
|
||||
Usenet, then completely overhauled by Rich $alz (@samp{rsalz@@bbn.com})
|
||||
and Jim Berets (@samp{jberets@@bbn.com}) in August, 1990. Various
|
||||
Usenet, then completely overhauled by Rich $alz (@email{rsalz@@bbn.com})
|
||||
and Jim Berets (@email{jberets@@bbn.com}) in August, 1990. Various
|
||||
revisions for the GNU system were made by David MacKenzie, Jim Meyering,
|
||||
and others.
|
||||
|
||||
@cindex Pinard, F.
|
||||
@cindex Berry, K.
|
||||
This chapter was originally produced by Fran@,{c}ois Pinard
|
||||
(@samp{pinard@@iro.umontreal.ca}) from the @file{getdate.y} source code,
|
||||
and then edited by K.@: Berry (@samp{kb@@cs.umb.edu}).
|
||||
(@email{pinard@@iro.umontreal.ca}) from the @file{getdate.y} source code,
|
||||
and then edited by K.@: Berry (@email{kb@@cs.umb.edu}).
|
||||
|
||||
@@ -1140,15 +1140,16 @@ The only options are a lone @samp{--help} or
|
||||
Synopses:
|
||||
|
||||
@example
|
||||
stty [@var{setting}]@dots{}
|
||||
stty [@var{option}] [@var{setting}]@dots{}
|
||||
stty [@var{option}]
|
||||
@end example
|
||||
|
||||
If given no arguments, @code{stty} prints the baud rate, line
|
||||
If given no line settings, @code{stty} prints the baud rate, line
|
||||
discipline number (on systems that support it), and line settings
|
||||
that have been changed from the values set by @samp{stty sane}.
|
||||
Mode reading and setting are performed on the tty line connected to
|
||||
standard input.
|
||||
By default, mode reading and setting are performed on the tty line
|
||||
connected to standard input, although this can be modified by the
|
||||
@samp{--file} option.
|
||||
|
||||
@code{stty} accepts many non-option arguments that change aspects of
|
||||
the terminal line operation, as described below.
|
||||
@@ -1160,7 +1161,19 @@ The program accepts the following options. Also see @ref{Common options}.
|
||||
@itemx --all
|
||||
@opindex -a
|
||||
@opindex --all
|
||||
Print all current settings in human-readable form.
|
||||
Print all current settings in human-readable form. This option may not
|
||||
be used in combination with any line settings.
|
||||
|
||||
@item -F @var{device}
|
||||
@itemx --file @var{device}
|
||||
@opindex -F
|
||||
@opindex --file
|
||||
Set the line opened by the filename specified in @var{device} instead of
|
||||
the tty line connected to standard input. This option is necessary
|
||||
because opening a POSIX tty requires use of the @code{O_NONDELAY} flag to
|
||||
prevent a POSIX tty from blocking until the carrier detect line is high if
|
||||
the @code{clocal} flag is not set. Hence, it is not always possible
|
||||
to allow the shell to open the device in the traditional manner.
|
||||
|
||||
@item -g
|
||||
@itemx --save
|
||||
@@ -1168,7 +1181,8 @@ Print all current settings in human-readable form.
|
||||
@opindex --save
|
||||
@cindex machine-readable @code{stty} output
|
||||
Print all current settings in a form that can be used as an argument to
|
||||
another @code{stty} command to restore the current settings.
|
||||
another @code{stty} command to restore the current settings. This option
|
||||
may not be used in combination with any line settings.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
455
doc/texinfo.tex
455
doc/texinfo.tex
@@ -1,32 +1,56 @@
|
||||
%% TeX macros to handle Texinfo files.
|
||||
%% $Id: texinfo.tex,v 1.16 1997/12/25 18:00:21 meyering Exp $
|
||||
|
||||
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
|
||||
% 94, 95, 96, 97 Free Software Foundation, Inc.
|
||||
|
||||
%This texinfo.tex file 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 texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write
|
||||
%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
%Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
%In other words, you are welcome to use, share and improve this program.
|
||||
%You are forbidden to forbid anyone else to use, share and improve
|
||||
%what you give them. Help stamp out software-hoarding!
|
||||
|
||||
|
||||
% Send bug reports to bug-texinfo@prep.ai.mit.edu.
|
||||
% Please include a *precise* test case in each bug report.
|
||||
% texinfo.tex -- TeX macros to handle Texinfo files.
|
||||
% $Id: texinfo.tex,v 1.17 1998/04/11 15:03:51 meyering Exp $
|
||||
%
|
||||
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
|
||||
% Free Software Foundation, Inc.
|
||||
%
|
||||
% This texinfo.tex file 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 texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write
|
||||
% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
% Boston, MA 02111-1307, USA.
|
||||
%
|
||||
% In other words, you are welcome to use, share and improve this program.
|
||||
% You are forbidden to forbid anyone else to use, share and improve
|
||||
% what you give them. Help stamp out software-hoarding!
|
||||
%
|
||||
% Please try the latest version of texinfo.tex before submitting bug
|
||||
% reports; you can get the latest version from:
|
||||
% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
|
||||
% ftp://ftp.gnu.org/pub/gnu/texinfo.tex
|
||||
% (and all GNU mirrors)
|
||||
% ftp://tug.org/tex/texinfo.tex
|
||||
% ftp://ctan.org/macros/texinfo/texinfo.tex
|
||||
% (and all CTAN mirrors, finger ctan@tug.org for a list).
|
||||
%
|
||||
% Send bug reports to bug-texinfo@gnu.org.
|
||||
% Please include a precise test case in each bug report,
|
||||
% including a complete document with which we can reproduce the problem.
|
||||
%
|
||||
% Texinfo macros (with @macro) are *not* supported by texinfo.tex. You
|
||||
% have to run makeinfo -E to expand macros first; the texi2dvi script
|
||||
% does this.
|
||||
%
|
||||
% To process a Texinfo manual with TeX, it's most reliable to use the
|
||||
% texi2dvi shell script that comes with the distribution. For simple
|
||||
% manuals, you can get away with:
|
||||
% tex foo.texi
|
||||
% texindex foo.??
|
||||
% tex foo.texi
|
||||
% tex foo.texi
|
||||
% dvips foo.dvi -o # or whatever, to process the dvi file.
|
||||
% The extra runs of TeX get the cross-reference information correct.
|
||||
% Sometimes one run after texindex suffices, and sometimes you need more
|
||||
% than two; texi2dvi does it as many times as necessary.
|
||||
|
||||
|
||||
% Make it possible to create a .fmt file just by loading this file:
|
||||
@@ -36,7 +60,7 @@
|
||||
|
||||
% This automatically updates the version number based on RCS.
|
||||
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
|
||||
\deftexinfoversion$Revision: 1.16 $
|
||||
\deftexinfoversion$Revision: 1.17 $
|
||||
\message{Loading texinfo package [Version \texinfoversion]:}
|
||||
|
||||
% If in a .fmt file, print the version number
|
||||
@@ -54,24 +78,17 @@
|
||||
\let\ptexdot=\.
|
||||
\let\ptexdots=\dots
|
||||
\let\ptexend=\end
|
||||
\let\ptexequiv = \equiv
|
||||
\let\ptexequiv=\equiv
|
||||
\let\ptexexclam=\!
|
||||
\let\ptexi=\i
|
||||
\let\ptexlbrace=\{
|
||||
\let\ptexrbrace=\}
|
||||
\let\ptexstar=\*
|
||||
\let\ptext=\t
|
||||
|
||||
% Be sure we're in horizontal mode when doing a tie, since we make space
|
||||
% equivalent to this in @example-like environments. Otherwise, a space
|
||||
% at the beginning of a line will start with \penalty -- and
|
||||
% since \penalty is valid in vertical mode, we'd end up putting the
|
||||
% penalty on the vertical list instead of in the new paragraph.
|
||||
{\catcode`@ = 11
|
||||
% Avoid using \@M directly, because that causes trouble
|
||||
% if the definition is written into an index file.
|
||||
\global\let\tiepenalty = \@M
|
||||
\gdef\tie{\leavevmode\penalty\tiepenalty\ }
|
||||
}
|
||||
% We never want plain's outer \+ definition in Texinfo.
|
||||
% For @tex, we can use \tabalign.
|
||||
\let\+ = \relax
|
||||
|
||||
|
||||
\message{Basics,}
|
||||
@@ -384,7 +401,7 @@
|
||||
|
||||
% @@ prints an @
|
||||
% Kludge this until the fonts are right (grr).
|
||||
\def\@{{\tt \char '100}}
|
||||
\def\@{{\tt\char64}}
|
||||
|
||||
% This is turned off because it was never documented
|
||||
% and you can use @w{...} around a quote to suppress ligatures.
|
||||
@@ -394,8 +411,8 @@
|
||||
%\def\'{{'}}
|
||||
|
||||
% Used to generate quoted braces.
|
||||
\def\mylbrace {{\tt \char '173}}
|
||||
\def\myrbrace {{\tt \char '175}}
|
||||
\def\mylbrace {{\tt\char123}}
|
||||
\def\myrbrace {{\tt\char125}}
|
||||
\let\{=\mylbrace
|
||||
\let\}=\myrbrace
|
||||
\begingroup
|
||||
@@ -432,6 +449,18 @@
|
||||
\fi\fi
|
||||
}
|
||||
|
||||
% Be sure we're in horizontal mode when doing a tie, since we make space
|
||||
% equivalent to this in @example-like environments. Otherwise, a space
|
||||
% at the beginning of a line will start with \penalty -- and
|
||||
% since \penalty is valid in vertical mode, we'd end up putting the
|
||||
% penalty on the vertical list instead of in the new paragraph.
|
||||
{\catcode`@ = 11
|
||||
% Avoid using \@M directly, because that causes trouble
|
||||
% if the definition is written into an index file.
|
||||
\global\let\tiepenalty = \@M
|
||||
\gdef\tie{\leavevmode\penalty\tiepenalty\ }
|
||||
}
|
||||
|
||||
% @: forces normal size whitespace following.
|
||||
\def\:{\spacefactor=1000 }
|
||||
|
||||
@@ -763,6 +792,7 @@ where each line of input produces a line of output.}
|
||||
% Also ignore @macro ... @end macro. The user must run texi2dvi,
|
||||
% which runs makeinfo to do macro expansion. Ignore @unmacro, too.
|
||||
\def\macro{\doignore{macro}}
|
||||
\def\macrocsname{macro}
|
||||
\let\unmacro = \comment
|
||||
|
||||
|
||||
@@ -777,7 +807,9 @@ where each line of input produces a line of output.}
|
||||
\ignoresections
|
||||
%
|
||||
% Define a command to swallow text until we reach `@end #1'.
|
||||
\long\def\doignoretext##1\end #1{\enddoignore}%
|
||||
% This @ is a catcode 12 token (that is the normal catcode of @ in
|
||||
% this texinfo.tex file). We change the catcode of @ below to match.
|
||||
\long\def\doignoretext##1@end #1{\enddoignore}%
|
||||
%
|
||||
% Make sure that spaces turn into tokens that match what \doignoretext wants.
|
||||
\catcode32 = 10
|
||||
@@ -786,6 +818,22 @@ where each line of input produces a line of output.}
|
||||
\catcode`\{ = 9
|
||||
\catcode`\} = 9
|
||||
%
|
||||
% We must not have @c interpreted as a control sequence.
|
||||
\catcode`\@ = 12
|
||||
%
|
||||
% Make the letter c a comment character so that the rest of the line
|
||||
% will be ignored. This way, the document can have (for example)
|
||||
% @c @end ifinfo
|
||||
% and the @end ifinfo will be properly ignored.
|
||||
% (We've just changed @ to catcode 12.)
|
||||
%
|
||||
% But we can't do this if #1 is `macro', since that actually contains a c.
|
||||
% Happily, none of the other conditionals have the letter `c' in their names!
|
||||
\def\temp{#1}%
|
||||
\ifx\temp\macrocsname \else
|
||||
\catcode`\c = 14
|
||||
\fi
|
||||
%
|
||||
% And now expand that command.
|
||||
\doignoretext
|
||||
}
|
||||
@@ -1278,6 +1326,10 @@ where each line of input produces a line of output.}
|
||||
%
|
||||
\textfonts
|
||||
|
||||
% Define these so they can be easily changed for other fonts.
|
||||
\def\angleleft{$\langle$}
|
||||
\def\angleright{$\rangle$}
|
||||
|
||||
% Count depth in font-changes, for error checks
|
||||
\newcount\fontdepth \fontdepth=0
|
||||
|
||||
@@ -1315,15 +1367,15 @@ where each line of input produces a line of output.}
|
||||
\null
|
||||
}
|
||||
\let\ttfont=\t
|
||||
\def\samp #1{`\tclose{#1}'\null}
|
||||
\def\samp#1{`\tclose{#1}'\null}
|
||||
\setfont\smallrm\rmshape{8}{1000}
|
||||
\font\smallsy=cmsy9
|
||||
\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
|
||||
\raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
|
||||
\raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
|
||||
\vbox{\hrule\kern-0.4pt
|
||||
\hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
|
||||
\hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
|
||||
\kern-0.4pt\hrule}%
|
||||
\kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
|
||||
\kern-.06em\raise0.4pt\hbox{\angleright}}}}
|
||||
% The old definition, with no lozenge:
|
||||
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
|
||||
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
|
||||
@@ -1436,7 +1488,7 @@ where each line of input produces a line of output.}
|
||||
|
||||
% rms does not like the angle brackets --karl, 17may97.
|
||||
% So now @email is just like @uref.
|
||||
%\def\email#1{$\langle${\tt #1}$\rangle$}
|
||||
%\def\email#1{\angleleft{\tt #1}\angleright}
|
||||
\let\email=\uref
|
||||
|
||||
% Check if we are currently using a typewriter font. Since all the
|
||||
@@ -1689,18 +1741,6 @@ July\or August\or September\or October\or November\or December\fi
|
||||
|
||||
|
||||
\message{tables,}
|
||||
|
||||
% @tabs -- simple alignment
|
||||
|
||||
% These don't work. For one thing, \+ is defined as outer.
|
||||
% So these macros cannot even be defined.
|
||||
|
||||
%\def\tabs{\parsearg\tabszzz}
|
||||
%\def\tabszzz #1{\settabs\+#1\cr}
|
||||
%\def\tabline{\parsearg\tablinezzz}
|
||||
%\def\tablinezzz #1{\+#1\cr}
|
||||
%\def\&{&}
|
||||
|
||||
% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
|
||||
|
||||
% default indentation of table text
|
||||
@@ -2058,10 +2098,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
% @multitablelinespace is space to leave between table items, baseline
|
||||
% to baseline.
|
||||
% 0pt means it depends on current normal line spacing.
|
||||
|
||||
%%%%
|
||||
% Dimensions
|
||||
|
||||
%
|
||||
\newskip\multitableparskip
|
||||
\newskip\multitableparindent
|
||||
\newdimen\multitablecolspace
|
||||
@@ -2071,15 +2108,15 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\multitablecolspace=12pt
|
||||
\multitablelinespace=0pt
|
||||
|
||||
%%%%
|
||||
% Macros used to set up halign preamble:
|
||||
%
|
||||
\let\endsetuptable\relax
|
||||
\def\xendsetuptable{\endsetuptable}
|
||||
\let\columnfractions\relax
|
||||
\def\xcolumnfractions{\columnfractions}
|
||||
\newif\ifsetpercent
|
||||
|
||||
%% 2/1/96, to allow fractions to be given with more than one digit.
|
||||
% 2/1/96, to allow fractions to be given with more than one digit.
|
||||
\def\pickupwholefraction#1 {\global\advance\colcount by1 %
|
||||
\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
|
||||
\setuptable}
|
||||
@@ -2105,80 +2142,84 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
|
||||
\fi\go}
|
||||
|
||||
%%%%
|
||||
% multitable syntax
|
||||
\def\tab{&\hskip1sp\relax} % 2/2/96
|
||||
% tiny skip here makes sure this column space is
|
||||
% maintained, even if it is never used.
|
||||
|
||||
|
||||
%%%%
|
||||
% @multitable ... @end multitable definitions:
|
||||
|
||||
\def\multitable{\parsearg\dotable}
|
||||
|
||||
\def\dotable#1{\bgroup
|
||||
\let\item\cr
|
||||
\tolerance=9500
|
||||
\hbadness=9500
|
||||
\setmultitablespacing
|
||||
\parskip=\multitableparskip
|
||||
\parindent=\multitableparindent
|
||||
\overfullrule=0pt
|
||||
\global\colcount=0\relax%
|
||||
\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
|
||||
% To parse everything between @multitable and @item :
|
||||
\setuptable#1 \endsetuptable
|
||||
% Need to reset this to 0 after \setuptable.
|
||||
\global\colcount=0\relax%
|
||||
%
|
||||
% This preamble sets up a generic column definition, which will
|
||||
% be used as many times as user calls for columns.
|
||||
% \vtop will set a single line and will also let text wrap and
|
||||
% continue for many paragraphs if desired.
|
||||
\halign\bgroup&\global\advance\colcount by 1\relax%
|
||||
\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
|
||||
% In order to keep entries from bumping into each other
|
||||
% we will add a \leftskip of \multitablecolspace to all columns after
|
||||
% the first one.
|
||||
% If a template has been used, we will add \multitablecolspace
|
||||
% to the width of each template entry.
|
||||
% If user has set preamble in terms of percent of \hsize
|
||||
% we will use that dimension as the width of the column, and
|
||||
% the \leftskip will keep entries from bumping into each other.
|
||||
% Table will start at left margin and final column will justify at
|
||||
% right margin.
|
||||
\ifnum\colcount=1
|
||||
\else
|
||||
\ifsetpercent
|
||||
\vskip\parskip
|
||||
\let\item\crcr
|
||||
\tolerance=9500
|
||||
\hbadness=9500
|
||||
\setmultitablespacing
|
||||
\parskip=\multitableparskip
|
||||
\parindent=\multitableparindent
|
||||
\overfullrule=0pt
|
||||
\global\colcount=0
|
||||
\def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
|
||||
%
|
||||
% To parse everything between @multitable and @item:
|
||||
\setuptable#1 \endsetuptable
|
||||
%
|
||||
% \everycr will reset column counter, \colcount, at the end of
|
||||
% each line. Every column entry will cause \colcount to advance by one.
|
||||
% The table preamble
|
||||
% looks at the current \colcount to find the correct column width.
|
||||
\everycr{\noalign{%
|
||||
%
|
||||
% \filbreak%% keeps underfull box messages off when table breaks over pages.
|
||||
% Maybe so, but it also creates really weird page breaks when the table
|
||||
% breaks over pages. Wouldn't \vfil be better? Wait until the problem
|
||||
% manifests itself, so it can be fixed for real --karl.
|
||||
\global\colcount=0\relax}}%
|
||||
%
|
||||
% This preamble sets up a generic column definition, which will
|
||||
% be used as many times as user calls for columns.
|
||||
% \vtop will set a single line and will also let text wrap and
|
||||
% continue for many paragraphs if desired.
|
||||
\halign\bgroup&\global\advance\colcount by 1\relax
|
||||
\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
|
||||
%
|
||||
% In order to keep entries from bumping into each other
|
||||
% we will add a \leftskip of \multitablecolspace to all columns after
|
||||
% the first one.
|
||||
%
|
||||
% If a template has been used, we will add \multitablecolspace
|
||||
% to the width of each template entry.
|
||||
%
|
||||
% If the user has set preamble in terms of percent of \hsize we will
|
||||
% use that dimension as the width of the column, and the \leftskip
|
||||
% will keep entries from bumping into each other. Table will start at
|
||||
% left margin and final column will justify at right margin.
|
||||
%
|
||||
% Make sure we don't inherit \rightskip from the outer environment.
|
||||
\rightskip=0pt
|
||||
\ifnum\colcount=1
|
||||
% The first column will be indented with the surrounding text.
|
||||
\advance\hsize by\leftskip
|
||||
\else
|
||||
% If user has <not> set preamble in terms of percent of \hsize
|
||||
% we will advance \hsize by \multitablecolspace
|
||||
\advance\hsize by \multitablecolspace
|
||||
\ifsetpercent \else
|
||||
% If user has not set preamble in terms of percent of \hsize
|
||||
% we will advance \hsize by \multitablecolspace.
|
||||
\advance\hsize by \multitablecolspace
|
||||
\fi
|
||||
% In either case we will make \leftskip=\multitablecolspace:
|
||||
\leftskip=\multitablecolspace
|
||||
\fi
|
||||
% In either case we will make \leftskip=\multitablecolspace:
|
||||
\leftskip=\multitablecolspace
|
||||
\fi
|
||||
% Ignoring space at the beginning and end avoids an occasional spurious
|
||||
% blank line, when TeX decides to break the line at the space before the
|
||||
% box from the multistrut, so the strut ends up on a line by itself.
|
||||
% For example:
|
||||
% @multitable @columnfractions .11 .89
|
||||
% @item @code{#}
|
||||
% @tab Legal holiday which is valid in major parts of the whole country.
|
||||
% Is automatically provided with highlighting sequences respectively marking
|
||||
% characters.
|
||||
\noindent\ignorespaces##\unskip\multistrut}\cr
|
||||
% \everycr will reset column counter, \colcount, at the end of
|
||||
% each line. Every column entry will cause \colcount to advance by one.
|
||||
% The table preamble
|
||||
% looks at the current \colcount to find the correct column width.
|
||||
\global\everycr{\noalign{%
|
||||
% \filbreak%% keeps underfull box messages off when table breaks over pages.
|
||||
% Maybe so, but it also creates really weird page breaks when the table
|
||||
% breaks over pages Wouldn't \vfil be better? Wait until the problem
|
||||
% manifests itself, so it can be fixed for real --karl.
|
||||
\global\colcount=0\relax}}
|
||||
% Ignoring space at the beginning and end avoids an occasional spurious
|
||||
% blank line, when TeX decides to break the line at the space before the
|
||||
% box from the multistrut, so the strut ends up on a line by itself.
|
||||
% For example:
|
||||
% @multitable @columnfractions .11 .89
|
||||
% @item @code{#}
|
||||
% @tab Legal holiday which is valid in major parts of the whole country.
|
||||
% Is automatically provided with highlighting sequences respectively marking
|
||||
% characters.
|
||||
\noindent\ignorespaces##\unskip\multistrut}\cr
|
||||
}
|
||||
|
||||
\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
|
||||
@@ -2246,20 +2287,24 @@ width0pt\relax} \fi
|
||||
|
||||
% @synindex foo bar makes index foo feed into index bar.
|
||||
% Do this instead of @defindex foo if you don't want it as a separate index.
|
||||
\def\synindex #1 #2 {%
|
||||
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
|
||||
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
|
||||
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
|
||||
\noexpand\doindex {#2}}%
|
||||
% The \closeout helps reduce unnecessary open files; the limit on the
|
||||
% Acorn RISC OS is a mere 16 files.
|
||||
\def\synindex#1 #2 {%
|
||||
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
|
||||
\expandafter\closeout\csname#1indfile\endcsname
|
||||
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
|
||||
\expandafter\xdef\csname#1index\endcsname{% define \xxxindex
|
||||
\noexpand\doindex{#2}}%
|
||||
}
|
||||
|
||||
% @syncodeindex foo bar similar, but put all entries made for index foo
|
||||
% inside @code.
|
||||
\def\syncodeindex #1 #2 {%
|
||||
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
|
||||
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
|
||||
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
|
||||
\noexpand\docodeindex {#2}}%
|
||||
\def\syncodeindex#1 #2 {%
|
||||
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
|
||||
\expandafter\closeout\csname#1indfile\endcsname
|
||||
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
|
||||
\expandafter\xdef\csname#1index\endcsname{% define \xxxindex
|
||||
\noexpand\docodeindex{#2}}%
|
||||
}
|
||||
|
||||
% Define \doindex, the driver for all \fooindex macros.
|
||||
@@ -2525,6 +2570,11 @@ width0pt\relax} \fi
|
||||
\indexbreaks
|
||||
%
|
||||
% See if the index file exists and is nonempty.
|
||||
% Change catcode of @ here so that if the index file contains
|
||||
% \initial {@}
|
||||
% as its first line, TeX doesn't complain about mismatched braces
|
||||
% (because it thinks @} is a control sequence).
|
||||
\catcode`\@ = 11
|
||||
\openin 1 \jobname.#1s
|
||||
\ifeof 1
|
||||
% \enddoublecolumns gets confused if there is no text in the index,
|
||||
@@ -2546,7 +2596,6 @@ width0pt\relax} \fi
|
||||
% to make right now.
|
||||
\def\indexbackslash{\rawbackslashxx}%
|
||||
\catcode`\\ = 0
|
||||
\catcode`\@ = 11
|
||||
\escapechar = `\\
|
||||
\begindoublecolumns
|
||||
\input \jobname.#1s
|
||||
@@ -3442,11 +3491,12 @@ width0pt\relax} \fi
|
||||
% the index entries, but we want to suppress hyphenation here. (We
|
||||
% can't do that in the \entry macro, since index entries might consist
|
||||
% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
|
||||
%
|
||||
% \turnoffactive is for the sake of @" used for umlauts.
|
||||
\def\tocentry#1#2{\begingroup
|
||||
\vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
|
||||
\entry{\turnoffactive #1}{\turnoffactive #2}%
|
||||
% Do not use \turnoffactive in these arguments. Since the toc is
|
||||
% typeset in cmr, so characters such as _ would come out wrong; we
|
||||
% have to do the usual translation tricks.
|
||||
\entry{#1}{#2}%
|
||||
\endgroup}
|
||||
|
||||
% Space between chapter (or whatever) number and the title.
|
||||
@@ -3512,30 +3562,36 @@ width0pt\relax} \fi
|
||||
% But \@ or @@ will get a plain tex @ character.
|
||||
|
||||
\def\tex{\begingroup
|
||||
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
|
||||
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
|
||||
\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
|
||||
\catcode `\%=14
|
||||
\catcode 43=12 % plus
|
||||
\catcode`\"=12
|
||||
\catcode`\==12
|
||||
\catcode`\|=12
|
||||
\catcode`\<=12
|
||||
\catcode`\>=12
|
||||
\escapechar=`\\
|
||||
%
|
||||
\let\,=\ptexcomma
|
||||
\let\{=\ptexlbrace
|
||||
\let\}=\ptexrbrace
|
||||
\let\.=\ptexdot
|
||||
\let\*=\ptexstar
|
||||
\let\dots=\ptexdots
|
||||
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
|
||||
\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
|
||||
\def\@{@}%
|
||||
\let\bullet=\ptexbullet
|
||||
\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext
|
||||
%
|
||||
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
|
||||
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
|
||||
\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
|
||||
\catcode `\%=14
|
||||
\catcode 43=12 % plus
|
||||
\catcode`\"=12
|
||||
\catcode`\==12
|
||||
\catcode`\|=12
|
||||
\catcode`\<=12
|
||||
\catcode`\>=12
|
||||
\escapechar=`\\
|
||||
%
|
||||
\let\b=\ptexb
|
||||
\let\bullet=\ptexbullet
|
||||
\let\c=\ptexc
|
||||
\let\,=\ptexcomma
|
||||
\let\.=\ptexdot
|
||||
\let\dots=\ptexdots
|
||||
\let\equiv=\ptexequiv
|
||||
\let\!=\ptexexclam
|
||||
\let\i=\ptexi
|
||||
\let\{=\ptexlbrace
|
||||
\let\+=\tabalign
|
||||
\let\}=\ptexrbrace
|
||||
\let\*=\ptexstar
|
||||
\let\t=\ptext
|
||||
%
|
||||
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
|
||||
\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
|
||||
\def\@{@}%
|
||||
\let\Etex=\endgroup}
|
||||
|
||||
% Define @lisp ... @endlisp.
|
||||
@@ -3580,8 +3636,8 @@ width0pt\relax} \fi
|
||||
% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
|
||||
\let\nonarrowing=\relax
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% \cartouche: draw rectangle w/rounded corners around argument
|
||||
% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
|
||||
% environment contents.
|
||||
\font\circle=lcircle10
|
||||
\newdimen\circthick
|
||||
\newdimen\cartouter\newdimen\cartinner
|
||||
@@ -3608,9 +3664,9 @@ width0pt\relax} \fi
|
||||
\cartinner=\hsize \advance\cartinner by-\lskip
|
||||
\advance\cartinner by-\rskip
|
||||
\cartouter=\hsize
|
||||
\advance\cartouter by 18pt % allow for 3pt kerns on either
|
||||
\advance\cartouter by 18.4pt % allow for 3pt kerns on either
|
||||
% side, and for 6pt waste from
|
||||
% each corner char
|
||||
% each corner char, and rule thickness
|
||||
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
|
||||
% Flag to tell @lisp, etc., not to narrow margin.
|
||||
\let\nonarrowing=\comment
|
||||
@@ -4246,18 +4302,17 @@ width0pt\relax} \fi
|
||||
|
||||
|
||||
\message{cross reference,}
|
||||
% Define cross-reference macros
|
||||
\newwrite \auxfile
|
||||
\newwrite\auxfile
|
||||
|
||||
\newif\ifhavexrefs % True if xref values are known.
|
||||
\newif\ifhavexrefs % True if xref values are known.
|
||||
\newif\ifwarnedxrefs % True if we warned once that they aren't known.
|
||||
|
||||
% @inforef is simple.
|
||||
% @inforef is relatively simple.
|
||||
\def\inforef #1{\inforefzzz #1,,,,**}
|
||||
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
|
||||
node \samp{\ignorespaces#1{}}}
|
||||
|
||||
% \setref{foo} defines a cross-reference point named foo.
|
||||
% @setref{foo} defines a cross-reference point named foo.
|
||||
|
||||
\def\setref#1{%
|
||||
\dosetq{#1-title}{Ytitle}%
|
||||
@@ -4325,7 +4380,7 @@ width0pt\relax} \fi
|
||||
% into the usual \leavevmode...\vrule stuff for purposes of
|
||||
% printing. So we \turnoffactive for the \refx-snt, back on for the
|
||||
% printing, back off for the \refx-pg.
|
||||
{\turnoffactive \refx{#1-snt}{}}%
|
||||
{\normalturnoffactive \refx{#1-snt}{}}%
|
||||
\space [\printednodename],\space
|
||||
\turnoffactive \putwordpage\tie\refx{#1-pg}{}%
|
||||
\fi
|
||||
@@ -4333,11 +4388,15 @@ width0pt\relax} \fi
|
||||
|
||||
% \dosetq is the interface for calls from other macros
|
||||
|
||||
% Use \turnoffactive so that punctuation chars such as underscore
|
||||
% work in node names.
|
||||
\def\dosetq #1#2{{\let\folio=0 \turnoffactive
|
||||
\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
|
||||
\next}}
|
||||
% Use \normalturnoffactive so that punctuation chars such as underscore
|
||||
% and backslash work in node names. (\turnoffactive doesn't do \.)
|
||||
\def\dosetq#1#2{%
|
||||
{\let\folio=0
|
||||
\normalturnoffactive
|
||||
\edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
|
||||
\next
|
||||
}%
|
||||
}
|
||||
|
||||
% \internalsetq {foo}{page} expands into
|
||||
% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
|
||||
@@ -4388,7 +4447,7 @@ width0pt\relax} \fi
|
||||
\def\refx#1#2{%
|
||||
\expandafter\ifx\csname X#1\endcsname\relax
|
||||
% If not defined, say something at least.
|
||||
$\langle$un\-de\-fined$\rangle$%
|
||||
\angleleft un\-de\-fined\angleright
|
||||
\ifhavexrefs
|
||||
\message{\linenumber Undefined cross reference `#1'.}%
|
||||
\else
|
||||
@@ -4405,10 +4464,13 @@ width0pt\relax} \fi
|
||||
}
|
||||
|
||||
% This is the macro invoked by entries in the aux file.
|
||||
\def\xrdef #1#2{{%
|
||||
\catcode`\'=\other
|
||||
\expandafter\gdef\csname X#1\endcsname{#2}%
|
||||
}}
|
||||
%
|
||||
\def\xrdef#1{\begingroup
|
||||
% Reenable \ as an escape while reading the second argument.
|
||||
\catcode`\\ = 0
|
||||
\afterassignment\endgroup
|
||||
\expandafter\gdef\csname X#1\endcsname
|
||||
}
|
||||
|
||||
% Read the last existing aux file, if any. No error if none exists.
|
||||
\def\readauxfile{\begingroup
|
||||
@@ -4465,8 +4527,7 @@ width0pt\relax} \fi
|
||||
\catcode`\$=\other
|
||||
\catcode`\#=\other
|
||||
\catcode`\&=\other
|
||||
% `\+ does not work, so use 43.
|
||||
\catcode43=\other
|
||||
\catcode`+=\other % avoid \+ for paranoia even though we've turned it off
|
||||
% Make the characters 128-255 be printing characters
|
||||
{%
|
||||
\count 1=128
|
||||
@@ -4837,10 +4898,10 @@ width0pt\relax} \fi
|
||||
% use math or other variants that look better in normal text.
|
||||
|
||||
\catcode`\"=\active
|
||||
\def\activedoublequote{{\tt \char '042}}
|
||||
\def\activedoublequote{{\tt\char34}}
|
||||
\let"=\activedoublequote
|
||||
\catcode`\~=\active
|
||||
\def~{{\tt \char '176}}
|
||||
\def~{{\tt\char126}}
|
||||
\chardef\hat=`\^
|
||||
\catcode`\^=\active
|
||||
\def^{{\tt \hat}}
|
||||
@@ -4851,7 +4912,7 @@ width0pt\relax} \fi
|
||||
\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
|
||||
|
||||
\catcode`\|=\active
|
||||
\def|{{\tt \char '174}}
|
||||
\def|{{\tt\char124}}
|
||||
\chardef \less=`\<
|
||||
\catcode`\<=\active
|
||||
\def<{{\tt \less}}
|
||||
@@ -4938,8 +4999,8 @@ width0pt\relax} \fi
|
||||
@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
|
||||
@catcode`+=@active @catcode`@_=@active}
|
||||
|
||||
%% These look ok in all fonts, so just make them not special. The @rm below
|
||||
%% makes sure that the current font starts out as the newly loaded cmr10
|
||||
% These look ok in all fonts, so just make them not special. The @rm below
|
||||
% makes sure that the current font starts out as the newly loaded cmr10
|
||||
@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
|
||||
|
||||
@textfonts
|
||||
|
||||
@@ -142,7 +142,7 @@ The GNU text utilities are mostly compatible with the @sc{POSIX.2} standard.
|
||||
@c This paragraph appears in all of fileutils.texi, textutils.texi, and
|
||||
@c sh-utils.texi too -- so be sure to keep them consistent.
|
||||
@cindex bugs, reporting
|
||||
Please report bugs to @samp{textutils-bugs@@gnu.org}. Remember
|
||||
Please report bugs to @email{textutils-bugs@@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
|
||||
@@ -2696,6 +2696,24 @@ Convert each sequence of repeated newlines to a single newline:
|
||||
tr -s '\n'
|
||||
@end example
|
||||
|
||||
@item
|
||||
Find doubled occurrences of words in a document.
|
||||
For example, people often write ``the the'' with the duplicated words
|
||||
separated by a newline. The bourne shell script below works first
|
||||
by converting each sequence of punctuation and blank characters to a
|
||||
single newline. That puts each ``word'' on a line by itself.
|
||||
Next it maps all uppercase characters to lower case, and finally it
|
||||
runs @code{uniq} with the @samp{-d} option to print out only the words
|
||||
that were adjacent duplicates.
|
||||
|
||||
@example
|
||||
#!/bin/sh
|
||||
cat "$@@" \
|
||||
| tr -s '[:punct:][:blank:]' '\n' \
|
||||
| tr '[:upper:]' '[:lower:]' \
|
||||
| uniq -d
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
|
||||
|
||||
@@ -4,9 +4,6 @@ AUTOMAKE_OPTIONS = ../src/ansi2knr
|
||||
|
||||
noinst_LIBRARIES = libfu.a
|
||||
|
||||
EXTRA_DIST = chown.c getgroups.c getline.c lstat.c malloc.c mktime.c \
|
||||
realloc.c stat.c strftime.c
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
|
||||
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
|
||||
@@ -14,7 +11,7 @@ addext.c argmatch.c backupfile.c basename.c \
|
||||
closeout.c dirname.c exclude.c filemode.c \
|
||||
full-write.c human.c idcache.c \
|
||||
isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \
|
||||
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
|
||||
quotearg.c safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
|
||||
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
|
||||
|
||||
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
@@ -22,8 +19,9 @@ libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
|
||||
|
||||
noinst_HEADERS = argmatch.h backupfile.h closeout.h \
|
||||
error.h exclude.h fnmatch.h fsusage.h \
|
||||
get-date.h getline.h getopt.h group-member.h human.h long-options.h \
|
||||
getdate.h getline.h getopt.h group-member.h human.h long-options.h \
|
||||
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
|
||||
save-cwd.h savedir.h strverscmp.h xalloc.h xstrtol.h xstrtoul.h
|
||||
quotearg.h safe-read.h save-cwd.h savedir.h strverscmp.h \
|
||||
xalloc.h xstrtol.h xstrtoul.h
|
||||
|
||||
BUILT_SOURCES = getdate.c posixtm.c
|
||||
|
||||
261
lib/Makefile.in
261
lib/Makefile.in
@@ -1,6 +1,6 @@
|
||||
# Makefile.in generated automatically by automake 1.2d from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -32,6 +32,8 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
@@ -66,6 +68,7 @@ GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GT_NO = @GT_NO@
|
||||
GT_YES = @GT_YES@
|
||||
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
@@ -91,9 +94,6 @@ AUTOMAKE_OPTIONS = ../src/ansi2knr
|
||||
|
||||
noinst_LIBRARIES = libfu.a
|
||||
|
||||
EXTRA_DIST = chown.c getgroups.c getline.c lstat.c malloc.c mktime.c \
|
||||
realloc.c stat.c strftime.c
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
|
||||
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
|
||||
@@ -101,7 +101,7 @@ addext.c argmatch.c backupfile.c basename.c \
|
||||
closeout.c dirname.c exclude.c filemode.c \
|
||||
full-write.c human.c idcache.c \
|
||||
isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \
|
||||
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
|
||||
quotearg.c safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
|
||||
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
|
||||
|
||||
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
@@ -109,9 +109,10 @@ libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
|
||||
|
||||
noinst_HEADERS = argmatch.h backupfile.h closeout.h \
|
||||
error.h exclude.h fnmatch.h fsusage.h \
|
||||
get-date.h getline.h getopt.h group-member.h human.h long-options.h \
|
||||
getdate.h getline.h getopt.h group-member.h human.h long-options.h \
|
||||
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
|
||||
save-cwd.h savedir.h strverscmp.h xalloc.h xstrtol.h xstrtoul.h
|
||||
quotearg.h safe-read.h save-cwd.h savedir.h strverscmp.h \
|
||||
xalloc.h xstrtol.h xstrtoul.h
|
||||
|
||||
BUILT_SOURCES = getdate.c posixtm.c
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
@@ -129,9 +130,9 @@ libfu_a_OBJECTS = getdate$U.o posixtm$U.o getopt$U.o getopt1$U.o \
|
||||
addext$U.o argmatch$U.o backupfile$U.o basename$U.o closeout$U.o \
|
||||
dirname$U.o exclude$U.o filemode$U.o full-write$U.o human$U.o \
|
||||
idcache$U.o isdir$U.o long-options$U.o makepath$U.o modechange$U.o \
|
||||
hash$U.o path-concat$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
|
||||
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@
|
||||
@@ -139,13 +140,13 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in 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 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 regex.h rename.c rmdir.c rpmatch.c rx.c rx.h stat.c \
|
||||
stpcpy.c strcasecmp.c strdup.c strftime.c strndup.c strstr.c strtol.c \
|
||||
strtoul.c strverscmp.c ylwrap
|
||||
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 regex.h rename.c \
|
||||
rmdir.c rpmatch.c rx.c rx.h stat.c stpcpy.c strcasecmp.c strdup.c \
|
||||
strftime.c strndup.c strstr.c strtol.c strtoul.c strverscmp.c ylwrap
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
@@ -156,13 +157,14 @@ DEP_FILES = .deps/addext.P .deps/alloca.P .deps/argmatch.P \
|
||||
.deps/backupfile.P .deps/basename.P .deps/chown.P .deps/closeout.P \
|
||||
.deps/dirname.P .deps/error.P .deps/euidaccess.P .deps/exclude.P \
|
||||
.deps/fileblocks.P .deps/filemode.P .deps/fnmatch.P .deps/fsusage.P \
|
||||
.deps/ftruncate.P .deps/full-write.P .deps/getdate.P .deps/getgroups.P \
|
||||
.deps/getline.P .deps/getopt.P .deps/getopt1.P .deps/group-member.P \
|
||||
.deps/hash.P .deps/human.P .deps/idcache.P .deps/isdir.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.P .deps/realloc.P .deps/regex.P \
|
||||
.deps/ftruncate.P .deps/full-write.P .deps/getdate .deps/getdate.P \
|
||||
.deps/getgroups.P .deps/getline.P .deps/getopt.P .deps/getopt1.P \
|
||||
.deps/group-member.P .deps/hash.P .deps/human.P .deps/idcache.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/rx.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 \
|
||||
@@ -173,14 +175,14 @@ DEP_FILES = .deps/addext.P .deps/alloca.P .deps/argmatch.P \
|
||||
SOURCES = $(libfu_a_SOURCES)
|
||||
OBJECTS = $(libfu_a_OBJECTS)
|
||||
|
||||
default: all
|
||||
all: Makefile $(LIBRARIES) $(HEADERS)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .h .o .s .y
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
.SUFFIXES: .S .c .o .s .y
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -194,9 +196,6 @@ distclean-noinstLIBRARIES:
|
||||
|
||||
maintainer-clean-noinstLIBRARIES:
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
@@ -204,7 +203,7 @@ maintainer-clean-noinstLIBRARIES:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core
|
||||
-rm -f *.o core *.core
|
||||
|
||||
clean-compile:
|
||||
|
||||
@@ -215,6 +214,9 @@ maintainer-clean-compile:
|
||||
../src/ansi2knr: ../src/ansi2knr.o
|
||||
cd ../src && $(MAKE) ansi2knr
|
||||
|
||||
../src/ansi2knr.o:
|
||||
cd ../src && $(MAKE) ansi2knr.o
|
||||
|
||||
|
||||
mostlyclean-kr:
|
||||
-rm -f *_.c
|
||||
@@ -231,156 +233,161 @@ libfu.a: $(libfu_a_OBJECTS) $(libfu_a_DEPENDENCIES)
|
||||
$(RANLIB) libfu.a
|
||||
.y.c:
|
||||
$(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS)
|
||||
.y.h:
|
||||
$(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS)
|
||||
posixtm.h: posixtm.c
|
||||
getdate.h: getdate.c
|
||||
|
||||
addext_.c: addext.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/addext.c; then echo $(srcdir)/addext.c; else echo addext.c; fi` addext_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` alloca_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/argmatch.c; then echo $(srcdir)/argmatch.c; else echo argmatch.c; fi` argmatch_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/backupfile.c; then echo $(srcdir)/backupfile.c; else echo backupfile.c; fi` backupfile_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` basename_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/chown.c; then echo $(srcdir)/chown.c; else echo chown.c; fi` chown_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/closeout.c; then echo $(srcdir)/closeout.c; else echo closeout.c; fi` closeout_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` dirname_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` error_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/euidaccess.c; then echo $(srcdir)/euidaccess.c; else echo euidaccess.c; fi` euidaccess_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/exclude.c; then echo $(srcdir)/exclude.c; else echo exclude.c; fi` exclude_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` fileblocks_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/filemode.c; then echo $(srcdir)/filemode.c; else echo filemode.c; fi` filemode_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` fnmatch_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/fsusage.c; then echo $(srcdir)/fsusage.c; else echo fsusage.c; fi` fsusage_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/ftruncate.c; then echo $(srcdir)/ftruncate.c; else echo ftruncate.c; fi` ftruncate_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/full-write.c; then echo $(srcdir)/full-write.c; else echo full-write.c; fi` full-write_.c
|
||||
$(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
|
||||
getdate_.c: getdate.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/getdate.c; then echo $(srcdir)/getdate.c; else echo getdate.c; fi` getdate_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/getgroups.c; then echo $(srcdir)/getgroups.c; else echo getgroups.c; fi` getgroups_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/getline.c; then echo $(srcdir)/getline.c; else echo getline.c; fi` getline_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` getopt_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` getopt1_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/group-member.c; then echo $(srcdir)/group-member.c; else echo group-member.c; fi` group-member_.c
|
||||
$(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
|
||||
hash_.c: hash.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` hash_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/human.c; then echo $(srcdir)/human.c; else echo human.c; fi` human_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/idcache.c; then echo $(srcdir)/idcache.c; else echo idcache.c; fi` idcache_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/isdir.c; then echo $(srcdir)/isdir.c; else echo isdir.c; fi` isdir_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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
|
||||
long-options_.c: long-options.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/long-options.c; then echo $(srcdir)/long-options.c; else echo long-options.c; fi` long-options_.c
|
||||
$(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
|
||||
lstat_.c: lstat.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` lstat_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/makepath.c; then echo $(srcdir)/makepath.c; else echo makepath.c; fi` makepath_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` malloc_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` memcmp_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` memcpy_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` memset_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/mkdir.c; then echo $(srcdir)/mkdir.c; else echo mkdir.c; fi` mkdir_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` mktime_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/modechange.c; then echo $(srcdir)/modechange.c; else echo modechange.c; fi` modechange_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/mountlist.c; then echo $(srcdir)/mountlist.c; else echo mountlist.c; fi` mountlist_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` obstack_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/path-concat.c; then echo $(srcdir)/path-concat.c; else echo path-concat.c; fi` path-concat_.c
|
||||
$(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
|
||||
posixtm_.c: posixtm.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/posixtm.c; then echo $(srcdir)/posixtm.c; else echo posixtm.c; fi` posixtm_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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
|
||||
realloc_.c: realloc.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` realloc_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` regex_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/rename.c; then echo $(srcdir)/rename.c; else echo rename.c; fi` rename_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/rmdir.c; then echo $(srcdir)/rmdir.c; else echo rmdir.c; fi` rmdir_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/rpmatch.c; then echo $(srcdir)/rpmatch.c; else echo rpmatch.c; fi` rpmatch_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/rpmatch.c; then echo $(srcdir)/rpmatch.c; else echo rpmatch.c; fi` | $(ANSI2KNR) > rpmatch_.c
|
||||
rx_.c: rx.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/rx.c; then echo $(srcdir)/rx.c; else echo rx.c; fi` rx_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/rx.c; then echo $(srcdir)/rx.c; else echo rx.c; fi` | $(ANSI2KNR) > rx_.c
|
||||
safe-read_.c: safe-read.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/safe-read.c; then echo $(srcdir)/safe-read.c; else echo safe-read.c; fi` safe-read_.c
|
||||
$(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
|
||||
save-cwd_.c: save-cwd.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/save-cwd.c; then echo $(srcdir)/save-cwd.c; else echo save-cwd.c; fi` save-cwd_.c
|
||||
$(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
|
||||
savedir_.c: savedir.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` savedir_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` stat_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` stpcpy_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strcasecmp.c; then echo $(srcdir)/strcasecmp.c; else echo strcasecmp.c; fi` strcasecmp_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` strdup_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` strftime_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/stripslash.c; then echo $(srcdir)/stripslash.c; else echo stripslash.c; fi` stripslash_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strndup.c; then echo $(srcdir)/strndup.c; else echo strndup.c; fi` strndup_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` strstr_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` strtol_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` strtoul_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strverscmp.c; then echo $(srcdir)/strverscmp.c; else echo strverscmp.c; fi` strverscmp_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/userspec.c; then echo $(srcdir)/userspec.c; else echo userspec.c; fi` userspec_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/userspec.c; then echo $(srcdir)/userspec.c; else echo userspec.c; fi` | $(ANSI2KNR) > userspec_.c
|
||||
xgetcwd_.c: xgetcwd.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/xgetcwd.c; then echo $(srcdir)/xgetcwd.c; else echo xgetcwd.c; fi` xgetcwd_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` xmalloc_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/xstrdup.c; then echo $(srcdir)/xstrdup.c; else echo xstrdup.c; fi` xstrdup_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` xstrtol_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/xstrtoul.c; then echo $(srcdir)/xstrtoul.c; else echo xstrtoul.c; fi` xstrtoul_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` yesno_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(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 \
|
||||
getgroups_.o getline_.o getopt_.o getopt1_.o group-member_.o hash_.o \
|
||||
human_.o idcache_.o isdir_.o long-options_.o lstat_.o makepath_.o \
|
||||
malloc_.o memcmp_.o memcpy_.o memset_.o mkdir_.o mktime_.o \
|
||||
human_.o idcache_.o isdir_.o lchown_.o long-options_.o lstat_.o \
|
||||
makepath_.o malloc_.o memcmp_.o memcpy_.o memset_.o mkdir_.o mktime_.o \
|
||||
modechange_.o mountlist_.o obstack_.o path-concat_.o posixtm_.o \
|
||||
realloc_.o regex_.o rename_.o rmdir_.o rpmatch_.o rx_.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)
|
||||
quotearg_.o realloc_.o regex_.o rename_.o rmdir_.o rpmatch_.o rx_.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)
|
||||
|
||||
tags: TAGS
|
||||
|
||||
@@ -391,8 +398,12 @@ ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) $(LISP) -o $$here/TAGS)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
@@ -420,12 +431,7 @@ distdir: $(DISTFILES)
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
|
||||
MKDEP = $(CC) -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
|
||||
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
|
||||
-include .deps/.P
|
||||
.deps/.P: $(BUILT_SOURCES)
|
||||
echo > $@
|
||||
|
||||
-include $(DEP_FILES)
|
||||
|
||||
@@ -438,13 +444,16 @@ distclean-depend:
|
||||
maintainer-clean-depend:
|
||||
-rm -rf .deps
|
||||
|
||||
.deps/%.P: %.c
|
||||
@echo "Computing dependencies for $<..."
|
||||
@o='o'; \
|
||||
test -n "$o" && o='$$o'; \
|
||||
$(MKDEP) $< >$@.tmp \
|
||||
&& sed "s,^\(.*\)\.o:,\1.$$o \1.l$$o $@:," < $@.tmp > $@ \
|
||||
&& rm -f $@.tmp
|
||||
%.o: %.c
|
||||
@echo '$(COMPILE) -c $<'; \
|
||||
$(COMPILE) -Wp,-MD,.deps/$(*F).P -c $<
|
||||
|
||||
%.lo: %.c
|
||||
@echo '$(LTCOMPILE) -c $<'; \
|
||||
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).p -c $<
|
||||
@-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \
|
||||
< .deps/$(*F).p > .deps/$(*F).P
|
||||
@-rm -f .deps/$(*F).p
|
||||
info:
|
||||
dvi:
|
||||
check: all
|
||||
@@ -461,8 +470,6 @@ install: install-exec install-data all
|
||||
|
||||
uninstall:
|
||||
|
||||
all: Makefile $(LIBRARIES) $(HEADERS)
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
@@ -500,7 +507,7 @@ maintainer-clean: maintainer-clean-noinstLIBRARIES \
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
|
||||
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
|
||||
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
|
||||
|
||||
32
lib/TODO
Normal file
32
lib/TODO
Normal file
@@ -0,0 +1,32 @@
|
||||
Things to do to hash.c:
|
||||
|
||||
Always use curly braces around statements in if/else/while/do/etc.
|
||||
that span more than a line -- even around multiline simple statements
|
||||
or single-line simple statements preceded by a comment line.
|
||||
|
||||
Never have lines longer than 80 chars.
|
||||
|
||||
Remove ^L characters. We don't want/need such crutches.
|
||||
Get a good (smart) pagination filter. I have one (a perl script)
|
||||
that usually does a decent job for me -- I called it something
|
||||
like stdc-print and think I sent you an early verison.
|
||||
|
||||
I don't like the name `cursor'. I much prefer short names
|
||||
like `p' for index variables. I doubt I'll change all of them,
|
||||
but thought you should know why some will probably end up changing.
|
||||
|
||||
#define USE_OBSTACK somewhere
|
||||
|
||||
Fix this comment. Depending on system and application...
|
||||
Mention fragmentation.
|
||||
+#if USE_OBSTACK
|
||||
+ /* Whenever obstacks are used, it is possible to allocate all overflowed
|
||||
+ entries into a single stack, so they all can be freed in a single
|
||||
+ operation. It is not clear if the speedup is worth the trouble. */
|
||||
+ struct obstack entry_stack;
|
||||
+#endif
|
||||
|
||||
|
||||
assert (bucket_limit - bucket == n_buckets) ?
|
||||
|
||||
remove.c: s/done/successful or ok
|
||||
120
lib/alloca.c
120
lib/alloca.c
@@ -22,11 +22,11 @@
|
||||
your main control loop, etc. to force garbage collection. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef emacs
|
||||
#include "blockinput.h"
|
||||
# include "blockinput.h"
|
||||
#endif
|
||||
|
||||
/* If compiling with GCC 2, this file's not needed. */
|
||||
@@ -34,39 +34,41 @@
|
||||
|
||||
/* If someone has defined alloca as a macro,
|
||||
there must be some other way alloca is supposed to work. */
|
||||
#ifndef alloca
|
||||
# ifndef alloca
|
||||
|
||||
#ifdef emacs
|
||||
#ifdef static
|
||||
# ifdef emacs
|
||||
# ifdef static
|
||||
/* actually, only want this if static is defined as ""
|
||||
-- this is for usg, in which emacs must undefine static
|
||||
in order to make unexec workable
|
||||
*/
|
||||
#ifndef STACK_DIRECTION
|
||||
# ifndef STACK_DIRECTION
|
||||
you
|
||||
lose
|
||||
-- must know STACK_DIRECTION at compile-time
|
||||
#endif /* STACK_DIRECTION undefined */
|
||||
#endif /* static */
|
||||
#endif /* emacs */
|
||||
# endif /* STACK_DIRECTION undefined */
|
||||
# endif /* static */
|
||||
# endif /* emacs */
|
||||
|
||||
/* If your stack is a linked list of frames, you have to
|
||||
provide an "address metric" ADDRESS_FUNCTION macro. */
|
||||
|
||||
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||
long i00afunc ();
|
||||
#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
|
||||
#else
|
||||
#define ADDRESS_FUNCTION(arg) &(arg)
|
||||
#endif
|
||||
# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
|
||||
# else
|
||||
# define ADDRESS_FUNCTION(arg) &(arg)
|
||||
# endif
|
||||
|
||||
#if __STDC__
|
||||
# if __STDC__
|
||||
typedef void *pointer;
|
||||
#else
|
||||
# else
|
||||
typedef char *pointer;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#define NULL 0
|
||||
# ifndef NULL
|
||||
# define NULL 0
|
||||
# endif
|
||||
|
||||
/* Different portions of Emacs need to call different versions of
|
||||
malloc. The Emacs executable needs alloca to call xmalloc, because
|
||||
@@ -78,9 +80,9 @@ typedef char *pointer;
|
||||
|
||||
Callers below should use malloc. */
|
||||
|
||||
#ifndef emacs
|
||||
#define malloc xmalloc
|
||||
#endif
|
||||
# ifndef emacs
|
||||
# define malloc xmalloc
|
||||
# endif
|
||||
extern pointer malloc ();
|
||||
|
||||
/* Define STACK_DIRECTION if you know the direction of stack
|
||||
@@ -91,18 +93,18 @@ extern pointer malloc ();
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
|
||||
#ifndef STACK_DIRECTION
|
||||
#define STACK_DIRECTION 0 /* Direction unknown. */
|
||||
#endif
|
||||
# ifndef STACK_DIRECTION
|
||||
# define STACK_DIRECTION 0 /* Direction unknown. */
|
||||
# endif
|
||||
|
||||
#if STACK_DIRECTION != 0
|
||||
# if STACK_DIRECTION != 0
|
||||
|
||||
#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
|
||||
# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
|
||||
|
||||
#else /* STACK_DIRECTION == 0; need run-time code. */
|
||||
# else /* STACK_DIRECTION == 0; need run-time code. */
|
||||
|
||||
static int stack_dir; /* 1 or -1 once known. */
|
||||
#define STACK_DIR stack_dir
|
||||
# define STACK_DIR stack_dir
|
||||
|
||||
static void
|
||||
find_stack_direction ()
|
||||
@@ -126,7 +128,7 @@ find_stack_direction ()
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* STACK_DIRECTION == 0 */
|
||||
# endif /* STACK_DIRECTION == 0 */
|
||||
|
||||
/* An "alloca header" is used to:
|
||||
(a) chain together all alloca'ed blocks;
|
||||
@@ -135,9 +137,9 @@ find_stack_direction ()
|
||||
It is very important that sizeof(header) agree with malloc
|
||||
alignment chunk size. The following default should work okay. */
|
||||
|
||||
#ifndef ALIGN_SIZE
|
||||
#define ALIGN_SIZE sizeof(double)
|
||||
#endif
|
||||
# ifndef ALIGN_SIZE
|
||||
# define ALIGN_SIZE sizeof(double)
|
||||
# endif
|
||||
|
||||
typedef union hdr
|
||||
{
|
||||
@@ -165,20 +167,20 @@ alloca (size)
|
||||
auto char probe; /* Probes stack depth: */
|
||||
register char *depth = ADDRESS_FUNCTION (probe);
|
||||
|
||||
#if STACK_DIRECTION == 0
|
||||
# if STACK_DIRECTION == 0
|
||||
if (STACK_DIR == 0) /* Unknown growth direction. */
|
||||
find_stack_direction ();
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* Reclaim garbage, defined as all alloca'd storage that
|
||||
was allocated from deeper in the stack than currently. */
|
||||
was allocated from deeper in the stack than currently. */
|
||||
|
||||
{
|
||||
register header *hp; /* Traverses linked list. */
|
||||
|
||||
#ifdef emacs
|
||||
# ifdef emacs
|
||||
BLOCK_INPUT;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
for (hp = last_alloca_header; hp != NULL;)
|
||||
if ((STACK_DIR > 0 && hp->h.deep > depth)
|
||||
@@ -195,9 +197,9 @@ alloca (size)
|
||||
|
||||
last_alloca_header = hp; /* -> last valid storage. */
|
||||
|
||||
#ifdef emacs
|
||||
# ifdef emacs
|
||||
UNBLOCK_INPUT;
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
|
||||
if (size == 0)
|
||||
@@ -220,15 +222,15 @@ alloca (size)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||
|
||||
#ifdef DEBUG_I00AFUNC
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
# ifdef DEBUG_I00AFUNC
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
|
||||
#ifndef CRAY_STACK
|
||||
#define CRAY_STACK
|
||||
#ifndef CRAY2
|
||||
# ifndef CRAY_STACK
|
||||
# define CRAY_STACK
|
||||
# ifndef CRAY2
|
||||
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
|
||||
struct stack_control_header
|
||||
{
|
||||
@@ -280,7 +282,7 @@ struct stack_segment_linkage
|
||||
long sss7;
|
||||
};
|
||||
|
||||
#else /* CRAY2 */
|
||||
# else /* CRAY2 */
|
||||
/* The following structure defines the vector of words
|
||||
returned by the STKSTAT library routine. */
|
||||
struct stk_stat
|
||||
@@ -333,12 +335,12 @@ struct stk_trailer
|
||||
long unknown14;
|
||||
};
|
||||
|
||||
#endif /* CRAY2 */
|
||||
#endif /* not CRAY_STACK */
|
||||
# endif /* CRAY2 */
|
||||
# endif /* not CRAY_STACK */
|
||||
|
||||
#ifdef CRAY2
|
||||
# ifdef CRAY2
|
||||
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
||||
I doubt that "lint" will like this much. */
|
||||
I doubt that "lint" will like this much. */
|
||||
|
||||
static long
|
||||
i00afunc (long *address)
|
||||
@@ -407,7 +409,7 @@ i00afunc (long *address)
|
||||
return (result);
|
||||
}
|
||||
|
||||
#else /* not CRAY2 */
|
||||
# else /* not CRAY2 */
|
||||
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
|
||||
Determine the number of the cell within the stack,
|
||||
given the address of the cell. The purpose of this
|
||||
@@ -452,9 +454,9 @@ i00afunc (long address)
|
||||
|
||||
while (!(this_segment <= address && address <= stkl))
|
||||
{
|
||||
#ifdef DEBUG_I00AFUNC
|
||||
# ifdef DEBUG_I00AFUNC
|
||||
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
|
||||
#endif
|
||||
# endif
|
||||
if (pseg == 0)
|
||||
break;
|
||||
stkl = stkl - pseg;
|
||||
@@ -473,9 +475,9 @@ i00afunc (long address)
|
||||
|
||||
while (pseg != 0)
|
||||
{
|
||||
#ifdef DEBUG_I00AFUNC
|
||||
# ifdef DEBUG_I00AFUNC
|
||||
fprintf (stderr, "%011o %011o\n", pseg, size);
|
||||
#endif
|
||||
# endif
|
||||
stkl = stkl - pseg;
|
||||
ssptr = (struct stack_segment_linkage *) stkl;
|
||||
size = ssptr->sssize;
|
||||
@@ -485,8 +487,8 @@ i00afunc (long address)
|
||||
return (result);
|
||||
}
|
||||
|
||||
#endif /* not CRAY2 */
|
||||
#endif /* CRAY */
|
||||
# endif /* not CRAY2 */
|
||||
# endif /* CRAY */
|
||||
|
||||
#endif /* no alloca */
|
||||
# endif /* no alloca */
|
||||
#endif /* not GCC version 2 */
|
||||
|
||||
@@ -1,15 +1,30 @@
|
||||
/* basename.c -- return the last element in a path */
|
||||
/* basename.c -- return the last element in a path
|
||||
Copyright (C) 1990, 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. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef FILESYSTEM_PREFIX_LEN
|
||||
# define FILESYSTEM_PREFIX_LEN(f) 0
|
||||
# define FILESYSTEM_PREFIX_LEN(Filename) 0
|
||||
#endif
|
||||
|
||||
#ifndef ISSLASH
|
||||
# define ISSLASH(c) ((c) == '/')
|
||||
# define ISSLASH(C) ((C) == '/')
|
||||
#endif
|
||||
|
||||
/* In general, we can't use the builtin `basename' function if available,
|
||||
@@ -17,8 +32,7 @@
|
||||
In some environments the builtin `basename' modifies its argument. */
|
||||
|
||||
char *
|
||||
base_name (name)
|
||||
char const *name;
|
||||
base_name (char const *name)
|
||||
{
|
||||
char const *base = name += FILESYSTEM_PREFIX_LEN (name);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# define _(Text) Text
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#ifndef EXIT_FAILURE
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
89
lib/error.c
89
lib/error.c
@@ -1,23 +1,27 @@
|
||||
/* error.c -- error handler for noninteractive utilities
|
||||
Copyright (C) 1990, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
/* Error handler for noninteractive utilities
|
||||
Copyright (C) 1990,91,92,93,94,95,96,97,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 file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -43,13 +47,12 @@
|
||||
void exit ();
|
||||
#endif
|
||||
|
||||
#include "error.h"
|
||||
|
||||
#ifndef _
|
||||
# define _(String) String
|
||||
#endif
|
||||
|
||||
/* Get prototypes for the functions defined here. */
|
||||
#include <error.h>
|
||||
|
||||
/* If NULL, error will flush stdout, then print on stderr the program
|
||||
name, a colon and a space. Otherwise, error will call this
|
||||
function without parameters instead. */
|
||||
@@ -68,17 +71,25 @@ unsigned int error_message_count;
|
||||
# define program_name program_invocation_name
|
||||
# include <errno.h>
|
||||
|
||||
/* In GNU libc we want do not want to use the common name `error' directly.
|
||||
Instead make it a weak alias. */
|
||||
# define error __error
|
||||
# define error_at_line __error_at_line
|
||||
|
||||
#else /* not _LIBC */
|
||||
|
||||
/* The calling program should define program_name and set it to the
|
||||
name of the executing program. */
|
||||
extern char *program_name;
|
||||
|
||||
# if HAVE_STRERROR
|
||||
# ifndef strerror /* On some systems, strerror is a macro */
|
||||
char *strerror ();
|
||||
# endif
|
||||
# ifdef HAVE_STRERROR_R
|
||||
# define __strerror_r strerror_r
|
||||
# else
|
||||
# if HAVE_STRERROR
|
||||
# ifndef strerror /* On some systems, strerror is a macro */
|
||||
char *strerror ();
|
||||
# endif
|
||||
# else
|
||||
static char *
|
||||
private_strerror (errnum)
|
||||
int errnum;
|
||||
@@ -87,12 +98,12 @@ private_strerror (errnum)
|
||||
extern int sys_nerr;
|
||||
|
||||
if (errnum > 0 && errnum <= sys_nerr)
|
||||
return sys_errlist[errnum];
|
||||
return _(sys_errlist[errnum]);
|
||||
return _("Unknown system error");
|
||||
}
|
||||
# define strerror private_strerror
|
||||
# endif /* HAVE_STRERROR */
|
||||
|
||||
# define strerror private_strerror
|
||||
# endif /* HAVE_STRERROR */
|
||||
# endif /* HAVE_STRERROR_R */
|
||||
#endif /* not _LIBC */
|
||||
|
||||
/* Print the program name and error message MESSAGE, which is a printf-style
|
||||
@@ -102,7 +113,7 @@ private_strerror (errnum)
|
||||
/* VARARGS */
|
||||
|
||||
void
|
||||
#if defined(VA_START) && __STDC__
|
||||
#if defined VA_START && __STDC__
|
||||
error (int status, int errnum, const char *message, ...)
|
||||
#else
|
||||
error (status, errnum, message, va_alist)
|
||||
@@ -138,7 +149,14 @@ error (status, errnum, message, va_alist)
|
||||
|
||||
++error_message_count;
|
||||
if (errnum)
|
||||
fprintf (stderr, ": %s", strerror (errnum));
|
||||
{
|
||||
#if defined HAVE_STRERROR_R || defined _LIBC
|
||||
char errbuf[1024];
|
||||
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
|
||||
#else
|
||||
fprintf (stderr, ": %s", strerror (errnum));
|
||||
#endif
|
||||
}
|
||||
putc ('\n', stderr);
|
||||
fflush (stderr);
|
||||
if (status)
|
||||
@@ -150,7 +168,7 @@ error (status, errnum, message, va_alist)
|
||||
int error_one_per_line;
|
||||
|
||||
void
|
||||
#if defined(VA_START) && __STDC__
|
||||
#if defined VA_START && __STDC__
|
||||
error_at_line (int status, int errnum, const char *file_name,
|
||||
unsigned int line_number, const char *message, ...)
|
||||
#else
|
||||
@@ -206,9 +224,24 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist)
|
||||
|
||||
++error_message_count;
|
||||
if (errnum)
|
||||
fprintf (stderr, ": %s", strerror (errnum));
|
||||
{
|
||||
#if defined HAVE_STRERROR_R || defined _LIBC
|
||||
char errbuf[1024];
|
||||
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
|
||||
#else
|
||||
fprintf (stderr, ": %s", strerror (errnum));
|
||||
#endif
|
||||
}
|
||||
putc ('\n', stderr);
|
||||
fflush (stderr);
|
||||
if (status)
|
||||
exit (status);
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Make the weak alias. */
|
||||
# undef error
|
||||
# undef error_at_line
|
||||
weak_alias (__error, error)
|
||||
weak_alias (__error_at_line, error_at_line)
|
||||
#endif
|
||||
|
||||
57
lib/error.h
57
lib/error.h
@@ -1,10 +1,14 @@
|
||||
/* error.h -- declaration for error-reporting function
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Declaration for error-reporting function
|
||||
Copyright (C) 1995, 1996, 1997 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.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -12,26 +16,31 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifndef ERROR_H_
|
||||
# define ERROR_H_
|
||||
#ifndef _ERROR_H
|
||||
#define _ERROR_H 1
|
||||
|
||||
# ifndef __attribute__
|
||||
#ifndef __attribute__
|
||||
/* This feature is available in gcc versions 2.5 and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
/* The __-protected variants of `format' and `printf' attributes
|
||||
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __format__ format
|
||||
# define __printf__ printf
|
||||
# endif
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __format__ format
|
||||
# define __printf__ printf
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# if defined (__STDC__) && __STDC__
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
|
||||
/* Print a message with `fprintf (stderr, FORMAT, ...)';
|
||||
if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
|
||||
@@ -49,11 +58,11 @@ extern void error_at_line (int status, int errnum, const char *fname,
|
||||
function without parameters instead. */
|
||||
extern void (*error_print_progname) (void);
|
||||
|
||||
# else
|
||||
#else
|
||||
void error ();
|
||||
void error_at_line ();
|
||||
extern void (*error_print_progname) ();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* This variable is incremented each time `error' is called. */
|
||||
extern unsigned int error_message_count;
|
||||
@@ -62,4 +71,8 @@ extern unsigned int error_message_count;
|
||||
variable controls whether this mode is selected or not. */
|
||||
extern int error_one_per_line;
|
||||
|
||||
#endif /* not ERROR_H_ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* error.h */
|
||||
|
||||
@@ -21,7 +21,7 @@ Suite 330, Boston, MA 02111-1307, USA. */
|
||||
/* Written by David MacKenzie and Torbjorn Granlund.
|
||||
Adapted for GNU C library by Roland McGrath. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -111,7 +111,7 @@ static gid_t egid;
|
||||
/* Nonzero if UID, GID, EUID, and EGID have valid values. */
|
||||
static int have_ids = 0;
|
||||
|
||||
# ifdef HAVE_GETGROUPS
|
||||
# if HAVE_GETGROUPS
|
||||
int group_member ();
|
||||
# else
|
||||
# define group_member(gid) 0
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/* Written by Brian L. Matthews, blm@6sceng.UUCP. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* filemode.c -- make a string describing file modes
|
||||
Copyright (C) 1985, 1990, 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1985, 1990, 1993, 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
|
||||
@@ -15,8 +15,8 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -47,45 +47,45 @@
|
||||
#endif
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISBLK
|
||||
#undef S_ISCHR
|
||||
#undef S_ISDIR
|
||||
#undef S_ISFIFO
|
||||
#undef S_ISLNK
|
||||
#undef S_ISMPB
|
||||
#undef S_ISMPC
|
||||
#undef S_ISNWK
|
||||
#undef S_ISREG
|
||||
#undef S_ISSOCK
|
||||
# undef S_ISBLK
|
||||
# undef S_ISCHR
|
||||
# undef S_ISDIR
|
||||
# undef S_ISFIFO
|
||||
# undef S_ISLNK
|
||||
# undef S_ISMPB
|
||||
# undef S_ISMPC
|
||||
# undef S_ISNWK
|
||||
# undef S_ISREG
|
||||
# undef S_ISSOCK
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
|
||||
#if !defined(S_ISBLK) && defined(S_IFBLK)
|
||||
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
#endif
|
||||
#if !defined(S_ISCHR) && defined(S_IFCHR)
|
||||
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
#endif
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
#if !defined(S_ISREG) && defined(S_IFREG)
|
||||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
#if !defined(S_ISFIFO) && defined(S_IFIFO)
|
||||
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
#endif
|
||||
#if !defined(S_ISLNK) && defined(S_IFLNK)
|
||||
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
#endif
|
||||
#if !defined(S_ISSOCK) && defined(S_IFSOCK)
|
||||
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
||||
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
||||
#endif
|
||||
#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
|
||||
#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
|
||||
#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
|
||||
# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
|
||||
# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
|
||||
#endif
|
||||
#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
|
||||
#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
|
||||
# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
|
||||
#endif
|
||||
|
||||
void mode_string ();
|
||||
|
||||
@@ -1,37 +1,52 @@
|
||||
/* Copyright (C) 1991, 1992, 1993, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Enable GNU extensions in fnmatch.h. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <fnmatch.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if defined (STDC_HEADERS) || !defined (isascii)
|
||||
# define ISASCII(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
Library, but also included in many other GNU distributions. Compiling
|
||||
and linking in this code is a waste when using the GNU C library
|
||||
(especially if it is a shared library). Rather than having every GNU
|
||||
program understand `configure --with-gnu-libc' and omit the object files,
|
||||
it is simpler to just do this in the source for each such file. */
|
||||
|
||||
#if defined _LIBC || !defined __GNU_LIBRARY__
|
||||
|
||||
|
||||
# if defined STDC_HEADERS || !defined isascii
|
||||
# define ISASCII(c) 1
|
||||
# else
|
||||
# define ISASCII(c) isascii(c)
|
||||
# endif
|
||||
|
||||
# define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||
|
||||
|
||||
# ifndef errno
|
||||
extern int errno;
|
||||
@@ -49,7 +64,7 @@ fnmatch (pattern, string, flags)
|
||||
register char c;
|
||||
|
||||
/* Note that this evaluates C many times. */
|
||||
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||
|
||||
while ((c = *p++) != '\0')
|
||||
{
|
||||
@@ -71,6 +86,9 @@ fnmatch (pattern, string, flags)
|
||||
if (!(flags & FNM_NOESCAPE))
|
||||
{
|
||||
c = *p++;
|
||||
if (c == '\0')
|
||||
/* Trailing \ loses. */
|
||||
return FNM_NOMATCH;
|
||||
c = FOLD (c);
|
||||
}
|
||||
if (FOLD (*n) != c)
|
||||
@@ -82,10 +100,24 @@ fnmatch (pattern, string, flags)
|
||||
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
|
||||
if (((flags & FNM_FILE_NAME) && *n == '/') ||
|
||||
(c == '?' && *n == '\0'))
|
||||
return FNM_NOMATCH;
|
||||
for (c = *p++; c == '?' || c == '*'; c = *p++)
|
||||
{
|
||||
if ((flags & FNM_FILE_NAME) && *n == '/')
|
||||
/* A slash does not match a wildcard under FNM_FILE_NAME. */
|
||||
return FNM_NOMATCH;
|
||||
else if (c == '?')
|
||||
{
|
||||
/* A ? needs to match one character. */
|
||||
if (*n == '\0')
|
||||
/* There isn't another character; no match. */
|
||||
return FNM_NOMATCH;
|
||||
else
|
||||
/* One character of the string is consumed in matching
|
||||
this ? wildcard, so *??? won't match if there are
|
||||
less than three characters. */
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
if (c == '\0')
|
||||
return 0;
|
||||
@@ -122,7 +154,11 @@ fnmatch (pattern, string, flags)
|
||||
register char cstart = c, cend = c;
|
||||
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
cstart = cend = *p++;
|
||||
{
|
||||
if (*p == '\0')
|
||||
return FNM_NOMATCH;
|
||||
cstart = cend = *p++;
|
||||
}
|
||||
|
||||
cstart = cend = FOLD (cstart);
|
||||
|
||||
@@ -169,8 +205,12 @@ fnmatch (pattern, string, flags)
|
||||
|
||||
c = *p++;
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
/* XXX 1003.2d11 is unclear if this is right. */
|
||||
++p;
|
||||
{
|
||||
if (*p == '\0')
|
||||
return FNM_NOMATCH;
|
||||
/* XXX 1003.2d11 is unclear if this is right. */
|
||||
++p;
|
||||
}
|
||||
}
|
||||
if (not)
|
||||
return FNM_NOMATCH;
|
||||
@@ -196,3 +236,5 @@ fnmatch (pattern, string, flags)
|
||||
|
||||
# undef FOLD
|
||||
}
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
|
||||
@@ -26,6 +26,13 @@
|
||||
#include <sys/stat.h>
|
||||
#include "fsusage.h"
|
||||
|
||||
#if HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
#ifndef CHAR_BIT
|
||||
# define CHAR_BIT 8
|
||||
#endif
|
||||
|
||||
int statfs ();
|
||||
|
||||
#if HAVE_SYS_PARAM_H
|
||||
@@ -68,9 +75,22 @@ int statvfs ();
|
||||
/* Many space usage primitives use all 1 bits to denote a value that is
|
||||
not applicable or unknown. Propagate this information by returning
|
||||
a uintmax_t value that is all 1 bits if the argument is all 1 bits,
|
||||
even if the argument is unsigned and smaller than unitmax_t. */
|
||||
even if the argument is unsigned and smaller than uintmax_t. */
|
||||
#define PROPAGATE_ALL_ONES(x) ((x) == -1 ? (uintmax_t) -1 : (uintmax_t) (x))
|
||||
|
||||
/* Extract the top bit of X as an uintmax_t value. */
|
||||
#define EXTRACT_TOP_BIT(x) ((x) \
|
||||
& ((uintmax_t) 1 << (sizeof (x) * CHAR_BIT - 1)))
|
||||
|
||||
/* If a value is negative, many space usage primitives store it into an
|
||||
integer variable by assignment, even if the variable's type is unsigned.
|
||||
So, if a space usage variable X's top bit is set, convert X to the
|
||||
uintmax_t value V such that (- (uintmax_t) V) is the negative of
|
||||
the original value. If X's top bit is clear, just yield X.
|
||||
Use PROPAGATE_TOP_BIT if the original value might be negative;
|
||||
otherwise, use PROPAGATE_ALL_ONES. */
|
||||
#define PROPAGATE_TOP_BIT(x) ((x) | ~ (EXTRACT_TOP_BIT (x) - 1))
|
||||
|
||||
int safe_read ();
|
||||
|
||||
/* Fill in the fields of FSP with information about space usage for
|
||||
@@ -107,7 +127,8 @@ get_fs_usage (path, disk, fsp)
|
||||
fsp->fsu_blocksize = 1024;
|
||||
fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.fd_req.btot);
|
||||
fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.fd_req.bfree);
|
||||
fsp->fsu_bavail = PROPAGATE_ALL_ONES (fsd.fd_req.bfreen);
|
||||
fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.fd_req.bfreen);
|
||||
fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.fd_req.bfreen) != 0;
|
||||
fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.fd_req.gtot);
|
||||
fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.fd_req.gfree);
|
||||
|
||||
@@ -141,7 +162,8 @@ get_fs_usage (path, disk, fsp)
|
||||
fsp->fsu_blocksize = (fsd.s_type == Fs2b ? 1024 : 512);
|
||||
fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.s_fsize);
|
||||
fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.s_tfree);
|
||||
fsp->fsu_bavail = PROPAGATE_ALL_ONES (fsd.s_tfree);
|
||||
fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.s_tfree);
|
||||
fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.s_tfree) != 0;
|
||||
fsp->fsu_files = (fsd.s_isize == -1
|
||||
? (uintmax_t) -1
|
||||
: (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1));
|
||||
@@ -226,7 +248,8 @@ get_fs_usage (path, disk, fsp)
|
||||
|
||||
fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.f_blocks);
|
||||
fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.f_bfree);
|
||||
fsp->fsu_bavail = PROPAGATE_ALL_ONES (fsd.f_bavail);
|
||||
fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.f_bavail);
|
||||
fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.f_bavail) != 0;
|
||||
fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.f_files);
|
||||
fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.f_ffree);
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ struct fs_usage
|
||||
uintmax_t fsu_blocks; /* Total blocks. */
|
||||
uintmax_t fsu_bfree; /* Free blocks available to superuser. */
|
||||
uintmax_t fsu_bavail; /* Free blocks available to non-superuser. */
|
||||
int fsu_bavail_top_bit_set; /* 1 if fsu_bavail represents a value < 0. */
|
||||
uintmax_t fsu_files; /* Total file nodes. */
|
||||
uintmax_t fsu_ffree; /* Free file nodes. */
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* ftruncate emulations that work on some System V's.
|
||||
This file is in the public domain. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -19,15 +19,15 @@ ftruncate (fd, length)
|
||||
}
|
||||
|
||||
#else /* not F_CHSIZE */
|
||||
#ifdef F_FREESP
|
||||
# ifdef F_FREESP
|
||||
|
||||
/* By William Kucharski <kucharsk@netcom.com>. */
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
# include <sys/stat.h>
|
||||
# include <errno.h>
|
||||
# if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
# endif
|
||||
|
||||
int
|
||||
ftruncate (fd, length)
|
||||
@@ -71,8 +71,8 @@ ftruncate (fd, length)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else /* not F_CHSIZE nor F_FREESP */
|
||||
#ifdef HAVE_CHSIZE
|
||||
# else /* not F_CHSIZE nor F_FREESP */
|
||||
# if HAVE_CHSIZE
|
||||
|
||||
int
|
||||
ftruncate (fd, length)
|
||||
@@ -82,12 +82,12 @@ ftruncate (fd, length)
|
||||
return chsize (fd, length);
|
||||
}
|
||||
|
||||
#else /* not F_CHSIZE nor F_FREESP nor HAVE_CHSIZE */
|
||||
# else /* not F_CHSIZE nor F_FREESP nor HAVE_CHSIZE */
|
||||
|
||||
#include <errno.h>
|
||||
#ifndef errno
|
||||
# include <errno.h>
|
||||
# ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
int
|
||||
ftruncate (fd, length)
|
||||
@@ -98,6 +98,6 @@ ftruncate (fd, length)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif /* not HAVE_CHSIZE */
|
||||
#endif /* not F_FREESP */
|
||||
# endif /* not HAVE_CHSIZE */
|
||||
# endif /* not F_FREESP */
|
||||
#endif /* not F_CHSIZE */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* full-write.c -- an interface to write that retries after interrupts
|
||||
Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 1994, 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
|
||||
@@ -37,10 +37,7 @@ extern int errno;
|
||||
Return LEN upon success, write's (negative) error code otherwise. */
|
||||
|
||||
int
|
||||
full_write (desc, ptr, len)
|
||||
int desc;
|
||||
char *ptr;
|
||||
size_t len;
|
||||
full_write (int desc, const char *ptr, size_t len)
|
||||
{
|
||||
int total_written;
|
||||
|
||||
|
||||
46
lib/getdate.h
Normal file
46
lib/getdate.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* Copyright (C) 1995, 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
|
||||
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. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef vms
|
||||
# include <types.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# include <sys/types.h>
|
||||
# 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
|
||||
#endif /* defined (vms) */
|
||||
|
||||
time_t get_date PARAMS ((const char *p, const time_t *now));
|
||||
@@ -439,7 +439,7 @@ o_merid : /* NULL */
|
||||
/* Include this file down here because bison inserts code above which
|
||||
may define-away `const'. We want the prototype for get_date to have
|
||||
the same signature as the function definition does. */
|
||||
#include "get-date.h"
|
||||
#include "getdate.h"
|
||||
|
||||
extern struct tm *gmtime ();
|
||||
extern struct tm *localtime ();
|
||||
|
||||
22
lib/getopt.c
22
lib/getopt.c
@@ -701,16 +701,18 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
{
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
}
|
||||
|
||||
nextchar += strlen (nextchar);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* getugroups.c -- return a list of the groups a user is in
|
||||
Copyright (C) 1990, 1991 Free Software Foundation.
|
||||
Copyright (C) 1990, 1991, 1998 Free Software Foundation.
|
||||
|
||||
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
|
||||
@@ -45,10 +45,7 @@ struct group *getgrent ();
|
||||
the current process. */
|
||||
|
||||
int
|
||||
getugroups (maxcount, grouplist, username)
|
||||
int maxcount;
|
||||
GETGROUPS_T *grouplist;
|
||||
char *username;
|
||||
getugroups (int maxcount, GETGROUPS_T *grouplist, char *username)
|
||||
{
|
||||
struct group *grp;
|
||||
register char **cp;
|
||||
@@ -59,16 +56,27 @@ getugroups (maxcount, grouplist, username)
|
||||
for (cp = grp->gr_mem; *cp; ++cp)
|
||||
if (!strcmp (username, *cp))
|
||||
{
|
||||
if (maxcount != 0)
|
||||
int n;
|
||||
|
||||
/* See if this group number is already on the list. */
|
||||
for (n = 0; n < count; ++n)
|
||||
if (grouplist[n] == grp->gr_gid)
|
||||
break;
|
||||
|
||||
/* If it's a new group number, then try to add it to the list. */
|
||||
if (n == count)
|
||||
{
|
||||
if (count >= maxcount)
|
||||
if (maxcount != 0)
|
||||
{
|
||||
endgrent ();
|
||||
return count;
|
||||
if (count >= maxcount)
|
||||
{
|
||||
endgrent ();
|
||||
return count;
|
||||
}
|
||||
grouplist[count] = grp->gr_gid;
|
||||
}
|
||||
grouplist[count] = grp->gr_gid;
|
||||
count++;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
endgrent ();
|
||||
return count;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* group-member.c -- determine whether group id is in calling user's group list
|
||||
Copyright (C) 1994, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994, 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
|
||||
@@ -15,7 +15,7 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
@@ -41,7 +41,7 @@ struct group_info
|
||||
GETGROUPS_T *group;
|
||||
};
|
||||
|
||||
#ifdef HAVE_GETGROUPS
|
||||
#if HAVE_GETGROUPS
|
||||
|
||||
static void
|
||||
free_group_info (struct group_info *g)
|
||||
|
||||
1409
lib/hash.c
1409
lib/hash.c
File diff suppressed because it is too large
Load Diff
266
lib/hash.h
266
lib/hash.h
@@ -1,193 +1,103 @@
|
||||
#ifndef HASH_H
|
||||
# define HASH_H 1
|
||||
/* hash - hashing table processing.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
Written by Jim Meyering <meyering@ascend.com>, 1998.
|
||||
|
||||
# if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
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. */
|
||||
|
||||
/* A generic hash table package. */
|
||||
|
||||
/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
|
||||
obstacks instead of malloc, and recompile `hash.c' with same setting. */
|
||||
|
||||
#ifndef PARAMS
|
||||
# if PROTOTYPES || __STDC__
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# include <stdio.h>
|
||||
# include <assert.h>
|
||||
typedef unsigned int (*Hash_hasher) PARAMS ((const void *, unsigned int));
|
||||
typedef bool (*Hash_comparator) PARAMS ((const void *, const void *));
|
||||
typedef void (*Hash_data_freer) PARAMS ((void *));
|
||||
typedef bool (*Hash_processor) PARAMS ((void *, void *));
|
||||
|
||||
# ifdef STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
# endif
|
||||
|
||||
# ifndef HAVE_DECL_FREE
|
||||
void free ();
|
||||
# endif
|
||||
|
||||
# ifndef HAVE_DECL_MALLOC
|
||||
char *malloc ();
|
||||
# endif
|
||||
|
||||
# ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# define USE_OBSTACK
|
||||
# ifdef USE_OBSTACK
|
||||
# include "obstack.h"
|
||||
# endif
|
||||
|
||||
# define obstack_chunk_alloc malloc
|
||||
# define obstack_chunk_free free
|
||||
|
||||
struct hash_ent
|
||||
struct hash_entry
|
||||
{
|
||||
void *key;
|
||||
struct hash_ent *next;
|
||||
};
|
||||
typedef struct hash_ent HASH_ENT;
|
||||
|
||||
/* This is particularly useful to cast uses in hash_initialize of the
|
||||
system free function. */
|
||||
typedef void (*Hash_key_freer_type) PARAMS((void *key));
|
||||
|
||||
struct HT
|
||||
{
|
||||
/* User-supplied function for freeing keys. It is specified in
|
||||
hash_initialize. If non-null, it is used by hash_free and
|
||||
hash_clear. You should specify `free' here only if you want
|
||||
these functions to free all of your `key' data. This is typically
|
||||
the case when your key is simply an auxilliary struct that you
|
||||
have malloc'd to aggregate several values. */
|
||||
Hash_key_freer_type hash_key_freer;
|
||||
|
||||
/* User-supplied hash function that hashes entry E to an integer
|
||||
in the range 0..TABLE_SIZE-1. */
|
||||
unsigned int (*hash_hash) PARAMS((const void *e, unsigned int table_size));
|
||||
|
||||
/* User-supplied function that determines whether a new entry is
|
||||
unique by comparing the new entry to entries that hashed to the
|
||||
same bucket index. It should return zero for a pair of entries
|
||||
that compare equal, non-zero otherwise. */
|
||||
|
||||
int (*hash_key_comparator) PARAMS((const void *, const void *));
|
||||
|
||||
HASH_ENT **hash_table;
|
||||
unsigned int hash_table_size;
|
||||
unsigned int hash_n_slots_used;
|
||||
unsigned int hash_max_chain_length;
|
||||
|
||||
/* Gets set when an entry is deleted from a chain of length
|
||||
hash_max_chain_length. Indicates that hash_max_chain_length
|
||||
may no longer be valid. */
|
||||
unsigned int hash_dirty_max_chain_length;
|
||||
|
||||
/* Sum of lengths of all chains (not counting any dummy
|
||||
header entries). */
|
||||
unsigned int hash_n_keys;
|
||||
|
||||
/* A linked list of freed HASH_ENT structs.
|
||||
FIXME: Perhaps this is unnecessary and we should simply free
|
||||
and reallocate such structs. */
|
||||
HASH_ENT *hash_free_entry_list;
|
||||
|
||||
/* FIXME: comment. */
|
||||
# ifdef USE_OBSTACK
|
||||
struct obstack ht_obstack;
|
||||
# endif
|
||||
void *data;
|
||||
struct hash_entry *next;
|
||||
};
|
||||
|
||||
typedef struct HT HT;
|
||||
struct hash_table
|
||||
{
|
||||
/* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
|
||||
for a possibility of N_BUCKETS. Among those, N_BUCKETS_USED buckets
|
||||
are not empty, there are N_ENTRIES active entries in the table. */
|
||||
struct hash_entry *bucket;
|
||||
struct hash_entry *bucket_limit;
|
||||
unsigned int n_buckets;
|
||||
unsigned int n_buckets_used;
|
||||
unsigned int n_entries;
|
||||
|
||||
unsigned int
|
||||
hash_get_n_slots_used PARAMS((const HT *ht));
|
||||
/* Three functions are given to `hash_initialize', see the documentation
|
||||
block for this function. In a word, HASHER randomizes a user entry
|
||||
into a number up from 0 up to some maximum minus 1; COMPARATOR returns
|
||||
true if two user entries compare equally; and DATA_FREER is the cleanup
|
||||
function for a user entry. */
|
||||
Hash_hasher hasher;
|
||||
Hash_comparator comparator;
|
||||
Hash_data_freer data_freer;
|
||||
|
||||
unsigned int
|
||||
hash_get_max_chain_length PARAMS((HT *ht));
|
||||
/* A linked list of freed struct hash_entry structs. */
|
||||
struct hash_entry *free_entry_list;
|
||||
|
||||
int
|
||||
hash_rehash PARAMS((HT *ht, unsigned int new_table_size));
|
||||
#if USE_OBSTACK
|
||||
/* Whenever obstacks are used, it is possible to allocate all overflowed
|
||||
entries into a single stack, so they all can be freed in a single
|
||||
operation. It is not clear if the speedup is worth the trouble. */
|
||||
struct obstack entry_stack;
|
||||
#endif
|
||||
};
|
||||
|
||||
unsigned int
|
||||
hash_get_table_size PARAMS((const HT *ht));
|
||||
typedef struct hash_table Hash_table;
|
||||
|
||||
HT *
|
||||
hash_initialize PARAMS((unsigned int table_size,
|
||||
void (*key_freer) PARAMS((void *key)),
|
||||
unsigned int (*hash) PARAMS((const void *,
|
||||
unsigned int)),
|
||||
int (*equality_tester) PARAMS((const void *,
|
||||
const void *))));
|
||||
/* Information and lookup. */
|
||||
unsigned int hash_get_n_buckets PARAMS ((const Hash_table *));
|
||||
unsigned int hash_get_n_buckets_used PARAMS ((const Hash_table *));
|
||||
unsigned int hash_get_n_entries PARAMS ((const Hash_table *));
|
||||
unsigned int hash_get_max_bucket_length PARAMS ((const Hash_table *));
|
||||
bool hash_table_ok PARAMS ((const Hash_table *));
|
||||
void hash_print_statistics PARAMS ((const Hash_table *, FILE *));
|
||||
void *hash_lookup PARAMS ((const Hash_table *, const void *));
|
||||
|
||||
unsigned int
|
||||
hash_get_n_keys PARAMS((const HT *ht));
|
||||
/* Walking. */
|
||||
void *hash_get_first PARAMS ((const Hash_table *));
|
||||
void *hash_get_next PARAMS ((const Hash_table *, const void *));
|
||||
unsigned int hash_get_entries PARAMS ((const Hash_table *, void **,
|
||||
unsigned int));
|
||||
unsigned int hash_do_for_each PARAMS ((const Hash_table *, Hash_processor,
|
||||
void *));
|
||||
|
||||
int
|
||||
hash_query_in_table PARAMS((const HT *ht, const void *e));
|
||||
/* Allocation and clean-up. */
|
||||
unsigned int hash_string PARAMS ((const char *, unsigned int));
|
||||
Hash_table *hash_initialize PARAMS ((unsigned int, Hash_hasher,
|
||||
Hash_comparator, Hash_data_freer));
|
||||
void hash_clear PARAMS ((Hash_table *));
|
||||
void hash_free PARAMS ((Hash_table *));
|
||||
|
||||
void *
|
||||
hash_lookup PARAMS((const HT *ht, const void *e));
|
||||
|
||||
void *
|
||||
hash_insert_if_absent PARAMS((HT *ht,
|
||||
const void *e,
|
||||
int *failed));
|
||||
|
||||
void *
|
||||
hash_delete_if_present PARAMS((HT *ht, const void *e));
|
||||
|
||||
void
|
||||
hash_print_statistics PARAMS((const HT *ht, FILE *stream));
|
||||
|
||||
int
|
||||
hash_get_statistics PARAMS((const HT *ht, unsigned int *n_slots_used,
|
||||
unsigned int *n_keys,
|
||||
unsigned int *max_chain_length));
|
||||
|
||||
int
|
||||
hash_table_ok PARAMS((HT *ht));
|
||||
|
||||
void
|
||||
hash_do_for_each PARAMS((HT *ht,
|
||||
void (*f) PARAMS((void *e, void *aux)),
|
||||
void *aux));
|
||||
|
||||
int
|
||||
hash_do_for_each_2 PARAMS((HT *ht,
|
||||
int (*f) PARAMS((void *e, void *aux)),
|
||||
void *aux));
|
||||
|
||||
int
|
||||
hash_do_for_each_in_selected_bucket PARAMS((HT *ht,
|
||||
const void *key,
|
||||
int (*f) PARAMS((const void *bucket_key,
|
||||
void *e,
|
||||
void *aux)),
|
||||
void *aux));
|
||||
|
||||
void
|
||||
hash_clear PARAMS((HT *ht));
|
||||
|
||||
void
|
||||
hash_free PARAMS((HT *ht));
|
||||
|
||||
void
|
||||
hash_get_key_list PARAMS((const HT *ht,
|
||||
unsigned int bufsize,
|
||||
void **buf));
|
||||
|
||||
void *
|
||||
hash_get_first PARAMS((const HT *ht));
|
||||
|
||||
void *
|
||||
hash_get_next PARAMS((const HT *ht, const void *e));
|
||||
|
||||
/* This interface to hash_insert_if_absent is used frequently enough to
|
||||
merit a macro here. */
|
||||
|
||||
# define HASH_INSERT_NEW_ITEM(Ht, Item, Failp) \
|
||||
do \
|
||||
{ \
|
||||
void *_already; \
|
||||
_already = hash_insert_if_absent ((Ht), (Item), Failp); \
|
||||
assert (_already == NULL); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#endif /* HASH_H */
|
||||
/* Insertion and deletion. */
|
||||
bool hash_rehash PARAMS ((Hash_table *, unsigned int));
|
||||
void *hash_insert PARAMS ((Hash_table *, const void *, bool *));
|
||||
void *hash_delete PARAMS ((Hash_table *, const void *));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* idcache.c -- map user and group IDs, cached for speed
|
||||
Copyright (C) 1985, 1988, 1989, 1990, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1985, 1988, 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
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
#if STDC_HEADERS || HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
@@ -44,6 +44,10 @@ struct group *getgrnam ();
|
||||
char *xmalloc ();
|
||||
char *xstrdup ();
|
||||
|
||||
#ifdef __DJGPP__
|
||||
static char digits[] = "0123456789";
|
||||
#endif
|
||||
|
||||
struct userid
|
||||
{
|
||||
union
|
||||
@@ -55,23 +59,15 @@ struct userid
|
||||
struct userid *next;
|
||||
};
|
||||
|
||||
/* The members of this list have already been looked up.
|
||||
If a name is NULL, the corresponding id is not in the password file. */
|
||||
static struct userid *user_alist;
|
||||
|
||||
#ifdef NOT_USED
|
||||
/* The members of this list are names not in the local passwd file;
|
||||
their names are always not NULL, and their ids are irrelevant. */
|
||||
/* The members of this list have names not in the local passwd file. */
|
||||
static struct userid *nouser_alist;
|
||||
#endif /* NOT_USED */
|
||||
|
||||
/* Translate UID to a login name, with cache.
|
||||
If UID cannot be resolved, return NULL.
|
||||
Cache lookup failures, too. */
|
||||
/* Translate UID to a login name, with cache, or NULL if unresolved. */
|
||||
|
||||
char *
|
||||
getuser (uid)
|
||||
uid_t uid;
|
||||
getuser (uid_t uid)
|
||||
{
|
||||
register struct userid *tail;
|
||||
struct passwd *pwent;
|
||||
@@ -83,31 +79,28 @@ getuser (uid)
|
||||
pwent = getpwuid (uid);
|
||||
tail = (struct userid *) xmalloc (sizeof (struct userid));
|
||||
tail->id.u = uid;
|
||||
tail->name = (pwent ? xstrdup (pwent->pw_name) : NULL);
|
||||
tail->name = pwent ? xstrdup (pwent->pw_name) : NULL;
|
||||
|
||||
/* Add to the head of the list, so most recently added is first. */
|
||||
/* Add to the head of the list, so most recently used is first. */
|
||||
tail->next = user_alist;
|
||||
user_alist = tail;
|
||||
return tail->name;
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
|
||||
/* Translate USER to a UID, with cache.
|
||||
Return NULL if there is no such user.
|
||||
(We also cache which user names have no passwd entry,
|
||||
so we don't keep looking them up.) */
|
||||
|
||||
uid_t *
|
||||
getuidbyname (user)
|
||||
const char *user;
|
||||
getuidbyname (const char *user)
|
||||
{
|
||||
register struct userid *tail;
|
||||
struct passwd *pwent;
|
||||
|
||||
for (tail = user_alist; tail; tail = tail->next)
|
||||
/* Avoid a function call for the most common case. */
|
||||
if (tail->name && *tail->name == *user && !strcmp (tail->name, user))
|
||||
if (*tail->name == *user && !strcmp (tail->name, user))
|
||||
return &tail->id.u;
|
||||
|
||||
for (tail = nouser_alist; tail; tail = tail->next)
|
||||
@@ -116,11 +109,20 @@ getuidbyname (user)
|
||||
return 0;
|
||||
|
||||
pwent = getpwnam (user);
|
||||
#ifdef __DJGPP__
|
||||
/* We need to pretend to be the user USER, to make
|
||||
pwd functions know about an arbitrary user name. */
|
||||
if (!pwent && strspn (user, digits) < strlen (user))
|
||||
{
|
||||
setenv ("USER", user, 1);
|
||||
pwent = getpwnam (user); /* now it will succeed */
|
||||
}
|
||||
#endif
|
||||
|
||||
tail = (struct userid *) xmalloc (sizeof (struct userid));
|
||||
tail->name = xstrdup (user);
|
||||
|
||||
/* Add to the head of the list, so most recently added is first. */
|
||||
/* Add to the head of the list, so most recently used is first. */
|
||||
if (pwent)
|
||||
{
|
||||
tail->id.u = pwent->pw_uid;
|
||||
@@ -134,20 +136,14 @@ getuidbyname (user)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* NOT_USED */
|
||||
|
||||
/* Use the same struct as for userids. */
|
||||
static struct userid *group_alist;
|
||||
#ifdef NOT_USED
|
||||
static struct userid *nogroup_alist;
|
||||
#endif
|
||||
|
||||
/* Translate GID to a group name, with cache.
|
||||
Return NULL if the group has no name. */
|
||||
/* Translate GID to a group name, with cache, or NULL if unresolved. */
|
||||
|
||||
char *
|
||||
getgroup (gid)
|
||||
gid_t gid;
|
||||
getgroup (gid_t gid)
|
||||
{
|
||||
register struct userid *tail;
|
||||
struct group *grent;
|
||||
@@ -159,7 +155,7 @@ getgroup (gid)
|
||||
grent = getgrgid (gid);
|
||||
tail = (struct userid *) xmalloc (sizeof (struct userid));
|
||||
tail->id.g = gid;
|
||||
tail->name = (grent ? xstrdup (grent->gr_name) : NULL);
|
||||
tail->name = grent ? xstrdup (grent->gr_name) : NULL;
|
||||
|
||||
/* Add to the head of the list, so most recently used is first. */
|
||||
tail->next = group_alist;
|
||||
@@ -167,23 +163,20 @@ getgroup (gid)
|
||||
return tail->name;
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
|
||||
/* Translate GROUP to a GID, with cache.
|
||||
Return NULL if there is no such group.
|
||||
(We also cache which group names have no group entry,
|
||||
so we don't keep looking them up.) */
|
||||
|
||||
gid_t *
|
||||
getgidbyname (group)
|
||||
const char *group;
|
||||
getgidbyname (const char *group)
|
||||
{
|
||||
register struct userid *tail;
|
||||
struct group *grent;
|
||||
|
||||
for (tail = group_alist; tail; tail = tail->next)
|
||||
/* Avoid a function call for the most common case. */
|
||||
if (tail->name && *tail->name == *group && !strcmp (tail->name, group))
|
||||
if (*tail->name == *group && !strcmp (tail->name, group))
|
||||
return &tail->id.g;
|
||||
|
||||
for (tail = nogroup_alist; tail; tail = tail->next)
|
||||
@@ -192,6 +185,15 @@ getgidbyname (group)
|
||||
return 0;
|
||||
|
||||
grent = getgrnam (group);
|
||||
#ifdef __DJGPP__
|
||||
/* We need to pretend to belong to group GROUP, to make
|
||||
grp functions know about any arbitrary group name. */
|
||||
if (!grent && strspn (group, digits) < strlen (group))
|
||||
{
|
||||
setenv ("GROUP", group, 1);
|
||||
grent = getgrnam (group); /* now it will succeed */
|
||||
}
|
||||
#endif
|
||||
|
||||
tail = (struct userid *) xmalloc (sizeof (struct userid));
|
||||
tail->name = xstrdup (group);
|
||||
@@ -209,5 +211,3 @@ getgidbyname (group)
|
||||
nogroup_alist = tail;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* NOT_USED */
|
||||
|
||||
16
lib/isdir.c
16
lib/isdir.c
@@ -1,5 +1,5 @@
|
||||
/* isdir.c -- determine whether a directory exists
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 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
|
||||
@@ -15,19 +15,19 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISDIR
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
#if STAT_MACROS_BROKEN
|
||||
# undef S_ISDIR
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#if !defined S_ISDIR && defined S_IFDIR
|
||||
# define S_ISDIR(Mode) (((Mode) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
/* If PATH is an existing directory or symbolic link to a directory,
|
||||
|
||||
44
lib/lchown.c
Normal file
44
lib/lchown.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/* Provide a stub lchown function for systems that lack it.
|
||||
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. */
|
||||
|
||||
/* written by Jim Meyering */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/* Work just like chown, except when FILE is a symbolic link.
|
||||
In that case, set errno to ENOSYS and return -1. */
|
||||
|
||||
int
|
||||
lchown (const char *file, uid_t uid, gid_t gid)
|
||||
{
|
||||
struct stat stats;
|
||||
|
||||
if (lstat (file, &stats) == 0 && S_ISLNK (stats.st_mode))
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return chown (file, uid, gid);
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Torbjorn Granlund (tege@sics.se).
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
@@ -325,7 +325,7 @@ memcmp_not_common_alignment (srcp1, srcp2, len)
|
||||
}
|
||||
|
||||
int
|
||||
memcmp (s1, s2, len)
|
||||
rpl_memcmp (s1, s2, len)
|
||||
const __ptr_t s1;
|
||||
const __ptr_t s2;
|
||||
size_t len;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
/* mktime: convert a `struct tm' to a time_t value zzzzzz
|
||||
Copyright (C) 1993-1997, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Paul Eggert (eggert@twinsun.com).
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
@@ -79,7 +80,7 @@
|
||||
It is necessary at least when t == time_t. */
|
||||
#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
|
||||
? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
|
||||
#define TYPE_MAXIMUM(t) (~ (t) 0 - TYPE_MINIMUM (t))
|
||||
#define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
|
||||
|
||||
#ifndef INT_MIN
|
||||
# define INT_MIN TYPE_MINIMUM (int)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* mountlist.c -- return a list of mounted filesystems
|
||||
Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 1992, 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
|
||||
@@ -15,7 +15,7 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,7 @@ char *xrealloc ();
|
||||
char *xstrdup ();
|
||||
void error ();
|
||||
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#if HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
||||
@@ -101,7 +101,7 @@ void error ();
|
||||
# define MOUNTED_GETMNTTBL
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_MNTENT_H
|
||||
#if HAVE_SYS_MNTENT_H
|
||||
/* This is to get MNTOPT_IGNORE on e.g. SVR4. */
|
||||
# include <sys/mntent.h>
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* path-concat.c -- concatenate two arbitrary pathnames
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 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
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STRING_H
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
355
lib/quotearg.c
Normal file
355
lib/quotearg.c
Normal file
@@ -0,0 +1,355 @@
|
||||
/* quotearg.c - quote arguments for output
|
||||
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. */
|
||||
|
||||
/* Written by Paul Eggert <eggert@twinsun.com> */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <quotearg.h>
|
||||
#include <xalloc.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
# define ISASCII(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii (c)
|
||||
#endif
|
||||
#ifdef isgraph
|
||||
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||
#else
|
||||
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
|
||||
#endif
|
||||
|
||||
#if HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
#ifndef CHAR_BIT
|
||||
# define CHAR_BIT 8
|
||||
#endif
|
||||
#ifndef UCHAR_MAX
|
||||
# define UCHAR_MAX ((unsigned char) -1)
|
||||
#endif
|
||||
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
#define INT_BITS (sizeof (int) * CHAR_BIT)
|
||||
|
||||
struct quoting_options
|
||||
{
|
||||
/* Basic quoting style. */
|
||||
enum quoting_style style;
|
||||
|
||||
/* Quote the chararacters indicated by this bit vector even if the
|
||||
quoting style would not normally require them to be quoted. */
|
||||
int quote_these_too[((UCHAR_MAX + 1) / INT_BITS
|
||||
+ ((UCHAR_MAX + 1) % INT_BITS != 0))];
|
||||
};
|
||||
|
||||
/* Names of quoting styles. */
|
||||
char const *const quoting_style_args[] =
|
||||
{
|
||||
"literal", "shell", "shell-always", "c", "escape", 0
|
||||
};
|
||||
|
||||
/* The default quoting options. */
|
||||
static struct quoting_options default_quoting_options;
|
||||
|
||||
/* Allocate a new set of quoting options, with contents initially identical
|
||||
to O if O is not null, or to the default if O is null.
|
||||
It is the caller's responsibility to free the result. */
|
||||
struct quoting_options *
|
||||
clone_quoting_options (struct quoting_options *o)
|
||||
{
|
||||
struct quoting_options *p
|
||||
= (struct quoting_options *) xmalloc (sizeof (struct quoting_options));
|
||||
*p = *(o ? o : &default_quoting_options);
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Get the value of O's quoting style. If O is null, use the default. */
|
||||
enum quoting_style
|
||||
get_quoting_style (struct quoting_options *o)
|
||||
{
|
||||
return (o ? o : &default_quoting_options)->style;
|
||||
}
|
||||
|
||||
/* In O (or in the default if O is null),
|
||||
set the value of the quoting style to S. */
|
||||
void
|
||||
set_quoting_style (struct quoting_options *o, enum quoting_style s)
|
||||
{
|
||||
(o ? o : &default_quoting_options)->style = s;
|
||||
}
|
||||
|
||||
/* In O (or in the default if O is null),
|
||||
set the value of the quoting options for character C to I.
|
||||
Return the old value. Currently, the only values defined for I are
|
||||
0 (the default) and 1 (which means to quote the character even if
|
||||
it would not otherwise be quoted). */
|
||||
int
|
||||
set_char_quoting (struct quoting_options *o, char c, int i)
|
||||
{
|
||||
unsigned char uc = c;
|
||||
int *p = (o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS;
|
||||
int shift = uc % INT_BITS;
|
||||
int r = (*p >> shift) & 1;
|
||||
*p ^= ((i & 1) ^ r) << shift;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
|
||||
argument ARG (of size ARGSIZE), using O to control quoting.
|
||||
If O is null, use the default.
|
||||
Terminate the output with a null character, and return the written
|
||||
size of the output, not counting the terminating null.
|
||||
If BUFFERSIZE is too small to store the output string, return the
|
||||
value that would have been returned had BUFFERSIZE been large enough.
|
||||
If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */
|
||||
size_t
|
||||
quotearg_buffer (char *buffer, size_t buffersize,
|
||||
char const *arg, size_t argsize,
|
||||
struct quoting_options const *o)
|
||||
{
|
||||
unsigned char c;
|
||||
size_t i;
|
||||
size_t len;
|
||||
int quote_mark;
|
||||
struct quoting_options const *p = o ? o : &default_quoting_options;
|
||||
enum quoting_style quoting_style = p->style;
|
||||
#define STORE(c) \
|
||||
do \
|
||||
{ \
|
||||
if (len < buffersize) \
|
||||
buffer[len] = (c); \
|
||||
len++; \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
switch (quoting_style)
|
||||
{
|
||||
case shell_quoting_style:
|
||||
if (! (argsize == -1 ? arg[0] == '\0' : argsize == 0))
|
||||
{
|
||||
switch (arg[0])
|
||||
{
|
||||
case '#': case '~':
|
||||
break;
|
||||
|
||||
default:
|
||||
len = 0;
|
||||
for (i = 0; ; i++)
|
||||
{
|
||||
if (argsize == -1 ? arg[i] == '\0' : i == argsize)
|
||||
goto done;
|
||||
|
||||
c = arg[i];
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\t': case '\n': case ' ':
|
||||
case '!': /* special in csh */
|
||||
case '"': case '$': case '&': case '\'':
|
||||
case '(': case ')': case '*': case ';':
|
||||
case '<': case '>': case '?': case '[': case '\\':
|
||||
case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */
|
||||
case '`': case '|':
|
||||
goto needs_quoting;
|
||||
}
|
||||
|
||||
if (p->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))
|
||||
goto needs_quoting;
|
||||
|
||||
STORE (c);
|
||||
}
|
||||
|
||||
needs_quoting:;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case shell_always_quoting_style:
|
||||
quote_mark = '\'';
|
||||
break;
|
||||
|
||||
case c_quoting_style:
|
||||
quote_mark = '"';
|
||||
break;
|
||||
|
||||
default:
|
||||
quote_mark = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
len = 0;
|
||||
|
||||
if (quote_mark)
|
||||
STORE (quote_mark);
|
||||
|
||||
for (i = 0; ! (argsize == -1 ? arg[i] == '\0' : i == argsize); i++)
|
||||
{
|
||||
c = arg[i];
|
||||
|
||||
switch (quoting_style)
|
||||
{
|
||||
case literal_quoting_style:
|
||||
break;
|
||||
|
||||
case shell_quoting_style:
|
||||
case shell_always_quoting_style:
|
||||
if (c == '\'')
|
||||
{
|
||||
STORE ('\'');
|
||||
STORE ('\\');
|
||||
STORE ('\'');
|
||||
}
|
||||
break;
|
||||
|
||||
case c_quoting_style:
|
||||
case escape_quoting_style:
|
||||
switch (c)
|
||||
{
|
||||
case '?': /* Do not generate trigraphs. */
|
||||
case '\\': goto store_escape;
|
||||
/* Not all C compilers know what \a means. */
|
||||
case 7 : c = 'a'; goto store_escape;
|
||||
case '\b': c = 'b'; goto store_escape;
|
||||
case '\f': c = 'f'; goto store_escape;
|
||||
case '\n': c = 'n'; goto store_escape;
|
||||
case '\r': c = 'r'; goto store_escape;
|
||||
case '\t': c = 't'; goto store_escape;
|
||||
case '\v': c = 'v'; goto store_escape;
|
||||
|
||||
case ' ':
|
||||
if (quoting_style == escape_quoting_style)
|
||||
goto store_escape;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
if (quoting_style == c_quoting_style)
|
||||
goto store_escape;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!ISGRAPH (c))
|
||||
{
|
||||
STORE ('\\');
|
||||
STORE ('0' + (c >> 6));
|
||||
STORE ('0' + ((c >> 3) & 3));
|
||||
c = '0' + (c & 3);
|
||||
goto store_c;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (! (p->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS))))
|
||||
goto store_c;
|
||||
|
||||
store_escape:
|
||||
STORE ('\\');
|
||||
}
|
||||
|
||||
store_c:
|
||||
STORE (c);
|
||||
}
|
||||
|
||||
if (quote_mark)
|
||||
STORE (quote_mark);
|
||||
|
||||
done:
|
||||
if (len < buffersize)
|
||||
buffer[len] = '\0';
|
||||
return len;
|
||||
}
|
||||
|
||||
/* Use storage slot N to return a quoted version of the string ARG.
|
||||
OPTIONS specifies the quoting options.
|
||||
The returned value points to static storage that can be
|
||||
reused by the next call to this function with the same value of N.
|
||||
N must be nonnegative. */
|
||||
static char *
|
||||
quotearg_n_options (int n, char const *arg, struct quoting_options *options)
|
||||
{
|
||||
static unsigned nslots;
|
||||
static struct slotvec
|
||||
{
|
||||
size_t size;
|
||||
char *val;
|
||||
} *slotvec;
|
||||
|
||||
if (nslots <= n)
|
||||
{
|
||||
int n1 = n + 1;
|
||||
size_t s = n1 * sizeof (struct slotvec);
|
||||
if (! (0 < n1 && n1 == s / sizeof (struct slotvec)))
|
||||
abort ();
|
||||
slotvec = (struct slotvec *) xrealloc (slotvec, s);
|
||||
memset (slotvec + nslots, 0, (n1 - nslots) * sizeof (struct slotvec));
|
||||
nslots = n;
|
||||
}
|
||||
|
||||
{
|
||||
size_t size = slotvec[n].size;
|
||||
char *val = slotvec[n].val;
|
||||
size_t qsize = quotearg_buffer (val, size, arg, (size_t) -1, options);
|
||||
|
||||
if (size <= qsize)
|
||||
{
|
||||
slotvec[n].size = size = qsize + 1;
|
||||
slotvec[n].val = val = xrealloc (val, size);
|
||||
quotearg_buffer (val, size, arg, (size_t) -1, options);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
quotearg_n (int n, char const *arg)
|
||||
{
|
||||
return quotearg_n_options (n, arg, &default_quoting_options);
|
||||
}
|
||||
|
||||
char *
|
||||
quotearg (char const *arg)
|
||||
{
|
||||
return quotearg_n (0, arg);
|
||||
}
|
||||
|
||||
char *
|
||||
quotearg_char (char const *arg, char ch)
|
||||
{
|
||||
struct quoting_options options;
|
||||
options = default_quoting_options;
|
||||
set_char_quoting (&options, ch, 1);
|
||||
return quotearg_n_options (0, arg, &options);
|
||||
}
|
||||
|
||||
char *
|
||||
quotearg_colon (char const *arg)
|
||||
{
|
||||
return quotearg_char (arg, ':');
|
||||
}
|
||||
99
lib/quotearg.h
Normal file
99
lib/quotearg.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/* quotearg.h - quote arguments for output
|
||||
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. */
|
||||
|
||||
/* Written by Paul Eggert <eggert@twinsun.com> */
|
||||
|
||||
/* Basic quoting styles. */
|
||||
enum quoting_style
|
||||
{
|
||||
literal_quoting_style, /* --quoting-style=literal */
|
||||
shell_quoting_style, /* --quoting-style=shell */
|
||||
shell_always_quoting_style, /* --quoting-style=shell-always */
|
||||
c_quoting_style, /* --quoting-style=c */
|
||||
escape_quoting_style /* --quoting-style=escape */
|
||||
};
|
||||
|
||||
/* For now, --quoting-style=literal is the default, but
|
||||
this is planned to change to --quoting-style=shell in the future. */
|
||||
#ifndef DEFAULT_QUOTING_STYLE
|
||||
# define DEFAULT_QUOTING_STYLE literal_quoting_style
|
||||
#endif
|
||||
|
||||
/* Names of quoting styles. */
|
||||
extern char const *const quoting_style_args[];
|
||||
|
||||
struct quoting_options;
|
||||
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || defined __STDC__
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The functions listed below set and use a hidden variable
|
||||
that contains the default quoting style options. */
|
||||
|
||||
/* Allocate a new set of quoting options, with contents initially identical
|
||||
to O if O is not null, or to the default if O is null.
|
||||
It is the caller's responsibility to free the result. */
|
||||
struct quoting_options *clone_quoting_options
|
||||
PARAMS ((struct quoting_options *o));
|
||||
|
||||
/* Get the value of O's quoting style. If O is null, use the default. */
|
||||
enum quoting_style get_quoting_style PARAMS ((struct quoting_options *o));
|
||||
|
||||
/* In O (or in the default if O is null),
|
||||
set the value of the quoting style to S. */
|
||||
void set_quoting_style PARAMS ((struct quoting_options *o,
|
||||
enum quoting_style s));
|
||||
|
||||
/* In O (or in the default if O is null),
|
||||
set the value of the quoting options for character C to I.
|
||||
Return the old value. Currently, the only values defined for I are
|
||||
0 (the default) and 1 (which means to quote the character even if
|
||||
it would not otherwise be quoted). */
|
||||
int set_char_quoting PARAMS ((struct quoting_options *o, char c, int i));
|
||||
|
||||
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
|
||||
argument ARG (of size ARGSIZE), using O to control quoting.
|
||||
If O is null, use the default.
|
||||
Terminate the output with a null character, and return the written
|
||||
size of the output, not counting the terminating null.
|
||||
If BUFFERSIZE is too small to store the output string, return the
|
||||
value that would have been returned had BUFFERSIZE been large enough.
|
||||
If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */
|
||||
size_t quotearg_buffer PARAMS ((char *buffer, size_t buffersize,
|
||||
char const *arg, size_t argsize,
|
||||
struct quoting_options const *o));
|
||||
|
||||
/* Use storage slot N to return a quoted version of the string ARG.
|
||||
Use the default quoting options.
|
||||
The returned value points to static storage that can be
|
||||
reused by the next call to this function with the same value of N.
|
||||
N must be nonnegative. */
|
||||
char *quotearg_n PARAMS ((int n, char const *arg));
|
||||
|
||||
/* Equivalent to quotearg_n (ARG, 0). */
|
||||
char *quotearg PARAMS ((char const *arg));
|
||||
|
||||
/* Like quotearg (ARG), except also quote any instances of CH. */
|
||||
char *quotearg_char PARAMS ((char const *arg, char ch));
|
||||
|
||||
/* Equivalent to quotearg_char (ARG, ':'). */
|
||||
char *quotearg_colon PARAMS ((char const *arg));
|
||||
@@ -1,5 +1,5 @@
|
||||
/* GNU's read utmp module.
|
||||
Copyright (C) 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 92, 93, 94, 95, 96, 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
|
||||
@@ -34,8 +34,7 @@ char *xmalloc ();
|
||||
trailing spaces from the copy, NUL terminate it, and return the copy. */
|
||||
|
||||
char *
|
||||
extract_trimmed_name (ut)
|
||||
const STRUCT_UTMP *ut;
|
||||
extract_trimmed_name (const STRUCT_UTMP *ut)
|
||||
{
|
||||
char *p, *trimmed_name;
|
||||
|
||||
@@ -54,11 +53,74 @@ extract_trimmed_name (ut)
|
||||
number of entries read, and return zero. If there is any error,
|
||||
return non-zero and don't modify the parameters. */
|
||||
|
||||
#ifdef HAVE_UTMPNAME
|
||||
|
||||
int
|
||||
read_utmp (filename, n_entries, utmp_buf)
|
||||
const char *filename;
|
||||
int *n_entries;
|
||||
STRUCT_UTMP **utmp_buf;
|
||||
read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
|
||||
{
|
||||
int count_utmp = 0;
|
||||
int n_read;
|
||||
STRUCT_UTMP *u;
|
||||
STRUCT_UTMP *uptr;
|
||||
STRUCT_UTMP *utmp_contents;
|
||||
|
||||
if (utmpname (filename))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* FIXME: going through the list twice is wasteful. */
|
||||
|
||||
/* count the entries in utmp */
|
||||
setutent ();
|
||||
while ((u = getutent ()) != NULL)
|
||||
++count_utmp;
|
||||
|
||||
if (count_utmp == 0)
|
||||
return 0;
|
||||
|
||||
utmp_contents = (STRUCT_UTMP *) xmalloc (count_utmp * sizeof (STRUCT_UTMP));
|
||||
|
||||
/* read the entries in utmp */
|
||||
|
||||
/* FIXME: can this fail? */
|
||||
setutent ();
|
||||
|
||||
n_read = 0;
|
||||
uptr = utmp_contents;
|
||||
while ((u = getutent ()) != NULL)
|
||||
{
|
||||
++n_read;
|
||||
if (n_read > count_utmp)
|
||||
{
|
||||
STRUCT_UTMP *old_utmp_contents = utmp_contents;
|
||||
++count_utmp;
|
||||
utmp_contents = (STRUCT_UTMP *) xrealloc (utmp_contents,
|
||||
(count_utmp
|
||||
* sizeof (STRUCT_UTMP)));
|
||||
uptr = utmp_contents + (uptr - old_utmp_contents);
|
||||
}
|
||||
*uptr = *u;
|
||||
++uptr;
|
||||
}
|
||||
|
||||
if (n_read != count_utmp)
|
||||
utmp_contents = (STRUCT_UTMP *) xrealloc (utmp_contents,
|
||||
n_read * sizeof (STRUCT_UTMP));
|
||||
|
||||
/* FIXME: can this fail? */
|
||||
endutent ();
|
||||
|
||||
*n_entries = n_read;
|
||||
*utmp_buf = utmp_contents;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
|
||||
{
|
||||
FILE *utmp;
|
||||
struct stat file_stats;
|
||||
@@ -91,3 +153,5 @@ read_utmp (filename, n_entries, utmp_buf)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* HAVE_UTMPNAME */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Declarations for GNU's read utmp module.
|
||||
Copyright (C) 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 92, 93, 94, 95, 96, 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
|
||||
@@ -20,6 +20,14 @@
|
||||
#ifndef __READUTMP_H__
|
||||
# define __READUTMP_H__
|
||||
|
||||
# ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# include <stdio.h>
|
||||
# include <sys/types.h>
|
||||
|
||||
|
||||
475
lib/regex.c
475
lib/regex.c
@@ -2,30 +2,28 @@
|
||||
version 0.12.
|
||||
(Implements POSIX draft P1003.2/D11.2, except for some of the
|
||||
internationalization features.)
|
||||
Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
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.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the
|
||||
GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
This program is 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. */
|
||||
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. */
|
||||
|
||||
/* AIX requires this to be the first thing in the file. */
|
||||
#if defined (_AIX) && !defined (REGEX_MALLOC)
|
||||
#if defined _AIX && !defined REGEX_MALLOC
|
||||
#pragma alloca
|
||||
#endif
|
||||
|
||||
@@ -33,25 +31,36 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(STDC_HEADERS) && !defined(emacs)
|
||||
#include <stddef.h>
|
||||
#ifndef PARAMS
|
||||
# if defined __GNUC__ || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(args) args
|
||||
# else
|
||||
# define PARAMS(args) ()
|
||||
# endif /* GCC. */
|
||||
#endif /* Not PARAMS. */
|
||||
|
||||
#if defined STDC_HEADERS && !defined emacs
|
||||
# include <stddef.h>
|
||||
#else
|
||||
/* We need this for `regex.h', and perhaps for the Emacs include files. */
|
||||
#include <sys/types.h>
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#define WIDE_CHAR_SUPPORT \
|
||||
defined _LIBC || (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
|
||||
|
||||
/* For platform which support the ISO C amendement 1 functionality we
|
||||
support user defined character classes. */
|
||||
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
# include <wctype.h>
|
||||
#if WIDE_CHAR_SUPPORT
|
||||
# include <wchar.h>
|
||||
# include <wctype.h>
|
||||
#endif
|
||||
|
||||
/* This is for other GNU distributions with internationalized messages. */
|
||||
#if HAVE_LIBINTL_H || defined (_LIBC)
|
||||
#if HAVE_LIBINTL_H || defined _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# define gettext(msgid) (msgid)
|
||||
@@ -60,83 +69,83 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#ifndef gettext_noop
|
||||
/* This define is so xgettext can find the internationalizable
|
||||
strings. */
|
||||
#define gettext_noop(String) String
|
||||
# define gettext_noop(String) String
|
||||
#endif
|
||||
|
||||
/* The `emacs' switch turns on certain matching commands
|
||||
that make sense only in Emacs. */
|
||||
#ifdef emacs
|
||||
|
||||
#include "lisp.h"
|
||||
#include "buffer.h"
|
||||
#include "syntax.h"
|
||||
# include "lisp.h"
|
||||
# include "buffer.h"
|
||||
# include "syntax.h"
|
||||
|
||||
#else /* not emacs */
|
||||
|
||||
/* If we are not linking with Emacs proper,
|
||||
we can't use the relocating allocator
|
||||
even if config.h says that we can. */
|
||||
#undef REL_ALLOC
|
||||
# undef REL_ALLOC
|
||||
|
||||
#if defined (STDC_HEADERS) || defined (_LIBC)
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
# if defined STDC_HEADERS || defined _LIBC
|
||||
# include <stdlib.h>
|
||||
# else
|
||||
char *malloc ();
|
||||
char *realloc ();
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
|
||||
If nothing else has been done, use the method below. */
|
||||
#ifdef INHIBIT_STRING_HEADER
|
||||
#if !(defined (HAVE_BZERO) && defined (HAVE_BCOPY))
|
||||
#if !defined (bzero) && !defined (bcopy)
|
||||
#undef INHIBIT_STRING_HEADER
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
# ifdef INHIBIT_STRING_HEADER
|
||||
# if !(defined HAVE_BZERO && defined HAVE_BCOPY)
|
||||
# if !defined bzero && !defined bcopy
|
||||
# undef INHIBIT_STRING_HEADER
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* This is the normal way of making sure we have a bcopy and a bzero.
|
||||
This is used in most programs--a few other programs avoid this
|
||||
by defining INHIBIT_STRING_HEADER. */
|
||||
#ifndef INHIBIT_STRING_HEADER
|
||||
#if defined (HAVE_STRING_H) || defined (STDC_HEADERS) || defined (_LIBC)
|
||||
#include <string.h>
|
||||
#ifndef bcmp
|
||||
#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
|
||||
#endif
|
||||
#ifndef bcopy
|
||||
#define bcopy(s, d, n) memcpy ((d), (s), (n))
|
||||
#endif
|
||||
#ifndef bzero
|
||||
#define bzero(s, n) memset ((s), 0, (n))
|
||||
#endif
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#endif
|
||||
# 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))
|
||||
# endif
|
||||
# else
|
||||
# include <strings.h>
|
||||
# ifndef memcmp
|
||||
# define memcmp(s1, s2, n) bcmp (s1, s2, n)
|
||||
# endif
|
||||
# ifndef memcpy
|
||||
# define memcpy(d, s, n) (bcopy (s, d, n), (d))
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* Define the syntax stuff for \<, \>, etc. */
|
||||
|
||||
/* This must be nonzero for the wordchar and notwordchar pattern
|
||||
commands in re_match_2. */
|
||||
#ifndef Sword
|
||||
#define Sword 1
|
||||
#endif
|
||||
# ifndef Sword
|
||||
# define Sword 1
|
||||
# endif
|
||||
|
||||
#ifdef SWITCH_ENUM_BUG
|
||||
#define SWITCH_ENUM_CAST(x) ((int)(x))
|
||||
#else
|
||||
#define SWITCH_ENUM_CAST(x) (x)
|
||||
#endif
|
||||
# ifdef SWITCH_ENUM_BUG
|
||||
# define SWITCH_ENUM_CAST(x) ((int)(x))
|
||||
# else
|
||||
# define SWITCH_ENUM_CAST(x) (x)
|
||||
# endif
|
||||
|
||||
#ifdef SYNTAX_TABLE
|
||||
/* How many characters in the character set. */
|
||||
# define CHAR_SET_SIZE 256
|
||||
|
||||
# ifdef SYNTAX_TABLE
|
||||
|
||||
extern char *re_syntax_table;
|
||||
|
||||
#else /* not SYNTAX_TABLE */
|
||||
|
||||
/* How many characters in the character set. */
|
||||
#define CHAR_SET_SIZE 256
|
||||
# else /* not SYNTAX_TABLE */
|
||||
|
||||
static char re_syntax_table[CHAR_SET_SIZE];
|
||||
|
||||
@@ -165,9 +174,9 @@ init_syntax_once ()
|
||||
done = 1;
|
||||
}
|
||||
|
||||
#endif /* not SYNTAX_TABLE */
|
||||
# endif /* not SYNTAX_TABLE */
|
||||
|
||||
#define SYNTAX(c) re_syntax_table[c]
|
||||
# define SYNTAX(c) re_syntax_table[c]
|
||||
|
||||
#endif /* not emacs */
|
||||
|
||||
@@ -188,23 +197,25 @@ init_syntax_once ()
|
||||
Defining isascii to 1 should let any compiler worth its salt
|
||||
eliminate the && through constant folding." */
|
||||
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
#define ISASCII(c) 1
|
||||
#undef ISASCII
|
||||
#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII)
|
||||
# define ISASCII(c) 1
|
||||
#else
|
||||
#define ISASCII(c) isascii(c)
|
||||
# define ISASCII(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#ifdef isblank
|
||||
#define ISBLANK(c) (ISASCII (c) && isblank (c))
|
||||
# define ISBLANK(c) (ISASCII (c) && isblank (c))
|
||||
#else
|
||||
#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
|
||||
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
|
||||
#endif
|
||||
#ifdef isgraph
|
||||
#define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||
#else
|
||||
#define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
|
||||
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
|
||||
#endif
|
||||
|
||||
#undef ISPRINT
|
||||
#define ISPRINT(c) (ISASCII (c) && isprint (c))
|
||||
#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
|
||||
#define ISALNUM(c) (ISASCII (c) && isalnum (c))
|
||||
@@ -217,7 +228,7 @@ init_syntax_once ()
|
||||
#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (void *)0
|
||||
# define NULL (void *)0
|
||||
#endif
|
||||
|
||||
/* We remove any previous definition of `SIGN_EXTEND_CHAR',
|
||||
@@ -226,10 +237,10 @@ init_syntax_once ()
|
||||
(Per Bothner suggested the basic approach.) */
|
||||
#undef SIGN_EXTEND_CHAR
|
||||
#if __STDC__
|
||||
#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
|
||||
# define SIGN_EXTEND_CHAR(c) ((signed char) (c))
|
||||
#else /* not __STDC__ */
|
||||
/* As in Harbison and Steele. */
|
||||
#define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
|
||||
# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
|
||||
#endif
|
||||
|
||||
/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
|
||||
@@ -244,74 +255,67 @@ init_syntax_once ()
|
||||
|
||||
#ifdef REGEX_MALLOC
|
||||
|
||||
#define REGEX_ALLOCATE malloc
|
||||
#define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
|
||||
#define REGEX_FREE free
|
||||
# define REGEX_ALLOCATE malloc
|
||||
# define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
|
||||
# define REGEX_FREE free
|
||||
|
||||
#else /* not REGEX_MALLOC */
|
||||
|
||||
/* Emacs already defines alloca, sometimes. */
|
||||
#ifndef alloca
|
||||
# ifndef alloca
|
||||
|
||||
/* Make alloca work the best possible way. */
|
||||
#ifdef __GNUC__
|
||||
#define alloca __builtin_alloca
|
||||
#else /* not __GNUC__ */
|
||||
#if HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#else /* not __GNUC__ or HAVE_ALLOCA_H */
|
||||
#if 0 /* It is a bad idea to declare alloca. We always cast the result. */
|
||||
#ifndef _AIX /* Already did AIX, up at the top. */
|
||||
char *alloca ();
|
||||
#endif /* not _AIX */
|
||||
#endif
|
||||
#endif /* not HAVE_ALLOCA_H */
|
||||
#endif /* not __GNUC__ */
|
||||
# ifdef __GNUC__
|
||||
# define alloca __builtin_alloca
|
||||
# else /* not __GNUC__ */
|
||||
# if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# endif /* HAVE_ALLOCA_H */
|
||||
# endif /* not __GNUC__ */
|
||||
|
||||
#endif /* not alloca */
|
||||
# endif /* not alloca */
|
||||
|
||||
#define REGEX_ALLOCATE alloca
|
||||
# define REGEX_ALLOCATE alloca
|
||||
|
||||
/* Assumes a `char *destination' variable. */
|
||||
#define REGEX_REALLOCATE(source, osize, nsize) \
|
||||
# define REGEX_REALLOCATE(source, osize, nsize) \
|
||||
(destination = (char *) alloca (nsize), \
|
||||
bcopy (source, destination, osize), \
|
||||
destination)
|
||||
memcpy (destination, source, osize))
|
||||
|
||||
/* No need to do anything to free, after alloca. */
|
||||
#define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */
|
||||
# define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */
|
||||
|
||||
#endif /* not REGEX_MALLOC */
|
||||
|
||||
/* Define how to allocate the failure stack. */
|
||||
|
||||
#if defined (REL_ALLOC) && defined (REGEX_MALLOC)
|
||||
#if defined REL_ALLOC && defined REGEX_MALLOC
|
||||
|
||||
#define REGEX_ALLOCATE_STACK(size) \
|
||||
# define REGEX_ALLOCATE_STACK(size) \
|
||||
r_alloc (&failure_stack_ptr, (size))
|
||||
#define REGEX_REALLOCATE_STACK(source, osize, nsize) \
|
||||
# define REGEX_REALLOCATE_STACK(source, osize, nsize) \
|
||||
r_re_alloc (&failure_stack_ptr, (nsize))
|
||||
#define REGEX_FREE_STACK(ptr) \
|
||||
# define REGEX_FREE_STACK(ptr) \
|
||||
r_alloc_free (&failure_stack_ptr)
|
||||
|
||||
#else /* not using relocating allocator */
|
||||
|
||||
#ifdef REGEX_MALLOC
|
||||
# ifdef REGEX_MALLOC
|
||||
|
||||
#define REGEX_ALLOCATE_STACK malloc
|
||||
#define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize)
|
||||
#define REGEX_FREE_STACK free
|
||||
# define REGEX_ALLOCATE_STACK malloc
|
||||
# define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize)
|
||||
# define REGEX_FREE_STACK free
|
||||
|
||||
#else /* not REGEX_MALLOC */
|
||||
# else /* not REGEX_MALLOC */
|
||||
|
||||
#define REGEX_ALLOCATE_STACK alloca
|
||||
# define REGEX_ALLOCATE_STACK alloca
|
||||
|
||||
#define REGEX_REALLOCATE_STACK(source, osize, nsize) \
|
||||
# define REGEX_REALLOCATE_STACK(source, osize, nsize) \
|
||||
REGEX_REALLOCATE (source, osize, nsize)
|
||||
/* No need to explicitly free anything. */
|
||||
#define REGEX_FREE_STACK(arg)
|
||||
# define REGEX_FREE_STACK(arg)
|
||||
|
||||
#endif /* not REGEX_MALLOC */
|
||||
# endif /* not REGEX_MALLOC */
|
||||
#endif /* not using relocating allocator */
|
||||
|
||||
|
||||
@@ -341,7 +345,12 @@ typedef char boolean;
|
||||
#define false 0
|
||||
#define true 1
|
||||
|
||||
static int re_match_2_internal ();
|
||||
static int re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
|
||||
const char *string1, int size1,
|
||||
const char *string2, int size2,
|
||||
int pos,
|
||||
struct re_registers *regs,
|
||||
int stop));
|
||||
|
||||
/* These are the command codes that appear in compiled regular
|
||||
expressions. Some opcodes are followed by argument bytes. A
|
||||
@@ -523,10 +532,10 @@ extract_number (dest, source)
|
||||
*dest += temp << 8;
|
||||
}
|
||||
|
||||
#ifndef EXTRACT_MACROS /* To debug the macros. */
|
||||
#undef EXTRACT_NUMBER
|
||||
#define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
|
||||
#endif /* not EXTRACT_MACROS */
|
||||
# ifndef EXTRACT_MACROS /* To debug the macros. */
|
||||
# undef EXTRACT_NUMBER
|
||||
# define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
|
||||
# endif /* not EXTRACT_MACROS */
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
@@ -551,11 +560,11 @@ extract_number_and_incr (destination, source)
|
||||
*source += 2;
|
||||
}
|
||||
|
||||
#ifndef EXTRACT_MACROS
|
||||
#undef EXTRACT_NUMBER_AND_INCR
|
||||
#define EXTRACT_NUMBER_AND_INCR(dest, src) \
|
||||
# ifndef EXTRACT_MACROS
|
||||
# undef EXTRACT_NUMBER_AND_INCR
|
||||
# define EXTRACT_NUMBER_AND_INCR(dest, src) \
|
||||
extract_number_and_incr (&dest, &src)
|
||||
#endif /* not EXTRACT_MACROS */
|
||||
# endif /* not EXTRACT_MACROS */
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
@@ -568,21 +577,21 @@ extract_number_and_incr (destination, source)
|
||||
#ifdef DEBUG
|
||||
|
||||
/* We use standard I/O for debugging. */
|
||||
#include <stdio.h>
|
||||
# include <stdio.h>
|
||||
|
||||
/* It is useful to test things that ``must'' be true when debugging. */
|
||||
#include <assert.h>
|
||||
# include <assert.h>
|
||||
|
||||
static int debug = 0;
|
||||
|
||||
#define DEBUG_STATEMENT(e) e
|
||||
#define DEBUG_PRINT1(x) if (debug) printf (x)
|
||||
#define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
|
||||
#define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
|
||||
#define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
|
||||
#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
|
||||
# define DEBUG_STATEMENT(e) e
|
||||
# define DEBUG_PRINT1(x) if (debug) printf (x)
|
||||
# define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
|
||||
# define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
|
||||
# define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
|
||||
# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
|
||||
if (debug) print_partial_compiled_pattern (s, e)
|
||||
#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
|
||||
# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
|
||||
if (debug) print_double_string (w, s1, sz1, s2, sz2)
|
||||
|
||||
|
||||
@@ -802,7 +811,7 @@ print_partial_compiled_pattern (start, end)
|
||||
case wordend:
|
||||
printf ("/wordend");
|
||||
|
||||
#ifdef emacs
|
||||
# ifdef emacs
|
||||
case before_dot:
|
||||
printf ("/before_dot");
|
||||
break;
|
||||
@@ -826,7 +835,7 @@ print_partial_compiled_pattern (start, end)
|
||||
mcnt = *p++;
|
||||
printf ("/%d", mcnt);
|
||||
break;
|
||||
#endif /* emacs */
|
||||
# endif /* emacs */
|
||||
|
||||
case wordchar:
|
||||
printf ("/wordchar");
|
||||
@@ -919,16 +928,16 @@ printchar (c)
|
||||
|
||||
#else /* not DEBUG */
|
||||
|
||||
#undef assert
|
||||
#define assert(e)
|
||||
# undef assert
|
||||
# define assert(e)
|
||||
|
||||
#define DEBUG_STATEMENT(e)
|
||||
#define DEBUG_PRINT1(x)
|
||||
#define DEBUG_PRINT2(x1, x2)
|
||||
#define DEBUG_PRINT3(x1, x2, x3)
|
||||
#define DEBUG_PRINT4(x1, x2, x3, x4)
|
||||
#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
|
||||
#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
|
||||
# define DEBUG_STATEMENT(e)
|
||||
# define DEBUG_PRINT1(x)
|
||||
# define DEBUG_PRINT2(x1, x2)
|
||||
# define DEBUG_PRINT3(x1, x2, x3)
|
||||
# define DEBUG_PRINT4(x1, x2, x3, x4)
|
||||
# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
|
||||
# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
|
||||
|
||||
#endif /* not DEBUG */
|
||||
|
||||
@@ -1014,7 +1023,7 @@ static const char *re_error_msgid[] =
|
||||
/* When using GNU C, we are not REALLY using the C alloca, no matter
|
||||
what config.h may say. So don't take precautions for it. */
|
||||
#ifdef __GNUC__
|
||||
#undef C_ALLOCA
|
||||
# undef C_ALLOCA
|
||||
#endif
|
||||
|
||||
/* The match routines may not allocate if (1) they would do it with malloc
|
||||
@@ -1022,8 +1031,8 @@ static const char *re_error_msgid[] =
|
||||
Note that if REL_ALLOC is defined, matching would not use malloc for the
|
||||
failure stack, but we would still use it for the register vectors;
|
||||
so REL_ALLOC should not affect this. */
|
||||
#if (defined (C_ALLOCA) || defined (REGEX_MALLOC)) && defined (emacs)
|
||||
#undef MATCH_MAY_ALLOCATE
|
||||
#if (defined C_ALLOCA || defined REGEX_MALLOC) && defined emacs
|
||||
# undef MATCH_MAY_ALLOCATE
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1036,7 +1045,7 @@ static const char *re_error_msgid[] =
|
||||
when matching. If this number is exceeded, we allocate more
|
||||
space, so it is not a hard limit. */
|
||||
#ifndef INIT_FAILURE_ALLOC
|
||||
#define INIT_FAILURE_ALLOC 5
|
||||
# define INIT_FAILURE_ALLOC 5
|
||||
#endif
|
||||
|
||||
/* Roughly the maximum number of failure points on the stack. Would be
|
||||
@@ -1046,13 +1055,13 @@ static const char *re_error_msgid[] =
|
||||
|
||||
#ifdef INT_IS_16BIT
|
||||
|
||||
#if defined (MATCH_MAY_ALLOCATE)
|
||||
# if defined MATCH_MAY_ALLOCATE
|
||||
/* 4400 was enough to cause a crash on Alpha OSF/1,
|
||||
whose default stack limit is 2mb. */
|
||||
long int re_max_failures = 4000;
|
||||
#else
|
||||
# else
|
||||
long int re_max_failures = 2000;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
union fail_stack_elt
|
||||
{
|
||||
@@ -1071,13 +1080,13 @@ typedef struct
|
||||
|
||||
#else /* not INT_IS_16BIT */
|
||||
|
||||
#if defined (MATCH_MAY_ALLOCATE)
|
||||
# if defined MATCH_MAY_ALLOCATE
|
||||
/* 4400 was enough to cause a crash on Alpha OSF/1,
|
||||
whose default stack limit is 2mb. */
|
||||
int re_max_failures = 20000;
|
||||
#else
|
||||
# else
|
||||
int re_max_failures = 2000;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
union fail_stack_elt
|
||||
{
|
||||
@@ -1105,10 +1114,10 @@ typedef struct
|
||||
Do `return -2' if the alloc fails. */
|
||||
|
||||
#ifdef MATCH_MAY_ALLOCATE
|
||||
#define INIT_FAIL_STACK() \
|
||||
# define INIT_FAIL_STACK() \
|
||||
do { \
|
||||
fail_stack.stack = (fail_stack_elt_t *) \
|
||||
REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \
|
||||
REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \
|
||||
\
|
||||
if (fail_stack.stack == NULL) \
|
||||
return -2; \
|
||||
@@ -1117,14 +1126,14 @@ typedef struct
|
||||
fail_stack.avail = 0; \
|
||||
} while (0)
|
||||
|
||||
#define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack)
|
||||
# define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack)
|
||||
#else
|
||||
#define INIT_FAIL_STACK() \
|
||||
# define INIT_FAIL_STACK() \
|
||||
do { \
|
||||
fail_stack.avail = 0; \
|
||||
} while (0)
|
||||
|
||||
#define RESET_FAIL_STACK()
|
||||
# define RESET_FAIL_STACK()
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1185,11 +1194,11 @@ typedef struct
|
||||
|
||||
/* Used to omit pushing failure point id's when we're not debugging. */
|
||||
#ifdef DEBUG
|
||||
#define DEBUG_PUSH PUSH_FAILURE_INT
|
||||
#define DEBUG_POP(item_addr) (item_addr)->integer = POP_FAILURE_INT ()
|
||||
# define DEBUG_PUSH PUSH_FAILURE_INT
|
||||
# define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT ()
|
||||
#else
|
||||
#define DEBUG_PUSH(item)
|
||||
#define DEBUG_POP(item_addr)
|
||||
# define DEBUG_PUSH(item)
|
||||
# define DEBUG_POP(item_addr)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1197,8 +1206,8 @@ typedef struct
|
||||
if we ever fail back to it.
|
||||
|
||||
Requires variables fail_stack, regstart, regend, reg_info, and
|
||||
num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be
|
||||
declared.
|
||||
num_regs_pushed be declared. DOUBLE_FAIL_STACK requires `destination'
|
||||
be declared.
|
||||
|
||||
Does `return FAILURE_CODE' if runs out of memory. */
|
||||
|
||||
@@ -1210,7 +1219,7 @@ typedef struct
|
||||
/* Can't be int, since there is not a shred of a guarantee that int \
|
||||
is wide enough to hold a value of something to which pointer can \
|
||||
be assigned */ \
|
||||
s_reg_t this_reg; \
|
||||
active_reg_t this_reg; \
|
||||
\
|
||||
DEBUG_STATEMENT (failure_id++); \
|
||||
DEBUG_STATEMENT (nfailure_points_pushed++); \
|
||||
@@ -1218,7 +1227,7 @@ typedef struct
|
||||
DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\
|
||||
DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\
|
||||
\
|
||||
DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \
|
||||
DEBUG_PRINT2 (" slots needed: %ld\n", NUM_FAILURE_ITEMS); \
|
||||
DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \
|
||||
\
|
||||
/* Ensure we have enough space allocated for what we will push. */ \
|
||||
@@ -1239,16 +1248,17 @@ typedef struct
|
||||
for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \
|
||||
this_reg++) \
|
||||
{ \
|
||||
DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \
|
||||
DEBUG_PRINT2 (" Pushing reg: %lu\n", this_reg); \
|
||||
DEBUG_STATEMENT (num_regs_pushed++); \
|
||||
\
|
||||
DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
|
||||
DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \
|
||||
PUSH_FAILURE_POINTER (regstart[this_reg]); \
|
||||
\
|
||||
DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
|
||||
DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \
|
||||
PUSH_FAILURE_POINTER (regend[this_reg]); \
|
||||
\
|
||||
DEBUG_PRINT2 (" info: 0x%x\n ", reg_info[this_reg]); \
|
||||
DEBUG_PRINT2 (" info: %p\n ", \
|
||||
reg_info[this_reg].word.pointer); \
|
||||
DEBUG_PRINT2 (" match_null=%d", \
|
||||
REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \
|
||||
DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \
|
||||
@@ -1260,17 +1270,17 @@ typedef struct
|
||||
PUSH_FAILURE_ELT (reg_info[this_reg].word); \
|
||||
} \
|
||||
\
|
||||
DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\
|
||||
DEBUG_PRINT2 (" Pushing low active reg: %ld\n", lowest_active_reg);\
|
||||
PUSH_FAILURE_INT (lowest_active_reg); \
|
||||
\
|
||||
DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\
|
||||
DEBUG_PRINT2 (" Pushing high active reg: %ld\n", highest_active_reg);\
|
||||
PUSH_FAILURE_INT (highest_active_reg); \
|
||||
\
|
||||
DEBUG_PRINT2 (" Pushing pattern 0x%x:\n", pattern_place); \
|
||||
DEBUG_PRINT2 (" Pushing pattern %p:\n", pattern_place); \
|
||||
DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \
|
||||
PUSH_FAILURE_POINTER (pattern_place); \
|
||||
\
|
||||
DEBUG_PRINT2 (" Pushing string 0x%x: `", string_place); \
|
||||
DEBUG_PRINT2 (" Pushing string %p: `", string_place); \
|
||||
DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \
|
||||
size2); \
|
||||
DEBUG_PRINT1 ("'\n"); \
|
||||
@@ -1286,9 +1296,9 @@ typedef struct
|
||||
|
||||
/* Individual items aside from the registers. */
|
||||
#ifdef DEBUG
|
||||
#define NUM_NONREG_ITEMS 5 /* Includes failure point id. */
|
||||
# define NUM_NONREG_ITEMS 5 /* Includes failure point id. */
|
||||
#else
|
||||
#define NUM_NONREG_ITEMS 4
|
||||
# define NUM_NONREG_ITEMS 4
|
||||
#endif
|
||||
|
||||
/* We push at most this many items on the stack. */
|
||||
@@ -1322,8 +1332,8 @@ typedef struct
|
||||
|
||||
#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
|
||||
{ \
|
||||
DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \
|
||||
s_reg_t this_reg; \
|
||||
DEBUG_STATEMENT (unsigned failure_id;) \
|
||||
active_reg_t this_reg; \
|
||||
const unsigned char *string_temp; \
|
||||
\
|
||||
assert (!FAIL_STACK_EMPTY ()); \
|
||||
@@ -1345,34 +1355,35 @@ typedef struct
|
||||
if (string_temp != NULL) \
|
||||
str = (const char *) string_temp; \
|
||||
\
|
||||
DEBUG_PRINT2 (" Popping string 0x%x: `", str); \
|
||||
DEBUG_PRINT2 (" Popping string %p: `", str); \
|
||||
DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \
|
||||
DEBUG_PRINT1 ("'\n"); \
|
||||
\
|
||||
pat = (unsigned char *) POP_FAILURE_POINTER (); \
|
||||
DEBUG_PRINT2 (" Popping pattern 0x%x:\n", pat); \
|
||||
DEBUG_PRINT2 (" Popping pattern %p:\n", pat); \
|
||||
DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
|
||||
\
|
||||
/* Restore register info. */ \
|
||||
high_reg = (active_reg_t) POP_FAILURE_INT (); \
|
||||
DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \
|
||||
DEBUG_PRINT2 (" Popping high active reg: %ld\n", high_reg); \
|
||||
\
|
||||
low_reg = (active_reg_t) POP_FAILURE_INT (); \
|
||||
DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \
|
||||
DEBUG_PRINT2 (" Popping low active reg: %ld\n", low_reg); \
|
||||
\
|
||||
if (1) \
|
||||
for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \
|
||||
{ \
|
||||
DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \
|
||||
DEBUG_PRINT2 (" Popping reg: %ld\n", this_reg); \
|
||||
\
|
||||
reg_info[this_reg].word = POP_FAILURE_ELT (); \
|
||||
DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]); \
|
||||
DEBUG_PRINT2 (" info: %p\n", \
|
||||
reg_info[this_reg].word.pointer); \
|
||||
\
|
||||
regend[this_reg] = (const char *) POP_FAILURE_POINTER (); \
|
||||
DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
|
||||
DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \
|
||||
\
|
||||
regstart[this_reg] = (const char *) POP_FAILURE_POINTER (); \
|
||||
DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
|
||||
DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
@@ -1478,7 +1489,7 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
|
||||
string passed to us by the user to an unsigned char that we can use
|
||||
as an array index (in, e.g., `translate'). */
|
||||
#ifndef PATFETCH
|
||||
#define PATFETCH(c) \
|
||||
# define PATFETCH(c) \
|
||||
do {if (p == pend) return REG_EEND; \
|
||||
c = (unsigned char) *p++; \
|
||||
if (translate) c = (unsigned char) translate[c]; \
|
||||
@@ -1501,7 +1512,7 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
|
||||
`char *', to avoid warnings when a string constant is passed. But
|
||||
when we use a character as a subscript we must make it unsigned. */
|
||||
#ifndef TRANSLATE
|
||||
#define TRANSLATE(d) \
|
||||
# define TRANSLATE(d) \
|
||||
(translate ? (char) translate[(unsigned char) (d)] : (d))
|
||||
#endif
|
||||
|
||||
@@ -1569,15 +1580,15 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
|
||||
MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up
|
||||
reallocating to 0 bytes. Such thing is not going to work too well.
|
||||
You have been warned!! */
|
||||
#if defined(_MSC_VER) && !defined(WIN32)
|
||||
#if defined _MSC_VER && !defined WIN32
|
||||
/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes.
|
||||
The REALLOC define eliminates a flurry of conversion warnings,
|
||||
but is not required. */
|
||||
#define MAX_BUF_SIZE 65500L
|
||||
#define REALLOC(p,s) realloc ((p), (size_t) (s))
|
||||
# define MAX_BUF_SIZE 65500L
|
||||
# define REALLOC(p,s) realloc ((p), (size_t) (s))
|
||||
#else
|
||||
#define MAX_BUF_SIZE (1L << 16)
|
||||
#define REALLOC(p,s) realloc ((p), (s))
|
||||
# define MAX_BUF_SIZE (1L << 16)
|
||||
# define REALLOC(p,s) realloc ((p), (s))
|
||||
#endif
|
||||
|
||||
/* Extend the buffer by twice its current size via realloc and
|
||||
@@ -1677,7 +1688,7 @@ typedef struct
|
||||
} \
|
||||
}
|
||||
|
||||
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
#if WIDE_CHAR_SUPPORT
|
||||
/* The GNU C library provides support for user-defined character classes
|
||||
and the functions from ISO C amendement 1. */
|
||||
# ifdef CHARCLASS_NAME_MAX
|
||||
@@ -1864,7 +1875,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
/* Always count groups, whether or not bufp->no_sub is set. */
|
||||
bufp->re_nsub = 0;
|
||||
|
||||
#if !defined (emacs) && !defined (SYNTAX_TABLE)
|
||||
#if !defined emacs && !defined SYNTAX_TABLE
|
||||
/* Initialize the syntax table. */
|
||||
init_syntax_once ();
|
||||
#endif
|
||||
@@ -2177,7 +2188,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
the leading `:' and `[' (but set bits for them). */
|
||||
if (c == ':' && *p == ']')
|
||||
{
|
||||
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
#if WIDE_CHAR_SUPPORT
|
||||
boolean is_lower = STREQ (str, "lower");
|
||||
boolean is_upper = STREQ (str, "upper");
|
||||
wctype_t wt;
|
||||
@@ -2378,10 +2389,12 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
|
||||
|
||||
if (COMPILE_STACK_EMPTY)
|
||||
if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
goto normal_backslash;
|
||||
else
|
||||
FREE_STACK_RETURN (REG_ERPAREN);
|
||||
{
|
||||
if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
goto normal_backslash;
|
||||
else
|
||||
FREE_STACK_RETURN (REG_ERPAREN);
|
||||
}
|
||||
|
||||
handle_close:
|
||||
if (fixup_alt_jump)
|
||||
@@ -2398,10 +2411,12 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
|
||||
/* See similar code for backslashed left paren above. */
|
||||
if (COMPILE_STACK_EMPTY)
|
||||
if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
goto normal_char;
|
||||
else
|
||||
FREE_STACK_RETURN (REG_ERPAREN);
|
||||
{
|
||||
if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
goto normal_char;
|
||||
else
|
||||
FREE_STACK_RETURN (REG_ERPAREN);
|
||||
}
|
||||
|
||||
/* Since we just checked for an empty stack above, this
|
||||
``can't happen''. */
|
||||
@@ -2841,7 +2856,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
{
|
||||
fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS);
|
||||
|
||||
#ifdef emacs
|
||||
# ifdef emacs
|
||||
if (! fail_stack.stack)
|
||||
fail_stack.stack
|
||||
= (fail_stack_elt_t *) xmalloc (fail_stack.size
|
||||
@@ -2851,7 +2866,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
= (fail_stack_elt_t *) xrealloc (fail_stack.stack,
|
||||
(fail_stack.size
|
||||
* sizeof (fail_stack_elt_t)));
|
||||
#else /* not emacs */
|
||||
# else /* not emacs */
|
||||
if (! fail_stack.stack)
|
||||
fail_stack.stack
|
||||
= (fail_stack_elt_t *) malloc (fail_stack.size
|
||||
@@ -2861,7 +2876,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
= (fail_stack_elt_t *) realloc (fail_stack.stack,
|
||||
(fail_stack.size
|
||||
* sizeof (fail_stack_elt_t)));
|
||||
#endif /* not emacs */
|
||||
# endif /* not emacs */
|
||||
}
|
||||
|
||||
regex_grow_registers (num_regs);
|
||||
@@ -3540,9 +3555,9 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
|
||||
val = re_match_2_internal (bufp, string1, size1, string2, size2,
|
||||
startpos, regs, stop);
|
||||
#ifndef REGEX_MALLOC
|
||||
#ifdef C_ALLOCA
|
||||
# ifdef C_ALLOCA
|
||||
alloca (0);
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if (val >= 0)
|
||||
@@ -3619,8 +3634,8 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
|
||||
|
||||
/* Free everything we malloc. */
|
||||
#ifdef MATCH_MAY_ALLOCATE
|
||||
#define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
|
||||
#define FREE_VARIABLES() \
|
||||
# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
|
||||
# define FREE_VARIABLES() \
|
||||
do { \
|
||||
REGEX_FREE_STACK (fail_stack.stack); \
|
||||
FREE_VAR (regstart); \
|
||||
@@ -3634,7 +3649,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
|
||||
FREE_VAR (reg_info_dummy); \
|
||||
} while (0)
|
||||
#else
|
||||
#define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */
|
||||
# define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */
|
||||
#endif /* not MATCH_MAY_ALLOCATE */
|
||||
|
||||
/* These values must meet several constraints. They must not be valid
|
||||
@@ -3661,11 +3676,11 @@ re_match (bufp, string, size, pos, regs)
|
||||
{
|
||||
int result = re_match_2_internal (bufp, NULL, 0, string, size,
|
||||
pos, regs, size);
|
||||
#ifndef REGEX_MALLOC
|
||||
#ifdef C_ALLOCA
|
||||
# ifndef REGEX_MALLOC
|
||||
# ifdef C_ALLOCA
|
||||
alloca (0);
|
||||
#endif
|
||||
#endif
|
||||
# endif
|
||||
# endif
|
||||
return result;
|
||||
}
|
||||
#endif /* not emacs */
|
||||
@@ -3707,9 +3722,9 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
int result = re_match_2_internal (bufp, string1, size1, string2, size2,
|
||||
pos, regs, stop);
|
||||
#ifndef REGEX_MALLOC
|
||||
#ifdef C_ALLOCA
|
||||
# ifdef C_ALLOCA
|
||||
alloca (0);
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
@@ -4457,7 +4472,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
past them. */
|
||||
if (translate
|
||||
? bcmp_translate (d, d2, mcnt, translate)
|
||||
: bcmp (d, d2, mcnt))
|
||||
: memcmp (d, d2, mcnt))
|
||||
goto fail;
|
||||
d += mcnt, d2 += mcnt;
|
||||
|
||||
@@ -4823,7 +4838,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n");
|
||||
/* It doesn't matter what we push for the string here. What
|
||||
the code at `fail' tests is the value for the pattern. */
|
||||
PUSH_FAILURE_POINT (0, 0, -2);
|
||||
PUSH_FAILURE_POINT (NULL, NULL, -2);
|
||||
goto unconditional_jump;
|
||||
|
||||
|
||||
@@ -4836,7 +4851,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n");
|
||||
/* See comments just above at `dummy_failure_jump' about the
|
||||
two zeroes. */
|
||||
PUSH_FAILURE_POINT (0, 0, -2);
|
||||
PUSH_FAILURE_POINT (NULL, NULL, -2);
|
||||
break;
|
||||
|
||||
/* Have to succeed matching what follows at least n times.
|
||||
@@ -5410,7 +5425,7 @@ re_compile_pattern (pattern, length, bufp)
|
||||
/* Entry points compatible with 4.2 BSD regex library. We don't define
|
||||
them unless specifically requested. */
|
||||
|
||||
#if defined (_REGEX_RE_COMP) || defined (_LIBC)
|
||||
#if defined _REGEX_RE_COMP || defined _LIBC
|
||||
|
||||
/* BSD has one and only one pattern buffer. */
|
||||
static struct re_pattern_buffer re_comp_buf;
|
||||
@@ -5684,11 +5699,15 @@ regerror (errcode, preg, errbuf, errbuf_size)
|
||||
{
|
||||
if (msg_size > errbuf_size)
|
||||
{
|
||||
strncpy (errbuf, msg, errbuf_size - 1);
|
||||
#if defined HAVE_MEMPCPY || defined _LIBC
|
||||
*((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
|
||||
#else
|
||||
memcpy (errbuf, msg, errbuf_size - 1);
|
||||
errbuf[errbuf_size - 1] = 0;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
strcpy (errbuf, msg);
|
||||
memcpy (errbuf, msg, msg_size);
|
||||
}
|
||||
|
||||
return msg_size;
|
||||
|
||||
50
lib/regex.h
50
lib/regex.h
@@ -2,24 +2,24 @@
|
||||
expression library, version 0.12.
|
||||
Copyright (C) 1985,89,90,91,92,93,95,96,97 Free Software Foundation, Inc.
|
||||
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the
|
||||
GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifndef _REGEX_H
|
||||
#define _REGEX_H 1
|
||||
@@ -32,10 +32,10 @@ extern "C" {
|
||||
/* POSIX says that <sys/types.h> must be included (by the caller) before
|
||||
<regex.h>. */
|
||||
|
||||
#if !defined (_POSIX_C_SOURCE) && !defined (_POSIX_SOURCE) && defined (VMS)
|
||||
#if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
|
||||
/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
|
||||
should be there. */
|
||||
#include <stddef.h>
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
/* The following two types have to be signed and unsigned integer type
|
||||
@@ -240,7 +240,7 @@ extern reg_syntax_t re_syntax_options;
|
||||
(erroneously) define this in other header files, but we want our
|
||||
value, so remove any previous define. */
|
||||
#ifdef RE_DUP_MAX
|
||||
#undef RE_DUP_MAX
|
||||
# undef RE_DUP_MAX
|
||||
#endif
|
||||
/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
|
||||
#define RE_DUP_MAX (0x7fff)
|
||||
@@ -283,6 +283,10 @@ extern reg_syntax_t re_syntax_options;
|
||||
`re_error_msg' table in regex.c. */
|
||||
typedef enum
|
||||
{
|
||||
#if (_XOPEN_SOURCE - 0) == 500
|
||||
REG_NOSYS = -1, /* This will never happen for this implementation. */
|
||||
#endif
|
||||
|
||||
REG_NOERROR = 0, /* Success. */
|
||||
REG_NOMATCH, /* Didn't find a match (for regexec). */
|
||||
|
||||
@@ -314,7 +318,7 @@ typedef enum
|
||||
private to the regex routines. */
|
||||
|
||||
#ifndef RE_TRANSLATE_TYPE
|
||||
#define RE_TRANSLATE_TYPE char *
|
||||
# define RE_TRANSLATE_TYPE char *
|
||||
#endif
|
||||
|
||||
struct re_pattern_buffer
|
||||
@@ -405,7 +409,7 @@ struct re_registers
|
||||
`re_match_2' returns information about at least this many registers
|
||||
the first time a `regs' structure is passed. */
|
||||
#ifndef RE_NREGS
|
||||
#define RE_NREGS 30
|
||||
# define RE_NREGS 30
|
||||
#endif
|
||||
|
||||
|
||||
@@ -428,11 +432,11 @@ typedef struct
|
||||
|
||||
#if __STDC__
|
||||
|
||||
#define _RE_ARGS(args) args
|
||||
# define _RE_ARGS(args) args
|
||||
|
||||
#else /* not __STDC__ */
|
||||
|
||||
#define _RE_ARGS(args) ()
|
||||
# define _RE_ARGS(args) ()
|
||||
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
@@ -503,11 +507,11 @@ extern void re_set_registers
|
||||
unsigned num_regs, regoff_t *starts, regoff_t *ends));
|
||||
|
||||
#ifdef _REGEX_RE_COMP
|
||||
#ifndef _CRAY
|
||||
# ifndef _CRAY
|
||||
/* 4.2 bsd compatibility. */
|
||||
extern char *re_comp _RE_ARGS ((const char *));
|
||||
extern int re_exec _RE_ARGS ((const char *));
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* POSIX compatibility. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* safe-read.c -- an interface to read that retries after interrupts
|
||||
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 1994, 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
|
||||
@@ -31,17 +31,16 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#include "safe-read.h"
|
||||
|
||||
/* Read LEN bytes at PTR from descriptor DESC, retrying if interrupted.
|
||||
Return the actual number of bytes read, zero for EOF, or negative
|
||||
for an error. */
|
||||
|
||||
int
|
||||
safe_read (desc, ptr, len)
|
||||
int desc;
|
||||
char *ptr;
|
||||
int len;
|
||||
ssize_t
|
||||
safe_read (int desc, char *ptr, size_t len)
|
||||
{
|
||||
int n_chars;
|
||||
ssize_t n_chars;
|
||||
|
||||
if (len <= 0)
|
||||
return len;
|
||||
|
||||
10
lib/safe-read.h
Normal file
10
lib/safe-read.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
ssize_t
|
||||
safe_read PARAMS ((int desc, char *ptr, size_t len));
|
||||
@@ -1,5 +1,5 @@
|
||||
/* save-cwd.c -- Save and restore current working directory.
|
||||
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 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
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/* Written by Jim Meyering <meyering@na-net.ornl.gov>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#if HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
#else
|
||||
# include <sys/file.h>
|
||||
@@ -67,7 +67,7 @@ save_cwd (cwd)
|
||||
|
||||
if (have_working_fchdir)
|
||||
{
|
||||
#ifdef HAVE_FCHDIR
|
||||
#if HAVE_FCHDIR
|
||||
cwd->desc = open (".", O_RDONLY);
|
||||
if (cwd->desc < 0)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* savedir.c -- save the list of files in a directory in a string
|
||||
Copyright (C) 1990, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 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
|
||||
@@ -17,13 +17,13 @@
|
||||
|
||||
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 1992, 1995, 1997 Free Software Foundation, Inc.
|
||||
/* stpcpy.c -- copy a string and return pointer to end of new string
|
||||
Copyright (C) 1992, 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
10
lib/strdup.c
10
lib/strdup.c
@@ -1,5 +1,5 @@
|
||||
/* strdup.c -- return a newly allocated copy of a string
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 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
|
||||
@@ -15,13 +15,13 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
char *malloc ();
|
||||
char *strcpy ();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
@@ -490,7 +490,7 @@ my_strftime (s, maxsize, format, tp)
|
||||
|
||||
for (f = format; *f != '\0'; ++f)
|
||||
{
|
||||
int pad; /* Padding for number ('-', '_', or 0). */
|
||||
int pad = 0; /* Padding for number ('-', '_', or 0). */
|
||||
int modifier; /* Field modifier ('E', 'O', or 0). */
|
||||
int digits; /* Max digits for numeric format. */
|
||||
int number_value; /* Numeric value to be printed. */
|
||||
@@ -580,7 +580,6 @@ my_strftime (s, maxsize, format, tp)
|
||||
#endif /* ! DO_MULTIBYTE */
|
||||
|
||||
/* Check for flags that can modify a format. */
|
||||
pad = 0;
|
||||
while (1)
|
||||
{
|
||||
switch (*++f)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* userspec.c -- Parse a user and group string.
|
||||
Copyright (C) 1989, 1990, 1991, 1992, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989, 1990, 1991, 1992, 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
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifdef __GNUC__
|
||||
# define alloca __builtin_alloca
|
||||
#else
|
||||
# ifdef HAVE_ALLOCA_H
|
||||
# if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# else
|
||||
# ifdef _AIX
|
||||
@@ -85,7 +85,9 @@ struct group *getgrgid ();
|
||||
|
||||
#define isdigit(c) ((c) >= '0' && (c) <= '9')
|
||||
|
||||
#ifndef strdup
|
||||
char *strdup ();
|
||||
#endif
|
||||
|
||||
/* Return nonzero if STR represents an unsigned decimal integer,
|
||||
otherwise return 0. */
|
||||
@@ -153,6 +155,15 @@ parse_user_spec (spec_arg, uid, gid, username_arg, groupname_arg)
|
||||
if (u == NULL && g == NULL)
|
||||
return "can not omit both user and group";
|
||||
|
||||
#ifdef __DJGPP__
|
||||
/* Pretend that we are the user U whose group is G. This makes
|
||||
pwd and grp functions ``know'' about the UID and GID of these. */
|
||||
if (u && !is_number (u))
|
||||
setenv ("USER", u, 1);
|
||||
if (g && !is_number (g))
|
||||
setenv ("GROUP", g, 1);
|
||||
#endif
|
||||
|
||||
if (u != NULL)
|
||||
{
|
||||
pwd = getpwnam (u);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* xstrdup.c -- copy a string with out of memory checking
|
||||
Copyright (C) 1990, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1996, 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
|
||||
@@ -19,24 +19,28 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS || HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
char *xmalloc (size_t);
|
||||
char *xstrdup (char *string);
|
||||
#else
|
||||
char *xmalloc ();
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
char *xmalloc PARAMS ((size_t n));
|
||||
|
||||
/* Return a newly allocated copy of STRING. */
|
||||
|
||||
char *
|
||||
xstrdup (string)
|
||||
char *string;
|
||||
xstrdup (const char *string)
|
||||
{
|
||||
return strcpy (xmalloc (strlen (string) + 1), string);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* A more useful interface to strtol.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1996, 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
|
||||
@@ -46,27 +46,45 @@ extern int errno;
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#ifndef CHAR_BIT
|
||||
# define CHAR_BIT 8
|
||||
#endif
|
||||
|
||||
/* The extra casts work around common compiler bugs. */
|
||||
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
|
||||
/* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
|
||||
It is necessary at least when t == time_t. */
|
||||
#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
|
||||
? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
|
||||
#define TYPE_MAXIMUM(t) (~ (t) 0 - TYPE_MINIMUM (t))
|
||||
|
||||
#ifndef ULONG_MAX
|
||||
# define ULONG_MAX ((unsigned long) ~(unsigned long) 0)
|
||||
# define ULONG_MAX TYPE_MAXIMUM (unsigned long int)
|
||||
#endif
|
||||
|
||||
#ifndef LONG_MAX
|
||||
# define LONG_MAX ((long int) (ULONG_MAX >> 1))
|
||||
# define LONG_MAX TYPE_MAXIMUM (long int)
|
||||
#endif
|
||||
|
||||
#include "xstrtol.h"
|
||||
|
||||
#define BKM_SCALE(x, scale_factor, error_return) \
|
||||
do \
|
||||
{ \
|
||||
if ((x) > (double) __ZLONG_MAX / (scale_factor)) \
|
||||
return (error_return); \
|
||||
(x) *= (scale_factor); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
__unsigned long int __strtol ();
|
||||
|
||||
static int
|
||||
bkm_scale (x, scale_factor)
|
||||
__unsigned long int *x;
|
||||
int scale_factor;
|
||||
{
|
||||
/* The cast to `__unsigned long int' before the cast to double is
|
||||
required to work around a bug in SunOS's /bin/cc. */
|
||||
if (*x > (double) ((__unsigned long int) __ZLONG_MAX) / scale_factor)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
*x *= scale_factor;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* FIXME: comment. */
|
||||
|
||||
strtol_error
|
||||
@@ -109,7 +127,8 @@ __xstrtol (s, ptr, base, val, valid_suffixes)
|
||||
switch (**p)
|
||||
{
|
||||
case 'b':
|
||||
BKM_SCALE (tmp, 512, LONGINT_OVERFLOW);
|
||||
if (bkm_scale (&tmp, 512))
|
||||
return LONGINT_OVERFLOW;
|
||||
++(*p);
|
||||
break;
|
||||
|
||||
@@ -119,17 +138,20 @@ __xstrtol (s, ptr, base, val, valid_suffixes)
|
||||
|
||||
case 'B':
|
||||
case 'k':
|
||||
BKM_SCALE (tmp, 1024, LONGINT_OVERFLOW);
|
||||
if (bkm_scale (&tmp, 1024))
|
||||
return LONGINT_OVERFLOW;
|
||||
++(*p);
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
BKM_SCALE (tmp, 1024 * 1024, LONGINT_OVERFLOW);
|
||||
if (bkm_scale (&tmp, 1024 * 1024))
|
||||
return LONGINT_OVERFLOW;
|
||||
++(*p);
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
BKM_SCALE (tmp, 2, LONGINT_OVERFLOW);
|
||||
if (bkm_scale (&tmp, 2))
|
||||
return LONGINT_OVERFLOW;
|
||||
++(*p);
|
||||
break;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* yesno.c -- read a yes/no response from stdin
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 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
|
||||
@@ -15,12 +15,12 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
56
m4/ChangeLog
56
m4/ChangeLog
@@ -1,3 +1,59 @@
|
||||
1998-05-19 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* jm-macros.m4: Add jm_FUNC_LCHOWN.
|
||||
* lchown.m4: New file.
|
||||
|
||||
* Makefile.am.in: New file.
|
||||
* Makefile.am (Makefile.am): Depend on Makefile.am.in.
|
||||
|
||||
1998-05-14 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add them.
|
||||
* jm-macros.m4: New file.
|
||||
* utimbuf.m4: New file.
|
||||
|
||||
1998-05-12 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add isc-posix.m4.
|
||||
|
||||
1998-05-11 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* isc-posix.m4: New file.
|
||||
|
||||
1998-05-10 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* jm-mktime.m4: Use AM_FUNC_MKTIME, now that it's up to date.
|
||||
|
||||
1998-05-09 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add ssize_t.m4.
|
||||
(EXTRA_DIST): Remove mktime.m4, now that the new version is included
|
||||
with automake.
|
||||
|
||||
* ssize_t.m4: New file.
|
||||
* mktime.m4: Remove file -- the new automake has this now.
|
||||
|
||||
1998-04-26 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* assert.m4: New file.
|
||||
* Makefile.am (EXTRA_DIST): Add assert.m4.
|
||||
|
||||
1998-04-05 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* prereq.m4 (jm_PREREQ_REGEX): New macro.
|
||||
(jm_PREREQ): Use it here.
|
||||
|
||||
1998-03-23 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* inttypes_h.m4: Kludges so I don't have to add HAVE_INTTYPES_H
|
||||
in acconfig.h.
|
||||
|
||||
1998-03-15 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* prereq.m4: New file.
|
||||
* error.m4: New file.
|
||||
* Makefile.am (EXTRA_DIST): Add error.m4 and prereq.m4.
|
||||
|
||||
1998-02-07 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* getline.m4: Don't set am_cv_func_working_getline before the
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
|
||||
# Generate this list with
|
||||
# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
|
||||
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
|
||||
EXTRA_DIST = README \
|
||||
check-decl.m4 chown.m4 const.m4 d-ino.m4 d-type.m4 decl.m4 getgroups.m4 \
|
||||
getline.m4 getloadavg.m4 inttypes_h.m4 jm-mktime.m4 jm-winsz1.m4 \
|
||||
jm-winsz2.m4 lfs.m4 lstat.m4 malloc.m4 memcmp.m4 perl.m4 putenv.m4 \
|
||||
readdir.m4 realloc.m4 stat.m4 strftime.m4 uintmax_t.m4 uptime.m4 \
|
||||
mktime.m4
|
||||
##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 getgroups.m4 getline.m4 \
|
||||
getloadavg.m4 inttypes_h.m4 isc-posix.m4 jm-macros.m4 jm-mktime.m4 \
|
||||
jm-winsz1.m4 jm-winsz2.m4 lchown.m4 lfs.m4 lstat.m4 malloc.m4 memcmp.m4 \
|
||||
perl.m4 prereq.m4 putenv.m4 readdir.m4 realloc.m4 ssize_t.m4 stat.m4 \
|
||||
strftime.m4 uintmax_t.m4 uptime.m4 utimbuf.m4
|
||||
|
||||
##m4-files-end
|
||||
|
||||
Makefile.am: Makefile.am.in
|
||||
rm -f $@ $@t
|
||||
sed -n '1,/^##m4-files-begin/p' $< > $@t
|
||||
( echo EXTRA_DIST = README Makefile.am.in; \
|
||||
find . -type f -name '*.m4' -print |sed 's,^\./,,' |sort ) \
|
||||
|fmt | (tr '\012' @; echo) \
|
||||
|sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
|
||||
>> $@t
|
||||
sed -n '/^##m4-files-end/,$$p' $< >> $@t
|
||||
chmod a-w $@t
|
||||
mv $@t $@
|
||||
|
||||
16
m4/Makefile.am.in
Normal file
16
m4/Makefile.am.in
Normal file
@@ -0,0 +1,16 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
|
||||
##m4-files-begin
|
||||
##m4-files-end
|
||||
|
||||
Makefile.am: Makefile.am.in
|
||||
rm -f $@ $@t
|
||||
sed -n '1,/^##m4-files-begin/p' $< > $@t
|
||||
( echo EXTRA_DIST = README Makefile.am.in; \
|
||||
find . -type f -name '*.m4' -print |sed 's,^\./,,' |sort ) \
|
||||
|fmt | (tr '\012' @; echo) \
|
||||
|sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
|
||||
>> $@t
|
||||
sed -n '/^##m4-files-end/,$$p' $< >> $@t
|
||||
chmod a-w $@t
|
||||
mv $@t $@
|
||||
@@ -1,6 +1,6 @@
|
||||
# Makefile.in generated automatically by automake 1.2d from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -10,10 +10,6 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Generate this list with
|
||||
# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
|
||||
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
@@ -36,6 +32,8 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
@@ -70,6 +68,7 @@ GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GT_NO = @GT_NO@
|
||||
GT_YES = @GT_YES@
|
||||
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
@@ -91,12 +90,12 @@ VERSION = @VERSION@
|
||||
YACC = @YACC@
|
||||
l = @l@
|
||||
|
||||
EXTRA_DIST = README \
|
||||
check-decl.m4 chown.m4 const.m4 d-ino.m4 d-type.m4 decl.m4 getgroups.m4 \
|
||||
getline.m4 getloadavg.m4 inttypes_h.m4 jm-mktime.m4 jm-winsz1.m4 \
|
||||
jm-winsz2.m4 lfs.m4 lstat.m4 malloc.m4 memcmp.m4 perl.m4 putenv.m4 \
|
||||
readdir.m4 realloc.m4 stat.m4 strftime.m4 uintmax_t.m4 uptime.m4 \
|
||||
mktime.m4
|
||||
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 getgroups.m4 getline.m4 \
|
||||
getloadavg.m4 inttypes_h.m4 isc-posix.m4 jm-macros.m4 jm-mktime.m4 \
|
||||
jm-winsz1.m4 jm-winsz2.m4 lchown.m4 lfs.m4 lstat.m4 malloc.m4 memcmp.m4 \
|
||||
perl.m4 prereq.m4 putenv.m4 readdir.m4 realloc.m4 ssize_t.m4 stat.m4 \
|
||||
strftime.m4 uintmax_t.m4 uptime.m4 utimbuf.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@@ -107,13 +106,13 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
default: all
|
||||
all: Makefile
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnits m4/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -153,8 +152,6 @@ install: install-exec install-data all
|
||||
|
||||
uninstall:
|
||||
|
||||
all: Makefile
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
@@ -185,12 +182,24 @@ maintainer-clean: maintainer-clean-generic distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default tags distdir info dvi installcheck install-exec \
|
||||
install-data install uninstall all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
.PHONY: tags distdir info dvi installcheck install-exec install-data \
|
||||
install uninstall all installdirs mostlyclean-generic distclean-generic \
|
||||
clean-generic maintainer-clean-generic clean mostlyclean distclean \
|
||||
maintainer-clean
|
||||
|
||||
|
||||
Makefile.am: Makefile.am.in
|
||||
rm -f $@ $@t
|
||||
sed -n '1,/^##m4-files-begin/p' $< > $@t
|
||||
( echo EXTRA_DIST = README Makefile.am.in; \
|
||||
find . -type f -name '*.m4' -print |sed 's,^\./,,' |sort ) \
|
||||
|fmt | (tr '\012' @; echo) \
|
||||
|sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
|
||||
>> $@t
|
||||
sed -n '/^##m4-files-end/,$$p' $< >> $@t
|
||||
chmod a-w $@t
|
||||
mv $@t $@
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
||||
@@ -2,3 +2,7 @@ These files are used by a program called aclocal (part of the GNU automake
|
||||
package). aclocal uses these files to create aclocal.m4 which is in turn
|
||||
used by autoconf to create the configure script at the the top level in
|
||||
this distribution.
|
||||
|
||||
The Makefile.am file in this directory is automatically generated
|
||||
from the template file, Makefile.am.in. The generation will fail
|
||||
if you don't have all the right tools.
|
||||
|
||||
13
m4/assert.m4
Normal file
13
m4/assert.m4
Normal file
@@ -0,0 +1,13 @@
|
||||
#serial 1
|
||||
dnl based on code from Eleftherios Gkioulekas
|
||||
|
||||
AC_DEFUN(jm_ASSERT,
|
||||
[
|
||||
AC_MSG_CHECKING(whether to enable assertions)
|
||||
AC_ARG_ENABLE(assert,
|
||||
[ --disable-assert turn off assertions],
|
||||
[ AC_MSG_RESULT(no)
|
||||
AC_DEFINE(NDEBUG) ],
|
||||
[ AC_MSG_RESULT(yes) ]
|
||||
)
|
||||
])
|
||||
11
m4/error.m4
Normal file
11
m4/error.m4
Normal file
@@ -0,0 +1,11 @@
|
||||
#serial 1
|
||||
|
||||
dnl FIXME: put these prerequisite-only *.m4 files in a separate
|
||||
dnl directory -- otherwise, they'll conflict with existing files.
|
||||
|
||||
dnl These are the prerequisite macros for GNU's error.c file.
|
||||
AC_DEFUN(jm_PREREQ_ERROR,
|
||||
[
|
||||
AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt)
|
||||
AC_HEADER_STDC
|
||||
])
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 1
|
||||
#serial 2
|
||||
|
||||
dnl From Paul Eggert.
|
||||
|
||||
@@ -7,6 +7,12 @@ dnl From Paul Eggert.
|
||||
|
||||
AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
|
||||
[
|
||||
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 an entry
|
||||
dnl for `HAVE_INTTYPES_H' in config.h.in.
|
||||
AC_CHECK_FUNCS(INTTYPES_H)
|
||||
fi
|
||||
AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
|
||||
[AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>
|
||||
@@ -15,6 +21,7 @@ AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
|
||||
jm_ac_cv_header_inttypes_h=yes,
|
||||
jm_ac_cv_header_inttypes_h=no)])
|
||||
if test $jm_ac_cv_header_inttypes_h = yes; then
|
||||
AC_DEFINE(HAVE_INTTYPES_H)
|
||||
ac_kludge=HAVE_INTTYPES_H
|
||||
AC_DEFINE_UNQUOTED($ac_kludge)
|
||||
fi
|
||||
])
|
||||
|
||||
16
m4/isc-posix.m4
Normal file
16
m4/isc-posix.m4
Normal file
@@ -0,0 +1,16 @@
|
||||
#serial 1
|
||||
dnl This test replaces the one in autoconf.
|
||||
dnl Currently this macro should have the same name as the autoconf macro
|
||||
dnl because gettext's gettext.m4 (distributed in the automake package)
|
||||
dnl still uses it. Otherwise, the use in gettext.m4 makes autoheader
|
||||
dnl give these diagnostics:
|
||||
dnl configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
|
||||
dnl configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
|
||||
|
||||
undefine([AC_ISC_POSIX])
|
||||
AC_DEFUN(AC_ISC_POSIX,
|
||||
[
|
||||
dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
|
||||
AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
|
||||
]
|
||||
)
|
||||
30
m4/jm-macros.m4
Normal file
30
m4/jm-macros.m4
Normal file
@@ -0,0 +1,30 @@
|
||||
#serial 1
|
||||
|
||||
dnl Misc type-related macros for fileutils, sh-utils, textutils.
|
||||
|
||||
AC_DEFUN(jm_MACROS,
|
||||
[
|
||||
dnl This macro actually runs replacement code. See isc-posix.m4.
|
||||
AC_REQUIRE([AC_ISC_POSIX])dnl
|
||||
|
||||
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_REQUIRE([jm_STRUCT_UTIMBUF])
|
||||
AC_REQUIRE([jm_STRUCT_DIRENT_D_TYPE])
|
||||
AC_REQUIRE([jm_STRUCT_DIRENT_D_INO])
|
||||
AC_REQUIRE([jm_CHECK_DECLS])
|
||||
|
||||
AC_REQUIRE([jm_PREREQ])
|
||||
|
||||
AC_REQUIRE([jm_FUNC_LCHOWN])
|
||||
AC_REQUIRE([jm_FUNC_CHOWN])
|
||||
AC_REQUIRE([jm_FUNC_MKTIME])
|
||||
AC_REQUIRE([jm_FUNC_LSTAT])
|
||||
AC_REQUIRE([jm_FUNC_STAT])
|
||||
AC_REQUIRE([jm_FUNC_REALLOC])
|
||||
AC_REQUIRE([jm_FUNC_MALLOC])
|
||||
AC_REQUIRE([jm_FUNC_READDIR])
|
||||
AC_REQUIRE([jm_FUNC_MEMCMP])
|
||||
])
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 2
|
||||
#serial 3
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl If you use this macro in a package, you should
|
||||
@@ -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([jm_AM_FUNC_MKTIME])dnl
|
||||
[AC_REQUIRE([AM_FUNC_MKTIME])dnl
|
||||
|
||||
dnl mktime.c uses localtime_r if it exists. Check for it.
|
||||
AC_CHECK_FUNCS(localtime_r)
|
||||
|
||||
if test $jm_am_cv_func_working_mktime = no; then
|
||||
if test $am_cv_func_working_mktime = no; then
|
||||
AC_DEFINE_UNQUOTED(mktime, rpl_mktime)
|
||||
fi
|
||||
])
|
||||
|
||||
10
m4/lchown.m4
Normal file
10
m4/lchown.m4
Normal file
@@ -0,0 +1,10 @@
|
||||
#serial 1
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl Provide lchown on systems that lack it.
|
||||
|
||||
AC_DEFUN(jm_FUNC_LCHOWN,
|
||||
[
|
||||
AC_REQUIRE([AC_TYPE_UID_T])
|
||||
AC_REPLACE_FUNCS(lchown)
|
||||
])
|
||||
144
m4/mktime.m4
144
m4/mktime.m4
@@ -1,144 +0,0 @@
|
||||
#serial 103
|
||||
dnl FIXME: when this goes back into automake, reset this to a small number
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl FIXME: this should migrate into libit.
|
||||
|
||||
dnl FIXME: when this goes back into automake, remove all jm_ prefixes
|
||||
|
||||
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, "GMT0", "JST-9",
|
||||
"EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
|
||||
};
|
||||
#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
|
||||
|
||||
static void
|
||||
mktime_test (now)
|
||||
time_t now;
|
||||
{
|
||||
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;
|
||||
|
||||
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
|
||||
])
|
||||
22
m4/prereq.m4
Normal file
22
m4/prereq.m4
Normal file
@@ -0,0 +1,22 @@
|
||||
#serial 2
|
||||
|
||||
dnl These are the prerequisite macros for files in the lib/
|
||||
dnl directories of the fileutils, sh-utils, and textutils packages.
|
||||
|
||||
AC_DEFUN(jm_PREREQ,
|
||||
[
|
||||
jm_PREREQ_ERROR
|
||||
jm_PREREQ_REGEX
|
||||
])
|
||||
|
||||
dnl FIXME: maybe put this in a separate file
|
||||
AC_DEFUN(jm_PREREQ_REGEX,
|
||||
[
|
||||
dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
|
||||
dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
|
||||
dnl to get them.
|
||||
AC_CHECK_FUNCS(bzero bcopy isascii btowc)
|
||||
AC_CHECK_HEADERS(alloca.h libintl.h wctype.h wchar.h)
|
||||
AC_HEADER_STDC
|
||||
AC_FUNC_ALLOCA
|
||||
])
|
||||
19
m4/ssize_t.m4
Normal file
19
m4/ssize_t.m4
Normal file
@@ -0,0 +1,19 @@
|
||||
#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
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
49
m4/utimbuf.m4
Normal file
49
m4/utimbuf.m4
Normal file
@@ -0,0 +1,49 @@
|
||||
#serial 1
|
||||
|
||||
dnl From Jim Meyering
|
||||
|
||||
dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
|
||||
dnl usually in <utime.h>.
|
||||
dnl Some systems have utime.h but don't declare the struct anywhere.
|
||||
|
||||
AC_DEFUN(jm_STRUCT_UTIMBUF,
|
||||
[
|
||||
AC_CHECK_HEADERS(utime.h)
|
||||
AC_REQUIRE([AC_HEADER_TIME])
|
||||
AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
|
||||
[AC_TRY_COMPILE(
|
||||
[
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_UTIME_H
|
||||
# include <utime.h>
|
||||
#endif
|
||||
],
|
||||
[static struct utimbuf x; x.actime = x.modtime;],
|
||||
fu_cv_sys_struct_utimbuf=yes,
|
||||
fu_cv_sys_struct_utimbuf=no)
|
||||
])
|
||||
|
||||
if test $fu_cv_sys_struct_utimbuf = 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(STRUCT_UTIMBUF)
|
||||
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_STRUCT_UTIMBUF
|
||||
AC_DEFINE_UNQUOTED($ac_kludge)
|
||||
fi
|
||||
])
|
||||
@@ -1,3 +1,384 @@
|
||||
1998-05-24 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Version 3.16o.
|
||||
|
||||
* src/ansi2knr.c: Use new version from automake-1.3.
|
||||
|
||||
* src/chown.c: Accept new option, --dereference.
|
||||
--no-dereference is now the default.
|
||||
(enum Change_status) [CH_NOT_APPLIED]: New member.
|
||||
(change_symlinks): Enable this by default, now.
|
||||
(describe_change): Handle new case.
|
||||
(change_file_owner): Add new parameter: cmdline_arg. Update callers.
|
||||
Reorganize to reflect changed semantics.
|
||||
(LCHOWN): Remove definitions.
|
||||
|
||||
* lib/lchown.c: New file.
|
||||
|
||||
1998-05-21 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* configure.in (ALL_LINGUAS): Add russian (ru).
|
||||
|
||||
1998-05-16 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/remove.c (hash_compare_strings): Return true or false, not 1/0.
|
||||
(remove_cwd_entries): Use RM_OK, not equivalent literal `1'.
|
||||
|
||||
* lib/hash.c (is_prime): Ansideclify.
|
||||
(next_prime): Ansideclify. Add an assertion.
|
||||
|
||||
* lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
|
||||
lines from the m4/*.m4 macros, so the hack of including some
|
||||
custom-replaced C source file names here is no longer needed.
|
||||
|
||||
* configure.in (jm_MACROS): New wrapper macro.
|
||||
Remove uses of most jm_* macros.
|
||||
|
||||
* acconfig.h (HAVE_STRUCT_UTIMBUF): Remove #undef. Now it's handled
|
||||
as part of utimbuf.m4.
|
||||
(memcmp): Add #undef.
|
||||
|
||||
1998-05-12 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* configure.in: Use my replacement AC_ISC_POSIX rather than
|
||||
open-coding it.
|
||||
|
||||
* src/copy.c (copy_internal): Plug a small leak.
|
||||
|
||||
1998-05-10 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/mv.c (do_move): Remove lots of code that was duplicated in
|
||||
copy.c (copy), now that copy() has better support for mv. This fixes
|
||||
a bug with cross-filesystem `mv -i' whereby you could get two prompts
|
||||
for the same destination file and eventually remove the destination
|
||||
file even though one of the responses was negative.
|
||||
Reported by Dirk Lattermann.
|
||||
|
||||
* src/copy.h: Better support for mv:
|
||||
[struct cp_options] (move_mode): New member.
|
||||
* src/copy.c (copy_internal): Use new move_mode member.
|
||||
Add parameter.
|
||||
(copy): Add parameter.
|
||||
|
||||
* tests/cp/Makefile.am (TESTS): Add backup-is-src.
|
||||
* tests/mv/Makefile.am (TESTS): Likewise.
|
||||
|
||||
* lib/userspec.c: Don't declare strdup if it's defined as a macro.
|
||||
Reported by Lorne Baker.
|
||||
|
||||
* src/Makefile.am (ginstall_SOURCES): Add copy.c and cp-hash.c.
|
||||
|
||||
* src/mv.c (cp_option_init): Initialize new members.
|
||||
* src/cp.c (cp_option_init): Likewise.
|
||||
(main): Set new preserve_* options.
|
||||
|
||||
1998-05-09 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/copy.h: Support for install:
|
||||
[struct cp_options] (failed_unlink_is_fatal): New member.
|
||||
(preserve_owner_and_group): New member.
|
||||
(preserve_chmod_bits): New member.
|
||||
(preserve_timestamps): New member.
|
||||
(preserve): Remove member.
|
||||
(set_mode): New member.
|
||||
(mode): New member.
|
||||
* src/copy.c (new_nondir_mode): New function. Use where appropriate.
|
||||
Use more-specific preserve_* members in place of removed `preserve'.
|
||||
(copy_internal): Honor failed_unlink_is_fatal.
|
||||
|
||||
* src/install.c (main): Rewrite argv-handling to be clearer.
|
||||
(copy_file): Rewrite to use copy.c (copy).
|
||||
(change_attributes): Get rid of now-(with chown wrapper)-unnecessary
|
||||
`no_need_to_chown' parameter. Fix caller.
|
||||
(install_file_in_file): Remove now-unnecessary `to_created' parameter.
|
||||
(cp_option_init): New function.
|
||||
Update several functions to take new parameter specifying copy options.
|
||||
|
||||
* tests/install: New subdir, with one basic test.
|
||||
* tests/Makefile.am (SUBDIRS): Add install.
|
||||
* configure.in (AC_OUTPUT): Add tests/install/Makefile.
|
||||
|
||||
* src/dd.c: Include safe-read.h.
|
||||
Don't declare safe_read.
|
||||
* src/touch.c: Likewise.
|
||||
|
||||
* configure.in (jm_TYPE_SSIZE_T): Use it.
|
||||
* acconfig.h (ssize_t): Add undef.
|
||||
|
||||
1998-05-03 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* po/: Update from gettext-0.10.35.
|
||||
* intl/: Likewise.
|
||||
* configure.in: Remove use of AC_LINK_FILES.
|
||||
(AC_OUTPUT): Remove po/Makefile-generating sed command.
|
||||
|
||||
1998-04-28 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/dircolors.c (parse_line): Use ISSPACE, not isspace.
|
||||
Use unsigned char * pointers, not potentially signed ones, to avoid
|
||||
sign extension.
|
||||
|
||||
1998-04-26 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* configure.in: Use jm_ASSERT.
|
||||
* acconfig.h: Add NDEBUG.
|
||||
|
||||
* src/mv.c: Don't define NDEBUG.
|
||||
* src/cp.c: Likewise.
|
||||
|
||||
1998-04-14 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/.rm-warning: New file.
|
||||
* src/Makefile.am (EXTRA_DIST): Add .rm-warning
|
||||
(DISTCLEANFILES): Add .rm-warn-stamp.
|
||||
(rm_DEPENDENCIES): Depend on .rm-warn-stamp.
|
||||
(.rm-warn-stamp): New rule.
|
||||
(rm_prep): Comment out rule.
|
||||
|
||||
* src/df.c (main): Use STREQ in string equality tests, not strcmp.
|
||||
* src/dircolors.c (dc_parse_stream): Likewise.
|
||||
(dc_parse_file): Likewise.
|
||||
* src/du.c (main): Likewise.
|
||||
* src/ls.c (decode_switches): Likewise.
|
||||
* src/remove.c (hash_compare_strings): Likewise.
|
||||
* src/touch.c (main): Likewise.
|
||||
|
||||
1998-04-13 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
|
||||
|
||||
1998-04-11 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* lib/hash.c: Add curly braces around statements in
|
||||
if/else/while/do/etc. that span more than a line -- even around
|
||||
multiline simple statements or single-line simple statements
|
||||
preceded by a comment line.
|
||||
|
||||
1998-04-09 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* configure.in: Don't use AC_PATH_PROG to check for perl, now that
|
||||
we use jm_PERL.
|
||||
|
||||
1998-04-06 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/cp-hash.c (cph_hash_insert): Rename from now-conflicting
|
||||
hash_insert. Also declare to be static.
|
||||
* src/cp-hash.h (hash_insert): Remove declaration.
|
||||
|
||||
* lib/hash.c: Lots of minor spec and name changes, and new comments.
|
||||
(hash_rehash): Rewrite to be easier on the allocator.
|
||||
From François Pinard.
|
||||
* lib/hash.h: More comments.
|
||||
* src/remove.c: Change names/usage of hash-related functions to work
|
||||
with the above.
|
||||
|
||||
1998-04-05 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* lib/regex.c (WIDE_CHAR_SUPPORT): Define.
|
||||
This now depends on HAVE_BTOWC so systems that lack btowc (like
|
||||
solaris-2.5.1) don't lose.
|
||||
|
||||
1998-04-04 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* GNUmakefile: Add conditionals so that running `make' in an
|
||||
unconfigured source directory will get a reasonable diagnostic.
|
||||
|
||||
* Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
|
||||
know about the m4/ subdirectory.
|
||||
* Makefile.maint (aclocal-files): Remove now-unnecessary (with
|
||||
automake-1.2h and the above change) aclocal-related rules and includes.
|
||||
|
||||
1998-04-01 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* tests/ls/cr-1: New file.
|
||||
* tests/ls/Makefile.am (TESTS): Add cr-1.
|
||||
|
||||
1998-03-31 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* src/system.h (TYPE_MAXIMUM): Cast result to `(t)' so this macro
|
||||
works with `unsigned char'.
|
||||
From Greg Wooledge.
|
||||
(SCHAR_MIN, SCHAR_MAX, SHRT_MIN, SHRT_MAX, LONG_MAX, ULONG_MAX): Define.
|
||||
|
||||
* lib/xstrtol.c: Merge with the version from textutils.
|
||||
|
||||
* lib/memcmp.c (rpl_memcmp): Rename from memcmp.
|
||||
|
||||
1998-03-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime,
|
||||
rev_cmp_mtime, compare_atime, rev_cmp_atime, compare_size,
|
||||
rev_cmp_size): Use file name as secondary sort key to get
|
||||
consistent sorting.
|
||||
|
||||
1998-03-28 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* src/copy.c: Add copyright.
|
||||
* src/remove.c: Add copyright.
|
||||
[_AIX]: Add #pragma alloca.
|
||||
|
||||
1998-03-27 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* Makefile.maint ($(ACLOCAL_M4)): Replace old rule with this
|
||||
dependency and the := assignment of ACLOCAL to make the default
|
||||
rule use the `-I m4' option.
|
||||
|
||||
* Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
|
||||
|
||||
1998-03-23 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
|
||||
automatically handles it.
|
||||
|
||||
1998-03-21 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/quotearg.h: Update from patch-2.5.3.
|
||||
* lib/quotearg.c: Likewise.
|
||||
* src/ls.c (decode_switches): Pass a null pointer instead of address
|
||||
of quotearg_quoting_options.
|
||||
|
||||
1998-03-19 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/fsusage.h (struct fs_usage): New member
|
||||
fsu_bavail_top_bit_set.
|
||||
* lib/fsusage.c: Include <limits.h>.
|
||||
(CHAR_BIT, EXTRACT_TOP_BIT, PROPAGATE_TOP_BIT): New macros.
|
||||
(get_fs_usage): If top bit of system variable corresponding to
|
||||
fsu_bavail is set, then set fsu_bavail_top_bit_set, and
|
||||
sign-extend the value when storing it into fsu_bavail.
|
||||
* src/df.c (show_dev): If fsu_bavail_top_bit_set is nonzero,
|
||||
assume the original value corresponding to fsu_bavail was negative.
|
||||
Reported by Arne Juul.
|
||||
|
||||
1998-03-18 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* src/Makefile.am (rm-prep): Add dependency and rule to save users
|
||||
with `.' too early in their PATH from the `rm: cannot unlink `rm':
|
||||
Text file busy' error. Suggestion from Philippe De Muyter.
|
||||
|
||||
1998-03-15 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* Version 3.16n.
|
||||
|
||||
* lib/chown.c: Use #if, not #ifdef with HAVE_ macros.
|
||||
* lib/closeout.c: Likewise.
|
||||
* lib/dirname.c: Likewise.
|
||||
* lib/euidaccess.c: Likewise.
|
||||
* lib/fileblocks.c: Likewise.
|
||||
* lib/filemode.c: Likewise.
|
||||
* lib/ftruncate.c: Likewise.
|
||||
* lib/group-member.c: Likewise.
|
||||
* lib/isdir.c: Likewise.
|
||||
* lib/long-options.c: Likewise.
|
||||
* lib/mountlist.c: Likewise.
|
||||
* lib/path-concat.c: Likewise.
|
||||
* lib/save-cwd.c: Likewise.
|
||||
* lib/savedir.c: Likewise.
|
||||
* lib/strcasecmp.c: Likewise.
|
||||
* lib/strdup.c: Likewise.
|
||||
* lib/userspec.c: Likewise.
|
||||
* lib/yesno.c:: Likewise.
|
||||
|
||||
* src/chgrp.c: Use #if, not #ifdef with HAVE_ macros.
|
||||
Use #if !, not #ifndef with HAVE_ macros.
|
||||
* src/chown.c: Likewise.
|
||||
* src/copy.c: Likewise.
|
||||
* src/dd.c: Likewise.
|
||||
* src/dircolors.c: Likewise.
|
||||
* src/install.c: Likewise.
|
||||
* src/ls.c: Likewise.
|
||||
* src/mv.c: Likewise.
|
||||
* src/touch.c: Likewise.
|
||||
|
||||
* configure.in: Use jm_PREREQ.
|
||||
|
||||
1998-03-14 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
Revert most `getdate.h -> get-date.h' changes of 1998-02-20.
|
||||
With automake-1.2f, that hack is no longer needed.
|
||||
|
||||
* src/remove.c: Use `virtual memory exhausted' message, not
|
||||
`Memory exhausted' to be consistent with the majority of other
|
||||
such messages.
|
||||
Say `removing all...', not `removing any...'.
|
||||
* src/rmdir.c (remove_parents): Be consistent with documentation of
|
||||
--verbose option and with remove.c in saying `removing...' before
|
||||
the operation is attempted.
|
||||
(main): Likewise.
|
||||
Suggestions from Santiago Vila.
|
||||
|
||||
* src/copy.c (copy_dir): Add new parameter, copy_into_self, and set it.
|
||||
(copy_internal): Likewise.
|
||||
(copy): Likewise.
|
||||
Update all callers.
|
||||
* src/copy.h (copy): Update prototype.
|
||||
* src/cp.c (do_copy): Add unused arg in calls to copy.
|
||||
* src/mv.c (do_move): Add ©_into_self arg in call to copy.
|
||||
Don't remove source directory when copy_into_self is nonzero.
|
||||
Reported by Arne Henrik Juul.
|
||||
|
||||
* tests/mv/into-self: Test for the above.
|
||||
* tests/mv/Makefile.am (TESTS): Add into-self.
|
||||
|
||||
1998-02-28 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
* userspec.c (parse_user_spec) [__DJGPP__]: Make function know
|
||||
about any arbitrary user and group by pretending to be the user
|
||||
and to belong to the group specified in `spec_arg' argument.
|
||||
|
||||
* idcache.c (getuidbyname) [__DJGPP__]: Make function know about
|
||||
any arbitrary user name.
|
||||
(getgidbyname) [__DJGPP__]: Make function know about any arbitrary
|
||||
group name.
|
||||
|
||||
1998-02-24 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/xstrtol.c (TYPE_SIGNED): Define.
|
||||
(TYPE_MAXIMUM): Define.
|
||||
(ULONG_MAX): Use TYPE_MAXIMUM.
|
||||
(LONG_MAX): Use TYPE_MAXIMUM.
|
||||
|
||||
* lib/fnmatch.c: Update from libit.
|
||||
* lib/idcache.c: Update from libit.
|
||||
|
||||
1998-02-23 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/quotearg.h, lib/quotearg.c: New files.
|
||||
* lib/Makefile.am (libfu_a_SOURCES): Add quotearg.c.
|
||||
(noinst_HEADERS): Add quotearg.h.
|
||||
|
||||
* src/ls.c: Include new file quotearg.h.
|
||||
(enum indicator_style): Rename all to classify, and not_programs
|
||||
to file_type, to match option spellings. All users changed.
|
||||
(indicator_style_args): New constant.
|
||||
(quote_funny_chars, quote_as_string, quote_shell): Remove;
|
||||
(filename_quoting_options, dirname_quoting_options): Use these
|
||||
variables instead.
|
||||
(long_options): Add --indicator-style, --quoting-style,
|
||||
--show-control-chars. Remove --quote-shell.
|
||||
(dired_dump_obstack): Remove style parameter and don't output style.
|
||||
(main): Go back to previous method of outputting //DIRED//
|
||||
and //SUBDIRED// lines, without style. But add a new
|
||||
//DIRED-OPTIONS// line that does output style.
|
||||
(decode_switches, usage): Add --indicator-style, --quoting-style,
|
||||
--show-control-chars. Remove --quote-shell.
|
||||
(decode_switches): Default from QUOTING_STYLE environment variable.
|
||||
Set new quoting vars.
|
||||
(quote_name): Renamed from quote_filename.
|
||||
Take new arg specifying quoting options.
|
||||
Always print; do not have a special case for null FILE * argument.
|
||||
All callers changed.
|
||||
Move the guts of this function to new file quotearg.c.
|
||||
(length_of_file_name_and_frills): Use quotearg_buffer instead
|
||||
of (old) quote_filename to find length of file name.
|
||||
|
||||
(decode_switches, parse_ls_color, print_dir, gobble_file,
|
||||
get_link_name): Quote output in diagnostics.
|
||||
|
||||
* NEWS, doc/fileutils.texi: Describe above changes.
|
||||
* doc/fileutils.texi: Mention that control characters are output
|
||||
as question marks if output is a terminal.
|
||||
|
||||
1998-02-22 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* Version 3.16m.
|
||||
|
||||
@@ -1,4 +1,41 @@
|
||||
Changes in release 3.17:
|
||||
[3.16o]
|
||||
* chown accepts new option, --dereference. --no-dereference is now the default.
|
||||
* install now shares core copying code with mv and cp
|
||||
* mv (between distinct filesystems) now uses more of the core copying code
|
||||
* fixed a bug or two in mv
|
||||
* df once again displays negative numbers when that's what's returned
|
||||
by get_fs_usage
|
||||
[3.16n]
|
||||
* `mv dir dir' once again does *not* remove dir/
|
||||
* ls accepts new options:
|
||||
--indicator-style=none (no indicators, the default)
|
||||
--indicator-style=classify (all indicators)
|
||||
(equivalent to -F or --classify)
|
||||
--indicator-style=file-type (file type indicators)
|
||||
(equivalent to -p or --file-type)
|
||||
|
||||
--quoting-style=literal (do not quote output)
|
||||
--quoting-style=shell (minimally quote output for the shell)
|
||||
--quoting-style=shell-always (always quote output with '' for the shell)
|
||||
--quoting-style=c (quote output as for a C-language string)
|
||||
(equivalent to -Q or --quote-name)
|
||||
--quoting-style=escape (like c but omit enclosing "")
|
||||
(equivalent to -b or --escape)
|
||||
|
||||
--show-control-chars is the opposite of --hide-control-chars
|
||||
This option can be useful if output is to a terminal,
|
||||
to override the default beahvior of hiding control characters.
|
||||
|
||||
* The QUOTING_STYLE environment variable can now be used to specify the
|
||||
default value for ls's --quoting-style option. If not specified,
|
||||
the default quoting style is 'literal', but this default may change to
|
||||
'shell' in a future version of this package.
|
||||
* ls's quoting style now affects operands in diagnostics, too.
|
||||
* ls's --dired option now outputs the quoting style
|
||||
using the format of the new --quoting-style option.
|
||||
* ls's -e or --quote-shell option (introduced in 3.16j) has been removed;
|
||||
use --quoting-style=shell to get its functionality.
|
||||
[3.16m]
|
||||
* mv can move (and doesn't read) special files
|
||||
* remove maintainer mode
|
||||
|
||||
@@ -1,3 +1,151 @@
|
||||
1998-05-16 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Version 1.16f.
|
||||
|
||||
* lib/readutmp.c (read_utmp): Add variant for systems that have
|
||||
the utmpname function.
|
||||
Ansideclify.
|
||||
* configure.in: Check for utmpname.
|
||||
|
||||
* configure.in (jm_MACROS): New wrapper macro.
|
||||
Remove uses of most jm_* macros.
|
||||
|
||||
* acconfig.h: (chown): Add undef.
|
||||
(D_INO_IN_DIRENT): Likewise.
|
||||
(D_TYPE_IN_DIRENT): Likewise.
|
||||
(ssize_t): Likewise.
|
||||
|
||||
* lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
|
||||
lines from the m4/*.m4 macros, so the hack of including some
|
||||
custom-replaced C source file names here is no longer needed.
|
||||
|
||||
1998-05-03 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* po/: Update from gettext-0.10.35.
|
||||
* intl/: Likewise.
|
||||
* configure.in: Remove use of AC_LINK_FILES.
|
||||
(AC_OUTPUT): Remove po/Makefile-generating sed command.
|
||||
|
||||
1998-05-02 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/seq.c (check_format): Use ISDIGIT, not isdigit.
|
||||
|
||||
1998-04-26 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* configure.in: Use jm_ASSERT.
|
||||
* acconfig.h: Add NDEBUG.
|
||||
|
||||
1998-04-13 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
|
||||
|
||||
1998-04-09 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* configure.in (AM_MAINTAINER_MODE): Remove it.
|
||||
No longer use AC_PATH_PROG to check for perl.
|
||||
(jm_PERL): Use this instead.
|
||||
|
||||
1998-04-04 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* lib/readutmp.h (PARAMS): Define.
|
||||
|
||||
* tests/Makefile.am (SUBDIRS): Add stty.
|
||||
* tests/stty/row-col-1: New file.
|
||||
* tests/stty: New directory.
|
||||
* configure.in (AC_OUTPUT): Add tests/stty/Makefile.
|
||||
|
||||
* src/stty.c: Use STREQ in place of strcmp everywhere.
|
||||
(valid_options): Indent.
|
||||
Parenthesize assignment in while expr.
|
||||
(main): s/case 'f':/case 'F':/
|
||||
Tweak error messages to make them consistent.
|
||||
Remove #if-0'd block.
|
||||
Move dcl of `fdflags' into scope where it's used.
|
||||
Remove dcl of unused `cp'.
|
||||
Use "%s", not device_name, as the format string, in case the
|
||||
latter contains `%'.
|
||||
|
||||
[1998-03-31 Theodore Ts'o <tytso@rsts-11.mit.edu>]
|
||||
* src/stty.c (valid_options): New function.
|
||||
(main): Fix broken options parsing that worked only
|
||||
by serendipity (getopt_long_only already parsed short options; no
|
||||
need to parse them again manually!). Add support for the --file
|
||||
option, which allows the user to specify the device whose line
|
||||
settings are to be set. This is necessary because POSIX ttys will
|
||||
block waiting for carrier detect to go high if CLOCAL is not set,
|
||||
unless the device is opened with the O_NONBLOCK flag.
|
||||
Unfortunately, the shell doesn't use this flag, so users lose.
|
||||
Opening the device in stty is the easist way to fix this.
|
||||
(speeds): Add support for 230400 and 460800 line speeds, which are
|
||||
supported by Linux.
|
||||
|
||||
* acconfig.h (uintmax_t): Add #undef.
|
||||
|
||||
* configure.in (jm_AC_HEADER_INTTYPES_H): Use it.
|
||||
(jm_AC_TYPE_UINTMAX_T): Use it.
|
||||
(jm_PREREQ): Use it.
|
||||
|
||||
* src/system.h: Sync with system.c from fileutils.
|
||||
|
||||
* Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
|
||||
know about the m4/ subdirectory.
|
||||
* Makefile.maint (aclocal-files): Remove now-unnecessary (with
|
||||
automake-1.2h and the above change) aclocal-related rules and includes.
|
||||
|
||||
1998-04-03 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/closeout.c: New file.
|
||||
* lib/closeout.h: New file.
|
||||
* lib/Makefile.am (libsu_a_SOURCES): Add closeout.c.
|
||||
(noinst_HEADERS): Add closeout.h.
|
||||
|
||||
1998-03-27 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
|
||||
|
||||
1998-03-26 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* src/date.c (batch_convert): Remove spurious space in error message.
|
||||
Reported by Karl Berry.
|
||||
|
||||
1998-03-13 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/getugroups.c (getugroups): Don't add a group number if it
|
||||
would be a duplicate. From Ulrich Drepper.
|
||||
|
||||
1998-02-22 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* tests/Makefile.am (EXTRA_DIST): Add mk-script.
|
||||
* tests/Makefile.am.in (EXTRA_DIST): Remove mk-script.pl.
|
||||
(mk_script): Set to ../mk-script.
|
||||
(x-tests): Use `$(PERL) -w -- $(mk_script)', not ./mk-script.
|
||||
Remove @MAINT@ cruft.
|
||||
(Makefile.am): Likewise.
|
||||
Remove @MAINT@ cruft. Now `missing' will explain the failure
|
||||
when people don't have Perl yet modify a file whose rebuilding
|
||||
would lead to the use of Perl.
|
||||
|
||||
* src/Makefile.am (pinky_LDADD): Explicitly add @GETHOSTBYNAME_LIB@.
|
||||
(who_LDADD): Likewise.
|
||||
(pinky_DEPENDENCIES): Set to $(LDADD)
|
||||
(who_DEPENDENCIES): Likewise.
|
||||
|
||||
1998-02-20 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/getdate.h: Removed. Could cause confusion with an
|
||||
automake-generated `.y.h' rule.
|
||||
* lib/get-date.h: Renamed from getdate.h.
|
||||
* lib/getdate.y: s/getdate.h/get-date.h/
|
||||
* lib/Makefile.am (noinst_HEADERS): s/getdate.h/get-date.h/
|
||||
* src/date.c: s/getdate.h/get-date.h/
|
||||
|
||||
1998-02-16 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* configure.in (jm_FUNC_LSTAT): Use it.
|
||||
(jm_FUNC_STAT): Use it.
|
||||
* acconfig.h: Add lstat.
|
||||
* lib/Makefile.am (EXTRA_DIST): Add lstat.c and stat.c.
|
||||
|
||||
1998-02-06 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* tests/nice: Fail immediately if this test is run with `nice'
|
||||
|
||||
@@ -1,6 +1,188 @@
|
||||
1998-02-06 Jim Meyering <meyering@eng.ascend.com>
|
||||
1998-05-16 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Version 1.22e.
|
||||
* Version 1.22f.
|
||||
|
||||
* configure.in (jm_MACROS): New wrapper macro.
|
||||
Remove uses of most jm_* macros.
|
||||
|
||||
* src/tac.c (tac_seekable): Fix error in handling regex separators.
|
||||
* tests/tac/Test.pm (opt-b, opt-s, opt_sb, opt_r): New tests.
|
||||
(opt_br): New test -- exercises above-fixed bug.
|
||||
|
||||
* lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
|
||||
lines from the m4/*.m4 macros, so the hack of including some
|
||||
custom-replaced C source file names here is no longer needed.
|
||||
|
||||
* acconfig.h (chown): Add undef.
|
||||
(D_INO_IN_DIRENT): Likewise.
|
||||
(D_TYPE_IN_DIRENT): Likewise.
|
||||
(ssize_t): Likewise.
|
||||
|
||||
1998-05-09 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/tac.c (tac_seekable): Rename from tac_stream.
|
||||
Change `FILE *in' parameter to `int input_fd'. Adjust callers.
|
||||
|
||||
1998-05-03 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* po/: Update from gettext-0.10.35.
|
||||
* intl/: Likewise.
|
||||
* configure.in: Remove use of AC_LINK_FILES.
|
||||
(AC_OUTPUT): Remove po/Makefile-generating sed command.
|
||||
|
||||
1998-04-26 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* tests/tail/Test.pm: Disable test f-1, now that it fails.
|
||||
|
||||
* src/sort.c (keycompare) (CMP_WITH_IGNORE): Don't return 0 from inside
|
||||
the keyspec-iterating loop. With this change, test 22a passes.
|
||||
Reported by Zvi Har'El.
|
||||
(strncoll): Remove bogus assertion.
|
||||
* tests/sort/Test.pm: Add tests for the above fix.
|
||||
|
||||
* configure.in: Use jm_ASSERT.
|
||||
* acconfig.h: Add NDEBUG.
|
||||
|
||||
* src/cut.c: Don't define NDEBUG.
|
||||
* src/csplit.c: Likewise.
|
||||
* src/join.c: Likewise.
|
||||
* src/sort.c: Likewise.
|
||||
* src/tr.c: Likewise.
|
||||
|
||||
* src/cut.c: Don't define _GNU_SOURCE (now it's in config.h).
|
||||
* src/expand.c: Likewise.
|
||||
* src/fold.c: Likewise.
|
||||
* src/join.c: Likewise.
|
||||
* src/sort.c: Likewise.
|
||||
* src/tr.c: Likewise.
|
||||
* src/unexpand.c: Likewise.
|
||||
* src/uniq.c: Likewise.
|
||||
|
||||
* src/tail.c (close_fd): New function -- converted from macro.
|
||||
[struct File_spec] (n_stat_calls): New member.
|
||||
[struct File_spec] (n_unchanged_stats): New member.
|
||||
(max_n_unchanged_stats): New global.
|
||||
Initialize new members.
|
||||
(xwrite): New function -- converted from macro.
|
||||
[struct File_spec] (pretty_name): Remove member.
|
||||
(pretty_name): New function.
|
||||
|
||||
* src/md5sum.c (md5_check): Declare local, `md5num' as _unsigned_ char*.
|
||||
(hex_digits): Declare parameter `s' as _unsigned_ char*.
|
||||
(split_3): Declare parameter `u' as _unsigned_ char**.
|
||||
|
||||
1998-04-17 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/fmt.c (check_punctuation): Used unsigned char* pointers to avoid
|
||||
new warning.
|
||||
* src/join.c (xfields): Likewise.
|
||||
|
||||
1998-04-12 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/cat.c: Use STREQ macro rather than strcmp.
|
||||
* src/cksum.c: Likewise.
|
||||
* src/comm.c: Likewise.
|
||||
* src/csplit.c: Likewise.
|
||||
* src/cut.c: Likewise.
|
||||
* src/fmt.c: Likewise.
|
||||
* src/fold.c: Likewise.
|
||||
* src/head.c: Likewise.
|
||||
* src/join.c: Likewise.
|
||||
* src/md5sum.c: Likewise.
|
||||
* src/nl.c: Likewise.
|
||||
* src/paste.c: Likewise.
|
||||
* src/pr.c: Likewise.
|
||||
* src/split.c: Likewise.
|
||||
* src/sum.c: Likewise.
|
||||
* src/tac.c: Likewise.
|
||||
* src/uniq.c: Likewise.
|
||||
* src/wc.c: Likewise.
|
||||
|
||||
1998-04-11 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* lib/safe-read.h: New file.
|
||||
* lib/safe-read.c: Include it.
|
||||
* src/cat.c: Include it instead of merely declaring safe_read.
|
||||
* src/csplit.c: Likewise.
|
||||
* src/head.c: Likewise.
|
||||
* src/split.c: Likewise.
|
||||
* src/sum.c: Likewise.
|
||||
* src/tac.c: Likewise.
|
||||
* src/tail.c: Likewise.
|
||||
* src/tr.c: Likewise.
|
||||
* src/wc.c: Likewise.
|
||||
|
||||
* lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
|
||||
|
||||
* src/wc.c [HAVE_INTTYPES_H]: Include inttypes.h.
|
||||
Declare counters to be of type uintmax_t.
|
||||
(write_counts): Use human_readable to format potentially-long-long
|
||||
numbers. Suggestion from Rogier Wolff.
|
||||
(wc): Declare per-file counters to be of type uintmax_t.
|
||||
Declare bytes_read to be ssize_t.
|
||||
* lib/Makefile.am (libtu_a_SOURCES): Add human.c.
|
||||
(noinst_HEADERS): Add human.h.
|
||||
|
||||
* lib/human.c: New file.
|
||||
* lib/human.h: New file.
|
||||
|
||||
1998-04-04 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* configure.in (jm_AC_HEADER_INTTYPES_H): Use it.
|
||||
(jm_AC_TYPE_UINTMAX_T): Use it.
|
||||
(jm_PREREQ): Use it.
|
||||
|
||||
* Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
|
||||
know about the m4/ subdirectory.
|
||||
* Makefile.maint (aclocal-files): Remove now-unnecessary (with
|
||||
automake-1.2h and the above change) aclocal-related rules and includes.
|
||||
|
||||
1998-04-03 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/closeout.c: New file.
|
||||
* lib/closeout.h: New file.
|
||||
* lib/Makefile.am (libtu_a_SOURCES): Add closeout.c.
|
||||
(noinst_HEADERS): Add closeout.h.
|
||||
|
||||
1998-03-31 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/xstrtol.c: Merge with the version from fileutils.
|
||||
|
||||
1998-03-27 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
|
||||
|
||||
1998-03-23 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
|
||||
automatically handles it.
|
||||
|
||||
1998-03-19 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* src/system.h (SCHAR_MIN): Define.
|
||||
(SHRT_MIN): Define.
|
||||
od.c needs these when compiling with NCR's R2.0c C compiler.
|
||||
(TYPE_MAXIMUM): Cast result to `(t)' so this macro works with
|
||||
`unsigned char'.
|
||||
From Greg Wooledge.
|
||||
|
||||
1998-03-15 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* src/tail.c (tail_file): Merge largely-duplicated blocks of code.
|
||||
|
||||
1998-03-03 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/sort.c (xtmpfopen): Open temporary file exclusively, to
|
||||
foil a common denial-of-service attack.
|
||||
* src/tac.c (save_stdin): Likewise.
|
||||
|
||||
1998-02-16 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* configure.in (jm_FUNC_LSTAT): Use it.
|
||||
(jm_FUNC_STAT): Use it.
|
||||
* lib/Makefile.am (EXTRA_DIST): Add lstat.c and stat.c.
|
||||
|
||||
1998-02-06 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* configure.in: Don't use AM_MAINTAINER_MODE or
|
||||
AC_PATH_PROG(PERL, perl).
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
Changes in release 1.23
|
||||
[1.22f]
|
||||
* fix tac bug when using -b, -r, and -s SEPARATOR
|
||||
* fix sort bug whereby using key-local `d' option would cause following
|
||||
key specs to be ignored when any two keys (in the `d'-modified test)
|
||||
compared equal.
|
||||
[1.22e]
|
||||
* remove maintainer mode
|
||||
[1.22d]
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
# Makefile for program source directory in GNU NLS utilities package.
|
||||
# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# This file file be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
@@ -94,9 +85,10 @@ all-no:
|
||||
$(srcdir)/$(PACKAGE).pot: $(POTFILES)
|
||||
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
|
||||
--add-comments --keyword=_ --keyword=N_ \
|
||||
--files-from=$(srcdir)/POTFILES.in
|
||||
rm -f $(srcdir)/$(PACKAGE).pot
|
||||
mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
|
||||
--files-from=$(srcdir)/POTFILES.in \
|
||||
&& test ! -f $(PACKAGE).po \
|
||||
|| ( rm -f $(srcdir)/$(PACKAGE).pot \
|
||||
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
|
||||
|
||||
$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
|
||||
$(srcdir)/stamp-cat-id: $(PACKAGE).pot
|
||||
@@ -118,10 +110,10 @@ install-exec:
|
||||
install-data: install-data-@USE_NLS@
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
if test -r "$(MKINSTALLDIRS)"; then \
|
||||
$(MKINSTALLDIRS) $(datadir); \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $(datadir); \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \
|
||||
fi
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
@@ -132,10 +124,10 @@ install-data-yes: all
|
||||
esac; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
dir=$$destdir/$$lang/LC_MESSAGES; \
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
if test -r "$(MKINSTALLDIRS)"; then \
|
||||
$(MKINSTALLDIRS) $$dir; \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $$dir; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
|
||||
fi; \
|
||||
if test -r $$cat; then \
|
||||
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
@@ -160,10 +152,10 @@ install-data-yes: all
|
||||
fi; \
|
||||
done
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
if test -r "$(MKINSTALLDIRS)"; then \
|
||||
$(MKINSTALLDIRS) $(gettextsrcdir); \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
|
||||
fi; \
|
||||
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
||||
$(gettextsrcdir)/Makefile.in.in; \
|
||||
|
||||
106
src/ansi2knr.c
106
src/ansi2knr.c
@@ -1,4 +1,6 @@
|
||||
/* ansi2knr.c */
|
||||
/* Copyright (C) 1989, 1997 Aladdin Enterprises. All rights reserved. */
|
||||
|
||||
/*$Id: ansi2knr.c,v 1.8 1998/05/24 17:43:17 meyering Exp $*/
|
||||
/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
|
||||
|
||||
/*
|
||||
@@ -11,9 +13,10 @@ License (the "GPL") for full details.
|
||||
Everyone is granted permission to copy, modify and redistribute ansi2knr,
|
||||
but only under the conditions described in the GPL. A copy of this license
|
||||
is supposed to have been given to you along with ansi2knr so you can know
|
||||
your rights and responsibilities. It should be in a file named COPYLEFT.
|
||||
Among other things, the copyright notice and this notice must be preserved
|
||||
on all copies.
|
||||
your rights and responsibilities. It should be in a file named COPYLEFT,
|
||||
or, if there is no file named COPYLEFT, a file named COPYING. Among other
|
||||
things, the copyright notice and this notice must be preserved on all
|
||||
copies.
|
||||
|
||||
We explicitly state here what we believe is already implied by the GPL: if
|
||||
the ansi2knr program is distributed as a separate set of sources and a
|
||||
@@ -26,7 +29,10 @@ program under the GPL.
|
||||
|
||||
/*
|
||||
* Usage:
|
||||
ansi2knr input_file [output_file]
|
||||
ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]
|
||||
* --filename provides the file name for the #line directive in the output,
|
||||
* overriding input_file (if present).
|
||||
* If no input_file is supplied, input is read from stdin.
|
||||
* If no output_file is supplied, output goes to stdout.
|
||||
* There are no error messages.
|
||||
*
|
||||
@@ -49,6 +55,11 @@ program under the GPL.
|
||||
* The original and principal author of ansi2knr is L. Peter Deutsch
|
||||
* <ghost@aladdin.com>. Other authors are noted in the change history
|
||||
* that follows (in reverse chronological order):
|
||||
lpd 97-12-08 made input_file optional; only closes input and/or
|
||||
output file if not stdin or stdout respectively; prints
|
||||
usage message on stderr rather than stdout; adds
|
||||
--filename switch (changes suggested by
|
||||
<ceder@lysator.liu.se>)
|
||||
lpd 96-01-21 added code to cope with not HAVE_CONFIG_H and with
|
||||
compilers that don't understand void, as suggested by
|
||||
Tom Lane
|
||||
@@ -169,11 +180,15 @@ int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{ FILE *in, *out;
|
||||
{ FILE *in = stdin;
|
||||
FILE *out = stdout;
|
||||
char *filename = 0;
|
||||
#define bufsize 5000 /* arbitrary size */
|
||||
char *buf;
|
||||
char *line;
|
||||
char *more;
|
||||
char *usage =
|
||||
"Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n";
|
||||
/*
|
||||
* In previous versions, ansi2knr recognized a --varargs switch.
|
||||
* If this switch was supplied, ansi2knr would attempt to convert
|
||||
@@ -184,42 +199,49 @@ main(argc, argv)
|
||||
*/
|
||||
int convert_varargs = 1;
|
||||
|
||||
if ( argc > 1 && argv[1][0] == '-' )
|
||||
{ if ( !strcmp(argv[1], "--varargs") )
|
||||
{ convert_varargs = 1;
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
else
|
||||
{ fprintf(stderr, "Unrecognized switch: %s\n", argv[1]);
|
||||
exit(1);
|
||||
}
|
||||
while ( argc > 1 && argv[1][0] == '-' ) {
|
||||
if ( !strcmp(argv[1], "--varargs") ) {
|
||||
convert_varargs = 1;
|
||||
argc--;
|
||||
argv++;
|
||||
continue;
|
||||
}
|
||||
if (argc < 2 || argc > 3)
|
||||
if ( !strcmp(argv[1], "--filename") && argc > 2 ) {
|
||||
filename = argv[2];
|
||||
argc -= 2;
|
||||
argv += 2;
|
||||
continue;
|
||||
}
|
||||
fprintf(stderr, "Unrecognized switch: %s\n", argv[1]);
|
||||
fprintf(stderr, usage);
|
||||
exit(1);
|
||||
}
|
||||
switch ( argc )
|
||||
{
|
||||
printf("Usage: ansi2knr input_file [output_file]\n");
|
||||
exit(1);
|
||||
}
|
||||
in = fopen(argv[1], "r");
|
||||
if ( in == NULL )
|
||||
{
|
||||
fprintf(stderr, "Cannot open input file %s\n", argv[1]);
|
||||
exit(1);
|
||||
default:
|
||||
fprintf(stderr, usage);
|
||||
exit(0);
|
||||
case 3:
|
||||
out = fopen(argv[2], "w");
|
||||
if ( out == NULL ) {
|
||||
fprintf(stderr, "Cannot open output file %s\n", argv[2]);
|
||||
exit(1);
|
||||
}
|
||||
/* falls through */
|
||||
case 2:
|
||||
in = fopen(argv[1], "r");
|
||||
if ( in == NULL ) {
|
||||
fprintf(stderr, "Cannot open input file %s\n", argv[1]);
|
||||
exit(1);
|
||||
}
|
||||
if ( filename == 0 )
|
||||
filename = argv[1];
|
||||
/* falls through */
|
||||
case 1:
|
||||
break;
|
||||
}
|
||||
if (argc == 3)
|
||||
{
|
||||
out = fopen(argv[2], "w");
|
||||
if ( out == NULL )
|
||||
{
|
||||
fprintf(stderr, "Cannot open output file %s\n", argv[2]);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
out = stdout;
|
||||
}
|
||||
fprintf(out, "#line 1 \"%s\"\n", argv[1]);
|
||||
if ( filename )
|
||||
fprintf(out, "#line 1 \"%s\"\n", filename);
|
||||
buf = malloc(bufsize);
|
||||
line = buf;
|
||||
while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
|
||||
@@ -271,8 +293,10 @@ wl: fputs(buf, out);
|
||||
if ( line != buf )
|
||||
fputs(buf, out);
|
||||
free(buf);
|
||||
fclose(out);
|
||||
fclose(in);
|
||||
if ( out != stdout )
|
||||
fclose(out);
|
||||
if ( in != stdin )
|
||||
fclose(in);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,13 +32,13 @@
|
||||
#endif
|
||||
#include "system.h"
|
||||
#include "error.h"
|
||||
#include "safe-read.h"
|
||||
|
||||
/* Undefine, to avoid warning about redefinition on some systems. */
|
||||
#undef max
|
||||
#define max(h,i) ((h) > (i) ? (h) : (i))
|
||||
|
||||
int full_write ();
|
||||
int safe_read ();
|
||||
|
||||
/* Name under which this program was invoked. */
|
||||
char *program_name;
|
||||
@@ -722,7 +722,7 @@ main (int argc, char **argv)
|
||||
free (inbuf);
|
||||
|
||||
contin:
|
||||
if (strcmp (infile, "-") && close (input_desc) < 0)
|
||||
if (!STREQ (infile, "-") && close (input_desc) < 0)
|
||||
{
|
||||
error (0, errno, "%s", infile);
|
||||
exit_status = 1;
|
||||
|
||||
@@ -39,11 +39,11 @@
|
||||
struct group *getgrnam ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ENDGRENT
|
||||
#if ! HAVE_ENDGRENT
|
||||
# define endgrent() ((void) 0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCHOWN
|
||||
#if HAVE_LCHOWN
|
||||
# define LCHOWN(FILE, OWNER, GROUP) lchown (FILE, OWNER, GROUP)
|
||||
#else
|
||||
# define LCHOWN(FILE, OWNER, GROUP) 1
|
||||
@@ -379,7 +379,7 @@ main (int argc, char **argv)
|
||||
usage (1);
|
||||
}
|
||||
|
||||
#ifndef HAVE_LCHOWN
|
||||
#if ! HAVE_LCHOWN
|
||||
if (change_symlinks)
|
||||
{
|
||||
error (1, 0, _("--no-dereference (-h) is not supported on this system"));
|
||||
|
||||
63
src/chown.c
63
src/chown.c
@@ -46,21 +46,16 @@ struct group *getgrnam ();
|
||||
struct group *getgrgid ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ENDPWENT
|
||||
#if ! HAVE_ENDPWENT
|
||||
# define endpwent() ((void) 0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCHOWN
|
||||
# define LCHOWN(FILE, OWNER, GROUP) lchown (FILE, OWNER, GROUP)
|
||||
#else
|
||||
# define LCHOWN(FILE, OWNER, GROUP) 1
|
||||
#endif
|
||||
|
||||
char *parse_user_spec ();
|
||||
void strip_trailing_slashes ();
|
||||
|
||||
enum Change_status
|
||||
{
|
||||
CH_NOT_APPLIED,
|
||||
CH_SUCCEEDED,
|
||||
CH_FAILED,
|
||||
CH_NO_CHANGE_REQUESTED
|
||||
@@ -86,7 +81,7 @@ char *program_name;
|
||||
|
||||
/* If nonzero, and the systems has support for it, change the ownership
|
||||
of symbolic links rather than any files they point to. */
|
||||
static int change_symlinks;
|
||||
static int change_symlinks = 1;
|
||||
|
||||
/* If nonzero, change the ownership of directories recursively. */
|
||||
static int recurse;
|
||||
@@ -117,6 +112,7 @@ static struct option const long_options[] =
|
||||
{
|
||||
{"recursive", no_argument, 0, 'R'},
|
||||
{"changes", no_argument, 0, 'c'},
|
||||
{"dereference", no_argument, 0, 13},
|
||||
{"no-dereference", no_argument, 0, 'h'},
|
||||
{"quiet", no_argument, 0, 'f'},
|
||||
{"silent", no_argument, 0, 'f'},
|
||||
@@ -134,6 +130,14 @@ static void
|
||||
describe_change (const char *file, enum Change_status changed)
|
||||
{
|
||||
const char *fmt;
|
||||
|
||||
if (changed == CH_NOT_APPLIED)
|
||||
{
|
||||
printf (_("neither symbolic link %s nor referent has been changed\n"),
|
||||
file);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (changed)
|
||||
{
|
||||
case CH_SUCCEEDED:
|
||||
@@ -160,7 +164,7 @@ describe_change (const char *file, enum Change_status changed)
|
||||
Return 0 if successful, 1 if errors occurred. */
|
||||
|
||||
static int
|
||||
change_file_owner (const char *file, uid_t user, gid_t group)
|
||||
change_file_owner (int cmdline_arg, const char *file, uid_t user, gid_t group)
|
||||
{
|
||||
struct stat file_stats;
|
||||
uid_t newuser;
|
||||
@@ -179,14 +183,31 @@ change_file_owner (const char *file, uid_t user, gid_t group)
|
||||
if (newuser != file_stats.st_uid || newgroup != file_stats.st_gid)
|
||||
{
|
||||
int fail;
|
||||
int symlink_changed = 1;
|
||||
|
||||
if (change_symlinks)
|
||||
fail = LCHOWN (file, newuser, newgroup);
|
||||
if (S_ISLNK (file_stats.st_mode) && change_symlinks)
|
||||
{
|
||||
fail = lchown (file, newuser, newgroup);
|
||||
|
||||
/* Ignore the failure if it's due to lack of support (ENOSYS)
|
||||
and this is not a command line argument. */
|
||||
if (!cmdline_arg && fail && errno == ENOSYS)
|
||||
{
|
||||
fail = 0;
|
||||
symlink_changed = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
fail = chown (file, newuser, newgroup);
|
||||
{
|
||||
fail = chown (file, newuser, newgroup);
|
||||
}
|
||||
|
||||
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
|
||||
describe_change (file, (fail ? CH_FAILED : CH_SUCCEEDED));
|
||||
{
|
||||
enum Change_status ch_status = (! symlink_changed ? CH_NOT_APPLIED
|
||||
: (fail ? CH_FAILED : CH_SUCCEEDED));
|
||||
describe_change (file, ch_status);
|
||||
}
|
||||
|
||||
if (fail)
|
||||
{
|
||||
@@ -250,7 +271,7 @@ change_dir_owner (const char *dir, uid_t user, gid_t group, struct stat *statp)
|
||||
path = xrealloc (path, pathlength);
|
||||
}
|
||||
strcpy (path + dirlength, namep);
|
||||
errors |= change_file_owner (path, user, group);
|
||||
errors |= change_file_owner (0, path, user, group);
|
||||
}
|
||||
free (path);
|
||||
free (name_space);
|
||||
@@ -275,6 +296,8 @@ Usage: %s [OPTION]... OWNER[.[GROUP]] FILE...\n\
|
||||
Change the owner and/or group of each FILE to OWNER and/or GROUP.\n\
|
||||
\n\
|
||||
-c, --changes be verbose whenever change occurs\n\
|
||||
--dereference affect the referent of each symbolic link, rather\n\
|
||||
than the symbolic link itself\n\
|
||||
-h, --no-dereference affect symbolic links instead of any referenced file\n\
|
||||
(available only on systems that can change the\n\
|
||||
ownership of a symlink)\n\
|
||||
@@ -320,6 +343,9 @@ main (int argc, char **argv)
|
||||
case 12:
|
||||
reference_file = optarg;
|
||||
break;
|
||||
case 13:
|
||||
change_symlinks = 0;
|
||||
break;
|
||||
case 'R':
|
||||
recurse = 1;
|
||||
break;
|
||||
@@ -356,13 +382,6 @@ main (int argc, char **argv)
|
||||
usage (1);
|
||||
}
|
||||
|
||||
#ifndef HAVE_LCHOWN
|
||||
if (change_symlinks)
|
||||
{
|
||||
error (1, 0, _("--no-dereference (-h) is not supported on this system"));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (reference_file)
|
||||
{
|
||||
struct stat ref_stats;
|
||||
@@ -387,7 +406,7 @@ main (int argc, char **argv)
|
||||
for (; optind < argc; ++optind)
|
||||
{
|
||||
strip_trailing_slashes (argv[optind]);
|
||||
errors |= change_file_owner (argv[optind], user, group);
|
||||
errors |= change_file_owner (1, argv[optind], user, group);
|
||||
}
|
||||
|
||||
if (verbosity != V_off)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* cksum -- calculate and print POSIX.2 checksums and sizes of files
|
||||
Copyright (C) 92, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 92, 95, 96, 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
|
||||
@@ -202,7 +202,7 @@ cksum (char *file, int print_name)
|
||||
long bytes_read;
|
||||
register FILE *fp;
|
||||
|
||||
if (!strcmp (file, "-"))
|
||||
if (STREQ (file, "-"))
|
||||
{
|
||||
fp = stdin;
|
||||
have_read_stdin = 1;
|
||||
@@ -229,12 +229,12 @@ cksum (char *file, int print_name)
|
||||
if (ferror (fp))
|
||||
{
|
||||
error (0, errno, "%s", file);
|
||||
if (strcmp (file, "-"))
|
||||
if (!STREQ (file, "-"))
|
||||
fclose (fp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strcmp (file, "-") && fclose (fp) == EOF)
|
||||
if (!STREQ (file, "-") && fclose (fp) == EOF)
|
||||
{
|
||||
error (0, errno, "%s", file);
|
||||
return -1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* comm -- compare two sorted files line by line.
|
||||
Copyright (C) 86, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 86, 90, 91, 95, 96, 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
|
||||
@@ -148,8 +148,7 @@ compare_files (char **infiles)
|
||||
{
|
||||
initbuffer (&lb1[i]);
|
||||
thisline[i] = &lb1[i];
|
||||
streams[i] = strcmp (infiles[i], "-")
|
||||
? fopen (infiles[i], "r") : stdin;
|
||||
streams[i] = (STREQ (infiles[i], "-") ? stdin : fopen (infiles[i], "r"));
|
||||
if (!streams[i])
|
||||
{
|
||||
error (0, errno, "%s", infiles[i]);
|
||||
|
||||
169
src/copy.c
169
src/copy.c
@@ -1,3 +1,22 @@
|
||||
/* copy.c -- core functions for copying files and directories
|
||||
Copyright (C) 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation.
|
||||
|
||||
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. */
|
||||
|
||||
/* Extracted from cp.c and librarified by Jim Meyering. */
|
||||
|
||||
#ifdef _AIX
|
||||
#pragma alloca
|
||||
#endif
|
||||
@@ -43,11 +62,34 @@ int yesno ();
|
||||
static int copy_internal PARAMS ((const char *src_path, const char *dst_path,
|
||||
int new_dst, dev_t device,
|
||||
struct dir_list *ancestors,
|
||||
const struct cp_options *x));
|
||||
const struct cp_options *x,
|
||||
int move_mode,
|
||||
int *copy_into_self,
|
||||
int *rename_succeeded));
|
||||
|
||||
/* The invocation name of this program. */
|
||||
extern char *program_name;
|
||||
|
||||
/* Encapsulate selection of the file mode to be applied to
|
||||
new non-directories. */
|
||||
|
||||
static mode_t
|
||||
new_nondir_mode (const struct cp_options *option, mode_t mode)
|
||||
{
|
||||
/* In some applications (e.g., install), use precisely the
|
||||
specified mode. */
|
||||
if (option->set_mode)
|
||||
return option->mode;
|
||||
|
||||
/* In others (e.g., cp, mv), apply the user's umask. */
|
||||
return mode & option->umask_kill;
|
||||
}
|
||||
|
||||
/* FIXME: describe */
|
||||
/* FIXME: rewrite this to use a hash table so we avoid the quadratic
|
||||
performance hit that's probably noticeable only on trees deeper
|
||||
than a few hundred levels. See use of active_dir_map in remove.c */
|
||||
|
||||
static int
|
||||
is_ancestor (const struct stat *sb, const struct dir_list *ancestors)
|
||||
{
|
||||
@@ -64,17 +106,17 @@ is_ancestor (const struct stat *sb, const struct dir_list *ancestors)
|
||||
copy the contents to DST_PATH_IN. NEW_DST is nonzero if
|
||||
DST_PATH_IN is a directory that was created previously in the
|
||||
recursion. SRC_SB and ANCESTORS describe SRC_PATH_IN.
|
||||
Set *COPY_INTO_SELF to nonzero if SRC_PATH_IN is a parent of
|
||||
(or the same as) DST_PATH_IN; otherwise, set it to zero.
|
||||
Return 0 if successful, -1 if an error occurs. */
|
||||
|
||||
static int
|
||||
copy_dir (const char *src_path_in, const char *dst_path_in, int new_dst,
|
||||
const struct stat *src_sb, struct dir_list *ancestors,
|
||||
const struct cp_options *x)
|
||||
const struct cp_options *x, int *copy_into_self)
|
||||
{
|
||||
char *name_space;
|
||||
char *namep;
|
||||
char *src_path;
|
||||
char *dst_path;
|
||||
int ret = 0;
|
||||
|
||||
errno = 0;
|
||||
@@ -93,13 +135,16 @@ copy_dir (const char *src_path_in, const char *dst_path_in, int new_dst,
|
||||
namep = name_space;
|
||||
while (*namep != '\0')
|
||||
{
|
||||
src_path = path_concat (src_path_in, namep, NULL);
|
||||
dst_path = path_concat (dst_path_in, namep, NULL);
|
||||
int local_copy_into_self;
|
||||
char *src_path = path_concat (src_path_in, namep, NULL);
|
||||
char *dst_path = path_concat (dst_path_in, namep, NULL);
|
||||
|
||||
if (dst_path == NULL || src_path == NULL)
|
||||
error (1, 0, _("virtual memory exhausted"));
|
||||
|
||||
ret |= copy_internal (src_path, dst_path, new_dst, src_sb->st_dev,
|
||||
ancestors, x);
|
||||
ancestors, x, 0, &local_copy_into_self, NULL);
|
||||
*copy_into_self |= local_copy_into_self;
|
||||
|
||||
/* Free the memory for `src_path'. The memory for `dst_path'
|
||||
cannot be deallocated, since it is used to create multiple
|
||||
@@ -166,7 +211,7 @@ copy_reg (const char *src_path, const char *dst_path,
|
||||
|
||||
buf_size = ST_BLKSIZE (sb);
|
||||
|
||||
#ifdef HAVE_ST_BLOCKS
|
||||
#if HAVE_ST_BLOCKS
|
||||
if (sparse_mode == SPARSE_AUTO && S_ISREG (sb.st_mode))
|
||||
{
|
||||
/* Use a heuristic to determine whether SRC_PATH contains any
|
||||
@@ -263,7 +308,7 @@ copy_reg (const char *src_path, const char *dst_path,
|
||||
|
||||
if (last_write_made_hole)
|
||||
{
|
||||
#ifdef HAVE_FTRUNCATE
|
||||
#if HAVE_FTRUNCATE
|
||||
/* Write a null character and truncate it again. */
|
||||
if (full_write (dest_desc, "", 1) < 0
|
||||
|| ftruncate (dest_desc, n_read_total) < 0)
|
||||
@@ -301,12 +346,19 @@ ret2:
|
||||
number of the parent directory, or 0 if the parent of this file is
|
||||
not known. ANCESTORS points to a linked, null terminated list of
|
||||
devices and inodes of parent directories of SRC_PATH.
|
||||
Set *COPY_INTO_SELF to nonzero if SRC_PATH is a parent of (or the
|
||||
same as) DST_PATH; otherwise, set it to zero.
|
||||
Return 0 if successful, 1 if an error occurs. */
|
||||
|
||||
static int
|
||||
copy_internal (const char *src_path, const char *dst_path,
|
||||
int new_dst, dev_t device, struct dir_list *ancestors,
|
||||
const struct cp_options *x)
|
||||
int new_dst,
|
||||
dev_t device,
|
||||
struct dir_list *ancestors,
|
||||
const struct cp_options *x,
|
||||
int move_mode,
|
||||
int *copy_into_self,
|
||||
int *rename_succeeded)
|
||||
{
|
||||
struct stat src_sb;
|
||||
struct stat dst_sb;
|
||||
@@ -316,6 +368,10 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
char *dst_backup = NULL;
|
||||
int fix_mode = 0;
|
||||
|
||||
if (move_mode && rename_succeeded)
|
||||
*rename_succeeded = 0;
|
||||
|
||||
*copy_into_self = 0;
|
||||
if ((*(x->xstat)) (src_path, &src_sb))
|
||||
{
|
||||
error (0, errno, "%s", src_path);
|
||||
@@ -335,7 +391,10 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
/* Did we just create this file? */
|
||||
|
||||
if (earlier_file == &new_file)
|
||||
return 0;
|
||||
{
|
||||
*copy_into_self = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
src_mode = src_sb.st_mode;
|
||||
src_type = src_sb.st_mode;
|
||||
@@ -423,6 +482,13 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* In move_mode, DEST may not be an existing directory. */
|
||||
if (move_mode && S_ISDIR (dst_sb.st_mode))
|
||||
{
|
||||
error (0, 0, _("%s: cannot overwrite directory"), dst_path);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (x->backup_type != none && !S_ISDIR (dst_sb.st_mode))
|
||||
{
|
||||
char *tmp_backup = find_backup_file_name (dst_path,
|
||||
@@ -436,12 +502,15 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
would leave two zero-length files: a and a~. */
|
||||
if (STREQ (tmp_backup, src_path))
|
||||
{
|
||||
error (0, 0,
|
||||
_("backing up `%s' would destroy source; `%s' not copied"),
|
||||
dst_path, src_path);
|
||||
const char *fmt;
|
||||
fmt = (move_mode
|
||||
? _("backing up `%s' would destroy source; `%s' not moved")
|
||||
: _("backing up `%s' would destroy source; `%s' not copied"));
|
||||
error (0, 0, fmt, dst_path, src_path);
|
||||
free (tmp_backup);
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
dst_backup = (char *) alloca (strlen (tmp_backup) + 1);
|
||||
strcpy (dst_backup, tmp_backup);
|
||||
free (tmp_backup);
|
||||
@@ -479,9 +548,13 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
{
|
||||
error (0, errno, _("cannot remove old link to `%s'"),
|
||||
dst_path);
|
||||
return 1;
|
||||
if (x->failed_unlink_is_fatal)
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_dst = 1;
|
||||
}
|
||||
new_dst = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -506,6 +579,15 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (move_mode && rename (src_path, dst_path) == 0)
|
||||
{
|
||||
if (x->verbose && S_ISDIR (src_type))
|
||||
printf ("%s -> %s\n", src_path, dst_path);
|
||||
if (rename_succeeded)
|
||||
*rename_succeeded = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (S_ISDIR (src_type))
|
||||
{
|
||||
struct dir_list *dir;
|
||||
@@ -552,7 +634,8 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
|
||||
/* Copy the contents of the directory. */
|
||||
|
||||
if (copy_dir (src_path, dst_path, new_dst, &src_sb, dir, x))
|
||||
if (copy_dir (src_path, dst_path, new_dst, &src_sb, dir, x,
|
||||
copy_into_self))
|
||||
return 1;
|
||||
}
|
||||
#ifdef S_ISLNK
|
||||
@@ -602,7 +685,7 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
#ifdef S_ISFIFO
|
||||
if (S_ISFIFO (src_type))
|
||||
{
|
||||
if (mkfifo (dst_path, src_mode & x->umask_kill))
|
||||
if (mkfifo (dst_path, new_nondir_mode (x, src_mode)))
|
||||
{
|
||||
error (0, errno, _("cannot create fifo `%s'"), dst_path);
|
||||
goto un_backup;
|
||||
@@ -616,7 +699,7 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (mknod (dst_path, src_mode & x->umask_kill, src_sb.st_rdev))
|
||||
if (mknod (dst_path, new_nondir_mode (x, src_mode), src_sb.st_rdev))
|
||||
{
|
||||
error (0, errno, _("cannot create special file `%s'"), dst_path);
|
||||
goto un_backup;
|
||||
@@ -644,11 +727,11 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
goto un_backup;
|
||||
}
|
||||
|
||||
if (x->preserve)
|
||||
if (x->preserve_owner_and_group)
|
||||
{
|
||||
/* Preserve the owner and group of the just-`copied'
|
||||
symbolic link, if possible. */
|
||||
# ifdef HAVE_LCHOWN
|
||||
# if HAVE_LCHOWN
|
||||
if (DO_CHOWN (lchown, dst_path, src_sb.st_uid, src_sb.st_gid))
|
||||
{
|
||||
error (0, errno, _("preserving ownership for %s"), dst_path);
|
||||
@@ -699,7 +782,7 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
chown turns off set[ug]id bits for non-root,
|
||||
so do the chmod last. */
|
||||
|
||||
if (x->preserve)
|
||||
if (x->preserve_timestamps)
|
||||
{
|
||||
struct utimbuf utb;
|
||||
|
||||
@@ -712,7 +795,10 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
if (x->require_preserve)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (x->preserve_owner_and_group)
|
||||
{
|
||||
if (DO_CHOWN (chown, dst_path, src_sb.st_uid, src_sb.st_gid))
|
||||
{
|
||||
error (0, errno, _("preserving ownership for %s"), dst_path);
|
||||
@@ -721,8 +807,17 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
}
|
||||
}
|
||||
|
||||
if ((x->preserve || new_dst)
|
||||
&& (x->copy_as_regular || S_ISREG (src_type) || S_ISDIR (src_type)))
|
||||
if (x->set_mode)
|
||||
{
|
||||
/* This is so install's -m MODE option works. */
|
||||
if (chmod (dst_path, x->mode))
|
||||
{
|
||||
error (0, errno, _("setting permissions for %s"), dst_path);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if ((x->preserve_chmod_bits || new_dst)
|
||||
&& (x->copy_as_regular || S_ISREG (src_type) || S_ISDIR (src_type)))
|
||||
{
|
||||
if (chmod (dst_path, src_mode & x->umask_kill))
|
||||
{
|
||||
@@ -759,10 +854,15 @@ valid_options (const struct cp_options *co)
|
||||
|
||||
assert (VALID_BACKUP_TYPE (co->backup_type));
|
||||
|
||||
/* FIXME: make sure xstat and dereference are consistent. */
|
||||
assert (co->xstat);
|
||||
/* FIXME: for some reason this assertion always fails,
|
||||
at least on Solaris2.5.1. Just disable it for now. */
|
||||
/* assert (co->xstat == lstat || co->xstat == stat); */
|
||||
|
||||
/* Make sure xstat and dereference are consistent. */
|
||||
/* FIXME */
|
||||
|
||||
assert (VALID_SPARSE_MODE (co->sparse_mode));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -771,12 +871,21 @@ valid_options (const struct cp_options *co)
|
||||
is known not to exist (e.g., because its parent directory was just
|
||||
created); NONEXISTENT_DST should be zero if DST_PATH might already
|
||||
exist. OPTIONS is ... FIXME-describe
|
||||
Set *COPY_INTO_SELF to nonzero if SRC_PATH is a parent of (or the
|
||||
same as) DST_PATH; otherwise, set it to zero.
|
||||
Return 0 if successful, 1 if an error occurs. */
|
||||
|
||||
int
|
||||
copy (const char *src_path, const char *dst_path,
|
||||
int nonexistent_dst, const struct cp_options *options)
|
||||
int nonexistent_dst, const struct cp_options *options,
|
||||
int *copy_into_self, int *rename_succeeded)
|
||||
{
|
||||
/* move_mode is set to the value from the `options' parameter for the
|
||||
first copy_internal call. For all subsequent calls (if any), it must
|
||||
be zero. */
|
||||
int move_mode = options->move_mode;
|
||||
|
||||
assert (valid_options (options));
|
||||
return copy_internal (src_path, dst_path, nonexistent_dst, 0, NULL, options);
|
||||
return copy_internal (src_path, dst_path, nonexistent_dst, 0, NULL,
|
||||
options, move_mode, copy_into_self, rename_succeeded);
|
||||
}
|
||||
|
||||
26
src/copy.h
26
src/copy.h
@@ -41,6 +41,13 @@ struct cp_options
|
||||
/* If nonzero, remove existing destination nondirectories. */
|
||||
int force;
|
||||
|
||||
/* Setting this member is meaningful only if FORCE is also set.
|
||||
If nonzero, copy returns nonzero upon failed unlink.
|
||||
Otherwise, the failure still elicits a diagnostic, but it doesn't
|
||||
change copy's return value. This is nonzero for cp and mv, and zero
|
||||
for install. */
|
||||
int failed_unlink_is_fatal;
|
||||
|
||||
/* If nonzero, create hard links instead of copying files.
|
||||
Create destination directories as usual. */
|
||||
int hard_link;
|
||||
@@ -49,6 +56,10 @@ struct cp_options
|
||||
with regular files. */
|
||||
int interactive;
|
||||
|
||||
/* If nonzero, rather than copying, first attempt to use rename.
|
||||
If that fails, then resort to copying. */
|
||||
int move_mode;
|
||||
|
||||
/* This process's effective user ID. */
|
||||
uid_t myeuid;
|
||||
|
||||
@@ -58,7 +69,9 @@ struct cp_options
|
||||
|
||||
/* If nonzero, attempt to give the copies the original files' permissions,
|
||||
owner, group, and timestamps. */
|
||||
int preserve;
|
||||
int preserve_owner_and_group;
|
||||
int preserve_chmod_bits;
|
||||
int preserve_timestamps;
|
||||
|
||||
/* If nonzero and any of the above (for preserve) file attributes cannot
|
||||
be applied to a destination file, treat it as a failure and return
|
||||
@@ -70,6 +83,14 @@ struct cp_options
|
||||
as themselves rather than copying their contents. */
|
||||
int recursive;
|
||||
|
||||
/* If nonzero, set file mode to value of MODE. Otherwise,
|
||||
set it based on current umask modified by UMASK_KILL. */
|
||||
int set_mode;
|
||||
|
||||
/* Set the mode of the destination file to exactly this value
|
||||
if USE_MODE is nonzero. */
|
||||
mode_t mode;
|
||||
|
||||
/* Control creation of sparse files. */
|
||||
enum Sparse_type sparse_mode;
|
||||
|
||||
@@ -94,6 +115,7 @@ struct cp_options
|
||||
|
||||
int
|
||||
copy PARAMS ((const char *src_path, const char *dst_path,
|
||||
int nonexistent_dst, const struct cp_options *options));
|
||||
int nonexistent_dst, const struct cp_options *options,
|
||||
int *copy_into_self, int *rename_succeeded));
|
||||
|
||||
#endif
|
||||
|
||||
@@ -48,6 +48,8 @@ struct htab
|
||||
struct htab *htab;
|
||||
char new_file;
|
||||
|
||||
static char *cph_hash_insert PARAMS ((ino_t ino, dev_t dev, const char *node));
|
||||
|
||||
/* Add PATH to the list of files that we have created.
|
||||
Return 0 if successful, 1 if not. */
|
||||
|
||||
@@ -62,7 +64,7 @@ remember_created (const char *path)
|
||||
return 1;
|
||||
}
|
||||
|
||||
hash_insert (sb.st_ino, sb.st_dev, &new_file);
|
||||
cph_hash_insert (sb.st_ino, sb.st_dev, &new_file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -73,7 +75,7 @@ remember_created (const char *path)
|
||||
char *
|
||||
remember_copied (const char *node, ino_t ino, dev_t dev)
|
||||
{
|
||||
return hash_insert (ino, dev, node);
|
||||
return cph_hash_insert (ino, dev, node);
|
||||
}
|
||||
|
||||
/* Allocate space for the hash structures, and set the global
|
||||
@@ -165,8 +167,8 @@ hash_insert2 (struct htab *ht, ino_t ino, dev_t dev, const char *node)
|
||||
the same inode and device was not found already.
|
||||
Return NULL if inserted, otherwise non-NULL. */
|
||||
|
||||
char *
|
||||
hash_insert (ino_t ino, dev_t dev, const char *node)
|
||||
static char *
|
||||
cph_hash_insert (ino_t ino, dev_t dev, const char *node)
|
||||
{
|
||||
struct htab *htab_r = htab;
|
||||
|
||||
|
||||
@@ -4,6 +4,5 @@ extern char new_file;
|
||||
|
||||
void hash_init PARAMS ((unsigned int modulus, unsigned int entry_tab_size));
|
||||
void forget_all PARAMS ((void));
|
||||
char *hash_insert PARAMS ((ino_t ino, dev_t dev, const char *node));
|
||||
char *remember_copied PARAMS ((const char *node, ino_t ino, dev_t dev));
|
||||
int remember_created PARAMS ((const char *path));
|
||||
|
||||
39
src/cp.c
39
src/cp.c
@@ -24,13 +24,9 @@
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* FIXME: uncomment for release
|
||||
#define NDEBUG
|
||||
*/
|
||||
#include <assert.h>
|
||||
|
||||
#include <getopt.h>
|
||||
|
||||
#include "system.h"
|
||||
#include "backupfile.h"
|
||||
#include "argmatch.h"
|
||||
@@ -233,7 +229,7 @@ re_protect (const char *const_dst_path, int src_offset,
|
||||
chown turns off set[ug]id bits for non-root,
|
||||
so do the chmod last. */
|
||||
|
||||
if (x->preserve)
|
||||
if (x->preserve_timestamps)
|
||||
{
|
||||
struct utimbuf utb;
|
||||
|
||||
@@ -245,7 +241,10 @@ re_protect (const char *const_dst_path, int src_offset,
|
||||
error (0, errno, _("preserving times for %s"), dst_path);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (x->preserve_owner_and_group)
|
||||
{
|
||||
/* If non-root uses -p, it's ok if we can't preserve ownership.
|
||||
But root probably wants to know, e.g. if NFS disallows it,
|
||||
or if the target system doesn't support file ownership. */
|
||||
@@ -257,7 +256,7 @@ re_protect (const char *const_dst_path, int src_offset,
|
||||
}
|
||||
}
|
||||
|
||||
if (x->preserve || p->is_new_dir)
|
||||
if (x->preserve_chmod_bits || p->is_new_dir)
|
||||
{
|
||||
if (chmod (dst_path, src_sb.st_mode & x->umask_kill))
|
||||
{
|
||||
@@ -485,7 +484,8 @@ do_copy (int argc, char **argv, const struct cp_options *x)
|
||||
}
|
||||
else
|
||||
{
|
||||
ret |= copy (arg, dst_path, new_dst, x);
|
||||
int unused;
|
||||
ret |= copy (arg, dst_path, new_dst, x, &unused, NULL);
|
||||
forget_all ();
|
||||
|
||||
if (flag_path)
|
||||
@@ -506,6 +506,7 @@ do_copy (int argc, char **argv, const struct cp_options *x)
|
||||
{
|
||||
char *new_dest;
|
||||
char *source;
|
||||
int unused;
|
||||
struct stat source_stats;
|
||||
|
||||
if (flag_path)
|
||||
@@ -572,7 +573,7 @@ do_copy (int argc, char **argv, const struct cp_options *x)
|
||||
new_dest = dest;
|
||||
}
|
||||
|
||||
return copy (source, new_dest, new_dst, x);
|
||||
return copy (source, new_dest, new_dst, x, &unused, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -593,15 +594,23 @@ cp_option_init (struct cp_options *x)
|
||||
x->copy_as_regular = 1;
|
||||
x->dereference = 1;
|
||||
x->force = 0;
|
||||
x->failed_unlink_is_fatal = 1;
|
||||
x->hard_link = 0;
|
||||
x->interactive = 0;
|
||||
x->myeuid = geteuid ();
|
||||
x->move_mode = 0;
|
||||
x->one_file_system = 0;
|
||||
x->preserve = 0;
|
||||
|
||||
x->preserve_owner_and_group = 0;
|
||||
x->preserve_chmod_bits = 0;
|
||||
x->preserve_timestamps = 0;
|
||||
|
||||
x->require_preserve = 0;
|
||||
x->recursive = 0;
|
||||
x->sparse_mode = SPARSE_AUTO;
|
||||
x->symbolic_link = 0;
|
||||
x->set_mode = 0;
|
||||
x->mode = 0;
|
||||
|
||||
/* Find out the current file creation mask, to knock the right bits
|
||||
when using chmod. The creation mask is set to be liberal, so
|
||||
@@ -658,7 +667,9 @@ main (int argc, char **argv)
|
||||
|
||||
case 'a': /* Like -dpR. */
|
||||
x.dereference = 0;
|
||||
x.preserve = 1;
|
||||
x.preserve_owner_and_group = 1;
|
||||
x.preserve_chmod_bits = 1;
|
||||
x.preserve_timestamps = 1;
|
||||
x.require_preserve = 1;
|
||||
x.recursive = 1;
|
||||
x.copy_as_regular = 0;
|
||||
@@ -687,7 +698,9 @@ main (int argc, char **argv)
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
x.preserve = 1;
|
||||
x.preserve_owner_and_group = 1;
|
||||
x.preserve_chmod_bits = 1;
|
||||
x.preserve_timestamps = 1;
|
||||
x.require_preserve = 1;
|
||||
break;
|
||||
|
||||
@@ -756,7 +769,7 @@ main (int argc, char **argv)
|
||||
|
||||
x.backup_type = (make_backups ? get_version (version) : none);
|
||||
|
||||
if (x.preserve == 1)
|
||||
if (x.preserve_chmod_bits == 1)
|
||||
x.umask_kill = 0777777;
|
||||
|
||||
/* The key difference between -d (--no-dereference) and not is the version
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Disable assertions. Some systems have broken assert macros. */
|
||||
#define NDEBUG 1
|
||||
|
||||
#include <assert.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/types.h>
|
||||
@@ -41,6 +37,7 @@
|
||||
#include "error.h"
|
||||
#include "xstrtoul.h"
|
||||
#include "xalloc.h"
|
||||
#include "safe-read.h"
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
@@ -126,8 +123,6 @@ struct buffer_record
|
||||
struct buffer_record *next;
|
||||
};
|
||||
|
||||
int safe_read ();
|
||||
|
||||
static void close_output_file PARAMS ((void));
|
||||
static void create_output_file PARAMS ((void));
|
||||
static void delete_all_files PARAMS ((void));
|
||||
@@ -690,7 +685,7 @@ no_more_lines (void)
|
||||
static void
|
||||
set_input_file (const char *name)
|
||||
{
|
||||
if (!strcmp (name, "-"))
|
||||
if (STREQ (name, "-"))
|
||||
input_desc = 0;
|
||||
else
|
||||
{
|
||||
|
||||
12
src/cut.c
12
src/cut.c
@@ -1,5 +1,5 @@
|
||||
/* cut - remove parts of lines of files
|
||||
Copyright (C) 1984, 1997 by David M. Ihnat
|
||||
Copyright (C) 1984, 1997, 1998 by David M. Ihnat
|
||||
|
||||
This program is a total rewrite of the Bell Laboratories Unix(Tm)
|
||||
command of the same name, as of System V. It contains no proprietary
|
||||
@@ -61,14 +61,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Get isblank from GNU libc. */
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <assert.h>
|
||||
|
||||
#include <getopt.h>
|
||||
#include <sys/types.h>
|
||||
#include "system.h"
|
||||
@@ -644,7 +638,7 @@ cut_file (char *file)
|
||||
{
|
||||
FILE *stream;
|
||||
|
||||
if (!strcmp (file, "-"))
|
||||
if (STREQ (file, "-"))
|
||||
{
|
||||
have_read_stdin = 1;
|
||||
stream = stdin;
|
||||
@@ -666,7 +660,7 @@ cut_file (char *file)
|
||||
error (0, errno, "%s", file);
|
||||
return 1;
|
||||
}
|
||||
if (!strcmp (file, "-"))
|
||||
if (STREQ (file, "-"))
|
||||
clearerr (stream); /* Also clear EOF. */
|
||||
else if (fclose (stream) == EOF)
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "system.h"
|
||||
#include "getline.h"
|
||||
#include "error.h"
|
||||
#include "get-date.h"
|
||||
#include "getdate.h"
|
||||
|
||||
#ifndef STDC_HEADERS
|
||||
size_t strftime ();
|
||||
@@ -170,7 +170,7 @@ batch_convert (const char *input_filename, const char *format)
|
||||
{
|
||||
if (line[line_length - 1] == '\n')
|
||||
line[line_length - 1] = '\0';
|
||||
error (0, 0, _("invalid date ` %s'"), line);
|
||||
error (0, 0, _("invalid date `%s'"), line);
|
||||
status = 1;
|
||||
}
|
||||
else
|
||||
|
||||
4
src/dd.c
4
src/dd.c
@@ -33,6 +33,7 @@
|
||||
#include "system.h"
|
||||
#include "closeout.h"
|
||||
#include "error.h"
|
||||
#include "safe-read.h"
|
||||
|
||||
#ifndef SIGINFO
|
||||
# define SIGINFO SIGUSR1
|
||||
@@ -62,7 +63,6 @@
|
||||
/* Use separate input and output buffers, and combine partial input blocks. */
|
||||
#define C_TWOBUFS 04000
|
||||
|
||||
int safe_read ();
|
||||
int full_write ();
|
||||
|
||||
/* The name this program was run with. */
|
||||
@@ -1106,7 +1106,7 @@ main (int argc, char **argv)
|
||||
output_fd = open (output_file, omode, 0666);
|
||||
if (output_fd < 0)
|
||||
error (1, errno, "%s", output_file);
|
||||
#ifdef HAVE_FTRUNCATE
|
||||
#if HAVE_FTRUNCATE
|
||||
if (seek_record != 0 && !(conversions_mask & C_NOTRUNC))
|
||||
{
|
||||
off_t o = seek_record * output_blocksize;
|
||||
|
||||
28
src/df.c
28
src/df.c
@@ -268,7 +268,9 @@ show_dev (const char *disk, const char *mount_point, const char *fstype)
|
||||
else
|
||||
{
|
||||
int w = human_readable_base ? 5 : 7;
|
||||
char buf[3][LONGEST_HUMAN_READABLE + 1];
|
||||
char buf[2][LONGEST_HUMAN_READABLE + 1];
|
||||
char availbuf[LONGEST_HUMAN_READABLE + 2];
|
||||
char *avail;
|
||||
double blocks_percent_used;
|
||||
uintmax_t blocks_used;
|
||||
|
||||
@@ -281,18 +283,31 @@ show_dev (const char *disk, const char *mount_point, const char *fstype)
|
||||
{
|
||||
blocks_used = fsu.fsu_blocks - fsu.fsu_bfree;
|
||||
blocks_percent_used =
|
||||
(fsu.fsu_bfree < fsu.fsu_bavail ? -1
|
||||
: (blocks_used + fsu.fsu_bavail) == 0 ? 0
|
||||
((fsu.fsu_bavail == -1
|
||||
|| blocks_used + fsu.fsu_bavail == 0
|
||||
|| (fsu.fsu_bavail_top_bit_set
|
||||
? blocks_used < - fsu.fsu_bavail
|
||||
: fsu.fsu_bfree < fsu.fsu_bavail))
|
||||
? -1
|
||||
: blocks_used * 100.0 / (blocks_used + fsu.fsu_bavail));
|
||||
}
|
||||
|
||||
avail = df_readable ((fsu.fsu_bavail_top_bit_set
|
||||
? - fsu.fsu_bavail
|
||||
: fsu.fsu_bavail),
|
||||
availbuf + 1, fsu.fsu_blocksize,
|
||||
output_units, human_readable_base);
|
||||
|
||||
if (fsu.fsu_bavail_top_bit_set)
|
||||
*--avail = '-';
|
||||
|
||||
printf (" %*s %*s %*s ",
|
||||
w, df_readable (fsu.fsu_blocks, buf[0], fsu.fsu_blocksize,
|
||||
output_units, human_readable_base),
|
||||
w, df_readable (blocks_used, buf[1], fsu.fsu_blocksize,
|
||||
output_units, human_readable_base),
|
||||
w, df_readable (fsu.fsu_bavail, buf[2], fsu.fsu_blocksize,
|
||||
output_units, human_readable_base));
|
||||
w, avail);
|
||||
|
||||
if (blocks_percent_used < 0)
|
||||
printf (" - ");
|
||||
else
|
||||
@@ -568,7 +583,7 @@ main (int argc, char **argv)
|
||||
human_readable_base = 1024;
|
||||
output_units = 1;
|
||||
}
|
||||
else if (bs && strcmp (bs, "SI") == 0)
|
||||
else if (bs && STREQ (bs, "SI"))
|
||||
{
|
||||
human_readable_base = 1000;
|
||||
output_units = 1;
|
||||
@@ -738,4 +753,3 @@ with the portable output format"));
|
||||
close_stdout ();
|
||||
exit (exit_status);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* dircolors - output commands to set the LS_COLOR environment variable
|
||||
Copyright (C) 1994, 1995, 1997 H. Peter Anvin
|
||||
Copyright (C) 1994, 1995, 1997, 1998 H. Peter Anvin
|
||||
Copyright (C) 96, 97, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -151,16 +151,16 @@ guess_shell_syntax (void)
|
||||
}
|
||||
|
||||
static void
|
||||
parse_line (const char *line, char **keyword, char **arg)
|
||||
parse_line (unsigned char const *line, char **keyword, char **arg)
|
||||
{
|
||||
const char *p;
|
||||
const char *keyword_start;
|
||||
const char *arg_start;
|
||||
unsigned char const *p;
|
||||
unsigned char const *keyword_start;
|
||||
unsigned char const *arg_start;
|
||||
|
||||
*keyword = NULL;
|
||||
*arg = NULL;
|
||||
|
||||
for (p = line; isspace (*p); ++p)
|
||||
for (p = line; ISSPACE (*p); ++p)
|
||||
;
|
||||
|
||||
/* Ignore blank lines and shell-style comments. */
|
||||
@@ -169,7 +169,7 @@ parse_line (const char *line, char **keyword, char **arg)
|
||||
|
||||
keyword_start = p;
|
||||
|
||||
while (!isspace (*p) && *p != '\0')
|
||||
while (!ISSPACE (*p) && *p != '\0')
|
||||
{
|
||||
++p;
|
||||
}
|
||||
@@ -182,7 +182,7 @@ parse_line (const char *line, char **keyword, char **arg)
|
||||
{
|
||||
++p;
|
||||
}
|
||||
while (isspace (*p));
|
||||
while (ISSPACE (*p));
|
||||
|
||||
if (*p == '\0' || *p == '#')
|
||||
return;
|
||||
@@ -192,7 +192,7 @@ parse_line (const char *line, char **keyword, char **arg)
|
||||
while (*p != '\0' && *p != '#')
|
||||
++p;
|
||||
|
||||
for (--p; isspace (*p); --p)
|
||||
for (--p; ISSPACE (*p); --p)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
@@ -295,7 +295,7 @@ dc_parse_stream (FILE *fp, const char *filename)
|
||||
unrecognized = 0;
|
||||
if (strcasecmp (keywd, "TERM") == 0)
|
||||
{
|
||||
if (strcmp (arg, term) == 0)
|
||||
if (STREQ (arg, term))
|
||||
state = ST_TERMSURE;
|
||||
else if (state != ST_TERMSURE)
|
||||
state = ST_TERMNO;
|
||||
@@ -376,7 +376,7 @@ dc_parse_file (const char *filename)
|
||||
FILE *fp;
|
||||
int err;
|
||||
|
||||
if (strcmp (filename, "-") == 0)
|
||||
if (STREQ (filename, "-"))
|
||||
{
|
||||
have_read_stdin = 1;
|
||||
fp = stdin;
|
||||
|
||||
2
src/du.c
2
src/du.c
@@ -274,7 +274,7 @@ main (int argc, char **argv)
|
||||
human_readable_base = 1024;
|
||||
output_units = 1;
|
||||
}
|
||||
else if (bs && strcmp (bs, "SI") == 0)
|
||||
else if (bs && STREQ (bs, "SI"))
|
||||
{
|
||||
human_readable_base = 1000;
|
||||
output_units = 1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* expand - convert tabs to spaces
|
||||
Copyright (C) 89, 91, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 89, 91, 95, 96, 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
|
||||
@@ -35,9 +35,6 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Get isblank from GNU libc. */
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user