Moved PHYSFS_ArchiveInfo into PHYSFS_Archiver.
This commit is contained in:
parent
6222a4a92d
commit
758e5beedb
|
@ -178,18 +178,14 @@ static int DIR_stat(PHYSFS_Dir *opaque, const char *name,
|
||||||
} /* DIR_stat */
|
} /* 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 =
|
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_openArchive, /* openArchive() method */
|
||||||
DIR_enumerateFiles, /* enumerateFiles() method */
|
DIR_enumerateFiles, /* enumerateFiles() method */
|
||||||
DIR_openRead, /* openRead() method */
|
DIR_openRead, /* openRead() method */
|
||||||
|
|
|
@ -85,18 +85,14 @@ static void *GRP_openArchive(PHYSFS_Io *io, const char *name, int forWriting)
|
||||||
} /* GRP_openArchive */
|
} /* 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 =
|
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 */
|
GRP_openArchive, /* openArchive() method */
|
||||||
UNPK_enumerateFiles, /* enumerateFiles() method */
|
UNPK_enumerateFiles, /* enumerateFiles() method */
|
||||||
UNPK_openRead, /* openRead() method */
|
UNPK_openRead, /* openRead() method */
|
||||||
|
|
|
@ -91,18 +91,14 @@ static void *HOG_openArchive(PHYSFS_Io *io, const char *name, int forWriting)
|
||||||
} /* HOG_openArchive */
|
} /* 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 =
|
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 */
|
HOG_openArchive, /* openArchive() method */
|
||||||
UNPK_enumerateFiles, /* enumerateFiles() method */
|
UNPK_enumerateFiles, /* enumerateFiles() method */
|
||||||
UNPK_openRead, /* openRead() method */
|
UNPK_openRead, /* openRead() method */
|
||||||
|
|
|
@ -944,18 +944,14 @@ static int ISO9660_mkdir(PHYSFS_Dir *opaque, const char *name)
|
||||||
} /* ISO9660_mkdir */
|
} /* 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 =
|
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_openArchive, /* openArchive() method */
|
||||||
ISO9660_enumerateFiles, /* enumerateFiles() method */
|
ISO9660_enumerateFiles, /* enumerateFiles() method */
|
||||||
ISO9660_openRead, /* openRead() method */
|
ISO9660_openRead, /* openRead() method */
|
||||||
|
|
|
@ -676,18 +676,14 @@ static int LZMA_stat(PHYSFS_Dir *opaque, const char *filename,
|
||||||
} /* LZMA_stat */
|
} /* 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 =
|
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_openArchive, /* openArchive() method */
|
||||||
LZMA_enumerateFiles, /* enumerateFiles() method */
|
LZMA_enumerateFiles, /* enumerateFiles() method */
|
||||||
LZMA_openRead, /* openRead() method */
|
LZMA_openRead, /* openRead() method */
|
||||||
|
|
|
@ -78,18 +78,14 @@ static void *MVL_openArchive(PHYSFS_Io *io, const char *name, int forWriting)
|
||||||
} /* MVL_openArchive */
|
} /* 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 =
|
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 */
|
MVL_openArchive, /* openArchive() method */
|
||||||
UNPK_enumerateFiles, /* enumerateFiles() method */
|
UNPK_enumerateFiles, /* enumerateFiles() method */
|
||||||
UNPK_openRead, /* openRead() method */
|
UNPK_openRead, /* openRead() method */
|
||||||
|
|
|
@ -94,17 +94,14 @@ static void *QPAK_openArchive(PHYSFS_Io *io, const char *name, int forWriting)
|
||||||
} /* QPAK_openArchive */
|
} /* 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 =
|
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 */
|
QPAK_openArchive, /* openArchive() method */
|
||||||
UNPK_enumerateFiles, /* enumerateFiles() method */
|
UNPK_enumerateFiles, /* enumerateFiles() method */
|
||||||
UNPK_openRead, /* openRead() method */
|
UNPK_openRead, /* openRead() method */
|
||||||
|
|
|
@ -102,18 +102,14 @@ static void *WAD_openArchive(PHYSFS_Io *io, const char *name, int forWriting)
|
||||||
} /* WAD_openArchive */
|
} /* 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 =
|
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 */
|
WAD_openArchive, /* openArchive() method */
|
||||||
UNPK_enumerateFiles, /* enumerateFiles() method */
|
UNPK_enumerateFiles, /* enumerateFiles() method */
|
||||||
UNPK_openRead, /* openRead() method */
|
UNPK_openRead, /* openRead() method */
|
||||||
|
|
|
@ -1397,18 +1397,14 @@ static int ZIP_stat(PHYSFS_Dir *opaque, const char *filename, int *exists,
|
||||||
} /* ZIP_stat */
|
} /* 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 =
|
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_openArchive, /* openArchive() method */
|
||||||
ZIP_enumerateFiles, /* enumerateFiles() method */
|
ZIP_enumerateFiles, /* enumerateFiles() method */
|
||||||
ZIP_openRead, /* openRead() 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... */
|
/* Look for archivers with matching file extensions first... */
|
||||||
for (i = archivers; (*i != NULL) && (retval == NULL); i++)
|
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);
|
retval = tryOpenDir(io, *i, d, forWriting);
|
||||||
} /* for */
|
} /* for */
|
||||||
|
|
||||||
/* failing an exact file extension match, try all the others... */
|
/* failing an exact file extension match, try all the others... */
|
||||||
for (i = archivers; (*i != NULL) && (retval == NULL); i++)
|
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);
|
retval = tryOpenDir(io, *i, d, forWriting);
|
||||||
} /* for */
|
} /* for */
|
||||||
} /* if */
|
} /* if */
|
||||||
|
@ -1137,7 +1137,7 @@ static int initStaticArchivers(void)
|
||||||
BAIL_IF_MACRO(!archivers, PHYSFS_ERR_OUT_OF_MEMORY, 0);
|
BAIL_IF_MACRO(!archivers, PHYSFS_ERR_OUT_OF_MEMORY, 0);
|
||||||
|
|
||||||
for (i = 0; i < numStaticArchivers - 1; i++)
|
for (i = 0; i < numStaticArchivers - 1; i++)
|
||||||
archiveInfo[i] = staticArchivers[i]->info;
|
archiveInfo[i] = &staticArchivers[i]->info;
|
||||||
archiveInfo[numStaticArchivers - 1] = NULL;
|
archiveInfo[numStaticArchivers - 1] = NULL;
|
||||||
|
|
||||||
memcpy(archivers, staticArchivers, len);
|
memcpy(archivers, staticArchivers, len);
|
||||||
|
|
|
@ -126,10 +126,10 @@ typedef void PHYSFS_Dir;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Basic info about this archiver...
|
* Basic info about this archiver...
|
||||||
*/
|
*/
|
||||||
const PHYSFS_ArchiveInfo *info;
|
const PHYSFS_ArchiveInfo info;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue