physfs: physfs.h Source File

physfs 3.2.0

physfs.h
Go to the documentation of this file.
1
219#ifndef _INCLUDE_PHYSFS_H_
220#define _INCLUDE_PHYSFS_H_
221
222#ifdef __cplusplus
223extern "C" {
224#endif
225
226#if defined(PHYSFS_DECL)
227/* do nothing. */
228#elif defined(PHYSFS_STATIC)
229#define PHYSFS_DECL
230#elif defined(_WIN32) || defined(__OS2__)
231#define PHYSFS_DECL __declspec(dllexport)
232#elif defined(__SUNPRO_C)
233#define PHYSFS_DECL __global
234#elif ((__GNUC__ >= 3) && (!defined(__EMX__)) && (!defined(sun)))
235#define PHYSFS_DECL __attribute__((visibility("default")))
236#else
237#define PHYSFS_DECL
238#endif
239
240#if defined(PHYSFS_DEPRECATED)
241/* do nothing. */
242#elif (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */
243#define PHYSFS_DEPRECATED __attribute__((deprecated))
244#else
245#define PHYSFS_DEPRECATED
246#endif
247
248#if 0 /* !!! FIXME: look into this later. */
249#if defined(PHYSFS_CALL)
250/* do nothing. */
251#elif defined(__WIN32__) && !defined(__GNUC__)
252#define PHYSFS_CALL __cdecl
253#elif defined(__OS2__) || defined(OS2) /* should work across all compilers. */
254#define PHYSFS_CALL _System
255#else
256#define PHYSFS_CALL
257#endif
258#endif
259
264 typedef unsigned char PHYSFS_uint8;
265
270 typedef signed char PHYSFS_sint8;
271
276 typedef unsigned short PHYSFS_uint16;
277
282 typedef signed short PHYSFS_sint16;
283
288 typedef unsigned int PHYSFS_uint32;
289
294 typedef signed int PHYSFS_sint32;
295
311#if (defined PHYSFS_NO_64BIT_SUPPORT) /* oh well. */
312typedef PHYSFS_uint32 PHYSFS_uint64;
313typedef PHYSFS_sint32 PHYSFS_sint64;
314#elif (defined _MSC_VER)
315typedef signed __int64 PHYSFS_sint64;
316typedef unsigned __int64 PHYSFS_uint64;
317#else
318 typedef unsigned long long PHYSFS_uint64;
319 typedef signed long long PHYSFS_sint64;
320#endif
321
322
323#ifndef DOXYGEN_SHOULD_IGNORE_THIS
324/* Make sure the types really have the right sizes */
325#define PHYSFS_COMPILE_TIME_ASSERT(name, x) \
326 typedef int PHYSFS_compile_time_assert_##name[(x) * 2 - 1]
327
328PHYSFS_COMPILE_TIME_ASSERT(uint8IsOneByte, sizeof(PHYSFS_uint8) == 1);
329PHYSFS_COMPILE_TIME_ASSERT(sint8IsOneByte, sizeof(PHYSFS_sint8) == 1);
330PHYSFS_COMPILE_TIME_ASSERT(uint16IsTwoBytes, sizeof(PHYSFS_uint16) == 2);
331PHYSFS_COMPILE_TIME_ASSERT(sint16IsTwoBytes, sizeof(PHYSFS_sint16) == 2);
332PHYSFS_COMPILE_TIME_ASSERT(uint32IsFourBytes, sizeof(PHYSFS_uint32) == 4);
333PHYSFS_COMPILE_TIME_ASSERT(sint32IsFourBytes, sizeof(PHYSFS_sint32) == 4);
334
335#ifndef PHYSFS_NO_64BIT_SUPPORT
336PHYSFS_COMPILE_TIME_ASSERT(uint64IsEightBytes, sizeof(PHYSFS_uint64) == 8);
337PHYSFS_COMPILE_TIME_ASSERT(sint64IsEightBytes, sizeof(PHYSFS_sint64) == 8);
338#endif
339
340#undef PHYSFS_COMPILE_TIME_ASSERT
341
342#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
343
344
368 typedef struct PHYSFS_File
369{
370 void *opaque;
371} PHYSFS_File;
372
373
385#define PHYSFS_file PHYSFS_File
386
387
405 typedef struct PHYSFS_ArchiveInfo
406{
407 const char *extension;
408 const char *description;
409 const char *author;
410 const char *url;
411 int supportsSymlinks;
412} PHYSFS_ArchiveInfo;
413
414
428 typedef struct PHYSFS_Version
429{
430 PHYSFS_uint8 major;
431 PHYSFS_uint8 minor;
432 PHYSFS_uint8 patch;
433} PHYSFS_Version;
434
435
436#ifndef DOXYGEN_SHOULD_IGNORE_THIS
437#define PHYSFS_VER_MAJOR 3
438#define PHYSFS_VER_MINOR 2
439#define PHYSFS_VER_PATCH 0
440#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
441
442
443/* PhysicsFS state stuff ... */
444
461#define PHYSFS_VERSION(x) \
462{ \
463 (x)->major = PHYSFS_VER_MAJOR; \
464 (x)->minor = PHYSFS_VER_MINOR; \
465 (x)->patch = PHYSFS_VER_PATCH; \
466}
467
468
495PHYSFS_DECL void PHYSFS_getLinkedVersion(PHYSFS_Version *ver);
496
497
498#ifdef __ANDROID__
499typedef struct PHYSFS_AndroidInit
500{
501 void *jnienv;
502 void *context;
503} PHYSFS_AndroidInit;
504#endif
505
537PHYSFS_DECL int PHYSFS_init(const char *argv0);
538
539
566PHYSFS_DECL int PHYSFS_deinit(void);
567
568
602PHYSFS_DECL const PHYSFS_ArchiveInfo **PHYSFS_supportedArchiveTypes(void);
603
604
622PHYSFS_DECL void PHYSFS_freeList(void *listVar);
623
624
675PHYSFS_DECL const char *PHYSFS_getLastError(void) PHYSFS_DEPRECATED;
676
677
691PHYSFS_DECL const char *PHYSFS_getDirSeparator(void);
692
693
729PHYSFS_DECL void PHYSFS_permitSymbolicLinks(int allow);
730
731
771PHYSFS_DECL char **PHYSFS_getCdRomDirs(void);
772
773
799PHYSFS_DECL const char *PHYSFS_getBaseDir(void);
800
801
822PHYSFS_DECL const char *PHYSFS_getUserDir(void) PHYSFS_DEPRECATED;
823
824
836PHYSFS_DECL const char *PHYSFS_getWriteDir(void);
837
838
858PHYSFS_DECL int PHYSFS_setWriteDir(const char *newDir);
859
860
881PHYSFS_DECL int PHYSFS_addToSearchPath(const char *newDir, int appendToPath)
882 PHYSFS_DEPRECATED;
883
908PHYSFS_DECL int PHYSFS_removeFromSearchPath(const char *oldDir)
909 PHYSFS_DEPRECATED;
910
911
938PHYSFS_DECL char **PHYSFS_getSearchPath(void);
939
940
999PHYSFS_DECL int PHYSFS_setSaneConfig(const char *organization,
1000 const char *appName,
1001 const char *archiveExt,
1002 int includeCdRoms,
1003 int archivesFirst);
1004
1005
1006/* Directory management stuff ... */
1007
1029PHYSFS_DECL int PHYSFS_mkdir(const char *dirName);
1030
1031
1062PHYSFS_DECL int PHYSFS_delete(const char *filename);
1063
1064
1095PHYSFS_DECL const char *PHYSFS_getRealDir(const char *filename);
1096
1097
1149PHYSFS_DECL char **PHYSFS_enumerateFiles(const char *dir);
1150
1151
1166PHYSFS_DECL int PHYSFS_exists(const char *fname);
1167
1168
1189PHYSFS_DECL int PHYSFS_isDirectory(const char *fname) PHYSFS_DEPRECATED;
1190
1191
1212PHYSFS_DECL int PHYSFS_isSymbolicLink(const char *fname) PHYSFS_DEPRECATED;
1213
1214
1236PHYSFS_DECL PHYSFS_sint64 PHYSFS_getLastModTime(const char *filename)
1237 PHYSFS_DEPRECATED;
1238
1239
1240/* i/o stuff... */
1241
1264PHYSFS_DECL PHYSFS_File *PHYSFS_openWrite(const char *filename);
1265
1266
1290PHYSFS_DECL PHYSFS_File *PHYSFS_openAppend(const char *filename);
1291
1292
1315PHYSFS_DECL PHYSFS_File *PHYSFS_openRead(const char *filename);
1316
1317
1336PHYSFS_DECL int PHYSFS_close(PHYSFS_File *handle);
1337
1338
1363PHYSFS_DECL PHYSFS_sint64 PHYSFS_read(PHYSFS_File *handle,
1364 void *buffer,
1365 PHYSFS_uint32 objSize,
1366 PHYSFS_uint32 objCount)
1367 PHYSFS_DEPRECATED;
1368
1392PHYSFS_DECL PHYSFS_sint64 PHYSFS_write(PHYSFS_File *handle,
1393 const void *buffer,
1394 PHYSFS_uint32 objSize,
1395 PHYSFS_uint32 objCount)
1396 PHYSFS_DEPRECATED;
1397
1398
1399/* File position stuff... */
1400
1413PHYSFS_DECL int PHYSFS_eof(PHYSFS_File *handle);
1414
1415
1426PHYSFS_DECL PHYSFS_sint64 PHYSFS_tell(PHYSFS_File *handle);
1427
1428
1443PHYSFS_DECL int PHYSFS_seek(PHYSFS_File *handle, PHYSFS_uint64 pos);
1444
1445
1460PHYSFS_DECL PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_File *handle);
1461
1462
1463/* Buffering stuff... */
1464
1505PHYSFS_DECL int PHYSFS_setBuffer(PHYSFS_File *handle, PHYSFS_uint64 bufsize);
1506
1507
1524PHYSFS_DECL int PHYSFS_flush(PHYSFS_File *handle);
1525
1526
1527/* Byteorder stuff... */
1528
1539PHYSFS_DECL PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 val);
1540
1541
1552PHYSFS_DECL PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 val);
1553
1564PHYSFS_DECL PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 val);
1565
1566
1577PHYSFS_DECL PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 val);
1578
1592PHYSFS_DECL PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 val);
1593
1594
1608PHYSFS_DECL PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 val);
1609
1610
1621PHYSFS_DECL PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 val);
1622
1623
1634PHYSFS_DECL PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 val);
1635
1646PHYSFS_DECL PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 val);
1647
1648
1659PHYSFS_DECL PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 val);
1660
1661
1675PHYSFS_DECL PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 val);
1676
1677
1691PHYSFS_DECL PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 val);
1692
1693
1707PHYSFS_DECL int PHYSFS_readSLE16(PHYSFS_File *file, PHYSFS_sint16 *val);
1708
1709
1724PHYSFS_DECL int PHYSFS_readULE16(PHYSFS_File *file, PHYSFS_uint16 *val);
1725
1726
1740PHYSFS_DECL int PHYSFS_readSBE16(PHYSFS_File *file, PHYSFS_sint16 *val);
1741
1742
1757PHYSFS_DECL int PHYSFS_readUBE16(PHYSFS_File *file, PHYSFS_uint16 *val);
1758
1759
1773PHYSFS_DECL int PHYSFS_readSLE32(PHYSFS_File *file, PHYSFS_sint32 *val);
1774
1775
1790PHYSFS_DECL int PHYSFS_readULE32(PHYSFS_File *file, PHYSFS_uint32 *val);
1791
1792
1806PHYSFS_DECL int PHYSFS_readSBE32(PHYSFS_File *file, PHYSFS_sint32 *val);
1807
1808
1823PHYSFS_DECL int PHYSFS_readUBE32(PHYSFS_File *file, PHYSFS_uint32 *val);
1824
1825
1842PHYSFS_DECL int PHYSFS_readSLE64(PHYSFS_File *file, PHYSFS_sint64 *val);
1843
1844
1861PHYSFS_DECL int PHYSFS_readULE64(PHYSFS_File *file, PHYSFS_uint64 *val);
1862
1863
1880PHYSFS_DECL int PHYSFS_readSBE64(PHYSFS_File *file, PHYSFS_sint64 *val);
1881
1882
1899PHYSFS_DECL int PHYSFS_readUBE64(PHYSFS_File *file, PHYSFS_uint64 *val);
1900
1901
1914PHYSFS_DECL int PHYSFS_writeSLE16(PHYSFS_File *file, PHYSFS_sint16 val);
1915
1916
1929PHYSFS_DECL int PHYSFS_writeULE16(PHYSFS_File *file, PHYSFS_uint16 val);
1930
1931
1944PHYSFS_DECL int PHYSFS_writeSBE16(PHYSFS_File *file, PHYSFS_sint16 val);
1945
1946
1959PHYSFS_DECL int PHYSFS_writeUBE16(PHYSFS_File *file, PHYSFS_uint16 val);
1960
1961
1974PHYSFS_DECL int PHYSFS_writeSLE32(PHYSFS_File *file, PHYSFS_sint32 val);
1975
1976
1989PHYSFS_DECL int PHYSFS_writeULE32(PHYSFS_File *file, PHYSFS_uint32 val);
1990
1991
2004PHYSFS_DECL int PHYSFS_writeSBE32(PHYSFS_File *file, PHYSFS_sint32 val);
2005
2006
2019PHYSFS_DECL int PHYSFS_writeUBE32(PHYSFS_File *file, PHYSFS_uint32 val);
2020
2021
2037PHYSFS_DECL int PHYSFS_writeSLE64(PHYSFS_File *file, PHYSFS_sint64 val);
2038
2039
2055PHYSFS_DECL int PHYSFS_writeULE64(PHYSFS_File *file, PHYSFS_uint64 val);
2056
2057
2073PHYSFS_DECL int PHYSFS_writeSBE64(PHYSFS_File *file, PHYSFS_sint64 val);
2074
2075
2091PHYSFS_DECL int PHYSFS_writeUBE64(PHYSFS_File *file, PHYSFS_uint64 val);
2092
2093
2094/* Everything above this line is part of the PhysicsFS 1.0 API. */
2095
2110PHYSFS_DECL int PHYSFS_isInit(void);
2111
2112
2125PHYSFS_DECL int PHYSFS_symbolicLinksPermitted(void);
2126
2127
2148 typedef struct PHYSFS_Allocator
2149{
2150 int (*Init)(void);
2151 void (*Deinit)(void);
2152 void *(*Malloc)(PHYSFS_uint64);
2153 void *(*Realloc)(void *, PHYSFS_uint64);
2154 void (*Free)(void *);
2155} PHYSFS_Allocator;
2156
2157
2185PHYSFS_DECL int PHYSFS_setAllocator(const PHYSFS_Allocator *allocator);
2186
2187
2233PHYSFS_DECL int PHYSFS_mount(const char *newDir,
2234 const char *mountPoint,
2235 int appendToPath);
2236
2259PHYSFS_DECL const char *PHYSFS_getMountPoint(const char *dir);
2260
2261
2286 typedef void (*PHYSFS_StringCallback)(void *data, const char *str);
2287
2288
2324 typedef void (*PHYSFS_EnumFilesCallback)(void *data, const char *origdir,
2325 const char *fname);
2326
2327
2359PHYSFS_DECL void PHYSFS_getCdRomDirsCallback(PHYSFS_StringCallback c, void *d);
2360
2361
2395PHYSFS_DECL void PHYSFS_getSearchPathCallback(PHYSFS_StringCallback c, void *d);
2396
2397
2415PHYSFS_DECL void PHYSFS_enumerateFilesCallback(const char *dir,
2416 PHYSFS_EnumFilesCallback c,
2417 void *d) PHYSFS_DEPRECATED;
2418
2442PHYSFS_DECL void PHYSFS_utf8FromUcs4(const PHYSFS_uint32 *src, char *dst,
2443 PHYSFS_uint64 len);
2444
2468PHYSFS_DECL void PHYSFS_utf8ToUcs4(const char *src, PHYSFS_uint32 *dst,
2469 PHYSFS_uint64 len);
2470
2502PHYSFS_DECL void PHYSFS_utf8FromUcs2(const PHYSFS_uint16 *src, char *dst,
2503 PHYSFS_uint64 len);
2504
2537PHYSFS_DECL void PHYSFS_utf8ToUcs2(const char *src, PHYSFS_uint16 *dst,
2538 PHYSFS_uint64 len);
2539
2563PHYSFS_DECL void PHYSFS_utf8FromLatin1(const char *src, char *dst,
2564 PHYSFS_uint64 len);
2565
2566/* Everything above this line is part of the PhysicsFS 2.0 API. */
2567
2595PHYSFS_DECL int PHYSFS_caseFold(const PHYSFS_uint32 from, PHYSFS_uint32 *to);
2596
2597
2623PHYSFS_DECL int PHYSFS_utf8stricmp(const char *str1, const char *str2);
2624
2646PHYSFS_DECL int PHYSFS_utf16stricmp(const PHYSFS_uint16 *str1,
2647 const PHYSFS_uint16 *str2);
2648
2670PHYSFS_DECL int PHYSFS_ucs4stricmp(const PHYSFS_uint32 *str1,
2671 const PHYSFS_uint32 *str2);
2672
2673
2684 typedef enum PHYSFS_EnumerateCallbackResult
2685{
2686 PHYSFS_ENUM_ERROR = -1,
2687 PHYSFS_ENUM_STOP = 0,
2688 PHYSFS_ENUM_OK = 1
2689} PHYSFS_EnumerateCallbackResult;
2690
2718 typedef PHYSFS_EnumerateCallbackResult (*PHYSFS_EnumerateCallback)(void *data,
2719 const char *origdir, const char *fname);
2720
2780PHYSFS_DECL int PHYSFS_enumerate(const char *dir, PHYSFS_EnumerateCallback c,
2781 void *d);
2782
2783
2810PHYSFS_DECL int PHYSFS_unmount(const char *oldDir);
2811
2812
2846PHYSFS_DECL const PHYSFS_Allocator *PHYSFS_getAllocator(void);
2847
2848
2857 typedef enum PHYSFS_FileType
2858{
2859 PHYSFS_FILETYPE_REGULAR,
2860 PHYSFS_FILETYPE_DIRECTORY,
2861 PHYSFS_FILETYPE_SYMLINK,
2862 PHYSFS_FILETYPE_OTHER
2863} PHYSFS_FileType;
2864
2882 typedef struct PHYSFS_Stat
2883{
2884 PHYSFS_sint64 filesize;
2885 PHYSFS_sint64 modtime;
2886 PHYSFS_sint64 createtime;
2887 PHYSFS_sint64 accesstime;
2888 PHYSFS_FileType filetype;
2889 int readonly;
2890} PHYSFS_Stat;
2891
2911PHYSFS_DECL int PHYSFS_stat(const char *fname, PHYSFS_Stat *stat);
2912
2913
2942PHYSFS_DECL void PHYSFS_utf8FromUtf16(const PHYSFS_uint16 *src, char *dst,
2943 PHYSFS_uint64 len);
2944
2978PHYSFS_DECL void PHYSFS_utf8ToUtf16(const char *src, PHYSFS_uint16 *dst,
2979 PHYSFS_uint64 len);
2980
2981
2998PHYSFS_DECL PHYSFS_sint64 PHYSFS_readBytes(PHYSFS_File *handle, void *buffer,
2999 PHYSFS_uint64 len);
3000
3024PHYSFS_DECL PHYSFS_sint64 PHYSFS_writeBytes(PHYSFS_File *handle,
3025 const void *buffer,
3026 PHYSFS_uint64 len);
3027
3028
3070 typedef struct PHYSFS_Io
3071{
3080 PHYSFS_uint32 version;
3081
3090 void *opaque;
3091
3111 PHYSFS_sint64 (*read)(struct PHYSFS_Io *io, void *buf, PHYSFS_uint64 len);
3112
3136 PHYSFS_sint64 (*write)(struct PHYSFS_Io *io, const void *buffer,
3137 PHYSFS_uint64 len);
3138
3150 int (*seek)(struct PHYSFS_Io *io, PHYSFS_uint64 offset);
3151
3162 PHYSFS_sint64 (*tell)(struct PHYSFS_Io *io);
3163
3174 PHYSFS_sint64 (*length)(struct PHYSFS_Io *io);
3175
3192 struct PHYSFS_Io *(*duplicate)(struct PHYSFS_Io *io);
3193
3207 int (*flush)(struct PHYSFS_Io *io);
3208
3226 void (*destroy)(struct PHYSFS_Io *io);
3227} PHYSFS_Io;
3228
3229
3270PHYSFS_DECL int PHYSFS_mountIo(PHYSFS_Io *io, const char *newDir,
3271 const char *mountPoint, int appendToPath);
3272
3273
3317PHYSFS_DECL int PHYSFS_mountMemory(const void *buf, PHYSFS_uint64 len,
3318 void (*del)(void *), const char *newDir,
3319 const char *mountPoint, int appendToPath);
3320
3321
3375PHYSFS_DECL int PHYSFS_mountHandle(PHYSFS_File *file, const char *newDir,
3376 const char *mountPoint, int appendToPath);
3377
3378
3397 typedef enum PHYSFS_ErrorCode
3398{
3399 PHYSFS_ERR_OK,
3400 PHYSFS_ERR_OTHER_ERROR,
3401 PHYSFS_ERR_OUT_OF_MEMORY,
3402 PHYSFS_ERR_NOT_INITIALIZED,
3403 PHYSFS_ERR_IS_INITIALIZED,
3404 PHYSFS_ERR_ARGV0_IS_NULL,
3405 PHYSFS_ERR_UNSUPPORTED,
3406 PHYSFS_ERR_PAST_EOF,
3407 PHYSFS_ERR_FILES_STILL_OPEN,
3408 PHYSFS_ERR_INVALID_ARGUMENT,
3409 PHYSFS_ERR_NOT_MOUNTED,
3410 PHYSFS_ERR_NOT_FOUND,
3411 PHYSFS_ERR_SYMLINK_FORBIDDEN,
3412 PHYSFS_ERR_NO_WRITE_DIR,
3413 PHYSFS_ERR_OPEN_FOR_READING,
3414 PHYSFS_ERR_OPEN_FOR_WRITING,
3415 PHYSFS_ERR_NOT_A_FILE,
3416 PHYSFS_ERR_READ_ONLY,
3417 PHYSFS_ERR_CORRUPT,
3418 PHYSFS_ERR_SYMLINK_LOOP,
3419 PHYSFS_ERR_IO,
3420 PHYSFS_ERR_PERMISSION,
3421 PHYSFS_ERR_NO_SPACE,
3422 PHYSFS_ERR_BAD_FILENAME,
3423 PHYSFS_ERR_BUSY,
3424 PHYSFS_ERR_DIR_NOT_EMPTY,
3425 PHYSFS_ERR_OS_ERROR,
3426 PHYSFS_ERR_DUPLICATE,
3427 PHYSFS_ERR_BAD_PASSWORD,
3428 PHYSFS_ERR_APP_CALLBACK
3429} PHYSFS_ErrorCode;
3430
3431
3460PHYSFS_DECL PHYSFS_ErrorCode PHYSFS_getLastErrorCode(void);
3461
3462
3491PHYSFS_DECL const char *PHYSFS_getErrorByCode(PHYSFS_ErrorCode code);
3492
3520PHYSFS_DECL void PHYSFS_setErrorCode(PHYSFS_ErrorCode code);
3521
3522
3588PHYSFS_DECL const char *PHYSFS_getPrefDir(const char *org, const char *app);
3589
3590
3647 typedef struct PHYSFS_Archiver
3648{
3657 PHYSFS_uint32 version;
3658
3665 PHYSFS_ArchiveInfo info;
3666
3692 void *(*openArchive)(PHYSFS_Io *io, const char *name,
3693 int forWrite, int *claimed);
3694
3720 PHYSFS_EnumerateCallbackResult (*enumerate)(void *opaque,
3721 const char *dirname, PHYSFS_EnumerateCallback cb,
3722 const char *origdir, void *callbackdata);
3723
3733 PHYSFS_Io *(*openRead)(void *opaque, const char *fnm);
3734
3747 PHYSFS_Io *(*openWrite)(void *opaque, const char *filename);
3748
3760 PHYSFS_Io *(*openAppend)(void *opaque, const char *filename);
3761
3774 int (*remove)(void *opaque, const char *filename);
3775
3787 int (*mkdir)(void *opaque, const char *filename);
3788
3799 int (*stat)(void *opaque, const char *fn, PHYSFS_Stat *stat);
3800
3809 void (*closeArchive)(void *opaque);
3810} PHYSFS_Archiver;
3811
3844PHYSFS_DECL int PHYSFS_registerArchiver(const PHYSFS_Archiver *archiver);
3845
3872PHYSFS_DECL int PHYSFS_deregisterArchiver(const char *ext);
3873
3874
3875/* Everything above this line is part of the PhysicsFS 2.1 API. */
3876
3877
3911PHYSFS_DECL int PHYSFS_setRoot(const char *archive, const char *subdir);
3912
3913
3914/* Everything above this line is part of the PhysicsFS 3.1 API. */
3915
3916
3917#ifdef __cplusplus
3918}
3919#endif
3920
3921#endif /* !defined _INCLUDE_PHYSFS_H_ */
3922
3923/* end of physfs.h ... */
3924
PHYSFS_getBaseDir
const char * PHYSFS_getBaseDir(void)
Get the path where the application resides.
PHYSFS_writeUBE64
int PHYSFS_writeUBE64(PHYSFS_File *file, PHYSFS_uint64 val)
Convert and write an unsigned 64-bit bigendian value.
PHYSFS_readSBE64
int PHYSFS_readSBE64(PHYSFS_File *file, PHYSFS_sint64 *val)
Read and convert a signed 64-bit bigendian value.
PHYSFS_mountHandle
int PHYSFS_mountHandle(PHYSFS_File *file, const char *newDir, const char *mountPoint, int appendToPath)
Add an archive, contained in a PHYSFS_File handle, to the search path.
PHYSFS_swapUBE16
PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 val)
Swap bigendian unsigned 16 to platform's native byte order.
PHYSFS_writeSBE32
int PHYSFS_writeSBE32(PHYSFS_File *file, PHYSFS_sint32 val)
Convert and write a signed 32-bit bigendian value.
PHYSFS_readUBE16
int PHYSFS_readUBE16(PHYSFS_File *file, PHYSFS_uint16 *val)
Read and convert an unsigned 16-bit bigendian value.
PHYSFS_addToSearchPath
int PHYSFS_addToSearchPath(const char *newDir, int appendToPath)
Add an archive or directory to the search path.
PHYSFS_readSLE16
int PHYSFS_readSLE16(PHYSFS_File *file, PHYSFS_sint16 *val)
Read and convert a signed 16-bit littleendian value.
PHYSFS_mountMemory
int PHYSFS_mountMemory(const void *buf, PHYSFS_uint64 len, void(*del)(void *), const char *newDir, const char *mountPoint, int appendToPath)
Add an archive, contained in a memory buffer, to the search path.
PHYSFS_tell
PHYSFS_sint64 PHYSFS_tell(PHYSFS_File *handle)
Determine current position within a PhysicsFS filehandle.
PHYSFS_enumerateFiles
char ** PHYSFS_enumerateFiles(const char *dir)
Get a file listing of a search path's directory.
PHYSFS_utf16stricmp
int PHYSFS_utf16stricmp(const PHYSFS_uint16 *str1, const PHYSFS_uint16 *str2)
Case-insensitive compare of two UTF-16 strings.
PHYSFS_writeBytes
PHYSFS_sint64 PHYSFS_writeBytes(PHYSFS_File *handle, const void *buffer, PHYSFS_uint64 len)
Write data to a PhysicsFS filehandle.
PHYSFS_removeFromSearchPath
int PHYSFS_removeFromSearchPath(const char *oldDir)
Remove a directory or archive from the search path.
PHYSFS_sint8
signed char PHYSFS_sint8
A signed, 8-bit integer type.
Definition physfs.h:270
PHYSFS_delete
int PHYSFS_delete(const char *filename)
Delete a file or directory.
PHYSFS_utf8FromLatin1
void PHYSFS_utf8FromLatin1(const char *src, char *dst, PHYSFS_uint64 len)
Convert a UTF-8 string to a Latin1 string.
PHYSFS_readSLE32
int PHYSFS_readSLE32(PHYSFS_File *file, PHYSFS_sint32 *val)
Read and convert a signed 32-bit littleendian value.
PHYSFS_enumerate
int PHYSFS_enumerate(const char *dir, PHYSFS_EnumerateCallback c, void *d)
Get a file listing of a search path's directory, using an application-defined callback,...
PHYSFS_readUBE32
int PHYSFS_readUBE32(PHYSFS_File *file, PHYSFS_uint32 *val)
Read and convert an unsigned 32-bit bigendian value.
PHYSFS_setWriteDir
int PHYSFS_setWriteDir(const char *newDir)
Tell PhysicsFS where it may write files.
PHYSFS_readUBE64
int PHYSFS_readUBE64(PHYSFS_File *file, PHYSFS_uint64 *val)
Read and convert an unsigned 64-bit bigendian value.
PHYSFS_caseFold
int PHYSFS_caseFold(const PHYSFS_uint32 from, PHYSFS_uint32 *to)
"Fold" a Unicode codepoint to a lowercase equivalent.
PHYSFS_uint64
unsigned long long PHYSFS_uint64
An unsigned, 64-bit integer type.
Definition physfs.h:318
PHYSFS_writeSLE32
int PHYSFS_writeSLE32(PHYSFS_File *file, PHYSFS_sint32 val)
Convert and write a signed 32-bit littleendian value.
PHYSFS_fileLength
PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_File *handle)
Get total length of a file in bytes.
PHYSFS_flush
int PHYSFS_flush(PHYSFS_File *handle)
Flush a buffered PhysicsFS file handle.
PHYSFS_utf8ToUcs4
void PHYSFS_utf8ToUcs4(const char *src, PHYSFS_uint32 *dst, PHYSFS_uint64 len)
Convert a UTF-8 string to a UCS-4 string.
PHYSFS_swapUBE32
PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 val)
Swap bigendian unsigned 32 to platform's native byte order.
PHYSFS_swapULE64
PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 val)
Swap littleendian unsigned 64 to platform's native byte order.
PHYSFS_supportedArchiveTypes
const PHYSFS_ArchiveInfo ** PHYSFS_supportedArchiveTypes(void)
Get a list of supported archive types.
PHYSFS_ErrorCode
PHYSFS_ErrorCode
Values that represent specific causes of failure.
Definition physfs.h:3398
PHYSFS_ERR_READ_ONLY
@ PHYSFS_ERR_READ_ONLY
Definition physfs.h:3416
PHYSFS_ERR_BAD_PASSWORD
@ PHYSFS_ERR_BAD_PASSWORD
Definition physfs.h:3427
PHYSFS_ERR_IO
@ PHYSFS_ERR_IO
Definition physfs.h:3419
PHYSFS_ERR_NOT_MOUNTED
@ PHYSFS_ERR_NOT_MOUNTED
Definition physfs.h:3409
PHYSFS_ERR_DIR_NOT_EMPTY
@ PHYSFS_ERR_DIR_NOT_EMPTY
Definition physfs.h:3424
PHYSFS_ERR_OPEN_FOR_READING
@ PHYSFS_ERR_OPEN_FOR_READING
Definition physfs.h:3413
PHYSFS_ERR_FILES_STILL_OPEN
@ PHYSFS_ERR_FILES_STILL_OPEN
Definition physfs.h:3407
PHYSFS_ERR_OK
@ PHYSFS_ERR_OK
Definition physfs.h:3399
PHYSFS_ERR_OUT_OF_MEMORY
@ PHYSFS_ERR_OUT_OF_MEMORY
Definition physfs.h:3401
PHYSFS_ERR_NOT_FOUND
@ PHYSFS_ERR_NOT_FOUND
Definition physfs.h:3410
PHYSFS_ERR_SYMLINK_FORBIDDEN
@ PHYSFS_ERR_SYMLINK_FORBIDDEN
Definition physfs.h:3411
PHYSFS_ERR_OPEN_FOR_WRITING
@ PHYSFS_ERR_OPEN_FOR_WRITING
Definition physfs.h:3414
PHYSFS_ERR_APP_CALLBACK
@ PHYSFS_ERR_APP_CALLBACK
Definition physfs.h:3428
PHYSFS_ERR_PAST_EOF
@ PHYSFS_ERR_PAST_EOF
Definition physfs.h:3406
PHYSFS_ERR_UNSUPPORTED
@ PHYSFS_ERR_UNSUPPORTED
Definition physfs.h:3405
PHYSFS_ERR_NO_WRITE_DIR
@ PHYSFS_ERR_NO_WRITE_DIR
Definition physfs.h:3412
PHYSFS_ERR_BUSY
@ PHYSFS_ERR_BUSY
Definition physfs.h:3423
PHYSFS_ERR_BAD_FILENAME
@ PHYSFS_ERR_BAD_FILENAME
Definition physfs.h:3422
PHYSFS_ERR_OS_ERROR
@ PHYSFS_ERR_OS_ERROR
Definition physfs.h:3425
PHYSFS_ERR_INVALID_ARGUMENT
@ PHYSFS_ERR_INVALID_ARGUMENT
Definition physfs.h:3408
PHYSFS_ERR_NO_SPACE
@ PHYSFS_ERR_NO_SPACE
Definition physfs.h:3421
PHYSFS_ERR_NOT_A_FILE
@ PHYSFS_ERR_NOT_A_FILE
Definition physfs.h:3415
PHYSFS_ERR_SYMLINK_LOOP
@ PHYSFS_ERR_SYMLINK_LOOP
Definition physfs.h:3418
PHYSFS_ERR_PERMISSION
@ PHYSFS_ERR_PERMISSION
Definition physfs.h:3420
PHYSFS_ERR_ARGV0_IS_NULL
@ PHYSFS_ERR_ARGV0_IS_NULL
Definition physfs.h:3404
PHYSFS_ERR_CORRUPT
@ PHYSFS_ERR_CORRUPT
Definition physfs.h:3417
PHYSFS_ERR_IS_INITIALIZED
@ PHYSFS_ERR_IS_INITIALIZED
Definition physfs.h:3403
PHYSFS_ERR_DUPLICATE
@ PHYSFS_ERR_DUPLICATE
Definition physfs.h:3426
PHYSFS_ERR_NOT_INITIALIZED
@ PHYSFS_ERR_NOT_INITIALIZED
Definition physfs.h:3402
PHYSFS_ERR_OTHER_ERROR
@ PHYSFS_ERR_OTHER_ERROR
Definition physfs.h:3400
PHYSFS_symbolicLinksPermitted
int PHYSFS_symbolicLinksPermitted(void)
Determine if the symbolic links are permitted.
PHYSFS_getRealDir
const char * PHYSFS_getRealDir(const char *filename)
Figure out where in the search path a file resides.
PHYSFS_getErrorByCode
const char * PHYSFS_getErrorByCode(PHYSFS_ErrorCode code)
Get human-readable description string for a given error code.
PHYSFS_isDirectory
int PHYSFS_isDirectory(const char *fname)
Determine if a file in the search path is really a directory.
PHYSFS_getLastModTime
PHYSFS_sint64 PHYSFS_getLastModTime(const char *filename)
Get the last modification time of a file.
PHYSFS_uint8
unsigned char PHYSFS_uint8
An unsigned, 8-bit integer type.
Definition physfs.h:264
PHYSFS_sint32
signed int PHYSFS_sint32
A signed, 32-bit integer type.
Definition physfs.h:294
PHYSFS_openRead
PHYSFS_File * PHYSFS_openRead(const char *filename)
Open a file for reading.
PHYSFS_swapSBE16
PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 val)
Swap bigendian signed 16 to platform's native byte order.
PHYSFS_isInit
int PHYSFS_isInit(void)
Determine if the PhysicsFS library is initialized.
PHYSFS_init
int PHYSFS_init(const char *argv0)
Initialize the PhysicsFS library.
PHYSFS_writeSBE16
int PHYSFS_writeSBE16(PHYSFS_File *file, PHYSFS_sint16 val)
Convert and write a signed 16-bit bigendian value.
PHYSFS_readBytes
PHYSFS_sint64 PHYSFS_readBytes(PHYSFS_File *handle, void *buffer, PHYSFS_uint64 len)
Read bytes from a PhysicsFS filehandle.
PHYSFS_getWriteDir
const char * PHYSFS_getWriteDir(void)
Get path where PhysicsFS will allow file writing.
PHYSFS_writeUBE16
int PHYSFS_writeUBE16(PHYSFS_File *file, PHYSFS_uint16 val)
Convert and write an unsigned 16-bit bigendian value.
PHYSFS_sint16
signed short PHYSFS_sint16
A signed, 16-bit integer type.
Definition physfs.h:282
PHYSFS_close
int PHYSFS_close(PHYSFS_File *handle)
Close a PhysicsFS filehandle.
PHYSFS_swapUBE64
PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 val)
Swap bigendian unsigned 64 to platform's native byte order.
PHYSFS_eof
int PHYSFS_eof(PHYSFS_File *handle)
Check for end-of-file state on a PhysicsFS filehandle.
PHYSFS_swapULE32
PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 val)
Swap littleendian unsigned 32 to platform's native byte order.
PHYSFS_swapSLE16
PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 val)
Swap littleendian signed 16 to platform's native byte order.
PHYSFS_utf8ToUtf16
void PHYSFS_utf8ToUtf16(const char *src, PHYSFS_uint16 *dst, PHYSFS_uint64 len)
Convert a UTF-8 string to a UTF-16 string.
PHYSFS_mountIo
int PHYSFS_mountIo(PHYSFS_Io *io, const char *newDir, const char *mountPoint, int appendToPath)
Add an archive, built on a PHYSFS_Io, to the search path.
PHYSFS_stat
int PHYSFS_stat(const char *fname, PHYSFS_Stat *stat)
Get various information about a directory or a file.
PHYSFS_EnumFilesCallback
void(* PHYSFS_EnumFilesCallback)(void *data, const char *origdir, const char *fname)
Function signature for callbacks that enumerate files.
Definition physfs.h:2324
PHYSFS_swapSBE32
PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 val)
Swap bigendian signed 32 to platform's native byte order.
PHYSFS_getLinkedVersion
void PHYSFS_getLinkedVersion(PHYSFS_Version *ver)
Get the version of PhysicsFS that is linked against your program.
PHYSFS_mount
int PHYSFS_mount(const char *newDir, const char *mountPoint, int appendToPath)
Add an archive or directory to the search path.
PHYSFS_read
PHYSFS_sint64 PHYSFS_read(PHYSFS_File *handle, void *buffer, PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
Read data from a PhysicsFS filehandle.
PHYSFS_writeULE32
int PHYSFS_writeULE32(PHYSFS_File *file, PHYSFS_uint32 val)
Convert and write an unsigned 32-bit littleendian value.
PHYSFS_swapSBE64
PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 val)
Swap bigendian signed 64 to platform's native byte order.
PHYSFS_writeUBE32
int PHYSFS_writeUBE32(PHYSFS_File *file, PHYSFS_uint32 val)
Convert and write an unsigned 32-bit bigendian value.
PHYSFS_swapSLE32
PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 val)
Swap littleendian signed 32 to platform's native byte order.
PHYSFS_enumerateFilesCallback
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_getUserDir
const char * PHYSFS_getUserDir(void)
Get the path where user's home directory resides.
PHYSFS_getLastError
const char * PHYSFS_getLastError(void)
Get human-readable error information.
PHYSFS_EnumerateCallbackResult
PHYSFS_EnumerateCallbackResult
Definition physfs.h:2685
PHYSFS_ENUM_ERROR
@ PHYSFS_ENUM_ERROR
Definition physfs.h:2686
PHYSFS_ENUM_STOP
@ PHYSFS_ENUM_STOP
Definition physfs.h:2687
PHYSFS_ENUM_OK
@ PHYSFS_ENUM_OK
Definition physfs.h:2688
PHYSFS_deinit
int PHYSFS_deinit(void)
Deinitialize the PhysicsFS library.
PHYSFS_uint16
unsigned short PHYSFS_uint16
An unsigned, 16-bit integer type.
Definition physfs.h:276
PHYSFS_utf8stricmp
int PHYSFS_utf8stricmp(const char *str1, const char *str2)
Case-insensitive compare of two UTF-8 strings.
PHYSFS_getAllocator
const PHYSFS_Allocator * PHYSFS_getAllocator(void)
Discover the current allocator.
PHYSFS_unmount
int PHYSFS_unmount(const char *oldDir)
Remove a directory or archive from the search path.
PHYSFS_readSBE32
int PHYSFS_readSBE32(PHYSFS_File *file, PHYSFS_sint32 *val)
Read and convert a signed 32-bit bigendian value.
PHYSFS_sint64
signed long long PHYSFS_sint64
A signed, 64-bit integer type.
Definition physfs.h:319
PHYSFS_permitSymbolicLinks
void PHYSFS_permitSymbolicLinks(int allow)
Enable or disable following of symbolic links.
PHYSFS_writeULE64
int PHYSFS_writeULE64(PHYSFS_File *file, PHYSFS_uint64 val)
Convert and write an unsigned 64-bit littleendian value.
PHYSFS_writeSLE64
int PHYSFS_writeSLE64(PHYSFS_File *file, PHYSFS_sint64 val)
Convert and write a signed 64-bit littleendian value.
PHYSFS_writeSBE64
int PHYSFS_writeSBE64(PHYSFS_File *file, PHYSFS_sint64 val)
Convert and write a signed 64-bit bigending value.
PHYSFS_utf8FromUtf16
void PHYSFS_utf8FromUtf16(const PHYSFS_uint16 *src, char *dst, PHYSFS_uint64 len)
Convert a UTF-16 string to a UTF-8 string.
PHYSFS_deregisterArchiver
int PHYSFS_deregisterArchiver(const char *ext)
Remove an archiver from the system.
PHYSFS_openWrite
PHYSFS_File * PHYSFS_openWrite(const char *filename)
Open a file for writing.
PHYSFS_getSearchPathCallback
void PHYSFS_getSearchPathCallback(PHYSFS_StringCallback c, void *d)
Enumerate the search path, using an application-defined callback.
PHYSFS_openAppend
PHYSFS_File * PHYSFS_openAppend(const char *filename)
Open a file for appending.
PHYSFS_utf8FromUcs4
void PHYSFS_utf8FromUcs4(const PHYSFS_uint32 *src, char *dst, PHYSFS_uint64 len)
Convert a UCS-4 string to a UTF-8 string.
PHYSFS_utf8FromUcs2
void PHYSFS_utf8FromUcs2(const PHYSFS_uint16 *src, char *dst, PHYSFS_uint64 len)
Convert a UCS-2 string to a UTF-8 string.
PHYSFS_getSearchPath
char ** PHYSFS_getSearchPath(void)
Get the current search path.
PHYSFS_FileType
PHYSFS_FileType
Type of a File.
Definition physfs.h:2858
PHYSFS_FILETYPE_DIRECTORY
@ PHYSFS_FILETYPE_DIRECTORY
Definition physfs.h:2860
PHYSFS_FILETYPE_OTHER
@ PHYSFS_FILETYPE_OTHER
Definition physfs.h:2862
PHYSFS_FILETYPE_SYMLINK
@ PHYSFS_FILETYPE_SYMLINK
Definition physfs.h:2861
PHYSFS_FILETYPE_REGULAR
@ PHYSFS_FILETYPE_REGULAR
Definition physfs.h:2859
PHYSFS_swapULE16
PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 val)
Swap littleendian unsigned 16 to platform's native byte order.
PHYSFS_exists
int PHYSFS_exists(const char *fname)
Determine if a file exists in the search path.
PHYSFS_getPrefDir
const char * PHYSFS_getPrefDir(const char *org, const char *app)
Get the user-and-app-specific path where files can be written.
PHYSFS_getCdRomDirsCallback
void PHYSFS_getCdRomDirsCallback(PHYSFS_StringCallback c, void *d)
Enumerate CD-ROM directories, using an application-defined callback.
PHYSFS_registerArchiver
int PHYSFS_registerArchiver(const PHYSFS_Archiver *archiver)
Add a new archiver to the system.
PHYSFS_uint32
unsigned int PHYSFS_uint32
An unsigned, 32-bit integer type.
Definition physfs.h:288
PHYSFS_getDirSeparator
const char * PHYSFS_getDirSeparator(void)
Get platform-dependent dir separator string.
PHYSFS_ucs4stricmp
int PHYSFS_ucs4stricmp(const PHYSFS_uint32 *str1, const PHYSFS_uint32 *str2)
Case-insensitive compare of two UCS-4 strings.
PHYSFS_readSBE16
int PHYSFS_readSBE16(PHYSFS_File *file, PHYSFS_sint16 *val)
Read and convert a signed 16-bit bigendian value.
PHYSFS_writeULE16
int PHYSFS_writeULE16(PHYSFS_File *file, PHYSFS_uint16 val)
Convert and write an unsigned 16-bit littleendian value.
PHYSFS_setErrorCode
void PHYSFS_setErrorCode(PHYSFS_ErrorCode code)
Set the current thread's error code.
PHYSFS_readULE32
int PHYSFS_readULE32(PHYSFS_File *file, PHYSFS_uint32 *val)
Read and convert an unsigned 32-bit littleendian value.
PHYSFS_utf8ToUcs2
void PHYSFS_utf8ToUcs2(const char *src, PHYSFS_uint16 *dst, PHYSFS_uint64 len)
Convert a UTF-8 string to a UCS-2 string.
PHYSFS_mkdir
int PHYSFS_mkdir(const char *dirName)
Create a directory.
PHYSFS_isSymbolicLink
int PHYSFS_isSymbolicLink(const char *fname)
Determine if a file in the search path is really a symbolic link.
PHYSFS_seek
int PHYSFS_seek(PHYSFS_File *handle, PHYSFS_uint64 pos)
Seek to a new position within a PhysicsFS filehandle.
PHYSFS_setAllocator
int PHYSFS_setAllocator(const PHYSFS_Allocator *allocator)
Hook your own allocation routines into PhysicsFS.
PHYSFS_readULE64
int PHYSFS_readULE64(PHYSFS_File *file, PHYSFS_uint64 *val)
Read and convert an unsigned 64-bit littleendian value.
PHYSFS_getMountPoint
const char * PHYSFS_getMountPoint(const char *dir)
Determine a mounted archive's mountpoint.
PHYSFS_readSLE64
int PHYSFS_readSLE64(PHYSFS_File *file, PHYSFS_sint64 *val)
Read and convert a signed 64-bit littleendian value.
PHYSFS_getLastErrorCode
PHYSFS_ErrorCode PHYSFS_getLastErrorCode(void)
Get machine-readable error information.
PHYSFS_writeSLE16
int PHYSFS_writeSLE16(PHYSFS_File *file, PHYSFS_sint16 val)
Convert and write a signed 16-bit littleendian value.
PHYSFS_StringCallback
void(* PHYSFS_StringCallback)(void *data, const char *str)
Function signature for callbacks that report strings.
Definition physfs.h:2286
PHYSFS_setBuffer
int PHYSFS_setBuffer(PHYSFS_File *handle, PHYSFS_uint64 bufsize)
Set up buffering for a PhysicsFS file handle.
PHYSFS_swapSLE64
PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 val)
Swap littleendian signed 64 to platform's native byte order.
PHYSFS_EnumerateCallback
PHYSFS_EnumerateCallbackResult(* PHYSFS_EnumerateCallback)(void *data, const char *origdir, const char *fname)
Possible return values from PHYSFS_EnumerateCallback.
Definition physfs.h:2718
PHYSFS_readULE16
int PHYSFS_readULE16(PHYSFS_File *file, PHYSFS_uint16 *val)
Read and convert an unsigned 16-bit littleendian value.
PHYSFS_write
PHYSFS_sint64 PHYSFS_write(PHYSFS_File *handle, const void *buffer, PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
Write data to a PhysicsFS filehandle.
PHYSFS_freeList
void PHYSFS_freeList(void *listVar)
Deallocate resources of lists returned by PhysicsFS.
PHYSFS_getCdRomDirs
char ** PHYSFS_getCdRomDirs(void)
Get an array of paths to available CD-ROM drives.
PHYSFS_setRoot
int PHYSFS_setRoot(const char *archive, const char *subdir)
Make a subdirectory of an archive its root directory.
PHYSFS_setSaneConfig
int PHYSFS_setSaneConfig(const char *organization, const char *appName, const char *archiveExt, int includeCdRoms, int archivesFirst)
Set up sane, default paths.
PHYSFS_Allocator
PhysicsFS allocation function pointers.
Definition physfs.h:2149
PHYSFS_Allocator::Deinit
void(* Deinit)(void)
Definition physfs.h:2151
PHYSFS_Allocator::Init
int(* Init)(void)
Definition physfs.h:2150
PHYSFS_Allocator::Free
void(* Free)(void *)
Definition physfs.h:2154
PHYSFS_ArchiveInfo
Information on various PhysicsFS-supported archives.
Definition physfs.h:406
PHYSFS_ArchiveInfo::url
const char * url
Definition physfs.h:410
PHYSFS_ArchiveInfo::author
const char * author
Definition physfs.h:409
PHYSFS_ArchiveInfo::description
const char * description
Definition physfs.h:408
PHYSFS_ArchiveInfo::supportsSymlinks
int supportsSymlinks
Definition physfs.h:411
PHYSFS_ArchiveInfo::extension
const char * extension
Definition physfs.h:407
PHYSFS_Archiver
Abstract interface to provide support for user-defined archives.
Definition physfs.h:3648
PHYSFS_Archiver::closeArchive
void(* closeArchive)(void *opaque)
Destruct a previously-opened archive.
Definition physfs.h:3809
PHYSFS_Archiver::stat
int(* stat)(void *opaque, const char *fn, PHYSFS_Stat *stat)
Obtain basic file metadata.
Definition physfs.h:3799
PHYSFS_Archiver::enumerate
PHYSFS_EnumerateCallbackResult(* enumerate)(void *opaque, const char *dirname, PHYSFS_EnumerateCallback cb, const char *origdir, void *callbackdata)
List all files in (dirname).
Definition physfs.h:3720
PHYSFS_Archiver::version
PHYSFS_uint32 version
Binary compatibility information.
Definition physfs.h:3657
PHYSFS_Archiver::mkdir
int(* mkdir)(void *opaque, const char *filename)
Create a directory in the archive.
Definition physfs.h:3787
PHYSFS_Archiver::info
PHYSFS_ArchiveInfo info
Basic info about this archiver.
Definition physfs.h:3665
PHYSFS_Archiver::remove
int(* remove)(void *opaque, const char *filename)
Delete a file or directory in the archive.
Definition physfs.h:3774
PHYSFS_File
A PhysicsFS file handle.
Definition physfs.h:369
PHYSFS_File::opaque
void * opaque
Definition physfs.h:370
PHYSFS_Io
An abstract i/o interface.
Definition physfs.h:3071
PHYSFS_Io::length
PHYSFS_sint64(* length)(struct PHYSFS_Io *io)
Determine size of the i/o instance's dataset.
Definition physfs.h:3174
PHYSFS_Io::write
PHYSFS_sint64(* write)(struct PHYSFS_Io *io, const void *buffer, PHYSFS_uint64 len)
Write more data.
Definition physfs.h:3136
PHYSFS_Io::seek
int(* seek)(struct PHYSFS_Io *io, PHYSFS_uint64 offset)
Move i/o position to a given byte offset from start.
Definition physfs.h:3150
PHYSFS_Io::tell
PHYSFS_sint64(* tell)(struct PHYSFS_Io *io)
Report current i/o position.
Definition physfs.h:3162
PHYSFS_Io::destroy
void(* destroy)(struct PHYSFS_Io *io)
Cleanup and deallocate i/o instance.
Definition physfs.h:3226
PHYSFS_Io::read
PHYSFS_sint64(* read)(struct PHYSFS_Io *io, void *buf, PHYSFS_uint64 len)
Read more data.
Definition physfs.h:3111
PHYSFS_Io::opaque
void * opaque
Instance data for this struct.
Definition physfs.h:3090
PHYSFS_Io::flush
int(* flush)(struct PHYSFS_Io *io)
Flush resources to media, or wherever.
Definition physfs.h:3207
PHYSFS_Io::version
PHYSFS_uint32 version
Binary compatibility information.
Definition physfs.h:3080
PHYSFS_Stat
Meta data for a file or directory.
Definition physfs.h:2883
PHYSFS_Stat::accesstime
PHYSFS_sint64 accesstime
Definition physfs.h:2887
PHYSFS_Stat::filesize
PHYSFS_sint64 filesize
Definition physfs.h:2884
PHYSFS_Stat::readonly
int readonly
Definition physfs.h:2889
PHYSFS_Stat::modtime
PHYSFS_sint64 modtime
Definition physfs.h:2885
PHYSFS_Stat::createtime
PHYSFS_sint64 createtime
Definition physfs.h:2886
PHYSFS_Stat::filetype
PHYSFS_FileType filetype
Definition physfs.h:2888
PHYSFS_Version
Information the version of PhysicsFS in use.
Definition physfs.h:429
PHYSFS_Version::patch
PHYSFS_uint8 patch
Definition physfs.h:432
PHYSFS_Version::minor
PHYSFS_uint8 minor
Definition physfs.h:431
PHYSFS_Version::major
PHYSFS_uint8 major
Definition physfs.h:430