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: #if !defined(lint) && !defined(NOSCCS)
   8: static char sccsid[] = "@(#)insch.c	5.1 (Berkeley) 6/7/85";
   9: #endif
  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: }

Defined functions

Defined variables

sccsid defined in line 8; never used
Last modified: 1987-07-26
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1157
Valid CSS Valid XHTML 1.0 Strict