1curs_getstr(3CURSES) Curses Library Functions curs_getstr(3CURSES)
2
3
4
6 curs_getstr, getstr, wgetstr, mvgetstr, mvwgetstr, wgetnstr - get char‐
7 acter strings from curses terminal keyboard
8
10 cc [ flag ... ] file ... -lcurses [ library ... ]
11 #include <curses.h>
12
13 int getstr(char *str);
14
15
16 int wgetstr(WINDOW *win, char *str);
17
18
19 int mvgetstr(int y, int x, char *str);
20
21
22 int mvwgetstr(WINDOW *win, int y, int x, char *str);
23
24
25 int wgetnstr(WINDOW *win, char *str, int n);
26
27
29 The effect of getstr() is as though a series of calls to getch() were
30 made, until a newline or carriage return is received. The resulting
31 value is placed in the area pointed to by the character pointer str.
32 wgetnstr() reads at most n characters, thus preventing a possible over‐
33 flow of the input buffer. The user's erase and kill characters are
34 interpreted, as well as any special keys (such as function keys, HOME
35 key, and CLEAR key.)
36
38 All routines return the integer ERR upon failure and an integer value
39 other than ERR upon successful completion.
40
42 See attributes(5) for descriptions of the following attributes:
43
44
45
46
47 ┌─────────────────────────────┬─────────────────────────────┐
48 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
49 ├─────────────────────────────┼─────────────────────────────┤
50 │MT-Level │Unsafe │
51 └─────────────────────────────┴─────────────────────────────┘
52
54 curs_getch(3CURSES), curses(3CURSES), attributes(5)
55
57 The header <curses.h> automatically includes the headers <stdio.h> and
58 <unctrl.h>.
59
60
61 Note that getstr(), mvgetstr(), and mvwgetstr() may be macros.
62
63
64
65SunOS 5.11 31 Dec 1996 curs_getstr(3CURSES)