Annotation of 42BSD/usr.lib/libcurses/scroll.c, revision 1.1

1.1     ! root        1: # include      "curses.ext"
        !             2: 
        !             3: /*
        !             4:  *     This routine scrolls the window up a line.
        !             5:  *
        !             6:  * 6/1/83 (Berkeley) @(#)scroll.c      1.3
        !             7:  */
        !             8: scroll(win)
        !             9: reg WINDOW     *win; {
        !            10: 
        !            11:        reg char        *sp;
        !            12:        reg int         i;
        !            13:        reg char        *temp;
        !            14: 
        !            15:        if (!win->_scroll)
        !            16:                return ERR;
        !            17:        temp = win->_y[0];
        !            18:        for (i = 1; i < win->_maxy; i++)
        !            19:                win->_y[i - 1] = win->_y[i];
        !            20:        for (sp = temp; sp < &temp[win->_maxx]; )
        !            21:                *sp++ = ' ';
        !            22:        win->_y[win->_maxy - 1] = temp;
        !            23:        win->_cury--;
        !            24:        if (win == curscr) {
        !            25:                putchar('\n');
        !            26:                if (!NONL)
        !            27:                        win->_curx = 0;
        !            28: # ifdef DEBUG
        !            29:                fprintf(outf, "SCROLL: win == curscr\n");
        !            30: # endif
        !            31:        }
        !            32: # ifdef DEBUG
        !            33:        else
        !            34:                fprintf(outf, "SCROLL: win [0%o] != curscr [0%o]\n",win,curscr);
        !            35: # endif
        !            36:        touchwin(win);
        !            37:        return OK;
        !            38: }

unix.superglobalmegacorp.com

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