Removed getLastModTime() interface from the archivers; it's not used anymore.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 22 Aug 2010 20:20:04 -0400
changeset 1111 20d7c2d95a98
parent 1110 803e5e8a0ff8
child 1112 12e187aa051c
Removed getLastModTime() interface from the archivers; it's not used anymore.
src/archiver_dir.c
src/archiver_grp.c
src/archiver_hog.c
src/archiver_iso9660.c
src/archiver_lzma.c
src/archiver_mvl.c
src/archiver_qpak.c
src/archiver_wad.c
src/archiver_zip.c
src/physfs.h
src/physfs_internal.h
--- a/src/archiver_dir.c	Sun Aug 22 03:43:22 2010 -0400
+++ b/src/archiver_dir.c	Sun Aug 22 20:20:04 2010 -0400
@@ -147,22 +147,6 @@
 } /* DIR_isSymLink */
 
 
-static PHYSFS_sint64 DIR_getLastModTime(dvoid *opaque,
-                                        const char *name,
-                                        int *fileExists)
-{
-    char *d = __PHYSFS_platformCvtToDependent((char *) opaque, name, NULL);
-    PHYSFS_sint64 retval = -1;
-
-    BAIL_IF_MACRO(d == NULL, NULL, 0);
-    *fileExists = __PHYSFS_platformExists(d);
-    if (*fileExists)
-        retval = __PHYSFS_platformGetLastModTime(d);
-    allocator.Free(d);
-    return retval;
-} /* DIR_getLastModTime */
-
-
 static fvoid *doOpen(dvoid *opaque, const char *name,
                      void *(*openFunc)(const char *filename),
                      int *fileExists)
@@ -268,7 +252,6 @@
     DIR_exists,             /* exists() method         */
     DIR_isDirectory,        /* isDirectory() method    */
     DIR_isSymLink,          /* isSymLink() method      */
-    DIR_getLastModTime,     /* getLastModTime() method */
     DIR_openRead,           /* openRead() method       */
     DIR_openWrite,          /* openWrite() method      */
     DIR_openAppend,         /* openAppend() method     */
--- a/src/archiver_grp.c	Sun Aug 22 03:43:22 2010 -0400
+++ b/src/archiver_grp.c	Sun Aug 22 20:20:04 2010 -0400
@@ -367,21 +367,6 @@
 } /* GRP_isSymLink */
 
 
-static PHYSFS_sint64 GRP_getLastModTime(dvoid *opaque,
-                                        const char *name,
-                                        int *fileExists)
-{
-    GRPinfo *info = (GRPinfo *) opaque;
-    PHYSFS_sint64 retval = -1;
-
-    *fileExists = (grp_find_entry(info, name) != NULL);
-    if (*fileExists)  /* use time of GRP itself in the physical filesystem. */
-        retval = info->last_mod_time;
-
-    return retval;
-} /* GRP_getLastModTime */
-
-
 static fvoid *GRP_openRead(dvoid *opaque, const char *fnm, int *fileExists)
 {
     GRPinfo *info = (GRPinfo *) opaque;
@@ -472,7 +457,6 @@
     GRP_exists,             /* exists() method         */
     GRP_isDirectory,        /* isDirectory() method    */
     GRP_isSymLink,          /* isSymLink() method      */
-    GRP_getLastModTime,     /* getLastModTime() method */
     GRP_openRead,           /* openRead() method       */
     GRP_openWrite,          /* openWrite() method      */
     GRP_openAppend,         /* openAppend() method     */
--- a/src/archiver_hog.c	Sun Aug 22 03:43:22 2010 -0400
+++ b/src/archiver_hog.c	Sun Aug 22 20:20:04 2010 -0400
@@ -402,21 +402,6 @@
 } /* HOG_isSymLink */
 
 
