3 /* fsetpos( FILE *, const fpos_t * )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
12 #include <_PDCLIB_io.h>
14 int fsetpos_unlocked( FILE * stream,
15 const _PDCLIB_fpos_t * pos )
17 if ( stream->status & _PDCLIB_FWRITE )
19 if ( _PDCLIB_flushbuffer( stream ) == EOF )
24 if ( _PDCLIB_seek( stream, pos->offset, SEEK_SET ) == EOF )
28 stream->pos.mbs = pos->mbs;
33 int fsetpos( FILE * stream,
34 const _PDCLIB_fpos_t * pos )
37 int res = fsetpos_unlocked( stream, pos );
38 funlockfile( stream );
45 #include <_PDCLIB_test.h>
49 /* fsetpos() tested together with fsetpos(). */