X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=fs.h;h=9ed0b5114cf2c22c236758cf586f9221634f8ce0;hp=a55df4b7f637d7cbcc53f11e9daeae52a6de48dc;hb=15c442ea999fd0159430991b3a13aa92311f142f;hpb=ea3f4513f96a21ae1bcbaae4a4997968ace1ab95 diff --git a/fs.h b/fs.h index a55df4b7..9ed0b511 100644 --- a/fs.h +++ b/fs.h @@ -44,6 +44,10 @@ typedef long long fs_offset_t; extern char fs_gamedir [MAX_OSPATH]; extern char fs_basedir [MAX_OSPATH]; +// list of active game directories (empty if not running a mod) +#define MAX_GAMEDIRS 16 +extern int fs_numgamedirs; +extern char fs_gamedirs[MAX_GAMEDIRS][MAX_QPATH]; // ------ Main functions ------ // @@ -51,18 +55,29 @@ extern char fs_basedir [MAX_OSPATH]; // IMPORTANT: the file path is automatically prefixed by the current game directory for // each file created by FS_WriteFile, or opened in "write" or "append" mode by FS_Open +qboolean FS_AddPack(const char *pakfile, qboolean *already_loaded, qboolean keep_plain_dirs); // already_loaded may be NULL if caller does not care +const char *FS_WhichPack(const char *filename); qfile_t *FS_Open (const char* filepath, const char* mode, qboolean quiet, qboolean nonblocking); int FS_Close (qfile_t* file); fs_offset_t FS_Write (qfile_t* file, const void* data, size_t datasize); fs_offset_t FS_Read (qfile_t* file, void* buffer, size_t buffersize); int FS_Print(qfile_t* file, const char *msg); -int FS_Printf(qfile_t* file, const char* format, ...); +int FS_Printf(qfile_t* file, const char* format, ...) DP_FUNC_PRINTF(2); int FS_VPrintf(qfile_t* file, const char* format, va_list ap); int FS_Getc (qfile_t* file); int FS_UnGetc (qfile_t* file, unsigned char c); int FS_Seek (qfile_t* file, fs_offset_t offset, int whence); fs_offset_t FS_Tell (qfile_t* file); +fs_offset_t FS_FileSize (qfile_t* file); void FS_Purge (qfile_t* file); +const char *FS_FileWithoutPath (const char *in); +const char *FS_FileExtension (const char *in); +int FS_CheckNastyPath (const char *path, qboolean isgamedir); +qboolean FS_CheckGameDir(const char *gamedir); +qboolean FS_ChangeGameDirs(int numgamedirs, char gamedirs[][MAX_QPATH], qboolean complain, qboolean failmissing); +qboolean FS_IsRegisteredQuakePack(const char *name); +int FS_CRCFile(const char *filename, size_t *filesizepointer); +void FS_Rescan(void); typedef struct fssearch_s {