xref: /csrg-svn/lib/libplot/hp2648/open.c (revision 19975)
1*19975Sdist /*
2*19975Sdist  * Copyright (c) 1980 Regents of the University of California.
3*19975Sdist  * All rights reserved.  The Berkeley software License Agreement
4*19975Sdist  * specifies the terms and conditions for redistribution.
5*19975Sdist  */
6*19975Sdist 
715456Sralph #ifndef lint
8*19975Sdist static char sccsid[] = "@(#)open.c	5.1 (Berkeley) 05/07/85";
9*19975Sdist #endif not lint
1015456Sralph 
1115456Sralph #include <sgtty.h>
1215456Sralph #include "hp2648.h"
1315456Sralph 
1415456Sralph int shakehands;
1515456Sralph int currentx;
1615456Sralph int currenty;
1715456Sralph int buffcount;
1815456Sralph int fildes;
1915456Sralph float lowx;
2015456Sralph float lowy;
2115456Sralph float scalex;
2215456Sralph float scaley;
2315456Sralph struct sgttyb sarg;
2415456Sralph 
2515456Sralph openpl()
2615456Sralph {
2715456Sralph 	if ( isatty(fileno( stdout )) ) {
2815456Sralph 		shakehands = TRUE;
2915456Sralph 		fildes = open(TERMINAL, 0);
3015456Sralph 		gtty(fildes, &sarg);
3115456Sralph 		sarg.sg_flags = sarg.sg_flags | RAW;
3215456Sralph 		stty(fildes, &sarg);
3315456Sralph 		sarg.sg_flags = sarg.sg_flags & ~RAW;
3415456Sralph 	}
3515456Sralph 	else {
3615456Sralph 		shakehands = FALSE;
3715456Sralph 	}
3815456Sralph 	buffcount = 0;
3915456Sralph 	currentx = 0;
4015456Sralph 	currenty = 0;
4115456Sralph 	buffready(8);
4215456Sralph 	putchar(ESC);
4315456Sralph 	putchar(GRAPHIC);
4415456Sralph 	putchar(DISPLAY);
4515456Sralph 	putchar('c');
4615456Sralph 	putchar(ESC);
4715456Sralph 	putchar(GRAPHIC);
4815456Sralph 	putchar(PLOT);
4915456Sralph 	putchar(BINARY);
5015456Sralph 	space(0,0,720,360);
5115456Sralph }
52