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