- Remove GNU sort and the WITH_GNU_SORT knob

This commit is contained in:
Gabor Kovesdan 2012-10-13 18:40:39 +00:00
parent 9bccc7a939
commit d38ae94bce
73 changed files with 6 additions and 21390 deletions

View File

@ -24,6 +24,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20121013:
The GNU sort(1) program has been removed since the BSD-licensed
sort(1) has been the default for quite some time and no serious
problems have been reported. The corresponding WITH_GNU_SORT
knob has als gone.
20121006:
The pfil(9) API/ABI for AF_INET family has been changed. Packet
filtering modules: pf(4), ipfw(4), ipfilter(4) need to be recompiled

View File

@ -1,716 +0,0 @@
Notes on the Free Translation Project
*************************************
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 distribution, you may
assume that the distributed package does use GNU `gettext' internally,
itself available at your nearest GNU archive site. But you do _not_
need to install GNU `gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work at translations should contact the appropriate team.
When reporting bugs in the `intl/' directory or bugs which may be
related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
Quick configuration advice
==========================
If you want to exploit the full power of internationalization, you
should configure it using
./configure --with-included-gettext
to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in the
operating system where this package is being installed. So far, only
the `gettext' implementation in the GNU C library version 2 provides as
many features (such as locale alias, message inheritance, automatic
charset conversion or plural form handling) 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 packages are "localizable" when properly installed; the programs
they contain can be made to speak your own native language. Most such
packages use GNU `gettext'. Other packages have their own ways to
internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
provides the GNU `gettext' functions. If not, the GNU `gettext' own
library will be used. This library is wholly contained within this
package, usually in the `intl/' subdirectory, so prior installation of
the GNU `gettext' package is _not_ required. Installers may use
special options at configuration time for changing the default
behaviour. The commands:
./configure --with-included-gettext
./configure --disable-nls
will respectively bypass any pre-existing `gettext' to use the
internationalizing routines provided within this package, or else,
_totally_ disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
probably detect the previously built and installed `libintl.a' file and
will decide to use this. This might be not what is desirable. You
should use the more recent version of the GNU `gettext' library. I.e.
if the file `intl/VERSION' shows that the library which comes with this
package is more recent, you should use
./configure --with-included-gettext
to prevent auto-detection.
The configuration process will not test for the `catgets' function
and therefore it will not be used. The reason is that even an
emulation of `gettext' on top of `catgets' could not provide all the
extensions of the GNU `gettext' library.
Internationalized packages have usually many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable `LINGUAS'
may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
Using This Package
==================
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
and `CC' is an ISO 3166 two-letter country code. For example, let's
suppose that you speak German and live in Germany. At the shell
prompt, merely execute `setenv LANG de_DE' (in `csh'),
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
This can be done from your `.login' or `.profile' file, once and for
all.
You might think that the country code specification is redundant.
But in fact, some languages have dialects in different countries. For
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
country code serves to distinguish the dialects.
The locale naming convention of `LL_CC', with `LL' denoting the
language and `CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
locales supported by your system for your country by running the command
`locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
understand other languages, you can set up a priority list of languages.
This is done through a different environment variable, called
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
for the purpose of message handling, but you still need to have `LANG'
set to the primary language; this is required by other parts of the
system libraries. For example, some Swedish users who would rather
read translations in German than English for when Swedish is not
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
In the `LANGUAGE' environment variable, but not in the `LANG'
environment variable, `LL_CC' combinations can be abbreviated as `LL'
to denote the language's main dialect. For example, `de' is equivalent
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
(Portuguese as spoken in Portugal) in this context.
Translating Teams
=================
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. The up-to-date list of
teams can be found at the Free Translation Project's homepage,
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
area.
If you'd like to volunteer to _work_ at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is _not_ the same as the list itself, it has
`-request' appended. For example, speakers of Swedish can send a
message to `sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate
_actively_ in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `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 in use. Proven linguistic skill are praised more than
programming skill, here.
Available Packages
==================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of December
2003. The matrix shows, in regard of each package, for which languages
PO files have been submitted to translation coordination, with a
translation percentage of at least 50%.
Ready PO files am az be bg ca cs da de el en en_GB eo es
+-------------------------------------------+
a2ps | [] [] [] [] |
aegis | () |
ant-phone | () |
anubis | |
ap-utils | |
bash | [] [] [] [] |
batchelor | |
bfd | [] [] |
binutils | [] [] |
bison | [] [] [] |
bluez-pin | [] [] |
clisp | |
clisp | [] [] [] |
coreutils | [] [] [] [] |
cpio | [] [] [] |
darkstat | [] () [] |
diffutils | [] [] [] [] [] [] [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
error | [] [] [] [] [] |
fetchmail | [] () [] [] [] [] |
fileutils | [] [] [] |
findutils | [] [] [] [] [] [] [] |
flex | [] [] [] [] |
fslint | |
gas | [] |
gawk | [] [] [] [] |
gbiff | [] |
gcal | [] |
gcc | [] [] |
gettext | [] [] [] [] [] |
gettext-examples | [] [] [] |
gettext-runtime | [] [] [] [] [] |
gettext-tools | [] [] [] |
gimp-print | [] [] [] [] [] |
gliv | |
glunarclock | [] [] |
gnubiff | [] |
gnucash | [] () [] [] |
gnucash-glossary | [] () [] |
gnupg | [] () [] [] [] [] |
gpe-aerial | [] |
gpe-beam | [] [] |
gpe-calendar | [] [] |
gpe-clock | [] [] |
gpe-conf | [] [] |
gpe-contacts | [] [] |
gpe-edit | [] |
gpe-go | [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] |
gpe-sketchbook | [] [] |
gpe-su | [] [] |
gpe-taskmanager | [] [] |
gpe-timesheet | [] |
gpe-today | [] [] |
gpe-todo | [] [] |
gphoto2 | [] [] [] [] |
gprof | [] [] [] |
gpsdrive | () () () |
gramadoir | [] |
grep | [] [] [] [] [] [] |
gretl | [] |
gtick | () |
hello | [] [] [] [] [] [] |
id-utils | [] [] |
indent | [] [] [] [] |
jpilot | [] [] [] |
jtag | |
jwhois | [] |
kbd | [] [] [] [] [] |
latrine | () |
ld | [] [] |
libc | [] [] [] [] [] [] |
libgpewidget | [] [] |
libiconv | [] [] [] [] [] |
lifelines | [] () |
lilypond | [] |
lingoteach | |
lingoteach_lessons | () () |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailutils | [] [] |
make | [] [] [] |
man-db | [] () [] [] () |
minicom | [] [] [] |
mysecretdiary | [] [] [] |
nano | [] () [] [] [] |
nano_1_0 | [] () [] [] [] |
opcodes | [] |
parted | [] [] [] [] [] |
ptx | [] [] [] [] [] |
python | |
radius | [] |
recode | [] [] [] [] [] [] [] |
rpm | [] [] |
screem | |
scrollkeeper | [] [] [] [] [] [] |
sed | [] [] [] [] [] |
sh-utils | [] [] [] |
shared-mime-info | |
sharutils | [] [] [] [] [] [] |
silky | () |
skencil | [] () [] |
sketch | [] () [] |
soundtracker | [] [] [] |
sp | [] |
tar | [] [] [] [] |
texinfo | [] [] [] |
textutils | [] [] [] [] |
tin | () () |
tuxpaint | [] [] [] [] [] [] [] |
util-linux | [] [] [] [] [] |
vorbis-tools | [] [] [] [] |
wastesedge | () |
wdiff | [] [] [] [] |
wget | [] [] [] [] [] [] |
xchat | [] [] [] [] |
xfree86_xkb_xml | [] |
xpad | [] |
+-------------------------------------------+
am az be bg ca cs da de el en en_GB eo es
0 0 8 3 37 38 56 73 15 1 5 12 64
et fa fi fr ga gl he hr hu id is it ja
+----------------------------------------+
a2ps | [] [] [] () |
aegis | |
ant-phone | |
anubis | [] |
ap-utils | [] |
bash | [] [] |
batchelor | [] |
bfd | [] |
binutils | [] [] |
bison | [] [] [] [] |
bluez-pin | [] [] [] [] [] |
clisp | |
clisp | [] |
coreutils | [] [] [] [] [] [] |
cpio | [] [] [] |
darkstat | () [] [] [] |
diffutils | [] [] [] [] [] [] [] |
e2fsprogs | |
enscript | [] [] |
error | [] [] [] [] |
fetchmail | [] |
fileutils | [] [] [] [] [] [] |
findutils | [] [] [] [] [] [] [] [] [] [] |
flex | [] [] |
fslint | |
gas | [] |
gawk | [] [] [] |
gbiff | |
gcal | [] |
gcc | [] |
gettext | [] [] |
gettext-examples | [] [] |
gettext-runtime | [] [] [] [] |
gettext-tools | [] [] |
gimp-print | [] [] |
gliv | () |
glunarclock | [] [] [] [] |
gnubiff | |
gnucash | () [] |
gnucash-glossary | [] |
gnupg | [] [] [] [] [] [] [] |
gpe-aerial | [] |
gpe-beam | [] |
gpe-calendar | [] [] [] |
gpe-clock | [] |
gpe-conf | [] |
gpe-contacts | [] [] |
gpe-edit | [] [] |
gpe-go | [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] [] |
gpe-sketchbook | [] |
gpe-su | [] |
gpe-taskmanager | [] |
gpe-timesheet | [] [] [] |
gpe-today | [] [] |
gpe-todo | [] [] |
gphoto2 | [] [] [] |
gprof | [] [] |
gpsdrive | () [] () () |
gramadoir | [] |
grep | [] [] [] [] [] [] [] [] [] [] [] |
gretl | [] |
gtick | [] [] |
hello | [] [] [] [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] [] |
indent | [] [] [] [] [] [] [] [] [] |
jpilot | [] () |
jtag | |
jwhois | [] [] [] [] |
kbd | [] |
latrine | |
ld | [] |
libc | [] [] [] [] [] |
libgpewidget | [] [] [] [] |
libiconv | [] [] [] [] [] [] [] [] [] |
lifelines | () |
lilypond | [] |
lingoteach | [] [] |
lingoteach_lessons | |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailutils | |
make | [] [] [] [] [] |
man-db | () () |
minicom | [] [] [] [] |
mysecretdiary | [] [] |
nano | [] [] [] [] |
nano_1_0 | [] [] [] [] |
opcodes | [] |
parted | [] [] [] |
ptx | [] [] [] [] [] [] [] |
python | |
radius | [] |
recode | [] [] [] [] [] [] |
rpm | |
screem | |
scrollkeeper | [] |
sed | [] [] [] [] [] [] [] [] [] |
sh-utils | [] [] [] [] [] [] [] |
shared-mime-info | [] |
sharutils | [] [] [] [] [] |
silky | [] () |
skencil | [] |
sketch | [] |
soundtracker | [] [] [] [] |
sp | [] () |
tar | [] [] [] [] [] [] [] [] [] |
texinfo | [] [] [] [] |
textutils | [] [] [] [] [] |
tin | [] () |
tuxpaint | [] [] [] [] [] [] [] [] |
util-linux | [] [] [] [] () [] |
vorbis-tools | [] |
wastesedge | () |
wdiff | [] [] [] [] [] [] |
wget | [] [] [] [] [] [] [] |
xchat | [] [] [] |
xfree86_xkb_xml | |
xpad | [] |
+----------------------------------------+
et fa fi fr ga gl he hr hu id is it ja
21 1 25 86 24 24 8 10 38 31 1 23 32
ko lg lt lv ms nb nl nn no pl pt pt_BR ro
+-------------------------------------------+
a2ps | () [] [] () () [] [] |
aegis | () () |
ant-phone | [] [] |
anubis | [] [] [] [] [] |
ap-utils | [] () [] |
bash | [] [] |
batchelor | [] |
bfd | [] |
binutils | |
bison | [] [] [] [] |
bluez-pin | [] [] [] |
clisp | |
clisp | [] |
coreutils | [] |
cpio | [] [] [] [] [] |
darkstat | [] [] [] [] |
diffutils | [] [] [] [] |
e2fsprogs | [] |
enscript | [] [] [] |
error | [] [] [] |
fetchmail | [] [] () |
fileutils | [] [] |
findutils | [] [] [] [] [] |
flex | [] [] [] [] |
fslint | [] [] |
gas | |
gawk | [] [] [] |
gbiff | [] [] |
gcal | |
gcc | |
gettext | [] [] [] |
gettext-examples | [] [] |
gettext-runtime | [] [] [] |
gettext-tools | [] [] [] |
gimp-print | [] |
gliv | [] [] [] |
glunarclock | [] [] [] |
gnubiff | |
gnucash | [] [] () |
gnucash-glossary | [] [] |
gnupg | [] |
gpe-aerial | [] [] [] |
gpe-beam | [] [] [] |
gpe-calendar | [] [] [] |
gpe-clock | [] [] [] |
gpe-conf | [] [] [] |
gpe-contacts | [] [] [] |
gpe-edit | [] [] [] |
gpe-go | [] [] |
gpe-login | [] [] [] |
gpe-ownerinfo | [] [] [] |
gpe-sketchbook | [] [] [] |
gpe-su | [] [] [] |
gpe-taskmanager | [] [] [] |
gpe-timesheet | [] [] [] |
gpe-today | [] [] [] |
gpe-todo | [] [] [] |
gphoto2 | [] |
gprof | [] [] |
gpsdrive | () () () [] |
gramadoir | [] |
grep | [] [] [] [] |
gretl | |
gtick | [] [] |
hello | [] [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] |
indent | [] [] [] |
jpilot | () () |
jtag | |
jwhois | [] [] [] [] |
kbd | [] [] [] |
latrine | [] |
ld | |
libc | [] [] [] [] [] |
libgpewidget | [] [] [] |
libiconv | [] [] [] [] |
lifelines | |
lilypond | |
lingoteach | |
lingoteach_lessons | |
lynx | [] [] |
m4 | [] [] [] [] |
mailutils | [] [] |
make | [] [] [] [] |
man-db | [] |
minicom | [] [] [] |
mysecretdiary | [] [] [] |
nano | [] [] [] [] |
nano_1_0 | [] [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] [] |
ptx | [] [] [] [] [] [] [] |
python | |
radius | [] |
recode | [] [] [] |
rpm | [] [] |
screem | |
scrollkeeper | [] [] [] [] |
sed | [] [] [] |
sh-utils | [] |
shared-mime-info | [] |
sharutils | [] |
silky | |
skencil | [] [] |
sketch | [] [] |
soundtracker | |
sp | |
tar | [] [] [] [] [] [] |
texinfo | [] [] [] |
textutils | [] [] |
tin | |
tuxpaint | [] [] [] [] [] [] [] [] [] |
util-linux | [] [] |
vorbis-tools | [] [] |
wastesedge | |
wdiff | [] [] [] [] |
wget | [] [] |
xchat | [] [] |
xfree86_xkb_xml | [] |
xpad | [] [] |
+-------------------------------------------+
ko lg lt lv ms nb nl nn no pl pt pt_BR ro
12 0 1 2 12 10 60 4 4 38 25 35 76
ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW
+-------------------------------------------+
a2ps | [] [] [] [] [] | 16
aegis | () | 0
ant-phone | | 2
anubis | [] [] [] | 9
ap-utils | () | 3
bash | [] | 9
batchelor | | 2
bfd | [] [] | 6
binutils | [] [] [] | 7
bison | [] [] [] | 14
bluez-pin | [] [] [] | 13
clisp | | 0
clisp | | 5
coreutils | [] [] [] [] [] | 16
cpio | [] [] [] | 14
darkstat | [] [] [] () () | 12
diffutils | [] [] [] [] | 22
e2fsprogs | [] [] | 5
enscript | [] [] [] | 12
error | [] [] [] | 15
fetchmail | [] [] [] | 11
fileutils | [] [] [] [] [] [] | 17
findutils | [] [] [] [] [] [] [] | 29
flex | [] [] [] | 13
fslint | | 2
gas | [] | 3
gawk | [] [] | 12
gbiff | | 3
gcal | [] [] | 4
gcc | [] | 4
gettext | [] [] [] [] [] [] | 16
gettext-examples | [] [] [] [] | 11
gettext-runtime | [] [] [] [] [] [] [] [] [] | 21
gettext-tools | [] [] [] [] [] [] | 14
gimp-print | [] [] | 10
gliv | | 3
glunarclock | [] [] [] [] | 13
gnubiff | | 1
gnucash | [] [] [] | 9
gnucash-glossary | [] [] [] | 8
gnupg | [] [] [] [] | 17
gpe-aerial | [] [] | 7
gpe-beam | [] [] | 8
gpe-calendar | [] [] [] [] [] | 13
gpe-clock | [] [] [] [] | 10
gpe-conf | [] [] [] | 9
gpe-contacts | [] [] [] [] | 11
gpe-edit | [] [] [] [] [] [] | 12
gpe-go | [] | 5
gpe-login | [] [] [] [] [] [] | 13
gpe-ownerinfo | [] [] [] [] [] | 13
gpe-sketchbook | [] [] [] | 9
gpe-su | [] [] [] [] | 10
gpe-taskmanager | [] [] [] [] | 10
gpe-timesheet | [] [] [] [] [] | 12
gpe-today | [] [] [] [] [] [] | 13
gpe-todo | [] [] [] [] [] | 12
gphoto2 | [] [] [] | 11
gprof | [] [] | 9
gpsdrive | [] [] | 4
gramadoir | | 3
grep | [] [] [] [] [] | 26
gretl | | 2
gtick | [] | 5
hello | [] [] [] [] [] | 33
id-utils | [] [] [] | 12
indent | [] [] [] [] [] | 21
jpilot | [] [] [] [] [] | 9
jtag | [] | 1
jwhois | () () [] [] | 11
kbd | [] [] | 11
latrine | | 1
ld | [] [] | 5
libc | [] [] [] [] | 20
libgpewidget | [] [] [] [] | 13
libiconv | [] [] [] [] [] [] [] [] [] | 27
lifelines | [] | 2
lilypond | [] | 3
lingoteach | | 2
lingoteach_lessons | () | 0
lynx | [] [] [] [] | 14
m4 | [] [] [] | 15
mailutils | [] | 5
make | [] [] [] [] | 16
man-db | [] | 5
minicom | [] | 11
mysecretdiary | [] [] | 10
nano | [] [] [] [] [] | 17
nano_1_0 | [] [] [] [] | 17
opcodes | [] [] | 6
parted | [] [] [] | 15
ptx | [] [] [] | 22
python | | 0
radius | [] | 4
recode | [] [] [] [] | 20
rpm | [] [] [] | 7
screem | [] [] | 2
scrollkeeper | [] [] [] [] | 15
sed | [] [] [] [] [] [] | 23
sh-utils | [] [] [] | 14
shared-mime-info | [] [] | 4
sharutils | [] [] [] [] [] | 17
silky | () | 2
skencil | [] | 6
sketch | [] | 6
soundtracker | [] [] | 9
sp | [] | 3
tar | [] [] [] [] [] | 24
texinfo | [] [] [] [] | 14
textutils | [] [] [] [] [] | 16
tin | | 1
tuxpaint | [] [] [] [] [] | 29
util-linux | [] [] [] | 15
vorbis-tools | [] | 8
wastesedge | | 0
wdiff | [] [] [] [] | 18
wget | [] [] [] [] [] [] [] [] | 23
xchat | [] [] [] [] [] | 14
xfree86_xkb_xml | [] [] [] [] [] [] | 8
xpad | | 4
+-------------------------------------------+
51 teams ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW
120 domains 59 42 16 25 81 0 56 12 1 10 21 22 1260
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
If December 2003 seems to be old, you may fetch a more recent copy
of this `ABOUT-NLS' file on most GNU archive sites. The most
up-to-date matrix with full percentage details can be found at
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
Using `gettext' in new packages
===============================
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
package. Of course you have to respect the GNU Library General Public
License which covers the use of the GNU `gettext' library. This means
in particular that even non-free programs can use `libintl' as a shared
library, whereas only free software can use `libintl' as a static
library or use modified versions of `libintl'.
Once the sources are changed appropriately and the setup can handle
the use of `gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
`translation@iro.umontreal.ca' to make the `.pot' files available to
the translation teams.

View File

@ -1,86 +0,0 @@
Here are the names of the programs in this package,
each followed by the name(s) of its author(s).
basename: FIXME unknown
cat: Torbjorn Granlund and Richard M. Stallman
chgrp: David MacKenzie
chmod: David MacKenzie
chown: David MacKenzie
chroot: Roland McGrath
cksum: Q. Frank Xia
comm: Richard Stallman and David MacKenzie
cp: Torbjorn Granlund, David MacKenzie, and Jim Meyering
csplit: Stuart Kemp and David MacKenzie
cut: David Ihnat, David MacKenzie, and Jim Meyering
date: David MacKenzie
dd: Paul Rubin, David MacKenzie, and Stuart Kemp
df: Torbjorn Granlund, David MacKenzie, Larry McVoy, and Paul Eggert
dircolors: H. Peter Anvin
dirname: David MacKenzie and Jim Meyering
du: Torbjorn Granlund, David MacKenzie, Larry McVoy, and Paul Eggert
echo: FIXME unknown
env: Richard Mlynarik and David MacKenzie
expand: David MacKenzie
expr: Mike Parker
factor: Paul Rubin
false: no one
fmt: Ross Paterson
fold: David MacKenzie
head: David MacKenzie
hostid: Jim Meyering
hostname: Jim Meyering
id: Arnold Robbins and David MacKenzie
install: David MacKenzie
join: Mike Haertel
kill: Paul Eggert
link: Michael Stone
ln: Mike Parker and David MacKenzie
logname: FIXME: unknown
ls: Richard Stallman and David MacKenzie
md5sum: Ulrich Drepper and Scott Miller
mkdir: David MacKenzie
mkfifo: David MacKenzie
mknod: David MacKenzie
mv: Mike Parker, David MacKenzie, and Jim Meyering
nice: David MacKenzie
nl: Scott Bartram and David MacKenzie
od: Jim Meyering
paste: David M. Ihnat and David MacKenzie
pathchk: David MacKenzie and Jim Meyering
pinky: Joseph Arceneaux, David MacKenzie, and Kaveh Ghazi
pr: Pete TerMaat and Roland Huebner
printenv: David MacKenzie and Richard Mlynarik
printf: David MacKenzie
ptx: François Pinard
pwd: Jim Meyering
rm: Paul Rubin, David MacKenzie, Richard Stallman, and Jim Meyering
rmdir: David MacKenzie
seq: Ulrich Drepper
shred: Colin Plumb
sleep: Jim Meyering and Paul Eggert
sort: Mike Haertel and Paul Eggert
split: Torbjorn Granlund and Richard M. Stallman
stat: Michael Meskes
stty: David MacKenzie
su: David MacKenzie
sum: Kayvan Aghaiepour and David MacKenzie
sync: Jim Meyering
tac: Jay Lepreau and David MacKenzie
tail: Paul Rubin, David MacKenzie, Ian Lance Taylor, and Jim Meyering
tee: Mike Parker, Richard M. Stallman, and David MacKenzie
test: FIXME: ksb and mjb
touch: Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith
tr: Jim Meyering
true: no one
tsort: Mark Kettenis
tty: David MacKenzie
uname: David MacKenzie
unexpand: David MacKenzie
uniq: Richard Stallman and David MacKenzie
unlink: Michael Stone
uptime: Joseph Arceneaux, David MacKenzie, and Kaveh Ghazi
users: Joseph Arceneaux and David MacKenzie
wc: Paul Rubin and David MacKenzie
who: Joseph Arceneaux, David MacKenzie, and Michael Stone
whoami: Richard Mlynarik
yes: David MacKenzie

View File

@ -1,340 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +0,0 @@
$FreeBSD$
GNU Sort
originals can be found at: ftp://ftp.gnu.org/gnu/coreutils/
Configure by:
./configure --disable-nls --without-libiconv-prefix \
--without-libintl-prefix
Imported by:
cvs import \
-m "Virgin import (trimmed) of GNU Sort, coreutils 5.2.1" \
src/contrib/gnu-sort FSF SORT_v5_2_1

View File

@ -1,229 +0,0 @@
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View File

