1curs_get_wstr(3X) curs_get_wstr(3X)
2
3
4
6 get_wstr, getn_wstr, wget_wstr, wgetn_wstr, mvget_wstr, mvgetn_wstr,
7 mvwget_wstr, mvwgetn_wstr - get an array of wide characters from a
8 curses terminal keyboard
9
11 #include <curses.h>
12
13 int get_wstr(wint_t *wstr);
14 int getn_wstr(wint_t *wstr, int n);
15 int wget_wstr(WINDOW *win, wint_t *wstr);
16 int wgetn_wstr(WINDOW *win, wint_t *wstr, int n);
17 int mvget_wstr(int y, int x, wint_t *wstr);
18 int mvgetn_wstr(int y, int x, wint_t *wstr, int n);
19 int mvwget_wstr(WINDOW *win, int y, int x, wint_t *wstr);
20 int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n);
21
23 The effect of get_wstr is as though a series of calls to get_wch were
24 made, until a newline, other end-of-line, or end-of-file condition is
25 processed. An end-of-file condition is represented by WEOF, as defined
26 in <wchar.h>. The newline and end-of-line conditions are represented
27 by the \n wchar_t value. In all instances, the end of the string is
28 terminated by a null wchar_t. The routine places resulting values in
29 the area pointed to by wstr.
30
31 The user's erase and kill characters are interpreted. If keypad mode
32 is on for the window, KEY_LEFT and KEY_BACKSPACE are both considered
33 equivalent to the user's kill character.
34
35 Characters input are echoed only if echo is currently on. In that
36 case, backspace is echoed as deletion of the previous character (typi‐
37 cally a left motion).
38
39 The effect of wget_wstr is as though a series of calls to wget_wch were
40 made.
41
42 The effect of mvget_wstr is as though a call to move and then a series
43 of calls to get_wch were made.
44
45 The effect of mvwget_wstr is as though a call to wmove and then a se‐
46 ries of calls to wget_wch were made.
47
48 The getn_wstr, mvgetn_wstr, mvwgetn_wstr, and wgetn_wstr functions are
49 identical to the get_wstr, mvget_wstr, mvwget_wstr, and wget_wstr func‐
50 tions, respectively, except that the *n_* versions read at most n char‐
51 acters, letting the application prevent overflow of the input buffer.
52
54 Using get_wstr, mvget_wstr, mvwget_wstr, or wget_wstr to read a line
55 that overflows the array pointed to by wstr causes undefined results.
56 The use of getn_wstr, mvgetn_wstr, mvwgetn_wstr, or wgetn_wstr, respec‐
57 tively, is recommended.
58
59 These functions cannot return KEY_ values because there is no way to
60 distinguish a KEY_ value from a valid wchar_t value.
61
62 All of these routines except wgetn_wstr may be macros.
63
65 All of these functions return OK upon successful completion. Other‐
66 wise, they return ERR.
67
68 Functions using a window parameter return an error if it is null.
69
70 wgetn_wstr
71 returns an error if the associated call to wget_wch failed.
72
74 These functions are described in The Single Unix Specification, Version
75 2. No error conditions are defined. This implementation returns ERR
76 if the window pointer is null, or if the lower-level wget_wch call re‐
77 turns an ERR. In the latter case, an ERR return without other data is
78 treated as an end-of-file condition, and the returned array contains a
79 WEOF followed by a null wchar_t.
80
81 X/Open curses documents these functions to pass an array of wchar_t,
82 but all of the vendors implement this using wint_t.
83
85 Functions: curses(3X), curs_get_wch(3X), curs_getstr(3X).
86
87
88
89 curs_get_wstr(3X)