/* PDCurses */12#include <curspriv.h>34/*man-start**************************************************************56delch7-----89### Synopsis1011int delch(void);12int wdelch(WINDOW *win);13int mvdelch(int y, int x);14int mvwdelch(WINDOW *win, int y, int x);1516### Description1718The character under the cursor in the window is deleted. All19characters to the right on the same line are moved to the left one20position and the last character on the line is filled with a blank.21The cursor position does not change (after moving to y, x if22coordinates are specified).2324### Return Value2526All functions return OK on success and ERR on error.2728### Portability29X/Open ncurses NetBSD30delch Y Y Y31wdelch Y Y Y32mvdelch Y Y Y33mvwdelch Y Y Y3435**man-end****************************************************************/3637#include <string.h>3839int wdelch(WINDOW *win)40{41int y, x, maxx;42chtype *temp1;4344PDC_LOG(("wdelch() - called\n"));4546if (!win)47return ERR;4849y = win->_cury;50x = win->_curx;51maxx = win->_maxx - 1;52temp1 = &win->_y[y][x];5354memmove(temp1, temp1 + 1, (maxx - x) * sizeof(chtype));5556/* wrs (4/10/93) account for window background */5758win->_y[y][maxx] = win->_bkgd;5960win->_lastch[y] = maxx;6162if ((win->_firstch[y] == _NO_CHANGE) || (win->_firstch[y] > x))63win->_firstch[y] = x;6465PDC_sync(win);6667return OK;68}6970int delch(void)71{72PDC_LOG(("delch() - called\n"));7374return wdelch(stdscr);75}7677int mvdelch(int y, int x)78{79PDC_LOG(("mvdelch() - called\n"));8081if (move(y, x) == ERR)82return ERR;8384return wdelch(stdscr);85}8687int mvwdelch(WINDOW *win, int y, int x)88{89PDC_LOG(("mvwdelch() - called\n"));9091if (wmove(win, y, x) == ERR)92return ERR;9394return wdelch(win);95}969798