@ -1,904 +0,0 @@
GNU coreutils NEWS -*- outline -*-
* Major changes in release 5.3.0 (2004-03-17) [unstable]
** Bug fixes
rm (without -f) no longer hangs when attempting to remove a symlink
to a file on an off-line NFS-mounted partition.
cut's --output-delimiter=D option works with abutting byte ranges.
rm no longer gets a failed assertion under some unusual conditions.
Several fixes to chgrp and chown for compatibility with POSIX and BSD:
Do not affect symbolic links by default.
Now, operate on whatever a symbolic points to, instead.
To get the old behavior, use --no-dereference (-h).
--dereference now works, even when the specified owner
and/or group match those of an affected symlink.
Check for incompatible options. When -R and --dereference are
both used, then either -H or -L must also be used. When -R and -h
are both used, then -P must be in effect.
-H, -L, and -P have no effect unless -R is also specified.
If -P and -R are both specified, -h is assumed.
Do not optimize away the chown() system call when the file's owner
and group already have the desired value. This optimization was
incorrect, as it failed to update the last-changed time and reset
special permission bits, as POSIX requires.
Do not report an error if the owner or group of a
recursively-encountered symbolic link cannot be updated because
the file system does not support it.
md5sum and sha1sum now report an error when given so many input
lines that their line counter overflows, instead of silently
reporting incorrect results.
rm no longer requires read access to the current directory.
"sort -o -" now writes to a file named "-" instead of to standard
output; POSIX requires this.
tail -f no longer mishandles pipes and fifos. With no operands,
tail now ignores -f if standard input is a pipe, as POSIX requires.
For some types of errors (e.g., read-only file system, I/O error)
when first encountering a directory, `rm -r' would mistakenly fail
to remove files under that directory.
If d/x is a directory and x a file, "ln x d/" now reports an error
instead of incorrectly creating a link to d/x/x.
Fixes for "nice":
If it fails to lower the nice value due to lack of permissions,
it goes ahead and runs the command anyway, as POSIX requires.
It no longer incorrectly reports an error if the current nice
value happens to be -1.
It no longer assumes that nice values range from -20 through 19.
It now consistently adjusts out-of-range nice values to the
closest values in range; formerly it sometimes reported an error.
ptx now diagnoses invalid values for its --width=N (-w)
and --gap-size=N (-g) options.
tee now exits when it gets a SIGPIPE signal, as POSIX requires.
To get tee's old behavior, use the shell command "(trap '' PIPE; tee)".
Also, "tee -" now writes to standard output instead of to a file named "-".
ls no longer segfaults on systems for which SIZE_MAX != (size_t) -1
echo now conforms to POSIX better. It supports the \0ooo syntax for
octal escapes, and \c now terminates printing immediately. If
POSIXLY_CORRECT is set and the first argument is not "-n", echo now
outputs all option-like arguments instead of treating them as options.
printf has several changes:
It now uses 'intmax_t' (not 'long int') to format integers, so it
can now format 64-bit integers on most modern hosts.
On modern hosts it now supports the C99-inspired %a, %A, %F conversion
specs, the "'" and "0" flags, and the ll, j, t, and z length modifiers
(this is compatible with recent Bash versions).
The printf command now rejects invalid conversion specifications
like %#d, instead of relying on undefined behavior in the underlying
printf function.
who now prints user names in full instead of truncating them after 8 bytes.
** New features
For efficiency, `sort -m' no longer copies input to a temporary file
merely because the input happens to come from a pipe. As a result,
some relatively-contrived examples like `cat F | sort -m -o F - G'
are no longer safe, as `sort' might start writing F before `cat' is
done reading it. This problem cannot occur unless `-m' is used.
When outside the default POSIX locale, the 'who' and 'pinky'
commands now output time stamps like "2004-06-21 13:09" instead of
the traditional "Jun 21 13:09".
pwd now works even when run from a working directory whose name
is longer than PATH_MAX.
cp, install, ln, and mv have a new --no-target-directory (-T) option,
and -t is now a short name for their --target-directory option.
cp -pu and mv -u (when copying) now don't bother to update the
destination if the resulting time stamp would be no newer than the
preexisting time stamp. This saves work in the common case when
copying or moving multiple times to the same destination in a file
system with a coarse time stamp resolution.
dd has new conversions for the conv= option:
nocreat do not create the output file
excl fail if the output file already exists
fdatasync physically write output file data before finishing
fsync likewise, but also write metadata
dd has new iflag= and oflag= options with the following flags:
append append mode (makes sense for output file only)
direct use direct I/O for data
dsync use synchronized I/O for data
sync likewise, but also for metadata
nonblock use non-blocking I/O
nofollow do not follow symlinks
stty now provides support (iutf8) for setting UTF-8 input mode.
With stat, a specified format is no longer automatically newline terminated.
If you want a newline at the end of your output, append `\n' to the format
string.
'df', 'du', and 'ls' now take the default block size from the
BLOCKSIZE environment variable if the BLOCK_SIZE, DF_BLOCK_SIZE,
DU_BLOCK_SIZE, and LS_BLOCK_SIZE environment variables are not set.
Unlike the other variables, though, BLOCKSIZE does not affect
values like 'ls -l' sizes that are normally displayed as bytes.
This new behavior is for compatibility with BSD.
du accepts a new option --files0-from=FILE, where FILE contains a
list of NUL-terminated file names.
`date -d' and `touch -d' now accept integer counts of seconds since
1970 when prefixed by `@'. For example, `@321' represents
1970-01-01 00:05:21 UTC.
`date -d', `date -f' and `touch -d' now handle fractional time
stamps like 2004-02-27 14:19:13.489392193.
`date' has a new option --iso-8601=ns that outputs
nanosecond-resolution time stamps.
echo -e '\xHH' now outputs a byte whose hexadecimal value is HH,
for compatibility with bash.
In the following cases POSIX allows the default GNU behavior,
so when POSIXLY_CORRECT is set:
false, printf, true, unlink, and yes all support --help and --option.
ls supports TABSIZE.
pr no longer depends on LC_TIME for the date format in non-POSIX locales.
printf supports \u, \U, \x.
tail supports two or more files when using the obsolete option syntax.
The usual `--' operand is now supported by chroot, hostid, hostname,
pwd, sync, and yes.
The stat option --filesystem has been renamed to --file-system, for
consistency with POSIX "file system" and with cp and du --one-file-system.
** Removed features
tail's undocumented --max-consecutive-size-changes option has been removed.
* Major changes in release 5.2.1 (2004-03-12) [stable]
** Bug fixes
mv could mistakenly fail to preserve hard links when moving two
or more arguments between partitions.
`cp --sparse=always F /dev/hdx' no longer tries to use lseek to create
holes in the destination.
nohup now sets the close-on-exec flag for its copy of the stderr file
descriptor. This avoids some nohup-induced hangs. For example, before
this change, if you ran `ssh localhost', then `nohup sleep 600 </dev/null &',
and then exited that remote shell, the ssh session would hang until the
10-minute sleep terminated. With the fixed nohup, the ssh session
terminates immediately.
`expr' now conforms to POSIX better:
Integers like -0 and 00 are now treated as zero.
The `|' operator now returns 0, not its first argument, if both
arguments are null or zero. E.g., `expr "" \| ""' now returns 0,
not the empty string.
The `|' and `&' operators now use short-circuit evaluation, e.g.,
`expr 1 \| 1 / 0' no longer reports a division by zero.
** New features
`chown user.group file' now has its traditional meaning even when
conforming to POSIX 1003.1-2001, so long as no user has a name
containing `.' that happens to equal `user.group'.
* Major changes in release 5.2.0 (2004-02-19) [stable]
** Bug fixes
none
* Major changes in release 5.1.3 (2004-02-08): candidate to become stable 5.2.0
** Bug fixes
`cp -d' now works as required even on systems like OSF V5.1 that
declare stat and lstat as `static inline' functions.
time stamps output by stat now include actual fractional seconds,
when available -- or .0000000 for files without that information.
seq no longer infloops when printing 2^31 or more numbers.
For reference, seq `echo 2^31|bc` > /dev/null takes about one hour
on a 1.6 GHz Athlon 2000 XP. Now it can output 2^53-1 numbers before
misbehaving.
* Major changes in release 5.1.2 (2004-01-25):
** Bug fixes
rmdir -p exits with status 1 on error; formerly it sometimes exited
with status 0 when given more than one argument.
nohup now always exits with status 127 when it finds an error,
as POSIX requires; formerly it sometimes exited with status 1.
Several programs (including cut, date, dd, env, hostname, nl, pr,
stty, and tr) now always exit with status 1 when they find an error;
formerly they sometimes exited with status 2.
factor no longer reports a usage error if stdin has the wrong format.
paste no longer infloops on ppc systems (bug introduced in 5.1.1)
* Major changes in release 5.1.1 (2004-01-17):
** Configuration option
You can select the default level of POSIX conformance at configure-time,
e.g., by ./configure DEFAULT_POSIX2_VERSION=199209
** Bug fixes
fold -s works once again on systems with differing sizes for int
and size_t (bug introduced in 5.1.0)
** New features
touch -r now specifies the origin for any relative times in the -d
operand, if both options are given. For example, "touch -r FOO -d
'-5 seconds' BAR" sets BAR's modification time to be five seconds
before FOO's.
join: The obsolete options "-j1 FIELD", "-j2 FIELD", and
"-o LIST1 LIST2..." are no longer supported on POSIX 1003.1-2001 systems.
Portable scripts should use "-1 FIELD", "-2 FIELD", and
"-o LIST1,LIST2..." respectively. If join was compiled on a
POSIX 1003.1-2001 system, you may enable the old behavior
by setting _POSIX2_VERSION=199209 in your environment.
* Major changes in release 5.1.0 (2003-12-21):
** New features
chgrp, chmod, and chown can now process (with -R) hierarchies of virtually
unlimited depth. Before, they would fail to operate on any file they
encountered with a relative name of length PATH_MAX (often 4096) or longer.
chgrp, chmod, chown, and rm accept the new options:
--preserve-root, --no-preserve-root (default)
chgrp and chown now accept POSIX-mandated -L, -H, and -P options
du can now process hierarchies of virtually unlimited depth.
Before, du was limited by the user's stack size and it would get a
stack overflow error (often a segmentation fault) when applied to
a hierarchy of depth around 30,000 or larger.
du works even when run from an inaccessible directory
du -D now dereferences all symlinks specified on the command line,
not just the ones that reference directories
du now accepts -P (--no-dereference), for compatibility with du
of NetBSD and for consistency with e.g., chown and chgrp
du's -H option will soon have the meaning required by POSIX
(--dereference-args, aka -D) rather then the current meaning of --si.
Now, using -H elicits a warning to that effect.
When given -l and similar options, ls now adjusts the output column
widths to fit the data, so that output lines are shorter and have
columns that line up better. This may adversely affect shell
scripts that expect fixed-width columns, but such shell scripts were
not portable anyway, even with old GNU ls where the columns became
ragged when a datum was too wide.
du accepts a new option, -0/--null, to make it produce NUL-terminated
output lines
** Bug fixes
printf, seq, tail, and sleep now parse floating-point operands
and options in the C locale. POSIX requires this for printf.
od -c -w9999999 no longer segfaults
csplit no longer reads from freed memory (dumping core on some systems)
csplit would mistakenly exhaust virtual memory in some cases
ls --width=N (for very large N) is no longer subject to an address
arithmetic bug that could result in bounds violations.
ls --width=N (with -x or -C) no longer allocates more space
(potentially much more) than necessary for a given directory.
dd `unblock' and `sync' may now be combined (e.g., dd conv=unblock,sync)
* Major changes in release 5.0.91 (2003-09-08):
** New features
date accepts a new option --rfc-2822, an alias for --rfc-822.
split accepts a new option -d or --numeric-suffixes.
cp, install, mv, and touch now preserve microsecond resolution on
file timestamps, on platforms that have the 'utimes' system call.
Unfortunately there is no system call yet to preserve file
timestamps to their full nanosecond resolution; microsecond
resolution is the best we can do right now.
sort now supports the zero byte (NUL) as a field separator; use -t '\0'.
The -t '' option, which formerly had no effect, is now an error.
sort option order no longer matters for the options -S, -d, -i, -o, and -t.
Stronger options override weaker, and incompatible options are diagnosed.
`sha1sum --check' now accepts the BSD format for SHA1 message digests
in addition to the BSD format for MD5 ones.
who -l now means `who --login', not `who --lookup', per POSIX.
who's -l option has been eliciting an unconditional warning about
this impending change since sh-utils-2.0.12 (April 2002).
** Bug fixes
Mistakenly renaming a file onto itself, e.g., via `mv B b' when `B' is
the same directory entry as `b' no longer destroys the directory entry
referenced by both `b' and `B'. Note that this would happen only on
file systems like VFAT where two different names may refer to the same
directory entry, usually due to lower->upper case mapping of file names.
Now, the above can happen only on file systems that perform name mapping and
that support hard links (stat.st_nlink > 1). This mitigates the problem
in two ways: few file systems appear to be affected (hpfs and ntfs are),
when the bug is triggered, mv no longer removes the last hard link to a file.
*** ATTENTION ***: if you know how to distinguish the following two cases
without writing to the file system in question, please let me know:
1) B and b refer to the same directory entry on a file system like NTFS
(B may well have a link count larger than 1)
2) B and b are hard links to the same file
stat no longer overruns a buffer for format strings ending in `%'
fold -s -wN would infloop for N < 8 with TABs in the input.
E.g., this would not terminate: printf 'a\t' | fold -w2 -s
`split -a0', although of questionable utility, is accepted once again.
`df DIR' used to hang under some conditions on OSF/1 5.1. Now it doesn't.
seq's --width (-w) option now works properly even when the endpoint
requiring the larger width is negative and smaller than the other endpoint.
seq's default step is 1, even if LAST < FIRST.
paste no longer mistakenly outputs 0xFF bytes for a nonempty input file
without a trailing newline.
`tail -n0 -f FILE' and `tail -c0 -f FILE' no longer perform what amounted
to a busy wait, rather than sleeping between iterations.
tail's long-undocumented --allow-missing option now elicits a warning
* Major changes in release 5.0.90 (2003-07-29):
** New features
sort is now up to 30% more CPU-efficient in some cases
`test' is now more compatible with Bash and POSIX:
`test -t', `test --help', and `test --version' now silently exit
with status 0. To test whether standard output is a terminal, use
`test -t 1'. To get help and version info for `test', use
`[ --help' and `[ --version'.
`test' now exits with status 2 (not 1) if there is an error.
wc count field widths now are heuristically adjusted depending on the input
size, if known. If only one count is printed, it is guaranteed to
be printed without leading spaces.
Previously, wc did not align the count fields if POSIXLY_CORRECT was set,
but POSIX did not actually require this undesirable behavior, so it
has been removed.
** Bug fixes
kill no longer tries to operate on argv[0] (introduced in 5.0.1)
Why wasn't this noticed? Although many tests use kill, none of
them made an effort to avoid using the shell's built-in kill.
`[' invoked with no arguments no longer evokes a segfault
rm without --recursive (aka -r or -R) no longer prompts regarding
unwritable directories, as required by POSIX.
uniq -c now uses a SPACE, not a TAB between the count and the
corresponding line, as required by POSIX.
expr now exits with status 2 if the expression is syntactically valid,
and with status 3 if an error occurred. POSIX requires this.
expr now reports trouble if string comparison fails due to a collation error.
split now generates suffixes properly on EBCDIC hosts.
split -a0 now works, as POSIX requires.
`sort --version' and `sort --help' fail, as they should
when their output is redirected to /dev/full.
`su --version > /dev/full' now fails, as it should.
** Fewer arbitrary limitations
cut requires 97% less memory when very large field numbers or
byte offsets are specified.
* Major changes in release 5.0.1 (2003-07-15):
** New programs
- new program: `[' (much like `test')
** New features
- head now accepts --lines=-N (--bytes=-N) to print all but the
N lines (bytes) at the end of the file
- md5sum --check now accepts the output of the BSD md5sum program, e.g.,
MD5 (f) = d41d8cd98f00b204e9800998ecf8427e
- date -d DATE can now parse a DATE string like May-23-2003
- chown: `.' is no longer recognized as a separator in the OWNER:GROUP
specifier on POSIX 1003.1-2001 systems. If chown *was not* compiled
on such a system, then it still accepts `.', by default. If chown
was compiled on a POSIX 1003.1-2001 system, then you may enable the
old behavior by setting _POSIX2_VERSION=199209 in your environment.
- chown no longer tries to preserve set-user-ID and set-group-ID bits;
on some systems, the chown syscall resets those bits, and previous
versions of the chown command would call chmod to restore the original,
pre-chown(2) settings, but that behavior is problematic.
1) There was a window whereby a malicious user, M, could subvert a
chown command run by some other user and operating on files in a
directory where M has write access.
2) Before (and even now, on systems with chown(2) that doesn't reset
those bits), an unwary admin. could use chown unwittingly to create e.g.,
a set-user-ID root copy of /bin/sh.
** Bug fixes
- chown --dereference no longer leaks a file descriptor per symlink processed
- `du /' once again prints the `/' on the last line
- split's --verbose option works once again [broken in 4.5.10 and 5.0]
- tail -f is no longer subject to a race condition that could make it
delay displaying the last part of a file that had stopped growing. That
bug could also make tail -f give an unwarranted `file truncated' warning.
- du no longer runs out of file descriptors unnecessarily
- df and `readlink --canonicalize' no longer corrupt the heap on
non-glibc, non-solaris systems
- `env -u UNSET_VARIABLE' no longer dumps core on non-glibc systems
- readlink's --canonicalize option now works on systems like Solaris that
lack the canonicalize_file_name function but do have resolvepath.
- mv now removes `a' in this example on all systems: touch a; ln a b; mv a b
This behavior is contrary to POSIX (which requires that the mv command do
nothing and exit successfully), but I suspect POSIX will change.
- date's %r format directive now honors locale settings
- date's `-' (no-pad) format flag now affects the space-padded-by-default
conversion specifiers, %e, %k, %l
- fmt now diagnoses invalid obsolescent width specifications like `-72x'
- fmt now exits nonzero when unable to open an input file
- tsort now fails when given an odd number of input tokens,
as required by POSIX. Before, it would act as if the final token
appeared one additional time.
** Fewer arbitrary limitations
- tail's byte and line counts are no longer limited to OFF_T_MAX.
Now the limit is UINTMAX_MAX (usually 2^64).
- split can now handle --bytes=N and --lines=N with N=2^31 or more.
** Portability
- `kill -t' now prints signal descriptions (rather than `?') on systems
like Tru64 with __sys_siglist but no strsignal function.
- stat.c now compiles on Ultrix systems
- sleep now works on AIX systems that lack support for clock_gettime
- rm now works around Darwin6.5's broken readdir function
Before `rm -rf DIR' would fail to remove all files in DIR
if there were more than 338.
* Major changes in release 5.0 (2003-04-02):
- false --help now exits nonzero
[4.5.12]
* printf no longer treats \x specially when POSIXLY_CORRECT is set
* printf avoids buffer overrun with format ending in a backslash and
* printf avoids buffer overrun with incomplete conversion specifier
* printf accepts multiple flags in a single conversion specifier
[4.5.11]
* seq no longer requires that a field width be specified
* seq no longer fails when given a field width of `0'
* seq now accepts ` ' and `'' as valid format flag characters
* df now shows a HOSTNAME: prefix for each remote-mounted file system on AIX 5.1
* portability tweaks for HP-UX, AIX 5.1, DJGPP
[4.5.10]
* printf no longer segfaults for a negative field width or precision
* shred now always enables --exact for non-regular files
* du no longer lists hard-linked files more than once
* du no longer dumps core on some systems due to `infinite' recursion
via nftw's use of the buggy replacement function in getcwd.c
* portability patches for a few vendor compilers and 64-bit systems
* du -S *really* now works like it did before the change in 4.5.5
[4.5.9]
* du no longer truncates file sizes or sums to fit in 32-bit size_t
* work around Linux kernel bug in getcwd (fixed in 2.4.21-pre4), so that pwd
now fails if the name of the working directory is so long that getcwd
truncates it. Before it would print the truncated name and exit successfully.
* `df /some/mount-point' no longer hangs on a GNU libc system when another
hard-mounted NFS file system (preceding /some/mount-point in /proc/mounts)
is inaccessible.
* rm -rf now gives an accurate diagnostic when failing to remove a file
under certain unusual conditions
* mv and `cp --preserve=links' now preserve multiple hard links even under
certain unusual conditions where they used to fail
[4.5.8]
* du -S once again works like it did before the change in 4.5.5
* stat accepts a new file format, %B, for the size of each block reported by %b
* du accepts new option: --apparent-size
* du --bytes (-b) works the same way it did in fileutils-3.16 and before
* du reports proper sizes for directories (not zero) (broken in 4.5.6 or 4.5.7)
* df now always displays under `Filesystem', the device file name
corresponding to the listed mount point. Before, for a block- or character-
special file command line argument, df would display that argument. E.g.,
`df /dev/hda' would list `/dev/hda' as the `Filesystem', rather than say
/dev/hda3 (the device on which `/' is mounted), as it does now.
* test now works properly when invoked from a set user ID or set group ID
context and when testing access to files subject to alternate protection
mechanisms. For example, without this change, a set-UID program that invoked
`test -w F' (to see if F is writable) could mistakenly report that it *was*
writable, even though F was on a read-only file system, or F had an ACL
prohibiting write access, or F was marked as immutable.
[4.5.7]
* du would fail with more than one DIR argument when any but the last did not
contain a slash (due to a bug in ftw.c)
[4.5.6]
* du no longer segfaults on Solaris systems (fixed heap-corrupting bug in ftw.c)
* du --exclude=FILE works once again (this was broken by the rewrite for 4.5.5)
* du no longer gets a failed assertion for certain hierarchy lay-outs
involving hard-linked directories
* `who -r' no longer segfaults when using non-C-locale messages
* df now displays a mount point (usually `/') for non-mounted
character-special and block files
[4.5.5]
* ls --dired produces correct byte offset for file names containing
nonprintable characters in a multibyte locale
* du has been rewritten to use a variant of GNU libc's ftw.c
* du now counts the space associated with a directory's directory entry,
even if it cannot list or chdir into that subdirectory.
* du -S now includes the st_size of each entry corresponding to a subdirectory
* rm on FreeBSD can once again remove directories from NFS-mounted file systems
* ls has a new option --dereference-command-line-symlink-to-dir, which
corresponds to the new default behavior when none of -d, -l -F, -H, -L
has been specified.
* ls dangling-symlink now prints `dangling-symlink'.
Before, it would fail with `no such file or directory'.
* ls -s symlink-to-non-dir and ls -i symlink-to-non-dir now print
attributes of `symlink', rather than attributes of their referents.
* Fix a bug introduced in 4.5.4 that made it so that ls --color would no
longer highlight the names of files with the execute bit set when not
specified on the command line.
* shred's --zero (-z) option no longer gobbles up any following argument.
Before, `shred --zero file' would produce `shred: missing file argument',
and worse, `shred --zero f1 f2 ...' would appear to work, but would leave
the first file untouched.
* readlink: new program
* cut: new feature: when used to select ranges of byte offsets (as opposed
to ranges of fields) and when --output-delimiter=STRING is specified,
output STRING between ranges of selected bytes.
* rm -r can no longer be tricked into mistakenly reporting a cycle.
* when rm detects a directory cycle, it no longer aborts the entire command,
but rather merely stops processing the affected command line argument.
[4.5.4]
* cp no longer fails to parse options like this: --preserve=mode,ownership
* `ls --color -F symlink-to-dir' works properly
* ls is much more efficient on directories with valid dirent.d_type.
* stty supports all baud rates defined in linux-2.4.19.
* `du symlink-to-dir/' would improperly remove the trailing slash
* `du ""' would evoke a bounds violation.
* In the unlikely event that running `du /' resulted in `stat ("/", ...)'
failing, du would give a diagnostic about `' (empty string) rather than `/'.
* printf: a hexadecimal escape sequence has at most two hex. digits, not three.
* The following features have been added to the --block-size option
and similar environment variables of df, du, and ls.
- A leading "'" generates numbers with thousands separators.
For example:
$ ls -l --block-size="'1" file
-rw-rw-r-- 1 eggert src 47,483,707 Sep 24 23:40 file
- A size suffix without a leading integer generates a suffix in the output.
For example:
$ ls -l --block-size="K"
-rw-rw-r-- 1 eggert src 46371K Sep 24 23:40 file
* ls's --block-size option now affects file sizes in all cases, not
just for --block-size=human-readable and --block-size=si. Fractional
sizes are now always rounded up, for consistency with df and du.
* df now displays the block size using powers of 1000 if the requested
block size seems to be a multiple of a power of 1000.
* nl no longer gets a segfault when run like this `yes|nl -s%n'
[4.5.3]
* du --dereference-args (-D) no longer fails in certain cases
* `ln --target-dir=DIR' no longer fails when given a single argument
[4.5.2]
* `rm -i dir' (without --recursive (-r)) no longer recurses into dir
* `tail -c N FILE' now works with files of size >= 4GB
* `mkdir -p' can now create very deep (e.g. 40,000-component) directories
* rmdir -p dir-with-trailing-slash/ no longer fails
* printf now honors the `--' command line delimiter
* od's 8-byte formats x8, o8, and u8 now work
* tail now accepts fractional seconds for its --sleep-interval=S (-s) option
[4.5.1]
* du and ls now report sizes of symbolic links (before they'd always report 0)
* uniq now obeys the LC_COLLATE locale, as per POSIX 1003.1-2001 TC1.
========================================================================
Here are the NEWS entries made from fileutils-4.1 until the
point at which the packages merged to form the coreutils:
[4.1.11]
* `rm symlink-to-unwritable' doesn't prompt [introduced in 4.1.10]
[4.1.10]
* rm once again gives a reasonable diagnostic when failing to remove a file
owned by someone else in a sticky directory [introduced in 4.1.9]
* df now rounds all quantities up, as per POSIX.
* New ls time style: long-iso, which generates YYYY-MM-DD HH:MM.
* Any time style can be preceded by "posix-"; this causes "ls" to
use traditional timestamp format when in the POSIX locale.
* The default time style is now posix-long-iso instead of posix-iso.
Set TIME_STYLE="posix-iso" to revert to the behavior of 4.1.1 thru 4.1.9.
* `rm dangling-symlink' doesn't prompt [introduced in 4.1.9]
* stat: remove support for --secure/-s option and related %S and %C format specs
* stat: rename --link/-l to --dereference/-L.
The old options will continue to work for a while.
[4.1.9]
* rm can now remove very deep hierarchies, in spite of any limit on stack size
* new programs: link, unlink, and stat
* New ls option: --author (for the Hurd).
* `touch -c no-such-file' no longer fails, per POSIX
[4.1.8]
* mv no longer mistakenly creates links to preexisting destination files
that aren't moved
[4.1.7]
* rm: close a hole that would allow a running rm process to be subverted
[4.1.6]
* New cp option: --copy-contents.
* cp -r is now equivalent to cp -R. Use cp -R -L --copy-contents to get the
traditional (and rarely desirable) cp -r behavior.
* ls now accepts --time-style=+FORMAT, where +FORMAT works like date's format
* The obsolete usage `touch [-acm] MMDDhhmm[YY] FILE...' is no longer
supported on systems conforming to POSIX 1003.1-2001. Use touch -t instead.
* cp and inter-partition mv no longer give a misleading diagnostic in some
unusual cases
[4.1.5]
* cp -r no longer preserves symlinks
* The block size notation is now compatible with SI and with IEC 60027-2.
For example, --block-size=1MB now means --block-size=1000000,
whereas --block-size=1MiB now means --block-size=1048576.
A missing `B' (e.g. `1M') has the same meaning as before.
A trailing `B' now means decimal, not binary; this is a silent change.
The nonstandard `D' suffix (e.g. `1MD') is now obsolescent.
* -H or --si now outputs the trailing 'B', for consistency with the above.
* Programs now output trailing 'K' (not 'k') to mean 1024, as per IEC 60027-2.
* New df, du short option -B is short for --block-size.
* You can omit an integer `1' before a block size suffix,
e.g. `df -BG' is equivalent to `df -B 1G' and to `df --block-size=1G'.
* The following options are now obsolescent, as their names are
incompatible with IEC 60027-2:
df, du: -m or --megabytes (use -BM or --block-size=1M)
df, du, ls: --kilobytes (use --block-size=1K)
[4.1.4]
* df --local no longer lists smbfs file systems whose name starts with //
* dd now detects the Linux/tape/lseek bug at run time and warns about it.
[4.1.3]
* ls -R once again outputs a blank line between per-directory groups of files.
This was broken by the cycle-detection change in 4.1.1.
* dd once again uses `lseek' on character devices like /dev/mem and /dev/kmem.
On systems with the linux kernel (at least up to 2.4.16), dd must still
resort to emulating `skip=N' behavior using reads on tape devices, because
lseek has no effect, yet appears to succeed. This may be a kernel bug.
[4.1.2]
* cp no longer fails when two or more source files are the same;
now it just gives a warning and doesn't copy the file the second time.
E.g., cp a a d/ produces this:
cp: warning: source file `a' specified more than once
* chmod would set the wrong bit when given symbolic mode strings like
these: g=o, o=g, o=u. E.g., `chmod a=,o=w,ug=o f' would give a mode
of --w-r---w- rather than --w--w--w-.
[4.1.1]
* mv (likewise for cp), now fails rather than silently clobbering one of
the source files in the following example:
rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c
* ls -R detects directory cycles, per POSIX. It warns and doesn't infloop.
* cp's -P option now means the same as --no-dereference, per POSIX.
Use --parents to get the old meaning.
* When copying with the -H and -L options, cp can preserve logical
links between source files with --preserve=links
* cp accepts new options:
--preserve[={mode,ownership,timestamps,links,all}]
--no-preserve={mode,ownership,timestamps,links,all}
* cp's -p and --preserve options remain unchanged and are equivalent
to `--preserve=mode,ownership,timestamps'
* mv and cp accept a new option: --reply={yes,no,query}; provides a consistent
mechanism to control whether one is prompted about certain existing
destination files. Note that cp's and mv's -f options don't have the
same meaning: cp's -f option no longer merely turns off `-i'.
* remove portability limitations (e.g., PATH_MAX on the Hurd, fixes for
64-bit systems)
* mv now prompts before overwriting an existing, unwritable destination file
when stdin is a tty, unless --force (-f) is specified, as per POSIX.
* mv: fix the bug whereby `mv -uf source dest' would delete source,
even though it's older than dest.
* chown's --from=CURRENT_OWNER:CURRENT_GROUP option now works
* cp now ensures that the set-user-ID and set-group-ID bits are cleared for
the destination file when when copying and not preserving permissions.
* `ln -f --backup k k' gives a clearer diagnostic
* ls no longer truncates user names or group names that are longer
than 8 characters.
* ls's new --dereference-command-line option causes it to dereference
symbolic links on the command-line only. It is the default unless
one of the -d, -F, or -l options are given.
* ls -H now means the same as ls --dereference-command-line, as per POSIX.
* ls -g now acts like ls -l, except it does not display owner, as per POSIX.
* ls -n now implies -l, as per POSIX.
* ls can now display dates and times in one of four time styles:
- The `full-iso' time style gives full ISO-style time stamps like
`2001-05-14 23:45:56.477817180 -0700'.
- The 'iso' time style gives ISO-style time stamps like '2001-05-14 '
and '05-14 23:45'.
- The 'locale' time style gives locale-dependent time stamps like
'touko 14 2001' and 'touko 14 23:45' (in a Finnish locale).
- The 'posix-iso' time style gives traditional POSIX-locale
time stamps like 'May 14 2001' and 'May 14 23:45' unless the user
specifies a non-POSIX locale, in which case it uses ISO-style dates.
This is the default.
You can specify a time style with an option like --time-style='iso'
or with an environment variable like TIME_STYLE='iso'. GNU Emacs 21
and later can parse ISO dates, but older Emacs versions cannot, so
if you are using an older version of Emacs outside the default POSIX
locale, you may need to set TIME_STYLE="locale".
* --full-time is now an alias for "-l --time-style=full-iso".
========================================================================
Here are the NEWS entries made from sh-utils-2.0 until the
point at which the packages merged to form the coreutils:
[2.0.15]
* date no longer accepts e.g., September 31 in the MMDDhhmm syntax
* fix a bug in this package's .m4 files and in configure.ac
[2.0.14]
* nohup's behavior is changed as follows, to conform to POSIX 1003.1-2001:
- nohup no longer adjusts scheduling priority; use "nice" for that.
- nohup now redirects stderr to stdout, if stderr is not a terminal.
- nohup exit status is now 126 if command was found but not invoked,
127 if nohup failed or if command was not found.
[2.0.13]
* uname and uptime work better on *BSD systems
* pathchk now exits nonzero for a path with a directory component
that specifies a non-directory
[2.0.12]
* kill: new program
* who accepts new options: --all (-a), --boot (-b), --dead (-d), --login,
--process (-p), --runlevel (-r), --short (-s), --time (-t), --users (-u).
The -u option now produces POSIX-specified results and is the same as
the long option `--users'. --idle is no longer the same as -u.
* The following changes apply on systems conforming to POSIX 1003.1-2001,
and are required by the new POSIX standard:
- `date -I' is no longer supported. Instead, use `date --iso-8601'.
- `nice -NUM' is no longer supported. Instead, use `nice -n NUM'.
* New 'uname' options -i or --hardware-platform, and -o or --operating-system.
'uname -a' now outputs -i and -o information at the end.
New uname option --kernel-version is an alias for -v.
Uname option --release has been renamed to --kernel-release,
and --sysname has been renamed to --kernel-name;
the old options will work for a while, but are no longer documented.
* 'expr' now uses the LC_COLLATE locale for string comparison, as per POSIX.
* 'expr' now requires '+' rather than 'quote' to quote tokens;
this removes an incompatibility with POSIX.
* date -d 'last friday' would print a date/time that was one hour off
(e.g., 23:00 on *thursday* rather than 00:00 of the preceding friday)
when run such that the current time and the target date/time fall on
opposite sides of a daylight savings time transition.
This problem arose only with relative date strings like `last monday'.
It was not a problem with strings that include absolute dates.
* factor is twice as fast, for large numbers
[2.0.11]
* setting the date now works properly, even when using -u
* `date -f - < /dev/null' no longer dumps core
* some DOS/Windows portability changes
[2.0j]
* `date -d DATE' now parses certain relative DATEs correctly
[2.0i]
* fixed a bug introduced in 2.0h that made many programs fail with a
`write error' when invoked with the --version option
[2.0h]
* all programs fail when printing --help or --version output to a full device
* printf exits nonzero upon write failure
* yes now detects and terminates upon write failure
* date --rfc-822 now always emits day and month names from the `C' locale
* portability tweaks for Solaris8, Ultrix, and DOS
[2.0g]
* date now handles two-digit years with leading zeros correctly.
* printf interprets unicode, \uNNNN \UNNNNNNNN, on systems with the
required support; from Bruno Haible.
* stty's rprnt attribute now works on HPUX 10.20
* seq's --equal-width option works more portably
[2.0f]
* fix build problems with ut_name vs. ut_user
[2.0e]
* stty: fix long-standing bug that caused test failures on at least HPUX
systems when COLUMNS was set to zero
* still more portability fixes
* unified lib/: now that directory and most of the configuration framework
is common between fileutils, textutils, and sh-utils
[2.0d]
* fix portability problem with sleep vs lib/strtod.c's requirement for -lm
[2.0c]
* fix portability problems with nanosleep.c and with the new code in sleep.c
[2.0b]
* Regenerate lib/Makefile.in so that nanosleep.c is distributed.
[2.0a]
* sleep accepts floating point arguments on command line
* sleep's clock continues counting down when sleep is suspended
* when a suspended sleep process is resumed, it continues sleeping if
there is any time remaining
* who once again prints whatever host information it has, even without --lookup
========================================================================
For older NEWS entries for the fileutils, textutils, and sh-utils
packages, see ./old/*/NEWS.
This package began as the union of the following:
textutils-2.1, fileutils-4.1.11, sh-utils-2.0.15.

View File

@ -1,147 +0,0 @@
These are the GNU core utilities. This package is the union of
the GNU fileutils, sh-utils, and textutils packages.
Most of these programs have significant advantages over their Unix
counterparts, such as greater speed, additional options, and fewer
arbitrary limits.
The programs that can be built with this package are:
[ basename cat chgrp chmod chown chroot cksum comm cp csplit cut date dd
df dir dircolors dirname du echo env expand expr factor false fmt fold
ginstall groups head hostid hostname id join kill link ln logname ls
md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr
printenv printf ptx pwd readlink rm rmdir seq sha1sum shred sleep sort
split stat stty su sum sync tac tail tee test touch tr true tsort tty
uname unexpand uniq unlink uptime users vdir wc who whoami yes
See the file NEWS for a list of major changes in the current release.
See the file INSTALL for compilation and installation instructions.
These programs are intended to conform to POSIX (with BSD and other
extensions), like the rest of the GNU system. By default they conform
to older POSIX (1003.2-1992), and therefore support obsolete usages
like "head -10" and "chown owner.group file". This default is
overridden at build-time by the value of <unistd.h>'s _POSIX2_VERSION
macro, and this in turn can be overridden at runtime as described in
the documentation under "Standards conformance".
The ls, dir, and vdir commands are all separate executables instead of
one program that checks argv[0] because people often rename these
programs to things like gls, gnuls, l, etc. Renaming a program
file shouldn't affect how it operates, so that people can get the
behavior they want with whatever name they want.
Special thanks to Paul Eggert, Brian Matthews, Bruce Evans, Karl Berry,
Kaveh Ghazi, and François Pinard for help with debugging and porting
these programs. Many thanks to all of the people who have taken the
time to submit problem reports and fixes. All contributed changes are
attributed in the ChangeLog file.
And thanks to the following people who have provided accounts for
portability testing on many different types of systems: Bob Proulx,
Christian Robert, François Pinard, Greg McGary, Harlan Stenn,
Joel N. Weber, Mark D. Roth, Matt Schalit, Nelson H. F. Beebe,
Réjean Payette, Sam Tardieu.
Thanks to Michael Stone for inflicting test releases of the fileutils
on Debian's unstable distribution, and to all the kind folks who used
that distribution and found and reported bugs.
Note that each man page is now automatically generated from a template
and from the corresponding --help usage message. Patches to the template
files (man/*.x) are welcome. However, the authoritative documentation
is in texinfo form in the doc directory.
If you run the tests on a SunOS4.1.4 system, expect the ctime-part of
the ls `time-1' test to fail. I believe that is due to a bug in the
way Sun implemented link(2) and chmod(2).
***************************************
Last-minute notes, before coreutils-5.0
---------------------------------------
A known problem exists when compiling on HPUX on both hppa and ia64
in 64-bit mode (i.e. +DD64) on all known HPUX 11.x versions. This
is not due to a bug in the package but instead due to a bug in the
system header file which breaks things in 64-bit mode. The default
compilation mode is 32-bit and the software compiles fine using the
default mode. To build this software in 64-bit mode you will need
to fix the system /usr/include/inttypes.h header file. After
correcting that file the software also compiles fine in 64-bit mode.
Here is one possible patch to correct the problem.
--- /usr/include/inttypes.h.orig Thu May 30 01:00:00 1996
+++ /usr/include/inttypes.h Sun Mar 23 00:20:36 2003
@@ -489 +489 @@
-#ifndef __STDC_32_MODE__
+#ifndef __LP64__
If you run the tests as root, note that a few of them create files
and/or run programs as a non-root user, `nobody' by default.
If you want to use some other non-root username, specify it via
the NON_ROOT_USERNAME environment variable. Depending on the
permissions with which the working directories have been created,
using `nobody' may fail, because that user won't have the required
read and write access to the build and test directories.
I find that it is best to unpack and build as a non-privileged
user, and then to run the following command as that user in order
to run the privilege-requiring tests:
sudo env NON_ROOT_USERNAME=$USER make check
If you can run the tests as root, please do so and report any
problems. We get much less test coverage in that mode, and it's
arguably more important that these tools work well when run by
root than when run by less privileged users.
***************************************
There are pretty many tests, but nowhere near as many as we need.
Additions and corrections are very welcome.
If you see a problem that you've already reported, feel free to re-report
it -- it won't bother me to get a reminder. Besides, the more messages I
get regarding a particular problem the sooner it'll be fixed -- usually.
If you sent a complete patch and, after a couple weeks you haven't
received any acknowledgement, please ping us. A complete patch includes
a well-written ChangeLog entry, unified (diff -u format) diffs relative
to the most recent test release (or, better, relative to the latest
sources in the CVS repository), an explanation for why the patch is
necessary or useful, and if at all possible, enough information to
reproduce whatever problem prompted it. Plus, you'll earn lots of
karma if you include a test case to exercise any bug(s) you fix.
Instructions for checking out the latest source via CVS are here:
http://savannah.gnu.org/cvs/?group=coreutils
If your patch adds a new feature, please try to get some sort of consensus
that it is a worthwhile change. One way to do that is to send mail to
bug-coreutils@gnu.org including as much description and justification
as you can. Based on the feedback that generates, you may be able to
convince us that it's worth adding.
WARNING: If you modify files like configure.in, m4/*.m4, aclocal.m4,
or any Makefile.am, then don't be surprised if what gets regenerated no
longer works. To make things work, you'll have to be using appropriate
versions of automake and autoconf. As for what versions are `appropriate',
use the versions of
* autoconf specified via AC_PREREQ in m4/jm-macros.m4
* automake specified via AM_INIT_AUTOMAKE in configure.ac
Usually it's fine to use versions that are newer than those specified.
These programs all recognize the `--version' option. When reporting
bugs, please include in the subject line both the package name/version
and the name of the program for which you found a problem.
For general documentation on the coding and usage standards
this distribution follows, see the GNU Coding Standards,
http://www.gnu.org/prep/standards_toc.html.
Mail suggestions and bug reports for these programs to
the address on the last line of --help output.

View File

@ -1,463 +0,0 @@
These people have contributed to the GNU coreutils (formerly, the fileutils,
textutils, and/or sh-utils packages). Some have reported problems, others
have contributed improvements to the documentation, actual code, and even
complete programs. Those contributions are described in the ChangeLog
files. If your name has been left out, if you'd rather not be listed,
or if you'd prefer a different address be used, please send a note to
the bug-report mailing list (as seen on last line of e.g., cp --help).
??? kytek@cybercomm.net
A Costa agcosta@gis.net
Achim Blumensath blume@corona.oche.de
Adam Klein aklein@debian.org
Akim Demaille demaille@inf.enst.fr
Alain Magloire alain@qnx.com
Alan Iwi iwi@atm.ox.ac.uk
Albert Chin-A-Young china@thewrittenword.com
Albert Hopkins ahopkins@dynacare.com
Alberto Accomazzi alberto@cfa0.harvard.edu
aldomel aldomel@ix.netcom.com
Alen Muzinic zveki@fly.cc.fer.hr
Alexandre Duret-Lutz duret_g@epita.fr
Alexey Solovyov alekso@math.uu.se
Alexey Vyskubov alexey@pippuri.mawhrin.net
Alfred M. Szmidt ams@kemisten.nu
Andi Kleen freitag@alancoxonachip.com
Andre Novaes Cunha Andre.Cunha@br.global-one.net
Andreas Gruenbacher ag@bestbits.at
Andreas Jaeger jaeger@gnu.org
Andreas Luik luik@isa.de
Andreas Schwab schwab@suse.de
Andreas Stolcke stolcke@ICSI.Berkeley.EDU
Andrei Gaponenko andr@triumf.ca
Andres Soolo andres@soolo.matti.ee
Andrew Burgess aab@cichlid.com
Andrew Dalke dalke@bioreason.com
Andrew Fabbro andrew@fabbro.org
Andrew Pham andpha@us.ibm.com
Andrew Tridgell tridge@samba.org
Andrey Borzenkov arvidjaar@mail.ru
Andries Brouwer Andries.Brouwer@cwi.nl
Andy Longton alongton@metamark.com
Anthony Thyssen anthony@griffith.edu.au
Antonio Rendas ajrendas@yahoo.com
Ariel Faigon ariel@cthulhu.engr.sgi.com
Arne H. Juul arnej@solan.unit.no
Arne Henrik Juul arnej@imf.unit.no
Arnold Robbins arnold@skeeve.com
Arthur Pool pool@commerce.uq.edu.au
Arun Sharma arun.sharma@intel.com
Arvind Autar Autar022@planet.nl
Augey Mikus mikus@dqc.org
Austin Donnelly Austin.Donnelly@cl.cam.ac.uk
Axel Kittenberger Anshil@gmx.net
Bauke Jan Douma bjdouma@xs4all.nl
Ben Elliston bje@air.net.au
Ben Harris bjh21@netbsd.org
Benjamin Cutler cutlerbc@simla.colostate.edu
Bengt Martensson bengt@mathematik.uni-Bremen.de
Bernard Giroud bernard.giroud@creditlyonnais.ch
Bernd Leibing bernd.leibing@rz.uni-ulm.de
Bernd Melchers melchers@cis.fu-berlin.de
Bernhard Baehr bernhard.baehr@gmx.de
Bernhard Gabler bernhard@uni-koblenz.de
Bernhard Rosenkraenzer bero@redhat.de
Bert Deknuydt Bert.Deknuydt@esat.kuleuven.ac.be
Bill Peters peters@gaffel.as.arizona.edu
Bjorn Helgaas helgaas@rsn.hp.com
Bob McCracken kerouac@ravenet.com
Bob Proulx rwp@fc.hp.com
Branden Robinson branden@necrotic.deadbeast.net
Brendan O'Dea bod@compusol.com.au
Brian Kimball bfk@footbag.org
Brian Youmans 3diff@gnu.org
Bruce Korb bkorb@veritas.com
Bruce Robertson brucer@theodolite.dyndns.org
Bruno Haible haible@clisp.cons.org
Carl Johnson carlj@cjlinux.home.org
Carl Lowenstein cdl@mpl.UCSD.EDU
Carlos Canau Carlos.Canau@relay.puug.pt
Charles Karney karney@pppl.gov
Charles Randall crandall@matchlogic.com
Chip Salzenberg chip@valinux.com
Chris Faylor cgf@cygnus.com
Chris J. Bednar cjb@AdvancedDataSolutions.com
Chris Lesniewski ctl@mit.edu
Chris Sylvain csylvain@umm.edu
Chris Yeo cyeo@biking.org
Christi Alice Scarborough christi@chiark.greenend.org.uk
Christian Harkort christian.harkort@web.de
Christian Krackowizer ckrackowiz@std.schuler-ag.com
Christian Rose menthos@menthos.com
Christian von Roques roques@pond.sub.org
Chuck Hedrick hedrick@klinzhai.rutgers.edu
Clark Morgan cmorgan@aracnet.com
Clement Wang clem.wang@overture.com
Colin Plumb colin@nyx.net
Colin Watson cjw44@riva.ucam.org
Collin Rogowski collin@rogowski.de
Cray-Cyber Project http://www.cray-cyber.org
Dale Scheetz dwarf@polaris.net
Dan Hagerty hag@gnu.ai.it.edu
Dan Jacobson http://www.geocities.com/jidani
Dan Pascu dan@services.iiruc.ro
Daniel Bergstrom noa@melody.se
Dániel Varga danielv@axelero.hu
Danny Levinson danny.levinson@overture.com
Darren Salt ds@youmustbejoking.demon.co.uk
Dave Beckett dajobe@dajobe.org
David Dyck dcd@tc.fluke.COM
David Eisner cradle@umd.edu
David Flynn dav@chess.plus.com
David Godfrey dave@delta.demon.co.uk
David Luyer david_luyer@pacific.net.au
David Malone dwmalone@cnri.dit.ie
Deepak Goel deego@gnufans.org
Dennis Henriksen opus@flamingo.osrl.dk
Dennis Smit ds@nerds-incorporated.org
Derek Clegg dclegg@next.com
Dick Streefland dick_streefland@tasking.com
Dirk Lattermann dlatt@t-online.de
Dirk-Jan Faber djfaber@snow.nl
Dmitry Rutsky rutsky@school.ioffe.rssi.ru
Dmitry V. Levin ldv@altlinux.org
Don Parsons dparsons@synapse.kent.edu
Donni Erpel donald@appc11.gsi.de
Doug Coleman coleman@iarc1.ece.utexas.edu
Doug McLaren dougmc@comco.com
Dragos Harabor dharabor@us.oracle.com
Duncan Roe duncanr@optimation.com.au
Ed Avis ed@membled.com
Edzer Pebesma Edzer.Pebesma@rivm.nl
Eirik Fuller eirik@hackrat.com
Eivind eivindt@multinet.no
Eli Zaretskii eliz@is.elta.co.il
Emile LeBlanc leblanc@math.toronto.edu
Eric Backus ericb@lsid.hp.com
Eric G. Miller egm2@jps.net
Eric Pemente pemente@northpark.edu
Eric S. Raymond esr@snark.thyrsus.com
Erik Bennett bennett@cvo.oneworld.com
Erik Corry erik@kroete2.freinet.de
Felix Lee flee@teleport.com
Ferdinand fw@scenic.mine.nu
Fletcher Mattox fletcher@cs.utexas.edu
Florin Iucha fiucha@hsys.mic.ro
François Pinard pinard@iro.umontreal.ca
Frank Adler fadler@allesklar.de
Frank T Lofaro ftlofaro@snooks.Egr.UNLV.EDU
Fred Fish fnf@ninemoons.com
Frédéric L. W. Meunier 0@pervalidus.net
Frederik Eaton frederik@caltech.edu
Gabor Z. Papp gzp@gzp.org.hu
Gaël Quéri gqueri@mail.dotcom.fr
Galen Hazelwood galenh@micron.net
Gary Anderson ganderson@clark.net
Gary V. Vaughan gary@gnu.org
Gaute Hvoslef Kvalnes gaute@verdsveven.com
Geoff Collyer geoff at collyer.net
Geoff Kuenning geoff@cs.hmc.edu
Geoff Odhner geoff@franklin.com
Geoff Whale geoffw@cse.unsw.EDU.AU
Gerhard Poul gpoul@gnu.org
Germano Leichsenring germano@jedi.cs.kobe-u.ac.jp
Göran Uddeborg goeran@uddeborg.pp.se
GOTO Masanori gotom@debian.or.jp
Greg Louis glouis@dynamicro.on.ca
Greg McGary gkm@gnu.org
Greg Schafer gschafer@zip.com.au
Greg Troxel gdt@bbn.com
Greg Wooledge gawooledge@sherwin.com
Gregory Leblanc gleblanc@cu-portland.edu
Guido Leenders guido.leenders@invantive.com
H. J. Lu hjl@valinux.com
Hans Ginzel hans@matfyz.cz
Hans Lermen lermen@fgan.de
Hans Verkuil hans@wyst.hobby.nl
Harry Liu rliu@lek.ugcs.caltech.edu
Harti Brandt brandt@fokus.fraunhofer.de
Herbert Xu herbert@gondor.apana.org.au
Holger Berger hberger@ess.nec.de
Hon-Yin Kok hkok@yoda.unl.edu
Hugh Daniel hugh@xanadu.com
Ian Bruce ian.bruce@myrealbox.com
Ian Jackson ijackson@chiark.greenend.org.uk
Ian Lance Taylor ian@cygnus.com
Ian Turner vectro@pipeline.com
Iida Yosiaki iida@gnu.org
Ingo Saitz ingo@debian.org
Ivo Timmermans ivo@debian.org
James james@albion.glarp.com
James Antill jmanti%essex.ac.uk@seralph21.essex.ac.uk
James Sneeringer jvs@ocslink.com
James Tanis jtt@soscorp.com
James Youngman james+usenet@free-lunch.demon.co.uk
Jamie Lokier jamie@imbolc.ucc.ie
Jan Fedak J.Fedak@sh.cvut.cz
Jan Nieuwenhuizen janneke@gnu.org
Janos Farkas chexum@shadow.banki.hu
Jarkko Hietaniemi jhi@epsilon.hut.fi
Jean Charles Delepine delepine@u-picardie.fr
Jeff Moore jbm@mordor.com
Jeff Sheinberg jeff@bsrd.net
Jens Elkner elkner@imsgroup.de
Jens Schmidt jms@jsds.hamburg.com
Jerome Abela abela@hsc.fr
Jérôme Zago bug-coreutils-ml@agt-the-walker.net
Jesse Kornblum kornblum@usna.edu
Jesse Thilo jgt2@eecs.lehigh.edu
Jie Xu xuj@iag.net
Jim Blandy jimb@cyclic.com
Jim Dennis jimd@starshine.org
Joakim Rosqvist dvljrt@cs.umu.se
Jochen Hein jochen@jochen.org
Joe Orton joe@manyfish.co.uk
Johan Danielsson joda@pdc.kth.se
John Bley jbb6@acpub.duke.edu
John David Anglin dave.anglin@nrc.ca
John Gatewood Ham zappaman@alphabox.compsci.buu.ac.th
John Gotts jgotts@umich.edu
John Kendall kendall@capps.com
John Kodis kodis@acm.org
John Murphy jam@philabs.research.philips.com
John Roll john@panic.harvard.edu
John Salmon johns@mullet.anu.edu.au
John Summerfield summer@OS2.ami.com.au
Jon Peatfield J.S.Peatfield@damtp.cam.ac.uk
Joost van Baal joostvb@xs4all.nl
Jorge Stolfi stolfi@ic.unicamp.br
Joseph S. Myers jsm28@cam.ac.uk
Juan F. Codagnone juam@arnet.com.ar
Jungshik Shin jshin@pantheon.yale.edu
Jürgen Fluk louis@dachau.marco.de
Jurriaan thunder7@xs4all.nl
jvogel jvogel@linkny.com
Kai Henningsen kai@debian.org
Kai-Uwe Rommel rommel@informatik.tu-muenchen.de
Kalle Olavi Niemitalo kon@iki.fi
Kamal Paul Nigam Kamal_Paul_Nigam@gs35.sp.cs.cmu.edu
Karl Eichwalder keichwa@gmx.net
Karl Heuer kwzh@gnu.org
Karl-Michael Schneider schneide@phil.uni-passau.de
Karsten Thygesen karthy@kom.auc.dk
Kaveh R. Ghazi ghazi@caip.rutgers.edu
Keith M. Briggs keith.briggs@bt.com
Keith Owens kaos@audio.apana.org.au
Keith Thompson kst@cts.com
Ken Pizzini kenp@halcyon.com
Kristin E Thomas kristint@us.ibm.com
Kjetil Torgrim Homme kjetilho@ifi.uio.no
Kristoffer Rose kris@diku.dk
Larry McVoy lm@sgi.com
Lars Hecking lhecking@nmrc.ucc.ie
Leah Q eequor@earthlink.net
Lehti Rami rammer@cs.tut.fi
Leonard N. Zubkoff lnz@dandelion.com
Leonardo Milano lmilano@udel.edu
Lorne Baker lbaker@nitro.avint.net
Luke Hassell lukehassell@yahoo.com
M. P. Suzuki mpsuzuki@hiroshima-u.ac.jp
Maciej Kwapulinski pikpok@univ.gda.pl
Manas Garg manas@cygsoft.com
Manfred Hollstein manfred@s-direktnet.de
Marc Boucher marc@mbsi.ca
Marc Haber mh+debian-bugs@zugschlus.de
Marc Olzheim marcolz@stack.nl
Marco Franzen Marco.Franzen@Thyron.com
Marcus Brinkmann http://www.marcus-brinkmann.de
Marcus Daniels marcus@ee.pdx.edu
Mark A. Thomas thommark@access.digex.net
Mark Conty Mark_Conty@cargill.com
Mark D. Roth roth@uiuc.edu
Mark Funkenhauser mfunkenhauser@rogers.com
Mark Harris mark@monitor.designacc.com
Mark Hewitt mhewitt@armature.com
Mark Hounschell markh@compro.net
Mark Hubbart discord@mac.com
Mark Kettenis kettenis@phys.uva.nl
Mark Nudelman marknu@flash.net
Mark W. Eichin eichin@cygnus.com
Markus Demleitner msdemlei@auriga.ari.uni-heidelberg.de
Martin martin@dresden.nacamar.de
Martin Buck martin.buck@ascom.ch
Martin Gallant martyg@goodbit.net
Martin Hippe martin.hippe@schlund.de
Martin Michlmayr tbm@cyrius.com
Martin Mitchell martin@debian.org
Martin P.J. Zinser zinser@decus.de
Marty Leisner leisner@sdsp.mc.xerox.com
Masami Takikawa takikawm@CS.ORST.EDU
Mate Wierdl mw@moni.msci.memphis.edu
Matej Vela mvela@public.srce.hr
Matt Perry matt@primefactor.com
Matt Schalit mschalit@pacbell.net
Matt Swift swift@alum.mit.edu
Matthew Arnison maffew@cat.org.au
Matthew Braun matthew@ans.net
Matthew Clarke Matthew_Clarke@mindlink.bc.ca
Matthew S. Levine mslevine@theory.lcs.mit.edu
Matthew Smith matts@bluesguitar.org
Matthew Swift swift@alum.mit.edu
Matthias Urlichs smurf@noris.de
Matti Aarnio matti.aarnio@zmailer.org
Mattias Wadenstein maswan@acc.umu.se
Meelis Roos mroos@tartu.cyber.ee
Michael michael@aplatform.com
Michael ??? michael@roka.net
Michael Bacarella mbac@netgraft.com>
Michael Deutschmann michael@talamasca.ocis.net
Michael Elizabeth Chastain mec.gnu@mindspring.com
Michael Gaughen mgaughen@polyserve.com
Michael Hasselberg mikelh@zonta.ping.de
Michael Hohn hohn@math.utah.edu
Michael J. Croghan mcroghan@usatoday.com
Michael McFarland sidlon@yahoo.com
Michael Piefel piefel@informatik.hu-berlin.de
Michael Steffens michael.steffens@s.netic.de
Michael Stone mstone@debian.org
Michael Stutz stutz@dsl.org
Michael van Elst mlelstv@dev.de.cw.net
Michael Veksler mveksler@techunix.technion.ac.il
Michail Litvak mci@owl.openwall.com
Michal Politowski mpol@charybda.icm.edu.pl
Michal Svec msvec@suse.cz
Michel Robitaille robitail@IRO.UMontreal.CA
Michiel Bacchiani bacchian@raven.bu.edu
Mike Castle dalgoda@ix.netcom.com
Mike Coleman mkc@mathdogs.com
Mike Jetzer mjetzer@mke.catalystwms.com
Mikko Tuumanen m@sorvankyla.yok.utu.fi
Mikulas Patocka mikulas@artax.karlin.mff.cuni.cz
Miles Bader miles@gnu.ai.mit.edu
Minh Tran-Le tranle@intellicorp.com
Morten Welinder terra@diku.dk
Neal H Walfield neal@cs.uml.edu
Neil Brown neilb@cse.unsw.edu.au
Nelson H. F. Beebe beebe@math.utah.edu
Nick Estes debian@nickstoys.com
Nick Lawes nlawes@silverplatter.com
Niklas Edmundsson nikke@acc.umu.se
Nikola Milutinovic Nikola.Milutinovic@ev.co.yu
Noah Friedman friedman@splode.com
Noel Cragg noel@red-bean.com
Olatunji Oluwabukunmi Ruwase tjruwase@stanford.edu
Olav Morkrid olav@funcom.com
Ole Laursen olau@hardworking.dk
Oliver Kiddle okiddle@yahoo.co.uk
Ørn E. Hansen oehansen@daimi.aau.dk
Oskar Liljeblad osk@hem.passagen.se
Patrick Mauritz oxygene@studentenbude.ath.cx
Paul Eggert eggert@twinsun.com
Paul Jarc prj@po.cwru.edu
Paul Nevai nevai@ops.mps.ohio-state.edu
Paul Sauer paul@alexa.com
Paul Slootman paul@debian.org
Paul Worrall paul@basilisk.uklinux.net
Pawel Prokop pablo@wizard.ae.krakow.pl
Per Cederqvist ceder@lysator.liu.se
Per Kristian Hove perhov@math.ntnu.no
Peter Eriksson peter@ifm.liu.se
Peter Horst peter@ointment.org
Peter Moulder reiter@netspace.net.au
Peter Samuelson psamuels@sampo.creighton.edu
Peter Seebach seebs@taniemarie.solon.com
Petter Reinholdtsen pere@hungry.com
Phelippe Neveu pneveu@pcigeomatics.com
Phil Richards phil.richards@vf.vodafone.co.uk
Philippe De Muyter phdm@macqel.be
Philippe Schnoebelen Philippe.Schnoebelen@imag.fr
Phillip Jones mouse@datastacks.com
Piergiorgio Sartor sartor@sony.de
Piotr Kwapulinski kwap@univ.gda.pl
Prashant TR tr@eth.net
Rainer Orth ro@TechFak.Uni-Bielefeld.DE
Ralf W. Stephan stephan@tmt.de
Ralph Loader loader@maths.ox.ac.uk
Raul Miller moth@magenta.com
Raúl Núñez de Arenas Coronado raul@pleyades.net
Reuben Thomas rrt@sc3d.org
Richard A Downing richard.downing@bcs.org.uk
Richard Braakman dark@xs4all.nl
Richard Dawe rich@phekda.freeserve.co.uk
Richard J. Rauenzahn rrauenza@hairball.cup.hp.com
Richard Neill rn214@hermes.cam.ac.uk
Richard Sharman rsharman@magmacom.com
Rick Sladkey jrs@world.std.com
Rik Faith faith@cs.unc.edu
Risto Kankkunen kankkune@lingsoft.fi
Robert H. de Vries robert@and.nl
Robert Millan zeratul2@wanadoo.es
Rogier Wolff R.E.Wolff@BitWizard.nl
Roland Huebner ro-huebner@gmx.de
Roland Turner raz.tah.bet@raz.cx
Ronald F. Guilmette rfg@netcom.com
Ross Alexander r.alexander@auckland.ac.nz
Ross Paterson rap@doc.ic.ac.uk
Ross Ridge rridge@calum.csclub.uwaterloo.ca
Sami Farin sfarin@ratol.fi
Samuel Tardieu sam@rfc1149.net
Samuli Karkkainen Samuli.Karkkainen@hut.fi
Sander van Malssen svm@kozmix.ow.nl
Santiago Vila Doncel sanvila@unex.es
Savochkin Andrey Vladimirovich saw@msu.ru
Scott Lurndal slurn@griffin.engr.sgi.com
Shing-Shong Shei shei@cs.indiana.edu
Soeren Sonnenburg sonnenburg@informatik.hu-berlin.de
Solar Designer solar@owl.openwall.com
Stanislav Ievlev inger@altlinux.ru
Stéphane Chazelas Stephane_CHAZELAS@yahoo.fr
Stephen Depooter sbdep@myrealbox.com
Stephen Eglen eglen@pcg.wustl.edu
Stephen Gildea gildea@stop.mail-abuse.org
Stephen Smoogen smooge@mindspring.com
Steve McConnel steve@acadcomp.sil.org
Steven G. Johnson stevenj@alum.mit.edu
Steven Mocking ufo@quicknet.nl
Steven P Watson steven@magelico.net
Stuart Kemp skemp@peter.bmc.com
Szakacsits Szabolcs szaka@sienet.hu
Tadayoshi Funaba tadf@kt.rim.or.jp
TAKAI Kousuke takai@vlsi.kuee.kyoto-u.ac.jp
Theodore Ts'o tytso@rsts-11.mit.edu
Thomas Bushnell thomas@gnu.ai.mit.edu
Thomas Goerlich thomas@schnappmatik.de
Thomas Luzat thomas@luzat.com
Thomas Quinot thomas@Cuivre.FR.EU.ORG
Tim J. Robbins tjr@FreeBSD.org
Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu
Tim Smithers mouse@dmouse.com.au
Tim Waugh twaugh@redhat
Todd A. Jacobs tjacobs@codegnome.org
Tom Haynes thomas@netapp.com
Tom Quinn trq@dionysos.thphys.ox.ac.uk
Tommi Kyntola tkyntola@cc.hut.fi
Ton Hospel thospel@mail.dma.be
Ton Nijkes ton@murphy.nl
Tony Kocurko akocurko@mun.ca
Tony Leneis tony@plaza.ds.adp.com
Tony Robinson ajr@eng.cam.ac.uk
Torbjorn Granlund tege@nada.kth.se
Torbjorn Lindgren tl@funcom.no
Torsten Landschoff torsten@pclab.ifg.uni-kiel.de
Ulrich Drepper drepper@gnu.org
Urs Thuermann urs@isnogud.escape.de
Uwe H. Steinfeld usteinfeld@gmx.net
Vesselin Atanasov vesselin@bgnet.bg
Vin Shelton acs@alumni.princeton.edu
Volker Borchert bt@teknon.de
Volker Paul vpaul@dohle.com
Wartan Hachaturow wart@tepkom.ru
Wayne Stewart wstewa@atl.com
Wenjun Zheng zwj@yahoo.com
Werner Almesberger Werner.Almesberger@epfl.ch
Wichert Akkerman wichert@cistron.nl
Will Edgington wedgingt@acm.org
William Bader william@nscs.fast.net
William Dowling will@franklin.com
William Lewis wiml@omnigroup.com
wiregauze wiregauze@yahoo.com
Wojciech Purczynski cliph@isec.pl
Wolfram Kleff kleff@cs.uni-bonn.de
Won-kyu Park wkpark@chem.skku.ac.kr
Yann Dirson dirson@debian.org
Zvi Har'El rl@math.technion.ac.il

View File

@ -1,36 +0,0 @@
The following teams have translated the many diagnostics of this
package into many different languages. Thank you!
---
http://www.iro.umontreal.ca/contrib/po/HTML/team-af.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-be.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-ca.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-cs.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-da.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-de.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-el.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-es.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-et.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-fi.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-fr.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-ga.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-gl.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-hu.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-it.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-ja.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-ko.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-lg.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-ms.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-nb.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-nl.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-no.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-pl.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-pt.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-pt_BR.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-ru.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-sk.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-sl.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-sv.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-tr.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-zh_CN.html
http://www.iro.umontreal.ca/contrib/po/HTML/team-zh_TW.html

View File

@ -1,171 +0,0 @@
restore djgpp, eventually
merge TODO lists
add unit tests for lib/*.c
strip: add an option to specify the program used to strip binaries.
suggestion from Karl Berry
doc/coreutils.texi:
Address this comment: FIXME: mv's behavior in this case is system-dependent
Better still: fix the code so it's *not* system-dependent.
implement --target-directory=DIR for install (per texinfo documentation)
ls: add --format=FORMAT option that controls how each line is printed.
cp --no-preserve=X should not attempt to preserve attribute X
reported by Andreas Schwab
copy.c: Address the FIXME-maybe comment in copy_internal.
And once that's done, add an exclusion so that `cp --link'
no longer incurs the overhead of saving src. dev/ino and dest. filename
in the hash table.
See if we can be consistent about where --verbose sends its output:
These all send --verbose output to stdout:
head, tail, rm, cp, mv, ln, chmod, chown, chgrp, install, ln
These send it to stderr:
shred mkdir split
readlink is different
Write an autoconf test to work around build failure in HPUX's 64-bit mode.
See notes in README -- and remove them once there's a work-around.
Integrate use of sendfile, suggested here:
http://mail.gnu.org/archive/html/bug-fileutils/2003-03/msg00030.html
I don't plan to do that, since a few tests demonstrate no significant benefit.
Should printf '\0123' print "\n3"?
per report from TAKAI Kousuke on Mar 27
http://mail.gnu.org/archive/html/bug-coreutils/2003-03/index.html
printf: consider adapting builtins/printf.def from bash
df: add `--total' option, suggested here http://bugs.debian.org/186007
seq: give better diagnostics for invalid formats:
e.g. no or too many % directives
seq: consider allowing format string to contain no %-directives
m4: rename all macros that start with AC_ to start with another prefix
resolve RH report on cp -a forwarded by Tim Waugh
Martin Michlmayr's patch to provide ls with `--sort directory' option
tail: don't use xlseek; it *exits*.
Instead, maybe use a macro and return nonzero.
add mktemp? Suggested by Nelson Beebe
df: alignment problem of `Used' heading with e.g., -mP
reported by Karl Berry
tr: support nontrivial equivalence classes, e.g. [=e=] with LC_COLLATE=fr_FR
fix tail -f to work with named pipes; reported by Ian D. Allen
$ mkfifo j; tail -f j & sleep 1; echo x > j
./tail: j: file truncated
./tail: j: cannot seek to offset 0: Illegal seek
lib/strftime.c: Since %N is the only format that we need but that
glibc's strftime doesn't support, consider using a wrapper that
would expand /%(-_)?\d*N/ to the desired string and then pass the
resulting string to glibc's strftime.
sort: Compress temporary files when doing large external sort/merges.
This improves performance when you can compress/uncompress faster than
you can read/write, which is common in these days of fast CPUs.
suggestion from Charles Randall on 2001-08-10
sort: Add an ordering option -R that causes 'sort' to sort according
to a random permutation of the correct sort order. Also, add an
option --random-seed=SEED that causes 'sort' to use an arbitrary
string SEED to select which permutations to use, in a deterministic
manner: that is, if you sort a permutation of the same input file
with the same --random-seed=SEED option twice, you'll get the same
output. The default SEED is chosen at random, and contains enough
information to ensure that the output permutation is random.
suggestion from Feth AREZKI, Stephan Kasal, and Paul Eggert on 2003-07-17
unexpand: [http://www.opengroup.org/onlinepubs/007908799/xcu/unexpand.html]
printf 'x\t \t y\n'|unexpand -t 8,9 should print its input, unmodified.
printf 'x\t \t y\n'|unexpand -t 5,8 should print "x\ty\n"
Let GNU su use the `wheel' group if appropriate.
(there are a couple patches, already)
sort: Investigate better sorting algorithms; see Knuth vol. 3.
We tried list merge sort, but it was about 50% slower than the
recursive algorithm currently used by sortlines, and it used more
comparisons. We're not sure why this was, as the theory suggests it
should do fewer comparisons, so perhaps this should be revisited.
List merge sort was implemented in the style of Knuth algorithm
5.2.4L, with the optimization suggested by exercise 5.2.4-22. The
test case was 140,213,394 bytes, 426,4424 lines, text taken from the
GCC 3.3 distribution, sort.c compiled with GCC 2.95.4 and running on
Debian 3.0r1 GNU/Linux, 2.4GHz Pentium 4, single pass with no
temporary files and plenty of RAM.
Since comparisons seem to be the bottleneck, perhaps the best
algorithm to try next should be merge insertion. See Knuth section
5.3.1, who credits Lester Ford, Jr. and Selmer Johnson, American
Mathematical Monthly 66 (1959), 387-389.
cp --recursive: perform dir traversals in source and dest hierarchy rather
than forming full file names. The latter (current) approach fails
unnecessarily when the names become very long.
tail --p is now ambiguous
Remove suspicious uses of alloca (ones that may allocate more than
about 4k)
Adapt these contribution guidelines for coreutils:
http://sources.redhat.com/automake/contribute.html
Changes expected to go in, post-5.2.1:
======================================
wc: add an option, --files0-from [as for du] to make it read NUL-delimited
file name arguments from a file.
dd patch from Olivier Delhomme
Apply Andreas Gruenbacher's ACL and xattr changes
Apply Bruno Haible's hostname changes
test/mv/*: clean up $other_partition_tmpdir in all cases
ls: when both -l and --dereference-command-line-symlink-to-dir are
specified, consider whether to let the latter select whether to
dereference command line symlinks to directories. Since -l has
an implicit --NO-dereference-command-line-symlink-to-dir meaning.
Pointed out by Karl Berry.
A more efficient version of factor, and possibly one that
accepts inputs of size 2^64 and larger.
Re-add a separate test for du's stack space usage (like the one removed
from tests/rm/deep-1).
dd: consider adding an option to suppress `bytes/block read/written'
output to stderr. Suggested here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=165045
Pending copyright papers:
------------------------
ls --color: Ed Avis' patch to suppress escape sequences for
non-highlighted files
getpwnam from Bruce Korb
pb (progress bar) from Miika Pekkarinen
Look into improving the performance of md5sum.
`openssl md5' is consistently about 30% faster than md5sum on an idle
AMD 2000-XP system with plenty of RAM and a 261 MB input file.
openssl's md5 implementation is in assembly, generated by a perl script.

View File

@ -1,30 +0,0 @@
/* __fpending.c -- return the number of pending output bytes on a stream
Copyright (C) 2000 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. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "__fpending.h"
size_t
__fpending (FILE *fp)
{
return PENDING_OUTPUT_N_BYTES;
}

View File

@ -1,17 +0,0 @@
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <stddef.h>
#include <stdio.h>
#if HAVE_STDIO_EXT_H
# include <stdio_ext.h>
#endif
#ifndef HAVE_DECL___FPENDING
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL___FPENDING
size_t __fpending (FILE *);
#endif

View File

@ -1,278 +0,0 @@
/* argmatch.c -- find a match for a string in an array
Copyright (C) 1990, 1998, 1999, 2001, 2002, 2003, 2004 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 David MacKenzie <djm@ai.mit.edu>
Modified by Akim Demaille <demaille@inf.enst.fr> */
#if HAVE_CONFIG_H
# include <config.h>
#endif
/* Specification. */
#include "argmatch.h"
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "error.h"
#include "exit.h"
#include "quotearg.h"
#include "quote.h"
#include "unlocked-io.h"
/* When reporting an invalid argument, show nonprinting characters
by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use
literal_quoting_style. */
#ifndef ARGMATCH_QUOTING_STYLE
# define ARGMATCH_QUOTING_STYLE locale_quoting_style
#endif
/* Non failing version of argmatch call this function after failing. */
#ifndef ARGMATCH_DIE
# include "exitfail.h"
# define ARGMATCH_DIE exit (exit_failure)
#endif
#ifdef ARGMATCH_DIE_DECL
ARGMATCH_DIE_DECL;
#endif
static void
__argmatch_die (void)
{
ARGMATCH_DIE;
}
/* Used by XARGMATCH and XARGCASEMATCH. See description in argmatch.h.
Default to __argmatch_die, but allow caller to change this at run-time. */
argmatch_exit_fn argmatch_die = __argmatch_die;
/* If ARG is an unambiguous match for an element of the
null-terminated array ARGLIST, return the index in ARGLIST
of the matched element, else -1 if it does not match any element
or -2 if it is ambiguous (is a prefix of more than one element).
If VALLIST is none null, use it to resolve ambiguities limited to
synonyms, i.e., for
"yes", "yop" -> 0
"no", "nope" -> 1
"y" is a valid argument, for `0', and "n" for `1'. */
ptrdiff_t
argmatch (const char *arg, const char *const *arglist,
const char *vallist, size_t valsize)
{
size_t i; /* Temporary index in ARGLIST. */
size_t arglen; /* Length of ARG. */
ptrdiff_t matchind = -1; /* Index of first nonexact match. */
bool ambiguous = false; /* If true, multiple nonexact match(es). */
arglen = strlen (arg);
/* Test all elements for either exact match or abbreviated matches. */
for (i = 0; arglist[i]; i++)
{
if (!strncmp (arglist[i], arg, arglen))
{
if (strlen (arglist[i]) == arglen)
/* Exact match found. */
return i;
else if (matchind == -1)
/* First nonexact match found. */
matchind = i;
else
{
/* Second nonexact match found. */
if (vallist == NULL
|| memcmp (vallist + valsize * matchind,
vallist + valsize * i, valsize))
{
/* There is a real ambiguity, or we could not
disambiguate. */
ambiguous = true;
}
}
}
}
if (ambiguous)
return -2;
else
return matchind;
}
/* Error reporting for argmatch.
CONTEXT is a description of the type of entity that was being matched.
VALUE is the invalid value that was given.
PROBLEM is the return value from argmatch. */
void
argmatch_invalid (const char *context, const char *value, ptrdiff_t problem)
{
char const *format = (problem == -1
? _("invalid argument %s for %s")
: _("ambiguous argument %s for %s"));
error (0, 0, format, quotearg_n_style (0, ARGMATCH_QUOTING_STYLE, value),
quote_n (1, context));
}
/* List the valid arguments for argmatch.
ARGLIST is the same as in argmatch.
VALLIST is a pointer to an array of values.
VALSIZE is the size of the elements of VALLIST */
void
argmatch_valid (const char *const *arglist,
const char *vallist, size_t valsize)
{
size_t i;
const char *last_val = NULL;
/* We try to put synonyms on the same line. The assumption is that
synonyms follow each other */
fprintf (stderr, _("Valid arguments are:"));
for (i = 0; arglist[i]; i++)
if ((i == 0)
|| memcmp (last_val, vallist + valsize * i, valsize))
{
fprintf (stderr, "\n - `%s'", arglist[i]);
last_val = vallist + valsize * i;
}
else
{
fprintf (stderr, ", `%s'", arglist[i]);
}
putc ('\n', stderr);
}
/* Never failing versions of the previous functions.
CONTEXT is the context for which argmatch is called (e.g.,
"--version-control", or "$VERSION_CONTROL" etc.). Upon failure,
calls the (supposed never to return) function EXIT_FN. */
ptrdiff_t
__xargmatch_internal (const char *context,
const char *arg, const char *const *arglist,
const char *vallist, size_t valsize,
argmatch_exit_fn exit_fn)
{
ptrdiff_t res = argmatch (arg, arglist, vallist, valsize);
if (res >= 0)
/* Success. */
return res;
/* We failed. Explain why. */
argmatch_invalid (context, arg, res);
argmatch_valid (arglist, vallist, valsize);
(*exit_fn) ();
return -1; /* To please the compilers. */
}
/* Look for VALUE in VALLIST, an array of objects of size VALSIZE and
return the first corresponding argument in ARGLIST */
const char *
argmatch_to_argument (const char *value,
const char *const *arglist,
const char *vallist, size_t valsize)
{
size_t i;
for (i = 0; arglist[i]; i++)
if (!memcmp (value, vallist + valsize * i, valsize))
return arglist[i];
return NULL;
}
#ifdef TEST
/*
* Based on "getversion.c" by David MacKenzie <djm@gnu.ai.mit.edu>
*/
char *program_name;
/* When to make backup files. */
enum backup_type
{
/* Never make backups. */
none,
/* Make simple backups of every file. */
simple,
/* Make numbered backups of files that already have numbered backups,
and simple backups of the others. */
numbered_existing,
/* Make numbered backups of every file. */
numbered
};
/* Two tables describing arguments (keys) and their corresponding
values */
static const char *const backup_args[] =
{
"no", "none", "off",
"simple", "never",
"existing", "nil",
"numbered", "t",
0
};
static const enum backup_type backup_vals[] =
{
none, none, none,
simple, simple,
numbered_existing, numbered_existing,
numbered, numbered
};
int
main (int argc, const char *const *argv)
{
const char *cp;
enum backup_type backup_type = none;
program_name = (char *) argv[0];
if (argc > 2)
{
fprintf (stderr, "Usage: %s [VERSION_CONTROL]\n", program_name);
exit (1);
}
if ((cp = getenv ("VERSION_CONTROL")))
backup_type = XARGMATCH ("$VERSION_CONTROL", cp,
backup_args, backup_vals);
if (argc == 2)
backup_type = XARGMATCH (program_name, argv[1],
backup_args, backup_vals);
printf ("The version control is `%s'\n",
ARGMATCH_TO_ARGUMENT (backup_type, backup_args, backup_vals));
return 0;
}
#endif

View File

@ -1,112 +0,0 @@
/* argmatch.h -- definitions and prototypes for argmatch.c
Copyright (C) 1990, 1998, 1999, 2001, 2002, 2004 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 David MacKenzie <djm@ai.mit.edu>
Modified by Akim Demaille <demaille@inf.enst.fr> */
#ifndef ARGMATCH_H_
# define ARGMATCH_H_ 1
# include <stddef.h>
# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
# define ARGMATCH_CONSTRAINT(Arglist, Vallist) \
(ARRAY_CARDINALITY (Arglist) == ARRAY_CARDINALITY (Vallist) + 1)
/* Assert there are as many real arguments as there are values
(argument list ends with a NULL guard). ARGMATCH_VERIFY is
preferred, since it is guaranteed to be checked at compile-time.
ARGMATCH_ASSERT is for backward compatibility only. */
# define ARGMATCH_VERIFY(Arglist, Vallist) \
struct argmatch_verify \
{ \
char argmatch_verify[ARGMATCH_CONSTRAINT(Arglist, Vallist) ? 1 : -1]; \
}
# define ARGMATCH_ASSERT(Arglist, Vallist) \
assert (ARGMATCH_CONSTRAINT (Arglist, Vallist))
/* Return the index of the element of ARGLIST (NULL terminated) that
matches with ARG. If VALLIST is not NULL, then use it to resolve
false ambiguities (i.e., different matches of ARG but corresponding
to the same values in VALLIST). */
ptrdiff_t argmatch (char const *arg, char const *const *arglist,
char const *vallist, size_t valsize);
# define ARGMATCH(Arg, Arglist, Vallist) \
argmatch (Arg, Arglist, (char const *) (Vallist), sizeof *(Vallist))
/* xargmatch calls this function when it fails. This function should not
return. By default, this is a function that calls ARGMATCH_DIE which
in turn defaults to `exit (exit_failure)'. */
typedef void (*argmatch_exit_fn) (void);
extern argmatch_exit_fn argmatch_die;
/* Report on stderr why argmatch failed. Report correct values. */
void argmatch_invalid (char const *context, char const *value,
ptrdiff_t problem);
/* Left for compatibility with the old name invalid_arg */
# define invalid_arg(Context, Value, Problem) \
argmatch_invalid (Context, Value, Problem)
/* Report on stderr the list of possible arguments. */
void argmatch_valid (char const *const *arglist,
char const *vallist, size_t valsize);
# define ARGMATCH_VALID(Arglist, Vallist) \
argmatch_valid (Arglist, (char const *) (Vallist), sizeof *(Vallist))
/* Same as argmatch, but upon failure, reports a explanation on the
failure, and exits using the function EXIT_FN. */
ptrdiff_t __xargmatch_internal (char const *context,
char const *arg, char const *const *arglist,
char const *vallist, size_t valsize,
argmatch_exit_fn exit_fn);
/* Programmer friendly interface to __xargmatch_internal. */
# define XARGMATCH(Context, Arg, Arglist, Vallist) \
((Vallist) [__xargmatch_internal (Context, Arg, Arglist, \
(char const *) (Vallist), \
sizeof *(Vallist), \
argmatch_die)])
/* Convert a value into a corresponding argument. */
char const *argmatch_to_argument (char const *value,
char const *const *arglist,
char const *vallist, size_t valsize);
# define ARGMATCH_TO_ARGUMENT(Value, Arglist, Vallist) \
argmatch_to_argument (Value, Arglist, \
(char const *) (Vallist), sizeof *(Vallist))
#endif /* ARGMATCH_H_ */

View File

@ -1,93 +0,0 @@
/* closeout.c - close standard output
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 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
#include "closeout.h"
#include <stdio.h>
#include <errno.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "error.h"
#include "exitfail.h"
#include "quotearg.h"
#include "unlocked-io.h"
#include "__fpending.h"
static const char *file_name;
/* Set the file name to be reported in the event an error is detected
by close_stdout. */
void
close_stdout_set_file_name (const char *file)
{
file_name = file;
}
/* Close standard output, exiting with status 'exit_failure' on failure.
If a program writes *anything* to stdout, that program should `fflush'
stdout and make sure that it succeeds before exiting. Otherwise,
suppose that you go to the extreme of checking the return status
of every function that does an explicit write to stdout. The last
printf can succeed in writing to the internal stream buffer, and yet
the fclose(stdout) could still fail (due e.g., to a disk full error)
when it tries to write out that buffered data. Thus, you would be
left with an incomplete output file and the offending program would
exit successfully.
FIXME: note the fflush suggested above is implicit in the fclose
we actually do below. Consider doing only the fflush and/or using
setvbuf to inhibit buffering.
Besides, it's wasteful to check the return value from every call
that writes to stdout -- just let the internal stream state record
the failure. That's what the ferror test is checking below.
It's important to detect such failures and exit nonzero because many
tools (most notably `make' and other build-management systems) depend
on being able to detect failure in other tools via their exit status. */
void
close_stdout (void)
{
int e = ferror (stdout) ? 0 : -1;
/* If the stream's error bit is clear and there is nothing to flush,
then return right away. */
if (e && __fpending (stdout) == 0)
return;
if (fclose (stdout) != 0)
e = errno;
if (0 <= e)
{
char const *write_error = _("write error");
if (file_name)
error (exit_failure, e, "%s: %s", quotearg_colon (file_name),
write_error);
else
error (exit_failure, e, "%s", write_error);
}
}

View File

@ -1,33 +0,0 @@
/* Close standard output.
Copyright (C) 1998, 2000, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef CLOSEOUT_H
# define CLOSEOUT_H 1
# ifdef __cplusplus
extern "C" {
# endif
void close_stdout_set_file_name (const char *file);
void close_stdout (void);
# ifdef __cplusplus
}
# endif
#endif

View File

@ -1,59 +0,0 @@
/* Invoke dup, but avoid some glitches.
Copyright (C) 2001, 2004 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. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
#if HAVE_FCNTL_H
# include <fcntl.h>
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifndef STDERR_FILENO
# define STDERR_FILENO 2
#endif
#include <unistd-safer.h>
/* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or
STDERR_FILENO. */
int
dup_safer (int fd)
{
#ifdef F_DUPFD
return fcntl (fd, F_DUPFD, STDERR_FILENO + 1);
#else
int f = dup (fd);
if (0 <= f && f <= STDERR_FILENO)
{
int f1 = dup_safer (f);
int e = errno;
close (f);
errno = e;
f = f1;
}
return f;
#endif
}

View File

@ -1,306 +0,0 @@
/* Error handler for noninteractive utilities
Copyright (C) 1990-1998, 2000-2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is 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 David MacKenzie <djm@gnu.ai.mit.edu>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "error.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _LIBC
# include <libintl.h>
#else
# include "gettext.h"
#endif
#ifdef _LIBC
# include <wchar.h>
# define mbsrtowcs __mbsrtowcs
#endif
#if !_LIBC
# include "unlocked-io.h"
#endif
#ifndef _
# define _(String) String
#endif
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */
void (*error_print_progname) (void);
/* This variable is incremented each time `error' is called. */
unsigned int error_message_count;
#ifdef _LIBC
/* In the GNU C library, there is a predefined variable for this. */
# define program_name program_invocation_name
# include <errno.h>
# include <libio/libioP.h>
/* In GNU libc we want do not want to use the common name `error' directly.
Instead make it a weak alias. */
extern void __error (int status, int errnum, const char *message, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
extern void __error_at_line (int status, int errnum, const char *file_name,
unsigned int line_number, const char *message,
...)
__attribute__ ((__format__ (__printf__, 5, 6)));;
# define error __error
# define error_at_line __error_at_line
# include <libio/iolibio.h>
# define fflush(s) INTUSE(_IO_fflush) (s)
# undef putc
# define putc(c, fp) INTUSE(_IO_putc) (c, fp)
# include <bits/libc-lock.h>
#else /* not _LIBC */
# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
# ifndef HAVE_DECL_STRERROR_R
"this configure-time declaration test was not run"
# endif
char *strerror_r ();
# endif
# ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
# endif
/* The calling program should define program_name and set it to the
name of the executing program. */
extern char *program_name;
# if HAVE_STRERROR_R || defined strerror_r
# define __strerror_r strerror_r
# endif
#endif /* not _LIBC */
static void
print_errno_message (int errnum)
{
char const *s = NULL;
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
# if STRERROR_R_CHAR_P || _LIBC
s = __strerror_r (errnum, errbuf, sizeof errbuf);
# else
if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
s = errbuf;
# endif
#endif
#if !_LIBC
if (! s && ! (s = strerror (errnum)))
s = _("Unknown system error");
#endif
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
{
__fwprintf (stderr, L": %s", s);
return;
}
#endif
fprintf (stderr, ": %s", s);
}
static void
error_tail (int status, int errnum, const char *message, va_list args)
{
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
{
# define ALLOCA_LIMIT 2000
size_t len = strlen (message) + 1;
const wchar_t *wmessage = L"out of memory";
wchar_t *wbuf = (len < ALLOCA_LIMIT
? alloca (len * sizeof *wbuf)
: len <= SIZE_MAX / sizeof *wbuf
? malloc (len * sizeof *wbuf)
: NULL);
if (wbuf)
{
size_t res;
mbstate_t st;
const char *tmp = message;
memset (&st, '\0', sizeof (st));
res = mbsrtowcs (wbuf, &tmp, len, &st);
wmessage = res == (size_t) -1 ? L"???" : wbuf;
}
__vfwprintf (stderr, wmessage, args);
if (! (len < ALLOCA_LIMIT))
free (wbuf);
}
else
#endif
vfprintf (stderr, message, args);
va_end (args);
++error_message_count;
if (errnum)
print_errno_message (errnum);
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
putwc (L'\n', stderr);
else
#endif
putc ('\n', stderr);
fflush (stderr);
if (status)
exit (status);
}
/* Print the program name and error message MESSAGE, which is a printf-style
format string with optional args.
If ERRNUM is nonzero, print its corresponding system error message.
Exit with status STATUS if it is nonzero. */
void
error (int status, int errnum, const char *message, ...)
{
va_list args;
#if defined _LIBC && defined __libc_ptf_call
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
__libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
0);
#endif
fflush (stdout);
#ifdef _LIBC
_IO_flockfile (stderr);
#endif
if (error_print_progname)
(*error_print_progname) ();
else
{
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s: ", program_name);
else
#endif
fprintf (stderr, "%s: ", program_name);
}
va_start (args, message);
error_tail (status, errnum, message, args);
#ifdef _LIBC
_IO_funlockfile (stderr);
# ifdef __libc_ptf_call
__libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
# endif
#endif
}
/* Sometimes we want to have at most one error per line. This
variable controls whether this mode is selected or not. */
int error_one_per_line;
void
error_at_line (int status, int errnum, const char *file_name,
unsigned int line_number, const char *message, ...)
{
va_list args;
if (error_one_per_line)
{
static const char *old_file_name;
static unsigned int old_line_number;
if (old_line_number == line_number
&& (file_name == old_file_name
|| strcmp (old_file_name, file_name) == 0))
/* Simply return and print nothing. */
return;
old_file_name = file_name;
old_line_number = line_number;
}
#if defined _LIBC && defined __libc_ptf_call
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
__libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
0);
#endif
fflush (stdout);
#ifdef _LIBC
_IO_flockfile (stderr);
#endif
if (error_print_progname)
(*error_print_progname) ();
else
{
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s: ", program_name);
else
#endif
fprintf (stderr, "%s:", program_name);
}
if (file_name != NULL)
{
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s:%d: ", file_name, line_number);
else
#endif
fprintf (stderr, "%s:%d: ", file_name, line_number);
}
va_start (args, message);
error_tail (status, errnum, message, args);
#ifdef _LIBC
_IO_funlockfile (stderr);
# ifdef __libc_ptf_call
__libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
# endif
#endif
}
#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

