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