Annotation of researchv10no/ncurses/screen/clrtobot.c, revision 1.1.1.1

1.1       root        1: # include      "curses.ext"
                      2: /*     @(#) clrtobot.c: 1.1 10/15/83   (1.3    7/22/82)        */
                      3: 
                      4: /*
                      5:  *     This routine erases everything on the window.
                      6:  *
                      7:  * 1/26/81 (Berkeley) @(#)clrtobot.c   1.1
                      8:  */
                      9: wclrtobot(win)
                     10: reg WINDOW     *win; {
                     11: 
                     12:        reg int         y;
                     13:        reg chtype      *sp, *end, *maxx;
                     14:        reg int         startx, minx;
                     15: 
                     16:        startx = win->_curx;
                     17:        for (y = win->_cury; y < win->_maxy; y++) {
                     18:                minx = _NOCHANGE;
                     19:                end = &win->_y[y][win->_maxx];
                     20:                for (sp = &win->_y[y][startx]; sp < end; sp++)
                     21:                        if (*sp != ' ') {
                     22:                                maxx = sp;
                     23:                                if (minx == _NOCHANGE)
                     24:                                        minx = sp - win->_y[y];
                     25:                                *sp = ' ';
                     26:                        }
                     27:                if (minx != _NOCHANGE) {
                     28:                        if (win->_firstch[y] > minx
                     29:                             || win->_firstch[y] == _NOCHANGE)
                     30:                                win->_firstch[y] = minx;
                     31:                        if (win->_lastch[y] < maxx - win->_y[y])
                     32:                                win->_lastch[y] = maxx - win->_y[y];
                     33:                }
                     34:                startx = 0;
                     35:        }
                     36:        /* win->_curx = win->_cury = 0; */
                     37: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.