View File

@ -1,66 +0,0 @@
/* Declaration for error-reporting function
Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _ERROR_H
#define _ERROR_H 1
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
# 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
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Print a message with `fprintf (stderr, FORMAT, ...)';
if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
extern void error (int __status, int __errnum, const char *__format, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
extern void error_at_line (int __status, int __errnum, const char *__fname,
unsigned int __lineno, const char *__format, ...)
__attribute__ ((__format__ (__printf__, 5, 6)));
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */
extern void (*error_print_progname) (void);
/* This variable is incremented each time `error' is called. */
extern unsigned int error_message_count;
/* Sometimes we want to have at most one error per line. This
variable controls whether this mode is selected or not. */
extern int error_one_per_line;
#ifdef __cplusplus
}
#endif
#endif /* error.h */

View File

@ -1,32 +0,0 @@
/* exit() function.
Copyright (C) 1995, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _EXIT_H
#define _EXIT_H
/* Get exit() declaration. */
#include <stdlib.h>
/* Some systems do not define EXIT_*, even with STDC_HEADERS. */
#ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
#endif
#ifndef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
#endif /* _EXIT_H */

View File

@ -1,27 +0,0 @@
/* Failure exit status
Copyright (C) 2002, 2003 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; see the file COPYING.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "exitfail.h"
#include "exit.h"
int volatile exit_failure = EXIT_FAILURE;

View File

@ -1,20 +0,0 @@
/* Failure exit status
Copyright (C) 2002 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; see the file COPYING.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern int volatile exit_failure;

View File

@ -1,72 +0,0 @@
/* Invoke fopen, but avoid some glitches.
Copyright (C) 2001, 2004 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. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <unistd-safer.h>
#ifndef STDERR_FILENO
# define STDERR_FILENO 2
#endif
#include <errno.h>
#include <stdio.h>
#include <stdio-safer.h>
/* Like fopen, but do not return stdin, stdout, or stderr. */
FILE *
fopen_safer (char const *file, char const *mode)
{
FILE *fp = fopen (file, mode);
if (fp)
{
int fd = fileno (fp);
if (0 <= fd && fd <= STDERR_FILENO)
{
int f = dup_safer (fd);
if (f < 0)
{
int e = errno;
fclose (fp);
errno = e;
return NULL;
}
if (fclose (fp) != 0
|| ! (fp = fdopen (f, mode)))
{
int e = errno;
close (f);
errno = e;
return NULL;
}
}
}
return fp;
}

