Commit | Line | Data |
---|---|---|
259c2c61 KA |
1 | # include "curses.ext" |
2 | ||
3 | /* | |
4 | * This routine performs an insert-line on the window, leaving | |
5 | * (_cury,_curx) unchanged. | |
6 | * | |
70527d7d | 7 | * %G% (Berkeley) @(#)insertln.c 1.4 |
259c2c61 KA |
8 | */ |
9 | winsertln(win) | |
10 | reg WINDOW *win; { | |
11 | ||
12 | reg char *temp; | |
13 | reg int y; | |
14 | reg char *end; | |
15 | ||
5a3f0553 | 16 | temp = win->_y[win->_maxy-1]; |
259c2c61 KA |
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++ = ' '; | |
5a3f0553 | 26 | win->_y[win->_cury] = temp - win->_maxx; |
70527d7d KA |
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; | |
259c2c61 | 36 | } |