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