diff options
author | ache <ache@FreeBSD.org> | 1994-10-07 08:58:58 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-10-07 08:58:58 +0000 |
commit | a80c0624fbd8bd1c784b0b5b7a0fd20b09d317b9 (patch) | |
tree | 4a94ca97fb2fc2fdc1fcdd522a66e39c6e763138 /lib/libncurses/lib_deleteln.c | |
download | FreeBSD-src-a80c0624fbd8bd1c784b0b5b7a0fd20b09d317b9.zip FreeBSD-src-a80c0624fbd8bd1c784b0b5b7a0fd20b09d317b9.tar.gz |
Moved from ports with several enhancements
Diffstat (limited to 'lib/libncurses/lib_deleteln.c')
-rw-r--r-- | lib/libncurses/lib_deleteln.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/libncurses/lib_deleteln.c b/lib/libncurses/lib_deleteln.c new file mode 100644 index 0000000..d218eb4 --- /dev/null +++ b/lib/libncurses/lib_deleteln.c @@ -0,0 +1,48 @@ + +/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * +* details. If they are missing then this copy is in violation of * +* the copyright conditions. */ + +/* +** lib_deleteln.c +** +** The routine wdeleteln(). +** +*/ + +#include "curses.priv.h" +#include <nterm.h> + +int wdeleteln(WINDOW *win) +{ +chtype *end, *temp; +int y, touched = 0; + + T(("wdeleteln(%x) called", win)); + + temp = win->_line[win->_cury]; + + if (win->_idlok && (delete_line != NULL)) { + putp(delete_line); + touched = 1; + } + + for (y = win->_cury; y < win->_regbottom; y++) { + win->_line[y] = win->_line[y+1]; + + if (!touched) { + win->_firstchar[y] = 0; + win->_lastchar[y] = win->_maxx; + } + } + + win->_line[win->_regbottom] = temp; + if (!touched) { + win->_firstchar[win->_regbottom] = 0; + win->_lastchar[win->_regbottom] = win->_maxx; + } + + for (end = &(temp[win->_maxx]); temp <= end; ) + *temp++ = ' ' | win->_attrs; + return OK; +} |