src/archiver_qpak.c
changeset 1111 20d7c2d95a98
parent 1109 c69df75dbcc3
child 1113 2136d64bd1ad
equal deleted inserted replaced
1110:803e5e8a0ff8 1111:20d7c2d95a98
   509     *fileExists = QPAK_exists(opaque, name);
   509     *fileExists = QPAK_exists(opaque, name);
   510     return 0;  /* never symlinks in a quake pak. */
   510     return 0;  /* never symlinks in a quake pak. */
   511 } /* QPAK_isSymLink */
   511 } /* QPAK_isSymLink */
   512 
   512 
   513 
   513 
   514 static PHYSFS_sint64 QPAK_getLastModTime(dvoid *opaque,
       
   515                                         const char *name,
       
   516                                         int *fileExists)
       
   517 {
       
   518     int isDir;
       
   519     QPAKinfo *info = ((QPAKinfo *) opaque);
       
   520     PHYSFS_sint64 retval = -1;
       
   521     QPAKentry *entry = qpak_find_entry(info, name, &isDir);
       
   522 
       
   523     *fileExists = ((isDir) || (entry != NULL));
       
   524     if (*fileExists)  /* use time of QPAK itself in the physical filesystem. */
       
   525         retval = info->last_mod_time;
       
   526 
       
   527     return retval;
       
   528 } /* QPAK_getLastModTime */
       
   529 
       
   530 
       
   531 static fvoid *QPAK_openRead(dvoid *opaque, const char *fnm, int *fileExists)
   514 static fvoid *QPAK_openRead(dvoid *opaque, const char *fnm, int *fileExists)
   532 {
   515 {
   533     QPAKinfo *info = ((QPAKinfo *) opaque);
   516     QPAKinfo *info = ((QPAKinfo *) opaque);
   534     QPAKfileinfo *finfo;
   517     QPAKfileinfo *finfo;
   535     QPAKentry *entry;
   518     QPAKentry *entry;
   628     QPAK_openArchive,        /* openArchive() method    */
   611     QPAK_openArchive,        /* openArchive() method    */
   629     QPAK_enumerateFiles,     /* enumerateFiles() method */
   612     QPAK_enumerateFiles,     /* enumerateFiles() method */
   630     QPAK_exists,             /* exists() method         */
   613     QPAK_exists,             /* exists() method         */
   631     QPAK_isDirectory,        /* isDirectory() method    */
   614     QPAK_isDirectory,        /* isDirectory() method    */
   632     QPAK_isSymLink,          /* isSymLink() method      */
   615     QPAK_isSymLink,          /* isSymLink() method      */
   633     QPAK_getLastModTime,     /* getLastModTime() method */
       
   634     QPAK_openRead,           /* openRead() method       */
   616     QPAK_openRead,           /* openRead() method       */
   635     QPAK_openWrite,          /* openWrite() method      */
   617     QPAK_openWrite,          /* openWrite() method      */
   636     QPAK_openAppend,         /* openAppend() method     */
   618     QPAK_openAppend,         /* openAppend() method     */
   637     QPAK_remove,             /* remove() method         */
   619     QPAK_remove,             /* remove() method         */
   638     QPAK_mkdir,              /* mkdir() method          */
   620     QPAK_mkdir,              /* mkdir() method          */