home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume26 / pbmplus / patch10dec91 / part01 / p121091.diffs < prev    next >
Encoding:
Text File  |  1991-12-14  |  38.5 KB  |  1,414 lines

  1. diff -cr pbmplus30oct91/CHANGES CHANGES
  2. *** pbmplus30oct91/CHANGES    Wed Oct 30 13:03:49 1991
  3. --- CHANGES    Tue Dec 10 16:53:20 1991
  4. ***************
  5. *** 1,3 ****
  6. --- 1,21 ----
  7. + Changes since the 30oct91 patch version:
  8. +     Fixed uninitialized variable in ppmtotga.  (John Walker)
  9. +     Added pgmcrater, ppmforge, ppmtoacad, sldtoppm.  (John Walker)
  10. +     Slight change to the p?mmerge.c front-ends to allow for main programs
  11. +       that return instead of exitting.
  12. +     Minor clarifications to the pnmconvol man page.
  13. +     Fixed xwdtopnm to read some 16-bit True/Direct files. (David Elliott)
  14. +     Fixed uninitialized variables in pnmtotiff.  (Larry Rosenstein, Bayles Holt)
  15. +     Added a couple of checks for \r while reading whitespace. (Larry Rosenstein)
  16. +     Removed all the BROKENPUTC stuff.  Now we ignore all return values from
  17. +       putc(), and check ferror() in pm_close().  Added pm_close() calls to
  18. +       many of the filters.
  19. +     Fixed pnmdepth to check for too-large newmaxvals.  Improved rounding
  20. +       in pnmdepth and PPM_DEPTH macro.  (Tom Lane)
  21. +     Minor fix to ppmtouil.  (Mohsen Banan)
  22. +     Added new Imakefiles.  (Rainer Klute)
  23.   Changes since the 05oct91 X11R5 contrib tape version:
  24.   
  25.       Fixed minor SysV config error in pbmplus.h.  (Tom Lane)
  26. diff -cr pbmplus30oct91/FORMATS FORMATS
  27. *** pbmplus30oct91/FORMATS    Fri Sep 27 01:43:23 1991
  28. --- FORMATS    Tue Dec 10 16:53:22 1991
  29. ***************
  30. *** 51,56 ****
  31. --- 51,58 ----
  32.       X11 "puzzle" file                    writing
  33.       Motif UIL icon file                    writing
  34.       DEC sixel format                    writing
  35. +     AutoCAD slide format            reading    writing
  36. +     AutoCAD DXB format                    writing
  37.   
  38.   PNM handles the following multi-type formats:
  39.   
  40. diff -cr pbmplus30oct91/Makefile Makefile
  41. *** pbmplus30oct91/Makefile    Wed Oct 30 20:13:49 1991
  42. --- Makefile    Tue Dec 10 16:53:27 1991
  43. ***************
  44. *** 50,55 ****
  45. --- 50,58 ----
  46.   # Libtiff is pretty good about portability, but there are some machines
  47.   # it has problems on.  If you run into problems, you may wish to contact
  48.   # Sam directly, at the address listed in the OTHER.SYSTEMS file.
  49. + #
  50. + # By the way, you must have at least version 2.4 of libtiff.  Earlier
  51. + # versions will not work.
  52.   TIFFDEF =    -DLIBTIFF
  53.   TIFFINC =    -I../libtiff
  54.   TIFFLIB =    ../libtiff/libtiff.a
  55. diff -cr pbmplus30oct91/OTHER.SYSTEMS OTHER.SYSTEMS
  56. *** pbmplus30oct91/OTHER.SYSTEMS    Wed Sep 18 20:03:52 1991
  57. --- OTHER.SYSTEMS    Tue Dec 10 16:53:22 1991
  58. ***************
  59. *** 62,67 ****
  60. --- 62,77 ----
  61.       signal processing routines, and 2D/3D plotting packages.  Available via
  62.       FTP as pprg.unm.edu:pub/khoros/*.
  63.   
  64. +     LaboImage, a SunView-based image processing and analysis package.  It
  65. +     includes more than 200 image manipulation, processing and measurement
  66. +     routines, on-line help, plus tools such as an image editor, a color
  67. +     table editor and several biomedical utilities.  Available via anonymous
  68. +     FTP as ads.com:pub/VISION-LIST-ARCHIVE/SHAREWARE/LaboImage_3.1.tar.Z
  69. +     The San Diego Supercomputer Center Image Tools, software tools for
  70. +     reading, writing, and manipulating raster images.  Binaries for some
  71. +     machines available via anonymous FTP in sdsc.edu:sdscpub.
  72.   Don't forget to set binary mode when you FTP tar files.  For you MILNET
  73.   folks who still don't have name servers, the IP addresses are:
  74.   
  75. ***************
  76. *** 74,79 ****
  77. --- 84,91 ----
  78.       weedeater.math.yale.edu    130.132.23.17
  79.       freebie.engin.umich.edu    141.212.68.23
  80.       pprg.eece.unm.edu        129.24.24.10
  81. +     ads.com            128.229.30.16
  82. +     sdsc.edu            132.249.20.22
  83.   
  84.   Also, the newsgroup alt.graphics.pixutils is specifically for discussion
  85.   of software like this.  You may find useful information there.
  86. diff -cr pbmplus30oct91/README README
  87. *** pbmplus30oct91/README    Wed Oct 30 20:11:16 1991
  88. --- README    Tue Dec 10 16:53:18 1991
  89. ***************
  90. *** 1,6 ****
  91.                     Extended Portable Bitmap Toolkit
  92. !                       Distribution of 30oct91
  93. !                    Previous distribution 05oct91
  94.   
  95.   
  96.   PBMPLUS is a toolkit for converting various image formats to and from
  97. --- 1,6 ----
  98.                     Extended Portable Bitmap Toolkit
  99. !                       Distribution of 10dec91
  100. !                    Previous distribution 30oct91
  101.   
  102.   
  103.   PBMPLUS is a toolkit for converting various image formats to and from
  104. ***************
  105. *** 40,49 ****
  106.       Make.
  107.       When you're happy that things compiled ok, make install.
  108.       
  109. !     The Imakefiles are pretty minimal, but if you want to use them anyway:
  110.   
  111. !     Edit pbmplus.h, find each line with the string "CONFIGURE", and
  112. !       follow the directions for setting configuration options.
  113.       Save the original Makefiles, in case you later want to switch back
  114.         to using them.
  115.       The usual X11 sequence of xmkmf, make Makefiles, make depend, then
  116. --- 40,50 ----
  117.       Make.
  118.       When you're happy that things compiled ok, make install.
  119.       
  120. !     If you want to use Imakefiles:
  121.   
  122. !     Edit Pbmplus.tmpl, find each line with the string "CONFIGURE",
  123. !       and follow the directions for setting configuration options.
  124. !     Likewise edit pbmplus.h.
  125.       Save the original Makefiles, in case you later want to switch back
  126.         to using them.
  127.       The usual X11 sequence of xmkmf, make Makefiles, make depend, then
  128. ***************
  129. *** 65,71 ****
  130.   enhancements, etc. to this address:
  131.   
  132.       jef@well.sf.ca.us
  133. !     {apple, ucbvax}!well!jef
  134.   
  135.   When sending bug reports, always include the output from running any
  136.   PBMPLUS program with the -version flag.  Also include the type of
  137. --- 66,72 ----
  138.   enhancements, etc. to this address:
  139.   
  140.       jef@well.sf.ca.us
  141. !     apple!well!jef
  142.   
  143.   When sending bug reports, always include the output from running any
  144.   PBMPLUS program with the -version flag.  Also include the type of
  145. ***************
  146. *** 135,140 ****
  147. --- 136,143 ----
  148.       OTHER.SYSTEMS    list of other free image-processing software
  149.       Makefile        guess
  150.       Imakefile        for X11-type installations
  151. +     Imakefile.tiff    for X11-type installations
  152. +     Pbmplus.tmpl    for X11-type installations
  153.       pbmplus.h        header file for PBM, PGM, PPM, and PNM
  154.   
  155.       compat.csh        csh script for compatibility with old versions
  156. ***************
  157. *** 216,221 ****
  158. --- 219,225 ----
  159.       pgmtopbm.c        convert portable graymap to portable bitmap
  160.   
  161.       pgmbentley.c    Bentleyize a portable graymap
  162. +     pgmcrater.c        create cratered terrain by fractal forgery
  163.       pgmedge.c        edge-detect a portable graymap
  164.       pgmenhance.c    edge-enhance a portable graymap
  165.       pgmhist.c        print a histogram of the values in a portable graymap
  166. ***************
  167. *** 251,256 ****
  168. --- 255,261 ----
  169.       qrttoppm.c        convert QRT ray-tracer output to portable pixmap
  170.       rawtoppm.c        convert raw RGB bytes to portable pixmap
  171.       rgb3toppm.c        combine three portable graymaps into one portable pixmap
  172. +     sldtoppm.c        convert an AutoCAD slide file into a portable pixmap
  173.       spctoppm.c        convert Atari compressed Spectrum to portable pixmap
  174.       sputoppm.c        convert Atari uncompressed Spectrum to portable pixmap
  175.       tgatoppm.c        convert TrueVision Targa file to portable pixmap
  176. ***************
  177. *** 258,263 ****
  178. --- 263,269 ----
  179.       xpmtoppm.c        convert XPM format to portable pixmap
  180.       yuvtoppm.c        convert Abekas YUV format to portable pixmap
  181.   
  182. +     ppmtoacad.c        convert portable pixmap to AutoCAD database or slide
  183.       ppmtogif.c        convert portable pixmap to GIF
  184.       ppmtoicr.c        convert portable pixmap to NCSA ICR graphics
  185.       ppmtoilbm.c        convert portable pixmap to IFF ILBM
  186. ***************
  187. *** 275,281 ****
  188. --- 281,289 ----
  189.       ppmtoyuv.c        convert portable pixmap to Abekas YUV format
  190.   
  191.       ppmdither.c        ordered dither for color images
  192. +     ppmforge.c        fractal forgeries of clouds, planets, and starry skies
  193.       ppmhist.c        print a histogram of a portable pixmap
  194. +     ppmmake.c        create a pixmap of a specified size and color
  195.       ppmpat.c        create a pretty pixmap
  196.       ppmquant.c        quantize colors down to a specified number
  197.       ppmquantall        script to run ppmquant on a set of pixmaps
  198. ***************
  199. *** 287,292 ****
  200. --- 295,301 ----
  201.       ppmcmap.h        header file for colormap routines in libppm
  202.       ppmdraw.h        header file for simple drawing routines in libppm
  203.       libppm.h        internal header file for libppm
  204. +     autocad.h        definitions for AutoCAD files
  205.       tga.h        definitions for TrueVision Targa files
  206.       xim.h        definitions for Xim files
  207.       *.1            manual entries for all of the tools
  208. diff -cr pbmplus30oct91/pbmplus.h pbmplus.h
  209. *** pbmplus30oct91/pbmplus.h    Sun Oct  6 09:32:33 1991
  210. --- pbmplus.h    Tue Dec 10 16:53:28 1991
  211. ***************
  212. *** 17,27 ****
  213.   #include <ctype.h>
  214.   #include <stdio.h>
  215.   
  216. ! #if ! ( defined(BSD) || defined(SYSV) || defined(MSDOS))
  217.   /* CONFIGURE: If your system is >= 4.2BSD, set the BSD option; if you're a
  218.   ** System V site, set the SYSV option; and if you're IBM-compatible, set
  219.   ** MSDOS.  If your compiler is ANSI C, you're probably better off setting
  220. ! ** SYSV.
  221.   */
  222.   #define BSD
  223.   /* #define SYSV */
  224. --- 17,30 ----
  225.   #include <ctype.h>
  226.   #include <stdio.h>
  227.   
  228. ! #if defined(USG) || defined(SVR4)
  229. ! #define SYSV
  230. ! #endif
  231. ! #if ! ( defined(BSD) || defined(SYSV) || defined(MSDOS) )
  232.   /* CONFIGURE: If your system is >= 4.2BSD, set the BSD option; if you're a
  233.   ** System V site, set the SYSV option; and if you're IBM-compatible, set
  234.   ** MSDOS.  If your compiler is ANSI C, you're probably better off setting
  235. ! ** SYSV - all it affects is string handling.
  236.   */
  237.   #define BSD
  238.   /* #define SYSV */
  239. ***************
  240. *** 36,62 ****
  241.   ** Note that reading "raw" files works whether writing is enabled or not.
  242.   */
  243.   #define PBMPLUS_RAWBITS
  244. - /* CONFIGURE: On some systems, the putc() macro is broken and will return
  245. - ** EOF when you write out a 255.  For example, ULTRIX does this.  This
  246. - ** only matters if you have defined RAWBITS.  To test whether your system
  247. - ** is broken this way, go ahead and compile things with RAWBITS defined,
  248. - ** and then try "pbmmake -b 8 1 > file".  If it works, fine.  If not,
  249. - ** define BROKENPUTC1 and try again - if that works, good.  Otherwise,
  250. - ** BROKENPUTC2 is guaranteed to work, although it's about twice as slow.
  251. - */
  252. - /* #define PBMPLUS_BROKENPUTC1 */
  253. - /* #define PBMPLUS_BROKENPUTC2 */
  254. - #ifdef PBMPLUS_BROKENPUTC1
  255. - #undef putc
  256. - /* This is a fixed version of putc() that should work on most Unix systems. */
  257. - #define putc(x,p) (--(p)->_cnt>=0? ((int)(unsigned char)(*(p)->_ptr++=(unsigned char)(x))) : _flsbuf((unsigned char)(x),p))
  258. - #endif /*PBMPLUS_BROKENPUTC1*/
  259. - #ifdef PBMPLUS_BROKENPUTC2
  260. - #undef putc
  261. - /* For this one, putc() becomes a function, defined in pbm/libpbm1.c. */
  262. - #endif /*PBMPLUS_BROKENPUTC2*/
  263.   
  264.   /* CONFIGURE: PGM can store gray values as either bytes or shorts.  For most
  265.   ** applications, bytes will be big enough, and the memory savings can be
  266. --- 39,44 ----
  267. diff -cr pbmplus30oct91/version.h version.h
  268. *** pbmplus30oct91/version.h    Wed Oct 30 20:11:25 1991
  269. --- version.h    Tue Dec 10 16:53:28 1991
  270. ***************
  271. *** 1,4 ****
  272.   /* version.h - define the current version of PBM, PGM, PPM, and PNM
  273.   */
  274.   
  275. ! #define PBMPLUS_VERSION "30oct91"
  276. --- 1,4 ----
  277.   /* version.h - define the current version of PBM, PGM, PPM, and PNM
  278.   */
  279.   
  280. ! #define PBMPLUS_VERSION "10dec91"
  281. diff -cr pbmplus30oct91/pbm/Makefile pbm/Makefile
  282. *** pbmplus30oct91/pbm/Makefile    Thu Oct 24 13:34:36 1991
  283. --- pbm/Makefile    Tue Dec 10 16:51:57 1991
  284. ***************
  285. *** 42,49 ****
  286.           pbmtogem pbmtogo pbmtoicon pbmtolj pbmtomacp \
  287.           pbmtomgr pbmtopi3 pbmtoplot pbmtoptx \
  288.           pbmtox10bm pbmtoxbm pbmtoybm pbmtozinc \
  289. !         pbmupc pi3topbm xbmtopbm \
  290. !         ybmtopbm
  291.   
  292.   OBJECTS =    atktopbm.o brushtopbm.o cmuwmtopbm.o g3topbm.o \
  293.           icontopbm.o gemtopbm.o macptopbm.o mgrtopbm.o \
  294. --- 42,48 ----
  295.           pbmtogem pbmtogo pbmtoicon pbmtolj pbmtomacp \
  296.           pbmtomgr pbmtopi3 pbmtoplot pbmtoptx \
  297.           pbmtox10bm pbmtoxbm pbmtoybm pbmtozinc \
  298. !         pbmupc pi3topbm xbmtopbm ybmtopbm
  299.   
  300.   OBJECTS =    atktopbm.o brushtopbm.o cmuwmtopbm.o g3topbm.o \
  301.           icontopbm.o gemtopbm.o macptopbm.o mgrtopbm.o \
  302. ***************
  303. *** 53,60 ****
  304.           pbmtogem.o pbmtogo.o pbmtoicon.o pbmtolj.o pbmtomacp.o \
  305.           pbmtomgr.o pbmtopi3.o pbmtoplot.o pbmtoptx.o \
  306.           pbmtox10bm.o pbmtoxbm.o pbmtoybm.o pbmtozinc.o \
  307. !         pbmupc.o pi3topbm.o xbmtopbm.o \
  308. !         ybmtopbm.o
  309.   
  310.   MANUALS1 =    $(BINARIES)
  311.   MANUALS3 =    libpbm
  312. --- 52,58 ----
  313.           pbmtogem.o pbmtogo.o pbmtoicon.o pbmtolj.o pbmtomacp.o \
  314.           pbmtomgr.o pbmtopi3.o pbmtoplot.o pbmtoptx.o \
  315.           pbmtox10bm.o pbmtoxbm.o pbmtoybm.o pbmtozinc.o \
  316. !         pbmupc.o pi3topbm.o xbmtopbm.o ybmtopbm.o
  317.   
  318.   MANUALS1 =    $(BINARIES)
  319.   MANUALS3 =    libpbm
  320. diff -cr pbmplus30oct91/pbm/atktopbm.c pbm/atktopbm.c
  321. *** pbmplus30oct91/pbm/atktopbm.c    Thu Sep 26 18:55:48 1991
  322. --- pbm/atktopbm.c    Tue Dec 10 16:53:16 1991
  323. ***************
  324. *** 21,27 ****
  325.       int argc;
  326.       char *argv[];
  327.       {
  328. !     FILE *ifd;
  329.       register bit *bitrow, *bP;
  330.       int rows, cols, row, col, charcount;
  331.       unsigned char *data, mask;
  332. --- 21,27 ----
  333.       int argc;
  334.       char *argv[];
  335.       {
  336. !     FILE *ifp;
  337.       register bit *bitrow, *bP;
  338.       int rows, cols, row, col, charcount;
  339.       unsigned char *data, mask;
  340. ***************
  341. *** 32,44 ****
  342.       pm_usage( "[raster obj]" );
  343.       
  344.       if ( argc == 2 )
  345. !     ifd = pm_openr( argv[1] );
  346.       else
  347. !     ifd = stdin;
  348.   
  349. !     ReadATKRaster( ifd, &cols, &rows, &data );
  350.   
  351. !     pm_close( ifd );
  352.   
  353.       pbm_writepbminit( stdout, cols, rows, 0 );
  354.       bitrow = pbm_allocrow( cols );
  355. --- 32,44 ----
  356.       pm_usage( "[raster obj]" );
  357.       
  358.       if ( argc == 2 )
  359. !     ifp = pm_openr( argv[1] );
  360.       else
  361. !     ifp = stdin;
  362.   
  363. !     ReadATKRaster( ifp, &cols, &rows, &data );
  364.   
  365. !     pm_close( ifp );
  366.   
  367.       pbm_writepbminit( stdout, cols, rows, 0 );
  368.       bitrow = pbm_allocrow( cols );
  369. ***************
  370. *** 63,68 ****
  371. --- 63,69 ----
  372.       pbm_writepbmrow( stdout, bitrow, cols, 0 );
  373.       }
  374.   
  375. +     pm_close( stdout );
  376.       exit( 0 );
  377.       }
  378.   
  379. diff -cr pbmplus30oct91/pbm/brushtopbm.c pbm/brushtopbm.c
  380. *** pbmplus30oct91/pbm/brushtopbm.c    Fri Jun 28 14:28:18 1991
  381. --- pbm/brushtopbm.c    Tue Dec 10 16:52:20 1991
  382. ***************
  383. *** 56,61 ****
  384. --- 56,62 ----
  385.       }
  386.   
  387.       pm_close( ifp );
  388. +     pm_close( stdout );
  389.       
  390.       exit( 0 );
  391.       }
  392. diff -cr pbmplus30oct91/pbm/cmuwmtopbm.c pbm/cmuwmtopbm.c
  393. *** pbmplus30oct91/pbm/cmuwmtopbm.c    Fri Jun 28 14:42:04 1991
  394. --- pbm/cmuwmtopbm.c    Tue Dec 10 16:52:36 1991
  395. ***************
  396. *** 58,63 ****
  397. --- 58,64 ----
  398.       }
  399.   
  400.       pm_close( ifp );
  401. +     pm_close( stdout );
  402.   
  403.       exit( 0 );
  404.       }
  405. diff -cr pbmplus30oct91/pbm/g3topbm.c pbm/g3topbm.c
  406. *** pbmplus30oct91/pbm/g3topbm.c    Fri Jun 28 14:51:31 1991
  407. --- pbm/g3topbm.c    Tue Dec 10 16:52:11 1991
  408. ***************
  409. *** 123,128 ****
  410. --- 123,129 ----
  411.       pbm_writepbminit( stdout, cols, rows, 0 );
  412.       for ( row = 0; row < rows; ++row )
  413.       pbm_writepbmrow( stdout, bits[row], cols, 0 );
  414. +     pm_close( stdout );
  415.   
  416.       exit(0);
  417.       }
  418. diff -cr pbmplus30oct91/pbm/gemtopbm.c pbm/gemtopbm.c
  419. *** pbmplus30oct91/pbm/gemtopbm.c    Fri Jun 28 14:42:07 1991
  420. --- pbm/gemtopbm.c    Tue Dec 10 16:52:30 1991
  421. ***************
  422. *** 209,214 ****
  423. --- 209,215 ----
  424.           } while (linerep--);
  425.       }
  426.       pm_close( f );
  427. +     pm_close( stdout );
  428.       exit(0);
  429.   }
  430.   
  431. diff -cr pbmplus30oct91/pbm/icontopbm.c pbm/icontopbm.c
  432. *** pbmplus30oct91/pbm/icontopbm.c    Fri Jun 28 14:28:25 1991
  433. --- pbm/icontopbm.c    Tue Dec 10 16:51:58 1991
  434. ***************
  435. *** 62,67 ****
  436. --- 62,68 ----
  437.       pbm_writepbmrow( stdout, bitrow, cols, 0 );
  438.       }
  439.   
  440. +     pm_close( stdout );
  441.       exit( 0 );
  442.       }
  443.   
  444. diff -cr pbmplus30oct91/pbm/libpbm1.c pbm/libpbm1.c
  445. *** pbmplus30oct91/pbm/libpbm1.c    Wed Jul  3 13:08:09 1991
  446. --- pbm/libpbm1.c    Tue Dec 10 16:52:45 1991
  447. ***************
  448. *** 376,382 ****
  449.       {
  450.       if ( *format != '%' )
  451.           { /* Not special, just write out the char. */
  452. !         putc( *format, stream );
  453.           ++n;
  454.           ++format;
  455.           }
  456. --- 376,382 ----
  457.       {
  458.       if ( *format != '%' )
  459.           { /* Not special, just write out the char. */
  460. !         (void) putc( *format, stream );
  461.           ++n;
  462.           ++format;
  463.           }
  464. ***************
  465. *** 467,473 ****
  466.           break;
  467.   
  468.               case '%':
  469. !         putc( '%', stream );
  470.           ++n;
  471.           break;
  472.   
  473. --- 467,473 ----
  474.           break;
  475.   
  476.               case '%':
  477. !         (void) putc( '%', stream );
  478.           ++n;
  479.           break;
  480.   
  481. ***************
  482. *** 533,555 ****
  483.   pm_close( f )
  484.       FILE* f;
  485.       {
  486.       if ( f != stdin )
  487.       if ( fclose( f ) != 0 )
  488.           pm_perror( "fclose" );
  489.       }
  490.   
  491. - /* Broken putc() fix. */
  492. - #ifdef PBMPLUS_BROKENPUTC2
  493. - int
  494. - putc( c, stream )
  495. -     char c;
  496. -     FILE* stream;
  497. -     {
  498. -     return fwrite( &c, 1, 1, stream ) == 1 ? c : EOF;
  499. -     }
  500. - #endif /*PBMPLUS_BROKENPUTC2*/
  501.   /* Endian I/O.
  502.   */
  503.   
  504. --- 533,546 ----
  505.   pm_close( f )
  506.       FILE* f;
  507.       {
  508. +     fflush( f );
  509. +     if ( ferror( f ) )
  510. +     pm_message( "a file read or write error occurred at some point" );
  511.       if ( f != stdin )
  512.       if ( fclose( f ) != 0 )
  513.           pm_perror( "fclose" );
  514.       }
  515.   
  516.   /* Endian I/O.
  517.   */
  518.   
  519. ***************
  520. *** 579,588 ****
  521.       short s;
  522.   #endif /*__STDC__*/
  523.       {
  524. !     if ( putc( ( s >> 8 ) & 0xff, out ) == EOF )
  525. !     return -1;
  526. !     if ( putc( s & 0xff, out ) == EOF )
  527. !     return -1;
  528.       return 0;
  529.       }
  530.   
  531. --- 570,577 ----
  532.       short s;
  533.   #endif /*__STDC__*/
  534.       {
  535. !     (void) putc( ( s >> 8 ) & 0xff, out );
  536. !     (void) putc( s & 0xff, out );
  537.       return 0;
  538.       }
  539.   
  540. ***************
  541. *** 613,626 ****
  542.       FILE* out;
  543.       long l;
  544.       {
  545. !     if ( putc( ( l >> 24 ) & 0xff, out ) == EOF )
  546. !     return -1;
  547. !     if ( putc( ( l >> 16 ) & 0xff, out ) == EOF )
  548. !     return -1;
  549. !     if ( putc( ( l >> 8 ) & 0xff, out ) == EOF )
  550. !     return -1;
  551. !     if ( putc( l & 0xff, out ) == EOF )
  552. !     return -1;
  553.       return 0;
  554.       }
  555.   
  556. --- 602,611 ----
  557.       FILE* out;
  558.       long l;
  559.       {
  560. !     (void) putc( ( l >> 24 ) & 0xff, out );
  561. !     (void) putc( ( l >> 16 ) & 0xff, out );
  562. !     (void) putc( ( l >> 8 ) & 0xff, out );
  563. !     (void) putc( l & 0xff, out );
  564.       return 0;
  565.       }
  566.   
  567. ***************
  568. *** 650,659 ****
  569.       short s;
  570.   #endif /*__STDC__*/
  571.       {
  572. !     if ( putc( s & 0xff, out ) == EOF )
  573. !     return -1;
  574. !     if ( putc( ( s >> 8 ) & 0xff, out ) == EOF )
  575. !     return -1;
  576.       return 0;
  577.       }
  578.   
  579. --- 635,642 ----
  580.       short s;
  581.   #endif /*__STDC__*/
  582.       {
  583. !     (void) putc( s & 0xff, out );
  584. !     (void) putc( ( s >> 8 ) & 0xff, out );
  585.       return 0;
  586.       }
  587.   
  588. ***************
  589. *** 684,696 ****
  590.       FILE* out;
  591.       long l;
  592.       {
  593. !     if ( putc( l & 0xff, out ) == EOF )
  594. !     return -1;
  595. !     if ( putc( ( l >> 8 ) & 0xff, out ) == EOF )
  596. !     return -1;
  597. !     if ( putc( ( l >> 16 ) & 0xff, out ) == EOF )
  598. !     return -1;
  599. !     if ( putc( ( l >> 24 ) & 0xff, out ) == EOF )
  600. !     return -1;
  601.       return 0;
  602.       }
  603. --- 667,675 ----
  604.       FILE* out;
  605.       long l;
  606.       {
  607. !     (void) putc( l & 0xff, out );
  608. !     (void) putc( ( l >> 8 ) & 0xff, out );
  609. !     (void) putc( ( l >> 16 ) & 0xff, out );
  610. !     (void) putc( ( l >> 24 ) & 0xff, out );
  611.       return 0;
  612.       }
  613. diff -cr pbmplus30oct91/pbm/libpbm3.c pbm/libpbm3.c
  614. *** pbmplus30oct91/pbm/libpbm3.c    Fri Jun 28 14:28:29 1991
  615. --- pbm/libpbm3.c    Tue Dec 10 16:52:47 1991
  616. ***************
  617. *** 49,63 ****
  618.       --bitshift;
  619.       if ( bitshift == -1 )
  620.           {
  621. !         if ( putc( item, file ) == EOF )
  622. !         pm_error( "write error" );
  623.           bitshift = 7;
  624.           item = 0;
  625.           }
  626.       }
  627.       if ( bitshift != 7 )
  628. !     if ( putc( item, file ) == EOF )
  629. !         pm_error( "write error" );
  630.       }
  631.   #endif /*PBMPLUS_RAWBITS*/
  632.   
  633. --- 49,61 ----
  634.       --bitshift;
  635.       if ( bitshift == -1 )
  636.           {
  637. !         (void) putc( item, file );
  638.           bitshift = 7;
  639.           item = 0;
  640.           }
  641.       }
  642.       if ( bitshift != 7 )
  643. !     (void) putc( item, file );
  644.       }
  645.   #endif /*PBMPLUS_RAWBITS*/
  646.   
  647. ***************
  648. *** 75,90 ****
  649.       {
  650.       if ( charcount >= 70 )
  651.           {
  652. !         if ( putc( '\n', file ) == EOF )
  653. !         pm_error( "write error" );
  654.           charcount = 0;
  655.           }
  656. !     if ( putc( *bP ? '1' : '0', file ) == EOF )
  657. !         pm_error( "write error" );
  658.       ++charcount;
  659.       }
  660. !     if ( putc( '\n', file ) == EOF )
  661. !     pm_error( "write error" );
  662.       }
  663.   
  664.   void
  665. --- 73,85 ----
  666.       {
  667.       if ( charcount >= 70 )
  668.           {
  669. !         (void) putc( '\n', file );
  670.           charcount = 0;
  671.           }
  672. !     (void) putc( *bP ? '1' : '0', file );
  673.       ++charcount;
  674.       }
  675. !     (void) putc( '\n', file );
  676.       }
  677.   
  678.   void
  679. diff -cr pbmplus30oct91/pbm/libpbm4.c pbm/libpbm4.c
  680. *** pbmplus30oct91/pbm/libpbm4.c    Fri Jun 28 14:28:31 1991
  681. --- pbm/libpbm4.c    Tue Dec 10 16:52:47 1991
  682. ***************
  683. *** 34,40 ****
  684.           pm_error( "EOF / read error" );
  685.           ch = (char) ich;
  686.           }
  687. !     while ( ch != '\n' );
  688.       }
  689.   
  690.       return ch;
  691. --- 34,40 ----
  692.           pm_error( "EOF / read error" );
  693.           ch = (char) ich;
  694.           }
  695. !     while ( ch != '\n' && ch != '\r' );
  696.       }
  697.   
  698.       return ch;
  699. ***************
  700. *** 63,69 ****
  701.       {
  702.       ch = pbm_getc( file );
  703.       }
  704. !     while ( ch == ' ' || ch == '\t' || ch == '\n' );
  705.   
  706.       if ( ch < '0' || ch > '9' )
  707.       pm_error( "junk in file where an integer should be" );
  708. --- 63,69 ----
  709.       {
  710.       ch = pbm_getc( file );
  711.       }
  712. !     while ( ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' );
  713.   
  714.       if ( ch < '0' || ch > '9' )
  715.       pm_error( "junk in file where an integer should be" );
  716. diff -cr pbmplus30oct91/pbm/macptopbm.c pbm/macptopbm.c
  717. *** pbmplus30oct91/pbm/macptopbm.c    Fri Jun 28 14:28:33 1991
  718. --- pbm/macptopbm.c    Tue Dec 10 16:52:00 1991
  719. ***************
  720. *** 74,79 ****
  721. --- 74,80 ----
  722.       pbm_writepbmrow( stdout, bitrow, cols, 0 );
  723.       }
  724.   
  725. +     pm_close( stdout );
  726.       exit( 0 );
  727.       }
  728.   
  729. diff -cr pbmplus30oct91/pbm/mgrtopbm.c pbm/mgrtopbm.c
  730. *** pbmplus30oct91/pbm/mgrtopbm.c    Fri Jun 28 14:42:09 1991
  731. --- pbm/mgrtopbm.c    Tue Dec 10 16:52:22 1991
  732. ***************
  733. *** 55,60 ****
  734. --- 55,61 ----
  735.       }
  736.   
  737.       pm_close( ifp );
  738. +     pm_close( stdout );
  739.   
  740.       exit( 0 );
  741.       }
  742. diff -cr pbmplus30oct91/pbm/pbmlife.c pbm/pbmlife.c
  743. *** pbmplus30oct91/pbm/pbmlife.c    Fri Jun 28 14:28:35 1991
  744. --- pbm/pbmlife.c    Tue Dec 10 16:52:34 1991
  745. ***************
  746. *** 107,112 ****
  747. --- 107,113 ----
  748.       }
  749.   
  750.       pm_close( ifp );
  751. +     pm_close( stdout );
  752.   
  753.       exit( 0 );
  754.       }
  755. diff -cr pbmplus30oct91/pbm/pbmmake.c pbm/pbmmake.c
  756. *** pbmplus30oct91/pbm/pbmmake.c    Fri Jun 28 14:28:36 1991
  757. --- pbm/pbmmake.c    Tue Dec 10 16:52:13 1991
  758. ***************
  759. *** 79,83 ****
  760. --- 79,84 ----
  761.       pbm_writepbmrow( stdout, bitrow, cols, 0 );
  762.       }
  763.   
  764. +     pm_close( stdout );
  765.       exit( 0 );
  766.       }
  767. diff -cr pbmplus30oct91/pbm/pbmmask.c pbm/pbmmask.c
  768. *** pbmplus30oct91/pbm/pbmmask.c    Fri Jun 28 14:28:37 1991
  769. --- pbm/pbmmask.c    Tue Dec 10 16:53:07 1991
  770. ***************
  771. *** 133,138 ****
  772. --- 133,139 ----
  773.       pbm_writepbm( stdout, emask, cols, rows, 0 );
  774.       }
  775.   
  776. +     pm_close( stdout );
  777.       exit( 0 );
  778.       }
  779.   
  780. diff -cr pbmplus30oct91/pbm/pbmmerge.c pbm/pbmmerge.c
  781. *** pbmplus30oct91/pbm/pbmmerge.c    Thu Sep 26 18:38:29 1991
  782. --- pbm/pbmmerge.c    Tue Dec 10 16:52:54 1991
  783. ***************
  784. *** 32,38 ****
  785.       goto again;
  786.       }
  787.   
  788. ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) m( argc, argv ); }
  789.   
  790.       TRY( "atktopbm", atktopbm_main );
  791.       TRY( "brushtopbm", brushtopbm_main );
  792. --- 32,38 ----
  793.       goto again;
  794.       }
  795.   
  796. ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) exit( m( argc, argv ) ); }
  797.   
  798.       TRY( "atktopbm", atktopbm_main );
  799.       TRY( "brushtopbm", brushtopbm_main );
  800. diff -cr pbmplus30oct91/pbm/pbmreduce.c pbm/pbmreduce.c
  801. *** pbmplus30oct91/pbm/pbmreduce.c    Sun Jul  7 17:29:03 1991
  802. --- pbm/pbmreduce.c    Tue Dec 10 16:52:28 1991
  803. ***************
  804. *** 193,198 ****
  805. --- 193,199 ----
  806.       }
  807.   
  808.       pm_close( ifp );
  809. +     pm_close( stdout );
  810.   
  811.       exit( 0 );
  812.       }
  813. diff -cr pbmplus30oct91/pbm/pbmtext.c pbm/pbmtext.c
  814. *** pbmplus30oct91/pbm/pbmtext.c    Fri Jun 28 14:28:43 1991
  815. --- pbm/pbmtext.c    Tue Dec 10 16:52:39 1991
  816. ***************
  817. *** 152,157 ****
  818. --- 152,158 ----
  819.   
  820.       /* All done. */
  821.       pbm_writepbm( stdout, bits, cols, rows, 0 );
  822. +     pm_close( stdout );
  823.   
  824.       exit( 0 );
  825.       }
  826. diff -cr pbmplus30oct91/pbm/pbmtocmuwm.c pbm/pbmtocmuwm.c
  827. *** pbmplus30oct91/pbm/pbmtocmuwm.c    Fri Jun 28 14:28:47 1991
  828. --- pbm/pbmtocmuwm.c    Tue Dec 10 16:52:37 1991
  829. ***************
  830. *** 109,116 ****
  831.   static void
  832.   putitem( )
  833.       {
  834. !     if ( putc( item, stdout ) == EOF )
  835. !     pm_error( "write error" );
  836.       item = 0;
  837.       bitsperitem = 0;
  838.       bitshift = 7;
  839. --- 109,115 ----
  840.   static void
  841.   putitem( )
  842.       {
  843. !     (void) putc( item, stdout );
  844.       item = 0;
  845.       bitsperitem = 0;
  846.       bitshift = 7;
  847. diff -cr pbmplus30oct91/pbm/pbmtogem.c pbm/pbmtogem.c
  848. *** pbmplus30oct91/pbm/pbmtogem.c    Fri Jun 28 14:28:51 1991
  849. --- pbm/pbmtogem.c    Tue Dec 10 16:53:00 1991
  850. ***************
  851. *** 155,162 ****
  852.   static void
  853.   putrow( )
  854.       {
  855. !     putc(0x80, stdout);        /* a Bit string */
  856. !     putc(outcol*2, stdout);    /* count */
  857.       fwrite( outrow, outcol*2, 1, stdout );
  858.       outcol = 0;
  859.       }        
  860. --- 155,162 ----
  861.   static void
  862.   putrow( )
  863.       {
  864. !     (void) putc(0x80, stdout);        /* a Bit string */
  865. !     (void) putc(outcol*2, stdout);    /* count */
  866.       fwrite( outrow, outcol*2, 1, stdout );
  867.       outcol = 0;
  868.       }        
  869. diff -cr pbmplus30oct91/pbm/pbmtomacp.c pbm/pbmtomacp.c
  870. *** pbmplus30oct91/pbm/pbmtomacp.c    Fri Jun 28 14:28:57 1991
  871. --- pbm/pbmtomacp.c    Tue Dec 10 16:52:16 1991
  872. ***************
  873. *** 280,286 ****
  874.   
  875.     b = pb;
  876.     while( npb-- )
  877. !     putc( *b++, fdout );
  878.   } /* sendbytes */
  879.   
  880.   /* - - - - - - - - - - - - - - - - - - - - - - - - - - */
  881. --- 280,286 ----
  882.   
  883.     b = pb;
  884.     while( npb-- )
  885. !     (void) putc( *b++, fdout );
  886.   } /* sendbytes */
  887.   
  888.   /* - - - - - - - - - - - - - - - - - - - - - - - - - - */
  889. ***************
  890. *** 293,297 ****
  891.     /* header contains nothing ... */
  892.     ch = '\0';
  893.     for(i = 0; i < HEADER_LENGTH; i++ )
  894. !     putc( ch, fdout );
  895.   } /* header */
  896. --- 293,297 ----
  897.     /* header contains nothing ... */
  898.     ch = '\0';
  899.     for(i = 0; i < HEADER_LENGTH; i++ )
  900. !     (void) putc( ch, fdout );
  901.   } /* header */
  902. diff -cr pbmplus30oct91/pbm/pbmupc.c pbm/pbmupc.c
  903. *** pbmplus30oct91/pbm/pbmupc.c    Fri Jun 28 14:39:31 1991
  904. --- pbm/pbmupc.c    Tue Dec 10 16:52:43 1991
  905. ***************
  906. *** 141,146 ****
  907. --- 141,147 ----
  908.       putdigit( sum, bits, digrow, col + LINE1_WIDTH );
  909.   
  910.       pbm_writepbm( stdout, bits, cols, rows, 0 );
  911. +     pm_close( stdout );
  912.   
  913.       exit( 0 );
  914.       }
  915. diff -cr pbmplus30oct91/pbm/pi3topbm.c pbm/pi3topbm.c
  916. *** pbmplus30oct91/pbm/pi3topbm.c    Fri Jun 28 14:29:09 1991
  917. --- pbm/pi3topbm.c    Tue Dec 10 16:53:02 1991
  918. ***************
  919. *** 90,94 ****
  920. --- 90,95 ----
  921.           pbm_writepbmrow( stdout, bitrow, cols, 0 );
  922.       }
  923.       pm_close( f );
  924. +     pm_close( stdout );
  925.       exit(0);
  926.   }
  927. diff -cr pbmplus30oct91/pbm/xbmtopbm.c pbm/xbmtopbm.c
  928. *** pbmplus30oct91/pbm/xbmtopbm.c    Fri Jun 28 14:29:10 1991
  929. --- pbm/xbmtopbm.c    Tue Dec 10 16:52:02 1991
  930. ***************
  931. *** 63,68 ****
  932. --- 63,69 ----
  933.       pbm_writepbmrow( stdout, bitrow, cols, 0 );
  934.       }
  935.   
  936. +     pm_close( stdout );
  937.       exit( 0 );
  938.       }
  939.   
  940. diff -cr pbmplus30oct91/pbm/ybmtopbm.c pbm/ybmtopbm.c
  941. *** pbmplus30oct91/pbm/ybmtopbm.c    Fri Jun 28 14:42:10 1991
  942. --- pbm/ybmtopbm.c    Tue Dec 10 16:52:57 1991
  943. ***************
  944. *** 60,65 ****
  945. --- 60,66 ----
  946.       }
  947.   
  948.       pm_close( ifp );
  949. +     pm_close( stdout );
  950.   
  951.       exit( 0 );
  952.       }
  953. diff -cr pbmplus30oct91/pgm/Makefile pgm/Makefile
  954. *** pbmplus30oct91/pgm/Makefile    Fri Sep 27 12:33:43 1991
  955. --- pgm/Makefile    Tue Dec 10 16:53:33 1991
  956. ***************
  957. *** 41,53 ****
  958.           pgmenhance pgmhist pgmnorm pgmoil pgmramp \
  959.           pgmtofits pgmtofs pgmtolispm pgmtopbm \
  960.           psidtopgm rawtopgm
  961. ! MATHBINARIES =    pgmedge pgmtexture
  962.   BINARIES =    $(PORTBINARIES) $(MATHBINARIES)
  963.   
  964.   OBJECTS =    fitstopgm.o fstopgm.o hipstopgm.o lispmtopgm.o pgmbentley.o \
  965.           pgmenhance.o pgmhist.o pgmnorm.o pgmoil.o pgmramp.o \
  966.           pgmtofits.o pgmtofs.o pgmtolispm.o pgmtopbm.o \
  967. !         psidtopgm.o rawtopgm.o pgmedge.o pgmtexture.o
  968.   
  969.   MANUALS1 =    $(BINARIES)
  970.   MANUALS3 =    libpgm
  971. --- 41,53 ----
  972.           pgmenhance pgmhist pgmnorm pgmoil pgmramp \
  973.           pgmtofits pgmtofs pgmtolispm pgmtopbm \
  974.           psidtopgm rawtopgm
  975. ! MATHBINARIES =    pgmcrater pgmedge pgmtexture
  976.   BINARIES =    $(PORTBINARIES) $(MATHBINARIES)
  977.   
  978.   OBJECTS =    fitstopgm.o fstopgm.o hipstopgm.o lispmtopgm.o pgmbentley.o \
  979.           pgmenhance.o pgmhist.o pgmnorm.o pgmoil.o pgmramp.o \
  980.           pgmtofits.o pgmtofs.o pgmtolispm.o pgmtopbm.o \
  981. !         psidtopgm.o rawtopgm.o pgmcrater.o pgmedge.o pgmtexture.o
  982.   
  983.   MANUALS1 =    $(BINARIES)
  984.   MANUALS3 =    libpgm
  985. ***************
  986. *** 126,131 ****
  987. --- 126,132 ----
  988.   hipstopgm hipstopgm.o:        hipstopgm.c
  989.   lispmtopgm lispmtopgm.o:    lispmtopgm.c
  990.   pgmbentley pgmbentley.o:    pgmbentley.c
  991. + pgmcrater pgmcrater.o:        pgmcrater.c
  992.   pgmedge pgmedge.o:        pgmedge.c
  993.   pgmenhance pgmenhance.o:    pgmenhance.c
  994.   pgmhist pgmhist.o:        pgmhist.c
  995. diff -cr pbmplus30oct91/pgm/fitstopgm.c pgm/fitstopgm.c
  996. *** pbmplus30oct91/pgm/fitstopgm.c    Wed Sep 25 22:47:36 1991
  997. --- pgm/fitstopgm.c    Tue Dec 10 16:53:53 1991
  998. ***************
  999. *** 186,191 ****
  1000. --- 186,192 ----
  1001.           }
  1002.       }
  1003.       pm_close( ifp );
  1004. +     pm_close( stdout );
  1005.   
  1006.       exit( 0 );
  1007.       }
  1008. diff -cr pbmplus30oct91/pgm/fstopgm.c pgm/fstopgm.c
  1009. *** pbmplus30oct91/pgm/fstopgm.c    Sat Jul  6 10:24:32 1991
  1010. --- pgm/fstopgm.c    Tue Dec 10 16:53:39 1991
  1011. ***************
  1012. *** 105,110 ****
  1013. --- 105,111 ----
  1014.   
  1015.       /* And write out the graymap. */
  1016.       pgm_writepgm( stdout, grays, cols, rows, (gray) maxval, 0 );
  1017. +     pm_close( stdout );
  1018.   
  1019.       exit( 0 );
  1020.       }
  1021. diff -cr pbmplus30oct91/pgm/hipstopgm.c pgm/hipstopgm.c
  1022. *** pbmplus30oct91/pgm/hipstopgm.c    Fri Jun 28 15:10:53 1991
  1023. --- pgm/hipstopgm.c    Tue Dec 10 16:53:41 1991
  1024. ***************
  1025. *** 115,120 ****
  1026. --- 115,121 ----
  1027.       pgm_writepgmrow( stdout, grayrow, cols, (gray) maxval, 0 );
  1028.       }
  1029.       pm_close( ifp );
  1030. +     pm_close( stdout );
  1031.   
  1032.       exit( 0 );
  1033.       }
  1034. diff -cr pbmplus30oct91/pgm/libpgm2.c pgm/libpgm2.c
  1035. *** pbmplus30oct91/pgm/libpgm2.c    Fri Jun 28 14:29:17 1991
  1036. --- pgm/libpgm2.c    Tue Dec 10 16:53:37 1991
  1037. ***************
  1038. *** 41,55 ****
  1039.   #endif /*PBMPLUS_RAWBITS*/
  1040.       }
  1041.   
  1042. ! static int
  1043.   putus( n, file )
  1044.       unsigned short n;
  1045.       FILE* file;
  1046.       {
  1047.       if ( n >= 10 )
  1048. !     if ( putus( n / 10, file ) == EOF )
  1049. !         return EOF;
  1050. !     return putc( n % 10 + '0', file );
  1051.       }
  1052.   
  1053.   #ifdef PBMPLUS_RAWBITS
  1054. --- 41,54 ----
  1055.   #endif /*PBMPLUS_RAWBITS*/
  1056.       }
  1057.   
  1058. ! static void
  1059.   putus( n, file )
  1060.       unsigned short n;
  1061.       FILE* file;
  1062.       {
  1063.       if ( n >= 10 )
  1064. !     putus( n / 10, file );
  1065. !     (void) putc( n % 10 + '0', file );
  1066.       }
  1067.   
  1068.   #ifdef PBMPLUS_RAWBITS
  1069. ***************
  1070. *** 69,76 ****
  1071.       if ( *gP > maxval )
  1072.           pm_error( "value out of bounds (%u > %u)", *gP, maxval );
  1073.   #endif /*DEBUG*/
  1074. !     if ( putc( *gP, file ) == EOF )
  1075. !         pm_error( "write error" );
  1076.       }
  1077.       }
  1078.   #endif /*PBMPLUS_RAWBITS*/
  1079. --- 68,74 ----
  1080.       if ( *gP > maxval )
  1081.           pm_error( "value out of bounds (%u > %u)", *gP, maxval );
  1082.   #endif /*DEBUG*/
  1083. !     (void) putc( *gP, file );
  1084.       }
  1085.       }
  1086.   #endif /*PBMPLUS_RAWBITS*/
  1087. ***************
  1088. *** 90,103 ****
  1089.       {
  1090.       if ( charcount >= 65 )
  1091.           {
  1092. !         if ( putc( '\n', file ) == EOF )
  1093. !         pm_error( "write error" );
  1094.           charcount = 0;
  1095.           }
  1096.       else if ( charcount > 0 )
  1097.           {
  1098. !         if ( putc( ' ', file ) == EOF )
  1099. !         pm_error( "write error" );
  1100.           ++charcount;
  1101.           }
  1102.   #ifdef DEBUG
  1103. --- 88,99 ----
  1104.       {
  1105.       if ( charcount >= 65 )
  1106.           {
  1107. !         (void) putc( '\n', file );
  1108.           charcount = 0;
  1109.           }
  1110.       else if ( charcount > 0 )
  1111.           {
  1112. !         (void) putc( ' ', file );
  1113.           ++charcount;
  1114.           }
  1115.   #ifdef DEBUG
  1116. ***************
  1117. *** 104,116 ****
  1118.       if ( *gP > maxval )
  1119.           pm_error( "value out of bounds (%u > %u)", *gP, maxval );
  1120.   #endif /*DEBUG*/
  1121. !     if ( putus( (unsigned long) *gP, file ) == EOF )
  1122. !         pm_error( "write error" );
  1123.       charcount += 3;
  1124.       }
  1125.       if ( charcount > 0 )
  1126. !     if ( putc( '\n', file ) == EOF )
  1127. !         pm_error( "write error" );
  1128.       }
  1129.   
  1130.   #if __STDC__
  1131. --- 100,110 ----
  1132.       if ( *gP > maxval )
  1133.           pm_error( "value out of bounds (%u > %u)", *gP, maxval );
  1134.   #endif /*DEBUG*/
  1135. !     putus( (unsigned long) *gP, file );
  1136.       charcount += 3;
  1137.       }
  1138.       if ( charcount > 0 )
  1139. !     (void) putc( '\n', file );
  1140.       }
  1141.   
  1142.   #if __STDC__
  1143. diff -cr pbmplus30oct91/pgm/lispmtopgm.c pgm/lispmtopgm.c
  1144. *** pbmplus30oct91/pgm/lispmtopgm.c    Fri Jun 28 15:12:29 1991
  1145. --- pgm/lispmtopgm.c    Tue Dec 10 16:53:54 1991
  1146. ***************
  1147. *** 63,68 ****
  1148. --- 63,69 ----
  1149.       pgm_writepgmrow( stdout, grayrow, cols, (gray) maxval, 0 );
  1150.       }
  1151.       pm_close( ifp );
  1152. +     pm_close( stdout );
  1153.       exit( 0 );
  1154.       }
  1155.   
  1156. diff -cr pbmplus30oct91/pgm/pgm.5 pgm/pgm.5
  1157. *** pbmplus30oct91/pgm/pgm.5    Thu Sep 26 16:13:49 1991
  1158. --- pgm/pgm.5    Tue Dec 10 16:53:34 1991
  1159. ***************
  1160. *** 1,4 ****
  1161. ! .TH pgm 5 "27 September 1991"
  1162.   .SH NAME
  1163.   pgm - portable graymap file format
  1164.   .SH DESCRIPTION
  1165. --- 1,4 ----
  1166. ! .TH pgm 5 "12 November 1991"
  1167.   .SH NAME
  1168.   pgm - portable graymap file format
  1169.   .SH DESCRIPTION
  1170. ***************
  1171. *** 76,82 ****
  1172.   .SH "SEE ALSO"
  1173.   fitstopgm(1), fstopgm(1), hipstopgm(1), lispmtopgm(1), psidtopgm(1),
  1174.   rawtopgm(1),
  1175. ! pgmbentley(1), pgmedge(1), pgmenhance(1), pgmhist(1), pgmnorm(1),
  1176.   pgmoil(1), pgmramp(1), pgmtexture(1),
  1177.   pgmtofits(1), pgmtofs(1), pgmtolispm(1), pgmtopbm(1),
  1178.   pnm(5), pbm(5), ppm(5)
  1179. --- 76,82 ----
  1180.   .SH "SEE ALSO"
  1181.   fitstopgm(1), fstopgm(1), hipstopgm(1), lispmtopgm(1), psidtopgm(1),
  1182.   rawtopgm(1),
  1183. ! pgmbentley(1), pgmcrater(1), pgmedge(1), pgmenhance(1), pgmhist(1), pgmnorm(1),
  1184.   pgmoil(1), pgmramp(1), pgmtexture(1),
  1185.   pgmtofits(1), pgmtofs(1), pgmtolispm(1), pgmtopbm(1),
  1186.   pnm(5), pbm(5), ppm(5)
  1187. diff -cr pbmplus30oct91/pgm/pgmbentley.c pgm/pgmbentley.c
  1188. *** pbmplus30oct91/pgm/pgmbentley.c    Fri Jun 28 14:29:20 1991
  1189. --- pgm/pgmbentley.c    Tue Dec 10 16:54:10 1991
  1190. ***************
  1191. *** 56,61 ****
  1192. --- 56,62 ----
  1193.           }
  1194.   
  1195.       pgm_writepgm( stdout, gout, cols, rows, maxval, 0 );
  1196. +     pm_close( stdout );
  1197.       pgm_freearray( gout, rows );
  1198.   
  1199.       exit( 0 );
  1200. diff -cr pbmplus30oct91/pgm/pgmedge.c pgm/pgmedge.c
  1201. *** pbmplus30oct91/pgm/pgmedge.c    Fri Jun 28 14:29:21 1991
  1202. --- pgm/pgmedge.c    Tue Dec 10 16:54:06 1991
  1203. ***************
  1204. *** 101,105 ****
  1205. --- 101,107 ----
  1206.       orow[col] = 0;
  1207.       pgm_writepgmrow( stdout, orow, cols, maxval, 0 );
  1208.   
  1209. +     pm_close( stdout );
  1210.       exit( 0 );
  1211.       }
  1212. diff -cr pbmplus30oct91/pgm/pgmenhance.c pgm/pgmenhance.c
  1213. *** pbmplus30oct91/pgm/pgmenhance.c    Fri Jun 28 14:29:23 1991
  1214. --- pgm/pgmenhance.c    Tue Dec 10 16:53:43 1991
  1215. ***************
  1216. *** 113,123 ****
  1217.       *ngP = thisrow[cols - 1];
  1218.       pgm_writepgmrow( stdout, newrow, cols, maxval, 0 );
  1219.       }
  1220.   
  1221.       /* Last row. */
  1222.       pgm_writepgmrow( stdout, nextrow, cols, maxval, 0 );
  1223.   
  1224. !     pm_close( ifp );
  1225.   
  1226.       exit( 0 );
  1227.       }
  1228. --- 113,124 ----
  1229.       *ngP = thisrow[cols - 1];
  1230.       pgm_writepgmrow( stdout, newrow, cols, maxval, 0 );
  1231.       }
  1232. +     pm_close( ifp );
  1233.   
  1234.       /* Last row. */
  1235.       pgm_writepgmrow( stdout, nextrow, cols, maxval, 0 );
  1236.   
  1237. !     pm_close( stdout );
  1238.   
  1239.       exit( 0 );
  1240.       }
  1241. diff -cr pbmplus30oct91/pgm/pgmmerge.c pgm/pgmmerge.c
  1242. *** pbmplus30oct91/pgm/pgmmerge.c    Thu Sep 26 16:52:44 1991
  1243. --- pgm/pgmmerge.c    Tue Dec 10 16:54:05 1991
  1244. ***************
  1245. *** 32,38 ****
  1246.       goto again;
  1247.       }
  1248.   
  1249. ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) m( argc, argv ); }
  1250.   
  1251.       TRY("fitstopgm", fitstopgm_main);
  1252.       TRY("fstopgm", fstopgm_main);
  1253. --- 32,38 ----
  1254.       goto again;
  1255.       }
  1256.   
  1257. ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) exit( m( argc, argv ) ); }
  1258.   
  1259.       TRY("fitstopgm", fitstopgm_main);
  1260.       TRY("fstopgm", fstopgm_main);
  1261. ***************
  1262. *** 39,44 ****
  1263. --- 39,45 ----
  1264.       TRY("hipstopgm", hipstopgm_main);
  1265.       TRY("lispmtopgm", lispmtopgm_main);
  1266.       TRY("pgmbentley", pgmbentley_main);
  1267. +     TRY("pgmcrater", pgmcrater_main);
  1268.       TRY("pgmedge", pgmedge_main);
  1269.       TRY("pgmenhance", pgmenhance_main);
  1270.       TRY("pgmhist", pgmhist_main);
  1271. diff -cr pbmplus30oct91/pgm/pgmnorm.c pgm/pgmnorm.c
  1272. *** pbmplus30oct91/pgm/pgmnorm.c    Fri Jun 28 15:14:52 1991
  1273. --- pgm/pgmnorm.c    Tue Dec 10 16:54:00 1991
  1274. ***************
  1275. *** 177,181 ****
  1276. --- 177,182 ----
  1277.           }
  1278.       }
  1279.   
  1280. +     pm_close( stdout );
  1281.       exit( 0 );
  1282.       }
  1283. diff -cr pbmplus30oct91/pgm/pgmoil.c pgm/pgmoil.c
  1284. *** pbmplus30oct91/pgm/pgmoil.c    Wed Oct 30 13:04:36 1991
  1285. --- pgm/pgmoil.c    Tue Dec 10 16:54:11 1991
  1286. ***************
  1287. *** 89,93 ****
  1288. --- 89,94 ----
  1289.       pgm_writepgmrow( stdout, grayrow, cols, maxval, 0 );
  1290.       }
  1291.   
  1292. +     pm_close( stdout );
  1293.       exit( 0 );
  1294.       }
  1295. diff -cr pbmplus30oct91/pgm/pgmramp.c pgm/pgmramp.c
  1296. *** pbmplus30oct91/pgm/pgmramp.c    Sat Oct  5 23:08:10 1991
  1297. --- pgm/pgmramp.c    Tue Dec 10 16:54:04 1991
  1298. ***************
  1299. *** 97,101 ****
  1300. --- 97,102 ----
  1301.       pgm_writepgmrow( stdout, grayrow, cols, PGM_MAXMAXVAL, 0 );
  1302.       }
  1303.   
  1304. +     pm_close( stdout );
  1305.       exit( 0 );
  1306.       }
  1307. diff -cr pbmplus30oct91/pgm/pgmtopbm.c pgm/pgmtopbm.c
  1308. *** pbmplus30oct91/pgm/pgmtopbm.c    Sun Jul  7 17:29:11 1991
  1309. --- pgm/pgmtopbm.c    Tue Dec 10 16:53:48 1991
  1310. ***************
  1311. *** 146,152 ****
  1312.   
  1313.       default:
  1314.       pm_error( "can't happen" );
  1315. -     exit( 1 );
  1316.       }
  1317.   
  1318.       for ( row = 0; row < rows; ++row )
  1319. --- 146,151 ----
  1320. ***************
  1321. *** 255,261 ****
  1322.   
  1323.           default:
  1324.           pm_error( "can't happen" );
  1325. -         exit( 1 );
  1326.           }
  1327.   
  1328.       pbm_writepbmrow( stdout, bitrow, cols, 0 );
  1329. --- 254,259 ----
  1330. ***************
  1331. *** 262,267 ****
  1332. --- 260,266 ----
  1333.       }
  1334.   
  1335.       pm_close( ifp );
  1336. +     pm_close( stdout );
  1337.   
  1338.       exit( 0 );
  1339.       }
  1340. diff -cr pbmplus30oct91/pgm/psidtopgm.c pgm/psidtopgm.c
  1341. *** pbmplus30oct91/pgm/psidtopgm.c    Fri Jun 28 15:17:11 1991
  1342. --- pgm/psidtopgm.c    Tue Dec 10 16:53:51 1991
  1343. ***************
  1344. *** 105,110 ****
  1345. --- 105,111 ----
  1346.       pgm_writepgmrow( stdout, grayrow, cols, (gray) maxval, 0 );
  1347.       }
  1348.       pm_close( ifp );
  1349. +     pm_close( stdout );
  1350.   
  1351.       exit( 0 );
  1352.       }
  1353. diff -cr pbmplus30oct91/pgm/rawtopgm.c pgm/rawtopgm.c
  1354. *** pbmplus30oct91/pgm/rawtopgm.c    Fri Jun 28 14:29:38 1991
  1355. --- pgm/rawtopgm.c    Tue Dec 10 16:53:46 1991
  1356. ***************
  1357. *** 100,105 ****
  1358. --- 100,106 ----
  1359.       pgm_writepgmrow( stdout, grayrow, cols, (gray) 255, 0 );
  1360.       }
  1361.       pm_close( ifp );
  1362. +     pm_close( stdout );
  1363.   
  1364.       exit( 0 );
  1365.       }
  1366. diff -cr pbmplus30oct91/ppm/Makefile ppm/Makefile
  1367. *** pbmplus30oct91/ppm/Makefile    Thu Oct 24 13:34:40 1991
  1368. --- ppm/Makefile    Tue Dec 10 16:55:21 1991
  1369. ***************
  1370. *** 47,73 ****
  1371.   
  1372.   PORTBINARIES =    giftoppm gouldtoppm ilbmtoppm imgtoppm mtvtoppm \
  1373.           pcxtoppm pgmtoppm pi1toppm picttoppm \
  1374. !         pjtoppm ppmdither ppmhist ppmmake ppmquant \
  1375. !         ppmrelief ppmtogif ppmtoicr ppmtoilbm \
  1376. !         ppmtopcx ppmtopgm ppmtopi1 ppmtopict \
  1377.           ppmtopj ppmtopuzz ppmtorgb3 ppmtosixel \
  1378.           ppmtotga ppmtouil ppmtoxpm ppmtoyuv qrttoppm \
  1379. !         rawtoppm rgb3toppm spctoppm sputoppm \
  1380.           tgatoppm ximtoppm xpmtoppm yuvtoppm
  1381. ! MATHBINARIES =    ppmpat
  1382.   BINARIES =    $(PORTBINARIES) $(MATHBINARIES)
  1383.   SCRIPTS =    ppmquantall
  1384.   
  1385.   OBJECTS =    giftoppm.o gouldtoppm.o ilbmtoppm.o imgtoppm.o mtvtoppm.o \
  1386.           pcxtoppm.o pgmtoppm.o pi1toppm.o picttoppm.o \
  1387. !         pjtoppm.o ppmdither.o ppmhist.o ppmmake.o ppmquant.o \
  1388. !         ppmrelief.o ppmtogif.o ppmtoicr.o ppmtoilbm.o \
  1389. !         ppmtopcx.o ppmtopgm.o ppmtopi1.o ppmtopict.o \
  1390.           ppmtopj.o ppmtopuzz.o ppmtorgb3.o ppmtosixel.o \
  1391.           ppmtotga.o ppmtouil.o ppmtoxpm.o ppmtoyuv.o qrttoppm.o \
  1392. !         rawtoppm.o rgb3toppm.o spctoppm.o sputoppm.o \
  1393.           tgatoppm.o ximtoppm.o xpmtoppm.o yuvtoppm.o \
  1394. !         ppmpat.o
  1395.   
  1396.   MANUALS1 =    $(BINARIES) $(SCRIPTS)
  1397.   MANUALS3 =    libppm
  1398. --- 47,73 ----
  1399.   
  1400.   PORTBINARIES =    giftoppm gouldtoppm ilbmtoppm imgtoppm mtvtoppm \
  1401.           pcxtoppm pgmtoppm pi1toppm picttoppm \
  1402. !         pjtoppm ppmdither ppmhist ppmmake \
  1403. !         ppmquant ppmrelief ppmtoacad ppmtogif ppmtoicr \
  1404. !         ppmtoilbm ppmtopcx ppmtopgm ppmtopi1 ppmtopict \
  1405.