Paul Eggert [Mon, 24 Apr 2006 17:50:24 +0000 (17:50 +0000)]
* unlink-busy.m4 (gl_FUNC_UNLINK_BUSY_TEXT): Use prototype
to define main with arguments, for C++. Reported by Eric Blake.
* c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC):
Prefer 'int main ()' to 'int main (void)', for C++.
* getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise.
* fsusage.m4 (gl_FILE_SYSTEM_USAGE): Specify a return type
for 'main', for C99 and C++.
Jim Meyering [Sun, 23 Apr 2006 21:35:04 +0000 (21:35 +0000)]
(sort_type): Rearrange to use as an array index when
choosing sort function; added new sort_numtypes member for
compile-time check.
(time_type): Add new time_numtypes member for compile-time check.
(directories_first): New global variable.
(GROUP_DIRECTORIES_FIRST_OPTION): New enum.
(long_options): Add --directories-first.
(main): Support new option.
(is_directory): New function.
(extract_dirs_from_files): Use it.
(DIRFIRST_CHECK, DEFINE_SORT_FUNCTIONS)
(LIST_SORTFUNCTION_VARIANTS): New macros.
(sort_functions): New global variable.
(sort_files): Use it.
(usage): Document new option.
Paul Eggert [Wed, 19 Apr 2006 06:27:43 +0000 (06:27 +0000)]
(fillrand): The assertion was way too weak, due to
what must be a typo. Strengthen it to its intended value.
(dopass): Don't use alloca; it's not worth the aggravation here,
since it's used only to get a page-aligned buffer, and page
alignment doesn't buy us much here. I'm suspicious that alloca
causes problems on some hosts, due to a recent bug report by Adam
Waltman.
Paul Eggert [Mon, 17 Apr 2006 23:23:43 +0000 (23:23 +0000)]
(human_access): Use (new) filemodestring rather than
(old) mode_string, so that we get more file types right, at least
in theory. Adjust to filemode changes.
Paul Eggert [Mon, 17 Apr 2006 23:23:11 +0000 (23:23 +0000)]
(HAVE_ST_DM_MODE): Remove; moved to ../lib/filemode.c.
(print_long_format): Use (new) filemodestring rather than
(old) mode_string, so that we get more file types right, at least
in theory. Adjust to filemode changes.
Paul Eggert [Mon, 17 Apr 2006 23:22:01 +0000 (23:22 +0000)]
Don't undef S_ISDOOR, since it's never buggy.
(S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
(S_ISPORT, S_ISWHT): New macros, if not already defined.
Paul Eggert [Mon, 17 Apr 2006 23:21:14 +0000 (23:21 +0000)]
Include "filemode.h" first, to test the interface.
Assume that filemode.h includes sys/types.h and sys/stat.h.
(HAVE_ST_DM_MODE): New macro, moved here from ls.c.
(ftypelet): Reorder to put common cases first, for efficiency.
Add 'P', 'w'. Remove 'M', since it's now the caller's responsibility
to do 'M'.
(strmode): Renamed from mode_string, and now stores 12 bytes instead
of 10, for compatibility with FreeBSD. All callers changed.
(filemodestring): Now stores 12 bytes instead of 10, and sets file types
that can't be deduced solely from st_mode. First arg is now a const
pointer.
Paul Eggert [Mon, 17 Apr 2006 23:20:53 +0000 (23:20 +0000)]
(What information is listed): Add P for Solaris
10 ports. Add commented-out entries for other types that POSIX
says are possible, or that I observed in FreeBSD documentation.
Paul Eggert [Wed, 12 Apr 2006 20:14:42 +0000 (20:14 +0000)]
(USE_STATVFS): New macro.
Include <sys/statvfs.h> and use statvfs only if USE_STATVFS.
(NAMEMAX_FORMAT): define a bit more clearly, now that the
statvfs-using code is a bit more regular.
Paul Eggert [Wed, 12 Apr 2006 20:13:00 +0000 (20:13 +0000)]
Don't include <inttypes.h> or <stdint.h>, since
fsusage.h now does that. Include fsusage.h first, to test interface.
Prefer statvfs if it works, since it's blessed by POSIX. Attempt
at most one method (the old code could have generated decls that
didn't conform to C89, not that this was ever exercised).