Debian Codegraph @

upstream/debian-trixie/man3/addwstr.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_addwstr.3x,v 1.58 2025/02/01 22:54:32 tom Exp $
31 .TH addwstr 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\%addwstr\fP,
49 \fB\%waddwstr\fP,
50 \fB\%mvaddwstr\fP,
51 \fB\%mvwaddwstr\fP,
52 \fB\%addnwstr\fP,
53 \fB\%waddnwstr\fP,
54 \fB\%mvaddnwstr\fP,
55 \fB\%mvwaddnwstr\fP \-
56 add a wide-character string to a \fIcurses\fR window and advance the cursor
57 .SH SYNOPSIS
58 .nf
59 \fB#include <curses.h>
60 .PP
61 \fBint addwstr(const wchar_t * \fIwstr\fP);
62 \fBint waddwstr(WINDOW * \fIwin\fP, const wchar_t * \fIwstr\fP);
63 \fBint mvaddwstr(int \fIy\fP, int \fIx\fP, const wchar_t * \fIwstr\fP);
64 \fBint mvwaddwstr(WINDOW * \fIwin\fP, int \fIy\fP, int \fIx\fP,
65 const wchar_t * \fIwstr\fP);
66 .PP
67 \fBint addnwstr(const wchar_t * \fIwstr\fP, int \fIn\fP);
68 \fBint waddnwstr(WINDOW * \fIwin\fP, const wchar_t * \fIwstr\fP, int \fIn\fP);
69 \fBint mvaddnwstr(int \fIy\fP, int \fIx\fP, const wchar_t * \fIwstr\fP, int \fIn\fP);
70 \fBint mvwaddnwstr(WINDOW * \fIwin\fP, int \fIy\fP, int \fIx\fP,
71 const wchar_t * \fIwstr\fP, int \fIn\fP);
72 .fi
73 .SH DESCRIPTION
74 .B \%waddwstr
75 writes the characters of the (wide-null-terminated) wide-character
76 string
77 .I wstr
78 to the window
79 .IR win ,
80 as if by
81 constructing a
82 .I cchar_t
83 for each
84 .I wchar_t
85 in
86 .IR wstr ,
87 then calling \fB\%wadd_wch\fP(3NCURSES) with the resulting
88 .IR cchar_t .
89 .I curses
90 processes spacing and non-spacing characters in
91 .I wstr
92 one at a time.
93 .B \%waddnwstr
94 is similar,
95 but writes at most
96 .I n
97 wide characters.
98 If
99 .I n
100 is \-1,
101 .B \%waddnwstr
102 writes the entire wide string.
103 \fB\%ncurses\fP(3NCURSES) describes the variants of these functions.
104 .SH RETURN VALUE
105 These functions return
106 .B OK
107 on success and
108 .B ERR
109 on failure.
110 .PP
111 In
112 .IR \%ncurses ","
113 they return
114 .B ERR
115 if
116 .bP
117 .I win
118 is
119 .IR NULL ","
120 .bP
121 .I wstr
122 is
123 .IR NULL ","
124 or
125 .bP
126 an internal \fB\%wadd_wch\fP(3NCURSES) call returns
127 .BR ERR "."
128 .PP
129 Functions prefixed with \*(``mv\*('' first perform cursor movement and
130 fail if the position
131 .RI ( y ,
132 .IR x )
133 is outside the window boundaries.
134 .SH NOTES
135 All of these functions except
136 .B \%waddnwstr
137 may be implemented as macros.
138 .SH PORTABILITY
139 X/Open Curses Issue\ 4 describes these functions.
140 .PP
141 SVr4 describes a successful return value only as
142 \*(``an integer value other than
143 .IR ERR \*(''. \" Courier roman in source; SVID 4, vol. 3, p. 478
144 .SH HISTORY
145 X/Open Curses Issue\ 4 (1995) initially specified these functions.
146 The System\ V Interface Definition Version\ 4
147 of the same year
148 specified functions named
149 .I \%waddwstr
150 and
151 .I \%waddnwstr
152 (and the usual variants).
153 .\" SVID 4, vol 3., p. 478
154 These were later additions to
155 .RI SVr4. x ,
156 not appearing in the first SVr4 (1989).
157 .SH SEE ALSO
158 \fB\%addstr\fP(3NCURSES) describes comparable functions of the
159 .I \%ncurses
160 library in its non-wide-character configuration.
161 .PP
162 \fB\%ncurses\fP(3NCURSES),
163 \fB\%add_wch\fP(3NCURSES),
164 \fB\%add_wchstr\fP(3NCURSES)