]> git.sesse.net Git - vlc/commitdiff
- since DIR* on win32 is mapped to a private data type, rewinddir(), seekdir() and...
authorDamien Fouilleul <damienf@videolan.org>
Mon, 8 Jan 2007 00:41:45 +0000 (00:41 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Mon, 8 Jan 2007 00:41:45 +0000 (00:41 +0000)
include/vlc_common.h
src/extras/libc.c

index 4c8fd91ebbf91092c61d6c32348d05fceb031483..e42488805705e35813dc53a9c0135805c75e91f0 100644 (file)
@@ -958,9 +958,15 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
 #   define opendir vlc_opendir
 #   define readdir vlc_readdir
 #   define closedir vlc_closedir
+#   define rewinddir vlc_rewindir
+#   define seekdir vlc_seekdir
+#   define telldir vlc_telldir
     VLC_EXPORT( void *, vlc_opendir, ( const char * ) );
     VLC_EXPORT( void *, vlc_readdir, ( void * ) );
     VLC_EXPORT( int, vlc_closedir, ( void * ) );
+    VLC_INTERNAL( void, vlc_rewinddir, ( void * ) );
+    VLC_INTERNAL( void, vlc_seekdir, ( void *, long ) );
+    VLC_INTERNAL( long, vlc_telldir, ( void * ) );
 #else
     struct dirent;  /* forward declaration for vlc_symbols.h */
 #   if !defined(__PLUGIN__)
@@ -975,12 +981,17 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
 VLC_INTERNAL( void *, vlc_wopendir, ( const wchar_t * ) );
 VLC_INTERNAL( struct _wdirent *, vlc_wreaddir, ( void * ) );
 VLC_INTERNAL( int, vlc_wclosedir, ( void * ) );
+VLC_INTERNAL( void, vlc_rewinddir, ( void * ) );
+VLC_INTERNAL( void, vlc_seekdir, ( void *, long ) );
+VLC_INTERNAL( long, vlc_telldir, ( void * ) );
 #   define opendir Use_utf8_opendir_or_vlc_wopendir_instead!
 #   define readdir Use_utf8_readdir_or_vlc_wreaddir_instead!
 #   define closedir vlc_wclosedir
 #   define _wopendir vlc_wopendir
 #   define _wreaddir vlc_wreaddir
-#   define _wclosedir vlc_wclosedir
+#   define rewinddir vlc_rewinddir
+#   define seekdir vlc_seekdir
+#   define telldir vlc_telldir
 #endif
 
 /* Format type specifiers for 64 bits numbers */
index 79a6dd0867afe64bfa500f24033d35c26c2f5972..d7ccda6b60a1f727d761ca3c3a0fb5412e687ac7 100644 (file)
@@ -55,6 +55,9 @@
 #   undef _wopendir
 #   undef _wreaddir
 #   undef _wclosedir
+#   undef rewinddir
+#   undef seekdir
+#   undef telldir
 #   define WIN32_LEAN_AND_MEAN
 #   include <windows.h>
 #endif
@@ -483,6 +486,31 @@ int vlc_wclosedir( void *_p_dir )
     free( p_dir );
     return i_ret;
 }
+
+void vlc_rewinddir( void *_p_dir )
+{
+    vlc_DIR *p_dir = (vlc_DIR *)_p_dir;
+
+    if ( p_dir->p_real_dir != NULL )
+        _wrewinddir( p_dir->p_real_dir );
+}
+
+void vlc_seekdir( void *_p_dir, long loc)
+{
+    vlc_DIR *p_dir = (vlc_DIR *)_p_dir;
+
+    if ( p_dir->p_real_dir != NULL )
+        _wseekdir( p_dir->p_real_dir, loc );
+}
+
+long vlc_telldir( void *_p_dir )
+{
+    vlc_DIR *p_dir = (vlc_DIR *)_p_dir;
+
+    if ( p_dir->p_real_dir != NULL )
+        return _wtelldir( p_dir->p_real_dir );
+    return 0;
+}
 #endif
 
 /*****************************************************************************