Skip to content
Permalink
Browse files
Moved PHYSFS_ArchiveInfo into PHYSFS_Archiver.
  • Loading branch information
icculus committed Mar 25, 2012
1 parent 6222a4a commit 758e5beedb097545d71498d4a8caa9dcc2be8b40
Showing with 61 additions and 96 deletions.
  1. +6 −10 src/archiver_dir.c
  2. +6 −10 src/archiver_grp.c
  3. +6 −10 src/archiver_hog.c
  4. +6 −10 src/archiver_iso9660.c
  5. +6 −10 src/archiver_lzma.c
  6. +6 −10 src/archiver_mvl.c
  7. +6 −9 src/archiver_qpak.c
  8. +6 −10 src/archiver_wad.c
  9. +6 −10 src/archiver_zip.c
  10. +3 −3 src/physfs.c
  11. +4 −4 src/physfs_internal.h
@@ -178,18 +178,14 @@ static int DIR_stat(PHYSFS_Dir *opaque, const char *name,
} /* 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 */
@@ -85,18 +85,14 @@ static void *GRP_openArchive(PHYSFS_Io *io, const char *name, int forWriting)
} /* 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 */
@@ -91,18 +91,14 @@ static void *HOG_openArchive(PHYSFS_Io *io, const char *name, int forWriting)
} /* 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 */
@@ -944,18 +944,14 @@ static int ISO9660_mkdir(PHYSFS_Dir *opaque, const char *name)
} /* 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 */
@@ -676,18 +676,14 @@ static int LZMA_stat(PHYSFS_Dir *opaque, const char *filename,
} /* 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 */
@@ -78,18 +78,14 @@ static void *MVL_openArchive(PHYSFS_Io *io, const char *name, int forWriting)
} /* 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 */
@@ -94,17 +94,14 @@ static void *QPAK_openArchive(PHYSFS_Io *io, const char *name, int forWriting)
} /* 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 */
@@ -102,18 +102,14 @@ static void *WAD_openArchive(PHYSFS_Io *io, const char *name, int forWriting)
} /* 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 */
@@ -1397,18 +1397,14 @@ static int ZIP_stat(PHYSFS_Dir *opaque, const char *filename, int *exists,
} /* 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 */
@@ -885,14 +885,14 @@ static DirHandle *openDirectory(PHYSFS_Io *io, const char *d, int forWriting)
/* 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 @@ static int initStaticArchivers(void)
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);
@@ -126,10 +126,10 @@ typedef void PHYSFS_Dir;

typedef struct
{
/*
* Basic info about this archiver...
*/
const PHYSFS_ArchiveInfo *info;
/*
* Basic info about this archiver...
*/
const PHYSFS_ArchiveInfo info;


/*

0 comments on commit 758e5be

Please sign in to comment.