xref: /csrg-svn/lib/libc/stdio/fscanf.c (revision 61180)
146111Sbostic /*-
2*61180Sbostic  * Copyright (c) 1990, 1993
3*61180Sbostic  *	The Regents of the University of California.  All rights reserved.
446111Sbostic  *
546111Sbostic  * This code is derived from software contributed to Berkeley by
646111Sbostic  * Chris Torek.
746111Sbostic  *
846111Sbostic  * %sccs.include.redist.c%
946111Sbostic  */
1046111Sbostic 
1146111Sbostic #if defined(LIBC_SCCS) && !defined(lint)
12*61180Sbostic static char sccsid[] = "@(#)fscanf.c	8.1 (Berkeley) 06/04/93";
1346111Sbostic #endif /* LIBC_SCCS and not lint */
1446111Sbostic 
1546111Sbostic #include <stdio.h>
1646111Sbostic #if __STDC__
1746111Sbostic #include <stdarg.h>
1846111Sbostic #else
1946111Sbostic #include <varargs.h>
2046111Sbostic #endif
2146111Sbostic 
2246111Sbostic #if __STDC__
fscanf(FILE * fp,char const * fmt,...)2346111Sbostic fscanf(FILE *fp, char const *fmt, ...) {
2446111Sbostic 	int ret;
2546111Sbostic 	va_list ap;
2646111Sbostic 
2746111Sbostic 	va_start(ap, fmt);
2846111Sbostic #else
2946111Sbostic fscanf(fp, fmt, va_alist)
3046111Sbostic 	FILE *fp;
3146111Sbostic 	char *fmt;
3246111Sbostic 	va_dcl
3346111Sbostic {
3446111Sbostic 	int ret;
3546111Sbostic 	va_list ap;
3646111Sbostic 
3746111Sbostic 	va_start(ap);
3846111Sbostic #endif
3946111Sbostic 	ret = __svfscanf(fp, fmt, ap);
4046111Sbostic 	va_end(ap);
4146111Sbostic 	return (ret);
4246111Sbostic }
43