summaryrefslogtreecommitdiffstats
path: root/lib/libncurses/curs_getstr.3
blob: 91d934baa8aead0d9c94faa84556d87f40fa73c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
.TH curs_getstr 3 ""
.SH NAME
\fBgetstr\fR, \fBwgetstr\fR, \fBmvgetstr\fR,
\fBmvwgetstr\fR, 
\fBwgetnstr\fR - accept character strings from \fBncurses\fR terminal keyboard
.SH SYNOPSIS
\fB#include <ncurses.h>\fR

\fBint getstr(char *str);\fR
.br
\fBint wgetstr(WINDOW *win, char *str);\fR
.br
\fBint mvgetstr(int y, int x, char *str);\fR
.br
\fBint mvwgetstr(WINDOW *win, int y, int x, char *str);\fR
.br
\fBint wgetnstr(WINDOW *win, char *str, int n);\fR
.br
.SH DESCRIPTION
The function \fBgetstr\fR is equivalent to a series of calls to \fBgetch\fR,
until a newline or carriage return is received (the terminating character is
not included in the returned string).  The resulting value is placed in the
area pointed to by the character pointer \fIstr\fR.

\fBwgetnstr\fR reads at most \fIn\fR characters, thus preventing a possible
overflow of the input buffer.  Any attempt to enter more characters (other
than the terminating newline or carriage return) causes a beep.

The user's erase and kill characters are interpreted.  If keypad
mode is on for the window, \fBKEY_LEFT\fR and \fBKEY_BACKSPACE\fR
are both considered equivalent to the user's kill character.
.SH RETURN VALUE
All routines return the integer \fBERR\fR upon failure and an integer value
other than \fBERR\fR upon successful completion.
.SH BUGS
When the window is in keypad mode and the user types any special key
other than those named above, the `character' value appended to the
string by the ncurses implementation is predictable but not useful
(being, in fact, the low-order eight bits of the key's KEY_ value).

The SVr4.0 documentation claims that "special keys (such as function
keys, "home" key, "clear" key, \fIetc\fR.) are interpreted" without
giving details.  It lies.  The actual behavior is like that of ncurses.
.SH NOTES
Note that \fBgetstr\fR, \fBmvgetstr\fR, and \fBmvwgetstr\fR may be macros.
.SH SEE ALSO
\fBncurses\fR(3), \fBcurs_getch\fR(3).
.\"#
.\"# The following sets edit modes for GNU EMACS
.\"# Local Variables:
.\"# mode:nroff
.\"# fill-column:79
.\"# End:
OpenPOWER on IntegriCloud