X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Ffeof.c;h=f5d05846589324d29b601aaacd9c93fa91c80d7c;hb=abc15df6b9fae3374d24c7cf5c3ab94c605b2a6d;hp=13c4b64b7e47fd54d84f4b220dee7be76e2db702;hpb=13ee02fa27a739d9d602f801126eadcfbfeab8a8;p=pdclib diff --git a/functions/stdio/feof.c b/functions/stdio/feof.c index 13c4b64..f5d0584 100644 --- a/functions/stdio/feof.c +++ b/functions/stdio/feof.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /* feof( FILE * ) This file is part of the Public Domain C Library (PDCLib). @@ -9,21 +7,31 @@ #include #ifndef REGTEST +#include "_PDCLIB_io.h" -int feof( struct _PDCLIB_file_t * stream ) +int _PDCLIB_feof_unlocked( FILE * stream ) { return stream->status & _PDCLIB_EOFFLAG; } +int feof( FILE * stream ) +{ + _PDCLIB_flockfile( stream ); + int eof = _PDCLIB_feof_unlocked( stream ); + _PDCLIB_funlockfile( stream ); + return eof; +} + #endif #ifdef TEST -#include <_PDCLIB_test.h> +#include "_PDCLIB_test.h" int main( void ) { - TESTCASE( NO_TESTDRIVER ); + /* Testing covered by clearerr(). */ return TEST_RESULTS; } #endif +