* Reads standard graphics input
* Makes a plot on a 200 dot-per-inch 11" wide
* Creates and leaves /usr/tmp/raster (1000 blocks)
#define mapx(x) ((1536*((x)-botx)/del)+centx)
#define mapy(y) ((1536*(del-(y)+boty)/del)-centy)
#define SETSTATE (('v'<<8)+1)
int plotcom
[] = { 0200, 0, 0};
int eotcom
[] = { 0210, 0, 0};
char *picture
= "/usr/tmp/raster";
if (signal(SIGINT
, SIG_IGN
) != SIG_IGN
)
bufs
[i
].block
= blocks
[i
];
out
= creat(picture
, 0666);
write(out
, blocks
[0], BSIZ
);
/*delete following code when filsys deals properly with
write(out
,blocks
[0],512);
write(out
, bufs
[i
].block
, BSIZ
);
for (;;) switch (x1
= getc(stdin
)) {
if (dely
/delx
> 1536./2048.)
del
= delx
* (1566./2048.);
centx
= (2048 - mapx(topx
)) / 2;
lastx
= mapx(getw(stdin
));
lasty
= mapy(getw(stdin
));
line(x1
, y1
, lastx
, lasty
);
lastx
= mapx(getw(stdin
));
lasty
= mapy(getw(stdin
));
while ((x1
= getc(stdin
)) != '\n')
lastx
= mapx(getw(stdin
));
lasty
= mapy(getw(stdin
));
line(lastx
, lasty
, x1
, y1
);
while((x1
=getc(stdin
))!='\n')
for (i
= -16; i
<16; i
+= 2) {
point(lastx
+6-j
*2, lasty
+i
);
point(lastx
+7-j
*2, lasty
+i
);
point(lastx
+6-j
*2, lasty
+i
+1);
point(lastx
+7-j
*2, lasty
+i
+1);
int f
; /* versatec file number */
printf("Cannot open vp\n");
ioctl(f
, SETSTATE
, plotcom
);
read(in
, blocks
[0], 32*BSIZ
);
ip
= (int *)&blocks
[x
][(y
&077)<<3];
write(f
, (char *)obuf
, sizeof(obuf
));
if (dx
>= dy
) while (x0
!= x1
) {
if (((x0
>>6) + ((y0
&~077)>>1)) == bufs
[0].bno
)
bufs
[0].block
[((y0
&077)<<3)+((x0
>>3)&07)] |= 1 << (7-(x0
&07));
} else while (y0
!= y1
) {
if (((x0
>>6) + ((y0
&~077)>>1)) == bufs
[0].bno
)
bufs
[0].block
[((y0
&077)<<3)+((x0
>>3)&07)] |= 1 << (7-(x0
&07));
if (((x1
>>6) + ((y1
&~077)>>1)) == bufs
[0].bno
)
bufs
[0].block
[((y1
&077)<<3)+((x1
>>3)&07)] |= 1 << (7-(x1
&07));
bno
= ((x
&03700)>>6) + ((y
&03700)>>1);
if (bno
!= bufs
[0].bno
) {
if (bno
< 0 || bno
>= 1024)
bufs
[0].block
[((y
&077)<<3)+((x
>>3)&07)] |= 1 << (7-(x
&07));
register struct buf
*bp1
, *bp2
;
for (bp1
= bufs
; bp1
< &bufs
[NB
]; bp1
++) {
if (bp1
->bno
== b
|| bp1
->bno
== -1) {
for (bp2
= bp1
; bp2
>bufs
; --bp2
) {
bp2
->block
= (bp2
-1)->block
;
zseek(out
, bufs
[NB
-1].bno
);
write(out
, bufs
[NB
-1].block
, BSIZ
);
read(in
, bufs
[NB
-1].block
, BSIZ
);
return(lseek(a
, (long)b
*512, 0));