View File

@ -1,68 +0,0 @@
/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _LIBGETTEXT_H
#define _LIBGETTEXT_H 1
/* NLS can be disabled through the configure --disable-nls option. */
#if ENABLE_NLS
/* Get declarations of GNU message catalog functions. */
# include <libintl.h>
#else
/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
chokes if dcgettext is defined as a macro. So include it now, to make
later inclusions of <locale.h> a NOP. We don't include <libintl.h>
as well because people using "gettext.h" will not include <libintl.h>,
and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
is OK. */
#if defined(__sun)
# include <locale.h>
#endif
/* Disabled NLS.
The casts to 'const char *' serve the purpose of producing warnings
for invalid uses of the value returned from these functions.
On pre-ANSI systems without 'const', the config.h file is supposed to
contain "#define const". */
# define gettext(Msgid) ((const char *) (Msgid))
# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
# define ngettext(Msgid1, Msgid2, N) \
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
# define dngettext(Domainname, Msgid1, Msgid2, N) \
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
# define textdomain(Domainname) ((const char *) (Domainname))
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
#endif
/* A pseudo function call that serves as a marker for the automated
extraction of messages, but does not call gettext(). The run-time
translation is done at a different place in the code.
The argument, String, should be a literal string. Concatenated strings
and other string expressions won't work.
The macro's expansion is not parenthesized, so that it is suitable as
initializer for static 'char[]' or 'const char[]' variables. */
#define gettext_noop(String) String
#endif /* _LIBGETTEXT_H */

