854fd9e5c2d114e03a680f8db0ab4ce01baa596d
[dragonfly.git] / lib / libncurses / man / curs_get_wstr.3
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 .\" $DragonFly: src/lib/libncurses/man/curs_get_wstr.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
31 .TH curs_get_wstr 3X ""
32 .SH NAME
33 \fBget_wstr\fR,
34 \fBgetn_wstr\fR,
35 \fBwget_wstr\fR,
36 \fBwgetn_wstr\fR,
37 \fBmvget_wstr\fR,
38 \fBmvgetn_wstr\fR,
39 \fBmvwget_wstr\fR,
40 \fBmvwgetn_wstr\fR \- get an array of wide characters from a curses terminal keyboard
41 .SH SYNOPSIS
42 .nf
43 \fB#include <curses.h>\fR
44
45 \fBint get_wstr(wint_t *\fR\fIwstr\fR\fB);\fR
46 .br
47 \fBint getn_wstr(wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR
48 .br
49 \fBint wget_wstr(WINDOW *\fR\fIwin\fR\fB, wint_t *\fR\fIwstr\fR\fB);\fR
50 .br
51 \fBint wgetn_wstr(WINDOW *\fR\fIwin\fR\fB, wint_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR
52 .br
53 \fBint mvget_wstr(int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wint_t *\fR\fIwstr\fR\fB);\fR
54 .br
55 \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
56 .br
57 \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
58 .br
59 \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
60 .fi
61 .SH DESCRIPTION
62 The effect of
63 \fBget_wstr\fR
64 is as though a series of calls
65 to
66 \fBget_wch\fR
67 were made, until a newline, other end-of-line, or end-of-file condition is processed.
68 An end-of-file condition is represented by \fBWEOF\fR, as defined in \fB<wchar.h>\fR.
69 The newline and end-of-line conditions are represented by the \fB\\n\fR \fBwchar_t\fR value.
70 In all instances, the end of the string is terminated by a null \fBwchar_t\fR.
71 The routine places resulting values in the area pointed to by \fIwstr\fR.
72
73 The user's erase and kill characters are interpreted.  If keypad
74 mode is on for the window, \fBKEY_LEFT\fR and \fBKEY_BACKSPACE\fR
75 are both considered equivalent to the user's kill character.
76
77 Characters input are echoed only if \fBecho\fR is currently on.  In that case,
78 backspace is echoed as deletion of the previous character (typically a left
79 motion).
80
81 The effect of
82 \fBwget_wstr\fR
83 is as though a series of
84 calls to
85 \fBwget_wch\fR
86 were made.
87
88 The effect of
89 \fBmvget_wstr\fR
90 is as though a call to
91 \fBmove\fR
92 and then a series of calls to
93 \fBget_wch\fR
94 were
95 made.
96
97 The effect of
98 \fBmvwget_wstr\fR
99 is as though a call to
100 \fBwmove\fR
101 and then a series of calls to
102 \fBwget_wch\fR
103 were made.
104
105 The
106 \fBgetn_wstr\fR,
107 \fBmvgetn_wstr\fR,
108 \fBmvwgetn_wstr\fR, and
109 \fBwgetn_wstr\fR
110 functions are identical
111 to the
112 \fBget_wstr\fR,
113 \fBmvget_wstr\fR,
114 \fBmvwget_wstr\fR, and
115 \fBwget_wstr\fR
116 functions, respectively,
117 except that the
118 \fB*n_*\fR
119 versions read at most
120 \fIn\fR
121 characters, letting the application prevent overflow of the
122 input buffer.
123 .SH NOTES
124 Using
125 \fBget_wstr\fR,
126 \fBmvget_wstr\fR,
127 \fBmvwget_wstr\fR, or
128 \fBwget_wstr\fR
129 to read a line that
130 overflows the array pointed to by
131 \fBwstr\fR
132 causes undefined
133 results.
134 The use of
135 \fBgetn_wstr\fR,
136 \fBmvgetn_wstr\fR,
137 \fBmvwgetn_wstr\fR, or
138 \fBwgetn_wstr\fR, respectively, is recommended.
139
140 These functions cannot return \fBKEY_\fR values because there
141 is no way to distinguish a \fBKEY_\fR value from a valid \fBwchar_t\fR value.
142
143 All of these routines except \fBwgetn_wstr\fR may be macros.
144 .SH RETURN VALUES
145 All of these functions return \fBOK\fR upon successful completion.
146 Otherwise, they return \fBERR\fR.
147 .SH PORTABILITY
148 These functions are described in The Single Unix Specification, Version 2.
149 No error conditions are defined.
150 This implementation returns ERR if the window pointer is null,
151 or if the lower-level \fBwget_wch\fR call returns an ERR.
152 In the latter case,
153 an ERR return without other data is treated as an end-of-file condition,
154 and the returned array contains a \fBWEOF\fR followed by a null \fBwchar_t\fR.
155 .PP
156 X/Open curses documents these functions to pass an array of \fBwchar_t\fR,
157 but all of the vendors implement this using \fBwint_t\fR.
158 .SH SEE ALSO
159 Functions:
160 \fBcurses\fR(3X),
161 \fBcurs_get_wch\fR(3X),
162 \fBcurs_getstr\fR(3X).
163 .\"#
164 .\"# The following sets edit modes for GNU EMACS
165 .\"# Local Variables:
166 .\"# mode:nroff
167 .\"# fill-column:79
168 .\"# End: