1 /* Public Domain Curses */
5 RCSID("$Id: inch.c,v 1.33 2008/07/13 16:08:18 wmcbrine Exp $")
7 /*man-start**************************************************************
13 chtype winch(WINDOW *win);
14 chtype mvinch(int y, int x);
15 chtype mvwinch(WINDOW *win, int y, int x);
17 int in_wch(cchar_t *wcval);
18 int win_wch(WINDOW *win, cchar_t *wcval);
19 int mvin_wch(int y, int x, cchar_t *wcval);
20 int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval);
23 The inch() functions retrieve the character and attribute from
24 the current or specified window position, in the form of a
25 chtype. If a NULL window is specified, (chtype)ERR is returned.
27 The in_wch() functions are the wide-character versions; instead
28 of returning a chtype, they store a cchar_t at the address
29 specified by wcval, and return OK or ERR. (No value is stored
30 when ERR is returned.) Note that in PDCurses, chtype and cchar_t
33 Portability X/Open BSD SYS V
43 **man-end****************************************************************/
45 chtype winch(WINDOW *win)
47 PDC_LOG(("winch() - called\n"));
52 return win->_y[win->_cury][win->_curx];
57 PDC_LOG(("inch() - called\n"));
62 chtype mvinch(int y, int x)
64 PDC_LOG(("mvinch() - called\n"));
66 if (move(y, x) == ERR)
69 return stdscr->_y[stdscr->_cury][stdscr->_curx];
72 chtype mvwinch(WINDOW *win, int y, int x)
74 PDC_LOG(("mvwinch() - called\n"));
76 if (wmove(win, y, x) == ERR)
79 return win->_y[win->_cury][win->_curx];
83 int win_wch(WINDOW *win, cchar_t *wcval)
85 PDC_LOG(("win_wch() - called\n"));
90 *wcval = win->_y[win->_cury][win->_curx];
95 int in_wch(cchar_t *wcval)
97 PDC_LOG(("in_wch() - called\n"));
99 return win_wch(stdscr, wcval);
102 int mvin_wch(int y, int x, cchar_t *wcval)
104 PDC_LOG(("mvin_wch() - called\n"));
106 if (!wcval || (move(y, x) == ERR))
109 *wcval = stdscr->_y[stdscr->_cury][stdscr->_curx];
114 int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval)
116 PDC_LOG(("mvwin_wch() - called\n"));
118 if (!wcval || (wmove(win, y, x) == ERR))
121 *wcval = win->_y[win->_cury][win->_curx];