|
|
1.1 root 1: # include "curses.ext"
2:
3: /*
4: * This routine erases everything on the window.
5: */
6: wclrtobot(win)
7: reg WINDOW *win; {
8:
9: reg int y;
10: reg char *sp, *end, *maxx;
11: reg int startx, minx;
12:
13: startx = win->_curx;
14: for (y = win->_cury; y < win->_maxy; y++) {
15: minx = _NOCHANGE;
16: end = &win->_y[y][win->_maxx];
17: for (sp = &win->_y[y][startx]; sp < end; sp++)
18: if (*sp != ' ') {
19: maxx = sp;
20: if (minx == _NOCHANGE)
21: minx = sp - win->_y[y];
22: *sp = ' ';
23: }
24: if (minx != _NOCHANGE) {
25: if (win->_firstch[y] > minx
26: || win->_firstch[y] == _NOCHANGE)
27: win->_firstch[y] = minx;
28: if (win->_lastch[y] < maxx - win->_y[y])
29: win->_lastch[y] = maxx - win->_y[y];
30: }
31: startx = 0;
32: }
33: win->_curx = win->_cury = 0;
34: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.