Skip to content
Permalink
Browse files
Removed "dvoid" typedef.
  • Loading branch information
icculus committed Mar 25, 2012
1 parent 716ea05 commit b3fbba7af0242821ac0389b0b51db29f46a60111
Showing with 78 additions and 79 deletions.
  1. +0 −1 docs/TODO.txt
  2. +10 −10 src/archiver_dir.c
  3. +9 −8 src/archiver_iso9660.c
  4. +10 −9 src/archiver_lzma.c
  5. +13 −12 src/archiver_unpacked.c
  6. +9 −8 src/archiver_zip.c
  7. +27 −31 src/physfs_internal.h
@@ -47,7 +47,6 @@ From old TODO.txt...
- fscanf and fprintf support in extras dir.
- Sanity check byte order at runtime.
- Memory locking?
- Find a better name than dvoid and fvoid.
- General code audit.
- Multiple write dirs with mount points?
- Replace code from SDL...
@@ -66,7 +66,7 @@ static void *DIR_openArchive(PHYSFS_Io *io, const char *name, int forWriting)
} /* DIR_openArchive */


static void DIR_enumerateFiles(dvoid *opaque, const char *dname,
static void DIR_enumerateFiles(PHYSFS_Dir *opaque, const char *dname,
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
const char *origdir, void *callbackdata)
{
@@ -82,7 +82,7 @@ static void DIR_enumerateFiles(dvoid *opaque, const char *dname,
} /* DIR_enumerateFiles */


static PHYSFS_Io *doOpen(dvoid *opaque, const char *name,
static PHYSFS_Io *doOpen(PHYSFS_Dir *opaque, const char *name,
const int mode, int *fileExists)
{
char *f;
@@ -114,25 +114,25 @@ static PHYSFS_Io *doOpen(dvoid *opaque, const char *name,
} /* doOpen */


static PHYSFS_Io *DIR_openRead(dvoid *opaque, const char *fnm, int *exist)
static PHYSFS_Io *DIR_openRead(PHYSFS_Dir *opaque, const char *fnm, int *exist)
{
return doOpen(opaque, fnm, 'r', exist);
} /* DIR_openRead */


static PHYSFS_Io *DIR_openWrite(dvoid *opaque, const char *filename)
static PHYSFS_Io *DIR_openWrite(PHYSFS_Dir *opaque, const char *filename)
{
return doOpen(opaque, filename, 'w', NULL);
} /* DIR_openWrite */


static PHYSFS_Io *DIR_openAppend(dvoid *opaque, const char *filename)
static PHYSFS_Io *DIR_openAppend(PHYSFS_Dir *opaque, const char *filename)
{
return doOpen(opaque, filename, 'a', NULL);
} /* DIR_openAppend */


static int DIR_remove(dvoid *opaque, const char *name)
static int DIR_remove(PHYSFS_Dir *opaque, const char *name)
{
int retval;
char *f;
@@ -145,7 +145,7 @@ static int DIR_remove(dvoid *opaque, const char *name)
} /* DIR_remove */


static int DIR_mkdir(dvoid *opaque, const char *name)
static int DIR_mkdir(PHYSFS_Dir *opaque, const char *name)
{
int retval;
char *f;
@@ -158,14 +158,14 @@ static int DIR_mkdir(dvoid *opaque, const char *name)
} /* DIR_mkdir */


static void DIR_closeArchive(dvoid *opaque)
static void DIR_closeArchive(PHYSFS_Dir *opaque)
{
allocator.Free(opaque);
} /* DIR_closeArchive */


static int DIR_stat(dvoid *opaque, const char *name, int *exists,
PHYSFS_Stat *stat)
static int DIR_stat(PHYSFS_Dir *opaque, const char *name,
int *exists, PHYSFS_Stat *stat)
{
int retval = 0;
char *d;
@@ -638,7 +638,7 @@ static void *ISO9660_openArchive(PHYSFS_Io *io, const char *filename, int forWri
} /* ISO9660_openArchive */


static void ISO9660_closeArchive(dvoid *opaque)
static void ISO9660_closeArchive(PHYSFS_Dir *opaque)
{
ISO9660Handle *handle = (ISO9660Handle*) opaque;
handle->io->destroy(handle->io);
@@ -766,7 +766,8 @@ static int iso_file_open_foreign(ISO9660Handle *handle,
} /* iso_file_open_foreign */


static PHYSFS_Io *ISO9660_openRead(dvoid *opaque, const char *filename, int *exists)
static PHYSFS_Io *ISO9660_openRead(PHYSFS_Dir *opaque, const char *filename,
int *exists)
{
PHYSFS_Io *retval = NULL;
ISO9660Handle *handle = (ISO9660Handle*) opaque;
@@ -815,7 +816,7 @@ static PHYSFS_Io *ISO9660_openRead(dvoid *opaque, const char *filename, int *exi
* Information gathering functions
******************************************************************************/

static void ISO9660_enumerateFiles(dvoid *opaque, const char *dname,
static void ISO9660_enumerateFiles(PHYSFS_Dir *opaque, const char *dname,
int omitSymLinks,
PHYSFS_EnumFilesCallback cb,
const char *origdir, void *callbackdata)
@@ -872,7 +873,7 @@ static void ISO9660_enumerateFiles(dvoid *opaque, const char *dname,
} /* ISO9660_enumerateFiles */


static int ISO9660_stat(dvoid *opaque, const char *name, int *exists,
static int ISO9660_stat(PHYSFS_Dir *opaque, const char *name, int *exists,
PHYSFS_Stat *stat)
{
ISO9660Handle *handle = (ISO9660Handle*) opaque;
@@ -919,25 +920,25 @@ static int ISO9660_stat(dvoid *opaque, const char *name, int *exists,
* Not supported functions
******************************************************************************/

static PHYSFS_Io *ISO9660_openWrite(dvoid *opaque, const char *name)
static PHYSFS_Io *ISO9660_openWrite(PHYSFS_Dir *opaque, const char *name)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
} /* ISO9660_openWrite */


static PHYSFS_Io *ISO9660_openAppend(dvoid *opaque, const char *name)
static PHYSFS_Io *ISO9660_openAppend(PHYSFS_Dir *opaque, const char *name)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
} /* ISO9660_openAppend */


static int ISO9660_remove(dvoid *opaque, const char *name)
static int ISO9660_remove(PHYSFS_Dir *opaque, const char *name)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
} /* ISO9660_remove */


static int ISO9660_mkdir(dvoid *opaque, const char *name)
static int ISO9660_mkdir(PHYSFS_Dir *opaque, const char *name)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
} /* ISO9660_mkdir */
@@ -531,7 +531,7 @@ static void doEnumCallback(PHYSFS_EnumFilesCallback cb, void *callbackdata,
} /* doEnumCallback */


static void LZMA_enumerateFiles(dvoid *opaque, const char *dname,
static void LZMA_enumerateFiles(PHYSFS_Dir *opaque, const char *dname,
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
const char *origdir, void *callbackdata)
{
@@ -575,7 +575,8 @@ static void LZMA_enumerateFiles(dvoid *opaque, const char *dname,
} /* LZMA_enumerateFiles */


static PHYSFS_Io *LZMA_openRead(dvoid *opaque, const char *name, int *fileExists)
static PHYSFS_Io *LZMA_openRead(PHYSFS_Dir *opaque, const char *name,
int *fileExists)
{
LZMAarchive *archive = (LZMAarchive *) opaque;
LZMAfile *file = lzma_find_file(archive, name);
@@ -597,19 +598,19 @@ static PHYSFS_Io *LZMA_openRead(dvoid *opaque, const char *name, int *fileExists
} /* LZMA_openRead */


static PHYSFS_Io *LZMA_openWrite(dvoid *opaque, const char *filename)
static PHYSFS_Io *LZMA_openWrite(PHYSFS_Dir *opaque, const char *filename)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
} /* LZMA_openWrite */


static PHYSFS_Io *LZMA_openAppend(dvoid *opaque, const char *filename)
static PHYSFS_Io *LZMA_openAppend(PHYSFS_Dir *opaque, const char *filename)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
} /* LZMA_openAppend */


static void LZMA_closeArchive(dvoid *opaque)
static void LZMA_closeArchive(PHYSFS_Dir *opaque)
{
LZMAarchive *archive = (LZMAarchive *) opaque;

@@ -627,19 +628,19 @@ static void LZMA_closeArchive(dvoid *opaque)
} /* LZMA_closeArchive */


static int LZMA_remove(dvoid *opaque, const char *name)
static int LZMA_remove(PHYSFS_Dir *opaque, const char *name)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
} /* LZMA_remove */


static int LZMA_mkdir(dvoid *opaque, const char *name)
static int LZMA_mkdir(PHYSFS_Dir *opaque, const char *name)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
} /* LZMA_mkdir */

static int LZMA_stat(dvoid *opaque, const char *filename, int *exists,
PHYSFS_Stat *stat)
static int LZMA_stat(PHYSFS_Dir *opaque, const char *filename,
int *exists, PHYSFS_Stat *stat)
{
const LZMAarchive *archive = (const LZMAarchive *) opaque;
const LZMAfile *file = lzma_find_file(archive, filename);
@@ -34,7 +34,7 @@ typedef struct
} UNPKfileinfo;


void UNPK_closeArchive(dvoid *opaque)
void UNPK_closeArchive(PHYSFS_Dir *opaque)
{
UNPKinfo *info = ((UNPKinfo *) opaque);
info->io->destroy(info->io);
@@ -242,9 +242,9 @@ static void doEnumCallback(PHYSFS_EnumFilesCallback cb, void *callbackdata,
} /* doEnumCallback */


void UNPK_enumerateFiles(dvoid *opaque, const char *dname,
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
const char *origdir, void *callbackdata)
void UNPK_enumerateFiles(PHYSFS_Dir *opaque, const char *dname,
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
const char *origdir, void *callbackdata)
{
UNPKinfo *info = ((UNPKinfo *) opaque);
PHYSFS_sint32 dlen, dlen_inc, max, i;
@@ -344,7 +344,7 @@ static UNPKentry *findEntry(const UNPKinfo *info, const char *path, int *isDir)
} /* findEntry */


PHYSFS_Io *UNPK_openRead(dvoid *opaque, const char *fnm, int *fileExists)
PHYSFS_Io *UNPK_openRead(PHYSFS_Dir *opaque, const char *fnm, int *fileExists)
{
PHYSFS_Io *retval = NULL;
UNPKinfo *info = (UNPKinfo *) opaque;
@@ -390,32 +390,32 @@ PHYSFS_Io *UNPK_openRead(dvoid *opaque, const char *fnm, int *fileExists)
} /* UNPK_openRead */


PHYSFS_Io *UNPK_openWrite(dvoid *opaque, const char *name)
PHYSFS_Io *UNPK_openWrite(PHYSFS_Dir *opaque, const char *name)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
} /* UNPK_openWrite */


PHYSFS_Io *UNPK_openAppend(dvoid *opaque, const char *name)
PHYSFS_Io *UNPK_openAppend(PHYSFS_Dir *opaque, const char *name)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
} /* UNPK_openAppend */


int UNPK_remove(dvoid *opaque, const char *name)
int UNPK_remove(PHYSFS_Dir *opaque, const char *name)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
} /* UNPK_remove */


int UNPK_mkdir(dvoid *opaque, const char *name)
int UNPK_mkdir(PHYSFS_Dir *opaque, const char *name)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
} /* UNPK_mkdir */


int UNPK_stat(dvoid *opaque, const char *filename, int *exists,
PHYSFS_Stat *stat)
int UNPK_stat(PHYSFS_Dir *opaque, const char *filename,
int *exists, PHYSFS_Stat *stat)
{
int isDir = 0;
const UNPKinfo *info = (const UNPKinfo *) opaque;
@@ -448,7 +448,8 @@ int UNPK_stat(dvoid *opaque, const char *filename, int *exists,
} /* UNPK_stat */


dvoid *UNPK_openArchive(PHYSFS_Io *io, UNPKentry *e, const PHYSFS_uint32 num)
PHYSFS_Dir *UNPK_openArchive(PHYSFS_Io *io, UNPKentry *e,
const PHYSFS_uint32 num)
{
UNPKinfo *info = (UNPKinfo *) allocator.Malloc(sizeof (UNPKinfo));
if (info == NULL)
@@ -1193,7 +1193,7 @@ static void doEnumCallback(PHYSFS_EnumFilesCallback cb, void *callbackdata,
} /* doEnumCallback */


static void ZIP_enumerateFiles(dvoid *opaque, const char *dname,
static void ZIP_enumerateFiles(PHYSFS_Dir *opaque, const char *dname,
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
const char *origdir, void *callbackdata)
{
@@ -1265,7 +1265,8 @@ static PHYSFS_Io *zip_get_io(PHYSFS_Io *io, ZIPinfo *inf, ZIPentry *entry)
} /* zip_get_io */


static PHYSFS_Io *ZIP_openRead(dvoid *opaque, const char *fnm, int *fileExists)
static PHYSFS_Io *ZIP_openRead(PHYSFS_Dir *opaque, const char *fnm,
int *fileExists)
{
PHYSFS_Io *retval = NULL;
ZIPinfo *info = (ZIPinfo *) opaque;
@@ -1323,19 +1324,19 @@ static PHYSFS_Io *ZIP_openRead(dvoid *opaque, const char *fnm, int *fileExists)
} /* ZIP_openRead */


static PHYSFS_Io *ZIP_openWrite(dvoid *opaque, const char *filename)
static PHYSFS_Io *ZIP_openWrite(PHYSFS_Dir *opaque, const char *filename)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
} /* ZIP_openWrite */


static PHYSFS_Io *ZIP_openAppend(dvoid *opaque, const char *filename)
static PHYSFS_Io *ZIP_openAppend(PHYSFS_Dir *opaque, const char *filename)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, NULL);
} /* ZIP_openAppend */


static void ZIP_closeArchive(dvoid *opaque)
static void ZIP_closeArchive(PHYSFS_Dir *opaque)
{
ZIPinfo *zi = (ZIPinfo *) (opaque);
zi->io->destroy(zi->io);
@@ -1344,19 +1345,19 @@ static void ZIP_closeArchive(dvoid *opaque)
} /* ZIP_closeArchive */


static int ZIP_remove(dvoid *opaque, const char *name)
static int ZIP_remove(PHYSFS_Dir *opaque, const char *name)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
} /* ZIP_remove */


static int ZIP_mkdir(dvoid *opaque, const char *name)
static int ZIP_mkdir(PHYSFS_Dir *opaque, const char *name)
{
BAIL_MACRO(PHYSFS_ERR_READ_ONLY, 0);
} /* ZIP_mkdir */


static int ZIP_stat(dvoid *opaque, const char *filename, int *exists,
static int ZIP_stat(PHYSFS_Dir *opaque, const char *filename, int *exists,
PHYSFS_Stat *stat)
{
int isDir = 0;

0 comments on commit b3fbba7

Please sign in to comment.