#include #include #include #include #include "comments.h" #include "gen.h" #include "path.h" int debug = 0; /* predefine int cat(char *); void error(int, char *, ...); */ #define HDLEN 60 char header[HDLEN]; char *screenbits; char hex[] = { 'f', 'e', 'd', 'c', 'b', 'a', '9', '8', '7', '6', '5', '4', '3', '2', '1', '0' }; /* black on gnot is not * black on printer. */ #define LETTERWIDTH 8.5 #define LETTERHEIGHT 11.0 int landscape = 0; #define XOFF (int)((landscape)?((LETTERWIDTH/2 + (float)height * yscale / (2 * 100.)) * 72.):((LETTERWIDTH/2 - (float)width * pixperbyte * xscale / (2 * 100.)) * 72.)) #define YOFF (int)((landscape)?((LETTERHEIGHT/2 - (float)width * pixperbyte * xscale / (2 * 100.)) * 72.):((LETTERHEIGHT/2 - (float)height * yscale / (2 * 100.)) * 72.)) char *prologue = POSTDMD; void preamble(void) { fprintf(stdout, "%s", CONFORMING); fprintf(stdout, "%s %s\n", VERSION, PROGRAMVERSION); fprintf(stdout, "%s %s\n", DOCUMENTFONTS, ATEND); fprintf(stdout, "%s %s\n", PAGES, ATEND); fprintf(stdout, "%s", ENDCOMMENTS); /* if (cat(prologue) == FALSE) { fprintf(2, "can't read %s", prologue); exits("copying prologue"); } */ fprintf(stdout, "%s", ENDPROLOG); fprintf(stdout, "%s", BEGINSETUP); fprintf(stdout, "mark\n"); } void main(int argc, char *argv[]) { FILE *screenfd = stdin; int i, j, bcnt; int width, height, ldepth, bitsperpix, pixperbyte; float xscale = 1.0, yscale = 1.0; Rectangle r; int ; char *bp, *optstr, *patch = 0; for (i=1; i>4], hex[(*bp++&0xf)]); if (j%32 == 31) fprintf(stdout, "\n"); } fprintf(stdout, "\n"); } fprintf(stdout, "showpage\n"); fprintf(stdout, "%%%%BoundingBox: %d %d %6.2f %6.2f\n", XOFF, YOFF, (float)width * pixperbyte * .72 * xscale + XOFF, (float)height * .72 * yscale + YOFF); exits(""); }