xref: /csrg-svn/lib/libc/stdio/scanf.c (revision 46101)
1*46101Sbostic /*-
2*46101Sbostic  * Copyright (c) 1990 The Regents of the University of California.
3*46101Sbostic  * All rights reserved.
4*46101Sbostic  *
5*46101Sbostic  * This code is derived from software contributed to Berkeley by
6*46101Sbostic  * Chris Torek.
7*46101Sbostic  *
8*46101Sbostic  * %sccs.include.redist.c%
9*46101Sbostic  */
10*46101Sbostic 
1126660Sdonn #if defined(LIBC_SCCS) && !defined(lint)
12*46101Sbostic static char sccsid[] = "@(#)scanf.c	5.3 (Berkeley) 01/20/91";
13*46101Sbostic #endif /* LIBC_SCCS and not lint */
1422145Smckusick 
15*46101Sbostic #include <stdio.h>
16*46101Sbostic #if __STDC__
17*46101Sbostic #include <stdarg.h>
18*46101Sbostic #else
19*46101Sbostic #include <varargs.h>
20*46101Sbostic #endif
212031Swnj 
22*46101Sbostic #if __STDC__
23*46101Sbostic scanf(char const *fmt, ...)
24*46101Sbostic #else
25*46101Sbostic scanf(fmt, va_alist)
26*46101Sbostic 	char *fmt;
27*46101Sbostic 	va_dcl
28*46101Sbostic #endif
292031Swnj {
30*46101Sbostic 	int ret;
31*46101Sbostic 	va_list ap;
322031Swnj 
33*46101Sbostic #if __STDC__
34*46101Sbostic 	va_start(ap, fmt);
35*46101Sbostic #else
36*46101Sbostic 	va_start(ap);
37*46101Sbostic #endif
38*46101Sbostic 	ret = __svfscanf(stdin, fmt, ap);
39*46101Sbostic 	va_end(ap);
40*46101Sbostic 	return (ret);
412031Swnj }
42