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