home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / printer / dvi2pcl.lha / doallpages.c < prev    next >
C/C++ Source or Header  |  1992-11-25  |  2KB  |  70 lines

  1. /* $Log:    doallpages.c,v $
  2.  * Revision 0.8  92/11/23  19:46:40  19:46:40  bt (Bo Thide')
  3.  * Fixed resolution bug. Portable downloading. Added/changed options. PJXL color support
  4.  * 
  5.  * Revision 0.7  92/11/13  02:41:24  02:41:24  bt (Bo Thide')
  6.  * More bug fixes and improvements. Support for PaintJet XL
  7.  * 
  8.  * Revision 0.6  92/11/10  21:47:40  21:47:40  bt (Bo Thide')
  9.  * Bug fixes. Added -R option. Better font handling.
  10.  * 
  11.  * Revision 0.5  92/11/09  16:25:27  16:25:27  bt (Bo Thide')
  12.  * Rewrite of dospecial.c. Extended \special support
  13.  * 
  14.  * Revision 0.4  92/11/08  02:45:42  02:45:42  bt (Bo Thide')
  15.  * Changed to portable bit manipulations. Replaced strrstr for non-POSIX compliant C. Fixed numerous bugs. Added support for more \special's.
  16.  * 
  17.  * Revision 0.3  92/08/24  12:45:35  12:45:35  bt (Bo Thide')
  18.  * Fixed 8 bit (dc font) support.
  19.  * 
  20.  * Revision 0.2  92/08/23  17:28:55  17:28:55  bt (Bo Thide')
  21.  * Source cleaned up.  Changed certain function calls.  Removed globals.
  22.  * 
  23.  * Revision 0.1  92/08/22  23:58:47  23:58:47  bt (Bo Thide')
  24.  * First Release.
  25.  *  */
  26.  
  27. #include <stdio.h>
  28. #include "macros.h"
  29. #include "globals.h"
  30.  
  31. static char rcsid[] = "$Header: doallpages.c,v 0.8 92/11/23 19:46:40 bt Exp $";
  32.  
  33. /*
  34.  * This routine processes all pages in the default 'single-sided' mode.
  35.  * Processing is done in reversal order from higher to lower page numbers.
  36.  * This way output to the old LaserJet+ will be in natural order.
  37.  * This behavior can be controlled via the 'reverse' flag.
  38.  */
  39. void doallpages(bitfile, dvifile, pcllevel, reverse, resolution, device)
  40. FILE    *bitfile;
  41. FILE    *dvifile;
  42. short    pcllevel;
  43. bool    reverse;
  44. short    resolution;
  45. short    device;
  46.     long backpage;
  47.  
  48.     if(inpostamble)
  49.         backpage = lastpage + 1;
  50.     else
  51.         backpage = prevpage + 1;
  52.     maxpages = actualpagecount;
  53.  
  54.     if (!reverse)
  55.         fseek(dvifile, firstpage, 0);
  56.  
  57.     while(maxpages-- > 0) {
  58.         if (reverse)
  59.             fseek(dvifile, backpage , 0);
  60.         scanbop(dvifile);
  61.         backpage = prevpage + 1;
  62.         printbop(startvals, count);
  63.         dopage(bitfile, dvifile, pcllevel, resolution, device);
  64.         if (!reverse) 
  65.             getubyte(dvifile);
  66.     }
  67.     fprintf(stderr,"\n");
  68. }
  69.