Renamed PHYSFS_Archiver::dirClose() to PHYSFS_Archiver::closeArchive().

This commit is contained in:
Ryan C. Gordon 2012-03-24 10:36:11 -04:00
parent 24aef83ead
commit 0de337eb75
13 changed files with 25 additions and 26 deletions

View File

@ -45,7 +45,6 @@ From old TODO.txt...
- Look for FIXMEs (many marked with "!!!" in comments).
- Find some way to relax or remove the security model for external tools.
- fscanf and fprintf support in extras dir.
- Why do we call it openArchive and dirClose?
- Sanity check byte order at runtime.
- Memory locking?
- Find a better name than dvoid and fvoid.

View File

@ -158,10 +158,10 @@ static int DIR_mkdir(dvoid *opaque, const char *name)
} /* DIR_mkdir */
static void DIR_dirClose(dvoid *opaque)
static void DIR_closeArchive(dvoid *opaque)
{
allocator.Free(opaque);
} /* DIR_dirClose */
} /* DIR_closeArchive */
static int DIR_stat(dvoid *opaque, const char *name, int *exists,
@ -197,7 +197,7 @@ const PHYSFS_Archiver __PHYSFS_Archiver_DIR =
DIR_openAppend, /* openAppend() method */
DIR_remove, /* remove() method */
DIR_mkdir, /* mkdir() method */
DIR_dirClose, /* dirClose() method */
DIR_closeArchive, /* closeArchive() method */
DIR_stat /* stat() method */
};

View File

@ -104,7 +104,7 @@ const PHYSFS_Archiver __PHYSFS_Archiver_GRP =
UNPK_openAppend, /* openAppend() method */
UNPK_remove, /* remove() method */
UNPK_mkdir, /* mkdir() method */
UNPK_dirClose, /* dirClose() method */
UNPK_closeArchive, /* closeArchive() method */
UNPK_stat /* stat() method */
};

View File

@ -103,14 +103,14 @@ const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_HOG =
const PHYSFS_Archiver __PHYSFS_Archiver_HOG =
{
&__PHYSFS_ArchiveInfo_HOG,
HOG_openArchive, /* openArchive() method */
HOG_openArchive, /* openArchive() method */
UNPK_enumerateFiles, /* enumerateFiles() method */
UNPK_openRead, /* openRead() method */
UNPK_openWrite, /* openWrite() method */
UNPK_openAppend, /* openAppend() method */
UNPK_remove, /* remove() method */
UNPK_mkdir, /* mkdir() method */
UNPK_dirClose, /* dirClose() method */
UNPK_closeArchive, /* closeArchive() method */
UNPK_stat /* stat() method */
};

View File

@ -638,14 +638,14 @@ errorcleanup:
} /* ISO9660_openArchive */
static void ISO9660_dirClose(dvoid *opaque)
static void ISO9660_closeArchive(dvoid *opaque)
{
ISO9660Handle *handle = (ISO9660Handle*) opaque;
handle->io->destroy(handle->io);
__PHYSFS_platformDestroyMutex(handle->mutex);
allocator.Free(handle->path);
allocator.Free(handle);
} /* ISO9660_dirClose */
} /* ISO9660_closeArchive */
/*******************************************************************************
@ -962,7 +962,7 @@ const PHYSFS_Archiver __PHYSFS_Archiver_ISO9660 =
ISO9660_openAppend, /* openAppend() method */
ISO9660_remove, /* remove() method */
ISO9660_mkdir, /* mkdir() method */
ISO9660_dirClose, /* dirClose() method */
ISO9660_closeArchive, /* closeArchive() method */
ISO9660_stat /* stat() method */
};

View File

@ -609,7 +609,7 @@ static PHYSFS_Io *LZMA_openAppend(dvoid *opaque, const char *filename)
} /* LZMA_openAppend */
static void LZMA_dirClose(dvoid *opaque)
static void LZMA_closeArchive(dvoid *opaque)
{
LZMAarchive *archive = (LZMAarchive *) opaque;
@ -624,7 +624,7 @@ static void LZMA_dirClose(dvoid *opaque)
SzArDbExFree(&archive->db, SzFreePhysicsFS);
archive->stream.io->destroy(archive->stream.io);
lzma_archive_exit(archive);
} /* LZMA_dirClose */
} /* LZMA_closeArchive */
static int LZMA_remove(dvoid *opaque, const char *name)
@ -694,7 +694,7 @@ const PHYSFS_Archiver __PHYSFS_Archiver_LZMA =
LZMA_openAppend, /* openAppend() method */
LZMA_remove, /* remove() method */
LZMA_mkdir, /* mkdir() method */
LZMA_dirClose, /* dirClose() method */
LZMA_closeArchive, /* closeArchive() method */
LZMA_stat /* stat() method */
};

View File

