xref: /original-bsd/lib/libcurses/deleteln.c (revision e59fb703)
1 /*
2  * Copyright (c) 1981 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)deleteln.c	5.4 (Berkeley) 06/01/90";
10 #endif /* not lint */
11 
12 # include	"curses.ext"
13 
14 /*
15  *	This routine deletes a line from the screen.  It leaves
16  * (_cury,_curx) unchanged.
17  *
18  */
19 wdeleteln(win)
20 reg WINDOW	*win;
21 {
22 	reg char	*temp;
23 	reg int		y;
24 	reg char	*end;
25 	reg int		x;
26 
27 # ifdef DEBUG
28 	fprintf(outf, "DELETELN(%0.2o)\n", win);
29 # endif
30 	temp = win->_y[win->_cury];
31 	for (y = win->_cury; y < win->_maxy - 1; y++) {
32 		if (win->_orig == NULL)
33 			win->_y[y] = win->_y[y + 1];
34 		else
35 			bcopy(win->_y[y + 1], win->_y[y], win->_maxx);
36 		touchline(win, y, 0, win->_maxx - 1);
37 	}
38 	if (win->_orig == NULL)
39 		win->_y[y] = temp;
40 	else
41 		temp = win->_y[y];
42 	for (end = &temp[win->_maxx]; temp < end; )
43 		*temp++ = ' ';
44 	touchline(win, win->_cury, 0, win->_maxx - 1);
45 	if (win->_orig == NULL)
46 		_id_subwins(win);
47 	return OK;
48 }
49