X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdio%2Frewind.c;h=f50bf025b475fa9cbcb6d614c965653e19607ad9;hp=4dab8e9e2cbe9943392011876bf9723a060005b9;hb=da0f3f353d417fed71f358a48d5d5394145e460d;hpb=393020b6e48719d27699dea6b29e53025bbd5123 diff --git a/functions/stdio/rewind.c b/functions/stdio/rewind.c index 4dab8e9..f50bf02 100644 --- a/functions/stdio/rewind.c +++ b/functions/stdio/rewind.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /* rewind( FILE * ) This file is part of the Public Domain C Library (PDCLib). @@ -9,17 +7,25 @@ #include #ifndef REGTEST +#include "_PDCLIB_io.h" -void rewind( struct _PDCLIB_file_t * stream ) +void _PDCLIB_rewind_unlocked( FILE * stream ) { stream->status &= ~ _PDCLIB_ERRORFLAG; - fseek( stream, 0L, SEEK_SET ); + _PDCLIB_fseek_unlocked( stream, 0L, SEEK_SET ); +} + +void rewind( FILE * stream ) +{ + _PDCLIB_flockfile(stream); + _PDCLIB_rewind_unlocked(stream); + _PDCLIB_funlockfile(stream); } #endif #ifdef TEST -#include <_PDCLIB_test.h> +#include "_PDCLIB_test.h" int main( void ) {