]> pd.if.org Git - pdclib/blob - functions/stdio/vprintf.c
PDCLib includes with quotes, not <>.
[pdclib] / functions / stdio / vprintf.c
1 /* vprintf( const char *, va_list )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <stdio.h>
8 #include <stdarg.h>
9
10 #ifndef REGTEST
11 #include "_PDCLIB_io.h"
12
13 int _PDCLIB_vprintf_unlocked( const char * _PDCLIB_restrict format, 
14                               _PDCLIB_va_list arg )
15 {
16     return _PDCLIB_vfprintf_unlocked( stdout, format, arg );
17 }
18
19 int vprintf( const char * _PDCLIB_restrict format, _PDCLIB_va_list arg )
20 {
21     return vfprintf( stdout, format, arg );
22 }
23
24 #endif
25
26 #ifdef TEST
27 #define _PDCLIB_FILEID "stdio/vprintf.c"
28 #define _PDCLIB_FILEIO
29 #include <stdint.h>
30 #include <stddef.h>
31 #include "_PDCLIB_test.h"
32
33 static int testprintf( FILE * stream, const char * format, ... )
34 {
35     int i;
36     va_list arg;
37     va_start( arg, format );
38     i = vprintf( format, arg );
39     va_end( arg );
40     return i;
41 }
42
43 int main( void )
44 {
45     FILE * target;
46     TESTCASE( ( target = freopen( testfile, "wb+", stdout ) ) != NULL );
47 #include "printf_testcases.h"
48     TESTCASE( fclose( target ) == 0 );
49     TESTCASE( remove( testfile ) == 0 );
50     return TEST_RESULTS;
51 }
52
53 #endif