1curs_inch(3X) curs_inch(3X)
2
3
4
6 inch, winch, mvinch, mvwinch - get a character and attributes from a
7 curses window
8
10 #include <curses.h>
11
12 chtype inch(void);
13 chtype winch(WINDOW *win);
14
15 chtype mvinch(int y, int x);
16 chtype mvwinch(WINDOW *win, int y, int x);
17
19 These routines return the character, of type chtype, at the current po‐
20 sition in the named window. If any attributes are set for that posi‐
21 tion, their values are OR'ed into the value returned. Constants de‐
22 fined in <curses.h> can be used with the & (logical AND) operator to
23 extract the character or attributes alone.
24
25 Attributes
26 The following bit-masks may be AND-ed with characters returned by
27 winch.
28
29 A_CHARTEXT Bit-mask to extract character
30 A_ATTRIBUTES Bit-mask to extract attributes
31 A_COLOR Bit-mask to extract color-pair field information
32
34 Functions with a “mv” prefix first perform a cursor movement using
35 wmove, and return an error if the position is outside the window, or if
36 the window pointer is null.
37
38 The winch function does not return an error if the window contains
39 characters larger than 8-bits (255). Only the low-order 8 bits of the
40 character are used by winch.
41
43 Note that all of these routines may be macros.
44
46 These functions are described in the XSI Curses standard, Issue 4.
47
48 Very old systems (before standardization) provide a different function
49 with the same name:
50
51 • The winch function was part of the original BSD curses library,
52 which stored a 7-bit character combined with the standout attri‐
53 bute.
54
55 In BSD curses, winch returned only the character (as an integer)
56 with the standout attribute removed.
57
58 • System V curses added support for several video attributes which
59 could be combined with characters in the window.
60
61 Reflecting this improvement, the function was altered to return the
62 character combined with all video attributes in a chtype value.
63
64 X/Open Curses does not specify the size and layout of attributes, color
65 and character values in chtype; it is implementation-dependent. This
66 implementation uses 8 bits for character values. An application using
67 more bits, e.g., a Unicode value, should use the wide-character equiva‐
68 lents to these functions.
69
71 curses(3X)
72 gives an overview of the WINDOW and chtype data types.
73
74 curs_attr(3X)
75 goes into more detail, pointing out portability problems and con‐
76 straints on the use of chtype for returning window information.
77
78 curs_in_wch(3X)
79 describes comparable functions for the wide-character (ncursesw)
80 library.
81
82
83
84 curs_inch(3X)