]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_getcchar.3x
ncurses 5.9 - patch 20111001
[ncurses.git] / man / curs_getcchar.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 2001-2009,2010 Free Software Foundation, Inc.              *
3 .\"                                                                          *
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:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
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.                               *
22 .\"                                                                          *
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       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_getcchar.3x,v 1.15 2010/12/04 18:36:44 tom Exp $
30 .TH curs_getcchar 3X ""
31 .de bP
32 .IP \(bu 4
33 ..
34 .SH NAME
35 \fBgetcchar\fP,
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
37 .SH SYNOPSIS
38 \fB#include <curses.h>\fP
39 .sp
40 \fBint getcchar(\fP
41 .br
42 .B "        const cchar_t *\fIwcval\fP,"
43 .br
44 .B "        wchar_t *\fIwch\fP,"
45 .br
46 .B "        attr_t *\fIattrs\fP,"
47 .br
48 .B "        short *\fIcolor_pair\fP,"
49 .br
50 .B "        void *\fIopts\fP );"
51 .sp
52 .B "int setcchar("
53 .br
54 .B "        cchar_t *\fIwcval\fP,"
55 .br
56 .B "        const wchar_t *\fIwch\fP,"
57 .br
58 .B "        const attr_t \fIattrs\fP,"
59 .br
60 .B "        short \fIcolor_pair\fP,"
61 .br
62 .B "        void *\fIopts\fP );"
63 .SH DESCRIPTION
64 .PP
65 The \fBgetcchar\fP function gets a wide-character string
66 and rendition from a \fBcchar_t\fP argument.
67 When \fIwch\fP is not a null pointer,
68 the \fBgetcchar\fP function does the following:
69 .bP
70 Extracts information from a \fBcchar_t\fP value \fIwcval\fP
71 .bP
72 Stores the character attributes in the location pointed to by \fIattrs\fP
73 .bP
74 Stores the color-pair in the location pointed to by \fIcolor_pair\fP
75 .bP
76 Stores the wide-character string,
77 characters referenced by \fIwcval\fP, into the array pointed to by \fIwch\fP.
78 .PP
79 When
80 \fIwch\fP
81 is a null pointer, the
82 \fBgetcchar\fP
83 function does the following:
84 .bP
85 Obtains the number of wide characters pointed to by \fIwcval\fP
86 .bP
87 Does not change the data referenced by
88 \fIattrs\fP
89 or
90 \fIcolor_pair\fP
91 .PP
92 The \fBsetcchar\fP function initializes the location pointed to by \fIwcval\fP
93 by using:
94 .bP
95 The character attributes in
96 \fIattrs\fP
97 .bP
98 The color pair in
99 \fIcolor_pair\fP
100 .bP
101 The wide-character string pointed to by \fIwch\fP.
102 The string must be L'\\0' terminated,
103 contain at most one spacing character,
104 which must be the first.
105 .IP
106 Up to \fBCCHARW_MAX\fP\-1 nonspacing characters may follow.
107 Additional nonspacing characters are ignored.
108 .IP
109 The string may contain a single control character instead.
110 In that case, no nonspacing characters are allowed.
111 .SH NOTES
112 .PP
113 The \fIopts\fP argument is reserved for future use.
114 Currently, an application must provide a null pointer as \fIopts\fP.
115 .PP
116 The \fIwcval\fP argument may be a value generated by a call to
117 \fBsetcchar\fP or by a function that has a \fBcchar_t\fP output argument.
118 If \fIwcval\fP is constructed by any other means, the effect is unspecified.
119 .SH RETURN VALUES
120 .PP
121 When \fIwch\fP is a null pointer,
122 \fBgetcchar\fP returns the number of wide characters referenced by
123 \fIwcval\fP,
124 including one for a trailing null.
125 .PP
126 When \fIwch\fP is not a null pointer,
127 \fBgetcchar\fP returns \fBOK\fP upon successful completion,
128 and \fBERR\fP otherwise.
129 .PP
130 Upon successful completion, \fBsetcchar\fP returns \fBOK\fP.
131 Otherwise, it returns \fBERR\fP.
132 .SH SEE ALSO
133 .PP
134 Functions:
135 \fBcurs_attr\fR(3X),
136 \fBcurs_color\fR(3X),
137 \fBcurses\fR(3X),
138 \fBwcwidth\fR(3).