getstr(3cur)
NAME
getstr, mvgetstr, mvwgetstr, wgetstr − read string
SYNTAX
getstr(str)
char ∗str;
wgetstr(win, str)
WINDOW ∗win;
char ∗str;
mvgetstr(y, x, str)
int y, x;
char ∗str;
mvwgetstr(win, y, x, str)
WINDOW ∗win;
int y, x;
char ∗str;
DESCRIPTION
The getstr routine reads characters from the terminal associated with the default window and stores them in a buffer until a carriage return or newline is received from stdscr. The routine getch is called by getstr to read each character.
The routine wgetstr reads characters from the terminal associated with the specified window. The characters are read from the current cursor position until a newline or carriage return is received.
The routine mvgetstr reads characters from the terminal associated with the default window. The characters are read from the specified cursor position until a newline or carriage return is received.
The routine mvwgetstr reads characters from the terminal associated with the specified window. The characters are read from the specified cursor position until a newline or carriage return is received.
The following information applies to all the routines.
The resulting string is placed in the area pointed to by the character pointer str. The user’s erase and kill characters are interpreted. The area used to hold the string is assumed to be large enough to handle it, as getstr does not check for buffer overflow. If the area is not large enough, the result will be unpredictable.
The routines getstr, mvgetstr and mvwgetstr are macros.
SEE ALSO
Subroutines