]> pd.if.org Git - pdclib/blob - functions/stdio/rewind.c
PDCLib includes with quotes, not <>.
[pdclib] / functions / stdio / rewind.c
1 /* rewind( FILE * )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <stdio.h>
8
9 #ifndef REGTEST
10 #include "_PDCLIB_io.h"
11
12 void _PDCLIB_rewind_unlocked( FILE * stream )
13 {
14     stream->status &= ~ _PDCLIB_ERRORFLAG;
15     _PDCLIB_fseek_unlocked( stream, 0L, SEEK_SET );
16 }
17
18 void rewind( FILE * stream )
19 {
20     _PDCLIB_flockfile(stream);
21     _PDCLIB_rewind_unlocked(stream);
22     _PDCLIB_funlockfile(stream);
23 }
24
25 #endif
26
27 #ifdef TEST
28 #include "_PDCLIB_test.h"
29
30 int main( void )
31 {
32     /* Testing covered by ftell.c */
33     return TEST_RESULTS;
34 }
35
36 #endif