date and time created 83/05/31 00:19:54 by sam
[unix-history] / usr / src / lib / libcurses / box.c
CommitLineData
004a9809 1# include "curses.ext"
4c977e83
KA
2
3/*
4 * This routine draws a box around the given window with "vert"
5 * as the vertical delimiting char, and "hor", as the horizontal one.
6 *
004a9809 7 * %G% (Berkeley) @(#)box.c 1.2
4c977e83
KA
8 */
9box(win, vert, hor)
10reg WINDOW *win;
11char vert, hor; {
12
13 reg int i;
14 reg int endy, endx;
15 reg char *fp, *lp;
16
17 endx = win->_maxx;
18 endy = win->_maxy - 1;
19 fp = win->_y[0];
20 lp = win->_y[endy];
21 for (i = 0; i < endx; i++)
22 fp[i] = lp[i] = hor;
23 endx--;
24 for (i = 0; i <= endy; i++)
25 win->_y[i][0] = (win->_y[i][endx] = vert);
26 if (!win->_scroll && (win->_flags&_SCROLLWIN))
27 fp[0] = fp[endx] = lp[0] = lp[endx] = ' ';
28 touchwin(win);
29}