1994-10-07 08:58:58 +00:00
|
|
|
|
|
|
|
/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for *
|
|
|
|
* details. If they are missing then this copy is in violation of *
|
|
|
|
* the copyright conditions. */
|
|
|
|
|
|
|
|
/*
|
|
|
|
** lib_clreol.c
|
|
|
|
**
|
|
|
|
** The routine wclrtoeol().
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "curses.priv.h"
|
|
|
|
|
|
|
|
int wclrtoeol(WINDOW *win)
|
|
|
|
{
|
|
|
|
chtype *maxx, *ptr, *end;
|
|
|
|
int y, x, minx;
|
|
|
|
|
|
|
|
T(("wclrtoeol(%x) called", win));
|
|
|
|
|
|
|
|
y = win->_cury;
|
|
|
|
x = win->_curx;
|
|
|
|
|
|
|
|
end = &win->_line[y][win->_maxx];
|
|
|
|
minx = _NOCHANGE;
|
|
|
|
maxx = &win->_line[y][x];
|
|
|
|
|
|
|
|
for (ptr = maxx; ptr <= end; ptr++) {
|
1997-07-30 17:21:39 +00:00
|
|
|
chtype blank = _nc_background(win);
|
|
|
|
|
|
|
|
if (*ptr != blank) {
|
1994-10-07 08:58:58 +00:00
|
|
|
maxx = ptr;
|
|
|
|
if (minx == _NOCHANGE)
|
|
|
|
minx = ptr - win->_line[y];
|
1997-07-30 17:21:39 +00:00
|
|
|
*ptr = blank;
|
1994-10-07 08:58:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (minx != _NOCHANGE) {
|
|
|
|
if (win->_firstchar[y] > minx || win->_firstchar[y] == _NOCHANGE)
|
|
|
|
win->_firstchar[y] = minx;
|
|
|
|
|
|
|
|
if (win->_lastchar[y] < maxx - win->_line[y])
|
|
|
|
win->_lastchar[y] = maxx - win->_line[y];
|
|
|
|
}
|
|
|
|
return(OK);
|
|
|
|
}
|