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