home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware 1 2 the Maxx
/
sw_1.zip
/
sw_1
/
PROGRAM
/
AECUR100.ZIP
/
CONTRIB
/
CURSES
/
SRC
/
WDELCH.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-08
|
772b
|
35 lines
/*------------------------------------------------------------
*
* wdelch.c
*
* copyright (c) 1987,88,89,90 J. Alan Eldridge
*
* deletes a char at the cursor position in a window
* rightmost char on line is blanked
*
*----------------------------------------------------------*/
#include "curses.h"
int
wdelch(win)
WINDOW *win;
{
VIDCHR *ptr;
int cury, curx, endcol;
getyx(win, cury, curx);
markwin(win);
endcol = win->maxx;
ptr = &(win->buf[cury][curx]);
memcpy(ptr, ptr + 1, (endcol - curx) * sizeof(VIDCHR));
wmove(win, cury, endcol);
win->buf[cury][endcol].chr = ' ';
win->buf[cury][endcol].att = win->attrib;
markwin(win);
wmove(win, cury, curx);
return OK;
}