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 */ 10 11 #if defined(LIBC_SCCS) && !defined(lint) 12 static char sccsid[] = "@(#)scanf.c 5.3 (Berkeley) 01/20/91"; 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