-/* $Id$ */
-
/* fflush( FILE * )
This file is part of the Public Domain C Library (PDCLib).
#include <stdio.h>
#ifndef REGTEST
-#include <_PDCLIB_glue.h>
+
+#include "_PDCLIB_glue.h"
extern struct _PDCLIB_file_t * _PDCLIB_filelist;
int rc = 0;
while ( stream != NULL )
{
- if ( stream->bufidx > stream->bufend )
+ if ( stream->status & _PDCLIB_FWRITE )
{
- rc |= _PDCLIB_fflush( stream );
+ if ( _PDCLIB_flushbuffer( stream ) == EOF )
+ {
+ rc = EOF;
+ }
}
stream = stream->next;
}
}
else
{
- return _PDCLIB_fflush( stream );
+ return _PDCLIB_flushbuffer( stream );
}
}
-
+
#endif
#ifdef TEST
-#include <_PDCLIB_test.h>
+
+#include "_PDCLIB_test.h"
int main( void )
{
- TESTCASE( NO_TESTDRIVER );
+ /* Testing covered by ftell.c */
return TEST_RESULTS;
}
#endif
-