11999-02-17 Jim Kingdon <http://www.cyclic.com> 2 and Hallvard B Furuseth. 3 4 * util.c: Use __STDC__ consistently with ./system.h. 5 * system.h: Add comment about PARAMS. 6 71999-01-12 Jim Kingdon <http://www.cyclic.com> 8 9 * Makefile.in, analyze.c, cmpbuf.c, cmpbuf.h, context.c, diff.c, 10 diff.h, diff3.c, diffrun.h, dir.c, ed.c, io.c, normal.c, system.h, 11 util.c: Remove paragraph containing the old snail mail address of 12 the Free Software Foundation. 13 141998-09-21 Jim Kingdon <kingdon@harvey.cyclic.com> 15 16 * util.c (printf_output): Make msg static; avoids auto 17 initializer, which is not portable to SunOS4 /bin/cc. 18 Reported by Mike Sutton@SAIC. 19 201998-09-14 Jim Kingdon <kingdon@harvey.cyclic.com> 21 22 * Makefile.in (DISTFILES): Add diagmeet.note. 23 241998-08-15 Jim Kingdon <kingdon@harvey.cyclic.com> 25 26 * diffrun.h (struct diff_callbacks): Change calling convention of 27 write_output so that a zero length means to output zero bytes. 28 The cvs_output convention is just too ugly/error-prone. 29 * util.c (printf_output): Rewrite to parse format string 30 overselves rather than calling vasprintf, which cannot be 31 implemented in portable C. 32 331998-08-06 David Masterson of kla-tencor.com 34 35 * util.c (flush_output): Don't prototype. 36 37Thu Jul 2 16:34:38 1998 Ian Lance Taylor <ian@cygnus.com> 38 39 Simplify the callback interface: 40 * diffrun.h: Don't include <stdarg.h> or <varargs.h>. 41 (struct diff_callbacks): Remove printf_output field. 42 * util.c: Include <stdarg.h> or <varargs.h>. 43 (printf_output): Use vasprintf and write_output callback rather 44 than printf_output callback. 45 * diff3.c (read_diff): Don't set my_callbacks.printf_output. 46 47Thu Jun 18 12:43:53 1998 Ian Lance Taylor <ian@cygnus.com> 48 49 * diffrun.h: New file. 50 * diff.h: Include diffrun.h. 51 (callbacks): New EXTERN variable. 52 (write_output, printf_output, flush_output): Declare. 53 * diff.c (diff_run): Add parameter callbacks_arg. Use callback 54 functions rather than writing to stdout. Don't open a file if 55 there is a write_output callback. Call perror_with_name rather 56 than perror. 57 (usage): Use callbacks if defined rather than writing to stdout. 58 (compare_files): Call flush_output rather than fflush (outfile). 59 * diff3.c: Include diffrun.h. Change several functions to use 60 output functions from util.c rather than direct printing. Use 61 diff_error and friends rather than printing to stderr. Set global 62 variable outfile. 63 (outfile, callbacks): Declare. 64 (write_output, printf_output, flush_output): Declare. 65 (diff3_run): Add parameter callbacks_arg. Use callback functions 66 rather than writing to stdout. 67 (usage): Use callbacks if defined rather than writing to stdout. 68 (read_diff): Preserve callbacks and outfile around call to 69 diff_run. 70 * util.c (perror_with_name): Use error callback if defined. 71 (pfatal_with_name, diff_error): Likewise. 72 (message5): Use printf_output and write_output. 73 (print_message_queue, print_1_line, output_1_line): Likewise. 74 (begin_output): Reject paginate_flag if there are output 75 callbacks. 76 (write_output, printf_output, flush_output): New functions. 77 * context.c: Change all output to outfile to use printf_output and 78 write_output. 79 * ed.c: Likewise. 80 * ifdef.c: Likewise. 81 * normal.c: Likewise. 82 * side.c: Likewise. 83 * Makefile.in (SOURCES): Add diffrun.h. 84 ($(OBJECTS)): Depend upon diffrun.h. 85 86Fri Jan 16 14:58:19 1998 Larry Jones <larry.jones@sdrc.com> 87 88 * diff.c, diff3.c: Plug memory leaks. 89 90Thu Jan 15 13:36:46 1998 Jim Kingdon <kingdon@harvey.cyclic.com> 91 92 * Makefile.in (installdirs): New rule, for when ../Makefile 93 recurses into this directory (bug reported by W. L. Estes). 94 95Tue Nov 11 10:48:19 1997 Jim Kingdon <kingdon@harvey.cyclic.com> 96 97 * diff.c (diff_run): Change #ifdef on HAVE_SETMODE to #if to match 98 the other uses (fixes compilation error on unix). 99 100 * diff.c (diff_run): Don't set stdout to binary mode. 101 102Mon, 10 Nov 1997 Jim Kingdon 103 104 * diff.c (run_diff): Open outfile in binary mode if --binary. 105 106Thu Nov 6 12:42:12 1997 Karl Fogel <kfogel@floss.red-bean.com> 107 and Paul Eggert <eggert@twinsun.com> 108 109 * analyze.c: applied Paul Eggert's patch to fix the diff3 merge 110 bug described in ccvs/doc/DIFFUTILS-2.7-BUG: 111 (shift_boundaries): new var `inhibit_hunk_merge'; use it to 112 control something important that I don't quite understand, but 113 Paul apparently does, so that's okay. 114 115Sat Nov 1 14:17:57 1997 Michael L.H. Brouwer <michael@thi.nl> 116 117 * Makefile.in: Add call to ranlib to build a table of contents for 118 the library since some systems seem to require this. 119 1201997-10-28 Jim Kingdon 121 122 * .cvsignore: Add files du jour for Visual C++, vc50.pdb and vc50.idb. 123 124 * system.h: Define HAVE_TIME_H. 125 * dir.c [_WIN32]: Define CLOSEDIR_VOID. 126 1271997-10-18 Jim Kingdon 128 129 * build_diff.com: Add diff3.c 130 131Fri Sep 26 14:24:42 1997 Tim Pierce <twp@twp.tezcat.com> 132 133 * diff.c (diff_run): Save old value of optind before calling 134 getopt_long, then restore before returning. Eventually it would 135 be nice if diff_run were fully reentrant. 136 137 New diff3 library for CVS. 138 * Makefile.in (SOURCES): Add diff3.c. 139 (OBJECTS): Add diff3.o. 140 * diff3.c: New file, copied from diffutils-2.7. See diffutils for 141 earlier ChangeLogs. Undefine initialize_main macro. Remove <signal.h>. 142 (diff3_run): Renamed from main(). Add `outfile' argument. Remove 143 SIGCLD handling; we do not fork. Save optind and reset to 0 144 before calling getopt_long; restore after option processing done. 145 (read_diff): Use diff_run with a temporary output file, 146 instead of forking a diff subprocess and reading from a pipe. 147 Change DIFF_PROGRAM to "diff"; this argument is now used only for 148 diagnostic reporting. 149 (xmalloc, xrealloc): Removed. 150 (diff_program): Removed. 151 (diff_program_name): Made extern, so it may be used in other 152 library calls like `error'. 153 (initialize_main): New function. 154 155 Namespace munging. util.c defines both fatal() and 156 perror_with_exit(), but these cannot be used to abort diff3: both 157 attempt to longjmp() to a buffer set in diff.c, used only by 158 diff_run. This is an awful solution, but necessary until the code 159 can be cleaned up. (These functions do not *have* to be renamed, 160 since both are declared static to diff3.c and should not clash 161 with libdiff.a, but it reduces potential confusion.) 162 * diff3.c (diff3_fatal): Renamed from fatal. 163 (diff3_perror_with_exit): Renamed from perror_with_exit. 164 165 Eliminate exit calls. 166 (try_help): Change from `void' to `int'. Return, do not exit. 167 (diff3_fatal, diff3_perror_with_exit, process_diff): Change `exit' 168 to DIFF3_ABORT. 169 (diff3_run): Initialize jump buffer for nonlocal exits. Change 170 exit calls to returns. Change `perror_with_exit' to 171 `perror_with_name' and add a return. Change `fatal' to 172 `diff_error' and add a return. The reasoning is that we shouldn't 173 rely on setjmp/longjmp any more than necessary. 174 175 Redirect stdout. 176 (check_output): Renamed from check_stdout. Take stream argument 177 instead of blindly checking stdout. Do not close stream, but 178 merely fflush it. 179 (diff3_run): Initialize outstream, and close when done. Pass this 180 stream (instead of stdout) to output_diff3_edscript, 181 output_diff3_merge, and output_diff3. 182 183Thu Sep 25 14:34:22 1997 Jim Kingdon <kingdon@harvey.cyclic.com> 184 185 * util.c (begin_output, finish_output): If PR_PROGRAM is not 186 defined (VMS), just give a fatal error if --paginate specified. 187 188 * Makefile.in (DISTFILES): Add ChangeLog build_diff.com 189 Makefile.in. 190 * build_diff.com: New file. 191 192Wed Sep 24 10:27:00 1997 Jim Kingdon <kingdon@harvey.cyclic.com> 193 194 * Makefile.in: Also set top_srcdir. Needed to make today's other 195 Makefile.in change work. 196 197 * .cvsignore: New file. 198 199 * Makefile.in (COMPILE): Add -I options for srcdir (perhaps 200 unneeded) and change -I option for lib to use top_srcdir (needed 201 to avoid mixups with CVS's regex.h vs. the system one). 202 203Sun Sep 21 19:44:42 1997 Jim Kingdon <kingdon@harvey.cyclic.com> 204 205 * Makefile.in (util.o): Change util.c to $<, needed for srcdir. 206 207Sat Sep 20 12:06:41 1997 Tim Pierce <twp@twp.tezcat.com> 208 209 New diff library for CVS, based on diffutils-2.7. See diffutils 210 for earlier ChangeLogs. 211 * Makefile.in, analyze.c, cmpbuf.c, cmpbuf.h, config.hin, 212 context.c, diagmeet.note, diff.c, diff.h, dir.c, ed.c, ifdef.c, 213 io.c, normal.c, side.c, stamp-h.in, system.h, util.c, version.c: 214 New files. 215 (COMPILE): Add -I../lib, so we can get getopt.h. 216 217 * Makefile.in: Removed anything not related to libdiff.a. 218 (dist-dir): New target, copied from ../lib/Makefile.in. 219 (DISTFILES): New variable. 220 (SOURCES): Renamed from `srcs'. 221 (OBJECTS): Renamed from `libdiff_o'. 222 (Makefile): Changed dependencies to reflect 223 new, shallow config directory structure. 224 (stamp-h.in, config.h.in, config.h, stamp-h): Removed. 225 * stamp-h.in, config.h.in: Removed. 226 227 * system.h: Remove dup2 macro (provided by ../lib/dup2.c). 228 Include stdlib.h if STDC_HEADERS is defined (not just 229 HAVE_STDLIB_H). 230 231Sat Sep 20 05:32:18 1997 Tim Pierce <twp@twp.tezcat.com> 232 233 Diff librarification. 234 235 * diff.c (diff_run): New function, renamed from `main'. 236 Initialize `outfile' based on the value of the new `out' filename 237 argument. 238 (initialize_main): New function. 239 * system.h: Removed initialize_main macro. 240 * diffmain.c: New file. 241 * Makefile.in (diff): Added diffmain.o. 242 (libdiff): New target. 243 (AR, libdiff_o): New variables. libdiff_o does not include 244 xmalloc.o, fnmatch.o, getopt.o, getopt1.o, regex.o or error.o, 245 because these functions are already present in CVS. It will take 246 some work to make this more general-purpose. 247 248 Redirect standard output. 249 * util.c: Redirect stdout to outfile: change all naked `printf' 250 and `putchar' statements to `fprintf (outfile)' and `putc (..., 251 outfile)' throughout. This should permit redirecting diff output 252 by changing `outfile' just once in `diff_run'. 253 (output_in_progress): New variable. 254 (begin_output, finish_output): Use `output_in_progress', rather than 255 `outfile', as a semaphore to avoid reentrancy problems. 256 (finish_output): Close `outfile' only if paginate_flag is set. 257 * diff.c (check_output): New function, was check_stdout. Take a 258 `file' argument, and flush it instead of closing it. 259 (diff_run): Change check_stdout to check_output. 260 (compare_files): Fflush outfile, not stdout. 261 262 Eliminate exit statements. 263 * diff.h: Include setjmp.h. 264 (diff_abort_buf): New variable. 265 (DIFF_ABORT): New macro. 266 * diff.c (diff_run): Change all `exit' statements to `return'. 267 Set up diff_abort_buf, so we can abort diff without 268 terminating (for libdiff.a). 269 (try_help): Return int instead of void; do not exit. 270 * util.c (fatal): Use DIFF_ABORT instead of exit. 271 (pfatal_with_name): Use DIFF_ABORT instead of exit. 272 273 Namespace cleanup (rudimentary). Strictly speaking, this is not 274 necessary to make diff into a library. However, namespace 275 clashes between diff and CVS must be resolved immediately, since 276 CVS is the first application targeted for use with difflib. 277 278 * analyze.c, diff.c, diff.h, util.c (diff_error): Renamed from `error'. 279 280 * version.c, diff.c, diff.h, cmp.c, diff3.c, sdiff.c 281 (diff_version_string): Renamed from version_string. 282 * diff.c, util.c, diff.h, diff3.c, error.c (diff_program_name): 283 Renamed from program_name. 284 285 * util.c (xmalloc, xrealloc): Removed. 286 * Makefile.in (diff_o): Added error.o and xmalloc.o. 287 288