*** empty log message ***

This commit is contained in:
Kevin Dalley 2000-04-12 10:18:08 +00:00
parent d419e9f001
commit 491aaa41f5
79 changed files with 5500 additions and 3537 deletions

View File

@ -1,5 +1,4 @@
Makefile
Makefile.in
config.cache
config.h
config.log

View File

@ -291,7 +291,7 @@ 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) 19yy <name of author>
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
@ -313,7 +313,7 @@ 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) 19yy name of author
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.

291
ChangeLog
View File

@ -1,3 +1,281 @@
2000-04-12 Kevin Dalley <kevind@rahul.net>
* doc/find.texi, doc/permi.texi: fix spellings, add LocalWords.
* lib/Makefile.am: put getline.c back into libfind_a_SOURCES,
since getstr is needed.
* Version 4.1.5
* po/POTFILES.in: updated list of files, updated po files.
2000-04-02 Paul Eggert <eggert@twinsun.com>
Add support for large files, and port to Solaris 8 and earlier
versions.
* lib/human.c (getenv): Depend on NEED_GETENV_DECL, not
HAVE_DECL_GETENV.
* lib/strftime.c (my_strftime): Make sure we call the system
strftime, not ourselves, when invoking the underlying strftime.
* m4/check-decl.m4 (jm_CHECK_DECLS): Remove memchr, nanosleep.
* m4/jm-macros.m4 (jm_MACROS): Don't check for utime.h. Do not
require jm_BISON, jm_CHECK_TYPE_STRUCT_UTIMBUF, jm_FUNC_LCHOWN,
jm_FUNC_CHOWN, jm_FUNC_NANOSLEEP, jm_FUNC_GROUP_MEMBER,
jm_FUNC_PUTENV, jm_FUNC_GETGROUPS, AM_FUNC_GETLOADAVG,
jm_SYS_PROC_UPTIME, jm_FUNC_FTRUNCATE, jm_FUNC_UTIME. Do not
replace strcasecmp, dup2, gethostname, getusershell, stime,
strcspn, strpbrk, euidaccess, mkdir, rmdir, rpmatch, strndup,
strverscmp, memchr, memmove. Do not check for declaration of
lchown. Remove invocations of AM_FUNC_OBSTACK, AM_FUNC_STRTOD,
POW_LIBM, jm_LANGINFO_CODESET, jm_ICONV. Remove df tests.
(jm_CHECK_ALL_TYPES): Include <sys/stat.h> when checking for
struct stat.st_blksize.
* m4/strftime.m4 (jm_FUNC_GNU_STRFTIME): Set environment variable
in shell rather than using putenv, which isn't portable.
* COPYING, lib/alloca.c, lib/dirname.c, lib/error.c,
lib/savedir.c, lib/strstr.c, m4/check-decl.m4, m4/d-ino.m4,
m4/d-type.m4, m4/getline.m4, m4/jm-glibc-io.m4, m4/jm-macros.m4,
m4/jm-mktime.m4, m4/ls-mntd-fs.m4, m4/memcmp.m4, m4/prereq.m4,
m4/readdir.m4, m4/regex.m4, m4/strftime.m4, m4/uintmax_t.m4: Sync
to latest version from sh-utils-2.0g.
* config.guess, config.sub, lib/argmatch.c, lib/argmatch.h,
lib/human.c, lib/human.h, lib/memcpy.c, lib/quotearg.c,
lib/quotearg.h, lib/strtoull.c, lib/strtoumax.c,
lib/xstrtoumax.c, m4/c-bs-a.m4, m4/gettext.m4,
m4/largefile.m4, m4/lcmessage.m4, m4/link-follow.m4,
m4/progtest.m4, m4/strerror_r.m4, m4/timespec.m4,
m4/xstrtoumax.m4: New files, taken from sh-utils-2.0g.
* lib/ansi2knr.1, lib/ansi2knr.c, lib/basename.c, lib/getopt.h,
lib/fnmatch.c, lib/fnmatch.h, lib/modechange.c: Sync to latest
unreleased version of GNU tar (between 1.13.17 and 1.13.18).
* lib/basename.h, lib/waitpid.c: New files, taken from same
version of GNU tar.
* lib/regex.c, lib/regex.h: Sync to GNU grep 2.4.2.
* lib/posix/Makefile.am, lib/posix/regex.h: New files, taken from
GNU grep 2.4.2.
* lib/strftime.c: Sync to textutils 2.0e.
* acconfig.h, depcomp, lib/strcasecmp.c, m4/check-type.m4,
m4/const.m4, m4/decl.m4, m4/lfs.m4, m4/mktime.m4, m4/perl.m4,
m4/putenv.m4, m4/uptime.m4, m4/utimbuf.m4, m4/utime.m4,
m4/utimes.m4: Remove these files; no longer needed.
* configure.in (AC_CANONICAL_HOST, AC_SYS_LARGEFILE,
jm_AC_TYPE_UINTMAX_T): Add.
(CACHE_IDS, FSTYPE_STATVFS, FSTYPE_USG_STATFS, FSTYPE_AIX_STATFS,
FSTYPE_MNTENT, FSTYPE_STATFS, FSTYPE_GETMNT): Add comment, so that
we don't need acconfig.h.
(AC_CHECK_TYPE): Add ssize_t.
(AC_REPLACE_FUNCS): Add waitpid.
(AC_CHECK_FUNCS): Remove basename.
(AC_FUNC_MKTIME): Remove.
(LIBOBJS): Add no-ops to work around automake 1.4 bug.
(AC_OUTPUT): Add lib/posix/Makefile.
* find/defs.h: Include <config.h>, <sys/types.h>, <sys/stat.h>,
<stdio.h>, <limits.h>, <inttypes.h>. All includers changed to not
include these files, and to include "defs.h" first (since config.h
must be included first).
(CHAR_BIT, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, MOD_WXUSR,
MODE_R, MODE_RW, MODE_RWX, MODE_ALL): New macros.
(enum permissions_type): New enum.
(struct long_val.negative): New member.
(struct long_val.l_val): Now uintmax_t, not unsigned long.
(struct size_val.size): Likewise.
(struct perm_val): New type.
(struct predicate.perm): Now struct perm_val, not unsigned long.
(struct predicate.type): Now mode_t, not unsigned long.
(list_file): New parameters current_time, output_block_size.
All callers changed.
(savedir, basename): Remove decls.
(output_block_size, start_time): New extern vars.
* find/find.c: Include <human.h>, <savedir.h>.
(output_block_size, start_time): New vars.
(main): Initialize them. No need to check for negative st_size,
since savedir now does it for us.
* find/fstype.c: Include "dirname.h".
(xatoi): Remove.
(filesystem_type_uncached): Use xstrtoumax instead of xatoi.
* find/parser.c: Include "xstrtol.h".
(get_num_days, get_num, parse_amin, parse_cmin, parse_mmin,
parse_size, parse_used, insert_time, insert_num): Compute using
uintmax_t, not unsigned long.
(parse_amin, parse_cmin, parse_mmin, parse_used, insert_time):
Keep track of whether time was negative before converting it to an
unsigned type.
(parse_daystart): Don't assume that localtime succeeds; e.g. it
can fail with 64-bit time_t and 32-bit tm_year.
(parse_perm, insert_type): Compute using mode_t, not unsigned
long.
(insert_type): Use symbolic constants like MODE_ALL instead of
traditional ones like 07777. Set new kind member to indicate
permissions type, instead of using unportable magic numbers.
(make_segment): We will use human_readable to convert most numeric
values, so simplify the cases.
(get_num_days): Write in terms of get_num, to avoid duplicated
code.
(insert_time, insert_num): When debugging, convert large values to
uintmax_t and output with %ju.
(get_num): Use xstrtoumax to do the real work.
* find/pred.c: Include "basename.h", "human.h".
(DEV_BSIZE, ST_BLKSIZE, ST_NBLOCKSIZE): New macros, taken from
fileutils.
(ST_NBLOCKS): Replace with fileutils defn.
(MAX): New macro.
(ctime_format): New function.
(pred_fprintf, format_date): Use human_readable to output large
numbers portably.
(pred_fprintf): Use ctime_format to output ctime-style dates. Use
base_name to compute the base name of a path. With %m, output the
mode portably using traditional numbers, even if the host uses
some other numbering scheme.
(pred_iname, pred_name): basename -> base_name.
(pred_perm): Use new kind member to deduce permissions type,
instead of relying on magic numbers.
(pred_size): Compute using uintmax_t, not unsigned long. Avoid
overflow if file size is near the maximum.
(pred_type): Compute using mode_t, not unsigned long.
(launch): Use waitpid, not wait. Check for EINTR.
(format_date): Don't assume that localtime succeeds.
* find/util.c (basename): Remove; we now use base_name.
* lib/Makefile.am (SUBDIRS): New macro.
(libfind_a_SOURCES): Add argmatch.h, argmatch.c, basename.h,
basename.c, human.c, human.h, quotearg.c, quotearg.h, xstrtoumax.c.
Remove error.h, error.c, getline.c.
(EXTRA_DIST): Add mktime.c, regex.c.
* lib/listfile.c: Include "human.h".
(alloca): Declare, or include appropriate files to declare.
(DEV_BSIZE, ST_NBLKSIZE, ST_NBLOCKS, ST_NBLOCKSIZE): New macros.
(convert_blocks): Remove.
(list_file): New current_time and output_block_size args.
Revamp quite a bit, to handle large numbers correctly
and to match GNU ls behavior more closely.
* m4/Makefile.am (EXTRA_DIST): Add c-bs-a.m4, gettext.m4,
largefile.m4, lcmessage.m4, link-follow.m4, progtest.m4,
strerror_r.m4, xstrtoumax.m4. Remove check-type.m4, const.m4,
decl.m4, lfs.m4, mktime.m4, perl.m4, putenv.m4, timespec.m4,
uptime.m4, utimbuf.m4, utime.m4, utimes.m4.
* xargs/xargs.c (wait_for_proc): Retry wait if it fails with
errno == EINTR.
2000-04-05 Kevin Dalley <kevind@rahul.net>
* xargs/Makefile.am: add ansi2knr
* xargs/xargs.c: add macros PARAMS rather than P_. Add
prototypes.
* po/POTFILES: new file listing all POFILES.
* m4/gl.po, m4/et.po: new files
* m4/Makefile.am.in: updated file
* m4: update directory
* locate/Makefile.am: create updatedb from updatedb.sh
* locate/updatedb.sh, locate/updatedb.in: removed file. Replaced
by updatedb.sh
* locate/frcode.c, locate/code.c, locate/bigram.c: add macros
PARAMS rather than P_. Add prototypes.
* lib/xstat.in: new file
* lib/Makefile.am: update to latest versions of library files.
* find/testsuite/Makefile.am: add CLEANFILES
* find/util.c: remove definition of basename
* find/util.c, find/tree.c, find/pred.c, find/parser.c,
find/fstype.c, find/find.c, find/defs.h: add macros PARAMS rather
than P_, for consistency, change to prototypes
* find/Makefile.am: Add prototypes and ansi2knr
* configure.in: add Galition and Estonian languages.
Miscellaneous other fixes.
2000-03-11 Kevin Dalley <kevind@rahul.net>
* lib/basename.c: Add file from libit.
* lib/Makefile.am (libfind_a_SOURCES): add basename.c since it is
no longer replaceable.
* find/util.c: Remove definition of basename, which is now in
lib/basename.c (as base_name).
* find/pred.c: Use base_name, not basename.
* find/defs.h: Likewise.
* configure.in : Don't replace basename. Now we use only
base_name.
2000-02-26 Kevin Dalley <kevind@rahul.net>
* Version 4.1.4
* lib/strtoul.c: added to distribution
* configure.in: added strtoul to AC_REPLACE_FUNCS
* configure.in: added jm_CHECK_ALL_TYPE
2000-02-23 Kevin Dalley <kevind@rahul.net>
* po/ChangeLog: removed, merged with top-level ChangeLog.
* po/de.po: new version of German file.
* po/gl.po, po/et.po: new languages, Estonian and Galician.
* locate/updatedb.sh (PRUNEFS): enclose paths in quotes
2000-02-17 Kevin Dalley <kevind@rahul.net>
* po/it.po: new version of Italian file.
* locate/updatedb.sh (prunefs_exp): have sed statement use '*'
rather than the often unsupported '+'.
2000-02-13 Kevin Dalley <kevind@rahul.net>
* configure.in: removed AC_ARG_PROGRAM, which is already in
AM_INIT_AUTOMAKE.
* locate/Makefile.am (updatedb), locate/updatedb.sh: add
transforms of find, frcode, bigram, and code back into
updatedb.sh, which were accidentally removed.
2000-02-12 Kevin Dalley <kevind@rahul.net>
* lib/wait.h: updated address.
2000-01-26 Kevin Dalley <kevind@rahul.net>
* Version 4.1.3
@ -14,6 +292,17 @@
* xargs/Makefile.am, xargs/xargs.c: internationalized directory.
2000-01-26 Kevin Dalley <kevind@rahul.net>
* POTFILES.in: added list of files with translatable strings.
* de.po, es.po, fr.po, it.po, ko.po, nl.po, pl.po, pt_BR.po,
ru.po, sv.po: New, slightly out of date, files imported from the
Translation Project: http://www.iro.umontreal.ca/contrib/po/HTML/,
German, Spanish, French, Italian, Korean, Dutch, Polish, Brazilian
Portuguese.
2000-01-24 Kevin Dalley <kevind@rahul.net>
* lib/xmalloc.c, lib/regex.c, lib/getopt.c: internationalization
@ -41,7 +330,7 @@
2000-01-22 Kevin Dalley <kevind@rahul.net>
* added po and intl directories.
* added intl directory.
* Added internationalization, only with slightly out of date po
files for many locales.

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -10,7 +10,6 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
@ -32,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@ -46,9 +43,10 @@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
@ -57,14 +55,27 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CPP = @CPP@
CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INCLUDES = @INCLUDES@
@ -75,8 +86,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@ -85,51 +99,56 @@ U = @U@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
install_sh = @install_sh@
l = @l@
AUTOMAKE_OPTIONS = gnits readme-alpha
EXTRA_DIST = COPYING ChangeLog TODO install-sh config.h.in stamp-h.in THANKS
EXTRA_DIST = COPYING ChangeLog TODO install-sh config.h.in stamp-h.in \
THANKS
SUBDIRS = lib intl find xargs locate doc m4 po
ACLOCAL_AMFLAGS = -I m4
DISTCLEANFILES = intl/libintl.h
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \
INSTALL Makefile.am Makefile.in NEWS README-alpha THANKS TODO \
acconfig.h aclocal.m4 config.h.in configure configure.in install-sh \
missing mkinstalldirs
aclocal.m4 config.guess config.h.in config.sub configure configure.in \
install-sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(ACLOCAL_M4): configure.in m4/assert.m4 m4/check-decl.m4 \
m4/check-type.m4 m4/const.m4 m4/decl.m4 m4/error.m4 \
$(ACLOCAL_M4): configure.in m4/afs.m4 m4/assert.m4 m4/c-bs-a.m4 \
m4/check-decl.m4 m4/d-ino.m4 m4/d-type.m4 m4/error.m4 \
m4/fnmatch.m4 m4/fstypename.m4 m4/getline.m4 \
m4/glibc.m4 m4/inttypes_h.m4 m4/isc-posix.m4 \
m4/jm-glibc-io.m4 m4/jm-macros.m4 m4/jm-mktime.m4 \
m4/lfs.m4 m4/ls-mntd-fs.m4 m4/lstat.m4 m4/malloc.m4 \
m4/memcmp.m4 m4/mktime.m4 m4/perl.m4 m4/prereq.m4 \
m4/putenv.m4 m4/readdir.m4 m4/realloc.m4 m4/regex.m4 \
m4/gettext.m4 m4/glibc.m4 m4/inttypes_h.m4 \
m4/isc-posix.m4 m4/jm-glibc-io.m4 m4/jm-macros.m4 \
m4/jm-mktime.m4 m4/largefile.m4 m4/lcmessage.m4 \
m4/link-follow.m4 m4/ls-mntd-fs.m4 m4/lstat-slash.m4 \
m4/lstat.m4 m4/malloc.m4 m4/memcmp.m4 m4/prereq.m4 \
m4/progtest.m4 m4/readdir.m4 m4/realloc.m4 m4/regex.m4 \
m4/st_dm_mode.m4 m4/st_mtim.m4 m4/stat.m4 \
m4/strftime.m4 m4/uintmax_t.m4 m4/uptime.m4 \
m4/utimbuf.m4 m4/utime.m4 m4/utimes.m4
m4/strerror_r.m4 m4/strftime.m4 m4/timespec.m4 \
m4/uintmax_t.m4 m4/ulonglong.m4 m4/xstrtoumax.m4
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -143,18 +162,22 @@ config.h: stamp-h
$(MAKE) stamp-h; \
else :; fi
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h stamp-hT
@echo timestamp > stamp-hT 2> /dev/null
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
$(SHELL) ./config.status
@echo timestamp > stamp-h 2> /dev/null
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
@mv stamp-hT stamp-h
$(srcdir)/config.h.in: $(srcdir)/./stamp-h.in
@if test ! -f $@; then \
rm -f $(srcdir)/stamp-h.in; \
$(MAKE) $(srcdir)/stamp-h.in; \
rm -f $(srcdir)/./stamp-h.in; \
$(MAKE) $(srcdir)/./stamp-h.in; \
else :; fi
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
@rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT
@echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null
cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
@mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in
mostlyclean-hdr:
@ -172,8 +195,6 @@ maintainer-clean-hdr:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@ -201,7 +222,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
if test "$$subdir" = "."; then dot_seen=yes; else :; fi; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
@ -222,15 +243,17 @@ tags-recursive:
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
mkid -fID $$unique $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
@ -238,12 +261,14 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LI
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
|| etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP)
mostlyclean-tags:
@ -257,58 +282,71 @@ maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
-rm -rf $(distdir)
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \
chmod a-w $(distdir)
dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
&& cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
--with-included-gettext \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) dist
-rm -rf $(distdir)
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& test `find $$dc_install_base -type f -print | wc -l` -le 1 \
&& chmod -R u+w .. \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& $(MAKE) $(AM_MAKEFLAGS) distclean \
&& rm -f $(distdir).tar.gz \
&& test `find . -type f -print | wc -l` -eq 0
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
@banner="$(distdir).tar.gz is ready for distribution"; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"
dist: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
distdir: $(DISTFILES)
@if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" > /dev/null; then :; else \
echo "NEWS not updated; not releasing" 1>&2; \
exit 1; \
fi
-rm -rf $(distdir)
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
for subdir in $(SUBDIRS); do \
@ -316,7 +354,6 @@ distdir: $(DISTFILES)
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
@ -346,7 +383,7 @@ uninstall: uninstall-recursive
all-am: Makefile config.h
all-redirect: all-recursive-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs: installdirs-recursive
installdirs-am:
@ -361,6 +398,7 @@ distclean-generic:
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
-rm -f Makefile.in
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-recursive
@ -383,7 +421,8 @@ maintainer-clean: maintainer-clean-recursive
-rm -f config.status
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
install-data-recursive uninstall-data-recursive install-exec-recursive \
install-recursive uninstall-recursive install-data-recursive \
uninstall-data-recursive install-exec-recursive \
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
@ -391,9 +430,10 @@ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
install-exec-am install-exec install-data-am install-data install-am \
install uninstall-am uninstall all-redirect all-am all installdirs-am \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
install uninstall-am uninstall all-redirect all-am all install-strip \
installdirs-am installdirs mostlyclean-generic distclean-generic \
clean-generic maintainer-clean-generic clean mostlyclean distclean \
maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.

88
NEWS
View File

@ -1,58 +1,74 @@
Major changes in release 4.1.3:
* added internationalization and localization.
GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
* Major changes in release 4.1.5:
Add support for large files
Major changes in release 4.1.1:
* attempt at successful compilation on many platforms after years of neglect
* "--existing" option added to locate "--prunefs" option added to updatedb
* Major changes in release 4.1.4:
bug fixes, more up-to-date languages.
Major changes in release 4.1:
* Major changes in release 4.1.3:
added internationalization and localization.
* Distribution renamed to findutils.
* updatedb is now a user command, installed in $exec_prefix/bin
* Major changes in release 4.1.1:
attempt at successful compilation on many platforms after years of neglect
"--existing" option added to locate "--prunefs" option added to updatedb
* Major changes in release 4.1:
** Distribution renamed to findutils.
** updatedb is now a user command, installed in $exec_prefix/bin
instead of $exec_prefix/libexec.
* A few problems in Makefiles and testsuite corrected.
** A few problems in Makefiles and testsuite corrected.
Major changes in release 4.0:
* Major changes in release 4.0:
* Documentation:
** Texinfo manual.
** Man page for updatedb.
** Man page for the locate database formats.
** Documentation:
*** Texinfo manual.
*** Man page for updatedb.
*** Man page for the locate database formats.
* find:
** Takes less CPU time on long paths, because it uses chdir to descend
** find:
*** Takes less CPU time on long paths, because it uses chdir to descend
trees, so it does fewer inode lookups.
** Does not get trapped in symbolic link loops when -follow is given.
** Supports "-fstype afs" if you have /afs and /usr/afsws/include
*** Does not get trapped in symbolic link loops when -follow is given.
*** Supports "-fstype afs" if you have /afs and /usr/afsws/include
and you configure using the --with-afs option.
** New action -fls FILE; like -ls but writes to FILE.
*** New action -fls FILE; like -ls but writes to FILE.
* locate:
** Supports a new database format, which is 8-bit clean and
allows machines with diffent byte orderings and integer sizes to
** locate:
*** Supports a new database format, which is 8-bit clean and
allows machines with different byte orderings and integer sizes to
share the databases. The new locate can also detect and read the
old database format automatically. The new databases are typically
30% or more larger than the old ones (due to allowing all 8 bits in
file names). Search times are approximately the same, or faster on
some systems.
** Warns if a file name database is more than 8 days old.
*** Warns if a file name database is more than 8 days old.
* updatedb:
** Takes command-line options.
** updatedb:
*** Takes command-line options.
* xargs:
** Performance improved 10-20%.
** The EOF string is not used when -0 is given.
** Now has a test suite. Some minor bugs fixed as a result.
** xargs:
*** Performance improved 10-20%.
*** The EOF string is not used when -0 is given.
*** Now has a test suite. Some minor bugs fixed as a result.
Major changes in release 3.8:
* Major changes in release 3.8:
* case insensitive versions of -lname, -name, -path, -regex:
** case insensitive versions of -lname, -name, -path, -regex:
-ilname, -iname, -ipath, -iregex
* %F directive for -printf, -fprintf to print file system type
** %F directive for -printf, -fprintf to print file system type
Major changes in release 3.7:
* Major changes in release 3.7:
* locate can search multiple databases
* locate has an option to specify the database path
* updatedb no longer goes into an infinite loop with some versions of tail
** locate can search multiple databases
** locate has an option to specify the database path
** updatedb no longer goes into an infinite loop with some versions of tail
--//--
This is used by Emacs' spell checker ispell.el:
LocalWords: ansi knr strftime xargs updatedb sh fnmatch hin strcpy
LocalWords: lib getstr getline frcode bigram texi depcomp automake
LocalWords: strncasecmp strcasecmp LIBOBJS FUNC prunefs allout libexec
LocalWords: testsuite Texinfo chdir inode fstype afs fls ls EOF lname
LocalWords: regex ilname iname ipath iregex printf fprintf

63
TODO
View File

@ -1,28 +1,59 @@
There are many bugs to be fixed and features to be added to
findutils. The current distribution is a snapshot which fixes many
-*-outline-*-
* There are many bugs to be fixed and features to be added to findutils.
The current distribution is a snapshot which fixes many
problems, but leaves others unsolved. Many of the known problems are
not listed below. Over the next few releases, I hope to fix more
items, and add the unfixed problems below.
Is ansi2knr internationalized? Does it need to be?
Should these files be internationalized?
* Internationalization
** Is ansi2knr internationalized? Does it need to be?
** Should these files be internationalized?
strftime.c
Should translated long options be offered in locate and xargs?
updatedb.sh should be internationalized as well
Add case insensitive locate option. Patch is available.
** Should translated long options be offered in locate and xargs?
** updatedb.sh should be internationalized as well
Should fnmatch.h be a link to fnmatch.hin. See tar distribution for
an example.
* new standards with Austin group
** "-H" and "-L" options to find were added by Austin group standards.
They need to be implemented.
Eliminate unnecessary strcpy calls in xargs.
**Austin added the following options to xargs:
-I perhaps replaces -i
lib/getline.c contains a function getstr which is needed in locate,
-L perhaps replaces -l
-E slightly different from -e
* Add case insensitive locate option. Patch is available.
* Should fnmatch.h be a link to fnmatch.hin?
See tar distribution for an example.
* Eliminate unnecessary strcpy calls in xargs.
* lib/getline.c
getline.c contains a function getstr which is needed in locate,
but is not in the standard library. In fact getstr is in curses.
This problem needs to be fixed. Can getstr be removed? Can getline.c
be optionally included?
be optionally included, or is it mandatory?
Files which were modified in findutils/lib:
changed in findutils:
getline.c (skipped for now)
nextelem.c (twice)
* man pages for frcode, bigram, and code
Perhaps a better description in texi pages as well.
* large file problems
depcomp gets added by automake
strncasecmp is needed
which requires strcasecmp
getline.c temporarily removed from Makefile.am
remove getline.o from LIBOBJS
remove extra AM_FUNC_GETLINE
--//--
This is used by Emacs' spell checker ispell.el:
LocalWords: ansi knr strftime xargs updatedb sh fnmatch hin strcpy
LocalWords: lib getstr getline frcode bigram texi depcomp automake
LocalWords: strncasecmp strcasecmp LIBOBJS FUNC

View File

@ -1,75 +0,0 @@
/* Entries for config.h.in that aren't automatically generated. */
/* Define if you have the Andrew File System. */
#undef AFS
/* Define If you want find -nouser and -nogroup to make tables of
used UIDs and GIDs at startup instead of using getpwuid or
getgrgid when needed. Speeds up -nouser and -nogroup unless you
are running NIS or Hesiod, which make password and group calls
very expensive. */
#undef CACHE_IDS
/* Define to use SVR4 statvfs to get filesystem type. */
#undef FSTYPE_STATVFS
/* Define to use SVR3.2 statfs to get filesystem type. */
#undef FSTYPE_USG_STATFS
/* Define to use AIX3 statfs to get filesystem type. */
#undef FSTYPE_AIX_STATFS
/* Define to use 4.3BSD getmntent to get filesystem type. */
#undef FSTYPE_MNTENT
/* Define to use 4.4BSD and OSF1 statfs to get filesystem type. */
#undef FSTYPE_STATFS
/* Define to use Ultrix getmnt to get filesystem type. */
#undef FSTYPE_GETMNT
/* Define to `unsigned long' if <sys/types.h> doesn't define. */
#undef dev_t
/* Define to `unsigned long' if <sys/types.h> doesn't define. */
#undef ino_t
/* Define to rpl_fnmatch if the replacement function should be used. */
#undef fnmatch
/* Define to 1 if assertions should be disabled. */
#undef NDEBUG
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
/* Define to rpl_memcmp if the replacement function should be used. */
#undef memcmp
/* Define to gnu_mktime if the replacement function should be used. */
#undef mktime
/* Define to rpl_realloc if the replacement function should be used. */
#undef realloc
/* Define to `int' if <sys/types.h> doesn't define. */
#undef ssize_t
/* Define to `unsigned long' or `unsigned long long'
if <inttypes.h> doesn't define. */
#undef uintmax_t
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define to 1 if NLS is requested. */
#undef ENABLE_NLS
/* Define as 1 if you have catgets and don't want to use GNU gettext. */
#undef HAVE_CATGETS
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
/* Define as 1 if you have the stpcpy function. */
#undef HAVE_STPCPY