View File

@ -1,76 +0,0 @@
/* hard-locale.c -- Determine whether a locale is hard.
Copyright (C) 1997, 1998, 1999, 2002, 2003, 2004 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. */
/* $FreeBSD$ */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "hard-locale.h"
#if HAVE_LOCALE_H
# include <locale.h>
#endif
#include <stdlib.h>
#include <string.h>
/* Return true if the current CATEGORY locale is hard, i.e. if you
can't get away with assuming traditional C or POSIX behavior. */
bool
hard_locale (int category)
{
#if ! HAVE_SETLOCALE
return false;
#else
bool hard = true;
char const *p = setlocale (category, NULL);
if (p)
{
# if defined(__FreeBSD__) || (defined __GLIBC__ && 2 <= __GLIBC__)
if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0)
hard = false;
# else
char *locale = malloc (strlen (p) + 1);
if (locale)
{
strcpy (locale, p);
/* Temporarily set the locale to the "C" and "POSIX" locales
to find their names, so that we can determine whether one
or the other is the caller's locale. */
if (((p = setlocale (category, "C"))
&& strcmp (p, locale) == 0)
|| ((p = setlocale (category, "POSIX"))
&& strcmp (p, locale) == 0))
hard = false;
/* Restore the caller's locale. */
setlocale (category, locale);
free (locale);
}
# endif
}
return hard;
#endif
}

View File

@ -1,26 +0,0 @@
/* Determine whether a locale is hard.
Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef HARD_LOCALE_H_
# define HARD_LOCALE_H_ 1
# include <stdbool.h>
bool hard_locale (int);
#endif /* HARD_LOCALE_H_ */

View File

@ -1,485 +0,0 @@
/* human.c -- print human readable file size
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
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 and Larry McVoy. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "human.h"
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
#endif
#ifndef UINTMAX_MAX
# define UINTMAX_MAX ((uintmax_t) -1)
#endif
#if HAVE_LOCALE_H && HAVE_LOCALECONV
# include <locale.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include <argmatch.h>
#include <error.h>
#include <xstrtol.h>
/* The maximum length of a suffix like "KiB". */
#define HUMAN_READABLE_SUFFIX_LENGTH_MAX 3
static const char power_letter[] =
{
0, /* not used */
'K', /* kibi ('k' for kilo is a special case) */
'M', /* mega or mebi */
'G', /* giga or gibi */
'T', /* tera or tebi */
'P', /* peta or pebi */
'E', /* exa or exbi */
'Z', /* zetta or 2**70 */
'Y' /* yotta or 2**80 */
};
/* If INEXACT_STYLE is not human_round_to_nearest, and if easily
possible, adjust VALUE according to the style. */
static long double
adjust_value (int inexact_style, long double value)
{
/* Do not use the floorl or ceill functions, as that would mean
checking for their presence and possibly linking with the
standard math library, which is a porting pain. So leave the
value alone if it is too large to easily round. */
if (inexact_style != human_round_to_nearest && value < UINTMAX_MAX)
{
uintmax_t u = value;
value = u + (inexact_style == human_ceiling && u != value);
}
return value;
}
/* Group the digits of NUMBER according to the grouping rules of the
current locale. NUMBER contains NUMBERLEN digits. Modify the
bytes pointed to by NUMBER in place, subtracting 1 from NUMBER for
each byte inserted. Return the starting address of the modified
number.
To group the digits, use GROUPING and THOUSANDS_SEP as in `struct
lconv' from <locale.h>. */
static char *
group_number (char *number, size_t numberlen,
char const *grouping, char const *thousands_sep)
{
register char *d;
size_t grouplen = SIZE_MAX;
size_t thousands_seplen = strlen (thousands_sep);
size_t i = numberlen;
/* The maximum possible value for NUMBERLEN is the number of digits
in the square of the largest uintmax_t, so double the size of
uintmax_t before converting to a bound. 302 / 1000 is ceil
(log10 (2.0)). Add 1 for integer division truncation. */
char buf[2 * sizeof (uintmax_t) * CHAR_BIT * 302 / 1000 + 1];
memcpy (buf, number, numberlen);
d = number + numberlen;
for (;;)
{
unsigned char g = *grouping;
if (g)
{
grouplen = g < CHAR_MAX ? g : i;
grouping++;
}
if (i < grouplen)
grouplen = i;
d -= grouplen;
i -= grouplen;
memcpy (d, buf + i, grouplen);
if (i == 0)
return d;
d -= thousands_seplen;
memcpy (d, thousands_sep, thousands_seplen);
}
}
/* Convert N to a human readable format in BUF, using the options OPTS.
N is expressed in units of FROM_BLOCK_SIZE. FROM_BLOCK_SIZE must
be nonnegative.
Use units of TO_BLOCK_SIZE in the output number. TO_BLOCK_SIZE
must be positive.
Use (OPTS & (human_round_to_nearest | human_floor | human_ceiling))
to determine whether to take the ceiling or floor of any result
that cannot be expressed exactly.
If (OPTS & human_group_digits), group the thousands digits
according to the locale, e.g., `1,000,000' in an American English
locale.
If (OPTS & human_autoscale), deduce the output block size
automatically; TO_BLOCK_SIZE must be 1 but it has no effect on the
output. Use powers of 1024 if (OPTS & human_base_1024), and powers
of 1000 otherwise. For example, assuming powers of 1024, 8500
would be converted to 8.3, 133456345 to 127, 56990456345 to 53, and
so on. Numbers smaller than the power aren't modified.
human_autoscale is normally used together with human_SI.
If (OPTS & human_SI), append an SI prefix indicating which power is
being used. If in addition (OPTS & human_B), append "B" (if base
1000) or "iB" (if base 1024) to the SI prefix. When ((OPTS &
human_SI) && ! (OPTS & human_autoscale)), TO_BLOCK_SIZE must be a
power of 1024 or of 1000, depending on (OPTS &
human_base_1024). */
char *
human_readable (uintmax_t n, char *buf, int opts,
uintmax_t from_block_size, uintmax_t to_block_size)
{
int inexact_style =
opts & (human_round_to_nearest | human_floor | human_ceiling);
unsigned int base = opts & human_base_1024 ? 1024 : 1000;
uintmax_t amt;
int tenths;
int exponent = -1;
int exponent_max = sizeof power_letter - 1;
char *p;
char *psuffix;
char const *integerlim;
/* 0 means adjusted N == AMT.TENTHS;
1 means AMT.TENTHS < adjusted N < AMT.TENTHS + 0.05;
2 means adjusted N == AMT.TENTHS + 0.05;
3 means AMT.TENTHS + 0.05 < adjusted N < AMT.TENTHS + 0.1. */
int rounding;
char const *decimal_point = ".";
size_t decimal_pointlen = 1;
char const *grouping = "";
char const *thousands_sep = "";
#if HAVE_LOCALE_H && HAVE_LOCALECONV
struct lconv const *l = localeconv ();
size_t pointlen = strlen (l->decimal_point);
if (0 < pointlen && pointlen <= MB_LEN_MAX)
{
decimal_point = l->decimal_point;
decimal_pointlen = pointlen;
}
grouping = l->grouping;
if (strlen (l->thousands_sep) <= MB_LEN_MAX)
thousands_sep = l->thousands_sep;
#endif
psuffix = buf + LONGEST_HUMAN_READABLE - HUMAN_READABLE_SUFFIX_LENGTH_MAX;
p = psuffix;
/* Adjust AMT out of FROM_BLOCK_SIZE units and into TO_BLOCK_SIZE
units. If this can be done exactly with integer arithmetic, do
not use floating point operations. */
if (to_block_size <= from_block_size)
{
if (from_block_size % to_block_size == 0)
{
uintmax_t multiplier = from_block_size / to_block_size;
amt = n * multiplier;
if (amt / multiplier == n)
{
tenths = 0;
rounding = 0;
goto use_integer_arithmetic;
}
}
}
else if (from_block_size != 0 && to_block_size % from_block_size == 0)
{
uintmax_t divisor = to_block_size / from_block_size;
uintmax_t r10 = (n % divisor) * 10;
uintmax_t r2 = (r10 % divisor) * 2;
amt = n / divisor;
tenths = r10 / divisor;
rounding = r2 < divisor ? 0 < r2 : 2 + (divisor < r2);
goto use_integer_arithmetic;
}
{
/* Either the result cannot be computed easily using uintmax_t,
or from_block_size is zero. Fall back on floating point.
FIXME: This can yield answers that are slightly off. */
long double dto_block_size = to_block_size;
long double damt = n * (from_block_size / dto_block_size);
size_t buflen;
size_t nonintegerlen;
if (! (opts & human_autoscale))
{
sprintf (buf, "%.0Lf", adjust_value (inexact_style, damt));
buflen = strlen (buf);
nonintegerlen = 0;
}
else
{
long double e = 1;
exponent = 0;
do
{
e *= base;
exponent++;
}
while (e * base <= damt && exponent < exponent_max);
damt /= e;
sprintf (buf, "%.1Lf", adjust_value (inexact_style, damt));
buflen = strlen (buf);
nonintegerlen = decimal_pointlen + 1;
if (1 + nonintegerlen + ! (opts & human_base_1024) < buflen
|| ((opts & human_suppress_point_zero)
&& buf[buflen - 1] == '0'))
{
sprintf (buf, "%.0Lf",
adjust_value (inexact_style, damt * 10) / 10);
buflen = strlen (buf);
nonintegerlen = 0;
}
}
p = psuffix - buflen;
memmove (p, buf, buflen);
integerlim = p + buflen - nonintegerlen;
}
goto do_grouping;
use_integer_arithmetic:
{
/* The computation can be done exactly, with integer arithmetic.
Use power of BASE notation if requested and if adjusted AMT is
large enough. */
if (opts & human_autoscale)
{
exponent = 0;
if (base <= amt)
{
do
{
unsigned int r10 = (amt % base) * 10 + tenths;
unsigned int r2 = (r10 % base) * 2 + (rounding >> 1);
amt /= base;
tenths = r10 / base;
rounding = (r2 < base
? (r2 + rounding) != 0
: 2 + (base < r2 + rounding));
exponent++;
}
while (base <= amt && exponent < exponent_max);
if (amt < 10)
{
if (inexact_style == human_round_to_nearest
? 2 < rounding + (tenths & 1)
: inexact_style == human_ceiling && 0 < rounding)
{
tenths++;
rounding = 0;
if (tenths == 10)
{
amt++;
tenths = 0;
}
}
if (amt < 10
&& (tenths || ! (opts & human_suppress_point_zero)))
{
*--p = '0' + tenths;
p -= decimal_pointlen;
memcpy (p, decimal_point, decimal_pointlen);
tenths = rounding = 0;
}
}
}
}
if (inexact_style == human_round_to_nearest
? 5 < tenths + (0 < rounding + (amt & 1))
: inexact_style == human_ceiling && 0 < tenths + rounding)
{
amt++;
if ((opts & human_autoscale)
&& amt == base && exponent < exponent_max)
{
exponent++;
if (! (opts & human_suppress_point_zero))
{
*--p = '0';
p -= decimal_pointlen;
memcpy (p, decimal_point, decimal_pointlen);
}
amt = 1;
}
}
integerlim = p;
do
{
int digit = amt % 10;
*--p = digit + '0';
}
while ((amt /= 10) != 0);
}
do_grouping:
if (opts & human_group_digits)
p = group_number (p, integerlim - p, grouping, thousands_sep);
if (opts & human_SI)
{
if (exponent < 0)
{
uintmax_t power;
exponent = 0;
for (power = 1; power < to_block_size; power *= base)
if (++exponent == exponent_max)
break;
}
if (exponent)
*psuffix++ = (! (opts & human_base_1024) && exponent == 1
? 'k'
: power_letter[exponent]);
if (opts & human_B)
{
if ((opts & human_base_1024) && exponent)
*psuffix++ = 'i';
*psuffix++ = 'B';
}
}
*psuffix = '\0';
return p;
}
/* The default block size used for output. This number may change in
the future as disks get larger. */
#ifndef DEFAULT_BLOCK_SIZE
# define DEFAULT_BLOCK_SIZE 1024
#endif
static char const *const block_size_args[] = { "human-readable", "si", 0 };
static int const block_size_opts[] =
{
human_autoscale + human_SI + human_base_1024,
human_autoscale + human_SI
};
static uintmax_t
default_block_size (void)
{
return getenv ("POSIXLY_CORRECT") ? 512 : DEFAULT_BLOCK_SIZE;
}
static strtol_error
humblock (char const *spec, uintmax_t *block_size, int *options)
{
int i;
int opts = 0;
if (! spec
&& ! (spec = getenv ("BLOCK_SIZE"))
&& ! (spec = getenv ("BLOCKSIZE")))
*block_size = default_block_size ();
else
{
if (*spec == '\'')
{
opts |= human_group_digits;
spec++;
}
if (0 <= (i = ARGMATCH (spec, block_size_args, block_size_opts)))
{
opts |= block_size_opts[i];
*block_size = 1;
}
else
{
char *ptr;
strtol_error e = xstrtoumax (spec, &ptr, 0, block_size,
"eEgGkKmMpPtTyYzZ0");
if (e != LONGINT_OK)
return e;
for (; ! ('0' <= *spec && *spec <= '9'); spec++)
if (spec == ptr)
{
opts |= human_SI;
if (ptr[-1] == 'B')
opts |= human_B;
if (ptr[-1] != 'B' || ptr[-2] == 'i')
opts |= human_base_1024;
break;
}
}
}
*options = opts;
return LONGINT_OK;
}
int
human_options (char const *spec, bool report_errors, uintmax_t *block_size)
{
int opts;
strtol_error e = humblock (spec, block_size, &opts);
if (*block_size == 0)
{
*block_size = default_block_size ();
e = LONGINT_INVALID;
}
if (e != LONGINT_OK && report_errors)
STRTOL_FATAL_ERROR (spec, _("block size"), e);
return opts;
}

View File

@ -1,88 +0,0 @@
/* human.h -- print human readable file size
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
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 and Larry McVoy. */
#ifndef HUMAN_H_
# define HUMAN_H_ 1
# if HAVE_CONFIG_H
# include <config.h>
# endif
# include <limits.h>
# include <stdbool.h>
# if HAVE_STDINT_H
# include <stdint.h>
# endif
# if HAVE_UNISTD_H
# include <unistd.h>
# endif
/* A conservative bound on the maximum length of a human-readable string.
The output can be the square of the largest uintmax_t, so double
its size before converting to a bound.
302 / 1000 is ceil (log10 (2.0)). Add 1 for integer division truncation.
Also, the output can have a thousands separator between every digit,
so multiply by MB_LEN_MAX + 1 and then subtract MB_LEN_MAX.
Finally, append 3, the maximum length of a suffix. */
# define LONGEST_HUMAN_READABLE \
((2 * sizeof (uintmax_t) * CHAR_BIT * 302 / 1000 + 1) * (MB_LEN_MAX + 1) \
- MB_LEN_MAX + 3)
/* Options for human_readable. */
enum
{
/* Unless otherwise specified these options may be ORed together. */
/* The following three options are mutually exclusive. */
/* Round to plus infinity (default). */
human_ceiling = 0,
/* Round to nearest, ties to even. */
human_round_to_nearest = 1,
/* Round to minus infinity. */
human_floor = 2,
/* Group digits together, e.g. `1,000,000'. This uses the
locale-defined grouping; the traditional C locale does not group,
so this has effect only if some other locale is in use. */
human_group_digits = 4,
/* When autoscaling, suppress ".0" at end. */
human_suppress_point_zero = 8,
/* Scale output and use SI-style units, ignoring the output block size. */
human_autoscale = 16,
/* Prefer base 1024 to base 1000. */
human_base_1024 = 32,
/* Append SI prefix, e.g. "k" or "M". */
human_SI = 64,
/* Append "B" (if base 1000) or "iB" (if base 1024) to SI prefix. */
human_B = 128
};
char *human_readable (uintmax_t, char *, int, uintmax_t, uintmax_t);
int human_options (char const *, bool, uintmax_t *);
#endif /* HUMAN_H_ */

View File

@ -1,49 +0,0 @@
/* inttostr.c -- convert integers to printable strings
Copyright (C) 2001 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 */
#include "inttostr.h"
/* Convert I to a printable string in BUF, which must be at least
INT_BUFSIZE_BOUND (INTTYPE) bytes long. Return the address of the
printable string, which need not start at BUF. */
char *
inttostr (inttype i, char *buf)
{
char *p = buf + INT_STRLEN_BOUND (inttype);
*p = 0;
if (i < 0)
{
do
*--p = '0' - i % 10;
while ((i /= 10) != 0);
*--p = '-';
}
else
{
do
*--p = '0' + i % 10;
while ((i /= 10) != 0);
}
return p;
}

View File

@ -1,47 +0,0 @@
/* inttostr.h -- convert integers to printable strings
Copyright (C) 2001, 2002, 2003, 2004 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 */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_STDINT_H
# include <stdint.h>
#endif
#include <limits.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
/* Upper bound on the string length of an integer converted to string.
302 / 1000 is ceil (log10 (2.0)). Subtract 1 for the sign bit;
add 1 for integer division truncation; add 1 more for a minus sign. */
#define INT_STRLEN_BOUND(t) ((sizeof (t) * CHAR_BIT - 1) * 302 / 1000 + 2)
#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
char *offtostr (off_t, char *);
char *imaxtostr (intmax_t, char *);
char *umaxtostr (uintmax_t, char *);

View File

@ -1,91 +0,0 @@
/* Utility to accept --help and --version options as unobtrusively as possible.
Copyright (C) 1993, 1994, 1998, 1999, 2000, 2002, 2003, 2004 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. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
/* Specification. */
#include "long-options.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include "version-etc.h"
static struct option const long_options[] =
{
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'v'},
{0, 0, 0, 0}
};
/* Process long options --help and --version, but only if argc == 2.
Be careful not to gobble up `--'. */
void
parse_long_options (int argc,
char **argv,
const char *command_name,
const char *package,
const char *version,
void (*usage_func) (int),
/* const char *author1, ...*/ ...)
{
int c;
int saved_opterr;
saved_opterr = opterr;
/* Don't print an error message for unrecognized options. */
opterr = 0;
if (argc == 2
&& (c = getopt_long (argc, argv, "+", long_options, NULL)) != -1)
{
switch (c)
{
case 'h':
(*usage_func) (EXIT_SUCCESS);
case 'v':
{
va_list authors;
va_start (authors, usage_func);
version_etc_va (stdout, command_name, package, version, authors);
exit (0);
}
default:
/* Don't process any other long-named options. */
break;
}
}
/* Restore previous value. */
opterr = saved_opterr;
/* Reset this to zero so that getopt internals get initialized from
the probably-new parameters when/if getopt is called later. */
optind = 0;
}

View File

@ -1,26 +0,0 @@
/* long-options.h -- declaration for --help- and --version-handling function.
Copyright (C) 1993, 1994, 1998, 1999, 2003 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. */
void parse_long_options (int _argc,
char **_argv,
const char *_command_name,
const char *_package,
const char *_version,
void (*_usage) (int),
/* const char *author1, ...*/ ...);

View File

@ -1,85 +0,0 @@
/* Locale-specific memory comparison.
Copyright (C) 1999, 2002, 2003, 2004 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. */
/* Contributed by Paul Eggert <eggert@twinsun.com>. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "memcoll.h"
#include <errno.h>
#include <string.h>
/* Compare S1 (with length S1LEN) and S2 (with length S2LEN) according
to the LC_COLLATE locale. S1 and S2 do not overlap, and are not
adjacent. Perhaps temporarily modify the bytes after S1 and S2,
but restore their original contents before returning. Set errno to an
error number if there is an error, and to zero otherwise. */
int
memcoll (char *s1, size_t s1len, char *s2, size_t s2len)
{
int diff;
#if HAVE_STRCOLL
char n1 = s1[s1len];
char n2 = s2[s2len];
s1[s1len++] = '\0';
s2[s2len++] = '\0';
while (! (errno = 0, (diff = strcoll (s1, s2)) || errno))
{
/* strcoll found no difference, but perhaps it was fooled by NUL
characters in the data. Work around this problem by advancing
past the NUL chars. */
size_t size1 = strlen (s1) + 1;
size_t size2 = strlen (s2) + 1;
s1 += size1;
s2 += size2;
s1len -= size1;
s2len -= size2;
if (s1len == 0)
{
if (s2len != 0)
diff = -1;
break;
}
else if (s2len == 0)
{
diff = 1;
break;
}
}
s1[s1len - 1] = n1;
s2[s2len - 1] = n2;
#else
diff = memcmp (s1, s2, s1len < s2len ? s1len : s2len);
if (! diff)
diff = s1len < s2len ? -1 : s1len != s2len;
errno = 0;
#endif
return diff;
}

View File

@ -1,28 +0,0 @@
/* Locale-specific memory comparison.
Copyright (C) 1999, 2003 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. */
/* Contributed by Paul Eggert <eggert@twinsun.com>. */
#ifndef MEMCOLL_H_
# define MEMCOLL_H_ 1
# include <stddef.h>
int memcoll (char *, size_t, char *, size_t);
#endif /* MEMCOLL_H_ */

View File

@ -1,54 +0,0 @@
/* Define PATH_MAX somehow. Requires sys/types.h.
Copyright (C) 1992, 1999, 2001, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _PATHMAX_H
# define _PATHMAX_H
# if HAVE_UNISTD_H
# include <unistd.h>
# endif
/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
PATH_MAX but might cause redefinition warnings when sys/param.h is
later included (as on MORE/BSD 4.3). */
# if defined _POSIX_VERSION || !defined __GNUC__
# include <limits.h>
# endif
# ifndef _POSIX_PATH_MAX
# define _POSIX_PATH_MAX 255
# endif
# if !defined PATH_MAX && defined _PC_PATH_MAX
# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 \
: pathconf ("/", _PC_PATH_MAX))
# endif
/* Don't include sys/param.h if it already has been. */
# if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
# include <sys/param.h>
# endif
# if !defined PATH_MAX && defined MAXPATHLEN
# define PATH_MAX MAXPATHLEN
# endif
# ifndef PATH_MAX
# define PATH_MAX _POSIX_PATH_MAX
# endif
#endif /* _PATHMAX_H */

