00001
00141 #ifndef _INCLUDE_PHYSFS_H_
00142 #define _INCLUDE_PHYSFS_H_
00143
00144 #ifdef __cplusplus
00145 extern "C" {
00146 #endif
00147
00148 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
00149 #if (defined _MSC_VER)
00150 #define __EXPORT__ __declspec(dllexport)
00151 #else
00152 #define __EXPORT__
00153 #endif
00154 #endif
00155
00160 typedef unsigned char PHYSFS_uint8;
00161
00166 typedef signed char PHYSFS_sint8;
00167
00172 typedef unsigned short PHYSFS_uint16;
00173
00178 typedef signed short PHYSFS_sint16;
00179
00184 typedef unsigned int PHYSFS_uint32;
00185
00190 typedef signed int PHYSFS_sint32;
00191
00207 #if (defined PHYSFS_NO_64BIT_SUPPORT)
00208 typedef PHYSFS_uint32 PHYSFS_uint64;
00209 typedef PHYSFS_sint32 PHYSFS_sint64;
00210 #elif (defined _MSC_VER)
00211 typedef signed __int64 PHYSFS_sint64;
00212 typedef unsigned __int64 PHYSFS_uint64;
00213 #else
00214 typedef unsigned long long PHYSFS_uint64;
00215 typedef signed long long PHYSFS_sint64;
00216 #endif
00217
00218
00219 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
00220
00221 #define PHYSFS_COMPILE_TIME_ASSERT(name, x) \
00222 typedef int PHYSFS_dummy_ ## name[(x) * 2 - 1]
00223
00224 PHYSFS_COMPILE_TIME_ASSERT(uint8, sizeof(PHYSFS_uint8) == 1);
00225 PHYSFS_COMPILE_TIME_ASSERT(sint8, sizeof(PHYSFS_sint8) == 1);
00226 PHYSFS_COMPILE_TIME_ASSERT(uint16, sizeof(PHYSFS_uint16) == 2);
00227 PHYSFS_COMPILE_TIME_ASSERT(sint16, sizeof(PHYSFS_sint16) == 2);
00228 PHYSFS_COMPILE_TIME_ASSERT(uint32, sizeof(PHYSFS_uint32) == 4);
00229 PHYSFS_COMPILE_TIME_ASSERT(sint32, sizeof(PHYSFS_sint32) == 4);
00230
00231 #ifndef PHYSFS_NO_64BIT_SUPPORT
00232 PHYSFS_COMPILE_TIME_ASSERT(uint64, sizeof(PHYSFS_uint64) == 8);
00233 PHYSFS_COMPILE_TIME_ASSERT(sint64, sizeof(PHYSFS_sint64) == 8);
00234 #endif
00235
00236 #undef PHYSFS_COMPILE_TIME_ASSERT
00237
00238 #endif
00239
00240
00262 typedef struct
00263 {
00264 void *opaque;
00265 } PHYSFS_file;
00266
00267
00268
00284 typedef struct
00285 {
00286 const char *extension;
00287 const char *description;
00288 const char *author;
00289 const char *url;
00290 } PHYSFS_ArchiveInfo;
00291
00305 typedef struct
00306 {
00307 PHYSFS_uint8 major;
00308 PHYSFS_uint8 minor;
00309 PHYSFS_uint8 patch;
00310 } PHYSFS_Version;
00311
00312 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
00313 #define PHYSFS_VER_MAJOR 0
00314 #define PHYSFS_VER_MINOR 1
00315 #define PHYSFS_VER_PATCH 7
00316 #endif
00317
00334 #define PHYSFS_VERSION(x) \
00335 { \
00336 (x)->major = PHYSFS_VER_MAJOR; \
00337 (x)->minor = PHYSFS_VER_MINOR; \
00338 (x)->patch = PHYSFS_VER_PATCH; \
00339 }
00340
00341
00368 __EXPORT__ void PHYSFS_getLinkedVersion(PHYSFS_Version *ver);
00369
00370
00390 __EXPORT__ int PHYSFS_init(const char *argv0);
00391
00392
00417 __EXPORT__ int PHYSFS_deinit(void);
00418
00419
00448 __EXPORT__ const PHYSFS_ArchiveInfo **PHYSFS_supportedArchiveTypes(void);
00449
00450
00464 __EXPORT__ void PHYSFS_freeList(void *listVar);
00465
00466
00481 __EXPORT__ const char *PHYSFS_getLastError(void);
00482
00483
00497 __EXPORT__ const char *PHYSFS_getDirSeparator(void);
00498
00499
00528 __EXPORT__ void PHYSFS_permitSymbolicLinks(int allow);
00529
00530
00563 __EXPORT__ char **PHYSFS_getCdRomDirs(void);
00564
00565
00582 __EXPORT__ const char *PHYSFS_getBaseDir(void);
00583
00584
00605 __EXPORT__ const char *PHYSFS_getUserDir(void);
00606
00607
00619 __EXPORT__ const char *PHYSFS_getWriteDir(void);
00620
00621
00643 __EXPORT__ int PHYSFS_setWriteDir(const char *newDir);
00644
00645
00663 __EXPORT__ int PHYSFS_addToSearchPath(const char *newDir, int appendToPath);
00664
00665
00683 __EXPORT__ int PHYSFS_removeFromSearchPath(const char *oldDir);
00684
00685
00711 __EXPORT__ char **PHYSFS_getSearchPath(void);
00712
00713
00771 __EXPORT__ int PHYSFS_setSaneConfig(const char *organization,
00772 const char *appName,
00773 const char *archiveExt,
00774 int includeCdRoms,
00775 int archivesFirst);
00776
00777
00799 __EXPORT__ int PHYSFS_mkdir(const char *dirName);
00800
00801
00832 __EXPORT__ int PHYSFS_delete(const char *filename);
00833
00834
00856 __EXPORT__ const char *PHYSFS_getRealDir(const char *filename);
00857
00858
00859
00896 __EXPORT__ char **PHYSFS_enumerateFiles(const char *dir);
00897
00898
00916 __EXPORT__ int PHYSFS_exists(const char *fname);
00917
00918
00936 __EXPORT__ int PHYSFS_isDirectory(const char *fname);
00937
00938
00956 __EXPORT__ int PHYSFS_isSymbolicLink(const char *fname);
00957
00958
00981 __EXPORT__ PHYSFS_file *PHYSFS_openWrite(const char *filename);
00982
00983
01007 __EXPORT__ PHYSFS_file *PHYSFS_openAppend(const char *filename);
01008
01009
01032 __EXPORT__ PHYSFS_file *PHYSFS_openRead(const char *filename);
01033
01034
01053 __EXPORT__ int PHYSFS_close(PHYSFS_file *handle);
01054
01055
01069 __EXPORT__ PHYSFS_sint64 PHYSFS_getLastModTime(const char *filename);
01070
01071
01088 __EXPORT__ PHYSFS_sint64 PHYSFS_read(PHYSFS_file *handle,
01089 void *buffer,
01090 PHYSFS_uint32 objSize,
01091 PHYSFS_uint32 objCount);
01092
01106 __EXPORT__ PHYSFS_sint64 PHYSFS_write(PHYSFS_file *handle,
01107 const void *buffer,
01108 PHYSFS_uint32 objSize,
01109 PHYSFS_uint32 objCount);
01110
01123 __EXPORT__ int PHYSFS_eof(PHYSFS_file *handle);
01124
01125
01136 __EXPORT__ PHYSFS_sint64 PHYSFS_tell(PHYSFS_file *handle);
01137
01138
01153 __EXPORT__ int PHYSFS_seek(PHYSFS_file *handle, PHYSFS_uint64 pos);
01154
01155
01172 __EXPORT__ PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_file *handle);
01173
01174
01175
01176
01187 __EXPORT__ PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 val);
01188
01189
01200 __EXPORT__ PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 val);
01201
01212 __EXPORT__ PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 val);
01213
01214
01225 __EXPORT__ PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 val);
01226
01240 __EXPORT__ PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 val);
01241
01242
01256 __EXPORT__ PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 val);
01257
01258
01269 __EXPORT__ PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 val);
01270
01271
01282 __EXPORT__ PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 val);
01283
01294 __EXPORT__ PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 val);
01295
01296
01307 __EXPORT__ PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 val);
01308
01309
01323 __EXPORT__ PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 val);
01324
01325
01339 __EXPORT__ PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 val);
01340
01341
01355 __EXPORT__ int PHYSFS_readSLE16(PHYSFS_file *file, PHYSFS_sint16 *val);
01356
01357
01372 __EXPORT__ int PHYSFS_readULE16(PHYSFS_file *file, PHYSFS_uint16 *val);
01373
01374
01388 __EXPORT__ int PHYSFS_readSBE16(PHYSFS_file *file, PHYSFS_sint16 *val);
01389
01390
01405 __EXPORT__ int PHYSFS_readUBE16(PHYSFS_file *file, PHYSFS_uint16 *val);
01406
01407
01421 __EXPORT__ int PHYSFS_readSLE32(PHYSFS_file *file, PHYSFS_sint32 *val);
01422
01423
01438 __EXPORT__ int PHYSFS_readULE32(PHYSFS_file *file, PHYSFS_uint32 *val);
01439
01440
01454 __EXPORT__ int PHYSFS_readSBE32(PHYSFS_file *file, PHYSFS_sint32 *val);
01455
01456
01471 __EXPORT__ int PHYSFS_readUBE32(PHYSFS_file *file, PHYSFS_uint32 *val);
01472
01473
01490 __EXPORT__ int PHYSFS_readSLE64(PHYSFS_file *file, PHYSFS_sint64 *val);
01491
01492
01509 __EXPORT__ int PHYSFS_readULE64(PHYSFS_file *file, PHYSFS_uint64 *val);
01510
01511
01528 __EXPORT__ int PHYSFS_readSBE64(PHYSFS_file *file, PHYSFS_sint64 *val);
01529
01530
01547 __EXPORT__ int PHYSFS_readUBE64(PHYSFS_file *file, PHYSFS_uint64 *val);
01548
01549
01562 __EXPORT__ int PHYSFS_writeSLE16(PHYSFS_file *file, PHYSFS_sint16 val);
01563
01564
01577 __EXPORT__ int PHYSFS_writeULE16(PHYSFS_file *file, PHYSFS_uint16 val);
01578
01579
01592 __EXPORT__ int PHYSFS_writeSBE16(PHYSFS_file *file, PHYSFS_sint16 val);
01593
01594
01607 __EXPORT__ int PHYSFS_writeUBE16(PHYSFS_file *file, PHYSFS_uint16 val);
01608
01609
01622 __EXPORT__ int PHYSFS_writeSLE32(PHYSFS_file *file, PHYSFS_sint32 val);
01623
01624
01637 __EXPORT__ int PHYSFS_writeULE32(PHYSFS_file *file, PHYSFS_uint32 val);
01638
01639
01652 __EXPORT__ int PHYSFS_writeSBE32(PHYSFS_file *file, PHYSFS_sint32 val);
01653
01654
01667 __EXPORT__ int PHYSFS_writeUBE32(PHYSFS_file *file, PHYSFS_uint32 val);
01668
01669
01685 __EXPORT__ int PHYSFS_writeSLE64(PHYSFS_file *file, PHYSFS_sint64 val);
01686
01687
01703 __EXPORT__ int PHYSFS_writeULE64(PHYSFS_file *file, PHYSFS_uint64 val);
01704
01705
01721 __EXPORT__ int PHYSFS_writeSBE64(PHYSFS_file *file, PHYSFS_sint64 val);
01722
01723
01739 __EXPORT__ int PHYSFS_writeUBE64(PHYSFS_file *file, PHYSFS_uint64 val);
01740
01741
01742 #ifdef __cplusplus
01743 }
01744 #endif
01745
01746 #endif
01747
01748
01749