Moved supportsSymlinks into PHYSFS_ArchiveInfo.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 30 Nov 2012 00:04:52 -0500
changeset 1326 ac0fac4fe6d6
parent 1325 4fa1518513c4
child 1327 998351d485d9
Moved supportsSymlinks into PHYSFS_ArchiveInfo.
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_slb.c
src/archiver_wad.c
src/archiver_zip.c
src/physfs.c
src/physfs.h
test/test_physfs.c
--- a/src/archiver_dir.c	Thu Nov 29 11:48:48 2012 -0500
+++ b/src/archiver_dir.c	Fri Nov 30 00:04:52 2012 -0500
@@ -185,8 +185,8 @@
         "Non-archive, direct filesystem I/O",
         "Ryan C. Gordon <icculus@icculus.org>",
         "http://icculus.org/physfs/",
+        1,  /* supportsSymlinks */
     },
-    1,  /* supportsSymlinks */
     DIR_openArchive,        /* openArchive() method    */
     DIR_enumerateFiles,     /* enumerateFiles() method */
     DIR_openRead,           /* openRead() method       */
--- a/src/archiver_grp.c	Thu Nov 29 11:48:48 2012 -0500
+++ b/src/archiver_grp.c	Fri Nov 30 00:04:52 2012 -0500
@@ -93,8 +93,8 @@
         "Build engine Groupfile format",
         "Ryan C. Gordon <icculus@icculus.org>",
         "http://icculus.org/physfs/",
+        0,  /* supportsSymlinks */
     },
-    0,  /* supportsSymlinks */
     GRP_openArchive,        /* openArchive() method    */
     UNPK_enumerateFiles,    /* enumerateFiles() method */
     UNPK_openRead,          /* openRead() method       */
--- a/src/archiver_hog.c	Thu Nov 29 11:48:48 2012 -0500
+++ b/src/archiver_hog.c	Fri Nov 30 00:04:52 2012 -0500
@@ -99,8 +99,8 @@
         "Descent I/II HOG file format",
         "Bradley Bell <btb@icculus.org>",
         "http://icculus.org/physfs/",
+        0,  /* supportsSymlinks */
     },
-    0,  /* supportsSymlinks */
     HOG_openArchive,         /* openArchive() method    */
     UNPK_enumerateFiles,     /* enumerateFiles() method */
     UNPK_openRead,           /* openRead() method       */
--- a/src/archiver_iso9660.c	Thu Nov 29 11:48:48 2012 -0500
+++ b/src/archiver_iso9660.c	Fri Nov 30 00:04:52 2012 -0500
@@ -951,8 +951,8 @@
         "ISO9660 image file",
         "Christoph Nelles <evilazrael@evilazrael.de>",
         "http://www.evilazrael.de/",
+        0,  /* supportsSymlinks */
     },
-    0,  /* supportsSymlinks */
     ISO9660_openArchive,        /* openArchive() method    */
     ISO9660_enumerateFiles,     /* enumerateFiles() method */
     ISO9660_openRead,           /* openRead() method       */
--- a/src/archiver_lzma.c	Thu Nov 29 11:48:48 2012 -0500
+++ b/src/archiver_lzma.c	Fri Nov 30 00:04:52 2012 -0500
@@ -684,8 +684,8 @@
         "LZMA (7zip) format",
         "Dennis Schridde <devurandom@gmx.net>",
         "http://icculus.org/physfs/",
+        0,  /* supportsSymlinks */
     },
-    0,  /* supportsSymlinks */
     LZMA_openArchive,        /* openArchive() method    */
     LZMA_enumerateFiles,     /* enumerateFiles() method */
     LZMA_openRead,           /* openRead() method       */
--- a/src/archiver_mvl.c	Thu Nov 29 11:48:48 2012 -0500
+++ b/src/archiver_mvl.c	Fri Nov 30 00:04:52 2012 -0500
@@ -86,8 +86,8 @@
         "Descent II Movielib format",
         "Bradley Bell <btb@icculus.org>",
         "http://icculus.org/physfs/",
+        0,  /* supportsSymlinks */
     },
-    0,  /* supportsSymlinks */
     MVL_openArchive,        /* openArchive() method    */
     UNPK_enumerateFiles,     /* enumerateFiles() method */
     UNPK_openRead,           /* openRead() method       */
--- a/src/archiver_qpak.c	Thu Nov 29 11:48:48 2012 -0500
+++ b/src/archiver_qpak.c	Fri Nov 30 00:04:52 2012 -0500
@@ -102,8 +102,8 @@
         "Quake I/II format",
         "Ryan C. Gordon <icculus@icculus.org>",
         "http://icculus.org/physfs/",
