curs_getcchar.3x.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  2. <!--
  3. ****************************************************************************
  4. * Copyright (c) 2001-2006,2008 Free Software Foundation, Inc. *
  5. * *
  6. * Permission is hereby granted, free of charge, to any person obtaining a *
  7. * copy of this software and associated documentation files (the *
  8. * "Software"), to deal in the Software without restriction, including *
  9. * without limitation the rights to use, copy, modify, merge, publish, *
  10. * distribute, distribute with modifications, sublicense, and/or sell *
  11. * copies of the Software, and to permit persons to whom the Software is *
  12. * furnished to do so, subject to the following conditions: *
  13. * *
  14. * The above copyright notice and this permission notice shall be included *
  15. * in all copies or substantial portions of the Software. *
  16. * *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
  18. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
  19. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
  20. * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
  21. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
  22. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
  23. * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
  24. * *
  25. * Except as contained in this notice, the name(s) of the above copyright *
  26. * holders shall not be used in advertising or otherwise to promote the *
  27. * sale, use or other dealings in this Software without prior written *
  28. * authorization. *
  29. ****************************************************************************
  30. * @Id: curs_getcchar.3x,v 1.11 2008/05/17 19:37:05 tom Exp @
  31. -->
  32. <HTML>
  33. <HEAD>
  34. <TITLE>curs_getcchar 3x</TITLE>
  35. <link rev=made href="mailto:bug-ncurses@gnu.org">
  36. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  37. </HEAD>
  38. <BODY>
  39. <H1>curs_getcchar 3x</H1>
  40. <HR>
  41. <PRE>
  42. <!-- Manpage converted by man2html 3.0.1 -->
  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. </PRE>
  45. <H2>NAME</H2><PRE>
  46. <STRONG>getcchar</STRONG>, <STRONG>setcchar</STRONG> - Get a wide character string and ren-
  47. dition from a <STRONG>cchar_t</STRONG> or set a <STRONG>cchar_t</STRONG> from a wide-charac-
  48. ter string
  49. </PRE>
  50. <H2>SYNOPSIS</H2><PRE>
  51. <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
  52. <STRONG>int</STRONG> <STRONG>getcchar(</STRONG>
  53. <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wcval</EM><STRONG>,</STRONG>
  54. <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG>
  55. <STRONG>attr_t</STRONG> <STRONG>*</STRONG><EM>attrs</EM><STRONG>,</STRONG>
  56. <STRONG>short</STRONG> <STRONG>*</STRONG><EM>color</EM><STRONG>_</STRONG><EM>pair</EM><STRONG>,</STRONG>
  57. <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM> <STRONG>);</STRONG>
  58. <STRONG>int</STRONG> <STRONG>setcchar(</STRONG>
  59. <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wcval</EM><STRONG>,</STRONG>
  60. <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>,</STRONG>
  61. <STRONG>const</STRONG> <STRONG>attr_t</STRONG> <EM>attrs</EM><STRONG>,</STRONG>
  62. <STRONG>short</STRONG> <EM>color</EM><STRONG>_</STRONG><EM>pair</EM><STRONG>,</STRONG>
  63. <STRONG>void</STRONG> <STRONG>*</STRONG><EM>opts</EM> <STRONG>);</STRONG>
  64. </PRE>
  65. <H2>DESCRIPTION</H2><PRE>
  66. The <STRONG>getcchar</STRONG> function gets a wide-character string and
  67. rendition from a <STRONG>cchar_t</STRONG> argument. When <EM>wch</EM> is not a null
  68. pointer, the <STRONG>getcchar</STRONG> function does the following:
  69. - Extracts information from a <STRONG>cchar_t</STRONG> value <EM>wcval</EM>
  70. - Stores the character attributes in the location
  71. pointed to by <EM>attrs</EM>
  72. - Stores the color-pair in the location pointed to by
  73. <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
  74. - Stores the wide-character string, characters refer-
  75. enced by <EM>wcval</EM>, into the array pointed to by <EM>wch</EM>.
  76. When <EM>wch</EM> is a null pointer, the <STRONG>getcchar</STRONG> function does the
  77. following:
  78. - Obtains the number of wide characters pointed to by
  79. <EM>wcval</EM>
  80. - Does not change the data referenced by <EM>attrs</EM> or
  81. <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
  82. The <STRONG>setcchar</STRONG> function initializes the location pointed to
  83. by <EM>wcval</EM> by using:
  84. - The character attributes in <EM>attrs</EM>
  85. - The color pair in <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
  86. - The wide-character string pointed to by <EM>wch</EM>. The
  87. string must be L'\0' terminated, contain at most one
  88. spacing character, which must be the first.
  89. Up to <STRONG>CCHARW_MAX</STRONG>-1 nonspacing characters may follow.
  90. Additional nonspacing characters are ignored.
  91. The string may contain a single control character
  92. instead. In that case, no nonspacing characters are
  93. allowed.
  94. </PRE>
  95. <H2>NOTES</H2><PRE>
  96. The <EM>opts</EM> argument is reserved for future use. Currently,
  97. an application must provide a null pointer as <EM>opts</EM>.
  98. The <EM>wcval</EM> argument may be a value generated by a call to
  99. <STRONG>setcchar</STRONG> or by a function that has a <STRONG>cchar_t</STRONG> output argu-
  100. ment. If <EM>wcval</EM> is constructed by any other means, the
  101. effect is unspecified.
  102. </PRE>
  103. <H2>RETURN VALUES</H2><PRE>
  104. When <EM>wch</EM> is a null pointer, <STRONG>getcchar</STRONG> returns the number of
  105. wide characters referenced by <EM>wcval</EM>.
  106. When <EM>wch</EM> is not a null pointer, <STRONG>getcchar</STRONG> returns <STRONG>OK</STRONG> upon
  107. successful completion, and <STRONG>ERR</STRONG> otherwise.
  108. Upon successful completion, <STRONG>setcchar</STRONG> returns <STRONG>OK</STRONG>. Other-
  109. wise, it returns <STRONG>ERR</STRONG>.
  110. </PRE>
  111. <H2>SEE ALSO</H2><PRE>
  112. 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>,
  113. <STRONG><A HREF="wcwidth.3.html">wcwidth(3)</A></STRONG>.
  114. <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG>
  115. </PRE>
  116. <HR>
  117. <ADDRESS>
  118. Man(1) output converted with
  119. <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
  120. </ADDRESS>
  121. </BODY>
  122. </HTML>