freebsd-skq/lib/libncurses/curs_getstr.3

54 lines
2.0 KiB
Groff

.TH curs_getstr 3X ""
.SH NAME
\fBcurs_getstr\fR: \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(3X), \fBcurs_getch\fR(3X).
.\"#
.\"# The following sets edit modes for GNU EMACS
.\"# Local Variables:
.\"# mode:nroff
.\"# fill-column:79
.\"# End: