soc/intel/xeon_sp/util: Enhance lock_pam0123
[coreboot2.git] / payloads / libpayload / curses / PDCurses / pdcurses / inch.c
blob6609b293839598e3fcaac0b9422c0628a065f01c
1 /* Public Domain Curses */
3 #include <curspriv.h>
5 RCSID("$Id: inch.c,v 1.33 2008/07/13 16:08:18 wmcbrine Exp $")
7 /*man-start**************************************************************
9 Name: inch
11 Synopsis:
12 chtype inch(void);
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);
22 Description:
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
31 are the same.
33 Portability X/Open BSD SYS V
34 inch Y Y Y
35 winch Y Y Y
36 mvinch Y Y Y
37 mvwinch Y Y Y
38 in_wch Y
39 win_wch Y
40 mvin_wch Y
41 mvwin_wch Y
43 **man-end****************************************************************/
45 chtype winch(WINDOW *win)
47 PDC_LOG(("winch() - called\n"));
49 if (!win)
50 return (chtype)ERR;
52 return win->_y[win->_cury][win->_curx];
55 chtype inch(void)
57 PDC_LOG(("inch() - called\n"));
59 return winch(stdscr);
62 chtype mvinch(int y, int x)
64 PDC_LOG(("mvinch() - called\n"));
66 if (move(y, x) == ERR)
67 return (chtype)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)
77 return (chtype)ERR;
79 return win->_y[win->_cury][win->_curx];
82 #ifdef PDC_WIDE
83 int win_wch(WINDOW *win, cchar_t *wcval)
85 PDC_LOG(("win_wch() - called\n"));
87 if (!win || !wcval)
88 return ERR;
90 *wcval = win->_y[win->_cury][win->_curx];
92 return OK;
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))
107 return ERR;
109 *wcval = stdscr->_y[stdscr->_cury][stdscr->_curx];
111 return OK;
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))
119 return ERR;
121 *wcval = win->_y[win->_cury][win->_curx];
123 return OK;
125 #endif