2009
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,3 @@
Makefile
Makefile.in
stamp-vti
version.texi

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@ -84,8 +86,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@ -122,7 +127,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -246,7 +251,6 @@ dist-info: $(INFO_DEPS)
d=$(srcdir); \
for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done; \
done
@ -278,11 +282,12 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir); \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info

View File

@ -27,7 +27,7 @@ translation approved by the Foundation.

Indirect:
find.info-1: 1079
find.info-2: 50723
find.info-2: 50724

Tag Table:
(Indirect)
@ -77,36 +77,36 @@ Node: Unsafe File Name Handling42082
Node: Safe File Name Handling43632
Node: Limiting Command Size44317
Node: Interspersing File Names46072
Node: Querying47131
Node: Adding Tests48045
Node: Common Tasks50307
Node: Viewing And Editing50723
Node: Archiving51234
Node: Cleaning Up52866
Node: Strange File Names54391
Node: Fixing Permissions56021
Node: Classifying Files56580
Node: Databases57298
Node: Database Locations57912
Node: Database Formats60217
Node: New Database Format60868
Node: Sample Database62430
Node: Old Database Format63069
Node: File Permissions64799
Node: Mode Structure65367
Node: Symbolic Modes67495
Node: Setting Permissions68492
Node: Copying Permissions71028
Node: Changing Special Permissions71829
Node: Conditional Executability73664
Node: Multiple Changes74281
Node: Umask and Protection75928
Node: Numeric Modes77017
Node: Reference78847
Node: Invoking find79145
Node: Invoking locate80192
Node: Invoking updatedb81121
Node: Invoking xargs82671
Node: Primary Index85741
Node: Querying47132
Node: Adding Tests48046
Node: Common Tasks50308
Node: Viewing And Editing50724
Node: Archiving51235
Node: Cleaning Up52867
Node: Strange File Names54392
Node: Fixing Permissions56022
Node: Classifying Files56581
Node: Databases57299
Node: Database Locations57913
Node: Database Formats60218
Node: New Database Format60871
Node: Sample Database62433
Node: Old Database Format63072
Node: File Permissions64802
Node: Mode Structure65370
Node: Symbolic Modes67498
Node: Setting Permissions68495
Node: Copying Permissions71031
Node: Changing Special Permissions71832
Node: Conditional Executability73667
Node: Multiple Changes74284
Node: Umask and Protection75931
Node: Numeric Modes77020
Node: Reference78850
Node: Invoking find79148
Node: Invoking locate80195
Node: Invoking updatedb81124
Node: Invoking xargs82674
Node: Primary Index85745

End Tag Table

View File

@ -29,7 +29,7 @@ File: find.info, Node: Top, Next: Introduction, Up: (dir)
This file documents the GNU utilities for finding files that match
certain criteria and performing various actions on them. This is
edition 4.1.4, for `find' version 4.1.4.
edition 4.1.5, for `find' version 4.1.5.
* Menu:
@ -1469,7 +1469,7 @@ operation is equivalent to `find -exec' (*note Single File::).
`--replace[=REPLACE-STR]'
`-i[REPLACE-STR]'
Replace occurences of REPLACE-STR in the initial arguments with
Replace occurrences of REPLACE-STR in the initial arguments with
names read from standard input. Also, unquoted blanks do not
terminate arguments. If REPLACE-STR is omitted, it defaults to
`{}' (like for `find -exec'). Implies `-x' and `-l 1'. As an

View File

@ -289,7 +289,7 @@ Database Formats
The file name databases contain lists of files that were in
particular directory trees when the databases were last updated. The
file name database format changed starting with GNU `locate' version
4.0 to allow machines with diffent byte orderings to share the
4.0 to allow machines with different byte orderings to share the
databases. The new GNU `locate' can read both the old and new database
formats. However, old versions of `locate' and `find' produce incorrect
results if given a new-format database.
@ -982,7 +982,7 @@ Invoking `xargs'
`--replace[=REPLACE-STR]'
`-i[REPLACE-STR]'
Replace occurences of REPLACE-STR in the initial arguments with
Replace occurrences of REPLACE-STR in the initial arguments with
names read from standard input. Also, unquoted blanks do not
terminate arguments. If REPLACE-STR is omitted, it defaults to
`{}' (like for `find -exec'). Implies `-x' and `-l 1'.

View File

