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.1 (Berkeley) 5/7/85";
9: #endif not lint
10:
11: /*
12: * This accepts plot file formats and produces the appropriate plots
13: * for dumb terminals. It can also be used for printing terminals and
14: * lineprinter listings, although there is no way to specify number of
15: * lines and columns different from your terminal. This would be easy
16: * to change, and is left as an exercise for the reader.
17: */
18:
19: #include <signal.h>
20: #include "dumb.h"
21:
22: int minX, rangeX; /* min and range of x */
23: int minY, rangeY; /* min and range of y */
24: int currentx,currenty;
25: int COLS,LINES;
26:
27: /* A very large screen! (probably should use malloc) */
28: char screenmat[MAXCOLS][MAXLINES];
29:
30: openpl()
31: {
32: int closepl();
33: int i, j;
34: char *term, *getenv();
35: char bp[1024];
36:
37: term = getenv("TERM");
38: tgetent(bp, term);
39:
40: COLS = tgetnum("co");
41: if (COLS > MAXCOLS)
42: COLS = MAXCOLS;
43: if (COLS < 0)
44: COLS = 48; /* lower bound on # of cols? */
45: COLS--; /* prevent auto wrap */
46:
47: LINES = tgetnum("li");
48: if (LINES > MAXLINES)
49: LINES = MAXLINES;
50: if (LINES < 0)
51: LINES = 20; /* lower bound on # of lines? */
52:
53: for(i=0; i<COLS; i++)
54: for(j=0; j<LINES; j++)
55: screenmat[i][j] = ' ';
56:
57: signal(SIGINT, closepl);
58: currentx = currenty = 0;
59: }
Defined functions
Defined variables
COLS
defined in line
25; used 70 times
- in line 40-45(6),
53
- in /usr/src/games/battlestar/fly.c line
17,
55,
160,
222,
253
- in /usr/src/games/cribbage/io.c line
567
- in /usr/src/games/hangman/hangman.h line
18-22(3)
- in /usr/src/games/hangman/main.c line
25
- in /usr/src/games/hunt/playit.c line
300,
346,
377(2)
- in /usr/src/games/mille/mille.c line
133
- in /usr/src/games/robots/main.c line
95-96(2),
130
- in /usr/src/games/sail/player.h line
16,
48,
67-69(2)
- in /usr/src/games/worm.c line
77-78(2),
158
- in /usr/src/new/mh/uip/vmh.c line
627-633(4),
1199
- in /usr/src/old/talk/display.c line
105,
112
- in /usr/src/old/talk/init_disp.c line
41,
47,
53
- in /usr/src/ucb/systat/cmds.c line
53-56(2)
- in /usr/src/ucb/systat/swap.c line
278
- in /usr/src/ucb/talk/display.c line
105,
112
- in /usr/src/ucb/talk/init_disp.c line
41,
47,
53
- in /usr/src/usr.bin/plot/crtplot.c line
42,
55-60(2),
88,
116-117(2),
138,
163
- in /usr/src/usr.lib/libcurses/test.c line
24
- in /usr/src/usr.lib/libplot/dumb/dumb.h line
18
- in /usr/src/usr.lib/libplot/dumb/erase.c line
17
- in /usr/src/usr.lib/libplot/dumb/label.c line
16-20(2)
- in /usr/src/usr.lib/libplot/dumb/open.c line
40-45(6),
53
LINES
defined in line
25; used 65 times
- in line 47-54(6)
- in /usr/src/games/battlestar/fly.c line
16,
54,
159-163(2),
196-198(2),
204,
220,
238-242(3),
253
- in /usr/src/games/cribbage/io.c line
567
- in /usr/src/games/hangman/main.c line
25
- in /usr/src/games/hunt/playit.c line
304-305(2),
325
- in /usr/src/games/mille/mille.c line
133
- in /usr/src/games/robots/main.c line
95-96(2),
130
- in /usr/src/games/sail/player.h line
47
- in /usr/src/games/worm.c line
78,
157,
251
- in /usr/src/new/mh/uip/vmh.c line
620-622(2),
1199,
1302
- in /usr/src/old/talk/init_disp.c line
40,
46
- in /usr/src/old/talk/io.c line
102
- in /usr/src/ucb/systat/iostat.c line
21
- in /usr/src/ucb/systat/main.c line
104
- in /usr/src/ucb/systat/mbufs.c line
18
- in /usr/src/ucb/systat/netstat.c line
48
- in /usr/src/ucb/systat/pigs.c line
26
- in /usr/src/ucb/systat/swap.c line
24
- in /usr/src/ucb/systat/vmstat.c line
345
- in /usr/src/ucb/talk/init_disp.c line
40,
46
- in /usr/src/ucb/talk/io.c line
102
- in /usr/src/usr.bin/plot/crtplot.c line
24,
42,
88,
137-140(3),
164
- in /usr/src/usr.lib/libcurses/test.c line
24
- in /usr/src/usr.lib/libplot/dumb/dumb.h line
18(2)
- in /usr/src/usr.lib/libplot/dumb/erase.c line
18
- in /usr/src/usr.lib/libplot/dumb/open.c line
47-54(6)
minX
defined in line
22; used 2 times
minY
defined in line
23; used 2 times
sccsid
defined in line
8;
never used