xref: /csrg-svn/lib/libplot/t300/open.c (revision 61399)
148521Sbostic /*-
2*61399Sbostic  * Copyright (c) 1983, 1993
3*61399Sbostic  *	The Regents of the University of California.  All rights reserved.
448521Sbostic  *
548521Sbostic  * %sccs.include.proprietary.c%
648521Sbostic  */
748521Sbostic 
813319Ssam #ifndef lint
9*61399Sbostic static char sccsid[] = "@(#)open.c	8.1 (Berkeley) 06/04/93";
1048521Sbostic #endif /* not lint */
1113319Ssam 
1213319Ssam #include <sgtty.h>
1313319Ssam /* gsi plotting output routines */
1413319Ssam # define DOWN 012
1513319Ssam # define UP 013
1613319Ssam # define LEFT 010
1713319Ssam # define RIGHT 040
1813319Ssam # define BEL 007
1913319Ssam # define ACK 006
2013319Ssam # define CR 015
2113319Ssam # define FF 014
2213319Ssam # define VERTRESP 48
2313319Ssam # define HORZRESP 60.
2413319Ssam # define HORZRES 6.
2513319Ssam # define VERTRES 8.
2613319Ssam /* down is line feed, up is reverse oyne feed,
2713319Ssam    left is bwckspace, right is space.  48 points per inch
2813319Ssam    vertically, 60 horizontally */
2913319Ssam 
3013319Ssam int xnow, ynow;
3113319Ssam int OUTF;
3213319Ssam struct sgttyb ITTY, PTTY;
3313319Ssam float HEIGHT = 6.0, WIDTH = 6.0, OFFSET = 0.0;
3413319Ssam int xscale, xoffset, yscale;
3513319Ssam float botx = 0., boty = 0., obotx = 0., oboty = 0.;
3613319Ssam float scalex = 1., scaley = 1.;
3713319Ssam 
openpl()3813319Ssam openpl ()
3913319Ssam {
4013319Ssam 	int reset();
4113319Ssam 		xnow = ynow = 0;
4213319Ssam 		OUTF = 1;
4313319Ssam 		printf("\r");
4413319Ssam 		gtty(OUTF, &ITTY);
4513319Ssam 		signal (2, reset);
4613319Ssam 		PTTY = ITTY;
4713319Ssam 		PTTY.sg_flags &= ~CRMOD;	/* don't map lf */
4813319Ssam 		/* initialize constants */
4913319Ssam 		xscale  = 4096./(HORZRESP * WIDTH);
5013319Ssam 		yscale = 4096 /(VERTRESP * HEIGHT);
5113319Ssam 		xoffset = OFFSET * HORZRESP;
5213319Ssam 		return;
5313319Ssam }
5413319Ssam 
openvt()5513319Ssam openvt(){
5613319Ssam openpl();
5713319Ssam }
58