xref: /csrg-svn/lib/libc/stdio/vsscanf.c (revision 61180)
147991Sdonn /*-
2*61180Sbostic  * Copyright (c) 1990, 1993
3*61180Sbostic  *	The Regents of the University of California.  All rights reserved.
447991Sdonn  *
547991Sdonn  * This code is derived from software contributed to Berkeley by
647991Sdonn  * Donn Seeley at UUNET Technologies, Inc.
747991Sdonn  *
847991Sdonn  * %sccs.include.redist.c%
947991Sdonn  */
1047991Sdonn 
1147991Sdonn #if defined(LIBC_SCCS) && !defined(lint)
12*61180Sbostic static char sccsid[] = "@(#)vsscanf.c	8.1 (Berkeley) 06/04/93";
1347991Sdonn #endif /* LIBC_SCCS and not lint */
1447991Sdonn 
1547991Sdonn #include <stdio.h>
1647991Sdonn #include <string.h>
1747991Sdonn 
1847991Sdonn /* ARGSUSED */
1947991Sdonn static int
eofread(cookie,buf,len)2047991Sdonn eofread(cookie, buf, len)
2147991Sdonn 	void *cookie;
2247991Sdonn 	char *buf;
2347991Sdonn 	int len;
2447991Sdonn {
2547991Sdonn 
2647991Sdonn 	return (0);
2747991Sdonn }
2847991Sdonn 
vsscanf(str,fmt,ap)2947991Sdonn vsscanf(str, fmt, ap)
3047991Sdonn 	const char *str;
3147991Sdonn 	const char *fmt;
3254268Sbostic 	_BSD_VA_LIST_ ap;
3347991Sdonn {
3447991Sdonn 	int ret;
3547991Sdonn 	FILE f;
3647991Sdonn 
3747991Sdonn 	f._flags = __SRD;
3847991Sdonn 	f._bf._base = f._p = (unsigned char *)str;
3947991Sdonn 	f._bf._size = f._r = strlen(str);
4047991Sdonn 	f._read = eofread;
4147991Sdonn 	f._ub._base = NULL;
4247991Sdonn 	f._lb._base = NULL;
4347991Sdonn 	return (__svfscanf(&f, fmt, ap));
4447991Sdonn }
45