This is skippage.c in view mode; [Download] [Up]
/*
* skippage.c of dvisw software package.
*
* Skips over a page, collecting possible font definitions. A very simple
* case statement insures we maintain sync with the dvi file by collecting
* the necessary parameters; font definitions must be processed normally,
* however.
*/
#include "structures.h"
/*
* These are the external routines called.
*/
extern shalfword dvibyte() ;
extern halfword twobytes() ;
extern integer threebytes() ;
extern integer signedquad() ;
extern shalfword signedbyte() ;
extern shalfword signedpair() ;
extern integer signedtrio() ;
Boolean prescan ;
extern void skipover() ;
extern void fontdef() ;
extern void dospecial() ;
extern void abortdvi() ;
extern void bopcolor() ;
/*
* These are the external variables accessed.
*/
extern integer pagenum ;
extern Boolean pageinterrupted ;
/*
* And now the big routine.
*/
static signed char comlen[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1,-1,-1,-1, 8, 1,-1,-1,-1, 8, 0,-1, 0, 0, 0, 1, /* 128 - 143 */
2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 1, 2, 3, /* 144 - 159 */
4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 0, 0, 0, 0, /* 160 - 175 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 176 - 191 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 192 - 207 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 208 - 223 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,-1,-1,-1,-2, /* 224 - 239 */
-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 } ; /* 240 - 255 */
void skippage() {
register shalfword cmd ;
register integer i ;
register signed char *com = comlen ;
prescan = 1 ;
pageinterrupted = 0 ;
bopcolor(0) ;
while ((cmd=dvibyte())!=140) {
i = com[cmd] ;
if (i >= 0) {
while (i > 0) {
dvibyte() ;
i-- ;
}
} else if (i == -2) {
if (cmd == 243)
fontdef() ;
else {
i = 0 ;
while (cmd > 238) {
i = i * 256 + dvibyte() ;
cmd-- ;
}
dospecial(i) ;
}
} else
abortdvi() ;
}
prescan = 0 ;
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.