Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | <!-- |
| 2 | **************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 3 | * Copyright (c) 2001-2012,2015 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 4 | * * |
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a * |
| 6 | * copy of this software and associated documentation files (the * |
| 7 | * "Software"), to deal in the Software without restriction, including * |
| 8 | * without limitation the rights to use, copy, modify, merge, publish, * |
| 9 | * distribute, distribute with modifications, sublicense, and/or sell * |
| 10 | * copies of the Software, and to permit persons to whom the Software is * |
| 11 | * furnished to do so, subject to the following conditions: * |
| 12 | * * |
| 13 | * The above copyright notice and this permission notice shall be included * |
| 14 | * in all copies or substantial portions of the Software. * |
| 15 | * * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 17 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 19 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 20 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 21 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 22 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 23 | * * |
| 24 | * Except as contained in this notice, the name(s) of the above copyright * |
| 25 | * holders shall not be used in advertising or otherwise to promote the * |
| 26 | * sale, use or other dealings in this Software without prior written * |
| 27 | * authorization. * |
| 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 | --> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 31 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 32 | <HTML> |
| 33 | <HEAD> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 34 | <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
| 35 | <meta name="generator" content="Manpage converted by man2html - see http://invisible-island.net/scripts/readme.html#others_scripts"> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 36 | <TITLE>curs_getcchar 3x</TITLE> |
| 37 | <link rev=made href="mailto:bug-ncurses@gnu.org"> |
| 38 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 39 | </HEAD> |
| 40 | <BODY> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 41 | <H1 class="no-header">curs_getcchar 3x</H1> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 42 | <PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 43 | <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG> <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG> |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 49 | <H2><a name="h2-NAME">NAME</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 50 | <STRONG>getcchar</STRONG>, <STRONG>setcchar</STRONG> - Get a wide character string and ren- |
| 51 | dition from a <STRONG>cchar_t</STRONG> or set a <STRONG>cchar_t</STRONG> from a wide-charac- |
| 52 | ter string |
| 53 | |
| 54 | |
| 55 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 56 | <H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 57 | <STRONG>#include</STRONG> <STRONG><curses.h></STRONG> |
| 58 | |
| 59 | <STRONG>int</STRONG> <STRONG>getcchar(</STRONG> |
| 60 | <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wcval</EM><STRONG>,</STRONG> |
| 61 | <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> |
| 62 | <STRONG>attr_t</STRONG> <STRONG>*</STRONG><EM>attrs</EM><STRONG>,</STRONG> |
| 63 | <STRONG>short</STRONG> <STRONG>*</STRONG><EM>color</EM><STRONG>_</STRONG><EM>pair</EM><STRONG>,</STRONG> |
| 64 | <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM> <STRONG>);</STRONG> |
| 65 | |
| 66 | <STRONG>int</STRONG> <STRONG>setcchar(</STRONG> |
| 67 | <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wcval</EM><STRONG>,</STRONG> |
| 68 | <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG> |
| 69 | <STRONG>const</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG> |
| 70 | <STRONG>short</STRONG> <EM>color</EM><STRONG>_</STRONG><EM>pair</EM><STRONG>,</STRONG> |
| 71 | <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM> <STRONG>);</STRONG> |
| 72 | |
| 73 | |
| 74 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 75 | <H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE> |
| 76 | |
| 77 | </PRE> |
| 78 | <H3><a name="h3-getcchar">getcchar</a></H3><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 79 | The <STRONG>getcchar</STRONG> function gets a wide-character string and |
| 80 | rendition from a <STRONG>cchar_t</STRONG> argument. When <EM>wch</EM> is not a null |
| 81 | pointer, the <STRONG>getcchar</STRONG> function does the following: |
| 82 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 83 | <STRONG>o</STRONG> Extracts information from a <STRONG>cchar_t</STRONG> value <EM>wcval</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 84 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 85 | <STRONG>o</STRONG> Stores the character attributes in the location |
| 86 | pointed to by <EM>attrs</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 87 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 88 | <STRONG>o</STRONG> Stores the color-pair in the location pointed to by |
| 89 | <EM>color</EM><STRONG>_</STRONG><EM>pair</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 90 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 91 | <STRONG>o</STRONG> Stores the wide-character string, characters refer- |
| 92 | enced by <EM>wcval</EM>, into the array pointed to by <EM>wch</EM>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 93 | |
| 94 | When <EM>wch</EM> is a null pointer, the <STRONG>getcchar</STRONG> function does the |
| 95 | following: |
| 96 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 97 | <STRONG>o</STRONG> Obtains the number of wide characters pointed to by |
| 98 | <EM>wcval</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 99 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 100 | <STRONG>o</STRONG> Does not change the data referenced by <EM>attrs</EM> or |
| 101 | <EM>color</EM><STRONG>_</STRONG><EM>pair</EM> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 102 | |
| 103 | |
| 104 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 105 | <H3><a name="h3-setcchar">setcchar</a></H3><PRE> |
| 106 | The <STRONG>setcchar</STRONG> function initializes the location pointed to |
| 107 | by <EM>wcval</EM> by using: |
| 108 | |
| 109 | <STRONG>o</STRONG> The character attributes in <EM>attrs</EM> |
| 110 | |
| 111 | <STRONG>o</STRONG> The color pair in <EM>color</EM><STRONG>_</STRONG><EM>pair</EM> |
| 112 | |
| 113 | <STRONG>o</STRONG> The wide-character string pointed to by <EM>wch</EM>. The |
| 114 | string must be L'\0' terminated, contain at most one |
| 115 | spacing character, which must be the first. |
| 116 | |
| 117 | Up to <STRONG>CCHARW_MAX</STRONG>-1 nonspacing characters may follow. |
| 118 | Additional nonspacing characters are ignored. |
| 119 | |
| 120 | The string may contain a single control character |
| 121 | instead. In that case, no nonspacing characters are |
| 122 | allowed. |
| 123 | |
| 124 | |
| 125 | </PRE> |
| 126 | <H2><a name="h2-NOTES">NOTES</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 127 | The <EM>opts</EM> argument is reserved for future use. Currently, |
| 128 | an application must provide a null pointer as <EM>opts</EM>. |
| 129 | |
| 130 | The <EM>wcval</EM> argument may be a value generated by a call to |
| 131 | <STRONG>setcchar</STRONG> or by a function that has a <STRONG>cchar_t</STRONG> output argu- |
| 132 | ment. If <EM>wcval</EM> is constructed by any other means, the |
| 133 | effect is unspecified. |
| 134 | |
| 135 | |
| 136 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 137 | <H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 138 | When <EM>wch</EM> is a null pointer, <STRONG>getcchar</STRONG> returns the number of |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 139 | wide characters referenced by <EM>wcval</EM>, including one for a |
| 140 | trailing null. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 141 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 142 | When <EM>wch</EM> is not a null pointer, <STRONG>getcchar</STRONG> returns <STRONG>OK</STRONG> upon |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 143 | successful completion, and <STRONG>ERR</STRONG> otherwise. |
| 144 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 145 | Upon successful completion, <STRONG>setcchar</STRONG> returns <STRONG>OK</STRONG>. Other- |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 146 | wise, it returns <STRONG>ERR</STRONG>. |
| 147 | |
| 148 | |
| 149 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 150 | <H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE> |
| 151 | Functions: <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, |
| 152 | <STRONG>wcwidth(3)</STRONG>. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 153 | |
| 154 | |
| 155 | |
| 156 | <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG> |
| 157 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame^] | 158 | <div class="nav"> |
| 159 | <ul> |
| 160 | <li><a href="#h2-NAME">NAME</a></li> |
| 161 | <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li> |
| 162 | <li><a href="#h2-DESCRIPTION">DESCRIPTION</a> |
| 163 | <ul> |
| 164 | <li><a href="#h3-getcchar">getcchar</a></li> |
| 165 | <li><a href="#h3-setcchar">setcchar</a></li> |
| 166 | </ul> |
| 167 | </li> |
| 168 | <li><a href="#h2-NOTES">NOTES</a></li> |
| 169 | <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li> |
| 170 | <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li> |
| 171 | </ul> |
| 172 | </div> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 173 | </BODY> |
| 174 | </HTML> |