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