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