@ -1,4 +1,3 @@
.deps
Makefile
Makefile.in
find

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@ -83,8 +85,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@ -133,16 +138,16 @@ man1dir = $(mandir)/man1
MANS = $(man_MANS)
NROFF = nroff
depcomp = $(SHELL) $(top_srcdir)/depcomp
DEP_FILES = @AMDEP@ $(DEPDIR)/find$U.Po $(DEPDIR)/fstype$U.Po \
$(DEPDIR)/parser$U.Po $(DEPDIR)/pred$U.Po $(DEPDIR)/tree$U.Po \
$(DEPDIR)/util$U.Po $(DEPDIR)/version$U.Po
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
depcomp = $(SHELL) $(top_srcdir)/depcomp
DEP_FILES = @AMDEP@ $(DEPDIR)/find$U.Po $(DEPDIR)/fstype$U.Po \
$(DEPDIR)/parser$U.Po $(DEPDIR)/pred$U.Po $(DEPDIR)/tree$U.Po \
$(DEPDIR)/util$U.Po $(DEPDIR)/version$U.Po
SOURCES = $(find_SOURCES)
OBJECTS = $(am_find_OBJECTS)
@ -152,7 +157,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu find/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -213,22 +218,73 @@ maintainer-clean-kr:
find: $(find_OBJECTS) $(find_DEPENDENCIES)
@rm -f find
$(LINK) $(find_LDFLAGS) $(find_OBJECTS) $(find_LDADD) $(LIBS)
alloca_.c: alloca.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c
error_.c: error.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > error_.c
fileblocks_.c: fileblocks.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fileblocks_.c
find_.c: find.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/find.c; then echo $(srcdir)/find.c; else echo find.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > find_.c
fnmatch_.c: fnmatch.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fnmatch_.c
fstype_.c: fstype.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fstype.c; then echo $(srcdir)/fstype.c; else echo fstype.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fstype_.c
lstat_.c: lstat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > lstat_.c
malloc_.c: malloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c
memcmp_.c: memcmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcmp_.c
memcpy_.c: memcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcpy_.c
memset_.c: memset.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memset_.c
mktime_.c: mktime.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mktime_.c
parser_.c: parser.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/parser.c; then echo $(srcdir)/parser.c; else echo parser.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > parser_.c
pred_.c: pred.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/pred.c; then echo $(srcdir)/pred.c; else echo pred.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > pred_.c
realloc_.c: realloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c
regex_.c: regex.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > regex_.c
stat_.c: stat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stat_.c
stpcpy_.c: stpcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c
strdup_.c: strdup.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strdup_.c
strftime_.c: strftime.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strftime_.c
strncasecmp_.c: strncasecmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strncasecmp.c; then echo $(srcdir)/strncasecmp.c; else echo strncasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strncasecmp_.c
strspn_.c: strspn.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strspn.c; then echo $(srcdir)/strspn.c; else echo strspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strspn_.c
strstr_.c: strstr.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strstr_.c
strtol_.c: strtol.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtol_.c
strtoul_.c: strtoul.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoul_.c
strtoull_.c: strtoull.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoull.c; then echo $(srcdir)/strtoull.c; else echo strtoull.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoull_.c
strtoumax_.c: strtoumax.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c
tree_.c: tree.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/tree.c; then echo $(srcdir)/tree.c; else echo tree.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > tree_.c
util_.c: util.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/util.c; then echo $(srcdir)/util.c; else echo util.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > util_.c
version_.c: version.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/version.c; then echo $(srcdir)/version.c; else echo version.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > version_.c
find_.o fstype_.o parser_.o pred_.o tree_.o util_.o version_.o : \
$(ANSI2KNR)
waitpid_.c: waitpid.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/waitpid.c; then echo $(srcdir)/waitpid.c; else echo waitpid.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > waitpid_.c
alloca_.o error_.o fileblocks_.o find_.o fnmatch_.o fstype_.o lstat_.o \
malloc_.o memcmp_.o memcpy_.o memset_.o mktime_.o parser_.o pred_.o \
realloc_.o regex_.o stat_.o stpcpy_.o strdup_.o strftime_.o \
strncasecmp_.o strspn_.o strstr_.o strtol_.o strtoul_.o strtoull_.o \
strtoumax_.o tree_.o util_.o version_.o waitpid_.o : $(ANSI2KNR)
install-man1:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
@ -333,7 +389,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -f$$here/ID $$unique $(LISP)
mkid -fID $$unique $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@ -362,29 +418,6 @@ distclean-tags:
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
for subdir in $(SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
@AMDEP@include $(DEPDIR)/find$U.Po
@AMDEP@include $(DEPDIR)/fstype$U.Po
@AMDEP@include $(DEPDIR)/parser$U.Po
@ -408,8 +441,32 @@ maintainer-clean-depend:
@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c -o $@ $<
$(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
for subdir in $(SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
info-am:
info: info-recursive
dvi-am:
@ -485,14 +542,14 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir \
mostlyclean-depend distclean-depend clean-depend \
maintainer-clean-depend info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs-am installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
distclean-tags clean-tags maintainer-clean-tags mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend distdir info-am \
info dvi-am dvi check check-am installcheck-am installcheck \
install-exec-am install-exec install-data-am install-data install-am \
install uninstall-am uninstall all-redirect all-am all install-strip \
installdirs-am installdirs mostlyclean-generic distclean-generic \
clean-generic maintainer-clean-generic clean mostlyclean distclean \
maintainer-clean
$(PROGRAMS): ../lib/libfind.a

View File

@ -1,5 +1,5 @@
/* defs.h -- data types and declarations.
Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94, 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
@ -15,6 +15,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#if defined(HAVE_STRING_H) || defined(STDC_HEADERS)
#include <string.h>
#else
@ -42,6 +47,17 @@ extern int errno;
#include <time.h>
#if HAVE_LIMITS_H
# include <limits.h>
#endif
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#include "regex.h"
#ifndef S_IFLNK
@ -59,6 +75,49 @@ extern int errno;
int lstat PARAMS((const char *__path, struct stat *__statbuf));
int stat PARAMS((const char *__path, struct stat *__statbuf));
#ifndef S_ISUID
# define S_ISUID 0004000
#endif
#ifndef S_ISGID
# define S_ISGID 0002000
#endif
#ifndef S_ISVTX
# define S_ISVTX 0001000
#endif
#ifndef S_IRUSR
# define S_IRUSR 0000400
#endif
#ifndef S_IWUSR
# define S_IWUSR 0000200
#endif
#ifndef S_IXUSR
# define S_IXUSR 0000100
#endif
#ifndef S_IRGRP
# define S_IRGRP 0000040
#endif
#ifndef S_IWGRP
# define S_IWGRP 0000020
#endif
#ifndef S_IXGRP
# define S_IXGRP 0000010
#endif
#ifndef S_IROTH
# define S_IROTH 0000004
#endif
#ifndef S_IWOTH
# define S_IWOTH 0000002
#endif
#ifndef S_IXOTH
# define S_IXOTH 0000001
#endif
#define MODE_WXUSR (S_IWUSR | S_IXUSR)
#define MODE_R (S_IRUSR | S_IRGRP | S_IROTH)
#define MODE_RW (S_IWUSR | S_IWGRP | S_IWOTH | MODE_R)
#define MODE_RWX (S_IXUSR | S_IXGRP | S_IXOTH | MODE_RW)
#define MODE_ALL (S_ISUID | S_ISGID | S_ISVTX | MODE_RWX)
/* Not char because of type promotion; NeXT gcc can't handle it. */
typedef int boolean;
#define true 1
@ -79,6 +138,13 @@ enum comparison_type
COMP_EQ
};
enum permissions_type
{
PERM_AT_LEAST,
PERM_ANY,
PERM_EXACT
};
enum predicate_type
{
NO_TYPE,
@ -102,14 +168,21 @@ enum predicate_precedence
struct long_val
{
enum comparison_type kind;
unsigned long l_val;
boolean negative; /* Defined only when representing time_t. */
uintmax_t l_val;
};
struct perm_val
{
enum permissions_type kind;
mode_t val;
};
struct size_val
{
enum comparison_type kind;
int blocksize;
unsigned long size;
uintmax_t size;
};
struct path_arg
@ -178,13 +251,14 @@ struct predicate
char *str; /* fstype [i]lname [i]name [i]path */
struct re_pattern_buffer *regex; /* regex */
struct exec_val exec_vec; /* exec ok */
struct long_val info; /* atime ctime mtime inum links */
struct long_val info; /* atime ctime gid inum links mtime
size uid */
struct size_val size; /* size */
uid_t uid; /* user */
gid_t gid; /* group */
time_t time; /* newer */
unsigned long perm; /* perm */
unsigned long type; /* type */
struct perm_val perm; /* perm */
mode_t type; /* type */
FILE *stream; /* fprint fprint0 */
struct format_val printf_vec; /* printf fprintf */
} args;
@ -210,12 +284,9 @@ char *dirname PARAMS((char *path));
void error PARAMS((int status, int errnum, char *message, ...));
/* listfile.c */
void list_file PARAMS((char *name, char *relname, struct stat *statp, FILE *stream));
void list_file PARAMS((char *name, char *relname, struct stat *statp, time_t current_time, int output_block_size, FILE *stream));
char *get_link_name PARAMS((char *name, char *relname));
/* savedir.c */
char *savedir PARAMS((char *dir, unsigned name_size));
/* stpcpy.c */
#if !HAVE_STPCPY
char *stpcpy PARAMS((char *dest, const char *src));
@ -306,12 +377,11 @@ void print_list PARAMS((struct predicate *node));
/* tree.c */
struct predicate *
get_expr (struct predicate **input, short int prev_prec);
get_expr PARAMS((struct predicate **input, short int prev_prec));
boolean opt_expr PARAMS((struct predicate **eval_treep));
boolean mark_stat PARAMS((struct predicate *tree));
/* util.c */
char *base_name PARAMS((const char *fname));
struct predicate *get_new_pred PARAMS((void));
struct predicate *get_new_pred_chk_op PARAMS((void));
struct predicate *insert_primary PARAMS((boolean (*pred_func )()));
@ -324,6 +394,8 @@ extern boolean do_dir_first;
extern int maxdepth;
extern int mindepth;
extern int curdepth;
extern int output_block_size;
extern time_t start_time;
extern time_t cur_day_start;
extern boolean full_days;
extern boolean no_leaf_check;

View File

@ -1,5 +1,5 @@
/* find -- search for files in a directory hierarchy
Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94, 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
@ -22,17 +22,16 @@
The idea for -print0 and xargs -0 came from
Dan Bernstein <brnstnd@kramden.acf.nyu.edu>. */
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include "defs.h"
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#else
#include <sys/file.h>
#endif
#include "defs.h"
#include <human.h>
#include <modetype.h>
#include <savedir.h>
#ifdef HAVE_LOCALE_H
#include <locale.h>
@ -84,6 +83,12 @@ int mindepth;
/* Current depth; 0 means current path is a command line arg. */
int curdepth;
/* Output block size. */
int output_block_size;
/* Time at start of execution. */
time_t start_time;
/* Seconds between 00:00 1/1/70 and either one day before now
(the default), or the start of today (if -daystart is given). */
time_t cur_day_start;
@ -162,7 +167,8 @@ main (int argc, char **argv)
last_pred = NULL;
do_dir_first = true;
maxdepth = mindepth = -1;
cur_day_start = time ((time_t *) 0) - DAYSECS;
start_time = time (NULL);
cur_day_start = start_time - DAYSECS;
full_days = false;
no_leaf_check = false;
stay_on_filesystem = false;
@ -174,6 +180,8 @@ main (int argc, char **argv)
xstat = lstat;
#endif /* !DEBUG_STAT */
human_block_size (getenv ("FIND_BLOCK_SIZE"), 0, &output_block_size);
#ifdef DEBUG
printf ("cur_day_start = %s", ctime (&cur_day_start));
#endif /* DEBUG */
@ -441,8 +449,7 @@ process_dir (char *pathname, char *name, int pathlen, struct stat *statp, char *
subdirs_left = statp->st_nlink - 2; /* Account for name and ".". */
errno = 0;
/* On some systems (VAX 4.3BSD+NFS), NFS mount points have st_size < 0. */
name_space = savedir (name, statp->st_size > 0 ? statp->st_size : 512);
name_space = savedir (name, statp->st_size);
if (name_space == NULL)
{
if (errno)

View File

@ -1,5 +1,5 @@
/* fstype.c -- determine type of filesystems that files are on
Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94, 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
@ -17,11 +17,9 @@
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
#include <config.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "defs.h"
#include "dirname.h"
#include "modetype.h"
#include <errno.h>
#ifdef STDC_HEADERS
@ -43,7 +41,6 @@ extern int errno;
#endif
static char *filesystem_type_uncached PARAMS((char *path, char *relpath, struct stat *statp));
static int xatoi PARAMS((char *cp));
#ifdef FSTYPE_MNTENT /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */
#include <mntent.h>
@ -260,10 +257,12 @@ filesystem_type_uncached (char *path, char *relpath, struct stat *statp)
devopt = strstr (mnt->mnt_opts, "dev=");
if (devopt)
{
if (devopt[4] == '0' && (devopt[5] == 'x' || devopt[5] == 'X'))
dev = xatoi (devopt + 6);
else
dev = xatoi (devopt + 4);
uintmax_t u = 0;
devopt += 4;
if (devopt[0] == '0' && (devopt[1] == 'x' || devopt[1] == 'X'))
devopt += 2;
xstrtoumax (devopt, NULL, 16, &u, NULL);
dev = u;
}
else
#endif /* not hpux */
@ -363,30 +362,3 @@ filesystem_type_uncached (char *path, char *relpath, struct stat *statp)
return xstrdup (type ? type : _("unknown"));
}
#ifdef FSTYPE_MNTENT /* 4.3BSD etc. */
/* Return the value of the hexadecimal number represented by CP.
No prefix (like '0x') or suffix (like 'h') is expected to be
part of CP. */
static int
xatoi (char *cp)
{
int val;
val = 0;
while (*cp)
{
if (*cp >= 'a' && *cp <= 'f')
val = val * 16 + *cp - 'a' + 10;
else if (*cp >= 'A' && *cp <= 'F')
val = val * 16 + *cp - 'A' + 10;
else if (*cp >= '0' && *cp <= '9')
val = val * 16 + *cp - '0';
else
break;
cp++;
}
return val;
}
#endif

View File

@ -1,5 +1,5 @@
/* parser.c -- convert the command line args into an expression tree.
Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94, 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
@ -15,16 +15,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "defs.h"
#include <ctype.h>
#include <stdio.h>
#include <pwd.h>
#include <grp.h>
#include "modechange.h"
#include "defs.h"
#include "modetype.h"
#include "xstrtol.h"
#if ENABLE_NLS
# include <libintl.h>
@ -122,9 +119,9 @@ static boolean insert_type PARAMS((char *argv[], int *arg_ptr, boolean (*which_p
static boolean insert_fprintf PARAMS((FILE *fp, boolean (*func )(), char *argv[], int *arg_ptr));
static struct segment **make_segment PARAMS((struct segment **segment, char *format, int len, int kind));
static boolean insert_exec_ok PARAMS((boolean (*func )(), char *argv[], int *arg_ptr));
static boolean get_num_days PARAMS((char *str, unsigned long *num_days, enum comparison_type *comp_type));
static boolean get_num_days PARAMS((char *str, uintmax_t *num_days, enum comparison_type *comp_type));
static boolean insert_time PARAMS((char *argv[], int *arg_ptr, PFB pred));
static boolean get_num PARAMS((char *str, unsigned long *num, enum comparison_type *comp_type));
static boolean get_num PARAMS((char *str, uintmax_t *num, enum comparison_type *comp_type));
static boolean insert_num PARAMS((char *argv[], int *arg_ptr, PFB pred));
static FILE *open_output_file PARAMS((char *path));
@ -252,16 +249,19 @@ static boolean
parse_amin (char **argv, int *arg_ptr)
{
struct predicate *our_pred;
unsigned long num;
uintmax_t num;
enum comparison_type c_type;
time_t t;
if ((argv == NULL) || (argv[*arg_ptr] == NULL))
return (false);
if (!get_num_days (argv[*arg_ptr], &num, &c_type))
return (false);
t = cur_day_start + DAYSECS - num * 60;
our_pred = insert_primary (pred_amin);
our_pred->args.info.kind = c_type;
our_pred->args.info.l_val = cur_day_start + DAYSECS - num * 60;
our_pred->args.info.negative = t < 0;
our_pred->args.info.l_val = t;
(*arg_ptr)++;
return (true);
}
@ -324,16 +324,19 @@ static boolean
parse_cmin (char **argv, int *arg_ptr)
{
struct predicate *our_pred;
unsigned long num;
uintmax_t num;
enum comparison_type c_type;
time_t t;
if ((argv == NULL) || (argv[*arg_ptr] == NULL))
return (false);
if (!get_num_days (argv[*arg_ptr], &num, &c_type))
return (false);
t = cur_day_start + DAYSECS - num * 60;
our_pred = insert_primary (pred_cmin);
our_pred->args.info.kind = c_type;
our_pred->args.info.l_val = cur_day_start + DAYSECS - num * 60;
our_pred->args.info.negative = t < 0;
our_pred->args.info.l_val = t;
(*arg_ptr)++;
return (true);
}
@ -385,8 +388,10 @@ parse_daystart (char **argv, int *arg_ptr)
{
cur_day_start += DAYSECS;
local = localtime (&cur_day_start);
cur_day_start -= local->tm_sec + local->tm_min * 60
+ local->tm_hour * 3600;
cur_day_start -= (local
? (local->tm_sec + local->tm_min * 60
+ local->tm_hour * 3600)
: cur_day_start % DAYSECS);
full_days = true;
}
return (true);
@ -688,16 +693,19 @@ static boolean
parse_mmin (char **argv, int *arg_ptr)
{
struct predicate *our_pred;
unsigned long num;
uintmax_t num;
enum comparison_type c_type;
time_t t;
if ((argv == NULL) || (argv[*arg_ptr] == NULL))
return (false);
if (!get_num_days (argv[*arg_ptr], &num, &c_type))
return (false);
t = cur_day_start + DAYSECS - num * 60;
our_pred = insert_primary (pred_mmin);
our_pred->args.info.kind = c_type;
our_pred->args.info.l_val = cur_day_start + DAYSECS - num * 60;
our_pred->args.info.negative = t < 0;
our_pred->args.info.l_val = t;
(*arg_ptr)++;
return (true);
}
@ -898,7 +906,7 @@ parse_path (char **argv, int *arg_ptr)
static boolean
parse_perm (char **argv, int *arg_ptr)
{
unsigned long perm_val;
mode_t perm_val;
int mode_start = 0;
struct mode_change *change;
struct predicate *our_pred;
@ -930,18 +938,16 @@ parse_perm (char **argv, int *arg_ptr)
switch (argv[*arg_ptr][0])
{
case '-':
/* Set magic flag to indicate true if at least the given bits are set. */
our_pred->args.perm = (perm_val & 07777) | 010000;
our_pred->args.perm.kind = PERM_AT_LEAST;
break;
case '+':
/* Set magic flag to indicate true if any of the given bits are set. */
our_pred->args.perm = (perm_val & 07777) | 020000;
our_pred->args.perm.kind = PERM_ANY;
break;
default:
/* True if exactly the given bits are set. */
our_pred->args.perm = (perm_val & 07777);
our_pred->args.perm.kind = PERM_EXACT;
break;
}
our_pred->args.perm.val = perm_val & MODE_ALL;
(*arg_ptr)++;
return (true);
}
@ -1040,7 +1046,7 @@ static boolean
parse_size (char **argv, int *arg_ptr)
{
struct predicate *our_pred;
unsigned long num;
uintmax_t num;
enum comparison_type c_type;
int blksize = 512;
int len;
@ -1123,16 +1129,19 @@ static boolean
parse_used (char **argv, int *arg_ptr)
{
struct predicate *our_pred;
unsigned long num_days;
uintmax_t num_days;
enum comparison_type c_type;
time_t t;
if ((argv == NULL) || (argv[*arg_ptr] == NULL))
return (false);
if (!get_num (argv[*arg_ptr], &num_days, &c_type))
return (false);
t = num_days * DAYSECS;
our_pred = insert_primary (pred_used);
our_pred->args.info.kind = c_type;
our_pred->args.info.l_val = num_days * DAYSECS;
our_pred->args.info.negative = t < 0;
our_pred->args.info.l_val = t;
(*arg_ptr)++;
return (true);
}
@ -1190,7 +1199,7 @@ parse_xtype (char **argv, int *arg_ptr)
static boolean
insert_type (char **argv, int *arg_ptr, boolean (*which_pred) (/* ??? */))
{
unsigned long type_cell;
mode_t type_cell;
struct predicate *our_pred;
if ((argv == NULL) || (argv[*arg_ptr] == NULL)
@ -1382,7 +1391,7 @@ make_segment (struct segment **segment, char *format, int len, int kind)
(*segment)->next = NULL;
(*segment)->text_len = len;
fmt = (*segment)->text = xmalloc (len + 3); /* room for "ld\0" */
fmt = (*segment)->text = xmalloc (len + sizeof "d");
strncpy (fmt, format, len);
fmt += len;
@ -1393,15 +1402,22 @@ make_segment (struct segment **segment, char *format, int len, int kind)
break;
case 'a': /* atime in `ctime' format */
case 'c': /* ctime in `ctime' format */
case 'F': /* filesystem type */
case 'g': /* group name */
case 'l': /* object of symlink */
case 't': /* mtime in `ctime' format */
case 'u': /* user name */
case 'A': /* atime in user-specified strftime format */
case 'b': /* size in 512-byte blocks */
case 'c': /* ctime in `ctime' format */
case 'C': /* ctime in user-specified strftime format */
case 'F': /* filesystem type */
case 'G': /* GID number */
case 'g': /* group name */
case 'i': /* inode number */
case 'k': /* size in 1K blocks */
case 'l': /* object of symlink */
case 'n': /* number of links */
case 's': /* size in bytes */
case 't': /* mtime in `ctime' format */
case 'T': /* mtime in user-specified strftime format */
case 'U': /* UID number */
case 'u': /* user name */
fprintf_stat_needed = true;
/* FALLTHROUGH */
case 'f': /* basename of path */
@ -1412,27 +1428,10 @@ make_segment (struct segment **segment, char *format, int len, int kind)
*fmt++ = 's';
break;
case 'b': /* size in 512-byte blocks */
case 'k': /* size in 1K blocks */
case 's': /* size in bytes */
*fmt++ = 'l';
/*FALLTHROUGH*/
case 'n': /* number of links */
fprintf_stat_needed = true;
/* FALLTHROUGH */
case 'd': /* depth in search tree (0 = ARGV element) */
*fmt++ = 'd';
break;
case 'i': /* inode number */
*fmt++ = 'l';
/*FALLTHROUGH*/
case 'G': /* GID number */
case 'U': /* UID number */
*fmt++ = 'u';
fprintf_stat_needed = true;
break;
case 'm': /* mode as octal number (perms only) */
*fmt++ = 'o';
fprintf_stat_needed = true;
@ -1523,45 +1522,17 @@ insert_exec_ok (boolean (*func) (/* ??? */), char **argv, int *arg_ptr)
get the appropriate information for a time predicate processor. */
static boolean
get_num_days (char *str, long unsigned int *num_days, enum comparison_type *comp_type)
get_num_days (char *str, uintmax_t *num_days, enum comparison_type *comp_type)
{
int len_days; /* length of field */
if (str == NULL)
return (false);
switch (str[0])
{
case '+':
*comp_type = COMP_LT;
str++;
break;
case '-':
*comp_type = COMP_GT;
str++;
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
*comp_type = COMP_EQ;
break;
default:
return (false);
}
/* We know the first char has been reasonable. Find the
number of days to play with. */
len_days = strspn (str, "0123456789");
if ((len_days == 0) || (str[len_days] != '\0'))
return (false);
*num_days = (unsigned long) atol (str);
return (true);
boolean r = get_num (str, num_days, comp_type);
if (r)
switch (*comp_type)
{
case COMP_LT: *comp_type = COMP_GT; break;
case COMP_GT: *comp_type = COMP_LT; break;
default: break;
}
return r;
}
/* Insert a time predicate PRED.
@ -1580,17 +1551,20 @@ static boolean
insert_time (char **argv, int *arg_ptr, PFB pred)
{
struct predicate *our_pred;
unsigned long num_days;
uintmax_t num_days;
enum comparison_type c_type;
time_t t;
if ((argv == NULL) || (argv[*arg_ptr] == NULL))
return (false);
if (!get_num_days (argv[*arg_ptr], &num_days, &c_type))
return (false);
t = (cur_day_start - num_days * DAYSECS
+ ((c_type == COMP_GT) ? DAYSECS - 1 : 0));
our_pred = insert_primary (pred);
our_pred->args.info.kind = c_type;
our_pred->args.info.l_val = cur_day_start - num_days * DAYSECS
+ ((c_type == COMP_GT) ? DAYSECS - 1 : 0);
our_pred->args.info.negative = t < 0;
our_pred->args.info.l_val = t;
(*arg_ptr)++;
#ifdef DEBUG
printf (_("inserting %s\n"), our_pred->p_name);
@ -1599,13 +1573,13 @@ insert_time (char **argv, int *arg_ptr, PFB pred)
((c_type == COMP_LT) ? "lt" : ((c_type == COMP_EQ) ? "eq" : "?")),
(c_type == COMP_GT) ? " >" :
((c_type == COMP_LT) ? " <" : ((c_type == COMP_EQ) ? ">=" : " ?")));
printf ("%ld %s", our_pred->args.info.l_val,
ctime (&our_pred->args.info.l_val));
t = our_pred->args.info.l_val;
printf ("%ju %s", (uintmax_t) our_pred->args.info.l_val, ctime (&t));
if (c_type == COMP_EQ)
{
our_pred->args.info.l_val += DAYSECS;
printf (" < %ld %s", our_pred->args.info.l_val,
ctime (&our_pred->args.info.l_val));
t = our_pred->args.info.l_val += DAYSECS;
printf (" < %ju %s",
(uintmax_t) our_pred->args.info.l_val, ctime (&t));
our_pred->args.info.l_val -= DAYSECS;
}
#endif /* DEBUG */
@ -1614,18 +1588,16 @@ insert_time (char **argv, int *arg_ptr, PFB pred)
/* Get a number with comparision information.
The sense of the comparision information is 'normal'; that is,
'+' looks for inums or links > than the number and '-' less than.
'+' looks for a count > than the number and '-' less than.
STR is the ASCII representation of the number.
Set *NUM to the number.
Set *COMP_TYPE to the kind of comparison that is requested.
Return true if all okay, false if input error.
Used by the -inum and -links predicate parsers. */
Return true if all okay, false if input error. */
static boolean
get_num (char *str, long unsigned int *num, enum comparison_type *comp_type)
get_num (char *str, uintmax_t *num, enum comparison_type *comp_type)
{
int len_num; /* Length of field. */
@ -1641,29 +1613,12 @@ get_num (char *str, long unsigned int *num, enum comparison_type *comp_type)
*comp_type = COMP_LT;
str++;
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
default:
*comp_type = COMP_EQ;
break;
default:
return (false);
}
/* We know the first char has been reasonable. Find the number of
days to play with. */
len_num = strspn (str, "0123456789");
if ((len_num == 0) || (str[len_num] != '\0'))
return (false);
*num = (unsigned long) atol (str);
return (true);
return xstrtoumax (str, NULL, 10, num, "") == LONGINT_OK;
}
/* Insert a number predicate.
@ -1682,7 +1637,7 @@ static boolean
insert_num (char **argv, int *arg_ptr, PFB pred)
{
struct predicate *our_pred;
unsigned long num;
uintmax_t num;
enum comparison_type c_type;
if ((argv == NULL) || (argv[*arg_ptr] == NULL))
@ -1700,7 +1655,7 @@ insert_num (char **argv, int *arg_ptr, PFB pred)
((c_type == COMP_LT) ? "lt" : ((c_type == COMP_EQ) ? "eq" : "?")),
(c_type == COMP_GT) ? " >" :
((c_type == COMP_LT) ? " <" : ((c_type == COMP_EQ) ? " =" : " ?")));
printf ("%ld\n", our_pred->args.info.l_val);
printf ("%ju\n", our_pred->args.info.l_val);
#endif /* DEBUG */
return (true);
}

View File

@ -1,5 +1,5 @@
/* pred.c -- execute the expression tree.
Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94, 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
@ -16,15 +16,14 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define _GNU_SOURCE
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include "defs.h"
#include <fnmatch.h>
#include <signal.h>
#include <pwd.h>
#include <grp.h>
#include "defs.h"
#include "basename.h"
#include "human.h"
#include "modetype.h"
#include "wait.h"
@ -68,28 +67,75 @@
#define CLOSEDIR(d) closedir (d)
#endif
/* Get or fake the disk device blocksize.
Usually defined by sys/param.h (if at all). */
#ifndef DEV_BSIZE
# ifdef BSIZE
# define DEV_BSIZE BSIZE
# else /* !BSIZE */
# define DEV_BSIZE 4096
# endif /* !BSIZE */
#endif /* !DEV_BSIZE */
/* Extract or fake data from a `struct stat'.
ST_NBLOCKS: Number of 512-byte blocks in the file
(including indirect blocks).
HP-UX, perhaps uniquely, counts st_blocks in 1024-byte units.
This workaround loses when mixing HP-UX and 4BSD filesystems, though. */
#ifdef _POSIX_SOURCE
# define ST_NBLOCKS(statp) (((statp)->st_size + 512 - 1) / 512)
#else
# ifndef HAVE_ST_BLOCKS
# define ST_NBLOCKS(statp) (st_blocks ((statp)->st_size))
# else
# if defined(hpux) || defined(__hpux__)
# define ST_NBLOCKS(statp) ((statp)->st_blocks * 2)
# else
# define ST_NBLOCKS(statp) ((statp)->st_blocks)
# endif
# endif
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) \
(S_ISREG ((statbuf).st_mode) \
|| S_ISDIR ((statbuf).st_mode) \
? (statbuf).st_size / ST_NBLOCKSIZE + ((statbuf).st_size % ST_NBLOCKSIZE != 0) : 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. */
# define ST_BLKSIZE(statbuf) ((statbuf).st_blksize > 0 \
? (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 filesystems 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) \
(S_ISREG ((statbuf).st_mode) \
|| S_ISDIR ((statbuf).st_mode) \
? (statbuf).st_blocks : 0)
#endif
#ifndef ST_NBLOCKSIZE
# define ST_NBLOCKSIZE 512
#endif
#undef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
static boolean insert_lname PARAMS((char *pathname, struct stat *stat_buf, struct predicate *pred_ptr, boolean ignore_case));
static boolean launch PARAMS((struct predicate *pred_ptr));
static char *format_date PARAMS((time_t when, int kind));
static char *ctime_format PARAMS((time_t when));
#ifdef DEBUG
struct pred_assoc
@ -440,7 +486,8 @@ pred_false (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
boolean
pred_fls (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
list_file (pathname, rel_pathname, stat_buf, pred_ptr->args.stream);
list_file (pathname, rel_pathname, stat_buf, start_time,
output_block_size, pred_ptr->args.stream);
return (true);
}
@ -466,6 +513,7 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
FILE *fp = pred_ptr->args.printf_vec.stream;
struct segment *segment;
char *cp;
char hbuf[LONGEST_HUMAN_READABLE + 1];
for (segment = pred_ptr->args.printf_vec.segment; segment;
segment = segment->next)
@ -503,28 +551,21 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
fflush (fp);
return (true);
case 'a': /* atime in `ctime' format. */
cp = ctime (&stat_buf->st_atime);
cp[24] = '\0';
fprintf (fp, segment->text, cp);
fprintf (fp, segment->text, ctime_format (stat_buf->st_atime));
break;
case 'b': /* size in 512-byte blocks */
fprintf (fp, segment->text, ST_NBLOCKS (stat_buf));
fprintf (fp, segment->text,
human_readable ((uintmax_t) ST_NBLOCKS (*stat_buf),
hbuf, ST_NBLOCKSIZE, 512));
break;
case 'c': /* ctime in `ctime' format */
cp = ctime (&stat_buf->st_ctime);
cp[24] = '\0';
fprintf (fp, segment->text, cp);
fprintf (fp, segment->text, ctime_format (stat_buf->st_ctime));
break;
case 'd': /* depth in search tree */
fprintf (fp, segment->text, curdepth);
break;
case 'f': /* basename of path */
cp = strrchr (pathname, '/');
if (cp)
cp++;
else
cp = pathname;
fprintf (fp, segment->text, cp);
fprintf (fp, segment->text, base_name (pathname));
break;
case 'F': /* filesystem type */
fprintf (fp, segment->text,
@ -544,8 +585,8 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
/* else fallthru */
}
case 'G': /* GID number */
segment->text[segment->text_len] = 'u';
fprintf (fp, segment->text, stat_buf->st_gid);
fprintf (fp, segment->text,
human_readable ((uintmax_t) stat_buf->st_gid, hbuf, 1, 1));
break;
case 'h': /* leading directories part of path */
{
@ -570,10 +611,13 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
break;
}
case 'i': /* inode number */
fprintf (fp, segment->text, stat_buf->st_ino);
fprintf (fp, segment->text,
human_readable ((uintmax_t) stat_buf->st_ino, hbuf, 1, 1));
break;
case 'k': /* size in 1K blocks */
fprintf (fp, segment->text, (ST_NBLOCKS (stat_buf) + 1) / 2);
fprintf (fp, segment->text,
human_readable ((uintmax_t) ST_NBLOCKS (*stat_buf),
hbuf, ST_NBLOCKSIZE, 1024));
break;
case 'l': /* object of symlink */
#ifdef S_ISLNK
@ -597,10 +641,38 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
#endif /* S_ISLNK */
break;
case 'm': /* mode as octal number (perms only) */
fprintf (fp, segment->text, stat_buf->st_mode & 07777);
{
/* Output the mode portably using the traditional numbers,
even if the host unwisely uses some other numbering
scheme. But help the compiler in the common case where
the host uses the traditional numbering scheme. */
mode_t m = stat_buf->st_mode;
boolean traditional_numbering_scheme =
(S_ISUID == 04000 && S_ISGID == 02000 && S_ISVTX == 01000
&& S_IRUSR == 00400 && S_IWUSR == 00200 && S_IXUSR == 00100
&& S_IRGRP == 00040 && S_IWGRP == 00020 && S_IXGRP == 00010
&& S_IROTH == 00004 && S_IWOTH == 00002 && S_IXOTH == 00001);
fprintf (fp, segment->text,
(traditional_numbering_scheme
? m & MODE_ALL
: ((m & S_ISUID ? 04000 : 0)
| (m & S_ISGID ? 02000 : 0)
| (m & S_ISVTX ? 01000 : 0)
| (m & S_IRUSR ? 00400 : 0)
| (m & S_IWUSR ? 00200 : 0)
| (m & S_IXUSR ? 00100 : 0)
| (m & S_IRGRP ? 00040 : 0)
| (m & S_IWGRP ? 00020 : 0)
| (m & S_IXGRP ? 00010 : 0)
| (m & S_IROTH ? 00004 : 0)
| (m & S_IWOTH ? 00002 : 0)
| (m & S_IXOTH ? 00001 : 0))));
}
break;
case 'n': /* number of links */
fprintf (fp, segment->text, stat_buf->st_nlink);
fprintf (fp, segment->text,
human_readable ((uintmax_t) stat_buf->st_nlink,
hbuf, 1, 1));
break;
case 'p': /* pathname */
fprintf (fp, segment->text, pathname);
@ -621,12 +693,12 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
fprintf (fp, segment->text, cp);
break;
case 's': /* size in bytes */
fprintf (fp, segment->text, stat_buf->st_size);
fprintf (fp, segment->text,
human_readable ((uintmax_t) stat_buf->st_size,
hbuf, 1, 1));
break;
case 't': /* mtime in `ctime' format */
cp = ctime (&stat_buf->st_mtime);
cp[24] = '\0';
fprintf (fp, segment->text, cp);
fprintf (fp, segment->text, ctime_format (stat_buf->st_mtime));
break;
case 'u': /* user name */
{
@ -642,8 +714,8 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
/* else fallthru */
}
case 'U': /* UID number */
segment->text[segment->text_len] = 'u';
fprintf (fp, segment->text, stat_buf->st_uid);
fprintf (fp, segment->text,
human_readable ((uintmax_t) stat_buf->st_uid, hbuf, 1, 1));
break;
}
}
@ -785,7 +857,8 @@ insert_lname (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr,
boolean
pred_ls (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
list_file (pathname, rel_pathname, stat_buf, stdout);
list_file (pathname, rel_pathname, stat_buf, start_time,
output_block_size, stdout);
return (true);
}
@ -960,28 +1033,20 @@ pred_path (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
boolean
pred_perm (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
if (pred_ptr->args.perm & 010000)
switch (pred_ptr->args.perm.kind)
{
/* Magic flag set in parse_perm:
true if at least the given bits are set. */
if ((stat_buf->st_mode & 07777 & pred_ptr->args.perm)
== (pred_ptr->args.perm & 07777))
return (true);
case PERM_AT_LEAST:
return (~stat_buf->st_mode & pred_ptr->args.perm.val) != 0;
case PERM_ANY:
return (stat_buf->st_mode & pred_ptr->args.perm.val) != 0;
case PERM_EXACT:
return (stat_buf->st_mode & MODE_ALL) == pred_ptr->args.perm.val;
default:
abort ();
}
else if (pred_ptr->args.perm & 020000)
{
/* Magic flag set in parse_perm:
true if any of the given bits are set. */
if ((stat_buf->st_mode & 07777) & pred_ptr->args.perm)
return (true);
}
else
{
/* True if exactly the given bits are set. */
if ((stat_buf->st_mode & 07777) == pred_ptr->args.perm)
return (true);
}
return (false);
}
boolean
@ -1019,10 +1084,10 @@ pred_regex (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
boolean
pred_size (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
unsigned long f_val;
uintmax_t f_val;
f_val = (stat_buf->st_size + pred_ptr->args.size.blocksize - 1)
/ pred_ptr->args.size.blocksize;
f_val = ((stat_buf->st_size / pred_ptr->args.size.blocksize)
+ (stat_buf->st_size % pred_ptr->args.size.blocksize != 0));
switch (pred_ptr->args.size.kind)
{
case COMP_GT:
@ -1050,8 +1115,8 @@ pred_true (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
boolean
pred_type (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
unsigned long mode = stat_buf->st_mode;
unsigned long type = pred_ptr->args.type;
mode_t mode = stat_buf->st_mode;
mode_t type = pred_ptr->args.type;
#ifndef S_IFMT
/* POSIX system; check `mode' the slow way. */
@ -1174,7 +1239,7 @@ static boolean
launch (struct predicate *pred_ptr)
{
int status;
pid_t wait_ret, child_pid;
pid_t child_pid;
struct exec_val *execp; /* Pointer for efficiency. */
static int first_time = 1;
@ -1215,26 +1280,14 @@ launch (struct predicate *pred_ptr)
_exit (1);
}
wait_ret = wait (&status);
if (wait_ret == -1)
{
error (0, errno, _("error waiting for %s"), execp->vec[0]);
exit_status = 1;
return (false);
}
if (wait_ret != child_pid)
{
error (0, 0, _("wait got pid %d, expected pid %d"), wait_ret, child_pid);
exit_status = 1;
return (false);
}
if (WIFSTOPPED (status))
{
error (0, 0, _("%s stopped by signal %d"),
execp->vec[0], WSTOPSIG (status));
exit_status = 1;
return (false);
}
while (waitpid (child_pid, &status, 0) == (pid_t) -1)
if (errno != EINTR)
{
error (0, errno, _("error waiting for %s"), execp->vec[0]);
exit_status = 1;
return false;
}
if (WIFSIGNALED (status))
{
error (0, 0, _("%s terminated by signal %d"),
@ -1251,23 +1304,46 @@ launch (struct predicate *pred_ptr)
static char *
format_date (time_t when, int kind)
{
static char fmt[3];
static char buf[64]; /* More than enough space. */
static char buf[MAX (LONGEST_HUMAN_READABLE + 2, 64)];
struct tm *tm;
char fmt[3];
if (kind == '@')
fmt[0] = '%';
fmt[1] = kind;
fmt[2] = '\0';
if (kind != '@'
&& (tm = localtime (&when))
&& strftime (buf, sizeof buf, fmt, tm))
return buf;
else
{
sprintf (buf, "%ld", when);
return (buf);
uintmax_t w = when;
char *p = human_readable (when < 0 ? -w : w, buf + 1, 1, 1);
if (when < 0)
*--p = '-';
return p;
}
}
static char *
ctime_format (when)
time_t when;
{
char *r = ctime (&when);
if (!r)
{
/* The time cannot be represented as a struct tm.
Output it as an integer. */
return format_date (when, '@');
}
else
{
fmt[0] = '%';
fmt[1] = kind;
fmt[2] = '\0';
if (strftime (buf, sizeof (buf), fmt, localtime (&when)))
return (buf);
/* Remove the trailing newline from the ctime output,
being careful not to assume that the output is fixed-width. */
*strchr (r, '\n') = '\0';
return r;
}
return "";
}
#ifdef DEBUG

View File

@ -1,5 +1,5 @@
Makefile
Makefile.in
dbg.log
find.log
find.sum
site.exp

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@ -84,8 +86,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@ -119,20 +124,20 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
EXPECT = expect
RUNTEST = runtest
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
EXPECT = expect
RUNTEST = runtest
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu find/testsuite/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -140,21 +145,6 @@ tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
$(mkinstalldirs) $(distdir)/config $(distdir)/find.gnu
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
RUNTESTFLAGS =
RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir
@ -176,10 +166,28 @@ site.exp: Makefile
@echo 'set tool $(DEJATOOL)' >> $@-t
@echo 'set srcdir $(srcdir)' >> $@-t
@echo 'set objdir' `pwd` >> $@-t
@echo 'set host_alias $(host_alias)' >> $@-t
@echo 'set host_triplet $(host_triplet)' >> $@-t
@echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
@test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
@test ! -f site.exp || mv site.exp site.bak
@mv $@-t site.exp
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
$(mkinstalldirs) $(distdir)/config $(distdir)/find.gnu
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
info-am:
info: info-am
dvi-am:
@ -236,7 +244,7 @@ maintainer-clean-am: maintainer-clean-generic distclean-am
maintainer-clean: maintainer-clean-am
.PHONY: tags distdir check-DEJAGNU info-am info dvi-am dvi check \
.PHONY: tags check-DEJAGNU distdir info-am info dvi-am dvi check \
check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \

View File

@ -1,5 +1,5 @@
/* tree.c -- helper functions to build and evaluate the expression tree.
Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94, 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
@ -15,10 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include "defs.h"
#if ENABLE_NLS

View File

@ -1,5 +1,5 @@
/* util.c -- functions for initializing new tree elements, and other things.
Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94, 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
@ -15,10 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include "defs.h"
#if ENABLE_NLS

View File

@ -1,3 +1,8 @@
2000-03-06 Paul Eggert <eggert@twinsun.com>
* libgettext.h (gettext_noop): Do not parenthesize Str in the
definiens, as that breaks string literal concatenation.
1999-08-12 Paul Eggert <eggert@twinsun.com>
* localealias.c (memcpy): Return 2nd argument, so that it's

View File

@ -85,8 +85,10 @@ extern int _msg_tbl_length;
/* For automatical extraction of messages sometimes no real
translation is needed. Instead the string itself is the result. */
#define gettext_noop(Str) (Str)
translation is needed. Instead the string itself is the result.
Do not parenthesize Str in the definiens,
as that breaks string literal concatenation. */
#define gettext_noop(Str) Str
/* Look up MSGID in the current default message catalog for the current
LC_MESSAGES locale. If not found, returns MSGID itself (the default

View File

@ -1,3 +1,2 @@
.deps
Makefile
Makefile.in

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@ -83,8 +85,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@ -98,25 +103,32 @@ l = @l@
AUTOMAKE_OPTIONS = ansi2knr
SUBDIRS = posix
noinst_LIBRARIES = libfind.a
localedir = $(datadir)/locale
INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\"
libfind_a_SOURCES = regex.h \
argmatch.h \
argmatch.c \
basename.h \
basename.c \
dirname.c \
dirname.h \
error.c \
error.h \
filemode.c \
filemode.h \
getopt.c \
getopt.h \
getopt1.c \
human.c \
human.h \
idcache.c \
listfile.c \
modechange.c \
modechange.h \
pathmax.h \
nextelem.c \
pathmax.h \
quotearg.c \
quotearg.h \
savedir.c \
savedir.h \
xmalloc.c \
@ -128,6 +140,7 @@ libfind_a_SOURCES = regex.h \
xstrtol.h \
xstrtoul.c \
xstrtoul.h \
xstrtoumax.c \
getline.c \
getline.h \
basename.c
@ -138,7 +151,10 @@ libfind_a_LIBADD = @LIBOBJS@ \
# Are these really needed?
EXTRA_DIST = modetype.h \
EXTRA_DIST = \
modetype.h \
mktime.c \
regex.c \
wait.h \
alloca.c \
getline.h \
@ -161,10 +177,11 @@ LIBS = @LIBS@
ANSI2KNR = @ANSI2KNR@
libfind_a_AR = $(AR) cru
libfind_a_DEPENDENCIES = @LIBOBJS@ @ALLOCA@
am_libfind_a_OBJECTS = dirname$U.o error$U.o filemode$U.o getopt$U.o \
getopt1$U.o idcache$U.o listfile$U.o modechange$U.o nextelem$U.o \
savedir$U.o xmalloc$U.o xstrdup$U.o xgetcwd$U.o xstrtol$U.o \
xstrtoul$U.o getline$U.o basename$U.o
am_libfind_a_OBJECTS = argmatch$U.o basename$U.o dirname$U.o \
filemode$U.o getopt$U.o getopt1$U.o human$U.o idcache$U.o listfile$U.o \
modechange$U.o nextelem$U.o quotearg$U.o savedir$U.o xmalloc$U.o \
xstrdup$U.o xgetcwd$U.o xstrtol$U.o xstrtoul$U.o xstrtoumax$U.o \
getline$U.o basename$U.o
libfind_a_OBJECTS = $(am_libfind_a_OBJECTS)
AR = ar
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -172,29 +189,33 @@ CFLAGS = @CFLAGS@
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(libfind_a_SOURCES)
depcomp = $(SHELL) $(top_srcdir)/depcomp
DEP_FILES = @AMDEP@ $(DEPDIR)/alloca.Po $(DEPDIR)/argmatch$U.Po \
$(DEPDIR)/basename$U.Po $(DEPDIR)/dirname$U.Po $(DEPDIR)/error.Po \
$(DEPDIR)/fileblocks.Po $(DEPDIR)/filemode$U.Po $(DEPDIR)/fnmatch.Po \
$(DEPDIR)/getline$U.Po $(DEPDIR)/getopt$U.Po $(DEPDIR)/getopt1$U.Po \
$(DEPDIR)/human$U.Po $(DEPDIR)/idcache$U.Po $(DEPDIR)/listfile$U.Po \
$(DEPDIR)/lstat.Po $(DEPDIR)/malloc.Po $(DEPDIR)/memcmp.Po \
$(DEPDIR)/memcpy.Po $(DEPDIR)/memset.Po $(DEPDIR)/mktime.Po \
$(DEPDIR)/modechange$U.Po $(DEPDIR)/nextelem$U.Po \
$(DEPDIR)/quotearg$U.Po $(DEPDIR)/realloc.Po $(DEPDIR)/regex.Po \
$(DEPDIR)/savedir$U.Po $(DEPDIR)/stat.Po $(DEPDIR)/stpcpy.Po \
$(DEPDIR)/strdup.Po $(DEPDIR)/strftime.Po $(DEPDIR)/strncasecmp.Po \
$(DEPDIR)/strspn.Po $(DEPDIR)/strstr.Po $(DEPDIR)/strtol.Po \
$(DEPDIR)/strtoul.Po $(DEPDIR)/strtoull.Po $(DEPDIR)/strtoumax.Po \
$(DEPDIR)/waitpid.Po $(DEPDIR)/xgetcwd$U.Po $(DEPDIR)/xmalloc$U.Po \
$(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtol$U.Po $(DEPDIR)/xstrtoul$U.Po \
$(DEPDIR)/xstrtoumax$U.Po
DIST_COMMON = Makefile.am Makefile.in alloca.c ansi2knr.1 ansi2knr.c \
fileblocks.c fnmatch.c getline.c malloc.c memcmp.c memset.c mktime.c \
realloc.c regex.c stpcpy.c strcasecmp.c strdup.c strftime.c \
strncasecmp.c strspn.c strstr.c strtol.c strtoul.c
depcomp error.c error.h fileblocks.c fnmatch.c malloc.c memcmp.c \
memcpy.c memset.c mktime.c realloc.c regex.c stpcpy.c strdup.c \
strftime.c strncasecmp.c strspn.c strstr.c strtol.c strtoul.c \
strtoull.c strtoumax.c waitpid.c
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
depcomp = $(SHELL) $(top_srcdir)/depcomp
DEP_FILES = @AMDEP@ $(DEPDIR)/alloca.Po $(DEPDIR)/basename$U.Po \
$(DEPDIR)/dirname$U.Po $(DEPDIR)/error$U.Po $(DEPDIR)/fileblocks.Po \
$(DEPDIR)/filemode$U.Po $(DEPDIR)/fnmatch.Po $(DEPDIR)/getline$U.Po \
$(DEPDIR)/getline.Po $(DEPDIR)/getopt$U.Po $(DEPDIR)/getopt1$U.Po \
$(DEPDIR)/idcache$U.Po $(DEPDIR)/listfile$U.Po $(DEPDIR)/lstat.Po \
$(DEPDIR)/malloc.Po $(DEPDIR)/memcmp.Po $(DEPDIR)/memset.Po \
$(DEPDIR)/mktime.Po $(DEPDIR)/modechange$U.Po $(DEPDIR)/nextelem$U.Po \
$(DEPDIR)/realloc.Po $(DEPDIR)/regex.Po $(DEPDIR)/savedir$U.Po \
$(DEPDIR)/stat.Po $(DEPDIR)/stpcpy.Po $(DEPDIR)/strcasecmp.Po \
$(DEPDIR)/strdup.Po $(DEPDIR)/strftime.Po $(DEPDIR)/strncasecmp.Po \
$(DEPDIR)/strspn.Po $(DEPDIR)/strstr.Po $(DEPDIR)/strtol.Po \
$(DEPDIR)/strtoul.Po $(DEPDIR)/xgetcwd$U.Po $(DEPDIR)/xmalloc$U.Po \
$(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtol$U.Po $(DEPDIR)/xstrtoul$U.Po
SOURCES = $(libfind_a_SOURCES)
OBJECTS = $(am_libfind_a_OBJECTS)
@ -204,7 +225,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -256,6 +277,8 @@ libfind.a: $(libfind_a_OBJECTS) $(libfind_a_DEPENDENCIES)
$(RANLIB) libfind.a
alloca_.c: alloca.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c
argmatch_.c: argmatch.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argmatch.c; then echo $(srcdir)/argmatch.c; else echo argmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > argmatch_.c
basename_.c: basename.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > basename_.c
dirname_.c: dirname.c $(ANSI2KNR)
@ -274,6 +297,8 @@ getopt_.c: getopt.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt_.c
getopt1_.c: getopt1.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt1_.c
human_.c: human.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/human.c; then echo $(srcdir)/human.c; else echo human.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > human_.c
idcache_.c: idcache.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/idcache.c; then echo $(srcdir)/idcache.c; else echo idcache.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > idcache_.c
listfile_.c: listfile.c $(ANSI2KNR)
@ -284,6 +309,8 @@ malloc_.c: malloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c
memcmp_.c: memcmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcmp_.c
memcpy_.c: memcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcpy_.c
memset_.c: memset.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memset_.c
mktime_.c: mktime.c $(ANSI2KNR)
@ -292,6 +319,8 @@ modechange_.c: modechange.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/modechange.c; then echo $(srcdir)/modechange.c; else echo modechange.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > modechange_.c
nextelem_.c: nextelem.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/nextelem.c; then echo $(srcdir)/nextelem.c; else echo nextelem.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > nextelem_.c
quotearg_.c: quotearg.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/quotearg.c; then echo $(srcdir)/quotearg.c; else echo quotearg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > quotearg_.c
realloc_.c: realloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c
regex_.c: regex.c $(ANSI2KNR)
@ -302,8 +331,6 @@ stat_.c: stat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stat_.c
stpcpy_.c: stpcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c
strcasecmp_.c: strcasecmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strcasecmp.c; then echo $(srcdir)/strcasecmp.c; else echo strcasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strcasecmp_.c
strdup_.c: strdup.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strdup_.c
strftime_.c: strftime.c $(ANSI2KNR)
@ -318,6 +345,12 @@ strtol_.c: strtol.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtol_.c
strtoul_.c: strtoul.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoul_.c
strtoull_.c: strtoull.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoull.c; then echo $(srcdir)/strtoull.c; else echo strtoull.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoull_.c
strtoumax_.c: strtoumax.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c
waitpid_.c: waitpid.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/waitpid.c; then echo $(srcdir)/waitpid.c; else echo waitpid.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > waitpid_.c
xgetcwd_.c: xgetcwd.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xgetcwd.c; then echo $(srcdir)/xgetcwd.c; else echo xgetcwd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xgetcwd_.c
xmalloc_.c: xmalloc.c $(ANSI2KNR)
@ -328,13 +361,69 @@ xstrtol_.c: xstrtol.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtol_.c
xstrtoul_.c: xstrtoul.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoul.c; then echo $(srcdir)/xstrtoul.c; else echo xstrtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtoul_.c
alloca_.o basename_.o dirname_.o error_.o fileblocks_.o filemode_.o \
fnmatch_.o getline_.o getopt_.o getopt1_.o idcache_.o listfile_.o \
lstat_.o malloc_.o memcmp_.o memset_.o mktime_.o modechange_.o \
nextelem_.o realloc_.o regex_.o savedir_.o stat_.o stpcpy_.o \
strcasecmp_.o strdup_.o strftime_.o strncasecmp_.o strspn_.o strstr_.o \
strtol_.o strtoul_.o xgetcwd_.o xmalloc_.o xstrdup_.o xstrtol_.o \
xstrtoul_.o : $(ANSI2KNR)
xstrtoumax_.c: xstrtoumax.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoumax.c; then echo $(srcdir)/xstrtoumax.c; else echo xstrtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtoumax_.c
alloca_.o argmatch_.o basename_.o dirname_.o error_.o fileblocks_.o \
filemode_.o fnmatch_.o getline_.o getopt_.o getopt1_.o human_.o \
idcache_.o listfile_.o lstat_.o malloc_.o memcmp_.o memcpy_.o memset_.o \
mktime_.o modechange_.o nextelem_.o quotearg_.o realloc_.o regex_.o \
savedir_.o stat_.o stpcpy_.o strdup_.o strftime_.o strncasecmp_.o \
strspn_.o strstr_.o strtol_.o strtoul_.o strtoull_.o strtoumax_.o \
waitpid_.o xgetcwd_.o xmalloc_.o xstrdup_.o xstrtol_.o xstrtoul_.o \
xstrtoumax_.o : $(ANSI2KNR)
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
if test "$$subdir" = "."; then dot_seen=yes; else :; fi; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
tags: TAGS
@ -345,12 +434,17 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -f$$here/ID $$unique $(LISP)
mkid -fID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
@ -369,46 +463,34 @@ distclean-tags:
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
@AMDEP@include $(DEPDIR)/alloca.Po
@AMDEP@include $(DEPDIR)/argmatch$U.Po
@AMDEP@include $(DEPDIR)/basename$U.Po
@AMDEP@include $(DEPDIR)/dirname$U.Po
@AMDEP@include $(DEPDIR)/error$U.Po
@AMDEP@include $(DEPDIR)/error.Po
@AMDEP@include $(DEPDIR)/fileblocks.Po
@AMDEP@include $(DEPDIR)/filemode$U.Po
@AMDEP@include $(DEPDIR)/fnmatch.Po
@AMDEP@include $(DEPDIR)/getline$U.Po
@AMDEP@include $(DEPDIR)/getline.Po
@AMDEP@include $(DEPDIR)/getopt$U.Po
@AMDEP@include $(DEPDIR)/getopt1$U.Po
@AMDEP@include $(DEPDIR)/human$U.Po
@AMDEP@include $(DEPDIR)/idcache$U.Po
@AMDEP@include $(DEPDIR)/listfile$U.Po
@AMDEP@include $(DEPDIR)/lstat.Po
@AMDEP@include $(DEPDIR)/malloc.Po
@AMDEP@include $(DEPDIR)/memcmp.Po
@AMDEP@include $(DEPDIR)/memcpy.Po
@AMDEP@include $(DEPDIR)/memset.Po
@AMDEP@include $(DEPDIR)/mktime.Po
@AMDEP@include $(DEPDIR)/modechange$U.Po
@AMDEP@include $(DEPDIR)/nextelem$U.Po
@AMDEP@include $(DEPDIR)/quotearg$U.Po
@AMDEP@include $(DEPDIR)/realloc.Po
@AMDEP@include $(DEPDIR)/regex.Po
@AMDEP@include $(DEPDIR)/savedir$U.Po
@AMDEP@include $(DEPDIR)/stat.Po
@AMDEP@include $(DEPDIR)/stpcpy.Po
@AMDEP@include $(DEPDIR)/strcasecmp.Po
@AMDEP@include $(DEPDIR)/strdup.Po
@AMDEP@include $(DEPDIR)/strftime.Po
@AMDEP@include $(DEPDIR)/strncasecmp.Po
@ -416,11 +498,15 @@ distdir: $(DISTFILES)
@AMDEP@include $(DEPDIR)/strstr.Po
@AMDEP@include $(DEPDIR)/strtol.Po
@AMDEP@include $(DEPDIR)/strtoul.Po
@AMDEP@include $(DEPDIR)/strtoull.Po
@AMDEP@include $(DEPDIR)/strtoumax.Po
@AMDEP@include $(DEPDIR)/waitpid.Po
@AMDEP@include $(DEPDIR)/xgetcwd$U.Po
@AMDEP@include $(DEPDIR)/xmalloc$U.Po
@AMDEP@include $(DEPDIR)/xstrdup$U.Po
@AMDEP@include $(DEPDIR)/xstrtol$U.Po
@AMDEP@include $(DEPDIR)/xstrtoul$U.Po
@AMDEP@include $(DEPDIR)/xstrtoumax$U.Po
mostlyclean-depend:
@ -437,32 +523,57 @@ maintainer-clean-depend:
@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c -o $@ $<
$(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
for subdir in $(SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
info-am:
info: info-am
info: info-recursive
dvi-am:
dvi: dvi-am
dvi: dvi-recursive
check-am: all-am
check: check-am
check: check-recursive
installcheck-am:
installcheck: installcheck-am
installcheck: installcheck-recursive
install-exec-am:
install-exec: install-exec-am
install-exec: install-exec-recursive
install-data-am:
install-data: install-data-am
install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
install: install-recursive
uninstall-am:
uninstall: uninstall-am
uninstall: uninstall-recursive
all-am: Makefile $(ANSI2KNR) $(LIBRARIES)
all-redirect: all-am
all-redirect: all-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
installdirs: installdirs-recursive
installdirs-am:
mostlyclean-generic:
@ -481,18 +592,18 @@ mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-krextra mostlyclean-kr mostlyclean-tags \
mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-am
mostlyclean: mostlyclean-recursive
clean-am: clean-noinstLIBRARIES clean-compile clean-krextra clean-kr \
clean-tags clean-depend clean-generic mostlyclean-am
clean: clean-am
clean: clean-recursive
distclean-am: distclean-noinstLIBRARIES distclean-compile \
distclean-krextra distclean-kr distclean-tags \
distclean-depend distclean-generic clean-am
distclean: distclean-am
distclean: distclean-recursive
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-krextra \
@ -502,21 +613,27 @@ maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
maintainer-clean: maintainer-clean-recursive
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-krextra distclean-krextra \
clean-krextra maintainer-clean-krextra mostlyclean-kr distclean-kr \
clean-kr maintainer-clean-kr tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
install-exec install-data-am install-data install-am install \
uninstall-am uninstall all-redirect all-am all install-strip \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
clean-kr maintainer-clean-kr install-recursive uninstall-recursive \
install-data-recursive uninstall-data-recursive install-exec-recursive \
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend distdir info-am \
info dvi-am dvi check check-am installcheck-am installcheck \
install-exec-am install-exec install-data-am install-data install-am \
install uninstall-am uninstall all-redirect all-am all install-strip \
installdirs-am installdirs mostlyclean-generic distclean-generic \
clean-generic maintainer-clean-generic clean mostlyclean distclean \
maintainer-clean
lstat.c: xstat.in

View File

@ -25,6 +25,13 @@
# include <config.h>
#endif
#if HAVE_STRING_H
# include <string.h>
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef emacs
# include "blockinput.h"
#endif
@ -210,6 +217,9 @@ alloca (unsigned size)
register pointer new = malloc (sizeof (header) + size);
/* Address of header. */
if (new == 0)
abort();
((header *) new)->h.next = last_alloca_header;
((header *) new)->h.deep = depth;

View File

@ -1,15 +1,21 @@
.TH ANSI2KNR 1 "19 Jan 1996"
.\" $Id$
.TH ANSI2KNR 1 "9 September 1998" \" -*- nroff -*-
.SH NAME
ansi2knr \- convert ANSI C to Kernighan & Ritchie C
.SH SYNOPSIS
.I ansi2knr
[--varargs] input_file [output_file]
.SH DESCRIPTION
If no output_file is supplied, output goes to stdout.
\fBansi2knr\fR [\fB--filename\fR \fIfilename\fR] [\fIinput_file\fR [\fIoutput_file\fR]]
.br
.SH DESCRIPTION
\fB--filename\fR provides the file name for the #line directive in the output,
overriding \fIinput_file\fR (if present).
.sp
If no \fIinput_file\fR is supplied, input is read from stdin.
.sp
If no \fIoutput_file\fR is supplied, output goes to stdout.
.sp
There are no error messages.
.sp
.I ansi2knr
\fBansi2knr\fR
recognizes function definitions by seeing a non-keyword identifier at the left
margin, followed by a left parenthesis, with a right parenthesis as the last
character on the line, and with a left brace as the first token on the
@ -18,16 +24,23 @@ multi-line header provided that no intervening line ends with a left or right
brace or a semicolon. These algorithms ignore whitespace and comments, except
that the function name must be the first thing on the line.
.sp
\fBansi2knr\fP
also recognizes adjacent string literals and concatenates them.
.sp
The following constructs will confuse it:
.br
- Any other construct that starts at the left margin and follows the
above syntax (such as a macro or function call).
.br
- Some macros that tinker with the syntax of the function header.
.br
- String literals whose concatenation requires rewriting
their contents; e.g. "ab\0" "07c" is concatenated to "ab\007c",
which is not correct.
.sp
The --varargs switch is obsolete, and is recognized only for
backwards compatibility. The present version of
.I ansi2knr
\fBansi2knr\fR
will always attempt to convert a ... argument to va_alist and va_dcl.
.SH AUTHOR
L. Peter Deutsch <ghost@aladdin.com> wrote the original ansi2knr and

View File

@ -37,21 +37,21 @@ program under the GPL.
* There are no error messages.
*
* ansi2knr recognizes function definitions by seeing a non-keyword
* identifier at the left margin, followed by a left parenthesis,
* with a right parenthesis as the last character on the line,
* and with a left brace as the first token on the following line
* (ignoring possible intervening comments), except that a line
* identifier at the left margin, followed by a left parenthesis, with a
* right parenthesis as the last character on the line, and with a left
* brace as the first token on the following line (ignoring possible
* intervening comments and/or preprocessor directives), except that a line
* consisting of only
* identifier1(identifier2)
* will not be considered a function definition unless identifier2 is
* the word "void", and a line consisting of
* identifier1(identifier2, <<arbitrary>>)
* will not be considered a function definition.
* ansi2knr will recognize a multi-line header provided
* that no intervening line ends with a left or right brace or a semicolon.
* These algorithms ignore whitespace and comments, except that
* the function name must be the first thing on the line.
* The following constructs will confuse it:
* ansi2knr will recognize a multi-line header provided that no intervening
* line ends with a left or right brace or a semicolon. These algorithms
* ignore whitespace, comments, and preprocessor directives, except that
* the function name must be the first thing on the line. The following
* constructs will confuse it:
* - Any other construct that starts at the left margin and
* follows the above syntax (such as a macro or function call).
* - Some macros that tinker with the syntax of function headers.
@ -61,6 +61,8 @@ program under the GPL.
* The original and principal author of ansi2knr is L. Peter Deutsch
* <ghost@aladdin.com>. Other authors are noted in the change history
* that follows (in reverse chronological order):
lpd 1999-08-17 added code to allow preprocessor directives
wherever comments are allowed
lpd 1999-04-12 added minor fixes from Pavel Roskin
<pavel_roskin@geocities.com> for clean compilation with
gcc -W -Wall
@ -196,11 +198,14 @@ program under the GPL.
#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
/* Forward references */
char *ppdirforward();
char *ppdirbackward();
char *skipspace();
char *scanstring();
int writeblanks();
int test1();
int convert1();
int concatlits();
/* The main program */
int
@ -298,7 +303,7 @@ f: if ( line >= buf + (bufsize - 1) ) /* overflow check */
goto wl;
if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
goto wl;
switch ( *skipspace(more, 1) )
switch ( *skipspace(ppdirforward(more), 1) )
{
case '{':
/* Definitely a function header. */
@ -324,6 +329,7 @@ f: if ( line >= buf + (bufsize - 1) ) /* overflow check */
continue;
/* falls through */
default: /* not a function */
concatlits(buf, line, buf + bufsize, in);
wl: fputs(buf, out);
break;
}
@ -349,36 +355,84 @@ wl: fputs(buf, out);
return 0;
}
/*
* Skip forward or backward over one or more preprocessor directives.
*/
char *
ppdirforward(p)
char *p;
{
for (; *p == '#'; ++p) {
for (; *p != '\r' && *p != '\n'; ++p)
if (*p == 0)
return p;
if (*p == '\r' && p[1] == '\n')
++p;
}
return p;
}
char *
ppdirbackward(p, limit)
char *p;
char *limit;
{
char *np = p;
for (;; p = --np) {
if (*np == '\n' && np[-1] == '\r')
--np;
for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np)
if (np[-1] == 0)
return np;
if (*np != '#')
return p;
}
}
/* Skip over whitespace and comments, in either direction. */
char *
skipspace(p, dir)
register char *p;
register int dir; /* 1 for forward, -1 for backward */
{ for ( ; ; )
{ while ( is_space(*p) )
p += dir;
if ( !(*p == '/' && p[dir] == '*') )
break;
p += dir; p += dir;
while ( !(*p == '*' && p[dir] == '/') )
{ if ( *p == 0 )
return p; /* multi-line comment?? */
p += dir;
}
p += dir; p += dir;
}
return p;
char *p;
int dir; /* 1 for forward, -1 for backward */
{
for ( ; ; ) {
while ( is_space(*p) )
p += dir;
if ( !(*p == '/' && p[dir] == '*') )
break;
p += dir; p += dir;
while ( !(*p == '*' && p[dir] == '/') ) {
if ( *p == 0 )
return p; /* multi-line comment?? */
p += dir;
}
p += dir; p += dir;
}
return p;
}
/* Scan over a quoted string, in either direction. */
char *
scanstring(p, dir)
register char *p;
register int dir;
char *p;
int dir;
{
for (p += dir; ; p += dir)
if (*p == '"' && p[-dir] != '\\')
return p + dir;
char quote = *p;
for (p += dir; *p; p += dir) {
if (*p == quote) {
char *q = p;
int backslashed;
for (backslashed = 0; ; backslashed ^= 1) {
for (q--; *q == '\n' && q[-1] == '\\'; q -= 2)
continue;
if (*q != '\\')
break;
}
if (!backslashed)
return p + dir;
}
}
return p; /* unterminated string */
}
/*
@ -412,14 +466,14 @@ writeblanks(start, end)
int
test1(buf)
char *buf;
{ register char *p = buf;
{ char *p = buf;
char *bend;
char *endfn;
int contin;
if ( !isidfirstchar(*p) )
return 0; /* no name at left margin */
bend = skipspace(buf + strlen(buf) - 1, -1);
bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1);
switch ( *bend )
{
case ';': contin = 0 /*2*/; break;
@ -498,7 +552,7 @@ convert1(buf, out, header, convert_varargs)
int header; /* Boolean */
int convert_varargs; /* Boolean */
{ char *endfn;
register char *p;
char *p;
/*
* The breaks table contains pointers to the beginning and end
* of each argument.
@ -558,7 +612,7 @@ top: p = endfn;
if (p[1] == '*')
p = skipspace(p, 1) - 1;
break;
case '"':
case '"': case '\'':
p = scanstring(p, 1) - 1;
break;
default:
@ -592,7 +646,7 @@ top: p = endfn;
if (p > buf && p[-1] == '*')
p = skipspace(p, -1) + 1;
break;
case '"':
case '"': case '\'':
p = scanstring(p, -1) + 1;
break;
default: ;
@ -676,3 +730,65 @@ found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
free((char *)breaks);
return 0;
}
/* Append a line to a buffer. Return the end of the appended line. */
char *
appendline(lineend, bufend, in)
char *lineend;
char *bufend;
FILE *in;
{
if (bufend == lineend)
return NULL;
if (fgets(lineend, (unsigned)(bufend - lineend), in) == NULL)
return NULL;
return lineend + strlen(lineend);
}
/*
* Concatenate string literals in a non-function line, appending
* new lines if a string literal crosses a line boundary or ends a line.
*/
int
concatlits(line, lineend, bufend, in)
char *line;
char *lineend;
FILE *in;
{
char *d = line;
char *s = line;
char *s1;
int pending_newlines = 0;
if (lineend[-1] != '\n')
return 0;
if (*skipspace(s, 1) == '#')
return 0;
while (*s) {
switch ((*d++ = *s++))
{
case '"': case '\'':
for (;;) {
while ((s1 = scanstring(s - 1, 1)) == lineend)
if (!(lineend = appendline(lineend, bufend, in)))
goto finish;
do *d++ = *s++;
while (s != s1);
if (s[-1] != '"')
break;
while ((s1 = skipspace(s, 1)) == lineend)
if (!(lineend = appendline(lineend, bufend, in)))
goto finish;
if (*s1 != '"')
break;
d--;
do pending_newlines += *s++ == '\n';
while (s <= s1);
}
}
}
while (pending_newlines--)
*d++ = '\n';
finish:
strcpy(d, s);
return 0;
}

View File

@ -57,8 +57,17 @@ dir_name (const char *path)
else
{
/* Remove any trailing slashes from the result. */
#ifdef MSDOS
char *lim = (path[0] >= 'A' && path[0] <= 'z' && path[1] == ':')
? path + 2 : path;
/* If canonicalized "d:/path", leave alone the root case "d:/". */
while (slash > lim && *slash == '/')
--slash;
#else
while (slash > path && *slash == '/')
--slash;
#endif
length = slash - path + 1;
}

View File

@ -1,5 +1,5 @@
/* Error handler for noninteractive utilities
Copyright (C) 1990,91,92,93,94,95,96,97,98, 99 Free Software Foundation, Inc.
Copyright (C) 1990-2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
@ -150,12 +150,16 @@ error (status, errnum, message, va_alist)
++error_message_count;
if (errnum)
{
#if defined HAVE_STRERROR_R || defined _LIBC
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
# if HAVE_WORKING_STRERROR_R || _LIBC
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
# else
/* Don't use __strerror_r's return value because on some systems
(at least DEC UNIX 4.0[A-D]) strerror_r returns `int'. */
__strerror_r (errnum, errbuf, sizeof errbuf);
fprintf (stderr, ": %s", errbuf);
# endif
#else
fprintf (stderr, ": %s", strerror (errnum));
#endif
@ -228,12 +232,16 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist)
++error_message_count;
if (errnum)
{
#if defined HAVE_STRERROR_R || defined _LIBC
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
# if HAVE_WORKING_STRERROR_R || _LIBC
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
# else
/* Don't use __strerror_r's return value because on some systems
(at least DEC UNIX 4.0[A-D]) strerror_r returns `int'. */
__strerror_r (errnum, errbuf, sizeof errbuf);
fprintf (stderr, ": %s", errbuf);
# endif
#else
fprintf (stderr, ": %s", strerror (errnum));
#endif

View File

@ -1,4 +1,6 @@
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
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
@ -10,9 +12,9 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
@ -27,6 +29,23 @@
#include <fnmatch.h>
#include <ctype.h>
#if HAVE_STRING_H || defined _LIBC
# include <string.h>
#else
# include <strings.h>
#endif
#if defined STDC_HEADERS || defined _LIBC
# include <stdlib.h>
#endif
/* For platform which support the ISO C amendement 1 functionality we
support user defined character classes. */
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
# include <wchar.h>
# include <wctype.h>
#endif
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
@ -45,23 +64,112 @@
# define ISASCII(c) isascii(c)
# endif
# define ISUPPER(c) (ISASCII (c) && isupper (c))
# ifdef isblank
# define ISBLANK(c) (ISASCII (c) && isblank (c))
# else
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
# endif
# ifdef isgraph
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
# else
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
# endif
# define ISPRINT(c) (ISASCII (c) && isprint (c))
# define ISDIGIT(c) (ISASCII (c) && isdigit (c))
# define ISALNUM(c) (ISASCII (c) && isalnum (c))
# define ISALPHA(c) (ISASCII (c) && isalpha (c))
# define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
# define ISLOWER(c) (ISASCII (c) && islower (c))
# define ISPUNCT(c) (ISASCII (c) && ispunct (c))
# define ISSPACE(c) (ISASCII (c) && isspace (c))
# define ISUPPER(c) (ISASCII (c) && isupper (c))
# define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
# define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
/* The GNU C library provides support for user-defined character classes
and the functions from ISO C amendement 1. */
# ifdef CHARCLASS_NAME_MAX
# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
# else
/* This shouldn't happen but some implementation might still have this
problem. Use a reasonable default value. */
# define CHAR_CLASS_MAX_LENGTH 256
# endif
# ifdef _LIBC
# define IS_CHAR_CLASS(string) __wctype (string)
# else
# define IS_CHAR_CLASS(string) wctype (string)
# endif
# else
# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
# define IS_CHAR_CLASS(string) \
(STREQ (string, "alpha") || STREQ (string, "upper") \
|| STREQ (string, "lower") || STREQ (string, "digit") \
|| STREQ (string, "alnum") || STREQ (string, "xdigit") \
|| STREQ (string, "space") || STREQ (string, "print") \
|| STREQ (string, "punct") || STREQ (string, "graph") \
|| STREQ (string, "cntrl") || STREQ (string, "blank"))
# endif
/* Avoid depending on library functions or files
whose names are inconsistent. */
# if !defined _LIBC && !defined getenv
extern char *getenv ();
# endif
# ifndef errno
extern int errno;
# endif
/* This function doesn't exist on most systems. */
# if !defined HAVE___STRCHRNUL && !defined _LIBC
static char *
__strchrnul (s, c)
const char *s;
int c;
{
char *result = strchr (s, c);
if (result == NULL)
result = strchr (s, '\0');
return result;
}
# endif
# ifndef internal_function
/* Inside GNU libc we mark some function in a special way. In other
environments simply ignore the marking. */
# define internal_function
# endif
/* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */
int
fnmatch (const char *pattern, const char *string, int flags)
static int internal_fnmatch __P ((const char *pattern, const char *string,
int no_leading_period, int flags))
internal_function;
static int
internal_function
internal_fnmatch (pattern, string, no_leading_period, flags)
const char *pattern;
const char *string;
int no_leading_period;
int flags;
{
register const char *p = pattern, *n = string;
register char c;
register unsigned char c;
/* Note that this evaluates C many times. */
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
# ifdef _LIBC
# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
# else
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
# endif
while ((c = *p++) != '\0')
{
@ -72,10 +180,11 @@ fnmatch (const char *pattern, const char *string, int flags)
case '?':
if (*n == '\0')
return FNM_NOMATCH;
else if ((flags & FNM_FILE_NAME) && *n == '/')
else if (*n == '/' && (flags & FNM_FILE_NAME))
return FNM_NOMATCH;
else if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
else if (*n == '.' && no_leading_period
&& (n == string
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH;
break;
@ -88,18 +197,19 @@ fnmatch (const char *pattern, const char *string, int flags)
return FNM_NOMATCH;
c = FOLD (c);
}
if (FOLD (*n) != c)
if (FOLD ((unsigned char) *n) != c)
return FNM_NOMATCH;
break;
case '*':
if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
if (*n == '.' && no_leading_period
&& (n == string
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++)
{
if ((flags & FNM_FILE_NAME) && *n == '/')
if (*n == '/' && (flags & FNM_FILE_NAME))
/* A slash does not match a wildcard under FNM_FILE_NAME. */
return FNM_NOMATCH;
else if (c == '?')
@ -117,82 +227,214 @@ fnmatch (const char *pattern, const char *string, int flags)
}
if (c == '\0')
return 0;
/* The wildcard(s) is/are the last element of the pattern.
If the name is a file name and contains another slash
this does mean it cannot match. */
return ((flags & FNM_FILE_NAME) && strchr (n, '/') != NULL
? FNM_NOMATCH : 0);
else
{
const char *endp;
{
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
c1 = FOLD (c1);
for (--p; *n != '\0'; ++n)
if ((c == '[' || FOLD (*n) == c1) &&
fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
return 0;
return FNM_NOMATCH;
}
endp = __strchrnul (n, (flags & FNM_FILE_NAME) ? '/' : '\0');
if (c == '[')
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
for (--p; n < endp; ++n)
if (internal_fnmatch (p, n,
(no_leading_period
&& (n == string
|| (n[-1] == '/'
&& (flags
& FNM_FILE_NAME)))),
flags2)
== 0)
return 0;
}
else if (c == '/' && (flags & FNM_FILE_NAME))
{
while (*n != '\0' && *n != '/')
++n;
if (*n == '/'
&& (internal_fnmatch (p, n + 1, flags & FNM_PERIOD,
flags) == 0))
return 0;
}
else
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
if (c == '\\' && !(flags & FNM_NOESCAPE))
c = *p;
c = FOLD (c);
for (--p; n < endp; ++n)
if (FOLD ((unsigned char) *n) == c
&& (internal_fnmatch (p, n,
(no_leading_period
&& (n == string
|| (n[-1] == '/'
&& (flags
& FNM_FILE_NAME)))),
flags2) == 0))
return 0;
}
}
/* If we come here no match is possible with the wildcard. */
return FNM_NOMATCH;
case '[':
{
/* Nonzero if the sense of the character class is inverted. */
static int posixly_correct;
register int not;
char cold;
if (posixly_correct == 0)
posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
if (*n == '\0')
return FNM_NOMATCH;
if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
if (*n == '.' && no_leading_period && (n == string
|| (n[-1] == '/'
&& (flags
& FNM_FILE_NAME))))
return FNM_NOMATCH;
not = (*p == '!' || *p == '^');
if (*n == '/' && (flags & FNM_FILE_NAME))
/* `/' cannot be matched. */
return FNM_NOMATCH;
not = (*p == '!' || (posixly_correct < 0 && *p == '^'));
if (not)
++p;
c = *p++;
for (;;)
{
register char cstart = c, cend = c;
unsigned char fn = FOLD ((unsigned char) *n);
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
if (*p == '\0')
return FNM_NOMATCH;
cstart = cend = *p++;
c = FOLD ((unsigned char) *p);
++p;
if (c == fn)
goto matched;
}
else if (c == '[' && *p == ':')
{
/* Leave room for the null. */
char str[CHAR_CLASS_MAX_LENGTH + 1];
size_t c1 = 0;
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
wctype_t wt;
# endif
const char *startp = p;
cstart = cend = FOLD (cstart);
for (;;)
{
if (c1 == CHAR_CLASS_MAX_LENGTH)
/* The name is too long and therefore the pattern
is ill-formed. */
return FNM_NOMATCH;
if (c == '\0')
c = *++p;
if (c == ':' && p[1] == ']')
{
p += 2;
break;
}
if (c < 'a' || c >= 'z')
{
/* This cannot possibly be a character class name.
Match it as a normal range. */
p = startp;
c = '[';
goto normal_bracket;
}
str[c1++] = c;
}
str[c1] = '\0';
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
wt = IS_CHAR_CLASS (str);
if (wt == 0)
/* Invalid character class name. */
return FNM_NOMATCH;
if (__iswctype (__btowc ((unsigned char) *n), wt))
goto matched;
# else
if ((STREQ (str, "alnum") && ISALNUM ((unsigned char) *n))
|| (STREQ (str, "alpha") && ISALPHA ((unsigned char) *n))
|| (STREQ (str, "blank") && ISBLANK ((unsigned char) *n))
|| (STREQ (str, "cntrl") && ISCNTRL ((unsigned char) *n))
|| (STREQ (str, "digit") && ISDIGIT ((unsigned char) *n))
|| (STREQ (str, "graph") && ISGRAPH ((unsigned char) *n))
|| (STREQ (str, "lower") && ISLOWER ((unsigned char) *n))
|| (STREQ (str, "print") && ISPRINT ((unsigned char) *n))
|| (STREQ (str, "punct") && ISPUNCT ((unsigned char) *n))
|| (STREQ (str, "space") && ISSPACE ((unsigned char) *n))
|| (STREQ (str, "upper") && ISUPPER ((unsigned char) *n))
|| (STREQ (str, "xdigit") && ISXDIGIT ((unsigned char) *n)))
goto matched;
# endif
}
else if (c == '\0')
/* [ (unterminated) loses. */
return FNM_NOMATCH;
c = *p++;
c = FOLD (c);
if ((flags & FNM_FILE_NAME) && c == '/')
/* [/] can never match. */
return FNM_NOMATCH;
if (c == '-' && *p != ']')
else
{
cend = *p++;
if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++;
if (cend == '\0')
return FNM_NOMATCH;
cend = FOLD (cend);
c = FOLD (c);
normal_bracket:
if (c == fn)
goto matched;
cold = c;
c = *p++;
}
if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
goto matched;
if (c == '-' && *p != ']')
{
/* It is a range. */
char lo[2];
char fc[2];
char hi[2];
unsigned char cend = *p++;
if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++;
if (cend == '\0')
return FNM_NOMATCH;
lo[0] = cold; lo[1] = '\0';
fc[0] = fn; fc[1] = '\0';
if (strcoll (lo, fc) <= 0)
{
hi[0] = FOLD (cend); hi[1] = '\0';
if (strcoll (fc, hi) <= 0)
goto matched;
}
c = *p++;
}
}
if (c == ']')
break;
}
if (!not)
return FNM_NOMATCH;
break;
matched:;
matched:
/* Skip the rest of the [...] that already matched. */
while (c != ']')
{
@ -208,6 +450,15 @@ fnmatch (const char *pattern, const char *string, int flags)
/* XXX 1003.2d11 is unclear if this is right. */
++p;
}
else if (c == '[' && *p == ':')
{
do
if (*++p == '\0')
return FNM_NOMATCH;
while (*p != ':' || p[1] == ']');
p += 2;
c = *p;
}
}
if (not)
return FNM_NOMATCH;
@ -215,7 +466,7 @@ fnmatch (const char *pattern, const char *string, int flags)
break;
default:
if (c != FOLD (*n))
if (c != FOLD ((unsigned char) *n))
return FNM_NOMATCH;
}
@ -234,4 +485,14 @@ fnmatch (const char *pattern, const char *string, int flags)
# undef FOLD
}
int
fnmatch (pattern, string, flags)
const char *pattern;
const char *string;
int flags;
{
return internal_fnmatch (pattern, string, flags & FNM_PERIOD, flags);
}
#endif /* _LIBC or not __GNU_LIBRARY__. */

View File

@ -1,41 +1,48 @@
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _FNMATCH_H
#define _FNMATCH_H 1
#ifdef __cplusplus
extern "C" {
#endif
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
#undef __P
#define __P(protos) protos
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
# if !defined __GLIBC__ || !defined __P
# undef __P
# define __P(protos) protos
# endif
#else /* Not C++ or ANSI C. */
#undef __P
#define __P(protos) ()
# undef __P
# define __P(protos) ()
/* We can get away without defining `const' here only because in this file
it is used only inside the prototype for `fnmatch', which is elided in
non-ANSI C where `const' is problematical. */
#endif /* C++ or ANSI C. */
#ifndef const
# if (defined __STDC__ && __STDC__) || defined __cplusplus
# define __const const
# else
# define __const
# endif
#endif
/* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */
@ -48,18 +55,26 @@ extern "C" {
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
#define FNM_NOMATCH 1
/* Match STRING against the filename pattern PATTERN,
/* This value is returned if the implementation does not support
`fnmatch'. Since this is not the case here it will never be
returned but the conformance test suites still require the symbol
to be defined. */
#ifdef _XOPEN_SOURCE
# define FNM_NOSYS (-1)
#endif
/* Match NAME against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch __P ((const char *__pattern, const char *__string,
extern int fnmatch __P ((__const char *__pattern, __const char *__name,
int __flags));
#ifdef __cplusplus

View File

@ -126,7 +126,7 @@ struct option
arguments to the option '\0'. This behavior is specific to the GNU
`getopt'. */
#if defined __STDC__ && __STDC__
#if (defined __STDC__ && __STDC__) || defined PROTOTYPES
# ifdef __GNU_LIBRARY__
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
@ -149,7 +149,7 @@ extern int _getopt_internal (int __argc, char *const *__argv,
const struct option *__longopts, int *__longind,
int __long_only);
# endif
#else /* not __STDC__ */
#else /* not ((defined __STDC__ && __STDC__) || defined PROTOTYPES) */
extern int getopt ();
# ifndef __need_getopt
extern int getopt_long ();
@ -157,7 +157,7 @@ extern int getopt_long_only ();
extern int _getopt_internal ();
# endif
#endif /* __STDC__ */
#endif /* (defined __STDC__ && __STDC__) || defined PROTOTYPES */
#ifdef __cplusplus
}

View File

@ -1,5 +1,5 @@
/* listfile.c -- display a long listing of a file
Copyright (C) 1991, 1993 Free Software Foundation, Inc.
Copyright (C) 1991, 1993, 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
@ -19,6 +19,25 @@
# include <config.h>
#endif
#ifndef __GNUC__
# if HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
# pragma alloca
# else
# ifdef _WIN32
# include <malloc.h>
# include <io.h>
# else
# ifndef alloca
char *alloca ();
# endif
# endif
# endif
# endif
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
@ -26,6 +45,7 @@
#include <grp.h>
#include <time.h>
#include <errno.h>
#include "human.h"
#include "pathmax.h"
#if HAVE_STRING_H || STDC_HEADERS
@ -71,29 +91,66 @@ extern int errno;
int readlink ();
#endif
/* Get or fake the disk device blocksize.
Usually defined by sys/param.h (if at all). */
#ifndef DEV_BSIZE
# ifdef BSIZE
# define DEV_BSIZE BSIZE
# else /* !BSIZE */
# define DEV_BSIZE 4096
# endif /* !BSIZE */
#endif /* !DEV_BSIZE */
/* Extract or fake data from a `struct stat'.
ST_NBLOCKS: Number of 512-byte blocks in the file
(including indirect blocks).
HP-UX, perhaps uniquely, counts st_blocks in 1024-byte units.
This workaround loses when mixing HP-UX and 4BSD filesystems, though. */
#ifdef _POSIX_SOURCE
# define ST_NBLOCKS(statp) (((statp)->st_size + 512 - 1) / 512)
#else
# ifndef HAVE_ST_BLOCKS
# define ST_NBLOCKS(statp) (st_blocks ((statp)->st_size))
# else
# if defined(hpux) || defined(__hpux__)
# define ST_NBLOCKS(statp) ((statp)->st_blocks * 2)
# else
# define ST_NBLOCKS(statp) ((statp)->st_blocks)
# endif
# endif
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) \
(S_ISREG ((statbuf).st_mode) \
|| S_ISDIR ((statbuf).st_mode) \
? (statbuf).st_size / ST_NBLOCKSIZE + ((statbuf).st_size % ST_NBLOCKSIZE != 0) : 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. */
# define ST_BLKSIZE(statbuf) ((statbuf).st_blksize > 0 \
? (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 filesystems 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) \
(S_ISREG ((statbuf).st_mode) \
|| S_ISDIR ((statbuf).st_mode) \
? (statbuf).st_blocks : 0)
#endif
/* Convert NUMBER 512-byte blocks to kilobytes if KILOFLAG is nonzero,
otherwise return it unchanged. */
#define convert_blocks(Number, Kiloflag) \
((Kiloflag) ? ((Number) + 1) / 2 : (Number))
#ifndef ST_NBLOCKSIZE
# define ST_NBLOCKSIZE 512
#endif
#ifndef _POSIX_VERSION
struct passwd *getpwuid ();
@ -121,63 +178,113 @@ void print_name_with_quoting ();
/* NAME is the name to print.
RELNAME is the path to access it from the current directory.
STATP is the results of stat or lstat on it.
Use CURRENT_TIME to decide whether to print yyyy or hh:mm.
Use OUTPUT_BLOCK_SIZE to determine how to print file block counts
and sizes.
STREAM is the stdio stream to print on. */
void
list_file (name, relname, statp, stream)
list_file (name, relname, statp, current_time, output_block_size, stream)
char *name;
char *relname;
struct stat *statp;
time_t current_time;
int output_block_size;
FILE *stream;
{
static int kilobytes = -1; /* -1 = uninitialized, 0 = 512, 1 = 1024. */
char modebuf[20];
char timebuf[40];
time_t current_time = time ((time_t *) 0);
if (kilobytes == -1)
kilobytes = getenv ("POSIXLY_CORRECT") == 0;
char modebuf[11];
struct tm const *when_local;
char const *user_name;
char const *group_name;
char hbuf[LONGEST_HUMAN_READABLE + 1];
#if HAVE_ST_DM_MODE
/* Cray DMF: look at the file's migrated, not real, status */
mode_string (statp->st_dm_mode, modebuf);
#else
mode_string (statp->st_mode, modebuf);
#endif
modebuf[10] = '\0';
strcpy (timebuf, ctime (&statp->st_mtime));
if (current_time > statp->st_mtime + 6L * 30L * 24L * 60L * 60L /* Old. */
|| current_time < statp->st_mtime - 60L * 60L) /* In the future. */
{
/* The file is fairly old or in the future.
POSIX says the cutoff is 6 months old;
approximate this by 6*30 days.
Allow a 1 hour slop factor for what is considered "the future",
to allow for NFS server/client clock disagreement.
Show the year instead of the time of day. */
strcpy (timebuf + 11, timebuf + 19);
}
timebuf[16] = 0;
fprintf (stream, "%6s ",
human_readable ((uintmax_t) statp->st_ino, hbuf, 1, 1));
fprintf (stream, "%6lu ", statp->st_ino);
fprintf (stream, "%4lu ",
(long) convert_blocks (ST_NBLOCKS (statp), kilobytes));
fprintf (stream, "%4s ",
human_readable ((uintmax_t) ST_NBLOCKS (*statp), hbuf,
ST_NBLOCKSIZE, output_block_size));
/* The space between the mode and the number of links is the POSIX
"optional alternate access method flag". */
fprintf (stream, "%s %3u ", modebuf, statp->st_nlink);
"optional alternate access method flag". */
fprintf (stream, "%s %3lu ", modebuf, (unsigned long) statp->st_nlink);
fprintf (stream, "%-8.8s ", getuser (statp->st_uid));
user_name = getuser (statp->st_uid);
if (user_name)
fprintf (stream, "%-8.8s ", user_name);
else
fprintf (stream, "%-8lu ", (unsigned long) statp->st_uid);
fprintf (stream, "%-8.8s ", getgroup (statp->st_gid));
group_name = getgroup (statp->st_gid);
if (group_name)
fprintf (stream, "%-8.8s ", group_name);
else
fprintf (stream, "%-8lu ", (unsigned long) statp->st_gid);
if (S_ISCHR (statp->st_mode) || S_ISBLK (statp->st_mode))
#ifdef HAVE_ST_RDEV
fprintf (stream, "%3u, %3u ", major (statp->st_rdev), minor (statp->st_rdev));
fprintf (stream, "%3lu, %3lu ",
(unsigned long) major (statp->st_rdev),
(unsigned long) minor (statp->st_rdev));
#else
fprintf (stream, " ");
#endif
else
fprintf (stream, "%8lu ", statp->st_size);
fprintf (stream, "%8s ",
human_readable ((uintmax_t) statp->st_size, hbuf, 1,
output_block_size < 0 ? output_block_size : 1));
fprintf (stream, "%s ", timebuf + 4);
if ((when_local = localtime (&statp->st_mtime)))
{
char init_bigbuf[256];
char *buf = init_bigbuf;
size_t bufsize = sizeof init_bigbuf;
/* Use strftime rather than ctime, because the former can produce
locale-dependent names for the month (%b).
Output the year if the file is fairly old or in the future.
POSIX says the cutoff is 6 months old;
approximate this by 6*30 days.
Allow a 1 hour slop factor for what is considered "the future",
to allow for NFS server/client clock disagreement. */
char const *fmt =
((current_time - 6 * 30 * 24 * 60 * 60 <= statp->st_mtime
&& statp->st_mtime <= current_time + 60 * 60)
? "%b %e %H:%M"
: "%b %e %Y");
while (!strftime (buf, bufsize, fmt, when_local))
buf = (char *) alloca (bufsize *= 2);
fprintf (stream, "%s ", buf);
}
else
{
/* The time cannot be represented as a local time;
print it as a huge integer number of seconds. */
int width = 12;
if (statp->st_mtime < 0)
{
char const *num = human_readable (- (uintmax_t) statp->st_mtime,
hbuf, 1, 1);
int sign_width = width - strlen (num);
fprintf (stream, "%*s%s ",
sign_width < 0 ? 0 : sign_width, "-", num);
}
else
fprintf (stream, "%*s ", width,
human_readable ((uintmax_t) statp->st_mtime, hbuf, 1, 1));
}
print_name_with_quoting (name, stream);

View File

@ -157,7 +157,7 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
{
struct mode_change *head; /* First element of the linked list. */
struct mode_change *tail; /* An element of the linked list. */
unsigned long mode_value; /* The mode value, if octal. */
uintmax_t mode_value; /* The mode value, if octal. */
char *string_end; /* Pointer to end of parsed value. */
mode_t umask_value; /* The umask value (surprise). */
@ -166,10 +166,10 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
tail = NULL;
#endif
if (xstrtoul (mode_string, &string_end, 8, &mode_value, "") == LONGINT_OK)
if (xstrtoumax (mode_string, &string_end, 8, &mode_value, "") == LONGINT_OK)
{
struct mode_change *p;
if (mode_value > CHMOD_MODE_BITS)
if (mode_value != (mode_value & CHMOD_MODE_BITS))
return MODE_INVALID;
p = make_node_op_equals ((mode_t) mode_value);
if (p == NULL)

View File

@ -2,7 +2,7 @@
version 0.12.
(Implements POSIX draft P1003.2/D11.2, except for some of the
internationalization features.)
Copyright (C) 1993, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
Copyright (C) 1993-1999, 2000 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
@ -78,7 +78,12 @@
__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
#define btowc __btowc
# define btowc __btowc
/* We are also using some library internals. */
# include <locale/localeinfo.h>
# include <locale/elem-hash.h>
# include <langinfo.h>
#endif
/* This is for other GNU distributions with internationalized messages. */
@ -164,47 +169,15 @@ char *realloc ();
# define SWITCH_ENUM_CAST(x) (x)
# endif
/* How many characters in the character set. */
# define CHAR_SET_SIZE 256
# ifdef SYNTAX_TABLE
extern char *re_syntax_table;
# else /* not SYNTAX_TABLE */
static char re_syntax_table[CHAR_SET_SIZE];
static void
init_syntax_once ()
{
register int c;
static int done = 0;
if (done)
return;
bzero (re_syntax_table, sizeof re_syntax_table);
for (c = 'a'; c <= 'z'; c++)
re_syntax_table[c] = Sword;
for (c = 'A'; c <= 'Z'; c++)
re_syntax_table[c] = Sword;
for (c = '0'; c <= '9'; c++)
re_syntax_table[c] = Sword;
re_syntax_table['_'] = Sword;
done = 1;
}
# endif /* not SYNTAX_TABLE */
# define SYNTAX(c) re_syntax_table[c]
#endif /* not emacs */
#if defined _LIBC || HAVE_LIMITS_H
# include <limits.h>
#endif
#ifndef MB_LEN_MAX
# define MB_LEN_MAX 1
#endif
/* Get the interface, including the syntax bits. */
#include <regex.h>
@ -276,6 +249,43 @@ init_syntax_once ()
# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
#endif
#ifndef emacs
/* How many characters in the character set. */
# define CHAR_SET_SIZE 256
# ifdef SYNTAX_TABLE
extern char *re_syntax_table;
# else /* not SYNTAX_TABLE */
static char re_syntax_table[CHAR_SET_SIZE];
static void
init_syntax_once ()
{
register int c;
static int done = 0;
if (done)
return;
bzero (re_syntax_table, sizeof re_syntax_table);
for (c = 0; c < CHAR_SET_SIZE; ++c)
if (ISALNUM (c))
re_syntax_table[c] = Sword;
re_syntax_table['_'] = Sword;
done = 1;
}
# endif /* not SYNTAX_TABLE */
# define SYNTAX(c) re_syntax_table[(unsigned char) (c)]
#endif /* emacs */
/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
use `alloca' instead of `malloc'. This is because using malloc in
re_search* or re_match* could cause memory leaks when C-g is used in
@ -615,7 +625,7 @@ extract_number_and_incr (destination, source)
/* It is useful to test things that ``must'' be true when debugging. */
# include <assert.h>
static int debug = 0;
static int debug;
# define DEBUG_STATEMENT(e) e
# define DEBUG_PRINT1(x) if (debug) printf (x)
@ -1013,25 +1023,79 @@ weak_alias (__re_set_syntax, re_set_syntax)
POSIX doesn't require that we do anything for REG_NOERROR,
but why not be nice? */
static const char *re_error_msgid[] =
static const char re_error_msgid[] =
{
gettext_noop ("Success"), /* REG_NOERROR */
gettext_noop ("No match"), /* REG_NOMATCH */
gettext_noop ("Invalid regular expression"), /* REG_BADPAT */
gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */
gettext_noop ("Invalid character class name"), /* REG_ECTYPE */
gettext_noop ("Trailing backslash"), /* REG_EESCAPE */
gettext_noop ("Invalid back reference"), /* REG_ESUBREG */
gettext_noop ("Unmatched [ or [^"), /* REG_EBRACK */
gettext_noop ("Unmatched ( or \\("), /* REG_EPAREN */
gettext_noop ("Unmatched \\{"), /* REG_EBRACE */
gettext_noop ("Invalid content of \\{\\}"), /* REG_BADBR */
gettext_noop ("Invalid range end"), /* REG_ERANGE */
gettext_noop ("Memory exhausted"), /* REG_ESPACE */
gettext_noop ("Invalid preceding regular expression"), /* REG_BADRPT */
gettext_noop ("Premature end of regular expression"), /* REG_EEND */
gettext_noop ("Regular expression too big"), /* REG_ESIZE */
gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */
#define REG_NOERROR_IDX 0
gettext_noop ("Success") /* REG_NOERROR */
"\0"
#define REG_NOMATCH_IDX (REG_NOERROR_IDX + sizeof "Success")
gettext_noop ("No match") /* REG_NOMATCH */
"\0"
#define REG_BADPAT_IDX (REG_NOMATCH_IDX + sizeof "No match")
gettext_noop ("Invalid regular expression") /* REG_BADPAT */
"\0"
#define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression")
gettext_noop ("Invalid collation character") /* REG_ECOLLATE */
"\0"
#define REG_ECTYPE_IDX (REG_ECOLLATE_IDX + sizeof "Invalid collation character")
gettext_noop ("Invalid character class name") /* REG_ECTYPE */
"\0"
#define REG_EESCAPE_IDX (REG_ECTYPE_IDX + sizeof "Invalid character class name")
gettext_noop ("Trailing backslash") /* REG_EESCAPE */
"\0"
#define REG_ESUBREG_IDX (REG_EESCAPE_IDX + sizeof "Trailing backslash")
gettext_noop ("Invalid back reference") /* REG_ESUBREG */
"\0"
#define REG_EBRACK_IDX (REG_ESUBREG_IDX + sizeof "Invalid back reference")
gettext_noop ("Unmatched [ or [^") /* REG_EBRACK */
"\0"
#define REG_EPAREN_IDX (REG_EBRACK_IDX + sizeof "Unmatched [ or [^")
gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */
"\0"
#define REG_EBRACE_IDX (REG_EPAREN_IDX + sizeof "Unmatched ( or \\(")
gettext_noop ("Unmatched \\{") /* REG_EBRACE */
"\0"
#define REG_BADBR_IDX (REG_EBRACE_IDX + sizeof "Unmatched \\{")
gettext_noop ("Invalid content of \\{\\}") /* REG_BADBR */
"\0"
#define REG_ERANGE_IDX (REG_BADBR_IDX + sizeof "Invalid content of \\{\\}")
gettext_noop ("Invalid range end") /* REG_ERANGE */
"\0"
#define REG_ESPACE_IDX (REG_ERANGE_IDX + sizeof "Invalid range end")
gettext_noop ("Memory exhausted") /* REG_ESPACE */
"\0"
#define REG_BADRPT_IDX (REG_ESPACE_IDX + sizeof "Memory exhausted")
gettext_noop ("Invalid preceding regular expression") /* REG_BADRPT */
"\0"
#define REG_EEND_IDX (REG_BADRPT_IDX + sizeof "Invalid preceding regular expression")
gettext_noop ("Premature end of regular expression") /* REG_EEND */
"\0"
#define REG_ESIZE_IDX (REG_EEND_IDX + sizeof "Premature end of regular expression")
gettext_noop ("Regular expression too big") /* REG_ESIZE */
"\0"
#define REG_ERPAREN_IDX (REG_ESIZE_IDX + sizeof "Regular expression too big")
gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */
};
static const size_t re_error_msgid_idx[] =
{
REG_NOERROR_IDX,
REG_NOMATCH_IDX,
REG_BADPAT_IDX,
REG_ECOLLATE_IDX,
REG_ECTYPE_IDX,
REG_EESCAPE_IDX,
REG_ESUBREG_IDX,
REG_EBRACK_IDX,
REG_EPAREN_IDX,
REG_EBRACE_IDX,
REG_BADBR_IDX,
REG_ERANGE_IDX,
REG_ESPACE_IDX,
REG_BADRPT_IDX,
REG_EEND_IDX,
REG_ESIZE_IDX,
REG_ERPAREN_IDX
};
/* Avoiding alloca during matching, to placate r_alloc. */
@ -1514,7 +1578,8 @@ static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p,
reg_syntax_t syntax));
static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend,
reg_syntax_t syntax));
static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
static reg_errcode_t compile_range _RE_ARGS ((unsigned int range_start,
const char **p_ptr,
const char *pend,
char *translate,
reg_syntax_t syntax,
@ -1712,7 +1777,7 @@ typedef struct
{ if (p != pend) \
{ \
PATFETCH (c); \
while (ISDIGIT (c)) \
while ('0' <= c && c <= '9') \
{ \
if (num < 0) \
num = 0; \
@ -2118,6 +2183,7 @@ regex_compile (pattern, size, syntax, bufp)
case '[':
{
boolean had_char_class = false;
unsigned int range_start = 0xffffffff;
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
@ -2161,6 +2227,7 @@ regex_compile (pattern, size, syntax, bufp)
PATFETCH (c1);
SET_LIST_BIT (c1);
range_start = c1;
continue;
}
@ -2185,8 +2252,10 @@ regex_compile (pattern, size, syntax, bufp)
&& *p != ']')
{
reg_errcode_t ret
= compile_range (&p, pend, translate, syntax, b);
= compile_range (range_start, &p, pend, translate,
syntax, b);
if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
range_start = 0xffffffff;
}
else if (p[0] == '-' && p[1] != ']')
@ -2196,8 +2265,9 @@ regex_compile (pattern, size, syntax, bufp)
/* Move past the `-'. */
PATFETCH (c1);
ret = compile_range (&p, pend, translate, syntax, b);
ret = compile_range (c, &p, pend, translate, syntax, b);
if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
range_start = 0xffffffff;
}
/* See if we're at the beginning of a possible character
@ -2320,13 +2390,289 @@ regex_compile (pattern, size, syntax, bufp)
PATUNFETCH;
SET_LIST_BIT ('[');
SET_LIST_BIT (':');
range_start = ':';
had_char_class = false;
}
}
else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '=')
{
unsigned char str[MB_LEN_MAX + 1];
#ifdef _LIBC
uint32_t nrules =
_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
#endif
PATFETCH (c);
c1 = 0;
/* If pattern is `[[='. */
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
for (;;)
{
PATFETCH (c);
if ((c == '=' && *p == ']') || p == pend)
break;
if (c1 < MB_LEN_MAX)
str[c1++] = c;
else
/* This is in any case an invalid class name. */
str[0] = '\0';
}
str[c1] = '\0';
if (c == '=' && *p == ']' && str[0] != '\0')
{
/* If we have no collation data we use the default
collation in which each character is in a class
by itself. It also means that ASCII is the
character set and therefore we cannot have character
with more than one byte in the multibyte
representation. */
#ifdef _LIBC
if (nrules == 0)
#endif
{
if (c1 != 1)
FREE_STACK_RETURN (REG_ECOLLATE);
/* Throw away the ] at the end of the equivalence
class. */
PATFETCH (c);
/* Set the bit for the character. */
SET_LIST_BIT (str[0]);
}
#ifdef _LIBC
else
{
/* Try to match the byte sequence in `str' against
those known to the collate implementation.
First find out whether the bytes in `str' are
actually from exactly one character. */
const int32_t *table;
const unsigned char *weights;
const unsigned char *extra;
const int32_t *indirect;
int32_t idx;
const unsigned char *cp = str;
int ch;
/* This #include defines a local function! */
# include <locale/weight.h>
table = (const int32_t *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
weights = (const unsigned char *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB);
extra = (const unsigned char *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
indirect = (const int32_t *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
idx = findidx (&cp);
if (idx == 0 || cp < str + c1)
/* This is no valid character. */
FREE_STACK_RETURN (REG_ECOLLATE);
/* Throw away the ] at the end of the equivalence
class. */
PATFETCH (c);
/* Now we have to go throught the whole table
and find all characters which have the same
first level weight.
XXX Note that this is not entirely correct.
we would have to match multibyte sequences
but this is not possible with the current
implementation. */
for (ch = 1; ch < 256; ++ch)
/* XXX This test would have to be changed if we
would allow matching multibyte sequences. */
if (table[ch] > 0)
{
int32_t idx2 = table[ch];
size_t len = weights[idx2];
/* Test whether the lenghts match. */
if (weights[idx] == len)
{
/* They do. New compare the bytes of
the weight. */
size_t cnt = 0;
while (cnt < len
&& (weights[idx + 1 + cnt]
== weights[idx2 + 1 + cnt]))
++len;
if (cnt == len)
/* They match. Mark the character as
acceptable. */
SET_LIST_BIT (ch);
}
}
}
#endif
had_char_class = true;
}
else
{
c1++;
while (c1--)
PATUNFETCH;
SET_LIST_BIT ('[');
SET_LIST_BIT ('=');
range_start = '=';
had_char_class = false;
}
}
else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '.')
{
unsigned char str[128]; /* Should be large enough. */
#ifdef _LIBC
uint32_t nrules =
_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
#endif
PATFETCH (c);
c1 = 0;
/* If pattern is `[[='. */
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
for (;;)
{
PATFETCH (c);
if ((c == '.' && *p == ']') || p == pend)
break;
if (c1 < sizeof (str))
str[c1++] = c;
else
/* This is in any case an invalid class name. */
str[0] = '\0';
}
str[c1] = '\0';
if (c == '.' && *p == ']' && str[0] != '\0')
{
/* If we have no collation data we use the default
collation in which each character is the name
for its own class which contains only the one
character. It also means that ASCII is the
character set and therefore we cannot have character
with more than one byte in the multibyte
representation. */
#ifdef _LIBC
if (nrules == 0)
#endif
{
if (c1 != 1)
FREE_STACK_RETURN (REG_ECOLLATE);
/* Throw away the ] at the end of the equivalence
class. */
PATFETCH (c);
/* Set the bit for the character. */
SET_LIST_BIT (str[0]);
range_start = ((const unsigned char *) str)[0];
}
#ifdef _LIBC
else
{
/* Try to match the byte sequence in `str' against
those known to the collate implementation.
First find out whether the bytes in `str' are
actually from exactly one character. */
int32_t table_size;
const int32_t *symb_table;
const unsigned char *extra;
int32_t idx;
int32_t elem;
int32_t second;
int32_t hash;
table_size =
_NL_CURRENT_WORD (LC_COLLATE,
_NL_COLLATE_SYMB_HASH_SIZEMB);
symb_table = (const int32_t *)
_NL_CURRENT (LC_COLLATE,
_NL_COLLATE_SYMB_TABLEMB);
extra = (const unsigned char *)
_NL_CURRENT (LC_COLLATE,
_NL_COLLATE_SYMB_EXTRAMB);
/* Locate the character in the hashing table. */
hash = elem_hash (str, c1);
idx = 0;
elem = hash % table_size;
second = hash % (table_size - 2);
while (symb_table[2 * elem] != 0)
{
/* First compare the hashing value. */
if (symb_table[2 * elem] == hash
&& c1 == extra[symb_table[2 * elem + 1]]
&& memcmp (str,
&extra[symb_table[2 * elem + 1]
+ 1],
c1) == 0)
{
/* Yep, this is the entry. */
idx = symb_table[2 * elem + 1];
idx += 1 + extra[idx];
break;
}
/* Next entry. */
elem += second;
}
if (symb_table[2 * elem] == 0)
/* This is no valid character. */
FREE_STACK_RETURN (REG_ECOLLATE);
/* Throw away the ] at the end of the equivalence
class. */
PATFETCH (c);
/* Now add the multibyte character(s) we found
to the acceptabed list.
XXX Note that this is not entirely correct.
we would have to match multibyte sequences
but this is not possible with the current
implementation. Also, we have to match
collating symbols, which expand to more than
one file, as a whole and not allow the
individual bytes. */
c1 = extra[idx++];
if (c1 == 1)
range_start = extra[idx];
while (c1-- > 0)
SET_LIST_BIT (extra[idx++]);
}
#endif
had_char_class = false;
}
else
{
c1++;
while (c1--)
PATUNFETCH;
SET_LIST_BIT ('[');
SET_LIST_BIT ('.');
range_start = '.';
had_char_class = false;
}
}
else
{
had_char_class = false;
SET_LIST_BIT (c);
range_start = c;
}
}
@ -2553,7 +2899,7 @@ regex_compile (pattern, size, syntax, bufp)
if (!(syntax & RE_INTERVALS)
/* If we're at `\{' and it's not the open-interval
operator. */
|| ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
|| (syntax & RE_NO_BK_BRACES)
|| (p - 2 == pattern && p == pend))
goto normal_backslash;
@ -2579,7 +2925,8 @@ regex_compile (pattern, size, syntax, bufp)
if (c == ',')
{
GET_UNSIGNED_NUMBER (upper_bound);
if (upper_bound < 0) upper_bound = RE_DUP_MAX;
if (upper_bound < 0)
upper_bound = RE_DUP_MAX;
}
else
/* Interval such as `{1}' => match exactly once. */
@ -3076,49 +3423,53 @@ group_in_compile_stack (compile_stack, regnum)
`regex_compile' itself. */
static reg_errcode_t
compile_range (p_ptr, pend, translate, syntax, b)
const char **p_ptr, *pend;
RE_TRANSLATE_TYPE translate;
reg_syntax_t syntax;
unsigned char *b;
compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
unsigned int range_start_char;
const char **p_ptr, *pend;
RE_TRANSLATE_TYPE translate;
reg_syntax_t syntax;
unsigned char *b;
{
unsigned this_char;
const char *p = *p_ptr;
unsigned int range_start, range_end;
reg_errcode_t ret;
char range_start[2];
char range_end[2];
char ch[2];
if (p == pend)
return REG_ERANGE;
/* Even though the pattern is a signed `char *', we need to fetch
with unsigned char *'s; if the high bit of the pattern character
is set, the range endpoints will be negative if we fetch using a
signed char *.
We also want to fetch the endpoints without translating them; the
/* Fetch the endpoints without translating them; the
appropriate translation is done in the bit-setting loop below. */
/* The SVR4 compiler on the 3B2 had trouble with unsigned const char *. */
range_start = ((const unsigned char *) p)[-2];
range_end = ((const unsigned char *) p)[0];
range_start[0] = range_start_char;
range_start[1] = '\0';
range_end[0] = p[0];
range_end[1] = '\0';
/* Have to increment the pointer into the pattern string, so the
caller isn't still at the ending character. */
(*p_ptr)++;
/* If the start is after the end, the range is empty. */
if (range_start > range_end)
return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
/* Report an error if the range is empty and the syntax prohibits this. */
ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
/* Here we see why `this_char' has to be larger than an `unsigned
char' -- the range is inclusive, so if `range_end' == 0xff
(assuming 8-bit characters), we would otherwise go into an infinite
loop, since all characters <= 0xff. */
for (this_char = range_start; this_char <= range_end; this_char++)
char' -- we would otherwise go into an infinite loop, since all
characters <= 0xff. */
ch[1] = '\0';
for (this_char = 0; this_char <= (unsigned char) -1; ++this_char)
{
SET_LIST_BIT (TRANSLATE (this_char));
ch[0] = this_char;
if (strcoll (range_start, ch) <= 0 && strcoll (ch, range_end) <= 0)
{
SET_LIST_BIT (TRANSLATE (this_char));
ret = REG_NOERROR;
}
}
return REG_NOERROR;
return ret;
}
/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
@ -3848,7 +4199,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
fail_stack_type fail_stack;
#endif
#ifdef DEBUG
static unsigned failure_id = 0;
static unsigned failure_id;
unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
#endif
@ -4779,26 +5130,15 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
}
else if ((re_opcode_t) *p2 == charset)
{
#ifdef DEBUG
register unsigned char c
= *p2 == (unsigned char) endline ? '\n' : p2[2];
#endif
#if 0
/* We win if the first character of the loop is not part
of the charset. */
if ((re_opcode_t) p1[3] == exactn
&& ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
&& (p2[2 + p1[5] / BYTEWIDTH]
& (1 << (p1[5] % BYTEWIDTH)))))
#else
if ((re_opcode_t) p1[3] == exactn
&& ! ((int) p2[1] * BYTEWIDTH > (int) p1[4]
&& (p2[2 + p1[4] / BYTEWIDTH]
& (1 << (p1[4] % BYTEWIDTH)))))
#endif
{
p[-3] = (unsigned char) pop_failure_jump;
DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
c, p1[5]);
&& ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
&& (p2[2 + p1[5] / BYTEWIDTH]
& (1 << (p1[5] % BYTEWIDTH)))))
{
p[-3] = (unsigned char) pop_failure_jump;
DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
}
else if ((re_opcode_t) p1[3] == charset_not)
@ -5489,7 +5829,7 @@ re_compile_pattern (pattern, length, bufp)
if (!ret)
return NULL;
return gettext (re_error_msgid[(int) ret]);
return gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
}
#ifdef _LIBC
weak_alias (__re_compile_pattern, re_compile_pattern)
@ -5526,12 +5866,14 @@ re_comp (s)
{
re_comp_buf.buffer = (unsigned char *) malloc (200);
if (re_comp_buf.buffer == NULL)
return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
return (char *) gettext (re_error_msgid
+ re_error_msgid_idx[(int) REG_ESPACE]);
re_comp_buf.allocated = 200;
re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
if (re_comp_buf.fastmap == NULL)
return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
return (char *) gettext (re_error_msgid
+ re_error_msgid_idx[(int) REG_ESPACE]);
}
/* Since `re_exec' always passes NULL for the `regs' argument, we
@ -5546,7 +5888,7 @@ re_comp (s)
return NULL;
/* Yes, we're discarding `const' here if !HAVE_LIBINTL. */
return (char *) gettext (re_error_msgid[(int) ret]);
return (char *) gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
}
@ -5666,7 +6008,7 @@ regcomp (preg, pattern, cflags)
buffer. */
if (re_compile_fastmap (preg) == -2)
{
/* Some error occured while computing the fastmap, just forget
/* Some error occurred while computing the fastmap, just forget
about it. */
free (preg->fastmap);
preg->fastmap = NULL;
@ -5772,15 +6114,15 @@ regerror (errcode, preg, errbuf, errbuf_size)
size_t msg_size;
if (errcode < 0
|| errcode >= (int) (sizeof (re_error_msgid)
/ sizeof (re_error_msgid[0])))
|| errcode >= (int) (sizeof (re_error_msgid_idx)
/ sizeof (re_error_msgid_idx[0])))
/* Only error codes returned by the rest of the code should be passed
to this routine. If we are given anything else, or if other regex
code generates an invalid error code, then the program has a bug.
Dump core so we can fix it. */
abort ();
msg = gettext (re_error_msgid[errcode]);
msg = gettext (re_error_msgid + re_error_msgid_idx[errcode]);
msg_size = strlen (msg) + 1; /* Includes the null. */

View File

@ -1,542 +1,46 @@
/* Definitions for data structures and routines for the regular
expression library, version 0.12.
Copyright (C) 1985,89,90,91,92,93,95,96,97,98 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _REGEX_H
#define _REGEX_H 1
#include <posix/regex.h>
/* Allow the use in C++ code. */
#ifdef __cplusplus
extern "C" {
#endif
/* Document internal interfaces. */
extern reg_syntax_t __re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
/* POSIX says that <sys/types.h> must be included (by the caller) before
<regex.h>. */
#if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
should be there. */
# include <stddef.h>
#endif
/* The following two types have to be signed and unsigned integer type
wide enough to hold a value of a pointer. For most ANSI compilers
ptrdiff_t and size_t should be likely OK. Still size of these two
types is 2 for Microsoft C. Ugh... */
typedef long int s_reg_t;
typedef unsigned long int active_reg_t;
/* The following bits are used to determine the regexp syntax we
recognize. The set/not-set meanings are chosen so that Emacs syntax
remains the value 0. The bits are given in alphabetical order, and
the definitions shifted by one from the previous bit; thus, when we
add or remove a bit, only one other definition need change. */
typedef unsigned long int reg_syntax_t;
/* If this bit is not set, then \ inside a bracket expression is literal.
If set, then such a \ quotes the following character. */
#define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
/* If this bit is not set, then + and ? are operators, and \+ and \? are
literals.
If set, then \+ and \? are operators and + and ? are literals. */
#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
/* If this bit is set, then character classes are supported. They are:
[:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
[:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
If not set, then character classes are not supported. */
#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
/* If this bit is set, then ^ and $ are always anchors (outside bracket
expressions, of course).
If this bit is not set, then it depends:
^ is an anchor if it is at the beginning of a regular
expression or after an open-group or an alternation operator;
$ is an anchor if it is at the end of a regular expression, or
before a close-group or an alternation operator.
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
POSIX draft 11.2 says that * etc. in leading positions is undefined.
We already implemented a previous draft which made those constructs
invalid, though, so we haven't changed the code back. */
#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
/* If this bit is set, then special characters are always special
regardless of where they are in the pattern.
If this bit is not set, then special characters are special only in
some contexts; otherwise they are ordinary. Specifically,
* + ? and intervals are only special when not after the beginning,
open-group, or alternation operator. */
#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
/* If this bit is set, then *, +, ?, and { cannot be first in an re or
immediately after an alternation or begin-group operator. */
#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
/* If this bit is set, then . matches newline.
If not set, then it doesn't. */
#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
/* If this bit is set, then . doesn't match NUL.
If not set, then it does. */
#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
/* If this bit is set, nonmatching lists [^...] do not match newline.
If not set, they do. */
#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
/* If this bit is set, either \{...\} or {...} defines an
interval, depending on RE_NO_BK_BRACES.
If not set, \{, \}, {, and } are literals. */
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
/* If this bit is set, +, ? and | aren't recognized as operators.
If not set, they are. */
#define RE_LIMITED_OPS (RE_INTERVALS << 1)
/* If this bit is set, newline is an alternation operator.
If not set, newline is literal. */
#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
/* If this bit is set, then `{...}' defines an interval, and \{ and \}
are literals.
If not set, then `\{...\}' defines an interval. */
#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
/* If this bit is set, (...) defines a group, and \( and \) are literals.
If not set, \(...\) defines a group, and ( and ) are literals. */
#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
/* If this bit is set, then \<digit> matches <digit>.
If not set, then \<digit> is a back-reference. */
#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
/* If this bit is set, then | is an alternation operator, and \| is literal.
If not set, then \| is an alternation operator, and | is literal. */
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
/* If this bit is set, then an ending range point collating higher
than the starting range point, as in [z-a], is invalid.
If not set, then when ending range point collates higher than the
starting range point, the range is ignored. */
#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
/* If this bit is set, then an unmatched ) is ordinary.
If not set, then an unmatched ) is invalid. */
#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
/* If this bit is set, succeed as soon as we match the whole pattern,
without further backtracking. */
#define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
/* If this bit is set, do not process the GNU regex operators.
If not set, then the GNU regex operators are recognized. */
#define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
/* If this bit is set, turn on internal regex debugging.
If not set, and debugging was on, turn it off.
This only works if regex.c is compiled -DDEBUG.
We define this bit always, so that all that's needed to turn on
debugging is to recompile regex.c; the calling code can always have
this bit set, and it won't affect anything in the normal case. */
#define RE_DEBUG (RE_NO_GNU_OPS << 1)
/* This global variable defines the particular regexp syntax to use (for
some interfaces). When a regexp is compiled, the syntax used is
stored in the pattern buffer, so changing this does not affect
already-compiled regexps. */
extern reg_syntax_t re_syntax_options;
/* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so
don't delete them!) */
/* [[[begin syntaxes]]] */
#define RE_SYNTAX_EMACS 0
#define RE_SYNTAX_AWK \
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
| RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
| RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
#define RE_SYNTAX_GNU_AWK \
((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
& ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS))
#define RE_SYNTAX_POSIX_AWK \
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
| RE_INTERVALS | RE_NO_GNU_OPS)
#define RE_SYNTAX_GREP \
(RE_BK_PLUS_QM | RE_CHAR_CLASSES \
| RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
| RE_NEWLINE_ALT)
#define RE_SYNTAX_EGREP \
(RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
| RE_NEWLINE_ALT | RE_NO_BK_PARENS \
| RE_NO_BK_VBAR)
#define RE_SYNTAX_POSIX_EGREP \
(RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
/* Syntax bits common to both basic and extended POSIX regex syntax. */
#define _RE_SYNTAX_POSIX_COMMON \
(RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
| RE_INTERVALS | RE_NO_EMPTY_RANGES)
#define RE_SYNTAX_POSIX_BASIC \
(_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
isn't minimal, since other operators, such as \`, aren't disabled. */
#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
(_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
#define RE_SYNTAX_POSIX_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_VBAR \
| RE_UNMATCHED_RIGHT_PAREN_ORD)
/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
/* [[[end syntaxes]]] */
/* Maximum number of duplicates an interval can allow. Some systems
(erroneously) define this in other header files, but we want our
value, so remove any previous define. */
#ifdef RE_DUP_MAX
# undef RE_DUP_MAX
#endif
/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
#define RE_DUP_MAX (0x7fff)
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
/* If this bit is set, then use extended regular expression syntax.
If not set, then use basic regular expression syntax. */
#define REG_EXTENDED 1
/* If this bit is set, then ignore case when matching.
If not set, then case is significant. */
#define REG_ICASE (REG_EXTENDED << 1)
/* If this bit is set, then anchors do not match at newline
characters in the string.
If not set, then anchors do match at newlines. */
#define REG_NEWLINE (REG_ICASE << 1)
/* If this bit is set, then report only success or fail in regexec.
If not set, then returns differ between not matching and errors. */
#define REG_NOSUB (REG_NEWLINE << 1)
/* POSIX `eflags' bits (i.e., information for regexec). */
/* If this bit is set, then the beginning-of-line operator doesn't match
the beginning of the string (presumably because it's not the
beginning of a line).
If not set, then the beginning-of-line operator does match the
beginning of the string. */
#define REG_NOTBOL 1
/* Like REG_NOTBOL, except for the end-of-line. */
#define REG_NOTEOL (1 << 1)
/* If any error codes are removed, changed, or added, update the
`re_error_msg' table in regex.c. */
typedef enum
{
#ifdef _XOPEN_SOURCE
REG_ENOSYS = -1, /* This will never happen for this implementation. */
#endif
REG_NOERROR = 0, /* Success. */
REG_NOMATCH, /* Didn't find a match (for regexec). */
/* POSIX regcomp return error codes. (In the order listed in the
standard.) */
REG_BADPAT, /* Invalid pattern. */
REG_ECOLLATE, /* Not implemented. */
REG_ECTYPE, /* Invalid character class name. */
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* Unmatched left bracket. */
REG_EPAREN, /* Parenthesis imbalance. */
REG_EBRACE, /* Unmatched \{. */
REG_BADBR, /* Invalid contents of \{\}. */
REG_ERANGE, /* Invalid range end. */
REG_ESPACE, /* Ran out of memory. */
REG_BADRPT, /* No preceding re for repetition op. */
/* Error codes we've added. */
REG_EEND, /* Premature end. */
REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
} reg_errcode_t;
/* This data structure represents a compiled pattern. Before calling
the pattern compiler, the fields `buffer', `allocated', `fastmap',
`translate', and `no_sub' can be set. After the pattern has been
compiled, the `re_nsub' field is available. All other fields are
private to the regex routines. */
#ifndef RE_TRANSLATE_TYPE
# define RE_TRANSLATE_TYPE char *
#endif
struct re_pattern_buffer
{
/* [[[begin pattern_buffer]]] */
/* Space that holds the compiled pattern. It is declared as
`unsigned char *' because its elements are
sometimes used as array indexes. */
unsigned char *buffer;
/* Number of bytes to which `buffer' points. */
unsigned long int allocated;
/* Number of bytes actually used in `buffer'. */
unsigned long int used;
/* Syntax setting with which the pattern was compiled. */
reg_syntax_t syntax;
/* Pointer to a fastmap, if any, otherwise zero. re_search uses
the fastmap, if there is one, to skip over impossible
starting points for matches. */
char *fastmap;
/* Either a translate table to apply to all characters before
comparing them, or zero for no translation. The translation
is applied to a pattern when it is compiled and to a string
when it is matched. */
RE_TRANSLATE_TYPE translate;
/* Number of subexpressions found by the compiler. */
size_t re_nsub;
/* Zero if this pattern cannot match the empty string, one else.
Well, in truth it's used only in `re_search_2', to see
whether or not we should use the fastmap, so we don't set
this absolutely perfectly; see `re_compile_fastmap' (the
`duplicate' case). */
unsigned can_be_null : 1;
/* If REGS_UNALLOCATED, allocate space in the `regs' structure
for `max (RE_NREGS, re_nsub + 1)' groups.
If REGS_REALLOCATE, reallocate space if necessary.
If REGS_FIXED, use what's there. */
#define REGS_UNALLOCATED 0
#define REGS_REALLOCATE 1
#define REGS_FIXED 2
unsigned regs_allocated : 2;
/* Set to zero when `regex_compile' compiles a pattern; set to one
by `re_compile_fastmap' if it updates the fastmap. */
unsigned fastmap_accurate : 1;
/* If set, `re_match_2' does not return information about
subexpressions. */
unsigned no_sub : 1;
/* If set, a beginning-of-line anchor doesn't match at the
beginning of the string. */
unsigned not_bol : 1;
/* Similarly for an end-of-line anchor. */
unsigned not_eol : 1;
/* If true, an anchor at a newline matches. */
unsigned newline_anchor : 1;
/* [[[end pattern_buffer]]] */
};
typedef struct re_pattern_buffer regex_t;
/* Type for byte offsets within the string. POSIX mandates this. */
typedef int regoff_t;
/* This is the structure we store register match data in. See
regex.texinfo for a full description of what registers match. */
struct re_registers
{
unsigned num_regs;
regoff_t *start;
regoff_t *end;
};
/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
`re_match_2' returns information about at least this many registers
the first time a `regs' structure is passed. */
#ifndef RE_NREGS
# define RE_NREGS 30
#endif
/* POSIX specification for registers. Aside from the different names than
`re_registers', POSIX uses an array of structures, instead of a
structure of arrays. */
typedef struct
{
regoff_t rm_so; /* Byte offset from string's start to substring's start. */
regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
} regmatch_t;
/* Declarations for routines. */
/* To avoid duplicating every routine declaration -- once with a
prototype (if we are ANSI), and once without (if we aren't) -- we
use the following macro to declare argument types. This
unfortunately clutters up the declarations a bit, but I think it's
worth it. */
#if __STDC__
# define _RE_ARGS(args) args
#else /* not __STDC__ */
# define _RE_ARGS(args) ()
#endif /* not __STDC__ */
/* Sets the current default syntax to SYNTAX, and return the old syntax.
You can also simply assign to the `re_syntax_options' variable. */
extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
/* Compile the regular expression PATTERN, with length LENGTH
and syntax given by the global `re_syntax_options', into the buffer
BUFFER. Return NULL if successful, and an error string if not. */
extern const char *re_compile_pattern
extern const char *__re_compile_pattern
_RE_ARGS ((const char *pattern, size_t length,
struct re_pattern_buffer *buffer));
extern int __re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
/* Compile a fastmap for the compiled pattern in BUFFER; used to
accelerate searches. Return 0 if successful and -2 if was an
internal error. */
extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
/* Search in the string STRING (with length LENGTH) for the pattern
compiled into BUFFER. Start searching at position START, for RANGE
characters. Return the starting position of the match, -1 for no
match, or -2 for an internal error. Also return register
information in REGS (if REGS and BUFFER->no_sub are nonzero). */
extern int re_search
extern int __re_search
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
int length, int start, int range, struct re_registers *regs));
/* Like `re_search', but search in the concatenation of STRING1 and
STRING2. Also, stop searching at index START + STOP. */
extern int re_search_2
extern int __re_search_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, int range, struct re_registers *regs, int stop));
/* Like `re_search', but return how many characters in STRING the regexp
in BUFFER matched, starting at position START. */
extern int re_match
extern int __re_match
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
int length, int start, struct re_registers *regs));
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
extern int re_match_2
extern int __re_match_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, struct re_registers *regs, int stop));
/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
ENDS. Subsequent matches using BUFFER and REGS will use this memory
for recording register information. STARTS and ENDS must be
allocated with malloc, and must each be at least `NUM_REGS * sizeof
(regoff_t)' bytes long.
If NUM_REGS == 0, then subsequent matches should allocate their own
register data.
Unless this function is called, the first search or match using
PATTERN_BUFFER will allocate its own register data, without
freeing the old data. */
extern void re_set_registers
extern void __re_set_registers
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
unsigned num_regs, regoff_t *starts, regoff_t *ends));
#if defined _REGEX_RE_COMP || defined _LIBC
# ifndef _CRAY
/* 4.2 bsd compatibility. */
extern char *re_comp _RE_ARGS ((const char *));
extern int re_exec _RE_ARGS ((const char *));
# endif
extern int __regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
int __cflags));
extern int __regexec _RE_ARGS ((const regex_t *__preg,
const char *__string, size_t __nmatch,
regmatch_t __pmatch[], int __eflags));
extern size_t __regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
char *__errbuf, size_t __errbuf_size));
extern void __regfree _RE_ARGS ((regex_t *__preg));
#endif
/* POSIX compatibility. */
extern int regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
int __cflags));
extern int regexec _RE_ARGS ((const regex_t *__preg,
const char *__string, size_t __nmatch,
regmatch_t __pmatch[], int __eflags));
extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
char *__errbuf, size_t __errbuf_size));
extern void regfree _RE_ARGS ((regex_t *__preg));
#ifdef __cplusplus
}
#endif /* C++ */
#endif /* regex.h */
/*
Local variables:
make-backup-files: t
version-control: t
trim-versions-without-asking: nil
End:
*/

View File

@ -83,14 +83,15 @@ savedir (const char *dir, off_t name_size)
char *name_space;
char *namep;
/* Be sure name_size is at least `1' so there's room for
the final NUL byte. */
name_size += !name_size;
dirp = opendir (dir);
if (dirp == NULL)
return NULL;
/* Be sure name_size is at least `1' so there's room for
the final NUL byte. */
if (name_size <= 0)
name_size = 1;
name_space = (char *) malloc (name_size);
if (name_space == NULL)
{

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1994 Free Software Foundation, Inc.
/* Copyright (C) 1994, 1999 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
@ -24,15 +24,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
*
* Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <string.h>
#include <sys/types.h>
typedef unsigned chartype;
char *
strstr (phaystack, pneedle)
const char *phaystack;
const char *pneedle;
strstr (const char *phaystack, const char *pneedle)
{
register const unsigned char *haystack, *needle;
register chartype b, c;
@ -73,7 +75,7 @@ strstr (phaystack, pneedle)
a = *++haystack;
if (a == '\0')
goto ret0;
shloop: }
shloop:; }
while (a != b);
jin: a = *++haystack;

View File

@ -1,6 +1,5 @@
.deps
Makefile
Makefile.in
bigram
code
config.h.in

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@ -83,8 +85,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@ -158,15 +163,15 @@ man5dir = $(mandir)/man5
MANS = $(man_MANS)
NROFF = nroff
depcomp = $(SHELL) $(top_srcdir)/depcomp
DEP_FILES = @AMDEP@ $(DEPDIR)/bigram$U.Po $(DEPDIR)/code$U.Po \
$(DEPDIR)/frcode$U.Po $(DEPDIR)/locate$U.Po
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
depcomp = $(SHELL) $(top_srcdir)/depcomp
DEP_FILES = @AMDEP@ $(DEPDIR)/bigram$U.Po $(DEPDIR)/code$U.Po \
$(DEPDIR)/frcode$U.Po $(DEPDIR)/locate$U.Po
SOURCES = bigram.c code.c frcode.c locate.c
OBJECTS = bigram$U.o code$U.o frcode$U.o locate$U.o
@ -176,7 +181,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu locate/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -299,15 +304,67 @@ uninstall-binSCRIPTS:
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
rm -f $(DESTDIR)$(bindir)/$$f; \
done
alloca_.c: alloca.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c
bigram_.c: bigram.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/bigram.c; then echo $(srcdir)/bigram.c; else echo bigram.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > bigram_.c
code_.c: code.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/code.c; then echo $(srcdir)/code.c; else echo code.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > code_.c
error_.c: error.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > error_.c
fileblocks_.c: fileblocks.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fileblocks_.c
fnmatch_.c: fnmatch.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fnmatch_.c
frcode_.c: frcode.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/frcode.c; then echo $(srcdir)/frcode.c; else echo frcode.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > frcode_.c
locate_.c: locate.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/locate.c; then echo $(srcdir)/locate.c; else echo locate.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > locate_.c
bigram_.o code_.o frcode_.o locate_.o : $(ANSI2KNR)
lstat_.c: lstat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > lstat_.c
malloc_.c: malloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c
memcmp_.c: memcmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcmp_.c
memcpy_.c: memcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcpy_.c
memset_.c: memset.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memset_.c
mktime_.c: mktime.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mktime_.c
realloc_.c: realloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c
regex_.c: regex.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > regex_.c
stat_.c: stat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stat_.c
stpcpy_.c: stpcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c
strdup_.c: strdup.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strdup_.c
strftime_.c: strftime.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strftime_.c
strncasecmp_.c: strncasecmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strncasecmp.c; then echo $(srcdir)/strncasecmp.c; else echo strncasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strncasecmp_.c
strspn_.c: strspn.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strspn.c; then echo $(srcdir)/strspn.c; else echo strspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strspn_.c
strstr_.c: strstr.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strstr_.c
strtol_.c: strtol.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtol_.c
strtoul_.c: strtoul.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoul_.c
strtoull_.c: strtoull.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoull.c; then echo $(srcdir)/strtoull.c; else echo strtoull.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoull_.c
strtoumax_.c: strtoumax.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c
waitpid_.c: waitpid.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/waitpid.c; then echo $(srcdir)/waitpid.c; else echo waitpid.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > waitpid_.c
alloca_.o bigram_.o code_.o error_.o fileblocks_.o fnmatch_.o frcode_.o \
locate_.o lstat_.o malloc_.o memcmp_.o memcpy_.o memset_.o mktime_.o \
realloc_.o regex_.o stat_.o stpcpy_.o strdup_.o strftime_.o \
strncasecmp_.o strspn_.o strstr_.o strtol_.o strtoul_.o strtoull_.o \
strtoumax_.o waitpid_.o : $(ANSI2KNR)
install-man1:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
@ -394,7 +451,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -f$$here/ID $$unique $(LISP)
mkid -fID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@ -418,20 +475,6 @@ distclean-tags:
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
@AMDEP@include $(DEPDIR)/bigram$U.Po
@AMDEP@include $(DEPDIR)/code$U.Po
@AMDEP@include $(DEPDIR)/frcode$U.Po
@ -452,8 +495,23 @@ maintainer-clean-depend:
@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c -o $@ $<
$(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
info-am:
info: info-am
dvi-am:
@ -533,14 +591,13 @@ distclean-compile clean-compile maintainer-clean-compile mostlyclean-kr \
distclean-kr clean-kr maintainer-clean-kr uninstall-binSCRIPTS \
install-binSCRIPTS install-man1 uninstall-man1 install-man5 \
uninstall-man5 install-man uninstall-man tags mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir \
mostlyclean-depend distclean-depend clean-depend \
maintainer-clean-depend info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
distclean-tags clean-tags maintainer-clean-tags mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend distdir info-am \
info dvi-am dvi check check-am installcheck-am installcheck \
install-exec-am install-exec install-data-am install-data install-am \
install uninstall-am uninstall all-redirect all-am all install-strip \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
$(PROGRAMS) $(LIBPROGRAMS): ../find/version.o ../lib/libfind.a

View File

@ -74,7 +74,7 @@
#include "locatedb.h"
#include <getline.h>
char *xmalloc (size_t);
char *xmalloc PARAMS((size_t));
/* The name this program was run with. */
char *program_name;

View File

@ -78,7 +78,7 @@
#include "locatedb.h"
#include <getline.h>
char *xmalloc (size_t);
char *xmalloc PARAMS((size_t));
/* The name this program was run with. */
char *program_name;

View File

@ -39,4 +39,12 @@
/* Offset added to differential counts to encode them as positive numbers. */
#define LOCATEDB_OLD_OFFSET 14
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
#endif /* !_LOCATEDB_H */

View File

@ -1,3 +1,7 @@
2000-04-05 Kevin Dalley <kevind@rahul.net>
* m4/Makefile.am: new version of file
2000-01-18 Kevin Dalley <kevind@rahul.net>
* Makefile.am: recreated Makefile.am from Makefile.am.in

View File

@ -4,45 +4,43 @@
EXTRA_DIST = README Makefile.am.in \
afs.m4 \
assert.m4 \
c-bs-a.m4 \
check-decl.m4 \
check-type.m4 \
const.m4 \
d-ino.m4 \
d-type.m4 \
decl.m4 \
error.m4 \
fnmatch.m4 \
fstypename.m4 \
getline.m4 \
gettext.m4 \
glibc.m4 \
inttypes_h.m4 \
isc-posix.m4 \
jm-glibc-io.m4 \
jm-macros.m4 \
jm-mktime.m4 \
lfs.m4 \
largefile.m4 \
lcmessage.m4 \
link-follow.m4 \
ls-mntd-fs.m4 \
lstat-slash.m4 \
lstat.m4 \
malloc.m4 \
memcmp.m4 \
mktime.m4 \
perl.m4 \
prereq.m4 \
putenv.m4 \
progtest.m4 \
readdir.m4 \
realloc.m4 \
regex.m4 \
st_dm_mode.m4 \
st_mtim.m4 \
stat.m4 \
strerror_r.m4 \
strftime.m4 \
timespec.m4 \
uintmax_t.m4 \
ulonglong.m4 \
uptime.m4 \
utimbuf.m4 \
utime.m4 \
utimes.m4
xstrtoumax.m4
##m4-files-end
Makefile.am: Makefile.am.in

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@ -84,8 +86,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@ -101,45 +106,43 @@ l = @l@
EXTRA_DIST = README Makefile.am.in \
afs.m4 \
assert.m4 \
c-bs-a.m4 \
check-decl.m4 \
check-type.m4 \
const.m4 \
d-ino.m4 \
d-type.m4 \
decl.m4 \
error.m4 \
fnmatch.m4 \
fstypename.m4 \
getline.m4 \
gettext.m4 \
glibc.m4 \
inttypes_h.m4 \
isc-posix.m4 \
jm-glibc-io.m4 \
jm-macros.m4 \
jm-mktime.m4 \
lfs.m4 \
largefile.m4 \
lcmessage.m4 \
link-follow.m4 \
ls-mntd-fs.m4 \
lstat-slash.m4 \
lstat.m4 \
malloc.m4 \
memcmp.m4 \
mktime.m4 \
perl.m4 \
prereq.m4 \
putenv.m4 \
progtest.m4 \
readdir.m4 \
realloc.m4 \
regex.m4 \
st_dm_mode.m4 \
st_mtim.m4 \
stat.m4 \
strerror_r.m4 \
strftime.m4 \
timespec.m4 \
uintmax_t.m4 \
ulonglong.m4 \
uptime.m4 \
utimbuf.m4 \
utime.m4 \
utimes.m4
xstrtoumax.m4
subdir = m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@ -157,7 +160,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -171,11 +174,12 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir); \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
info-am:

