xref: /csrg-svn/lib/libplot/t300s/open.c (revision 61403)
148522Sbostic /*-
2*61403Sbostic  * Copyright (c) 1983, 1993
3*61403Sbostic  *	The Regents of the University of California.  All rights reserved.
448522Sbostic  *
548522Sbostic  * %sccs.include.proprietary.c%
648522Sbostic  */
748522Sbostic 
813336Ssam #ifndef lint
9*61403Sbostic static char sccsid[] = "@(#)open.c	8.1 (Berkeley) 06/04/93";
1048522Sbostic #endif /* not lint */
1113336Ssam 
1213336Ssam #include <sgtty.h>
1313336Ssam /* gsi plotting output routines */
1413336Ssam # define DOWN 012
1513336Ssam # define UP 013
1613336Ssam # define LEFT 010
1713336Ssam # define RIGHT 040
1813336Ssam # define BEL 007
1913336Ssam # define ACK 006
2013336Ssam # define CR 015
2113336Ssam # define FF 014
2213336Ssam # define VERTRESP 48
2313336Ssam # define HORZRESP 60.
2413336Ssam # define HORZRES 6.
2513336Ssam # define VERTRES 8.
2613336Ssam /* down is line feed, up is reverse oyne feed,
2713336Ssam    left is bwckspace, right is space.  48 points per inch
2813336Ssam    vertically, 60 horizontally */
2913336Ssam 
3013336Ssam int xnow, ynow;
3113336Ssam int OUTF;
3213336Ssam struct sgttyb ITTY, PTTY;
3313336Ssam float HEIGHT = 6.0, WIDTH = 6.0, OFFSET = 0.0;
3413336Ssam int xscale, xoffset, yscale;
3513336Ssam float botx = 0., boty = 0., obotx = 0., oboty = 0.;
3613336Ssam float scalex = 1., scaley = 1.;
3713336Ssam 
openpl()3813336Ssam openpl ()
3913336Ssam {
4013336Ssam 	int reset();
4113336Ssam 		xnow = ynow = 0;
4213336Ssam 		OUTF = 1;
4313336Ssam 		printf("\r");
4413336Ssam 		gtty(OUTF, &ITTY);
4513336Ssam 		signal (2, reset);
4613336Ssam 		PTTY = ITTY;
4713336Ssam 		PTTY.sg_flags &= ~CRMOD;	/* don't map lf */
4813336Ssam 		/* initialize constants */
4913336Ssam 		xscale  = 4096./(HORZRESP * WIDTH);
5013336Ssam 		yscale = 4096 /(VERTRESP * HEIGHT);
5113336Ssam 		xoffset = OFFSET * HORZRESP;
5213336Ssam 		return;
5313336Ssam }
5413336Ssam 
openvt()5513336Ssam openvt(){
5613336Ssam openpl();
5713336Ssam }
58