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

1.1       root        1: # include      "curses.ext"
                      2: /*     @(#) insch.c: 1.1 10/15/83      (1.4    11/18/82)       */
                      3: 
                      4: /*
                      5:  *     This routine performs an insert-char on the line, leaving
                      6:  * (_cury,_curx) unchanged.
                      7:  *
                      8:  * @(#)insch.c 1.2 (Berkeley) 4/17/81
                      9:  */
                     10: winsch(win, c)
                     11: reg WINDOW     *win;
                     12: chtype         c; {
                     13: 
                     14:        register chtype *temp1, *temp2;
                     15:        register chtype *end;
                     16: 
                     17:        end = &win->_y[win->_cury][win->_curx];
                     18:        temp1 = &win->_y[win->_cury][win->_maxx - 1];
                     19:        temp2 = temp1 - 1;
                     20:        while (temp1 > end)
                     21:                *temp1-- = *temp2--;
                     22:        *temp1 = c;
                     23:        win->_lastch[win->_cury] = win->_maxx - 1;
                     24:        if (win->_firstch[win->_cury] == _NOCHANGE ||
                     25:            win->_firstch[win->_cury] > win->_curx)
                     26:                win->_firstch[win->_cury] = win->_curx;
                     27:        if (win->_cury == LINES - 1 && win->_y[LINES-1][COLS-1] != ' ')
                     28:                if (win->_scroll && !(win->_flags&_ISPAD)) {
                     29:                        wrefresh(win);
                     30:                        scroll(win);
                     31:                        win->_cury--;
                     32:                }
                     33:                else
                     34:                        return ERR;
                     35:        return OK;
                     36: }

unix.superglobalmegacorp.com

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