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

physfs.h

Go to the documentation of this file.
00001 
00144 #ifndef _INCLUDE_PHYSFS_H_
00145 #define _INCLUDE_PHYSFS_H_
00146 
00147 #ifdef __cplusplus
00148 extern "C" {
00149 #endif
00150 
00151 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
00152 #if (defined _MSC_VER)
00153 #define __EXPORT__ __declspec(dllexport)
00154 #else
00155 #define __EXPORT__
00156 #endif
00157 #endif  /* DOXYGEN_SHOULD_IGNORE_THIS */
00158 
00163 typedef unsigned char         PHYSFS_uint8;
00164 
00169 typedef signed char           PHYSFS_sint8;
00170 
00175 typedef unsigned short        PHYSFS_uint16;
00176 
00181 typedef signed short          PHYSFS_sint16;
00182 
00187 typedef unsigned int          PHYSFS_uint32;
00188 
00193 typedef signed int            PHYSFS_sint32;
00194 
00210 #if (defined PHYSFS_NO_64BIT_SUPPORT)  /* oh well. */
00211 typedef PHYSFS_uint32         PHYSFS_uint64;
00212 typedef PHYSFS_sint32         PHYSFS_sint64;
00213 #elif (defined _MSC_VER)
00214 typedef signed __int64        PHYSFS_sint64;
00215 typedef unsigned __int64      PHYSFS_uint64;
00216 #else
00217 typedef unsigned long long    PHYSFS_uint64;
00218 typedef signed long long      PHYSFS_sint64;
00219 #endif
00220 
00221 
00222 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
00223 /* Make sure the types really have the right sizes */
00224 #define PHYSFS_COMPILE_TIME_ASSERT(name, x)               \
00225        typedef int PHYSFS_dummy_ ## name[(x) * 2 - 1]
00226 
00227 PHYSFS_COMPILE_TIME_ASSERT(uint8, sizeof(PHYSFS_uint8) == 1);
00228 PHYSFS_COMPILE_TIME_ASSERT(sint8, sizeof(PHYSFS_sint8) == 1);
00229 PHYSFS_COMPILE_TIME_ASSERT(uint16, sizeof(PHYSFS_uint16) == 2);
00230 PHYSFS_COMPILE_TIME_ASSERT(sint16, sizeof(PHYSFS_sint16) == 2);
00231 PHYSFS_COMPILE_TIME_ASSERT(uint32, sizeof(PHYSFS_uint32) == 4);
00232 PHYSFS_COMPILE_TIME_ASSERT(sint32, sizeof(PHYSFS_sint32) == 4);
00233 
00234 #ifndef PHYSFS_NO_64BIT_SUPPORT
00235 PHYSFS_COMPILE_TIME_ASSERT(uint64, sizeof(PHYSFS_uint64) == 8);
00236 PHYSFS_COMPILE_TIME_ASSERT(sint64, sizeof(PHYSFS_sint64) == 8);
00237 #endif
00238 
00239 #undef PHYSFS_COMPILE_TIME_ASSERT
00240 
00241 #endif  /* DOXYGEN_SHOULD_IGNORE_THIS */
00242 
00243 
00267 typedef struct
00268 {
00269     void *opaque;  
00270 } PHYSFS_file;
00271 
00272 
00273 
00289 typedef struct
00290 {
00291     const char *extension;   
00292     const char *description; 
00293     const char *author;      
00294     const char *url;         
00295 } PHYSFS_ArchiveInfo;
00296 
00297 
00311 typedef struct
00312 {
00313     PHYSFS_uint8 major; 
00314     PHYSFS_uint8 minor; 
00315     PHYSFS_uint8 patch; 
00316 } PHYSFS_Version;
00317 
00318 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
00319 #define PHYSFS_VER_MAJOR 0
00320 #define PHYSFS_VER_MINOR 1
00321 #define PHYSFS_VER_PATCH 9
00322 #endif  /* DOXYGEN_SHOULD_IGNORE_THIS */
00323 
00324 
00325 /* PhysicsFS state stuff ... */
00326 
00343 #define PHYSFS_VERSION(x) \
00344 { \
00345     (x)->major = PHYSFS_VER_MAJOR; \
00346     (x)->minor = PHYSFS_VER_MINOR; \
00347     (x)->patch = PHYSFS_VER_PATCH; \
00348 }
00349 
00350 
00377 __EXPORT__ void PHYSFS_getLinkedVersion(PHYSFS_Version *ver);
00378 
00379 
00399 __EXPORT__ int PHYSFS_init(const char *argv0);
00400 
00401 
00426 __EXPORT__ int PHYSFS_deinit(void);
00427 
00428 
00457 __EXPORT__ const PHYSFS_ArchiveInfo **PHYSFS_supportedArchiveTypes(void);
00458 
00459 
00473 __EXPORT__ void PHYSFS_freeList(void *listVar);
00474 
00475 
00490 __EXPORT__ const char *PHYSFS_getLastError(void);
00491 
00492 
00506 __EXPORT__ const char *PHYSFS_getDirSeparator(void);
00507 
00508 
00537 __EXPORT__ void PHYSFS_permitSymbolicLinks(int allow);
00538 
00539 
00572 __EXPORT__ char **PHYSFS_getCdRomDirs(void);
00573 
00574 
00591 __EXPORT__ const char *PHYSFS_getBaseDir(void);
00592 
00593 
00614 __EXPORT__ const char *PHYSFS_getUserDir(void);
00615 
00616 
00628 __EXPORT__ const char *PHYSFS_getWriteDir(void);
00629 
00630 
00652 __EXPORT__ int PHYSFS_setWriteDir(const char *newDir);
00653 
00654 
00672 __EXPORT__ int PHYSFS_addToSearchPath(const char *newDir, int appendToPath);
00673 
00674 
00692 __EXPORT__ int PHYSFS_removeFromSearchPath(const char *oldDir);
00693 
00694 
00720 __EXPORT__ char **PHYSFS_getSearchPath(void);
00721 
00722 
00780 __EXPORT__ int PHYSFS_setSaneConfig(const char *organization,
00781                                     const char *appName,
00782                                     const char *archiveExt,
00783                                     int includeCdRoms,
00784                                     int archivesFirst);
00785 
00786 
00787 /* Directory management stuff ... */
00788 
00810 __EXPORT__ int PHYSFS_mkdir(const char *dirName);
00811 
00812 
00843 __EXPORT__ int PHYSFS_delete(const char *filename);
00844 
00845 
00867 __EXPORT__ const char *PHYSFS_getRealDir(const char *filename);
00868 
00869 
00906 __EXPORT__ char **PHYSFS_enumerateFiles(const char *dir);
00907 
00908 
00926 __EXPORT__ int PHYSFS_exists(const char *fname);
00927 
00928 
00946 __EXPORT__ int PHYSFS_isDirectory(const char *fname);
00947 
00948 
00966 __EXPORT__ int PHYSFS_isSymbolicLink(const char *fname);
00967 
00968 
00982 __EXPORT__ PHYSFS_sint64 PHYSFS_getLastModTime(const char *filename);
00983 
00984 
00985 /* i/o stuff... */
00986 
01009 __EXPORT__ PHYSFS_file *PHYSFS_openWrite(const char *filename);
01010 
01011 
01035 __EXPORT__ PHYSFS_file *PHYSFS_openAppend(const char *filename);
01036 
01037 
01060 __EXPORT__ PHYSFS_file *PHYSFS_openRead(const char *filename);
01061 
01062 
01081 __EXPORT__ int PHYSFS_close(PHYSFS_file *handle);
01082 
01083 
01100 __EXPORT__ PHYSFS_sint64 PHYSFS_read(PHYSFS_file *handle,
01101                                      void *buffer,
01102                                      PHYSFS_uint32 objSize,
01103                                      PHYSFS_uint32 objCount);
01104 
01118 __EXPORT__ PHYSFS_sint64 PHYSFS_write(PHYSFS_file *handle,
01119                                       const void *buffer,
01120                                       PHYSFS_uint32 objSize,
01121                                       PHYSFS_uint32 objCount);
01122 
01123 
01124 /* File position stuff... */
01125 
01138 __EXPORT__ int PHYSFS_eof(PHYSFS_file *handle);
01139 
01140 
01151 __EXPORT__ PHYSFS_sint64 PHYSFS_tell(PHYSFS_file *handle);
01152 
01153 
01168 __EXPORT__ int PHYSFS_seek(PHYSFS_file *handle, PHYSFS_uint64 pos);
01169 
01170 
01187 __EXPORT__ PHYSFS_sint64 PHYSFS_fileLength(PHYSFS_file *handle);
01188 
01189 
01190 /* Buffering stuff... */
01191 
01232 __EXPORT__ int PHYSFS_setBuffer(PHYSFS_file *handle, PHYSFS_uint64 bufsize);
01233 
01234 
01251 __EXPORT__ int PHYSFS_flush(PHYSFS_file *handle);
01252 
01253 
01254 /* Byteorder stuff... */
01255 
01266 __EXPORT__ PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 val);
01267 
01268 
01279 __EXPORT__ PHYSFS_uint16 PHYSFS_swapULE16(PHYSFS_uint16 val);
01280 
01291 __EXPORT__ PHYSFS_sint32 PHYSFS_swapSLE32(PHYSFS_sint32 val);
01292 
01293 
01304 __EXPORT__ PHYSFS_uint32 PHYSFS_swapULE32(PHYSFS_uint32 val);
01305 
01319 __EXPORT__ PHYSFS_sint64 PHYSFS_swapSLE64(PHYSFS_sint64 val);
01320 
01321 
01335 __EXPORT__ PHYSFS_uint64 PHYSFS_swapULE64(PHYSFS_uint64 val);
01336 
01337 
01348 __EXPORT__ PHYSFS_sint16 PHYSFS_swapSBE16(PHYSFS_sint16 val);
01349 
01350 
01361 __EXPORT__ PHYSFS_uint16 PHYSFS_swapUBE16(PHYSFS_uint16 val);
01362 
01373 __EXPORT__ PHYSFS_sint32 PHYSFS_swapSBE32(PHYSFS_sint32 val);
01374 
01375 
01386 __EXPORT__ PHYSFS_uint32 PHYSFS_swapUBE32(PHYSFS_uint32 val);
01387 
01388 
01402 __EXPORT__ PHYSFS_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 val);
01403 
01404 
01418 __EXPORT__ PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 val);
01419 
01420 
01434 __EXPORT__ int PHYSFS_readSLE16(PHYSFS_file *file, PHYSFS_sint16 *val);
01435 
01436 
01451 __EXPORT__ int PHYSFS_readULE16(PHYSFS_file *file, PHYSFS_uint16 *val);
01452 
01453 
01467 __EXPORT__ int PHYSFS_readSBE16(PHYSFS_file *file, PHYSFS_sint16 *val);
01468 
01469 
01484 __EXPORT__ int PHYSFS_readUBE16(PHYSFS_file *file, PHYSFS_uint16 *val);
01485 
01486 
01500 __EXPORT__ int PHYSFS_readSLE32(PHYSFS_file *file, PHYSFS_sint32 *val);
01501 
01502 
01517 __EXPORT__ int PHYSFS_readULE32(PHYSFS_file *file, PHYSFS_uint32 *val);
01518 
01519 
01533 __EXPORT__ int PHYSFS_readSBE32(PHYSFS_file *file, PHYSFS_sint32 *val);
01534 
01535 
01550 __EXPORT__ int PHYSFS_readUBE32(PHYSFS_file *file, PHYSFS_uint32 *val);
01551 
01552 
01569 __EXPORT__ int PHYSFS_readSLE64(PHYSFS_file *file, PHYSFS_sint64 *val);
01570 
01571 
01588 __EXPORT__ int PHYSFS_readULE64(PHYSFS_file *file, PHYSFS_uint64 *val);
01589 
01590 
01607 __EXPORT__ int PHYSFS_readSBE64(PHYSFS_file *file, PHYSFS_sint64 *val);
01608 
01609 
01626 __EXPORT__ int PHYSFS_readUBE64(PHYSFS_file *file, PHYSFS_uint64 *val);
01627 
01628 
01641 __EXPORT__ int PHYSFS_writeSLE16(PHYSFS_file *file, PHYSFS_sint16 val);
01642 
01643 
01656 __EXPORT__ int PHYSFS_writeULE16(PHYSFS_file *file, PHYSFS_uint16 val);
01657 
01658 
01671 __EXPORT__ int PHYSFS_writeSBE16(PHYSFS_file *file, PHYSFS_sint16 val);
01672 
01673 
01686 __EXPORT__ int PHYSFS_writeUBE16(PHYSFS_file *file, PHYSFS_uint16 val);
01687 
01688 
01701 __EXPORT__ int PHYSFS_writeSLE32(PHYSFS_file *file, PHYSFS_sint32 val);
01702 
01703 
01716 __EXPORT__ int PHYSFS_writeULE32(PHYSFS_file *file, PHYSFS_uint32 val);
01717 
01718 
01731 __EXPORT__ int PHYSFS_writeSBE32(PHYSFS_file *file, PHYSFS_sint32 val);
01732 
01733 
01746 __EXPORT__ int PHYSFS_writeUBE32(PHYSFS_file *file, PHYSFS_uint32 val);
01747 
01748 
01764 __EXPORT__ int PHYSFS_writeSLE64(PHYSFS_file *file, PHYSFS_sint64 val);
01765 
01766 
01782 __EXPORT__ int PHYSFS_writeULE64(PHYSFS_file *file, PHYSFS_uint64 val);
01783 
01784 
01800 __EXPORT__ int PHYSFS_writeSBE64(PHYSFS_file *file, PHYSFS_sint64 val);
01801 
01802 
01818 __EXPORT__ int PHYSFS_writeUBE64(PHYSFS_file *file, PHYSFS_uint64 val);
01819 
01820 
01821 #ifdef __cplusplus
01822 }
01823 #endif
01824 
01825 #endif  /* !defined _INCLUDE_PHYSFS_H_ */
01826 
01827 /* end of physfs.h ... */
01828 

Generated on Sun Dec 28 11:45:18 2003 for physfs by doxygen 1.3.4