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