388 Commits

Author SHA1 Message Date
Paul Eggert
49e3b25b41 (AC_CHECK_FUNCS): Add gettimeofday, clock_gettime.
(LIB_CLOCK_GETTIME): New subst.
2001-11-25 00:22:19 +00:00
Paul Eggert
b6092f7a19 Assume C89 or better.
(_GNU_SOURCE): Remove; config.h now defines it.
(alloca): Declare like coreutils does it.
(verify, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, O_RDWR, S_IRUSR, S_IWUSR):
New macros.
(STAT_BLOCKSIZE): Parenthesize definiens.
<inttypes.h>: Include if HAVE_INTTYPES_H.
(CHAR_MAX, INT_MAX): Remove.
(PTRDIFF_MAX, SIZE_MAX): New macros.
(strtoumax): New decl.
Include stddef.h.
(bzero): Remove.
(bindtextdomain, textdomain, N_): New macros.
(ISPRINT, ISSPACE): Remove ifndef wrappers.
(ISUPPER, ISDIGIT): Remove.
(TOLOWER): New macro.
(MIN): Renamed from min; all callers changed.
(MAX): Likewise, from max.
(lin): New type.
(LIN_MAX): New macro.
(file_name_cmp): Renamed from filename_cmp.  All callers changed.
(file_name_lastdirchar): Renamed from file_name_lastdirchar.
All callers changed.
(could_be_mvfs_stat_bug, could_be_nfs_stat_bug, dev_may_have_duplicate_ino):
Remove.
(HAVE_SETMODE, NULL_DEVICE): New macros.
(same_file): Do not check attributes.
(same_file_attributes): New macro.
2001-11-25 00:21:28 +00:00
Paul Eggert
7cc1ca84b3 Assume C89 or better.
int -> bool for booleans.
int -> lin for line numbers.
int -> size_t for sizes.
Use angle-brackets when including quotesys.h.
Include error.h, regex.h, xalloc.h.
(message5): sizeof -> offsetof
(begin_output): Invoke pr without -f.
(lines_differ): Renamed from line_cmp, and return bool not 3-way int.
All callers changed.
Add support for IGNORE_TAB_EXPANSION.
(change_letter): Now an array rather than a function.  All callers changed.
(translate_range): Translate line numbers to long, not lin, for convenience
with printf.
(analyze_hunk): Return enum changes instead of a count of inserts and deletes.
All callers changed.
(zalloc): New function.
2001-11-25 00:11:23 +00:00
Paul Eggert
babd4445b7 Assume C89 or better.
int -> bool for booleans.
int -> lin for line numbers.
2001-11-24 23:59:13 +00:00
Paul Eggert
f7ea233c66 Assume C89 or better.
int -> bool for booleans.
int -> lin for line numbers.
Use angle-brackets when including getopt.h, quotesys.h.
Include error.h, freesoft.h, stdio.h, xalloc.h.
(copyright_string): Use only most recent year.
(authorship_msgid, option_help_msgid): Wrap in N_().

