]> pd.if.org Git - pdclib/blobdiff - functions/stdio/_PDCLIB_fillbuffer.c
dos2unix
[pdclib] / functions / stdio / _PDCLIB_fillbuffer.c
index 70df158e32fa20e18d1363736674285547e99718..7cfbe9355351eb469f5e06a721493a610607105a 100644 (file)
@@ -1,46 +1,46 @@
-/* _PDCLIB_fillbuffer( FILE * stream )\r
-\r
-   This file is part of the Public Domain C Library (PDCLib).\r
-   Permission is granted to use, modify, and / or redistribute at will.\r
-*/\r
-\r
-#include <stdio.h>\r
-\r
-#ifndef REGTEST\r
-#include <_PDCLIB_glue.h>\r
-#include <_PDCLIB_io.h>\r
-\r
-int _PDCLIB_fillbuffer( FILE * stream )\r
-{\r
-    size_t bytesRead;\r
-    bool ok = stream->ops->read( stream->handle, stream->buffer, stream->bufsize,\r
-                        &bytesRead);\r
-\r
-    if( ok ) {\r
-        if( bytesRead == 0 ) {\r
-            stream->status |= _PDCLIB_EOFFLAG;\r
-            return EOF;\r
-        }\r
-        stream->pos.offset += bytesRead;\r
-        stream->bufend = bytesRead;\r
-        stream->bufidx = 0;\r
-        return 0;\r
-    } else {\r
-        stream->status |= _PDCLIB_ERRORFLAG;\r
-        return EOF;\r
-    }\r
-}\r
-\r
-#endif\r
-\r
-#ifdef TEST\r
-#include <_PDCLIB_test.h>\r
-\r
-int main( void )\r
-{\r
-    /* Testing covered by ftell.c */\r
-    return TEST_RESULTS;\r
-}\r
-\r
-#endif\r
-\r
+/* _PDCLIB_fillbuffer( FILE * stream )
+
+   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
+#include "_PDCLIB_glue.h"
+#include "_PDCLIB_io.h"
+
+int _PDCLIB_fillbuffer( FILE * stream )
+{
+    size_t bytesRead;
+    bool ok = stream->ops->read( stream->handle, stream->buffer, stream->bufsize,
+                        &bytesRead);
+
+    if( ok ) {
+        if( bytesRead == 0 ) {
+            stream->status |= _PDCLIB_EOFFLAG;
+            return EOF;
+        }
+        stream->pos.offset += bytesRead;
+        stream->bufend = bytesRead;
+        stream->bufidx = 0;
+        return 0;
+    } else {
+        stream->status |= _PDCLIB_ERRORFLAG;
+        return EOF;
+    }
+}
+
+#endif
+
+#ifdef TEST
+#include "_PDCLIB_test.h"
+
+int main( void )
+{
+    /* Testing covered by ftell.c */
+    return TEST_RESULTS;
+}
+
+#endif
+