xref: /original-bsd/lib/libc/stdio/scanf.c (revision c3e32dec)
1 /*-
2  * Copyright (c) 1990, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Chris Torek.
7  *
8  * %sccs.include.redist.c%
9  */
10 
11 #if defined(LIBC_SCCS) && !defined(lint)
12 static char sccsid[] = "@(#)scanf.c	8.1 (Berkeley) 06/04/93";
13 #endif /* LIBC_SCCS and not lint */
14 
15 #include <stdio.h>
16 #if __STDC__
17 #include <stdarg.h>
18 #else
19 #include <varargs.h>
20 #endif
21 
22 #if __STDC__
23 scanf(char const *fmt, ...)
24 #else
25 scanf(fmt, va_alist)
26 	char *fmt;
27 	va_dcl
28 #endif
29 {
30 	int ret;
31 	va_list ap;
32 
33 #if __STDC__
34 	va_start(ap, fmt);
35 #else
36 	va_start(ap);
37 #endif
38 	ret = __svfscanf(stdin, fmt, ap);
39 	va_end(ap);
40 	return (ret);
41 }
42