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 #include <_PDCLIB_io.h>
15 static size_t filecb(void *p, const char *buf, size_t size)
17 return _PDCLIB_fwrite_unlocked( buf, 1, size, (FILE*) p );
20 int _PDCLIB_vfprintf_unlocked( FILE * _PDCLIB_restrict stream,
21 const char * _PDCLIB_restrict format,
24 return _vcbprintf(stream, filecb, format, arg);
27 int vfprintf( FILE * _PDCLIB_restrict stream,
28 const char * _PDCLIB_restrict format,
31 _PDCLIB_flockfile( stream );
32 int r = _PDCLIB_vfprintf_unlocked( stream, format, arg );
33 _PDCLIB_funlockfile( stream );
40 #define _PDCLIB_FILEID "stdio/vfprintf.c"
41 #define _PDCLIB_FILEIO
43 #include <_PDCLIB_test.h>
45 static int testprintf( FILE * stream, const char * format, ... )
49 va_start( arg, format );
50 i = vfprintf( stream, format, arg );
58 TESTCASE( ( target = tmpfile() ) != NULL );
59 #include "printf_testcases.h"
60 TESTCASE( fclose( target ) == 0 );