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

  1. From: mcastle@mcs213d.cs.umr.edu (Mike Castle {Nexus})
  2. Newsgroups: alt.sources
  3. Subject: PBMPlus on MSDOS patches (02/03)
  4. Message-ID: <2693@umriscc.isc.umr.edu>
  5. Date: 29 Apr 91 03:47:24 GMT
  6.  
  7.  
  8. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtopi3.c pbmplus.new/pbm/pbmtopi3.c
  9. *** pbmplus.old/pbm/pbmtopi3.c    Fri Apr 12 00:30:36 1991
  10. --- pbmplus.new/pbm/pbmtopi3.c    Fri Apr 19 19:56:32 1991
  11. ***************
  12. *** 17,22 ****
  13. --- 17,27 ----
  14.   
  15.   static void putinit(), putbit(), putrest(), putitem();
  16.   
  17. + #ifdef GNUDOS
  18. + FILE* ofp;
  19. + char fname[100], *fcp;
  20. + #endif /* GNUDOS */
  21.   void main( argc, argv )
  22.       int argc;
  23.       char* argv[];
  24. ***************
  25. *** 34,40 ****
  26.       if ( argc == 2 )
  27.       ifp = pm_openr( argv[1] );
  28.       else
  29. !     ifp = stdin;
  30.   
  31.       pbm_readpbminit( ifp, &cols, &rows, &format );
  32.       if (cols > 640)
  33. --- 39,57 ----
  34.       if ( argc == 2 )
  35.       ifp = pm_openr( argv[1] );
  36.       else
  37. !     ifp = stdin;    
  38. ! #ifdef GNUDOS
  39. !     if ( ifp == stdin )
  40. !         strcpy( fname, "noname" );
  41. !     else {
  42. !         strcpy( fname, argv[1] );
  43. !         if ( ( fcp = index( fname, '.' ) ) != 0 )
  44. !             *fcp = '\0';
  45. !         }
  46. !     strcat( fname, ".pi3" );
  47. !     ofp = pm_openwb( fname );
  48. ! #endif /* GNUDOS */
  49.   
  50.       pbm_readpbminit( ifp, &cols, &rows, &format );
  51.       if (cols > 640)
  52. ***************
  53. *** 63,69 ****
  54.   
  55.       putrest( );
  56.   
  57. !     exit( 0 );
  58.       }
  59.   
  60.   short item;
  61. --- 80,89 ----
  62.   
  63.       putrest( );
  64.   
  65. ! #ifdef GNUDOS
  66. !     pm_close( ofp );
  67. ! #endif /* GNUDOS */
  68. !     exit( 0 );
  69.       }
  70.   
  71.   short item;
  72. ***************
  73. *** 81,87 ****
  74. --- 101,111 ----
  75.       hdr.res = 2;
  76.       hdr.pal[0] = 0x0777;
  77.       hdr.pal[1] = 0x0700;
  78. + #ifdef GNUDOS
  79. +     fwrite( &hdr, sizeof(hdr), 1, ofp );
  80. + #else /* GNUDOS */
  81.       fwrite( &hdr, sizeof(hdr), 1, stdout );
  82. + #endif /* GNUDOS */
  83.       item = 0;
  84.       bitsperitem = 0;
  85.       bitshift = 15;
  86. ***************
  87. *** 108,115 ****
  88.   
  89.   static void
  90.   putitem( )
  91. !     {
  92.       fwrite( &item, sizeof(item), 1, stdout );
  93.       item = 0;
  94.       bitsperitem = 0;
  95.       bitshift = 15;
  96. --- 132,143 ----
  97.   
  98.   static void
  99.   putitem( )
  100. !     {     
  101. ! #ifdef GNUDOS
  102. !     fwrite( &item, sizeof(item), 1, ofp );
  103. ! #else /* GNUDOS */
  104.       fwrite( &item, sizeof(item), 1, stdout );
  105. + #endif /* GNUDOS */
  106.       item = 0;
  107.       bitsperitem = 0;
  108.       bitshift = 15;
  109. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtoplo.c pbmplus.new/pbm/pbmtoplo.c
  110. *** pbmplus.old/pbm/pbmtoplo.c    Fri Apr 12 00:30:32 1991
  111. --- pbmplus.new/pbm/pbmtoplo.c    Fri Apr 19 19:56:26 1991
  112. ***************
  113. *** 13,24 ****
  114. --- 13,34 ----
  115.   #include <stdio.h>
  116.   #include "pbm.h"
  117.   
  118. + #ifdef GNUDOS
  119. + FILE* ofp;
  120. + char fname[100], *fcp;
  121. + #endif /* GNUDOS */
  122.   static void
  123.   puttwo( i )
  124.       int i;
  125.       {
  126. + #ifdef GNUDOS
  127. +     (void) fputc( i, ofp );
  128. +     (void) fputc( i >> 8, ofp );
  129. + #else /* GNUDOS */
  130.       (void) putchar(i);
  131.       (void) putchar(i >> 8);
  132. + #endif /* GNUDOS */
  133.       }
  134.   
  135.   void main( argc, argv )
  136. ***************
  137. *** 37,47 ****
  138.   
  139.       ifp = (argc == 2) ? pm_openr( argv[1] ) : stdin;
  140.   
  141. !     bits = pbm_readpbm( ifp, &cols, &rows );
  142.   
  143.       pm_close( ifp );
  144.   
  145.       (void) putchar( 's' );
  146.       puttwo( 0 );
  147.       puttwo( 0 );
  148.       puttwo( rows - 1 );
  149. --- 47,73 ----
  150.   
  151.       ifp = (argc == 2) ? pm_openr( argv[1] ) : stdin;
  152.   
  153. ! #ifdef GNUDOS
  154. !     if ( ifp == stdin )  
  155. !         strcpy( fname, "noname" );
  156. !     else {
  157. !         strcpy( fname, argv[1] );
  158. !         if ( ( fcp = index( fname, '.' ) ) != 0 )
  159. !             *fcp = '\0';
  160. !         }
  161. !     strcat( fname, ".plo" );
  162. !     ofp = pm_openwb( fname );
  163. ! #endif /* GNUDOS */
  164. !     bits = pbm_readpbm( ifp, &cols, &rows );
  165.   
  166.       pm_close( ifp );
  167.   
  168. + #ifdef GNUDOS
  169. +     (void) fputc( 's', ofp );
  170. + #else /* GNUDOS */
  171.       (void) putchar( 's' );
  172. + #endif /* GNUDOS */
  173.       puttwo( 0 );
  174.       puttwo( 0 );
  175.       puttwo( rows - 1 );
  176. ***************
  177. *** 57,66 ****
  178. --- 83,100 ----
  179.           ; /* nothing */
  180.           --col;
  181.           if ( col == scol )
  182. + #ifdef GNUDOS
  183. +         (void) fputc( 'p', ofp );
  184. + #else /* GNUDOS */
  185.           (void) putchar( 'p' );
  186. + #endif /* GNUDOS */
  187.           else
  188.           {
  189. + #ifdef GNUDOS
  190. +         (void) fputc( 'l', ofp );
  191. + #else /* GNUDOS */
  192.           (void) putchar( 'l' );
  193. + #endif /* GNUDOS */
  194.           puttwo( scol );
  195.           puttwo( rows - 1 - row );
  196.           }
  197. ***************
  198. *** 68,73 ****
  199. --- 102,111 ----
  200.           puttwo( rows - 1 - row );
  201.           }
  202.       }
  203. + #ifdef GNUDOS
  204. +     pm_close( ofp );
  205. + #endif /* GNUDOS */
  206.   
  207.       exit( 0 );
  208.       }
  209. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtoptx.c pbmplus.new/pbm/pbmtoptx.c
  210. *** pbmplus.old/pbm/pbmtoptx.c    Fri Apr 12 00:30:30 1991
  211. --- pbmplus.new/pbm/pbmtoptx.c    Fri Apr 19 19:56:12 1991
  212. ***************
  213. *** 14,19 ****
  214. --- 14,24 ----
  215.   
  216.   static void putinit(), putbit(), putrest(), putitem();
  217.   
  218. + #ifdef GNUDOS
  219. + FILE *ofp;
  220. + char fname[100], *fcp;
  221. + #endif /* GNUDOS */
  222.   void main( argc, argv )
  223.   int argc;
  224.   char *argv[];
  225. ***************
  226. *** 33,38 ****
  227. --- 38,57 ----
  228.       else
  229.       ifp = stdin;
  230.   
  231. + #ifdef GNUDOS
  232. +     if ( ifp == stdin ) 
  233. +         strcpy( fname, "noname" );
  234. +     else {
  235. +         strcpy( fname, argv[1] );
  236. +         if ( ( fcp = index( fname, '.') ) != 0 )
  237. +         *fcp = '\0';
  238. +         }
  239. +     strcat( fname, ".ptx" );
  240. +     ofp = pm_openwb( fname );
  241. + #endif /* GNUDOS */
  242.       pbm_readpbminit( ifp, &cols, &rows, &format );
  243.       bitrow = pbm_allocrow( cols );
  244.   
  245. ***************
  246. *** 43,54 ****
  247.           for ( col = 0, bP = bitrow; col < cols; col++, bP++ )
  248.           putbit( *bP );
  249.       putrest( );
  250.       putchar( 5 );
  251.       putchar( '\n' );
  252.           }
  253.   
  254.       pm_close( ifp );
  255. !     
  256.       exit( 0 );
  257.       }
  258.   
  259. --- 62,82 ----
  260.           for ( col = 0, bP = bitrow; col < cols; col++, bP++ )
  261.           putbit( *bP );
  262.       putrest( );
  263. + #ifdef GNUDOS
  264. +     fputc( 5, ofp );
  265. +     fputc( '\n', ofp );
  266. + #else /* GNUDOS */
  267.       putchar( 5 );
  268.       putchar( '\n' );
  269. + #endif /* GNUDOS */
  270.           }
  271.   
  272.       pm_close( ifp );
  273. ! #ifdef GNUDOS
  274. !     pm_close( ofp );
  275. ! #endif /* GNUDOS */
  276.       exit( 0 );
  277.       }
  278.   
  279. ***************
  280. *** 86,92 ****
  281. --- 114,124 ----
  282.   static void
  283.   putitem( )
  284.       {
  285. + #ifdef GNUDOS
  286. +     fputc( item, ofp );
  287. + #else /* GNUDOS */
  288.       putchar( item );
  289. + #endif /* GNUDOS */
  290.       bitsperitem = 0;
  291.       item = 64;
  292.       bitshift = 0;
  293. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtox10.c pbmplus.new/pbm/pbmtox10.c
  294. *** pbmplus.old/pbm/pbmtox10.c    Fri Apr 12 00:30:30 1991
  295. --- pbmplus.new/pbm/pbmtox10.c    Fri Apr 19 19:56:06 1991
  296. ***************
  297. *** 12,17 ****
  298. --- 12,22 ----
  299.   
  300.   #include "pbm.h"
  301.   
  302. + #ifdef GNUDOS
  303. + FILE* ofp;
  304. + char fname[100], *fcp;
  305. + #endif /* GNUDOS */
  306.   void main( argc, argv )
  307.   int argc;
  308.   char *argv[];
  309. ***************
  310. *** 49,54 ****
  311. --- 54,71 ----
  312.       strcpy( name, "noname" );
  313.       }
  314.   
  315. + #ifdef GNUDOS
  316. +     if ( ifp == stdin )  
  317. +         strcpy( fname, "noname" );
  318. +     else {
  319. +         strcpy( fname, argv[1] );
  320. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  321. +             *fcp = '\0';
  322. +         }
  323. +     strcat( fname, ".x10" );
  324. +     ofp = pm_openwb( fname );
  325. + #endif /* GNUDOS */
  326.       pbm_readpbminit( ifp, &cols, &rows, &format );
  327.       bitrow = pbm_allocrow( cols );
  328.   
  329. ***************
  330. *** 55,63 ****
  331.       /* Compute padding to round cols up to the nearest multiple of 16. */
  332.       padright = ( ( cols + 15 ) / 16 ) * 16 - cols;
  333.   
  334. !     printf( "#define %s_width %d\n", name, cols );
  335.       printf( "#define %s_height %d\n", name, rows );
  336.       printf( "static short %s_bits[] = {\n", name );
  337.   
  338.       itemsperline = 0;
  339.       bitsperitem = 0;
  340. --- 72,86 ----
  341.       /* Compute padding to round cols up to the nearest multiple of 16. */
  342.       padright = ( ( cols + 15 ) / 16 ) * 16 - cols;
  343.   
  344. ! #ifdef GNUDOS
  345. !     fprintf( ofp, "#define %s_width %d\n", name, cols );
  346. !     fprintf( ofp, "#define %s_height %d\n", name, rows );
  347. !     fprintf( ofp, "static short %s_bits[] = {\n", name );
  348. ! #else /* GNUDOS */
  349. !     printf( "#define %s_width %d\n", name, cols );
  350.       printf( "#define %s_height %d\n", name, rows );
  351.       printf( "static short %s_bits[] = {\n", name );
  352. + #endif /* GNUDOS */
  353.   
  354.       itemsperline = 0;
  355.       bitsperitem = 0;
  356. ***************
  357. *** 64,69 ****
  358. --- 87,117 ----
  359.       item = 0;
  360.       firstitem = 1;
  361.   
  362. + #ifdef GNUDOS
  363. + #define PUTITEM \
  364. +     { \
  365. +     if ( firstitem ) \
  366. +     firstitem = 0; \
  367. +     else \
  368. +     fputc( ',', ofp ); \
  369. +     if ( itemsperline == 11 ) \
  370. +     { \
  371. +     fputc( '\n', ofp ); \
  372. +     itemsperline = 0; \
  373. +     } \
  374. +     if ( itemsperline == 0 ) \
  375. +     fputc( ' ', ofp ); \
  376. +     itemsperline++; \
  377. +     fputc('0', ofp ); \
  378. +     fputc('x', ofp ); \
  379. +     fputc(hexchar[item >> 12], ofp ); \
  380. +     fputc(hexchar[(item >> 8) & 15], ofp ); \
  381. +     fputc(hexchar[(item >> 4) & 15], ofp ); \
  382. +     fputc(hexchar[item & 15], ofp ); \
  383. +     bitsperitem = 0; \
  384. +     item = 0; \
  385. +     }
  386. + #else /* GNUDOS */
  387.   #define PUTITEM \
  388.       { \
  389.       if ( firstitem ) \
  390. ***************
  391. *** 87,92 ****
  392. --- 135,141 ----
  393.       bitsperitem = 0; \
  394.       item = 0; \
  395.       }
  396. + #endif /* GNUDOS */
  397.   
  398.   #define PUTBIT(b) \
  399.       { \
  400. ***************
  401. *** 110,116 ****
  402.       
  403.       if ( bitsperitem > 0 )
  404.       PUTITEM;
  405. !     printf( "};\n" );
  406.   
  407.       exit( 0 );
  408.       }
  409. --- 159,173 ----
  410.       
  411.       if ( bitsperitem > 0 )
  412.       PUTITEM;
  413. ! #ifdef GNUDOS
  414. !     fprintf( ofp, "};\n" );
  415. ! #else /* GNUDOS */
  416. !     printf( "};\n" );
  417. ! #endif /* GNUDOS */
  418. ! #ifdef GNUDOS
  419. !     pm_close( ofp );
  420. ! #endif /* GNUDOS */
  421.   
  422.       exit( 0 );
  423.       }
  424. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtoxbm.c pbmplus.new/pbm/pbmtoxbm.c
  425. *** pbmplus.old/pbm/pbmtoxbm.c    Fri Apr 12 00:30:30 1991
  426. --- pbmplus.new/pbm/pbmtoxbm.c    Fri Apr 19 19:55:58 1991
  427. ***************
  428. *** 12,17 ****
  429. --- 12,22 ----
  430.   
  431.   #include "pbm.h"
  432.   
  433. + #ifdef GNUDOS
  434. + FILE* ofp;
  435. + char fname[100], *fcp;
  436. + #endif /* GNUDOS */
  437.   void main( argc, argv )
  438.   int argc;
  439.   char *argv[];
  440. ***************
  441. *** 49,54 ****
  442. --- 54,71 ----
  443.       strcpy( name, "noname" );
  444.       }
  445.   
  446. + #ifdef GNUDOS
  447. +     if ( ifp == stdin )  
  448. +         strcpy( fname, "noname" );
  449. +     else {
  450. +         strcpy( fname, argv[1] );
  451. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  452. +             *fcp = '\0';
  453. +         }
  454. +     strcat( fname, ".xbm" );
  455. +     ofp = pm_openwb( fname );
  456. + #endif /* GNUDOS */
  457.       pbm_readpbminit( ifp, &cols, &rows, &format );
  458.       bitrow = pbm_allocrow( cols );
  459.       
  460. ***************
  461. *** 55,63 ****
  462. --- 72,86 ----
  463.       /* Compute padding to round cols up to the nearest multiple of 8. */
  464.       padright = ( ( cols + 7 ) / 8 ) * 8 - cols;
  465.   
  466. + #ifdef GNUDOS
  467. +     fprintf( ofp, "#define %s_width %d\n", name, cols );
  468. +     fprintf( ofp, "#define %s_height %d\n", name, rows );
  469. +     fprintf( ofp, "static char %s_bits[] = {\n", name );
  470. + #else /* GNUDOS */
  471.       printf( "#define %s_width %d\n", name, cols );
  472.       printf( "#define %s_height %d\n", name, rows );
  473.       printf( "static char %s_bits[] = {\n", name );
  474. + #endif /* GNUDOS */
  475.   
  476.       itemsperline = 0;
  477.       bitsperitem = 0;
  478. ***************
  479. *** 64,69 ****
  480. --- 87,115 ----
  481.       item = 0;
  482.       firstitem = 1;
  483.   
  484. + #ifdef GNUDOS
  485. + #define PUTITEM \
  486. +     { \
  487. +     if ( firstitem ) \
  488. +     firstitem = 0; \
  489. +     else \
  490. +     fputc( ',' , ofp ); \
  491. +     if ( itemsperline == 15 , ofp ) \
  492. +     { \
  493. +     fputc( '\n' , ofp ); \
  494. +     itemsperline = 0; \
  495. +     } \
  496. +     if ( itemsperline == 0 , ofp ) \
  497. +     fputc( ' ' , ofp ); \
  498. +     itemsperline++; \
  499. +     fputc('0', ofp ); \
  500. +     fputc('x', ofp ); \
  501. +     fputc(hexchar[item >> 4], ofp ); \
  502. +     fputc(hexchar[item & 15], ofp ); \
  503. +     bitsperitem = 0; \
  504. +     item = 0; \
  505. +     }
  506. + #else /* GNUDOS */
  507.   #define PUTITEM \
  508.       { \
  509.       if ( firstitem ) \
  510. ***************
  511. *** 85,90 ****
  512. --- 131,137 ----
  513.       bitsperitem = 0; \
  514.       item = 0; \
  515.       }
  516. + #endif /* GNUDOS */
  517.   
  518.   #define PUTBIT(b) \
  519.       { \
  520. ***************
  521. *** 109,115 ****
  522.   
  523.       if ( bitsperitem > 0 )
  524.       PUTITEM;
  525. !     printf( "};\n" );
  526.       exit( 0 );
  527.       }
  528. --- 156,166 ----
  529.   
  530.       if ( bitsperitem > 0 )
  531.       PUTITEM;
  532. ! #ifdef GNUDOS
  533. !     fprintf( ofp, "};\n" );
  534. !     pm_close( ofp );
  535. ! #else /* GNUDOS */
  536. !     printf( "};\n" );
  537. ! #endif /* GNUDOS */
  538.       exit( 0 );
  539.       }
  540. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtoybm.c pbmplus.new/pbm/pbmtoybm.c
  541. *** pbmplus.old/pbm/pbmtoybm.c    Fri Apr 12 00:30:36 1991
  542. --- pbmplus.new/pbm/pbmtoybm.c    Fri Apr 19 22:40:18 1991
  543. ***************
  544. *** 18,23 ****
  545. --- 18,28 ----
  546.   
  547.   static void putinit(), putbit(), putrest(), putitem();
  548.   
  549. + #ifdef GNUDOS
  550. + FILE* ofp;
  551. + char fname[100], *fcp;
  552. + #endif
  553.   void main( argc, argv )
  554.       int argc;
  555.       char* argv[];
  556. ***************
  557. *** 36,41 ****
  558. --- 41,58 ----
  559.       else
  560.       ifp = stdin;
  561.   
  562. + #ifdef GNUDOS
  563. +     if ( ifp == stdin )  
  564. +         strcpy( fname, "noname" );
  565. +     else {
  566. +         strcpy( fname, argv[1] );
  567. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  568. +             *fcp = '\0';
  569. +         }
  570. +     strcat( fname, ".ybm" );
  571. +     ofp = pm_openwb( fname );
  572. + #endif /* GNUDOS */
  573.       pbm_readpbminit( ifp, &cols, &rows, &format );
  574.       bitrow = pbm_allocrow( cols );
  575.       
  576. ***************
  577. *** 45,51 ****
  578.       putinit( cols, rows );
  579.       for ( row = 0; row < rows; ++row )
  580.       {
  581. !     printf(stderr,"row %d\n", row);
  582.       pbm_readpbmrow( ifp, bitrow, cols, format );
  583.           for ( col = 0, bP = bitrow; col < cols; ++col, ++bP )
  584.           putbit( *bP );
  585. --- 62,68 ----
  586.       putinit( cols, rows );
  587.       for ( row = 0; row < rows; ++row )
  588.       {
  589. !     fprintf(stderr,"row %d\n", row);
  590.       pbm_readpbmrow( ifp, bitrow, cols, format );
  591.           for ( col = 0, bP = bitrow; col < cols; ++col, ++bP )
  592.           putbit( *bP );
  593. ***************
  594. *** 58,63 ****
  595. --- 75,84 ----
  596.   
  597.       putrest( );
  598.   
  599. + #ifdef GNUDOS
  600. +     pm_close( ofp );
  601. + #endif /* GNUDOS */
  602.       exit( 0 );
  603.       }
  604.   
  605. ***************
  606. *** 68,76 ****
  607.   putinit( cols, rows )
  608.       int cols, rows;
  609.       {
  610. !     pm_writebigshort( stdout, YBM_MAGIC );
  611.       pm_writebigshort( stdout, cols );
  612.       pm_writebigshort( stdout, rows );
  613.       item = 0;
  614.       bitsperitem = 0;
  615.       bitshift = 0;
  616. --- 89,103 ----
  617.   putinit( cols, rows )
  618.       int cols, rows;
  619.       {
  620. ! #ifdef GNUDOS
  621. !     pm_writebigshort( ofp, YBM_MAGIC );
  622. !     pm_writebigshort( ofp, cols );
  623. !     pm_writebigshort( ofp, rows );          
  624. ! #else /* GNUDOS */
  625. !     pm_writebigshort( stdout, YBM_MAGIC );
  626.       pm_writebigshort( stdout, cols );
  627.       pm_writebigshort( stdout, rows );
  628. + #endif /* GNUDOS */
  629.       item = 0;
  630.       bitsperitem = 0;
  631.       bitshift = 0;
  632. ***************
  633. *** 98,104 ****
  634. --- 125,135 ----
  635.   static void
  636.   putitem( )
  637.       {
  638. + #ifdef GNUDOS
  639. +     pm_writebigshort( ofp, item );
  640. + #else /* GNUDOS */
  641.       pm_writebigshort( stdout, item );
  642. + #endif /* GNUDOS */
  643.       item = 0;
  644.       bitsperitem = 0;
  645.       bitshift = 0;
  646. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pbmtozin.c pbmplus.new/pbm/pbmtozin.c
  647. *** pbmplus.old/pbm/pbmtozin.c    Fri Apr 12 00:30:36 1991
  648. --- pbmplus.new/pbm/pbmtozin.c    Fri Apr 19 20:45:32 1991
  649. ***************
  650. *** 21,26 ****
  651. --- 21,31 ----
  652.   #include <stdio.h>
  653.   #include "pbm.h"
  654.   
  655. + #ifdef GNUDOS
  656. + FILE* ofp;
  657. + char fname[100], *fcp;
  658. + #endif /* GNUDOS */
  659.   void main( argc, argv )
  660.       int argc;
  661.       char* argv[];
  662. ***************
  663. *** 59,64 ****
  664. --- 64,75 ----
  665.       strcpy( name, "noname" );
  666.       }
  667.   
  668. + #ifdef GNUDOS
  669. +     strcpy( fname, name );
  670. +     strcat( fname, ".zin" ); 
  671. +     ofp = pm_openwb( fname );
  672. + #endif /* GNUDOS */
  673.       pbm_readpbminit( ifp, &cols, &rows, &format );
  674.       bitrow = pbm_allocrow( cols );
  675.   
  676. ***************
  677. *** 65,73 ****
  678. --- 76,90 ----
  679.       /* Compute padding to round cols up to the nearest multiple of 16. */
  680.       padright = ( ( cols + 15 ) / 16 ) * 16 - cols;
  681.   
  682. + #ifdef GNUDOS
  683. +     fprintf( ofp, "USHORT %s[] = {\n",name);
  684. +     fprintf( ofp, "  %d\n", cols );
  685. +     fprintf( ofp, "  %d\n", rows );
  686. + #else /* GNUDOS */
  687.       printf( "USHORT %s[] = {\n",name);
  688.       printf( "  %d\n", cols );
  689.       printf( "  %d\n", rows );
  690. + #endif /* GNUDOS */
  691.   
  692.       itemsperline = 0;
  693.       bitsperitem = 0;
  694. ***************
  695. *** 74,79 ****
  696. --- 91,121 ----
  697.       item = 0;
  698.       firstitem = 1;
  699.   
  700. + #ifdef GNUDOS
  701. + #define PUTITEM \
  702. +     { \
  703. +     if ( firstitem ) \
  704. +     firstitem = 0; \
  705. +     else \
  706. +     fputc( ',', ofp ); \
  707. +     if ( itemsperline == 11 ) \
  708. +     { \
  709. +     fputc( '\n', ofp ); \
  710. +     itemsperline = 0; \
  711. +     } \
  712. +     if ( itemsperline == 0 ) \
  713. +     fputc( ' ', ofp ); \
  714. +     ++itemsperline; \
  715. +     fputc('0', ofp ); \
  716. +     fputc('x', ofp ); \
  717. +     fputc(hexchar[item & 15], ofp ); \
  718. +     fputc(hexchar[(item >> 4) & 15], ofp ); \
  719. +     fputc(hexchar[(item >> 8) & 15], ofp ); \
  720. +     fputc(hexchar[item >> 12], ofp ); \
  721. +     bitsperitem = 0; \
  722. +     item = 0; \
  723. +     }
  724. + #else /* GNUDOS */
  725.   #define PUTITEM \
  726.       { \
  727.       if ( firstitem ) \
  728. ***************
  729. *** 97,102 ****
  730. --- 139,145 ----
  731.       bitsperitem = 0; \
  732.       item = 0; \
  733.       }
  734. + #endif /* GNUDOS */
  735.   
  736.   #define PUTBIT(b) \
  737.       { \
  738. ***************
  739. *** 120,126 ****
  740.       
  741.       if ( bitsperitem > 0 )
  742.       PUTITEM;
  743. !     printf( "};\n" );
  744.   
  745.       exit( 0 );
  746.       }
  747. --- 163,174 ----
  748.       
  749.       if ( bitsperitem > 0 )
  750.       PUTITEM;
  751. ! #ifdef GNUDOS
  752. !     fprintf( ofp, "};\n" ); 
  753. !     pm_close( ofp );
  754. ! #else /* GNUDOS */
  755. !     printf( "};\n" );
  756. ! #endif /* GNUDOS */
  757.   
  758.       exit( 0 );
  759.       }
  760. diff -c -B -H +new-file +recursive pbmplus.old/pbm/pi3topbm.c pbmplus.new/pbm/pi3topbm.c
  761. *** pbmplus.old/pbm/pi3topbm.c    Fri Apr 12 00:30:36 1991
  762. --- pbmplus.new/pbm/pi3topbm.c    Fri Apr 19 12:48:02 1991
  763. ***************
  764. *** 57,63 ****
  765. --- 57,67 ----
  766.       if (argc == 1)
  767.           f = stdin;
  768.       else if (argc == 2)
  769. + #ifdef GNUDOS
  770. +         f = pm_openrb( argv[1] );
  771. + #else /* GNUDOS */
  772.           f = pm_openr( argv[1] );
  773. + #endif /* GNUDOS */
  774.       else
  775.           pm_usage("[-d] [pi3file]");
  776.   
  777. diff -c -B -H +new-file +recursive pbmplus.old/pbm/xbmtopbm.c pbmplus.new/pbm/xbmtopbm.c
  778. *** pbmplus.old/pbm/xbmtopbm.c    Fri Apr 12 00:30:28 1991
  779. --- pbmplus.new/pbm/xbmtopbm.c    Fri Apr 19 12:44:56 1991
  780. ***************
  781. *** 27,33 ****
  782. --- 27,37 ----
  783.       pm_usage( "[bitmapfile]" );
  784.       
  785.       if ( argc == 2 )
  786. + #ifdef GNUDOS
  787. +     ifp = pm_openrb( argv[1] );
  788. + #else /* GNUDOS */
  789.       ifp = pm_openr( argv[1] );
  790. + #endif /* GNUDOS */
  791.       else
  792.       ifp = stdin;
  793.   
  794. diff -c -B -H +new-file +recursive pbmplus.old/pbm/ybmtopbm.c pbmplus.new/pbm/ybmtopbm.c
  795. *** pbmplus.old/pbm/ybmtopbm.c    Fri Apr 12 00:30:36 1991
  796. --- pbmplus.new/pbm/ybmtopbm.c    Fri Apr 19 22:39:46 1991
  797. ***************
  798. *** 32,38 ****
  799. --- 32,42 ----
  800.       pm_usage( "[ybmfile]" );
  801.   
  802.       if ( argc == 2 )
  803. + #ifdef GNUDOS
  804. +     ifp = pm_openrb( argv[1] );
  805. + #else /* GNUDOS */
  806.       ifp = pm_openr( argv[1] );
  807. + #endif /* GNUDOS */
  808.       else
  809.       ifp = stdin;
  810.   
  811. ***************
  812. *** 74,86 ****
  813.       {
  814.       short magic;
  815.   
  816. !     if ( pm_readbigshort( file, &magic ) == -1 )
  817.       pm_error( "EOF / read error", 0,0,0,0,0 );
  818.       if ( magic != YBM_MAGIC )
  819.       pm_error( "bad magic number in YBM file", 0,0,0,0,0 );
  820. !     if ( pm_readbigshort( file, colsP ) == -1 )
  821.       pm_error( "EOF / read error", 0,0,0,0,0 );
  822. !       if ( pm_readbigshort( file, rowsP ) == -1 )
  823.       pm_error( "EOF / read error", 0,0,0,0,0 );
  824.   
  825.       *depthP = 1;
  826. --- 78,90 ----
  827.       {
  828.       short magic;
  829.   
  830. !     if ( pm_readbigshort( file, &magic ) == -1 )
  831.       pm_error( "EOF / read error", 0,0,0,0,0 );
  832.       if ( magic != YBM_MAGIC )
  833.       pm_error( "bad magic number in YBM file", 0,0,0,0,0 );
  834. !     if ( pm_readbigshort( file, colsP ) == -1 )
  835.       pm_error( "EOF / read error", 0,0,0,0,0 );
  836. !       if ( pm_readbigshort( file, rowsP ) == -1 )
  837.       pm_error( "EOF / read error", 0,0,0,0,0 );
  838.   
  839.       *depthP = 1;
  840. diff -c -B -H +new-file +recursive pbmplus.old/pbmplus.h pbmplus.new/pbmplus.h
  841. *** pbmplus.old/pbmplus.h    Fri Apr 12 00:30:52 1991
  842. --- pbmplus.new/pbmplus.h    Sat Apr 20 01:56:56 1991
  843. ***************
  844. *** 35,41 ****
  845.   ** using uuencode or the equivalent, or running the files through pnmnoraw.
  846.   ** Note that reading "raw" files works whether writing is enabled or not.
  847.   */
  848. ! #define PBMPLUS_RAWBITS
  849.   
  850.   /* CONFIGURE: On some systems, the putc() macro is broken and will return
  851.   ** EOF when you write out a 255.  For example, ULTRIX does this.  This
  852. --- 35,41 ----
  853.   ** using uuencode or the equivalent, or running the files through pnmnoraw.
  854.   ** Note that reading "raw" files works whether writing is enabled or not.
  855.   */
  856. ! /* #define PBMPLUS_RAWBITS */
  857.   
  858.   /* CONFIGURE: On some systems, the putc() macro is broken and will return
  859.   ** EOF when you write out a 255.  For example, ULTRIX does this.  This
  860. ***************
  861. *** 106,114 ****
  862.   ** that point here, feel free to tweak or remove these declarations.
  863.   */
  864.   #include <malloc.h>
  865. ! extern char* malloc();
  866.   extern char* realloc();
  867. ! extern char* calloc();
  868.   
  869.   /* End of configurable definitions. */
  870.   
  871. --- 106,114 ----
  872.   ** that point here, feel free to tweak or remove these declarations.
  873.   */
  874.   #include <malloc.h>
  875. ! /* extern char* malloc();
  876.   extern char* realloc();
  877. ! extern char* calloc(); */
  878.   
  879.   /* End of configurable definitions. */
  880.   
  881. ***************
  882. *** 170,175 ****
  883. --- 170,180 ----
  884.   FILE* pm_openr ARGS(( char* name ));
  885.   FILE* pm_openw ARGS(( char* name ));
  886.   void pm_close ARGS(( FILE* f ));
  887. + #ifdef GNUDOS
  888. + FILE* pm_openrb ARGS(( char* name ));
  889. + FILE* pm_openwb ARGS(( char* name ));
  890. + #endif /* GNUDOS */
  891.   
  892.   
  893.   /* Endian I/O. */
  894. diff -c -B -H +new-file +recursive pbmplus.old/pgm/delpgm.bat pbmplus.new/pgm/delpgm.bat
  895. *** pbmplus.old/pgm/delpgm.bat
  896. --- pbmplus.new/pgm/delpgm.bat    Fri Apr 12 22:47:50 1991
  897. ***************
  898. *** 0 ****
  899. --- 1,18 ----
  900. + del FITSTOPG
  901. + del FSTOPGM
  902. + del HIPSTOPG
  903. + del LISPMTOP
  904. + del PGMBENTL
  905. + del PGMEDGE
  906. + del PGMENHAN
  907. + del PGMHIST
  908. + del PGMNORM
  909. + del PGMOIL
  910. + del PGMRAMP
  911. + del PGMTOFIT
  912. + del PGMTOFS
  913. + del PGMTOLIS
  914. + del PGMTOPBM
  915. + del PGMTOPS
  916. + del PSIDTOPG
  917. + del RAWTOPGM
  918. diff -c -B -H +new-file +recursive pbmplus.old/pgm/exepgm.bat pbmplus.new/pgm/exepgm.bat
  919. *** pbmplus.old/pgm/exepgm.bat
  920. --- pbmplus.new/pgm/exepgm.bat    Fri Apr 12 22:48:48 1991
  921. ***************
  922. *** 0 ****
  923. --- 1,18 ----
  924. + copy /b c:\gcc\bin\stub.exe+FITSTOPG     FITSTOPG.exe
  925. + copy /b c:\gcc\bin\stub.exe+FSTOPGM      FSTOPGM.exe
  926. + copy /b c:\gcc\bin\stub.exe+HIPSTOPG     HIPSTOPG.exe
  927. + copy /b c:\gcc\bin\stub.exe+LISPMTOP     LISPMTOP.exe
  928. + copy /b c:\gcc\bin\stub.exe+PGMBENTL     PGMBENTL.exe
  929. + copy /b c:\gcc\bin\stub.exe+PGMEDGE      PGMEDGE.exe
  930. + copy /b c:\gcc\bin\stub.exe+PGMENHAN     PGMENHAN.exe
  931. + copy /b c:\gcc\bin\stub.exe+PGMHIST      PGMHIST.exe
  932. + copy /b c:\gcc\bin\stub.exe+PGMNORM      PGMNORM.exe
  933. + copy /b c:\gcc\bin\stub.exe+PGMOIL       PGMOIL.exe
  934. + copy /b c:\gcc\bin\stub.exe+PGMRAMP      PGMRAMP.exe
  935. + copy /b c:\gcc\bin\stub.exe+PGMTOFIT     PGMTOFIT.exe
  936. + copy /b c:\gcc\bin\stub.exe+PGMTOFS      PGMTOFS.exe
  937. + copy /b c:\gcc\bin\stub.exe+PGMTOLIS     PGMTOLIS.exe
  938. + copy /b c:\gcc\bin\stub.exe+PGMTOPBM     PGMTOPBM.exe
  939. + copy /b c:\gcc\bin\stub.exe+PGMTOPS      PGMTOPS.exe
  940. + copy /b c:\gcc\bin\stub.exe+PSIDTOPG     PSIDTOPG.exe
  941. + copy /b c:\gcc\bin\stub.exe+RAWTOPGM     RAWTOPGM.exe
  942. diff -c -B -H +new-file +recursive pbmplus.old/pgm/fitstopg.c pbmplus.new/pgm/fitstopg.c
  943. *** pbmplus.old/pgm/fitstopg.c    Fri Apr 12 00:30:56 1991
  944. --- pbmplus.new/pgm/fitstopg.c    Fri Apr 19 22:51:46 1991
  945. ***************
  946. *** 60,66 ****
  947. --- 60,70 ----
  948.   
  949.       if ( argn < argc )
  950.       {
  951. + #ifdef GNUDOS
  952. +     ifp = pm_openrb( argv[argn] );
  953. + #else /* GNUDOS */
  954.       ifp = pm_openr( argv[argn] );
  955. + #endif /* GNUDOS */
  956.       ++argn;
  957.       }
  958.       else
  959. diff -c -B -H +new-file +recursive pbmplus.old/pgm/fstopgm.c pbmplus.new/pgm/fstopgm.c
  960. *** pbmplus.old/pgm/fstopgm.c    Fri Apr 12 00:30:54 1991
  961. --- pbmplus.new/pgm/fstopgm.c    Fri Apr 19 22:54:16 1991
  962. ***************
  963. *** 33,39 ****
  964. --- 33,43 ----
  965.   
  966.       if ( argn < argc )
  967.       {
  968. + #ifdef GNUDOS
  969. +     ifp = pm_openrb( argv[argn] );
  970. + #else /* GNUDOS */
  971.       ifp = pm_openr( argv[argn] );
  972. + #endif /* GNUDOS */
  973.       argn++;
  974.       }
  975.       else
  976. diff -c -B -H +new-file +recursive pbmplus.old/pgm/hipstopg.c pbmplus.new/pgm/hipstopg.c
  977. *** pbmplus.old/pgm/hipstopg.c    Fri Apr 12 00:30:54 1991
  978. --- pbmplus.new/pgm/hipstopg.c    Fri Apr 19 22:53:52 1991
  979. ***************
  980. *** 54,60 ****
  981. --- 54,64 ----
  982.   
  983.       if ( argn < argc )
  984.       {
  985. + #ifdef GNUDOS
  986. +     ifp = pm_openrb( argv[argn] );
  987. + #else /* GNUDOS */
  988.       ifp = pm_openr( argv[argn] );
  989. + #endif /* GNUDOS */
  990.       argn++;
  991.       }
  992.       else
  993. diff -c -B -H +new-file +recursive pbmplus.old/pgm/lispmtop.c pbmplus.new/pgm/lispmtop.c
  994. *** pbmplus.old/pgm/lispmtop.c    Fri Apr 12 00:30:56 1991
  995. --- pbmplus.new/pgm/lispmtop.c    Fri Apr 19 22:53:22 1991
  996. ***************
  997. *** 41,47 ****
  998. --- 41,51 ----
  999.       pm_usage( "[lispmfile]" );
  1000.   
  1001.       if ( argc == 2 )
  1002. + #ifdef GNUDOS
  1003. +         ifp = pm_openrb( argv[1] );
  1004. + #else /* GNUDOS */
  1005.           ifp = pm_openr( argv[1] );
  1006. + #endif /* GNUDOS */
  1007.       else
  1008.       ifp = stdin;
  1009.   
  1010. diff -c -B -H +new-file +recursive pbmplus.old/pgm/makefile.pc pbmplus.new/pgm/makefile.pc
  1011. *** pbmplus.old/pgm/makefile.pc
  1012. --- pbmplus.new/pgm/makefile.pc    Fri Apr 19 22:47:40 1991
  1013. ***************
  1014. *** 0 ****
  1015. --- 1,130 ----
  1016. + # Makefile for pgm tools.
  1017. + #
  1018. + # Copyright (C) 1989, 1991 by Jef Poskanzer.
  1019. + #
  1020. + # Permission to use, copy, modify, and distribute this software and its
  1021. + # documentation for any purpose and without fee is hereby granted, provided
  1022. + # that the above copyright notice appear in all copies and that both that
  1023. + # copyright notice and this permission notice appear in supporting
  1024. + # documentation.  This software is provided "as is" without express or
  1025. + # implied warranty.
  1026. + # Default values, usually overridden by top-level Makefile.
  1027. + #CC =         cc
  1028. + CC =       gcc -fcombine-regs 
  1029. + #CFLAGS =    -O
  1030. + CFLAGS =    -g
  1031. + #CFLAGS =    -g -O
  1032. + #LDFLAGS =    -s
  1033. + LDFLAGS =    
  1034. + INSTALLBINARIES =    /usr/new/pbm
  1035. + INSTALLMANUALS1 =    /usr/man/man1
  1036. + SUFFIXMANUALS1 =    1
  1037. + INSTALLMANUALS3 =    /usr/man/man3
  1038. + SUFFIXMANUALS3 =    3
  1039. + INSTALLMANUALS5 =    /usr/man/man5
  1040. + SUFFIXMANUALS5 =    5
  1041. + MANCP =            cp
  1042. + PBMDIR =    ../pbm
  1043. + INCLUDEPBM =    -I$(PBMDIR)
  1044. + LIBPBM =    $(PBMDIR)/libpbm.a
  1045. + DEFPBM =    $(PBMDIR)/pbm.h ../pbmplus.h
  1046. + DEFLIBPBM =    $(PBMDIR)/libpbm.h
  1047. + SHELL =        /bin/sh
  1048. + INCLUDE =    $(INCLUDEPBM)
  1049. + ALLCFLAGS =    $(CFLAGS) $(INCLUDE)
  1050. + LIBPGM =    libpgm.a
  1051. + PORTBINARIES =    fitstopgm fstopgm hipstopgm lispmtopgm pgmbentley \
  1052. +         pgmenhance pgmhist pgmnorm pgmoil pgmramp \
  1053. +         pgmtopbm pgmtofits pgmtofs pgmtolispm pgmtops \
  1054. +         psidtopgm rawtopgm
  1055. + MATHBINARIES =    pgmedge
  1056. + BINARIES =    $(PORTBINARIES) $(MATHBINARIES)
  1057. + OBJECTS =    fitstopgm.o fstopgm.o hipstopgm.o lispmtopgm.o pgmbentley.o \
  1058. +         pgmenhance.o pgmhist.o pgmnorm.o pgmoil.o pgmramp.o \
  1059. +         pgmtopbm.o pgmtofits.o pgmtofs.o pgmtolispm.o pgmtops.o \
  1060. +         psidtopgm.o rawtopgm.o pgmedge.o
  1061. + MANUALS1 =    $(BINARIES)
  1062. + MANUALS3 =    libpgm
  1063. + MANUALS5 =    pgm
  1064. + all:        binaries
  1065. + binaries:    $(BINARIES)
  1066. + installbinaries:    binaries
  1067. +     cd $(INSTALLBINARIES) 
  1068. +     cp $(BINARIES) $(INSTALLBINARIES)
  1069. + merge:        pgmmerge
  1070. + pgmmerge:    pgmmerge.c $(OBJECTS) $(LIBPGM) $(LIBPBM)
  1071. +     $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c $(OBJECTS) -lm $(LIBPGM) $(LIBPBM)
  1072. + installmerge:    installpgmmerge
  1073. + installpgmmerge:    pgmmerge
  1074. +     cd $(INSTALLBINARIES) ; 
  1075. +     cp pgmmerge $(INSTALLBINARIES)
  1076. +     cd $(INSTALLBINARIES) ; for i in $(BINARIES) ; do ln pgmmerge $$i ; done
  1077. +     
  1078. + installmanuals:
  1079. +     for i in $(MANUALS1) ; do $(MANCP) $$i.1 $(INSTALLMANUALS1)/$$i.$(SUFFIXMANUALS1) ; done
  1080. +     for i in $(MANUALS3) ; do $(MANCP) $$i.3 $(INSTALLMANUALS3)/$$i.$(SUFFIXMANUALS3) ; done
  1081. +     for i in $(MANUALS5) ; do $(MANCP) $$i.5 $(INSTALLMANUALS5)/$$i.$(SUFFIXMANUALS5) ; done
  1082. + # Rule for plain programs.
  1083. + $(PORTBINARIES):    pgm.h $(DEFPBM) $(LIBPGM) $(LIBPBM)
  1084. +     $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c $(LIBPGM) $(LIBPBM)
  1085. + # Rule for math-dependent programs.
  1086. + $(MATHBINARIES):    pgm.h $(DEFPBM) $(LIBPGM) $(LIBPBM)
  1087. +     $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c -lm $(LIBPGM) $(LIBPBM)
  1088. + # Rule for objects.
  1089. + $(OBJECTS):    pgm.h $(DEFPBM)
  1090. +     $(CC) $(ALLCFLAGS) "-Dmain=$*_main" -c $*.c
  1091. + # And libraries.
  1092. + $(LIBPBM):
  1093. +     cd $(PBMDIR) ; make lib
  1094. + lib:        $(LIBPGM)
  1095. + $(LIBPGM):    libpgm1.o libpgm2.o
  1096. +   
  1097. +     ar rc $(LIBPGM) libpgm1.o libpgm2.o
  1098. +     
  1099. + libpgm1.o:    pgm.h $(DEFPBM) libpgm.h libpgm1.c
  1100. +     $(CC) $(ALLCFLAGS) -c libpgm1.c
  1101. + libpgm2.o:    pgm.h $(DEFPBM) libpgm.h libpgm2.c $(DEFLIBPBM)
  1102. +     $(CC) $(ALLCFLAGS) -c libpgm2.c
  1103. + # Other dependencies.
  1104. + fitstopgm fitstopgm.o:        fitstopgm.c
  1105. + fstopgm fstopgm.o:        fstopgm.c
  1106. + hipstopgm hipstopgm.o:        hipstopgm.c
  1107. + lispmtopgm lispmtopgm.o:    lispmtopgm.c
  1108. + pgmbentley pgmbentley.o:    pgmbentley.c
  1109. + pgmedge pgmedge.o:        pgmedge.c
  1110. + pgmenhance pgmenhance.o:    pgmenhance.c
  1111. + pgmhist pgmhist.o:        pgmhist.c
  1112. + pgmnorm pgmnorm.o:        pgmnorm.c
  1113. + pgmoil pgmoil.o:        pgmoil.c
  1114. + pgmramp pgmramp.o:        pgmramp.c
  1115. + pgmtopbm pgmtopbm.o:        pgmtopbm.c dithers.h $(DEFPBM)
  1116. + pgmtofits pgmtofits.o:        pgmtofits.c
  1117. + pgmtofs pgmtofs.o:        pgmtofs.c
  1118. + pgmtolispm pgmtolispm.o:    pgmtolispm.c
  1119. + pgmtops pgmtops.o:        pgmtops.c
  1120. + psidtopgm psidtopgm.o:        psidtopgm.c
  1121. + rawtopgm rawtopgm.o:        rawtopgm.c
  1122. diff -c -B -H +new-file +recursive pbmplus.old/pgm/pgmtofit.c pbmplus.new/pgm/pgmtofit.c
  1123. *** pbmplus.old/pgm/pgmtofit.c    Fri Apr 12 00:30:54 1991
  1124. --- pbmplus.new/pgm/pgmtofit.c    Fri Apr 19 23:46:46 1991
  1125. ***************
  1126. *** 12,17 ****
  1127. --- 12,22 ----
  1128.   
  1129.   #include "pgm.h"
  1130.   
  1131. + #ifdef GNUDOS
  1132. + FILE* ofp;
  1133. + char fname[100], *fcp;
  1134. + #endif /* GNUDOS */
  1135.   void main( argc, argv )
  1136.   int argc;
  1137.   char *argv[];
  1138. ***************
  1139. *** 34,39 ****
  1140. --- 39,56 ----
  1141.       else
  1142.       ifp = stdin;
  1143.   
  1144. + #ifdef GNUDOS
  1145. +     if ( ifp == stdin )  
  1146. +         strcpy( fname, "noname" );
  1147. +     else {
  1148. +         strcpy( fname, argv[1] );
  1149. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1150. +             *fcp = '\0';
  1151. +         }
  1152. +     strcat( fname, ".fit" );
  1153. +     ofp = pm_openwb( fname );
  1154. + #endif /* GNUDOS */
  1155.       if ( argn != argc )
  1156.       pm_usage( "[pgmfile]" );
  1157.   
  1158. ***************
  1159. *** 48,61 ****
  1160. --- 65,90 ----
  1161.       {
  1162.       pgm_readpgmrow( ifp, grayrow, cols, maxval, format );
  1163.       for ( col = 0, gP = grayrow; col < cols; col++, gP++ )
  1164. + #ifdef GNUDOS
  1165. +         fputc( *gP, ofp );
  1166. + #else /* GNUDOS */
  1167.           putchar( *gP );
  1168. + #endif /* GNUDOS */
  1169.       }
  1170.   
  1171.       for ( i = ( rows * cols ) % 2880; i < 2880; i++ )
  1172. + #ifdef GNUDOS
  1173. +     fputc( '\0', ofp );
  1174. + #else /* GNUDOS */
  1175.       putchar( '\0' );
  1176. + #endif /* GNUDOS */
  1177.   
  1178.       pm_close( ifp );
  1179.   
  1180. + #ifdef GNUDOS
  1181. +     pm_close( ofp );
  1182. + #endif /* GNUDOS */
  1183.       exit( 0 );
  1184.       }
  1185.   
  1186. ***************
  1187. *** 97,101 ****
  1188. --- 126,134 ----
  1189.   write_card( str )
  1190.   char *str;
  1191.       {
  1192. + #ifdef GNUDOS
  1193. +     fwrite( str, sizeof (char), 80, ofp );
  1194. + #else /* GNUDOS */
  1195.       fwrite( str, sizeof (char), 80, stdout );
  1196. + #endif /* GNUDOS */
  1197.       }
  1198. diff -c -B -H +new-file +recursive pbmplus.old/pgm/pgmtofs.c pbmplus.new/pgm/pgmtofs.c
  1199. *** pbmplus.old/pgm/pgmtofs.c    Fri Apr 12 00:30:58 1991
  1200. --- pbmplus.new/pgm/pgmtofs.c    Fri Apr 19 23:48:28 1991
  1201. ***************
  1202. *** 14,19 ****
  1203. --- 14,24 ----
  1204.   
  1205.   static void putinit(), putinit(), putitem(), putgray(), putrest();
  1206.   
  1207. + #ifdef GNUDOS
  1208. + FILE* ofp;
  1209. + char fname[100], *fcp;
  1210. + #endif /* GNUDOS */
  1211.   void main( argc, argv )
  1212.   int argc;
  1213.   char *argv[];
  1214. ***************
  1215. *** 41,46 ****
  1216. --- 46,63 ----
  1217.       if ( argn != argc )
  1218.       pm_usage( usage );
  1219.   
  1220. + #ifdef GNUDOS
  1221. +     if ( ifp == stdin )  
  1222. +         strcpy( fname, "noname" );
  1223. +     else {
  1224. +         strcpy( fname, argv[1] );
  1225. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1226. +             *fcp = '\0';
  1227. +         }
  1228. +     strcat( fname, ".fs" );
  1229. +     ofp = pm_openwb( fname );
  1230. + #endif /* GNUDOS */
  1231.       grays = pgm_readpgm( ifp, &cols, &rows, &maxval );
  1232.       pm_close( ifp );
  1233.   
  1234. ***************
  1235. *** 73,78 ****
  1236. --- 90,99 ----
  1237.   
  1238.       putrest( );
  1239.   
  1240. + #ifdef GNUDOS
  1241. +     pm_close( ofp );
  1242. + #endif /* GNUDOS */
  1243.       exit( 0 );
  1244.       }
  1245.   
  1246. ***************
  1247. *** 84,89 ****
  1248. --- 105,124 ----
  1249.   putinit( cols, rows, bps )
  1250.   int cols, rows, bps;
  1251.       {
  1252. + #ifdef GNUDOS
  1253. +     fprintf( ofp, "FirstName: \n" );
  1254. +     fprintf( ofp, "LastName: \n" );
  1255. +     fprintf( ofp, "E-mail: \n" );
  1256. +     fprintf( ofp, "Telephone: \n" );
  1257. +     fprintf( ofp, "Company: \n" );
  1258. +     fprintf( ofp, "Address1: \n" );
  1259. +     fprintf( ofp, "Address2: \n" );
  1260. +     fprintf( ofp, "CityStateZip: \n" );
  1261. +     fprintf( ofp, "Date: \n" );
  1262. +     fprintf( ofp, "PicData: %d %d %d\n", cols, rows, bps );
  1263. +     fprintf( ofp, "Image: %d %d %d\n", cols, rows, bps );
  1264. +     fprintf( ofp, "\n" );
  1265. + #else /* GNUDOS */
  1266.       printf( "FirstName: \n" );
  1267.       printf( "LastName: \n" );
  1268.       printf( "E-mail: \n" );
  1269. ***************
  1270. *** 96,101 ****
  1271. --- 131,137 ----
  1272.       printf( "PicData: %d %d %d\n", cols, rows, bps );
  1273.       printf( "Image: %d %d %d\n", cols, rows, bps );
  1274.       printf( "\n" );
  1275. + #endif /* GNUDOS */
  1276.   
  1277.       bitspersample = bps;
  1278.       itemsperline = items = 0;
  1279. ***************
  1280. *** 111,121 ****
  1281. --- 147,165 ----
  1282.   
  1283.       if ( itemsperline == 30 )
  1284.       {
  1285. + #ifdef GNUDOS
  1286. +     fputc( '\n', ofp );
  1287. +     itemsperline = 0;
  1288. +     }
  1289. +     fputc( hexits[item >> 4], ofp );
  1290. +     fputc( hexits[item & 15], ofp );
  1291. + #else /* GNUDOS */
  1292.       putchar( '\n' );
  1293.       itemsperline = 0;
  1294.       }
  1295.       putchar( hexits[item >> 4] );
  1296.       putchar( hexits[item & 15] );
  1297. + #endif /* GNUDOS */
  1298.       ++itemsperline;
  1299.       ++items;
  1300.       item = 0;
  1301. ***************
  1302. *** 139,143 ****
  1303. --- 183,191 ----
  1304.       {
  1305.       if ( bitsperitem > 0 )
  1306.       putitem( );
  1307. + #ifdef GNUDOS
  1308. +     fprintf( ofp, "\n" );
  1309. + #else /* GNUDOS */
  1310.       printf( "\n" );
  1311. + #endif /* GNUDOS */
  1312.       }
  1313. diff -c -B -H +new-file +recursive pbmplus.old/pgm/pgmtolis.c pbmplus.new/pgm/pgmtolis.c
  1314. *** pbmplus.old/pgm/pgmtolis.c    Fri Apr 12 00:30:56 1991
  1315. --- pbmplus.new/pgm/pgmtolis.c    Fri Apr 19 23:48:12 1991
  1316. ***************
  1317. *** 23,28 ****
  1318. --- 23,33 ----
  1319.   
  1320.   static int depth_to_word_size();
  1321.   
  1322. + #ifdef GNUDOS
  1323. + FILE* ofp;
  1324. + char fname[100], *fcp;
  1325. + #endif /* GNUDOS */
  1326.   void main( argc, argv )
  1327.       int argc;
  1328.       char* argv[];
  1329. ***************
  1330. *** 42,47 ****
  1331. --- 47,64 ----
  1332.       else
  1333.       ifp = stdin;
  1334.   
  1335. + #ifdef GNUDOS
  1336. +     if ( ifp == stdin )  
  1337. +         strcpy( fname, "noname" );
  1338. +     else {
  1339. +         strcpy( fname, argv[1] );
  1340. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1341. +             *fcp = '\0';
  1342. +         }
  1343. +     strcat( fname, ".lis" );
  1344. +     ofp = pm_openwb( fname );
  1345. + #endif /* GNUDOS */
  1346.       pgm_readpgminit( ifp, &cols, &rows, &maxval, &format );
  1347.       grayrow = pgm_allocrow( cols );
  1348.       depth = pm_maxvaltobits( maxval );
  1349. ***************
  1350. *** 61,67 ****
  1351.   
  1352.       pm_close( ifp );
  1353.   
  1354. !     putrest( );
  1355.   
  1356.       exit( 0 );
  1357.       }
  1358. --- 78,88 ----
  1359.   
  1360.       pm_close( ifp );
  1361.   
  1362. !     putrest( );
  1363. ! #ifdef GNUDOS
  1364. !     pm_close( ofp );
  1365. ! #endif /* GNUDOS */
  1366.   
  1367.       exit( 0 );
  1368.       }
  1369. ***************
  1370. *** 75,81 ****
  1371.       int i;
  1372.       int cols32 = ( ( cols + 31 ) / 32 ) * 32;    /* Lispms are able to write bit files that are not mod32 wide, but we   */
  1373.                           /* don't.  This should be ok, since bit arrays which are not mod32 wide */
  1374. !     printf(LISPM_MAGIC);            /* are pretty useless on a lispm (can't hand them to bitblt).        */
  1375.       pm_writelittleshort( stdout, cols );
  1376.       pm_writelittleshort( stdout, rows );
  1377.       pm_writelittleshort( stdout, cols32 );
  1378. --- 96,112 ----
  1379.       int i;
  1380.       int cols32 = ( ( cols + 31 ) / 32 ) * 32;    /* Lispms are able to write bit files that are not mod32 wide, but we   */
  1381.                           /* don't.  This should be ok, since bit arrays which are not mod32 wide */
  1382. ! #ifdef GNUDOS
  1383. !     fprintf( ofp, LISPM_MAGIC);            /* are pretty useless on a lispm (can't hand them to bitblt).       */
  1384. !     pm_writelittleshort( ofp, cols );
  1385. !     pm_writelittleshort( ofp, rows );
  1386. !     pm_writelittleshort( ofp, cols32 );
  1387. !     fputc(depth & 0xFF, ofp );
  1388. !     for ( i = 0; i < 9; ++i )
  1389. !     fputc( 0, ofp );   /* pad bytes */                          
  1390. ! #else /* GNUDOS */
  1391. !     printf(LISPM_MAGIC);            /* are pretty useless on a lispm (can't hand them to bitblt).       */
  1392.       pm_writelittleshort( stdout, cols );
  1393.       pm_writelittleshort( stdout, rows );
  1394.       pm_writelittleshort( stdout, cols32 );
  1395. ***************
  1396. *** 83,88 ****
  1397. --- 114,120 ----
  1398.   
  1399.       for ( i = 0; i < 9; ++i )
  1400.       putchar( 0 );    /* pad bytes */
  1401. + #endif /* GNUDOS */
  1402.   
  1403.       item = 0;
  1404.       bitsperitem = 0;
  1405. ***************
  1406. *** 122,128 ****
  1407.   
  1408.   putitem( )
  1409.       {
  1410. !     pm_writelittlelong( stdout, ~item );
  1411.       item = 0;
  1412.       bitsperitem = 0;
  1413.       bitshift = 0;
  1414. --- 154,164 ----
  1415.   
  1416.   putitem( )
  1417.       {
  1418. ! #ifdef GNUDOS
  1419. !     pm_writelittlelong( ofp, ~item );
  1420. ! #else /* GNUDOS */
  1421. !     pm_writelittlelong( stdout, ~item );
  1422. ! #endif /* GNUDOS */
  1423.       item = 0;
  1424.       bitsperitem = 0;
  1425.       bitshift = 0;
  1426. diff -c -B -H +new-file +recursive pbmplus.old/pgm/pgmtops.c pbmplus.new/pgm/pgmtops.c
  1427. *** pbmplus.old/pgm/pgmtops.c    Fri Apr 12 00:30:56 1991
  1428. --- pbmplus.new/pgm/pgmtops.c    Fri Apr 19 23:47:48 1991
  1429. ***************
  1430. *** 15,20 ****
  1431. --- 15,25 ----
  1432.   static void putinit(), putinit(), putitem(), putgray(), putrest(),
  1433.       rleputinit(), rleputbuffer(), rleputitem(), rleputgray(), rleputrest();
  1434.   
  1435. + #ifdef GNUDOS
  1436. + FILE* ofp;
  1437. + char fname[100], *fcp;
  1438. + #endif /* GNUDOS */
  1439.   void main( argc, argv )
  1440.   int argc;
  1441.   char *argv[];
  1442. ***************
  1443. *** 73,78 ****
  1444. --- 78,95 ----
  1445.       if ( argn != argc )
  1446.       pm_usage( usage );
  1447.   
  1448. + #ifdef GNUDOS
  1449. +     if ( ifp == stdin )  
  1450. +         strcpy( fname, "noname" );
  1451. +     else {
  1452. +         strcpy( fname, argv[1] );
  1453. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1454. +             *fcp = '\0';
  1455. +         }
  1456. +     strcat( fname, ".ps" );
  1457. +     ofp = pm_openwb( fname );
  1458. + #endif /* GNUDOS */
  1459.       pgm_readpgminit( ifp, &cols, &rows, &maxval, &format );
  1460.       grayrow = pgm_allocrow( cols );
  1461.   
  1462. ***************
  1463. *** 119,124 ****
  1464. --- 136,145 ----
  1465.       else
  1466.       putrest( );
  1467.   
  1468. + #ifdef GNUDOS
  1469. +     pm_close( ofp );
  1470. + #endif /* GNUDOS */
  1471.       exit( 0 );
  1472.       }
  1473.   
  1474. ***************
  1475. *** 143,148 ****
  1476. --- 164,189 ----
  1477.       if ( llx < 0.0 || lly < 0.0 )
  1478.       pm_message( "warning, image too large for page", 0,0,0,0,0 );
  1479.   
  1480. + #ifdef GNUDOS
  1481. +     fprintf( ofp,  "%%!PS-Adobe-2.0 EPSF-2.0\n" );
  1482. +     fprintf( ofp,  "%%%%Creator: pgmtops\n" );
  1483. +     fprintf( ofp,  "%%%%Title: %s.ps\n", name );
  1484. +     fprintf( ofp,  "%%%%Pages: 1\n" );
  1485. +     fprintf( ofp, 
  1486. +     "%%%%BoundingBox: %d %d %d %d\n",
  1487. +     (int) llx, (int) lly, (int) ( llx + scols ), (int) ( lly + srows ) );
  1488. +     fprintf( ofp,  "%%%%EndComments\n" );
  1489. +     fprintf( ofp,  "%%%%EndProlog\n" );
  1490. +     fprintf( ofp,  "%%%%Page: 1 1\n" );
  1491. +     fprintf( ofp,  "/picstr %d string def\n", HSBUFSIZ );
  1492. +     fprintf( ofp,  "gsave\n" );
  1493. +     fprintf( ofp,  "%g %g translate\n", llx, lly );
  1494. +     fprintf( ofp,  "%g %g scale\n", scols, srows );
  1495. +     fprintf( ofp,  "%d %d %d\n", cols, rows, bps );
  1496. +     fprintf( ofp,  "[ %d 0 0 -%d 0 %d ]\n", cols, rows, rows );
  1497. +     fprintf( ofp,  "{ currentfile picstr readhexstring pop }\n" );
  1498. +     fprintf( ofp,  "image\n" );
  1499. + #else /* GNUDOS */
  1500.       printf( "%%!PS-Adobe-2.0 EPSF-2.0\n" );
  1501.       printf( "%%%%Creator: pgmtops\n" );
  1502.       printf( "%%%%Title: %s.ps\n", name );
  1503. ***************
  1504. *** 161,166 ****
  1505. --- 202,208 ----
  1506.       printf( "[ %d 0 0 -%d 0 %d ]\n", cols, rows, rows );
  1507.       printf( "{ currentfile picstr readhexstring pop }\n" );
  1508.       printf( "image\n" );
  1509. + #endif /* GNUDOS */
  1510.   
  1511.       bitspersample = bps;
  1512.       itemsperline = items = 0;
  1513. ***************
  1514. *** 176,186 ****
  1515. --- 218,238 ----
  1516.   
  1517.       if ( itemsperline == 30 )
  1518.       {
  1519. + #ifdef GNUDOS
  1520. +     fputc( '\n', ofp );
  1521. + #else /* GNUDOS */
  1522.       putchar( '\n' );
  1523. + #endif /* GNUDOS */
  1524.       itemsperline = 0;
  1525.       }
  1526. + #ifdef GNUDOS
  1527. +     fputc( hexits[item >> 4], ofp );
  1528. +     fputc( hexits[item & 15], ofp );
  1529. + #else /* GNUDOS */
  1530.       putchar( hexits[item >> 4] );
  1531.       putchar( hexits[item & 15] );
  1532. + #endif /* GNUDOS */
  1533.       itemsperline++;
  1534.       items++;
  1535.       item = 0;
  1536. ***************
  1537. *** 206,215 ****
  1538. --- 258,274 ----
  1539.       putitem( );
  1540.       while ( items % HSBUFSIZ != 0 )
  1541.       putitem( );
  1542. + #ifdef GNUDOS
  1543. +     fprintf( ofp,  "\n" );
  1544. +     fprintf( ofp,  "grestore\n" );
  1545. +     fprintf( ofp,  "showpage\n" );
  1546. +     fprintf( ofp,  "%%%%Trailer\n" );
  1547. + #else /* GNUDOS */
  1548.       printf( "\n" );
  1549.       printf( "grestore\n" );
  1550.       printf( "showpage\n" );
  1551.       printf( "%%%%Trailer\n" );
  1552. + #endif /* GNUDOS */
  1553.       }
  1554.   
  1555.   static void
  1556. ***************
  1557. *** 227,232 ****
  1558. --- 286,325 ----
  1559.       if ( llx < 0.0 || lly < 0.0 )
  1560.       pm_message( "warning, image too large for page", 0,0,0,0,0 );
  1561.   
  1562. + #ifdef GNUDOS
  1563. +     fprintf( ofp, "%%!PS-Adobe-2.0 EPSF-2.0\n" );
  1564. +     fprintf( ofp, "%%%%Creator: pgmtops\n" );
  1565. +     fprintf( ofp, "%%%%Title: %s.ps\n", name );
  1566. +     fprintf( ofp, "%%%%Pages: 1\n" );
  1567. +     fprintf( ofp,
  1568. +     "%%%%BoundingBox: %d %d %d %d\n",
  1569. +     (int) llx, (int) lly, (int) ( llx + scols ), (int) ( lly + srows ) );
  1570. +     fprintf( ofp, "%%%%EndComments\n" );
  1571. +     fprintf( ofp, "%%%%EndProlog\n" );
  1572. +     fprintf( ofp, "/rlestr1 1 string def\n" );
  1573. +     fprintf( ofp, "/rlestr 128 string def\n" );
  1574. +     fprintf( ofp, "/readrlestring {\n" );
  1575. +     fprintf( ofp, "  currentfile rlestr1 readhexstring pop  0 get\n" );
  1576. +     fprintf( ofp, "  dup 127 le {\n" );
  1577. +     fprintf( ofp, "    currentfile rlestr 0  4 3 roll  1 add  getinterval\n" );
  1578. +     fprintf( ofp, "    readhexstring  pop\n" );
  1579. +     fprintf( ofp, "  } {\n" );
  1580. +     fprintf( ofp, "    256 exch sub  dup\n" );
  1581. +     fprintf( ofp, "    currentfile rlestr1 readhexstring pop  0 get\n" );
  1582. +     fprintf( ofp, "    exch 0 exch 1 exch 1 sub { rlestr exch 2 index put } for\n" );
  1583. +     fprintf( ofp, "    pop  rlestr exch 0 exch getinterval\n" );
  1584. +     fprintf( ofp, "  } ifelse\n" );
  1585. +     fprintf( ofp, "} bind def\n" );
  1586. +     fprintf( ofp, "%%%%EndProlog\n" );
  1587. +     fprintf( ofp, "%%%%Page: 1 1\n" );
  1588. +     fprintf( ofp, "gsave\n" );
  1589. +     fprintf( ofp, "%g %g translate\n", llx, lly );
  1590. +     fprintf( ofp, "%g %g scale\n", scols, srows );
  1591. +     fprintf( ofp, "%d %d %d\n", cols, rows, bps );
  1592. +     fprintf( ofp, "[ %d 0 0 -%d 0 %d ]\n", cols, rows, rows );
  1593. +     fprintf( ofp, "{ readrlestring }\n" );
  1594. +     fprintf( ofp, "image\n" );
  1595. + #else /* GNUDOS */
  1596.       printf( "%%!PS-Adobe-2.0 EPSF-2.0\n" );
  1597.       printf( "%%%%Creator: pgmtops\n" );
  1598.       printf( "%%%%Title: %s.ps\n", name );
  1599. ***************
  1600. *** 259,264 ****
  1601. --- 352,358 ----
  1602.       printf( "[ %d 0 0 -%d 0 %d ]\n", cols, rows, rows );
  1603.       printf( "{ readrlestring }\n" );
  1604.       printf( "image\n" );
  1605. + #endif /* GNUDOS */
  1606.   
  1607.       bitspersample = bps;
  1608.       itemsperline = items = 0;
  1609. ***************
  1610. *** 382,389 ****
  1611. --- 476,490 ----
  1612.       rleputitem( );
  1613.       if ( count > 0 )
  1614.       rleputbuffer( );
  1615. + #ifdef GNUDOS
  1616. +     fprintf( ofp, "\n" );
  1617. +     fprintf( ofp, "grestore\n" );
  1618. +     fprintf( ofp, "showpage\n" );
  1619. +     fprintf( ofp, "%%%%Trailer\n" );
  1620. + #else /* GNUDOS */
  1621.       printf( "\n" );
  1622.       printf( "grestore\n" );
  1623.       printf( "showpage\n" );
  1624.       printf( "%%%%Trailer\n" );
  1625. + #endif /* GNUDOS */
  1626.       }
  1627. diff -c -B -H +new-file +recursive pbmplus.old/pgm/psidtopg.c pbmplus.new/pgm/psidtopg.c
  1628. *** pbmplus.old/pgm/psidtopg.c    Fri Apr 12 00:30:56 1991
  1629. --- pbmplus.new/pgm/psidtopg.c    Fri Apr 19 22:55:00 1991
  1630. ***************
  1631. *** 41,47 ****
  1632. --- 41,51 ----
  1633.   
  1634.       if ( argn < argc )
  1635.       {
  1636. + #ifdef GNUDOS
  1637. +     ifp = pm_openrb( argv[argn] );
  1638. + #else /* GNUDOS */
  1639.       ifp = pm_openr( argv[argn] );
  1640. + #endif /* GNUDOS */
  1641.       argn++;
  1642.       }
  1643.       else
  1644. diff -c -B -H +new-file +recursive pbmplus.old/pgm/rawtopgm.c pbmplus.new/pgm/rawtopgm.c
  1645. *** pbmplus.old/pgm/rawtopgm.c    Fri Apr 12 00:30:54 1991
  1646. --- pbmplus.new/pgm/rawtopgm.c    Fri Apr 19 22:52:30 1991
  1647. ***************
  1648. *** 63,69 ****
  1649. --- 63,73 ----
  1650.   
  1651.       if ( argn < argc )
  1652.       {
  1653. + #ifdef GNUDOS
  1654. +     ifp = pm_openrb( argv[argn] );
  1655. + #else /* GNUDOS */
  1656.       ifp = pm_openr( argv[argn] );
  1657. + #endif /* GNUDOS */
  1658.       ++argn;
  1659.       }
  1660.       else
  1661. diff -c -B -H +new-file +recursive pbmplus.old/pnm/body.c pbmplus.new/pnm/body.c
  1662. *** pbmplus.old/pnm/body.c
  1663. --- pbmplus.new/pnm/body.c    Sat Apr 20 10:08:52 1991
  1664. ***************
  1665. *** 0 ****
  1666. --- 1,11 ----
  1667. + #ifdef GNUDOS
  1668. +     if ( ifp == stdin )  
  1669. +         strcpy( fname, "noname" );
  1670. +     else {
  1671. +         strcpy( fname, argv[1] );
  1672. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1673. +             *fcp = '\0';
  1674. +         }
  1675. +     strcat( fname,           );
  1676. +     ofp = pm_openwb( fname );
  1677. + #endif /* GNUDOS */
  1678. diff -c -B -H +new-file +recursive pbmplus.old/pnm/delpnm.bat pbmplus.new/pnm/delpnm.bat
  1679. *** pbmplus.old/pnm/delpnm.bat
  1680. --- pbmplus.new/pnm/delpnm.bat    Fri Apr 12 22:53:10 1991
  1681. ***************
  1682. *** 0 ****
  1683. --- 1,21 ----
  1684. + del PNMARITH
  1685. + del PNMCAT
  1686. + del PNMCONVO
  1687. + del PNMCROP
  1688. + del PNMCUT
  1689. + del PNMDEPTH
  1690. + del PNMENLAR
  1691. + del PNMFILE
  1692. + del PNMFLIP
  1693. + del PNMGAMMA
  1694. + del PNMINVER
  1695. + del PNMNORAW
  1696. + del PNMPASTE
  1697. + del PNMROTAT
  1698. + del PNMSCALE
  1699. + del PNMSHEAR
  1700. + del PNMTILE
  1701. + del PNMTORAS
  1702. + del PNMTOXWD
  1703. + del RASTTOPN
  1704. + del XWDTOPNM
  1705. diff -c -B -H +new-file +recursive pbmplus.old/pnm/exepnm.bat pbmplus.new/pnm/exepnm.bat
  1706. *** pbmplus.old/pnm/exepnm.bat
  1707. --- pbmplus.new/pnm/exepnm.bat    Fri Apr 12 22:51:54 1991
  1708. ***************
  1709. *** 0 ****
  1710. --- 1,21 ----
  1711. + copy /b c:\gcc\bin\stub.exe+PNMARITH   PNMARITH.exe
  1712. + copy /b c:\gcc\bin\stub.exe+PNMCAT     PNMCAT.exe
  1713. + copy /b c:\gcc\bin\stub.exe+PNMCONVO   PNMCONVO.exe
  1714. + copy /b c:\gcc\bin\stub.exe+PNMCROP    PNMCROP.exe
  1715. + copy /b c:\gcc\bin\stub.exe+PNMCUT     PNMCUT.exe
  1716. + copy /b c:\gcc\bin\stub.exe+PNMDEPTH   PNMDEPTH.exe
  1717. + copy /b c:\gcc\bin\stub.exe+PNMENLAR   PNMENLAR.exe
  1718. + copy /b c:\gcc\bin\stub.exe+PNMFILE    PNMFILE.exe
  1719. + copy /b c:\gcc\bin\stub.exe+PNMFLIP    PNMFLIP.exe
  1720. + copy /b c:\gcc\bin\stub.exe+PNMGAMMA   PNMGAMMA.exe
  1721. + copy /b c:\gcc\bin\stub.exe+PNMINVER   PNMINVER.exe
  1722. + copy /b c:\gcc\bin\stub.exe+PNMNORAW   PNMNORAW.exe
  1723. + copy /b c:\gcc\bin\stub.exe+PNMPASTE   PNMPASTE.exe
  1724. + copy /b c:\gcc\bin\stub.exe+PNMROTAT   PNMROTAT.exe
  1725. + copy /b c:\gcc\bin\stub.exe+PNMSCALE   PNMSCALE.exe
  1726. + copy /b c:\gcc\bin\stub.exe+PNMSHEAR   PNMSHEAR.exe
  1727. + copy /b c:\gcc\bin\stub.exe+PNMTILE    PNMTILE.exe
  1728. + copy /b c:\gcc\bin\stub.exe+PNMTORAS   PNMTORAS.exe
  1729. + copy /b c:\gcc\bin\stub.exe+PNMTOXWD   PNMTOXWD.exe
  1730. + copy /b c:\gcc\bin\stub.exe+RASTTOPN   RASTTOPN.exe
  1731. + copy /b c:\gcc\bin\stub.exe+XWDTOPNM   XWDTOPNM.exe
  1732. diff -c -B -H +new-file +recursive pbmplus.old/pnm/header.c pbmplus.new/pnm/header.c
  1733. *** pbmplus.old/pnm/header.c
  1734. --- pbmplus.new/pnm/header.c    Fri Apr 19 15:37:02 1991
  1735. ***************
  1736. *** 0 ****
  1737. --- 1,4 ----
  1738. + #ifdef GNUDOS
  1739. + FILE* ofp;
  1740. + char fname[100], *fcp;
  1741. + #endif /* GNUDOS */
  1742. diff -c -B -H +new-file +recursive pbmplus.old/pnm/makefile.pc pbmplus.new/pnm/makefile.pc
  1743. *** pbmplus.old/pnm/makefile.pc
  1744. --- pbmplus.new/pnm/makefile.pc    Sat Apr 20 17:01:24 1991
  1745. ***************
  1746. *** 0 ****
  1747. --- 1,186 ----
  1748. + # Makefile for pnm tools.
  1749. + #
  1750. + # Copyright (C) 1989, 1991 by Jef Poskanzer.
  1751. + #
  1752. + # Permission to use, copy, modify, and distribute this software and its
  1753. + # documentation for any purpose and without fee is hereby granted, provided
  1754. + # that the above copyright notice appear in all copies and that both that
  1755. + # copyright notice and this permission notice appear in supporting
  1756. + # documentation.  This software is provided "as is" without express or
  1757. + # implied warranty.
  1758. + # Default values, usually overridden by top-level Makefile.
  1759. + #CC =         cc
  1760. + CC =       gcc -fcombine-regs 
  1761. + #CFLAGS =    -O
  1762. + CFLAGS =    -g
  1763. + #CFLAGS =    -g -O
  1764. + TIFFDEF =
  1765. + TIFFINC =
  1766. + TIFFLIB =
  1767. + TIFFBINARIES =
  1768. + TIFFOBJECTS =
  1769. + #TIFFDEF =         -DLIBTIFF
  1770. + #TIFFINC =         -I../libtiff
  1771. + #TIFFLIB =         ../libtiff/libtiff.a
  1772. + #TIFFBINARIES =  tifftopnm pnmtotiff
  1773. + #TIFFOBJECTS =     tifftopnm.o pnmtotiff.o
  1774. + #LDFLAGS =    -s
  1775. + LDFLAGS =    
  1776. + INSTALLBINARIES =    /usr/new/pbm
  1777. + INSTALLSCRIPTS =    $(INSTALLBINARIES)
  1778. + INSTALLMANUALS1 =    /usr/man/man1
  1779. + SUFFIXMANUALS1 =    1
  1780. + INSTALLMANUALS3 =    /usr/man/man3
  1781. + SUFFIXMANUALS3 =    3
  1782. + INSTALLMANUALS5 =    /usr/man/man5
  1783. + SUFFIXMANUALS5 =    5
  1784. + MANCP =            cp
  1785. + # CONFIGURE: You can compile PNM without PPM.  If you don't want PPM,
  1786. + # comment out the next six definitions.  This will make the PNM programs
  1787. + # use # less memory.  If you change this, don't forget to change the
  1788. + # SUBDIRS definition in the top-level Makefile.
  1789. + PPMOPT =    -DPPM
  1790. + PPMDIR =    .
  1791. + INCLUDEPPM =    -I$(PPMDIR)
  1792. + LIBPPM =    $(PPMDIR)/libppm.a
  1793. + DEFPPM =    $(PPMDIR)/ppm.h ../pbmplus.h
  1794. + DEFLIBPPM =    $(PPMDIR)/libppm.h
  1795. + # CONFIGURE: Likewise here: if you don't have PGM, comment these lines out.
  1796. + PGMOPT =    -DPGM
  1797. + PGMDIR =    .
  1798. + INCLUDEPGM =    -I$(PGMDIR)
  1799. + LIBPGM =    $(PGMDIR)/libpgm.a
  1800. + DEFPGM =    $(PGMDIR)/pgm.h
  1801. + DEFLIBPGM =    $(PGMDIR)/libpgm.h
  1802. + # PBM is required, don't comment these lines out.
  1803. + PBMOPT =    -DPBM
  1804. + PBMDIR =    .
  1805. + INCLUDEPBM =    -I$(PBMDIR)
  1806. + LIBPBM =    $(PBMDIR)/libpbm.a
  1807. + DEFPBM =    $(PBMDIR)/pbm.h
  1808. + DEFLIBPBM =    $(PBMDIR)/libpbm.h
  1809. + SHELL =        /bin/sh
  1810. + INCLUDE =    $(INCLUDEPPM) $(INCLUDEPGM) $(INCLUDEPBM)
  1811. + ALLCFLAGS =    $(CFLAGS) $(PPMOPT) $(PGMOPT) $(PBMOPT) $(INCLUDE) $(TIFFDEF) $(TIFFINC)
  1812. + LIBPNM =    libpnm.a
  1813. + PORTBINARIES =    pnmarith pnmcat pnmconvol pnmcrop pnmcut \
  1814. +         pnmdepth pnmenlarge pnmfile pnmflip pnminvert \
  1815. +         pnmnoraw pnmpaste pnmscale pnmtile \
  1816. +         pnmtorast pnmtoxwd rasttopnm xwdtopnm
  1817. + MATHBINARIES =    pnmgamma pnmrotate pnmshear
  1818. + BINARIES =      $(PORTBINARIES) $(MATHBINARIES) $(TIFFBINARIES)
  1819. + SCRIPTS =    anytopnm pnmindex pnmmargin pnmsmooth
  1820. + PORTOBJECTS =    pnmarith.o pnmcat.o pnmconvol.o pnmcrop.o pnmcut.o \
  1821. +         pnmdepth.o pnmenlarge.o pnmfile.o pnmflip.o pnminvert.o \
  1822. +         pnmnoraw.o pnmpaste.o pnmscale.o pnmtile.o \
  1823. +         pnmtorast.o pnmtoxwd.o rasttopnm.o xwdtopnm.o \
  1824. +         pnmgamma.o pnmrotate.o pnmshear.o
  1825. + OBJECTS =    $(PORTOBJECTS) $(TIFFOBJECTS)
  1826. + MANUALS1 =    $(BINARIES) $(SCRIPTS)
  1827. + MANUALS3 =    libpnm
  1828. + MANUALS5 =    pnm
  1829. + all:        binaries
  1830. + binaries:    $(BINARIES)
  1831. + installbinaries:    binaries
  1832. +     cd $(INSTALLBINARIES) ; rm -f $(BINARIES)
  1833. +     cp $(BINARIES) $(INSTALLBINARIES)
  1834. +     cd $(INSTALLSCRIPTS) ; rm -f $(SCRIPTS)
  1835. +     cp $(SCRIPTS) $(INSTALLSCRIPTS)
  1836. +     cd $(INSTALLSCRIPTS) ; chmod +x $(SCRIPTS)
  1837. + merge:        pnmmerge
  1838. + pnmmerge:    pnmmerge.c $(OBJECTS) $(LIBPNM) $(LIBPPM) $(LIBPGM) $(LIBPBM)
  1839. +     $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c $(OBJECTS) -lm $(LIBPNM) $(LIBPPM) $(LIBPGM) $(LIBPBM) $(TIFFLIB)
  1840. + installmerge:    installpnmmerge
  1841. + installpnmmerge:    pnmmerge
  1842. +     cd $(INSTALLBINARIES) ; rm -f $(BINARIES)
  1843. +     cp pnmmerge $(INSTALLBINARIES)
  1844. +     cd $(INSTALLBINARIES) ; for i in $(BINARIES) ; do ln pnmmerge $$i ; done
  1845. +     rm $(INSTALLBINARIES)/pnmmerge
  1846. +     cd $(INSTALLSCRIPTS) ; rm -f $(SCRIPTS)
  1847. +     cp $(SCRIPTS) $(INSTALLSCRIPTS)
  1848. +     cd $(INSTALLSCRIPTS) ; chmod +x $(SCRIPTS)
  1849. + installmanuals:
  1850. +     for i in $(MANUALS1) ; do $(MANCP) $$i.1 $(INSTALLMANUALS1)/$$i.$(SUFFIXMANUALS1) ; done
  1851. +     for i in $(MANUALS3) ; do $(MANCP) $$i.3 $(INSTALLMANUALS3)/$$i.$(SUFFIXMANUALS3) ; done
  1852. +     for i in $(MANUALS5) ; do $(MANCP) $$i.5 $(INSTALLMANUALS5)/$$i.$(SUFFIXMANUALS5) ; done
  1853. + # Rules for plain programs.
  1854. + $(PORTBINARIES) $(TIFFBINARIES):    pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) $(LIBPNM) $(LIBPPM) $(LIBPGM) $(LIBPBM) $(TIFFLIB)
  1855. +     $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c $(LIBPNM) $(LIBPPM) $(LIBPGM) $(LIBPBM) $(TIFFLIB)
  1856. + # Rule for math-dependent programs.
  1857. + $(MATHBINARIES):        pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) $(LIBPNM) \
  1858. +             $(LIBPPM) $(LIBPGM) $(LIBPBM)
  1859. +     $(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c -lm $(LIBPNM) $(LIBPPM) $(LIBPGM) $(LIBPBM)
  1860. + # Rule for objects.
  1861. + $(OBJECTS):    pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM)
  1862. +     $(CC) $(ALLCFLAGS) "-Dmain=$*_main" -c $*.c
  1863. + # And libraries.
  1864. + $(LIBPBM):
  1865. +     cd $(PBMDIR) ; make lib
  1866. + $(LIBPGM) FOO:
  1867. +     cd $(PGMDIR) ; make lib
  1868. + $(LIBPPM) BAR:
  1869. +     cd $(PPMDIR) ; make lib
  1870. + lib:        $(LIBPNM)
  1871. + $(LIBPNM):    libpnm1.o libpnm2.o libpnm3.o libpnm4.o
  1872. +     
  1873. +     ar rc $(LIBPNM) libpnm1.o libpnm2.o libpnm3.o libpnm4.o
  1874. +   
  1875. + libpnm1.o:    pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm1.c
  1876. +     $(CC) $(ALLCFLAGS) -c libpnm1.c
  1877. + libpnm2.o:    pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm2.c $(DEFLIBPPM) \
  1878. +         $(DEFLIBPGM) $(DEFLIBPBM)
  1879. +     $(CC) $(ALLCFLAGS) -c libpnm2.c
  1880. + libpnm3.o:    pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) libpnm3.c $(DEFLIBPPM) \
  1881. +         $(DEFLIBPGM) $(DEFLIBPBM)
  1882. +     $(CC) $(ALLCFLAGS) -c libpnm3.c
  1883. + libpnm4.o:    pnm.h $(DEFPPM) $(DEFPGM) $(DEFPBM) rast.h libpnm4.c
  1884. +     $(CC) $(ALLCFLAGS) -c libpnm4.c
  1885. + # Other dependencies.
  1886. + pnmarith pnmarith.o:        pnmarith.c
  1887. + pnmcat pnmcat.o:        pnmcat.c
  1888. + pnmconvol pnmconvol.o:        pnmconvol.c
  1889. + pnmcrop pnmcrop.o:        pnmcrop.c
  1890. + pnmcut pnmcut.o:        pnmcut.c
  1891. + pnmdepth pnmdepth.o:        pnmdepth.c
  1892. + pnmenlarge pnmenlarge.o:    pnmenlarge.c
  1893. + pnmfile pnmfile.o:        pnmfile.c
  1894. + pnmflip pnmflip.o:        pnmflip.c
  1895. + pnmgamma pnmgamma.o:        pnmgamma.c
  1896. + pnminvert pnminvert.o:        pnminvert.c
  1897. + pnmnoraw pnmnoraw.o:        pnmnoraw.c
  1898. + pnmpaste pnmpaste.o:        pnmpaste.c
  1899. + pnmrotate pnmrotate.o:        pnmrotate.c
  1900. + pnmscale pnmscale.o:        pnmscale.c
  1901. + pnmshear pnmshear.o:        pnmshear.c
  1902. + pnmtile pnmtile.o:        pnmtile.c
  1903. + pnmtorast pnmtorast.o:        pnmtorast.c rast.h
  1904. + pnmtotiff pnmtotiff.o:        pnmtotiff.c
  1905. + pnmtoxwd pnmtoxwd.o:        pnmtoxwd.c x11wd.h
  1906. + rasttopnm rasttopnm.o:        rasttopnm.c rast.h
  1907. + tifftopnm tifftopnm.o:        tifftopnm.c
  1908. + xwdtopnm xwdtopnm.o:        xwdtopnm.c x10wd.h x11wd.h
  1909. diff -c -B -H +new-file +recursive pbmplus.old/pnm/pnmtoras.c pbmplus.new/pnm/pnmtoras.c
  1910. *** pbmplus.old/pnm/pnmtoras.c    Fri Apr 12 00:31:04 1991
  1911. --- pbmplus.new/pnm/pnmtoras.c    Sat Apr 20 17:21:20 1991
  1912. ***************
  1913. *** 19,24 ****
  1914. --- 19,29 ----
  1915.   static colormap_t* make_pr_colormap();
  1916.   #endif /*PPM*/
  1917.   
  1918. + #ifdef GNUDOS
  1919. + FILE* ofp;
  1920. + char fname[100], *fcp;
  1921. + #endif /* GNUDOS */
  1922.   void main( argc, argv )
  1923.       int argc;
  1924.       char* argv[];
  1925. ***************
  1926. *** 69,74 ****
  1927. --- 74,91 ----
  1928.       if ( argn != argc )
  1929.       pm_usage( usage );
  1930.   
  1931. + #ifdef GNUDOS
  1932. +     if ( ifp == stdin )  
  1933. +         strcpy( fname, "noname" );
  1934. +     else {
  1935. +         strcpy( fname, argv[1] );
  1936. +         if ( ( fcp = index( fname, '.' ) ) != 0 )
  1937. +             *fcp = '\0';
  1938. +         }
  1939. +     strcat( fname, ".ras"  );
  1940. +     ofp = pm_openwb( fname );
  1941. + #endif /* GNUDOS */
  1942.       xels = pnm_readpnm( ifp, &cols, &rows, &maxval, &format );
  1943.   
  1944.       pm_close( ifp );
  1945. ***************
  1946. *** 248,254 ****
  1947.       }
  1948.   
  1949.       /* Finally, write the sucker out. */
  1950. !     pr_dump( pr, stdout, pr_colormapP, pr_type, 0 );
  1951.   
  1952.       exit( 0 );
  1953.       }
  1954. --- 265,279 ----
  1955.       }
  1956.   
  1957.       /* Finally, write the sucker out. */
  1958. ! #ifdef GNUDOS
  1959. !     pr_dump( pr, ofp, pr_colormapP, pr_type, 0 );
  1960. ! #else /* GNUDOS */
  1961. !     pr_dump( pr, stdout, pr_colormapP, pr_type, 0 );
  1962. ! #endif /* GNUDOS */
  1963. ! #ifdef GNUDOS
  1964. !     pm_close( ofp );
  1965. ! #endif /* GNUDOS */
  1966.   
  1967.       exit( 0 );
  1968.       }
  1969.