3 ****************************************************************************
4 * Copyright 2018-2023,2024 Thomas E. Dickey *
5 * Copyright 1998-2010,2017 Free Software Foundation, Inc. *
7 * Permission is hereby granted, free of charge, to any person obtaining a *
8 * copy of this software and associated documentation files (the *
9 * "Software"), to deal in the Software without restriction, including *
10 * without limitation the rights to use, copy, modify, merge, publish, *
11 * distribute, distribute with modifications, sublicense, and/or sell *
12 * copies of the Software, and to permit persons to whom the Software is *
13 * furnished to do so, subject to the following conditions: *
15 * The above copyright notice and this permission notice shall be included *
16 * in all copies or substantial portions of the Software. *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
21 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
24 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
26 * Except as contained in this notice, the name(s) of the above copyright *
27 * holders shall not be used in advertising or otherwise to promote the *
28 * sale, use or other dealings in this Software without prior written *
30 ****************************************************************************
31 * @Id: curs_inch.3x,v 1.44 2024/01/13 22:05:39 tom Exp @
33 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
36 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
37 <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
38 <TITLE>curs_inch 3x 2024-01-13 ncurses 6.4 Library calls</TITLE>
39 <link rel="author" href="mailto:bug-ncurses@gnu.org">
43 <H1 class="no-header">curs_inch 3x 2024-01-13 ncurses 6.4 Library calls</H1>
45 <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>
50 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
51 <STRONG>inch</STRONG>, <STRONG>winch</STRONG>, <STRONG>mvinch</STRONG>, <STRONG>mvwinch</STRONG> - get a <EM>curses</EM> character from a window
54 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
55 <STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
57 <STRONG>chtype</STRONG> <STRONG>inch(void);</STRONG>
58 <STRONG>chtype</STRONG> <STRONG>winch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG>
60 <STRONG>chtype</STRONG> <STRONG>mvinch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
61 <STRONG>chtype</STRONG> <STRONG>mvwinch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>);</STRONG>
64 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
65 These routines return the character, of type <STRONG>chtype</STRONG>, at the current
66 position in the named window. If any attributes are set for that
67 position, their values are OR'ed into the value returned. Constants
68 defined in <STRONG><curses.h></STRONG> can be used with the <STRONG>&</STRONG> (logical AND) operator to
69 extract the character or attributes alone.
72 </PRE><H3><a name="h3-Attributes">Attributes</a></H3><PRE>
73 The following bit masks may be AND-ed with characters returned by
74 <STRONG>winch</STRONG>.
76 <STRONG>Name</STRONG> <STRONG>Description</STRONG>
77 ------------------------------------------------------------------------
78 <STRONG>A_CHARTEXT</STRONG> Extract character
79 <STRONG>A_ATTRIBUTES</STRONG> Extract attributes
80 <STRONG>A_COLOR</STRONG> Extract color pair information
83 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
84 Functions with a "mv" prefix first perform a cursor movement using
85 <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
86 the window pointer is null.
88 The <STRONG>winch</STRONG> function does not return an error if the window contains
89 characters larger than 8-bits (255). Only the low-order 8 bits of the
90 character are used by <STRONG>winch</STRONG>.
93 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
94 Note that all of these routines may be macros.
97 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
98 These functions are described in the XSI Curses standard, Issue 4.
100 Very old systems (before standardization) provide a different function
103 <STRONG>o</STRONG> The <STRONG>winch</STRONG> function was part of the original BSD curses library,
104 which stored a 7-bit character combined with the <EM>standout</EM>
107 In BSD curses, <STRONG>winch</STRONG> returned only the character (as an integer)
108 with the <EM>standout</EM> attribute removed.
110 <STRONG>o</STRONG> System V curses added support for several video attributes which
111 could be combined with characters in the window.
113 Reflecting this improvement, the function was altered to return the
114 character combined with all video attributes in a <STRONG>chtype</STRONG> value.
116 X/Open Curses does not specify the size and layout of attributes, color
117 and character values in <STRONG>chtype</STRONG>; it is implementation-dependent. This
118 implementation uses 8 bits for character values. An application using
119 more bits, e.g., a Unicode value, should use the wide-character
120 equivalents to these functions.
123 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
124 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
125 gives an overview of the <STRONG>WINDOW</STRONG> and <STRONG>chtype</STRONG> data types.
127 <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
128 goes into more detail, pointing out portability problems and
129 constraints on the use of <STRONG>chtype</STRONG> for returning window
132 <STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG>
133 describes comparable functions for the wide-character (ncursesw)
138 ncurses 6.4 2024-01-13 <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>
142 <li><a href="#h2-NAME">NAME</a></li>
143 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
144 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
146 <li><a href="#h3-Attributes">Attributes</a></li>
149 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
150 <li><a href="#h2-NOTES">NOTES</a></li>
151 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
152 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>