]> pd.if.org Git - pdclib.old/blobdiff - functions/stdio/_PDCLIB_ftell64.c
Namespace cleanliness: Rename all ***_unlocked functions to _PDCLIB_***_unlocked.
[pdclib.old] / functions / stdio / _PDCLIB_ftell64.c
index 650eda548d48051863868df176fffdb1584ecf51..f72d2f96098ccfbe311bd5c4212eb23a18c9ed2e 100644 (file)
@@ -11,8 +11,9 @@
 #include <limits.h>\r
 \r
 #ifndef REGTEST\r
+#include <_PDCLIB_io.h>\r
 \r
-uint_fast64_t _PDCLIB_ftell64( struct _PDCLIB_file_t * stream )\r
+uint_fast64_t _PDCLIB_ftell64_unlocked( FILE * stream )\r
 {\r
     /* ftell() must take into account:\r
        - the actual *physical* offset of the file, i.e. the offset as recognized\r
@@ -38,6 +39,14 @@ uint_fast64_t _PDCLIB_ftell64( struct _PDCLIB_file_t * stream )
     return ( stream->pos.offset - ( ( (int)stream->bufend - (int)stream->bufidx ) + (int)stream->ungetidx ) );\r
 }\r
 \r
+uint_fast64_t _PDCLIB_ftell64( FILE * stream )\r
+{\r
+  _PDCLIB_flockfile( stream );\r
+  uint_fast64_t pos = _PDCLIB_ftell64_unlocked( stream );\r
+  _PDCLIB_funlockfile( stream );\r
+  return pos;\r
+}\r
+\r
 #endif\r
 \r
 #ifdef TEST\r