src/archiver_lzma.c
changeset 1125 bcff76dbd9fd
parent 1118 2e09fc635fdd
child 1129 d81afe4b0a97
equal deleted inserted replaced
1124:6ef3d04af1c4 1125:bcff76dbd9fd
   579         file++;
   579         file++;
   580     }
   580     }
   581 } /* LZMA_enumerateFiles */
   581 } /* LZMA_enumerateFiles */
   582 
   582 
   583 
   583 
   584 static int LZMA_exists(dvoid *opaque, const char *name)
       
   585 {
       
   586     LZMAarchive *archive = (LZMAarchive *) opaque;
       
   587     return (lzma_find_file(archive, name) != NULL);
       
   588 } /* LZMA_exists */
       
   589 
       
   590 
       
   591 static int LZMA_isDirectory(dvoid *opaque, const char *name, int *fileExists)
       
   592 {
       
   593     LZMAarchive *archive = (LZMAarchive *) opaque;
       
   594     LZMAfile *file = lzma_find_file(archive, name);
       
   595 
       
   596     *fileExists = (file != NULL);
       
   597 
       
   598     return ((file == NULL) ? 0 : file->item->IsDirectory);
       
   599 } /* LZMA_isDirectory */
       
   600 
       
   601 
       
   602 static int LZMA_isSymLink(dvoid *opaque, const char *name, int *fileExists)
       
   603 {
       
   604     BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
       
   605 } /* LZMA_isSymLink */
       
   606 
       
   607 
       
   608 static PHYSFS_Io *LZMA_openRead(dvoid *opaque, const char *name, int *fileExists)
   584 static PHYSFS_Io *LZMA_openRead(dvoid *opaque, const char *name, int *fileExists)
   609 {
   585 {
   610     LZMAarchive *archive = (LZMAarchive *) opaque;
   586     LZMAarchive *archive = (LZMAarchive *) opaque;
   611     LZMAfile *file = lzma_find_file(archive, name);
   587     LZMAfile *file = lzma_find_file(archive, name);
   612     PHYSFS_Io *io = NULL;
   588     PHYSFS_Io *io = NULL;
   717 const PHYSFS_Archiver __PHYSFS_Archiver_LZMA =
   693 const PHYSFS_Archiver __PHYSFS_Archiver_LZMA =
   718 {
   694 {
   719     &__PHYSFS_ArchiveInfo_LZMA,
   695     &__PHYSFS_ArchiveInfo_LZMA,
   720     LZMA_openArchive,        /* openArchive() method    */
   696     LZMA_openArchive,        /* openArchive() method    */
   721     LZMA_enumerateFiles,     /* enumerateFiles() method */
   697     LZMA_enumerateFiles,     /* enumerateFiles() method */
   722     LZMA_exists,             /* exists() method         */
       
   723     LZMA_isDirectory,        /* isDirectory() method    */
       
   724     LZMA_isSymLink,          /* isSymLink() method      */
       
   725     LZMA_openRead,           /* openRead() method       */
   698     LZMA_openRead,           /* openRead() method       */
   726     LZMA_openWrite,          /* openWrite() method      */
   699     LZMA_openWrite,          /* openWrite() method      */
   727     LZMA_openAppend,         /* openAppend() method     */
   700     LZMA_openAppend,         /* openAppend() method     */
   728     LZMA_remove,             /* remove() method         */
   701     LZMA_remove,             /* remove() method         */
   729     LZMA_mkdir,              /* mkdir() method          */
   702     LZMA_mkdir,              /* mkdir() method          */