]> pd.if.org Git - pdclib/blob - functions/_PDCLIB/_PDCLIB_closeall.c
Moving branches closer together.
[pdclib] / functions / _PDCLIB / _PDCLIB_closeall.c
1 /* _PDCLIB_closeall( void )
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
9 #ifndef REGTEST
10
11 extern struct _PDCLIB_file_t * _PDCLIB_filelist;
12
13 void _PDCLIB_closeall( void )
14 {
15     struct _PDCLIB_file_t * stream = _PDCLIB_filelist;
16     struct _PDCLIB_file_t * next;
17     while ( stream != NULL )
18     {
19         next = stream->next;
20         fclose( stream );
21         stream = next;
22     }
23 }
24
25 #endif
26
27 #ifdef TEST
28
29 #include "_PDCLIB_test.h"
30
31 int main( void )
32 {
33     /* No testdriver */
34     return TEST_RESULTS;
35 }
36
37 #endif