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