Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getwch(3)

getwstr(3)  —  Subroutines

NAME

getwstr, getnwstr, mvgetwstr, mvgetnwstr, mvwgetwstr, mvwgetnwstr, wgetwstr, wgetnwstr  − Read wchar_t character strings from curses terminal keyboard

LIBRARY

The curses library (libcurses.so, libcurses.a)

SYNOPSIS

#include <curses.h>

int getwstr( wchar_t ∗wstr );

int getnwstr(
        wchar_t ∗wstr,
        int n );

int mvgetwstr(
        int y,
        int x,
        wchar_t ∗wstr );

int mvgetnwstr(
        int y,
        int x,
        wchar_t ∗wstr,
        int n );

int mvwgetwstr(
        WINDOW ∗win,
        int y,
        int x,
        wchar_t ∗wstr );

int mvwgetnwstr(
        WINDOW ∗win,
        int y,
        int x,
        wchar_t ∗wstr,
        int n );

int wgetwstr(
        WINDOW ∗win,
        wchar_t ∗wstr );

int wgetnwstr(
        WINDOW ∗win,
        wchar_t ∗wstr,
        int n );

PARAMETERS

wstrSpecifies a pointer to the buffer for the wide-character string. 

winSpecifies a curses window. If not specified, the window is the default window stdscr. 

y, xSpecifies the line (y) and column (x) coordinates of the target position on the window.  If coordinates are not specified, the target position is the current position of the logical cursor. 

nSpecifies the maximum number of wide characters in the string. 

DESCRIPTION

The following information applies to all routines:

       •Each character read from the terminal is converted to a wchar_t character and the resulting wchar_t character string is placed in the buffer pointed to by the wchar_t character pointer wstr. 

       •The user’s erase and kill characters are interpreted. 

The getwstr routine reads wchar_t 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 getnwstr routine reads at most n wchar_t 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 mvgetwstr routine reads wchar_t characters from the terminal associated with the default window.  The characters are read from the specified cursor position (y, x) until a newline or carriage return is received. 

The mvgetnwstr routine reads at most n wchar_t characters from the terminal associated with the default window.  The characters are read from the specified cursor position (y, x) until a newline or carriage return is received. 

The mvwgetwstr routine reads wchar_t characters from the terminal associated with the window win.  The characters are read from the specified cursor position (y, x) until a newline or carriage return is received. 

The mvwgetnwstr routine reads at most n wchar_t characters from the terminal associated with the window win.  The characters are read from the specified cursor position (y, x) until a newline or carriage return is received. 

The wgetwstr routine reads wchar_t characters from the terminal associated with the window win.  The characters are read from the current cursor position until a newline or carriage return is received. 

The wgetnwstr routine reads at most n wchar_t characters from the terminal associated with the window win.  Characters are read from the current cursor position until a newline or carriage return is received; wgetnwstr() calls wgetwch() to read each character.  The wgetnwstr routine does not check for buffer overflow, so make sure that the buffer specified by wstr is large enough to hold the string.  If the buffer is not large enough, the result is unpredictable. 

The getwstr, getnwstr, mvgetwstr, mvgetnwstr, mvwgetwstr, mvwgetnwstr, and wgetwstr routines are macros. 

RETURN VALUES

The getwstr, getnwstr, mvgetwstr, mvgetnwstr, mvwgetwstr, mvwgetnwstr, wgetwstr, and wgetnwstr functions return OK on success and ERR on error. 

RELATED INFORMATION

Functions: getwch(3). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026