. use library function to parse memory string
[minix3.git] / lib / curses / wclrtobot.c
blob379ace4700b9ac2ed5386640d6f933ccd0c48506
1 #include <curses.h>
2 #include "curspriv.h"
4 /****************************************************************/
5 /* Wclrtobot() fills the right half of the cursor line of */
6 /* Window 'win', and all lines below it with blanks. */
7 /****************************************************************/
9 int wclrtobot(win)
10 WINDOW *win;
12 int y, minx, startx, *ptr, *end, *maxx, blank;
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;
34 return(OK);