home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3246 < prev    next >
Internet Message Format  |  1991-04-28  |  50KB

  1. From: mcastle@mcs213d.cs.umr.edu (Mike Castle {Nexus})
  2. Newsgroups: alt.sources
  3. Subject: PBMPlus on MSDOS patches (01/03)
  4. Message-ID: <2692@umriscc.isc.umr.edu>
  5. Date: 29 Apr 91 03:45:56 GMT
  6.  
  7.  
  8. These are my patches to get most of PBMPlus to work under MSDOS.  When I 
  9. created the diffs, my readme.dos got put at the very end, so look at the
  10. end of the last part if you want to look at that before down loading.  
  11.  
  12. Btw, the original diffs were 160k+, as one file (using gnu diff with
  13. -c -B -H +recursive +new-file or something like that).  I just broke the
  14. file up on file boundaries.  I don't know if patch will work with that or 
  15. not, but it's simple enough to cut out this header and cat or copy them 
  16. together.  -mrc
  17. -------------------------------------------------------
  18.  
  19. diff -c -B -H +new-file +recursive pbmplus.old/makeall.bat pbmplus.new/makeall.bat
  20. *** pbmplus.old/makeall.bat
  21. --- pbmplus.new/makeall.bat    Sun Apr 28 08:39:22 1991
  22. ***************
  23. *** 0 ****
  24. --- 1,27 ----
  25. + rem MAKEALL.BAT for use with GNUMAKE.
  26. + cd pbm
  27. + del *.a
  28. + make -f makefile.pc
  29. + cd ..\pgm
  30. + del *.a
  31. + make -f makefile.pc
  32. + cd ..\ppm 
  33. + del *.a
  34. + make -f makefile.pc
  35. + cd ..\pnm
  36. + del *.a
  37. + copy ..\pbm\*.a
  38. + copy ..\pbm\*.h
  39. + copy ..\pgm\*.a
  40. + copy ..\pgm\*.h
  41. + copy ..\ppm\*.a
  42. + copy ..\ppm\*.h
  43. + make -f makefile.pc
  44. + cd ..
  45. + ECHO Made all 32-bit files.
  46. + ECHO Edit MAKEEXE.BAT to use go32.exe or stub.exe as appropriate.
  47. diff -c -B -H +new-file +recursive pbmplus.old/makeexe.bat pbmplus.new/makeexe.bat
  48. *** pbmplus.old/makeexe.bat
  49. --- pbmplus.new/makeexe.bat    Sun Apr 28 08:27:38 1991
  50. ***************
  51. *** 0 ****
  52. --- 1,22 ----
  53. + rem Edit the following line to point to the correct path to use go32.exe or 
  54. + rem stub.exe
  55. + set  MAKEEXE=c:\gcc\bin\stub.exe
  56. +   
  57. + rem Change the following lines to make only the packages you want.
  58. + cd pbm            
  59. + call exepbm
  60. + cd ..
  61. +    
  62. + cd pgm            
  63. + call exepgm
  64. + cd .. 
  65. + cd ppm            
  66. + call exeppm
  67. + cd ..
  68. + cd pnm            
  69. + call exepnm
  70. + cd ..
  71. + set MAKEEXE=
  72. diff -c -B -H +new-file +recursive pbmplus.old/pbm/brushtop.c pbmplus.new/pbm/brushtop.c
  73. *** pbmplus.old/pbm/brushtop.c    Fri Apr 12 00:30:32 1991
  74. --- pbmplus.new/pbm/brushtop.c    Fri Apr 19 16:31:18 1991
  75. ***************
  76. *** 29,35 ****
  77. --- 29,39 ----
  78.       pm_usage( "[brushfile]" );
  79.   
  80.       if ( argc == 2 )
  81. + #ifdef GNUDOS
  82. +     ifp = pm_openrb( argv[1] );
  83. + #else /* GNUDOS */
  84.       ifp = pm_openr( argv[1] );
  85. + #endif /* GNUDOS */
  86.       else
  87.       ifp = stdin;
  88.   
  89. diff -c -B -H +new-file +recursive pbmplus.old/pbm/cmuwmtop.c pbmplus.new/pbm/cmuwmtop.c
  90. *** pbmplus.old/pbm/cmuwmtop.c    Fri Apr 12 00:30:34 1991
  91. --- pbmplus.new/pbm/cmuwmtop.c    Fri Apr 19 12:48:08 1991
  92. ***************
  93. *** 31,37 ****
  94. --- 31,41 ----
  95.       pm_usage( "[cmuwmfile]" );
  96.   
  97.       if ( argc == 2 )
  98. + #ifdef GNUDOS
  99. +     ifp = pm_openrb( argv[1] );
  100. + #else /* GNUDOS */
  101.       ifp = pm_openr( argv[1] );
  102. + #endif /* GNUDOS */
  103.       else
  104.       ifp = stdin;
  105.   
  106. diff -c -B -H +new-file +recursive pbmplus.old/pbm/delpbm.bat pbmplus.new/pbm/delpbm.bat
  107. *** pbmplus.old/pbm/delpbm.bat
  108. --- pbmplus.new/pbm/delpbm.bat    Fri Apr 12 22:46:42 1991
  109. ***************
  110. *** 0 ****
  111. --- 1,36 ----
  112. + del BRUSHTOP
  113. + del CMUWMTOP
  114. + del G3TOPBM
  115. + del GEMTOPBM
  116. + del ICONTOPB
  117. + del MACPTOPB
  118. + del MGRTOPBM
  119. + del PBMLIFE
  120. + del PBMMAKE
  121. + del PBMMASK
  122. + del PBMPASTE
  123. + del PBMREDUC
  124. + del PBMTEXT
  125. + del PBMTO10X
  126. + del PBMTOASC
  127. + del PBMTOBBN
  128. + del PBMTOCMU
  129. + del PBMTOEPS
  130. + del PBMTOG3
  131. + del PBMTOGEM
  132. + del PBMTOGO
  133. + del PBMTOICO
  134. + del PBMTOLJ
  135. + del PBMTOMAC
  136. + del PBMTOMGR
  137. + del PBMTOPI3
  138. + del PBMTOPLO
  139. + del PBMTOPTX
  140. + del PBMTOX10
  141. + del PBMTOXBM
  142. + del PBMTOYBM
  143. + del PBMTOZIN
  144. + del PBMUPC
  145. + del PI3TOPBM
  146. + del XBMTOPBM
  147. + del YBMTOPBM
  148. diff -c -B -H +new-file +recursive pbmplus.old/pbm/exepbm.bat pbmplus.new/pbm/exepbm.bat
  149. *** pbmplus.old/pbm/exepbm.bat
  150. --- pbmplus.new/pbm/exepbm.bat    Fri Apr 12 22:46:26 1991
  151. ***************
  152. *** 0 ****
  153. --- 1,36 ----
  154. + copy /b c:\gcc\bin\stub.exe+BRUSHTOP    BRUSHTOP.exe
  155. + copy /b c:\gcc\bin\stub.exe+CMUWMTOP    CMUWMTOP.exe
  156. + copy /b c:\gcc\bin\stub.exe+G3TOPBM     G3TOPBM.exe
  157. + copy /b c:\gcc\bin\stub.exe+GEMTOPBM    GEMTOPBM.exe
  158. + copy /b c:\gcc\bin\stub.exe+ICONTOPB    ICONTOPB.exe
  159. + copy /b c:\gcc\bin\stub.exe+MACPTOPB    MACPTOPB.exe
  160. + copy /b c:\gcc\bin\stub.exe+MGRTOPBM    MGRTOPBM.exe
  161. + copy /b c:\gcc\bin\stub.exe+PBMLIFE     PBMLIFE.exe
  162. + copy /b c:\gcc\bin\stub.exe+PBMMAKE     PBMMAKE.exe
  163. + copy /b c:\gcc\bin\stub.exe+PBMMASK     PBMMASK.exe
  164. + copy /b c:\gcc\bin\stub.exe+PBMPASTE    PBMPASTE.exe
  165. + copy /b c:\gcc\bin\stub.exe+PBMREDUC    PBMREDUC.exe
  166. + copy /b c:\gcc\bin\stub.exe+PBMTEXT     PBMTEXT.exe
  167. + copy /b c:\gcc\bin\stub.exe+PBMTO10X    PBMTO10X.exe
  168. + copy /b c:\gcc\bin\stub.exe+PBMTOASC    PBMTOASC.exe
  169. + copy /b c:\gcc\bin\stub.exe+PBMTOBBN    PBMTOBBN.exe
  170. + copy /b c:\gcc\bin\stub.exe+PBMTOCMU    PBMTOCMU.exe
  171. + copy /b c:\gcc\bin\stub.exe+PBMTOEPS    PBMTOEPS.exe
  172. + copy /b c:\gcc\bin\stub.exe+PBMTOG3     PBMTOG3.exe
  173. + copy /b c:\gcc\bin\stub.exe+PBMTOGEM    PBMTOGEM.exe
  174. + copy /b c:\gcc\bin\stub.exe+PBMTOGO     PBMTOGO.exe
  175. + copy /b c:\gcc\bin\stub.exe+PBMTOICO    PBMTOICO.exe
  176. + copy /b c:\gcc\bin\stub.exe+PBMTOLJ     PBMTOLJ.exe
  177. + copy /b c:\gcc\bin\stub.exe+PBMTOMAC    PBMTOMAC.exe
  178. + copy /b c:\gcc\bin\stub.exe+PBMTOMGR    PBMTOMGR.exe
  179. + copy /b c:\gcc\bin\stub.exe+PBMTOPI3    PBMTOPI3.exe
  180. + copy /b c:\gcc\bin\stub.exe+PBMTOPLO    PBMTOPLO.exe
  181. + copy /b c:\gcc\bin\stub.exe+PBMTOPTX    PBMTOPTX.exe
  182. + copy /b c:\gcc\bin\stub.exe+PBMTOX10    PBMTOX10.exe
  183. + copy /b c:\gcc\bin\stub.exe+PBMTOXBM    PBMTOXBM.exe
  184. + copy /b c:\gcc\bin\stub.exe+PBMTOYBM    PBMTOYBM.exe
  185. + copy /b c:\gcc\bin\stub.exe+PBMTOZIN    PBMTOZIN.exe
  186. + copy /b c:\gcc\bin\stub.exe+PBMUPC      PBMUPC.exe
  187. + copy /b c:\gcc\bin\stub.exe+PI3TOPBM    PI3TOPBM.exe
  188. + copy /b c:\gcc\bin\stub.exe+XBMTOPBM    XBMTOPBM.exe
  189. + copy /b c:\gcc\bin\stub.exe+YBMTOPBM    YBMTOPBM.exe
  190. diff -c -B -H +new-file +recursive pbmplus.old/pbm/g3topbm.c pbmplus.new/pbm/g3topbm.c
  191. *** pbmplus.old/pbm/g3topbm.c    Fri Apr 12 00:30:30 1991
  192. --- pbmplus.new/pbm/g3topbm.c    Fri Apr 19 12:48:28 1991
  193. ***************
  194. *** 67,73 ****
  195. --- 67,77 ----
  196.   
  197.       if ( argn < argc )
  198.       {
  199. + #ifdef GNUDOS
  200. +     ifp = pm_openrb( argv[argn] );
  201. + #else /* GNUDOS */
  202.       ifp = pm_openr( argv[argn] );
  203. + #endif /* GNUDOS */
  204.       argn++;
  205.       }
  206.       else
  207. diff -c -B -H +new-file +recursive pbmplus.old/pbm/gemtopbm.c pbmplus.new/pbm/gemtopbm.c
  208. *** pbmplus.old/pbm/gemtopbm.c    Fri Apr 12 00:30:32 1991
  209. --- pbmplus.new/pbm/gemtopbm.c    Fri Apr 19 21:33:30 1991
  210. ***************
  211. *** 32,37 ****
  212. --- 32,43 ----
  213.    * Handle systems that do CR-LF translation on reading / writing and
  214.    * little endians (some guesswork is involved).
  215.    */
  216. + #ifdef GNUDOS
  217. + #ifndef MSDOS
  218. + #define MSDOS
  219. + #endif /* MSDOS */
  220. + #endif /* GNUDOS */
  221.   #ifdef MSDOS
  222.   #define LITTLE_ENDIAN
  223.   #endif /*MSDOS*/
  224. ***************
  225. *** 110,117 ****
  226.       if (argc != 2)
  227.           pm_usage("[-d] <gemfile>");
  228.   
  229.       f = pm_openr( argv[1] );
  230.       if (fread(&hd, sizeof hd, 1, f) != 1)
  231.           pm_perror( "read" );
  232.   
  233. --- 116,126 ----
  234.       if (argc != 2)
  235.           pm_usage("[-d] <gemfile>");
  236.   
  237. + #ifdef GNUDOS
  238. +     f = pm_openrb( argv[1] );
  239. + #else /* GNUDOS */
  240.       f = pm_openr( argv[1] );
  241. ! #endif /* GNUDOS */
  242.       if (fread(&hd, sizeof hd, 1, f) != 1)
  243.           pm_perror( "read" );
  244.   
  245. ***************
  246. *** 120,126 ****
  247.   #endif /*LITTLE_ENDIAN*/
  248.   
  249.       for ( i = sizeof(struct header); i < hd.hlen; ++i )
  250. !         (void) getc(f);
  251.   
  252.       if (debug) {
  253.           pm_message(
  254. --- 129,135 ----
  255.   #endif /*LITTLE_ENDIAN*/
  256.   
  257.       for ( i = sizeof(struct header); i < hd.hlen; ++i )
  258. !         (void) fgetc(f);
  259.   
  260.       if (debug) {
  261.           pm_message(
  262. ***************
  263. *** 140,154 ****
  264.           x = 0;
  265.           linerep = 0;
  266.           while (x < hd.linewid) {
  267. !             switch (c = getc(f)) {
  268.               case 0x80:    /* Bit String */
  269. !                 c = getc(f);    /* Byte count */
  270.                   if (debug)
  271.                       pm_message(
  272.                           "bit string of %d bytes",
  273.                           c, 0,0,0,0);
  274.                   for (j = 0; j < c; ++j) {
  275. !                     cc = getc(f);
  276.                       for (k = 0x80; k; k >>= 1) {
  277.                           bitrow[x] = (k & cc) ? PBM_BLACK : PBM_WHITE;
  278.                           ++x;
  279. --- 149,163 ----
  280.           x = 0;
  281.           linerep = 0;
  282.           while (x < hd.linewid) {
  283. !             switch (c = fgetc(f)) {
  284.               case 0x80:    /* Bit String */
  285. !                 c = fgetc(f);     /* Byte count */
  286.                   if (debug)
  287.                       pm_message(
  288.                           "bit string of %d bytes",
  289.                           c, 0,0,0,0);
  290.                   for (j = 0; j < c; ++j) {
  291. !                     cc = fgetc(f);
  292.                       for (k = 0x80; k; k >>= 1) {
  293.                           bitrow[x] = (k & cc) ? PBM_BLACK : PBM_WHITE;
  294.                           ++x;
  295. ***************
  296. *** 156,162 ****
  297.                   }
  298.                   break;
  299.               case 0:        /* Pattern run */
  300. !                 c = getc(f);    /* Repeat count */
  301.                   if (debug)
  302.                       pm_message(
  303.                           "pattern run of %d repetitions",
  304. --- 165,171 ----
  305.                   }
  306.                   break;
  307.               case 0:        /* Pattern run */
  308. !                 c = fgetc(f);     /* Repeat count */
  309.                   if (debug)
  310.                       pm_message(
  311.                           "pattern run of %d repetitions",
  312. ***************
  313. *** 163,172 ****
  314.                           c, 0,0,0,0);
  315.                                   /* line repeat */
  316.                                   if (c == 0) {
  317. !                                         c = getc(f);
  318.                                           if (c != 0x00ff)
  319.                                                   pm_error( "badly formed line repeat", 0,0,0,0,0 );
  320. !                                         linerep = getc(f);
  321.                                           break;
  322.                                   }
  323.                   fread(pattern, 1, hd.patlen, f);
  324. --- 172,181 ----
  325.                           c, 0,0,0,0);
  326.                                   /* line repeat */
  327.                                   if (c == 0) {
  328. !                                         c = fgetc(f);
  329.                                           if (c != 0x00ff)
  330.                                                   pm_error( "badly formed line repeat", 0,0,0,0,0 );
  331. !                                         linerep = fgetc(f);
  332.                                           break;
  333.                                   }
  334.                   fread(pattern, 1, hd.patlen, f);
  335. diff -c -B -H +new-file +recursive pbmplus.old/pbm/icontopb.c pbmplus.new/pbm/icontopb.c
  336. *** pbmplus.old/pbm/icontopb.c    Fri Apr 12 00:30:28 1991
  337. --- pbmplus.new/pbm/icontopb.c    Fri Apr 19 12:48:42 1991
  338. ***************
  339. *** 27,33 ****
  340. --- 27,37 ----
  341.       pm_usage( "[iconfile]" );
  342.   
  343.       if ( argc == 2 )
  344. + #ifdef GNUDOS
  345. +     ifp = pm_openrb( argv[1] );
  346. + #else /* GNUDOS */
  347.       ifp = pm_openr( argv[1] );
  348. + #endif /* GNUDOS */
  349.       else
  350.       ifp = stdin;
  351.   
  352. diff -c -B -H +new-file +recursive pbmplus.old/pbm/libpbm1.c pbmplus.new/pbm/libpbm1.c
  353. *** pbmplus.old/pbm/libpbm1.c    Fri Apr 12 00:30:34 1991
  354. --- pbmplus.new/pbm/libpbm1.c    Fri Apr 19 16:27:22 1991
  355. ***************
  356. *** 251,256 ****
  357. --- 251,291 ----
  358.       }
  359.       return f;
  360.       }
  361. + #ifdef GNUDOS
  362. + FILE*
  363. + pm_openrb( name )
  364. +     char* name;
  365. +     {
  366. +     FILE* f;
  367. +     if ( strcmp( name, "-" ) == 0 )
  368. +     f = stdin;
  369. +     else
  370. +     {
  371. +     f = fopen( name, "rb" );
  372. +     if ( f == NULL )
  373. +         {
  374. +         pm_perror( name );
  375. +         exit( 1 );
  376. +         }
  377. +     }
  378. +     return f;
  379. +     }
  380. + FILE*
  381. + pm_openwb( name )
  382. +     char* name;
  383. +     {
  384. +     FILE* f;
  385. +     f = fopen( name, "wb" );
  386. +     if ( f == NULL )
  387. +     {
  388. +     pm_perror( name );
  389. +     exit( 1 );
  390. +     }
  391. +     return f;
  392. +     }
  393. + #endif /* GNUDOS */
  394.   
  395.   FILE*
  396.   pm_openw( name )
  397. ***************
  398. *** 275,281 ****
  399.   pm_close( f )
  400.       FILE* f;
  401.       {
  402. !     if ( f != stdin )
  403.       if ( fclose( f ) != 0 )
  404.           pm_perror( "fclose" );
  405.       }
  406. --- 310,316 ----
  407.   pm_close( f )
  408.       FILE* f;
  409.       {
  410. !     if ( f != stdin && f != stdout )
  411.       if ( fclose( f ) != 0 )
  412.           pm_perror( "fclose" );
  413.       }
  414. diff -c -B -H +new-file +recursive pbmplus.old/pbm/macptopb.c pbmplus.new/pbm/macptopb.c
  415. *** pbmplus.old/pbm/macptopb.c    Fri Apr 12 00:30:28 1991
  416. --- pbmplus.new/pbm/macptopb.c    Fri Apr 19 12:43:54 1991
  417. ***************
  418. *** 44,50 ****
  419. --- 44,54 ----
  420.   
  421.       if ( argn < argc )
  422.       {
  423. + #ifdef GNUDOS
  424. +     ifp = pm_openrb( argv[argn] );
  425. + #else /* GNUDOS */
  426.       ifp = pm_openr( argv[argn] );
  427. + #endif /* GNUDOS */
  428.       argn++;
  429.       }
  430.       else
  431. diff -c -B -H +new-file +recursive pbmplus.old/pbm/makefile.pc pbmplus.new/pbm/makefile.pc
  432. *** pbmplus.old/pbm/makefile.pc
  433. --- pbmplus.new/pbm/makefile.pc    Fri Apr 19 16:15:02 1991
  434. ***************
  435. *** 0 ****
  436. --- 1,145 ----
  437. + # Makefile for pbm tools.
  438. + #
  439. + # Copyright (C) 1989, 1991 by Jef Poskanzer.
  440. + #
  441. + # Permission to use, copy, modify, and distribute this software and its
  442. + # documentation for any purpose and without fee is hereby granted, provided
  443. + # that the above copyright notice appear in all copies and that both that
  444. + # copyright notice and this permission notice appear in supporting
  445. + # documentation.  This software is provided "as is" without express or
  446. + # implied warranty.
  447. + # Default values, usually overridden by top-level Makefile.
  448. + #CC =        cc
  449. + CC =        gcc -fcombine-regs
  450. + #CFLAGS =    -O
  451. + CFLAGS =    -g
  452. + #CFLAGS =    -g -O
  453. + #LDFLAGS =    -s
  454. + LDFLAGS =    
  455. + INSTALLBINARIES =    /usr/new/pbm
  456. + INSTALLMANUALS1 =    /usr/man/man1
  457. + SUFFIXMANUALS1 =    1
  458. + INSTALLMANUALS3 =    /usr/man/man3
  459. + SUFFIXMANUALS3 =    3
  460. + INSTALLMANUALS5 =    /usr/man/man5
  461. + SUFFIXMANUALS5 =    5
  462. + MANCP =            cp
  463. + SHELL =        /bin/sh
  464. + ALLCFLAGS =    $(CFLAGS)
  465. + LIBPBM =    libpbm.a
  466. + BINARIES =    brushtopbm cmuwmtopbm g3topbm icontopbm gemtopbm \
  467. +         macptopbm mgrtopbm pbmlife pbmmake pbmmask \
  468. +         pbmpaste pbmreduce pbmtext pbmto10x pbmtoascii \
  469. +         pbmtobbnbg pbmtocmuwm pbmtoepson pbmtog3 \
  470. +         pbmtogem pbmtogo pbmtoicon pbmtolj pbmtomacp \
  471. +         pbmtomgr pbmtopi3 pbmtoplot pbmtoptx \
  472. +         pbmtox10bm pbmtoxbm pbmtoybm pbmtozinc \
  473. +         pbmupc pi3topbm xbmtopbm \
  474. +         ybmtopbm
  475. + OBJECTS =    brushtopbm.o cmuwmtopbm.o g3topbm.o icontopbm.o gemtopbm.o \
  476. +         macptopbm.o mgrtopbm.o pbmlife.o pbmmake.o pbmmask.o \
  477. +         pbmpaste.o pbmreduce.o pbmtext.o pbmto10x.o pbmtoascii.o \
  478. +         pbmtobbnbg.o pbmtocmuwm.o pbmtoepson.o pbmtog3.o \
  479. +         pbmtogem.o pbmtogo.o pbmtoicon.o pbmtolj.o pbmtomacp.o \
  480. +         pbmtomgr.o pbmtopi3.o pbmtoplot.o pbmtoptx.o \
  481. +         pbmtox10bm.o pbmtoxbm.o pbmtoybm.o pbmtozinc.o \
  482. +         pbmupc.o pi3topbm.o xbmtopbm.o \
  483. +         ybmtopbm.o
  484. + MANUALS1 =    $(BINARIES)
  485. + MANUALS3 =    libpbm
  486. + MANUALS5 =    pbm
  487. + all:        binaries
  488. + binaries:    $(BINARIES)
  489. + installbinaries:    binaries
  490. +     cd $(INSTALLBINARIES)
  491. +     cp $(BINARIES) $(INSTALLBINARIES)
  492. + merge:        pbmmerge
  493. + pbmmerge:    pbmmerge.c $(OBJECTS) $(LIBPBM)
  494. +     $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c $(OBJECTS) $(LIBPBM)
  495. + installmerge:    installpbmmerge
  496. + installpbmmerge:    pbmmerge
  497. +     cd $(INSTALLBINARIES)
  498. +     cp pbmmerge $(INSTALLBINARIES)
  499. +     cd $(INSTALLBINARIES) ; for i in $(BINARIES) ; do ln pbmmerge $$i ; done
  500. + installmanuals:
  501. +     for i in $(MANUALS1) ; do $(MANCP) $$i.1 $(INSTALLMANUALS1)/$$i.$(SUFFIXMANUALS1) ; done
  502. +     for i in $(MANUALS3) ; do $(MANCP) $$i.3 $(INSTALLMANUALS3)/$$i.$(SUFFIXMANUALS3) ; done
  503. +     for i in $(MANUALS5) ; do $(MANCP) $$i.5 $(INSTALLMANUALS5)/$$i.$(SUFFIXMANUALS5) ; done
  504. + # Rules for plain programs.
  505. + $(BINARIES):    pbm.h ../pbmplus.h $(LIBPBM)
  506. +     $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c $(LIBPBM)
  507. + $(OBJECTS):    pbm.h ../pbmplus.h
  508. +     $(CC) $(ALLCFLAGS) "-Dmain=$*_main" -c $*.c
  509. + # And library.
  510. + lib:        $(LIBPBM)
  511. + $(LIBPBM):    libpbm1.o libpbm2.o libpbm3.o libpbm4.o libpbm5.o
  512. +     ar rc $(LIBPBM) libpbm1.o libpbm2.o libpbm3.o libpbm4.o libpbm5.o
  513. + libpbm1.o:    pbm.h ../pbmplus.h libpbm.h libpbm1.c
  514. +     $(CC) $(ALLCFLAGS) -c libpbm1.c
  515. + libpbm2.o:    pbm.h ../pbmplus.h libpbm.h libpbm2.c
  516. +     $(CC) $(ALLCFLAGS) -c libpbm2.c
  517. + libpbm3.o:    pbm.h ../pbmplus.h libpbm.h libpbm3.c
  518. +     $(CC) $(ALLCFLAGS) -c libpbm3.c
  519. + libpbm4.o:    pbm.h ../pbmplus.h libpbm.h libpbm4.c
  520. +     $(CC) $(ALLCFLAGS) -c libpbm4.c
  521. + libpbm5.o:    pbm.h ../pbmplus.h pbmfont.h libpbm5.c
  522. +     $(CC) $(ALLCFLAGS) -c libpbm5.c
  523. + # Other dependencies.
  524. + brushtopbm brushtopbm.o:    brushtopbm.c
  525. + cmuwmtopbm cmuwmtopbm.o:    cmuwmtopbm.c cmuwm.h
  526. + g3topbm g3topbm.o:        g3topbm.c g3.h
  527. + icontopbm icontopbm.o:        icontopbm.c
  528. + gemtopbm gemtopbm.o:        gemtopbm.c
  529. + macptopbm macptopbm.o:        macptopbm.c macp.h
  530. + mgrtopbm mgrtopbm.o:        mgrtopbm.c mgr.h
  531. + pbmlife pbmlife.o:        pbmlife.c
  532. + pbmmake pbmmake.o:        pbmmake.c
  533. + pbmmask pbmmask.o:        pbmmask.c
  534. + pbmpaste pbmpaste.o:        pbmpaste.c
  535. + pbmreduce pbmreduce.o:        pbmreduce.c
  536. + pbmtext pbmtext.o:        pbmtext.c pbmfont.h
  537. + pbmto10x pbmto10x.o:        pbmto10x.c
  538. + pbmtoascii pbmtoascii.o:    pbmtoascii.c
  539. + pbmtobbnbg pbmtobbnbg.o:    pbmtobbnbg.c
  540. + pbmtocmuwm pbmtocmuwm.o:    pbmtocmuwm.c cmuwm.h
  541. + pbmtoepson pbmtoepson.o:    pbmtoepson.c
  542. + pbmtog3 pbmtog3.o:        pbmtog3.c g3.h
  543. + pbmtogem pbmtogem.o:        pbmtogem.c
  544. + pbmtogo pbmtogo.o:        pbmtogo.c
  545. + pbmtoicon pbmtoicon.o:        pbmtoicon.c
  546. + pbmtolj pbmtolj.o:        pbmtolj.c
  547. + pbmtomacp pbmtomacp.o:        pbmtomacp.c macp.h
  548. + pbmtomgr pbmtomgr.o:        pbmtomgr.c mgr.h
  549. + pbmtopi3 pbmtopi3.o:        pbmtopi3.c
  550. + pbmtoplot pbmtoplot.o:        pbmtoplot.c
  551. + pbmtoptx pbmtoptx.o:        pbmtoptx.c
  552. + pbmtox10bm pbmtox10bm.o:    pbmtox10bm.c
  553. + pbmtoxbm pbmtoxbm.o:        pbmtoxbm.c
  554. + pbmtoybm pbmtoybm.o:        pbmtoybm.c
  555. + pbmtozinc pbmtozinc.o:        pbmtozinc.c
  556. + pbmupc pbmupc.o:        pbmupc.c
  557. + pi3topbm pi3topbm.o:        pi3topbm.c
  558. + xbmtopbm xbmtopbm.o:        xbmtopbm.c
  559. + ybmtopbm ybmtopbm.o:        ybmtopbm.c
  560. diff -c -B -H +new-file +recursive pbmplus.old/pbm/mgrtopbm.c pbmplus.new/pbm/mgrtopbm.c
  561. *** pbmplus.old/pbm/mgrtopbm.c    Fri Apr 12 00:30:32 1991
  562. --- pbmplus.new/pbm/mgrtopbm.c    Fri Apr 19 12:47:34 1991
  563. ***************
  564. *** 30,36 ****
  565. --- 30,40 ----
  566.       pm_usage( "[mgrfile]" );
  567.   
  568.       if ( argc == 2 )
  569. + #ifdef GNUDOS
  570. +     ifp = pm_openrb( argv[1] );
  571. + #else /* GNUDOS */
  572.       ifp = pm_openr( argv[1] );
  573. + #endif /* GNUDOS */
  574.       else
  575.       ifp = stdin;
  576.   
  577. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmto10x.c pbmplus.new/pbm/pbmto10x.c
  578. *** pbmplus.old/pbm/pbmto10x.c    Fri Apr 12 00:30:36 1991
  579. --- pbmplus.new/pbm/pbmto10x.c    Fri Apr 19 19:53:08 1991
  580. ***************
  581. *** 19,28 ****
  582. --- 19,35 ----
  583.   FILE    *ifp;
  584.   int    rows, cols, format;
  585.   
  586. + #ifdef GNUDOS
  587. + FILE* ofp;
  588. + char fname[100], *fcp;
  589. + #endif /* GNUDOS */
  590.   void main(argc, argv)
  591.       int    argc;
  592.       char    *argv[];
  593.   {
  594. +     fprintf(stderr,"%ld", argc);
  595. +     fflush(stderr);
  596.       pbm_init( &argc, argv );
  597.       if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'h')
  598.       {
  599. ***************
  600. *** 37,42 ****
  601. --- 44,61 ----
  602.       else
  603.           ifp = stdin;
  604.   
  605. + #ifdef GNUDOS
  606. +     if ( ifp == stdin )  
  607. +         strcpy( fname, "noname" );
  608. +     else {
  609. +         strcpy( fname, argv[1] );
  610. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  611. +             *fcp = '\0';
  612. +         }
  613. +     strcat( fname, ".10x" );
  614. +     ofp = pm_openwb( fname );
  615. + #endif /* GNUDOS */ 
  616.       pbm_readpbminit(ifp, &cols, &rows, &format);
  617.       if (highres)
  618.           res_120x144();
  619. ***************
  620. *** 44,49 ****
  621. --- 63,73 ----
  622.           res_60x72();
  623.   
  624.       pm_close(ifp);
  625. + #ifdef GNUDOS
  626. +     pm_close( ofp );
  627. + #endif /* GNUDOS */
  628. +  
  629.       exit(0);
  630.   }
  631.   
  632. ***************
  633. *** 54,60 ****
  634.   
  635.       for (i = 0; i < LOW_RES_ROWS; ++i)
  636.           bitrows[i] = pbm_allocrow(cols);
  637. !     printf("\033A\010");        /* '\n' = 8/72 */
  638.       for (row = 0; row < rows; row += LOW_RES_ROWS)
  639.       {
  640.           if (row + LOW_RES_ROWS <= rows)
  641. --- 78,89 ----
  642.   
  643.       for (i = 0; i < LOW_RES_ROWS; ++i)
  644.           bitrows[i] = pbm_allocrow(cols);
  645. ! #ifdef GNUDOS
  646. !     fprintf( ofp, "\033A\010");        /* '\n' = 8/72 */
  647. ! #else /* GNUDOS */
  648. !     printf("\033A\010");        /* '\n' = 8/72 */
  649. ! #endif /* GNUDOS */
  650.       for (row = 0; row < rows; row += LOW_RES_ROWS)
  651.       {
  652.           if (row + LOW_RES_ROWS <= rows)
  653. ***************
  654. *** 63,69 ****
  655. --- 92,102 ----
  656.               npins = rows - row;
  657.           for (i = 0; i < npins; ++i)
  658.               pbm_readpbmrow(ifp, bP[i] = bitrows[i], cols, format);
  659. + #ifdef GNUDOS
  660. +         fprintf( ofp, "\033K%c%c", cols % 256, cols / 256);
  661. + #else /* GNUDOS */
  662.           printf("\033K%c%c", cols % 256, cols / 256);
  663. + #endif /* GNUDOS */
  664.           for (col = 0; col < cols; ++col)
  665.           {
  666.               item = 0;
  667. ***************
  668. *** 70,78 ****
  669. --- 103,117 ----
  670.               for (i = 0; i < npins; ++i)
  671.                   if (*(bP[i]++) == PBM_BLACK)
  672.                       item |= 1 << (7 - i);
  673. + #ifdef GNUDOS
  674. +             fputc(item, ofp );
  675. +         }
  676. +         fputc('\n', ofp );
  677. + #else /* GNUDOS */
  678.               putchar(item);
  679.           }
  680.           putchar('\n');
  681. + #endif /* GNUDOS */
  682.       }
  683.   }
  684.   
  685. ***************
  686. *** 83,89 ****
  687. --- 122,133 ----
  688.   
  689.       for (i = 0; i < HIGH_RES_ROWS; ++i)
  690.           bitrows[i] = pbm_allocrow(cols);
  691. + #ifdef GNUDOS
  692. +     fputc('\033', ofp); fputc('3', ofp ); fputc('\0', ofp );
  693. + #else /* GNUDOS */
  694.       putchar('\033'); putchar('3'); putchar('\0');
  695. + #endif /* GNUDOS */
  696.       for (row = 0; row < rows; row += HIGH_RES_ROWS)
  697.       {
  698.           if (row + HIGH_RES_ROWS <= rows)
  699. ***************
  700. *** 92,98 ****
  701. --- 136,146 ----
  702.               npins = rows - row;
  703.           for (i = 0; i < npins; ++i)
  704.               pbm_readpbmrow(ifp, bP[i] = bitrows[i], cols, format);
  705. + #ifdef GNUDOS
  706. +         fprintf( ofp, "\033L%c%c", cols % 256, cols / 256);
  707. + #else /* GNUDOS */
  708.           printf("\033L%c%c", cols % 256, cols / 256);
  709. + #endif /* GNUDOS */
  710.           for (col = 0; col < cols; ++col)
  711.           {
  712.               item = 0;
  713. ***************
  714. *** 100,110 ****
  715. --- 148,169 ----
  716.               for (pin = i = 0; i < npins; i += 2, ++pin)
  717.                   if (*(bP[i]++) == PBM_BLACK)
  718.                       item |= 1 << (7 - pin);
  719. + #ifdef GNUDOS
  720. +             fputc(item, ofp );
  721. + #else /* GNUDOS */
  722.               putchar(item);
  723. + #endif /* GNUDOS */
  724.           }
  725. + #ifdef GNUDOS
  726. +         fputc('\n', ofp );          /* flush buffer */
  727. +         fprintf( ofp, "\033J\001");        /* 1/144 down */
  728. +         fprintf( ofp, "\033L%c%c", cols % 256, cols / 256);
  729. + #else /* GNUDOS */
  730.           putchar('\n');            /* flush buffer */
  731.           printf("\033J\001");        /* 1/144 down */
  732.           printf("\033L%c%c", cols % 256, cols / 256);
  733. + #endif /* GNUDOS */
  734.           for (col = 0; col < cols; ++col)
  735.           {
  736.               item = 0;
  737. ***************
  738. *** 112,120 ****
  739. --- 171,188 ----
  740.               for (i = 1, pin = 0; i < npins; i += 2, ++pin)
  741.                   if (*(bP[i]++) == PBM_BLACK)
  742.                       item |= 1 << (7 - pin);
  743. + #ifdef GNUDOS
  744. +             fputc( item, ofp );
  745. + #else /* GNUDOS */
  746.               putchar(item);
  747. + #endif /* GNUDOS */
  748.           }
  749. + #ifdef GNUDOS
  750. +         fputc('\n', ofp );          /* flush buffer */
  751. +         fprintf( ofp, "\033J\017");        /* 15/144 down */
  752. + #else /* GNUDOS */
  753.           putchar('\n');            /* flush buffer */
  754.           printf("\033J\017");        /* 15/144 down */
  755. + #endif /* GNUDOS */
  756.       }
  757.   }
  758. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtoasc.c pbmplus.new/pbm/pbmtoasc.c
  759. *** pbmplus.old/pbm/pbmtoasc.c    Fri Apr 12 00:30:30 1991
  760. --- pbmplus.new/pbm/pbmtoasc.c    Fri Apr 19 19:57:32 1991
  761. ***************
  762. *** 12,17 ****
  763. --- 12,22 ----
  764.   
  765.   #include "pbm.h"
  766.   
  767. + #ifdef GNUDOS
  768. + FILE* ofp;
  769. + char fname[100], *fcp;
  770. + #endif /* GNUDOS */
  771.   void main( argc, argv )
  772.   int argc;
  773.   char *argv[];
  774. ***************
  775. *** 30,35 ****
  776. --- 35,52 ----
  777.       else
  778.       ifp = stdin;
  779.   
  780. + #ifdef GNUDOS
  781. +     if ( ifp == stdin )  
  782. +         strcpy( fname, "noname" );
  783. +     else {
  784. +         strcpy( fname, argv[1] );
  785. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  786. +             *fcp = '\0';
  787. +         }
  788. +     strcat( fname, ".asc" );
  789. +     ofp = pm_openwb( fname );
  790. + #endif /* GNUDOS */
  791.       bits = pbm_readpbm( ifp, &cols, &rows );
  792.   
  793.       pm_close( ifp );
  794. ***************
  795. *** 50,69 ****
  796. --- 67,106 ----
  797.           if ( *bP == PBM_WHITE )
  798.           {
  799.           if ( row+1 >= rows || *b1P == PBM_WHITE )
  800. + #ifdef GNUDOS
  801. +             fputc( ' ', ofp );
  802. +         else
  803. +             fputc( 'o', ofp );
  804. + #else /* GNUDOS */
  805.               putchar( ' ' );
  806.           else
  807.               putchar( 'o' );
  808. + #endif /* GNUDOS */
  809.           }
  810.           else
  811.           {
  812.           if ( row+1 >= rows || *b1P == PBM_WHITE )
  813. + #ifdef GNUDOS
  814. +             fputc( '"', ofp );
  815. +         else
  816. +             fputc( '$', ofp );
  817. + #else /* GNUDOS */
  818.               putchar( '"' );
  819.           else
  820.               putchar( '$' );
  821. + #endif /* GNUDOS */
  822.           }
  823.           }
  824. + #ifdef GNUDOS
  825. +     fputc( '\n', ofp );
  826. + #else /* GNUDOS */
  827.       putchar( '\n' );
  828. + #endif /* GNUDOS */
  829.           }
  830. + #ifdef GNUDOS
  831. +     pm_close( ofp );
  832. + #endif /* GNUDOS */
  833.   
  834.       exit( 0 );
  835.       }
  836. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtobbn.c pbmplus.new/pbm/pbmtobbn.c
  837. *** pbmplus.old/pbm/pbmtobbn.c    Fri Apr 12 00:30:36 1991
  838. --- pbmplus.new/pbm/pbmtobbn.c    Fri Apr 19 18:16:46 1991
  839. ***************
  840. *** 19,24 ****
  841. --- 19,29 ----
  842.   
  843.   int nco;
  844.   
  845. + #ifdef GNUDOS
  846. + FILE* ofp;
  847. + char fname[100], *fcp;
  848. + #endif /* GNUDOS */
  849.   void main(argc,argv)
  850.   int argc;
  851.   char **argv;
  852. ***************
  853. *** 37,42 ****
  854. --- 42,52 ----
  855.   
  856.    pbm_init( &argc, argv );
  857.   
  858. + #ifdef GNUDOS
  859. +     strcpy( fname, "noname.bbn" );
  860. +     ofp = pm_openwb( fname );
  861. + #endif /* GNUDOS */
  862.    op = 3;
  863.    switch (argc)
  864.     { case 1:
  865. ***************
  866. *** 47,64 ****
  867.       case 3:
  868.          x = atoi(argv[1]);
  869.          y = atoi(argv[2]);
  870. !        printf("\33:%d;%dm",x,y);
  871.          break;
  872.       case 4:
  873.          op = atoi(argv[1]);
  874.          x = atoi(argv[2]);
  875.          y = atoi(argv[3]);
  876. !        printf("\33:%d;%dm",x,y);
  877.          break;
  878.     }
  879.    nco = 0;
  880.    pbm_readpbminit(stdin,&cols,&rows,&format);
  881.    printf("\33P:%d;%d;%ds\n",op,cols,rows);
  882.    bitrow = pbm_allocrow(cols);
  883.    for (row=0;row<rows;row++)
  884.     { pbm_readpbmrow(stdin,bitrow,cols,format);
  885. --- 57,88 ----
  886.       case 3:
  887.          x = atoi(argv[1]);
  888.          y = atoi(argv[2]);
  889. ! #ifdef GNUDOS
  890. !        fprintf( ofp, "\33:%d;%dm",x,y);
  891. ! #else /* GNUDOS */
  892. !        printf("\33:%d;%dm",x,y);
  893. ! #endif /* GNUDOS */
  894.          break;
  895.       case 4:
  896.          op = atoi(argv[1]);
  897.          x = atoi(argv[2]);
  898.          y = atoi(argv[3]);
  899. ! #ifdef GNUDOS
  900. !        fprintf( ofp, "\33:%d;%dm",x,y);
  901. ! #else /* GNUDOS */
  902. !        printf("\33:%d;%dm",x,y);
  903. ! #endif /* GNUDOS */
  904.          break;
  905.     }
  906.    nco = 0;
  907.    pbm_readpbminit(stdin,&cols,&rows,&format);
  908. + #ifdef GNUDOS
  909. +  fprintf( ofp, "\33P:%d;%d;%ds\n",op,cols,rows);
  910. + #else /* GNUDOS */
  911.    printf("\33P:%d;%d;%ds\n",op,cols,rows);
  912. + #endif /* GNUDOS */
  913.    bitrow = pbm_allocrow(cols);
  914.    for (row=0;row<rows;row++)
  915.     { pbm_readpbmrow(stdin,bitrow,cols,format);
  916. ***************
  917. *** 76,83 ****
  918.       if (mask != 0x8000)
  919.        { write16(sixteen);
  920.        }
  921. !   }
  922. !  puts("\033\\");
  923.    exit(0);
  924.   }
  925.   
  926. --- 100,112 ----
  927.       if (mask != 0x8000)
  928.        { write16(sixteen);
  929.        }
  930. !   } 
  931. ! #ifdef GNUDOS
  932. !  fputs( "\033\\\n", ofp );
  933. !  pm_close( ofp );
  934. ! #else /* GNUDOS */
  935. !  puts("\033\\");  
  936. ! #endif /* GNUDOS */
  937.    exit(0);
  938.   }
  939.   
  940. ***************
  941. *** 85,90 ****
  942. --- 114,135 ----
  943.   write16(sixteen)
  944.   unsigned int sixteen;
  945.   {
  946. + #ifdef GNUDOS
  947. +  if (nco > 75)
  948. +   { fputc('\n', ofp );
  949. +     nco = 0;
  950. +   }
  951. +  if (sixteen & 0xfc00)
  952. +   { fputc(0100+(sixteen>>10), ofp );
  953. +     nco ++;
  954. +   }
  955. +  if (sixteen & 0xfff0)
  956. +   { fputc(0100+((sixteen>>4)&0x3f), ofp );
  957. +     nco ++;
  958. +   }
  959. +  fputc(060+(sixteen&0xf), ofp );
  960. +  nco ++;
  961. + #else /* GNUDOS */
  962.    if (nco > 75)
  963.     { putchar('\n');
  964.       nco = 0;
  965. ***************
  966. *** 99,104 ****
  967. --- 144,150 ----
  968.     }
  969.    putchar(060+(sixteen&0xf));
  970.    nco ++;
  971. + #endif /* GNUDOS */
  972.   }
  973.   #else
  974.   /*
  975. ***************
  976. *** 115,121 ****
  977. --- 161,171 ----
  978.       int        signChar;
  979.   
  980.       if (nco > 75) {
  981. + #ifdef GNUDOS
  982. +     fputc( '\n', ofp );
  983. + #else /* GNUDOS */
  984.       putchar ('\n');
  985. + #endif /* GNUDOS */
  986.       nco = 0;
  987.       }
  988.   
  989. ***************
  990. *** 130,135 ****
  991. --- 180,199 ----
  992.       mid    = ((word & 0x3f0) >> 4) + '@';
  993.       low    = (word & 0xf) + signChar;
  994.   
  995. + #ifdef GNUDOS
  996. +     if (high != '@') {
  997. +     fprintf ( ofp, "%c%c%c", high, mid, low);
  998. +     nco += 3;
  999. +     }
  1000. +     else if (mid != '@') {
  1001. +     fprintf ( ofp, "%c%c", mid, low);
  1002. +     nco += 2;
  1003. +     }
  1004. +     else {
  1005. +     fputc( low, ofp );
  1006. +     nco++;
  1007. +     }
  1008. + #else /* GNUDOS */
  1009.       if (high != '@') {
  1010.       printf ("%c%c%c", high, mid, low);
  1011.       nco += 3;
  1012. ***************
  1013. *** 142,146 ****
  1014. --- 206,211 ----
  1015.       putchar (low);
  1016.       nco++;
  1017.       }
  1018. + #endif /* GNUDOS */
  1019.   }
  1020.   #endif
  1021. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtocmu.c pbmplus.new/pbm/pbmtocmu.c
  1022. *** pbmplus.old/pbm/pbmtocmu.c    Fri Apr 12 00:30:34 1991
  1023. --- pbmplus.new/pbm/pbmtocmu.c    Fri Apr 19 19:57:22 1991
  1024. ***************
  1025. *** 15,20 ****
  1026. --- 15,25 ----
  1027.   
  1028.   static void putinit(), putbit(), putrest(), putitem();
  1029.   
  1030. + #ifdef GNUDOS
  1031. + FILE* ofp;
  1032. + char fname[100], *fcp;
  1033. + #endif /* GNUDOS */
  1034.   void main( argc, argv )
  1035.   int argc;
  1036.   char *argv[];
  1037. ***************
  1038. *** 33,38 ****
  1039. --- 38,55 ----
  1040.       else
  1041.       ifp = stdin;
  1042.   
  1043. + #ifdef GNUDOS
  1044. +     if ( ifp == stdin )  
  1045. +         strcpy( fname, "noname" );
  1046. +     else {
  1047. +         strcpy( fname, argv[1] );
  1048. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1049. +             *fcp = '\0';
  1050. +         }
  1051. +     strcat( fname, ".cmu" );
  1052. +     ofp = pm_openwb( fname );
  1053. + #endif /* GNUDOS */
  1054.       pbm_readpbminit( ifp, &cols, &rows, &format );
  1055.       bitrow = pbm_allocrow( cols );
  1056.       
  1057. ***************
  1058. *** 53,58 ****
  1059. --- 70,79 ----
  1060.   
  1061.       putrest( );
  1062.   
  1063. + #ifdef GNUDOS
  1064. +     pm_close( ofp );
  1065. + #endif /* GNUDOS */
  1066.       exit( 0 );
  1067.       }
  1068.   
  1069. ***************
  1070. *** 64,70 ****
  1071.   putinit( rows, cols )
  1072.   int rows, cols;
  1073.       {
  1074. !     if ( pm_writebiglong( stdout, CMUWM_MAGIC ) == -1 )
  1075.       pm_error( "write error", 0,0,0,0,0 );
  1076.       if ( pm_writebiglong( stdout, cols ) == -1 )
  1077.       pm_error( "write error", 0,0,0,0,0 );
  1078. --- 85,101 ----
  1079.   putinit( rows, cols )
  1080.   int rows, cols;
  1081.       {
  1082. ! #ifdef GNUDOS
  1083. !     if ( pm_writebiglong( ofp, CMUWM_MAGIC ) == -1 )
  1084. !     pm_error( "write error", 0,0,0,0,0 );
  1085. !     if ( pm_writebiglong( ofp, cols ) == -1 )
  1086. !     pm_error( "write error", 0,0,0,0,0 );
  1087. !     if ( pm_writebiglong( ofp, rows ) == -1 )
  1088. !     pm_error( "write error", 0,0,0,0,0 );
  1089. !     if ( pm_writebigshort( ofp, (short) 1 ) == -1 )
  1090. !     pm_error( "write error", 0,0,0,0,0 );
  1091. ! #else /* GNUDOS */
  1092. !     if ( pm_writebiglong( stdout, CMUWM_MAGIC ) == -1 )
  1093.       pm_error( "write error", 0,0,0,0,0 );
  1094.       if ( pm_writebiglong( stdout, cols ) == -1 )
  1095.       pm_error( "write error", 0,0,0,0,0 );
  1096. ***************
  1097. *** 72,77 ****
  1098. --- 103,109 ----
  1099.       pm_error( "write error", 0,0,0,0,0 );
  1100.       if ( pm_writebigshort( stdout, (short) 1 ) == -1 )
  1101.       pm_error( "write error", 0,0,0,0,0 );
  1102. + #endif /* GNUDOS */
  1103.   
  1104.       item = 0;
  1105.       bitsperitem = 0;
  1106. ***************
  1107. *** 100,106 ****
  1108. --- 132,142 ----
  1109.   static void
  1110.   putitem( )
  1111.       {
  1112. + #ifdef GNUDOS
  1113. +     if ( putc( item, ofp ) == EOF )
  1114. + #else /* GNUDOS */
  1115.       if ( putc( item, stdout ) == EOF )
  1116. + #endif /* GNUDOS */
  1117.       pm_error( "write error", 0,0,0,0,0 );
  1118.       item = 0;
  1119.       bitsperitem = 0;
  1120. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtoeps.c pbmplus.new/pbm/pbmtoeps.c
  1121. *** pbmplus.old/pbm/pbmtoeps.c    Fri Apr 12 00:30:36 1991
  1122. --- pbmplus.new/pbm/pbmtoeps.c    Fri Apr 19 19:57:18 1991
  1123. ***************
  1124. *** 16,21 ****
  1125. --- 16,26 ----
  1126.   
  1127.   static int mask[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
  1128.   
  1129. + #ifdef GNUDOS
  1130. + FILE* ofp;
  1131. + char fname[100], *fcp;
  1132. + #endif /* GNUDOS */
  1133.   void main( argc, argv )
  1134.       int argc;
  1135.       char* argv[];
  1136. ***************
  1137. *** 37,48 ****
  1138. --- 42,71 ----
  1139.       else
  1140.       ifp = stdin;
  1141.   
  1142. + #ifdef GNUDOS
  1143. +     if ( ifp == stdin )      
  1144. +         strcpy( fname, "noname" );
  1145. +     else {
  1146. +         strcpy( fname, argv[1] );
  1147. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1148. +             *fcp = '\0';
  1149. +         }
  1150. +     strcat( fname, ".epn" );
  1151. +     ofp = pm_openwb( fname );
  1152. + #endif /* GNUDOS */
  1153.       bits = pbm_readpbm( ifp, &cols, &rows );
  1154.   
  1155.       pm_close( ifp );
  1156.       
  1157.       /* Change line spacing to 8/72 inches. */
  1158. + #ifdef GNUDOS
  1159. +     fprintf( ofp, "\033A\010");
  1160. + #else /* GNUDOS */
  1161.       printf("\033A\010");
  1162. + #endif /* GNUDOS */
  1163.       /* Write out rows by eights. */
  1164.       for ( row = 0; row < rows; row += 8 )
  1165.       {
  1166. ***************
  1167. *** 59,65 ****
  1168.           bP[idx] = bits[row+idx];
  1169.       /* Put in plotter (1:1) graphics. */
  1170.       if ( lastcol >= 0 )
  1171. !         printf("\033*\005%c%c", (lastcol+1)%256, (lastcol+1)/256);
  1172.           for ( col = 0; col <= lastcol; ++col )
  1173.           {
  1174.           val = 0;
  1175. --- 82,94 ----
  1176.           bP[idx] = bits[row+idx];
  1177.       /* Put in plotter (1:1) graphics. */
  1178.       if ( lastcol >= 0 )
  1179. ! #ifdef GNUDOS
  1180. !         fprintf( ofp, "\033*\005%c%c", (lastcol+1)%256, (lastcol+1)/256);
  1181. ! #else /* GNUDOS */
  1182. !         printf("\033*\005%c%c", (lastcol+1)%256, (lastcol+1)/256);
  1183. ! #endif /* GNUDOS */
  1184.           for ( col = 0; col <= lastcol; ++col )
  1185.           {
  1186.           val = 0;
  1187. ***************
  1188. *** 66,79 ****
  1189.           for ( idx = 0; idx < 8 && row+idx < rows; ++idx )
  1190.           if ( *bP[idx] == PBM_BLACK )
  1191.               val |= mask[idx];
  1192. !         putchar( val );
  1193.           for ( idx = 0; idx < 8 && row+idx < rows; ++idx )
  1194.           ++bP[idx];
  1195.           }
  1196.       putchar( '\n' );
  1197.           }
  1198.       putchar( '\f' );
  1199.       /* Restore normal line spacing. */
  1200.       printf("\033@");
  1201.       exit( 0 );
  1202. !     }
  1203. --- 95,127 ----
  1204.           for ( idx = 0; idx < 8 && row+idx < rows; ++idx )
  1205.           if ( *bP[idx] == PBM_BLACK )
  1206.               val |= mask[idx];
  1207. ! #ifdef GNUDOS
  1208. !         fputc( val, ofp );
  1209.           for ( idx = 0; idx < 8 && row+idx < rows; ++idx )
  1210.           ++bP[idx];
  1211.           }
  1212. +     fputc( '\n', ofp );
  1213. +         }
  1214. +     fputc( '\f', ofp );
  1215. + #else /* GNUDOS */
  1216. +         putchar( val );     
  1217. +         for ( idx = 0; idx < 8 && row+idx < rows; ++idx )
  1218. +         ++bP[idx];
  1219. +         }
  1220.       putchar( '\n' );
  1221.           }
  1222.       putchar( '\f' );
  1223. + #endif /* GNUDOS */
  1224.       /* Restore normal line spacing. */
  1225. + #ifdef GNUDOS
  1226. +     fprintf( ofp, "\033@");
  1227. +     pm_close( ofp );
  1228. + #else /* GNUDOS */
  1229.       printf("\033@");
  1230. + #endif /* GNUDOS */
  1231.       exit( 0 );
  1232. !     }  
  1233. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtog3.c pbmplus.new/pbm/pbmtog3.c
  1234. *** pbmplus.old/pbm/pbmtog3.c    Fri Apr 12 00:30:32 1991
  1235. --- pbmplus.new/pbm/pbmtog3.c    Fri Apr 19 19:57:16 1991
  1236. ***************
  1237. *** 18,23 ****
  1238. --- 18,28 ----
  1239.   
  1240.   static int reversebits;
  1241.   
  1242. + #ifdef GNUDOS
  1243. + FILE* ofp;
  1244. + char fname[100], *fcp;
  1245. + #endif /* GNUDOS */
  1246.   void main( argc, argv )
  1247.   int argc;
  1248.   char *argv[];
  1249. ***************
  1250. *** 52,57 ****
  1251. --- 57,74 ----
  1252.       if ( argn != argc )
  1253.       pm_usage( usage );
  1254.   
  1255. + #ifdef GNUDOS
  1256. +     if ( ifp == stdin )  
  1257. +         strcpy( fname, "noname" );
  1258. +     else {
  1259. +         strcpy( fname, argv[argc-1] );
  1260. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1261. +             *fcp = '\0';
  1262. +         }
  1263. +     strcat( fname, ".g3" );
  1264. +     ofp = pm_openwb( fname );
  1265. + #endif /* GNUDOS */
  1266.       pbm_readpbminit( ifp, &cols, &rows, &format );
  1267.       bigcols = max( 1728, cols );
  1268.       bitrow = pbm_allocrow( bigcols );
  1269. ***************
  1270. *** 81,86 ****
  1271. --- 98,107 ----
  1272.   
  1273.       pm_close( ifp );
  1274.   
  1275. + #ifdef GNUDOS
  1276. +     pm_close( ofp );
  1277. + #endif /* GNUDOS */
  1278.       exit( 0 );
  1279.       }
  1280.   
  1281. ***************
  1282. *** 198,204 ****
  1283. --- 219,229 ----
  1284.       else
  1285.       shbit = shbit>>1;
  1286.       if((shbit&0xff) == 0) {
  1287. + #ifdef GNUDOS
  1288. +     fputc( shdata, ofp );
  1289. + #else /* GNUDOS */
  1290.       putchar(shdata);
  1291. + #endif /* GNUDOS */
  1292.       shdata = 0;
  1293.       shbit = reversebits ? 0x01 : 0x80;
  1294.       }
  1295. ***************
  1296. *** 209,215 ****
  1297. --- 234,244 ----
  1298.   {
  1299.       if ( ( reversebits && shbit != 0x01 ) ||
  1300.        ( ! reversebits && shbit != 0x80 ) ) {
  1301. + #ifdef GNUDOS
  1302. +     fputc( shdata, ofp );
  1303. + #else /* GNUDOS */
  1304.       putchar(shdata);
  1305. + #endif /* GNUDOS */
  1306.       shdata = 0;
  1307.       shbit = reversebits ? 0x01 : 0x80;
  1308.       }
  1309. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtogem.c pbmplus.new/pbm/pbmtogem.c
  1310. *** pbmplus.old/pbm/pbmtogem.c    Fri Apr 12 00:30:36 1991
  1311. --- pbmplus.new/pbm/pbmtogem.c    Fri Apr 19 22:12:16 1991
  1312. ***************
  1313. *** 40,45 ****
  1314. --- 40,50 ----
  1315.   
  1316.   static void putinit(), putbit(), putrest(), putitem(), putrow();
  1317.   
  1318. + #ifdef GNUDOS
  1319. + FILE* ofp;
  1320. + char fname[100], *fcp;
  1321. + #endif /* GNUDOS */
  1322.   void main( argc, argv )
  1323.       int argc;
  1324.       char* argv[];
  1325. ***************
  1326. *** 58,64 ****
  1327.       if ( argc == 2 )
  1328.       ifp = pm_openr( argv[1] );
  1329.       else
  1330. !     ifp = stdin;
  1331.   
  1332.       pbm_readpbminit( ifp, &cols, &rows, &format );
  1333.       
  1334. --- 63,81 ----
  1335.       if ( argc == 2 )
  1336.       ifp = pm_openr( argv[1] );
  1337.       else
  1338. !     ifp = stdin;    
  1339. ! #ifdef GNUDOS
  1340. !     if ( ifp == stdin )
  1341. !         strcpy( fname, "noname");
  1342. !     else {
  1343. !         strcpy( fname, argv[1] );
  1344. !         if ( ( fcp = index( fname, '.' ) ) != 0 ) 
  1345. !             *fcp = '\0';
  1346. !         }
  1347. !     strcat( fname, ".img" );
  1348. !     ofp = pm_openwb( fname );
  1349. ! #endif /* GNUDOS */
  1350.   
  1351.       pbm_readpbminit( ifp, &cols, &rows, &format );
  1352.       
  1353. ***************
  1354. *** 92,97 ****
  1355. --- 109,118 ----
  1356.   
  1357.       putrest( );
  1358.   
  1359. + #ifdef GNUDOS
  1360. +     pm_close( ofp );
  1361. + #endif /* GNUDOS */
  1362.       exit( 0 );
  1363.       }
  1364.   
  1365. ***************
  1366. *** 101,108 ****
  1367.   static void
  1368.   putinit( hdr )
  1369.       struct header* hdr;
  1370. !     {
  1371.       fwrite( hdr, 32, 1, stdout );
  1372.       item = 0;
  1373.       bitsperitem = 0;
  1374.       bitshift = 15;
  1375. --- 122,133 ----
  1376.   static void
  1377.   putinit( hdr )
  1378.       struct header* hdr;
  1379. !     {        
  1380. ! #ifdef GNUDOS
  1381. !     fwrite( hdr, 32, 1, ofp );
  1382. ! #else /* GNUDOS */
  1383.       fwrite( hdr, 32, 1, stdout );
  1384. + #endif /* GNUDOS */
  1385.       item = 0;
  1386.       bitsperitem = 0;
  1387.       bitshift = 15;
  1388. ***************
  1389. *** 145,152 ****
  1390.   static void
  1391.   putrow( )
  1392.       {
  1393. !     putc(0x80, stdout);        /* a Bit string */
  1394. !     putc(outcol*2, stdout);    /* count */
  1395.       fwrite( outrow, outcol*2, 1, stdout );
  1396.       outcol = 0;
  1397.       }        
  1398. --- 170,183 ----
  1399.   static void
  1400.   putrow( )
  1401.       {
  1402. ! #ifdef GNUDOS
  1403. !     fputc(0x80, ofp );       /* a Bit string */
  1404. !     fputc(outcol*2, ofp ); /* count */
  1405. !     fwrite( outrow, outcol*2, 1, ofp );
  1406. ! #else /* GNUDOS */
  1407. !     fputc(0x80, stdout);     /* a Bit string */
  1408. !     fputc(outcol*2, stdout); /* count */
  1409.       fwrite( outrow, outcol*2, 1, stdout );
  1410. + #endif /* GNUDOS */
  1411.       outcol = 0;
  1412.       }        
  1413. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtogo.c pbmplus.new/pbm/pbmtogo.c
  1414. *** pbmplus.old/pbm/pbmtogo.c    Fri Apr 12 00:30:32 1991
  1415. --- pbmplus.new/pbm/pbmtogo.c    Fri Apr 19 19:57:08 1991
  1416. ***************
  1417. *** 48,53 ****
  1418. --- 48,58 ----
  1419.   
  1420.   unsigned char *scanlineptr;        /* Pointer to current scan line byte */
  1421.   
  1422. + #ifdef GNUDOS
  1423. + FILE *ofp;
  1424. + char fname[100], *fcp;
  1425. + #endif /* GNUDOS */
  1426.   void main( argc, argv )
  1427.   int argc;
  1428.   char *argv[];
  1429. ***************
  1430. *** 77,82 ****
  1431. --- 82,99 ----
  1432.       else
  1433.       ifd = stdin;
  1434.   
  1435. + #ifdef GNUDOS
  1436. +     if ( ifd == stdin )  
  1437. +         strcpy( fname, "noname" );
  1438. +     else {
  1439. +         strcpy( fname, argv[argn-1] );
  1440. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1441. +             *fcp = '\0';
  1442. +         }
  1443. +     strcat( fname, ".go" );
  1444. +     ofp = pm_openwb( fname );
  1445. + #endif /* GNUDOS */
  1446.       pbm_readpbminit(ifd, &cols, &rows, &format);
  1447.       bitrow = pbm_allocrow(cols);
  1448.   
  1449. ***************
  1450. *** 91,97 ****
  1451.       putinit();
  1452.   
  1453.       /* Start donwloading screen raster */
  1454. !     printf("\033P0;1;0;4;1;%d;%d;1!R1/", rows, rucols);
  1455.   
  1456.       linerepeat = 63;            /*  63 means "Start new picture" */
  1457.       for (row = 0; row < rows; row++)
  1458. --- 108,118 ----
  1459.       putinit();
  1460.   
  1461.       /* Start donwloading screen raster */
  1462. ! #ifdef GNUDOS
  1463. !     fprintf( ofp, "\033P0;1;0;4;1;%d;%d;1!R1/", rows, rucols);
  1464. ! #else /* GNUDOS */
  1465. !     printf("\033P0;1;0;4;1;%d;%d;1!R1/", rows, rucols);
  1466. ! #endif /* GNUDOS */
  1467.   
  1468.       linerepeat = 63;            /*  63 means "Start new picture" */
  1469.       for (row = 0; row < rows; row++)
  1470. ***************
  1471. *** 122,128 ****
  1472. --- 143,153 ----
  1473.       ** repeat count to cause the old line(s) to be plotted on the screen,
  1474.       ** copy the new data into the internal buffer, and reset the counters.
  1475.       */
  1476. + #ifdef GNUDOS
  1477. +     fputc(linerepeat, ofp );
  1478. + #else /* GNUDOS */
  1479.       putchar(linerepeat);
  1480. + #endif /* GNUDOS */
  1481.       for (i = 0; i < bytesperrow; ++i)
  1482.           buffer[i] = diff[i];
  1483.       nbyte = 0;            /* Internal buffer byte counter */
  1484. ***************
  1485. *** 196,206 ****
  1486. --- 221,240 ----
  1487.           goto nextrow;
  1488.       } /* while (TRUE) */
  1489.   
  1490. + #ifdef GNUDOS
  1491. + nextrow: fprintf( ofp, "%d/", nout+1);     /* Total bytes to transfer = nout+1 */
  1492. +         fflush( ofp );           
  1493. + #else /* GNUDOS */
  1494.   nextrow: printf("%d/", nout+1);        /* Total bytes to transfer = nout+1 */
  1495.           fflush(stdout);
  1496. + #endif /* GNUDOS */
  1497.   
  1498.       /* Output the plot data */
  1499. + #ifdef GNUDOS
  1500. +     fwrite( outbuffer, 1, nout, ofp );
  1501. + #else /* GNUDOS */
  1502.       write(1, outbuffer, nout);
  1503. + #endif /* GNUDOS */
  1504.   
  1505.       /* Reset the counters */
  1506.       linerepeat = 0;
  1507. ***************
  1508. *** 210,219 ****
  1509. --- 244,260 ----
  1510.         linerepeat++;
  1511.         if (linerepeat == 62)        /* 62 lines max, then restart */
  1512.         {
  1513. + #ifdef GNUDOS
  1514. +     fputc( linerepeat, ofp );
  1515. +     fprintf( ofp, "%d/", nout+1);
  1516. +     fflush( ofp );
  1517. +     fwrite( outbuffer, 1, nout, ofp );
  1518. + #else /* GNUDOS */
  1519.       putchar(linerepeat);
  1520.       printf("%d/", nout+1);
  1521.       fflush(stdout);
  1522.       write(1, outbuffer, nout);
  1523. + #endif /* GNUDOS */
  1524.       linerepeat = 0;
  1525.         }
  1526.       }
  1527. ***************
  1528. *** 222,230 ****
  1529. --- 263,279 ----
  1530.       for (i = 0; i < bytesperrow; ++i)
  1531.       oldscanline[i] = newscanline[i];
  1532.     }
  1533. + #ifdef GNUDOS
  1534. +   fputc( linerepeat, ofp );
  1535. + #else /* GNUDOS */
  1536.     putchar(linerepeat);            /* For the last line(s) to be plotted */
  1537. + #endif /* GNUDOS */
  1538.     pm_close(ifd);
  1539.     putrest();
  1540. + #ifdef GNUDOS
  1541. +   pm_close( ofp );
  1542. + #endif /* GNUDOS */
  1543.     exit(0);
  1544.   }
  1545.   
  1546. ***************
  1547. *** 232,237 ****
  1548. --- 281,299 ----
  1549.   
  1550.   putinit()
  1551.   {
  1552. + #ifdef GNUDOS
  1553. +   /* Enter graphics window */
  1554. +   fprintf( ofp, "\0331");
  1555. +   /* Erase graphics window */
  1556. +   fprintf( ofp, "\033\014");
  1557. +   /* Set graphics window in raster mode */
  1558. +   fprintf( ofp, "\033r");
  1559. +                   
  1560. +   /* Select standard Tek coding **/
  1561. +   fprintf( ofp, "\033[=11l");
  1562. + #else /* GNUDOS */
  1563.     /* Enter graphics window */
  1564.     printf("\0331");
  1565.   
  1566. ***************
  1567. *** 243,248 ****
  1568. --- 305,311 ----
  1569.   
  1570.     /* Select standard Tek coding **/
  1571.     printf("\033[=11l");
  1572. + #endif /* GNUDOS */
  1573.   
  1574.     bitsperitem = 1;
  1575.     item = 0;
  1576. ***************
  1577. *** 268,273 ****
  1578. --- 331,346 ----
  1579.     if (bitsperitem > 1)
  1580.         putitem();
  1581.   
  1582. + #ifdef GNUDOS
  1583. +   /* end raster downloading */
  1584. +   fprintf( ofp, "\033\134");
  1585. +   /* Exit raster mode */
  1586. +   fprintf( ofp, "\033t");
  1587. +   /* Exit graphics window
  1588. +   fprintf( ofp, "\0332"); */
  1589. + #else /* GNUDOS */
  1590.     /* end raster downloading */
  1591.     printf("\033\134");
  1592.   
  1593. ***************
  1594. *** 276,281 ****
  1595. --- 349,355 ----
  1596.   
  1597.     /* Exit graphics window
  1598.     printf("\0332"); */
  1599. + #endif /* GNUDOS */
  1600.   }
  1601.   
  1602.   putitem()
  1603. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtoico.c pbmplus.new/pbm/pbmtoico.c
  1604. *** pbmplus.old/pbm/pbmtoico.c    Fri Apr 12 00:30:30 1991
  1605. --- pbmplus.new/pbm/pbmtoico.c    Fri Apr 19 20:23:44 1991
  1606. ***************
  1607. *** 14,19 ****
  1608. --- 14,25 ----
  1609.   
  1610.   static void putinit(), putbit(), putrest(), putitem();
  1611.   
  1612. + #ifdef GNUDOS
  1613. + FILE *ofp;
  1614. + char fname[100], *fcp;
  1615. + #endif GNUDOS;
  1616.   void main( argc, argv )
  1617.   int argc;
  1618.   char *argv[];
  1619. ***************
  1620. *** 32,37 ****
  1621. --- 38,55 ----
  1622.       else
  1623.       ifp = stdin;
  1624.   
  1625. + #ifdef GNUDOS
  1626. +     if ( ifp == stdin )      
  1627. +         strcpy( fname, "noname" );
  1628. +     else {
  1629. +         strcpy( fname, argv[1] );
  1630. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1631. +             *fcp = '\0'; 
  1632. +         }
  1633. +     strcat( fname, ".ico" );
  1634. +     ofp = pm_openwb( fname );
  1635. + #endif /* GNUDOS */
  1636.       pbm_readpbminit( ifp, &cols, &rows, &format );
  1637.       bitrow = pbm_allocrow( cols );
  1638.       
  1639. ***************
  1640. *** 40,48 ****
  1641.       padleft = pad / 2;
  1642.       padright = pad - padleft;
  1643.   
  1644. !     printf( "/* Format_version=1, Width=%d, Height=%d", cols + pad, rows );
  1645.       printf( ", Depth=1, Valid_bits_per_item=16\n */\n" );
  1646.   
  1647.       putinit( );
  1648.       for ( row = 0; row < rows; row++ )
  1649.       {
  1650. --- 58,72 ----
  1651.       padleft = pad / 2;
  1652.       padright = pad - padleft;
  1653.   
  1654. ! #ifdef GNUDOS
  1655. !     fprintf( ofp, "/* Format_version=1, Width=%d, Height=%d", cols + pad, rows );
  1656. !     fprintf( ofp, ", Depth=1, Valid_bits_per_item=16\n */\n" );
  1657. ! #else /* GNUDOS */
  1658. !     printf( "/* Format_version=1, Width=%d, Height=%d", cols + pad, rows );
  1659.       printf( ", Depth=1, Valid_bits_per_item=16\n */\n" );
  1660. + #endif /* GNUDOS */
  1661.   
  1662.       putinit( );
  1663.       for ( row = 0; row < rows; row++ )
  1664.       {
  1665. ***************
  1666. *** 59,64 ****
  1667. --- 83,92 ----
  1668.   
  1669.       putrest( );
  1670.   
  1671. + #ifdef GNUDOS
  1672. +     pm_close( ofp );
  1673. + #endif /* GNUDOS */
  1674.       exit( 0 );
  1675.       }
  1676.   
  1677. ***************
  1678. *** 92,98 ****
  1679. --- 120,130 ----
  1680.       {
  1681.       if ( bitsperitem > 0 )
  1682.       putitem( );
  1683. + #ifdef GNUDOS
  1684. +     fputc( '\n', ofp );
  1685. + #else /* GNUDOS */
  1686.       putchar( '\n' );
  1687. + #endif /* GNUDOS */
  1688.       }
  1689.   
  1690.   static void
  1691. ***************
  1692. *** 103,108 ****
  1693. --- 135,156 ----
  1694.       if ( firstitem )
  1695.       firstitem = 0;
  1696.       else
  1697. + #ifdef GNUDOS
  1698. +     fputc( ',', ofp );
  1699. +     if ( itemsperline == 8 )
  1700. +     {
  1701. +     fputc( '\n', ofp );
  1702. +     itemsperline = 0;
  1703. +     }
  1704. +     if ( itemsperline == 0 )
  1705. +     fputc( '\t', ofp );
  1706. +     fputc( '0', ofp );
  1707. +     fputc( 'x', ofp );
  1708. +     fputc( hexits[item >> 12], ofp );
  1709. +     fputc( hexits[( item >> 8 ) & 15], ofp );
  1710. +     fputc( hexits[( item >> 4 ) & 15], ofp );
  1711. +     fputc( hexits[item & 15], ofp );
  1712. + #else /* GNUDOS */
  1713.       putchar( ',' );
  1714.       if ( itemsperline == 8 )
  1715.       {
  1716. ***************
  1717. *** 117,122 ****
  1718. --- 165,171 ----
  1719.       putchar( hexits[( item >> 8 ) & 15] );
  1720.       putchar( hexits[( item >> 4 ) & 15] );
  1721.       putchar( hexits[item & 15] );
  1722. + #endif /* GNUDOS */
  1723.       itemsperline++;
  1724.       bitsperitem = 0;
  1725.       item = 0;
  1726. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtolj.c pbmplus.new/pbm/pbmtolj.c
  1727. *** pbmplus.old/pbm/pbmtolj.c    Fri Apr 12 00:30:30 1991
  1728. --- pbmplus.new/pbm/pbmtolj.c    Fri Apr 19 20:31:38 1991
  1729. ***************
  1730. *** 28,33 ****
  1731. --- 28,38 ----
  1732.   
  1733.   static void putinit(), putbit(), putrest(), putitem();
  1734.   
  1735. + #ifdef GNUDOS
  1736. + FILE* ofp;
  1737. + char fname[100], *fcp;
  1738. + #endif /* GNUDOS */
  1739.   void main( argc, argv )
  1740.   int argc;
  1741.   char* argv[];
  1742. ***************
  1743. *** 68,73 ****
  1744. --- 73,90 ----
  1745.       if ( argn != argc )
  1746.       pm_usage( usage );
  1747.   
  1748. + #ifdef GNUDOS
  1749. +     if ( ifp == stdin )  
  1750. +         strcpy( fname, "noname" );
  1751. +     else {
  1752. +         strcpy( fname, argv[argc-1] );
  1753. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1754. +             *fcp = '\0';
  1755. +         }
  1756. +     strcat( fname, ".lj" );
  1757. +     ofp = pm_openwb( fname );
  1758. + #endif /* GNUDOS */
  1759.       pbm_readpbminit( ifp, &cols, &rows, &format );
  1760.       bitrow = pbm_allocrow( cols );
  1761.   
  1762. ***************
  1763. *** 86,92 ****
  1764.       padright = rucols - (nzcol + 1);
  1765.   
  1766.       /* Transfer raster graphics */
  1767. !      printf("\033*b%dW",rucols/8);
  1768.           for ( col = 0, bP = bitrow; col <= nzcol; ++col, ++bP )
  1769.           putbit( *bP );
  1770.       for ( col = 0; col < padright; ++col )
  1771. --- 103,113 ----
  1772.       padright = rucols - (nzcol + 1);
  1773.   
  1774.       /* Transfer raster graphics */
  1775. ! #ifdef GNUDOS
  1776. !     fprintf( ofp, "\033*b%dW",rucols/8);
  1777. ! #else /* GNUDOS */
  1778. !     printf("\033*b%dW",rucols/8);
  1779. ! #endif /* GNUDOS */
  1780.           for ( col = 0, bP = bitrow; col <= nzcol; ++col, ++bP )
  1781.           putbit( *bP );
  1782.       for ( col = 0; col < padright; ++col )
  1783. ***************
  1784. *** 97,102 ****
  1785. --- 118,127 ----
  1786.   
  1787.       putrest( );
  1788.   
  1789. + #ifdef GNUDOS
  1790. +     pm_close( ofp );
  1791. + #endif /* GNUDOS */
  1792.       exit( 0 );
  1793.       }
  1794.   
  1795. ***************
  1796. *** 106,111 ****
  1797. --- 131,149 ----
  1798.   static void
  1799.   putinit( )
  1800.       {
  1801. + #ifdef GNUDOS
  1802. +     /* Printer reset. */
  1803. +     fprintf( ofp, "\033E");
  1804. +     /* Ensure top margin is zero */
  1805. +     fprintf( ofp, "\033&l0E");
  1806. +     /* Set raster graphics resolution */
  1807. +     fprintf( ofp, "\033*t%dR",dpi);
  1808. +     /* Start raster graphics, relative adressing */
  1809. +     fprintf( ofp, "\033*r1A");
  1810. + #else /* GNUDOS */
  1811.       /* Printer reset. */
  1812.       printf("\033E");
  1813.   
  1814. ***************
  1815. *** 117,122 ****
  1816. --- 155,161 ----
  1817.   
  1818.       /* Start raster graphics, relative adressing */
  1819.       printf("\033*r1A");
  1820. + #endif /* GNUDOS */
  1821.   
  1822.       itemsperline = 0;
  1823.       bitsperitem = 1;
  1824. ***************
  1825. *** 145,161 ****
  1826. --- 184,212 ----
  1827.       if ( bitsperitem > 1 )
  1828.       putitem( );
  1829.   
  1830. + #ifdef GNUDOS
  1831. +     /* end raster graphics */
  1832. +     fprintf( ofp, "\033*rB" );
  1833. +     /* Printer reset. */
  1834. +     fprintf( ofp, "\033E");
  1835. + #else /* GNUDOS */
  1836.       /* end raster graphics */
  1837.       printf( "\033*rB" );
  1838.   
  1839.       /* Printer reset. */
  1840.       printf("\033E");
  1841. + #endif /* GNUDOS */
  1842.       }
  1843.   
  1844.   static void
  1845.   putitem( )
  1846.       {
  1847. + #ifdef GNUDOS
  1848. +     fputc( item, ofp );
  1849. + #else /* GNUDOS */
  1850.       putchar( item );
  1851. + #endif /* GNUDOS */
  1852.       bitsperitem = 0;
  1853.       item = 0;
  1854.       }
  1855. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtomac.c pbmplus.new/pbm/pbmtomac.c
  1856. *** pbmplus.old/pbm/pbmtomac.c    Fri Apr 12 00:30:32 1991
  1857. --- pbmplus.new/pbm/pbmtomac.c    Fri Apr 19 20:33:10 1991
  1858. ***************
  1859. *** 21,26 ****
  1860. --- 21,31 ----
  1861.   FILE *fdout;
  1862.   char *usage = "[-l left] [-r right] [-b bottom] [-t top] [pbmfile]";
  1863.   
  1864. + #ifdef GNUDOS
  1865. + FILE* ofp;
  1866. + char fname[100], *fcp;
  1867. + #endif /* GNUDOS */
  1868.   void main(argc, argv)
  1869.   int argc;
  1870.   char *argv[];
  1871. ***************
  1872. *** 83,88 ****
  1873. --- 88,105 ----
  1874.     if ( argn != argc )
  1875.       pm_usage( usage );
  1876.   
  1877. + #ifdef GNUDOS
  1878. +     if ( ifp == stdin )  
  1879. +         strcpy( fname, "noname" );
  1880. +     else {
  1881. +         strcpy( fname, argv[argc-1] );
  1882. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1883. +             *fcp = '\0';
  1884. +         }
  1885. +     strcat( fname, ".mac");
  1886. +     fdout = pm_openwb( fname );
  1887. + #endif /* GNUDOS */
  1888.     bitsr = pbm_readpbm( ifp, &cols, &rows );
  1889.   
  1890.     pm_close( ifp );
  1891. ***************
  1892. *** 119,124 ****
  1893. --- 136,144 ----
  1894.   
  1895.     writemacp( bits );
  1896.   
  1897. + #ifdef GNUDOS
  1898. +   pm_close( fdout );
  1899. + #endif /* GNUDOS */
  1900.     exit( 0 );
  1901.   
  1902.   }
  1903. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtomgr.c pbmplus.new/pbm/pbmtomgr.c
  1904. *** pbmplus.old/pbm/pbmtomgr.c    Fri Apr 12 00:30:36 1991
  1905. --- pbmplus.new/pbm/pbmtomgr.c    Fri Apr 19 19:56:50 1991
  1906. ***************
  1907. *** 15,20 ****
  1908. --- 15,25 ----
  1909.   
  1910.   static void putinit(), putbit(), putrest(), putitem();
  1911.   
  1912. + #ifdef GNUDOS
  1913. + FILE* ofp;
  1914. + char fname[100], *fcp;
  1915. + #endif /* GNUDOS */
  1916.   void main( argc, argv )
  1917.   int argc;
  1918.   char *argv[];
  1919. ***************
  1920. *** 33,38 ****
  1921. --- 38,55 ----
  1922.       else
  1923.       ifp = stdin;
  1924.   
  1925. + #ifdef GNUDOS
  1926. +     if ( ifp == stdin )  
  1927. +         strcpy( fname, "noname" );
  1928. +     else {
  1929. +         strcpy( fname, argv[1] );
  1930. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1931. +             *fcp = '\0';
  1932. +         }
  1933. +     strcat( fname, ".mgr" );
  1934. +     ofp = pm_openwb( fname );
  1935. + #endif /* GNUDOS */
  1936.       pbm_readpbminit( ifp, &cols, &rows, &format );
  1937.       bitrow = pbm_allocrow( cols );
  1938.       
  1939. ***************
  1940. *** 53,58 ****
  1941. --- 70,79 ----
  1942.   
  1943.       putrest( );
  1944.   
  1945. + #ifdef GNUDOS
  1946. +     pm_close( ofp );
  1947. + #endif /* GNUDOS */
  1948.       exit( 0 );
  1949.       }
  1950.   
  1951. ***************
  1952. *** 74,80 ****
  1953. --- 95,105 ----
  1954.       head.l_high = ( rows & 0x3f ) + ' ';
  1955.       head.depth = ( 1 & 0x3f ) + ' ';
  1956.       head._reserved = ' ';
  1957. + #ifdef GNUDOS
  1958. +     fwrite( &head, sizeof(head), 1, ofp );
  1959. + #else /* GNUDOS */
  1960.       fwrite( &head, sizeof(head), 1, stdout );
  1961. + #endif /* GNUDOS */
  1962.   
  1963.       item = 0;
  1964.       bitsperitem = 0;
  1965. ***************
  1966. *** 103,109 ****
  1967. --- 128,139 ----
  1968.   static void
  1969.   putitem( )
  1970.       {
  1971. + #ifdef GNUDOS
  1972. +     fwrite( &item, sizeof(item), 1, ofp );
  1973. + #else /* GNUDOS */
  1974.       fwrite( &item, sizeof(item), 1, stdout );
  1975. + #endif /* GNUDOS */
  1976.       item = 0;
  1977.       bitsperitem = 0;
  1978.       bitshift = 7;
  1979.