|
|
1.1 root 1: # include "curses.ext"
2: /* @(#) box.c: 1.1 10/15/83 (1.5 3/6/83) */
3:
4: /*
5: * This routine draws a box around the given window with "vert"
6: * as the vertical delimiting char, and "hor", as the horizontal one.
7: *
8: * 1/26/81 (Berkeley) @(#)box.c 1.1
9: */
10:
11: /* Defaults - might someday be terminal dependent using graphics chars */
12: #define DEFVERT '|'
13: #define DEFHOR '-'
14:
15: box(win, vert, hor)
16: register WINDOW *win;
17: chtype vert, hor;
18: {
19: register int i;
20: register int endy, endx;
21: register chtype *fp, *lp;
22:
23: if (vert == 0)
24: vert = DEFVERT;
25: if (hor == 0)
26: hor = DEFHOR;
27: endx = win->_maxx;
28: endy = win->_maxy - 1;
29: fp = win->_y[0];
30: lp = win->_y[endy];
31: for (i = 0; i < endx; i++)
32: fp[i] = lp[i] = hor;
33: endx--;
34: for (i = 0; i <= endy; i++)
35: win->_y[i][0] = (win->_y[i][endx] = vert);
36: touchwin(win);
37: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.