-static PHYSFS_sint64 HOG_getLastModTime(dvoid *opaque,
-                                        const char *name,
-                                        int *fileExists)
-{
-    HOGinfo *info = ((HOGinfo *) opaque);
-    PHYSFS_sint64 retval = -1;
-
-    *fileExists = (hog_find_entry(info, name) != NULL);
-    if (*fileExists)  /* use time of HOG itself in the physical filesystem. */
-        retval = info->last_mod_time;
-
-    return retval;
-} /* HOG_getLastModTime */
-
-
 static fvoid *HOG_openRead(dvoid *opaque, const char *fnm, int *fileExists)
 {
     HOGinfo *info = ((HOGinfo *) opaque);
@@ -507,7 +492,6 @@
     HOG_exists,             /* exists() method         */
     HOG_isDirectory,        /* isDirectory() method    */
     HOG_isSymLink,          /* isSymLink() method      */
-    HOG_getLastModTime,     /* getLastModTime() method */
     HOG_openRead,           /* openRead() method       */
     HOG_openWrite,          /* openWrite() method      */
     HOG_openAppend,         /* openAppend() method     */
--- a/src/archiver_iso9660.c	Sun Aug 22 03:43:22 2010 -0400
+++ b/src/archiver_iso9660.c	Sun Aug 22 20:20:04 2010 -0400
@@ -940,16 +940,6 @@
 } /* ISO9660_isSymLink */
 
 
-static PHYSFS_sint64 ISO9660_getLastModTime(dvoid *opaque, const char *name,
-                                            int *fileExists)
-{
-    ISO9660Handle *handle = (ISO9660Handle*) opaque;
-    ISO9660FileDescriptor descriptor;
-    BAIL_IF_MACRO(iso_find_dir_entry(handle, name, &descriptor, fileExists), NULL, -1);
-    return iso_mktime(&descriptor.recordtime);
-} /* ISO9660_getLastModTime */
-
-
 /*******************************************************************************
  * Not supported functions
  ******************************************************************************/
@@ -1001,7 +991,6 @@
     ISO9660_exists,             /* exists() method         */
     ISO9660_isDirectory,        /* isDirectory() method    */
     ISO9660_isSymLink,          /* isSymLink() method      */
-    ISO9660_getLastModTime,     /* getLastModTime() method */
     ISO9660_openRead,           /* openRead() method       */
     ISO9660_openWrite,          /* openWrite() method      */
     ISO9660_openAppend,         /* openAppend() method     */
--- a/src/archiver_lzma.c	Sun Aug 22 03:43:22 2010 -0400
+++ b/src/archiver_lzma.c	Sun Aug 22 20:20:04 2010 -0400
@@ -600,22 +600,6 @@
 } /* LZMA_exists */
 
 
-static PHYSFS_sint64 LZMA_getLastModTime(dvoid *opaque,
-                                         const char *name,
-                                         int *fileExists)
-{
-    LZMAarchive *archive = (LZMAarchive *) opaque;
-    LZMAfile *file = lzma_find_file(archive, name);
-
-    *fileExists = (file != NULL);
-
-    BAIL_IF_MACRO(file == NULL, NULL, -1);
-	BAIL_IF_MACRO(!file->item->IsLastWriteTimeDefined, NULL, -1); /* write-time may not be defined for every file */
-
-    return lzma_filetime_to_unix_timestamp(&file->item->LastWriteTime);
-} /* LZMA_getLastModTime */
-
-
 static int LZMA_isDirectory(dvoid *opaque, const char *name, int *fileExists)
 {
     LZMAarchive *archive = (LZMAarchive *) opaque;
@@ -743,7 +727,6 @@
     LZMA_exists,             /* exists() method         */
     LZMA_isDirectory,        /* isDirectory() method    */
     LZMA_isSymLink,          /* isSymLink() method      */
-    LZMA_getLastModTime,     /* getLastModTime() method */
     LZMA_openRead,           /* openRead() method       */
     LZMA_openWrite,          /* openWrite() method      */
     LZMA_openAppend,         /* openAppend() method     */
--- a/src/archiver_mvl.c	Sun Aug 22 03:43:22 2010 -0400
+++ b/src/archiver_mvl.c	Sun Aug 22 20:20:04 2010 -0400
@@ -362,21 +362,6 @@
 } /* MVL_isSymLink */
 
 
