1 /* vfprintf( FILE *, const char *, va_list )
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
13 int vfprintf( struct _PDCLIB_file_t * _PDCLIB_restrict stream, const char * _PDCLIB_restrict format, va_list arg )
15 /* TODO: This function should interpret format as multibyte characters. */
16 struct _PDCLIB_status_t status;
25 status.stream = stream;
26 va_copy( status.arg, arg );
28 while ( *format != '\0' )
31 if ( ( *format != '%' ) || ( ( rc = _PDCLIB_print( format, &status ) ) == format ) )
33 /* No conversion specifier, print verbatim */
34 putc( *(format++), stream );
39 /* Continue parsing after conversion specifier */
50 #define _PDCLIB_FILEID "stdio/vfprintf.c"
51 #define _PDCLIB_FILEIO
53 #include "_PDCLIB_test.h"
55 static int testprintf( FILE * stream, const char * format, ... )
59 va_start( arg, format );
60 i = vfprintf( stream, format, arg );
68 TESTCASE( ( target = tmpfile() ) != NULL );
69 #include "printf_testcases.h"
70 TESTCASE( fclose( target ) == 0 );