Line | |
---|
1 | #include <curses.h>
|
---|
2 | #include "curspriv.h"
|
---|
3 |
|
---|
4 | /****************************************************************/
|
---|
5 | /* Wclrtobot() fills the right half of the cursor line of */
|
---|
6 | /* Window 'win', and all lines below it with blanks. */
|
---|
7 | /****************************************************************/
|
---|
8 |
|
---|
9 | int wclrtobot(win)
|
---|
10 | WINDOW *win;
|
---|
11 | {
|
---|
12 | int y, minx, startx, *ptr, *end, *maxx, blank;
|
---|
13 |
|
---|
14 | blank = ' ' | (win->_attrs & ATR_MSK);
|
---|
15 | startx = win->_curx;
|
---|
16 | for (y = win->_cury; y <= win->_regbottom; y++) {
|
---|
17 | minx = _NO_CHANGE;
|
---|
18 | end = &win->_line[y][win->_maxx];
|
---|
19 | for (ptr = &win->_line[y][startx]; ptr <= end; ptr++) {
|
---|
20 | if (*ptr != blank) {
|
---|
21 | maxx = ptr;
|
---|
22 | if (minx == _NO_CHANGE) minx = ptr - win->_line[y];
|
---|
23 | *ptr = blank;
|
---|
24 | } /* if */
|
---|
25 | } /* for */
|
---|
26 | if (minx != _NO_CHANGE) {
|
---|
27 | if ((win->_minchng[y] > minx) || (win->_minchng[y] == _NO_CHANGE))
|
---|
28 | win->_minchng[y] = minx;
|
---|
29 | if (win->_maxchng[y] < maxx - win->_line[y])
|
---|
30 | win->_maxchng[y] = maxx - win->_line[y];
|
---|
31 | } /* if */
|
---|
32 | startx = 0;
|
---|
33 | }
|
---|
34 | return(OK);
|
---|
35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.