1 .\"***************************************************************************
2 .\" Copyright 2018-2023,2024 Thomas E. Dickey *
3 .\" Copyright 2002-2012,2017 Free Software Foundation, Inc. *
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: *
13 .\" The above copyright notice and this permission notice shall be included *
14 .\" in all copies or substantial portions of the Software. *
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. *
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 *
28 .\"***************************************************************************
30 .\" $Id: curs_inwstr.3x,v 1.45 2024/06/08 21:19:18 tom Exp $
31 .TH curs_inwstr 3X 2024-06-08 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
55 get a wide-character string from a \fIcurses\fR window
58 \fB#include <curses.h>
60 \fBint inwstr(wchar_t *\ \fIwstr\fP);
61 \fBint winwstr(WINDOW *\ \fIwin\fP, wchar_t *\ \fIwstr\fP);
62 \fBint mvinwstr(int \fIy\fP, int \fIx\fP, wchar_t *\ \fIwstr\fP);
63 \fBint mvwinwstr(WINDOW *\ \fIwin\fP, int \fIy\fP, int \fIx\fP, wchar_t *\ \fIwstr\fP);
65 \fBint innwstr(wchar_t *\ \fIwstr\fP, int \fIn\fP);
66 \fBint winnwstr(WINDOW *\ \fIwin\fP, wchar_t *\ \fIwstr\fP, int \fIn\fP);
67 \fBint mvinnwstr(int \fIy\fP, int \fIx\fP, wchar_t *\ \fIwstr\fP, int \fIn\fP);
68 \fBint mvwinnwstr(WINDOW *\ \fIwin\fP, int \fIy\fP, int \fIx\fP, wchar_t *\ \fIwstr\fP, int \fIn\fP);
72 extracts a wide-character string from a
76 starting at the cursor and stopping at the end of the line,
79 terminating it with a wide null character
81 omitting any attributes and color pair identifier
84 associates with each character.
99 \fB\%ncurses\fP(3X) describes the variants of these functions.
101 On successful operation,
102 these functions return the count of wide characters copied from
118 is insufficiently large to store a complete wide character string.
121 complex character can contain multiple wide characters,
122 some of which may be non-spacing.)
126 these functions return
139 Functions prefixed with \*(``mv\*('' first perform cursor movement and
143 is outside the window boundaries.
145 All of these functions except
147 may be implemented as macros.
149 Reading a line that overflows the array pointed to by
157 causes undefined results.
164 is recommended instead.
170 .BR \%mvwinnwstr "'s"
179 Applications employing
181 extensions should condition their use on the visibility of the
186 Issue 4 describes these functions.
187 It specifies no error conditions for them.
189 Notwithstanding the foregoing,
190 X/Open Curses Issues 4 and 7 both state that
196 \*(``fail .\|.\|. [i]f the array is not large enough to contain any
197 complete characters\*(''.
198 Strictly interpreted,
199 this means that a caller of these functions cannot use their return
200 values to detect truncation of a wide-character string copied from more
201 than one character cell in
204 reports any truncation with
207 X/Open Curses specifies
215 rather than a (wide) character count,
216 unlike their non-wide counterparts
223 regards this inconsistency as an error in the standard.
225 \fB\%curs_instr\fP(3X) describes comparable functions of the
227 library in its non-wide-character configuration.
230 \fB\%curs_in_wch\fP(3X),
231 \fB\%curs_in_wchstr\fP(3X)