]> pd.if.org Git - pdclib/blob - functions/_PDCLIB/closeall.c
3523f8c0fe5013f34f625abbd0146ff9627e25df
[pdclib] / functions / _PDCLIB / closeall.c
1 /* $Id$ */
2
3 /* _PDCLIB_closeall( void )
4
5    This file is part of the Public Domain C Library (PDCLib).
6    Permission is granted to use, modify, and / or redistribute at will.
7 */
8
9 #include <stdio.h>
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 #ifdef TEST
26 #include <_PDCLIB_test.h>
27
28 int main( void )
29 {
30     TESTCASE( NO_TESTDRIVER );
31     return TEST_RESULTS;
32 }
33
34 #endif
35