scanw(3cur)
Name
scanw, mvscanw, mvwscanw, wscanw − formatted read from window
Syntax
#include <cursesX.h>
int scanw(fmt [, arg] ...)
char ∗fmt;
int wscanw(win, fmt [, arg] ...)
WINDOW ∗win;
char ∗fmt;
int mvscanw(y, x, fmt [, arg] ...)
int y, x;
char ∗fmt;
int mvwscanw(win, y, x, fmt [, arg] ...)
WINDOW ∗win;
int y, x;
char ∗fmt;
Description
These routines correspond to scanf. The function scanw reads input from the default window. The function wscanw reads input from the specified window. The function mvscanw moves the cursor to the specified position and then reads input from the default window. The function mvwscanw moves the cursor to the specified position and then reads input from the specified window.
For all the 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.
Return Value
Upon successful completion, the scanw, mvscanw, mvwscanw and wscanw functions return the number of items successfully matched. On end-of-file, they return EOF. Otherwise they return ERR.
Errors
No errors are defined for these functions.