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 PLOTIN 063 15 #define PLOTOUT 064 16 # define CR 015 17 # define FF 014 18 # define VERTRESP 48 19 # define HORZRESP 60. 20 # define HORZRES 6. 21 # define VERTRES 8. 22 /* down is line feed, up is reverse oyne feed, 23 left is bwckspace, right is space. 48 points per inch 24 vertically, 60 horizontally */ 25 26 int xnow, ynow; 27 int OUTF; 28 struct sgttyb ITTY, PTTY; 29 float HEIGHT = 6.0, WIDTH = 6.0, OFFSET = 0.0; 30 int xscale, xoffset, yscale; 31 float botx = 0., boty = 0., obotx = 0., oboty = 0.; 32 float scalex = 1., scaley = 1.; 33 34 openpl () 35 { 36 int reset(); 37 xnow = ynow = 0; 38 OUTF = 1; 39 printf("\r"); 40 gtty(OUTF, &ITTY); 41 signal (2, reset); 42 PTTY = ITTY; 43 PTTY.sg_flags &= ~CRMOD; /* don't map lf */ 44 stty(OUTF,&PTTY); 45 /* initialize constants */ 46 xscale = 4096./(HORZRESP * WIDTH); 47 yscale = 4096 /(VERTRESP * HEIGHT); 48 xoffset = OFFSET * HORZRESP; 49 return; 50 } 51 52 openvt(){ 53 openpl(); 54 } 55