32 #include "../shared/ufotypes.h"
33 #include "../shared/cxx.h"
34 #define BASEDIRNAME "base"
44 #define MAX_OSPATH 256
123 #define SFF_ARCH 0x01
124 #define SFF_HIDDEN 0x02
125 #define SFF_RDONLY 0x04
126 #define SFF_SUBDIR 0x08
127 #define SFF_SYSTEM 0x10
152 bool FS_RenameFile(const
char* from, const
char* to,
bool relative);
154 void FS_CopyFile(const
char* fromOSPath, const
char* toOSPath);
192 memset(&_file, 0,
sizeof(_file));
202 inline operator bool ()
const
204 return file() || zip();
void FS_CopyFile(const char *fromOSPath, const char *toOSPath)
Copy a fully specified file from one place to another.
bool FS_FileExists(const char *filename,...) __attribute__((format(__printf__
void FS_ExecAutoexec(void)
void FS_CreatePath(const char *path)
Creates any directories needed to store the given filename.
int FS_Read2(void *buffer, int len, qFILE *f, bool failOnEmptyRead)
Read a file into a given buffer in memory.
const char * FS_NextFileFromFileList(const char *files)
Returns the next file that is found in the virtual filesystem identified by the given file pattern...
int FS_WriteFile(const void *buffer, size_t len, const char *filename)
void FS_CreateOpenPipeFile(const char *filename, qFILE *f)
const char * FS_NextPath(const char *prevpath)
Allows enumerating all of the directories in the search path.
struct searchpath_s * next
Links one file onto another - like a symlink.
const char * FS_Gamedir(void)
Called to find where to write a file (savegames, etc)
char * FS_NextScriptHeader(const char *files, const char **name, const char **text)
int void FS_InitFilesystem(bool writeToHomeDir)
const char * FS_GetCwd(void)
Return current working dir.
int FS_OpenFile(const char *filename, qFILE *file, filemode_t mode)
Finds and opens the file in the search path.
void FS_NormPath(char *path)
Convert operating systems path separators to ufo virtual filesystem separators (/) ...
static char findname[MAX_OSPATH]
struct filelink_s filelink_t
Links one file onto another - like a symlink.
char ** FS_ListFiles(const char *findname, int *numfiles, unsigned musthave, unsigned canthave)
Builds a qsorted filelist.
int FS_GetModList(struct linkedList_t **mods)
Searches and builds a list of mod directories.
void FS_CloseFile(qFILE *f)
Closes a file handle.
void FS_RestartFilesystem(const char *gamedir)
Restart the filesystem (reload all pk3 files)
void FS_Shutdown(void)
cleanup function
int FS_Read(void *buffer, int len, qFILE *f)
bool FS_RenameFile(const char *from, const char *to, bool relative)
Renames a file.
bool void FS_GetMaps(bool reset)
File the fs_maps array with valid maps.
void FS_RemoveFile(const char *osPath)
int FS_FileLength(qFILE *f)
Returns the size of a given file or -1 if no file is opened.
int FS_Printf(qFILE *f, const char *msg,...) __attribute__((format(__printf__
struct searchpath_s searchpath_t
void FS_FreeFile(void *buffer)
void FS_AddHomeAsGameDirectory(const char *dir, bool write)
QGL_EXTERN GLuint GLchar GLuint * len
int FS_CheckFile(const char *fmt,...) __attribute__((format(__printf__
int FS_LoadFile(const char *path, byte **buffer)
Filenames are relative to the quake search path.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
const char * FS_GetFileData(const char *files)
Returns the buffer of a file.
void FS_AddGameDirectory(const char *dir, bool write)
Adds the directory to the head of the search path.
int FS_Write(const void *buffer, int len, qFILE *f)
Properly handles partial writes.
int int FS_BuildFileList(const char *files)
Build a filelist.
int FS_Seek(qFILE *f, long offset, int origin)
Sets the file position of the given file.
void format(__printf__, 1, 2)))