Main Page | Data Structures | File List | Data Fields | Globals

physfs.h

Go to the documentation of this file.
00001 00146 #ifndef _INCLUDE_PHYSFS_H_ 00147 #define _INCLUDE_PHYSFS_H_ 00148 00149 #ifdef __cplusplus 00150 extern "C" { 00151 #endif 00152 00153 #ifndef DOXYGEN_SHOULD_IGNORE_THIS 00154 #if (defined _MSC_VER) 00155 #define __EXPORT__ __declspec(dllexport) 00156 #else 00157 #define __EXPORT__ 00158 #endif 00159 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */ 00160 00165 typedef unsigned char PHYSFS_uint8; 00166 00171 typedef signed char PHYSFS_sint8; 00172 00177 typedef unsigned short PHYSFS_uint16; 00178 00183 typedef signed short PHYSFS_sint16; 00184 00189 typedef unsigned int PHYSFS_uint32; 00190 00195 typedef signed int PHYSFS_sint32; 00196 00212 #if (defined PHYSFS_NO_64BIT_SUPPORT) /* oh well. */ 00213 typedef PHYSFS_uint32 PHYSFS_uint64; 00214 typedef PHYSFS_sint32 PHYSFS_sint64; 00215 #elif (defined _MSC_VER) 00216 typedef signed __int64 PHYSFS_sint64; 00217 typedef unsigned __int64 PHYSFS_uint64; 00218 #else 00219 typedef unsigned long long PHYSFS_uint64; 00220 typedef signed long long PHYSFS_sint64; 00221 #endif 00222 00223 00224 #ifndef DOXYGEN_SHOULD_IGNORE_THIS 00225 /* Make sure the types really have the right sizes */ 00226 #define PHYSFS_COMPILE_TIME_ASSERT(name, x) \ 00227 typedef int PHYSFS_dummy_ ## name[(x) * 2 - 1] 00228 00229 PHYSFS_COMPILE_TIME_ASSERT(uint8, sizeof(PHYSFS_uint8) == 1); 00230 PHYSFS_COMPILE_TIME_ASSERT(sint8, sizeof(PHYSFS_sint8) == 1); 00231 PHYSFS_COMPILE_TIME_ASSERT(uint16, sizeof(PHYSFS_uint16) == 2); 00232 PHYSFS_COMPILE_TIME_ASSERT(sint16, sizeof(PHYSFS_sint16) == 2); 00233 PHYSFS_COMPILE_TIME_ASSERT(uint32, sizeof(PHYSFS_uint32) == 4); 00234 PHYSFS_COMPILE_TIME_ASSERT(sint32, sizeof(PHYSFS_sint32) == 4); 00235 00236 #ifndef PHYSFS_NO_64BIT_SUPPORT 00237 PHYSFS_COMPILE_TIME_ASSERT(uint64, sizeof(PHYSFS_uint64) == 8); 00238 PHYSFS_COMPILE_TIME_ASSERT(sint64, sizeof(PHYSFS_sint64) == 8); 00239 #endif 00240 00241 #undef PHYSFS_COMPILE_TIME_ASSERT 00242 00243 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */ 00244 00245 00269 typedef struct 00270 { 00271 void *opaque; 00272 } PHYSFS_file; 00273 00274 00275 00291 typedef struct 00292 { 00293 const char *extension; 00294 const char *description; 00295 const char *author; 00296 const char *url; 00297 } PHYSFS_ArchiveInfo; 00298 00299 00313 typedef struct 00314 { 00315 PHYSFS_uint8 major; 00316 PHYSFS_uint8 minor; 00317 PHYSFS_uint8 patch; 00318 } PHYSFS_Version; 00319 00320 #ifndef DOXYGEN_SHOULD_IGNORE_THIS 00321 #define PHYSFS_VER_MAJOR 1 00322 #define PHYSFS_VER_MINOR 0 00323 #define PHYSFS_VER_PATCH 0 00324 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */ 00325 00326 00327 /* PhysicsFS state stuff ... */ 00328 00345 #define PHYSFS_VERSION(x) \ 00346 { \ 00347 (x)->major = PHYSFS_VER_MAJOR; \ 00348 (x)->minor = PHYSFS_VER_MINOR; \ 00349 (x)->patch = PHYSFS_VER_PATCH; \ 00350 } 00351 00352 00379 __EXPORT__ void PHYSFS_getLinkedVersion(PHYSFS_Version *ver); 00380 00381 00401 __EXPORT__ int PHYSFS_init(const char *argv0); 00402 00403 00428 __EXPORT__ int PHYSFS_deinit(void); 00429 00430 00459 __EXPORT__ const PHYSFS_ArchiveInfo **PHYSFS_supportedArchiveTypes(void); 00460 00461 00475 __EXPORT__ void PHYSFS_freeList(void *listVar); 00476 00477 00492 __EXPORT__ const char *PHYSFS_getLastError(void); 00493 00494 00508 __EXPORT__ const char *PHYSFS_getDirSeparator(void); 00509 00510 00539 __EXPORT__ void PHYSFS_permitSymbolicLinks(int allow); 00540 00541 00574 __EXPORT__ char **PHYSFS_getCdRomDirs(void); 00575 00576 00593 __EXPORT__ const char *PHYSFS_getBaseDir(void); 00594 00595 00616 __EXPORT__ const char *PHYSFS_getUserDir(void); 00617 00618 00630 __EXPORT__ const char *PHYSFS_getWriteDir(void); 00631 00632 00654 __EXPORT__ int PHYSFS_setWriteDir(const char *newDir); 00655 00656 00674 __EXPORT__ int PHYSFS_addToSearchPath(const char *newDir, int appendToPath); 00675 00676 00694 __EXPORT__ int PHYSFS_removeFromSearchPath(const char *oldDir); 00695 00696 00722 __EXPORT__ char **PHYSFS_getSearchPath(void); 00723 00724 00782 __EXPORT__ int PHYSFS_setSaneConfig(const char *organization, 00783 const char *appName, 00784 const char *archiveExt, 00785 int includeCdRoms, 00786 int archivesFirst); 00787 00788 00789 /* Directory management stuff ... */ 00790 00812 __EXPORT__ int PHYSFS_mkdir(const char *dirName); 00813 00814 00845 __EXPORT__ int PHYSFS_delete(const char *filename); 00846 00847 00869 __EXPORT__ const char *PHYSFS_getRealDir(const char *filename); 00870 00871 00908 __EXPORT__ char **PHYSFS_enumerateFiles(const char *dir); 00909 00910 00928 __EXPORT__ int PHYSFS_exists(const char *fname); 00929 00930 00948 __EXPORT__ int PHYSFS_isDirectory(const char *fname); 00949 00950 00968 __EXPORT__ int PHYSFS_isSymbolicLink(const char *fname); 00969 00970 00984 __EXPORT__ PHYSFS_sint64 PHYSFS_getLastModTime(const char *filename); 00985 00986 00987 /* i/o stuff... */ 00988 01011 __EXPORT__ PHYSFS_file *PHYSFS_openWrite(const char *filename); 01012 01013 01037 __EXPORT__ PHYSFS_file *PHYSFS_openAppend(const char *filename); 01038 01039 01062 __EXPORT__ PHYSFS_file *PHYSFS_openRead(const char *filename); 01063 01064 01083 __EXPORT__ int PHYSFS_close(PHYSFS_file *handle); 01084 01085 01102 __EXPORT__ PHYSFS_sint64 PHYSFS_read(PHYSFS_file *handle, 01103 void *buffer, 01104 PHYSFS_uint32 objSize, 01105 PHYSFS_uint32 objCount); 01106 01120 __EXPORT__ PHYSFS_sint64 PHYSFS_write(PHYSFS_file *handle, 01121 const void *buffer, 01122 PHYSFS_uint32 objSize, 01123 PHYSFS_uint32 objCount); 01124 01125 01126 /* File position stuff... */ 01127 01140 __EXPORT__ int PHYSFS_eof(PHYSFS_file *handle); 01141 01142 01153 __EXPORT__ PHYSFS_sint64 PHYSFS_tell(PHYSFS_file *handle); 01154 01155 01170 __EXPORT__ int PHYSFS_seek(PHYSFS_file *handle, PHYSFS_uint64 pos); 01171 01172 01189 __EXPORT__ PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_file *handle); 01190 01191 01192 /* Buffering stuff... */ 01193 01234 __EXPORT__ int PHYSFS_setBuffer(PHYSFS_file *handle, PHYSFS_uint64 bufsize); 01235 01236 01253 __EXPORT__ int PHYSFS_flush(PHYSFS_file *handle); 01254 01255 01256 /* Byteorder stuff... */ 01257 01268 __EXPORT__ PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 val); 01269 01270 01281 __EXPORT__ PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 val); 01282 01293 __EXPORT__ PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 val); 01294 01295 01306 __EXPORT__ PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 val); 01307 01321 __EXPORT__ PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 val); 01322 01323 01337 __EXPORT__ PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 val); 01338 01339 01350 __EXPORT__ PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 val); 01351 01352 01363 __EXPORT__ PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 val); 01364 01375 __EXPORT__ PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 val); 01376 01377 01388 __EXPORT__ PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 val); 01389 01390 01404 __EXPORT__ PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 val); 01405 01406 01420 __EXPORT__ PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 val); 01421 01422 01436 __EXPORT__ int PHYSFS_readSLE16(PHYSFS_file *file, PHYSFS_sint16 *val); 01437 01438 01453 __EXPORT__ int PHYSFS_readULE16(PHYSFS_file *file, PHYSFS_uint16 *val); 01454 01455 01469 __EXPORT__ int PHYSFS_readSBE16(PHYSFS_file *file, PHYSFS_sint16 *val); 01470 01471 01486 __EXPORT__ int PHYSFS_readUBE16(PHYSFS_file *file, PHYSFS_uint16 *val); 01487 01488 01502 __EXPORT__ int PHYSFS_readSLE32(PHYSFS_file *file, PHYSFS_sint32 *val); 01503 01504 01519 __EXPORT__ int PHYSFS_readULE32(PHYSFS_file *file, PHYSFS_uint32 *val); 01520 01521 01535 __EXPORT__ int PHYSFS_readSBE32(PHYSFS_file *file, PHYSFS_sint32 *val); 01536 01537 01552 __EXPORT__ int PHYSFS_readUBE32(PHYSFS_file *file, PHYSFS_uint32 *val); 01553 01554 01571 __EXPORT__ int PHYSFS_readSLE64(PHYSFS_file *file, PHYSFS_sint64 *val); 01572 01573 01590 __EXPORT__ int PHYSFS_readULE64(PHYSFS_file *file, PHYSFS_uint64 *val); 01591 01592 01609 __EXPORT__ int PHYSFS_readSBE64(PHYSFS_file *file, PHYSFS_sint64 *val); 01610 01611 01628 __EXPORT__ int PHYSFS_readUBE64(PHYSFS_file *file, PHYSFS_uint64 *val); 01629 01630 01643 __EXPORT__ int PHYSFS_writeSLE16(PHYSFS_file *file, PHYSFS_sint16 val); 01644 01645 01658 __EXPORT__ int PHYSFS_writeULE16(PHYSFS_file *file, PHYSFS_uint16 val); 01659 01660 01673 __EXPORT__ int PHYSFS_writeSBE16(PHYSFS_file *file, PHYSFS_sint16 val); 01674 01675 01688 __EXPORT__ int PHYSFS_writeUBE16(PHYSFS_file *file, PHYSFS_uint16 val); 01689 01690 01703 __EXPORT__ int PHYSFS_writeSLE32(PHYSFS_file *file, PHYSFS_sint32 val); 01704 01705 01718 __EXPORT__ int PHYSFS_writeULE32(PHYSFS_file *file, PHYSFS_uint32 val); 01719 01720 01733 __EXPORT__ int PHYSFS_writeSBE32(PHYSFS_file *file, PHYSFS_sint32 val); 01734 01735 01748 __EXPORT__ int PHYSFS_writeUBE32(PHYSFS_file *file, PHYSFS_uint32 val); 01749 01750 01766 __EXPORT__ int PHYSFS_writeSLE64(PHYSFS_file *file, PHYSFS_sint64 val); 01767 01768 01784 __EXPORT__ int PHYSFS_writeULE64(PHYSFS_file *file, PHYSFS_uint64 val); 01785 01786 01802 __EXPORT__ int PHYSFS_writeSBE64(PHYSFS_file *file, PHYSFS_sint64 val); 01803 01804 01820 __EXPORT__ int PHYSFS_writeUBE64(PHYSFS_file *file, PHYSFS_uint64 val); 01821 01822 01823 #ifdef __cplusplus 01824 } 01825 #endif 01826 01827 #endif /* !defined _INCLUDE_PHYSFS_H_ */ 01828 01829 /* end of physfs.h ... */ 01830

Generated on Wed Aug 18 06:41:58 2004 for physfs by doxygen 1.3.7