Jim Meyering [Sat, 22 Jan 2000 10:09:29 +0000 (10:09 +0000)]
Add support for octal and hexadecimal output.
(intconv): New variable.
(usage): Update.
(main): Call scan_arg instead of scan_double_arg. Call check_format
before scan_arg.
(scan_int_arg, scan_arg): New functions.
(check_format): Add intconv argument. Accept %d, %u, %o, %x, %X.
(print_numbers): If intconv is true, pass an int argument to printf.
Jim Meyering [Sat, 22 Jan 2000 09:31:19 +0000 (09:31 +0000)]
("xstrtol.h"): Include.
(Filter): Rename from PFL.
(non_neg_strtol): Remove function.
(find_bracketed_repeat): Use xstrtoul instead of non_neg_strtol.
(squeeze_filter, set_initialize, main): Use size_t and ssize_t in
place of long and int in several decls.
(read_and_delete, read_and_xlate): Likewise, and remove assertion.
Jim Meyering [Wed, 19 Jan 2000 22:43:33 +0000 (22:43 +0000)]
Tweak sort performance.
(hard_LC_CTYPE): Remove.
(keylist): Renamed from keyhead. Now a pointer, not a
mostly-unused struct. All uses changed.
(findlines, keycompare, CMP_WITH_IGNORE, compare, checkfp, mergefps,
sort): Tune and use a more consistent style for reallocation.
(keycompare, main): Don't worry about LC_CTYPE;
it's buggy with multibyte chars anyway.
(compare): Invoke alloca (0) after each call to keycompare,
not just the ones that return nonzero. This avoids a memory
leak on architectures without builtin alloca that occurs
sometimes when a file contains all duplicate lines.
Jim Meyering [Wed, 19 Jan 2000 20:40:51 +0000 (20:40 +0000)]
(jm_FUNC_NANOSLEEP): Include <sys/time.h>, too.
Use AC_HEADER_TIME. Volker Borchert reported that OpenBSD-2.3/sparc
defines `struct timespec' in <sys/time.h>
Jim Meyering [Tue, 18 Jan 2000 07:37:57 +0000 (07:37 +0000)]
(interrupt_handler, main):
Don't use SA_INTERRUPT to decide whether to call sigaction, as
POSIX.1 doesn't require SA_INTERRUPT and some systems
(e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
it's been part of POSIX.1 since day 1 (in 1988).
Jim Meyering [Tue, 18 Jan 2000 07:36:53 +0000 (07:36 +0000)]
(sighandler, main):
Don't use SA_INTERRUPT to decide whether to call sigaction, as
POSIX.1 doesn't require SA_INTERRUPT and some systems
(e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
it's been part of POSIX.1 since day 1 (in 1988).
Jim Meyering [Tue, 18 Jan 2000 07:28:47 +0000 (07:28 +0000)]
(interrupt_handler):
Don't use SA_INTERRUPT to decide whether to call sigaction, as
POSIX.1 doesn't require SA_INTERRUPT and some systems
(e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
it's been part of POSIX.1 since day 1 (in 1988).
(install_handler): Use SA_NOCLDSTOP, not _POSIX_VERSION,
to decide whether to call sigaction; this fixes an old typo.
Jim Meyering [Tue, 18 Jan 2000 07:25:53 +0000 (07:25 +0000)]
(nanosleep):
Don't use SA_INTERRUPT to decide whether to call sigaction, as
POSIX.1 doesn't require SA_INTERRUPT and some systems
(e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
it's been part of POSIX.1 since day 1 (in 1988).
Jim Meyering [Sun, 16 Jan 2000 12:35:49 +0000 (12:35 +0000)]
Sync with the version from emacs-20.5.
(<string.h>): Include if HAVE_STRING_H.
(<stdlib.h>): Include if HAVE_STDLIB_H.
(alloca): Abort if malloc fails.
Jim Meyering [Sat, 15 Jan 2000 11:57:11 +0000 (11:57 +0000)]
Quote multibyte characters correctly.
(ISGRAPH): Remove.
(ISPRINT): New macro.
(<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
(isprint, mbrtowc, mbsinit, mbstate_t): New macros,
defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
(quotearg_buffer_restyled): New function, with most of the old
quotearg_buffer's contents.
Major rewrite to support multibyte characters.
(quotearg_buffer): Now just calls quotearg_buffer_restyled.
Jim Meyering [Sat, 15 Jan 2000 11:13:44 +0000 (11:13 +0000)]
(TAB_STOP_SENTINEL): Define.
(unexpand): Use it instead of INT_MAX.
Declare column and pending to be `unsigned'.
Increment pending and column counters only if column is smaller
than TAB_STOP_SENTINEL.