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