@ -97,7 +97,7 @@ const PHYSFS_Archiver __PHYSFS_Archiver_MVL =
UNPK_openAppend, /* openAppend() method */
UNPK_remove, /* remove() method */
UNPK_mkdir, /* mkdir() method */
UNPK_dirClose, /* dirClose() method */
UNPK_closeArchive, /* closeArchive() method */
UNPK_stat /* stat() method */
};

View File

@ -112,7 +112,7 @@ const PHYSFS_Archiver __PHYSFS_Archiver_QPAK =
UNPK_openAppend, /* openAppend() method */
UNPK_remove, /* remove() method */
UNPK_mkdir, /* mkdir() method */
UNPK_dirClose, /* dirClose() method */
UNPK_closeArchive, /* closeArchive() method */
UNPK_stat /* stat() method */
};

View File

@ -34,13 +34,13 @@ typedef struct
} UNPKfileinfo;
void UNPK_dirClose(dvoid *opaque)
void UNPK_closeArchive(dvoid *opaque)
{
UNPKinfo *info = ((UNPKinfo *) opaque);
info->io->destroy(info->io);
allocator.Free(info->entries);
allocator.Free(info);
} /* UNPK_dirClose */
} /* UNPK_closeArchive */
static PHYSFS_sint64 UNPK_read(PHYSFS_Io *io, void *buffer, PHYSFS_uint64 len)

View File

@ -121,7 +121,7 @@ const PHYSFS_Archiver __PHYSFS_Archiver_WAD =
UNPK_openAppend, /* openAppend() method */
UNPK_remove, /* remove() method */
UNPK_mkdir, /* mkdir() method */
UNPK_dirClose, /* dirClose() method */
UNPK_closeArchive, /* closeArchive() method */
UNPK_stat /* stat() method */
};

View File

@ -1335,13 +1335,13 @@ static PHYSFS_Io *ZIP_openAppend(dvoid *opaque, const char *filename)
} /* ZIP_openAppend */
static void ZIP_dirClose(dvoid *opaque)
static void ZIP_closeArchive(dvoid *opaque)
{
ZIPinfo *zi = (ZIPinfo *) (opaque);
zi->io->destroy(zi->io);
zip_free_entries(zi->entries, zi->entryCount);
allocator.Free(zi);
} /* ZIP_dirClose */
} /* ZIP_closeArchive */
static int ZIP_remove(dvoid *opaque, const char *name)
@ -1415,7 +1415,7 @@ const PHYSFS_Archiver __PHYSFS_Archiver_ZIP =
ZIP_openAppend, /* openAppend() method */
ZIP_remove, /* remove() method */
ZIP_mkdir, /* mkdir() method */
ZIP_dirClose, /* dirClose() method */
ZIP_closeArchive, /* closeArchive() method */
ZIP_stat /* stat() method */
};

View File

@ -882,7 +882,7 @@ static DirHandle *tryOpenDir(PHYSFS_Io *io, const PHYSFS_Archiver *funcs,
{
retval = (DirHandle *) allocator.Malloc(sizeof (DirHandle));
if (retval == NULL)
funcs->dirClose(opaque);
funcs->closeArchive(opaque);
else
{
memset(retval, '\0', sizeof (DirHandle));
@ -1072,7 +1072,7 @@ static DirHandle *createDirHandle(PHYSFS_Io *io, const char *newDir,
badDirHandle:
if (dirHandle != NULL)
{
dirHandle->funcs->dirClose(dirHandle->opaque);
dirHandle->funcs->closeArchive(dirHandle->opaque);
allocator.Free(dirHandle->dirName);
allocator.Free(dirHandle->mountPoint);
allocator.Free(dirHandle);
@ -1094,7 +1094,7 @@ static int freeDirHandle(DirHandle *dh, FileHandle *openList)
for (i = openList; i != NULL; i = i->next)
BAIL_IF_MACRO(i->dirHandle == dh, PHYSFS_ERR_FILES_STILL_OPEN, 0);
dh->funcs->dirClose(dh->opaque);
dh->funcs->closeArchive(dh->opaque);
allocator.Free(dh->dirName);
allocator.Free(dh->mountPoint);
allocator.Free(dh);

View File

@ -242,7 +242,7 @@ typedef struct
* applicable. Implementation can assume that it won't be called if
* there are still files open from this archive.
*/
void (*dirClose)(dvoid *opaque);
void (*closeArchive)(dvoid *opaque);
/*
* Obtain basic file metadata.
@ -424,7 +424,7 @@ typedef struct
PHYSFS_uint32 size;
} UNPKentry;
void UNPK_dirClose(dvoid *opaque);
void UNPK_closeArchive(dvoid *opaque);
dvoid *UNPK_openArchive(PHYSFS_Io *io, UNPKentry *e, const PHYSFS_uint32 num);
void UNPK_enumerateFiles(dvoid *opaque, const char *dname,
int omitSymLinks, PHYSFS_EnumFilesCallback cb,