]> pd.if.org Git - pdclib.old/blobdiff - functions/stdio/rewind.c
Minimize the amount of internal definitions which get exposed via the user-visible...
[pdclib.old] / functions / stdio / rewind.c
index 4dab8e9e2cbe9943392011876bf9723a060005b9..53ab51da9509b64a2fcb1567fb05a8b45de5eb45 100644 (file)
@@ -9,11 +9,19 @@
 #include <stdio.h>
 
 #ifndef REGTEST
+#include <_PDCLIB_io.h>
 
-void rewind( struct _PDCLIB_file_t * stream )
+void rewind_unlocked( FILE * stream )
 {
     stream->status &= ~ _PDCLIB_ERRORFLAG;
-    fseek( stream, 0L, SEEK_SET );
+    fseek_unlocked( stream, 0L, SEEK_SET );
+}
+
+void rewind( FILE * stream )
+{
+    flockfile(stream);
+    rewind_unlocked(stream);
+    funlockfile(stream);
 }
 
 #endif