xref: /csrg-svn/lib/libplot/t450/open.c (revision 13371)
1*13371Ssam #ifndef lint
2*13371Ssam static char sccsid[] = "@(#)open.c	4.1 (Berkeley) 06/27/83";
3*13371Ssam #endif
4*13371Ssam 
5*13371Ssam #
6*13371Ssam #include <sgtty.h>
7*13371Ssam /* gsi plotting output routines */
8*13371Ssam # define DOWN 012
9*13371Ssam # define UP 013
10*13371Ssam # define LEFT 010
11*13371Ssam # define RIGHT 040
12*13371Ssam # define BEL 007
13*13371Ssam # define ACK 006
14*13371Ssam #define PLOTIN 063
15*13371Ssam #define PLOTOUT 064
16*13371Ssam # define CR 015
17*13371Ssam # define FF 014
18*13371Ssam # define VERTRESP 48
19*13371Ssam # define HORZRESP 60.
20*13371Ssam # define HORZRES 6.
21*13371Ssam # define VERTRES 8.
22*13371Ssam /* down is line feed, up is reverse oyne feed,
23*13371Ssam    left is bwckspace, right is space.  48 points per inch
24*13371Ssam    vertically, 60 horizontally */
25*13371Ssam 
26*13371Ssam int xnow, ynow;
27*13371Ssam int OUTF;
28*13371Ssam struct sgttyb ITTY, PTTY;
29*13371Ssam float HEIGHT = 6.0, WIDTH = 6.0, OFFSET = 0.0;
30*13371Ssam int xscale, xoffset, yscale;
31*13371Ssam float botx = 0., boty = 0., obotx = 0., oboty = 0.;
32*13371Ssam float scalex = 1., scaley = 1.;
33*13371Ssam 
34*13371Ssam openpl ()
35*13371Ssam {
36*13371Ssam 	int reset();
37*13371Ssam 		xnow = ynow = 0;
38*13371Ssam 		OUTF = 1;
39*13371Ssam 		printf("\r");
40*13371Ssam 		gtty(OUTF, &ITTY);
41*13371Ssam 		signal (2, reset);
42*13371Ssam 		PTTY = ITTY;
43*13371Ssam 		PTTY.sg_flags &= ~CRMOD;	/* don't map lf */
44*13371Ssam 		stty(OUTF,&PTTY);
45*13371Ssam 		/* initialize constants */
46*13371Ssam 		xscale  = 4096./(HORZRESP * WIDTH);
47*13371Ssam 		yscale = 4096 /(VERTRESP * HEIGHT);
48*13371Ssam 		xoffset = OFFSET * HORZRESP;
49*13371Ssam 		return;
50*13371Ssam }
51*13371Ssam 
52*13371Ssam openvt(){
53*13371Ssam openpl();
54*13371Ssam }
55