3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
10 #include <_PDCLIB_glue.h>
12 extern struct _PDCLIB_file_t * _PDCLIB_filelist;
14 int fflush( struct _PDCLIB_file_t * stream )
18 stream = _PDCLIB_filelist;
19 /* TODO: Check what happens when fflush( NULL ) encounters write errors, in other libs */
21 while ( stream != NULL )
23 if ( stream->status & _PDCLIB_FWRITE )
25 if ( _PDCLIB_flushbuffer( stream ) == EOF )
30 stream = stream->next;
36 return _PDCLIB_flushbuffer( stream );
43 #include <_PDCLIB_test.h>
47 /* Testing covered by ftell.c */