Navigation Menu

Skip to content

Commit

Permalink
More tweaks; GRP completely implemented. Everything builds clean.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 8, 2001
1 parent ee508bb commit 5918534
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
5 changes: 5 additions & 0 deletions Makefile
Expand Up @@ -145,6 +145,11 @@ MAINSRCS += archivers/zip.c
CFLAGS += -DPHYSFS_SUPPORTS_ZIP
endif

ifeq ($(strip $(use_archive_grp)),true)
MAINSRCS += archivers/grp.c
CFLAGS += -DPHYSFS_SUPPORTS_GRP
endif

# Rule for getting list of objects from source
MAINOBJS1 := $(MAINSRCS:.c=.o)
MAINOBJS2 := $(MAINOBJS1:.cpp=.o)
Expand Down
10 changes: 5 additions & 5 deletions archivers/dir.c
Expand Up @@ -14,6 +14,7 @@
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include "physfs.h"

#define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h"
Expand All @@ -30,8 +31,7 @@ static int DIR_read(FileHandle *handle, void *buffer,

errno = 0;
retval = fread(buffer, objSize, objCount, h);
if ( (retval < objCount) && (ferror(h)) )
__PHYSFS_setError(strerror(errno));
BAIL_IF_MACRO((retval < objCount) && (ferror(h)),strerror(errno),retval);

return(retval);
} /* DIR_read */
Expand Down Expand Up @@ -294,7 +294,7 @@ static const FileFunctions __PHYSFS_FileFunctions_DIRW =
DIR_eof, /* eof() method */
DIR_tell, /* tell() method */
DIR_seek, /* seek() method */
DIR_fileClose, /* fileClose() method */
DIR_fileClose /* fileClose() method */
};


Expand All @@ -311,13 +311,13 @@ const DirFunctions __PHYSFS_DirFunctions_DIR =
DIR_openAppend, /* openAppend() method */
DIR_remove, /* remove() method */
DIR_mkdir, /* mkdir() method */
DIR_dirClose, /* dirClose() method */
DIR_dirClose /* dirClose() method */
};


/* This doesn't get listed, since it's technically not an archive... */
#if 0
const __PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_DIR =
const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_DIR =
{
"DIR",
"non-archive directory I/O"
Expand Down
9 changes: 5 additions & 4 deletions archivers/zip.c
Expand Up @@ -8,6 +8,7 @@

#include <stdio.h>
#include <stdlib.h>
#include "physfs.h"

#define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h"
Expand All @@ -17,7 +18,7 @@
#endif

extern const DirFunctions __PHYSFS_DirFunctions_ZIP;
extern const FileFunctions __PHYSFS_FileHandle_ZIP;
static const FileFunctions __PHYSFS_FileFunctions_ZIP;


static int ZIP_read(FileHandle *handle, void *buffer,
Expand Down Expand Up @@ -93,7 +94,7 @@ static const FileFunctions __PHYSFS_FileFunctions_ZIP =
ZIP_eof, /* eof() method */
ZIP_tell, /* tell() method */
ZIP_seek, /* seek() method */
ZIP_fileClose, /* fileClose() method */
ZIP_fileClose /* fileClose() method */
};


Expand All @@ -110,10 +111,10 @@ const DirFunctions __PHYSFS_DirFunctions_ZIP =
NULL, /* openAppend() method */
NULL, /* remove() method */
NULL, /* mkdir() method */
ZIP_dirClose, /* dirClose() method */
ZIP_dirClose /* dirClose() method */
};

const __PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP =
const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP =
{
"ZIP",
"PkZip/WinZip/Info-Zip compatible"
Expand Down
5 changes: 5 additions & 0 deletions physfs.c
Expand Up @@ -46,6 +46,11 @@ extern const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_ZIP;
extern const DirFunctions __PHYSFS_DirFunctions_ZIP;
#endif

#if (defined PHYSFS_SUPPORTS_GRP)
extern const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_GRP;
extern const DirFunctions __PHYSFS_DirFunctions_GRP;
#endif

extern const DirFunctions __PHYSFS_DirFunctions_DIR;

static const PHYSFS_ArchiveInfo *supported_types[] =
Expand Down
1 change: 1 addition & 0 deletions physfs_internal.h
Expand Up @@ -240,6 +240,7 @@ typedef struct __PHYSFS_DIRFUNCTIONS__
#define ERR_NO_WRITE_DIR "Write directory is not set"
#define ERR_NO_SUCH_FILE "No such file"
#define ERR_PAST_EOF "Past end of file"
#define ERR_ARC_IS_READ_ONLY "Archive is read-only"

/*
* Call this to set the message returned by PHYSFS_getLastError().
Expand Down

0 comments on commit 5918534

Please sign in to comment.