]> pd.if.org Git - pdclib.old/blobdiff - functions/stdio/fread.c
[gandr] s/__lp64__/__LP64__/ to match GCC define
[pdclib.old] / functions / stdio / fread.c
index f1ab3a9adeb84745336a2043e8d0d4c8e95a8882..9695db43bb1f43a833fb5a02447dce1dfe07886f 100644 (file)
@@ -9,15 +9,16 @@
 #include <stdio.h>
 
 #ifndef REGTEST
-
-#include <_PDCLIB_glue.h>
+#include <_PDCLIB_io.h>
 
 #include <stdbool.h>
 #include <string.h>
 
-size_t fread_unlocked( void * _PDCLIB_restrict ptr, 
-                       size_t size, size_t nmemb, 
-                       struct _PDCLIB_file_t * _PDCLIB_restrict stream )
+size_t _PDCLIB_fread_unlocked( 
+    void * _PDCLIB_restrict ptr, 
+    size_t size, size_t nmemb, 
+    FILE * _PDCLIB_restrict stream 
+)
 {
     if ( _PDCLIB_prepread( stream ) == EOF )
     {
@@ -37,11 +38,11 @@ size_t fread_unlocked( void * _PDCLIB_restrict ptr,
 
 size_t fread( void * _PDCLIB_restrict ptr, 
               size_t size, size_t nmemb, 
-              struct _PDCLIB_file_t * _PDCLIB_restrict stream )
+              FILE * _PDCLIB_restrict stream )
 {
-    flockfile( stream );
-    size_t r = fread_unlocked( ptr, size, nmemb, stream );
-    funlockfile( stream );
+    _PDCLIB_flockfile( stream );
+    size_t r = _PDCLIB_fread_unlocked( ptr, size, nmemb, stream );
+    _PDCLIB_funlockfile( stream );
     return r;
 }