xref: /csrg-svn/lib/libc/stdio/scanf.c (revision 61180)
146101Sbostic /*-
2*61180Sbostic  * Copyright (c) 1990, 1993
3*61180Sbostic  *	The Regents of the University of California.  All rights reserved.
446101Sbostic  *
546101Sbostic  * This code is derived from software contributed to Berkeley by
646101Sbostic  * Chris Torek.
746101Sbostic  *
846101Sbostic  * %sccs.include.redist.c%
946101Sbostic  */
1046101Sbostic 
1126660Sdonn #if defined(LIBC_SCCS) && !defined(lint)
12*61180Sbostic static char sccsid[] = "@(#)scanf.c	8.1 (Berkeley) 06/04/93";
1346101Sbostic #endif /* LIBC_SCCS and not lint */
1422145Smckusick 
1546101Sbostic #include <stdio.h>
1646101Sbostic #if __STDC__
1746101Sbostic #include <stdarg.h>
1846101Sbostic #else
1946101Sbostic #include <varargs.h>
2046101Sbostic #endif
212031Swnj 
2246101Sbostic #if __STDC__
scanf(char const * fmt,...)2346101Sbostic scanf(char const *fmt, ...)
2446101Sbostic #else
2546101Sbostic scanf(fmt, va_alist)
2646101Sbostic 	char *fmt;
2746101Sbostic 	va_dcl
2846101Sbostic #endif
292031Swnj {
3046101Sbostic 	int ret;
3146101Sbostic 	va_list ap;
322031Swnj 
3346101Sbostic #if __STDC__
3446101Sbostic 	va_start(ap, fmt);
3546101Sbostic #else
3646101Sbostic 	va_start(ap);
3746101Sbostic #endif
3846101Sbostic 	ret = __svfscanf(stdin, fmt, ap);
3946101Sbostic 	va_end(ap);
4046101Sbostic 	return (ret);
412031Swnj }
42