. use library function to parse memory string
[minix3.git] / lib / curses / wdelch.c
blob0fe8c2cfed143c1372bfa32c3eb80e6220bfb7c0
1 #include <curses.h>
2 #include "curspriv.h"
4 /* Wdelch() deletes the character at the window cursor, and the
5 characters to the right of it are shifted left, inserting a
6 space at the last position of the line.
7 */
9 int wdelch(win)
10 WINDOW *win;
12 int *temp1;
13 int *temp2;
14 int *end;
15 int y = win->_cury;
16 int x = win->_curx;
17 int maxx = win->_maxx;
19 end = &win->_line[y][maxx];
20 temp1 = &win->_line[y][x];
21 temp2 = temp1 + 1;
22 while (temp1 < end) *temp1++ = *temp2++;
23 *temp1 = ' ' | (win->_attrs & ATR_MSK);
24 win->_maxchng[y] = maxx;
25 if (win->_minchng[y] == _NO_CHANGE || win->_minchng[y] > x)
26 win->_minchng[y] = x;
27 return(OK);