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_glue.h>
14 int fsetpos_unlocked( struct _PDCLIB_file_t * stream,
15 const struct _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.status = pos->status;
29 /* TODO: Add mbstate. */
33 int fsetpos( struct _PDCLIB_file_t * stream,
34 const struct _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(). */