Back to index

tetex-bin  3.0
skippage.c
Go to the documentation of this file.
00001 /*
00002  *   Skips over a page, collecting possible font definitions.  A very simple
00003  *   case statement insures we maintain sync with the dvi file by collecting
00004  *   the necessary parameters; but font definitions must be processed normally.
00005  */
00006 #include "dvips.h" /* The copyright notice in that file is included too! */
00007 
00008 /*
00009  *   These are the external routines called.
00010  */
00011 #include "protos.h"
00012 
00013 /*
00014  *   These are the external variables accessed.
00015  */
00016 #ifdef DEBUG
00017 extern integer debug_flag;
00018 #endif  /* DEBUG */
00019 extern integer pagenum ;
00020 extern char errbuf[] ;
00021 extern FILE *dvifile ;
00022 extern Boolean noomega ;
00023 /*
00024  *   And now the big routine.
00025  */
00026 void
00027 skippage P1H(void)
00028 {
00029    register shalfword cmd ;
00030    register integer i ;
00031 
00032 #ifdef DEBUG
00033    if (dd(D_PAGE))
00034 #ifdef SHORTINT
00035    (void)fprintf(stderr,"Skipping page %ld\n", pagenum) ;
00036 #else   /* ~SHORTINT */
00037    (void)fprintf(stderr,"Skipping page %d\n", pagenum) ;
00038 #endif  /* ~SHORTINT */
00039 #endif  /* DEBUG */
00040 /* skipover(40) ; skip rest of bop command? how did this get in here? */
00041    bopcolor(0) ;
00042    while ((cmd=dvibyte())!=140) {
00043      switch (cmd) {
00044 /* illegal options */
00045 case 130: case 131: case 135: case 136: case 139: 
00046 case 247: case 248: case 249: case 250: case 251:
00047 case 252: case 253: case 254: case 255:
00048          (void)sprintf(errbuf,
00049             "! DVI file contains unexpected command (%d)",cmd) ;
00050          error(errbuf) ;
00051 /* eight byte commands */
00052 case 132: case 137:
00053    cmd = dvibyte() ;
00054    cmd = dvibyte() ;
00055    cmd = dvibyte() ;
00056    cmd = dvibyte() ;
00057 /* four byte commands */
00058 case 146: case 151: case 156: case 160: case 165: case 170: case 238:
00059    cmd = dvibyte() ;
00060 /* three byte commands */
00061 case 145: case 150: case 155: case 159: case 164: case 169: case 237:
00062    cmd = dvibyte() ;
00063 /* two byte commands */
00064 case 129: case 134:
00065          if (noomega) {
00066             (void)sprintf(errbuf,
00067                "! DVI file contains unexpected Omega command (%d)",cmd) ;
00068             error(errbuf) ;
00069          }
00070 case 144: case 149: case 154: case 158: case 163: case 168: case 236:
00071    cmd = dvibyte() ;
00072 /* one byte commands */
00073 case 128: case 133: case 143: case 148: case 153: case 157: case 162:
00074 case 167: case 235:
00075    cmd = dvibyte() ;
00076    break ;
00077 /* specials */
00078 case 239: i = dvibyte() ; predospecial(i, 0) ; break ;
00079 case 240: i = twobytes() ; predospecial(i, 0) ; break ;
00080 case 241: i = threebytes() ; predospecial(i, 0) ; break ;
00081 case 242: i = signedquad() ; predospecial(i, 0) ; break ;
00082 /* font definition */
00083 case 243: case 244: case 245: case 246:
00084    fontdef(cmd - 242) ;
00085    break ;
00086 default: ;
00087       }
00088    }
00089 }