date and time created 83/11/10 14:43:58 by ralph
[unix-history] / usr / src / lib / libplot / hp2648 / open.c
CommitLineData
c546fcaa
RC
1#ifndef lint
2static char sccsid[] = "@(#)open.c 4.1 (Berkeley) %G%";
3#endif
4
5#include <sgtty.h>
6#include "hp2648.h"
7
8int shakehands;
9int currentx;
10int currenty;
11int buffcount;
12int fildes;
13float lowx;
14float lowy;
15float scalex;
16float scaley;
17struct sgttyb sarg;
18
19openpl()
20{
21 if ( isatty(fileno( stdout )) ) {
22 shakehands = TRUE;
23 fildes = open(TERMINAL, 0);
24 gtty(fildes, &sarg);
25 sarg.sg_flags = sarg.sg_flags | RAW;
26 stty(fildes, &sarg);
27 sarg.sg_flags = sarg.sg_flags & ~RAW;
28 }
29 else {
30 shakehands = FALSE;
31 }
32 buffcount = 0;
33 currentx = 0;
34 currenty = 0;
35 buffready(8);
36 putchar(ESC);
37 putchar(GRAPHIC);
38 putchar(DISPLAY);
39 putchar('c');
40 putchar(ESC);
41 putchar(GRAPHIC);
42 putchar(PLOT);
43 putchar(BINARY);
44 space(0,0,720,360);
45}