1 /* fsetpos( FILE *, const fpos_t * )
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_io.h>
12 int _PDCLIB_fsetpos_unlocked( FILE * stream,
13 const _PDCLIB_fpos_t * pos )
15 if ( stream->status & _PDCLIB_FWRITE )
17 if ( _PDCLIB_flushbuffer( stream ) == EOF )
22 if ( _PDCLIB_seek( stream, pos->offset, SEEK_SET ) == EOF )
26 stream->pos.mbs = pos->mbs;
31 int fsetpos( FILE * stream,
32 const _PDCLIB_fpos_t * pos )
34 _PDCLIB_flockfile( stream );
35 int res = _PDCLIB_fsetpos_unlocked( stream, pos );
36 _PDCLIB_funlockfile( stream );
43 #include <_PDCLIB_test.h>
47 /* fsetpos() tested together with fsetpos(). */