3 /* vfscanf( FILE *, const char *, va_list )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
15 int vfscanf( FILE * _PDCLIB_restrict stream, const char * _PDCLIB_restrict format, va_list arg )
17 /* base, flags, n, i, current, s, width, prec, stream, arg */
18 struct _PDCLIB_status_t status = { 0, 0, 0, 0, 0, NULL, 0, 0, stream, NULL };
19 va_copy( status.arg, arg );
20 while ( *format != '\0' )
23 if ( ( *format != '%' ) || ( ( rc = _PDCLIB_scan( format, &status ) ) == format ) )
26 /* No conversion specifier, match verbatim */
27 if ( isspace( *format ) )
29 /* Whitespace char in format string: Skip all whitespaces */
30 /* No whitespaces in input does not result in matching error */
31 while ( isspace( c = getc( stream ) ) )
42 /* Non-whitespace char in format string: Match verbatim */
43 if ( ( c = getc( stream ) ) != *format )
58 /* NULL return code indicates matching error */
63 /* Continue parsing after conversion specifier */
74 #include <_PDCLIB_test.h>
78 /* TODO: Check whitespace / EOF / ungetc handling */
79 TESTCASE( NO_TESTDRIVER );