xref: /csrg-svn/lib/libplot/hp2648/open.c (revision 15456)
1 #ifndef lint
2 static char sccsid[] = "@(#)open.c	4.1 (Berkeley) 11/10/83";
3 #endif
4 
5 #include <sgtty.h>
6 #include "hp2648.h"
7 
8 int shakehands;
9 int currentx;
10 int currenty;
11 int buffcount;
12 int fildes;
13 float lowx;
14 float lowy;
15 float scalex;
16 float scaley;
17 struct sgttyb sarg;
18 
19 openpl()
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 }
46