Debian Codegraph @

upstream/debian-unstable/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.60 2025/03/15 20:41:04 tom Exp $
31 .TH addwstr 3NCURSES 2025-03-15 "ncurses 6.6" "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 these functions fail if
114 .bP
115 the
116 .I curses
117 screen has not been initialized,
118 .bP
119 .I wstr
120 is a null pointer,
121 .bP
122 (for functions taking a
123 .I \%WINDOW
124 pointer argument)
125 .I win
126 is a null pointer,
127 or
128 .bP
129 an internal \fB\%wadd_wch\fP(3NCURSES) call returns
130 .BR ERR "."
131 .PP
132 Functions prefixed with \*(``mv\*('' first perform cursor movement and
133 fail if the position
134 .RI ( y ,
135 .IR x )
136 is outside the window boundaries.
137 .SH NOTES
138 All of these functions except
139 .B \%waddnwstr
140 may be implemented as macros.
141 .SH PORTABILITY
142 X/Open Curses Issue\ 4 describes these functions.
143 .PP
144 SVr4 describes a successful return value only as
145 \*(``an integer value other than
146 .IR ERR \*(''. \" Courier roman in source; SVID 4, vol. 3, p. 478
147 .SH HISTORY
148 X/Open Curses Issue\ 4 (1995) initially specified these functions.
149 The System\ V Interface Definition Version\ 4
150 of the same year
151 specified functions named
152 .I \%waddwstr
153 and
154 .I \%waddnwstr
155 (and the usual variants).
156 .\" SVID 4, vol 3., p. 478
157 These were later additions to
158 .RI SVr4. x ,
159 not appearing in the first SVr4 (1989).
160 .SH SEE ALSO
161 \fB\%addstr\fP(3NCURSES) describes comparable functions of the
162 .I \%ncurses
163 library in its non-wide-character configuration.
164 .PP
165 \fB\%ncurses\fP(3NCURSES),
166 \fB\%add_wch\fP(3NCURSES),
167 \fB\%add_wchstr\fP(3NCURSES)