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

  1. /* $Log:    postamble.c,v $
  2.  * Revision 0.8  92/11/23  19:46:54  19:46:54  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:38  02:41:38  bt (Bo Thide')
  6.  * More bug fixes and improvements. Support for PaintJet XL
  7.  * 
  8.  * Revision 0.6  92/11/10  21:48:36  21:48:36  bt (Bo Thide')
  9.  * Bug fixes. Added -R option. Better font handling.
  10.  * 
  11.  * Revision 0.5  92/11/09  16:25:42  16:25:42  bt (Bo Thide')
  12.  * Rewrite of dospecial.c. Extended \special support
  13.  * 
  14.  * Revision 0.4  92/11/08  02:45:58  02:45:58  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:49  12:45:49  bt (Bo Thide')
  18.  * Fixed 8 bit (dc font) support.
  19.  * 
  20.  * Revision 0.2  92/08/23  17:28:59  17:28:59  bt (Bo Thide')
  21.  * Source cleaned up.  Changed certain function calls.  Removed globals.
  22.  * 
  23.  * Revision 0.1  92/08/22  23:58:48  23:58:48  bt (Bo Thide')
  24.  * First Release.
  25.  *  */
  26.  
  27. /* 
  28.  * Process the postamble. It sets the pointer to the final bop
  29.  * in the dvi file and checks agreement with the corresponding values from
  30.  * the preamble. 
  31.  */
  32.  
  33. #include <stdio.h>
  34. #include "dvi.h"
  35. #include "globals.h"
  36. #include "macros.h"
  37.  
  38. static char rcsid[] = "$Header: postamble.c,v 0.8 92/11/23 19:46:54 bt Exp $";
  39.  
  40. void postamble(dvifile)
  41. FILE    *dvifile;
  42.     int    c, t;
  43.     long    p;
  44.  
  45.     lastpage = (long)getsquad(dvifile);
  46.     if(numerator != (long)getsquad(dvifile))
  47.         fprintf(stderr,"Warning: Pre-post disagreement in numerator\n");
  48.     if(denominator != (long)getsquad(dvifile))
  49.         fprintf(stderr,"Warning: Pre-post disagreement in denominator\n");
  50.     if(magnification != (long)getsquad(dvifile))
  51.         fprintf(stderr,"Warning: Pre-post disagreement in magnification\n");
  52.  
  53.     maxv = (long)getsquad(dvifile);
  54.     maxh = (long)getsquad(dvifile);
  55.     maxs = (int)getspair(dvifile);
  56.     t = (int)getspair(dvifile);
  57.  
  58.     while(TRUE)
  59.     { 
  60.         while((c = (int)getubyte(dvifile)) == DVI_NOP);
  61.         if((c >= DVI_FNT_DEF1) && (c <= DVI_FNT_DEF2))
  62.         { 
  63.             p = firstpar(dvifile, c);
  64.             checkfont(dvifile, p);
  65.         }
  66.         if(c == DVI_POSTPOST) break;
  67.     }
  68. }
  69.