]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libncurses/lib_delch.c
Make bdev userland access work like cdev userland access unless
[FreeBSD/FreeBSD.git] / lib / libncurses / lib_delch.c
1
2 /* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for   *
3 *  details. If they are missing then this copy is in violation of    *
4 *  the copyright conditions.                                        */
5
6 /*
7 **      lib_delch.c
8 **
9 **      The routine wdelch().
10 **
11 */
12
13 #include "curses.priv.h"
14 #include "terminfo.h"
15
16 int wdelch(WINDOW *win)
17 {
18 chtype  *temp1, *temp2;
19 chtype  *end;
20 chtype  blank = _nc_background(win);
21
22         T(("wdelch(%x) called", win));
23
24         end = &win->_line[win->_cury][win->_maxx];
25         temp2 = &win->_line[win->_cury][win->_curx + 1];
26         temp1 = temp2 - 1;
27
28         while (temp1 < end)
29             *temp1++ = *temp2++;
30
31         *temp1 = blank;
32
33         win->_lastchar[win->_cury] = win->_maxx;
34
35         if (win->_firstchar[win->_cury] == _NOCHANGE
36                                    || win->_firstchar[win->_cury] > win->_curx)
37             win->_firstchar[win->_cury] = win->_curx;
38         return OK;
39 }