2 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
21 sccsid
[] = "@(#)scanw.c 1.8 88/02/08 SMI"; /* from UCB 5.1 85/06/07 */
34 * This routine implements a scanf on the standard screen.
43 j
= _sscans(stdscr
, fmt
, ap
);
49 * This routine implements a scanf on the given window.
53 wscanw(WINDOW
*win
, char *fmt
, ...)
59 j
= _sscans(win
, fmt
, ap
);
64 * This routine actually executes the scanf from the window.
66 * This is really a modified version of "sscanf". As such,
67 * it assumes that sscanf interfaces with the other scanf functions
68 * in a certain way. If this is not how your system works, you
69 * will have to modify this routine to use the interface that your
74 _sscans(WINDOW
*win
, char *fmt
, va_list ap
)
79 junk
._flag
= _IOREAD
|_IOWRT
;
80 junk
._base
= junk
._ptr
= (unsigned char *)buf
;
81 if (wgetstr(win
, buf
) == ERR
)
83 junk
._cnt
= (ssize_t
)strlen(buf
);
84 return (_doscan(&junk
, fmt
, ap
));