]> pd.if.org Git - pdclib/blobdiff - functions/stdio/rewind.c
Comment cleanups.
[pdclib] / functions / stdio / rewind.c
index 0dd56ae181a16742b174f4f31871e8825f1a09e8..1cc99a2e45d6dc3bb08f0157c88b44cc572fc5fe 100644 (file)
@@ -1,8 +1,28 @@
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-
-void rewind( FILE * stream ) { /* TODO */ };
+/* rewind( FILE * )
+
+   This file is part of the Public Domain C Library (PDCLib).
+   Permission is granted to use, modify, and / or redistribute at will.
+*/
+
+#include <stdio.h>
+
+#ifndef REGTEST
+
+void rewind( struct _PDCLIB_file_t * stream )
+{
+    stream->status &= ~ _PDCLIB_ERRORFLAG;
+    fseek( stream, 0L, SEEK_SET );
+}
+
+#endif
+
+#ifdef TEST
+#include <_PDCLIB_test.h>
+
+int main( void )
+{
+    /* Testing covered by ftell.c */
+    return TEST_RESULTS;
+}
+
+#endif