Deleted Added
full compact
get_wch.c (1.22) get_wch.c (1.23)
1/* $NetBSD: get_wch.c,v 1.22 2019/05/20 22:17:41 blymn Exp $ */
1/* $NetBSD: get_wch.c,v 1.23 2019/06/09 07:40:14 blymn Exp $ */
2
3/*
4 * Copyright (c) 2005 The NetBSD Foundation Inc.
5 * All rights reserved.
6 *
7 * This code is derived from code donated to the NetBSD Foundation
8 * by Ruibiao Qiu <ruibiao@arl.wustl.edu,ruibiao@gmail.com>.
9 *

--- 21 unchanged lines hidden (view full) ---

31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 */
36
37#include <sys/cdefs.h>
38#ifndef lint
2
3/*
4 * Copyright (c) 2005 The NetBSD Foundation Inc.
5 * All rights reserved.
6 *
7 * This code is derived from code donated to the NetBSD Foundation
8 * by Ruibiao Qiu <ruibiao@arl.wustl.edu,ruibiao@gmail.com>.
9 *

--- 21 unchanged lines hidden (view full) ---

31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 */
36
37#include <sys/cdefs.h>
38#ifndef lint
39__RCSID("$NetBSD: get_wch.c,v 1.22 2019/05/20 22:17:41 blymn Exp $");
39__RCSID("$NetBSD: get_wch.c,v 1.23 2019/06/09 07:40:14 blymn Exp $");
40#endif /* not lint */
41
42#include <errno.h>
43#include <string.h>
44#include <stdlib.h>
45#include <unistd.h>
46#include <stdio.h>
47#include "curses.h"

--- 420 unchanged lines hidden (view full) ---

468/*
469 * mvwget_wch --
470 * Read in a character from stdscr at the given location in the
471 * given window.
472 */
473int
474mvwget_wch(WINDOW *win, int y, int x, wint_t *ch)
475{
40#endif /* not lint */
41
42#include <errno.h>
43#include <string.h>
44#include <stdlib.h>
45#include <unistd.h>
46#include <stdio.h>
47#include "curses.h"

--- 420 unchanged lines hidden (view full) ---

468/*
469 * mvwget_wch --
470 * Read in a character from stdscr at the given location in the
471 * given window.
472 */
473int
474mvwget_wch(WINDOW *win, int y, int x, wint_t *ch)
475{
476 if (_cursesi_wmove(win, y, x, 0) == ERR)
476 if (wmove(win, y, x) == ERR)
477 return ERR;
478
479 return wget_wch(win, ch);
480}
481
482/*
483 * wget_wch --
484 * Read in a wide character from the window.

--- 118 unchanged lines hidden (view full) ---

603
604 if (__echoit) {
605 if ( ret == KEY_CODE_YES ) {
606 /* handle [DEL], [BS], and [LEFT] */
607 if ( win->curx &&
608 ( inp == KEY_DC ||
609 inp == KEY_BACKSPACE ||
610 inp == KEY_LEFT )) {
477 return ERR;
478
479 return wget_wch(win, ch);
480}
481
482/*
483 * wget_wch --
484 * Read in a wide character from the window.

--- 118 unchanged lines hidden (view full) ---

603
604 if (__echoit) {
605 if ( ret == KEY_CODE_YES ) {
606 /* handle [DEL], [BS], and [LEFT] */
607 if ( win->curx &&
608 ( inp == KEY_DC ||
609 inp == KEY_BACKSPACE ||
610 inp == KEY_LEFT )) {
611 _cursesi_wmove( win, win->cury, win->curx - 1, 0 );
611 wmove( win, win->cury, win->curx - 1);
612 wdelch( win );
613 }
614 } else {
615 ws[ 0 ] = inp, ws[ 1 ] = L'\0';
616 setcchar( &wc, ws, win->wattr, 0, NULL );
617 wadd_wch( win, &wc );
618 }
619 }

--- 47 unchanged lines hidden ---
612 wdelch( win );
613 }
614 } else {
615 ws[ 0 ] = inp, ws[ 1 ] = L'\0';
616 setcchar( &wc, ws, win->wattr, 0, NULL );
617 wadd_wch( win, &wc );
618 }
619 }

--- 47 unchanged lines hidden ---