src/archiver_hog.c
changeset 1125 bcff76dbd9fd
parent 1118 2e09fc635fdd
child 1128 067d8e76261e
equal deleted inserted replaced
1124:6ef3d04af1c4 1125:bcff76dbd9fd
   333 
   333 
   334     BAIL_MACRO(ERR_NO_SUCH_FILE, NULL);
   334     BAIL_MACRO(ERR_NO_SUCH_FILE, NULL);
   335 } /* hog_find_entry */
   335 } /* hog_find_entry */
   336 
   336 
   337 
   337 
   338 static int HOG_exists(dvoid *opaque, const char *name)
       
   339 {
       
   340     return (hog_find_entry((HOGinfo *) opaque, name) != NULL);
       
   341 } /* HOG_exists */
       
   342 
       
   343 
       
   344 static int HOG_isDirectory(dvoid *opaque, const char *name, int *fileExists)
       
   345 {
       
   346     *fileExists = HOG_exists(opaque, name);
       
   347     return 0;  /* never directories in a groupfile. */
       
   348 } /* HOG_isDirectory */
       
   349 
       
   350 
       
   351 static int HOG_isSymLink(dvoid *opaque, const char *name, int *fileExists)
       
   352 {
       
   353     *fileExists = HOG_exists(opaque, name);
       
   354     return 0;  /* never symlinks in a groupfile. */
       
   355 } /* HOG_isSymLink */
       
   356 
       
   357 
       
   358 static PHYSFS_Io *HOG_openRead(dvoid *opaque, const char *fnm, int *fileExists)
   338 static PHYSFS_Io *HOG_openRead(dvoid *opaque, const char *fnm, int *fileExists)
   359 {
   339 {
   360     PHYSFS_Io *retval = NULL;
   340     PHYSFS_Io *retval = NULL;
   361     HOGinfo *info = (HOGinfo *) opaque;
   341     HOGinfo *info = (HOGinfo *) opaque;
   362     HOGfileinfo *finfo;
   342     HOGfileinfo *finfo;
   457 const PHYSFS_Archiver __PHYSFS_Archiver_HOG =
   437 const PHYSFS_Archiver __PHYSFS_Archiver_HOG =
   458 {
   438 {
   459     &__PHYSFS_ArchiveInfo_HOG,
   439     &__PHYSFS_ArchiveInfo_HOG,
   460     HOG_openArchive,        /* openArchive() method    */
   440     HOG_openArchive,        /* openArchive() method    */
   461     HOG_enumerateFiles,     /* enumerateFiles() method */
   441     HOG_enumerateFiles,     /* enumerateFiles() method */
   462     HOG_exists,             /* exists() method         */
       
   463     HOG_isDirectory,        /* isDirectory() method    */
       
   464     HOG_isSymLink,          /* isSymLink() method      */
       
   465     HOG_openRead,           /* openRead() method       */
   442     HOG_openRead,           /* openRead() method       */
   466     HOG_openWrite,          /* openWrite() method      */
   443     HOG_openWrite,          /* openWrite() method      */
   467     HOG_openAppend,         /* openAppend() method     */
   444     HOG_openAppend,         /* openAppend() method     */
   468     HOG_remove,             /* remove() method         */
   445     HOG_remove,             /* remove() method         */
   469     HOG_mkdir,              /* mkdir() method          */
   446     HOG_mkdir,              /* mkdir() method          */