Annotation of 43BSD/usr.lib/libcurses/insch.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1980 Regents of the University of California.
        !             3:  * All rights reserved.  The Berkeley software License Agreement
        !             4:  * specifies the terms and conditions for redistribution.
        !             5:  */
        !             6: 
        !             7: #ifndef lint
        !             8: static char sccsid[] = "@(#)insch.c    5.1 (Berkeley) 6/7/85";
        !             9: #endif not lint
        !            10: 
        !            11: # include      "curses.ext"
        !            12: 
        !            13: /*
        !            14:  *     This routine performs an insert-char on the line, leaving
        !            15:  * (_cury,_curx) unchanged.
        !            16:  *
        !            17:  */
        !            18: winsch(win, c)
        !            19: reg WINDOW     *win;
        !            20: char           c; {
        !            21: 
        !            22:        reg char        *temp1, *temp2;
        !            23:        reg char        *end;
        !            24: 
        !            25:        end = &win->_y[win->_cury][win->_curx];
        !            26:        temp1 = &win->_y[win->_cury][win->_maxx - 1];
        !            27:        temp2 = temp1 - 1;
        !            28:        while (temp1 > end)
        !            29:                *temp1-- = *temp2--;
        !            30:        *temp1 = c;
        !            31:        touchline(win, win->_cury, win->_curx, win->_maxx - 1);
        !            32:        if (win->_cury == LINES - 1 && win->_y[LINES-1][COLS-1] != ' ')
        !            33:                if (win->_scroll) {
        !            34:                        wrefresh(win);
        !            35:                        scroll(win);
        !            36:                        win->_cury--;
        !            37:                }
        !            38:                else
        !            39:                        return ERR;
        !            40:        return OK;
        !            41: }

unix.superglobalmegacorp.com

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