216 #ifndef _INCLUDE_PHYSFS_H_
217 #define _INCLUDE_PHYSFS_H_
223 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
224 #if (defined _MSC_VER)
225 #define __EXPORT__ __declspec(dllexport)
226 #elif (__GNUC__ >= 3)
227 #define __EXPORT__ __attribute__((visibility("default")))
284 #if (defined PHYSFS_NO_64BIT_SUPPORT)
287 #elif (defined _MSC_VER)
296 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
298 #define PHYSFS_COMPILE_TIME_ASSERT(name, x) \
299 typedef int PHYSFS_dummy_ ## name[(x) * 2 - 1]
301 PHYSFS_COMPILE_TIME_ASSERT(uint8,
sizeof(PHYSFS_uint8) == 1);
302 PHYSFS_COMPILE_TIME_ASSERT(sint8,
sizeof(PHYSFS_sint8) == 1);
303 PHYSFS_COMPILE_TIME_ASSERT(uint16,
sizeof(PHYSFS_uint16) == 2);
304 PHYSFS_COMPILE_TIME_ASSERT(sint16,
sizeof(PHYSFS_sint16) == 2);
305 PHYSFS_COMPILE_TIME_ASSERT(uint32,
sizeof(PHYSFS_uint32) == 4);
306 PHYSFS_COMPILE_TIME_ASSERT(sint32,
sizeof(PHYSFS_sint32) == 4);
308 #ifndef PHYSFS_NO_64BIT_SUPPORT
309 PHYSFS_COMPILE_TIME_ASSERT(uint64,
sizeof(PHYSFS_uint64) == 8);
310 PHYSFS_COMPILE_TIME_ASSERT(sint64,
sizeof(PHYSFS_sint64) == 8);
313 #undef PHYSFS_COMPILE_TIME_ASSERT
358 #define PHYSFS_file PHYSFS_File
405 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
406 #define PHYSFS_VER_MAJOR 2
407 #define PHYSFS_VER_MINOR 0
408 #define PHYSFS_VER_PATCH 3
430 #define PHYSFS_VERSION(x) \
432 (x)->major = PHYSFS_VER_MAJOR; \
433 (x)->minor = PHYSFS_VER_MINOR; \
434 (x)->patch = PHYSFS_VER_PATCH; \
882 const char *archiveExt,
1208 PHYSFS_uint32 objSize,
1209 PHYSFS_uint32 objCount);
1226 PHYSFS_uint32 objSize,
1227 PHYSFS_uint32 objCount);
2061 __EXPORT__
int PHYSFS_mount(
const char *newDir,
const char *mountPoint,
int appendToPath);
int PHYSFS_writeSLE16(PHYSFS_File *file, PHYSFS_sint16 val)
Convert and write a signed 16-bit littleendian value.
int PHYSFS_writeUBE64(PHYSFS_File *file, PHYSFS_uint64 val)
Convert and write an unsigned 64-bit bigendian value.
void PHYSFS_enumerateFilesCallback(const char *dir, PHYSFS_EnumFilesCallback c, void *d)
Get a file listing of a search path's directory, using an application-defined callback.
PHYSFS_sint64 PHYSFS_write(PHYSFS_File *handle, const void *buffer, PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
Write data to a PhysicsFS filehandle.
int PHYSFS_isInit(void)
Determine if the PhysicsFS library is initialized.
int PHYSFS_readSBE64(PHYSFS_File *file, PHYSFS_sint64 *val)
Read and convert a signed 64-bit bigendian value.
PHYSFS_File * PHYSFS_openRead(const char *filename)
Open a file for reading.
int(* Init)(void)
Definition: physfs.h:1983
PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 val)
Swap littleendian unsigned 64 to platform's native byte order.
int PHYSFS_mount(const char *newDir, const char *mountPoint, int appendToPath)
Add an archive or directory to the search path.
const char * PHYSFS_getRealDir(const char *filename)
Figure out where in the search path a file resides.
const char * PHYSFS_getUserDir(void)
Get the path where user's home directory resides.
int PHYSFS_isDirectory(const char *fname)
Determine if a file in the search path is really a directory.
const char * url
Definition: physfs.h:381
int PHYSFS_readULE64(PHYSFS_File *file, PHYSFS_uint64 *val)
Read and convert an unsigned 64-bit littleendian value.
const char * PHYSFS_getLastError(void)
Get human-readable error information.
const char * extension
Definition: physfs.h:378
PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 val)
Swap littleendian unsigned 32 to platform's native byte order.
PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 val)
Swap bigendian unsigned 32 to platform's native byte order.
void(* Free)(void *)
Definition: physfs.h:1987
int PHYSFS_writeUBE16(PHYSFS_File *file, PHYSFS_uint16 val)
Convert and write an unsigned 16-bit bigendian value.
void(* Deinit)(void)
Definition: physfs.h:1984
void(* PHYSFS_StringCallback)(void *data, const char *str)
Function signature for callbacks that report strings.
Definition: physfs.h:2112
Information the version of PhysicsFS in use.
Definition: physfs.h:398
int PHYSFS_writeULE16(PHYSFS_File *file, PHYSFS_uint16 val)
Convert and write an unsigned 16-bit littleendian value.
unsigned short PHYSFS_uint16
An unsigned, 16-bit integer type.
Definition: physfs.h:249
int PHYSFS_seek(PHYSFS_File *handle, PHYSFS_uint64 pos)
Seek to a new position within a PhysicsFS filehandle.
signed long long PHYSFS_sint64
A signed, 64-bit integer type.
Definition: physfs.h:292
PHYSFS_File * PHYSFS_openWrite(const char *filename)
Open a file for writing.
PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 val)
Swap littleendian signed 64 to platform's native byte order.
PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 val)
Swap bigendian signed 32 to platform's native byte order.
int PHYSFS_readUBE32(PHYSFS_File *file, PHYSFS_uint32 *val)
Read and convert an unsigned 32-bit bigendian value.
PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 val)
Swap bigendian signed 64 to platform's native byte order.
unsigned long long PHYSFS_uint64
An unsigned, 64-bit integer type.
Definition: physfs.h:291
int PHYSFS_readULE16(PHYSFS_File *file, PHYSFS_uint16 *val)
Read and convert an unsigned 16-bit littleendian value.
PHYSFS_uint8 major
Definition: physfs.h:400
void PHYSFS_utf8FromLatin1(const char *src, char *dst, PHYSFS_uint64 len)
Convert a UTF-8 string to a Latin1 string.
const char * PHYSFS_getDirSeparator(void)
Get platform-dependent dir separator string.
void PHYSFS_getLinkedVersion(PHYSFS_Version *ver)
Get the version of PhysicsFS that is linked against your program.
int PHYSFS_writeSBE32(PHYSFS_File *file, PHYSFS_sint32 val)
Convert and write a signed 32-bit bigendian value.
int PHYSFS_readSBE32(PHYSFS_File *file, PHYSFS_sint32 *val)
Read and convert a signed 32-bit bigendian value.
int PHYSFS_flush(PHYSFS_File *handle)
Flush a buffered PhysicsFS file handle.
PHYSFS_uint8 minor
Definition: physfs.h:401
int PHYSFS_removeFromSearchPath(const char *oldDir)
Remove a directory or archive from the search path.
int PHYSFS_exists(const char *fname)
Determine if a file exists in the search path.
PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_File *handle)
Get total length of a file in bytes.
int PHYSFS_setAllocator(const PHYSFS_Allocator *allocator)
Hook your own allocation routines into PhysicsFS.
void PHYSFS_utf8ToUcs2(const char *src, PHYSFS_uint16 *dst, PHYSFS_uint64 len)
Convert a UTF-8 string to a UCS-2 string.
PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 val)
Swap bigendian unsigned 64 to platform's native byte order.
PHYSFS_uint8 patch
Definition: physfs.h:402
PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 val)
Swap littleendian signed 32 to platform's native byte order.
PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 val)
Swap bigendian signed 16 to platform's native byte order.
unsigned char PHYSFS_uint8
An unsigned, 8-bit integer type.
Definition: physfs.h:237
PhysicsFS allocation function pointers.
Definition: physfs.h:1981
A PhysicsFS file handle.
Definition: physfs.h:341
int PHYSFS_setBuffer(PHYSFS_File *handle, PHYSFS_uint64 bufsize)
Set up buffering for a PhysicsFS file handle.
char ** PHYSFS_enumerateFiles(const char *dir)
Get a file listing of a search path's directory.
PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 val)
Swap bigendian unsigned 16 to platform's native byte order.
int PHYSFS_readSLE64(PHYSFS_File *file, PHYSFS_sint64 *val)
Read and convert a signed 64-bit littleendian value.
void PHYSFS_utf8ToUcs4(const char *src, PHYSFS_uint32 *dst, PHYSFS_uint64 len)
Convert a UTF-8 string to a UCS-4 string.
int PHYSFS_readSLE32(PHYSFS_File *file, PHYSFS_sint32 *val)
Read and convert a signed 32-bit littleendian value.
int PHYSFS_setWriteDir(const char *newDir)
Tell PhysicsFS where it may write files.
signed int PHYSFS_sint32
A signed, 32-bit integer type.
Definition: physfs.h:267
int PHYSFS_writeSBE64(PHYSFS_File *file, PHYSFS_sint64 val)
Convert and write a signed 64-bit bigending value.
PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 val)
Swap littleendian signed 16 to platform's native byte order.
int PHYSFS_writeSLE32(PHYSFS_File *file, PHYSFS_sint32 val)
Convert and write a signed 32-bit littleendian value.
void PHYSFS_utf8FromUcs2(const PHYSFS_uint16 *src, char *dst, PHYSFS_uint64 len)
Convert a UCS-2 string to a UTF-8 string.
int PHYSFS_writeUBE32(PHYSFS_File *file, PHYSFS_uint32 val)
Convert and write an unsigned 32-bit bigendian value.
signed short PHYSFS_sint16
A signed, 16-bit integer type.
Definition: physfs.h:255
char ** PHYSFS_getCdRomDirs(void)
Get an array of paths to available CD-ROM drives.
int PHYSFS_symbolicLinksPermitted(void)
Determine if the symbolic links are permitted.
PHYSFS_File * PHYSFS_openAppend(const char *filename)
Open a file for appending.
int PHYSFS_close(PHYSFS_File *handle)
Close a PhysicsFS filehandle.
int PHYSFS_readSBE16(PHYSFS_File *file, PHYSFS_sint16 *val)
Read and convert a signed 16-bit bigendian value.
PHYSFS_sint64 PHYSFS_read(PHYSFS_File *handle, void *buffer, PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
Read data from a PhysicsFS filehandle.
int PHYSFS_readUBE16(PHYSFS_File *file, PHYSFS_uint16 *val)
Read and convert an unsigned 16-bit bigendian value.
int PHYSFS_setSaneConfig(const char *organization, const char *appName, const char *archiveExt, int includeCdRoms, int archivesFirst)
Set up sane, default paths.
PHYSFS_sint64 PHYSFS_tell(PHYSFS_File *handle)
Determine current position within a PhysicsFS filehandle.
void PHYSFS_getSearchPathCallback(PHYSFS_StringCallback c, void *d)
Enumerate the search path, using an application-defined callback.
int PHYSFS_readULE32(PHYSFS_File *file, PHYSFS_uint32 *val)
Read and convert an unsigned 32-bit littleendian value.
int PHYSFS_deinit(void)
Deinitialize the PhysicsFS library.
int PHYSFS_writeSBE16(PHYSFS_File *file, PHYSFS_sint16 val)
Convert and write a signed 16-bit bigendian value.
int PHYSFS_writeULE64(PHYSFS_File *file, PHYSFS_uint64 val)
Convert and write an unsigned 64-bit littleendian value.
const char * author
Definition: physfs.h:380
int PHYSFS_eof(PHYSFS_File *handle)
Check for end-of-file state on a PhysicsFS filehandle.
const char * PHYSFS_getWriteDir(void)
Get path where PhysicsFS will allow file writing.
unsigned int PHYSFS_uint32
An unsigned, 32-bit integer type.
Definition: physfs.h:261
int PHYSFS_addToSearchPath(const char *newDir, int appendToPath)
Add an archive or directory to the search path.
int PHYSFS_mkdir(const char *dirName)
Create a directory.
PHYSFS_sint64 PHYSFS_getLastModTime(const char *filename)
Get the last modification time of a file.
int PHYSFS_isSymbolicLink(const char *fname)
Determine if a file in the search path is really a symbolic link.
int PHYSFS_writeULE32(PHYSFS_File *file, PHYSFS_uint32 val)
Convert and write an unsigned 32-bit littleendian value.
const char * PHYSFS_getBaseDir(void)
Get the path where the application resides.
int PHYSFS_init(const char *argv0)
Initialize the PhysicsFS library.
char ** PHYSFS_getSearchPath(void)
Get the current search path.
int PHYSFS_delete(const char *filename)
Delete a file or directory.
int PHYSFS_readSLE16(PHYSFS_File *file, PHYSFS_sint16 *val)
Read and convert a signed 16-bit littleendian value.
Information on various PhysicsFS-supported archives.
Definition: physfs.h:376
const char * PHYSFS_getMountPoint(const char *dir)
Determine a mounted archive's mountpoint.
void PHYSFS_getCdRomDirsCallback(PHYSFS_StringCallback c, void *d)
Enumerate CD-ROM directories, using an application-defined callback.
void PHYSFS_permitSymbolicLinks(int allow)
Enable or disable following of symbolic links.
void PHYSFS_utf8FromUcs4(const PHYSFS_uint32 *src, char *dst, PHYSFS_uint64 len)
Convert a UCS-4 string to a UTF-8 string.
int PHYSFS_writeSLE64(PHYSFS_File *file, PHYSFS_sint64 val)
Convert and write a signed 64-bit littleendian value.
signed char PHYSFS_sint8
A signed, 8-bit integer type.
Definition: physfs.h:243
const PHYSFS_ArchiveInfo ** PHYSFS_supportedArchiveTypes(void)
Get a list of supported archive types.
int PHYSFS_readUBE64(PHYSFS_File *file, PHYSFS_uint64 *val)
Read and convert an unsigned 64-bit bigendian value.
PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 val)
Swap littleendian unsigned 16 to platform's native byte order.
const char * description
Definition: physfs.h:379
void(* PHYSFS_EnumFilesCallback)(void *data, const char *origdir, const char *fname)
Function signature for callbacks that enumerate files.
Definition: physfs.h:2146
void * opaque
Definition: physfs.h:343
void PHYSFS_freeList(void *listVar)
Deallocate resources of lists returned by PhysicsFS.