Debian Codegraph @

upstream/debian-trixie/man3/add_wchstr.3ncurses

raw
1 .\"***************************************************************************
2 .\" Copyright 2019-2024,2025 Thomas E. Dickey *
3 .\" Copyright 2002-2012,2017 Free Software Foundation, Inc. *
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 .\"***************************************************************************
29 .\"
30 .\" $Id: curs_add_wchstr.3x,v 1.55 2025/02/01 22:57:57 tom Exp $
31 .TH add_wchstr 3NCURSES 2025-02-01 "ncurses 6.5" "Library calls"
32 .ie \n(.g \{\
33 .ds `` \(lq
34 .ds '' \(rq
35 .\}
36 .el \{\
37 .ie t .ds `` ``
38 .el .ds `` ""
39 .ie t .ds '' ''
40 .el .ds '' ""
41 .\}
42 .
43 .de bP
44 .ie n .IP \(bu 4
45 .el .IP \(bu 2
46 ..
47 .SH NAME
48 \fB\%add_wchstr\fP,
49 \fB\%wadd_wchstr\fP,
50 \fB\%mvadd_wchstr\fP,
51 \fB\%mvwadd_wchstr\fP,
52 \fB\%add_wchnstr\fP,
53 \fB\%wadd_wchnstr\fP,
54 \fB\%mvadd_wchnstr\fP,
55 \fB\%mvwadd_wchnstr\fP \-
56 add a \fIcurses\fR complex character string to a window
57 .SH SYNOPSIS
58 .nf
59 \fB#include <curses.h>
60 .PP
61 \fBint add_wchstr(const cchar_t * \fIwchstr\fP);
62 \fBint wadd_wchstr(WINDOW * \fIwin\fP, const cchar_t * \fIwchstr\fP);
63 \fBint mvadd_wchstr(int \fIy\fP, int \fIx\fP, const cchar_t * \fIwchstr\fP);
64 \fBint mvwadd_wchstr(WINDOW * \fIwin\fP, int \fIy\fP, int \fIx\fP,
65 const cchar_t * \fIwchstr\fP);
66 .PP
67 \fBint add_wchnstr(const cchar_t * \fIwchstr\fP, int \fIn\fP);
68 \fBint wadd_wchnstr(WINDOW * \fIwin\fP, const cchar_t * \fIwchstr\fP,
69 int \fIn\fP);
70 \fBint mvadd_wchnstr(int \fIy\fP, int \fIx\fP, const cchar_t * \fIwchstr\fP,
71 int \fIn\fP);
72 \fBint mvwadd_wchnstr(WINDOW * \fIwin\fP, int \fIy\fP, int \fIx\fP,
73 const cchar_t * \fIwchstr\fP, int \fIn\fP);
74 .fi
75 .SH DESCRIPTION
76 .B \%wadd_wchstr
77 copies the string of complex characters
78 .I \%wchstr
79 to the window
80 .IR win "."
81 A null complex character terminates the string.
82 If a complex character does not completely fit at the end of the line,
83 .I curses
84 fills its remaining cells with the window's background character;
85 see \fB\%bkgrnd\fP(3NCURSES).
86 .B \%wadd_wchnstr
87 does the same,
88 but copies at most
89 .I n
90 characters,
91 or as many as possible if
92 .I n
93 is
94 .BR \-1 "."
95 \fB\%ncurses\fP(3NCURSES) describes the variants of these functions.
96 .PP
97 Because these functions do not call \fB\%wadd_wch\fP(3NCURSES) internally,
98 they are faster than \fB\%waddwstr\fP(3NCURSES) and \fB\%waddnwstr\fP(3NCURSES).
99 On the other hand,
100 they
101 .bP
102 do not treat the backspace,
103 carriage return,
104 or line feed characters specially;
105 .bP
106 do not represent unprintable characters with \fB\%wunctrl\fP(3NCURSES);
107 .bP
108 do not update the cursor position to follow the last character written;
109 .bP
110 truncate the string at the window's right margin,
111 rather than wrapping it to the next line and potentially scrolling.
112 .SH RETURN VALUE
113 These functions return
114 .B OK
115 on success and
116 .B ERR
117 on failure.
118 .PP
119 In
120 .IR \%ncurses ","
121 they return
122 .B ERR
123 if
124 .bP
125 .I win
126 is
127 .I NULL
128 or
129 .bP
130 .I wchstr
131 is
132 .IR NULL "."
133 .PP
134 Functions prefixed with \*(``mv\*('' first perform cursor movement and
135 fail if the position
136 .RI ( y ,
137 .IR x )
138 is outside the window boundaries.
139 .SH NOTES
140 All of these functions except
141 .B \%wadd_wchnstr
142 may be implemented as macros.
143 .SH PORTABILITY
144 X/Open Curses Issue\ 4 describes these functions.
145 It specifies no error conditions for them.
146 .SH HISTORY
147 X/Open Curses Issue\ 4 (1995) initially specified these functions.
148 The System\ V Interface Definition Version\ 4
149 of the same year
150 specified functions named
151 .I \%waddwchstr
152 and
153 .I \%waddwchnstr
154 (and the usual variants).
155 .\" SVID 4, vol 3., p. 477
156 These were later additions to
157 .RI SVr4. x ,
158 not appearing in the first SVr4 (1989).
159 They differed from X/Open's later
160 .I \%wadd_wchstr
161 and
162 .I \%wadd_wchnstr
163 in that they each took an argument of type
164 .I \%wchar_t
165 instead of
166 .IR \%cchar_t "."
167 .SH SEE ALSO
168 \fB\%addchstr\fP(3NCURSES) describes comparable functions of the
169 .I \%ncurses
170 library in its non-wide-character configuration.
171 .PP
172 \fB\%ncurses\fP(3NCURSES),
173 \fB\%addwstr\fP(3NCURSES),
174 \fB\%add_wch\fP(3NCURSES)