| 1 |
|
| 2 |
|
| 3 |
#include <curspriv.h> |
| 4 |
|
| 5 |
RCSID("$Id: delch.c,v 1.33 2008/07/13 16:08:18 wmcbrine Exp $") |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
#include <string.h> |
| 36 |
|
| 37 |
int wdelch(WINDOW *win) |
| 38 |
{ |
| 39 |
int y, x, maxx; |
| 40 |
chtype *temp1; |
| 41 |
|
| 42 |
PDC_LOG(("wdelch() - called\n")); |
| 43 |
|
| 44 |
if (!win) |
| 45 |
return ERR; |
| 46 |
|
| 47 |
y = win->_cury; |
| 48 |
x = win->_curx; |
| 49 |
maxx = win->_maxx - 1; |
| 50 |
temp1 = &win->_y[y][x]; |
| 51 |
|
| 52 |
memmove(temp1, temp1 + 1, (maxx - x) * sizeof(chtype)); |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
win->_y[y][maxx] = win->_bkgd; |
| 57 |
|
| 58 |
win->_lastch[y] = maxx; |
| 59 |
|
| 60 |
if ((win->_firstch[y] == _NO_CHANGE) || (win->_firstch[y] > x)) |
| 61 |
win->_firstch[y] = x; |
| 62 |
|
| 63 |
PDC_sync(win); |
| 64 |
|
| 65 |
return OK; |
| 66 |
} |
| 67 |
|
| 68 |
int delch(void) |
| 69 |
{ |
| 70 |
PDC_LOG(("delch() - called\n")); |
| 71 |
|
| 72 |
return wdelch(stdscr); |
| 73 |
} |
| 74 |
|
| 75 |
int mvdelch(int y, int x) |
| 76 |
{ |
| 77 |
PDC_LOG(("mvdelch() - called\n")); |
| 78 |
|
| 79 |
if (move(y, x) == ERR) |
| 80 |
return ERR; |
| 81 |
|
| 82 |
return wdelch(stdscr); |
| 83 |
} |
| 84 |
|
| 85 |
int mvwdelch(WINDOW *win, int y, int x) |
| 86 |
{ |
| 87 |
PDC_LOG(("mvwdelch() - called\n")); |
| 88 |
|
| 89 |
if (wmove(win, y, x) == ERR) |
| 90 |
return ERR; |
| 91 |
|
| 92 |
return wdelch(win); |
| 93 |
} |