Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2 | .\" Copyright (c) 2001-2012,2015 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 | .\" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 29 | .\" $Id: curs_getcchar.3x,v 1.17 2015/07/21 09:30:38 tom Exp $ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 30 | .TH curs_getcchar 3X "" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 31 | .de bP |
| 32 | .IP \(bu 4 |
| 33 | .. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 64 | .SS getcchar |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 65 | .PP |
| 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: |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 70 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 71 | Extracts information from a \fBcchar_t\fP value \fIwcval\fP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 72 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 73 | Stores the character attributes in the location pointed to by \fIattrs\fP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 74 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 75 | Stores the color-pair in the location pointed to by \fIcolor_pair\fP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 76 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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: |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 85 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 86 | Obtains the number of wide characters pointed to by \fIwcval\fP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 87 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 88 | Does not change the data referenced by |
| 89 | \fIattrs\fP |
| 90 | or |
| 91 | \fIcolor_pair\fP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 92 | .SS setcchar |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 93 | .PP |
| 94 | The \fBsetcchar\fP function initializes the location pointed to by \fIwcval\fP |
| 95 | by using: |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 96 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 97 | The character attributes in |
| 98 | \fIattrs\fP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 99 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 100 | The color pair in |
| 101 | \fIcolor_pair\fP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 102 | .bP |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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. |
| 107 | .IP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 108 | Up to \fBCCHARW_MAX\fP\-1 nonspacing characters may follow. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 109 | Additional nonspacing characters are ignored. |
| 110 | .IP |
| 111 | The string may contain a single control character instead. |
| 112 | In that case, no nonspacing characters are allowed. |
| 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. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 121 | .SH RETURN VALUE |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 122 | .PP |
| 123 | When \fIwch\fP is a null pointer, |
| 124 | \fBgetcchar\fP returns the number of wide characters referenced by |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 125 | \fIwcval\fP, |
| 126 | including one for a trailing null. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 127 | .PP |
| 128 | When \fIwch\fP is not a null pointer, |
| 129 | \fBgetcchar\fP returns \fBOK\fP upon successful completion, |
| 130 | and \fBERR\fP otherwise. |
| 131 | .PP |
| 132 | Upon successful completion, \fBsetcchar\fP returns \fBOK\fP. |
| 133 | Otherwise, it returns \fBERR\fP. |
| 134 | .SH SEE ALSO |
| 135 | .PP |
| 136 | Functions: |
| 137 | \fBcurs_attr\fR(3X), |
| 138 | \fBcurs_color\fR(3X), |
| 139 | \fBcurses\fR(3X), |
| 140 | \fBwcwidth\fR(3). |