1<!-- 2 * t 3 **************************************************************************** 4 * Copyright 2018-2023,2024 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.51 2024/04/20 21:20:07 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 2024-04-20 ncurses 6.5 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 2024-04-20 ncurses 6.5 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><curses.h></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><curses.h></STRONG> can be used with the <STRONG>&</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>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 81 82 83</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>. 90 91 92</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE> 93 Note that all of these routines may be macros. 94 95 96</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. 120 121 122</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>). 125 126 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_instr.3x.html">curs_instr(3x)</A></STRONG> 127 128 129 130ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG> 131</PRE> 132<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> 147</BODY> 148</HTML> 149