View File

@ -1,307 +0,0 @@
/* Calculate the size of physical memory.
Copyright (C) 2000, 2001, 2003 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. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "physmem.h"
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#if HAVE_SYS_PSTAT_H
# include <sys/pstat.h>
#endif
#if HAVE_SYS_SYSMP_H
# include <sys/sysmp.h>
#endif
#if HAVE_SYS_SYSINFO_H && HAVE_MACHINE_HAL_SYSINFO_H
# include <sys/sysinfo.h>
# include <machine/hal_sysinfo.h>
#endif
#if HAVE_SYS_TABLE_H
# include <sys/table.h>
#endif
#include <sys/types.h>
#if HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#if HAVE_SYS_SYSCTL_H
# include <sys/sysctl.h>
#endif
#if HAVE_SYS_SYSTEMCFG_H
# include <sys/systemcfg.h>
#endif
#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
/* MEMORYSTATUSEX is missing from older windows headers, so define
a local replacement. */
typedef struct
{
DWORD dwLength;
DWORD dwMemoryLoad;
DWORDLONG ullTotalPhys;
DWORDLONG ullAvailPhys;
DWORDLONG ullTotalPageFile;
DWORDLONG ullAvailPageFile;
DWORDLONG ullTotalVirtual;
DWORDLONG ullAvailVirtual;
DWORDLONG ullAvailExtendedVirtual;
} lMEMORYSTATUSEX;
typedef WINBOOL (WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*);
#endif
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
/* Return the total amount of physical memory. */
double
physmem_total (void)
{
#if defined _SC_PHYS_PAGES && defined _SC_PAGESIZE
{ /* This works on linux-gnu, solaris2 and cygwin. */
double pages = sysconf (_SC_PHYS_PAGES);
double pagesize = sysconf (_SC_PAGESIZE);
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
}
#endif
#if HAVE_PSTAT_GETSTATIC
{ /* This works on hpux11. */
struct pst_static pss;
if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0))
{
double pages = pss.physical_memory;
double pagesize = pss.page_size;
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
}
}
#endif
#if HAVE_SYSMP && defined MP_SAGET && defined MPSA_RMINFO && defined _SC_PAGESIZE
{ /* This works on irix6. */
struct rminfo realmem;
if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
{
double pagesize = sysconf (_SC_PAGESIZE);
double pages = realmem.physmem;
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
}
}
#endif
#if HAVE_GETSYSINFO && defined GSI_PHYSMEM
{ /* This works on Tru64 UNIX V4/5. */
int physmem;
if (getsysinfo (GSI_PHYSMEM, (caddr_t) &physmem, sizeof (physmem),
NULL, NULL, NULL) == 1)
{
double kbytes = physmem;
if (0 <= kbytes)
return kbytes * 1024.0;
}
}
#endif
#if HAVE_SYSCTL && defined HW_PHYSMEM
{ /* This works on *bsd and darwin. */
unsigned int physmem;
size_t len = sizeof physmem;
static int mib[2] = { CTL_HW, HW_PHYSMEM };
if (sysctl (mib, ARRAY_SIZE (mib), &physmem, &len, NULL, 0) == 0
&& len == sizeof (physmem))
return (double) physmem;
}
#endif
#if HAVE__SYSTEM_CONFIGURATION
/* This works on AIX. */
return _system_configuration.physmem;
#endif
#if defined _WIN32
{ /* this works on windows */
PFN_MS_EX pfnex;
HMODULE h = GetModuleHandle ("kernel32.dll");
if (!h)
return 0.0;
/* Use GlobalMemoryStatusEx if available. */
if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
{
lMEMORYSTATUSEX lms_ex;
lms_ex.dwLength = sizeof lms_ex;
if (!pfnex (&lms_ex))
return 0.0;
return (double) lms_ex.ullTotalPhys;
}
/* Fall back to GlobalMemoryStatus which is always available.
but returns wrong results for physical memory > 4GB. */
else
{
MEMORYSTATUS ms;
GlobalMemoryStatus (&ms);
return (double) ms.dwTotalPhys;
}
}
#endif
/* Guess 64 MB. It's probably an older host, so guess small. */
return 64 * 1024 * 1024;
}
/* Return the amount of physical memory available. */
double
physmem_available (void)
{
#if defined _SC_AVPHYS_PAGES && defined _SC_PAGESIZE
{ /* This works on linux-gnu, solaris2 and cygwin. */
double pages = sysconf (_SC_AVPHYS_PAGES);
double pagesize = sysconf (_SC_PAGESIZE);
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
}
#endif
#if HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC
{ /* This works on hpux11. */
struct pst_static pss;
struct pst_dynamic psd;
if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0)
&& 0 <= pstat_getdynamic (&psd, sizeof psd, 1, 0))
{
double pages = psd.psd_free;
double pagesize = pss.page_size;
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
}
}
#endif
#if HAVE_SYSMP && defined MP_SAGET && defined MPSA_RMINFO && defined _SC_PAGESIZE
{ /* This works on irix6. */
struct rminfo realmem;
if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
{
double pagesize = sysconf (_SC_PAGESIZE);
double pages = realmem.availrmem;
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
}
}
#endif
#if HAVE_TABLE && defined TBL_VMSTATS
{ /* This works on Tru64 UNIX V4/5. */
struct tbl_vmstats vmstats;
if (table (TBL_VMSTATS, 0, &vmstats, 1, sizeof (vmstats)) == 1)
{
double pages = vmstats.free_count;
double pagesize = vmstats.pagesize;
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
}
}
#endif
#if HAVE_SYSCTL && defined HW_USERMEM
{ /* This works on *bsd and darwin. */
unsigned int usermem;
size_t len = sizeof usermem;
static int mib[2] = { CTL_HW, HW_USERMEM };
if (sysctl (mib, ARRAY_SIZE (mib), &usermem, &len, NULL, 0) == 0
&& len == sizeof (usermem))
return (double) usermem;
}
#endif
#if defined _WIN32
{ /* this works on windows */
PFN_MS_EX pfnex;
HMODULE h = GetModuleHandle ("kernel32.dll");
if (!h)
return 0.0;
/* Use GlobalMemoryStatusEx if available. */
if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
{
lMEMORYSTATUSEX lms_ex;
lms_ex.dwLength = sizeof lms_ex;
if (!pfnex (&lms_ex))
return 0.0;
return (double) lms_ex.ullAvailPhys;
}
/* Fall back to GlobalMemoryStatus which is always available.
but returns wrong results for physical memory > 4GB */
else
{
MEMORYSTATUS ms;
GlobalMemoryStatus (&ms);
return (double) ms.dwAvailPhys;
}
}
#endif
/* Guess 25% of physical memory. */
return physmem_total () / 4;
}
#if DEBUG
# include <stdio.h>
# include <stdlib.h>
int
main (void)
{
printf ("%12.f %12.f\n", physmem_total (), physmem_available ());
exit (0);
}
#endif /* DEBUG */
/*
Local Variables:
compile-command: "gcc -DDEBUG -DHAVE_CONFIG_H -I.. -g -O -Wall -W physmem.c"
End:
*/

View File

@ -1,27 +0,0 @@
/* Calculate the size of physical memory.
Copyright (C) 2000, 2003 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. */
#ifndef PHYSMEM_H_
# define PHYSMEM_H_ 1
double physmem_total (void);
double physmem_available (void);
#endif /* PHYSMEM_H_ */

View File

@ -1,59 +0,0 @@
/* Which POSIX version to conform to, for utilities.
Copyright (C) 2002, 2003, 2004 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. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "posixver.h"
#include <limits.h>
#include <stdlib.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifndef _POSIX2_VERSION
# define _POSIX2_VERSION 0
#endif
#ifndef DEFAULT_POSIX2_VERSION
# define DEFAULT_POSIX2_VERSION _POSIX2_VERSION
#endif
/* The POSIX version that utilities should conform to. The default is
specified by the system. */
int
posix2_version (void)
{
long int v = DEFAULT_POSIX2_VERSION;
char const *s = getenv ("_POSIX2_VERSION");
if (s && *s)
{
char *e;
long int i = strtol (s, &e, 10);
if (! *e)
v = i;
}
return v < INT_MIN ? INT_MIN : v < INT_MAX ? v : INT_MAX;
}

View File

@ -1 +0,0 @@
int posix2_version (void);

View File

@ -1,41 +0,0 @@
/* quote.c - quote arguments for output
Copyright (C) 1998, 1999, 2000, 2001, 2003 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 "quotearg.h"
#include "quote.h"
/* Return an unambiguous printable representation of NAME,
allocated in slot N, suitable for diagnostics. */
char const *
quote_n (int n, char const *name)
{
return quotearg_n_style (n, locale_quoting_style, name);
}
/* Return an unambiguous printable representation of NAME,
suitable for diagnostics. */
char const *
quote (char const *name)
{
return quote_n (0, name);
}

View File

@ -1,22 +0,0 @@
/* quote.h - prototypes for quote.c
Copyright (C) 1998, 1999, 2000, 2001, 2003 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. */
char const *quote_n (int n, char const *name);
char const *quote (char const *name);

View File

@ -1,673 +0,0 @@
/* quotearg.c - quote arguments for output
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 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 "quotearg.h"
#include "xalloc.h"
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
#if HAVE_WCHAR_H
/* BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared. */
# include <stdio.h>
# include <time.h>
# include <wchar.h>
#endif
#if !HAVE_MBRTOWC
/* Disable multibyte processing entirely. Since MB_CUR_MAX is 1, the
other macros are defined only for documentation and to satisfy C
syntax. */
# undef MB_CUR_MAX
# define MB_CUR_MAX 1
# define mbrtowc(pwc, s, n, ps) ((*(pwc) = *(s)) != 0)
# define iswprint(wc) isprint ((unsigned char) (wc))
# undef HAVE_MBSINIT
#endif
#if !defined mbsinit && !HAVE_MBSINIT
# define mbsinit(ps) 1
#endif
#ifndef iswprint
# if HAVE_WCTYPE_H
# include <wctype.h>
# endif
# if !defined iswprint && !HAVE_ISWPRINT
# define iswprint(wc) 1
# endif
#endif
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
#endif
#define INT_BITS (sizeof (int) * CHAR_BIT)
struct quoting_options
{
/* Basic quoting style. */
enum quoting_style style;
/* Quote the characters indicated by this bit vector even if the
quoting style would not normally require them to be quoted. */
int quote_these_too[(UCHAR_MAX / INT_BITS) + 1];
};
/* Names of quoting styles. */
char const *const quoting_style_args[] =
{
"literal",
"shell",
"shell-always",
"c",
"escape",
"locale",
"clocale",
0
};
/* Correspondences to quoting style names. */
enum quoting_style const quoting_style_vals[] =
{
literal_quoting_style,
shell_quoting_style,
shell_always_quoting_style,
c_quoting_style,
escape_quoting_style,
locale_quoting_style,
clocale_quoting_style
};
/* 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)
{
int e = errno;
struct quoting_options *p = xmalloc (sizeof *p);
*p = *(o ? o : &default_quoting_options);
errno = e;
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;
}
/* MSGID approximates a quotation mark. Return its translation if it
has one; otherwise, return either it or "\"", depending on S. */
static char const *
gettext_quote (char const *msgid, enum quoting_style s)
{
char const *translation = _(msgid);
if (translation == msgid && s == clocale_quoting_style)
translation = "\"";
return translation;
}
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
argument ARG (of size ARGSIZE), using QUOTING_STYLE and the
non-quoting-style part of O to control quoting.
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 SIZE_MAX, use the string length of the argument for ARGSIZE.
This function acts like quotearg_buffer (BUFFER, BUFFERSIZE, ARG,
ARGSIZE, O), except it uses QUOTING_STYLE instead of the quoting
style specified by O, and O may not be null. */
static size_t
quotearg_buffer_restyled (char *buffer, size_t buffersize,
char const *arg, size_t argsize,
enum quoting_style quoting_style,
struct quoting_options const *o)
{
size_t i;
size_t len = 0;
char const *quote_string = 0;
size_t quote_string_len = 0;
bool backslash_escapes = false;
bool unibyte_locale = MB_CUR_MAX == 1;
#define STORE(c) \
do \
{ \
if (len < buffersize) \
buffer[len] = (c); \
len++; \
} \
while (0)
switch (quoting_style)
{
case c_quoting_style:
STORE ('"');
backslash_escapes = true;
quote_string = "\"";
quote_string_len = 1;
break;
case escape_quoting_style:
backslash_escapes = true;
break;
case locale_quoting_style:
case clocale_quoting_style:
{
/* Get translations for open and closing quotation marks.
The message catalog should translate "`" to a left
quotation mark suitable for the locale, and similarly for
"'". If the catalog has no translation,
locale_quoting_style quotes `like this', and
clocale_quoting_style quotes "like this".
For example, an American English Unicode locale should
translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and
should translate "'" to U+201D (RIGHT DOUBLE QUOTATION
MARK). A British English Unicode locale should instead
translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. */
char const *left = gettext_quote (N_("`"), quoting_style);
char const *right = gettext_quote (N_("'"), quoting_style);
for (quote_string = left; *quote_string; quote_string++)
STORE (*quote_string);
backslash_escapes = true;
quote_string = right;
quote_string_len = strlen (quote_string);
}
break;
case shell_always_quoting_style:
STORE ('\'');
quote_string = "'";
quote_string_len = 1;
break;
default:
break;
}
for (i = 0; ! (argsize == SIZE_MAX ? arg[i] == '\0' : i == argsize); i++)
{
unsigned char c;
unsigned char esc;
if (backslash_escapes
&& quote_string_len
&& i + quote_string_len <= argsize
&& memcmp (arg + i, quote_string, quote_string_len) == 0)
STORE ('\\');
c = arg[i];
switch (c)
{
case '\0':
if (backslash_escapes)
{
STORE ('\\');
STORE ('0');
STORE ('0');
c = '0';
}
break;
case '?':
switch (quoting_style)
{
case shell_quoting_style:
goto use_shell_always_quoting_style;
case c_quoting_style:
if (i + 2 < argsize && arg[i + 1] == '?')
switch (arg[i + 2])
{
case '!': case '\'':
case '(': case ')': case '-': case '/':
case '<': case '=': case '>':
/* Escape the second '?' in what would otherwise be
a trigraph. */
c = arg[i + 2];
i += 2;
STORE ('?');
STORE ('\\');
STORE ('?');
break;
}
break;
default:
break;
}
break;
case '\a': esc = 'a'; goto c_escape;
case '\b': esc = 'b'; goto c_escape;
case '\f': esc = 'f'; goto c_escape;
case '\n': esc = 'n'; goto c_and_shell_escape;
case '\r': esc = 'r'; goto c_and_shell_escape;
case '\t': esc = 't'; goto c_and_shell_escape;
case '\v': esc = 'v'; goto c_escape;
case '\\': esc = c; goto c_and_shell_escape;
c_and_shell_escape:
if (quoting_style == shell_quoting_style)
goto use_shell_always_quoting_style;
c_escape:
if (backslash_escapes)
{
c = esc;
goto store_escape;
}
break;
case '{': case '}': /* sometimes special if isolated */
if (! (argsize == SIZE_MAX ? arg[1] == '\0' : argsize == 1))
break;
/* Fall through. */
case '#': case '~':
if (i != 0)
break;
/* Fall through. */
case ' ':
case '!': /* special in bash */
case '"': case '$': case '&':
case '(': case ')': case '*': case ';':
case '<':
case '=': /* sometimes special in 0th or (with "set -k") later args */
case '>': case '[':
case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */
case '`': case '|':
/* A shell special character. In theory, '$' and '`' could
be the first bytes of multibyte characters, which means
we should check them with mbrtowc, but in practice this
doesn't happen so it's not worth worrying about. */
if (quoting_style == shell_quoting_style)
goto use_shell_always_quoting_style;
break;
case '\'':
switch (quoting_style)
{
case shell_quoting_style:
goto use_shell_always_quoting_style;
case shell_always_quoting_style:
STORE ('\'');
STORE ('\\');
STORE ('\'');
break;
default:
break;
}
break;
case '%': case '+': case ',': case '-': case '.': case '/':
case '0': case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9': case ':':
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
case 'Y': case 'Z': case ']': case '_': case 'a': case 'b':
case 'c': case 'd': case 'e': case 'f': case 'g': case 'h':
case 'i': case 'j': case 'k': case 'l': case 'm': case 'n':
case 'o': case 'p': case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x': case 'y': case 'z':
/* These characters don't cause problems, no matter what the
quoting style is. They cannot start multibyte sequences. */
break;
default:
/* If we have a multibyte sequence, copy it until we reach
its end, find an error, or come back to the initial shift
state. For C-like styles, if the sequence has
unprintable characters, escape the whole sequence, since
we can't easily escape single characters within it. */
{
/* Length of multibyte sequence found so far. */
size_t m;
bool printable;
if (unibyte_locale)
{
m = 1;
printable = isprint (c) != 0;
}
else
{
mbstate_t mbstate;
memset (&mbstate, 0, sizeof mbstate);
m = 0;
printable = true;
if (argsize == SIZE_MAX)
argsize = strlen (arg);
do
{
wchar_t w;
size_t bytes = mbrtowc (&w, &arg[i + m],
argsize - (i + m), &mbstate);
if (bytes == 0)
break;
else if (bytes == (size_t) -1)
{
printable = false;
break;
}
else if (bytes == (size_t) -2)
{
printable = false;
while (i + m < argsize && arg[i + m])
m++;
break;
}
else
{
/* Work around a bug with older shells that "see" a '\'
that is really the 2nd byte of a multibyte character.
In practice the problem is limited to ASCII
chars >= '@' that are shell special chars. */
if ('[' == 0x5b && quoting_style == shell_quoting_style)
{
size_t j;
for (j = 1; j < bytes; j++)
switch (arg[i + m + j])
{
case '[': case '\\': case '^':
case '`': case '|':
goto use_shell_always_quoting_style;
}
}
if (! iswprint (w))
printable = false;
m += bytes;
}
}
while (! mbsinit (&mbstate));
}
if (1 < m || (backslash_escapes && ! printable))
{
/* Output a multibyte sequence, or an escaped
unprintable unibyte character. */
size_t ilim = i + m;
for (;;)
{
if (backslash_escapes && ! printable)
{
STORE ('\\');
STORE ('0' + (c >> 6));
STORE ('0' + ((c >> 3) & 7));
c = '0' + (c & 7);
}
if (ilim <= i + 1)
break;
STORE (c);
c = arg[++i];
}
goto store_c;
}
}
}
if (! (backslash_escapes
&& o->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS))))
goto store_c;
store_escape:
STORE ('\\');
store_c:
STORE (c);
}
if (i == 0 && quoting_style == shell_quoting_style)
goto use_shell_always_quoting_style;
if (quote_string)
for (; *quote_string; quote_string++)
STORE (*quote_string);
if (len < buffersize)
buffer[len] = '\0';
return len;
use_shell_always_quoting_style:
return quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
shell_always_quoting_style, o);
}
/* 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 SIZE_MAX, 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)
{
struct quoting_options const *p = o ? o : &default_quoting_options;
int e = errno;
size_t r = quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
p->style, p);
errno = e;
return r;
}
/* Like quotearg_buffer (..., ARG, ARGSIZE, O), except return newly
allocated storage containing the quoted string. */
char *
quotearg_alloc (char const *arg, size_t argsize,
struct quoting_options const *o)
{
int e = errno;
size_t bufsize = quotearg_buffer (0, 0, arg, argsize, o) + 1;
char *buf = xmalloc (bufsize);
quotearg_buffer (buf, bufsize, arg, argsize, o);
errno = e;
return buf;
}
/* Use storage slot N to return a quoted version of argument ARG.
ARG is of size ARGSIZE, but if that is SIZE_MAX, ARG is a
null-terminated string.
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. N is deliberately declared with type "int"
to allow for future extensions (using negative values). */
static char *
quotearg_n_options (int n, char const *arg, size_t argsize,
struct quoting_options const *options)
{
int e = errno;
/* Preallocate a slot 0 buffer, so that the caller can always quote
one small component of a "memory exhausted" message in slot 0. */
static char slot0[256];
static unsigned int nslots = 1;
unsigned int n0 = n;
struct slotvec
{
size_t size;
char *val;
};
static struct slotvec slotvec0 = {sizeof slot0, slot0};
static struct slotvec *slotvec = &slotvec0;
if (n < 0)
abort ();
if (nslots <= n0)
{
unsigned int n1 = n0 + 1;
if (xalloc_oversized (n1, sizeof *slotvec))
xalloc_die ();
if (slotvec == &slotvec0)
{
slotvec = xmalloc (sizeof *slotvec);
*slotvec = slotvec0;
}
slotvec = xrealloc (slotvec, n1 * sizeof *slotvec);
memset (slotvec + nslots, 0, (n1 - nslots) * sizeof *slotvec);
nslots = n1;
}
{
size_t size = slotvec[n].size;
char *val = slotvec[n].val;
size_t qsize = quotearg_buffer (val, size, arg, argsize, options);
if (size <= qsize)
{
slotvec[n].size = size = qsize + 1;
if (val != slot0)
free (val);
slotvec[n].val = val = xmalloc (size);
quotearg_buffer (val, size, arg, argsize, options);
}
errno = e;
return val;
}
}
char *
quotearg_n (int n, char const *arg)
{
return quotearg_n_options (n, arg, SIZE_MAX, &default_quoting_options);
}
char *
quotearg (char const *arg)
{
return quotearg_n (0, arg);
}
/* Return quoting options for STYLE, with no extra quoting. */
static struct quoting_options
quoting_options_from_style (enum quoting_style style)
{
struct quoting_options o;
o.style = style;
memset (o.quote_these_too, 0, sizeof o.quote_these_too);
return o;
}
char *
quotearg_n_style (int n, enum quoting_style s, char const *arg)
{
struct quoting_options const o = quoting_options_from_style (s);
return quotearg_n_options (n, arg, SIZE_MAX, &o);
}
char *
quotearg_n_style_mem (int n, enum quoting_style s,
char const *arg, size_t argsize)
{
struct quoting_options const o = quoting_options_from_style (s);
return quotearg_n_options (n, arg, argsize, &o);
}
char *
quotearg_style (enum quoting_style s, char const *arg)
{
return quotearg_n_style (0, s, 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, SIZE_MAX, &options);
}
char *
quotearg_colon (char const *arg)
{
return quotearg_char (arg, ':');
}

View File

