Added __PHYSFS_platformInit() and __PHYSFS_platformDeinit().

This commit is contained in:
Ryan C. Gordon 2002-03-24 06:36:48 +00:00
parent 83ee49dd6a
commit 419d5cd017
4 changed files with 37 additions and 0 deletions

View File

@ -70,6 +70,7 @@
"write" functions to get data from a "const" buffer. Added an
"extras" dir, which currently contains PhysFS->SDL_RWops glue code.
03202002 - Patched platform/win32.c to compile.
03242002 - Added __PHYSFS_platformInit() and __PHYSFS_platformDeinit().
--ryan. (icculus@clutteredmind.org)

View File

@ -362,6 +362,7 @@ int PHYSFS_init(const char *argv0)
BAIL_IF_MACRO(initialized, ERR_IS_INITIALIZED, 0);
BAIL_IF_MACRO(argv0 == NULL, ERR_INVALID_ARGUMENT, 0);
BAIL_IF_MACRO(!__PHYSFS_platformInit(), NULL, 0);
baseDir = calculateBaseDir(argv0);
BAIL_IF_MACRO(baseDir == NULL, NULL, 0);
@ -438,6 +439,7 @@ static void freeSearchPath(void)
int PHYSFS_deinit(void)
{
BAIL_IF_MACRO(!initialized, ERR_NOT_INITIALIZED, 0);
BAIL_IF_MACRO(!__PHYSFS_platformDeinit(), NULL, 0);
closeFileHandleList(&openWriteList);
BAIL_IF_MACRO(!PHYSFS_setWriteDir(NULL), ERR_FILES_STILL_OPEN, 0);

View File

@ -319,6 +319,27 @@ int __PHYSFS_verifySecurity(DirHandle *h, const char *fname);
*/
extern const char *__PHYSFS_platformDirSeparator;
/*
* Initialize the platform. This is called when PHYSFS_init() is called from
* the application. You can use this to (for example) determine what version
* of Windows you're running.
*
* Return zero if there was a catastrophic failure (which prevents you from
* functioning at all), and non-zero otherwise.
*/
int __PHYSFS_platformInit(void);
/*
* Deinitialize the platform. This is called when PHYSFS_deinit() is called
* from the application. You can use this to clean up anything you've
* allocated in your platform driver.
*
* Return zero if there was a catastrophic failure (which prevents you from
* functioning at all), and non-zero otherwise.
*/
int __PHYSFS_platformDeinit(void);
/*
* Platform implementation of PHYSFS_getCdRomDirs()...
* See physfs.h. The retval should be freeable via PHYSFS_freeList().

View File

@ -59,6 +59,19 @@
const char *__PHYSFS_platformDirSeparator = "/";
int __PHYSFS_platformInit(void)
{
return(1); /* always succeed. */
} /* __PHYSFS_platformInit */
int __PHYSFS_platformDeinit(void)
{
return(1); /* always succeed. */
} /* __PHYSFS_platformDeinit */
#if (defined __DARWIN__)
char **__PHYSFS_platformDetectAvailableCDs(void)