]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_getcchar.3x.html
ncurses 6.0 - patch 20170429
[ncurses.git] / doc / html / man / curs_getcchar.3x.html
1 <!-- 
2   ****************************************************************************
3   * Copyright (c) 2001-2015,2017 Free Software Foundation, Inc.              *
4   *                                                                          *
5   * Permission is hereby granted, free of charge, to any person obtaining a  *
6   * copy of this software and associated documentation files (the            *
7   * "Software"), to deal in the Software without restriction, including      *
8   * without limitation the rights to use, copy, modify, merge, publish,      *
9   * distribute, distribute with modifications, sublicense, and/or sell       *
10   * copies of the Software, and to permit persons to whom the Software is    *
11   * furnished to do so, subject to the following conditions:                 *
12   *                                                                          *
13   * The above copyright notice and this permission notice shall be included  *
14   * in all copies or substantial portions of the Software.                   *
15   *                                                                          *
16   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17   * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19   * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20   * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21   * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22   * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23   *                                                                          *
24   * Except as contained in this notice, the name(s) of the above copyright   *
25   * holders shall not be used in advertising or otherwise to promote the     *
26   * sale, use or other dealings in this Software without prior written       *
27   * authorization.                                                           *
28   ****************************************************************************
29   * @Id: curs_getcchar.3x,v 1.18 2017/03/31 10:50:54 tom Exp @
30 -->
31 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
32 <HTML>
33 <HEAD>
34 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
35 <meta name="generator" content="Manpage converted by man2html - see http://invisible-island.net/scripts/readme.html#others_scripts">
36 <TITLE>curs_getcchar 3x</TITLE>
37 <link rev=made href="mailto:bug-ncurses@gnu.org">
38 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
39 </HEAD>
40 <BODY>
41 <H1 class="no-header">curs_getcchar 3x</H1>
42 <PRE>
43 <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG>                                     <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG>
44
45
46
47
48 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
49        <STRONG>getcchar</STRONG>,  <STRONG>setcchar</STRONG> - Get a wide character string and ren-
50        dition from a <STRONG>cchar_t</STRONG> or set a <STRONG>cchar_t</STRONG> from a wide-charac-
51        ter string
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>int</STRONG> <STRONG>getcchar(</STRONG>
58                <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wcval</EM><STRONG>,</STRONG>
59                <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG>
60                <STRONG>attr_t</STRONG> <STRONG>*</STRONG><EM>attrs</EM><STRONG>,</STRONG>
61                <STRONG>short</STRONG> <STRONG>*</STRONG><EM>color</EM><STRONG>_</STRONG><EM>pair</EM><STRONG>,</STRONG>
62                <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM> <STRONG>);</STRONG>
63
64        <STRONG>int</STRONG> <STRONG>setcchar(</STRONG>
65                <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wcval</EM><STRONG>,</STRONG>
66                <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG>
67                <STRONG>const</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG>
68                <STRONG>short</STRONG> <EM>color</EM><STRONG>_</STRONG><EM>pair</EM><STRONG>,</STRONG>
69                <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM> <STRONG>);</STRONG>
70
71
72 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
73
74 </PRE><H3><a name="h3-getcchar">getcchar</a></H3><PRE>
75        The  <STRONG>getcchar</STRONG>  function  gets  a wide-character string and
76        rendition from a <STRONG>cchar_t</STRONG> argument.  When <EM>wch</EM> is not a null
77        pointer, the <STRONG>getcchar</STRONG> function does the following:
78
79        <STRONG>o</STRONG>   Extracts information from a <STRONG>cchar_t</STRONG> value <EM>wcval</EM>
80
81        <STRONG>o</STRONG>   Stores   the  character  attributes  in  the  location
82            pointed to by <EM>attrs</EM>
83
84        <STRONG>o</STRONG>   Stores the color-pair in the location  pointed  to  by
85            <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
86
87        <STRONG>o</STRONG>   Stores  the  wide-character  string, characters refer-
88            enced by <EM>wcval</EM>, into the array pointed to by <EM>wch</EM>.
89
90        When <EM>wch</EM> is a null pointer, the <STRONG>getcchar</STRONG> function does the
91        following:
92
93        <STRONG>o</STRONG>   Obtains  the  number  of wide characters pointed to by
94            <EM>wcval</EM>
95
96        <STRONG>o</STRONG>   Does not  change  the  data  referenced  by  <EM>attrs</EM>  or
97            <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
98
99
100 </PRE><H3><a name="h3-setcchar">setcchar</a></H3><PRE>
101        The  <STRONG>setcchar</STRONG> function initializes the location pointed to
102        by <EM>wcval</EM> by using:
103
104        <STRONG>o</STRONG>   The character attributes in <EM>attrs</EM>
105
106        <STRONG>o</STRONG>   The color pair in <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
107
108        <STRONG>o</STRONG>   The wide-character string  pointed  to  by  <EM>wch</EM>.   The
109            string  must  be L'\0' terminated, contain at most one
110            spacing character, which must be the first.
111
112            Up to <STRONG>CCHARW_MAX</STRONG>-1 nonspacing characters  may  follow.
113            Additional nonspacing characters are ignored.
114
115            The  string  may  contain  a  single control character
116            instead.  In that case, no nonspacing  characters  are
117            allowed.
118
119
120 </PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
121        X/Open  Curses documents the <EM>opts</EM> argument as reserved for
122        future use, saying that it must be null.  This implementa-
123        tion  uses that parameter in ABI 6 for the functions which
124        have a color-pair  parameter  to  support  extended  color
125        pairs:
126
127        <STRONG>o</STRONG>   For   functions   which  modify the color, e.g., <STRONG>setc-</STRONG>
128            <STRONG>char</STRONG>, if <EM>opts</EM> is set it is treated  as  a  pointer  to
129            <STRONG>int</STRONG>,  and used to  set  the  color pair instead of the
130            <STRONG>short</STRONG> pair parameter.
131
132        <STRONG>o</STRONG>   For functions which retrieve the  color,  e.g.,  <STRONG>getc-</STRONG>
133            <STRONG>char</STRONG>,  if  <EM>opts</EM>  is  set it is treated as a pointer to
134            <STRONG>int</STRONG>, and  used  to  retrieve  the color pair as an <STRONG>int</STRONG>
135            value,  in  addition  retrieving  it  via the standard
136            pointer to <STRONG>short</STRONG> parameter.
137
138
139 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
140        The <EM>wcval</EM> argument may be a value generated by a  call  to
141        <STRONG>setcchar</STRONG>  or by a function that has a <STRONG>cchar_t</STRONG> output argu-
142        ment.  If <EM>wcval</EM> is constructed by  any  other  means,  the
143        effect is unspecified.
144
145
146 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
147        When <EM>wch</EM> is a null pointer, <STRONG>getcchar</STRONG> returns the number of
148        wide characters referenced by <EM>wcval</EM>, including one  for  a
149        trailing null.
150
151        When  <EM>wch</EM>  is not a null pointer, <STRONG>getcchar</STRONG> returns <STRONG>OK</STRONG> upon
152        successful completion, and <STRONG>ERR</STRONG> otherwise.
153
154        Upon successful completion, <STRONG>setcchar</STRONG> returns  <STRONG>OK</STRONG>.   Other-
155        wise, it returns <STRONG>ERR</STRONG>.
156
157
158 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
159        Functions:   <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>,   <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>,  <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
160        <STRONG>wcwidth(3)</STRONG>.
161
162
163
164                                                       <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG>
165 </PRE>
166 <div class="nav">
167 <ul>
168 <li><a href="#h2-NAME">NAME</a></li>
169 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
170 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
171 <ul>
172 <li><a href="#h3-getcchar">getcchar</a></li>
173 <li><a href="#h3-setcchar">setcchar</a></li>
174 </ul>
175 </li>
176 <li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
177 <li><a href="#h2-NOTES">NOTES</a></li>
178 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
179 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
180 </ul>
181 </div>
182 </BODY>
183 </HTML>