@ -1,137 +0,0 @@
/* quotearg.h - quote arguments for output
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 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> */
#ifndef QUOTEARG_H_
# define QUOTEARG_H_ 1
# include <stddef.h>
/* Basic quoting styles. */
enum quoting_style
{
/* Output names as-is (ls --quoting-style=literal). */
literal_quoting_style,
/* Quote names for the shell if they contain shell metacharacters
or would cause ambiguous output (ls --quoting-style=shell). */
shell_quoting_style,
/* Quote names for the shell, even if they would normally not
require quoting (ls --quoting-style=shell-always). */
shell_always_quoting_style,
/* Quote names as for a C language string (ls --quoting-style=c). */
c_quoting_style,
/* Like c_quoting_style except omit the surrounding double-quote
characters (ls --quoting-style=escape). */
escape_quoting_style,
/* Like clocale_quoting_style, but quote `like this' instead of
"like this" in the default C locale (ls --quoting-style=locale). */
locale_quoting_style,
/* Like c_quoting_style except use quotation marks appropriate for
the locale (ls --quoting-style=clocale). */
clocale_quoting_style
};
/* For now, --quoting-style=literal is the default, but this may change. */
# ifndef DEFAULT_QUOTING_STYLE
# define DEFAULT_QUOTING_STYLE literal_quoting_style
# endif
/* Names of quoting styles and their corresponding values. */
extern char const *const quoting_style_args[];
extern enum quoting_style const quoting_style_vals[];
struct quoting_options;
/* 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 (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 (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 (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 (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 (char *buffer, size_t buffersize,
char const *arg, size_t argsize,
struct quoting_options const *o);
/* Like quotearg_buffer, except return the result in a newly allocated
buffer. It is the caller's responsibility to free the result. */
char *quotearg_alloc (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 (int n, char const *arg);
/* Equivalent to quotearg_n (0, ARG). */
char *quotearg (char const *arg);
/* Use style S and storage slot N to return a quoted version of the string ARG.
This is like quotearg_n (N, ARG), except that it uses S with no other
options to specify the quoting method. */
char *quotearg_n_style (int n, enum quoting_style s, char const *arg);
/* Use style S and storage slot N to return a quoted version of the
argument ARG of size ARGSIZE. This is like quotearg_n_style
(N, S, ARG), except it can quote null bytes. */
char *quotearg_n_style_mem (int n, enum quoting_style s,
char const *arg, size_t argsize);
/* Equivalent to quotearg_n_style (0, S, ARG). */
char *quotearg_style (enum quoting_style s, char const *arg);
/* Like quotearg (ARG), except also quote any instances of CH. */
char *quotearg_char (char const *arg, char ch);
/* Equivalent to quotearg_char (ARG, ':'). */
char *quotearg_colon (char const *arg);
#endif /* !QUOTEARG_H_ */

View File

@ -1,255 +0,0 @@
/* stat-related macros
Copyright (C) 1993, 1994, 2001, 2002, 2004 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 and Jim Meyering. */
#ifndef STAT_MACROS_H
# define STAT_MACROS_H 1
# if ! defined S_ISREG && ! defined S_IFREG
# error "you must include <sys/stat.h> before including this file"
# endif
# ifndef S_IFMT
# define S_IFMT 0170000
# endif
# if STAT_MACROS_BROKEN
# undef S_ISBLK
# undef S_ISCHR
# undef S_ISDIR
# undef S_ISDOOR
# undef S_ISFIFO
# undef S_ISLNK
# undef S_ISNAM
# undef S_ISMPB
# undef S_ISMPC
# undef S_ISNWK
# undef S_ISREG
# undef S_ISSOCK
# endif
# ifndef S_ISBLK
# ifdef S_IFBLK
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
# else
# define S_ISBLK(m) 0
# endif
# endif
# ifndef S_ISCHR
# ifdef S_IFCHR
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
# else
# define S_ISCHR(m) 0
# endif
# endif
# ifndef S_ISDIR
# ifdef S_IFDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# else
# define S_ISDIR(m) 0
# endif
# endif
# ifndef S_ISDOOR /* Solaris 2.5 and up */
# ifdef S_IFDOOR
# define S_ISDOOR(m) (((m) & S_IFMT) == S_IFDOOR)
# else
# define S_ISDOOR(m) 0
# endif
# endif
# ifndef S_ISFIFO
# ifdef S_IFIFO
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
# else
# define S_ISFIFO(m) 0
# endif
# endif
# ifndef S_ISLNK
# ifdef S_IFLNK
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
# else
# define S_ISLNK(m) 0
# endif
# endif
# ifndef S_ISMPB /* V7 */
# ifdef S_IFMPB
# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
# else
# define S_ISMPB(m) 0
# define S_ISMPC(m) 0
# endif
# endif
# ifndef S_ISNAM /* Xenix */
# ifdef S_IFNAM
# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
# else
# define S_ISNAM(m) 0
# endif
# endif
# ifndef S_ISNWK /* HP/UX */
# ifdef S_IFNWK
# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
# else
# define S_ISNWK(m) 0
# endif
# endif
# ifndef S_ISREG
# ifdef S_IFREG
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
# else
# define S_ISREG(m) 0
# endif
# endif
# ifndef S_ISSOCK
# ifdef S_IFSOCK
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
# else
# define S_ISSOCK(m) 0
# endif
# endif
# ifndef S_TYPEISMQ
# define S_TYPEISMQ(p) 0
# endif
# ifndef S_TYPEISTMO
# define S_TYPEISTMO(p) 0
# endif
# ifndef S_TYPEISSEM
# ifdef S_INSEM
# define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM)
# else
# define S_TYPEISSEM(p) 0
# endif
# endif
# ifndef S_TYPEISSHM
# ifdef S_INSHD
# define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD)
# else
# define S_TYPEISSHM(p) 0
# endif
# endif
/* contiguous */
# ifndef S_ISCTG
# define S_ISCTG(p) 0
# endif
/* Cray DMF (data migration facility): off line, with data */
# ifndef S_ISOFD
# define S_ISOFD(p) 0
# endif
/* Cray DMF (data migration facility): off line, with no data */
# ifndef S_ISOFL
# define S_ISOFL(p) 0
# endif
/* If any of the following are undefined,
define them to their de facto standard values. */
# if !S_ISUID
# define S_ISUID 04000
# endif
# if !S_ISGID
# define S_ISGID 02000
# endif
/* S_ISVTX is a common extension to POSIX. */
# ifndef S_ISVTX
# define S_ISVTX 01000
# endif
# if !S_IRUSR && S_IREAD
# define S_IRUSR S_IREAD
# endif
# if !S_IRUSR
# define S_IRUSR 00400
# endif
# if !S_IRGRP
# define S_IRGRP (S_IRUSR >> 3)
# endif
# if !S_IROTH
# define S_IROTH (S_IRUSR >> 6)
# endif
# if !S_IWUSR && S_IWRITE
# define S_IWUSR S_IWRITE
# endif
# if !S_IWUSR
# define S_IWUSR 00200
# endif
# if !S_IWGRP
# define S_IWGRP (S_IWUSR >> 3)
# endif
# if !S_IWOTH
# define S_IWOTH (S_IWUSR >> 6)
# endif
# if !S_IXUSR && S_IEXEC
# define S_IXUSR S_IEXEC
# endif
# if !S_IXUSR
# define S_IXUSR 00100
# endif
# if !S_IXGRP
# define S_IXGRP (S_IXUSR >> 3)
# endif
# if !S_IXOTH
# define S_IXOTH (S_IXUSR >> 6)
# endif
# if !S_IRWXU
# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
# endif
# if !S_IRWXG
# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
# endif
# if !S_IRWXO
# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
# endif
/* S_IXUGO is a common extension to POSIX. */
# if !S_IXUGO
# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
# endif
# ifndef S_IRWXUGO
# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
# endif
/* All the mode bits that can be affected by chmod. */
# define CHMOD_MODE_BITS \
(S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
#endif /* STAT_MACROS_H */

View File

@ -1,23 +0,0 @@
/* Invoke stdio functions, but avoid some glitches.
Copyright (C) 2001, 2003 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. */
#include <stdio.h>
FILE *fopen_safer (char const *, char const *);

View File

@ -1,48 +0,0 @@
/* Find the length of STRING, but scan at most MAXLEN characters.
Copyright (C) 1996, 1997, 1998, 2000-2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is 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
#undef strnlen
#include <string.h>
#undef __strnlen
#undef strnlen
#ifndef _LIBC
# define strnlen rpl_strnlen
#endif
#ifndef weak_alias
# define __strnlen strnlen
#endif
/* Find the length of STRING, but scan at most MAXLEN characters.
If no '\0' terminator is found in that many characters, return MAXLEN. */
size_t
__strnlen (const char *string, size_t maxlen)
{
const char *end = memchr (string, '\0', maxlen);
return end ? (size_t) (end - string) : maxlen;
}
#ifdef weak_alias
weak_alias (__strnlen, strnlen)
#endif

View File

@ -1,71 +0,0 @@
/* timespec -- System time interface
Copyright (C) 2000, 2002, 2004 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 ! defined TIMESPEC_H
# define TIMESPEC_H
/* You must include config.h before including this file. */
# 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
# if ! HAVE_STRUCT_TIMESPEC
/* Some systems don't define this struct, e.g., AIX 4.1, Ultrix 4.3. */
struct timespec
{
time_t tv_sec;
long tv_nsec;
};
# endif
# ifdef ST_MTIM_NSEC
# define ST_TIME_CMP_NS(a, b, ns) ((a).ns < (b).ns ? -1 : (a).ns > (b).ns)
# else
# define ST_TIME_CMP_NS(a, b, ns) 0
# endif
# define ST_TIME_CMP(a, b, s, ns) \
((a).s < (b).s ? -1 : (a).s > (b).s ? 1 : ST_TIME_CMP_NS(a, b, ns))
# define ATIME_CMP(a, b) ST_TIME_CMP (a, b, st_atime, st_atim.ST_MTIM_NSEC)
# define CTIME_CMP(a, b) ST_TIME_CMP (a, b, st_ctime, st_ctim.ST_MTIM_NSEC)
# define MTIME_CMP(a, b) ST_TIME_CMP (a, b, st_mtime, st_mtim.ST_MTIM_NSEC)
# ifdef ST_MTIM_NSEC
# define TIMESPEC_NS(timespec) ((timespec).ST_MTIM_NSEC)
# else
# define TIMESPEC_NS(timespec) 0
# endif
# if ! HAVE_DECL_NANOSLEEP
/* Don't specify a prototype here. Some systems (e.g., OSF) declare
nanosleep with a conflicting one (const-less first parameter). */
int nanosleep ();
# endif
int gettime (struct timespec *);
int settime (struct timespec const *);
#endif

View File

@ -1,3 +0,0 @@
#define inttostr umaxtostr
#define inttype uintmax_t
#include "inttostr.c"

View File

@ -1,21 +0,0 @@
/* Invoke unistd functions, but avoid some glitches.
Copyright (C) 2001, 2003 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. */
int dup_safer (int);

View File

@ -1,181 +0,0 @@
/* Utility to help print --version output in a consistent format.
Copyright (C) 1999-2004 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. */
/* $FreeBSD$ */
/* Written by Jim Meyering. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
/* Specification. */
#include "version-etc.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "unlocked-io.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
/* Default copyright goes to the FSF. */
const char* version_etc_copyright =
/* Do *not* mark this string for translation. */
"Copyright (C) 2004 Free Software Foundation, Inc.";
/* Like version_etc, below, but with the NULL-terminated author list
provided via a variable of type va_list. */
void
version_etc_va (FILE *stream,
const char *command_name, const char *package,
const char *version, va_list authors)
{
size_t n_authors;
/* Count the number of authors. */
{
va_list tmp_authors;
#ifdef va_copy
va_copy (tmp_authors, authors);
#else
tmp_authors = authors;
#endif
n_authors = 0;
while (va_arg (tmp_authors, const char *) != NULL)
++n_authors;
#ifdef va_copy
va_end (tmp_authors);
#endif
}
if (command_name)
fprintf (stream, "%s (%s) %s\n", command_name, package, version);
else
fprintf (stream, "%s %s\n", package, version);
switch (n_authors)
{
case 0:
/* The caller must provide at least one author name. */
abort ();
case 1:
/* TRANSLATORS: %s denotes an author name. */
vfprintf (stream, _("Written by %s.\n"), authors);
break;
case 2:
/* TRANSLATORS: Each %s denotes an author name. */
vfprintf (stream, _("Written by %s and %s.\n"), authors);
break;
case 3:
/* TRANSLATORS: Each %s denotes an author name. */
vfprintf (stream, _("Written by %s, %s, and %s.\n"), authors);
break;
case 4:
/* TRANSLATORS: Each %s denotes an author name.
You can use line breaks, estimating that each author name occupies
ca. 16 screen columns and that a screen line has ca. 80 columns. */
vfprintf (stream, _("Written by %s, %s, %s,\nand %s.\n"), authors);
break;
case 5:
/* TRANSLATORS: Each %s denotes an author name.
You can use line breaks, estimating that each author name occupies
ca. 16 screen columns and that a screen line has ca. 80 columns. */
vfprintf (stream, _("Written by %s, %s, %s,\n%s, and %s.\n"), authors);
break;
case 6:
/* TRANSLATORS: Each %s denotes an author name.
You can use line breaks, estimating that each author name occupies
ca. 16 screen columns and that a screen line has ca. 80 columns. */
vfprintf (stream, _("Written by %s, %s, %s,\n%s, %s, and %s.\n"),
authors);
break;
case 7:
/* TRANSLATORS: Each %s denotes an author name.
You can use line breaks, estimating that each author name occupies
ca. 16 screen columns and that a screen line has ca. 80 columns. */
vfprintf (stream, _("Written by %s, %s, %s,\n%s, %s, %s, and %s.\n"),
authors);
break;
case 8:
/* TRANSLATORS: Each %s denotes an author name.
You can use line breaks, estimating that each author name occupies
ca. 16 screen columns and that a screen line has ca. 80 columns. */
vfprintf (stream, _("\
Written by %s, %s, %s,\n%s, %s, %s, %s,\nand %s.\n"),
authors);
break;
case 9:
/* TRANSLATORS: Each %s denotes an author name.
You can use line breaks, estimating that each author name occupies
ca. 16 screen columns and that a screen line has ca. 80 columns. */
vfprintf (stream, _("\
Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, and %s.\n"),
authors);
break;
default:
/* 10 or more authors. Use an abbreviation, since the human reader
will probably not want to read the entire list anyway. */
/* TRANSLATORS: Each %s denotes an author name.
You can use line breaks, estimating that each author name occupies
ca. 16 screen columns and that a screen line has ca. 80 columns. */
vfprintf (stream, _("\
Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and others.\n"),
authors);
break;
}
va_end (authors);
putc ('\n', stream);
fputs (version_etc_copyright, stream);
putc ('\n', stream);
fputs (_("\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"),
stream);
}
/* Display the --version information the standard way.
If COMMAND_NAME is NULL, the PACKAGE is asumed to be the name of
the program. The formats are therefore:
PACKAGE VERSION
or
COMMAND_NAME (PACKAGE) VERSION.
The author names are passed as separate arguments, with an additional
NULL argument at the end. */
void
version_etc (FILE *stream,
const char *command_name, const char *package,
const char *version, /* const char *author1, ...*/ ...)
{
va_list authors;
va_start (authors, version);
version_etc_va (stream, command_name, package, version, authors);
}

View File

@ -1,37 +0,0 @@
/* Utility to help print --version output in a consistent format.
Copyright (C) 1999, 2003 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. */
#ifndef VERSION_ETC_H
# define VERSION_ETC_H 1
# include <stdarg.h>
# include <stdio.h>
extern const char *version_etc_copyright;
extern void version_etc_va (FILE *stream,
const char *command_name, const char *package,
const char *version, va_list authors);
extern void version_etc (FILE *stream,
const char *command_name, const char *package,
const char *version,
/* const char *author1, ...*/ ...);
#endif /* VERSION_ETC_H */

View File

@ -1,45 +0,0 @@
/* Report a memory allocation failure and exit.
Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004 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
#include "xalloc.h"
#include <stdlib.h>
#include "error.h"
#include "exitfail.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
void
xalloc_die (void)
{
error (exit_failure, 0, "%s", _("memory exhausted"));
/* The `noreturn' cannot be given to error, since it may return if
its first argument is 0. To help compilers understand the
xalloc_die does not return, call abort. Also, the abort is a
safety feature if exit_failure is 0 (which shouldn't happen). */
abort ();
}

View File

@ -1,90 +0,0 @@
/* xalloc.h -- malloc with out-of-memory checking
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef XALLOC_H_
# define XALLOC_H_
# include <stddef.h>
# ifdef __cplusplus
extern "C" {
# endif
# ifndef __attribute__
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
# define __attribute__(x)
# endif
# endif
# ifndef ATTRIBUTE_NORETURN
# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
# endif
/* This function is always triggered when memory is exhausted.
It must be defined by the application, either explicitly
or by using gnulib's xalloc-die module. This is the
function to call when one wants the program to die because of a
memory allocation failure. */
extern void xalloc_die (void) ATTRIBUTE_NORETURN;
void *xmalloc (size_t s);
void *xnmalloc (size_t n, size_t s);
void *xzalloc (size_t s);
void *xcalloc (size_t n, size_t s);
void *xrealloc (void *p, size_t s);
void *xnrealloc (void *p, size_t n, size_t s);
void *x2realloc (void *p, size_t *pn);
void *x2nrealloc (void *p, size_t *pn, size_t s);
void *xclone (void const *p, size_t s);
char *xstrdup (const char *str);
/* Return 1 if an array of N objects, each of size S, cannot exist due
to size arithmetic overflow. S must be positive and N must be
nonnegative. This is a macro, not an inline function, so that it
works correctly even when SIZE_MAX < N.
By gnulib convention, SIZE_MAX represents overflow in size
calculations, so the conservative dividend to use here is
SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value.
However, malloc (SIZE_MAX) fails on all known hosts where
sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for
exactly-SIZE_MAX allocations on such hosts; this avoids a test and
branch when S is known to be 1. */
# define xalloc_oversized(n, s) \
((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n))
/* These macros are deprecated; they will go away soon, and are retained
temporarily only to ease conversion to the functions described above. */
# define CCLONE(p, n) xclone (p, (n) * sizeof *(p))
# define CLONE(p) xclone (p, sizeof *(p))
# define NEW(type, var) type *var = xmalloc (sizeof (type))
# define XCALLOC(type, n) xcalloc (n, sizeof (type))
# define XMALLOC(type, n) xnmalloc (n, sizeof (type))
# define XREALLOC(p, type, n) xnrealloc (p, n, sizeof (type))
# define XFREE(p) free (p)
# ifdef __cplusplus
}
# endif
#endif /* !XALLOC_H_ */

View File

@ -1,221 +0,0 @@
/* xmalloc.c -- malloc with out of memory checking
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2002, 2003, 2004 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
#include "xalloc.h"
#include <stdlib.h>
#include <string.h>
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t) -1)
#endif
/* Allocate an array of N objects, each with S bytes of memory,
dynamically, with error checking. S must be nonzero. */
static inline void *
xnmalloc_inline (size_t n, size_t s)
{
void *p;
if (xalloc_oversized (n, s) || (! (p = malloc (n * s)) && n != 0))
xalloc_die ();
return p;
}
void *
xnmalloc (size_t n, size_t s)
{
return xnmalloc_inline (n, s);
}
/* Allocate N bytes of memory dynamically, with error checking. */
void *
xmalloc (size_t n)
{
return xnmalloc_inline (n, 1);
}
/* Change the size of an allocated block of memory P to an array of N
objects each of S bytes, with error checking. S must be nonzero. */
static inline void *
xnrealloc_inline (void *p, size_t n, size_t s)
{
if (xalloc_oversized (n, s) || (! (p = realloc (p, n * s)) && n != 0))
xalloc_die ();
return p;
}
void *
xnrealloc (void *p, size_t n, size_t s)
{
return xnrealloc_inline (p, n, s);
}
/* Change the size of an allocated block of memory P to N bytes,
with error checking. */
void *
xrealloc (void *p, size_t n)
{
return xnrealloc_inline (p, n, 1);
}
/* If P is null, allocate a block of at least *PN such objects;
otherwise, reallocate P so that it contains more than *PN objects
each of S bytes. *PN must be nonzero unless P is null, and S must
be nonzero. Set *PN to the new number of objects, and return the
pointer to the new block. *PN is never set to zero, and the
returned pointer is never null.
Repeated reallocations are guaranteed to make progress, either by
allocating an initial block with a nonzero size, or by allocating a
larger block.
In the following implementation, nonzero sizes are doubled so that
repeated reallocations have O(N log N) overall cost rather than
O(N**2) cost, but the specification for this function does not
guarantee that sizes are doubled.
Here is an example of use:
int *p = NULL;
size_t used = 0;
size_t allocated = 0;
void
append_int (int value)
{
if (used == allocated)
p = x2nrealloc (p, &allocated, sizeof *p);
p[used++] = value;
}
This causes x2nrealloc to allocate a block of some nonzero size the
first time it is called.
To have finer-grained control over the initial size, set *PN to a
nonzero value before calling this function with P == NULL. For
example:
int *p = NULL;
size_t used = 0;
size_t allocated = 0;
size_t allocated1 = 1000;
void
append_int (int value)
{
if (used == allocated)
{
p = x2nrealloc (p, &allocated1, sizeof *p);
allocated = allocated1;
}
p[used++] = value;
}
*/
static inline void *
x2nrealloc_inline (void *p, size_t *pn, size_t s)
{
size_t n = *pn;
if (! p)
{
if (! n)
{
/* The approximate size to use for initial small allocation
requests, when the invoking code specifies an old size of
zero. 64 bytes is the largest "small" request for the
GNU C library malloc. */
enum { DEFAULT_MXFAST = 64 };
n = DEFAULT_MXFAST / s;
n += !n;
}
}
else
{
if (SIZE_MAX / 2 / s < n)
xalloc_die ();
n *= 2;
}
*pn = n;
return xrealloc (p, n * s);
}
void *
x2nrealloc (void *p, size_t *pn, size_t s)
{
return x2nrealloc_inline (p, pn, s);
}
/* If P is null, allocate a block of at least *PN bytes; otherwise,
reallocate P so that it contains more than *PN bytes. *PN must be
nonzero unless P is null. Set *PN to the new block's size, and
return the pointer to the new block. *PN is never set to zero, and
the returned pointer is never null. */
void *
x2realloc (void *p, size_t *pn)
{
return x2nrealloc_inline (p, pn, 1);
}
/* Allocate S bytes of zeroed memory dynamically, with error checking.
There's no need for xnzalloc (N, S), since it would be equivalent
to xcalloc (N, S). */
void *
xzalloc (size_t s)
{
return memset (xmalloc (s), 0, s);
}
/* Allocate zeroed memory for N elements of S bytes, with error
checking. S must be nonzero. */
void *
xcalloc (size_t n, size_t s)
{
void *p;
/* Test for overflow, since some calloc implementations don't have
proper overflow checks. */
if (xalloc_oversized (n, s) || (! (p = calloc (n, s)) && n != 0))
xalloc_die ();
return p;
}
/* Clone an object P of size S, with error checking. There's no need
for xnclone (P, N, S), since xclone (P, N * S) works without any
need for an arithmetic overflow check. */
void *
xclone (void const *p, size_t s)
{
return memcpy (xmalloc (s), p, s);
}

View File

@ -1,59 +0,0 @@
/* Locale-specific memory comparison.
Copyright (C) 2002, 2003, 2004 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. */
/* Contributed by Paul Eggert <eggert@twinsun.com>. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
#include <stdlib.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "error.h"
#include "exitfail.h"
#include "memcoll.h"
#include "quotearg.h"
#include "xmemcoll.h"
/* Compare S1 (with length S1LEN) and S2 (with length S2LEN) according
to the LC_COLLATE locale. S1 and S2 do not overlap, and are not
adjacent. Temporarily modify the bytes after S1 and S2, but
restore their original contents before returning. Report an error
and exit if there is an error. */
int
xmemcoll (char *s1, size_t s1len, char *s2, size_t s2len)
{
int diff = memcoll (s1, s1len, s2, s2len);
int collation_errno = errno;
if (collation_errno)
{
error (0, collation_errno, _("string comparison failed"));
error (0, 0, _("Set LC_ALL='C' to work around the problem."));
error (exit_failure, 0,
_("The strings compared were %s and %s."),
quotearg_n_style_mem (0, locale_quoting_style, s1, s1len),
quotearg_n_style_mem (1, locale_quoting_style, s2, s2len));
}
return diff;
}

View File

@ -1,2 +0,0 @@
#include <stddef.h>
int xmemcoll (char *, size_t, char *, size_t);

View File

@ -1,291 +0,0 @@
/* A more useful interface to strtol.
Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2003, 2004 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. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#ifndef __strtol
# define __strtol strtol
# define __strtol_t long int
# define __xstrtol xstrtol
# define STRTOL_T_MINIMUM LONG_MIN
# define STRTOL_T_MAXIMUM LONG_MAX
#endif
/* Some pre-ANSI implementations (e.g. SunOS 4)
need stderr defined if assertion checking is enabled. */
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
/* The extra casts work around common compiler bugs. */
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \
: (t) 0))
#define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
#ifndef STRTOL_T_MINIMUM
# define STRTOL_T_MINIMUM TYPE_MINIMUM (__strtol_t)
# define STRTOL_T_MAXIMUM TYPE_MAXIMUM (__strtol_t)
#endif
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define IN_CTYPE_DOMAIN(c) 1
#else
# define IN_CTYPE_DOMAIN(c) isascii(c)
#endif
#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
#include "xstrtol.h"
#if !HAVE_DECL_STRTOIMAX && !defined strtoimax
intmax_t strtoimax ();
#endif
#if !HAVE_DECL_STRTOUMAX && !defined strtoumax
uintmax_t strtoumax ();
#endif
static strtol_error
bkm_scale (__strtol_t *x, int scale_factor)
{
if (TYPE_SIGNED (__strtol_t) && *x < STRTOL_T_MINIMUM / scale_factor)
{
*x = STRTOL_T_MINIMUM;
return LONGINT_OVERFLOW;
}
if (STRTOL_T_MAXIMUM / scale_factor < *x)
{
*x = STRTOL_T_MAXIMUM;
return LONGINT_OVERFLOW;
}
*x *= scale_factor;
return LONGINT_OK;
}
static strtol_error
bkm_scale_by_power (__strtol_t *x, int base, int power)
{
strtol_error err = LONGINT_OK;
while (power--)
err |= bkm_scale (x, base);
return err;
}
/* FIXME: comment. */
strtol_error
__xstrtol (const char *s, char **ptr, int strtol_base,
__strtol_t *val, const char *valid_suffixes)
{
char *t_ptr;
char **p;
__strtol_t tmp;
strtol_error err = LONGINT_OK;
assert (0 <= strtol_base && strtol_base <= 36);
p = (ptr ? ptr : &t_ptr);
if (! TYPE_SIGNED (__strtol_t))
{
const char *q = s;
unsigned char ch = *q;
while (ISSPACE (ch))
ch = *++q;
if (ch == '-')
return LONGINT_INVALID;
}
errno = 0;
tmp = __strtol (s, p, strtol_base);
if (*p == s)
{
/* If there is no number but there is a valid suffix, assume the
number is 1. The string is invalid otherwise. */
if (valid_suffixes && **p && strchr (valid_suffixes, **p))
tmp = 1;
else
return LONGINT_INVALID;
}
else if (errno != 0)
{
if (errno != ERANGE)
return LONGINT_INVALID;
err = LONGINT_OVERFLOW;
}
/* Let valid_suffixes == NULL mean `allow any suffix'. */
/* FIXME: update all callers except the ones that allow suffixes
after the number, changing last parameter NULL to `""'. */
if (!valid_suffixes)
{
*val = tmp;
return err;
}
if (**p != '\0')
{
int base = 1024;
int suffixes = 1;
strtol_error overflow;
if (!strchr (valid_suffixes, **p))
{
*val = tmp;
return err | LONGINT_INVALID_SUFFIX_CHAR;
}
if (strchr (valid_suffixes, '0'))
{
/* The ``valid suffix'' '0' is a special flag meaning that
an optional second suffix is allowed, which can change
the base. A suffix "B" (e.g. "100MB") stands for a power
of 1000, whereas a suffix "iB" (e.g. "100MiB") stands for
a power of 1024. If no suffix (e.g. "100M"), assume
power-of-1024. */
switch (p[0][1])
{
case 'i':
if (p[0][2] == 'B')
suffixes += 2;
break;
case 'B':
case 'D': /* 'D' is obsolescent */
base = 1000;
suffixes++;
break;
}
}
switch (**p)
{
case 'b':
overflow = bkm_scale (&tmp, 512);
break;
case 'B':
overflow = bkm_scale (&tmp, 1024);
break;
case 'c':
overflow = 0;
break;
case 'E': /* exa or exbi */
overflow = bkm_scale_by_power (&tmp, base, 6);
break;
case 'G': /* giga or gibi */
case 'g': /* 'g' is undocumented; for compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 3);
break;
case 'k': /* kilo */
case 'K': /* kibi */
overflow = bkm_scale_by_power (&tmp, base, 1);
break;
case 'M': /* mega or mebi */
case 'm': /* 'm' is undocumented; for compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 2);
break;
case 'P': /* peta or pebi */
overflow = bkm_scale_by_power (&tmp, base, 5);
break;
case 'T': /* tera or tebi */
case 't': /* 't' is undocumented; for compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 4);
break;
case 'w':
overflow = bkm_scale (&tmp, 2);
break;
case 'Y': /* yotta or 2**80 */
overflow = bkm_scale_by_power (&tmp, base, 8);
break;
case 'Z': /* zetta or 2**70 */
overflow = bkm_scale_by_power (&tmp, base, 7);
break;
default:
*val = tmp;
return err | LONGINT_INVALID_SUFFIX_CHAR;
}
err |= overflow;
*p += suffixes;
if (**p)
err |= LONGINT_INVALID_SUFFIX_CHAR;
}
*val = tmp;
return err;
}
#ifdef TESTING_XSTRTO
# include <stdio.h>
# include "error.h"
char *program_name;
int
main (int argc, char **argv)
{
strtol_error s_err;
int i;
program_name = argv[0];
for (i=1; i<argc; i++)
{
char *p;
__strtol_t val;
s_err = __xstrtol (argv[i], &p, 0, &val, "bckmw");
if (s_err == LONGINT_OK)
{
printf ("%s->%lu (%s)\n", argv[i], val, p);
}
else
{
STRTOL_FATAL_ERROR (argv[i], "arg", s_err);
}
}
exit (0);
}
#endif /* TESTING_XSTRTO */

View File

@ -1,89 +0,0 @@
/* A more useful interface to strtol.
Copyright (C) 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004 Free
Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef XSTRTOL_H_
# define XSTRTOL_H_ 1
# include "exitfail.h"
# if HAVE_INTTYPES_H
# include <inttypes.h>
# endif
# if HAVE_STDINT_H
# include <stdint.h>
# endif
# ifndef _STRTOL_ERROR
enum strtol_error
{
LONGINT_OK = 0,
/* These two values can be ORed together, to indicate that both
errors occurred. */
LONGINT_OVERFLOW = 1,
LONGINT_INVALID_SUFFIX_CHAR = 2,
LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW = (LONGINT_INVALID_SUFFIX_CHAR
| LONGINT_OVERFLOW),
LONGINT_INVALID = 4
};
typedef enum strtol_error strtol_error;
# endif
# define _DECLARE_XSTRTOL(name, type) \
strtol_error name (const char *, char **, int, type *, const char *);
_DECLARE_XSTRTOL (xstrtol, long int)
_DECLARE_XSTRTOL (xstrtoul, unsigned long int)
_DECLARE_XSTRTOL (xstrtoimax, intmax_t)
_DECLARE_XSTRTOL (xstrtoumax, uintmax_t)
# define _STRTOL_ERROR(Exit_code, Str, Argument_type_string, Err) \
do \
{ \
switch ((Err)) \
{ \
default: \
abort (); \
\
case LONGINT_INVALID: \
error ((Exit_code), 0, "invalid %s `%s'", \
(Argument_type_string), (Str)); \
break; \
\
case LONGINT_INVALID_SUFFIX_CHAR: \
case LONGINT_INVALID_SUFFIX_CHAR | LONGINT_OVERFLOW: \
error ((Exit_code), 0, "invalid character following %s in `%s'", \
(Argument_type_string), (Str)); \
break; \
\
case LONGINT_OVERFLOW: \
error ((Exit_code), 0, "%s `%s' too large", \
(Argument_type_string), (Str)); \
break; \
} \
} \
while (0)
# define STRTOL_FATAL_ERROR(Str, Argument_type_string, Err) \
_STRTOL_ERROR (exit_failure, Str, Argument_type_string, Err)
# define STRTOL_FAIL_WARN(Str, Argument_type_string, Err) \
_STRTOL_ERROR (0, Str, Argument_type_string, Err)
#endif /* not XSTRTOL_H_ */

View File

@ -1,6 +0,0 @@
#define __strtol strtoul
#define __strtol_t unsigned long int
#define __xstrtol xstrtoul
#define STRTOL_T_MINIMUM 0
#define STRTOL_T_MAXIMUM ULONG_MAX
#include "xstrtol.c"

View File

