Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Changed DirFunctions struct a little.
  • Loading branch information
icculus committed Jul 26, 2002
1 parent af32072 commit 3ae1f1f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 30 deletions.
22 changes: 10 additions & 12 deletions archivers/dir.c
Expand Up @@ -46,6 +46,15 @@ static int DIR_mkdir(DirHandle *h, const char *name);
static void DIR_dirClose(DirHandle *h);


const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_DIR =
{
"",
"non-archive directory I/O",
"Ryan C. Gordon <icculus@clutteredmind.org>",
"http://icculus.org/physfs/",
};


static const FileFunctions __PHYSFS_FileFunctions_DIR =
{
DIR_read, /* read() method */
Expand All @@ -72,6 +81,7 @@ static const FileFunctions __PHYSFS_FileFunctions_DIRW =

const DirFunctions __PHYSFS_DirFunctions_DIR =
{
&__PHYSFS_ArchiveInfo_DIR,
DIR_isArchive, /* isArchive() method */
DIR_openArchive, /* openArchive() method */
DIR_enumerateFiles, /* enumerateFiles() method */
Expand All @@ -88,18 +98,6 @@ const DirFunctions __PHYSFS_DirFunctions_DIR =
};


/* This doesn't get listed, since it's technically not an archive... */
#if 0
const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_DIR =
{
"DIR",
"non-archive directory I/O",
"Ryan C. Gordon <icculus@clutteredmind.org>",
"http://www.icculus.org/physfs/",
};
#endif


static PHYSFS_sint64 DIR_read(FileHandle *handle, void *buffer,
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
{
Expand Down
18 changes: 10 additions & 8 deletions archivers/grp.c
Expand Up @@ -90,6 +90,15 @@ static int GRP_isSymLink(DirHandle *h, const char *name);
static PHYSFS_sint64 GRP_getLastModTime(DirHandle *h, const char *name);
static FileHandle *GRP_openRead(DirHandle *h, const char *name);

const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_GRP =
{
"GRP",
"Build engine Groupfile format",
"Ryan C. Gordon <icculus@clutteredmind.org>",
"http://icculus.org/physfs/",
};


static const FileFunctions __PHYSFS_FileFunctions_GRP =
{
GRP_read, /* read() method */
Expand All @@ -104,6 +113,7 @@ static const FileFunctions __PHYSFS_FileFunctions_GRP =

const DirFunctions __PHYSFS_DirFunctions_GRP =
{
&__PHYSFS_ArchiveInfo_GRP,
GRP_isArchive, /* isArchive() method */
GRP_openArchive, /* openArchive() method */
GRP_enumerateFiles, /* enumerateFiles() method */
Expand All @@ -119,14 +129,6 @@ const DirFunctions __PHYSFS_DirFunctions_GRP =
GRP_dirClose /* dirClose() method */
};

const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_GRP =
{
"GRP",
"Build engine Groupfile format",
"Ryan C. Gordon <icculus@clutteredmind.org>",
"http://www.icculus.org/physfs/",
};



static void GRP_dirClose(DirHandle *h)
Expand Down
19 changes: 9 additions & 10 deletions archivers/zip.c
Expand Up @@ -141,10 +141,17 @@ static int ZIP_isSymLink(DirHandle *h, const char *name);
static PHYSFS_sint64 ZIP_getLastModTime(DirHandle *h, const char *name);
static FileHandle *ZIP_openRead(DirHandle *h, const char *filename);
static void ZIP_dirClose(DirHandle *h);

static int zip_resolve(void *in, ZIPinfo *info, ZIPentry *entry);


const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP =
{
"ZIP",
"PkZip/WinZip/Info-Zip compatible",
"Ryan C. Gordon <icculus@clutteredmind.org>",
"http://icculus.org/physfs/",
};

static const FileFunctions __PHYSFS_FileFunctions_ZIP =
{
ZIP_read, /* read() method */
Expand All @@ -159,6 +166,7 @@ static const FileFunctions __PHYSFS_FileFunctions_ZIP =

const DirFunctions __PHYSFS_DirFunctions_ZIP =
{
&__PHYSFS_ArchiveInfo_ZIP,
ZIP_isArchive, /* isArchive() method */
ZIP_openArchive, /* openArchive() method */
ZIP_enumerateFiles, /* enumerateFiles() method */
Expand All @@ -174,15 +182,6 @@ const DirFunctions __PHYSFS_DirFunctions_ZIP =
ZIP_dirClose /* dirClose() method */
};

const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP =
{
"ZIP",
"PkZip/WinZip/Info-Zip compatible",
"Ryan C. Gordon <icculus@clutteredmind.org>",
"http://www.icculus.org/physfs/",
};



/*
* Wrap all zlib calls in this, so the physfs error state is set appropriately.
Expand Down
2 changes: 2 additions & 0 deletions physfs_internal.h
Expand Up @@ -125,6 +125,8 @@ typedef struct __PHYSFS_DIRHANDLE__
*/
typedef struct __PHYSFS_DIRFUNCTIONS__
{
const PHYSFS_ArchiveInfo *info;

/*
* Returns non-zero if (filename) is a valid archive that this
* driver can handle. This filename is in platform-dependent
Expand Down

0 comments on commit 3ae1f1f

Please sign in to comment.