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