vplot.c revision b7d62af5b42f0da2eb668e8d33d24d2f4fdd98a8
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* 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;
static void circle(int, int, int);
static int getinteger(FILE *);
static int getpict(void);
static void InitFont(void);
static void line(int, int, int, int);
static void plotch(char);
static void point(int, int);
int
{
int 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();
/* NOTREACHED */
return (0);
}
static int
getpict(void)
{
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();
}
}
static void
{
int i,j,k;
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
}
static void
InitFont(void)
{
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();
}
}
static void
{
int 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)
static void
circle(int x, int y, int 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.
*/
static void
point(int x, int y)
{
unsigned byte;
}
void
cleanup()
{
}
exit(1);
}
static int
getinteger(FILE *f)
{
if (high > 127)
result |= ~0xffff;
return(result);
}