+        0,  /* supportsSymlinks */
     },
-    0,  /* supportsSymlinks */
     QPAK_openArchive,       /* openArchive() method    */
     UNPK_enumerateFiles,    /* enumerateFiles() method */
     UNPK_openRead,          /* openRead() method       */
--- a/src/archiver_slb.c	Thu Nov 29 11:48:48 2012 -0500
+++ b/src/archiver_slb.c	Fri Nov 30 00:04:52 2012 -0500
@@ -107,8 +107,8 @@
         "I-War / Independence War Slab file",
         "Aleksi Nurmi <aleksi.nurmi@gmail.com>",
         "http://bitbucket.org/ahnurmi/",
+        0,  /* supportsSymlinks */
     },
-    0,  /* supportsSymlinks */
     SLB_openArchive,        /* openArchive() method    */
     UNPK_enumerateFiles,    /* enumerateFiles() method */
     UNPK_openRead,          /* openRead() method       */
--- a/src/archiver_wad.c	Thu Nov 29 11:48:48 2012 -0500
+++ b/src/archiver_wad.c	Fri Nov 30 00:04:52 2012 -0500
@@ -110,8 +110,8 @@
         "DOOM engine format",
         "Travis Wells <traviswells@mchsi.com>",
         "http://www.3dmm2.com/doom/",
+        0,  /* supportsSymlinks */
     },
-    0,  /* supportsSymlinks */
     WAD_openArchive,        /* openArchive() method    */
     UNPK_enumerateFiles,     /* enumerateFiles() method */
     UNPK_openRead,           /* openRead() method       */
--- a/src/archiver_zip.c	Thu Nov 29 11:48:48 2012 -0500
+++ b/src/archiver_zip.c	Fri Nov 30 00:04:52 2012 -0500
@@ -1697,8 +1697,8 @@
         "PkZip/WinZip/Info-Zip compatible",
         "Ryan C. Gordon <icculus@icculus.org>",
         "http://icculus.org/physfs/",
+        1,  /* supportsSymlinks */
     },
-    1,  /* supportsSymlinks */
     ZIP_openArchive,        /* openArchive() method    */
     ZIP_enumerateFiles,     /* enumerateFiles() method */
     ZIP_openRead,           /* openRead() method       */
--- a/src/physfs.c	Thu Nov 29 11:48:48 2012 -0500
+++ b/src/physfs.c	Fri Nov 30 00:04:52 2012 -0500
@@ -1423,6 +1423,7 @@
     CPYSTR(description);
     CPYSTR(author);
     CPYSTR(url);
+    info->supportsSymlinks = _archiver->info.supportsSymlinks;
     #undef CPYSTR
 
     ptr = allocator.Realloc(archiveInfo, len);
@@ -2316,7 +2317,7 @@
 
             else if (verifyPath(i, &arcfname, 0))
             {
-                if ((!allowSymLinks) && (i->funcs->supportsSymlinks))
+                if ((!allowSymLinks) && (i->funcs->info.supportsSymlinks))
                 {
                     filterdata.dirhandle = i;
                     i->funcs->enumerateFiles(i->opaque, arcfname,
--- a/src/physfs.h	Thu Nov 29 11:48:48 2012 -0500
+++ b/src/physfs.h	Fri Nov 30 00:04:52 2012 -0500
@@ -408,6 +408,7 @@
     const char *description; /**< Human-readable archive description. */
     const char *author;      /**< Person who did support for this archive. */
     const char *url;         /**< URL related to this archive */
+    int supportsSymlinks;    /**< non-zero if archive offers symbolic links. */
 } PHYSFS_ArchiveInfo;
 
 
@@ -3384,13 +3385,7 @@
      * This is used to identify your archive, and is returned in
      *  PHYSFS_supportedArchiveTypes().
      */
-// !! FIXME: should this be const?
-    const PHYSFS_ArchiveInfo info;
-
-    /**
-     * !!! FIXME: document me.
-     */    
-    int supportsSymlinks;
+    PHYSFS_ArchiveInfo info;
 
 // !!! FIXME: documentation: \brief?
     /**
--- a/test/test_physfs.c	Thu Nov 29 11:48:48 2012 -0500
+++ b/test/test_physfs.c	Fri Nov 30 00:04:52 2012 -0500
@@ -67,6 +67,8 @@
             printf(" * %s: %s\n    Written by %s.\n    %s\n",
                     (*i)->extension, (*i)->description,
                     (*i)->author, (*i)->url);
+            printf("    %s symbolic links.\n",
+                    (*i)->supportsSymlinks ? "Supports" : "Does not support");
         } /* for */
     } /* else */