blob: eec361d77af95bbd0c2b6a8bd06433e3d4d9c9ec [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04002.\" Copyright 2018-2023,2024 Thomas E. Dickey *
3.\" Copyright 2002-2012,2017 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05304.\" *
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.\"
micky3879b9f5e72025-07-08 18:04:53 -040030.\" $Id: curs_inwstr.3x,v 1.41 2024/04/20 21:20:07 tom Exp $
31.TH curs_inwstr 3X 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "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.de bP
43.ie n .IP \(bu 4
44.el .IP \(bu 2
45..
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053046.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040047\fB\%inwstr\fP,
48\fB\%innwstr\fP,
49\fB\%winwstr\fP,
50\fB\%winnwstr\fP,
51\fB\%mvinwstr\fP,
52\fB\%mvinnwstr\fP,
53\fB\%mvwinwstr\fP,
54\fB\%mvwinnwstr\fP \-
55get a wide-character string from a \fIcurses\fR window
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053056.SH SYNOPSIS
57.nf
micky3879b9f5e72025-07-08 18:04:53 -040058\fB#include <curses.h>
59.PP
60\fBint inwstr(wchar_t *\fIwstr\fP);
61\fBint innwstr(wchar_t *\fIwstr\fP, int \fIn\fP);
62\fBint winwstr(WINDOW *\fIwin\fP, wchar_t *\fIwstr\fP);
63\fBint winnwstr(WINDOW *\fIwin\fP, wchar_t *\fIwstr\fP, int \fIn\fP);
64.PP
65\fBint mvinwstr(int \fIy\fP, int \fIx\fP, wchar_t *\fIwstr\fP);
66\fBint mvinnwstr(int \fIy\fP, int \fIx\fP, wchar_t *\fIwstr\fP, int \fIn\fP);
67\fBint mvwinwstr(WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, wchar_t *\fIwstr\fP);
68\fBint mvwinnwstr(WINDOW *\fIwin\fP, int \fIy\fP, int \fIx\fP, wchar_t *\fIwstr\fP, int \fIn\fP);
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053069.fi
70.SH DESCRIPTION
micky3879b9f5e72025-07-08 18:04:53 -040071These routines return a string of \fBwchar_t\fP wide characters in \fIwstr\fP,
72starting at the current cursor position in the named window.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053073.PP
micky3879b9f5e72025-07-08 18:04:53 -040074The four functions with \fIn\fP as the last argument return
75a leading substring at most \fIn\fP characters long
76(exclusive of the trailing NUL).
77Transfer stops at the end of the current line, or when \fIn\fP characters have
78been stored at the location referenced by \fIwstr\fP.
79.PP
80If the size \fIn\fP is not large enough to store a complete complex character,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053081an error is generated.
Steve Kondikae271bc2015-11-15 02:50:53 +010082.SH RETURN VALUE
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053083All routines return
micky3879b9f5e72025-07-08 18:04:53 -040084\fBERR\fP
85upon failure.
86Upon
87successful completion, the *\fBinwstr\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053088routines return
micky3879b9f5e72025-07-08 18:04:53 -040089\fBOK\fP, and the *\fBinnwstr\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053090routines return the
91number of characters read into the string.
Steve Kondikae271bc2015-11-15 02:50:53 +010092.PP
micky3879b9f5e72025-07-08 18:04:53 -040093X/Open defines no error conditions.
94This implementation returns an error
95.bP
96if the \fIwin\fP parameter is null or
97.bP
98if the \fIwstr\fP parameter is null, or
99.bP
100if no characters could be read.
101.PP
102Functions prefixed with \*(``mv\*('' first perform cursor movement and
103fail if the position
104.RI ( y ,
105.IR x )
106is outside the window boundaries.
107.SH NOTES
108All routines except
109\fBwinnwstr\fP
110may be macros.
111.PP
112Each cell in the window holds a complex character
113(a spacing character and zero or more non-spacing characters)
114together with attributes and color.
115These functions store only the wide characters,
116ignoring attributes and color.
117Use \fBin_wchstr\fP to return the complex characters from a window.
118.PP
119Reading a line that overflows the array pointed to by
120\fIwstr\fP
121with
122\fBinwstr\fP,
123\fBmvinwstr\fP,
124\fBmvwinwstr\fP
125or
126\fBwinwstr\fP
127causes undefined results.
128Therefore, the use of
129\fBinnwstr\fP,
130\fBmvinnwstr\fP,
131\fBmvwinnwstr\fP, or
132\fBwinnwstr\fP
133is recommended.
134.SH PORTABILITY
135These functions are described in X/Open Curses, Issue 4.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530136.SH SEE ALSO
micky3879b9f5e72025-07-08 18:04:53 -0400137\fB\%curses\fP(3X),
138\fB\%curs_inch\fP(3X),
139\fB\%curs_inchstr\fP(3X),
140\fB\%curs_instr\fP(3X),
141\fB\%curs_in_wchstr\fP(3X)