]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_inch.3x.html
ncurses 6.4 - patch 20230917
[ncurses.git] / doc / html / man / curs_inch.3x.html
1 <!--
2   * t
3   ****************************************************************************
4   * Copyright 2018-2022,2023 Thomas E. Dickey                                *
5   * Copyright 1998-2010,2017 Free Software Foundation, Inc.                  *
6   *                                                                          *
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:                 *
14   *                                                                          *
15   * The above copyright notice and this permission notice shall be included  *
16   * in all copies or substantial portions of the Software.                   *
17   *                                                                          *
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.                               *
25   *                                                                          *
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       *
29   * authorization.                                                           *
30   ****************************************************************************
31   * @Id: curs_inch.3x,v 1.37 2023/09/16 23:37:03 tom Exp @
32 -->
33 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
34 <HTML>
35 <HEAD>
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 2023-09-16 ncurses 6.4 Library calls</TITLE>
39 <link rel="author" href="mailto:bug-ncurses@gnu.org">
40
41 </HEAD>
42 <BODY>
43 <H1 class="no-header">curs_inch 3x 2023-09-16 ncurses 6.4 Library calls</H1>
44 <PRE>
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>
46
47
48
49
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
52
53
54 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
55        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
56
57        <STRONG>chtype</STRONG> <STRONG>inch(void);</STRONG>
58        <STRONG>chtype</STRONG> <STRONG>winch(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG>
59
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>
62
63
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>&lt;curses.h&gt;</STRONG> can be used with the <STRONG>&amp;</STRONG> (logical AND) operator  to
69        extract the character or attributes alone.
70
71
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>.
75
76        <STRONG>A_CHARTEXT</STRONG>     Bit-mask to extract character
77        <STRONG>A_ATTRIBUTES</STRONG>   Bit-mask to extract attributes
78        <STRONG>A_COLOR</STRONG>        Bit-mask to extract color-pair field information
79
80
81 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
82        Functions with a "mv" prefix first  perform  a  cursor  movement  using
83        <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
84        the window pointer is null.
85
86        The <STRONG>winch</STRONG> function does not return an  error  if  the  window  contains
87        characters  larger than 8-bits (255).  Only the low-order 8 bits of the
88        character are used by <STRONG>winch</STRONG>.
89
90
91 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
92        Note that all of these routines may be macros.
93
94
95 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
96        These functions are described in the XSI Curses standard, Issue 4.
97
98        Very old systems (before standardization) provide a different  function
99        with the same name:
100
101        <STRONG>o</STRONG>   The  <STRONG>winch</STRONG>  function  was  part of the original BSD curses library,
102            which  stored  a  7-bit  character  combined  with   the   <EM>standout</EM>
103            attribute.
104
105            In  BSD  curses,  <STRONG>winch</STRONG> returned only the character (as an integer)
106            with the <EM>standout</EM> attribute removed.
107
108        <STRONG>o</STRONG>   System V curses added support for several  video  attributes  which
109            could be combined with characters in the window.
110
111            Reflecting this improvement, the function was altered to return the
112            character combined with all video attributes in a <STRONG>chtype</STRONG> value.
113
114        X/Open Curses does not specify the size and layout of attributes, color
115        and  character  values in <STRONG>chtype</STRONG>; it is implementation-dependent.  This
116        implementation uses 8 bits for character values.  An application  using
117        more  bits,  e.g.,  a  Unicode  value,  should  use  the wide-character
118        equivalents to these functions.
119
120
121 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
122        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
123             gives an overview of the WINDOW and <STRONG>chtype</STRONG> data types.
124
125        <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
126             goes into more  detail,  pointing  out  portability  problems  and
127             constraints on the use of <STRONG>chtype</STRONG> for returning window information.
128
129        <STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG>
130             describes  comparable  functions for the wide-character (ncursesw)
131             library.
132
133
134
135 ncurses 6.4                       2023-09-16                     <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>
136 </PRE>
137 <div class="nav">
138 <ul>
139 <li><a href="#h2-NAME">NAME</a></li>
140 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
141 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
142 <ul>
143 <li><a href="#h3-Attributes">Attributes</a></li>
144 </ul>
145 </li>
146 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
147 <li><a href="#h2-NOTES">NOTES</a></li>
148 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
149 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
150 </ul>
151 </div>
152 </BODY>
153 </HTML>