BSD 4 development
[unix-history] / usr / src / lib / libcurses / scanw.c
CommitLineData
15eea6e6
BJ
1# include "curses.ext"
2
3/*
4 * This routine implements a scanf on the standard screen.
5 */
6scanw(fmt, args)
7char *fmt;
8int args; {
9
10 return _sscans(stdscr, fmt, &args);
11}
12/*
13 * This routine implements a scanf on the given window.
14 */
15wscanw(win, fmt, args)
16WINDOW *win;
17char *fmt;
18int args; {
19
20 return _sscans(win, fmt, &args);
21}
22/*
23 * This routine actually executes the scanf from the window.
24 */
25_sscans(win, fmt, args)
26WINDOW *win;
27char *fmt;
28int *args; {
29
30 char buf[100];
31 FILE junk;
32
33 junk._flag = _IOREAD|_IOSTRG;
34 junk._base = junk._ptr = buf;
35 if (wgetstr(win, buf) == ERR)
36 return ERR;
37 junk._cnt = strlen(buf);
38 return _doscan(&junk, fmt, args);
39}