]> git.sur5r.net Git - cc65/blob - libsrc/common/vfscanf.c
Rewrote _scanf. It does need some tests and improvements, but it's a more
[cc65] / libsrc / common / vfscanf.c
1 /*
2  * vfscanf.c
3  *
4  * Ullrich von Bassewitz (uz@cc65.org), 2004-11-26
5  *
6  */
7
8
9
10 #include <stdio.h>
11 #include "_scanf.h"
12
13
14
15 /*****************************************************************************/
16 /*                                   Code                                    */
17 /*****************************************************************************/
18
19
20
21 int __fastcall__ vfscanf (FILE* f, const char* format, va_list ap)
22 /* Standard C function */
23 {
24     struct scanfdata d;
25
26     /* Initialize the data struct. We do only need the given file as user data,
27      * since the get and ungetc are crafted so they match the standard fgetc
28      * and ungetc functions.
29      */
30     d.get    = (getfunc) fgetc,
31     d.unget  = (ungetfunc) ungetc,
32     d.data   = f;
33
34     /* Call the internal function and return the result */
35     return _scanf (&d, format, ap);
36 }
37
38
39