2 /***************************************************************************
4 ****************************************************************************
5 * ncurses is copyright (C) 1992-1995 *
7 * zmbenhal@netcom.com *
9 * esr@snark.thyrsus.com *
11 * Permission is hereby granted to reproduce and distribute ncurses *
12 * by any means and for any fee, whether alone or as part of a *
13 * larger distribution, in source or in binary form, PROVIDED *
14 * this notice is included with any such distribution, and is not *
15 * removed from any of its header files. Mention of ncurses in any *
16 * applications linked with it is highly appreciated. *
18 * ncurses comes AS IS with no warranty, implied or expressed. *
20 ***************************************************************************/
27 ** The routines scanw(), wscanw() and friends.
31 #include <curses.priv.h>
33 MODULE_ID("$Id: lib_scanw.c,v 1.4 1997/02/08 14:45:51 tom Exp $")
36 extern int vsscanf(const char *str, const char *format, ...);
39 int vwscanw(WINDOW *win, const char *fmt, va_list argp)
43 if (wgetstr(win, buf) == ERR)
46 return(vsscanf(buf, fmt, argp));
49 int scanw(const char *fmt, ...)
54 T(("scanw(\"%s\",...) called", fmt));
57 code = vwscanw(stdscr, fmt, ap);
62 int wscanw(WINDOW *win, const char *fmt, ...)
67 T(("wscanw(%p,\"%s\",...) called", win, fmt));
70 code = vwscanw(win, fmt, ap);
75 int mvscanw(int y, int x, const char *fmt, ...)
81 code = (move(y, x) == OK) ? vwscanw(stdscr, fmt, ap) : ERR;
86 int mvwscanw(WINDOW *win, int y, int x, const char *fmt, ...)
92 code = (wmove(win, y, x) == OK) ? vwscanw(win, fmt, ap) : ERR;