archivers/dir.c
changeset 399 02dd53688315
parent 311 8a4ee9ab0fc3
child 427 c38ace41039f
equal deleted inserted replaced
398:aa1e763b09ae 399:02dd53688315
    44 static int DIR_remove(DirHandle *h, const char *name);
    44 static int DIR_remove(DirHandle *h, const char *name);
    45 static int DIR_mkdir(DirHandle *h, const char *name);
    45 static int DIR_mkdir(DirHandle *h, const char *name);
    46 static void DIR_dirClose(DirHandle *h);
    46 static void DIR_dirClose(DirHandle *h);
    47 
    47 
    48 
    48 
       
    49 const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_DIR =
       
    50 {
       
    51     "",
       
    52     "non-archive directory I/O",
       
    53     "Ryan C. Gordon <icculus@clutteredmind.org>",
       
    54     "http://icculus.org/physfs/",
       
    55 };
       
    56 
       
    57 
    49 static const FileFunctions __PHYSFS_FileFunctions_DIR =
    58 static const FileFunctions __PHYSFS_FileFunctions_DIR =
    50 {
    59 {
    51     DIR_read,       /* read() method       */
    60     DIR_read,       /* read() method       */
    52     NULL,           /* write() method      */
    61     NULL,           /* write() method      */
    53     DIR_eof,        /* eof() method        */
    62     DIR_eof,        /* eof() method        */
    70 };
    79 };
    71 
    80 
    72 
    81 
    73 const DirFunctions __PHYSFS_DirFunctions_DIR =
    82 const DirFunctions __PHYSFS_DirFunctions_DIR =
    74 {
    83 {
       
    84     &__PHYSFS_ArchiveInfo_DIR,
    75     DIR_isArchive,          /* isArchive() method      */
    85     DIR_isArchive,          /* isArchive() method      */
    76     DIR_openArchive,        /* openArchive() method    */
    86     DIR_openArchive,        /* openArchive() method    */
    77     DIR_enumerateFiles,     /* enumerateFiles() method */
    87     DIR_enumerateFiles,     /* enumerateFiles() method */
    78     DIR_exists,             /* exists() method         */
    88     DIR_exists,             /* exists() method         */
    79     DIR_isDirectory,        /* isDirectory() method    */
    89     DIR_isDirectory,        /* isDirectory() method    */
    86     DIR_mkdir,              /* mkdir() method          */
    96     DIR_mkdir,              /* mkdir() method          */
    87     DIR_dirClose            /* dirClose() method       */
    97     DIR_dirClose            /* dirClose() method       */
    88 };
    98 };
    89 
    99 
    90 
   100 
    91 /* This doesn't get listed, since it's technically not an archive... */
       
    92 #if 0
       
    93 const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_DIR =
       
    94 {
       
    95     "DIR",
       
    96     "non-archive directory I/O",
       
    97     "Ryan C. Gordon <icculus@clutteredmind.org>",
       
    98     "http://www.icculus.org/physfs/",
       
    99 };
       
   100 #endif
       
   101 
       
   102 
       
   103 static PHYSFS_sint64 DIR_read(FileHandle *handle, void *buffer,
   101 static PHYSFS_sint64 DIR_read(FileHandle *handle, void *buffer,
   104                               PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
   102                               PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
   105 {
   103 {
   106     PHYSFS_sint64 retval;
   104     PHYSFS_sint64 retval;
   107     retval = __PHYSFS_platformRead(handle->opaque, buffer, objSize, objCount);
   105     retval = __PHYSFS_platformRead(handle->opaque, buffer, objSize, objCount);