summaryrefslogtreecommitdiff
path: root/m4/fts.m4
Commit message (Collapse)AuthorAgeFilesLines
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* Use AC_C_INLINE where necessary.Bruno Haible2009-12-311-1/+2
|
* update nearly all FSF copyright year lists to include 2009Jim Meyering2009-12-291-1/+1
| | | | | | | | | | | | | | | | | | The files named by the following are exempted: grep -v '^#' config/srclist.txt|grep -v '^$' \ | while read src dst; do test -f "$dst" && { echo "$dst"; continue; } test -d "$dst" || continue echo "$dst"/$(basename "$src") done > exempt git ls-files tests/unictype >> exempt In the remaining files, convert to all-interval notation if - there is already at least one year interval like 2000-2003 - the file is maintained by me - the file is in lib/uni*/, where that style already prevails Otherwise, use update-copyright's default.
* fts: bug fixesJim Meyering2008-10-021-3/+3
| | | | | | | * lib/fts.c: Remove unnecessary "defined" in cpp directive. Include <sys/vfs.h>, not <sys/statfs.h>. * m4/fts.m4 (gl_FUNC_FTS_CORE): Fix typo s/vfs/vfs.h/. Include <sys/vfs.h>, not <sys/statfs.h>.
* fts.m4: correct the test for statfs.f_typeJim Meyering2008-09-301-2/+4
| | | | | * m4/fts.m4 (gl_FUNC_FTS_CORE): Include <sys/statfs.h> when checking for statfs.f_type.
* fts: sort dirent entries on inode number before traversingJim Meyering2008-09-261-4/+5
| | | | | | | | | | | | | | | | | This avoids a quadratic, seek-related performance penalty when operating on a directory containing many entries (measurable at 10k; 3.5 hours at 2 million entries with a cold cache) on certain types of file systems, including ext3 and ext4, but not tmpfs. * lib/fts.c (DT_MUST_BE, NOT_AN_INODE_NUMBER, D_INO): Define. (FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD): Define if not defined. (S_MAGIC_TMPFS, S_MAGIC_NFS): Define. (fs_handles_readdir_ordered_dirents_efficiently): New function. (dirent_inode_sort_may_be_useful, fts_compare_ino): Likewise. (fts_build): Set the stat.st_ino member from D_INO. If it is likely to be useful, sort dirent entries on inode number. * m4/fts.m4 (gl_FUNC_FTS_CORE): Check for fstatfs, sys/vfs.h, and the struct statfs.f_type member. * modules/fts (Depends-on): Add d-ino.
* 2007-01-24 Bruno Haible <bruno@clisp.org>Bruno Haible2007-01-251-4/+4
| | | | | | | | | | | | | | | | | | | Don't AC_REQUIRE autoconf macros that invoke AC_LIBOBJ. See <http://lists.gnu.org/archive/html/bug-gnulib/2006-10/msg00279.html>. * m4/argp.m4 (gl_ARGP): Invoke, don't require, gl_GETOPT_SUBSTITUTE. * m4/fts.m4 (gl_FUNC_FTS, gl_FUNC_FTS_LGPL): Invoke, don't require, gl_FUNC_FTS_CORE. (gl_FUNC_FTS_CORE): Invoke, don't require, gl_FUNC_OPENAT. * m4/lstat.m4 (gl_FUNC_LSTAT): Invoke, don't require, AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK. * m4/memcmp.m4 (gl_FUNC_MEMCMP): Invoke, don't require, AC_FUNC_MEMCMP. * m4/mktime.m4 (gl_FUNC_MKTIME): Invoke, don't require, AC_FUNC_MKTIME. * m4/openat.m4 (gl_FUNC_OPENAT): Invoke, don't require, gl_FUNC_FCHOWNAT. * m4/strftime.m4 (gl_FUNC_GNU_STRFTIME): Invoke, don't require, gl_FUNC_STRFTIME. * m4/strtod.m4 (gl_FUNC_STRTOD): Invoke, don't require, AC_FUNC_STRTOD. Reported by Ralf Wildenhues.
* 2007-01-08 Bruno Haible <bruno@clisp.org>Bruno Haible2007-01-081-5/+2
| | | | | | | | * m4/fts.m4 (gl_FUNC_FTS_LGPL): Remove _LGPL_PACKAGE macro definition. * lib/fts_.h (_LGPL_PACKAGE): Remove macro. Use !GNULIB_FTS instead of _LGPL_PACKAGE. * lib/fts.c: Likewise. * modules/fts (configure.ac): Use gl_MODULE_INDICATOR.
* Avoid the need for AC_LIBSOURCES in m4 macros.Paul Eggert2006-08-211-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/acl (EXTRA_DIST): Add acl.h. * modules/argmatch (Files): Add m4/argmatch.m4. (configure.ac): Add gl_ARGMATCH. (EXTRA_DIST): Renamed from lib_SOURCES, for consistency with the other modules. Remove argmatch.c. * modules/backupfile (EXTRA_DIST): Add backupfile.h. * modules/c-strtod (EXTRA_DIST): Add c-strtod.h. * modules/c-strtold (EXTRA_DIST): Add c-strtod.c, c-strtod.h. * modules/canonhost (EXTRA_DIST): Add c-canonhost.h. * modules/canonicalize (EXTRA_DIST): Add canonicalize.h. * modules/chdir-long (EXTRA_DIST): Add chdir-long.h. * modules/chdir-safer (EXTRA_DIST): Add chdir-safer.h. * modules/cloexec (EXTRA_DIST): Add cloexec.h. * modules/close-stream (EXTRA_DIST): Add close-stream.h. * modules/closeout (EXTRA_DIST): Add closeout.h. * modules/cycle-check (EXTRA_DIST): Add cycle-check.h. * modules/dev-ino (EXTRA_DIST): Add dev-ino.h. * modules/dirfd (EXTRA_DIST): Add dirfd.h. * modules/dirname (EXTRA_DIST): Renamed from lib_SOURCES. Add dirname.h; remove basename.c and stripslash.c. * modules/exclude (EXTRA_DIST): Add exclude.h. * modules/exitfail (EXTRA_DIST): Add exitfail.h. * modules/fcntl-safer (EXTRA_DIST): Add fcntl-safer.h fcntl--.h. * modules/file-type (EXTRA_DIST): Add file-type.h. * modules/filemode (EXTRA_DIST): Add filemode.h. * modules/filenamecat (EXTRA_DIST): Add filenamecat.h. * modules/fopen-safer (EXTRA_DIST): Add stdio-safer.h stdio--.h. * modules/fpending (EXTRA_DIST): Add __fpending.h. * modules/fprintftime (EXTRA_DIST): Add fprintftime.h. * modules/fsusage (EXTRA_DIST): Add fsusage.h. * modules/fts (EXTRA_DIST): Add fts_.h fts-cycle.c. * modules/getcwd (EXTRA_DIST): Add getcwd.h. * modules/getdate (EXTRA_DIST): Add getdate.c. * modules/gethrxtime (EXTRA_DIST): Add gethrxtime.h xtime.h. * modules/getpagesize (EXTRA_DIST): Add getpagesize.h. * modules/getpass (EXTRA_DIST): Add getpass.h. * modules/glob (EXTRA_DIST): Add glob_.h glob-libc.h. * modules/group-member (EXTRA_DIST): Add group-member.h. * modules/hard-locale (EXTRA_DIST): Add hard-locale.h. * modules/hash (EXTRA_DIST): Add hash.h. * modules/human (EXTRA_DIST): Add human.h. * modules/inttypes (EXTRA_DIST): Add inttypes.h. * modules/lchmod (EXTRA_DIST): Add lchmod.h. * modules/lchown (EXTRA_DIST): Add lchown.h. * modules/long-options (EXTRA_DIST): Add long-options.h. * modules/lstat (EXTRA_DIST): Add lstat.h. * modules/md5 (EXTRA_DIST): Add memcasecmp.h. * modules/memcoll (EXTRA_DIST): Add memcoll.h. * modules/mempcpy (EXTRA_DIST): Add mempcpy.h. * modules/memrchr (EXTRA_DIST): Add memrchr.h. * modules/memxor (EXTRA_DIST): Add memxor.h. * modules/mkancesdirs (EXTRA_DIST): Add mkancesdirs.h. * modules/mkdir-p (EXTRA_DIST): Add modechange.h. * modules/mountlist (EXTRA_DIST): Add mountlist.h. * modules/openat (EXTRA_DIST): Add at-func.c openat.h openat-priv.h. * modules/pathmax (EXTRA_DIST): Add pathmax.h. * modules/physmem (EXTRA_DIST): Add physmem.h. * modules/posixtm (EXTRA_DIST): Add posixtm.h. * modules/posixver (EXTRA_DIST): Add posixver.h. * modules/quote (EXTRA_DIST): Add quote.h. * modules/quotearg (EXTRA_DIST): Add quotearg.h. * modules/readtokens (EXTRA_DIST): Add readtokens.h. * modules/readutmp (EXTRA_DIST): Add readutmp.h. * modules/regex (EXTRA_DIST): Add regcomp.c regex.h regex_internal.c regex_internal.h regexec.c. * modules/safe-read (EXTRA_DIST): Add safe-read.h. * modules/safe-write (EXTRA_DIST): Add safe-write.h. * modules/same (EXTRA_DIST): Add same.h. * modules/same-inode (EXTRA_DIST): Add same-inode.h. * modules/save-cwd (EXTRA_DIST): Add save-cwd.h. * modules/savedir (EXTRA_DIST): Add savedir.h. * modules/sha1 (EXTRA_DIST): Add sha1.h. * modules/sig2str (EXTRA_DIST): Add sig2str.h. * modules/stat-macros (EXTRA_DIST): Add stat-macros.h. * modules/stat-time (EXTRA_DIST): Add stat-time.h. * modules/stdlib-safer (EXTRA_DIST): Add stdlib-safer.h stdlib--.h. * modules/strdup (EXTRA_DIST): Add strdup.h. * modules/strftime (EXTRA_DIST): Add strftime.h. * modules/strndup (EXTRA_DIST): Add strndup.h. * modules/strnlen (EXTRA_DIST): Add strnlen.h. * modules/strverscmp (EXTRA_DIST): Add strverscmp.h. * modules/time_r (EXTRA_DIST): Add time_r.h. * modules/timespec (EXTRA_DIST): Add timespec.h. * modules/tmpfile-safer (EXTRA_DIST): Add stdio-safer.h stdio--.h. * modules/unistd-safer (EXTRA_DIST): Add unistd-safer.h unistd--.h. * modules/unlinkdir (EXTRA_DIST): Add unlinkdir.h. * modules/unlocked-io (EXTRA_DIST): Add unlocked-io.h. * modules/userspec (EXTRA_DIST): Add userspec.h. * modules/utimecmp (EXTRA_DIST): Add utimecmp.h. * modules/utimens (EXTRA_DIST): Add utimens.h. * modules/xalloc (EXTRA_DIST): Add xalloc.h. * modules/xgetcwd (EXTRA_DIST): Add xgetcwd.h. * modules/xnanosleep (EXTRA_DIST): Add xnanosleep.h. * modules/xreadlink (EXTRA_DIST): Add xreadlink.h. * modules/xstrtod (EXTRA_DIST): Add xstrtod.h. * modules/xstrtol (EXTRA_DIST): Add xstrtol.h. * modules/xstrtold (EXTRA_DIST): Add xstrtod.c xstrtod.h. * modules/yesno (EXTRA_DIST): Add yesno.h. + * m4/argmatch.m4: New file, from coreutils with AC_LIBSOURCES removed. * m4/dev-ino.m4, same-inode.m4: Remove. + * m4/_inttypes_h.m4 (gl_INTTYPES_H): * m4/acl.m4 (AC_FUNC_ACL): * m4/backupfile.m4 (gl_BACKUPFILE): * m4/c-strtod.m4 (gl_C99_STRTOLD): * m4/canon-host.m4 (gl_CANON_HOST): * m4/canonicalize.m4 (AC_FUNC_CANONICALIZE_FILE_NAME): * m4/chdir-long.m4 (gl_FUNC_CHDIR_LONG): * m4/chdir-safer.m4 (gl_CHDIR_SAFER): * m4/cloexec.m4 (gl_CLOEXEC): * m4/close-stream.m4 (gl_CLOSE_STREAM): * m4/closeout.m4 (gl_CLOSEOUT): * m4/dirfd.m4 (gl_FUNC_DIRFD): * m4/dirname.m4 (gl_DIRNAME): * m4/exclude.m4 (gl_EXCLUDE): * m4/exitfail.m4 (gl_EXITFAIL): * m4/fcntl-safer.m4 (gl_FCNTL_SAFER): * m4/file-type.m4 (gl_FILE_TYPE): * m4/filemode.m4 (gl_FILEMODE): * m4/filenamecat.m4 (gl_FILE_NAME_CONCAT): * m4/fpending.m4 (gl_FUNC_FPENDING): * m4/fprintftime.m4 (gl_FPRINTFTIME): * m4/fts.m4 (gl_FUNC_FTS): * m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): * m4/getdate.m4 (gl_GETDATE): * m4/gethrxtime.m4 (gl_GETHRXTIME): * m4/getpagesize.m4 (gl_GETPAGESIZE): * m4/getpass.m4 (gl_FUNC_GETPASS): * m4/gettime.m4 (gl_GETTIME): * m4/getugroups.m4 (gl_GETUGROUPS): * m4/glob.m4 (gl_GLOB_SUBSTITUTE): * m4/group-member.m4 (gl_FUNC_GROUP_MEMBER): * m4/hard-locale.m4 (gl_HARD_LOCALE): * m4/hash.m4 (gl_HASH): * m4/idcache.m4 (gl_IDCACHE): * m4/lchmod.m4 (gl_FUNC_LCHMOD): * m4/lchown.m4 (gl_FUNC_LCHOWN): * m4/long-options.m4 (gl_LONG_OPTIONS): * m4/lstat.m4 (gl_FUNC_LSTAT): * m4/md5.m4 (gl_MD5): * m4/memcasecmp.m4 (gl_MEMCASECMP): * m4/memcoll.m4 (gl_MEMCOLL): * m4/mempcpy.m4 (gl_FUNC_MEMPCPY): * m4/memrchr.m4 (gl_FUNC_MEMRCHR): * m4/memxor.m4 (gl_MEMXOR): * m4/mkancesdirs.m4 (gl_MKANCESDIRS): * m4/mkdir-p.m4 (gl_MKDIR_PARENTS): * m4/modechange.m4 (gl_MODECHANGE): * m4/mountlist.m4 (gl_MOUNTLIST): * m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): * m4/openat.m4 (gl_FUNC_OPENAT): * m4/pathmax.m4 (gl_PATHMAX): * m4/physmem.m4 (gl_PHYSMEM): * m4/posixtm.m4 (gl_POSIXTM): * m4/posixver.m4 (gl_POSIXVER): * m4/quote.m4 (gl_QUOTE): * m4/quotearg.m4 (gl_QUOTEARG): * m4/readtokens.m4 (gl_READTOKENS): * m4/readutmp.m4 (gl_READUTMP): * m4/regex.m4 (gl_REGEX): * m4/safe-read.m4 (gl_SAFE_READ): * m4/safe-write.m4 (gl_SAFE_WRITE): * m4/same.m4 (gl_SAME): * m4/save-cwd.m4 (gl_SAVE_CWD): * m4/savedir.m4 (gl_SAVEDIR): * m4/settime.m4 (gl_SETTIME): * m4/sha1.m4 (gl_SHA1): * m4/sig2str.m4 (gl_FUNC_SIG2STR): * m4/stat-macros.m4 (gl_STAT_MACROS): * m4/stat-time.m4 (gl_STAT_TIME): * m4/stdio-safer.m4 (gl_FOPEN_SAFER): * m4/stdlib-safer.m4 (gl_STDLIB_SAFER): * m4/strdup.m4 (gl_FUNC_STRDUP): * m4/strftime.m4 (gl_FUNC_GNU_STRFTIME): * m4/strndup.m4 (gl_FUNC_STRNDUP): * m4/strnlen.m4 (gl_FUNC_STRNLEN): * m4/strverscmp.m4 (gl_FUNC_STRVERSCMP): * m4/time_r.m4 (gl_TIME_R): * m4/timespec.m4 (gl_TIMESPEC): * m4/unistd-safer.m4 (gl_UNISTD_SAFER): * m4/unlinkdir.m4 (gl_UNLINKDIR): * m4/unlocked-io.m4 (gl_FUNC_GLIBC_UNLOCKED_IO): * m4/userspec.m4 (gl_USERSPEC): * m4/utimecmp.m4 (gl_UTIMECMP): * m4/utimens.m4 (gl_UTIMENS): * m4/xalloc.m4 (gl_XALLOC): * m4/xgetcwd.m4 (gl_XGETCWD): * m4/xnanosleep.m4 (gl_XNANOSLEEP): * m4/xreadlink.m4 (gl_XREADLINK): * m4/xstrtod.m4 (gl_XSTRTOD): * m2/yesno.m4 (gl_YESNO): Don't use AC_LIBSOURCES; instead, rely on the files in ../modules/ to get the necessary .h files and whatnot.
* Update from coreutils.Paul Eggert2006-08-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/__fpending.h: Add copyright notice. * lib/fprintftime.h: Likewise. * lib/savedir.c: Use (C) in copyright notice. * lib/savedir.h: Likewise. 2006-08-15 Jim Meyering <jim@meyering.net> * lib/at-func.c: New file, with the logic of all emulated at-functions. * lib/openat-priv.h: Include <errno.h> and define ENOSYS, in support of the EXPECTED_ERRNO macro. * lib/openat.c (fstatat, unlinkat, fchownat): Remove function definitions. Instead, define the appropriate symbols and include "at-func.c". * lib/mkdirat.c (mkdirat): Likewise. * lib/fchmodat.c (fchmodat): Likewise. (ENOSYS): Remove definition. * lib/openat.c: Don't include <errno.h>, now that "openat-priv.h" does it. Don't include "unistd--.h" -- it wasn't ever used. 2006-01-17 Jim Meyering <jim@meyering.net> Rewrite fts.c not to change the current working directory, by using openat, fstatat, fdopendir, etc.. * lib/fts.c [! _LIBC]: Include "openat.h" and "unistd--.h". (HAVE_OPENAT_SUPPORT): Define. [_LIBC] (fchdir): Don't undef or define; no longer used. (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir. Now, this `function' always succeeds, and consumes its file descriptor parameter -- so callers must not close such FDs. Update callers. (diropen_fd, opendirat, cwd_advance_fd): New functions. (diropen): Add parameter, SP. Adjust all callers. Implement using diropen_fd, rather than open. (fts_open): Initialize new member, fts_cwd_fd. Remove fts_rft-setting code. (fts_close): Close fts_cwd_fd, if necessary. (__opendir2): Define in terms of opendir or opendirat, depending on whether the FST_NOCHDIR flag is set. (fts_build): Since fts_safe_changedir consumes its FD, and since this code must do `closedir(dirp)', dup the dirfd(dirp) argument, and close the dup'd file descriptor upon failure. (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat. (fts_safe_changedir): Tweak semantics to reflect that this function now calls cwd_advance_fd and hence consumes its FD argument. * lib/fts_.h [struct FTS] (fts_cwd_fd): New member. [struct FTS] (fts_rft): Remove now-unused member. [struct FTS] (fts_cycle.state): Improve comment. * lib/openat.c (openat_needs_fchdir): New function. * lib/openat.h (openat_needs_fchdir): Declare it. 2006-08-15 Jim Meyering <jim@meyering.net> * m4/openat.m4 (gl_FUNC_OPENAT): Add at-func.c via AC_LIBSOURCES. 2006-01-17 Jim Meyering <jim@meyering.net> * m4/fts.m4 (gl_FUNC_FTS_CORE): Depend on gl_FUNC_OPENAT. 2006-01-11 Jim Meyering <jim@meyering.net> * m4/openat.m4 (gl_FUNC_OPENAT): Require and compile fchmodat.c. Check for the lchmod function.
* * backupfile.c, dirfd.h, fts.c, getcwd.c, glob.c, glob_.h:Paul Eggert2006-07-111-2/+2
| | | | | | | | | | | | Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN macros into the GNU _D_EXACT_NAMLEN. * savedir.c: Likewise. (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen. * backupfile.m4, d-ino.m4, d-type.m4, dirfd.m4, fts.m4, getcwd.m4: * savedir.m4: Ignore the obsolescent !HAVE_DIRENT_H case. Consolidate NAMLEN macros into the GNU _D_EXACT_NAMLEN.
* * lib/getloadavg.c: Use __VMS, not VMS.Paul Eggert2006-07-061-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/getopt.c: Likewise. * lib/getpagesize.h: Likewise. * lib/glob.c: Remove most VMS cruft; it hasn't been tested for a while and probably does not work. * lib/backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't worry about this obsolete case any more. (HAVE_DIR): Remove. All uses removed; we now assume you can read directories. * lib/dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't worry about this obsolete case any more. * lib/fts.c: Likewise. * lib/getcwd.c: Likewise. * lib/glob.h: Likewise. * lib/savedir.c: Likewise. * m4/backupfile.m4 (gl_BACKUPFILE): Check for dirent.h, instead of invoking obsolescent AC_HEADER_DIRENT macro. * m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Likewise. * m4/d-type.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE): Likewise. * m4/dirfd.m4 (gl_FUNC_DIRFD): Likewise. * m4/fts.m4 (gl_FUNC_FTS_CORE): Likewise. * m4/getcwd.m4 (gl_PREREQ_GETCWD): Likewise. * m4/glob.m4 (gl_PREREQ_GLOB): Likewise. * m4/savedir.m4 (gl_SAVEDIR): Likewise. * m4/readdir.m4: Remove; no longer needed.
* Sync from coreutils.Paul Eggert2005-09-231-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h, stat-time.h. * argmatch.h: Include verify.h (ARGMATCH_VERIFY): Use verify rather than rolling our own. (ARGMATCH_ASSERT): Remove; unused. * canonicalize.c: Assume STDC_HEADERS. * exclude.c: Include "strcase.h". * regex_internal.h [!defined _LIBC]: Likewise. * getusershell.c: Include stdio--.h rather than stdio.h and stdio-safer.h. (getusershell): Call fopen, not fopen_safer. * save-cwd.c: Include fcntl--.h rather than fcntl.h. Do not include unistd-safer.h. (save_cwd): Don't call fd_safer; no longer needed now that we include fcntl--.h. * modules/argmatch (Depends-on): Add verify. * modules/getloadavg (Depends-on): Depend on fcntl-safer, not unistd-safer. * modules/save-cwd (Depends-on): Likewise. * backupfile.m4, calloc.m4, chown.m4, cloexec.m4, dup2.m4: * fileblocks.m4, free.m4, ftruncate.m4, getcwd.m4, getpagesize.m4: * getugroups.m4, group-member.m4, idcache.m4, link-follow.m4: * mkstemp.m4, mktime.m4, mountlist.m4, nanosleep.m4, pathmax.m4: * physmem.m4, posixver.m4, putenv.m4, safe-read.m4, same.m4: * save-cwd.m4, stdio-safer.m4, unistd-safer.m4, unlinkdir.m4: * userspec.m4, xgetcwd.m4, xreadlink.m4: Don't bother checking for string.h, stdlib.h, unistd.h. * fts.m4 (gl_FUNC_FTS_CORE): Don't require AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK; that's now the lstat module's job. * jm-macros.m4 (gl_MACROS): Likewise. * prereq.m4 (gl_PREREQ): Add gl_FUNC_LSTAT. * backupfile.c: Use ARGMATCH_VERIFY, just in case. * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just the .tm_year member, since otherwise gcc-4.0 would now warn about tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday. * quotearg.c (quotearg_n_options): Change code to be suboptimal, in order to avoid an unsuppressible warning from gcc on 64-bit systems. * lstat.m4 (gl_FUNC_LSTAT): Use AC_LIBSOURCES to require lstat.c and lstat.h. Remove obsolete comment. * xreadlink.m4: Use AC_LIBSOURCES and AC_LIBOBJ. * xstrtod.m4: Likewise.
* * modules/fts (Files): Remove m4/inttypes-pri.m4.Paul Eggert2005-05-271-5/+1
| | | | | | | | | | * modules/fts-lgpl (Depends-on): Remove gettext. * lib/fts.c: Don't worry about debugging on pre-C99-comopatible hosts; the configuration hassle isn't worth it. Include inttypes.h and stdint.h unconditionally if FTS_DEBUG. (LONGEST_MODIFIER, PRIuMAX): Remove. * m4/fts.m4 (gl_FUNC_FTS_CORE): Don't check for inttypes.h or stdint.h, and don't require gt_INTTYPES_PRI.
* New fts module.Paul Eggert2005-05-201-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MODULES.html.sh (File system functions): Add fts, fts-lgpl. * lib/fts.c: Don't include "cycle-check.h" or "hash.h". (setup_dir, free_dir): New functions. (enter_dir, leave_dir): Define trivial alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE. (HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed. (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir. (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir): Move to fts-cycle.c. (fts_open): Use setup_dir. (fts_close): Use free_dir. (fts_read): Have just one copy of the ENTER_DIR code rather than three. This adds a label and some gotos, but the alternatives were messier. Check for memory allocation failure when entering a dir. (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code. * lib/fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro. (FTS): New member fts_cycle, that is a union that contains the old active_dir_ht and cycle_state. All uses changed to mention fts_cycle.ht and fts_cycle.state. * lib/fts-cycle.c: New file, containing GPL'ed code migrated out of fts.c, with the following changes: (setup_dir, free_dir): New functions. (enter_dir): Now returns bool. Return true if successful, false if memory exhausted. All callers changed. Do not bother partly cleaning up on memory allocation failure; that is free_dir's job. However, free ad if hash_insert fails, to avoid memory leak. (enter_dir, leave_dir): Accommodate change to FTS by inspecting fts->fts_options to see which union member to use. * m4/fts.m4 (gl_FUNC_FTS_CORE): Renamed from gl_FUNC_FTS. (gl_FUNC_FTS, gl_FUNC_FTS_LGPL): New macros. * lib/unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]: Now a macro, to pacify GCC.
* * fts.c: Include fts_.h first, to check interface.Paul Eggert2005-05-181-12/+3
| | | | | | | | | | | | | | | | | | | | | | Do not include intprops.h; no longer needed. Include cycle-check.h and hash.h, since fts_.h no longer does. Remove unnecessary casts of closedir to void. (fts_build): Use a simpler method (not involving TYPE_SIGNED) to decide whether to decrement nlinks. * fts_.h: Do not include hash.h or cycle-check.h; no longer needed. (FTS): Use struct hash_table * instead of Hash_table, so that we no longer need to include hash.h here. * fts.m4 (gl_FUNC_FTS): Don't require AC_HEADER_STDC, as we don't use its results. Don't check for fcntl.h, stddef.h, stdlib.h, string.h, unistd.h, since we include them unconditionally. Don't require AM_STDBOOL_H, since stdbool is a prerequisite. Don't require AC_C_CONST, AC_TYPE_SIZE_T or check for ptrdiff_t since we assume C89 or better. Don't require AC_FUNC_CLOSEDIR_VOID, AC_FUNC_LSTAT, or AC_FUNC_STAT, as we don't use their results. Don't check for fchdir, memmove, memset, strrchr, as we use them unconditionally.
* (AC_LIBSOURCES): Add intprops.h to the list.Jim Meyering2005-05-181-2/+2
|
* New file, from coreutils.Jim Meyering2005-05-171-0/+36