Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

curses(3)

curses_intro(3)

scanf(3)

wgetstr(3)

scanw(3)  —  Subroutines

NAME

scanw, mvscanw, mvwscanw, wscanw, vwscanw − Formatted read operation from a curses window

LIBRARY

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

SYNOPSIS

#include <curses.h>

int scanw( char ∗fmt [, arg] ... );

int wscanw(
    WINDOW ∗win,
    char ∗fmt [, arg] ... );

int mvscanw(
    int y,
    int x,
    char ∗fmt [, arg] ... );

int mvwscanw(
    WINDOW ∗win,
    int y,
    int x,
    char ∗fmt [, arg] ... );

#include <varargs.h>

int vwscanw(
    WINDOW ∗win,
    char ∗fmt,
    va_list varglist );

PARAMETERS

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. 

fmtSpecifies a string combining literal characters with conversion specifications.  Refer to the scanf(3) reference page for details about the format specification. 

argSpecifies a location for storing interpreted data. 

varglistSpecifies a variable list of locations for storing interpreted data. 

DESCRIPTION

These routines correspond to scanf(). 

The scanw function reads input from the default window. 

The wscanw function reads input from window win. 

The mvscanw function moves the cursor to position (y, x) and then reads input from the default window. 

The mvwscanw function moves the cursor to position (y, x) and then reads input from window win. 

For all functions, the routine wgetstr is called to get a string from the window, and the resulting line is used as input for the scan.  All character interpretation is carried out according to the scanf function rules. 

The function vwscanw reads input from window win by calling wscanw using the variable argument list varglist. 

RETURN VALUES

On successful completion, the scanw, mvscanw, mvwscanw, wscanw, and vwscanw functions return the number of items successfully matched.  On end-of-file, the functions return EOF.  Otherwise, they return ERR. 

RELATED INFORMATION

Functions: curses(3), curses_intro(3), scanf(3), wgetstr(3). 

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