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

  1. /* $Log:    betweenpages.c,v $
  2.  * Revision 0.8  92/11/23  19:46:36  19:46:36  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:20  02:41:20  bt (Bo Thide')
  6.  * More bug fixes and improvements. Support for PaintJet XL
  7.  * 
  8.  * Revision 0.6  92/11/10  21:47:37  21:47:37  bt (Bo Thide')
  9.  * Bug fixes. Added -R option. Better font handling.
  10.  * 
  11.  * Revision 0.5  92/11/09  16:25:23  16:25:23  bt (Bo Thide')
  12.  * Rewrite of dospecial.c. Extended \special support
  13.  * 
  14.  * Revision 0.4  92/11/08  02:45:38  02:45:38  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:32  12:45:32  bt (Bo Thide')
  18.  * Fixed 8 bit (dc font) support.
  19.  * 
  20.  * Revision 0.2  92/08/23  17:28:54  17:28:54  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. /*
  28.  * Process the .dvi file between the occurrence of an 'eop' and the next 'bop'
  29.  */
  30.  
  31. #include <stdio.h>
  32. #include "dvi.h"
  33. #include "globals.h"
  34. #include "macros.h"
  35.  
  36. static char rcsid[] = "$Header: betweenpages.c,v 0.8 92/11/23 19:46:36 bt Exp $";
  37.  
  38. extern void    postamble();
  39. extern int    valvalerror();
  40. extern void    scanbop();
  41.  
  42. betweenpages(dvifile, prescan)
  43. FILE    *dvifile;
  44. bool    prescan;
  45.     int    k;
  46.  
  47.     do
  48.     { 
  49.         k = (int)getubyte(dvifile);
  50.         if((k >= DVI_FNT_DEF1) && (k <=DVI_FNT_DEF4)) { 
  51.             firstpar(dvifile, k);
  52.             skipfontdef(dvifile);
  53.             k = DVI_NOP;
  54.         }
  55.     } while(k == DVI_NOP);
  56.  
  57.     if(k == DVI_POST) { 
  58.         inpostamble = TRUE;
  59.         if(prescan)
  60.             postamble(dvifile);
  61.         return(FALSE);
  62.     }
  63.  
  64.     if(k != DVI_BOP)
  65.         valvalerror("Bad .dvi file: byte %d is %d, not DVI_BOP\n",
  66.             ftell(dvifile) - 1 , k);
  67.     scanbop(dvifile);
  68.     return(TRUE);
  69. }
  70.