(tmpname): Now volatile.
(tmpmade): Remove.
(tmp): New var.
(private_tempnam, exists, letters): Remove.
(temporary_file): New function.
(edit): Use it.
(interact): Use strtoumax, not atoi.
2001-11-24 23:56:49 +00:00
Paul Eggert
7a9851bed3 Assume C89 or better.
int -> lin for line numbers.
2001-11-24 23:46:37 +00:00
Paul Eggert
420373575c Assume C89 or better.
int -> bool for booleans.
int -> lin for line numbers.
int -> size_t for sizes.
Use angle-brackets when including cmpbuf.h.
Include regex.h, xalloc.h.
(word): Remove; now done in system.h.
(hash_value): New type; use it instead of 'unsigned' for hash values.
(file_block_read): New function.
(sip, slurp): Use it.  Now static.
(sip): Ensure block size is a multiple of word size.  Clear eof flag.
(slurp): Use xalloc_die to report memory exhaustion.
(find_and_hash_each_line): Use TOLOWER instead of _tolower.
Add support for IGNORE_TAB_EXPANSION.
(prepare_text_end): Strip trailing CR if requested.
(find_identical_ends): Prepare the text only once, if they're duplicates.
Let the compiler take advantage more of the fact that the buffers are
word-aligned.
(primes): Remove.
(prime_offset): New var.
(read_var): Use prime_offset instead of primes.
Use zalloc instead of xmalloc + bzero.
2001-11-24 23:44:22 +00:00
Paul Eggert
9afb404ccb Assume C89 or better.
int -> lin for line numbers.
(format_group): Use strtoumax to parse line numbers.
(format_group, print_ifdef_lines): Use do_printf_spec to handle printf specs.
(groups_letter_value): Don't use _tolower; it's locale-dependent.
(do_printf_spec): Renamed from scan_printf_spec; now does the printing.
2001-11-24 20:16:15 +00:00
Paul Eggert
36b388a33f Assume C89 or better.
int -> lin for line numbers (or 'long' when that's more convenient).
(print_ed_hunk): Fix bug when handling double-dot inserts.
2001-11-24 20:10:42 +00:00
Paul Eggert
1c2ed8ea5b Assume C89 or better.
int -> bool for booleans.
Include error.h, exclude.h, xalloc.h.

(dir_sort): Return 0 on error, 1 on success.  All callers changed.
compare_names -> compare_names_for_qsort.

(compare_names): Try strcasecmp if ignore_file_name_case.  Then try
strcoll.  Use file_name_cmp only as a last resort.  Warn about
strcasecmp or strcoll failure.
(compare_names_for_qsort): New function.

(diff_dirs): Use compare_names rather than filename_cmp.
2001-11-24 20:08:03 +00:00
Paul Eggert
a54f0db411 Assume C89 or better.
int -> bool for booleans.
int -> lin for line numbers.
Use angle-brackets when including getopt.h, quotesys.h.
Include error.h, freesoft.h, inttostr.h, xalloc.h.
(copyright_string): Use only most recent year.
(authorship_msgid, option_help_msgid): Wrap in N_().

Rename the following variables for consistency with user-visible
option spellings.  All uses changed.
(text): Renamed from always_text.
(initial_tab): Renamed from tab_align_flag.

(horizon_lines): Remove.  Remove all uses.

(main): Invoke bindtextdomain and textdomain after setlocale.
Rename "DIFF" to "DIFF_PROGRAM".

Try to compare file0 to file1, because this is where changes are
expected to come from.  Diffing between these pairs of files is more
likely to avoid phantom changes from file0 to file1.
However, use file2 as the common file if this is a 3-way diff,
for backward compatibility.

(create_diff3_block): Use xcalloc instead of malloc + bzero.

(INT_STRLEN_BOUND): Remove; now in system.h.

(read_diff): Always use --horizon-lines=100 rather than trying to guess it.
Do not pass --inhibit-hunk-merge.
Minimum chunk size is 1, not 8KiB.
Use xalloc_die to report memory exhaustion.
(undotlines): Use long for start, not int.
2001-11-24 19:56:07 +00:00
Paul Eggert
2efe295eb5 Assume C89 or better.
int -> bool for booleans.
int -> lin for line numbers.
Don't include regex.h.
(enum changes): New enum.
(enum line_class): Remove; subsumed by enum changes.
(enum output_style): New constant OUTPUT_UNSPECIFIED.

(ignore_space_change_flag, ignore_all_space_flag): Remove.
(ignore_white_space): New decl, subsuming the above two.  All uses changed.

Rename the following decls for consistency with user-visible
option spellings.  All uses changed.
(text): Renamed from always_text_flag.
(ignore_blank_lines): Renamed from ignore_blank_lines_flag.
(ignore_case): Renamed from ignore_case_flag.
(brief): Renamed from no_details_flag.
(initial_tab): Renamed from tab_align_flag.
(expand_tabs): Renamed from tab_expand_flag.
(starting_file): Renamed from dir_start_file.
(paginate): Renamed from paginate_flag.
(sdiff_merge_assist): Renamed from sdiff_help_sdiff.
(left_column): Renamed from sdiff_left_only.
(suppress_common_lines): Renamed from sdiff_skip_common_lines.
(speed_large_files): Renamed from heuristic.
(minimal): Renamed from no_discards.

(inhibit_hunk_merge): Remove.

(strip_trailing_cr, excluded, time_format): New decls.

(files_can_be_treated_as_binary): Renamed from ignore_some_changes.

(group_format, line_format): Now char const *[], not char *[].

(struct file_data): Buffer is now word*, not char*, as it's always
aligned and this can help the compiler.  buffered_chars -> buffered
(since it's a byte count, not a char count).  All uses changed.
New member `eof'.

(FILE_BUFFER): New macro.

(excluded_filename, error, free_software_msgid): Remove decls; now in
other .h files.

(sip, slurp): Remove decls.
(file_block_read): New decl.
(change_letter): Now an array, not a function.
(lines_differ): Renamed from line_cmp.
(analyze_hunk): Now returns enum changes rather than two change counts.
2001-11-24 19:29:55 +00:00
Paul Eggert
d7f8501f53 (diff_LDADD): New symbol. 2001-11-24 19:12:49 +00:00
Paul Eggert
2e8641a5e5 Assume C89 or better.
int -> bool for booleans.
long -> off_t for line numbers.
Use angle-brackets when including getopt.h, fnmatch.h, quotesys.h.
Include error.h, exclude.h, freesoft.h, hard-locale.h, prepargs.h,
regex.h, signal.h, xalloc.h.
(copyright_string): Use only most recent year.
(authorship_msgid, option_help_msgid): Wrap in N_().

Rename the following variables for consistency with user-visible
option spellings.  All uses changed.
(binary): Renamed from binary_flag.
(new_file): Renamed from entire_new_file_flag.
(unidirectional_new_file): Renamed from unidirectional_new_file_flag.
(report_identical_files): Renamed from print_file_same_flag.

(numeric_arg): Remove.

(exclude, exclude_alloc, exclude_count, excluded_filename, add_exclude,
add_exclude_file):
Remove; now done by exclude.h.

(BINARY_OPTION, FROM_FILE_OPTION, HELP_OPTION, HORIZON_LINES_OPTION,
IGNORE_FILE_NAME_CASE_OPTION, INHIBIT_HUNK_MERGE_OPTION,
LEFT_COLUMN_OPTION, LINE_FORMAT_OPTION, NORMAL_OPTION,
SDIFF_MERGE_ASSIST_OPTION, STRIP_TRAILING_CR_OPTION,
SUPPRESS_COMMON_LINES_OPTION, TO_FILE_OPTION,
UNCHANGED_LINE_FORMAT_OPTION, OLD_LINE_FORMAT_OPTION,
NEW_LINE_FORMAT_OPTION, UNCHANGED_GROUP_FORMAT_OPTION,
OLD_GROUP_FORMAT_OPTION, NEW_GROUP_FORMAT_OPTION,
CHANGED_GROUP_FORMAT_OPTION): New constants.
(longopts, main): Use them.

(longopts, main, option_help_msgid): Add -E, --from-file, --to-file.

(main): Invoke bindtextdomain and textdomain after setlocale.
Use grep syntax, not Emacs, for regular expressions.
Use exclude.h, not our own functions.
Use ISO 8601 time format in hard locales.
Prepend DIFF_OPTIONS.
Don't update ignore_some_changes.
Use strtoumax instead of numeric_arg.
Use specify_value when appropriate.
error -> try_help when appropriate.
-p now means ^[[:alpha:]$_], not ^[_a-zA-Z$].
Ignore --inhibit-hunk-merge.
Prefer changed group formats to unchanged ones.
Remove now-unnecessary casts.
Set files_can_be_treated_as_binary.

(specify_value): Renamed from specify_format.  All uses changed.

(specify_style): Default is now unspecified, not normal.  All uses changed.

(set_mtime_to_now): New function.
(compare_files): Use it.  Use memset, not bzero.
Set stdin mtime to current time even when stdin is not a regular file.
Check for same file attributes, as well as for same file.
Use files_can_be_treated_as_binary.
"write failed" -> "standard output on output failure.
2001-11-24 19:10:43 +00:00
Paul Eggert
d96c04ee41 Assume C89 or better.
int -> lin for line numbers.
Include inttostr.h, regex.h.
(TIMESPEC_NS): New macro.
(nstrftime): New decl.
(print_context_label): Use nstrftime and time_format to format times.
Print numeric time stamp value if localtime fails.
(print_context_function): New function.
(pr_context_hunk, pr_unidiff_hunk): Use it.
(find_function): Use size_t for sizes, not int.
2001-11-24 14:34:53 +00:00
Paul Eggert
4de1d68d32 Assume C89 or better.
int -> bool for booleans.
long -> off_t for line numbers.
Use angle-brackets when including cmpbuf.h, getopt.h.
Include error.h, freesoft.h, inttostr.h, xalloc.h.
(copyright_string): Use only most recent year.
(authorship_msgid): Wrap in N_().
(buffer): Now word*, not char*.  All uses changed.
(word): Remove macro; now in system.h.
(long_options, option_help_msgid, main): -c --print-chars -> -b --print-bytes
(check_stdout): "write failed" -> "standard output"
(option_help_msgid): Wrap in N_().
(main): Invoke bindtextdomain and textdomain after setlocale.
Use strtoumax instead of doing the work ourselves.
Check for same_file_attributes as well as same_file.
(cmp): Use ssize_t for read returns, not size_t.
Do not assume that size_t is not narrower than int.
Do not assume that line numbers fit in 'long'.
(block_compare_and_count, block_compare):
Compiler now checks that buffers are word-aligned.
(block_compare_and_count): Count sizes with size_t, not long.
(sprintc): byte arg is unsigned char, not unsigned.
2001-11-24 14:16:12 +00:00
Paul Eggert
dd12686725 Assume C89 or better.
int -> lin for line numbers.
int -> bool for booleans.
unsigned int -> size_t for sizes.
Use angle-brackets when including cmpbuf.h.
Include error.h, regex.h, xalloc.h.
(discard_confusing_lines, diff_2_files): Use zalloc rather than xalloc+bzero.
(discard_confusing_lines): unsigned int -> lin for values that are really
line numbers.
(shift_boundaries): Do not inhibit hunk merges.
(build_reverse_script, build_script, diff_2_files): Use |, not ||, for speed.
(diff_2_files): no_details_flag & ~ignore_some_changes ->
files_can_be_treated_as_binary.  Esure that buffer size is a multiple
of sizeof (word).  Use file_block_read to read buffers.
(diff_2_files): Abort if output style is not one of the expected styles.
2001-11-24 13:51:07 +00:00
Paul Eggert
a821b5602b Initial revision 2001-11-23 18:44:41 +00:00
Paul Eggert
f78da6466e Initial revision 2001-11-23 13:28:32 +00:00
Paul Eggert
22af62a567 (jm_PREREQ_READUTMP): Remove, as it gives autoheader the willies. 2001-11-23 13:25:01 +00:00
Paul Eggert
cd1a913b43 Include config.h, freesoft.h rather than diff.h.
(free_software_msgid): Wrap contents in N_.
2001-11-23 13:04:25 +00:00
Paul Eggert
e28790892e Use prototypes instead of old-style functions. 2001-11-23 13:02:42 +00:00
Paul Eggert
33d72d80bc Don't include system.h; instead, include config.h, unistd.h.
Use prototypes instead of old-style functions.
(block_read): Don't assume that int is no wider than size_t.
2001-11-23 13:02:08 +00:00
Paul Eggert
e48d1026c5 Initial revision 2001-11-23 08:05:29 +00:00
Paul Eggert
8b1cfebb78 Define filename_cmp as an object-like macro, not as a function-like
macro.
2001-11-23 07:54:35 +00:00
Paul Eggert
da34f9fc34 Always operate in the C locale.
Set AWK using a method that works even with broken shells.
2001-11-23 07:52:27 +00:00
Paul Eggert
abb43c1f76 (AC_INIT): Use src/diff.c, not diff.h, as the source files got removed.
(AM_CONFIG_HEADER): Switch from AC_CONFIG_HEADER.
(AC_ARG_PROGRAM, AC_MINIX): Remove.

(AC_PREREQ, AM_INIT_AUTOMAKE, ALL_LINGUAS, AC_PROG_AWK,
AM_PROG_CC_STDC, AC_PROG_RANLIB, AC_C_INLINE, AC_C_VARARRAYS,
DEFAULT_DIFF_PROGRAM, DEFAULT_EDITOR_PROGRAM, AC_STRUCT_ST_MTIM_NSEC): Add.

(PR_PROGRAM): AC_DEFINE.

(AC_SYS_LARGEFILE): Use instead of our homebrew version.

(_GNU_SOURCE): Define if not defined.

(AC_CHECK_HEADERS): Add stdbool.h, unistd.h.
(AC_CHECK_TYPES): Add ptrdiff_t, uintmax_t.
(AM_GNU_GETTEXT, XGETTEXT): Add.

(WITH_MVFS_STAT_BUG, WITH_NFS_STAT_BUG): Remove.
(HAVE_MEMCHR): Remove.
(AC_CHECK_FUNCS): Add diraccess.
(AC_REPLACE_FUNCS): Add memchr, waitpid.
(jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_GNU_STRFTIME, jm_FUNC_MALLOC,
 jm_FUNC_REALLOC, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG, jm_PREREQ_REGEX,
 jm_PREREQ_TEMPNAME, jm_AC_PREREQ_XSTRTOUMAX, AC_FUNC_FNMATCH): Add.
(fnmatch.h, regex.h): Do not create these files unless we're using
our own fnmatch and regex.
(AC_OUTPUT): Add doc/Makefile, intl/Makefile, lib/Makefile, lib/posix/Makefile,
m4/Makefile, po/Makefile.in, src/Makefile.
2001-11-23 07:46:59 +00:00
Paul Eggert
851e787576 Don't translate "program" to "programme". 2001-11-23 07:12:27 +00:00
Paul Eggert
64c1b907e3 Initial revision 2001-11-20 19:05:44 +00:00
Paul Eggert
0b795bef12 Initial revision 2001-11-20 05:34:44 +00:00
Paul Eggert
8e78630e37 Initial revision 2001-11-04 01:21:33 +00:00
Paul Eggert
8a650ddd00 Initial revision 2001-10-27 00:37:40 +00:00
Paul Eggert
ce4ac3d8f5 Initial revision 2001-10-22 08:00:19 +00:00
Paul Eggert
5e0ab37d1b Initial revision 2001-09-29 01:15:42 +00:00
Paul Eggert
37788019c2 Initial revision 2001-08-23 17:25:08 +00:00
Paul Eggert
8a81b851d5 Initial revision 2001-08-12 17:11:46 +00:00
Paul Eggert
ecad5d7b24 Initial revision 2001-07-15 14:31:54 +00:00
Paul Eggert
688ab06db1 Initial revision 2001-07-07 04:55:38 +00:00
Paul Eggert
42bf2924b0 Initial revision 2001-07-06 04:44:39 +00:00
Paul Eggert
7109958ae4 Initial revision 2001-04-02 08:26:15 +00:00
Paul Eggert
4dcf610052 Initial revision 2001-01-26 11:13:28 +00:00
Paul Eggert
eb477ba945 Initial revision 2000-10-31 07:09:56 +00:00
Paul Eggert
0090fd30f9 Initial revision 2000-08-07 15:48:18 +00:00
Paul Eggert
9825e0bef5 From GCC repository 2000-02-06 06:57:20 +00:00
Paul Eggert
39a0766fcd (lf_snarf): Fix bug when help line wrapped around the input buffer. 1998-12-12 02:27:20 +00:00
Paul Eggert
4ecee655a2 Add dircategory. 1998-09-15 22:34:53 +00:00
Paul Eggert
5c5dfca096 Include <config.h> before using "const". 1998-09-14 07:27:17 +00:00
Paul Eggert
df0836e089 ($D.tar.gz): Don't use ln to create distribution; it doesn't
work with symlinks.
1998-09-14 06:59:43 +00:00
Paul Eggert
19db0feae5 (AC_PATH_PROG): Add PR_PROGRAM.
If available, prefer support for large files unless the user specified
one of the CPPFLAGS, LDFLAGS, or LIBS variables.
(AC_STRUCT_ST_RDEV): Add.
(HAVE_ST_FSTYPE_STRING): Add.
(--with-mvfs-stat-bug, --with-nfs-stat-bug): New options.
(HAVE_MEMCHR): New macro.
(AC_CHECK_FUNCS): Add sicprocmask.
1998-09-14 06:13:10 +00:00
Paul Eggert
eb6efbf9c6 Add --with-mvfs-stat-bug, --with-nfs-stat-bug. 1998-09-14 06:13:10 +00:00