xref: /original-bsd/lib/libcurses/deleteln.c (revision e78e7ec3)
1 # include	"curses.ext"
2 
3 /*
4  *	This routine deletes a line from the screen.  It leaves
5  * (_cury,_curx) unchanged.
6  *
7  * @(#)deleteln.c	1.5 (Berkeley) 05/01/85
8  */
9 wdeleteln(win)
10 reg WINDOW	*win;
11 {
12 	reg char	*temp;
13 	reg int		y;
14 	reg char	*end;
15 	reg int		x;
16 
17 # ifdef DEBUG
18 	fprintf(outf, "DELETELN(%0.2o)\n", win);
19 # endif
20 	temp = win->_y[win->_cury];
21 	for (y = win->_cury; y < win->_maxy - 1; y++) {
22 		if (win->_orig == NULL)
23 			win->_y[y] = win->_y[y + 1];
24 		else
25 			bcopy(win->_y[y + 1], win->_y[y], win->_maxx);
26 		touchline(win, y, 0, win->_maxx - 1);
27 	}
28 	if (win->_orig == NULL)
29 		win->_y[y] = temp;
30 	else
31 		temp = win->_y[y];
32 	for (end = &temp[win->_maxx]; temp < end; )
33 		*temp++ = ' ';
34 	touchline(win, win->_cury, 0, win->_maxx - 1);
35 	if (win->_orig == NULL)
36 		_id_subwins(win);
37 	return OK;
38 }
39