vplot.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
/*
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
* All Rights Reserved.
*/
/*
* Reads standard graphics input and produces a plot on the
* Varian or Versatec
*/
#include <stdio.h>
#include <signal.h>
#include "vfont.h"
#define SOLID -1
#define DOTTED 014
#define SHORTDASHED 034
#define DOTDASHED 054
#define LONGDASHED 074
int done1;
extern char chrtab[][16];
char *obuf;
int bufsize;
int lastx;
int lasty;
double topx;
double topy;
double botx;
double boty;
int centx = 0;
int centy = 0;
double delx;
double dely;
double del;
int warned = 0; /* Indicates whether the warning message about
* unimplemented routines has been printed */
char picture[] = "/usr/tmp/rastAXXXXXX";
#ifdef sun
#else
#endif
/* variables for used to print from font file */
void cleanup();
int fontSet = 0; /* Has the font file been read */
char *bits;
int argc;
char **argv;
{
register i;
int again;
argc--;
switch (*++arg) {
case 'W':
DevRange = 2048;
BytesPerLine = 880;
#ifdef sun
#else
#endif
break;
case 'V':
DevRange = 1536;
BytesPerLine = 264;
#ifdef sun
#else
#endif
break;
case 'b':
if (argc-- > 1)
break;
default:
break;
}
}
if (argc > 1) {
cleanup();
}
}
/* init constants for scaling */
cleanup();
}
do {
cleanup();
}
cleanup();
}
*cp1++ = 0;
}
} while (again);
cleanup();
}
getpict()
{
case '\n':
continue;
case 's':
else
centx = 0;
centy = 0;
continue;
case 'b':
continue;
case 'l':
done1 |= 01;
continue;
case 'c':
if (!warned) {
warned++;
}
continue;
case 'a':
if (!warned) {
warned++;
}
continue;
case 'm':
continue;
case 't':
done1 |= 01;
continue;
case 'e':
if (done1)
return(1);
continue;
case 'p':
done1 |= 01;
continue;
case 'n':
done1 |= 01;
continue;
case 'f':
case 't':
break;
default:
case 'i':
break;
case 'g':
linmod = LONGDASHED;
break;
case 'r':
break;
case 'd':
break;
}
return(0);
continue;
case 'd':
while (--x1 >= 0)
continue;
case 0: /* ignore null characters */
continue;
case 255:
case EOF:
return(0);
default:
cleanup();
}
}
char ch;
{
register int i,j,k;
register char *ptr,c;
int nbytes;
if (!fontSet)
InitFont(); /* Read font if not already read */
for (j = 0; j < nbytes; j++) {
c = *ptr++;
for (k = 7; k >= 0; k--)
if ((c >> k) & 1)
}
}
if (ch != ' ')
else
}
InitFont()
{
char *s;
int fonts;
int i;
fontSet = 1;
/* Get the font file */
s = fontFile;
perror(s);
cleanup();
}
/* Get the header and check magic number */
perror(s);
cleanup();
}
cleanup();
}
/* Get dispatches */
perror(s);
cleanup();
}
/* Allocate space for bit map and read in bits */
perror(s);
cleanup();
}
/* Close font file */
perror(s);
cleanup();
}
}
{
register res1;
int res2;
int slope;
xinc = 1;
yinc = 1;
xinc = -1;
}
yinc = -1;
}
res1 = 0;
res2 = 0;
res1 = 0;
}
res1 = 0;
}
}
}
#define labs(a) (a >= 0 ? a : -a)
circle(x,y,c)
{
long ep;
int de;
dx = 0;
ep = 0;
for (;;) {
dx++;
break;
}
}
}
}
/*
* Points should be in the range 0 <= x (or y) <= DevRange.
* The origin is the top left-hand corner with increasing x towards the
* right and increasing y going down.
*/
point(x, y)
register int x, y;
{
register unsigned byte;
}
void
cleanup()
{
}
exit(1);
}
getinteger(f)
FILE *f;
{
if (high > 127)
result |= ~0xffff;
return(result);
}