home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / alt / sources / 2884 < prev    next >
Encoding:
Internet Message Format  |  1992-12-25  |  50.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!utgpu!attcan!sobeco!philmtl!altitude!matrox!IRO.UMontreal.CA!pinard
  2. From: pinard@IRO.UMontreal.CA (Francois Pinard)
  3. Newsgroups: alt.sources
  4. Subject: wdiff - Patch 4, Part (1/3) - brings 0.03 to 0.04
  5. Message-ID: <PINARD.92Dec24003117@kovic.IRO.UMontreal.CA>
  6. Date: 24 Dec 92 05:31:17 GMT
  7. Sender: news@IRO.UMontreal.CA
  8. Distribution: alt
  9. Organization: Universite' de Montre'al
  10. Lines: 1444
  11.  
  12. ---- Cut Here and feed the following to sh ----
  13. #!/bin/sh
  14. # This is a shell archive (produced by shar 3.49)
  15. # To extract the files from this archive, save it to a file, remove
  16. # everything above the "!/bin/sh" line above, and type "sh file_name".
  17. #
  18. # made 12/24/1992 05:24 UTC by pinard@kovic.IRO.UMontreal.CA
  19. # Source directory /home/kovic/pinard/pub
  20. #
  21. # existing files will NOT be overwritten unless -c is specified
  22. #
  23. # This is part 1 of a multipart archive                                    
  24. # do not concatenate these parts, unpack them in order with /bin/sh        
  25. #
  26. # This shar contains:
  27. # length  mode       name
  28. # ------ ---------- ------------------------------------------
  29. # 137819 -rw-r----- Patch4
  30. #
  31. if test -r _shar_seq_.tmp; then
  32.     echo 'Must unpack archives in sequence!'
  33.     echo Please unpack part `cat _shar_seq_.tmp` next
  34.     exit 1
  35. fi
  36. # ============= Patch4 ==============
  37. if test -f 'Patch4' -a X"$1" != X"-c"; then
  38.     echo 'x - skipping Patch4 (File already exists)'
  39.     rm -f _shar_wnt_.tmp
  40. else
  41. > _shar_wnt_.tmp
  42. echo 'x - extracting Patch4 (Text)'
  43. sed 's/^X//' << 'SHAR_EOF' > 'Patch4' &&
  44. X--- wdiff-0.03/ChangeLog    Tue Aug 18 06:34:23 1992
  45. X+++ wdiff-0.04/ChangeLog    Wed Dec 23 21:05:19 1992
  46. X@@ -1,3 +1,203 @@
  47. X+Wed Dec 23 11:10:32 1992  Francois Pinard  (pinard at icule)
  48. X+
  49. X+    From Thorsten Ohl <ohl@physics.harvard.edu>:
  50. X+    * wdiff.c (split_file_into_words): Call tmpnam just before opening
  51. X+    the file.  On the Next, successive calls to tmpnam will return
  52. X+    different values only if the file is opened in between.
  53. X+    (main): Allocate temp_name statically, and initialize it to "".
  54. X+    On certain systems, tmpnam(NULL) causes a segmentation violation.
  55. X+    Length will be L_tmpman or else, PATH_MAX+1 from pathmax.h.  Check
  56. X+    temp_name before unlinking, in case of an intervening signal.
  57. X+    * pathmax.h: New, from elsewhere.
  58. X+    * Makefile.in: Distribute pathmax.h, adjust dependencies.
  59. X+    * xstrdup.c, xmalloc.c: Deleted, not needed anymore.
  60. X+
  61. X+    * Makefile.in: Some cleanup before the release.
  62. X+    * (dvi, wdiff.dvi): New goals.
  63. X+    * (_wdiff.o): Use -I$(srcdir).
  64. X+
  65. X+    From Thorsten Ohl <ohl@physics.harvard.edu>:
  66. X+    * wdiff.c: Added two missing `break;'.
  67. X+
  68. X+    * check_it: New script, using test data from a bug report by
  69. X+    Robert J. Chassell <bob@gnu.ai.mit.edu>.
  70. X+    * testinput1, testinput2, testoutput: Deleted.
  71. X+    * Makefile.in: Adjusted.
  72. X+
  73. X+Tue Dec 22 00:02:41 1992  Francois Pinard  (pinard at icule)
  74. X+
  75. X+    * Makefile.in: Remove $(CPPDEFS) from the implicit rules.
  76. X+
  77. X+Mon Dec 21 23:24:39 1992  Francois Pinard  (pinard at icule)
  78. X+
  79. X+    * Makefile.in: Distribute the THANKS file.
  80. X+
  81. X+    From Colin Brough <cmb@epcc.ed.ac.uk>:
  82. X+    * wdiff.1: New for 0.04, replaces the previous copy.
  83. X+    * Makefile.in: Install the man page.
  84. X+
  85. X+    Makefile.in: Do not distribute collate.el, which lacks the
  86. X+    required Copyright assignment to the FSF.
  87. X+
  88. X+Wed Dec  9 08:43:47 1992  Francois Pinard  (pinard at icule)
  89. X+
  90. X+    * From David D `zoo' Zuhn <zoo@cygnus.com>:
  91. X+    configure.in, wdiff.c: Replace USG by HAVE_STRING_H.
  92. X+
  93. X+    * From David D `zoo' Zuhn <zoo@cygnus.com>:
  94. X+    Makefile.in (configure): Go to $(srcdir) before autoconf.
  95. X+
  96. X+Sat Dec  5 15:45:25 1992  Francois Pinard  (pinard at icule)
  97. X+
  98. X+    * wdiff.c: Initialize the version[] string.
  99. X+    * version.c: Deleted.
  100. X+    * Makefile.in: Adjusted.
  101. X+
  102. X+    * From Paul Eggert <eggert@twinsun.com>:
  103. X+    readpipe.c: Beware that file descriptor 1 might not be opened.
  104. X+    writepipe.c: Beware that file descriptor 0 might not be opened.
  105. X+
  106. X+    * From David D `zoo' Zuhn <zoo@cygnus.com>:
  107. X+    Makefile.in: Define MAKEINFO as makeinfo, use it.
  108. X+
  109. X+    * From Karl Berry <karl@cs.umb.edu>:
  110. X+    Makefile.in (realclean): Remove wdiff.info.
  111. X+
  112. X+    Makefile.in (realclean): Remove configure.
  113. X+
  114. X+    * From Karl Berry <karl@cs.umb.edu>:
  115. X+    configure.in: Use AC_ISC_POSIX for defining -posix if necessary.
  116. X+
  117. X+Sat Nov 28 12:13:04 1992  Francois Pinard  (pinard at icule)
  118. X+
  119. X+    * From Pierre Gaumond <gaumondp@ere.umontreal.ca>:
  120. X+    Makefile.in (clean, distclean): Remove clutter for ansi2knr.
  121. X+
  122. X+    * Makefile.in (texclean): New.
  123. X+
  124. X+    * Makefile.in (check): Add a `Check successful' message.
  125. X+
  126. X+    From Colin M. Brough <cmb@epcc.ed.ac.uk>:
  127. X+    * wdiff.1: New.  This man page reflects wdiff at 0.03 level.
  128. X+    * Makefile.in: Distribute it.
  129. X+
  130. X+Mon Nov 23 08:48:41 1992  Francois Pinard  (pinard at icule)
  131. X+
  132. X+    * Makefile.in (dist): Get .fname from the current directory name,
  133. X+    instead of from version.c.  I need updating many files manually,
  134. X+    when the version changes, version.c is just one of them.
  135. X+
  136. X+    * cbars.sh: New.  By default, cbars is not part of PROGS.
  137. X+    * Makefile.in: Prepare, install, and distribute it.
  138. X+
  139. X+Sun Nov 22 08:54:43 1992  Francois Pinard  (pinard at icule)
  140. X+
  141. X+    From Per Cederqvist <ceder@lysator.liu.se>:
  142. X+    * wdiff.c (usage_and_exit): Use OLD_FILE and NEW_FILE in usage
  143. X+    message, instead of FILE_1 and FILE_2.
  144. X+
  145. X+    From Richard Stallman <rms@prep.ai.mit.edu>:
  146. X+    * Never launch pager by default.  So, I'm adding option -a.
  147. X+
  148. X+    * wdiff.c: New -a option and autopager variable.
  149. X+    (main): Initialize and decode it.
  150. X+    (usage_and_exit): Announce it.
  151. X+    (launch_output_program): Implement it.
  152. X+
  153. X+    * wdiff.c: New -l option.
  154. X+    Rename pager_is_less to overstrike_for_less.
  155. X+    (main): Initialized and decode it.
  156. X+    (usage_and_exit): Announce it.
  157. X+    * wdiff.c: Rename is_printer to overstrike.
  158. X+    * wdiff.c: Rename is_display to find_termcap.
  159. X+    (main): Delay its initialization, so -l can force it to 0.
  160. X+
  161. X+    From Joe Wells <jbw@cs.bu.edu>:
  162. X+    * wdiff.c: New -n option and no_wrapping variable.
  163. X+    (main): Initialize and decode it.
  164. X+    (usage_and_exit): Announce it.
  165. X+    (copy_whitespace): Implement it.
  166. X+
  167. X+Sat Nov 21 16:35:15 1992  Francois Pinard  (pinard at icule)
  168. X+
  169. X+    * configure.in: Use AC_CONST.
  170. X+    * wdiff.c: Never define const as empty, let configure do it.  Also
  171. X+    remove volatile declaration as empty, it is unused.
  172. X+    * wdiff.c, version.c: Add a few const's.
  173. X+
  174. X+    From Roland McGrath <roland@gnu.ai.mit.edu>:
  175. X+    * wdiff.c: Remove `const' to `char *strstr();' declaration.
  176. X+
  177. X+    From Jim Meyering <meyering@cs.utexas.edu>:
  178. X+    * configure.in: Avoid gdiff for X as found on SGI systems.  The
  179. X+    test presumes gdiff returns non-zero status if DISPLAY is defined
  180. X+    to be empty.
  181. X+
  182. X+Thu Nov 19 10:29:20 CST 1992  Jim Meyering  (meyering@idefix.comco.com)
  183. X+
  184. X+    * configure.in: Add AC_UNISTD_H.  Fix test for ANSI-ness.
  185. X+
  186. X+    * readpipe.c writepipe.c: Include unistd.h.
  187. X+    Parenthesize assignment used in boolean context.
  188. X+
  189. X+    * version.c: Remove copyright and print_copyright.
  190. X+
  191. X+    * wdiff.c: Add declaration of error.
  192. X+    (print_copyright): Moved copyright stuff here and declared static.
  193. X+    (reformat_diff_output): Add a do-nothing case for COPY_NORMAL
  194. X+    and a default that aborts to avoid warnings form gcc -Wall.
  195. X+    (complete_output_program): Add a default clause that aborts
  196. X+    to avoid warnings form gcc -Wall.
  197. X+
  198. X+Wed Nov 18 09:28:12 1992  Jim Meyering  (meyering@idefix.comco.com)
  199. X+
  200. X+    * Makefile.in: Add another layer of double quotes so PAGER
  201. X+    and DIFF may contain spaces.  Before, with PAGER='less -i'
  202. X+    compilation failed with unterminated string.
  203. X+
  204. X+Tue Nov 17 18:47:23 1992  Francois Pinard  (pinard at icule)
  205. X+
  206. X+    From Larry W. Virden <lvirden@cas.org>:
  207. X+    * Makefefile.in (check): Warn that `exit status 1' is expected.
  208. X+
  209. X+Fri Nov 13 00:01:25 1992  Francois Pinard  (pinard at icule)
  210. X+
  211. X+    * Makefile.in (dist): chmod a+r before making the tar file.
  212. X+
  213. X+    * aclocal.m4: Update FP_STDC_CHECK, replacing by FP_PROTOTYPES.
  214. X+    * configure.in: Adjust accordingly.
  215. X+
  216. X+Tue Oct  6 12:55:10 1992  Francois Pinard  (pinard at icule)
  217. X+
  218. X+    * Makefile.in: Use exec_prefix.  Add `uninstall'.
  219. X+
  220. X+Sun Aug 23 08:30:30 1992  Francois Pinard  (pinard at icule)
  221. X+
  222. X+    * configure.in: Split FP_STDC_CHECK out into aclocal.m4.
  223. X+    * aclocal.m4: New.
  224. X+    * Makefile.in: Distribute aclocal.m4.
  225. X+
  226. X+Thu Aug 20 08:13:12 1992  Francois Pinard  (pinard at icule)
  227. X+
  228. X+    * wdiff.c: With STDC_HEADERS, use <string.h>, not <strings.h>.
  229. X+
  230. X+Wed Aug 19 11:45:52 1992  Francois Pinard  (pinard at icule)
  231. X+
  232. X+    From James Ganong <jeg@ced.berkeley.edu>:
  233. X+    * collatew.el: New, generalizes Emacs LISP `compage-windows'.
  234. X+    * Makefile.in: Distribute collatew.el.
  235. X+
  236. X+    * configure.in: To define DIFF, also try gnudiff and diffgnu, not
  237. X+    only gdiff and diff.
  238. X+
  239. X+    * ansi2knr.c: New, from Ghostscript distribution.
  240. X+    * unproto.l: Deleted.
  241. X+    * Makefile.in: Use ansi2knr instead of unproto.
  242. X+    * configure.in: Do not check anymore for `lex' or bad `const's.
  243. X+    * wdiff.c: Undefine `const' and `volatile' if not __STDC__.
  244. X+
  245. X+    * wdiff.c: Do not declare tgetstr without HAVE_TPUTS.
  246. X+
  247. X Tue Aug 18 03:57:06 1992  Francois Pinard  (pinard at icule)
  248. X     * Version 0.03 released to alt.sources and ftp.uu.net:/tmp.
  249. X@@ -29,7 +229,7 @@
  250. X Sun Aug 16 09:28:50 1992  Francois Pinard  (pinard at icule)
  251. X     * wdiff.c (usage_and_exit): Added -s description.
  252. X-
  253. X+
  254. X Sat Aug 15 09:27:31 1992  Francois Pinard  (pinard at icule)
  255. X     * Version 0.02 released to alt.sources and ftp.uu.net:/tmp.
  256. X@@ -64,7 +264,7 @@
  257. X     * wdiff.c: Declare tgetstr if <termcap.h> not included.
  258. X     * Makefile.in: Have check goal works, now that -d is gone.
  259. X-
  260. X+
  261. X Wed Aug 12 01:01:37 1992  Francois Pinard  (pinard at icule)
  262. X     * Version 0.01 released to alt.sources and ftp.uu.net:/tmp.
  263. X@@ -80,7 +280,7 @@
  264. X     * writepipe.c: New, provided by David Mackenzie.
  265. X     * configure.in: Try defining PAGER to less or more.  Also use our
  266. X     strstr if necessary.
  267. X-    * Makefile.in: Transmit PAGER to program.  Also Handle strstr.c.
  268. X+    * Makefile.in: Transmit PAGER to program.  Also handle strstr.c.
  269. X     * configure.in: Try defining DIFF to gdiff or diff.
  270. X     * Makefile.in: Transmit DIFF to wdiff.c, which handles it already.
  271. X@@ -95,7 +295,7 @@
  272. X     * COPYING.LIB: New.
  273. X     * Makefile.in: Distributing COPYING.LIB.
  274. X-
  275. X+
  276. X Tue Aug 11 15:10:37 1992  Francois Pinard  (pinard at icule)
  277. X     * Version 0.0 released to alt.sources.
  278. X--- wdiff-0.03/INSTALL    Fri Jun 19 15:07:44 1992
  279. X+++ wdiff-0.04/INSTALL    Wed Oct 14 14:28:51 1992
  280. X@@ -15,32 +15,37 @@
  281. X directory).  In some packages it creates a C header file containing
  282. X system-dependent definitions.  It also creates a file `config.status'
  283. X that you can run in the future to recreate the current configuration.
  284. X-Running `configure' takes a minute or two.
  285. X+Running `configure' takes a minute or two.  While it is running, it
  286. X+prints some messages that tell what it is doing.  If you don't want to
  287. X+see the messages, run `configure' with its standard output redirected
  288. X+to `/dev/null'; for example, `./configure >/dev/null'.
  289. X+
  290. X To compile the package in a different directory from the one
  291. X containing the source code, you must use a version of make that
  292. X supports the VPATH variable, such as GNU make.  `cd' to the directory
  293. X where you want the object files and executables to go and run
  294. X-`configure' with the option `--srcdir=DIR', where DIR is the directory
  295. X-that contains the source code.  Using this option is actually
  296. X-unnecessary if the source code is in the parent directory of the one
  297. X-in which you are compiling; `configure' automatically checks for the
  298. X-source code in `..' if it does not find it in the current directory.
  299. X+`configure'.  `configure' automatically checks for the source code in
  300. X+the directory that `configure' is in and in `..'.  If for some reason
  301. X+`configure' is not in the source code directory that you are
  302. X+configuring, then it will report that it can't find the source code.
  303. X+In that case, run `configure' with the option `--srcdir=DIR', where
  304. X+DIR is the directory that contains the source code.
  305. X By default, `make install' will install the package's files in
  306. X /usr/local/bin, /usr/local/lib, /usr/local/man, etc.  You can specify
  307. X an installation prefix other than /usr/local by giving `configure' the
  308. X-option `--prefix=PATH'.  Alternately, you can do so by changing the
  309. X-`prefix' variable in the Makefile that `configure' creates (the
  310. X-Makefile in the top-level directory, if the package contains
  311. X-subdirectories).
  312. X+option `--prefix=PATH'.  Alternately, you can do so by giving a value
  313. X+for the `prefix' variable when you run `make', e.g.,
  314. X+    make prefix=/usr/gnu
  315. X You can specify separate installation prefixes for
  316. X architecture-specific files and architecture-independent files.  If
  317. X-you give `configure' the option `--exec_prefix=PATH', the package will
  318. X-use PATH as the prefix for installing programs and libraries.  Data
  319. X-files and documentation will still use the regular prefix.  Normally,
  320. X-all files are installed using the regular prefix.
  321. X+you give `configure' the option `--exec_prefix=PATH' or set the
  322. X+`make' variable `exec_prefix' to PATH, the package will use PATH as
  323. X+the prefix for installing programs and libraries.  Data files and
  324. X+documentation will still use the regular prefix.  Normally, all files
  325. X+are installed using the regular prefix.
  326. X You can tell `configure' to figure out the configuration for your
  327. X system, and record it in `config.status', without actually configuring
  328. X@@ -47,8 +52,10 @@
  329. X the package (creating `Makefile's and perhaps a configuration header
  330. X file).  To do this, give `configure' the `--no-create' option.  Later,
  331. X you can run `./config.status' to actually configure the package.  This
  332. X-option is useful mainly in `Makefile' rules for updating
  333. X-`config.status' and `Makefile'.
  334. X+option is useful mainly in `Makefile' rules for updating `config.status'
  335. X+and `Makefile'.  You can also give `config.status' the `--recheck'
  336. X+option, which makes it re-run `configure' with the same arguments you
  337. X+used before.  This is useful if you change `configure'.
  338. X `configure' ignores any other arguments that you give it.
  339. X@@ -75,9 +82,9 @@
  340. X LIBS        Libraries to link with, in the form `-lfoo -lbar ...'
  341. X If you need to do unusual things to compile the package, we encourage
  342. X-you to teach `configure' how to do them and mail the diffs to the
  343. X-address given in the README so we can include them in the next
  344. X-release.
  345. X+you to figure out how `configure' could check whether to do them, and
  346. X+mail diffs or instructions to the address given in the README so we
  347. X+can include them in the next release.
  348. X 2.  Type `make' to compile the package.  If you want, you can override
  349. X the `make' variables CFLAGS and LDFLAGS like this:
  350. X@@ -84,10 +91,16 @@
  351. X     make CFLAGS=-O2 LDFLAGS=-s
  352. X-3.  Type `make install' to install programs, data files, and
  353. X+3.  If the package comes with self-tests and you want to run them,
  354. X+type `make check'.  If you're not sure whether there are any, try it;
  355. X+if `make' responds with something like
  356. X+    make: *** No way to make target `check'.  Stop.
  357. X+then the package does not come with self-tests.
  358. X+
  359. X+4.  Type `make install' to install programs, data files, and
  360. X documentation.
  361. X-4.  You can remove the program binaries and object files from the
  362. X+5.  You can remove the program binaries and object files from the
  363. X source directory by typing `make clean'.  To also remove the
  364. X Makefile(s), the header file containing system-dependent definitions
  365. X (if the package uses one), and `config.status' (all the files that
  366. X--- wdiff-0.03/Makefile.in    Tue Aug 18 06:38:00 1992
  367. X+++ wdiff-0.04/Makefile.in    Wed Dec 23 20:54:10 1992
  368. X@@ -15,118 +15,138 @@
  369. X # along with this program; if not, write to the Free Software
  370. X # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  371. X+SHELL = /bin/sh
  372. X+
  373. X #### Start of system configuration section. ####
  374. X srcdir = @srcdir@
  375. X VPATH = @srcdir@
  376. X+U = @U@
  377. X CC = @CC@
  378. X DIFF = @DIFF@
  379. X-LEX = @LEX@
  380. X PAGER = @PAGER@
  381. X-
  382. X INSTALL = @INSTALL@
  383. X INSTALL_PROGRAM = @INSTALL_PROGRAM@
  384. X INSTALL_DATA = @INSTALL_DATA@
  385. X+MAKEINFO = makeinfo
  386. X+TEXI2DVI = texi2dvi
  387. X-U = @U@
  388. X DEFS = @DEFS@
  389. X-PROGDEFS = -DDIFF_PROGRAM=\"$(DIFF)\" -DPAGER_PROGRAM=\"$(PAGER)\"
  390. X+PROGDEFS = -DDIFF_PROGRAM="\"$(DIFF)\"" -DPAGER_PROGRAM="\"$(PAGER)\""
  391. X+CFLAGS = -g
  392. X+LDFLAGS = -g
  393. X LIBS = @LIBS@
  394. X LIBOBJS = @LIBOBJS@
  395. X-CFLAGS = -g -I$(srcdir)
  396. X-LDFLAGS = -g
  397. X-
  398. X prefix = /usr/local
  399. X exec_prefix = $(prefix)
  400. X-
  401. X bindir = $(exec_prefix)/bin
  402. X infodir = $(prefix)/info
  403. X+mandir = $(prefix)/man/man1
  404. X+manext = .1
  405. X-#### End of system configuration section. ####
  406. X+# You might add cbars to PROGS if you feel like it.
  407. X+PROGS = wdiff
  408. X-SHELL = /bin/sh
  409. X+#### End of system configuration section. ####
  410. X-SRCS = wdiff.c version.c readpipe.c writepipe.c \
  411. X-error.c getopt.c getopt1.c xmalloc.c xstrdup.c alloca.c strstr.c
  412. X-OBJS = $Uwdiff.o $Uversion.o readpipe.o writepipe.o \
  413. X-error.o getopt.o getopt1.o xmalloc.o xstrdup.o $(ALLOCA) $(LIBOBJS)
  414. X-HDRS = getopt.h
  415. X-DISTFILES = README COPYING COPYING.LIB INSTALL ChangeLog Makefile.in \
  416. X-$(SRCS) $(HDRS) configure configure.in testinput1 testinput2 testoutput \
  417. X-wdiff.texi gpl.texinfo texinfo.tex wdiff.info c-boxes.el unproto.l
  418. X+.c.o:
  419. X+    $(CC) -c -I$(srcdir) $(CFLAGS) $(DEFS) $<
  420. X+HEADERS = getopt.h pathmax.h
  421. X+SOURCES = wdiff.c readpipe.c writepipe.c \
  422. X+error.c getopt.c getopt1.c alloca.c strstr.c
  423. X+OBJECTS = $Uwdiff.o readpipe.o writepipe.o \
  424. X+error.o getopt.o getopt1.o $(ALLOCA) $(LIBOBJS)
  425. X+DISTFILES = README NEWS TODO THANKS COPYING INSTALL ChangeLog \
  426. X+configure.in aclocal.m4 Makefile.in ansi2knr.c \
  427. X+$(HEADERS) $(SOURCES) cbars.sh c-boxes.el check_it \
  428. X+wdiff.texi gpl.texinfo texinfo.tex wdiff.1 \
  429. X+configure wdiff.info
  430. X-all: wdiff wdiff.info
  431. X+all: $(PROGS)
  432. X-.c.o:
  433. X-    $(CC) -c $(CFLAGS) $(CPPFLAGS) $(DEFS) $<
  434. X+wdiff: $(OBJECTS)
  435. X+    $(CC) $(LDFLAGS) -o wdiff $(OBJECTS) $(LIBS)
  436. X $Uwdiff.o: $Uwdiff.c
  437. X-    $(CC) -c $(CFLAGS) $(CPPFLAGS) $(DEFS) $(PROGDEFS) $<
  438. X-
  439. X-install: all
  440. X-    $(INSTALL_PROGRAM) wdiff $(bindir)/wdiff
  441. X-    -$(INSTALL_DATA) $(srcdir)/wdiff.info $(infodir)/wdiff.info
  442. X-
  443. X-wdiff: $(OBJS)
  444. X-    $(CC) $(LDFLAGS) -o wdiff $(OBJS) $(LIBS)
  445. X+    $(CC) -c -I$(srcdir) $(CFLAGS) $(DEFS) $(PROGDEFS) $<
  446. X     
  447. X-wdiff.o getopt.o getopt1.o: getopt.h
  448. X+$Uwdiff.o: getopt.h pathmax.h
  449. X+getopt.o getopt1.o: getopt.h
  450. X-_wdiff.c: wdiff.c unproto
  451. X-    ./unproto < $(srcdir)/wdiff.c > _wdiff.c
  452. X+ansi2knr: ansi2knr.c
  453. X+    $(CC) $(CFLAGS) $(DEFS) -o ansi2knr $(srcdir)/ansi2knr.c
  454. X+_wdiff.c: wdiff.c ansi2knr
  455. X+    ./ansi2knr $(srcdir)/wdiff.c > _wdiff.c
  456. X-_version.c: version.c unproto
  457. X-    ./unproto < $(srcdir)/version.c > _version.c
  458. X+cbars: cbars.sh
  459. X+    sed -e 's|<bindir>|$(bindir)|' cbars.sh > cbars
  460. X-unproto: unproto.l
  461. X-    $(LEX) $(srcdir)/unproto.l
  462. X-    $(CC) $(CFLAGS) -o unproto lex.yy.c
  463. X-    rm -f yy.lex.c
  464. X+info: wdiff.info
  465. X wdiff.info: wdiff.texi
  466. X-    makeinfo -o wdiff.info $(srcdir)/wdiff.texi
  467. X+    $(MAKEINFO) -o wdiff.info $(srcdir)/wdiff.texi
  468. X-check: wdiff
  469. X-    -./wdiff $(srcdir)/testinput1 $(srcdir)/testinput2 > test.out
  470. X-    @echo
  471. X-    @echo Expect no output from following diff:
  472. X-    @echo
  473. X-    diff $(srcdir)/testoutput test.out
  474. X-    rm -f test.out
  475. X+dvi: wdiff.dvi
  476. X-Makefile: Makefile.in config.status
  477. X-    ./config.status
  478. X+wdiff.dvi: wdiff.texi
  479. X+    $(TEXI2DVI) $(srcdir)/wdiff.texi
  480. X-config.status: configure
  481. X-    $(srcdir)/configure --no-create
  482. X+check: wdiff
  483. X+    $(srcdir)/check_it
  484. X-configure: configure.in
  485. X-    autoconf
  486. X+install: wdiff wdiff.info
  487. X+    for file in $(PROGS); do \
  488. X+      $(INSTALL_PROGRAM) $$file $(bindir)/$$file; \
  489. X+    done
  490. X+    $(INSTALL_DATA) $(srcdir)/wdiff.info $(infodir)/wdiff.info
  491. X+    -$(INSTALL_DATA) $(srcdir)/wdiff.1 $(mandir)/wdiff$(manext)
  492. X+
  493. X+uninstall:
  494. X+    for file in $(PROGS); do \
  495. X+      rm -f $(bindir)/$$file; \
  496. X+    done
  497. X+    rm -f $(infodir)/wdiff.info $(mandir)/wdiff$(manext)
  498. X+
  499. X+tags: TAGS
  500. X+
  501. X+TAGS: $(HEADERS) $(SOURCES)
  502. X+    etags $(HEADERS) $(SOURCES)
  503. X-TAGS: $(SRCS)
  504. X-    etags $(SRCS)
  505. X+texclean:
  506. X+    rm -f *.aux *.cp *.dvi *.fn *.ky *.log *.pg *.toc *.tp *.vr
  507. X-clean:
  508. X-    rm -f wdiff *.o core test.out
  509. X+mostlyclean: texclean
  510. X+    rm -f *.o *.elc core test.out *~
  511. X-mostlyclean: clean
  512. X+clean: mostlyclean
  513. X+    rm -f $(PROGS) _*.c
  514. X distclean: clean
  515. X-    rm -f Makefile config.status
  516. X+    rm -f Makefile config.status ansi2knr TAGS
  517. X realclean: distclean
  518. X-    rm -f TAGS
  519. X+    rm -f wdiff.info
  520. X dist: $(DISTFILES)
  521. X-    echo wdiff-`sed -e '/version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
  522. X+    echo `pwd` | sed 's|.*/||' > .fname
  523. X     rm -rf `cat .fname`
  524. X     mkdir `cat .fname`
  525. X     ln $(DISTFILES) `cat .fname`
  526. X+    chmod -R a+r `cat .fname`
  527. X     tar chZf `cat .fname`.tar.Z `cat .fname`
  528. X     rm -rf `cat .fname` .fname
  529. X+
  530. X+Makefile: Makefile.in config.status
  531. X+    ./config.status
  532. X+
  533. X+config.status: configure
  534. X+    $(srcdir)/configure --no-create
  535. X+
  536. X+configure: configure.in aclocal.m4
  537. X+    cd $(srcdir); autoconf
  538. X # Prevent GNU make v3 from overflowing arg limit on SysV.
  539. X .NOEXPORT:
  540. X--- wdiff-0.03/NEWS
  541. X+++ wdiff-0.04/NEWS    Mon Dec 21 23:49:05 1992
  542. X@@ -0,0 +1,37 @@
  543. X+GNU wdiff NEWS - User visible changes.
  544. X+Copyright (C) 1992 Free Software Foundation, Inc.
  545. X+Francois Pinard <pinard@iro.umontreal.ca>, 1992.
  546. X+
  547. X+Version 0.04 - 21 December 1992, by Franc,ois Pinard
  548. X+
  549. X+* Add -a for automatic pager call, disallow this by default.
  550. X+* Add -l for less-like overstriking.
  551. X+* Add -n to forbid wrapping of differences.
  552. X+* New cbars script for producing change bars.
  553. X+* man page for wdiff 0.04.  Contributed and supported by contributor.
  554. X+
  555. X+
  556. X+Version 0.03 - 18 August 1992, by Franc,ois Pinard
  557. X+
  558. X+* Provide more useful exit codes.
  559. X+* Increase portability.
  560. X+
  561. X+
  562. X+Version 0.02 - 15 August 1992, by Franc,ois Pinard
  563. X+
  564. X+* Avoid calling pager if PAGER is in environment, but empty.
  565. X+* Correct disposition problems, and avoid useless overstrikes.
  566. X+* Add -s for statistics.
  567. X+
  568. X+
  569. X+Version 0.01 - 12 August 1992, by Franc,ois Pinard
  570. X+
  571. X+* Rename old -1234 into -wxyz for selecting strings.
  572. X+* Add new -123 resembling comm, delete -d.
  573. X+* Automatically pipe through `more' or `less' when writing to terminal.
  574. X+
  575. X+
  576. X+Version 0.00 - 11 August 1992, by Franc,ois Pinard
  577. X+
  578. X+* Initial release.
  579. X+
  580. X--- wdiff-0.03/README    Tue Aug 18 06:19:57 1992
  581. X+++ wdiff-0.04/README    Wed Dec 23 21:05:55 1992
  582. X@@ -1,67 +1,152 @@
  583. X-README file for wdiff, last updated August 18, 1992.
  584. X+README file for GNU wdiff, last updated December 21, 1992.
  585. X Copyright (C) 1992 Free Software Foundation, Inc.
  586. X+Written by Francois Pinard <pinard@iro.umontreal.ca>.
  587. X-Subject: wdiff 0.0 - Patch 3 (brings 0.02 to 0.03)
  588. X+Subject: Release of GNU wdiff, version 0.04
  589. X+Subject: GNU wdiff 0.0 - Patch 4, brings 0.03 to 0.04
  590. X-Here is the version 0.03 test release of `wdiff'.  All reported bugs
  591. X-in previous test releases have been fixed.  Some bugs surely remain.
  592. X-Your feedback will help me to make `wdiff' better and more portable.
  593. X-Thanks to all those who contributed comments or suggestions.
  594. X-
  595. X-The program `wdiff' is a front end to `diff' for comparing files on a
  596. X-word per word basis.  A word is anything between whitespace.  This
  597. X-program is particularily useful for comparing two texts in which a few
  598. X-words have been changed and for which paragraphs have been refilled.
  599. X-`wdiff' is free software.  See files COPYING and COPYING.LIB for
  600. X-copying conditions.
  601. X-
  602. X-This program does not require `termcap', but takes advantage of it.
  603. X-If your system does not have termcap, you might feel like getting and
  604. X-installing GNU termcap first.  Grab termcap-1.0.tar.Z in /pub/gnu from
  605. X-prep.ai.mit.edu.  *If* you do not have an ANSI-C compiler, you might
  606. X-still install `wdiff', BUT YOU NEED TO INSTALL FLEX FIRST.  Get a copy
  607. X-of flex-2.3.7.tar.Z in /pub/gnu from prep.ai.mit.edu.
  608. X-
  609. X-This version improves the previous one in the following areas:
  610. X-
  611. X-* Exit code values like diff's: 0=identical, 1=differs, 2=others.
  612. X-* Provide alloca.c for those lacking it.
  613. X-* Provide unproto.l, which can help compiling with non-ANSI compilers.
  614. X-* Other portability glitches, thanks to all those who wrote.
  615. X-
  616. X-If a patch follows later in this file, apply it to wdiff-0.02 to get
  617. X-wdiff-0.03.  It is a unified diff, you can apply it using a recent
  618. X-version of the `patch' program, like patch-2.0.12u7.tar.Z in /pub/gnu
  619. X+The program wdiff, version 0.04, is now available on prep.ai.mit.edu,
  620. X+in directory pub/gnu, as file wdiff-0.04.tar.Z.  All reported bugs
  621. X+have been fixed.  Some bugs surely remain.  Your feedback will help me
  622. X+to make wdiff better and more portable.  Please report any wdiff
  623. X+problems to me or to bug-gnu-utils@prep.ai.mit.edu.  Thanks to all
  624. X+those who contributed comments or suggestions.
  625. X+
  626. X+Read the file NEWS for an inventory of user visible changes, and file
  627. X+ChangeLog for a detailed list of all changes.  You will find below a
  628. X+description of wdiff, how to get its documentation, how to apply the
  629. X+current patch, a few installation notes you should read and, finally,
  630. X+the answer to some frequently asked questions.
  631. X+
  632. X+Installation has been simplified.  Flex is not anymore required for
  633. X+non ANSI-C compilers.  wdiff uses the first found of gnudiff, diffgnu,
  634. X+gdiff or diff.  Some other portability problems have been alleviated.
  635. X+
  636. X+James Ganong <jeg@ced.berkeley.edu> wrote collatew.el, generalizing
  637. X+the Emacs LISP compare-windows function in the spirit of wdiff;
  638. X+however, his package is not part of the wdiff distribution.  Email to
  639. X+James or me for a copy.
  640. X+
  641. X+Colin Brough <cmb@epcc.ed.ac.uk> contributed a man page, describing
  642. X+wdiff at level 0.04.  The man page will be distributed and installed
  643. X+along with wdiff as long as Colin will want to maintain it.
  644. X+
  645. X+.------------------.
  646. X+|  What is wdiff?  |
  647. X+`------------------'
  648. X+
  649. X+The program wdiff is a front end to diff for comparing files on a word
  650. X+per word basis.  A word is anything between whitespace.  This program
  651. X+is particularily useful for comparing two texts in which a few words
  652. X+have been changed and for which paragraphs have been refilled.  wdiff
  653. X+is free software.  See files COPYING and COPYING.LIB for copying
  654. X+conditions.
  655. X+
  656. X+This program does not require termcap, but takes advantage of it.  If
  657. X+your system does not have termcap, you might feel like getting and
  658. X+installing GNU termcap first.  Grab termcap-1.1.tar.Z in /pub/gnu from
  659. X+prep.ai.mit.edu.
  660. X+
  661. X+.-----------------.
  662. X+|  Documentation  |
  663. X+`-----------------'
  664. X+
  665. X+Calling just wdiff, without arguments, will summarize its usage.  The
  666. X+true documentation is in Texinfo format.  You can look at the file
  667. X+wdiff.info using any ASCII editor, or even print the file as is.  You
  668. X+may browse it from inside GNU Emacs by typing:
  669. X+
  670. X+    C-u M-x info RET wdiff.info RET
  671. X+
  672. X+or, using the standalone Info reader, through the command:
  673. X+
  674. X+    info -f wdiff.info
  675. X+
  676. X+If you have TeX, execute the command:
  677. X+
  678. X+    tex wdiff.texi
  679. X+
  680. X+then process and print wdiff.dvi the usual way.  You can find makeinfo
  681. X+and the standalone info reader in file texinfo-2.15.tar.Z in /pub/gnu
  682. X+from prep.ai.mit.edu: just unpack it and look into the C subdirectory.
  683. X+
  684. X+.----------------------.
  685. X+|  Applying the Patch  |
  686. X+`----------------------'
  687. X+
  688. X+This section is for you only if you received this as an introduction
  689. X+to a patch in diff format.  Apply this patch to wdiff-0.03 to get
  690. X+wdiff-0.04.  It is a unified diff, you can apply it using a recent
  691. X+version of the patch program, like patch-2.0.12g8.tar.Z in /pub/gnu
  692. X from prep.ai.mit.edu.  Given you have it, first save this article in
  693. X file THIS_ARTICLE, then execute the following commands:
  694. X-    cd wdiff-0.02
  695. X+    cd wdiff-0.03
  696. X     patch < THIS_ARTICLE
  697. X-If you just patched `wdiff', or if you received it in shar format,
  698. X-beware the time stamps might be improper.  You might somewhat
  699. X-alleviate the problem with the two following commands:
  700. X+If you just patched wdiff, or if you received it whole in shar format,
  701. X+the time stamps might be improper.  You might somewhat alleviate the
  702. X+problem with the two following commands:
  703. X     touch configure    <- if you forget this, you need autoconf!
  704. X     touch wdiff.info   <- if you forget this, you need makeinfo!
  705. X-You can also get a fully patched version, for at least a few days, as
  706. X-wdiff-0.03.tar.Z in /tmp from ftp.uu.net.  In any case, see the file
  707. X-INSTALL for building and installation instructions.  Please send all
  708. X-bug reports by electronic mail to: <pinard@iro.umontreal.ca>.
  709. X-
  710. X-Let me add a few words about the documentation.  Calling just `wdiff',
  711. X-without arguments, will summarize its usage.  The true documentation
  712. X-is in Texinfo format.  You can look at the file wdiff.info using any
  713. X-ASCII editor, or even print the file as is.  You may browse it using
  714. X-GNU Emacs Info mode: `C-u M-x info RET wdiff.info RET' or, using the
  715. X-standalone Info reader, through: `info -f wdiff.info'.  If you have
  716. X-TeX, first insure `.' is in TEXINPUTS, execute `tex wdiff.texi', then
  717. X-process and print wdiff.dvi the usual way.  You can find makeinfo and
  718. X-the standalone info reader in file texinfo-2.15.tar.Z in /pub/gnu from
  719. X-prep.ai.mit.edu: just unpack it and look into the C subdirectory.
  720. X-
  721. X--- 
  722. X-Franc,ois Pinard        ``Vivement GNU!''        pinard@iro.umontreal.ca
  723. X-(514) 588-4656                                    ...!uunet!iros1!pinard
  724. X-Consider joining the League for Programming Freedom.  Email for details!
  725. X+.----------------------.
  726. X+|  Installation notes  |
  727. X+`----------------------'
  728. X+
  729. X+See the file INSTALL for building and installation instructions.
  730. X+However, beware of these peculiarities:
  731. X+
  732. X+* There is a simple minded change bars producer in wdiff, which is not
  733. X+installed by default, nor documented.  If you nevertheles want it, one
  734. X+way to get it is requesting, at the final installation step:
  735. X+
  736. X+    make install PROGS='wdiff cbars'
  737. X+
  738. X+* If you have both more and less, you prefer more to less, your PAGER
  739. X+environment variable does not tell about more, then prefix the call to
  740. X+configure with your pager selection, as in:
  741. X+
  742. X+    PAGER=more sh configure
  743. X+
  744. X+* If you have termcap emulation routines in libcurses.a and you do not
  745. X+have libtermcap.a, and until I find a way to do better, please use:
  746. X+
  747. X+    LIBS=-lcurses sh configure
  748. X+
  749. X+.------------------------------.
  750. X+|  Frequently Asked Questions  |
  751. X+`------------------------------'
  752. X+
  753. X+Q: How is wdiff different from diff -w?
  754. X+
  755. X+wdiff finds word differences, ignoring spaces, tabs and newlines,
  756. X+while diff -w finds *line* differences, ignoring spaces and tabs.
  757. X+Also, each program uses its own output format.
  758. X+
  759. X+Q: How about spiff by Dan Nachbar <nachbar@bellcore.com>?
  760. X+
  761. X+spiff is far more general than wdiff.  On the other end, wdiff is a
  762. X+lot faster, needs almost no memory, and can afford handling big files
  763. X+in reasonnable time.  Despite its lack of generality, wdiff does one
  764. X+of the most usual jobs, so it is quite useful after all.  I might try
  765. X+retrofitting some of spiff features into wdiff, but not on short term.
  766. X+
  767. X+Q: How much memory wdiff exactly needs?
  768. X+
  769. X+wdiff uses a fixed amount of memory.  Long lines or long files are no
  770. X+handicap.  All the true work is done by diff under the scene, and diff
  771. X+needs memory itself.  GNU diff swallows both files in memory first.
  772. X+
  773. X+Q: Why not simply apply diff to files split one word per line?
  774. X+
  775. X+You like the way wdiff formats its output.  And it's speedier too.
  776. X+
  777. X+Q: Why calling an external diff?  Could not diff be built in wdiff?
  778. X+
  779. X+It's not fruitful to rewrite another diff.  I'd rather see wdiff
  780. X+integrated in GNU diff than the other way around.  This might come.
  781. X+When wdiff will have matured enough, it *might* be integrated into GNU
  782. X+diff distribution, or in GNU diff itself.
  783. X+
  784. X--- wdiff-0.03/THANKS
  785. X+++ wdiff-0.04/THANKS    Tue Dec 22 00:26:57 1992
  786. X@@ -0,0 +1,28 @@
  787. X+GNU wdiff THANKS file - last updated on 21 December 1992.
  788. X+Copyright (C) 1992 Free Software Foundation, Inc.
  789. X+Francois Pinard <pinard@iro.umontreal.ca>, 1992.
  790. X+
  791. X+GNU wdiff has originally been written by Franc,ois Pinard.  Many
  792. X+people further contributed to GNU wdiff by reporting problems,
  793. X+suggesting various improvements or submitting actual code.  Here is a
  794. X+list of these people.  Help me keeping it complete and exempt of
  795. X+errors.
  796. X+
  797. X+Andy Norman <ange@hplb.hpl.hp.com>
  798. X+Colin Brough <cmb@epcc.ed.ac.uk>
  799. X+David Zuhn <zoo@cygnus.com>
  800. X+Francois Pinard <pinard@iro.umontreal.ca>
  801. X+James Ganong <jeg@ced.berkeley.edu>
  802. X+Jim Meyering <meyering@cs.utexas.edu>
  803. X+Joe Wells <jbw@cs.bu.edu>
  804. X+Karl Berry <karl@cs.umb.edu>
  805. X+Larry Virden <lvirden@cas.org>
  806. X+Paul Eggert <eggert@twinsun.com>
  807. X+Paul Fox <pgf@cayman.com>
  808. X+Per Cederqvist <ceder@lysator.liu.se>
  809. X+Pierre Gaumond <gaumondp@ere.umontreal.ca>
  810. X+Richard Stallman <rms@prep.ai.mit.edu>
  811. X+Robert Chassell <bob@gnu.ai.mit.edu>
  812. X+Roland McGrath <roland@gnu.ai.mit.edu>
  813. X+Steve Fisk <fisk@polar.bowdoin.edu>
  814. X+Zhuo Zang <zzang@stat.ufl.edu>
  815. X--- wdiff-0.03/TODO
  816. X+++ wdiff-0.04/TODO    Wed Dec 23 16:48:00 1992
  817. X@@ -0,0 +1,22 @@
  818. X+TODO file for GNU wdiff - last revised 21 December 1992.
  819. X+Copyright (C) 1992 Free Software Foundation, Inc.
  820. X+Francois Pinard <pinard@iro.umontreal.ca>, 1992.
  821. X+
  822. X+These are more or less in decreasing order of priority.
  823. X+
  824. X+* Check how wdiff.dvi prints.
  825. X+
  826. X+* Implement a clever combination of these two ideas: (1) have a wpatch
  827. X+program (Zhuo Zang <zzang@stat.ufl.edu>, 1992-08-13); (2) use unified
  828. X+diff format (Per Cederqvist <ceder@lysator.liu.se>, 1992-11-22).
  829. X+
  830. X+* Detect and configure termcap better.
  831. X+
  832. X+* Support systems with terminfo and without termcap.
  833. X+
  834. X+* Select by options exactly what is whitespace.
  835. X+
  836. X+* Merge some spiff features into wdiff.
  837. X+
  838. X+* Merge all of wdiff into GNU diff.
  839. X+
  840. X--- wdiff-0.03/aclocal.m4
  841. X+++ wdiff-0.04/aclocal.m4    Sun Nov 22 11:16:32 1992
  842. X@@ -0,0 +1,18 @@
  843. X+dnl Local additions to Autoconf macros.
  844. X+dnl Copyright (C) 1992 Free Software Foundation, Inc.
  845. X+dnl Francois Pinard <pinard@iro.umontreal.ca>, 1992.
  846. X+dnl
  847. X+define(FP_PROTOTYPES,
  848. X+[echo checking for ANSI prototypes
  849. X+AC_PROGRAM_EGREP(yes,
  850. X+[#ifdef __STDC__
  851. X+  yes
  852. X+#endif
  853. X+], , U=_)
  854. X+AC_SUBST(U)])dnl
  855. X+dnl
  856. X+define(FP_VARLENGTH_ARRAYS,
  857. X+[echo checking for variable length arrays
  858. X+AC_TEST_PROGRAM([f(n)int n;{int array[n];}main(){f(7);exit(0);}
  859. X+], AC_DEFINE(HAVE_VARLENGTH_ARRAYS))
  860. X+])dnl
  861. X--- wdiff-0.03/alloca.c    Mon Mar 30 18:01:49 1992
  862. X+++ wdiff-0.04/alloca.c    Tue Dec  1 13:25:53 1992
  863. X@@ -30,8 +30,11 @@
  864. X static char    SCCSid[] = "@(#)alloca.c    1.1";    /* for the "what" utility */
  865. X #endif
  866. X-#ifdef emacs
  867. X+#ifdef HAVE_CONFIG_H
  868. X #include "config.h"
  869. X+#endif
  870. X+
  871. X+#ifdef emacs
  872. X #ifdef static
  873. X /* actually, only want this if static is defined as ""
  874. X    -- this is for usg, in which emacs must undefine static
  875. X--- wdiff-0.03/ansi2knr.c
  876. X+++ wdiff-0.04/ansi2knr.c    Sat Dec 19 18:09:17 1992
  877. X@@ -0,0 +1,302 @@
  878. X+/* Copyright (C) 1989, 1991 Aladdin Enterprises.  All rights reserved.
  879. X+   Distributed by Free Software Foundation, Inc.
  880. X+
  881. X+This file is part of Ghostscript.
  882. X+
  883. X+Ghostscript is distributed in the hope that it will be useful, but
  884. X+WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  885. X+to anyone for the consequences of using it or for whether it serves any
  886. X+particular purpose or works at all, unless he says so in writing.  Refer
  887. X+to the Ghostscript General Public License for full details.
  888. X+
  889. X+Everyone is granted permission to copy, modify and redistribute
  890. X+Ghostscript, but only under the conditions described in the Ghostscript
  891. X+General Public License.  A copy of this license is supposed to have been
  892. X+given to you along with Ghostscript so you can know your rights and
  893. X+responsibilities.  It should be in a file named COPYING.  Among other
  894. X+things, the copyright notice and this notice must be preserved on all
  895. X+copies.  */
  896. X+
  897. X+/* ansi2knr.c */
  898. X+/* Convert ANSI function declarations to K&R syntax */
  899. X+#include <stdio.h>
  900. X+#include <ctype.h>
  901. X+extern char *xmalloc ();
  902. X+#ifndef HAVE_STRING_H
  903. X+#ifndef STDC_HEADERS
  904. X+#define strchr index
  905. X+#endif
  906. X+#endif
  907. X+extern char *strchr ();
  908. X+
  909. X+/* Usage:
  910. X+    ansi2knr input_file output_file
  911. X+ * If no output_file is supplied, output goes to stdout.
  912. X+ * There are no error messages.
  913. X+ *
  914. X+ * ansi2knr recognizes functions by seeing a non-keyword identifier
  915. X+ * at the left margin, followed by a left parenthesis,
  916. X+ * with a right parenthesis as the last character on the line.
  917. X+ * It will recognize a multi-line header if the last character
  918. X+ * on each line but the last is a left parenthesis or comma.
  919. X+ * These algorithms ignore whitespace and comments, except that
  920. X+ * the function name must be the first thing on the line.
  921. X+ * The following constructs will confuse it:
  922. X+    - Any other construct that starts at the left margin and
  923. X+        follows the above syntax (such as a macro or function call).
  924. X+    - Macros that tinker with the syntax of the function header.
  925. X+ */
  926. X+
  927. X+/* Scanning macros */
  928. X+#define isidchar(ch) (isalnum(ch) || (ch) == '_')
  929. X+#define isidfirstchar(ch) (isalpha(ch) || (ch) == '_')
  930. X+
  931. X+main(argc, argv)
  932. X+    int argc;
  933. X+    char *argv[];
  934. X+{    FILE *in, *out;
  935. X+#define bufsize 500            /* arbitrary size */
  936. X+    char buf[bufsize];
  937. X+    char *line;
  938. X+    switch ( argc )
  939. X+       {
  940. X+    default:
  941. X+        printf("Usage: ansi2knr input_file [output_file]\n");
  942. X+        exit(0);
  943. X+    case 2:
  944. X+        out = stdout; break;
  945. X+    case 3:
  946. X+        out = fopen(argv[2], "w");
  947. X+        if ( out == NULL )
  948. X+           {    fprintf(stderr, "Cannot open %s\n", argv[2]);
  949. X+            exit(1);
  950. X+           }
  951. X+       }
  952. X+    in = fopen(argv[1], "r");
  953. X+    if ( in == NULL )
  954. X+       {    fprintf(stderr, "Cannot open %s\n", argv[1]);
  955. X+        exit(1);
  956. X+       }
  957. X+    fprintf(out, "#line 1 \"%s\"\n", argv[1]);
  958. X+    line = buf;
  959. X+    while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
  960. X+       {    switch ( test1(buf) )
  961. X+           {
  962. X+        case 1:            /* a function */
  963. X+            convert1(buf, out);
  964. X+            break;
  965. X+        case -1:        /* maybe the start of a function */
  966. X+            line = buf + strlen(buf);
  967. X+            continue;
  968. X+        default:        /* not a function */
  969. X+            fputs(buf, out);
  970. X+            break;
  971. X+           }
  972. X+        line = buf;
  973. X+       }
  974. X+    if ( line != buf ) fputs(buf, out);
  975. X+    fclose(out);
  976. X+    fclose(in);
  977. X+    return 0;
  978. X+}
  979. X+
  980. X+/* Skip over space and comments, in either direction. */
  981. X+char *
  982. X+skipspace(p, dir)
  983. X+    register char *p;
  984. X+    register int dir;            /* 1 for forward, -1 for backward */
  985. X+{    for ( ; ; )
  986. X+       {    while ( isspace(*p) ) p += dir;
  987. X+        if ( !(*p == '/' && p[dir] == '*') ) break;
  988. X+        p += dir;  p += dir;
  989. X+        while ( !(*p == '*' && p[dir] == '/') )
  990. X+           {    if ( *p == 0 ) return p;    /* multi-line comment?? */
  991. X+            p += dir;
  992. X+           }
  993. X+        p += dir;  p += dir;
  994. X+       }
  995. X+    return p;
  996. X+}
  997. X+
  998. X+/*
  999. X+ * Write blanks over part of a string.
  1000. X+ */
  1001. X+void
  1002. X+writeblanks(start, end)
  1003. X+    char *start;
  1004. X+    char *end;
  1005. X+{    char *p;
  1006. X+    for ( p = start; p < end; p++ ) *p = ' ';
  1007. X+}
  1008. X+
  1009. X+/*
  1010. X+ * Test whether the string in buf is a function definition.
  1011. X+ * The string may contain and/or end with a newline.
  1012. X+ * Return as follows:
  1013. X+ *    0 - definitely not a function definition;
  1014. X+ *    1 - definitely a function definition;
  1015. X+ *    -1 - may be the beginning of a function definition,
  1016. X+ *        append another line and look again.
  1017. X+ */
  1018. X+test1(buf)
  1019. X+    char *buf;
  1020. X+{    register char *p = buf;
  1021. X+    char *bend;
  1022. X+    char *endfn;
  1023. X+    int contin;
  1024. X+    if ( !isidfirstchar(*p) )
  1025. X+        return 0;        /* no name at left margin */
  1026. X+    bend = skipspace(buf + strlen(buf) - 1, -1);
  1027. X+    switch ( *bend )
  1028. X+       {
  1029. X+    case ')': contin = 1; break;
  1030. X+    case '(':
  1031. X+    case ',': contin = -1; break;
  1032. X+    default: return 0;        /* not a function */
  1033. X+       }
  1034. X+    while ( isidchar(*p) ) p++;
  1035. X+    endfn = p;
  1036. X+    p = skipspace(p, 1);
  1037. X+    if ( *p++ != '(' )
  1038. X+        return 0;        /* not a function */
  1039. X+    p = skipspace(p, 1);
  1040. X+    if ( *p == ')' )
  1041. X+        return 0;        /* no parameters */
  1042. X+    /* Check that the apparent function name isn't a keyword. */
  1043. X+    /* We only need to check for keywords that could be followed */
  1044. X+    /* by a left parenthesis (which, unfortunately, is most of them). */
  1045. X+       {    static char *words[] =
  1046. X+           {    "asm", "auto", "case", "char", "const", "double",
  1047. X+            "extern", "float", "for", "if", "int", "long",
  1048. X+            "register", "return", "short", "signed", "sizeof",
  1049. X+            "static", "switch", "typedef", "unsigned",
  1050. X+            "void", "volatile", "while", 0
  1051. X+           };
  1052. X+        char **key = words;
  1053. X+        char *kp;
  1054. X+        int len = endfn - buf;
  1055. X+        while ( (kp = *key) != 0 )
  1056. X+           {    if ( strlen(kp) == len && !strncmp(kp, buf, len) )
  1057. X+                return 0;    /* name is a keyword */
  1058. X+            key++;
  1059. X+           }
  1060. X+       }
  1061. X+    return contin;
  1062. X+}
  1063. X+
  1064. X+convert1(buf, out)
  1065. X+    char *buf;
  1066. X+    FILE *out;
  1067. X+{    char *endfn = strchr(buf, '(') + 1;
  1068. X+    register char *p;
  1069. X+    char **breaks;
  1070. X+    unsigned num_breaks = 2;    /* for testing */
  1071. X+    char **btop;
  1072. X+    char **bp;
  1073. X+    char **ap;
  1074. X+top:    p = endfn;
  1075. X+    breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
  1076. X+    if ( breaks == 0 )
  1077. X+       {    /* Couldn't allocate break table, give up */
  1078. X+        fprintf(stderr, "Unable to allocate break table!\n");
  1079. X+        fputs(buf, out);
  1080. X+        return -1;
  1081. X+       }
  1082. X+    btop = breaks + num_breaks * 2 - 2;
  1083. X+    bp = breaks;
  1084. X+    /* Parse the argument list */
  1085. X+    do
  1086. X+       {    int level = 0;
  1087. X+        char *end = NULL;
  1088. X+        if ( bp >= btop )
  1089. X+           {    /* Filled up break table. */
  1090. X+            /* Allocate a bigger one and start over. */
  1091. X+            free((char *)breaks);
  1092. X+            num_breaks <<= 1;
  1093. X+            goto top;
  1094. X+           }
  1095. X+        *bp++ = p;
  1096. X+        /* Find the end of the argument */
  1097. X+        for ( ; end == NULL; p++ )
  1098. X+           {    switch(*p)
  1099. X+               {
  1100. X+            case ',': if ( !level ) end = p; break;
  1101. X+            case '(': level++; break;
  1102. X+            case ')': if ( --level < 0 ) end = p; break;
  1103. X+            case '/': p = skipspace(p, 1) - 1; break;
  1104. X+            default: ;
  1105. X+               }
  1106. X+           }
  1107. X+        p--;            /* back up over terminator */
  1108. X+        /* Find the name being declared. */
  1109. X+        /* This is complicated because of procedure and */
  1110. X+        /* array modifiers. */
  1111. X+        for ( ; ; )
  1112. X+           {    p = skipspace(p - 1, -1);
  1113. X+            switch ( *p )
  1114. X+               {
  1115. X+            case ']':    /* skip array dimension(s) */
  1116. X+            case ')':    /* skip procedure args OR name */
  1117. X+               {    int level = 1;
  1118. X+                while ( level )
  1119. X+                 switch ( *--p )
  1120. X+                   {
  1121. X+                case ']': case ')': level++; break;
  1122. X+                case '[': case '(': level--; break;
  1123. X+                case '/': p = skipspace(p, -1) + 1; break;
  1124. X+                default: ;
  1125. X+                   }
  1126. X+               }
  1127. X+                if ( *p == '(' && *skipspace(p + 1, 1) == '*' )
  1128. X+                   {    /* We found the name being declared */
  1129. X+                    while ( !isidfirstchar(*p) )
  1130. X+                        p = skipspace(p, 1) + 1;
  1131. X+                    goto found;
  1132. X+                   }
  1133. X+                break;
  1134. X+            default: goto found;
  1135. X+               }
  1136. X+           }
  1137. X+found:        if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
  1138. X+           {    p++;
  1139. X+            if ( bp == breaks + 1 )    /* sole argument */
  1140. X+                writeblanks(breaks[0], p);
  1141. X+            else
  1142. X+                writeblanks(bp[-1] - 1, p);
  1143. X+            bp--;
  1144. X+           }
  1145. X+        else
  1146. X+           {    while ( isidchar(*p) ) p--;
  1147. X+            *bp++ = p+1;
  1148. X+           }
  1149. X+        p = end;
  1150. X+       }
  1151. X+    while ( *p++ == ',' );
  1152. X+    *bp = p;
  1153. X+    /* Make a special check for 'void' arglist */
  1154. X+    if ( bp == breaks+2 )
  1155. X+       {    p = skipspace(breaks[0], 1);
  1156. X+        if ( !strncmp(p, "void", 4) )
  1157. X+           {    p = skipspace(p+4, 1);
  1158. X+            if ( p == breaks[2] - 1 )
  1159. X+               {    bp = breaks;    /* yup, pretend arglist is empty */
  1160. X+                writeblanks(breaks[0], p + 1);
  1161. X+               }
  1162. X+           }
  1163. X+       }
  1164. X+    /* Put out the function name */
  1165. X+    p = buf;
  1166. X+    while ( p != endfn ) putc(*p, out), p++;
  1167. X+    /* Put out the declaration */
  1168. X+    for ( ap = breaks+1; ap < bp; ap += 2 )
  1169. X+       {    p = *ap;
  1170. X+        while ( isidchar(*p) ) putc(*p, out), p++;
  1171. X+        if ( ap < bp - 1 ) fputs(", ", out);
  1172. X+       }
  1173. X+    fputs(")  ", out);
  1174. X+    /* Put out the argument declarations */
  1175. X+    for ( ap = breaks+2; ap <= bp; ap += 2 ) (*ap)[-1] = ';';
  1176. X+    fputs(breaks[0], out);
  1177. X+    free((char *)breaks);
  1178. X+    return 0;
  1179. X+}
  1180. X--- wdiff-0.03/cbars.sh
  1181. X+++ wdiff-0.04/cbars.sh    Mon Nov 23 09:11:18 1992
  1182. X@@ -0,0 +1,13 @@
  1183. X+#!/bin/sh
  1184. X+# Produce change bars from two revisions of a document.
  1185. X+# Copyright (C) 1992 Free Software Foundation, Inc.
  1186. X+# Francois Pinard <pinard@iro.umontreal.ca>, 1992.
  1187. X+
  1188. X+usage="$0 OLD_FILE NEW_FILE"
  1189. X+
  1190. X+if [ $# -ne 2 ]; then
  1191. X+  echo "$usage"; exit
  1192. X+fi
  1193. X+
  1194. X+<bindir>/wdiff -1n $1 $2 |
  1195. X+  sed -e 's/^/  /;/{+/s/^ /|/;s/{+//g;s/+}//g'
  1196. X--- wdiff-0.03/check_it
  1197. X+++ wdiff-0.04/check_it    Wed Dec 23 12:11:25 1992
  1198. X@@ -0,0 +1,157 @@
  1199. X+#!/bin/sh
  1200. X+# Check wdiff against some simple test cases.
  1201. X+# Copyright (C) 1992 Free Software Foundation, Inc.
  1202. X+
  1203. X+wdiff=./wdiff
  1204. X+input1=/tmp/wd.$$a
  1205. X+input2=/tmp/wd.$$b
  1206. X+expect=/tmp/wd.$$c
  1207. X+output=/tmp/wd.$$d
  1208. X+
  1209. X+fail="echo; echo Check FAILED; rm -f $input1 $input2 $expect $output; exit 1"
  1210. X+trap "$fail" 1 2 3 14 15
  1211. X+
  1212. X+cat > $input1 <<END_OF_FILE
  1213. X+This is input1
  1214. X+The quick brown fox jumps over the lazy dog.
  1215. X+The hurried orange fox jumps over the lazy dog.
  1216. X+A slow green panda walks around a sleeping cat.
  1217. X+The middling red fox jumps over the lazy dog.
  1218. X+END_OF_FILE
  1219. X+
  1220. X+cat > $input2 <<END_OF_FILE
  1221. X+This is input2
  1222. X+The quick brown fox jumps over the lazy dog.
  1223. X+The slow red fox jumps over the lazy dog.
  1224. X+A slow, short green giraffe walks around a sleeping cat.
  1225. X+The middling red fox jumps over the lazy dog.
  1226. X+END_OF_FILE
  1227. X+
  1228. X+echo "Checking wdiff"
  1229. X+cat > $expect <<END_OF_FILE
  1230. X+This is [-input1-] {+input2+}
  1231. X+The quick brown fox jumps over the lazy dog.
  1232. X+The [-hurried orange-] {+slow red+} fox jumps over the lazy dog.
  1233. X+A [-slow-] {+slow, short+} green [-panda-] {+giraffe+} walks around a sleeping cat.
  1234. X+The middling red fox jumps over the lazy dog.
  1235. X+END_OF_FILE
  1236. X+$wdiff $input1 $input2 > $output
  1237. X+diff $expect $output || eval "$fail"
  1238. X+
  1239. X+echo "Checking wdiff -1"
  1240. X+cat > $expect <<END_OF_FILE
  1241. X+This is {+input2+}
  1242. X+The quick brown fox jumps over the lazy dog.
  1243. X+The {+slow red+} fox jumps over the lazy dog.
  1244. X+A {+slow, short+} green {+giraffe+} walks around a sleeping cat.
  1245. X+The middling red fox jumps over the lazy dog.
  1246. X+END_OF_FILE
  1247. X+$wdiff -1 $input1 $input2 > $output
  1248. X+diff $expect $output || eval "$fail"
  1249. X+
  1250. X+echo "Checking wdiff -2"
  1251. X+cat > $expect <<END_OF_FILE
  1252. X+This is [-input1-]
  1253. X+The quick brown fox jumps over the lazy dog.
  1254. X+The [-hurried orange-] fox jumps over the lazy dog.
  1255. X+A [-slow-] green [-panda-] walks around a sleeping cat.
  1256. X+The middling red fox jumps over the lazy dog.
  1257. X+END_OF_FILE
  1258. X+$wdiff -2 $input1 $input2 > $output
  1259. X+diff $expect $output || eval "$fail"
  1260. X+
  1261. X+echo "Checking wdiff -3"
  1262. X+cat > $expect <<END_OF_FILE
  1263. X+
  1264. X+======================================================================
  1265. X+ [-input1-] {+input2+}
  1266. X+======================================================================
  1267. X+ [-hurried orange-] {+slow red+}
  1268. X+======================================================================
  1269. X+ [-slow-] {+slow, short+}
  1270. X+======================================================================
  1271. X+ [-panda-] {+giraffe+}
  1272. X+======================================================================
  1273. X+END_OF_FILE
  1274. X+$wdiff -3 $input1 $input2 > $output
  1275. X+diff $expect $output || eval "$fail"
  1276. X+
  1277. X+echo "Checking wdiff -12"
  1278. X+cat > $expect <<END_OF_FILE
  1279. X+This is
  1280. X+======================================================================
  1281. X+
  1282. X+The quick brown fox jumps over the lazy dog.
  1283. X+The
  1284. X+======================================================================
  1285. X+ fox jumps over the lazy dog.
  1286. X+A
  1287. X+======================================================================
  1288. X+ green
  1289. X+======================================================================
  1290. X+ walks around a sleeping cat.
  1291. X+The middling red fox jumps over the lazy dog.
  1292. X+END_OF_FILE
  1293. X+$wdiff -12 $input1 $input2 > $output
  1294. X+diff $expect $output || eval "$fail"
  1295. X+
  1296. X+echo "Checking wdiff -13"
  1297. X+cat > $expect <<END_OF_FILE
  1298. X+
  1299. X+======================================================================
  1300. X+ input2
  1301. X+======================================================================
  1302. X+ slow red
  1303. X+======================================================================
  1304. X+ slow, short
  1305. X+======================================================================
  1306. X+ giraffe
  1307. X+======================================================================
  1308. X+END_OF_FILE
  1309. X+$wdiff -13 $input1 $input2 > $output
  1310. X+diff $expect $output || eval "$fail"
  1311. X+
  1312. X+echo "Checking wdiff -23"
  1313. X+cat > $expect <<END_OF_FILE
  1314. X+
  1315. X+======================================================================
  1316. X+ input1
  1317. X+======================================================================
  1318. X+ hurried orange
  1319. X+======================================================================
  1320. X+ slow
  1321. X+======================================================================
  1322. X+ panda
  1323. X+======================================================================
  1324. X+END_OF_FILE
  1325. X+$wdiff -23 $input1 $input2 > $output
  1326. X+diff $expect $output || eval "$fail"
  1327. X+
  1328. X+echo "Checking wdiff -123"
  1329. X+cat > $expect <<END_OF_FILE
  1330. X+END_OF_FILE
  1331. X+$wdiff -123 $input1 $input2 > $output
  1332. X+diff $expect $output || eval "$fail"
  1333. X+
  1334. X+echo "Checking wdiff -123s"
  1335. X+cat > $expect <<END_OF_FILE
  1336. X+$input1: 39 words  34 87% common  0 0% deleted  5 12% changed
  1337. X+$input2: 40 words  34 85% common  0 0% inserted  6 15% changed
  1338. X+END_OF_FILE
  1339. X+$wdiff -123s $input1 $input2 > $output
  1340. X+diff $expect $output || eval "$fail"
  1341. X+
  1342. X+echo "Checking wdiff -wxyz"
  1343. X+cat > $expect <<END_OF_FILE
  1344. X+This is (input1) <<input2>>
  1345. X+The quick brown fox jumps over the lazy dog.
  1346. X+The (hurried orange) <<slow red>> fox jumps over the lazy dog.
  1347. X+A (slow) <<slow, short>> green (panda) <<giraffe>> walks around a sleeping cat.
  1348. X+The middling red fox jumps over the lazy dog.
  1349. X+END_OF_FILE
  1350. X+$wdiff -w\( -x\) -y\<\< -z\>\> $input1 $input2 > $output
  1351. X+diff $expect $output || eval "$fail"
  1352. X+
  1353. X+rm -f $input1 $input2 $expect $output
  1354. X+echo
  1355. X+echo All checks successful
  1356. X--- wdiff-0.03/configure    Tue Aug 18 04:56:44 1992
  1357. X+++ wdiff-0.04/configure    Wed Dec 23 20:54:00 1992
  1358. X@@ -1,4 +1,3 @@
  1359. X-
  1360. X #!/bin/sh
  1361. X # Guess values for system-dependent variables and create Makefiles.
  1362. X # Generated automatically using autoconf.
  1363. X@@ -78,12 +77,19 @@
  1364. X # Find the source files, if location was not specified.
  1365. X if test -z "$srcdir"; then
  1366. X-  srcdirdefaulted=yes; srcdir=.
  1367. X-  if test ! -r $unique_file; then srcdir=..; fi
  1368. X+  srcdirdefaulted=yes
  1369. X+  # Try the directory containing this script, then `..'.
  1370. X+  prog=$0
  1371. X+  confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  1372. X+  test "X$confdir" = "X$prog" && confdir=.
  1373. X+  srcdir=$confdir
  1374. X+  if test ! -r $srcdir/$unique_file; then
  1375. X+    srcdir=..
  1376. X+  fi
  1377. X fi
  1378. X if test ! -r $srcdir/$unique_file; then
  1379. X   if test x$srcdirdefaulted = xyes; then
  1380. X-    echo "configure: Can not find sources in \`.' or \`..'." 1>&2
  1381. X+    echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  1382. X   else
  1383. X     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  1384. X   fi
  1385. X@@ -123,37 +129,9 @@
  1386. X fi
  1387. X rm -f conftest*
  1388. X-if test -z "$LEX"; then
  1389. X-  echo checking for flex
  1390. SHAR_EOF
  1391. true || echo 'restore of Patch4 failed'
  1392. fi
  1393. echo 'End of  part 1'
  1394. echo 'File Patch4 is continued in part 2'
  1395. echo 2 > _shar_seq_.tmp
  1396. exit 0
  1397. --
  1398. Franc,ois Pinard       ``Happy GNU Year!''      pinard@iro.umontreal.ca
  1399. (514) 588-4656                                   ...!uunet!iros1!pinard
  1400. About the League for Programming Freedom?  Email me or lpf@uunet.uu.net
  1401.