3 /* fseek( FILE *, long offset, int )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
13 #include <_PDCLIB_glue.h>
15 int fseek( struct _PDCLIB_file_t * _PDCLIB_restrict stream, long offset, int whence )
17 if ( stream->status & _PDCLIB_FWRITE )
19 if ( _PDCLIB_flushbuffer( stream ) == EOF )
24 stream->status &= ~ _PDCLIB_EOFFLAG;
25 if ( stream->status & _PDCLIB_FRW )
27 stream->status &= ~ ( _PDCLIB_FREAD | _PDCLIB_FWRITE );
29 return _PDCLIB_seek( stream, offset, whence );
35 #include <_PDCLIB_test.h>
39 /* Testing covered by ftell.c */