zip.c
changeset 11 677e01f5109e
parent 9 1155788ccbe3
child 14 7d822f0d5f57
equal deleted inserted replaced
10:45bd486c0224 11:677e01f5109e
    10 #include <stdlib.h>
    10 #include <stdlib.h>
    11 
    11 
    12 #define __PHYSICSFS_INTERNAL__
    12 #define __PHYSICSFS_INTERNAL__
    13 #include "physfs_internal.h"
    13 #include "physfs_internal.h"
    14 
    14 
    15 /* template for filehandles. */
    15 #if (!defined PHYSFS_SUPPORTS_ZIP)
    16 const FileHandle __PHYSFS_FileHandle_ZIP =
    16 #error PHYSFS_SUPPORTS_ZIP must be defined.
       
    17 #endif
       
    18 
       
    19 
       
    20 static const FileFunctions __PHYSFS_FileHandle_ZIP =
    17 {
    21 {
    18     NULL,       /* opaque         */
       
    19     NULL,       /* dirReader      */
       
    20     ZIP_read,   /* read() method  */
    22     ZIP_read,   /* read() method  */
    21     NULL,       /* write() method */
    23     NULL,       /* write() method */
    22     ZIP_eof,    /* eof() method   */
    24     ZIP_eof,    /* eof() method   */
    23     ZIP_tell,   /* tell() method  */
    25     ZIP_tell,   /* tell() method  */
    24     ZIP_seek,   /* seek() method  */
    26     ZIP_seek,   /* seek() method  */
    25     ZIP_close,  /* close() method */
    27     ZIP_close,  /* close() method */
    26 };
    28 };
    27 
    29 
    28 /* template for directories. */
    30 
    29 const DirReader __PHYSFS_DirReader_ZIP =
    31 const DirFunctions __PHYSFS_DirFunctions_ZIP =
    30 {
    32 {
    31     NULL,              /* opaque                  */
    33     ZIP_isArchive,     /* isArchive() method      */
       
    34     ZIP_openArchive,   /* openArchive() method    */
    32     ZIP_enumerate,     /* enumerateFiles() method */
    35     ZIP_enumerate,     /* enumerateFiles() method */
    33     ZIP_isDirectory,   /* isDirectory() method    */
    36     ZIP_isDirectory,   /* isDirectory() method    */
    34     ZIP_isSymLink,     /* isSymLink() method      */
    37     ZIP_isSymLink,     /* isSymLink() method      */
    35     ZIP_isOpenable,    /* isOpenable() method     */
    38     ZIP_isOpenable,    /* isOpenable() method     */
    36     ZIP_openRead,      /* openRead() method       */
    39     ZIP_openRead,      /* openRead() method       */
       
    40     NULL,              /* openWrite() method      */
    37     ZIP_dirClose,      /* close() method          */
    41     ZIP_dirClose,      /* close() method          */
    38 };
    42 };
    39 
    43 
    40 const __PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP =
    44 const __PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP =
    41 {
    45 {