Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
| 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 |
| 62 | The \fBgetcchar\fP function gets a wide-character string |
| 63 | and rendition from a \fBcchar_t\fP argument. |
| 64 | When \fIwch\fP is not a null pointer, |
| 65 | the \fBgetcchar\fP function does the following: |
| 66 | .TP 5 |
| 67 | - |
| 68 | Extracts information from a \fBcchar_t\fP value \fIwcval\fP |
| 69 | .TP 5 |
| 70 | - |
| 71 | Stores the character attributes in the location pointed to by \fIattrs\fP |
| 72 | .TP 5 |
| 73 | - |
| 74 | Stores the color-pair in the location pointed to by \fIcolor_pair\fP |
| 75 | .TP 5 |
| 76 | - |
| 77 | Stores the wide-character string, |
| 78 | characters referenced by \fIwcval\fP, into the array pointed to by \fIwch\fP. |
| 79 | .PP |
| 80 | When |
| 81 | \fIwch\fP |
| 82 | is a null pointer, the |
| 83 | \fBgetcchar\fP |
| 84 | function does the following: |
| 85 | .TP 5 |
| 86 | - |
| 87 | Obtains the number of wide characters pointed to by \fIwcval\fP |
| 88 | .TP 5 |
| 89 | - |
| 90 | Does not change the data referenced by |
| 91 | \fIattrs\fP |
| 92 | or |
| 93 | \fIcolor_pair\fP |
| 94 | .PP |
| 95 | The \fBsetcchar\fP function initializes the location pointed to by \fIwcval\fP |
| 96 | by using: |
| 97 | .TP 5 |
| 98 | - |
| 99 | The character attributes in |
| 100 | \fIattrs\fP |
| 101 | .TP 5 |
| 102 | - |
| 103 | The color pair in |
| 104 | \fIcolor_pair\fP |
| 105 | .TP 5 |
| 106 | - |
| 107 | The wide-character string pointed to by \fIwch\fP. |
| 108 | The string must be L'\\0' terminated, |
| 109 | contain at most one spacing character, |
| 110 | which must be the first. |
| 111 | .IP |
| 112 | Up to \fBCCHARW_MAX\fP-1 nonspacing characters may follow. |
| 113 | Additional nonspacing characters are ignored. |
| 114 | .IP |
| 115 | The string may contain a single control character instead. |
| 116 | In that case, no nonspacing characters are allowed. |
| 117 | .SH NOTES |
| 118 | .PP |
| 119 | The \fIopts\fP argument is reserved for future use. |
| 120 | Currently, an application must provide a null pointer as \fIopts\fP. |
| 121 | .PP |
| 122 | The \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. |
| 124 | If \fIwcval\fP is constructed by any other means, the effect is unspecified. |
| 125 | .SH RETURN VALUES |
| 126 | .PP |
| 127 | When \fIwch\fP is a null pointer, |
| 128 | \fBgetcchar\fP returns the number of wide characters referenced by |
| 129 | \fIwcval\fP. |
| 130 | .PP |
| 131 | When \fIwch\fP is not a null pointer, |
| 132 | \fBgetcchar\fP returns \fBOK\fP upon successful completion, |
| 133 | and \fBERR\fP otherwise. |
| 134 | .PP |
| 135 | Upon successful completion, \fBsetcchar\fP returns \fBOK\fP. |
| 136 | Otherwise, it returns \fBERR\fP. |
| 137 | .SH SEE ALSO |
| 138 | .PP |
| 139 | Functions: |
| 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: |