d097338c192f900ecb002d1b6aad9cc356e43b34
[unix-history] / usr / src / lib / libcurses / deleteln.c
/*
* Copyright (c) 1981 Regents of the University of California.
* All rights reserved.
*
* %sccs.include.redist.c%
*/
#ifndef lint
static char sccsid[] = "@(#)deleteln.c 5.7 (Berkeley) %G%";
#endif /* not lint */
#include <curses.h>
#include <string.h>
/*
* wdeleteln --
* Delete a line from the screen. It leaves (_cury, _curx) unchanged.
*/
int
wdeleteln(win)
register WINDOW *win;
{
register int y;
register char *temp;
#ifdef DEBUG
__TRACE("deleteln: (%0.2o)\n", win);
#endif
temp = win->_y[win->_cury];
for (y = win->_cury; y < win->_maxy - 1; y++) {
if (win->_orig == NULL)
win->_y[y] = win->_y[y + 1];
else
bcopy(win->_y[y + 1], win->_y[y], win->_maxx);
touchline(win, y, 0, win->_maxx - 1);
}
if (win->_orig == NULL)
win->_y[y] = temp;
else
temp = win->_y[y];
(void)memset(temp, ' ', &temp[win->_maxx] - temp);
touchline(win, win->_cury, 0, win->_maxx - 1);
if (win->_orig == NULL)
__id_subwins(win);
return (OK);
}