Commit | Line | Data |
---|---|---|
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 | */ |
9 | box(win, vert, hor) | |
10 | reg WINDOW *win; | |
11 | char 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 | } |