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 #include <_PDCLIB_io.h>
17 static size_t filecb(void *p, const char *buf, size_t size)
19 return _PDCLIB_fwrite_unlocked( buf, 1, size, (FILE*) p );
22 int _PDCLIB_vfprintf_unlocked( FILE * _PDCLIB_restrict stream,
23 const char * _PDCLIB_restrict format,
26 return _vcbprintf(stream, filecb, format, arg);
29 int vfprintf( FILE * _PDCLIB_restrict stream,
30 const char * _PDCLIB_restrict format,
33 _PDCLIB_flockfile( stream );
34 int r = _PDCLIB_vfprintf_unlocked( stream, format, arg );
35 _PDCLIB_funlockfile( stream );
42 #define _PDCLIB_FILEID "stdio/vfprintf.c"
43 #define _PDCLIB_FILEIO
45 #include <_PDCLIB_test.h>
47 static int testprintf( FILE * stream, const char * format, ... )
51 va_start( arg, format );
52 i = vfprintf( stream, format, arg );
60 TESTCASE( ( target = tmpfile() ) != NULL );
61 #include "printf_testcases.h"
62 TESTCASE( fclose( target ) == 0 );