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