Debian Codegraph @

upstream/mageia-cauldron/man3/curs_add_wchstr.3x

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.57 2025/03/15 20:41:04 tom Exp $
31 .TH curs_add_wchstr 3X 2025-03-15 "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(3X).
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(3X) describes the variants of these functions.
96 .PP
97 Because these functions do not call \fB\%wadd_wch\fP(3X) internally,
98 they are faster than \fB\%waddwstr\fP(3X) and \fB\%waddnwstr\fP(3X).
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(3X);
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 these functions fail if
122 .bP
123 the
124 .I curses
125 screen has not been initialized,
126 .bP
127 .I wchstr
128 is a null pointer,
129 or
130 .bP
131 (for functions taking a
132 .I \%WINDOW
133 pointer argument)
134 .I win
135 is a null pointer.
136 .PP
137 Functions prefixed with \*(``mv\*('' first perform cursor movement and
138 fail if the position
139 .RI ( y ,
140 .IR x )
141 is outside the window boundaries.
142 .SH NOTES
143 All of these functions except
144 .B \%wadd_wchnstr
145 may be implemented as macros.
146 .SH PORTABILITY
147 X/Open Curses Issue\ 4 describes these functions.
148 It specifies no error conditions for them.
149 .SH HISTORY
150 X/Open Curses Issue\ 4 (1995) initially specified these functions.
151 The System\ V Interface Definition Version\ 4
152 of the same year
153 specified functions named
154 .I \%waddwchstr
155 and
156 .I \%waddwchnstr
157 (and the usual variants).
158 .\" SVID 4, vol 3., p. 477
159 These were later additions to
160 .RI SVr4. x ,
161 not appearing in the first SVr4 (1989).
162 They differed from X/Open's later
163 .I \%wadd_wchstr
164 and
165 .I \%wadd_wchnstr
166 in that they each took an argument of type
167 .I \%wchar_t
168 instead of
169 .IR \%cchar_t "."
170 .SH SEE ALSO
171 \fB\%curs_addchstr\fP(3X) describes comparable functions of the
172 .I \%ncurses
173 library in its non-wide-character configuration.
174 .PP
175 \fB\%curses\fP(3X),
176 \fB\%curs_addwstr\fP(3X),
177 \fB\%curs_add_wch\fP(3X)