Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > G

getstr(3X)

CURSES
HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

getstr, mvgetstr, mvwgetstr, wgetstr — get a multi-byte character string from the terminal

SYNOPSIS

#include <curses.h>

int getstr(char *str);

int mvgetstr(int y, int x, char *str);

int mvwgetstr(WINDOW *win, int y, int x, char *str);

int wgetstr(WINDOW *win, char *str);

DESCRIPTION

The effect of getstr() is as though a series of calls to getch() were made, until a newline or carriage return is received. The resulting value is placed in the area pointed to by str. The user's erase and kill characters are interpreted, as well as any special keys (such as function keys, home key, clear key, and so on).

The mvgetstr() function is identical to getstr() except that it is as though it is a call to move() and then a series of calls to getch(). The mvwgetstr() function is identical to getstr() except it is as though a call to wmove() is made and then a series of calls to wgetch().

RETURN VALUE

Upon successful completion, these functions return OK. Otherwise, they return ERR.

ERRORS

No errors are defined.

APPLICATION USAGE

Reading a line that overflows the array pointed to by str with getstr(), mvgetstr(), mvwgetstr() or wgetstr() causes undefined results.

Traditional implementations often limited the number of bytes returned to 256.

SEE ALSO

beep(3X), getch(3X), getnstr(3X), curses_intro(3X), see Input Processing, <curses.h>.

CHANGE HISTORY

First released in X/Open Curses, Issue 2.

Issue 3

In X/Open Curses, Issue 3, the getstr(), mvgetstr(), mvwgetstr() and wgetstr() functions were described in the addstr() entry. In X/Open Curses, Issue 4, the DESCRIPTION of these functions is rewritten for clarity and is updated to indicate that they will handle multi-byte sequences correctly.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.