Debian Codegraph @

doc/html/man/curs_add_wch.3x.html

raw symbols SCIP
1 <!--
2 * t
3 ****************************************************************************
4 * Copyright 2019-2024,2025 Thomas E. Dickey *
5 * Copyright 2001-2015,2017 Free Software Foundation, Inc. *
6 * *
7 * Permission is hereby granted, free of charge, to any person obtaining a *
8 * copy of this software and associated documentation files (the *
9 * "Software"), to deal in the Software without restriction, including *
10 * without limitation the rights to use, copy, modify, merge, publish, *
11 * distribute, distribute with modifications, sublicense, and/or sell *
12 * copies of the Software, and to permit persons to whom the Software is *
13 * furnished to do so, subject to the following conditions: *
14 * *
15 * The above copyright notice and this permission notice shall be included *
16 * in all copies or substantial portions of the Software. *
17 * *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
21 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
24 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
25 * *
26 * Except as contained in this notice, the name(s) of the above copyright *
27 * holders shall not be used in advertising or otherwise to promote the *
28 * sale, use or other dealings in this Software without prior written *
29 * authorization. *
30 ****************************************************************************
31 * @Id: curs_add_wch.3x,v 1.125 2025/11/12 01:06:36 tom Exp @
32 -->
33 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
34 <HTML>
35 <HEAD>
36 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
37 <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
38 <TITLE>curs_add_wch 3x 2025-11-11 ncurses 6.6 Library calls</TITLE>
39 <link rel="author" href="mailto:[email protected]">
40
41 </HEAD>
42 <BODY>
43 <H1 class="no-header">curs_add_wch 3x 2025-11-11 ncurses 6.6 Library calls</H1>
44 <PRE>
45 <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>
46
47
48 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
49 <STRONG>add_wch</STRONG>, <STRONG>wadd_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvwadd_wch</STRONG>, <STRONG>echo_wchar</STRONG>, <STRONG>wecho_wchar</STRONG> - add
50 a <EM>curses</EM> complex character to a window, possibly advancing the cursor
51
52
53 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
54 <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
55
56 <STRONG>int</STRONG> <STRONG>add_wch(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
57 <STRONG>int</STRONG> <STRONG>wadd_wch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
58 <STRONG>int</STRONG> <STRONG>mvadd_wch(int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
59 <STRONG>int</STRONG> <STRONG>mvwadd_wch(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>y</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>x</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
60
61 <STRONG>int</STRONG> <STRONG>echo_wchar(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG> <EM>wch</EM><STRONG>);</STRONG>
62 <STRONG>int</STRONG> <STRONG>wecho_wchar(WINDOW</STRONG> <STRONG>*</STRONG> <EM>win</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>wch</EM><STRONG>);</STRONG>
63
64 <EM>/*</EM> <EM>(integer)</EM> <EM>constants</EM> <EM>*/</EM>
65 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_BLOCK;</STRONG>
66 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_BOARD;</STRONG>
67 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_BTEE;</STRONG>
68 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_BULLET;</STRONG>
69 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_CKBOARD;</STRONG>
70 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_DARROW;</STRONG>
71 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_DEGREE;</STRONG>
72 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_DIAMOND;</STRONG>
73 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_HLINE;</STRONG>
74 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_LANTERN;</STRONG>
75 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_LARROW;</STRONG>
76 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_LLCORNER;</STRONG>
77 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_LRCORNER;</STRONG>
78 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_LTEE;</STRONG>
79 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_PLMINUS;</STRONG>
80 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_PLUS;</STRONG>
81 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_RARROW;</STRONG>
82 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_RTEE;</STRONG>
83 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_S1;</STRONG>
84 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_S9;</STRONG>
85 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_TTEE;</STRONG>
86 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_UARROW;</STRONG>
87 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_ULCORNER;</STRONG>
88 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_URCORNER;</STRONG>
89 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_VLINE;</STRONG>
90 <EM>/*</EM> <EM>extensions</EM> <EM>*/</EM>
91 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_GEQUAL;</STRONG>
92 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_LEQUAL;</STRONG>
93 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_NEQUAL;</STRONG>
94 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_PI;</STRONG>
95 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_S3;</STRONG>
96 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_S7;</STRONG>
97 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_STERLING;</STRONG>
98 <EM>/*</EM> <EM>extensions</EM> <EM>for</EM> <EM>thick</EM> <EM>lines</EM> <EM>*/</EM>
99 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_BTEE;</STRONG>
100 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_HLINE;</STRONG>
101 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_LLCORNER;</STRONG>
102 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_LRCORNER;</STRONG>
103 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_LTEE;</STRONG>
104 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_PLUS;</STRONG>
105 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_RTEE;</STRONG>
106 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_TTEE;</STRONG>
107 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_ULCORNER;</STRONG>
108 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_URCORNER;</STRONG>
109 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_T_VLINE;</STRONG>
110 <EM>/*</EM> <EM>extensions</EM> <EM>for</EM> <EM>double</EM> <EM>lines</EM> <EM>*/</EM>
111 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_BTEE;</STRONG>
112 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_HLINE;</STRONG>
113 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_LLCORNER;</STRONG>
114 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_LRCORNER;</STRONG>
115 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_LTEE;</STRONG>
116 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_PLUS;</STRONG>
117 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_RTEE;</STRONG>
118 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_TTEE;</STRONG>
119 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_ULCORNER;</STRONG>
120 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_URCORNER;</STRONG>
121 /* <EM>...</EM> <EM>*/</EM> <STRONG>WACS_D_VLINE;</STRONG>
122
123
124 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
125
126 </PRE><H3><a name="h3-wadd_wch">wadd_wch</a></H3><PRE>
127 <STRONG>wadd_wch</STRONG> writes the <EM>curses</EM> complex character <EM>wch</EM> to the window <EM>win</EM>,
128 then may advance the cursor position, analogously to the standard C
129 library's <STRONG>putwchar(3)</STRONG>. <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> describes the variants of this
130 function.
131
132 Construct a <EM>curses</EM> complex character from a <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> with <STRONG><A HREF="curs_getcchar.3x.html">setcchar(3x)</A></STRONG>.
133 A <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> can be copied from place to place using <STRONG><A HREF="curs_in_wch.3x.html">win_wch(3x)</A></STRONG> and
134 <STRONG>wadd_wch</STRONG>. <EM>curses</EM> defines constants to aid the manipulation of
135 character attributes; see <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>. A complex character whose
136 only character component is a wide space, and whose only attribute is
137 <STRONG>WA_NORMAL</STRONG>, is a <EM>blank</EM> <EM>character</EM>, and therefore combines with the
138 window's background character; see <STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG>.
139
140 Much behavior depends on whether the wide characters in <EM>wch</EM> are spacing
141 or non-spacing; see subsection "Complex Characters" below.
142
143 <STRONG>o</STRONG> If <EM>wch</EM> contains a spacing character, then any character at the
144 cursor is first removed. The complex character <EM>wch</EM>, with its
145 attributes and color pair identifier, becomes the <EM>base</EM> of the
146 <EM>active</EM> <EM>complex</EM> <EM>character</EM>.
147
148 <STRONG>o</STRONG> If <EM>wch</EM> contains only non-spacing characters, they are combined with
149 the active complex character. <EM>curses</EM> ignores its attributes and
150 color pair identifier, and does not advance the cursor.
151
152 Further non-spacing characters added with <STRONG>wadd_wch</STRONG> are not written at
153 the new cursor position but combine with the active complex character
154 until another spacing character is written to the window or the cursor
155 is moved.
156
157 If <EM>wch</EM> is a backspace, carriage return, line feed, or tab, the cursor
158 moves appropriately within the window.
159
160 <STRONG>o</STRONG> Backspace moves the cursor one character left; at the left margin
161 of a window, it does nothing.
162
163 <STRONG>o</STRONG> Carriage return moves the cursor to the left margin on the same
164 line of the window.
165
166 <STRONG>o</STRONG> Line feed does a <STRONG><A HREF="curs_clear.3x.html">clrtoeol(3x)</A></STRONG>, then advances as if from the right
167 margin.
168
169 <STRONG>o</STRONG> Tab advances the cursor to the next tab stop (possibly on the next
170 line); these are placed at every eighth column by default.
171
172 Alter the tab interval with the <STRONG>TABSIZE</STRONG> extension; see
173 <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
174
175 If <EM>wch</EM> is any other nonprintable character, <EM>curses</EM> draws it in
176 printable form using the same convention as <STRONG><A HREF="curs_util.3x.html">wunctrl(3x)</A></STRONG>. Calling
177 <STRONG><A HREF="curs_in_wch.3x.html">win_wch(3x)</A></STRONG> on the location of a nonprintable character does not
178 retrieve the character itself, but its <STRONG><A HREF="curs_util.3x.html">wunctrl(3x)</A></STRONG> representation.
179
180 Adding spacing characters with <STRONG>wadd_wch</STRONG> causes it to wrap at the right
181 margin of the window:
182
183 <STRONG>o</STRONG> If the cursor is not at the bottom of the scrolling region and
184 advancement occurs at the right margin, the cursor automatically
185 wraps to the beginning of the next line.
186
187 <STRONG>o</STRONG> If the cursor is at the bottom of the scrolling region when
188 advancement occurs at the right margin, and <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG> is enabled
189 for <EM>win</EM>, the scrolling region scrolls up one line and the cursor
190 wraps as above. Otherwise, advancement and scrolling do not occur,
191 and <STRONG>wadd_wch</STRONG> returns <STRONG>ERR</STRONG>.
192
193 A window's margins may coincide with the screen boundaries. This may
194 be a problem when <EM>ncurses</EM> updates the screen to match the curses
195 window. When their right and bottom margins coincide, <EM>ncurses</EM> uses
196 different strategies to handle the variations of scrolling and wrapping
197 at the lower-right corner by depending on the terminal capabilities:
198
199 <STRONG>o</STRONG> If the terminal does not automatically wrap as characters are added
200 at the right margin (i.e., auto right margins), <EM>ncurses</EM> writes the
201 character directly.
202
203 <STRONG>o</STRONG> If the terminal has auto right margins, but also has capabilities
204 for turning auto margins off and on, <EM>ncurses</EM> turns the auto margin
205 feature off temporarily when writing to the lower-right corner.
206
207 <STRONG>o</STRONG> If the terminal has an insertion mode which can be turned off and
208 on, <EM>ncurses</EM> writes the character just before the lower-right
209 corner, and then inserts a character to push the update into the
210 corner.
211
212
213 </PRE><H3><a name="h3-wecho_wchar">wecho_wchar</a></H3><PRE>
214 <STRONG>echo_wchar</STRONG> and <STRONG>wecho_wchar</STRONG> are equivalent to calling (<STRONG>w</STRONG>)<STRONG>add_wch</STRONG>
215 followed by (<STRONG>w</STRONG>)<STRONG>refresh</STRONG> on <STRONG>stdscr</STRONG> or the specified window. <EM>curses</EM>
216 interprets these functions as a hint that only a single (complex)
217 character is being output; for non-control characters, a considerable
218 performance gain may be enjoyed by employing them.
219
220
221 </PRE><H3><a name="h3-Forms-Drawing-Characters">Forms-Drawing Characters</a></H3><PRE>
222 <EM>curses</EM> defines macros starting with <STRONG>WACS_</STRONG> that can be used with
223 <STRONG>wadd_wch</STRONG> to write line-drawing and other symbols to the screen.
224 <EM>ncurses</EM> terms these <EM>forms-drawing</EM> <EM>characters.</EM> <EM>curses</EM> uses the ACS
225 default listed below if the terminal type lacks the <STRONG>acs_chars</STRONG> (<STRONG>acsc</STRONG>)
226 capability; that capability does not define a replacement for the
227 character; or if the terminal type and locale configuration require
228 Unicode to access these characters, but the library is unable to use
229 Unicode. The "acsc char" column corresponds to how the characters are
230 specified in the <STRONG>acs_chars</STRONG> (<STRONG>acsc</STRONG>) string capability, and the characters
231 in it may appear on the screen if the terminal type's database entry
232 incorrectly advertises ACS support. The name "ACS" originates in the
233 Alternate Character Set feature of the DEC VT100 terminal.
234
235 <STRONG>Unicode</STRONG> <STRONG>ACS</STRONG> <STRONG>acsc</STRONG>
236 <STRONG>Symbol</STRONG> <STRONG>Default</STRONG> <STRONG>Default</STRONG> <STRONG>char</STRONG> <STRONG>Glyph</STRONG> <STRONG>Name</STRONG>
237 ------------------------------------------------------------------------
238 <STRONG>WACS_BLOCK</STRONG> U+25ae # 0 solid square block
239 <STRONG>WACS_BOARD</STRONG> U+2592 # h board of squares
240 <STRONG>WACS_BTEE</STRONG> U+2534 + v bottom tee
241 <STRONG>WACS_BULLET</STRONG> U+00b7 o ~ bullet
242 <STRONG>WACS_CKBOARD</STRONG> U+2592 : a checker board (stipple)
243 <STRONG>WACS_DARROW</STRONG> U+2193 v . arrow pointing down
244 <STRONG>WACS_DEGREE</STRONG> U+00b0 ' f degree symbol
245 <STRONG>WACS_DIAMOND</STRONG> U+25c6 + ` diamond
246 <STRONG>WACS_GEQUAL</STRONG> U+2265 &gt; &gt; greater-than-or-equal-to
247 <STRONG>WACS_HLINE</STRONG> U+2500 - q horizontal line
248 <STRONG>WACS_LANTERN</STRONG> U+2603 # i lantern symbol
249 <STRONG>WACS_LARROW</STRONG> U+2190 &lt; , arrow pointing left
250 <STRONG>WACS_LEQUAL</STRONG> U+2264 &lt; y less-than-or-equal-to
251 <STRONG>WACS_LLCORNER</STRONG> U+2514 + m lower left-hand corner
252 <STRONG>WACS_LRCORNER</STRONG> U+2518 + j lower right-hand corner
253 <STRONG>WACS_LTEE</STRONG> U+2524 + t left tee
254 <STRONG>WACS_NEQUAL</STRONG> U+2260 ! | not-equal
255 <STRONG>WACS_PI</STRONG> U+03c0 * { greek pi
256 <STRONG>WACS_PLMINUS</STRONG> U+00b1 # g plus/minus
257 <STRONG>WACS_PLUS</STRONG> U+253c + n plus
258 <STRONG>WACS_RARROW</STRONG> U+2192 &gt; + arrow pointing right
259 <STRONG>WACS_RTEE</STRONG> U+251c + u right tee
260 <STRONG>WACS_S1</STRONG> U+23ba - o scan line 1
261 <STRONG>WACS_S3</STRONG> U+23bb - p scan line 3
262 <STRONG>WACS_S7</STRONG> U+23bc - r scan line 7
263 <STRONG>WACS_S9</STRONG> U+23bd _ s scan line 9
264 <STRONG>WACS_STERLING</STRONG> U+00a3 f } pound-sterling symbol
265 <STRONG>WACS_TTEE</STRONG> U+252c + w top tee
266 <STRONG>WACS_UARROW</STRONG> U+2191 ^ - arrow pointing up
267 <STRONG>WACS_ULCORNER</STRONG> U+250c + l upper left-hand corner
268 <STRONG>WACS_URCORNER</STRONG> U+2510 + k upper right-hand corner
269 <STRONG>WACS_VLINE</STRONG> U+2502 | x vertical line
270
271 The <EM>ncurses</EM> wide API also defines symbols for thick lines (<STRONG>acsc</STRONG> "J"
272 through "N", "T" through "X", and "Q"):
273
274 <STRONG>Unicode</STRONG> <STRONG>ASCII</STRONG> <STRONG>acsc</STRONG>
275 <STRONG>ACS</STRONG> <STRONG>Name</STRONG> <STRONG>Default</STRONG> <STRONG>Default</STRONG> <STRONG>Char</STRONG> <STRONG>Glyph</STRONG> <STRONG>Name</STRONG>
276 ------------------------------------------------------------------------
277 <STRONG>WACS_T_BTEE</STRONG> U+253b + V thick tee pointing up
278 <STRONG>WACS_T_HLINE</STRONG> U+2501 - Q thick horizontal line
279 <STRONG>WACS_T_LLCORNER</STRONG> U+2517 + M thick lower left corner
280 <STRONG>WACS_T_LRCORNER</STRONG> U+251b + J thick lower right corner
281 <STRONG>WACS_T_LTEE</STRONG> U+252b + T thick tee pointing right
282 <STRONG>WACS_T_PLUS</STRONG> U+254b + N thick large plus
283 <STRONG>WACS_T_RTEE</STRONG> U+2523 + U thick tee pointing left
284 <STRONG>WACS_T_TTEE</STRONG> U+2533 + W thick tee pointing down
285 <STRONG>WACS_T_ULCORNER</STRONG> U+250f + L thick upper left corner
286 <STRONG>WACS_T_URCORNER</STRONG> U+2513 + K thick upper right corner
287 <STRONG>WACS_T_VLINE</STRONG> U+2503 | X thick vertical line
288
289 and for double lines (<STRONG>acsc</STRONG> "A" through "I", plus "R" and "Y"):
290
291 <STRONG>Unicode</STRONG> <STRONG>ASCII</STRONG> <STRONG>acsc</STRONG>
292 <STRONG>ACS</STRONG> <STRONG>Name</STRONG> <STRONG>Default</STRONG> <STRONG>Default</STRONG> <STRONG>Char</STRONG> <STRONG>Glyph</STRONG> <STRONG>Name</STRONG>
293 ------------------------------------------------------------------------
294 <STRONG>WACS_D_BTEE</STRONG> U+2569 + H double tee pointing up
295 <STRONG>WACS_D_HLINE</STRONG> U+2550 - R double horizontal line
296 <STRONG>WACS_D_LLCORNER</STRONG> U+255a + D double lower left corner
297 <STRONG>WACS_D_LRCORNER</STRONG> U+255d + A double lower right corner
298 <STRONG>WACS_D_LTEE</STRONG> U+2560 + F double tee pointing right
299 <STRONG>WACS_D_PLUS</STRONG> U+256c + E double large plus
300 <STRONG>WACS_D_RTEE</STRONG> U+2563 + G double tee pointing left
301 <STRONG>WACS_D_TTEE</STRONG> U+2566 + I double tee pointing down
302 <STRONG>WACS_D_ULCORNER</STRONG> U+2554 + C double upper left corner
303 <STRONG>WACS_D_URCORNER</STRONG> U+2557 + B double upper right corner
304 <STRONG>WACS_D_VLINE</STRONG> U+2551 | Y double vertical line
305
306 Unicode's descriptions for these characters differs slightly from
307 <EM>ncurses</EM>, by introducing the term "light" (along with less important
308 details). Here are its descriptions for the normal, thick, and double
309 horizontal lines:
310
311 <STRONG>o</STRONG> U+2500 BOX DRAWINGS LIGHT HORIZONTAL
312
313 <STRONG>o</STRONG> U+2501 BOX DRAWINGS HEAVY HORIZONTAL
314
315 <STRONG>o</STRONG> U+2550 BOX DRAWINGS DOUBLE HORIZONTAL
316
317
318 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
319 These functions return <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
320
321 In <EM>ncurses</EM>, these functions fail if
322
323 <STRONG>o</STRONG> the <EM>curses</EM> screen has not been initialized,
324
325 <STRONG>o</STRONG> (for functions taking a <EM>WINDOW</EM> pointer argument) <EM>win</EM> is a null
326 pointer,
327
328 <STRONG>o</STRONG> wrapping to a new line is impossible because <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG> has not
329 been called on <EM>win</EM> (or <STRONG>stdscr</STRONG>, as applicable) when writing to its
330 bottom right location is attempted, or
331
332 <STRONG>o</STRONG> it is not possible to add a complete character at the cursor
333 position.
334
335 Functions prefixed with "mv" first perform cursor movement and fail if
336 the position (<EM>y</EM>, <EM>x</EM>) is outside the window boundaries.
337
338
339 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
340 <STRONG>add_wch</STRONG>, <STRONG>mvadd_wch</STRONG>, <STRONG>mvwadd_wch</STRONG>, and <STRONG>echo_wchar</STRONG> may be implemented as
341 macros.
342
343
344 </PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
345 The symbols <EM>WACS</EM><STRONG>_</STRONG><EM>S3</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>S7</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>LEQUAL</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>GEQUAL</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>PI</EM>,
346 <EM>WACS</EM><STRONG>_</STRONG><EM>NEQUAL</EM>, and <EM>WACS</EM><STRONG>_</STRONG><EM>STERLING</EM> are not standard. However, many
347 publicly available <EM>terminfo</EM> entries include <STRONG>acs_chars</STRONG> (<STRONG>acsc</STRONG>)
348 capabilities in which their key characters (<STRONG>pryz{|}</STRONG>) are embedded, and
349 a second-hand list of their character descriptions has come to light.
350 The <EM>ncurses</EM> developers invented WACS-prefixed names for them.
351
352
353 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
354 Applications employing <EM>ncurses</EM> extensions should condition their use on
355 the visibility of the <STRONG>NCURSES_VERSION</STRONG> preprocessor macro.
356
357 These functions are described in X/Open Curses Issue 4. It specifies
358 no error conditions for them.
359
360 The defaults specified for forms-drawing characters apply in the POSIX
361 locale. X/Open Curses makes it clear that the WACS_ symbols should be
362 defined as a pointer to <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> data, e.g., in the discussion of
363 <EM>border</EM><STRONG>_</STRONG><EM>set</EM>. A few implementations are problematic:
364
365 <STRONG>o</STRONG> NetBSD <EM>curses</EM> defines the symbols as a <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> within a <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>.
366
367 <STRONG>o</STRONG> HP-UX <EM>curses</EM> equates some of the <EM>ACS</EM><STRONG>_</STRONG> symbols to the analogous
368 <EM>WACS</EM><STRONG>_</STRONG> symbols as if the <EM>ACS</EM><STRONG>_</STRONG> symbols were wide characters. The
369 misdefined symbols are the arrows and other symbols which are not
370 used for line-drawing.
371
372 X/Open Curses does not specify symbols for thick- or double-lines.
373 SVr4 <EM>curses</EM> implementations defined their line-drawing symbols in terms
374 of intermediate symbols. <EM>ncurses</EM> extends those symbols, providing new
375 definitions not found in SVr4 implementations.
376
377 Not all Unicode-capable terminals provide support for VT100-style
378 alternate character sets (i.e., the <EM>acsc</EM><STRONG>_</STRONG><EM>chars</EM> (<STRONG>acsc</STRONG>) capability), with
379 their corresponding line-drawing characters. X/Open Curses did not
380 address the aspect of integrating Unicode with line-drawing characters.
381 Existing implementations of System V <EM>curses</EM> (AIX, HP-UX, Solaris) use
382 only the <EM>acsc</EM><STRONG>_</STRONG><EM>chars</EM> (<STRONG>acsc</STRONG>) character-mapping to provide this feature.
383 As a result, those implementations can use only single-byte line-
384 drawing characters. <EM>ncurses</EM> 5.3 (2002) provided a table of Unicode
385 values to solve these problems. NetBSD <EM>curses</EM> incorporated that table
386 in 2010.
387
388 <EM>ncurses</EM> uses the Unicode values instead of the terminal type
389 description's <EM>acsc</EM><STRONG>_</STRONG><EM>chars</EM> (<STRONG>acsc</STRONG>) mapping as discussed in <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> for
390 the environment variable <EM>NCURSES</EM><STRONG>_</STRONG><EM>NO</EM><STRONG>_</STRONG><EM>UTF8</EM><STRONG>_</STRONG><EM>ACS</EM>. In contrast, for the
391 same cases, the line-drawing characters described in <STRONG><A HREF="curs_addch.3x.html">addch(3x)</A></STRONG> will use
392 only the ASCII default values.
393
394 Having Unicode available does not solve all of the problems with line-
395 drawing for <EM>curses</EM>:
396
397 <STRONG>o</STRONG> The closest Unicode equivalents to the VT100 graphics <EM>S1</EM>, <EM>S3</EM>, <EM>S7</EM>,
398 and <EM>S9</EM> frequently are not displayed at the regular intervals which
399 the terminal used.
400
401 <STRONG>o</STRONG> The <EM>lantern</EM> is a special case. It originated with the AT&amp;T 4410
402 terminal in the early 1980s. There is no accessible documentation
403 depicting the lantern symbol on the AT&amp;T terminal.
404
405 Lacking documentation, most readers assume that a <EM>storm</EM> <EM>lantern</EM> was
406 intended. But there are several possibilities, all with problems.
407
408 Unicode 6.0 (2010) does provide two lantern symbols: U+1F383 and
409 U+1F3EE. Those were not available in 2002, and are irrelevant
410 since they lie outside the Basic Multilingual Plane and as a result
411 are unavailable on many terminals. They are not storm lanterns, in
412 any case.
413
414 Most <EM>storm</EM> <EM>lanterns</EM> have a tapering glass chimney (to guard against
415 tipping); some have a wire grid protecting the chimney.
416
417 For the tapering appearance, U+2603 was adequate. In use on a
418 terminal, no one can tell what the image represents. Unicode calls
419 it a snowman.
420
421 Others have suggested these alternatives: &lt;section&gt; U+00A7 (section
422 mark), &lt;Theta&gt; U+0398 (theta), &lt;Phi&gt; U+03A6 (phi), &lt;delta&gt; U+03B4
423 (delta), U+2327 (x in a rectangle), U+256C (forms double vertical
424 and horizontal), and U+2612 (ballot box with x).
425
426
427 </PRE><H3><a name="h3-Complex-Characters">Complex Characters</a></H3><PRE>
428 The complex character type <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM> can store more than one wide
429 character (<EM>wchar</EM><STRONG>_</STRONG><EM>t</EM>). X/Open Curses does not mention this possibility,
430 specifying behavior only where <EM>wch</EM> is a single character, either
431 spacing or non-spacing.
432
433 <EM>ncurses</EM> assumes that <EM>wch</EM> is constructed using <STRONG><A HREF="curs_getcchar.3x.html">setcchar(3x)</A></STRONG>, and in turn
434 that the result
435
436 <STRONG>o</STRONG> contains at most one spacing character at the beginning of its list
437 of wide characters, and zero or more non-spacing characters, or
438
439 <STRONG>o</STRONG> holds one non-spacing character.
440
441 In the latter case, <EM>ncurses</EM> adds the non-spacing character to the
442 active complex character.
443
444
445 </PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
446 X/Open Curses Issue 4 (1995) initially specified these functions. The
447 System V Interface Definition (SVID) Version 4 of the same year
448 specified functions named <EM>waddwch</EM> (and the usual variants), <EM>echowchar</EM>,
449 and <EM>wechowchar</EM>. These were later additions to SVr4.<EM>x</EM>, not appearing in
450 the first SVr4 (1989). They differed from X/Open's later <EM>wadd</EM><STRONG>_</STRONG><EM>wch</EM> and
451 <EM>wecho</EM><STRONG>_</STRONG><EM>wchar</EM> in that they each took an argument of type <EM>wchar</EM><STRONG>_</STRONG><EM>t</EM> instead
452 of <EM>cchar</EM><STRONG>_</STRONG><EM>t</EM>. SVID defined no <EM>WACS</EM><STRONG>_</STRONG> symbols.
453
454 X/Open Curses Issue 4 also defined many of the <EM>WACS</EM><STRONG>_</STRONG> constants,
455 excepting <EM>WACS</EM><STRONG>_</STRONG><EM>GEQUAL</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>LEQUAL</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>NEQUAL</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>PI</EM>, <EM>WACS</EM><STRONG>_</STRONG><EM>S3</EM>,
456 <EM>WACS</EM><STRONG>_</STRONG><EM>S7</EM>, and <EM>WACS</EM><STRONG>_</STRONG><EM>STERLING</EM>; and those for drawing thick and double
457 lines.
458
459 <EM>ncurses</EM> 5.3 (2002) furnished the remaining <EM>WACS</EM><STRONG>_</STRONG> constants.
460
461
462 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
463 <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG> describes comparable functions of the <EM>ncurses</EM> library in
464 its non-wide-character configuration.
465
466 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addwstr.3x.html">curs_addwstr(3x)</A></STRONG>, <STRONG><A HREF="curs_add_wchstr.3x.html">curs_add_wchstr(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>,
467 <STRONG><A HREF="curs_bkgrnd.3x.html">curs_bkgrnd(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>, <STRONG><A HREF="curs_getcchar.3x.html">curs_getcchar(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>,
468 <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG>putwc(3)</STRONG>
469
470 ncurses 6.6 2025-11-11 <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>
471 </PRE>
472 <div class="nav">
473 <ul>
474 <li><a href="#h2-NAME">NAME</a></li>
475 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
476 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
477 <ul>
478 <li><a href="#h3-wadd_wch">wadd_wch</a></li>
479 <li><a href="#h3-wecho_wchar">wecho_wchar</a></li>
480 <li><a href="#h3-Forms-Drawing-Characters">Forms-Drawing Characters</a></li>
481 </ul>
482 </li>
483 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
484 <li><a href="#h2-NOTES">NOTES</a></li>
485 <li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
486 <li><a href="#h2-PORTABILITY">PORTABILITY</a>
487 <ul>
488 <li><a href="#h3-Complex-Characters">Complex Characters</a></li>
489 </ul>
490 </li>
491 <li><a href="#h2-HISTORY">HISTORY</a></li>
492 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
493 </ul>
494 </div>
495 </BODY>
496 </HTML>