1 .\"***************************************************************************
2 .\" Copyright (c) 2001-2015,2017 Free Software Foundation, Inc. *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a *
5 .\" copy of this software and associated documentation files (the *
6 .\" "Software"), to deal in the Software without restriction, including *
7 .\" without limitation the rights to use, copy, modify, merge, publish, *
8 .\" distribute, distribute with modifications, sublicense, and/or sell *
9 .\" copies of the Software, and to permit persons to whom the Software is *
10 .\" furnished to do so, subject to the following conditions: *
12 .\" The above copyright notice and this permission notice shall be included *
13 .\" in all copies or substantial portions of the Software. *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 .\" Except as contained in this notice, the name(s) of the above copyright *
24 .\" holders shall not be used in advertising or otherwise to promote the *
25 .\" sale, use or other dealings in this Software without prior written *
27 .\"***************************************************************************
29 .\" $Id: curs_getcchar.3x,v 1.18 2017/03/31 10:50:54 tom Exp $
30 .TH curs_getcchar 3X ""
36 \fBsetcchar\fP \- Get a wide character string and rendition from a \fBcchar_t\fP or set a \fBcchar_t\fP from a wide-character string
38 \fB#include <curses.h>\fP
42 .B " const cchar_t *\fIwcval\fP,"
44 .B " wchar_t *\fIwch\fP,"
46 .B " attr_t *\fIattrs\fP,"
48 .B " short *\fIcolor_pair\fP,"
50 .B " void *\fIopts\fP );"
54 .B " cchar_t *\fIwcval\fP,"
56 .B " const wchar_t *\fIwch\fP,"
58 .B " const attr_t \fIattrs\fP,"
60 .B " short \fIcolor_pair\fP,"
62 .B " void *\fIopts\fP );"
66 The \fBgetcchar\fP function gets a wide-character string
67 and rendition from a \fBcchar_t\fP argument.
68 When \fIwch\fP is not a null pointer,
69 the \fBgetcchar\fP function does the following:
71 Extracts information from a \fBcchar_t\fP value \fIwcval\fP
73 Stores the character attributes in the location pointed to by \fIattrs\fP
75 Stores the color-pair in the location pointed to by \fIcolor_pair\fP
77 Stores the wide-character string,
78 characters referenced by \fIwcval\fP, into the array pointed to by \fIwch\fP.
82 is a null pointer, the
84 function does the following:
86 Obtains the number of wide characters pointed to by \fIwcval\fP
88 Does not change the data referenced by
94 The \fBsetcchar\fP function initializes the location pointed to by \fIwcval\fP
97 The character attributes in
103 The wide-character string pointed to by \fIwch\fP.
104 The string must be L'\\0' terminated,
105 contain at most one spacing character,
106 which must be the first.
108 Up to \fBCCHARW_MAX\fP\-1 nonspacing characters may follow.
109 Additional nonspacing characters are ignored.
111 The string may contain a single control character instead.
112 In that case, no nonspacing characters are allowed.
115 X/Open Curses documents the \fIopts\fP argument as reserved for future use,
116 saying that it must be null.
118 uses that parameter in ABI 6 for the functions which have a color-pair
119 parameter to support extended color pairs:
121 For functions which modify the color, e.g., \fBsetcchar\fP,
122 if \fIopts\fP is set it is treated as a pointer to \fBint\fP,
123 and used to set the color pair instead of the \fBshort\fP pair parameter.
125 For functions which retrieve the color, e.g., \fBgetcchar\fP,
126 if \fIopts\fP is set it is treated as a pointer to \fBint\fP,
127 and used to retrieve the color pair as an \fBint\fP value,
128 in addition retrieving it via the standard pointer to \fBshort\fP parameter.
131 The \fIwcval\fP argument may be a value generated by a call to
132 \fBsetcchar\fP or by a function that has a \fBcchar_t\fP output argument.
133 If \fIwcval\fP is constructed by any other means, the effect is unspecified.
136 When \fIwch\fP is a null pointer,
137 \fBgetcchar\fP returns the number of wide characters referenced by
139 including one for a trailing null.
141 When \fIwch\fP is not a null pointer,
142 \fBgetcchar\fP returns \fBOK\fP upon successful completion,
143 and \fBERR\fP otherwise.
145 Upon successful completion, \fBsetcchar\fP returns \fBOK\fP.
146 Otherwise, it returns \fBERR\fP.
151 \fBcurs_color\fR(3X),