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