xref: /csrg-svn/lib/libplot/hp2648/open.c (revision 61393)
148517Sbostic /*-
2*61393Sbostic  * Copyright (c) 1980, 1993
3*61393Sbostic  *	The Regents of the University of California.  All rights reserved.
448517Sbostic  *
548517Sbostic  * %sccs.include.proprietary.c%
619975Sdist  */
719975Sdist 
815456Sralph #ifndef lint
9*61393Sbostic static char sccsid[] = "@(#)open.c	8.1 (Berkeley) 06/04/93";
1048517Sbostic #endif /* not lint */
1115456Sralph 
1215456Sralph #include <sgtty.h>
1315456Sralph #include "hp2648.h"
1415456Sralph 
1515456Sralph int shakehands;
1615456Sralph int currentx;
1715456Sralph int currenty;
1815456Sralph int buffcount;
1915456Sralph int fildes;
2015456Sralph float lowx;
2115456Sralph float lowy;
2215456Sralph float scalex;
2315456Sralph float scaley;
2415456Sralph struct sgttyb sarg;
2515456Sralph 
openpl()2615456Sralph openpl()
2715456Sralph {
2815456Sralph 	if ( isatty(fileno( stdout )) ) {
2915456Sralph 		shakehands = TRUE;
3015456Sralph 		fildes = open(TERMINAL, 0);
3115456Sralph 		gtty(fildes, &sarg);
3215456Sralph 		sarg.sg_flags = sarg.sg_flags | RAW;
3315456Sralph 		stty(fildes, &sarg);
3415456Sralph 		sarg.sg_flags = sarg.sg_flags & ~RAW;
3515456Sralph 	}
3615456Sralph 	else {
3715456Sralph 		shakehands = FALSE;
3815456Sralph 	}
3915456Sralph 	buffcount = 0;
4015456Sralph 	currentx = 0;
4115456Sralph 	currenty = 0;
4215456Sralph 	buffready(8);
4315456Sralph 	putchar(ESC);
4415456Sralph 	putchar(GRAPHIC);
4515456Sralph 	putchar(DISPLAY);
4615456Sralph 	putchar('c');
4715456Sralph 	putchar(ESC);
4815456Sralph 	putchar(GRAPHIC);
4915456Sralph 	putchar(PLOT);
5015456Sralph 	putchar(BINARY);
5115456Sralph 	space(0,0,720,360);
5215456Sralph }
53