Moved PHYSFS_ArchiveInfo into PHYSFS_Archiver.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 25 Mar 2012 17:17:56 -0400
changeset 1281 cd136b8d3b1a
parent 1280 bd174b99fa5b
child 1282 62256a6a8e4e
Moved PHYSFS_ArchiveInfo into PHYSFS_Archiver.
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.c
src/physfs_internal.h
--- a/src/archiver_dir.c	Sun Mar 25 17:18:24 2012 -0400
+++ b/src/archiver_dir.c	Sun Mar 25 17:17:56 2012 -0400
@@ -178,18 +178,14 @@
 } /* DIR_stat */
 
 
-const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_DIR =
-{
-    "",
-    "Non-archive, direct filesystem I/O",
-    "Ryan C. Gordon <icculus@icculus.org>",
-    "http://icculus.org/physfs/",
-};
-
-
 const PHYSFS_Archiver __PHYSFS_Archiver_DIR =
 {
-    &__PHYSFS_ArchiveInfo_DIR,
+    {
+        "",
+        "Non-archive, direct filesystem I/O",
+        "Ryan C. Gordon <icculus@icculus.org>",
+        "http://icculus.org/physfs/",
+    },
     DIR_openArchive,        /* openArchive() method    */
     DIR_enumerateFiles,     /* enumerateFiles() method */
     DIR_openRead,           /* openRead() method       */
--- a/src/archiver_grp.c	Sun Mar 25 17:18:24 2012 -0400
+++ b/src/archiver_grp.c	Sun Mar 25 17:17:56 2012 -0400
@@ -85,18 +85,14 @@
 } /* GRP_openArchive */
 
 
-const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_GRP =
-{
-    "GRP",
-    "Build engine Groupfile format",
-    "Ryan C. Gordon <icculus@icculus.org>",
-    "http://icculus.org/physfs/",
-};
-
-
 const PHYSFS_Archiver __PHYSFS_Archiver_GRP =
 {
-    &__PHYSFS_ArchiveInfo_GRP,
+    {
+        "GRP",
+        "Build engine Groupfile format",
+        "Ryan C. Gordon <icculus@icculus.org>",
+        "http://icculus.org/physfs/",
+    },
     GRP_openArchive,        /* openArchive() method    */
     UNPK_enumerateFiles,    /* enumerateFiles() method */
     UNPK_openRead,          /* openRead() method       */
--- a/src/archiver_hog.c	Sun Mar 25 17:18:24 2012 -0400
+++ b/src/archiver_hog.c	Sun Mar 25 17:17:56 2012 -0400
@@ -91,18 +91,14 @@
 } /* HOG_openArchive */
 
 
-const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_HOG =
-{
-    "HOG",
-    "Descent I/II HOG file format",
-    "Bradley Bell <btb@icculus.org>",
-    "http://icculus.org/physfs/",
-};
-
-
 const PHYSFS_Archiver __PHYSFS_Archiver_HOG =
 {
-    &__PHYSFS_ArchiveInfo_HOG,
+    {
+        "HOG",
+        "Descent I/II HOG file format",
+        "Bradley Bell <btb@icculus.org>",
+        "http://icculus.org/physfs/",
+    },
     HOG_openArchive,         /* openArchive() method    */
     UNPK_enumerateFiles,     /* enumerateFiles() method */
     UNPK_openRead,           /* openRead() method       */
--- a/src/archiver_iso9660.c	Sun Mar 25 17:18:24 2012 -0400
+++ b/src/archiver_iso9660.c	Sun Mar 25 17:17:56 2012 -0400
@@ -944,18 +944,14 @@
 } /* ISO9660_mkdir */
 
 
-
-const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ISO9660 =
-{
-    "ISO",
-    "ISO9660 image file",
-    "Christoph Nelles <evilazrael@evilazrael.de>",
-    "http://www.evilazrael.de",
-};
-
 const PHYSFS_Archiver __PHYSFS_Archiver_ISO9660 =
 {
-    &__PHYSFS_ArchiveInfo_ISO9660,
+    {
+        "ISO",
+        "ISO9660 image file",
+        "Christoph Nelles <evilazrael@evilazrael.de>",
+        "http://www.evilazrael.de/",
+    },
     ISO9660_openArchive,        /* openArchive() method    */
     ISO9660_enumerateFiles,     /* enumerateFiles() method */
     ISO9660_openRead,           /* openRead() method       */
--- a/src/archiver_lzma.c	Sun Mar 25 17:18:24 2012 -0400
+++ b/src/archiver_lzma.c	Sun Mar 25 17:17:56 2012 -0400
@@ -676,18 +676,14 @@
 } /* LZMA_stat */
 
 
-const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_LZMA =
-{
-    "7Z",
-    "LZMA (7zip) format",
-    "Dennis Schridde <devurandom@gmx.net>",
-    "http://icculus.org/physfs/",
-};
-
-
 const PHYSFS_Archiver __PHYSFS_Archiver_LZMA =
 {
-    &__PHYSFS_ArchiveInfo_LZMA,
+    {
+        "7Z",
+        "LZMA (7zip) format",
+        "Dennis Schridde <devurandom@gmx.net>",
+        "http://icculus.org/physfs/",
+    },
     LZMA_openArchive,        /* openArchive() method    */
     LZMA_enumerateFiles,     /* enumerateFiles() method */
     LZMA_openRead,           /* openRead() method       */
--- a/src/archiver_mvl.c	Sun Mar 25 17:18:24 2012 -0400
+++ b/src/archiver_mvl.c	Sun Mar 25 17:17:56 2012 -0400
@@ -78,18 +78,14 @@
 } /* MVL_openArchive */
 
 
