3 /* vfprintf( 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 vfprintf( struct _PDCLIB_file_t * _PDCLIB_restrict stream, const char * _PDCLIB_restrict format, va_list arg )
17 /* TODO: This function should interpret format as multibyte characters. */
18 /* Members: base, flags, n, i, this, s, width, prec, stream, arg */
19 struct _PDCLIB_status_t status = { 0, 0, SIZE_MAX, 0, 0, NULL, 0, 0, stream, arg };
20 while ( *format != '\0' )
23 if ( ( *format != '%' ) || ( ( rc = _PDCLIB_print( format, &status ) ) == format ) )
25 /* No conversion specifier, print verbatim */
26 putc( *(format++), stream );
31 /* Continue parsing after conversion specifier */
42 #include <_PDCLIB_test.h>
44 static int testprintf( FILE * stream, const char * format, ... )
48 va_start( arg, format );
49 i = vfprintf( stream, format, arg );
57 TESTCASE( ( fh = fopen( "testfile", "w" ) ) != NULL );
58 TESTCASE( testprintf( fh, "Hallo\n" ) == 6 );
59 TESTCASE( fclose( fh ) == 0 );
60 /* FIXME: Testfile doesn't exist... */