# 2.11BSD#431 - /usr/src/usr.lib/libplot/aed/open.c

##### Functions

    openpl            X

##### Variables

    curx              X
    cury              X
    dbuf              X
    scale             X
    sgttyb            X
    xbot              X
    ybot              X

       1: /*
       2:  * Copyright (c) 1980 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #ifndef lint
       8: static char sccsid[] = "@(#)open.c	5.2 (Berkeley) 4/30/85";
       9: #endif not lint
      10:
      11:
      12: /*
      13:  * Displays plot files on a AED512 graphics terminal.
      14:  */
      15:
      16: #include "aed.h"
      17:
      18: char dbuf[BUFSIZ];  /* Used to buffer display characters */
      19: struct sgttyb sgttyb;   /* Used to save terminal control bits */
      20: int curx, cury;     /* Current screen position */
      21: int xbot, ybot;     /* Coordinates of screen lower-left corner */
      22: int scale;      /* The number of pixels per 2**12 units
      23: 			 * of world coordinates.
      24: 			 */
      25:
      26: /*
      27:  * The following is the color map, containing reg, green, and blue
      28:  * values for color locations 0 and 1.
      29:  */
      30:
      31: static int colors[] = {200, 200, 200, 0, 0, 125, 125, 0, 0, 125, 0, 0};
      32:
      33: /*---------------------------------------------------------
      34:  *	Openpl initializes the graphics display and clears its screen.
      35:  *
      36:  *	Results:	None.
      37:  *
      38:  *	Side Effects:
      39:  *	The display is re-initialized and the file is remembered for
      40:  *	use in all subsequent calls to this module.  The display's
      41:  *	color map is reset.  The display is put into raw mode, but
      42:  *	the previous mode bits are saved.
      43:  *
      44:  *	Errors:		None.
      45:  *---------------------------------------------------------
      46:  */
      47: openpl()
      48: {
      49:     int flags, *p, i;
      50:     char dum[4];
      51:
      52:     /* First, grab up the display modes, then reset them to put it
      53:      * into cooked mode.  Also, lock the terminal.
      54:      */
      55:
      56:     (void) gtty(fileno(stdout), &sgttyb);
      57:     flags = sgttyb.sg_flags;
      58:     sgttyb.sg_flags = (sgttyb.sg_flags & ~(RAW | CBREAK)) | EVENP | ODDP;
      59:     (void) stty(fileno(stdout), &sgttyb);
      60:     sgttyb.sg_flags = flags;
      61:
      62:     /* Save the file pointer around for later use, then output an
      63:      * initialization string to the display.  The initialization
      64:      * string resets the terminal, sets formats, clears the display,
      65:      * initializes the read and write masks, and sets the color map.
      66:      */
      67:
      68:     setbuf(stdout, dbuf);
      69:     fputs("\33\33G1HHHN[00LFFCFFMFFFFFFFF", stdout);
      70:     fputs("K0004", stdout);
      71:     p = colors;
      72:     for (i=0; i<12; i++)
      73:     {
      74:     chex(*p++, dum, 2);
      75:     fputs(dum, stdout);
      76:     }
      77:     fputs("^15060AL", stdout);
      78:     scale = 1<<12;
      79:     curx = cury = xbot = ybot = 0;
      80:     (void) fflush(stdout);
      81: }

#### Defined functions

openpl defined in line 47; never used

#### Defined variables

colors defined in line 31; used 1 times

- in line 71

curx defined in line 20; used 35 times

- in line 79
- in /usr/src/games/hack/hack.pri.c line 19-25(3), 171, 635
- in /usr/src/games/hack/hack.rip.c line 68
- in /usr/src/games/hack/hack.termcap.c line 100-110(5), 143-158(7), 168, 185-189(3), 197, 208, 224, 250-254(2), 266-270(2)
- in /usr/src/games/hack/hack.topl.c line 35, 70, 177-185(3)

cury defined in line 20; used 29 times

- in line 79
- in /usr/src/games/hack/hack.pager.c line 146-150(2), 164
- in /usr/src/games/hack/hack.termcap.c line 100, 106-108(2), 120-124(3), 132-144(5), 167, 185, 197, 208, 250-254(2), 266-271(3)
- in /usr/src/games/hack/hack.topl.c line 36, 71, 178-179(3)

dbuf defined in line 18; used 2 times

- in line 68
- in /usr/src/usr.lib/libplot/aed/open.c line 68

scale defined in line 22; used 16 times

- in line 78
- in /usr/src/usr.lib/libplot/aed/circle.c line 31
- in /usr/src/usr.lib/libplot/aed/label.c line 30-35(3)
- in /usr/src/usr.lib/libplot/aed/open.c line 78
- in /usr/src/usr.lib/libplot/aed/space.c line 31-37(8)
- in /usr/src/usr.lib/libplot/aed/subr.c line 67-68(2)

sccsid defined in line 8; never used
sgttyb defined in line 19; used 13 times

- in line 56-60(6)
- in /usr/src/usr.lib/libplot/aed/close.c line 28
- in /usr/src/usr.lib/libplot/aed/open.c line 56-60(6)

xbot defined in line 21; used 4 times

- in line 79
- in /usr/src/usr.lib/libplot/aed/open.c line 79
- in /usr/src/usr.lib/libplot/aed/space.c line 36
- in /usr/src/usr.lib/libplot/aed/subr.c line 67

ybot defined in line 21; used 4 times

- in line 79
- in /usr/src/usr.lib/libplot/aed/open.c line 79
- in /usr/src/usr.lib/libplot/aed/space.c line 38
- in /usr/src/usr.lib/libplot/aed/subr.c line 68

Last modified: 1987-03-09 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 575 |