View File

@ -1,45 +1,63 @@
#serial 5
#serial 9, except remove memchr and nanosleep as findutils doesn't need them
dnl This is just a wrapper function to encapsulate this kludge.
dnl Putting it in a separate file like this helps share it between
dnl different packages.
AC_DEFUN(jm_CHECK_DECLS,
[
AC_REQUIRE([_jm_DECL_HEADERS])
AC_REQUIRE([AC_HEADER_TIME])
headers='
#include <stdio.h>
#ifdef HAVE_STRING_H
#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#else
# ifdef HAVE_STRINGS_H
# if HAVE_STRINGS_H
# include <strings.h>
# endif
#endif
#ifdef HAVE_STDLIB_H
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#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 test x = y; then
dnl This code is deliberately never run via ./configure.
dnl FIXME: this is a gross hack to make autoheader put entries
dnl for each of these symbols in the config.h.in.
dnl Otherwise, I'd have to update acconfig.h every time I change
dnl this list of functions.
AC_DEFINE(HAVE_DECL_FREE, 1, [Define if this function is declared.])
AC_DEFINE(HAVE_DECL_LSEEK, 1, [Define if this function is declared.])
AC_DEFINE(HAVE_DECL_MALLOC, 1, [Define if this function is declared.])
AC_DEFINE(HAVE_DECL_MEMCHR, 1, [Define if this function is declared.])
AC_DEFINE(HAVE_DECL_REALLOC, 1, [Define if this function is declared.])
AC_DEFINE(HAVE_DECL_STPCPY, 1, [Define if this function is declared.])
AC_DEFINE(HAVE_DECL_STRSTR, 1, [Define if this function is declared.])
fi
jm_CHECK_DECLARATIONS($headers, free lseek malloc \
memchr realloc stpcpy strstr)
AC_CHECK_DECLS((
free,
getenv,
geteuid,
getlogin,
lseek,
malloc,
realloc,
stpcpy,
strstr,
strtoul,
strtoull,
ttyname), , , $headers)
])
dnl FIXME: when autoconf has support for it.
dnl This is a little helper so we can require these header checks.
AC_DEFUN(_jm_DECL_HEADERS,
[
AC_REQUIRE([AC_HEADER_STDC])
AC_CHECK_HEADERS(memory.h string.h strings.h stdlib.h unistd.h sys/time.h)
])

