Line | |
---|
1 | #include <curses.h>
|
---|
2 | #include "curspriv.h"
|
---|
3 |
|
---|
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 | */
|
---|
8 |
|
---|
9 | int wdelch(win)
|
---|
10 | WINDOW *win;
|
---|
11 | {
|
---|
12 | int *temp1;
|
---|
13 | int *temp2;
|
---|
14 | int *end;
|
---|
15 | int y = win->_cury;
|
---|
16 | int x = win->_curx;
|
---|
17 | int maxx = win->_maxx;
|
---|
18 |
|
---|
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);
|
---|
28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.