]> pd.if.org Git - pdclib/blob - functions/stdio/vscanf.c
PDCLib includes with quotes, not <>.
[pdclib] / functions / stdio / vscanf.c
1 /* vscanf( 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_vscanf_unlocked( const char * _PDCLIB_restrict format,
14                              _PDCLIB_va_list arg )
15 {
16     return _PDCLIB_vfscanf_unlocked( stdin, format, arg );
17 }
18
19 int vscanf( const char * _PDCLIB_restrict format, _PDCLIB_va_list arg )
20 {
21     return vfscanf( stdin, format, arg );
22 }
23
24 #endif
25
26 #ifdef TEST
27 #define _PDCLIB_FILEID "stdio/vscanf.c"
28 #define _PDCLIB_FILEIO
29
30 #include "_PDCLIB_test.h"
31
32 static int testscanf( FILE * stream, const char * format, ... )
33 {
34     int i;
35     va_list arg;
36     va_start( arg, format );
37     i = vscanf( format, arg );
38     va_end( arg );
39     return i;
40 }
41
42 int main( void )
43 {
44     FILE * source;
45     TESTCASE( ( source = freopen( testfile, "wb+", stdin ) ) != NULL );
46 #include "scanf_testcases.h"
47     TESTCASE( fclose( source ) == 0 );
48     TESTCASE( remove( testfile ) == 0 );
49     return TEST_RESULTS;
50 }
51
52 #endif