1 /*-
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * %sccs.include.proprietary.c%
6 */
7
8 #ifndef lint
9 static char sccsid[] = "@(#)open.c 8.1 (Berkeley) 06/04/93";
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 CR 015
21 # define FF 014
22 # define VERTRESP 48
23 # define HORZRESP 60.
24 # define HORZRES 6.
25 # define VERTRES 8.
26 /* down is line feed, up is reverse oyne feed,
27 left is bwckspace, right is space. 48 points per inch
28 vertically, 60 horizontally */
29
30 int xnow, ynow;
31 int OUTF;
32 struct sgttyb ITTY, PTTY;
33 float HEIGHT = 6.0, WIDTH = 6.0, OFFSET = 0.0;
34 int xscale, xoffset, yscale;
35 float botx = 0., boty = 0., obotx = 0., oboty = 0.;
36 float scalex = 1., scaley = 1.;
37
openpl()38 openpl ()
39 {
40 int reset();
41 xnow = ynow = 0;
42 OUTF = 1;
43 printf("\r");
44 gtty(OUTF, &ITTY);
45 signal (2, reset);
46 PTTY = ITTY;
47 PTTY.sg_flags &= ~CRMOD; /* don't map lf */
48 /* initialize constants */
49 xscale = 4096./(HORZRESP * WIDTH);
50 yscale = 4096 /(VERTRESP * HEIGHT);
51 xoffset = OFFSET * HORZRESP;
52 return;
53 }
54
openvt()55 openvt(){
56 openpl();
57 }
58