new copyright; att/bsd/shared
[unix-history] / usr / src / lib / libc / stdio / scanf.c
CommitLineData
858d320c
KB
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * 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 */
2a129daa 10
858d320c
KB
11#if defined(LIBC_SCCS) && !defined(lint)
12static char sccsid[] = "@(#)scanf.c 5.3 (Berkeley) %G%";
13#endif /* LIBC_SCCS and not lint */
2a129daa 14
858d320c
KB
15#include <stdio.h>
16#if __STDC__
17#include <stdarg.h>
18#else
19#include <varargs.h>
20#endif
2a129daa 21
858d320c
KB
22#if __STDC__
23scanf(char const *fmt, ...)
24#else
25scanf(fmt, va_alist)
26 char *fmt;
27 va_dcl
28#endif
2a129daa 29{
858d320c
KB
30 int ret;
31 va_list ap;
2a129daa 32
858d320c
KB
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);
2a129daa 41}