xref: /original-bsd/lib/libc/stdio/vsscanf.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  * Donn Seeley at UUNET Technologies, Inc.
7  *
8  * %sccs.include.redist.c%
9  */
10 
11 #if defined(LIBC_SCCS) && !defined(lint)
12 static char sccsid[] = "@(#)vsscanf.c	8.1 (Berkeley) 06/04/93";
13 #endif /* LIBC_SCCS and not lint */
14 
15 #include <stdio.h>
16 #include <string.h>
17 
18 /* ARGSUSED */
19 static int
20 eofread(cookie, buf, len)
21 	void *cookie;
22 	char *buf;
23 	int len;
24 {
25 
26 	return (0);
27 }
28 
29 vsscanf(str, fmt, ap)
30 	const char *str;
31 	const char *fmt;
32 	_BSD_VA_LIST_ ap;
33 {
34 	int ret;
35 	FILE f;
36 
37 	f._flags = __SRD;
38 	f._bf._base = f._p = (unsigned char *)str;
39 	f._bf._size = f._r = strlen(str);
40 	f._read = eofread;
41 	f._ub._base = NULL;
42 	f._lb._base = NULL;
43 	return (__svfscanf(&f, fmt, ap));
44 }
45