-static PHYSFS_sint64 MVL_getLastModTime(dvoid *opaque,
-                                        const char *name,
-                                        int *fileExists)
-{
-    MVLinfo *info = ((MVLinfo *) opaque);
-    PHYSFS_sint64 retval = -1;
-
-    *fileExists = (mvl_find_entry(info, name) != NULL);
-    if (*fileExists)  /* use time of MVL itself in the physical filesystem. */
-        retval = info->last_mod_time;
-
-    return retval;
-} /* MVL_getLastModTime */
-
-
 static fvoid *MVL_openRead(dvoid *opaque, const char *fnm, int *fileExists)
 {
     MVLinfo *info = ((MVLinfo *) opaque);
@@ -467,7 +452,6 @@
     MVL_exists,             /* exists() method         */
     MVL_isDirectory,        /* isDirectory() method    */
     MVL_isSymLink,          /* isSymLink() method      */
-    MVL_getLastModTime,     /* getLastModTime() method */
     MVL_openRead,           /* openRead() method       */
     MVL_openWrite,          /* openWrite() method      */
     MVL_openAppend,         /* openAppend() method     */
--- a/src/archiver_qpak.c	Sun Aug 22 03:43:22 2010 -0400
+++ b/src/archiver_qpak.c	Sun Aug 22 20:20:04 2010 -0400
@@ -511,23 +511,6 @@
 } /* QPAK_isSymLink */
 
 
-static PHYSFS_sint64 QPAK_getLastModTime(dvoid *opaque,
-                                        const char *name,
-                                        int *fileExists)
-{
-    int isDir;
-    QPAKinfo *info = ((QPAKinfo *) opaque);
-    PHYSFS_sint64 retval = -1;
-    QPAKentry *entry = qpak_find_entry(info, name, &isDir);
-
-    *fileExists = ((isDir) || (entry != NULL));
-    if (*fileExists)  /* use time of QPAK itself in the physical filesystem. */
-        retval = info->last_mod_time;
-
-    return retval;
-} /* QPAK_getLastModTime */
-
-
 static fvoid *QPAK_openRead(dvoid *opaque, const char *fnm, int *fileExists)
 {
     QPAKinfo *info = ((QPAKinfo *) opaque);
@@ -630,7 +613,6 @@
     QPAK_exists,             /* exists() method         */
     QPAK_isDirectory,        /* isDirectory() method    */
     QPAK_isSymLink,          /* isSymLink() method      */
-    QPAK_getLastModTime,     /* getLastModTime() method */
     QPAK_openRead,           /* openRead() method       */
     QPAK_openWrite,          /* openWrite() method      */
     QPAK_openAppend,         /* openAppend() method     */
--- a/src/archiver_wad.c	Sun Aug 22 03:43:22 2010 -0400
+++ b/src/archiver_wad.c	Sun Aug 22 20:20:04 2010 -0400
@@ -421,21 +421,6 @@
 } /* WAD_isSymLink */
 
 
-static PHYSFS_sint64 WAD_getLastModTime(dvoid *opaque,
-                                        const char *name,
-                                        int *fileExists)
-{
-    WADinfo *info = ((WADinfo *) opaque);
-    PHYSFS_sint64 retval = -1;
-
-    *fileExists = (wad_find_entry(info, name) != NULL);
-    if (*fileExists)  /* use time of WAD itself in the physical filesystem. */
-        retval = info->last_mod_time;
-
-    return retval;
-} /* WAD_getLastModTime */
-
-
 static fvoid *WAD_openRead(dvoid *opaque, const char *fnm, int *fileExists)
 {
     WADinfo *info = ((WADinfo *) opaque);
@@ -526,7 +511,6 @@
     WAD_exists,             /* exists() method         */
     WAD_isDirectory,        /* isDirectory() method    */
     WAD_isSymLink,          /* isSymLink() method      */
-    WAD_getLastModTime,     /* getLastModTime() method */
     WAD_openRead,           /* openRead() method       */
     WAD_openWrite,          /* openWrite() method      */
     WAD_openAppend,         /* openAppend() method     */
--- a/src/archiver_zip.c	Sun Aug 22 03:43:22 2010 -0400
+++ b/src/archiver_zip.c	Sun Aug 22 20:20:04 2010 -0400
@@ -1240,23 +1240,6 @@
 } /* ZIP_exists */
 
 
