summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Assume C89 or better.Paul Eggert2001-11-241-110/+106
| | | | | | | | | | | | 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.
* Assume C89 or better.Paul Eggert2001-11-241-176/+150
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Assume C89 or better.Paul Eggert2001-11-241-222/+191
| | | | | | | | | | | | | | | | | 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.
* Initial revisionPaul Eggert2001-11-231-0/+49
|
* (lf_snarf): Fix bug when help line wrapped around the input buffer.Paul Eggert1998-12-121-3/+1
|
* Include <config.h> before using "const".Paul Eggert1998-09-144-5/+9
|
* (quotesys.h): Include.Paul Eggert1998-09-141-2/+2
| | | | | | | | | | (PR_PROGRAM): New macro. (pfatal_with_name): Abort if error returns. (fatal): Likewise. (print_message_queue): Free message chain after printing. (currently_recursive): Renamed from current_depth, and now a boolean. (begin_output): Report error if fflush does. Avoid stdio and gettext in child.
* (__attribute__): New macro.Paul Eggert1998-09-141-1/+1
| | | | | | | | | | (getenv): Don't declare if HAVE_STDLIB_H. (CHAR_MAX): New macro. (<locale.h>): New include. (<locale.h>): Include before <libintl.h>. (could_be_mvfs_stat_bug, could_be_nfs_stat_bug, dev_may_have_duplicate_ino, same_special_file): New macros. (same_file): Use them.
* (print_half_line): Add brackets to pacify GCC -Wall.Paul Eggert1998-09-141-1/+1
|
* (quotesys.h): Include.Paul Eggert1998-09-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | (DIFF_PROGRAM, DEFAULT_EDITOR_PROGRAM): Remove. (free_software_msgid, editor_program, not_found): New vars. (diffbin, edbin): Remove. (editor_program): Renamed from edbin. (edit, interact): Now take extra string arg. (exiterr, fatal, perror_fatal, try_help): Add noreturn attribute. (sigset_t, sigemptyset, sigmask, sigaddset, SIG_BLOCK, SIG_SETMASK): (sigprocmask): New macros, if !HAVE_SIGPROCMASK. (error): Now has printf attribute. (longopts, main): Don't assume ASCII. (try_help): New operand arg. (usage): Conform to new GNU standards. (main): Set static vars for editor and diff program. Compare getopt_long result to -1, not EOF. -v conforms to new GNU standard. Complain better about extra and missing operands. If HAVE_VFORK, block SIGINT and SIGPIPE in the parent, since when the child munges its handlers it may somp on the parent. Pass rname to intract. Translate not-found message before forking. (give_help): Just output it all at once. (edit): New args lname, lline, rname, rline. (edit): New command 'd'. (interact): New args lname, rname.
* Update FSF address.Paul Eggert1998-09-141-1/+1
|
* (cmpbuf.h): Include.Paul Eggert1998-09-141-1/+1
| | | | (slurp): Check for arithmetic overflow when computing buffer size.
* Remove `#if 0'ed code.Paul Eggert1998-09-141-1/+1
|
* (diff_dirs): Check for recursive directory loop.Paul Eggert1998-09-141-1/+1
| | | | | Arg is now struct comparison const *. (dir_loop): New function
* (quotesys.h): Include.Paul Eggert1998-09-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | (free_software_msgid): New decl. (RANGE_START, RANGE_END): Renamed from START and END. (fatal, perror_with_exit, try_help): Add noreturn attribute. (error): Add printf attribute. (diff_program): Now a ptr, not an array. Initialize to DEFAULT_DIFF_PROGRAM instead of DIFF_PROGRAM. (longopts, main): Don't assume ASCII. (main): Use DIFF environment var to specify name of diff program. Compare getopt_long result to -1, not EOF. -v now reports version according to new GNU standard. Report spelling of extra operand, or last operand before missing one. (try_help): Now takes operand arg. (option_help_ms): Fix typo: missing comma. (usage): Update as per current GNU standards. (environ): Remove decl. (read_diff): Invoke diff with --inhibit-hunk-merge. Translate `not found' message before forking. Quote name of diff program. Pass horizon lines. `memory exhausted' -> `Memory exhausted'
* (XTERN): Renamed from EXTERN.Paul Eggert1998-09-141-1/+1
| | | | | | | | | | | (struct filedata): Remove dir_p arg. (struct comparison): New type. (diff_2_files, diff_dirs)" Ise ot/ (error): Add printf attribute if applicable. (free_software_msgid): New decl. (pr_program): New decl. (fatal): Add noreturn attribute. (pfatal_with_name): Likewise.
* (authorship_msgid): New var.Paul Eggert1998-09-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (quotesys.h): Include. (ck_atoi): Remove. (function_regexp_list, ignore_regexp_list): Now static. (binary_flag): Renamed from binary_I_O. (entire_new_file_flag, unidirectional_new_file_flag, print_file_same_flag): Now static. (numeric_arg): Renamed from ck_atoi. New argument specifying the argument type. (longopts, main): Don't assume ASCII. (longopts): Remove old aliases --file-label, --entire-new-file, --ascii, --print. (main): Check for -1, not EOF, when calling getopt_long. Use numeric_arg to report errors. Report error if -l specified but pagination is not supported. Report error if -S is specified twice with conflicting values. Have --version conform to the new GNU standards. Add new --from-file, --to-file, --inhibit-hun,-merge options. Make the horizon at least as large as the context. Add casts to pacify gcc -Wall. (try_help): Add operand arg. (option_help_msgid): Doc fix to match above. (usage): Indent option_help_msgid. (compare_files): Now takes struct comparison instead of two directory names and a depth. (NONEXISTENT, UNOPENED, ERRNO_ENCODE, ERRNO_DECODE): New macros. (DIR_P): New macro. Report error if fflush does.
* Fix spacing.Paul Eggert1998-09-141-1/+1
|
* (authorship_msgid): New var.Paul Eggert1998-09-141-2/+2
| | | | | | | | | | | | | | | (free_software_msgid): New decl. (error): Now has printf attribute. (try_help): Likewise. (long_options): Don't assume ASCII. (try_help): Now accepts operand arg. (main): Check for -1, not EOF, when calling getopt_long. Report --ignore-initial value when complaining about it. Output copyright and free software info with -v. Don't assume ASCII. Report last operand when one is missing. Report text of extra operand. Move block_read into cmpbuf.c.
* (diff_dirs): Check for recursive directory loop.Paul Eggert1998-09-141-33/+51
| | | | | Arg is now struct comparison const *. (dir_loop): New function
* (quotearg.h): Include.Paul Eggert1998-09-131-69/+80
| | | | | | | | | | (PR_PROGRAM): New macro. (pfatal_with_name): Abort if error returns. (fatal): Likewise. (print_message_queue): Free message chain after printing. (currently_recursive): Renamed from current_depth, and now a boolean. (begin_output): Report error if fflush does. Avoid stdio and gettext in child.
* (__attribute__): New macro.Paul Eggert1998-09-131-63/+123
| | | | | | | | | | (getenv): Don't declare if HAVE_STDLIB_H. (CHAR_MAX): New macro. (<locale.h>): New include. (<locale.h>): Include before <libintl.h>. (could_be_mvfs_stat_bug, could_be_nfs_stat_bug, dev_may_have_duplicate_ino, same_special_file): New macros. (same_file): Use them.
* (print_half_line): Add brackets to pacify GCC -Wall.Paul Eggert1998-09-131-24/+26
|
* (quotearg.h): Include.Paul Eggert1998-09-131-167/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | (DIFF_PROGRAM, DEFAULT_EDITOR_PROGRAM): Remove. (free_software_msgid, editor_program, not_found): New vars. (diffbin, edbin): Remove. (editor_program): Renamed from edbin. (edit, interact): Now take extra string arg. (exiterr, fatal, perror_fatal, try_help): Add noreturn attribute. (sigset_t, sigemptyset, sigmask, sigaddset, SIG_BLOCK, SIG_SETMASK): (sigprocmask): New macros, if !HAVE_SIGPROCMASK. (error): Now has printf attribute. (longopts, main): Don't assume ASCII. (try_help): New operand arg. (usage): Conform to new GNU standards. (main): Set static vars for editor and diff program. Compare getopt_long result to -1, not EOF. -v conforms to new GNU standard. Complain better about extra and missing operands. If HAVE_VFORK, block SIGINT and SIGPIPE in the parent, since when the child munges its handlers it may somp on the parent. Pass rname to intract. Translate not-found message before forking. (give_help): Just output it all at once. (edit): New args lname, lline, rname, rline. (edit): New command 'd'. (interact): New args lname, rname.
* Update FSF address.Paul Eggert1998-09-131-13/+14
|
* (cmpbuf.h): Include.Paul Eggert1998-09-131-19/+24
| | | | (slurp): Check for arithmetic overflow when computing buffer size.
* Remove `#if 0'ed code.Paul Eggert1998-09-131-16/+14
|
* (quotearg.h): Include.Paul Eggert1998-09-131-79/+105
| | | | | | | | | | | | | | | | | | | | | | | (free_software_msgid): New decl. (RANGE_START, RANGE_END): Renamed from START and END. (fatal, perror_with_exit, try_help): Add noreturn attribute. (error): Add printf attribute. (diff_program): Now a ptr, not an array. Initialize to DEFAULT_DIFF_PROGRAM instead of DIFF_PROGRAM. (longopts, main): Don't assume ASCII. (main): Use DIFF environment var to specify name of diff program. Compare getopt_long result to -1, not EOF. -v now reports version according to new GNU standard. Report spelling of extra operand, or last operand before missing one. (try_help): Now takes operand arg. (option_help_ms): Fix typo: missing comma. (usage): Update as per current GNU standards. (environ): Remove decl. (read_diff): Invoke diff with --inhibit-hunk-merge. Translate `not found' message before forking. Quote name of diff program. Pass horizon lines. `memory exhausted' -> `Memory exhausted'
* (XTERN): Renamed from EXTERN.Paul Eggert1998-09-131-65/+73
| | | | | | | | | | | (struct filedata): Remove dir_p arg. (struct comparison): New type. (diff_2_files, diff_dirs)" Ise ot/ (error): Add printf attribute if applicable. (free_software_msgid): New decl. (pr_program): New decl. (fatal): Add noreturn attribute. (pfatal_with_name): Likewise.
* (authorship_msgid): New var.Paul Eggert1998-09-131-290/+434
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (quotearg.h): Include. (ck_atoi): Remove. (function_regexp_list, ignore_regexp_list): Now static. (binary_flag): Renamed from binary_I_O. (entire_new_file_flag, unidirectional_new_file_flag, print_file_same_flag): Now static. (numeric_arg): Renamed from ck_atoi. New argument specifying the argument type. (longopts, main): Don't assume ASCII. (longopts): Remove old aliases --file-label, --entire-new-file, --ascii, --print. (main): Check for -1, not EOF, when calling getopt_long. Use numeric_arg to report errors. Report error if -l specified but pagination is not supported. Report error if -S is specified twice with conflicting values. Have --version conform to the new GNU standards. Add new --from-file, --to-file, --inhibit-hun,-merge options. Make the horizon at least as large as the context. Add casts to pacify gcc -Wall. (try_help): Add operand arg. (option_help_msgid): Doc fix to match above. (usage): Indent option_help_msgid. (compare_files): Now takes struct comparison instead of two directory names and a depth. (NONEXISTENT, UNOPENED, ERRNO_ENCODE, ERRNO_DECODE): New macros. (DIR_P): New macro. Report error if fflush does.
* Fix spacing.Paul Eggert1998-09-131-14/+15
|
* (authorship_msgid): New var.Paul Eggert1998-09-131-67/+52
| | | | | | | | | | | | | | | (free_software_msgid): New decl. (error): Now has printf attribute. (try_help): Likewise. (long_options): Don't assume ASCII. (try_help): Now accepts operand arg. (main): Check for -1, not EOF, when calling getopt_long. Report --ignore-initial value when complaining about it. Output copyright and free software info with -v. Don't assume ASCII. Report last operand when one is missing. Report text of extra operand. Move block_read into cmpbuf.c.
* (no_discards): Remove.Paul Eggert1998-09-131-104/+106
| | | | | | | | | (inhibit): Remove. (shift_boundaries): Don't inhibit. If inhibit_hunk_merge is nonzero, don't merge hunks. (briefly_report): Now returns 2 if trouble, CHANGES otherwise. (diff_2_files): Now takes struct comparison. If briefly_report reports trouble, pass it on to caller.
* (struct msg, message5, print_message_queue): Allocate just one block of memoryPaul Eggert1994-11-141-29/+47
| | | | to save a messsage.
* (gettext): Declare; use a stub if ! HAVE_LIBINTL_H.Paul Eggert1994-11-141-0/+12
| | | | (setlocale): Declare; use a stub if ! HAVE_LOCALE_H.
* (version_string): Fix typo in declaration: `const' was missing.Paul Eggert1994-11-141-60/+79
| | | | | | | (option_help_msgid, help_msgid): New constant. (usage, give_help): Use them, so message is translated one option at a time. (main): Invoke setlocale first thing, to tell library we're internationalized. (trapsigs): Ignore sigaction failure, to be compatible with `signal'.
* (main): Invoke setlocale first thing, to tell library we're internationalized.Paul Eggert1994-11-141-44/+55
| | | | | (option_help_msgid): New constant. (usage): Use it, so message is translated one option at a time.
* (main): Invoke setlocale first thing, to tell library we're internationalized.Paul Eggert1994-11-141-95/+111
| | | | | | | -D FOO now outputs `/* ! FOO */ instead of `/* not FOO */'. (option_help_msgid): New constant. (usage): Use it, so message is translated one option at a time. (compare_files): For label, use file_label if set.
* (main): Invoke setlocale first thing, to tell library we're internationalized.Paul Eggert1994-11-141-45/+60
| | | | | | | (option_help_msgid): New constant. (usage): Use it, so message is translated one option at a time. (sprintc): Renamed from `printc'. Now outputs to a buffer instead of stdout. (cmp): Use new sprintc semantics.
* (briefly_report): Rewrite `message (A?"B":"C")' asPaul Eggert1994-11-141-5/+15
| | | | | `if (A) message ("B") : message ("C")'; this is for getmsgids. (briefly_report, diff_2_files): For label, use file_label if set.
* (trapsigs): Don't check signal return value, since it's bogus under djgpp.Paul Eggert1994-11-091-3/+2
|
* (pr_program): New var.Paul Eggert1994-10-311-37/+32
| | | | | | | | | (begin_output): Use system_quote_arg to compute command. (analyze_hunk): ignore_regexp_list -> ignore_regexp.fastmap Fix off-by-1 line length bug. Match with one big regexp instead of a list of regexps. Use new `trivial_length' local instead of comparing line's first byte to `\n'. Help the compiler with linbuf local vars.
* (system_quote_arg): New function; replaces SYSTEM_QUOTE_ARG macro.Paul Eggert1994-10-311-18/+2
|
* (main): Use system_quote_arg to compute command.Paul Eggert1994-10-311-5/+5
|
* (find_identical_ends): function_regexp_list -> function_regexp.fastmapPaul Eggert1994-10-311-1/+1
|
* (read_diff): Quote arguments with system_quote_arg.Paul Eggert1994-10-311-6/+8
|
* (function_regexp, ignore_regexp): Replace lists of compiled regexps withPaul Eggert1994-10-311-9/+3
| | | | | these single compiled regexps. (regexp_list, function_regexp_list, ignore_regexp_list): Moved to diff.c.
* (option_list): Quote options with system_quote_arg.Paul Eggert1994-10-311-23/+78
| | | | | | | (add_regexp): Build one big regexp instead of a list of regexps. (summarize_regexp_list): New function. (regexp_list): Redesigned struct; moved here from diff.h. (function_regexp_list, ignore_regexp_list): Likewise, for vars.
* (find_function): Simplify interface: don't return size of function line.Paul Eggert1994-10-311-42/+32
| | | | | | | All callers changed. function_regexp_list -> function_regexp (print_context_script, pr_context_hunk, pr_unidiff_hunk): ignore_regexp_list -> ignore_regexp.fastmap (print_context_script, find_function): INT_MAX now denotes no previous match;
* Fix comment.Paul Eggert1994-10-311-1/+1
|