]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libncurses/curs_getstr.3
wscrl: implement partial scrolling via al/dl
[FreeBSD/FreeBSD.git] / lib / libncurses / curs_getstr.3
1 .TH curs_getstr 3X ""
2 .SH NAME
3 \fBcurs_getstr\fR: \fBgetstr\fR, \fBwgetstr\fR, \fBmvgetstr\fR,
4 \fBmvwgetstr\fR, \fBwgetnstr\fR - accept character strings from
5 \fBncurses\fR terminal keyboard
6 .SH SYNOPSIS
7 \fB#include <ncurses.h>\fR
8
9 \fBint getstr(char *str);\fR
10 .br
11 \fBint wgetstr(WINDOW *win, char *str);\fR
12 .br
13 \fBint mvgetstr(int y, int x, char *str);\fR
14 .br
15 \fBint mvwgetstr(WINDOW *win, int y, int x, char *str);\fR
16 .br
17 \fBint wgetnstr(WINDOW *win, char *str, int n);\fR
18 .br
19 .SH DESCRIPTION
20 The function \fBgetstr\fR is equivalent to a series of calls to \fBgetch\fR,
21 until a newline or carriage return is received (the terminating character is
22 not included in the returned string).  The resulting value is placed in the
23 area pointed to by the character pointer \fIstr\fR.
24
25 \fBwgetnstr\fR reads at most \fIn\fR characters, thus preventing a possible
26 overflow of the input buffer.  Any attempt to enter more characters (other
27 than the terminating newline or carriage return) causes a beep.
28
29 The user's erase and kill characters are interpreted.  If keypad
30 mode is on for the window, \fBKEY_LEFT\fR and \fBKEY_BACKSPACE\fR
31 are both considered equivalent to the user's kill character.
32 .SH RETURN VALUE
33 All routines return the integer \fBERR\fR upon failure and an integer value
34 other than \fBERR\fR upon successful completion.
35 .SH BUGS
36 When the window is in keypad mode and the user types any special key
37 other than those named above, the `character' value appended to the
38 string by the ncurses implementation is predictable but not useful
39 (being, in fact, the low-order eight bits of the key's KEY_ value).
40
41 The SVr4.0 documentation claims that "special keys (such as function
42 keys, "home" key, "clear" key, \fIetc\fR.) are interpreted" without
43 giving details.  It lies.  The actual behavior is like that of ncurses.
44 .SH NOTES
45 Note that \fBgetstr\fR, \fBmvgetstr\fR, and \fBmvwgetstr\fR may be macros.
46 .SH SEE ALSO
47 \fBncurses\fR(3X), \fBcurs_getch\fR(3X).
48 .\"#
49 .\"# The following sets edit modes for GNU EMACS
50 .\"# Local Variables:
51 .\"# mode:nroff
52 .\"# fill-column:79
53 .\"# End: