8 Rectangle rpage = { 0, 0, 850, 1150 };
14 char libfont[256] = "/lib/font/bit";
15 char mapfile[256] = "MAP";
16 char *mapname = "MAP";
21 fprint(2, "usage: proof [-m mag] [-/ nview] [-x xoff] [-y yoff] "
22 "[-M mapfile] [-F fontdir] [-dt] file...\n");
27 main(int argc, char *argv[])
33 case 'M': /* change MAP file */
34 mapname = EARGF(usage());
36 case 'F': /* change /lib/font/bit directory */
37 strncpy(libfont, EARGF(usage()), sizeof libfont);
42 case 'm': /* magnification */
43 mag = atof(EARGF(usage()));
44 if (mag < 0.1 || mag > 10){
45 fprint(2, "ridiculous mag argument ignored\n");
53 xyoffset.x += atof(EARGF(usage())) * 100;
56 xyoffset.y += atof(EARGF(usage())) * 100;
59 nview = atof(EARGF(usage()));
60 if (nview < 1 || nview > MAXVIEW)
69 if (open(argv[0], 0) != 0) {
70 sysfatal("can't open %s: %r", argv[0]);
71 exits("open failure");
76 Binit(&bin, 0, OREAD);
77 snprint(mapfile, sizeof mapfile, "%s/%s", libfont, mapname);
79 for (c = 0; c < NFONT; c++)
80 loadfontname(c, "??");
88 * Input buffer to allow us to back up
90 #define SIZE 100000 /* 8-10 pages, typically */
93 char *inc = bufc; /* where next input character goes */
94 char *outc = bufc; /* next character to be read from buffer */
95 int off; /* position of outc in total input stream */
101 if(inc == &bufc[SIZE])
118 if(outc == &bufc[SIZE])
130 for(n=0; !fullrune(buf, n); n++){
141 nbuf(void) /* return number of buffered characters */
178 fprint(2, "backup buffer overflow\n");
196 static char buf[2048];
199 for(i=0; i<sizeof buf; ){