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