-static PHYSFS_sint64 ZIP_getLastModTime(dvoid *opaque,
-                                        const char *name,
-                                        int *fileExists)
-{
-    int isDir;
-    ZIPinfo *info = (ZIPinfo *) opaque;
-    ZIPentry *entry = zip_find_entry(info, name, &isDir);
-
-    *fileExists = ((isDir) || (entry != NULL));
-    if (isDir)
-        return 1;  /* Best I can do for a dir... */
-
-    BAIL_IF_MACRO(entry == NULL, NULL, -1);
-    return entry->last_mod_time;
-} /* ZIP_getLastModTime */
-
-
 static int ZIP_isDirectory(dvoid *opaque, const char *name, int *fileExists)
 {
     ZIPinfo *info = (ZIPinfo *) opaque;
@@ -1455,7 +1438,6 @@
     ZIP_exists,             /* exists() method         */
     ZIP_isDirectory,        /* isDirectory() method    */
     ZIP_isSymLink,          /* isSymLink() method      */
-    ZIP_getLastModTime,     /* getLastModTime() method */
     ZIP_openRead,           /* openRead() method       */
     ZIP_openWrite,          /* openWrite() method      */
     ZIP_openAppend,         /* openAppend() method     */
--- a/src/physfs.h	Sun Aug 22 03:43:22 2010 -0400
+++ b/src/physfs.h	Sun Aug 22 20:20:04 2010 -0400
@@ -1132,14 +1132,17 @@
  * \fn PHYSFS_sint64 PHYSFS_getLastModTime(const char *filename)
  * \brief Get the last modification time of a file.
  *
+ * \deprecated As of PhysicsFS 2.1, use PHYSFS_stat() instead. This
+ *             function just wraps it anyhow.
+ *
  * The modtime is returned as a number of seconds since the Unix epoch
  *  (midnight, Jan 1, 1970). The exact derivation and accuracy of this time
  *  depends on the particular archiver. If there is no reasonable way to
  *  obtain this information for a particular archiver, or there was some sort
  *  of error, this function returns (-1).
  *
- * \deprecated As of PhysicsFS 2.1, use PHYSFS_stat() instead. This
- *             function just wraps it anyhow.
+ * You must use this and not PHYSFS_stat() if binary compatibility with
+ *  PhysicsFS 2.0 is important (which it may not be for many people).
  *
  *   \param filename filename to check, in platform-independent notation.
  *  \return last modified time of the file. -1 if it can't be determined.
--- a/src/physfs_internal.h	Sun Aug 22 03:43:22 2010 -0400
+++ b/src/physfs_internal.h	Sun Aug 22 20:20:04 2010 -0400
@@ -807,18 +807,6 @@
     int (*isSymLink)(dvoid *opaque, const char *name, int *fileExists);
 
         /*
-         * Retrieve the last modification time (mtime) of a file.
-         *  Returns -1 on failure, or the file's mtime in seconds since
-         *  the epoch (Jan 1, 1970) on success.
-         *  This filename is in platform-independent notation.
-         *
-         * Regardless of success or failure, please set *exists to
-         *  non-zero if the file existed (even if it's a broken symlink!),
-         *  zero if it did not.
-         */
-    PHYSFS_sint64 (*getLastModTime)(dvoid *opaque, const char *fnm, int *exist);
-
-        /*
          * Open file for reading.
          *  This filename is in platform-independent notation.
          * If you can't handle multiple opens of the same file,