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
|
'\" te
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH curs_addwch 3CURSES "31 Dec 1996" "SunOS 5.11" "Curses Library Functions"
.SH NAME
curs_addwch, addwch, waddwch, mvaddwch, mvwaddwch, echowchar, wechowchar \- add
a wchar_t character (with attributes) to a curses window and advance cursor
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [\fIflag\fR]... \fIfile\fR... \fB-lcurses\fR [\fIlibrary\fR]...
.fi
.LP
.nf
#include<curses.h>
\fBint\fR \fBaddwch\fR(\fBchtype\fR \fIwch\fR);
.fi
.LP
.nf
\fBint\fR \fBwaddwch\fR(\fBWINDOW *\fR\fIwin\fR, \fBchtype\fR \fIwch\fR);
.fi
.LP
.nf
\fBint\fR \fBmvaddwch\fR(\fBint\fR \fIy\fR, \fBint\fR \fIx\fR, \fBchtype\fR \fIwch\fR);
.fi
.LP
.nf
\fBint\fR \fBmvwaddwch\fR(\fBWINDOW *\fR\fIwin\fR, \fBint\fR \fIy\fR, \fBint\fR \fIx\fR, \fBchtype\fR \fIwch\fR);
.fi
.LP
.nf
\fBint\fR \fBechowchar\fR(\fBchtype\fR \fIwch\fR);
.fi
.LP
.nf
\fBint\fR \fBwechowchar\fR(\fBWINDOW *\fR\fIwin\fR, \fBchtype\fR \fIwch\fR);
.fi
.SH DESCRIPTION
.sp
.LP
The \fBaddwch()\fR,\fBwaddwch()\fR,\fBmvaddwch()\fR, and \fBmvwaddwch()\fR
routines put the character \fIwch\fR, holding a \fBwchar_t\fR character, into
the window at the current cursor position of the window and advance the
position of the window cursor. Their function is similar to that of
\fBputwchar\fR(3C) in the C multibyte library. At the right margin, an
automatic newline is performed. At the bottom of the scrolling region, if
\fBscrollok\fR is enabled, the scrolling region is scrolled up one line.
.sp
.LP
If \fIwch\fR is a tab, newline, or backspace, the cursor is moved
appropriately within the window. A newline also does a \fBclrtoeol\fR(3CURSES)
before moving. Tabs are considered to be at every eighth column. If \fIwch\fR
is another control character, it is drawn in the \fB^\fR\fIX\fR notation.
Calling \fBwinwch\fR(3CURSES) after adding a control character does not return
the control character, but instead returns the representation of the control
character.
.sp
.LP
Video attributes can be combined with a \fBwchar_t\fR character by OR-ing them
into the parameter. This results in these attributes also being set. (The
intent here is that text, including attributes, can be copied from one place to
another using \fBinwch()\fR and \fBaddwch()\fR.) See
\fBstandout\fR(3CURSES), predefined video attribute constants.
.sp
.LP
The \fBechowchar()\fR and \fBwechowchar()\fR routines are functionally
equivalent to a call to \fBaddwch()\fR followed by a call to
\fBrefresh\fR(3CURSES), or a call to \fBwaddwch()\fR followed by a call to
\fBwrefresh\fR(3CURSES). The knowledge that only a single character is being
output is taken into consideration and, for non-control characters, a
considerable performance gain might be seen by using these routines instead of
their equivalents.
.SS "Line Graphics"
.sp
.LP
The following variables may be used to add line drawing characters to the
screen with routines of the \fBaddwch()\fR family. When variables are defined
for the terminal, the \fBA_ALTCHARSET\fR bit is turned on. (See
\fBcurs_attr\fR(3CURSES)). Otherwise, the default character listed below is
stored in the variable. The names chosen are consistent with the VT100
nomenclature.
.sp
.sp
.TS
tab() box;
cw(1.83i) |cw(1.83i) |cw(1.83i)
lw(1.83i) |lw(1.83i) |lw(1.83i)
.
NameDefaultGlyph Description
_
ACS_ULCORNER+upper left-hand corner
_
ACS_LLCORNER+lower left-hand corner
_
ACS_URCORNER+upper right-hand corner
_
ACS_LRCORNER+lower right-hand corner
_
ACS_RTEE+right tee
_
ACS_LTEE+left tee
_
ACS_BTEE+bottom tee
_
ACS_TTEE+top tee
_
ACS_HLINE-horizontal line
_
ACS_VLINE|vertical line
_
ACS_PLUS+plus
_
ACS_S1-scan line 1
_
ACS_S9-scan line 9
_
ACS_DIAMOND+diamond
_
ACS_CKBOARD:checker board (stipple)
_
ACS_DEGREE\&'degree symbol
_
ACS_PLMINUS#plus/minus
_
ACS_BULLETobullet
_
ACS_LARROW<arrow pointing left
_
ACS_RARRROW>arrow pointing right
_
ACS_DARROWvarrow pointing down
_
ACS_UARROW^arrow pointing up
_
ACS_BOARD#board of squares
_
ACS_LANTERN#lantern symbol
_
ACS_BLOCK#solid square block
.TE
.SH RETURN VALUE
.sp
.LP
All routines return the integer \fBERR\fR upon failure and an integer value
other than \fBERR\fR upon successful completion, unless otherwise noted in the
preceding routine descriptions.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i)
lw(2.75i) |lw(2.75i)
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
MT-LevelUnsafe
.TE
.SH SEE ALSO
.sp
.LP
\fBputwchar\fR(3C), \fBclrtoeol\fR(3CURSES), \fBcurses\fR(3CURSES),
\fBcurs_attr\fR(3CURSES), \fBcurs_inwch\fR(3CURSES),
\fBcurs_outopts\fR(3CURSES), \fBrefresh\fR(3CURSES), \fBstandout\fR(3CURSES),
\fBwinwch\fR(3CURSES), \fBwrefresh\fR(3CURSES), \fBattributes\fR(5)
.SH NOTES
.sp
.LP
The header file <\fBcurses.h\fR> automatically includes the header files
<\fBstdio.h\fR>, <\fBunctrl.h\fR> and <\fBwidec.h\fR>.
.sp
.LP
Note that \fBaddwch()\fR,\fB mvaddwch()\fR, \fBmvwaddwch()\fR, and
\fBechowchar()\fR may be macros.
.sp
.LP
None of these routines can use the color attribute in \fBchtype\fR.
|