View File

@ -1,28 +0,0 @@
#serial 1
dnl Just like AC_CHECK_TYPE from autoconf-2.12, but also checks in unistd.h
dnl on systems that have it. Fujitsu UXP/V needs this for ssize_t.
undefine([AC_CHECK_TYPE])
dnl AC_CHECK_TYPE(TYPE, DEFAULT)
AC_DEFUN(AC_CHECK_TYPE,
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_CHECK_HEADERS(unistd.h)
AC_MSG_CHECKING(for $1)
AC_CACHE_VAL(ac_cv_type_$1,
[AC_EGREP_CPP(dnl
changequote(<<,>>)dnl
<<$1[^a-zA-Z_0-9]>>dnl
changequote([,]), [#include <sys/types.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
AC_MSG_RESULT($ac_cv_type_$1)
if test $ac_cv_type_$1 = no; then
AC_DEFINE($1, $2)
fi
])

View File

@ -1,66 +0,0 @@
#serial 1
dnl Just like AC_C_CONST from autoconf-2.12, but with an initializer
dnl for `charset x' and with
dnl AC_DEFINE(const, )
dnl changed to
dnl AC_DEFINE_UNQUOTED(const, [/* empty */])
dnl to avoid this warning:
dnl [...]/m4: Warning: Excess arguments to built-in `define' ignored
undefine([AC_C_CONST])
AC_DEFUN(AC_C_CONST,
[dnl This message is consistent in form with the other checking messages,
dnl and with the result message.
AC_CACHE_CHECK([for working const], ac_cv_c_const,
[AC_TRY_COMPILE(,
changequote(<<, >>)dnl
<<
/* Ultrix mips cc rejects this. */
typedef int charset[2]; const charset x = {0, 0};
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
/* AIX XL C 1.02.0.0 rejects this.
It does not let you subtract one const X* pointer from another in an arm
of an if-expression whose if-part is not a constant expression */
const char *g = "string";
ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++ccp;
p = (char**) ccp;
ccp = (char const *const *) p;
{ /* SCO 3.2v4 cc rejects this. */
char *t;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
int x[] = {25, 17};
const int *foo = &x[0];
++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
typedef const int *iptr;
iptr p = 0;
++p;
}
{ /* AIX XL C 1.02.0.0 rejects this saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
struct s { int j; const int *ap[3]; };
struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
}
>>,
changequote([, ])dnl
ac_cv_c_const=yes, ac_cv_c_const=no)])
if test $ac_cv_c_const = no; then
AC_DEFINE_UNQUOTED(const, [/* empty */])
fi
])

View File

@ -1,43 +0,0 @@
#serial 3
AC_DEFUN(jm_CHECK_DECLARATION,
[
AC_REQUIRE([AC_HEADER_STDC])dnl
test -z "$ac_cv_header_memory_h" && AC_CHECK_HEADERS(memory.h)
test -z "$ac_cv_header_string_h" && AC_CHECK_HEADERS(string.h)
test -z "$ac_cv_header_strings_h" && AC_CHECK_HEADERS(strings.h)
test -z "$ac_cv_header_stdlib_h" && AC_CHECK_HEADERS(stdlib.h)
test -z "$ac_cv_header_unistd_h" && AC_CHECK_HEADERS(unistd.h)
AC_MSG_CHECKING([whether $1 is declared])
AC_CACHE_VAL(jm_cv_func_decl_$1,
[AC_TRY_COMPILE($2,
[
#ifndef $1
char *(*pfn) = (char *(*)) $1
#endif
],
eval "jm_cv_func_decl_$1=yes",
eval "jm_cv_func_decl_$1=no")])
if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then
AC_MSG_RESULT(yes)
ifelse([$3], , :, [$3])
else
AC_MSG_RESULT(no)
ifelse([$4], , , [$4
])dnl
fi
])dnl
dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED
dnl [, ACTION-IF-NOT-DECLARED]])
AC_DEFUN(jm_CHECK_DECLARATIONS,
[
for jm_func in $2
do
jm_CHECK_DECLARATION($jm_func, $1,
[
jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
AC_DEFINE_UNQUOTED($jm_tr_func) $3], $4)dnl
done
])

View File

@ -1,4 +1,4 @@
#serial 2
#serial 3
dnl From Jim Meyering.
dnl
@ -16,10 +16,10 @@ AC_DEFUN(jm_FUNC_GLIBC_UNLOCKED_IO,
# Otherwise, we'd get the Solaris5.5.1 functions that are not
# declared, and that have been removed from Solaris5.6. The resulting
# 5.5.1 binaries would not run on 5.6 due to shared library differences.
jm_CHECK_DECLARATIONS([#include <stdio.h>
], $jm_io_func,
jm_declared=yes,
jm_declared=no)
AC_CHECK_DECLS(($jm_io_func),
jm_declared=yes,
jm_declared=no,
[#include <stdio.h>])
if test $jm_declared = yes; then
AC_CHECK_FUNCS($jm_io_func)
fi

View File

@ -1,4 +1,4 @@
#serial 11
#serial 13, with several lines deleted for fileutils.
dnl Misc type-related macros for fileutils, sh-utils, textutils.
@ -11,36 +11,90 @@ AC_DEFUN(jm_MACROS,
[The concatenation of the strings `GNU ', and PACKAGE.])
AC_SUBST(GNU_PACKAGE)
AC_SUBST(OPTIONAL_BIN_PROGS)
AC_SUBST(OPTIONAL_BIN_ZCRIPTS)
AC_SUBST(MAN)
AC_SUBST(DF_PROG)
dnl This macro actually runs replacement code. See isc-posix.m4.
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_CHECK_HEADERS( \
errno.h \
fcntl.h \
fenv.h \
float.h \
limits.h \
memory.h \
mntent.h \
mnttab.h \
netdb.h \
paths.h \
stdlib.h \
stddef.h \
string.h \
sys/acl.h \
sys/filsys.h \
sys/fs/s5param.h \
sys/fs_types.h \
sys/fstyp.h \
sys/ioctl.h \
sys/mntent.h \
sys/mount.h \
sys/param.h \
sys/socket.h \
sys/statfs.h \
sys/statvfs.h \
sys/systeminfo.h \
sys/time.h \
sys/timeb.h \
sys/vfs.h \
sys/wait.h \
syslog.h \
termios.h \
unistd.h \
values.h \
)
jm_INCLUDED_REGEX([lib/regex.c])
AC_REQUIRE([jm_ASSERT])
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
AC_REQUIRE([jm_STRUCT_UTIMBUF])
AC_REQUIRE([jm_STRUCT_DIRENT_D_TYPE])
AC_REQUIRE([jm_STRUCT_DIRENT_D_INO])
AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO])
AC_REQUIRE([jm_CHECK_DECLS])
AC_REQUIRE([jm_PREREQ])
AC_REQUIRE([jm_FUNC_MKTIME])
AC_REQUIRE([jm_FUNC_LSTAT])
AC_REQUIRE([jm_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
AC_REQUIRE([jm_FUNC_STAT])
AC_REQUIRE([jm_FUNC_REALLOC])
AC_REQUIRE([jm_FUNC_MALLOC])
AC_REQUIRE([jm_FUNC_STRERROR_R])
AC_REQUIRE([jm_FUNC_READDIR])
AC_REQUIRE([jm_FUNC_MEMCMP])
AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
AC_REQUIRE([jm_FUNC_FNMATCH])
AC_REQUIRE([jm_AFS])
AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
AC_REQUIRE([AM_FUNC_ERROR_AT_LINE])
AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
AC_REQUIRE([jm_FUNC_MKTIME])
AC_REPLACE_FUNCS(strcasecmp strncasecmp)
AC_REQUIRE([AC_FUNC_VPRINTF])
AC_REQUIRE([AC_FUNC_ALLOCA])
AC_REPLACE_FUNCS(strncasecmp)
AC_REPLACE_FUNCS(stpcpy strstr strtol strtoul)
AC_REPLACE_FUNCS(memcmp)
dnl used by e.g. intl/*domain.c and lib/canon-host.c
AC_REPLACE_FUNCS(strdup)
AC_REPLACE_FUNCS(memcpy memset)
AC_CHECK_FUNCS(getpagesize)
# By default, argmatch should fail calling usage (1).
@ -61,38 +115,77 @@ AC_DEFUN(jm_MACROS,
AC_CHECK_FUNCS(clock_gettime)
AC_CHECK_FUNCS(gettimeofday)
AM_FUNC_GETLINE
AC_CHECK_FUNCS(getdelim)
AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
AC_CHECK_FUNCS( \
acl \
bcopy \
endgrent \
endpwent \
fchdir \
fdatasync \
fseeko \
ftime \
ftruncate \
getcwd \
gethrtime \
getmntinfo \
hasmntopt \
isascii \
listmntent \
localeconv \
memcpy \
mempcpy \
mkfifo \
realpath \
resolvepath \
sethostname \
strchr \
strerror \
strrchr \
sysinfo \
tzset \
)
AM_FUNC_GETLINE
if test $am_cv_func_working_getline != yes; then
AC_CHECK_FUNCS(getdelim)
fi
])
AC_DEFUN(jm_CHECK_ALL_TYPES,
[
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_C_LONG_DOUBLE
AC_REQUIRE([AC_C_BIGENDIAN])
AC_REQUIRE([AC_PROG_CC_STDC])
AC_REQUIRE([AC_C_CONST])
AC_REQUIRE([AC_C_VOLATILE])
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([AC_C_LONG_DOUBLE])
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_MEMBERS((struct stat.st_blksize))
AC_STRUCT_ST_BLOCKS
AC_REQUIRE([AC_HEADER_DIRENT])
AC_REQUIRE([AC_HEADER_STDC])
AC_CHECK_MEMBERS((struct stat.st_blksize),,,[$ac_includes_default
#include <sys/stat.h>
])
AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
AC_STRUCT_TM
AC_HEADER_TIME
AC_STRUCT_TIMEZONE
AC_HEADER_STAT
AC_STRUCT_ST_MTIM_NSEC
AC_STRUCT_ST_DM_MODE
AC_REQUIRE([AC_STRUCT_TM])
AC_REQUIRE([AC_STRUCT_TIMEZONE])
AC_REQUIRE([AC_HEADER_STAT])
AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC])
AC_TYPE_GETGROUPS
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_REQUIRE([AC_TYPE_GETGROUPS])
AC_REQUIRE([AC_TYPE_MODE_T])
AC_REQUIRE([AC_TYPE_OFF_T])
AC_REQUIRE([AC_TYPE_PID_T])
AC_REQUIRE([AC_TYPE_SIGNAL])
AC_REQUIRE([AC_TYPE_SIZE_T])
AC_REQUIRE([AC_TYPE_UID_T])
AC_CHECK_TYPE(ino_t, unsigned long)
dnl This relies on the fact that autoconf 2.14a's implementation of
@ -101,4 +194,8 @@ AC_DEFUN(jm_CHECK_ALL_TYPES,
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
AC_REQUIRE([AC_HEADER_MAJOR])
AC_REQUIRE([AC_HEADER_DIRENT])
])

View File

@ -1,18 +1,16 @@
#serial 3
#serial 7
dnl From Jim Meyering.
dnl If you use this macro in a package, you should
dnl add the following two lines to acconfig.h:
dnl /* Define to rpl_mktime if the replacement function should be used. */
dnl #undef mktime
dnl
dnl A wrapper around AC_FUNC_MKTIME.
AC_DEFUN(jm_FUNC_MKTIME,
[AC_REQUIRE([jm_AM_FUNC_MKTIME])dnl
[AC_REQUIRE([AC_FUNC_MKTIME])dnl
dnl mktime.c uses localtime_r if it exists. Check for it.
AC_CHECK_FUNCS(localtime_r)
if test $jm_am_cv_func_working_mktime = no; then
AC_DEFINE_UNQUOTED(mktime, rpl_mktime)
if test $ac_cv_func_working_mktime = no; then
AC_DEFINE_UNQUOTED(mktime, rpl_mktime,
[Define to rpl_mktime if the replacement function should be used.])
fi
])

View File

@ -1,44 +0,0 @@
#serial 1
dnl The problem is that the default compilation flags in Solaris 2.6 won't
dnl let programs access large files; you need to tell the compiler that
dnl you actually want your programs to work on large files. For more
dnl details about this brain damage please see:
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
dnl Written by Paul Eggert <eggert@twinsun.com>.
AC_DEFUN(AC_LFS,
[dnl
# If available, prefer support for large files unless the user specified
# one of the CPPFLAGS, LDFLAGS, or LIBS variables.
AC_MSG_CHECKING(whether large file support needs explicit enabling)
ac_getconfs=''
ac_result=yes
ac_set=''
ac_shellvars='CPPFLAGS LDFLAGS LIBS'
for ac_shellvar in $ac_shellvars; do
case $ac_shellvar in
CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;;
*) ac_lfsvar=LFS_$ac_shellvar ;;
esac
eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
(getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
ac_getconf=`getconf $ac_lfsvar`
ac_getconfs=$ac_getconfs$ac_getconf
eval ac_test_$ac_shellvar=\$ac_getconf
done
case "$ac_result$ac_getconfs" in
yes) ac_result=no ;;
esac
case "$ac_result$ac_set" in
yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
esac
AC_MSG_RESULT($ac_result)
case $ac_result in
yes)
for ac_shellvar in $ac_shellvars; do
eval $ac_shellvar=\$ac_test_$ac_shellvar
done ;;
esac
])

View File

@ -13,10 +13,11 @@ dnl
AC_PREREQ(2.14a)
# jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN(jm_LIST_MOUNTED_FILESYSTEMS,
[
# Determine how to get the list of mounted filesystems.
list_mounted_fs=
ac_list_mounted_fs=
# If the getmntent function is available but not in the standard library,
# make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
@ -31,7 +32,7 @@ AC_FUNC_GETMNTENT
# I think there is too great a chance that some non-Cray system has a
# function named listmntent to risk the false positive.
if test -z "$list_mounted_fs"; then
if test -z "$ac_list_mounted_fs"; then
# Cray UNICOS 9
AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
@ -47,7 +48,7 @@ yes
)
AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
if test $fu_cv_sys_mounted_cray_listmntent = yes; then
list_mounted_fs=found
ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_LISTMNTENT, 1,
[Define if there is a function named listmntent that can be used to
list all mounted filesystems. (UNICOS)])
@ -59,7 +60,7 @@ if test $ac_cv_func_getmntent = yes; then
# This system has the getmntent function.
# Determine whether it's the one-argument variant or the two-argument one.
if test -z "$list_mounted_fs"; then
if test -z "$ac_list_mounted_fs"; then
# 4.3BSD, SunOS, HP-UX, Dynix, Irix
AC_MSG_CHECKING([for one-argument getmntent function])
AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
@ -68,7 +69,7 @@ if test $ac_cv_func_getmntent = yes; then
|| fu_cv_sys_mounted_getmntent1=no])
AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
if test $fu_cv_sys_mounted_getmntent1 = yes; then
list_mounted_fs=found
ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_GETMNTENT1, 1,
[Define if there is a function named getmntent for reading the list
of mounted filesystems, and that function takes a single argument.
@ -76,7 +77,7 @@ if test $ac_cv_func_getmntent = yes; then
fi
fi
if test -z "$list_mounted_fs"; then
if test -z "$ac_list_mounted_fs"; then
# SVR4
AC_MSG_CHECKING([for two-argument getmntent function])
AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
@ -85,20 +86,20 @@ if test $ac_cv_func_getmntent = yes; then
fu_cv_sys_mounted_getmntent2=no)])
AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
if test $fu_cv_sys_mounted_getmntent2 = yes; then
list_mounted_fs=found
ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_GETMNTENT2, 1,
[Define if there is a function named getmntent for reading the list of
mounted filesystems, and that function takes two arguments. (SVR4)])
fi
fi
if test -z "$list_mounted_fs"; then
if test -z "$ac_list_mounted_fs"; then
AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
fi
fi
if test -z "$list_mounted_fs"; then
if test -z "$ac_list_mounted_fs"; then
# DEC Alpha running OSF/1.
AC_MSG_CHECKING([for getfsstat function])
AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
@ -112,14 +113,14 @@ if test -z "$list_mounted_fs"; then
fu_cv_sys_mounted_getsstat=no)])
AC_MSG_RESULT($fu_cv_sys_mounted_getsstat)
if test $fu_cv_sys_mounted_getsstat = yes; then
list_mounted_fs=found
ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_GETFSSTAT, 1,
[Define if there is a function named getfsstat for reading the
list of mounted filesystems. (DEC Alpha running OSF/1)])
fi
fi
if test -z "$list_mounted_fs"; then
if test -z "$ac_list_mounted_fs"; then
# AIX.
AC_MSG_CHECKING([for mntctl function and struct vmount])
AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
@ -128,7 +129,7 @@ if test -z "$list_mounted_fs"; then
fu_cv_sys_mounted_vmount=no)])
AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
if test $fu_cv_sys_mounted_vmount = yes; then
list_mounted_fs=found
ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_VMOUNT, 1,
[Define if there is a function named mntctl that can be used to read
the list of mounted filesystems, and there is a system header file
@ -136,7 +137,7 @@ if test -z "$list_mounted_fs"; then
fi
fi
if test -z "$list_mounted_fs"; then
if test -z "$ac_list_mounted_fs"; then
# SVR3
AC_MSG_CHECKING([for FIXME existence of three headers])
AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
@ -148,7 +149,7 @@ if test -z "$list_mounted_fs"; then
fu_cv_sys_mounted_fread_fstyp=no)])
AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
if test $fu_cv_sys_mounted_fread_fstyp = yes; then
list_mounted_fs=found
ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
[Define if (like SVR2) there is no specific function for reading the
list of mounted filesystems, and your system has these header files:
@ -156,7 +157,7 @@ if test -z "$list_mounted_fs"; then
fi
fi
if test -z "$list_mounted_fs"; then
if test -z "$ac_list_mounted_fs"; then
# 4.4BSD and DEC OSF/1.
AC_MSG_CHECKING([for getmntinfo function])
AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
@ -172,7 +173,7 @@ if test -z "$list_mounted_fs"; then
])
AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
if test $fu_cv_sys_mounted_getmntinfo = yes; then
list_mounted_fs=found
ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_GETMNTINFO, 1,
[Define if there is a function named getmntinfo for reading the
list of mounted filesystems. (4.4BSD)])
@ -181,7 +182,7 @@ fi
# FIXME: add a test for netbsd-1.1 here
if test -z "$list_mounted_fs"; then
if test -z "$ac_list_mounted_fs"; then
# Ultrix
AC_MSG_CHECKING([for getmnt function])
AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
@ -192,14 +193,14 @@ if test -z "$list_mounted_fs"; then
fu_cv_sys_mounted_getmnt=no)])
AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
if test $fu_cv_sys_mounted_getmnt = yes; then
list_mounted_fs=found
ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_GETMNT, 1,
[Define if there is a function named getmnt for reading the list of
mounted filesystems. (Ultrix)])
fi
fi
if test -z "$list_mounted_fs"; then
if test -z "$ac_list_mounted_fs"; then
# SVR2
AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
AC_CACHE_VAL(fu_cv_sys_mounted_fread,
@ -208,17 +209,19 @@ if test -z "$list_mounted_fs"; then
fu_cv_sys_mounted_fread=no)])
AC_MSG_RESULT($fu_cv_sys_mounted_fread)
if test $fu_cv_sys_mounted_fread = yes; then
list_mounted_fs=found
ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_FREAD, 1,
[Define if there is no specific function for reading the list of
mounted filesystems. fread will be used to read /etc/mnttab. (SVR2) ])
fi
fi
if test -z "$list_mounted_fs"; then
if test -z "$ac_list_mounted_fs"; then
AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
# FIXME -- no need to abort building the whole package
# Can't build mountlist.c or anything that needs its functions
fi
AC_SHELL_IFELSE([test $ac_list_mounted_fs = found], [$1], [$2])dnl
])

View File

@ -1,13 +1,12 @@
#serial 3
#serial 4
dnl A replacement for autoconf's AC_FUNC_MEMCMP that detects
dnl the losing memcmp on some x86 Next systems.
AC_DEFUN(jm_AC_FUNC_MEMCMP,
[AC_CACHE_CHECK([for working memcmp], jm_cv_func_memcmp_working,
[AC_TRY_RUN(
changequote(<<, >>)dnl
<<
main()
[int
main ()
{
/* Some versions of memcmp are not 8-bit clean. */
char c0 = 0x40, c1 = 0x80, c2 = 0x81;
@ -32,9 +31,7 @@ main()
}
exit (0);
}
}
>>,
changequote([, ])dnl
}],
jm_cv_func_memcmp_working=yes,
jm_cv_func_memcmp_working=no,
jm_cv_func_memcmp_working=no)])

View File

@ -1,166 +0,0 @@
#serial 1001
dnl Just like mktime.m4 from automake-1.3b, but with an additional test.
dnl Renamed to have jm_ prefix and to use jm_ prefix on cache variable names.
AC_DEFUN(jm_AM_FUNC_MKTIME,
[AC_REQUIRE([AC_HEADER_TIME])dnl
AC_CHECK_HEADERS(sys/time.h unistd.h)
AC_CHECK_FUNCS(alarm)
AC_CACHE_CHECK([for working mktime], jm_am_cv_func_working_mktime,
[AC_TRY_RUN(
changequote(<<, >>)dnl
<</* Test program from Paul Eggert (eggert@twinsun.com)
and Tony Leneis (tony@plaza.ds.adp.com). */
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#if !HAVE_ALARM
# define alarm(X) /* empty */
#endif
/* Work around redefinition to rpl_putenv by other config tests. */
#undef putenv
static time_t time_t_max;
/* Values we'll use to set the TZ environment variable. */
static const char *const tz_strings[] = {
(const char *) 0, "TZ=GMT0", "TZ=JST-9",
"TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
};
#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
/* Fail if mktime fails to convert a date in the spring-forward gap.
Based on a problem report from Andreas Jaeger. */
static void
spring_forward_gap ()
{
/* glibc (up to about 1998-10-07) failed this test) */
struct tm tm;
/* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
instead of "TZ=America/Vancouver" in order to detect the bug even
on systems that don't support the Olson extension, or don't have the
full zoneinfo tables installed. */
putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
tm.tm_year = 98;
tm.tm_mon = 3;
tm.tm_mday = 5;
tm.tm_hour = 2;
tm.tm_min = 0;
tm.tm_sec = 0;
tm.tm_isdst = -1;
if (mktime (&tm) == (time_t)-1)
exit (1);
}
static void
mktime_test (now)
time_t now;
{
struct tm *lt;
if ((lt = localtime (&now)) && mktime (lt) != now)
exit (1);
now = time_t_max - now;
if ((lt = localtime (&now)) && mktime (lt) != now)
exit (1);
}
static void
irix_6_4_bug ()
{
/* Based on code from Ariel Faigon. */
struct tm tm;
tm.tm_year = 96;
tm.tm_mon = 3;
tm.tm_mday = 0;
tm.tm_hour = 0;
tm.tm_min = 0;
tm.tm_sec = 0;
tm.tm_isdst = -1;
mktime (&tm);
if (tm.tm_mon != 2 || tm.tm_mday != 31)
exit (1);
}
static void
bigtime_test (j)
int j;
{
struct tm tm;
time_t now;
tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
/* This test makes some buggy mktime implementations loop.
Give up after 10 seconds. */
alarm (10);
now = mktime (&tm);
alarm (0);
if (now != (time_t) -1)
{
struct tm *lt = localtime (&now);
if (! (lt
&& lt->tm_year == tm.tm_year
&& lt->tm_mon == tm.tm_mon
&& lt->tm_mday == tm.tm_mday
&& lt->tm_hour == tm.tm_hour
&& lt->tm_min == tm.tm_min
&& lt->tm_sec == tm.tm_sec
&& lt->tm_yday == tm.tm_yday
&& lt->tm_wday == tm.tm_wday
&& ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
== (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
exit (1);
}
}
int
main ()
{
time_t t, delta;
int i, j;
spring_forward_gap ();
for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
continue;
time_t_max--;
delta = time_t_max / 997; /* a suitable prime number */
for (i = 0; i < N_STRINGS; i++)
{
if (tz_strings[i])
putenv (tz_strings[i]);
for (t = 0; t <= time_t_max - delta; t += delta)
mktime_test (t);
mktime_test ((time_t) 60 * 60);
mktime_test ((time_t) 60 * 60 * 24);
for (j = 1; 0 < j; j *= 2)
bigtime_test (j);
bigtime_test (j - 1);
}
irix_6_4_bug ();
exit (0);
}
>>,
changequote([, ])dnl
jm_am_cv_func_working_mktime=yes, jm_am_cv_func_working_mktime=no,
dnl When crosscompiling, assume mktime is missing or broken.
jm_am_cv_func_working_mktime=no)
])
if test $jm_am_cv_func_working_mktime = no; then
LIBOBJS="$LIBOBJS mktime.o"
fi
])

View File

@ -1,41 +0,0 @@
#serial 2
dnl From Jim Meyering.
dnl Find a new-enough version of Perl.
dnl
AC_DEFUN(jm_PERL,
[
dnl FIXME: don't hard-code 5.003
dnl FIXME: should we cache the result?
AC_MSG_CHECKING([for perl5.003 or newer])
if test "${PERL+set}" = set; then
# `PERL' is set in the user's environment.
candidate_perl_names="$PERL"
perl_specified=yes
else
candidate_perl_names='perl perl5'
perl_specified=no
fi
found=no
AC_SUBST(PERL)
PERL="$missing_dir/missing perl"
for perl in $candidate_perl_names; do
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
if ( $perl -e 'require 5.003; use File::Compare' ) > /dev/null 2>&1; then
PERL=$perl
found=yes
break
fi
done
AC_MSG_RESULT($found)
test $found = no && AC_MSG_WARN([
*** You don't seem to have perl5.003 or newer installed, or you lack
*** a usable version of the Perl File::Compare module. As a result,
*** you may be unable to run a few tests or to regenerate certain
*** files if you modify the sources from which they are derived.
] )
])

View File

@ -1,15 +1,72 @@
#serial 2
#serial 5
dnl These are the prerequisite macros for files in the lib/
dnl directories of the fileutils, sh-utils, and textutils packages.
AC_DEFUN(jm_PREREQ,
[
jm_PREREQ_ADDEXT
jm_PREREQ_CANON_HOST
jm_PREREQ_ERROR
jm_PREREQ_QUOTEARG
jm_PREREQ_READUTMP
jm_PREREQ_REGEX
])
dnl FIXME: maybe put this in a separate file
AC_DEFUN(jm_PREREQ_ADDEXT,
[
dnl For addext.c.
AC_SYS_LONG_FILE_NAMES
AC_CHECK_FUNCS(pathconf)
AC_CHECK_HEADERS(limits.h string.h unistd.h)
])
AC_DEFUN(jm_PREREQ_CANON_HOST,
[
dnl Add any libraries as early as possible.
dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
dnl so we have to add -lnsl to LIBS before checking for that function.
AC_SEARCH_LIBS(gethostbyname, [inet nsl])
dnl These come from -lnsl on Solaris5.5.1.
AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
netinet/in.h arpa/inet.h)
])
AC_DEFUN(jm_PREREQ_QUOTEARG,
[
AC_CHECK_FUNCS(isascii mbrtowc)
AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
AC_HEADER_STDC
AC_C_BACKSLASH_A
AM_C_PROTOTYPES
])
AC_DEFUN(jm_PREREQ_READUTMP,
[
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h utmpx.h sys/param.h)
AC_CHECK_FUNCS(utmpname)
AC_CHECK_FUNCS(utmpxname)
AM_C_PROTOTYPES
utmp_includes="\
$ac_includes_default
#ifdef HAVE_UTMPX_H
# include <utmpx.h>
#else
# include <utmp.h>
#endif
"
AC_CHECK_MEMBERS((struct utmpx.ut_user),,,[$utmp_includes])
AC_CHECK_MEMBERS((struct utmp.ut_user),,,[$utmp_includes])
AC_CHECK_MEMBERS((struct utmpx.ut_name),,,[$utmp_includes])
AC_CHECK_MEMBERS((struct utmp.ut_name),,,[$utmp_includes])
])
AC_DEFUN(jm_PREREQ_REGEX,
[
dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.

View File

@ -1,41 +0,0 @@
#serial 3
dnl From Jim Meyering.
dnl
dnl Check whether putenv ("FOO") removes FOO from the environment.
dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
dnl
AC_DEFUN(jm_FUNC_PUTENV,
[AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
[AC_TRY_RUN([
int
main ()
{
/* Put it in env. */
if (putenv ("CONFTEST_putenv=val"))
exit (1);
/* Try to remove it. */
if (putenv ("CONFTEST_putenv"))
exit (1);
/* Make sure it was deleted. */
if (getenv ("CONFTEST_putenv") != 0)
exit (1);
exit (0);
}
],
jm_cv_func_svid_putenv=yes,
jm_cv_func_svid_putenv=no,
dnl When crosscompiling, assume putenv is broken.
jm_cv_func_svid_putenv=no)
])
if test $jm_cv_func_svid_putenv = no; then
AC_SUBST(LIBOBJS)
LIBOBJS="$LIBOBJS putenv.$ac_objext"
AC_DEFINE_UNQUOTED(putenv, rpl_putenv,
[Define to rpl_putenv if the replacement function should be used.])
fi
])

View File

@ -1,4 +1,4 @@
#serial 2
#serial 3
dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
dnl to test whether a NULL return value really means there are no more files
@ -23,9 +23,7 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir,
ac_clean_files="$ac_clean_files conf-dir"
AC_TRY_RUN(
changequote(<<, >>)dnl
<<
# include <stdio.h>
[# include <stdio.h>
# include <sys/types.h>
# if HAVE_STRING_H
# include <string.h>
@ -119,9 +117,7 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir,
create_300_file_dir (dir);
remove_dir (dir);
exit (0);
}
>>,
changequote([, ])dnl
}],
jm_cv_func_working_readdir=yes,
jm_cv_func_working_readdir=no,
jm_cv_func_working_readdir=no)])

View File

@ -1,4 +1,4 @@
#serial 5
#serial 7
dnl Initially derived from code in GNU grep.
dnl Mostly written by Jim Meyering.
@ -16,14 +16,12 @@ AC_DEFUN(jm_INCLUDED_REGEX,
# However, if the system regex support is good enough that it passes the
# the following run test, then default to *not* using the included regex.c.
# If cross compiling, assume the test would fail and use the included
# regex.c. The failing regular expression is from `Spencer ere test #75'
# in grep-2.3.
# regex.c. The first failing regular expression is from `Spencer ere
# test #75' in grep-2.3.
AC_CACHE_CHECK([for working re_compile_pattern],
jm_cv_func_working_re_compile_pattern,
AC_TRY_RUN(
changequote(<<, >>)dnl
<<
#include <stdio.h>
[#include <stdio.h>
#include <regex.h>
int
main ()
@ -35,11 +33,15 @@ AC_DEFUN(jm_INCLUDED_REGEX,
three right ones below. Otherwise autoconf-2.14 chokes. */
s = re_compile_pattern ("a[[:]:]]b\n", 9, &regex);
/* This should fail with _Invalid character class name_ error. */
exit (s ? 0 : 1);
}
>>,
changequote([, ])dnl
if (!s)
exit (1);
/* This should succeed, but doesn't for e.g. glibc-2.1.3. */
s = re_compile_pattern ("{1", 2, &regex);
exit (s ? 1 : 0);
}
],
jm_cv_func_working_re_compile_pattern=yes,
jm_cv_func_working_re_compile_pattern=no,
dnl When crosscompiling, assume it's broken.

View File

@ -1,4 +1,4 @@
#serial 8
#serial 9
dnl This macro is intended to be used solely in this file.
dnl These are the prerequisite macros for GNU's strftime.c replacement.
@ -35,9 +35,12 @@ AC_DEFUN(jm_FUNC_GNU_STRFTIME,
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_CHECK_HEADERS(sys/time.h)
AC_CACHE_CHECK([for working GNU strftime], jm_cv_func_working_gnu_strftime,
[AC_TRY_RUN(
changequote(<<, >>)dnl
<< /* Ulrich Drepper provided parts of the test program. */
[# Set TZ to GMT0 to make strftime give consistent results during the test.
ac_save_TZ="${TZ-GMT0}"
TZ=GMT0
export TZ
AC_TRY_RUN(
[ /* Ulrich Drepper provided parts of the test program. */
#if STDC_HEADERS
# include <stdlib.h>
#endif
@ -77,10 +80,6 @@ main ()
time_t t = 738367; /* Fri Jan 9 13:06:07 1970 */
tm = gmtime (&t);
/* This is necessary to make strftime give consistent zone strings and
e.g., seconds since the epoch (%s). */
putenv ("TZ=GMT0");
#undef CMP
#define CMP(Fmt, Expected) n_fail += compare ((Fmt), tm, (Expected))
@ -134,13 +133,13 @@ main ()
CMP ("%z", "+0000"); /* GNU */
exit (n_fail ? 1 : 0);
}
>>,
changequote([, ])dnl
}],
jm_cv_func_working_gnu_strftime=yes,
jm_cv_func_working_gnu_strftime=no,
dnl When crosscompiling, assume strftime is missing or broken.
jm_cv_func_working_gnu_strftime=no)
dnl If TZ wasn't set before, this sets it to GMT0. No real harm done.
TZ="$ac_save_TZ"
])
if test $jm_cv_func_working_gnu_strftime = no; then
AC_SUBST(LIBOBJS)

View File

@ -1,8 +1,8 @@
#serial 4
#serial 5
dnl From Paul Eggert.
AC_PREREQ(2.14a)
AC_PREREQ(2.13)
# Define uintmax_t to `unsigned long' or `unsigned long long'
# if <inttypes.h> does not exist.
@ -16,7 +16,7 @@ AC_DEFUN(jm_AC_TYPE_UINTMAX_T,
&& ac_type='unsigned long long' \
|| ac_type='unsigned long'
AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
[ Define to `unsigned long' or `unsigned long long'
[ Define to unsigned long or unsigned long long
if <inttypes.h> doesn't define.])
fi
])

View File

@ -1,18 +0,0 @@
#serial 2
AC_PREREQ(2.13)
AC_DEFUN(jm_SYS_PROC_UPTIME,
[ dnl Require AC_PROG_CC to see if we're cross compiling.
AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([for /proc/uptime], jm_cv_have_proc_uptime,
[jm_cv_have_proc_uptime=no
test -f /proc/uptime \
&& test $ac_cv_prog_cc_cross = no \
&& cat < /proc/uptime >/dev/null 2>/dev/null \
&& jm_cv_have_proc_uptime=yes])
if test $jm_cv_have_proc_uptime = yes; then
AC_DEFINE(HAVE_PROC_UPTIME, 1,
[ Define if your system has the /proc/uptime special file.])
fi
])

View File

@ -1,40 +0,0 @@
#serial 2
dnl From Jim Meyering
dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
dnl usually in <utime.h>.
dnl Some systems have utime.h but don't declare the struct anywhere.
AC_DEFUN(jm_STRUCT_UTIMBUF,
[
AC_CHECK_HEADERS(utime.h)
AC_REQUIRE([AC_HEADER_TIME])
AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
[AC_TRY_COMPILE(
[
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#ifdef HAVE_UTIME_H
# include <utime.h>
#endif
],
[static struct utimbuf x; x.actime = x.modtime;],
fu_cv_sys_struct_utimbuf=yes,
fu_cv_sys_struct_utimbuf=no)
])
if test $fu_cv_sys_struct_utimbuf = yes; then
AC_DEFINE_UNQUOTED(HAVE_STRUCT_UTIMBUF, 1,
[Define if struct utimbuf is declared -- usually in <utime.h>.
Some systems have utime.h but don't declare the struct anywhere. ])
fi
])

View File

@ -1,18 +0,0 @@
#serial 1
dnl From Jim Meyering
dnl Replace the utime function on systems that need it.
dnl FIXME
AC_DEFUN(jm_FUNC_UTIME,
[
AC_CHECK_HEADERS(utime.h)
AC_REQUIRE([jm_STRUCT_UTIMBUF])
AC_REQUIRE([AC_FUNC_UTIME_NULL])
if test $ac_cv_func_utime_null = no; then
jm_FUNC_UTIMES_NULL
AC_REPLACE_FUNCS(utime)
fi
])

View File

@ -1,30 +0,0 @@
#serial 3
dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
dnl then do case-insensitive s/utime/utimes/.
AC_DEFUN(jm_FUNC_UTIMES_NULL,
[AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
[rm -f conftestdata; > conftestdata
AC_TRY_RUN([
/* In case stat has been defined to rpl_stat, undef it here. */
#undef stat
#include <sys/types.h>
#include <sys/stat.h>
main() {
struct stat s, t;
exit(!(stat ("conftestdata", &s) == 0 && utimes("conftestdata", (long *)0) == 0
&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
&& t.st_mtime - s.st_mtime < 120));
}],
ac_cv_func_utimes_null=yes,
ac_cv_func_utimes_null=no,
ac_cv_func_utimes_null=no)
rm -f core core.* *.core])
if test $ac_cv_func_utimes_null = yes; then
AC_DEFINE_UNQUOTED(HAVE_UTIMES_NULL, 1,
[Define if utimes accepts a null argument])
fi
]
)

View File

@ -1,4 +1,3 @@
.deps
Makefile
Makefile.in
xargs

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@ -83,8 +85,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@ -131,14 +136,14 @@ man1dir = $(mandir)/man1
MANS = $(man_MANS)
NROFF = nroff
depcomp = $(SHELL) $(top_srcdir)/depcomp
DEP_FILES = @AMDEP@ $(DEPDIR)/xargs$U.Po
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
depcomp = $(SHELL) $(top_srcdir)/depcomp
DEP_FILES = @AMDEP@ $(DEPDIR)/xargs$U.Po
SOURCES = xargs.c
OBJECTS = xargs$U.o
@ -148,7 +153,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu xargs/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -209,9 +214,61 @@ maintainer-clean-kr:
xargs: $(xargs_OBJECTS) $(xargs_DEPENDENCIES)
@rm -f xargs
$(LINK) $(xargs_LDFLAGS) $(xargs_OBJECTS) $(xargs_LDADD) $(LIBS)
alloca_.c: alloca.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c
error_.c: error.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > error_.c
fileblocks_.c: fileblocks.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fileblocks_.c
fnmatch_.c: fnmatch.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fnmatch_.c
lstat_.c: lstat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > lstat_.c
malloc_.c: malloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c
memcmp_.c: memcmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcmp_.c
memcpy_.c: memcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcpy_.c
memset_.c: memset.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memset_.c
mktime_.c: mktime.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mktime_.c
realloc_.c: realloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c
regex_.c: regex.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > regex_.c
stat_.c: stat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stat_.c
stpcpy_.c: stpcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c
strdup_.c: strdup.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strdup_.c
strftime_.c: strftime.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strftime_.c
strncasecmp_.c: strncasecmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strncasecmp.c; then echo $(srcdir)/strncasecmp.c; else echo strncasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strncasecmp_.c
strspn_.c: strspn.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strspn.c; then echo $(srcdir)/strspn.c; else echo strspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strspn_.c
strstr_.c: strstr.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strstr_.c
strtol_.c: strtol.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtol_.c
strtoul_.c: strtoul.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoul_.c
strtoull_.c: strtoull.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoull.c; then echo $(srcdir)/strtoull.c; else echo strtoull.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoull_.c
strtoumax_.c: strtoumax.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c
waitpid_.c: waitpid.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/waitpid.c; then echo $(srcdir)/waitpid.c; else echo waitpid.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > waitpid_.c
xargs_.c: xargs.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xargs.c; then echo $(srcdir)/xargs.c; else echo xargs.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xargs_.c
xargs_.o : $(ANSI2KNR)
alloca_.o error_.o fileblocks_.o fnmatch_.o lstat_.o malloc_.o \
memcmp_.o memcpy_.o memset_.o mktime_.o realloc_.o regex_.o stat_.o \
stpcpy_.o strdup_.o strftime_.o strncasecmp_.o strspn_.o strstr_.o \
strtol_.o strtoul_.o strtoull_.o strtoumax_.o waitpid_.o xargs_.o : \
$(ANSI2KNR)
install-man1:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
@ -316,7 +373,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -f$$here/ID $$unique $(LISP)
mkid -fID $$unique $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@ -345,29 +402,6 @@ distclean-tags:
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
for subdir in $(SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
@AMDEP@include $(DEPDIR)/xargs$U.Po
mostlyclean-depend:
@ -385,8 +419,32 @@ maintainer-clean-depend:
@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c -o $@ $<
$(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
for subdir in $(SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
info-am:
info: info-recursive
dvi-am:
@ -462,14 +520,14 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir \
mostlyclean-depend distclean-depend clean-depend \
maintainer-clean-depend info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs-am installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
distclean-tags clean-tags maintainer-clean-tags mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend distdir info-am \
info dvi-am dvi check check-am installcheck-am installcheck \
install-exec-am install-exec install-data-am install-data install-am \
install uninstall-am uninstall all-redirect all-am all install-strip \
installdirs-am installdirs mostlyclean-generic distclean-generic \
clean-generic maintainer-clean-generic clean mostlyclean distclean \
maintainer-clean
$(PROGRAMS): ../find/version.o ../lib/libfind.a

View File

@ -1,2 +1 @@
Makefile
Makefile.in

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@ -84,8 +86,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@ -149,20 +154,20 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
EXPECT = expect
RUNTEST = runtest
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
EXPECT = expect
RUNTEST = runtest
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu xargs/testsuite/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -170,23 +175,6 @@ tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
$(mkinstalldirs) $(distdir)/config $(distdir)/inputs \
$(distdir)/xargs.gnu $(distdir)/xargs.posix \
$(distdir)/xargs.sysv
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
RUNTESTFLAGS =
RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir
@ -208,10 +196,30 @@ site.exp: Makefile
@echo 'set tool $(DEJATOOL)' >> $@-t
@echo 'set srcdir $(srcdir)' >> $@-t
@echo 'set objdir' `pwd` >> $@-t
@echo 'set host_alias $(host_alias)' >> $@-t
@echo 'set host_triplet $(host_triplet)' >> $@-t
@echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
@test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
@test ! -f site.exp || mv site.exp site.bak
@mv $@-t site.exp
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
$(mkinstalldirs) $(distdir)/config $(distdir)/inputs \
$(distdir)/xargs.gnu $(distdir)/xargs.posix \
$(distdir)/xargs.sysv
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
info-am:
info: info-am
dvi-am:
@ -268,7 +276,7 @@ maintainer-clean-am: maintainer-clean-generic distclean-am
maintainer-clean: maintainer-clean-am
.PHONY: tags distdir check-DEJAGNU info-am info dvi-am dvi check \
.PHONY: tags check-DEJAGNU distdir info-am info dvi-am dvi check \
check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \

View File

@ -1,5 +1,5 @@
/* xargs -- build and execute command lines from standard input
Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94, 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
@ -834,9 +834,9 @@ wait_for_proc (boolean all)
{
pid_t pid;
pid = wait (&status);
if (pid < 0)
error (1, errno, _("error waiting for child process"));
while ((pid = wait (&status)) == (pid_t) -1)
if (errno != EINTR)
error (1, errno, _("error waiting for child process"));
/* Find the entry in `pids' for the child process
that exited. */