make it so that longname() is not redefined here
[unix-history] / usr / src / lib / libcurses / scanw.c
CommitLineData
4af7346f
KA
1/*
2 * scanw and friends
3 *
4 * %G% (Berkeley) @(#)scanw.c 1.1
5 */
6
7# include "curses.ext"
8
9/*
10 * This routine implements a scanf on the standard screen.
11 */
12scanw(fmt, args)
13char *fmt;
14int args; {
15
16 return _sscans(stdscr, fmt, &args);
17}
18/*
19 * This routine implements a scanf on the given window.
20 */
21wscanw(win, fmt, args)
22WINDOW *win;
23char *fmt;
24int args; {
25
26 return _sscans(win, fmt, &args);
27}
28/*
29 * This routine actually executes the scanf from the window.
30 *
31 * This is really a modified version of "sscanf". As such,
32 * it assumes that sscanf interfaces with the other scanf functions
33 * in a certain way. If this is not how your system works, you
34 * will have to modify this routine to use the interface that your
35 * "sscanf" uses.
36 */
37_sscans(win, fmt, args)
38WINDOW *win;
39char *fmt;
40int *args; {
41
42 char buf[100];
43 FILE junk;
44
45 junk._flag = _IOREAD|_IOSTRG;
46 junk._base = junk._ptr = buf;
47 if (wgetstr(win, buf) == ERR)
48 return ERR;
49 junk._cnt = strlen(buf);
50 return _doscan(&junk, fmt, args);
51}