@ -1,33 +0,0 @@
/* xstrtoumax.c -- A more useful interface to strtoumax.
Copyright (C) 1999, 2003, 2004 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. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "xstrtol.h"
#define __strtol strtoumax
#define __strtol_t uintmax_t
#define __xstrtol xstrtoumax
#ifdef UINTMAX_MAX
# define STRTOL_T_MINIMUM 0
# define STRTOL_T_MAXIMUM UINTMAX_MAX
#endif
#include "xstrtol.c"

View File

@ -1,113 +0,0 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.33.
.TH SORT "1" "March 2004" "sort (coreutils) 5.2.1" "User Commands"
.SH NAME
sort \- sort lines of text files
.SH SYNOPSIS
.B sort
[\fIOPTION\fR]... [\fIFILE\fR]...
.SH DESCRIPTION
.\" Add any additional description here
.PP
Write sorted concatenation of all FILE(s) to standard output.
.PP
Ordering options:
.PP
Mandatory arguments to long options are mandatory for short options too.
.HP
\fB\-b\fR, \fB\-\-ignore\-leading\-blanks\fR ignore leading blanks
.TP
\fB\-d\fR, \fB\-\-dictionary\-order\fR
consider only blanks and alphanumeric characters
.TP
\fB\-f\fR, \fB\-\-ignore\-case\fR
fold lower case to upper case characters
.TP
\fB\-g\fR, \fB\-\-general\-numeric\-sort\fR
compare according to general numerical value
.TP
\fB\-i\fR, \fB\-\-ignore\-nonprinting\fR
consider only printable characters
.TP
\fB\-M\fR, \fB\-\-month\-sort\fR
compare (unknown) < `JAN' < ... < `DEC'
.TP
\fB\-n\fR, \fB\-\-numeric\-sort\fR
compare according to string numerical value
.TP
\fB\-r\fR, \fB\-\-reverse\fR
reverse the result of comparisons
.PP
Other options:
.TP
\fB\-c\fR, \fB\-\-check\fR
check whether input is sorted; do not sort
.TP
\fB\-k\fR, \fB\-\-key\fR=\fIPOS1[\fR,POS2]
start a key at POS1, end it at POS 2 (origin 1)
.TP
\fB\-m\fR, \fB\-\-merge\fR
merge already sorted files; do not sort
.TP
\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR
write result to FILE instead of standard output
.TP
\fB\-s\fR, \fB\-\-stable\fR
stabilize sort by disabling last-resort comparison
.TP
\fB\-S\fR, \fB\-\-buffer\-size\fR=\fISIZE\fR
use SIZE for main memory buffer
.HP
\fB\-t\fR, \fB\-\-field\-separator\fR=\fISEP\fR use SEP instead of non-blank to blank transition
.TP
\fB\-T\fR, \fB\-\-temporary\-directory\fR=\fIDIR\fR
use DIR for temporaries, not $TMPDIR or /tmp;
multiple options specify multiple directories
.TP
\fB\-u\fR, \fB\-\-unique\fR
with \fB\-c\fR, check for strict ordering;
without \fB\-c\fR, output only the first of an equal run
.TP
\fB\-z\fR, \fB\-\-zero\-terminated\fR
end lines with 0 byte, not newline
.TP
\fB\-\-help\fR
display this help and exit
.TP
\fB\-\-version\fR
output version information and exit
.PP
POS is F[.C][OPTS], where F is the field number and C the character position
in the field. OPTS is one or more single-letter ordering options, which
override global ordering options for that key. If no key is given, use the
entire line as the key.
.PP
SIZE may be followed by the following multiplicative suffixes:
% 1% of memory, b 1, K 1024 (default), and so on for M, G, T, P, E, Z, Y.
.PP
With no FILE, or when FILE is -, read standard input.
.PP
*** WARNING ***
The locale specified by the environment affects sort order.
Set LC_ALL=C to get the traditional sort order that uses
native byte values.
.SH AUTHOR
Written by Mike Haertel and Paul Eggert.
.SH "REPORTING BUGS"
Report bugs to <bug-coreutils@gnu.org>.
.SH COPYRIGHT
Copyright \(co 2004 Free Software Foundation, Inc.
.br
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.SH "SEE ALSO"
The full documentation for
.B sort
is maintained as a Texinfo manual. If the
.B info
and
.B sort
programs are properly installed at your site, the command
.IP
.B info coreutils sort
.PP
should give you access to the complete manual.

File diff suppressed because it is too large Load Diff

View File

@ -1,831 +0,0 @@
/* system-dependent definitions for fileutils, textutils, and sh-utils packages.
Copyright (C) 1989, 1991-2004 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. */
#include <alloca.h>
/* Include sys/types.h before this file. */
#if 2 <= __GLIBC__ && 2 <= __GLIBC_MINOR__
# if ! defined _SYS_TYPES_H
you must include <sys/types.h> before including this file
# endif
#endif
#include <sys/stat.h>
#if !defined HAVE_MKFIFO
# define mkfifo(path, mode) (mknod ((path), (mode) | S_IFIFO, 0))
#endif
#if HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
/* <unistd.h> should be included before any preprocessor test
of _POSIX_VERSION. */
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifndef STDIN_FILENO
# define STDIN_FILENO 0
#endif
#ifndef STDOUT_FILENO
# define STDOUT_FILENO 1
#endif
#ifndef STDERR_FILENO
# define STDERR_FILENO 2
#endif
/* limits.h must come before pathmax.h because limits.h on some systems
undefs PATH_MAX, whereas pathmax.h sets PATH_MAX. */
#include <limits.h>
#include "pathmax.h"
#include "localedir.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
/* Since major is a function on SVR4, we can't use `ifndef major'. */
#if MAJOR_IN_MKDEV
# include <sys/mkdev.h>
# define HAVE_MAJOR
#endif
#if MAJOR_IN_SYSMACROS
# include <sys/sysmacros.h>
# define HAVE_MAJOR
#endif
#ifdef major /* Might be defined in sys/types.h. */
# define HAVE_MAJOR
#endif
#ifndef HAVE_MAJOR
# define major(dev) (((dev) >> 8) & 0xff)
# define minor(dev) ((dev) & 0xff)
# define makedev(maj, min) (((maj) << 8) | (min))
#endif
#undef HAVE_MAJOR
#if ! defined makedev && defined mkdev
# define makedev(maj, min) mkdev (maj, min)
#endif
#if HAVE_UTIME_H
# include <utime.h>
#endif
/* Some systems (even some that do have <utime.h>) don't declare this
structure anywhere. */
#ifndef HAVE_STRUCT_UTIMBUF
struct utimbuf
{
long actime;
long modtime;
};
#endif
/* Don't use bcopy! Use memmove if source and destination may overlap,
memcpy otherwise. */
#include <string.h>
#if ! HAVE_DECL_MEMRCHR
void *memrchr (const void *, int, size_t);
#endif
#include <errno.h>
/* Some systems don't define the following symbols. */
#ifndef ENOSYS
# define ENOSYS (-1)
#endif
#ifndef EISDIR
# define EISDIR (-1)
#endif
#include <stdbool.h>
#define getopt system_getopt
#include <stdlib.h>
#undef getopt
/* The following test is to work around the gross typo in
systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE
is defined to 0, not 1. */
#if !EXIT_FAILURE
# undef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
#ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
#endif
/* Exit statuses for programs like 'env' that exec other programs.
EXIT_FAILURE might not be 1, so use EXIT_FAIL in such programs. */
enum
{
EXIT_FAIL = 1,
EXIT_CANNOT_INVOKE = 126,
EXIT_ENOENT = 127
};
#include "exitfail.h"
/* Set exit_failure to STATUS if that's not the default already. */
static inline void
initialize_exit_failure (int status)
{
if (status != EXIT_FAILURE)
exit_failure = status;
}
#if HAVE_FCNTL_H
# include <fcntl.h>
#else
# include <sys/file.h>
#endif
#if !defined SEEK_SET
# define SEEK_SET 0
# define SEEK_CUR 1
# define SEEK_END 2
#endif
#ifndef F_OK
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
#endif
/* For systems that distinguish between text and binary I/O.
O_BINARY is usually declared in fcntl.h */
#if !defined O_BINARY && defined _O_BINARY
/* For MSC-compatible compilers. */
# define O_BINARY _O_BINARY
# define O_TEXT _O_TEXT
#endif
#if !defined O_DIRECT
# define O_DIRECT 0
#endif
#if !defined O_DSYNC
# define O_DSYNC 0
#endif
#if !defined O_NDELAY
# define O_NDELAY 0
#endif
#if !defined O_NONBLOCK
# define O_NONBLOCK O_NDELAY
#endif
#if !defined O_NOCTTY
# define O_NOCTTY 0
#endif
#if !defined O_NOFOLLOW
# define O_NOFOLLOW 0
#endif
#if !defined O_RSYNC
# define O_RSYNC 0
#endif
#if !defined O_SYNC
# define O_SYNC 0
#endif
#ifdef __BEOS__
/* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
# undef O_BINARY
# undef O_TEXT
#endif
#if O_BINARY
# ifndef __DJGPP__
# define setmode _setmode
# define fileno(_fp) _fileno (_fp)
# endif /* not DJGPP */
# define SET_MODE(_f, _m) setmode (_f, _m)
# define SET_BINARY(_f) do {if (!isatty(_f)) setmode (_f, O_BINARY);} while (0)
# define SET_BINARY2(_f1, _f2) \
do { \
if (!isatty (_f1)) \
{ \
setmode (_f1, O_BINARY); \
if (!isatty (_f2)) \
setmode (_f2, O_BINARY); \
} \
} while(0)
#else
# define SET_MODE(_f, _m) (void)0
# define SET_BINARY(f) (void)0
# define SET_BINARY2(f1,f2) (void)0
# ifndef O_BINARY
# define O_BINARY 0
# endif
# define O_TEXT 0
#endif /* O_BINARY */
#if HAVE_DIRENT_H
# include <dirent.h>
# define NLENGTH(direct) (strlen((direct)->d_name))
#else /* not HAVE_DIRENT_H */
# define dirent direct
# define NLENGTH(direct) ((direct)->d_namlen)
# if HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif /* HAVE_SYS_NDIR_H */
# if HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif /* HAVE_SYS_DIR_H */
# if HAVE_NDIR_H
# include <ndir.h>
# endif /* HAVE_NDIR_H */
#endif /* HAVE_DIRENT_H */
#if CLOSEDIR_VOID
/* Fake a return value. */
# define CLOSEDIR(d) (closedir (d), 0)
#else
# define CLOSEDIR(d) closedir (d)
#endif
/* Get or fake the disk device blocksize.
Usually defined by sys/param.h (if at all). */
#if !defined DEV_BSIZE && defined BSIZE
# define DEV_BSIZE BSIZE
#endif
#if !defined DEV_BSIZE && defined BBSIZE /* SGI */
# define DEV_BSIZE BBSIZE
#endif
#ifndef DEV_BSIZE
# define DEV_BSIZE 4096
#endif
/* Extract or fake data from a `struct stat'.
ST_BLKSIZE: Preferred I/O blocksize for the file, in bytes.
ST_NBLOCKS: Number of blocks in the file, including indirect blocks.
ST_NBLOCKSIZE: Size of blocks used when calculating ST_NBLOCKS. */
#ifndef HAVE_STRUCT_STAT_ST_BLOCKS
# define ST_BLKSIZE(statbuf) DEV_BSIZE
# if defined _POSIX_SOURCE || !defined BSIZE /* fileblocks.c uses BSIZE. */
# define ST_NBLOCKS(statbuf) \
((statbuf).st_size / ST_NBLOCKSIZE + ((statbuf).st_size % ST_NBLOCKSIZE != 0))
# else /* !_POSIX_SOURCE && BSIZE */
# define ST_NBLOCKS(statbuf) \
(S_ISREG ((statbuf).st_mode) \
|| S_ISDIR ((statbuf).st_mode) \
? st_blocks ((statbuf).st_size) : 0)
# endif /* !_POSIX_SOURCE && BSIZE */
#else /* HAVE_STRUCT_STAT_ST_BLOCKS */
/* Some systems, like Sequents, return st_blksize of 0 on pipes.
Also, when running `rsh hpux11-system cat any-file', cat would
determine that the output stream had an st_blksize of 2147421096.
So here we arbitrarily limit the `optimal' block size to 4MB.
If anyone knows of a system for which the legitimate value for
st_blksize can exceed 4MB, please report it as a bug in this code. */
# define ST_BLKSIZE(statbuf) ((0 < (statbuf).st_blksize \
&& (statbuf).st_blksize <= (1 << 22)) /* 4MB */ \
? (statbuf).st_blksize : DEV_BSIZE)
# if defined hpux || defined __hpux__ || defined __hpux
/* HP-UX counts st_blocks in 1024-byte units.
This loses when mixing HP-UX and BSD file systems with NFS. */
# define ST_NBLOCKSIZE 1024
# else /* !hpux */
# if defined _AIX && defined _I386
/* AIX PS/2 counts st_blocks in 4K units. */
# define ST_NBLOCKSIZE (4 * 1024)
# else /* not AIX PS/2 */
# if defined _CRAY
# define ST_NBLOCKS(statbuf) \
(S_ISREG ((statbuf).st_mode) \
|| S_ISDIR ((statbuf).st_mode) \
? (statbuf).st_blocks * ST_BLKSIZE(statbuf)/ST_NBLOCKSIZE : 0)
# endif /* _CRAY */
# endif /* not AIX PS/2 */
# endif /* !hpux */
#endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
#ifndef ST_NBLOCKS
# define ST_NBLOCKS(statbuf) ((statbuf).st_blocks)
#endif
#ifndef ST_NBLOCKSIZE
# define ST_NBLOCKSIZE 512
#endif
/* Redirection and wildcarding when done by the utility itself.
Generally a noop, but used in particular for native VMS. */
#ifndef initialize_main
# define initialize_main(ac, av)
#endif
#include "stat-macros.h"
#include "timespec.h"
#ifndef RETSIGTYPE
# define RETSIGTYPE void
#endif
#ifdef __DJGPP__
/* We need the declaration of setmode. */
# include <io.h>
/* We need the declaration of __djgpp_set_ctrl_c. */
# include <sys/exceptn.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_STDINT_H
# include <stdint.h>
#endif
#if ULONG_MAX < ULLONG_MAX
# define LONGEST_MODIFIER "ll"
#else
# define LONGEST_MODIFIER "l"
#endif
#if PRI_MACROS_BROKEN
# undef PRIdMAX
# undef PRIoMAX
# undef PRIuMAX
# undef PRIxMAX
#endif
#ifndef PRIdMAX
# define PRIdMAX LONGEST_MODIFIER "d"
#endif
#ifndef PRIoMAX
# define PRIoMAX LONGEST_MODIFIER "o"
#endif
#ifndef PRIuMAX
# define PRIuMAX LONGEST_MODIFIER "u"
#endif
#ifndef PRIxMAX
# define PRIxMAX LONGEST_MODIFIER "x"
#endif
#include <ctype.h>
/* Jim Meyering writes:
"... Some ctype macros are valid only for character codes that
isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
using /bin/cc or gcc but without giving an ansi option). So, all
ctype uses should be through macros like ISPRINT... If
STDC_HEADERS is defined, then autoconf has verified that the ctype
macros don't need to be guarded with references to isascii. ...
Defining isascii to 1 should let any compiler worth its salt
eliminate the && through constant folding."
Bruno Haible adds:
"... Furthermore, isupper(c) etc. have an undefined result if c is
outside the range -1 <= c <= 255. One is tempted to write isupper(c)
with c being of type `char', but this is wrong if c is an 8-bit
character >= 128 which gets sign-extended to a negative value.
The macro ISUPPER protects against this as well." */
#if STDC_HEADERS || (!defined (isascii) && !HAVE_ISASCII)
# define IN_CTYPE_DOMAIN(c) 1
#else
# define IN_CTYPE_DOMAIN(c) isascii(c)
#endif
#ifdef isblank
# define ISBLANK(c) (IN_CTYPE_DOMAIN (c) && isblank (c))
#else
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
#endif
#ifdef isgraph
# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isgraph (c))
#else
# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isprint (c) && !isspace (c))
#endif
/* This is defined in <sys/euc.h> on at least Solaris2.6 systems. */
#undef ISPRINT
#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c))
#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
#define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (c))
#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
#define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
#if STDC_HEADERS
# define TOLOWER(Ch) tolower (Ch)
# define TOUPPER(Ch) toupper (Ch)
#else
# define TOLOWER(Ch) (ISUPPER (Ch) ? tolower (Ch) : (Ch))
# define TOUPPER(Ch) (ISLOWER (Ch) ? toupper (Ch) : (Ch))
#endif
/* ISDIGIT differs from ISDIGIT_LOCALE, as follows:
- Its arg may be any int or unsigned int; it need not be an unsigned char.
- It's guaranteed to evaluate its argument exactly once.
- It's typically faster.
POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
ISDIGIT_LOCALE unless it's important to use the locale's definition
of `digit' even when the host does not conform to POSIX. */
#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
/* Convert a possibly-signed character to an unsigned character. This is
a bit safer than casting to unsigned char, since it catches some type
errors that the cast doesn't. */
static inline unsigned char to_uchar (char ch) { return ch; }
/* Take care of NLS matters. */
#if HAVE_LOCALE_H
# include <locale.h>
#else
# define setlocale(Category, Locale) /* empty */
#endif
#include "gettext.h"
#if ! ENABLE_NLS
# undef textdomain
# define textdomain(Domainname) /* empty */
# undef bindtextdomain
# define bindtextdomain(Domainname, Dirname) /* empty */
#endif
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
#ifndef HAVE_SETLOCALE
# define HAVE_SETLOCALE 0
#endif
#define STREQ(a, b) (strcmp ((a), (b)) == 0)
#if !HAVE_DECL_FREE
void free ();
#endif
#if !HAVE_DECL_MALLOC
char *malloc ();
#endif
#if !HAVE_DECL_MEMCHR
char *memchr ();
#endif
#if !HAVE_DECL_REALLOC
char *realloc ();
#endif
#if !HAVE_DECL_STPCPY
# ifndef stpcpy
char *stpcpy ();
# endif
#endif
#if !HAVE_DECL_STRNDUP
char *strndup ();
#endif
#if !HAVE_DECL_STRSTR
char *strstr ();
#endif
#if !HAVE_DECL_GETENV
char *getenv ();
#endif
#if !HAVE_DECL_LSEEK
off_t lseek ();
#endif
/* This is needed on some AIX systems. */
#if !HAVE_DECL_STRTOUL
unsigned long strtoul ();
#endif
#if !HAVE_DECL_GETLOGIN
char *getlogin ();
#endif
#if !HAVE_DECL_TTYNAME
char *ttyname ();
#endif
#if !HAVE_DECL_GETEUID
uid_t geteuid ();
#endif
#if !HAVE_DECL_GETPWUID
struct passwd *getpwuid ();
#endif
#if !HAVE_DECL_GETGRGID
struct group *getgrgid ();
#endif
#if !HAVE_DECL_GETUID
uid_t getuid ();
#endif
#include "xalloc.h"
#if ! defined HAVE_MEMPCPY && ! defined mempcpy
/* Be CAREFUL that there are no side effects in N. */
# define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
#endif
/* Include automatically-generated macros for unlocked I/O. */
#include "unlocked-io.h"
#define SAME_INODE(Stat_buf_1, Stat_buf_2) \
((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
&& (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
#define DOT_OR_DOTDOT(Basename) \
(Basename[0] == '.' && (Basename[1] == '\0' \
|| (Basename[1] == '.' && Basename[2] == '\0')))
/* A wrapper for readdir so that callers don't see entries for `.' or `..'. */
static inline struct dirent const *
readdir_ignoring_dot_and_dotdot (DIR *dirp)
{
while (1)
{
struct dirent const *dp = readdir (dirp);
if (dp == NULL || ! DOT_OR_DOTDOT (dp->d_name))
return dp;
}
}
#if SETVBUF_REVERSED
# define SETVBUF(Stream, Buffer, Type, Size) \
setvbuf (Stream, Type, Buffer, Size)
#else
# define SETVBUF(Stream, Buffer, Type, Size) \
setvbuf (Stream, Buffer, Type, Size)
#endif
/* Factor out some of the common --help and --version processing code. */
/* These enum values cannot possibly conflict with the option values
ordinarily used by commands, including CHAR_MAX + 1, etc. Avoid
CHAR_MIN - 1, as it may equal -1, the getopt end-of-options value. */
enum
{
GETOPT_HELP_CHAR = (CHAR_MIN - 2),
GETOPT_VERSION_CHAR = (CHAR_MIN - 3)
};
#define GETOPT_HELP_OPTION_DECL \
"help", no_argument, 0, GETOPT_HELP_CHAR
#define GETOPT_VERSION_OPTION_DECL \
"version", no_argument, 0, GETOPT_VERSION_CHAR
#define case_GETOPT_HELP_CHAR \
case GETOPT_HELP_CHAR: \
usage (EXIT_SUCCESS); \
break;
#define HELP_OPTION_DESCRIPTION \
_(" --help display this help and exit\n")
#define VERSION_OPTION_DESCRIPTION \
_(" --version output version information and exit\n")
#include "closeout.h"
#include "version-etc.h"
#define case_GETOPT_VERSION_CHAR(Program_name, Authors) \
case GETOPT_VERSION_CHAR: \
version_etc (stdout, Program_name, GNU_PACKAGE, VERSION, Authors, \
(char *) NULL); \
exit (EXIT_SUCCESS); \
break;
#ifndef MAX
# define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
#ifndef MIN
# define MIN(a,b) (((a) < (b)) ? (a) : (b))
#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) (~ (t) 0 - TYPE_MINIMUM (t)))
/* Upper bound on the string length of an integer converted to string.
302 / 1000 is ceil (log10 (2.0)). Subtract 1 for the sign bit;
add 1 for integer division truncation; add 1 more for a minus sign. */
#define INT_STRLEN_BOUND(t) ((sizeof (t) * CHAR_BIT - 1) * 302 / 1000 + 2)
#ifndef CHAR_MIN
# define CHAR_MIN TYPE_MINIMUM (char)
#endif
#ifndef CHAR_MAX
# define CHAR_MAX TYPE_MAXIMUM (char)
#endif
#ifndef SCHAR_MIN
# define SCHAR_MIN (-1 - SCHAR_MAX)
#endif
#ifndef SCHAR_MAX
# define SCHAR_MAX (CHAR_MAX == UCHAR_MAX ? CHAR_MAX / 2 : CHAR_MAX)
#endif
#ifndef UCHAR_MAX
# define UCHAR_MAX TYPE_MAXIMUM (unsigned char)
#endif
#ifndef SHRT_MIN
# define SHRT_MIN TYPE_MINIMUM (short int)
#endif
#ifndef SHRT_MAX
# define SHRT_MAX TYPE_MAXIMUM (short int)
#endif
#ifndef INT_MAX
# define INT_MAX TYPE_MAXIMUM (int)
#endif
#ifndef INT_MIN
# define INT_MIN TYPE_MINIMUM (int)
#endif
#ifndef INTMAX_MAX
# define INTMAX_MAX TYPE_MAXIMUM (intmax_t)
#endif
#ifndef INTMAX_MIN
# define INTMAX_MIN TYPE_MINIMUM (intmax_t)
#endif
#ifndef UINT_MAX
# define UINT_MAX TYPE_MAXIMUM (unsigned int)
#endif
#ifndef LONG_MAX
# define LONG_MAX TYPE_MAXIMUM (long int)
#endif
#ifndef ULONG_MAX
# define ULONG_MAX TYPE_MAXIMUM (unsigned long int)
#endif
#ifndef SIZE_MAX
# define SIZE_MAX TYPE_MAXIMUM (size_t)
#endif
#ifndef SSIZE_MAX
# define SSIZE_MAX TYPE_MAXIMUM (ssize_t)
#endif
#ifndef UINTMAX_MAX
# define UINTMAX_MAX TYPE_MAXIMUM (uintmax_t)
#endif
#ifndef OFF_T_MIN
# define OFF_T_MIN TYPE_MINIMUM (off_t)
#endif
#ifndef OFF_T_MAX
# define OFF_T_MAX TYPE_MAXIMUM (off_t)
#endif
#ifndef UID_T_MAX
# define UID_T_MAX TYPE_MAXIMUM (uid_t)
#endif
#ifndef GID_T_MAX
# define GID_T_MAX TYPE_MAXIMUM (gid_t)
#endif
#ifndef PID_T_MAX
# define PID_T_MAX TYPE_MAXIMUM (pid_t)
#endif
/* Use this to suppress gcc's `...may be used before initialized' warnings. */
#ifdef lint
# define IF_LINT(Code) Code
#else
# define IF_LINT(Code) /* empty */
#endif
#ifndef __attribute__
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
# define __attribute__(x)
# endif
#endif
#ifndef ATTRIBUTE_NORETURN
# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
#endif
#ifndef ATTRIBUTE_UNUSED
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#endif
#if defined strdupa
# define ASSIGN_STRDUPA(DEST, S) \
do { DEST = strdupa (S); } while (0)
#else
# define ASSIGN_STRDUPA(DEST, S) \
do \
{ \
const char *s_ = (S); \
size_t len_ = strlen (s_) + 1; \
char *tmp_dest_ = alloca (len_); \
DEST = memcpy (tmp_dest_, (s_), len_); \
} \
while (0)
#endif
#ifndef EOVERFLOW
# define EOVERFLOW EINVAL
#endif
#if ! HAVE_FSEEKO && ! defined fseeko
# define fseeko(s, o, w) ((o) == (long int) (o) \
? fseek (s, o, w) \
: (errno = EOVERFLOW, -1))
#endif
/* Compute the greatest common divisor of U and V using Euclid's
algorithm. U and V must be nonzero. */
static inline size_t
gcd (size_t u, size_t v)
{
do
{
size_t t = u % v;
u = v;
v = t;
}
while (v);
return u;
}
/* Compute the least common multiple of U and V. U and V must be
nonzero. There is no overflow checking, so callers should not
specify outlandish sizes. */
static inline size_t
lcm (size_t u, size_t v)
{
return u * (v / gcd (u, v));
}
/* Return PTR, aligned upward to the next multiple of ALIGNMENT.
ALIGNMENT must be nonzero. The caller must arrange for ((char *)
PTR) through ((char *) PTR + ALIGNMENT - 1) to be addressable
locations. */
static inline void *
ptr_align (void *ptr, size_t alignment)
{
char *p0 = ptr;
char *p1 = p0 + alignment - 1;
return p1 - (size_t) p1 % alignment;
}

View File

@ -17,7 +17,6 @@ SUBDIR= ${_binutils} \
${_rcs} \
sdiff \
send-pr \
sort \
${_texinfo}
.if ${MK_CXX} != "no"

View File

@ -1,46 +0,0 @@
# $FreeBSD$
SORTDIR= ${.CURDIR}/../../../contrib/gnu-sort
.PATH: ${SORTDIR}/lib ${SORTDIR}/src ${SORTDIR}/man
.include <bsd.own.mk>
.if ${MK_GNU_SORT} == "yes"
PROG= sort
.else
PROG= gnusort
CLEANFILES+= gnusort.1
gnusort.1: sort.1
cp ${.ALLSRC} ${.TARGET}
.endif
SRCS= sort.c \
__fpending.c \
argmatch.c \
closeout.c \
dup-safer.c \
error.c \
exitfail.c \
fopen-safer.c \
hard-locale.c \
human.c \
long-options.c \
memcoll.c \
physmem.c \
posixver.c \
quote.c \
quotearg.c \
strnlen.c \
umaxtostr.c \
version-etc.c \
xalloc-die.c \
xmalloc.c \
xmemcoll.c \
xstrtoul.c \
xstrtoumax.c
CFLAGS+=-DHAVE_CONFIG_H -DHAVE_LANGINFO_H=1 -DHAVE_NL_LANGINFO=1 \
-I${.CURDIR} -I${SORTDIR}/lib
.include <bsd.prog.mk>

View File

@ -1,2 +0,0 @@
/* $FreeBSD$ */
extern void *alloca(size_t size);

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
/* $FreeBSD$ */
#define LOCALEDIR ""

View File

@ -1,2 +0,0 @@
/* $FreeBSD$ */
/* Dummy file for trimmed down sort */

View File

@ -1,2 +0,0 @@
.\" $FreeBSD$
Install GNU-licensed sort as 'sort' instead of BSD sort.

View File

@ -2,15 +2,7 @@
.include <bsd.own.mk>
.if ${MK_GNU_SORT} != "yes"
PROG= sort
.else
PROG= bsdsort
CLEANFILES+= bsdsort.1
bsdsort.1: sort.1
cp ${.ALLSRC} ${.TARGET}
.endif
SRCS= bwstring.c coll.c file.c mem.c radixsort.c sort.c vsort.c