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 /* TODO: This function should interpret format as multibyte characters. */
18 struct _PDCLIB_status_t status;
27 status.stream = stream;
28 va_copy( status.arg, arg );
30 while ( *format != '\0' )
33 if ( ( *format != '%' ) || ( ( rc = _PDCLIB_scan( format, &status ) ) == format ) )
36 /* No conversion specifier, match verbatim */
37 if ( isspace( *format ) )
39 /* Whitespace char in format string: Skip all whitespaces */
40 /* No whitespaces in input does not result in matching error */
41 while ( isspace( c = getc( stream ) ) )
52 /* Non-whitespace char in format string: Match verbatim */
53 if ( ( c = getc( stream ) ) != *format )
68 /* NULL return code indicates matching error */
73 /* Continue parsing after conversion specifier */
84 #include <_PDCLIB_test.h>
86 #include "scan_test.h"
88 static int SCANFUNC( FILE * stream, char const * format, ... )
91 va_start( ap, format );
92 int result = vfscanf( stream, format, ap );
99 #include "fscan_sources.incl"
100 #include "scanf_testcases.incl"