]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_get_wstr.3x
86a5b82a11fc869af7f1b9360306d0a5afe3b72d
[ncurses.git] / man / curs_get_wstr.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 2002,2003 Free Software Foundation, Inc.                   *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_get_wstr.3x,v 1.3 2003/07/05 11:15:28 tom Exp $
30 .TH curs_get_wstr 3X ""
31 .SH NAME
32 \fBget_wstr\fR,
33 \fBgetn_wstr\fR,
34 \fBwget_wstr\fR,
35 \fBwgetn_wstr\fR,
36 \fBmvget_wstr\fR,
37 \fBmvgetn_wstr\fR,
38 \fBmvwget_wstr\fR,
39 \fBmvwgetn_wstr\fR \- get an array of wide characters from a curses terminal keyboard
40 .SH SYNOPSIS
41 .nf
42 \fB#include <curses.h>\fR
43
44 \fBint get_wstr(wint_t *\fR\fIwstr\fR\fB);\fR
45 .br
46 \fBint getn_wstr(wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR
47 .br
48 \fBint wget_wstr(WINDOW *\fR\fIwin\fR\fB, wint_t *\fR\fIwstr\fR\fB);\fR
49 .br
50 \fBint wgetn_wstr(WINDOW *\fR\fIwin\fR\fB, wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR
51 .br
52 \fBint mvget_wstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB);\fR
53 .br
54 \fBint mvgetn_wstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR
55 .br
56 \fBint mvwget_wstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB);\fR
57 .br
58 \fBint mvwgetn_wstr(WINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR
59 .fi
60 .SH DESCRIPTION
61 The effect of
62 \fBget_wstr\fR
63 is as though a series of calls
64 to
65 \fBget_wch\fR
66 were made, until a newline, other end-of-line, or end-of-file condition is processed.
67 An end-of-file condition is represented by \fBWEOF\fR, as defined in \fB<wchar.h>\fR.
68 The newline and end-of-line conditions are represented by the \fB\\n\fR \fBwchar_t\fR value.
69 In all instances, the end of the string is terminated by a null \fBwchar_t\fR.
70 The routine places resulting values in the area pointed to by \fIwstr\fR.
71
72 The user's erase and kill characters are interpreted.  If keypad
73 mode is on for the window, \fBKEY_LEFT\fR and \fBKEY_BACKSPACE\fR
74 are both considered equivalent to the user's kill character.
75
76 Characters input are echoed only if \fBecho\fR is currently on.  In that case,
77 backspace is echoed as deletion of the previous character (typically a left
78 motion).
79
80 The effect of
81 \fBwget_wstr\fR
82 is as though a series of
83 calls to
84 \fBwget_wch\fR
85 were made.
86
87 The effect of
88 \fBmvget_wstr\fR
89 is as though a call to
90 \fBmove\fR
91 and then a series of calls to
92 \fBget_wch\fR
93 were
94 made.
95
96 The effect of
97 \fBmvwget_wstr\fR
98 is as though a call to
99 \fBwmove\fR
100 and then a series of calls to
101 \fBwget_wch\fR
102 were made.
103
104 The
105 \fBgetn_wstr\fR,
106 \fBmvgetn_wstr\fR,
107 \fBmvwgetn_wstr\fR, and
108 \fBwgetn_wstr\fR
109 functions are identical
110 to the
111 \fBget_wstr\fR,
112 \fBmvget_wstr\fR,
113 \fBmvwget_wstr\fR, and
114 \fBwget_wstr\fR
115 functions, respectively,
116 except that the
117 \fB*n_*\fR
118 versions read at most
119 \fIn\fR
120 characters, letting the application prevent overflow of the
121 input buffer.
122 .SH NOTES
123 Using
124 \fBget_wstr\fR,
125 \fBmvget_wstr\fR,
126 \fBmvwget_wstr\fR, or
127 \fBwget_wstr\fR
128 to read a line that
129 overflows the array pointed to by
130 \fBwstr\fR
131 causes undefined
132 results.
133 The use of
134 \fBgetn_wstr\fR,
135 \fBmvgetn_wstr\fR,
136 \fBmvwgetn_wstr\fR, or
137 \fBwgetn_wstr\fR, respectively, is recommended.
138
139 These functions cannot return \fBKEY_\fR values because there
140 is no way to distinguish a \fBKEY_\fR value from a valid \fBwchar_t\fR value.
141
142 All of these routines except \fBwgetn_wstr\fR may be macros.
143 .SH RETURN VALUES
144 All of these functions return \fBOK\fR upon successful completion.
145 Otherwise, they return \fBERR\fR.
146 .SH PORTABILITY
147 These functions are described in The Single Unix Specification, Version 2.
148 No error conditions are defined.
149 This implementation returns ERR if the window pointer is null,
150 or if the lower-level \fBwget_wch\fR call returns an ERR.
151 In the latter case,
152 an ERR return without other data is treated as an end-of-file condition,
153 and the returned array contains a \fBWEOF\fR followed by a null \fBwchar_t\fR.
154 .PP
155 X/Open curses documents these functions to pass an array of \fBwchar_t\fR,
156 but all of the vendors implement this using \fBwint_t\fR.
157 .SH SEE ALSO
158 Functions:
159 \fBcurses\fR(3X),
160 \fBcurs_get_wch\fR(3X),
161 \fBcurs_getstr\fR(3X).
162 .\"#
163 .\"# The following sets edit modes for GNU EMACS
164 .\"# Local Variables:
165 .\"# mode:nroff
166 .\"# fill-column:79
167 .\"# End: