Update ncurses to version 5.4.
[dragonfly.git] / lib / libncurses / man / curs_getcchar.3
1 .\"***************************************************************************
2 .\" Copyright (c) 2001-2002,2003 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.7 2003/05/10 20:33:49 jmc Exp $
30 .\" $DragonFly: src/lib/libncurses/man/curs_getcchar.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
31 .TH curs_getcchar 3X ""
32 .SH NAME
33 \fBgetcchar\fP,
34 \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
35 .SH SYNOPSIS
36 \fB#include <curses.h>\fP
37 .sp
38 \fBint getcchar(\fP
39 .br
40 .B "        const cchar_t *\fIwcval\fP,"
41 .br
42 .B "        wchar_t *\fIwch\fP,"
43 .br
44 .B "        attr_t *\fIattrs\fP,"
45 .br
46 .B "        short *\fIcolor_pair\fP,"
47 .br
48 .B "        void *\fIopts\fP );"
49 .sp
50 .B "int setcchar("
51 .br
52 .B "        cchar_t *\fIwcval\fP,"
53 .br
54 .B "        const wchar_t *\fIwch\fP,"
55 .br
56 .B "        const attr_t \fIattrs\fP,"
57 .br
58 .B "        short \fIcolor_pair\fP,"
59 .br
60 .B "        void *\fIopts\fP );"
61 .SH DESCRIPTION
62 .PP
63 The \fBgetcchar\fP function gets a wide-character string
64 and rendition from a \fBcchar_t\fP argument.
65 When \fIwch\fP is not a null pointer,
66 the \fBgetcchar\fP function does the following:
67 .TP 5
68 -
69 Extracts information from a \fBcchar_t\fP value \fIwcval\fP
70 .TP 5
71 -
72 Stores the character attributes in the location pointed to by \fIattrs\fP
73 .TP 5
74 -
75 Stores the color-pair in the location pointed to by \fIcolor_pair\fP
76 .TP 5
77 -
78 Stores the wide-character string,
79 characters referenced by \fIwcval\fP, into the array pointed to by \fIwch\fP.
80 .PP
81 When
82 \fIwch\fP
83 is a null pointer, the
84 \fBgetcchar\fP
85 function does the following:
86 .TP 5
87 -
88 Obtains the number of wide characters pointed to by \fIwcval\fP
89 .TP 5
90 -
91 Does not change the data referenced by
92 \fIattrs\fP
93 or
94 \fIcolor_pair\fP
95 .PP
96 The \fBsetcchar\fP function initializes the location pointed to by \fIwcval\fP
97 by using:
98 .TP 5
99 -
100 The character attributes in
101 \fIattrs\fP
102 .TP 5
103 -
104 The color pair in
105 \fIcolor_pair\fP
106 .TP 5
107 -
108 The wide-character string pointed to by \fIwch\fP.
109 The string must be L'\\0' terminated,
110 contain at most one character with strictly positive width,
111 which must be the first,
112 and contain no characters of negative width.
113 .SH NOTES
114 .PP
115 The \fIopts\fP argument is reserved for future use.
116 Currently, an application must provide a null pointer as \fIopts\fP.
117 .PP
118 The \fIwcval\fP argument may be a value generated by a call to
119 \fBsetcchar\fP or by a function that has a \fBcchar_t\fP output argument.
120 If \fIwcval\fP is constructed by any other means, the effect is unspecified.
121 .SH RETURN VALUES
122 .PP
123 When \fIwch\fP is a null pointer,
124 \fBgetcchar\fP returns the number of wide characters referenced by
125 \fIwcval\fP, including the null terminator.
126 .PP
127 When \fIwch\fP is not a null pointer,
128 \fBgetcchar\fP returns \fBOK\fP upon successful completion,
129 and \fBERR\fP otherwise.
130 .PP
131 Upon successful completion, \fBsetcchar\fP returns \fBOK\fP.
132 Otherwise, it returns \fBERR\fP.
133 .SH SEE ALSO
134 .PP
135 Functions:
136 \fBcurses\fR(3X),
137 \fBwcwidth\fR(3X),
138 \fBcurs_attr_get\fR(3X),
139 \fBcan_change_color\fR(3X).
140 .\"#
141 .\"# The following sets edit modes for GNU EMACS
142 .\"# Local Variables:
143 .\"# mode:nroff
144 .\"# fill-column:79
145 .\"# End: