Update ncurses to version 5.4.
[dragonfly.git] / lib / libncurses / man / curs_getstr.3
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-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_getstr.3x,v 1.12 2003/05/10 20:33:49 jmc Exp $
30 .\" $DragonFly: src/lib/libncurses/man/curs_getstr.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
31 .TH curs_getstr 3X ""
32 .SH NAME
33 \fBgetstr\fR,
34 \fBgetnstr\fR,
35 \fBwgetstr\fR,
36 \fBwgetnstr\fR,
37 \fBmvgetstr\fR,
38 \fBmvgetnstr\fR,
39 \fBmvwgetstr\fR,
40 \fBmvwgetnstr\fR - accept character strings from \fBcurses\fR terminal keyboard
41 .SH SYNOPSIS
42 \fB#include <curses.h>\fR
43
44 \fBint getstr(char *str);\fR
45 .br
46 \fBint getnstr(char *str, int n);\fR
47 .br
48 \fBint wgetstr(WINDOW *win, char *str);\fR
49 .br
50 \fBint wgetnstr(WINDOW *win, char *str, int n);\fR
51 .br
52 \fBint mvgetstr(int y, int x, char *str);\fR
53 .br
54 \fBint mvwgetstr(WINDOW *win, int y, int x, char *str);\fR
55 .br
56 \fBint mvgetnstr(int y, int x, char *str, int n);\fR
57 .br
58 \fBint mvwgetnstr(WINDOW *, int y, int x, char *str, int n);\fR
59 .br
60 .SH DESCRIPTION
61 The function \fBgetstr\fR is equivalent to a series of calls to \fBgetch\fR,
62 until a newline or carriage return is received (the terminating character is
63 not included in the returned string).  The resulting value is placed in the
64 area pointed to by the character pointer \fIstr\fR.
65
66 \fBwgetnstr\fR reads at most \fIn\fR characters, thus preventing a possible
67 overflow of the input buffer.  Any attempt to enter more characters (other
68 than the terminating newline or carriage return) causes a beep.  Function
69 keys also cause a beep and are ignored.  The \fBgetnstr\fR function reads
70 from the \fIstdscr\fR default window.
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 .SH RETURN VALUE
80 All routines return the integer \fBERR\fR upon failure and an \fBOK\fR (SVr4
81 specifies only "an integer value other than \fBERR\fR") upon successful
82 completion.
83 .SH NOTES
84 Note that \fBgetstr\fR, \fBmvgetstr\fR, and \fBmvwgetstr\fR may be macros.
85 .SH PORTABILITY
86 These functions are described in the XSI Curses standard, Issue 4.
87 They read single-byte characters only.
88 The standard does not define any error conditions.
89 This implementation returns ERR if the window pointer is null,
90 or if the lower-level \fBwgetch\fR call returns an ERR.
91
92 SVr3 and early SVr4 curses implementations did not reject function keys;
93 the SVr4.0 documentation claimed that "special keys" (such as function
94 keys, "home" key, "clear" key, \fIetc\fR.) are "interpreted", without
95 giving details.  It lied.  In fact, the `character' value appended to the
96 string by those implementations was predictable but not useful
97 (being, in fact, the low-order eight bits of the key's KEY_ value).
98
99 The functions \fBgetnstr\fR, \fBmvgetnstr\fR, and \fBmvwgetnstr\fR were
100 present but not documented in SVr4.
101 .SH SEE ALSO
102 \fBcurses\fR(3X), \fBcurs_getch\fR(3X).
103 .\"#
104 .\"# The following sets edit modes for GNU EMACS
105 .\"# Local Variables:
106 .\"# mode:nroff
107 .\"# fill-column:79
108 .\"# End: