4 <!-- Manpage converted by man2html 3.0.1 -->
8 <B>getstr</B>, <B>getnstr</B>, <B>wgetstr</B>, <B>wgetnstr</B>, <B>mvgetstr</B>, <B>mvgetnstr</B>,
9 <B>mvwgetstr</B>, <B>mvwgetnstr</B> - accept character strings from
10 <B>curses</B> terminal keyboard
14 <H2>SYNOPSIS</H2><PRE>
15 <B>#include</B> <B><curses.h></B>
17 <B>int</B> <B>getstr(char</B> <B>*str);</B>
18 <B>int</B> <B>getnstr(char</B> <B>*str,</B> <B>int</B> <B>n);</B>
19 <B>int</B> <B>wgetstr(WINDOW</B> <B>*win,</B> <B>char</B> <B>*str);</B>
20 <B>int</B> <B>wgetnstr(WINDOW</B> <B>*win,</B> <B>char</B> <B>*str,</B> <B>int</B> <B>n);</B>
21 <B>int</B> <B>mvgetstr(int</B> <B>y,</B> <B>int</B> <B>x,</B> <B>char</B> <B>*str);</B>
22 <B>int</B> <B>mvwgetstr(WINDOW</B> <B>*win,</B> <B>int</B> <B>y,</B> <B>int</B> <B>x,</B> <B>char</B> <B>*str);</B>
23 <B>int</B> <B>mvgetnstr(int</B> <B>y,</B> <B>int</B> <B>x,</B> <B>char</B> <B>*str,</B> <B>int</B> <B>n);</B>
24 <B>int</B> <B>mvwgetnstr(WINDOW</B> <B>*,</B> <B>int</B> <B>y,</B> <B>int</B> <B>x,</B> <B>char</B> <B>*str,</B> <B>int</B> <B>n);</B>
28 <H2>DESCRIPTION</H2><PRE>
29 The function <B>getstr</B> is equivalent to a series of calls to
30 <B>getch</B>, until a newline or carriage return is received (the
31 terminating character is not included in the returned
32 string). The resulting value is placed in the area
33 pointed to by the character pointer <I>str</I>.
35 <B>wgetnstr</B> reads at most <I>n</I> characters, thus preventing a
36 possible overflow of the input buffer. Any attempt to
37 enter more characters (other than the terminating newline
38 or carriage return) causes a beep. Function keys also
39 cause a beep and are ignored. The <B>getnstr</B> function reads
40 from the <I>stdscr</I> default window.
42 The user's erase and kill characters are interpreted. If
43 keypad mode is on for the window, <B>KEY_LEFT</B> and
44 <B>KEY_BACKSPACE</B> are both considered equivalent to the user's
47 Characters input are echoed only if <B>echo</B> is currently on.
48 In that case, backspace is echoed as deletion of the pre-
49 vious character (typically a left motion).
53 <H2>RETURN VALUE</H2><PRE>
54 All routines return the integer <B>ERR</B> upon failure and an <B>OK</B>
55 (SVr4 specifies only "an integer value other than <B>ERR</B>")
56 upon successful completion.
61 Note that <B>getstr</B>, <B>mvgetstr</B>, and <B>mvwgetstr</B> may be macros.
65 <H2>PORTABILITY</H2><PRE>
66 These functions are described in the XSI Curses standard,
67 Issue 4. They read single-byte characters only. The
68 standard specifies that they return <B>ERR</B> on failure, but
69 the single error condition <B>EOVERFLOW</B> associated with
70 extended-level conformance is not yet returned (the XSI
71 curses support for multi-byte characters is not yet pre-
74 SVr3 and early SVr4 curses implementations did not reject
75 function keys; the SVr4.0 documentation claimed that "spe-
76 cial keys" (such as function keys, "home" key, "clear"
77 key, <I>etc</I>.) are interpreted" without giving details. It
78 lied. In fact, the `character' value appended to the
79 string by those implementations was predictable but not
80 useful (being, in fact, the low-order eight bits of the
83 The functions <B>getnstr</B>, <B>mvgetnstr</B>, and <B>mvwgetnstr</B> were pre-
84 sent but not documented in SVr4.
88 <H2>SEE ALSO</H2><PRE>
89 <B><A HREF="ncurses.3x.html">curses(3x)</A></B>, <B><A HREF="curs_getch.3x.html">curs_getch(3x)</A></B>.
130 Man(1) output converted with
131 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>