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

Defined functions

winsch defined in line 9; used 4 times
Last modified: 1983-05-18
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 612
Valid CSS Valid XHTML 1.0 Strict