-const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_MVL =
-{
-    "MVL",
-    "Descent II Movielib format",
-    "Bradley Bell <btb@icculus.org>",
-    "http://icculus.org/physfs/",
-};
-
-
 const PHYSFS_Archiver __PHYSFS_Archiver_MVL =
 {
-    &__PHYSFS_ArchiveInfo_MVL,
+    {
+        "MVL",
+        "Descent II Movielib format",
+        "Bradley Bell <btb@icculus.org>",
+        "http://icculus.org/physfs/",
+    },
     MVL_openArchive,        /* openArchive() method    */
     UNPK_enumerateFiles,     /* enumerateFiles() method */
     UNPK_openRead,           /* openRead() method       */
--- a/src/archiver_qpak.c	Sun Mar 25 17:18:24 2012 -0400
+++ b/src/archiver_qpak.c	Sun Mar 25 17:17:56 2012 -0400
@@ -94,17 +94,14 @@
 } /* QPAK_openArchive */
 
 
-const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_QPAK =
-{
-    "PAK",
-    "Quake I/II format",
-    "Ryan C. Gordon <icculus@icculus.org>",
-    "http://icculus.org/physfs/",
-};
-
 const PHYSFS_Archiver __PHYSFS_Archiver_QPAK =
 {
-    &__PHYSFS_ArchiveInfo_QPAK,
+    {
+        "PAK",
+        "Quake I/II format",
+        "Ryan C. Gordon <icculus@icculus.org>",
+        "http://icculus.org/physfs/",
+    },
     QPAK_openArchive,       /* openArchive() method    */
     UNPK_enumerateFiles,    /* enumerateFiles() method */
     UNPK_openRead,          /* openRead() method       */
--- a/src/archiver_wad.c	Sun Mar 25 17:18:24 2012 -0400
+++ b/src/archiver_wad.c	Sun Mar 25 17:17:56 2012 -0400
@@ -102,18 +102,14 @@
 } /* WAD_openArchive */
 
 
-const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_WAD =
-{
-    "WAD",
-    "DOOM engine format",
-    "Travis Wells <traviswells@mchsi.com>",
-    "http://www.3dmm2.com/doom/",
-};
-
-
 const PHYSFS_Archiver __PHYSFS_Archiver_WAD =
 {
-    &__PHYSFS_ArchiveInfo_WAD,
+    {
+        "WAD",
+        "DOOM engine format",
+        "Travis Wells <traviswells@mchsi.com>",
+        "http://www.3dmm2.com/doom/",
+    },
     WAD_openArchive,        /* openArchive() method    */
     UNPK_enumerateFiles,     /* enumerateFiles() method */
     UNPK_openRead,           /* openRead() method       */
--- a/src/archiver_zip.c	Sun Mar 25 17:18:24 2012 -0400
+++ b/src/archiver_zip.c	Sun Mar 25 17:17:56 2012 -0400
@@ -1397,18 +1397,14 @@
 } /* ZIP_stat */
 
 
-const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP =
-{
-    "ZIP",
-    "PkZip/WinZip/Info-Zip compatible",
-    "Ryan C. Gordon <icculus@icculus.org>",
-    "http://icculus.org/physfs/",
-};
-
-
 const PHYSFS_Archiver __PHYSFS_Archiver_ZIP =
 {
-    &__PHYSFS_ArchiveInfo_ZIP,
+    {
+        "ZIP",
+        "PkZip/WinZip/Info-Zip compatible",
+        "Ryan C. Gordon <icculus@icculus.org>",
+        "http://icculus.org/physfs/",
+    },
     ZIP_openArchive,        /* openArchive() method    */
     ZIP_enumerateFiles,     /* enumerateFiles() method */
     ZIP_openRead,           /* openRead() method       */
--- a/src/physfs.c	Sun Mar 25 17:18:24 2012 -0400
+++ b/src/physfs.c	Sun Mar 25 17:17:56 2012 -0400
@@ -885,14 +885,14 @@
         /* Look for archivers with matching file extensions first... */
         for (i = archivers; (*i != NULL) && (retval == NULL); i++)
         {
-            if (__PHYSFS_stricmpASCII(ext, (*i)->info->extension) == 0)
+            if (__PHYSFS_stricmpASCII(ext, (*i)->info.extension) == 0)
                 retval = tryOpenDir(io, *i, d, forWriting);
         } /* for */
 
         /* failing an exact file extension match, try all the others... */
         for (i = archivers; (*i != NULL) && (retval == NULL); i++)
         {
-            if (__PHYSFS_stricmpASCII(ext, (*i)->info->extension) != 0)
+            if (__PHYSFS_stricmpASCII(ext, (*i)->info.extension) != 0)
                 retval = tryOpenDir(io, *i, d, forWriting);
         } /* for */
     } /* if */
@@ -1137,7 +1137,7 @@
     BAIL_IF_MACRO(!archivers, PHYSFS_ERR_OUT_OF_MEMORY, 0);
 
     for (i = 0; i < numStaticArchivers - 1; i++)
-        archiveInfo[i] = staticArchivers[i]->info;
+        archiveInfo[i] = &staticArchivers[i]->info;
     archiveInfo[numStaticArchivers - 1] = NULL;
 
     memcpy(archivers, staticArchivers, len);
--- a/src/physfs_internal.h	Sun Mar 25 17:18:24 2012 -0400
+++ b/src/physfs_internal.h	Sun Mar 25 17:17:56 2012 -0400
@@ -126,10 +126,10 @@
 
 typedef struct
 {
-        /*
-         * Basic info about this archiver...
-         */
-    const PHYSFS_ArchiveInfo *info;
+    /*
+     * Basic info about this archiver...
+     */
+    const PHYSFS_ArchiveInfo info;
 
 
     /*