blob: 15bd134e9b760bff440799924c331a7d7e3234ba [file] [log] [blame]
micky3879b9f5e72025-07-08 18:04:53 -04001<!--
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05302 * t
3 ****************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04004 * Copyright 2018-2023,2024 Thomas E. Dickey *
5 * Copyright 1998-2010,2017 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05306 * *
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 ****************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -040031 * @Id: curs_inch.3x,v 1.51 2024/04/20 21:20:07 tom Exp @
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053032-->
Steve Kondikae271bc2015-11-15 02:50:53 +010033<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053034<HTML>
35<HEAD>
Steve Kondikae271bc2015-11-15 02:50:53 +010036<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
micky3879b9f5e72025-07-08 18:04:53 -040037<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
38<TITLE>curs_inch 3x 2024-04-20 ncurses 6.5 Library calls</TITLE>
39<link rel="author" href="mailto:bug-ncurses@gnu.org">
40
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053041</HEAD>
42<BODY>
micky3879b9f5e72025-07-08 18:04:53 -040043<H1 class="no-header">curs_inch 3x 2024-04-20 ncurses 6.5 Library calls</H1>
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053044<PRE>
micky3879b9f5e72025-07-08 18:04:53 -040045<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>
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053046
47
48
49
micky3879b9f5e72025-07-08 18:04:53 -040050</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
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053052
53
micky3879b9f5e72025-07-08 18:04:53 -040054</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053055 <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
56
57 <STRONG>chtype</STRONG> <STRONG>inch(void);</STRONG>
micky3879b9f5e72025-07-08 18:04:53 -040058 <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>
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053062
63
micky3879b9f5e72025-07-08 18:04:53 -040064</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.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053070
Steve Kondikae271bc2015-11-15 02:50:53 +010071
micky3879b9f5e72025-07-08 18:04:53 -040072</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>.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053075
micky3879b9f5e72025-07-08 18:04:53 -040076 <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
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053081
82
micky3879b9f5e72025-07-08 18:04:53 -040083</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
84 Functions prefixed with "mv" first perform cursor movement and fail if
85 the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
86
87 The <STRONG>winch</STRONG> function does not return an error if the window contains
88 characters larger than 8-bits (255). Only the low-order 8 bits of the
89 character are used by <STRONG>winch</STRONG>.
Steve Kondikae271bc2015-11-15 02:50:53 +010090
91
micky3879b9f5e72025-07-08 18:04:53 -040092</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053093 Note that all of these routines may be macros.
94
95
micky3879b9f5e72025-07-08 18:04:53 -040096</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
97 These functions are described in X/Open Curses, Issue 4.
98
99 Very old systems (before standardization) provide a different function
100 with the same name:
101
102 <STRONG>o</STRONG> The <STRONG>winch</STRONG> function was part of the original BSD curses library,
103 which stored a 7-bit character combined with the <EM>standout</EM>
104 attribute.
105
106 In BSD curses, <STRONG>winch</STRONG> returned only the character (as an integer)
107 with the <EM>standout</EM> attribute removed.
108
109 <STRONG>o</STRONG> System V curses added support for several video attributes which
110 could be combined with characters in the window.
111
112 Reflecting this improvement, the function was altered to return the
113 character combined with all video attributes in a <STRONG>chtype</STRONG> value.
114
115 X/Open Curses does not specify the size and layout of attributes, color
116 and character values in <STRONG>chtype</STRONG>; it is implementation-dependent. This
117 implementation uses 8 bits for character values. An application using
118 more bits, e.g., a Unicode value, should use the wide-character
119 equivalents to these functions.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530120
121
micky3879b9f5e72025-07-08 18:04:53 -0400122</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
123 <STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library
124 in its wide-character configuration (<EM>ncursesw</EM>).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530125
micky3879b9f5e72025-07-08 18:04:53 -0400126 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_instr.3x.html">curs_instr(3x)</A></STRONG>
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530127
128
129
micky3879b9f5e72025-07-08 18:04:53 -0400130ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530131</PRE>
Steve Kondikae271bc2015-11-15 02:50:53 +0100132<div class="nav">
133<ul>
134<li><a href="#h2-NAME">NAME</a></li>
135<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
136<li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
137<ul>
138<li><a href="#h3-Attributes">Attributes</a></li>
139</ul>
140</li>
141<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
142<li><a href="#h2-NOTES">NOTES</a></li>
143<li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
144<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
145</ul>
146</div>
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530147</BODY>
148</HTML>