vplot.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <signal.h>
#include <values.h>
#include <fcntl.h>
#include <sgtty.h>
#define NB 88
#define BSIZ 512
#define SOLID -1
#define DOTTED 014
#define SHORTDASHED 034
#define DOTDASHED 054
#define LONGDASHED 074
int again;
int done1;
extern char chrtab[][16];
short plotcom[] = { 0200, 0, 0, 0 };
short eotcom[] = { 0210, 0, 0, 0 };
short obuf[264];
int lastx;
int lasty;
double topx = 1536;
double topy = 1536;
double botx = 0;
double boty = 0;
int centx;
int centy;
double delx = 1536;
double dely = 1536;
double del = 1536;
int bflag;
int fflag;
char *banname;
struct buf {
int bno;
char *block;
};
char picname[] = "/var/tmp/rasterXXXXXX";
char *picture;
char **argv;
{
extern void onintr();
register i;
extern char *optarg;
extern int optind;
register int c;
char *fname;
char *mktemp();
switch (c) {
case 'b':
bflag++;
break;
case 'e':
fflag++;
break;
case '?':
"usage: vplot [ -f raster ] [ file ]\n");
exit(1);
}
if (fflag) {
exit(1);
}
putpict();
exit(0);
}
exit(1);
}
for (i = 0; i < NB; i++) {
}
exit(1);
}
exit(1);
}
/*
* delete following code when filsys deals properly with
* holes in files
*/
for (i = 0; i < 512; i++)
blocks[0][i] = 0;
for (i = 0; i < 32*32; i++)
getpict();
for (i = 0; i < NB; i++)
}
putpict();
if (again) {
goto another;
}
exit(0);
}
getpict()
{
again = 0;
for (;;)
case 's':
else
centx = 0;
centy = 0;
continue;
case 'l':
done1 |= 01;
continue;
case 'm':
continue;
case 't':
done1 |= 01;
continue;
case 'e':
if (done1) {
again++;
return;
}
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;
}
if (x1 == -1)
return;
continue;
case 'd':
while (--x1 >= 0)
continue;
case -1:
return;
default:
printf("Botch\n");
return;
}
}
plotch(c)
register c;
{
register j;
register char *cp;
int i;
if (c < ' ' || c > 0177)
return;
for (i = -16; i < 16; i += 2) {
c = *cp++;
for (j = 7; j >= 0; --j)
if ((c>>j)&1) {
}
}
lastx += 16;
}
int f; /* versatec file number */
putpict()
{
register x;
int y;
if (f == 0) {
if (f < 0) {
exit(1);
}
if (bflag) {
}
}
for (y = 0; y < 2048; y++) {
if ((y&077) == 0)
for (x = 0; x < 32; x++) {
}
*op++ = 0;
*op++ = 0;
*op++ = 0;
*op++ = 0;
if (y&1) {
}
}
}
{
register res1;
int res2;
int slope;
xinc = 1;
yinc = 1;
xinc = -1;
}
yinc = -1;
}
res1 = 0;
res2 = 0;
else
res1 = 0;
}
else
res1 = 0;
}
}
else
}
point(x, y)
register x, y;
{
register bno;
return;
}
}
getblk(b)
register b;
{
register char *tp;
loop:
}
return;
}
}
goto loop;
}
void
onintr()
{
exit(1);
}
zseek(a, b)
{
return (lseek(a, (long)b*512, 0));
}