]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_addwstr.3x
a0a1b4230084b64930b198209cc3f1577c9a0982
[ncurses.git] / man / curs_addwstr.3x
1 .\"***************************************************************************
2 .\" Copyright 2019-2022,2023 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.24 2023/09/16 23:34:43 tom Exp $
31 .TH curs_addwstr 3X 2023-09-16 "ncurses 6.4" "Library calls"
32 .ie \n(.g .ds `` \(lq
33 .el       .ds `` ``
34 .ie \n(.g .ds '' \(rq
35 .el       .ds '' ''
36 .de bP
37 .ie n  .IP \(bu 4
38 .el    .IP \(bu 2
39 ..
40 .SH NAME
41 \fB\%addwstr\fP,
42 \fB\%addnwstr\fP,
43 \fB\%waddwstr\fP,
44 \fB\%waddnwstr\fP,
45 \fB\%mvaddwstr\fP,
46 \fB\%mvaddnwstr\fP,
47 \fB\%mvwaddwstr\fP,
48 \fB\%mvwaddnwstr\fP \-
49 add a wide-character string to a \fIcurses\fR window and advance the cursor
50 .SH SYNOPSIS
51 .nf
52 \fB#include <curses.h>\fP
53 .PP
54 \fBint addwstr(const wchar_t *\fIwstr\fB);\fR
55 .br
56 \fBint addnwstr(const wchar_t *\fIwstr\fB, int \fIn\fB);\fR
57 .br
58 \fBint waddwstr(WINDOW *\fIwin\fB, const wchar_t *\fIwstr\fB);\fR
59 .br
60 \fBint waddnwstr(WINDOW *\fIwin\fB, const wchar_t *\fIwstr\fB, int \fIn\fB);\fR
61 .sp
62 \fBint mvaddwstr(int \fIy\fB, int \fIx\fB, const wchar_t *\fIwstr\fB);\fR
63 .br
64 \fBint mvaddnwstr(int \fIy\fB, int \fIx\fB, const wchar_t *\fIwstr\fB, int \fIn\fB);\fR
65 .br
66 \fBint mvwaddwstr(WINDOW *\fIwin\fB, int \fIy\fB, int \fIx\fB, const wchar_t *\fIwstr\fB);\fR
67 .br
68 \fBint mvwaddnwstr(WINDOW *\fIwin\fB, int \fIy\fB, int \fIx\fB, const wchar_t *\fIwstr\fB, int \fIn\fB);\fR
69 .fi
70 .SH DESCRIPTION
71 These functions write the characters of the
72 (null-terminated) \fBwchar_t\fP character string
73 \fIwstr\fP on the given window.
74 It is similar to constructing a \fBcchar_t\fP for
75 each \fBwchar_t\fR in the string,
76 then calling \fBwadd_wch\fP(3X) for the resulting \fBcchar_t\fP:
77 .bP
78 spacing and non-spacing characters in the string
79 are processed one at a time, and
80 .bP
81 control characters are processed as in \fBwaddch\fP(3X).
82 .PP
83 The \fImv\fP functions perform cursor movement once, before writing any
84 characters.
85 Thereafter, the cursor is advanced as a side-effect of writing to the window.
86 .PP
87 The four functions with \fIn\fP as the last argument
88 write at most \fIn\fP \fBwchar_t\fP characters,
89 or until a terminating null is reached.
90 If \fIn\fP is \-1, then the entire string will be added.
91 .SH RETURN VALUE
92 All functions return the integer \fBERR\fP upon failure and \fBOK\fP on success.
93 .PP
94 X/Open does not define any error conditions.
95 This implementation returns an error
96 .bP
97 if the window pointer is null or
98 .bP
99 if the string pointer is null or
100 .bP
101 if the corresponding calls to \fBwadd_wch\fP return an error.
102 .PP
103 Functions with a \*(``mv\*('' prefix first perform a cursor movement using
104 \fBwmove\fP, and return an error if the position is outside the window,
105 or if the window pointer is null.
106 .SH NOTES
107 All of these functions except \fBwaddnwstr\fP may be macros.
108 .SH PORTABILITY
109 These functions are described in the XSI Curses standard, Issue 4.
110 .SH SEE ALSO
111 \fBcurses\fP(3X),
112 \fBcurs_addch\fP(3X),
113 \fBcurs_add_wch\fP(3X).