![]() |
DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
|
|
#include <limits.h>
#include <fcntl.h>
#include <pwd.h>
#include <sys/stat.h>
#include <unistd.h>
#include "quakedef.h"
#include "thread.h"
#include "fs.h"
#include "wad.h"
#include "utf8lib.h"
Go to the source code of this file.
Data Structures | |
struct | dpackfile_t |
struct | dpackheader_t |
struct | pack_t |
struct | packfile_t |
struct | pk3_endOfCentralDir_t |
struct | qfile_t |
struct | searchpath_t |
Search paths for files (including packages) More... | |
struct | z_stream |
struct | ztoolkit_t |
Macros | |
#define | FILE_BUFF_SIZE 2048 |
#define | FILEDESC_CLOSE close |
#define | FILEDESC_INVALID -1 |
#define | FILEDESC_ISVALID(fd) |
#define | FILEDESC_READ read |
#define | FILEDESC_READ ReadAll |
#define | FILEDESC_SEEK lseek |
#define | FILEDESC_WRITE write |
#define | FILEDESC_WRITE WriteAll |
#define | MAX_WBITS 15 |
#define | O_BINARY 0 |
#define | O_NONBLOCK 0 |
#define | QFILE_FLAG_DATA (1 << 2) |
file is actually already loaded data | |
#define | QFILE_FLAG_DEFLATED (1 << 1) |
file is compressed using the deflate algorithm (PK3 only) | |
#define | QFILE_FLAG_PACKED (1 << 0) |
inside a package (PAK or PK3) | |
#define | QFILE_FLAG_REMOVE (1 << 3) |
real file will be removed on close | |
#define | S_ISDIR(a) |
#define | WPATHDEF(var) |
#define | Z_BINARY 0 |
#define | Z_BUF_ERROR (-5) |
#define | Z_DATA_ERROR (-3) |
#define | Z_DEFAULT_COMPRESSION (-1) |
#define | Z_DEFLATED 8 |
#define | Z_FINISH 4 |
#define | Z_FULL_FLUSH 3 |
#define | Z_MEM_ERROR (-4) |
#define | Z_MEMLEVEL_DEFAULT 8 |
#define | Z_NO_FLUSH 0 |
#define | Z_NULL 0 |
#define | Z_OK 0 |
#define | Z_STREAM_END 1 |
#define | Z_STREAM_ERROR (-2) |
#define | Z_SYNC_FLUSH 2 |
#define | Z_SYNC_FLUSH 2 |
#define | ZIP_CDIR_CHUNK_BASE_SIZE 46 |
#define | ZIP_CDIR_HEADER 0x504B0102 |
#define | ZIP_DATA_HEADER 0x504B0304 |
#define | ZIP_END_CDIR_SIZE 22 |
#define | ZIP_END_HEADER 0x504B0506 |
#define | ZIP_LOCAL_CHUNK_BASE_SIZE 30 |
#define | ZIP_MAX_COMMENTS_SIZE ((unsigned short)0xFFFF) |
#define | ZLIB_VERSION "1.2.3" |
Typedefs | |
typedef int | filedesc_t |
Functions | |
static filedesc_t | FILEDESC_DUP (const char *filename, filedesc_t fd) |
static fs_offset_t | ReadAll (const filedesc_t fd, void *const buf, const size_t length) |
static fs_offset_t | WriteAll (const filedesc_t fd, const void *const buf, const size_t length) |
Packages in memory | |
static void | AssertBufsize (sizebuf_t *buf, int length) |
static void | COM_InsertFlags (const char *buf) |
int | con_linewidth |
cvar_t | cvar_fs_gamedir = {CF_CLIENT | CF_SERVER | CF_READONLY | CF_PERSISTENT, "fs_gamedir", "", "the list of currently selected gamedirs (use the 'gamedir' command to change this)"} |
static int | flush |
static packfile_t * | FS_AddFileToPack (const char *name, pack_t *pack, fs_offset_t offset, fs_offset_t packsize, fs_offset_t realsize, int flags) |
static void | FS_AddGameDirectory (const char *dir) |
static void | FS_AddGameHierarchy (const char *dir) |
qbool | FS_AddPack (const char *pakfile, qbool *already_loaded, qbool keep_plain_dirs, qbool dlcache) |
static qbool | FS_AddPack_Fullpath (const char *pakfile, const char *shortname, qbool *already_loaded, qbool keep_plain_dirs, qbool dlcache) |
static void | FS_AddSelfPack (void) |
gamedir_t * | fs_all_gamedirs = NULL |
int | fs_all_gamedirs_count = 0 |
char | fs_basedir [MAX_OSPATH] |
qbool | FS_ChangeGameDirs (int numgamedirs, const char *gamedirs[], qbool failmissing) |
const char * | FS_CheckGameDir (const char *gamedir) |
const char *const | fs_checkgamedir_missing = "missing" |
int | FS_CheckNastyPath (const char *path, qbool isgamedir) |
static int | FS_ChooseUserDir (userdirmode_t userdirmode, char *userdir, size_t userdirsize) |
static void | FS_ClearSearchPath (void) |
int | FS_Close (qfile_t *file) |
int | FS_CRCFile (const char *filename, size_t *filesizepointer) |
void | FS_CreatePath (char *path) |
void | FS_DefaultExtension (char *path, const char *extension, size_t size_path) |
unsigned char * | FS_Deflate (const unsigned char *data, size_t size, size_t *deflated_size, int level, mempool_t *mempool) |
void | FS_Dir_f (cmd_state_t *cmd) |
cvar_t | fs_empty_files_in_pack_mark_deletions = {CF_CLIENT | CF_SERVER, "fs_empty_files_in_pack_mark_deletions", "0", "if enabled, empty files in a pak/pk3 count as not existing but cancel the search in further packs, effectively allowing patch pak/pk3 files to 'delete' files"} |
const char * | FS_FileExists (const char *filename) |
Look for a file in the packages and in the filesystem Returns its canonical name (same case as used in the pack) if found, else NULL. | |
const char * | FS_FileExtension (const char *in) |
qfile_t * | FS_FileFromData (const unsigned char *data, const size_t size, qbool quiet) |
fs_offset_t | FS_FileSize (qfile_t *file) |
int | FS_FileType (const char *filename) |
Look for a file in the packages and in the filesystem. | |
const char * | FS_FileWithoutPath (const char *in) |
static searchpath_t * | FS_FindFile (const char *name, int *index, const char **canonicalname, qbool quiet) |
void | FS_FreeSearch (fssearch_t *search) |
char | fs_gamedir [MAX_OSPATH] |
static void | FS_GameDir_f (cmd_state_t *cmd) |
char | fs_gamedirs [MAX_GAMEDIRS][MAX_QPATH] |
int | FS_Getc (qfile_t *file) |
qbool | FS_HasZlib (void) |
unsigned char * | FS_Inflate (const unsigned char *data, size_t size, size_t *inflated_size, mempool_t *mempool) |
void | FS_Init (void) |
void | FS_Init_Commands (void) |
static void | FS_Init_Dir (void) |
void | FS_Init_SelfPack (void) |
qbool | FS_IsRegisteredQuakePack (const char *name) |
static int | FS_ListDirectory (const char *pattern, int oneperline) |
static void | FS_ListDirectoryCmd (cmd_state_t *cmd, const char *cmdname, int oneperline) |
static void | FS_ListGameDirs (void) |
static unsigned char * | FS_LoadAndCloseQFile (qfile_t *file, const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer) |
unsigned char * | FS_LoadFile (const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer) |
static pack_t * | FS_LoadPackPAK (const char *packfile) |
static pack_t * | FS_LoadPackPK3 (const char *packfile) |
static pack_t * | FS_LoadPackPK3FromFD (const char *packfile, filedesc_t packhandle, qbool silent) |
static pack_t * | FS_LoadPackVirtual (const char *dirname) |
void | FS_Ls_f (cmd_state_t *cmd) |
mempool_t * | fs_mempool |
static void | FS_mkdir (const char *path) |
void * | fs_mutex = NULL |
int | fs_numgamedirs = 0 |
static qfile_t * | FS_OpenPackedFile (pack_t *pack, int pack_ind) |
static qfile_t * | FS_OpenReadFile (const char *filename, qbool quiet, qbool nonblocking, int symlinkLevels) |
qfile_t * | FS_OpenRealFile (const char *filepath, const char *mode, qbool quiet) |
qfile_t * | FS_OpenVirtualFile (const char *filepath, qbool quiet) |
static void | FS_Path_f (cmd_state_t *cmd) |
int | FS_Print (qfile_t *file, const char *msg) |
int | FS_Printf (qfile_t *file, const char *format,...) |
void | FS_Purge (qfile_t *file) |
fs_offset_t | FS_Read (qfile_t *file, void *buffer, size_t buffersize) |
void | FS_RemoveOnClose (qfile_t *file) |
void | FS_Rescan (void) |
static void | FS_Rescan_f (cmd_state_t *cmd) |
void | FS_SanitizePath (char *path) |
fssearch_t * | FS_Search (const char *pattern, int caseinsensitive, int quiet, const char *packfile) |
searchpath_t * | fs_searchpaths = NULL |
int | FS_Seek (qfile_t *file, fs_offset_t offset, int whence) |
static pack_t * | fs_selfpack = NULL |
addgamedirs_t | FS_SetGameDirs (int numgamedirs, const char *gamedirs[], qbool failmissing, qbool abortonfail) |
void | FS_Shutdown (void) |
void | FS_StripExtension (const char *in, char *out, size_t size_out) |
static const char * | FS_SysCheckGameDir (const char *gamedir, char *buf, size_t buflength) |
qbool | FS_SysFileExists (const char *path) |
Look for a file in the filesystem only. | |
int | FS_SysFileType (const char *path) |
Look for a file in the filesystem only. | |
unsigned char * | FS_SysLoadFile (const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer) |
qfile_t * | FS_SysOpen (const char *filepath, const char *mode, qbool nonblocking) |
int | FS_SysOpenFD (const char *filepath, const char *mode, qbool nonblocking) |
static filedesc_t | FS_SysOpenFiledesc (const char *filepath, const char *mode, qbool nonblocking) |
fs_offset_t | FS_Tell (qfile_t *file) |
int | FS_UnGetc (qfile_t *file, unsigned char c) |
cvar_t | fs_unload_dlcache = {CF_CLIENT, "fs_unload_dlcache", "1", "if enabled, unload dlcache's loaded pak/pk3 files when changing server and/or map WARNING: disabling unloading can cause servers to override assets of other servers, \"memory leaking\" by dlcache assets never unloading and many more issues"} |
void | FS_UnloadPacks_dlcache (void) |
char | fs_userdir [MAX_OSPATH] |
int | FS_VPrintf (qfile_t *file, const char *format, va_list ap) |
void | FS_Which_f (cmd_state_t *cmd) |
const char * | FS_WhichPack (const char *filename) |
fs_offset_t | FS_Write (qfile_t *file, const void *data, size_t datasize) |
qbool | FS_WriteFile (const char *filename, const void *data, fs_offset_t len) |
qbool | FS_WriteFileInBlocks (const char *filename, const void *const *data, const fs_offset_t *len, size_t count) |
static | int (ZEXPORT *qz_inflate)(z_stream *strm |
static int | level |
#define | MAX_FILES_IN_PACK 65536 |
static int int int int | memLevel |
static int int | method |
#define | PACKFILE_FLAG_DEFLATED (1 << 1) |
file compressed using the deflate algorithm | |
#define | PACKFILE_FLAG_SYMLINK (1 << 2) |
file is a symbolic link | |
#define | PACKFILE_FLAG_TRUEOFFS (1 << 0) |
the offset in packfile_t is the true contents offset | |
static int | PK3_BuildFileList (pack_t *pack, const pk3_endOfCentralDir_t *eocd) |
static void | PK3_CloseLibrary (void) |
static qbool | PK3_GetEndOfCentralDir (const char *packfile, filedesc_t packhandle, pk3_endOfCentralDir_t *eocd) |
static qbool | PK3_GetTrueFileOffset (packfile_t *pfile, pack_t *pack) |
static qbool | PK3_OpenLibrary (void) |
#define | qz_deflateInit2(strm, level, method, windowBits, memLevel, strategy) |
#define | qz_inflateInit2(strm, windowBits) |
cvar_t | scr_screenshot_name = {CF_CLIENT | CF_PERSISTENT, "scr_screenshot_name","dp", "prefix name for saved screenshots (changes based on -game commandline, as well as which game mode is running; the date is encoded using strftime escapes)"} |
static int int int int int | strategy |
static int const char int | stream_size |
static int const char * | version |
static int | windowBits |
#define | ZEXPORT |
static dllhandle_t | zlib_dll = NULL |
Handle for Zlib DLL. | |
static dllfunction_t | zlibfuncs [] |
#define FILEDESC_CLOSE close |
Definition at line 111 of file fs.c.
Referenced by FS_ChooseUserDir(), FS_ClearSearchPath(), FS_Close(), FS_LoadPackPAK(), FS_LoadPackPK3FromFD(), FS_OpenPackedFile(), FS_SysOpenFiledesc(), and FS_UnloadPacks_dlcache().
#define FILEDESC_INVALID -1 |
Definition at line 107 of file fs.c.
Referenced by FS_LoadPackVirtual(), and FS_SysOpenFiledesc().
#define FILEDESC_ISVALID | ( | fd | ) |
Definition at line 108 of file fs.c.
Referenced by FS_LoadPackPAK(), FS_LoadPackPK3(), FS_OpenPackedFile(), and FS_SysOpen().
#define FILEDESC_READ read |
Definition at line 109 of file fs.c.
Referenced by FS_LoadPackPAK(), FS_Read(), PK3_BuildFileList(), PK3_GetEndOfCentralDir(), PK3_GetTrueFileOffset(), and ReadAll().
#define FILEDESC_SEEK lseek |
Definition at line 112 of file fs.c.
Referenced by FS_LoadPackPAK(), FS_OpenPackedFile(), FS_Read(), FS_Seek(), FS_SysOpen(), FS_Write(), PK3_BuildFileList(), PK3_GetEndOfCentralDir(), and PK3_GetTrueFileOffset().
#define FILEDESC_WRITE write |
Definition at line 110 of file fs.c.
Referenced by FS_VPrintf(), FS_Write(), and WriteAll().
#define MAX_FILES_IN_PACK 65536 |
Definition at line 440 of file fs.c.
Referenced by FS_LoadPackPAK(), and FS_LoadPackPK3FromFD().
#define MAX_WBITS 15 |
Definition at line 232 of file fs.c.
Referenced by FS_Deflate(), FS_Inflate(), and FS_OpenPackedFile().
#define O_BINARY 0 |
Definition at line 56 of file fs.c.
Referenced by FS_SysOpenFiledesc().
#define O_NONBLOCK 0 |
Definition at line 61 of file fs.c.
Referenced by FS_SysOpenFiledesc(), Sys_Error(), Sys_HandleCrash(), Sys_Main(), and Sys_Print().
#define PACKFILE_FLAG_DEFLATED (1 << 1) |
file compressed using the deflate algorithm
Definition at line 372 of file fs.c.
Referenced by FS_OpenPackedFile(), and PK3_BuildFileList().
#define PACKFILE_FLAG_SYMLINK (1 << 2) |
file is a symbolic link
Definition at line 374 of file fs.c.
Referenced by FS_OpenReadFile(), and PK3_BuildFileList().
#define PACKFILE_FLAG_TRUEOFFS (1 << 0) |
the offset in packfile_t is the true contents offset
Definition at line 370 of file fs.c.
Referenced by FS_LoadPackPAK(), FS_OpenPackedFile(), and PK3_GetTrueFileOffset().
#define QFILE_FLAG_DATA (1 << 2) |
file is actually already loaded data
Definition at line 298 of file fs.c.
Referenced by FS_Close(), FS_FileFromData(), FS_Read(), and FS_Seek().
#define QFILE_FLAG_DEFLATED (1 << 1) |
file is compressed using the deflate algorithm (PK3 only)
Definition at line 296 of file fs.c.
Referenced by FS_OpenPackedFile(), FS_Read(), and FS_Seek().
#define QFILE_FLAG_PACKED (1 << 0) |
inside a package (PAK or PK3)
Definition at line 294 of file fs.c.
Referenced by FS_OpenPackedFile().
#define QFILE_FLAG_REMOVE (1 << 3) |
real file will be removed on close
Definition at line 300 of file fs.c.
Referenced by FS_Close(), and FS_RemoveOnClose().
#define qz_deflateInit2 | ( | strm, | |
level, | |||
method, | |||
windowBits, | |||
memLevel, | |||
strategy ) |
Definition at line 488 of file fs.c.
Referenced by FS_Deflate().
#define qz_inflateInit2 | ( | strm, | |
windowBits ) |
Definition at line 486 of file fs.c.
Referenced by FS_Inflate(), and FS_OpenPackedFile().
#define S_ISDIR | ( | a | ) |
Referenced by FS_SysFileType().
#define WPATHDEF | ( | var | ) |
Definition at line 84 of file fs.c.
Referenced by FS_Init_Dir(), FS_mkdir(), FS_SysFileType(), and FS_SysOpenFiledesc().
#define Z_BINARY 0 |
Definition at line 241 of file fs.c.
Referenced by FS_Deflate().
#define Z_BUF_ERROR (-5) |
Definition at line 238 of file fs.c.
Referenced by FS_Inflate().
#define Z_DATA_ERROR (-3) |
Definition at line 236 of file fs.c.
Referenced by FS_Inflate().
#define Z_DEFAULT_COMPRESSION (-1) |
Definition at line 246 of file fs.c.
Referenced by FS_Deflate().
#define Z_DEFLATED 8 |
Definition at line 242 of file fs.c.
Referenced by FS_Deflate().
#define Z_FINISH 4 |
Definition at line 250 of file fs.c.
Referenced by FS_Deflate().
#define Z_MEM_ERROR (-4) |
Definition at line 237 of file fs.c.
Referenced by FS_Inflate().
#define Z_MEMLEVEL_DEFAULT 8 |
Definition at line 243 of file fs.c.
Referenced by FS_Deflate().
#define Z_NO_FLUSH 0 |
Definition at line 247 of file fs.c.
Referenced by FS_Inflate().
#define Z_NULL 0 |
Definition at line 245 of file fs.c.
Referenced by FS_Deflate(), and FS_Inflate().
#define Z_OK 0 |
Definition at line 233 of file fs.c.
Referenced by FS_Deflate(), FS_Inflate(), FS_OpenPackedFile(), and FS_Read().
#define Z_STREAM_END 1 |
Definition at line 234 of file fs.c.
Referenced by FS_Deflate(), FS_Inflate(), and FS_Read().
#define Z_STREAM_ERROR (-2) |
Definition at line 235 of file fs.c.
Referenced by FS_Inflate().
#define ZIP_CDIR_CHUNK_BASE_SIZE 46 |
Definition at line 214 of file fs.c.
Referenced by PK3_BuildFileList().
#define ZIP_CDIR_HEADER 0x504B0102 |
Definition at line 208 of file fs.c.
Referenced by PK3_BuildFileList().
#define ZIP_DATA_HEADER 0x504B0304 |
Definition at line 207 of file fs.c.
Referenced by PK3_GetTrueFileOffset().
#define ZIP_END_CDIR_SIZE 22 |
Definition at line 213 of file fs.c.
Referenced by PK3_GetEndOfCentralDir().
#define ZIP_END_HEADER 0x504B0506 |
Definition at line 209 of file fs.c.
Referenced by PK3_GetEndOfCentralDir().
#define ZIP_LOCAL_CHUNK_BASE_SIZE 30 |
Definition at line 215 of file fs.c.
Referenced by PK3_GetTrueFileOffset().
#define ZIP_MAX_COMMENTS_SIZE ((unsigned short)0xFFFF) |
Definition at line 212 of file fs.c.
Referenced by PK3_GetEndOfCentralDir().
typedef int filedesc_t |
Definition at line 4256 of file fs.c.
References buf, length, Mem_Alloc, Mem_Free, olddata, and tempmempool.
Referenced by FS_Inflate().
|
static |
Definition at line 1911 of file fs.c.
References sys_t::argc, sys_t::argv, buf, COM_ParseToken_Console(), com_token, dp_strlcpy, fs_mempool, i, Mem_Alloc, NULL, strlen(), and sys.
Referenced by FS_Init_SelfPack().
|
static |
Definition at line 113 of file fs.c.
Referenced by FS_OpenPackedFile().
|
static |
Definition at line 954 of file fs.c.
References Con_Printf(), dp_strlcpy, pack_t::filename, pack_t::files, flags, packfile_t::flags, pack_t::ignorecase, int(), name, packfile_t::name, pack_t::numfiles, offset, packfile_t::offset, packfile_t::packsize, packfile_t::realsize, and right.
Referenced by FS_LoadPackPAK(), and PK3_BuildFileList().
|
static |
Definition at line 1340 of file fs.c.
References dir, dp_strlcpy, searchpath_t::filename, FS_AddPack_Fullpath(), FS_FileExtension(), fs_gamedir, fs_mempool, fs_searchpaths, i, listdirectory(), Mem_Alloc, searchpath_t::next, NULL, stringlist_t::numstrings, stringlistfreecontents(), stringlistinit(), stringlistsort(), stringlist_t::strings, and strlen().
Referenced by FS_AddGameHierarchy().
|
static |
Definition at line 1387 of file fs.c.
References dir, FS_AddGameDirectory(), fs_basedir, fs_userdir, and va().
Referenced by FS_Rescan().
qbool FS_AddPack | ( | const char * | pakfile, |
qbool * | already_loaded, | ||
qbool | keep_plain_dirs, | ||
qbool | dlcache ) |
Adds the given pack to the search path and searches for it in the game path. The pack type is autodetected by the file extension.
Returns true if the file was successfully added to the search path or if it was already included.
If keep_plain_dirs is set, the pack will be added AFTER the first sequence of plain directories.
Definition at line 1309 of file fs.c.
References Con_Printf(), dpsnprintf(), searchpath_t::filename, FS_AddPack_Fullpath(), FS_FindFile(), index, MAX_OSPATH, NULL, and searchpath_t::pack.
Referenced by Curl_Begin(), and Curl_EndDownload().
|
static |
Adds the given pack to the search path. The pack type is autodetected by the file extension.
Returns true if the file was successfully added to the search path or if it was already included.
If keep_plain_dirs is set, the pack will be added AFTER the first sequence of plain directories.
Definition at line 1194 of file fs.c.
References CON_ERROR, Con_Printf(), pack_t::dlcache, dp_strlcpy, dpsnprintf(), pack_t::filename, searchpath_t::filename, FS_FileExtension(), FS_LoadPackPAK(), FS_LoadPackPK3(), FS_LoadPackVirtual(), fs_mempool, fs_searchpaths, Mem_Alloc, searchpath_t::next, NULL, searchpath_t::pack, pack_t::shortname, strlen(), and pack_t::vpack.
Referenced by FS_AddGameDirectory(), and FS_AddPack().
Definition at line 1519 of file fs.c.
References fs_mempool, fs_searchpaths, fs_selfpack, Mem_Alloc, searchpath_t::next, and searchpath_t::pack.
Referenced by FS_Init_SelfPack(), and FS_Rescan().
Definition at line 1719 of file fs.c.
References Cbuf_InsertText(), CL_Disconnect(), cls, cmd_local, COM_ChangeGameTypeForGameDirs(), CONFIGFILENAME, client_static_t::demonum, client_static_t::demoplayback, FS_Rescan(), GAMEDIRS_ALLGOOD, GAMEDIRS_FAILURE, Host_SaveConfig(), and S_UnloadAllSounds_f().
Referenced by CL_ParseServerInfo(), FS_GameDir_f(), and ModList_Enable().
const char * FS_CheckGameDir | ( | const char * | gamedir | ) |
Definition at line 1824 of file fs.c.
References buf, fs_basedir, fs_checkgamedir_missing, FS_CheckNastyPath(), FS_SysCheckGameDir(), fs_userdir, NULL, ret, and va().
Referenced by FS_ListGameDirs(), FS_SetGameDirs(), and ModList_RebuildList().
Definition at line 2618 of file fs.c.
References strlen().
Referenced by CL_DownloadBegin_f(), FS_CheckGameDir(), FS_OpenReadFile(), FS_OpenRealFile(), FS_OpenVirtualFile(), SV_Download_f(), and VM_loadfromfile().
|
static |
Definition at line 1946 of file fs.c.
References dp_strlcpy, dpsnprintf(), FILEDESC_CLOSE, fs_basedir, FS_SysOpenFiledesc(), gamedirname1, gameuserdirname, MAX_OSPATH, NARROW, NULL, Sys_LoadDependency(), USERDIRMODE_HOME, USERDIRMODE_MYGAMES, USERDIRMODE_NOHOME, USERDIRMODE_SAVEDGAMES, and va().
Referenced by FS_Init_Dir().
Definition at line 1451 of file fs.c.
References FILEDESC_CLOSE, pack_t::files, fs_searchpaths, fs_selfpack, pack_t::handle, Mem_Free, searchpath_t::next, searchpath_t::pack, and pack_t::vpack.
Referenced by FS_Rescan(), and FS_Shutdown().
int FS_Close | ( | qfile_t * | file | ) |
Definition at line 2970 of file fs.c.
References FILEDESC_CLOSE, Mem_Free, QFILE_FLAG_DATA, QFILE_FLAG_REMOVE, and remove().
Referenced by CL_CutDemo(), CL_Locs_Save_f(), CL_Stop_f(), CL_StopPlayback(), Con_ConDump_f(), Crypto_KeyGen_f(), Crypto_KeyGen_Finished(), Crypto_LoadFile(), Crypto_SavePubKeyTextFile(), Curl_Begin(), Curl_EndDownload(), FS_LoadAndCloseQFile(), FS_OpenReadFile(), FS_SysCheckGameDir(), FS_WriteFileInBlocks(), GetMapList(), Host_SaveConfig(), Host_UnlockSession(), hz_bitstream_read_close(), jam_close(), JPEG_SaveImage_preflipped(), Key_History_Init(), Key_History_Shutdown(), libavw_close(), Log_Close(), Log_Printf(), M_ScanSaves(), PNG_SaveImage_preflipped(), PRVM_Prog_Load(), QW_CL_CheckOrDownloadFile(), R_GLSL_DumpShader_f(), SCR_CaptureVideo_Avi_EndVideo(), SCR_CaptureVideo_Ogg_EndVideo(), SV_Download_f(), SV_DropClient(), SV_ReadClientMessage(), SV_Savegame_to(), SV_StopDemoRecording(), VM_buf_loadfile(), VM_fclose(), VM_Files_CloseAll(), W_LoadTextureWadFile(), and W_UnloadAll().
int FS_CRCFile | ( | const char * | filename, |
size_t * | filesizepointer ) |
Definition at line 4158 of file fs.c.
References CRC_Block(), FS_LoadFile(), Mem_Free, and tempmempool.
Referenced by CL_BeginDownloads(), CL_StopDownload(), and QW_CL_RequestNextDownload().
void FS_CreatePath | ( | char * | path | ) |
Definition at line 1028 of file fs.c.
References FS_mkdir(), and ofs.
Referenced by Crypto_KeyGen_f(), Crypto_KeyGen_Finished(), FS_OpenRealFile(), and Host_LockSession().
void FS_DefaultExtension | ( | char * | path, |
const char * | extension, | ||
size_t | size_path ) |
Definition at line 3641 of file fs.c.
References dp_strlcat, src, and strlen().
Referenced by CL_PlayDemo(), CL_Record_f(), R_LoadTextureDDSFile(), SV_Loadgame_f(), SV_Savegame_f(), and SV_StartDemoRecording().
unsigned char * FS_Deflate | ( | const unsigned char * | data, |
size_t | size, | ||
size_t * | deflated_size, | ||
int | level, | ||
mempool_t * | mempool ) |
Definition at line 4178 of file fs.c.
References z_stream::avail_in, z_stream::avail_out, Con_Printf(), data, int(), level, MAX_WBITS, Mem_Alloc, Mem_Free, z_stream::next_in, z_stream::next_out, NULL, z_stream::opaque, qz_deflateInit2, size, tempmempool, z_stream::total_out, Z_BINARY, Z_DEFAULT_COMPRESSION, Z_DEFLATED, Z_FINISH, Z_MEMLEVEL_DEFAULT, Z_NULL, Z_OK, Z_STREAM_END, z_stream::zalloc, z_stream::zfree, and zlib_dll.
Referenced by SV_Prepare_CSQC().
void FS_Dir_f | ( | cmd_state_t * | cmd | ) |
Definition at line 4053 of file fs.c.
References cmd(), and FS_ListDirectoryCmd().
Referenced by FS_Init_Commands().
const char * FS_FileExists | ( | const char * | filename | ) |
Look for a file in the packages and in the filesystem Returns its canonical name (same case as used in the pack) if found, else NULL.
If the file is found outside a pak, this will be the same pointer as passed in.
Definition at line 3693 of file fs.c.
References FS_FindFile(), and NULL.
Referenced by CDAudio_Play_byName(), CL_BeginDownloads(), CL_SetupWorldModel(), CL_StopDownload(), Curl_Begin(), Curl_Curl_f(), Font_LoadFont(), FS_Rescan(), Host_AddConfigText(), loadimagepixelsbgra(), M_Menu_Main_f(), MR_SetRouting(), SV_Download_f(), and SV_SpawnServer().
const char * FS_FileExtension | ( | const char * | in | ) |
Definition at line 1403 of file fs.c.
References NULL.
Referenced by CL_PlayVideo_f(), CL_StopDownload(), FS_AddGameDirectory(), FS_AddPack_Fullpath(), Image_StripImageExtension(), Mod_LoadModel(), SCR_ScreenShot_f(), and SV_Download_f().
qfile_t * FS_FileFromData | ( | const unsigned char * | data, |
const size_t | size, | ||
qbool | quiet ) |
Definition at line 2951 of file fs.c.
References data, fs_mempool, Mem_Alloc, QFILE_FLAG_DATA, and size.
Referenced by SV_Download_f().
fs_offset_t FS_FileSize | ( | qfile_t * | file | ) |
Definition at line 3474 of file fs.c.
Referenced by LibAvW_FS_SeekSize(), SV_Download_f(), and SV_ReadClientMessage().
int FS_FileType | ( | const char * | filename | ) |
Look for a file in the packages and in the filesystem.
Definition at line 3667 of file fs.c.
References dpsnprintf(), searchpath_t::filename, FS_FILETYPE_FILE, FS_FILETYPE_NONE, FS_FindFile(), FS_SysFileType(), MAX_OSPATH, NULL, searchpath_t::pack, and pack_t::vpack.
Referenced by Con_CompleteCommandLine().
const char * FS_FileWithoutPath | ( | const char * | in | ) |
Definition at line 1431 of file fs.c.
Referenced by COM_InitGameType(), and FS_IsRegisteredQuakePack().
|
static |
Definition at line 2690 of file fs.c.
References Con_DPrintf(), developer_extra, dpsnprintf(), pack_t::filename, searchpath_t::filename, pack_t::files, fs_empty_files_in_pack_mark_deletions, fs_searchpaths, FS_SysFileExists(), pack_t::ignorecase, index, int(), cvar_t::integer, MAX_OSPATH, name, packfile_t::name, searchpath_t::next, NULL, pack_t::numfiles, searchpath_t::pack, packfile_t::realsize, right, and pack_t::vpack.
Referenced by FS_AddPack(), FS_FileExists(), FS_FileType(), FS_OpenReadFile(), FS_Which_f(), and FS_WhichPack().
void FS_FreeSearch | ( | fssearch_t * | search | ) |
Definition at line 3963 of file fs.c.
References Z_Free.
Referenced by Cmd_Exec_f(), Con_CompleteCommandLine(), FS_ListDirectory(), GetMapList(), Image_FixTransparentPixels_f(), Mod_LoadQ3Shaders(), VM_search_end(), and VM_Search_Reset().
|
static |
Definition at line 1751 of file fs.c.
References server_t::active, ca_connected, cls, cmd(), Cmd_Argc(), Cmd_Argv(), CON_ERROR, Con_Printf(), client_static_t::demoplayback, FS_ChangeGameDirs(), fs_gamedirs, fs_numgamedirs, gamedirname1, gamedirname2, i, MAX_GAMEDIRS, client_static_t::state, and sv.
Referenced by FS_Init_Commands().
int FS_Getc | ( | qfile_t * | file | ) |
Definition at line 3323 of file fs.c.
References FS_Read().
Referenced by CL_PlayDemo(), Key_History_Init(), VM_buf_loadfile(), and VM_fgets().
Definition at line 620 of file fs.c.
References PK3_OpenLibrary(), and zlib_dll.
Referenced by CL_BeginDownloads().
unsigned char * FS_Inflate | ( | const unsigned char * | data, |
size_t | size, | ||
size_t * | inflated_size, | ||
mempool_t * | mempool ) |
Definition at line 4273 of file fs.c.
References AssertBufsize(), z_stream::avail_in, z_stream::avail_out, Con_Print(), Con_Printf(), sizebuf_t::cursize, data, sizebuf_t::data, int(), max, MAX_WBITS, sizebuf_t::maxsize, Mem_Alloc, Mem_Free, z_stream::next_in, z_stream::next_out, NULL, z_stream::opaque, qz_inflateInit2, ret, size, SZ_Write(), tempmempool, z_stream::total_in, Z_BUF_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_NO_FLUSH, Z_NULL, Z_OK, Z_STREAM_END, Z_STREAM_ERROR, z_stream::zalloc, z_stream::zfree, and zlib_dll.
Referenced by CL_StopDownload().
Definition at line 2342 of file fs.c.
References COM_InitGameType(), FS_Init_Commands(), FS_Init_Dir(), FS_Init_SelfPack(), fs_mempool, Mem_AllocPool, NULL, and PK3_OpenLibrary().
Referenced by Host_Init().
Definition at line 2117 of file fs.c.
References CF_SHARED, Cmd_AddCommand(), com_startupgamegroup, cvar_fs_gamedir, Cvar_RegisterVariable(), FS_Dir_f(), fs_empty_files_in_pack_mark_deletions, FS_GameDir_f(), FS_Ls_f(), FS_Path_f(), FS_Rescan_f(), fs_unload_dlcache, FS_Which_f(), GAME_NORMAL, scr_screenshot_name, and Sys_EM_Register_Commands().
Referenced by FS_Init().
Definition at line 2139 of file fs.c.
References sys_t::argc, sys_t::argv, COM_ChangeGameTypeForGameDirs(), Con_DPrintf(), dp_strlcat, dp_strlcpy, dpsnprintf(), fs_basedir, FS_ChooseUserDir(), fs_gamedir, fs_mutex, FS_Rescan(), fs_userdir, gamedirname1, gameuserdirname, i, int(), MAX_GAMEDIRS, NARROW, strlen(), sys, Sys_CheckParm(), Thread_CreateMutex, Thread_HasThreads(), USERDIRMODE_COUNT, USERDIRMODE_HOME, USERDIRMODE_MYGAMES, USERDIRMODE_NOHOME, USERDIRMODE_SAVEDGAMES, va(), and WPATHDEF.
Referenced by FS_Init().
Definition at line 2299 of file fs.c.
References sys_t::argv, buf, COM_InsertFlags(), FS_AddSelfPack(), FS_LoadFile(), FS_LoadPackPK3FromFD(), fs_selfpack, FS_SysLoadFile(), Mem_Free, NULL, sys_t::selffd, sys, Sys_CheckParm(), and tempmempool.
Referenced by FS_Init().
qbool FS_IsRegisteredQuakePack | ( | const char * | name | ) |
Definition at line 4112 of file fs.c.
References searchpath_t::filename, pack_t::files, FS_FileWithoutPath(), fs_searchpaths, pack_t::ignorecase, int(), name, packfile_t::name, searchpath_t::next, pack_t::numfiles, searchpath_t::pack, right, and pack_t::vpack.
Referenced by SV_Download_f().
Definition at line 3969 of file fs.c.
References con_linewidth, Con_Printf(), fssearch_t::filenames, FS_FreeSearch(), FS_Search(), i, int(), MAX_INPUTLINE, name, NULL, fssearch_t::numfilenames, and strlen().
Referenced by FS_ListDirectoryCmd().
|
static |
Definition at line 4037 of file fs.c.
References cmd(), Cmd_Argc(), Cmd_Argv(), Con_Print(), Con_Printf(), and FS_ListDirectory().
Referenced by FS_Dir_f(), and FS_Ls_f().
Definition at line 1854 of file fs.c.
References dp_strlcpy, fs_all_gamedirs, fs_all_gamedirs_count, fs_basedir, FS_CheckGameDir(), fs_checkgamedir_missing, fs_mempool, fs_userdir, i, listdirectory(), Mem_Alloc, Mem_Free, gamedir_t::name, name, stringlist_t::numstrings, stringlistappend(), stringlistfreecontents(), stringlistinit(), stringlistsort(), stringlist_t::strings, and va().
Referenced by FS_Rescan().
|
static |
Definition at line 3503 of file fs.c.
References buf, Con_Printf(), developer_loadfile, FS_Close(), FS_Read(), cvar_t::integer, Mem_Alloc, and NULL.
Referenced by FS_LoadFile(), and FS_SysLoadFile().
unsigned char * FS_LoadFile | ( | const char * | path, |
mempool_t * | pool, | ||
qbool | quiet, | ||
fs_offset_t * | filesizepointer ) |
Definition at line 3540 of file fs.c.
References FS_LoadAndCloseQFile(), and FS_OpenVirtualFile().
Referenced by CL_CutDemo(), CL_IPLog_Load(), CL_Locs_Reload_f(), CL_Particles_LoadEffectInfo(), CL_ReadPointFile_f(), CL_VM_Init(), Cmd_Exec(), Curl_FindPackURL(), decode_image(), fontfilecache_LoadFile(), FS_CRCFile(), FS_Init_SelfPack(), GetMapList(), gl_main_newmap(), Image_GetStockPicSize(), LoadFont(), loadimagepixelsbgra(), LoadSubtitles(), M_Setup_Draw(), Mod_LoadModel(), Mod_LoadQ3Shaders(), Mod_LoadSkinFiles(), Mod_PSKMODEL_Load(), Mod_Q1BSP_LoadLighting(), Mod_Q1BSP_LoadMapBrushes(), Mod_Q2BSP_LoadTexinfo(), OGG_LoadVorbisFile(), Palette_Load(), Palette_LoadQ2Colormap(), Palette_SetupSpecialPalettes(), PRVM_LoadLNO(), PRVM_PO_Load(), PRVM_Prog_Load(), R_InitParticleTexture(), R_LoadQWSkin(), R_LoadTextureDDSFile(), R_Shadow_LoadLightsFile(), R_Shadow_LoadWorldLights(), R_Shadow_LoadWorldLightsFromMap_LightArghliteTyrlite(), S_LoadWavFile(), ShaderModeInfo_GetShaderText(), SV_Loadgame_f(), SV_ParticleEffectIndex(), SV_Prepare_CSQC(), SV_SpawnServer(), VM_loadfromfile(), W_GetLumpName(), and XMP_LoadModFile().
|
static |
Takes an explicit (not game tree related) path to a pak file. Loads the header and directory, adding the files at the beginning of the list so they override previous pack files.
Definition at line 1081 of file fs.c.
References Con_DPrintf(), Con_Printf(), dpackheader_t::dirlen, dpackheader_t::dirofs, dp_strlcpy, FILEDESC_CLOSE, FILEDESC_ISVALID, FILEDESC_READ, FILEDESC_SEEK, pack_t::filename, pack_t::files, FS_AddFileToPack(), fs_mempool, FS_SysOpenFiledesc(), pack_t::handle, i, dpackheader_t::id, pack_t::ignorecase, int(), LittleLong, MAX_FILES_IN_PACK, Mem_Alloc, Mem_Free, dpackfile_t::name, name, NULL, pack_t::numfiles, offset, PACKFILE_FLAG_TRUEOFFS, size, and tempmempool.
Referenced by FS_AddPack_Fullpath().
|
static |
Definition at line 891 of file fs.c.
References FILEDESC_ISVALID, FS_LoadPackPK3FromFD(), FS_SysOpenFiledesc(), and NULL.
Referenced by FS_AddPack_Fullpath().
|
static |
Definition at line 836 of file fs.c.
References pk3_endOfCentralDir_t::cdir_disknum, Con_DPrintf(), Con_Printf(), pk3_endOfCentralDir_t::disknum, dp_strlcpy, FILEDESC_CLOSE, pack_t::filename, pack_t::files, fs_mempool, pack_t::handle, pack_t::ignorecase, MAX_FILES_IN_PACK, Mem_Alloc, Mem_Free, pk3_endOfCentralDir_t::nbentries, NULL, pack_t::numfiles, PK3_BuildFileList(), and PK3_GetEndOfCentralDir().
Referenced by FS_Init_SelfPack(), and FS_LoadPackPK3().
|
static |
Definition at line 1165 of file fs.c.
References Con_DPrintf(), dp_strlcpy, FILEDESC_INVALID, pack_t::filename, pack_t::files, fs_mempool, pack_t::handle, pack_t::ignorecase, Mem_Alloc, NULL, pack_t::numfiles, and pack_t::vpack.
Referenced by FS_AddPack_Fullpath().
void FS_Ls_f | ( | cmd_state_t * | cmd | ) |
Definition at line 4058 of file fs.c.
References cmd(), and FS_ListDirectoryCmd().
Referenced by FS_Init_Commands().
|
static |
Definition at line 999 of file fs.c.
References Sys_CheckParm(), WIDE, and WPATHDEF.
Referenced by FS_CreatePath().
Definition at line 2518 of file fs.c.
References z_stream::avail_in, z_stream::avail_out, ztoolkit_t::comp_length, Con_Printf(), CON_WARN, FILEDESC_CLOSE, FILEDESC_DUP(), FILEDESC_ISVALID, FILEDESC_SEEK, pack_t::filename, pack_t::files, packfile_t::flags, fs_mempool, pack_t::handle, ztoolkit_t::input, MAX_WBITS, Mem_Alloc, Mem_Free, packfile_t::name, z_stream::next_in, z_stream::next_out, NULL, packfile_t::offset, PACKFILE_FLAG_DEFLATED, PACKFILE_FLAG_TRUEOFFS, packfile_t::packsize, PK3_GetTrueFileOffset(), QFILE_FLAG_DEFLATED, QFILE_FLAG_PACKED, qz_inflateInit2, packfile_t::realsize, Z_OK, zlib_dll, and ztoolkit_t::zstream.
Referenced by FS_OpenReadFile().
|
static |
Definition at line 2786 of file fs.c.
References Con_DPrintf(), Con_Printf(), count, developer_loading, dpsnprintf(), searchpath_t::filename, pack_t::files, packfile_t::flags, FS_CheckNastyPath(), FS_Close(), FS_FindFile(), FS_OpenPackedFile(), FS_OpenReadFile(), FS_Read(), FS_SysOpen(), cvar_t::integer, MAX_OSPATH, MAX_QPATH, NULL, searchpath_t::pack, and PACKFILE_FLAG_SYMLINK.
Referenced by FS_OpenReadFile(), and FS_OpenVirtualFile().
qfile_t * FS_OpenRealFile | ( | const char * | filepath, |
const char * | mode, | ||
qbool | quiet ) |
Definition at line 2901 of file fs.c.
References Con_Printf(), dpsnprintf(), FS_CheckNastyPath(), FS_CreatePath(), fs_gamedir, FS_SysOpen(), MAX_OSPATH, mode, and NULL.
Referenced by CheckPendingDownloads(), CL_CutDemo(), CL_Locs_Save_f(), CL_ParseServerInfo(), CL_Record_f(), Con_ConDump_f(), Curl_Begin(), Curl_EndDownload(), FS_WriteFileInBlocks(), Host_SaveConfig(), JPEG_SaveImage_preflipped(), Key_History_Init(), Key_History_Shutdown(), Log_Open(), Log_Printf(), M_ScanSaves(), PNG_SaveImage_preflipped(), PRVM_Prog_Load(), R_GLSL_DumpShader_f(), SCR_CaptureVideo_Avi_BeginVideo(), SCR_CaptureVideo_Ogg_BeginVideo(), SV_Savegame_to(), SV_StartDemoRecording(), and VM_fopen().
qfile_t * FS_OpenVirtualFile | ( | const char * | filepath, |
qbool | quiet ) |
Definition at line 2928 of file fs.c.
References Con_Printf(), FS_CheckNastyPath(), fs_mutex, FS_OpenReadFile(), NULL, Thread_LockMutex, and Thread_UnlockMutex.
Referenced by CL_PlayDemo(), FS_LoadFile(), GetMapList(), hz_bitstream_read_open(), jam_open(), LibAvW_OpenVideo(), QW_CL_CheckOrDownloadFile(), SV_Download_f(), VM_buf_loadfile(), VM_fopen(), and W_LoadTextureWadFile().
|
static |
Definition at line 1052 of file fs.c.
References Con_Print(), Con_Printf(), pack_t::filename, searchpath_t::filename, fs_searchpaths, searchpath_t::next, pack_t::numfiles, searchpath_t::pack, and pack_t::vpack.
Referenced by FS_Init_Commands().
int FS_Print | ( | qfile_t * | file, |
const char * | msg ) |
Definition at line 3261 of file fs.c.
References FS_Write(), and strlen().
Referenced by Log_Close(), Log_ConPrint(), Log_Open(), PRVM_ED_Write(), PRVM_ED_WriteGlobals(), R_GLSL_DumpShader_f(), and SV_Savegame_to().
int FS_Printf | ( | qfile_t * | file, |
const char * | format, | ||
... ) |
Definition at line 3273 of file fs.c.
References format, and FS_VPrintf().
Referenced by CL_CutDemo(), CL_Locs_Save_f(), CL_ParseServerInfo(), CL_Record_f(), Crypto_SavePubKeyTextFile(), Cvar_WriteVariables(), Key_History_Shutdown(), Key_WriteBindings(), PRVM_ED_Write(), PRVM_ED_WriteGlobals(), PRVM_Prog_Load(), SV_Savegame_to(), and SV_StartDemoRecording().
void FS_Purge | ( | qfile_t * | file | ) |
Definition at line 3487 of file fs.c.
Referenced by FS_Read(), FS_Seek(), and FS_Write().
fs_offset_t FS_Read | ( | qfile_t * | file, |
void * | buffer, | ||
size_t | buffersize ) |
Definition at line 3066 of file fs.c.
References z_stream::avail_in, z_stream::avail_out, buffer, ztoolkit_t::comp_length, Con_Printf(), count, error(), FILEDESC_READ, FILEDESC_SEEK, FS_Purge(), ztoolkit_t::in_ind, ztoolkit_t::in_len, ztoolkit_t::in_position, ztoolkit_t::input, int(), z_stream::next_in, z_stream::next_out, QFILE_FLAG_DATA, QFILE_FLAG_DEFLATED, Z_OK, Z_STREAM_END, Z_SYNC_FLUSH, and ztoolkit_t::zstream.
Referenced by CL_ReadDemoMessage(), Crypto_LoadFile(), Curl_Begin(), FS_Getc(), FS_LoadAndCloseQFile(), FS_OpenReadFile(), FS_Seek(), FS_SysCheckGameDir(), GetMapList(), hz_bitstream_read_blocks_read(), jam_open(), jam_video(), LibAvW_FS_Read(), M_ScanSaves(), SV_ReadClientMessage(), SV_SendClientDatagram(), W_GetTextureBGRA(), and W_LoadTextureWadFile().
void FS_RemoveOnClose | ( | qfile_t * | file | ) |
Definition at line 3007 of file fs.c.
References QFILE_FLAG_REMOVE.
Referenced by CL_Stop_f(), and SV_StopDemoRecording().
Definition at line 1538 of file fs.c.
References sys_t::argc, sys_t::argv, ca_dedicated, cls, com_modname, Con_Print(), cvar_fs_gamedir, Cvar_SetQuick(), Cvar_SetValueQuick(), dp_strlcat, dp_strlcpy, FS_AddGameHierarchy(), FS_AddSelfPack(), FS_ClearSearchPath(), FS_FileExists(), fs_gamedir, fs_gamedirs, FS_ListGameDirs(), fs_numgamedirs, GAME_HIPNOTIC, GAME_NORMAL, GAME_ROGUE, GAME_STEELSTORM, gamedirname1, gamedirname2, gamemode, gamescreenshotname, i, cvar_t::integer, MAX_INPUTLINE, registered, scr_screenshot_name, client_static_t::state, sys, Sys_CheckParm(), va(), and W_UnloadAll().
Referenced by CL_StopDownload(), FS_ChangeGameDirs(), FS_Init_Dir(), and FS_Rescan_f().
|
static |
void FS_SanitizePath | ( | char * | path | ) |
Definition at line 2673 of file fs.c.
Referenced by loadimagepixelsbgra().
fssearch_t * FS_Search | ( | const char * | pattern, |
int | caseinsensitive, | ||
int | quiet, | ||
const char * | packfile ) |
Definition at line 3756 of file fs.c.
References Con_Printf(), developer_loading, dp_strlcat, dp_strlcpy, dp_ustr2stp(), pack_t::filename, searchpath_t::filename, fssearch_t::filenames, fssearch_t::filenamesbuffer, pack_t::files, fs_searchpaths, i, int(), cvar_t::integer, listdirectory(), matchpattern(), max, MAX_OSPATH, Mem_Alloc, Mem_Free, packfile_t::name, searchpath_t::next, NULL, fssearch_t::numfilenames, pack_t::numfiles, stringlist_t::numstrings, searchpath_t::pack, pack_t::shortname, stringlistappend(), stringlistfreecontents(), stringlistinit(), stringlistsort(), stringlist_t::strings, strlen(), tempmempool, pack_t::vpack, and Z_Malloc.
Referenced by Cmd_Exec_f(), Con_CompleteCommandLine(), FS_ListDirectory(), GetMapList(), Image_FixTransparentPixels_f(), Mod_LoadQ3Shaders(), and VM_search_begin().
int FS_Seek | ( | qfile_t * | file, |
fs_offset_t | offset, | ||
int | whence ) |
Definition at line 3359 of file fs.c.
References z_stream::avail_in, buffer, Con_Printf(), count, FILEDESC_SEEK, FS_Purge(), FS_Read(), ztoolkit_t::in_ind, ztoolkit_t::in_len, ztoolkit_t::in_position, ztoolkit_t::input, Mem_Alloc, Mem_Free, z_stream::next_in, offset, position, QFILE_FLAG_DATA, QFILE_FLAG_DEFLATED, tempmempool, and ztoolkit_t::zstream.
Referenced by CheckPendingDownloads(), CL_ReadDemoMessage(), GetMapList(), LibAvW_FS_Seek(), SCR_CaptureVideo_Avi_BeginVideo(), SCR_CaptureVideo_Avi_EndVideo(), SCR_CaptureVideo_RIFF_Finish(), SCR_CaptureVideo_RIFF_MakeIxChunk(), SCR_CaptureVideo_RIFF_Pop(), SV_ReadClientMessage(), W_GetTextureBGRA(), and W_LoadTextureWadFile().
addgamedirs_t FS_SetGameDirs | ( | int | numgamedirs, |
const char * | gamedirs[], | ||
qbool | failmissing, | ||
qbool | abortonfail ) |
Definition at line 1633 of file fs.c.
References CON_ERROR, Con_Printf(), CON_WARN, dp_strlcpy, FS_CheckGameDir(), fs_checkgamedir_missing, fs_gamedirs, fs_numgamedirs, gamedirname1, gamedirname2, GAMEDIRS_ALLGOOD, GAMEDIRS_FAILURE, GAMEDIRS_SUCCESS, i, MAX_GAMEDIRS, and Sys_Error().
Referenced by COM_ChangeGameTypeForGameDirs().
Definition at line 2364 of file fs.c.
References FS_ClearSearchPath(), fs_mempool, fs_mutex, Mem_FreePool, PK3_CloseLibrary(), Sys_FreeLibrary(), and Thread_DestroyMutex.
void FS_StripExtension | ( | const char * | in, |
char * | out, | ||
size_t | size_out ) |
Definition at line 3611 of file fs.c.
References NULL.
Referenced by CL_ParseServerInfo(), CL_SetupWorldModel(), COM_InitGameType(), dpvsimpledecode_open(), Image_StripImageExtension(), jam_open(), LibAvW_OpenVideo(), Mod_Decompile_f(), Mod_PSKMODEL_Load(), Mod_Q1BSP_LoadLighting(), Mod_Q1BSP_LoadMapBrushes(), Mod_Q1BSP_LoadTextures(), Mod_Q3BSP_LoadLightmaps(), PRVM_LoadLNO(), R_LoadTextureDDSFile(), and SV_SpawnServer().
|
static |
Definition at line 1786 of file fs.c.
References buf, f, FS_Close(), FS_Read(), FS_SysOpen(), listdirectory(), n, NULL, stringlist_t::numstrings, stringlistfreecontents(), stringlistinit(), and va().
Referenced by FS_CheckGameDir().
qbool FS_SysFileExists | ( | const char * | path | ) |
Look for a file in the filesystem only.
Definition at line 3744 of file fs.c.
References FS_FILETYPE_NONE, and FS_SysFileType().
Referenced by FS_FindFile(), SCR_ScreenShot_f(), and Sys_FindInPATH().
int FS_SysFileType | ( | const char * | path | ) |
Look for a file in the filesystem only.
Definition at line 3708 of file fs.c.
References buf, FS_FILETYPE_DIRECTORY, FS_FILETYPE_FILE, FS_FILETYPE_NONE, S_ISDIR, WIDE, and WPATHDEF.
Referenced by FS_FileType(), and FS_SysFileExists().
unsigned char * FS_SysLoadFile | ( | const char * | path, |
mempool_t * | pool, | ||
qbool | quiet, | ||
fs_offset_t * | filesizepointer ) |
Definition at line 3555 of file fs.c.
References FS_LoadAndCloseQFile(), and FS_SysOpen().
Referenced by FS_Init_SelfPack(), and listdirectory().
qfile_t * FS_SysOpen | ( | const char * | filepath, |
const char * | mode, | ||
qbool | nonblocking ) |
Definition at line 2484 of file fs.c.
References FILEDESC_ISVALID, FILEDESC_SEEK, fs_mempool, FS_SysOpenFiledesc(), Mem_Alloc, Mem_Free, Mem_strdup, mode, and NULL.
Referenced by Crypto_KeyGen_f(), Crypto_KeyGen_Finished(), Crypto_LoadFile(), Crypto_SavePubKeyTextFile(), FS_OpenReadFile(), FS_OpenRealFile(), FS_SysCheckGameDir(), FS_SysLoadFile(), and Host_LockSession().
Definition at line 2468 of file fs.c.
References FS_SysOpenFiledesc(), and mode.
Referenced by Sys_ProvideSelfFD().
|
static |
Definition at line 2383 of file fs.c.
References CON_ERROR, Con_Printf(), FILEDESC_CLOSE, FILEDESC_INVALID, mod(), mode, O_BINARY, O_NONBLOCK, Sys_CheckParm(), WIDE, and WPATHDEF.
Referenced by FS_ChooseUserDir(), FS_LoadPackPAK(), FS_LoadPackPK3(), FS_SysOpen(), and FS_SysOpenFD().
fs_offset_t FS_Tell | ( | qfile_t * | file | ) |
Definition at line 3461 of file fs.c.
Referenced by CheckPendingDownloads(), SCR_CaptureVideo_RIFF_IndexEntry(), and SV_SendClientDatagram().
int FS_UnGetc | ( | qfile_t * | file, |
unsigned char | c ) |
Definition at line 3341 of file fs.c.
Referenced by VM_buf_loadfile(), and VM_fgets().
Definition at line 1485 of file fs.c.
References Con_DPrintf(), pack_t::dlcache, FILEDESC_CLOSE, pack_t::files, fs_searchpaths, fs_unload_dlcache, pack_t::handle, cvar_t::integer, Mem_Free, searchpath_t::next, searchpath_t::pack, and pack_t::shortname.
Referenced by CL_DisconnectEx(), and CL_ParseServerInfo().
int FS_VPrintf | ( | qfile_t * | file, |
const char * | format, | ||
va_list | ap ) |
Definition at line 3293 of file fs.c.
References dpvsnprintf(), FILEDESC_WRITE, format, MAX_INPUTLINE, Mem_Alloc, Mem_Free, and tempmempool.
Referenced by FS_Printf(), and Log_Printf().
void FS_Which_f | ( | cmd_state_t * | cmd | ) |
Definition at line 4063 of file fs.c.
References cmd(), Cmd_Argc(), Cmd_Argv(), Con_Printf(), searchpath_t::filename, FS_FindFile(), index, NULL, searchpath_t::pack, pack_t::shortname, and pack_t::vpack.
Referenced by FS_Init_Commands().
const char * FS_WhichPack | ( | const char * | filename | ) |
Definition at line 4091 of file fs.c.
References FS_FindFile(), index, NULL, searchpath_t::pack, and pack_t::shortname.
Referenced by Curl_SendRequirement(), SV_Download_f(), and VM_whichpack().
fs_offset_t FS_Write | ( | qfile_t * | file, |
const void * | data, | ||
size_t | datasize ) |
Definition at line 3019 of file fs.c.
References Con_Printf(), CON_WARN, data, FILEDESC_SEEK, FILEDESC_WRITE, FS_Purge(), int(), and min.
Referenced by CL_PasteDemo(), CL_WriteDemoMessage(), Con_ConDump_f(), Crypto_KeyGen_f(), Crypto_KeyGen_Finished(), CURL_fwrite(), FS_Print(), FS_WriteFileInBlocks(), JPEG_EmptyOutputBuffer(), JPEG_TermDestination(), Log_Start(), PNG_fWriteData(), SCR_CaptureVideo_Ogg_BeginVideo(), SCR_CaptureVideo_Ogg_EndVideo(), SCR_CaptureVideo_Ogg_FlushInterleaving(), SCR_CaptureVideo_Ogg_Interleave(), SCR_CaptureVideo_RIFF_Flush(), SCR_CaptureVideo_RIFF_FlushNoIncrease(), SCR_CaptureVideo_RIFF_Pop(), SCR_CaptureVideo_RIFF_WriteBytes(), SV_WriteDemoMessage(), VM_buf_writefile(), and VM_fputs().
qbool FS_WriteFile | ( | const char * | filename, |
const void * | data, | ||
fs_offset_t | len ) |
Definition at line 3592 of file fs.c.
References data, and FS_WriteFileInBlocks().
Referenced by CL_StopDownload(), Image_WriteTGABGRA(), Mod_Decompile_f(), Mod_Decompile_OBJ(), Mod_Decompile_SMD(), QW_CL_ParseDownload(), R_SaveTextureDDSFile(), R_Shadow_SaveWorldLights(), and SV_SaveEntFile_f().
qbool FS_WriteFileInBlocks | ( | const char * | filename, |
const void *const * | data, | ||
const fs_offset_t * | len, | ||
size_t | count ) |
Definition at line 3569 of file fs.c.
References Con_DPrintf(), Con_Printf(), count, data, FS_Close(), FS_OpenRealFile(), FS_Write(), and i.
Referenced by FS_WriteFile(), and Image_WriteTGABGR_preflipped().
|
static |
Referenced by animatemodel(), Buffer_Callback(), BufStr_Flush(), BuildGammaTable16(), BuildGammaTable8(), CDAudio_Play_byName(), CDAudio_StartPlaylist(), CL_Beam_AddPolygons(), CL_Beams_SetupBuiltinTexture(), CL_DrawVideo_DisplaySubtitleLine(), CL_Frame(), CL_GenericHitSuperContentsMask(), CL_GetTagMatrix(), CL_Locs_AddNode(), CL_Locs_Reload_f(), CL_Locs_Save_f(), CL_movestep(), CL_NewParticle(), CL_NewParticlesFromEffectinfo(), CL_Packet_f(), CL_ParseDownload(), CL_ParseServerMessage(), CL_ParticleCube(), CL_ParticleRain(), CL_Particles_ParseEffectInfo(), CL_PQRcon_f(), CL_Rcon_f(), CL_RelinkEffects(), CL_RelinkLightFlashes(), CL_RelinkWorld(), CL_Screen_Init(), CL_SpawnDecalParticleForSurface(), CL_StopDownload(), CL_TraceBox(), CL_TraceLine(), CL_TracePoint(), CL_Video_Frame(), Cmd_TokenizeString(), Collision_Cache_Lookup(), COM_InitGameType(), COM_ReadAndTokenizeLine(), Con_CheckResize(), Con_CompleteCommandLine(), Con_DisplayLineFunc(), Con_DisplayList(), Con_DrawConsole(), Con_DrawInput(), Con_DrawNotifyRect(), CSQC_AddRenderEdict(), Cvar_Get(), Cvar_RegisterVariable(), Cvar_SetQuick_Internal(), detect_match_rule(), DrawQ_SetClipArea(), DrawQ_String_Scale(), DrawQ_TextWidth_UntilWidth_TrackColors_Scale(), EntityFrame5_ExpandEdicts(), EntityFrameQuake_ReadEntity(), EntityFrameQuake_WriteFrame(), EntityState5_ReadUpdate(), FindFraction(), Font_Postprocess(), Font_SetSize(), Font_UnloadFont(), Font_VirtualToRealSize(), FS_AddFileToPack(), FS_Deflate(), FS_FindFile(), FS_Inflate(), FS_Init_Dir(), FS_IsRegisteredQuakePack(), FS_ListDirectory(), FS_LoadPackPAK(), FS_Read(), FS_Search(), FS_Write(), getdrawfont(), GetMapList(), gl_backend_devicelost(), GL_Mesh_ListVBOs(), GL_Setup(), GL_TextureMode_f(), Image_HeightmapToNormalmap_BGRA(), Image_Resample32Lerp(), Image_Resample32LerpLine(), InfoString_SetValue(), JPEG_SaveImage_to_Buffer(), Key_AddChar(), Key_History_Down(), Key_History_First(), Key_History_Get_foundCommand(), Key_History_Last(), Key_History_Up(), Key_Parse_CommonKeys(), Key_PrintBindList(), Key_StringToKeynum(), Key_Unbindall_f(), Key_WriteBindings(), LHNETADDRESS_FromString(), loadimagepixelsbgra(), M_Draw(), M_GameOptions_Key(), M_LanConfig_Key(), M_Main_Draw(), M_Menu_GameOptions_f(), M_ModList_Draw(), M_MultiPlayer_Draw(), M_Options_ColorControl_Draw(), M_Options_Draw(), M_Options_Effects_Draw(), M_Options_Graphics_Draw(), M_Setup_Key(), M_SinglePlayer_Draw(), M_UnbindCommand(), main(), MakeDownloadPacket(), Mod_BSP_FinalizePortals(), Mod_BSP_LightPoint_RecursiveBSPNode(), Mod_ClearUsed(), Mod_DARKPLACESMODEL_Load(), Mod_FindName(), Mod_GenerateLightmaps_CreateLightmaps(), Mod_IDP0_Load(), Mod_IDP2_Load(), Mod_IDP3_Load(), Mod_IDS2_Load(), Mod_INTERQUAKEMODEL_Load(), Mod_LoadModel(), Mod_LoadQ3Shaders(), Mod_Mesh_IndexForVertex(), mod_newmap(), Mod_OBJ_Load(), Mod_Print_f(), Mod_PSKMODEL_Load(), Mod_PurgeUnused(), Mod_Q1BSP_LoadEdges(), Mod_Q1BSP_LoadFaces(), Mod_Q1BSP_LoadTextures(), Mod_Q1BSP_ParseWadsFromEntityLump(), Mod_Q2BSP_LoadTexinfo(), Mod_Q3BSP_LightPoint(), Mod_Q3BSP_LoadLightGrid(), Mod_Q3BSP_LoadLightmaps(), Mod_Reload(), Mod_ShadowMesh_AddVertex(), mod_shutdown(), Mod_Skeletal_AnimateVertices_Generic(), Mod_Sprite_SharedSetup(), mod_start(), Mod_VBSP_LoadFaces(), Mod_ZYMOTICMODEL_Load(), MR_Init(), NetConn_BuildStatusResponse(), NetConn_ClientParsePacket(), NetConn_ReceivedMessage(), NetConn_SendUnreliableMessage(), NetConn_ServerParsePacket(), Nicks_CutMatchesAlphaNumeric(), Nicks_CutMatchesNormal(), Nicks_CutMatchesNoSpaces(), noise4f(), OGG_DecodeTags(), particletextureblotch(), PHYS_UnstickEntityReturnOffset(), PK3_BuildFileList(), PNG_fReadData(), PNG_LoadImage_BGRA(), PRVM_ConsoleCommand(), PRVM_ED_ParseEpair(), PRVM_LeakTest(), PRVM_PrintStatement(), PRVM_Prog_Load(), PRVM_UglyValueString(), R_Bloom_StartFrame(), R_BufferData_Store(), R_BuildFogTexture(), R_BuildLightMap(), R_CompleteLightPoint(), R_DrawParticles(), R_DrawTextureSurfaceList_ShowSurfaces(), R_GetCurrentTexture(), R_GLSL_Restart_f(), R_HDR_UpdateIrisAdaptation(), R_InitParticleTexture(), R_LoadTextureDDSFile(), R_Mesh_Draw(), R_Mesh_UpdateMeshBuffer(), R_RenderTarget_FreeUnused(), R_RenderTarget_Get(), R_RTLight_Compile(), R_ScissorForBBox(), R_Shadow_BounceGrid_AssignPhotons_Task(), R_Shadow_BounceGrid_CheckEnable(), R_Shadow_BounceGrid_ConvertPixelsAndUpload(), R_Shadow_BounceGrid_Slice(), R_Shadow_BounceGrid_UpdateSpacing(), R_Shadow_DrawCoronas(), R_Shadow_EditLights_DrawSelectedLightProperties(), R_Shadow_GetRTLightInfo(), R_Shadow_LoadWorldLightsFromMap_LightArghliteTyrlite(), R_Shadow_MakeTextures_MakeCorona(), R_StainNode(), R_tcMod_ApplyToMatrix(), r_textures_devicelost(), r_textures_devicerestored(), R_TimeReport(), R_TimeReport_EndFrame(), R_Water_StartFrame(), RSurf_FogPoint(), RSurf_FogVertex(), S_ConvertPaintBuffer(), S_MixToBuffer(), S_PaintAndSubmit(), S_PlaySfxOnChannel(), S_SoundList_f(), S_StartSound_StartPosition_Flags(), S_UnloadAllSounds_f(), Sbar_DeathmatchOverlay(), Sbar_Draw(), Sbar_DrawInventory(), Sbar_IntermissionOverlay(), Sbar_MiniDeathmatchOverlay(), Sbar_PrintScoreboardItem(), Sbar_Score(), Sbar_SoloScoreboard(), SCR_CaptureVideo_Avi_SoundFrame(), SCR_CaptureVideo_Ogg_BeginVideo(), SCR_CaptureVideo_RIFF_Pop(), SCR_Centerprint_f(), SCR_DrawCenterString(), SCR_DrawCurlDownload(), SCR_DrawInfobarString(), SCR_DrawQWDownload(), SCR_DrawScreen(), should_use_incmap(), snap_to_pixel_x(), snap_to_pixel_y(), SND_PickChannel(), SV_CleanupEnts(), SV_CreateBaseline(), SV_DisableCheats_c(), SV_Ent_Remove_f(), SV_FixCheckBottom(), SV_FlyMove(), SV_GenericHitSuperContentsMask(), SV_GetModelFromEdict(), SV_GetTagIndex(), SV_GetTagMatrix(), SV_Give_f(), SV_God_f(), SV_Kick_f(), SV_LinkEdict(), SV_Loadgame_f(), SV_movestep(), SV_Notarget_f(), SV_Physics_Step(), SV_Physics_Toss(), SV_Pings_f(), SV_PlayerPhysics(), SV_PointSuperContents(), SV_Prepare_CSQC(), SV_PrepareEntityForSending(), SV_PushEntity(), SV_PushMove(), SV_ReadClientMessage(), SV_Savegame_to(), SV_SaveSpawnparms(), SV_SendClientDatagram(), SV_SpawnServer(), SV_StartPointSound(), SV_StartSound(), SV_Status_f(), SV_Tell_f(), SV_TraceBox(), SV_TraceLine(), SV_TracePoint(), SV_UpdateToReliableMessages(), SV_Viewframe_f(), SV_Viewmodel_f(), SV_Viewnext_f(), SV_Viewprev_f(), SV_WalkMove(), SV_WaterJump(), SV_WriteClientdataToMessage(), SVBSP_InsertOccluderPolygonNodes(), Sys_Con_NearestColor(), u8_strpad(), u8_strpad_colorcodes(), V_CalcRefdefUsing(), VID_ApplyJoyState(), VM_altstr_get(), VM_altstr_ins(), VM_altstr_set(), VM_argv(), VM_argv_end_index(), VM_argv_start_index(), VM_buf_copy(), VM_buf_create(), VM_buf_sort(), VM_buf_writefile(), VM_bufstr_add(), VM_bufstr_find(), VM_bufstr_free(), VM_bufstr_get(), VM_bufstr_set(), VM_cin_getstate(), VM_CL_boxparticles(), VM_CL_droptofloor(), VM_CL_frameduration(), VM_CL_frameforname(), VM_CL_getinputstate(), VM_CL_getplayerkey(), VM_CL_getstatf(), VM_CL_getstati(), VM_CL_getstats(), VM_CL_gettaginfo(), VM_CL_lightstyle(), VM_CL_makestatic(), VM_CL_particle(), VM_CL_ParticleTheme(), VM_CL_ParticleThemeFree(), VM_CL_ParticleThemeFromGlobals(), VM_CL_ParticleThemeSave(), VM_CL_pointparticles(), VM_CL_R_AddDynamicLight(), VM_CL_R_AddEntities(), VM_CL_R_PolygonBegin(), VM_CL_R_SetView(), VM_CL_runplayerphysics(), VM_CL_setattachment(), VM_CL_setmodelindex(), VM_CL_skel_build(), VM_CL_skel_copybones(), VM_CL_skel_create(), VM_CL_skel_delete(), VM_CL_skel_find_bone(), VM_CL_skel_get_boneabs(), VM_CL_skel_get_bonename(), VM_CL_skel_get_boneparent(), VM_CL_skel_get_bonerel(), VM_CL_skel_get_numbones(), VM_CL_skel_mul_bone(), VM_CL_skel_mul_bones(), VM_CL_skel_set_bone(), VM_CL_sound(), VM_CL_SpawnParticle(), VM_CL_SpawnParticleDelayed(), VM_CL_te_explosion2(), VM_CL_tracebox(), VM_CL_traceline(), VM_CL_trailparticles(), VM_CL_V_CalcRefdef(), VM_drawcharacter(), VM_drawcolorcodedstring(), VM_drawfill(), VM_drawline(), VM_drawpic(), VM_drawrotpic(), VM_drawstring(), VM_drawsubpic(), VM_entityfieldname(), VM_entityfieldtype(), VM_fclose(), VM_fgets(), VM_fopen(), VM_fputs(), VM_FrameBlendFromFrameGroupBlend(), VM_GenerateFrameGroupBlend(), VM_getentityfieldstring(), VM_getsoundtime(), VM_getsurfacepoint(), VM_getsurfacepointattribute(), VM_getsurfacetriangle(), VM_gettime(), VM_M_getgamedirinfo(), VM_M_getresolution(), VM_M_getserverlistnumber(), VM_M_getserverliststat(), VM_M_getserverliststring(), VM_M_setserverlistmasknumber(), VM_M_setserverlistmaskstring(), VM_M_setserverlistsort(), VM_M_WriteDest(), VM_matchpattern(), VM_netaddress_resolve(), VM_putentityfieldstring(), VM_registercvar(), VM_search_begin(), VM_search_end(), VM_search_getfilename(), VM_search_getsize(), VM_sprint(), VM_sprintf(), VM_str2chr(), VM_strconv(), VM_stringwidth(), VM_strireplace(), VM_strlennocol(), VM_strpad(), VM_strreplace(), VM_strstrofs(), VM_substring(), VM_SV_AddStat(), VM_SV_droptofloor(), VM_SV_frameduration(), VM_SV_frameforname(), VM_SV_gettaginfo(), VM_SV_lightstyle(), VM_SV_modelnameforindex(), VM_SV_particle(), VM_SV_pointparticles(), VM_SV_pointsound(), VM_SV_setcolor(), VM_SV_setmodelindex(), VM_SV_setpause(), VM_SV_skel_build(), VM_SV_skel_copybones(), VM_SV_skel_create(), VM_SV_skel_delete(), VM_SV_skel_find_bone(), VM_SV_skel_get_boneabs(), VM_SV_skel_get_bonename(), VM_SV_skel_get_boneparent(), VM_SV_skel_get_bonerel(), VM_SV_skel_get_numbones(), VM_SV_skel_mul_bone(), VM_SV_skel_mul_bones(), VM_SV_skel_set_bone(), VM_SV_sound(), VM_SV_tracebox(), VM_SV_traceline(), VM_SV_UpdateCustomStats(), VM_tokenizebyseparator(), VM_UpdateEdictSkeleton(), VM_vectoyaw(), W_GetTextureBGRA(), World_EntitiesInBox(), World_LinkEdict_AreaGrid(), WriteDest(), and XMP_GetSamplesFloat().
|
static |
Definition at line 712 of file fs.c.
References BuffBigLong(), BuffLittleLong(), BuffLittleShort(), pk3_endOfCentralDir_t::cdir_offset, pk3_endOfCentralDir_t::cdir_size, count, FILEDESC_READ, FILEDESC_SEEK, pack_t::files, flags, FS_AddFileToPack(), pack_t::handle, int(), Mem_Alloc, Mem_Free, min, packfile_t::name, pk3_endOfCentralDir_t::nbentries, NULL, pack_t::numfiles, offset, PACKFILE_FLAG_DEFLATED, PACKFILE_FLAG_SYMLINK, pk3_endOfCentralDir_t::prepended_garbage, tempmempool, ZIP_CDIR_CHUNK_BASE_SIZE, and ZIP_CDIR_HEADER.
Referenced by FS_LoadPackPK3FromFD().
Definition at line 566 of file fs.c.
References Sys_FreeLibrary(), and zlib_dll.
Referenced by FS_Shutdown().
|
static |
Definition at line 637 of file fs.c.
References BuffBigLong(), buffer, pk3_endOfCentralDir_t::cdir_disknum, pk3_endOfCentralDir_t::cdir_offset, pk3_endOfCentralDir_t::cdir_size, pk3_endOfCentralDir_t::comment_size, pk3_endOfCentralDir_t::disknum, FILEDESC_READ, FILEDESC_SEEK, LittleLong, LittleShort, pk3_endOfCentralDir_t::localentries, Mem_Alloc, Mem_Free, pk3_endOfCentralDir_t::nbentries, pk3_endOfCentralDir_t::prepended_garbage, pk3_endOfCentralDir_t::signature, tempmempool, ZIP_END_CDIR_SIZE, ZIP_END_HEADER, and ZIP_MAX_COMMENTS_SIZE.
Referenced by FS_LoadPackPK3FromFD().
|
static |
Definition at line 908 of file fs.c.
References BuffBigLong(), buffer, BuffLittleShort(), Con_Printf(), count, FILEDESC_READ, FILEDESC_SEEK, pack_t::filename, packfile_t::flags, pack_t::handle, packfile_t::name, packfile_t::offset, PACKFILE_FLAG_TRUEOFFS, ZIP_DATA_HEADER, and ZIP_LOCAL_CHUNK_BASE_SIZE.
Referenced by FS_OpenPackedFile().
Definition at line 581 of file fs.c.
References NULL, Sys_LoadDependency(), zlib_dll, and zlibfuncs.
Referenced by FS_HasZlib(), and FS_Init().
|
static |
Definition at line 135 of file fs.c.
References buf, FILEDESC_READ, and length.
|
static |
Definition at line 159 of file fs.c.
References buf, FILEDESC_WRITE, and length.
|
extern |
Definition at line 94 of file console.c.
Referenced by FS_ListDirectory().
cvar_t cvar_fs_gamedir = {CF_CLIENT | CF_SERVER | CF_READONLY | CF_PERSISTENT, "fs_gamedir", "", "the list of currently selected gamedirs (use the 'gamedir' command to change this)"} |
Definition at line 458 of file fs.c.
Referenced by FS_Init_Commands(), and FS_Rescan().
Definition at line 452 of file fs.c.
Referenced by FS_ListGameDirs(), and VM_M_getgamedirinfo().
int fs_all_gamedirs_count = 0 |
Definition at line 453 of file fs.c.
Referenced by FS_ListGameDirs(), and VM_M_getgamedirinfo().
char fs_basedir[MAX_OSPATH] |
Definition at line 444 of file fs.c.
Referenced by Crypto_KeyGen_f(), Crypto_KeyGen_Finished(), Crypto_LoadFile(), Crypto_SavePubKeyTextFile(), FS_AddGameHierarchy(), FS_CheckGameDir(), FS_ChooseUserDir(), FS_Init_Dir(), FS_ListGameDirs(), Host_LockSession(), and ModList_RebuildList().
const char* const fs_checkgamedir_missing = "missing" |
Definition at line 438 of file fs.c.
Referenced by FS_CheckGameDir(), FS_ListGameDirs(), FS_SetGameDirs(), and ModList_RebuildList().
cvar_t fs_empty_files_in_pack_mark_deletions = {CF_CLIENT | CF_SERVER, "fs_empty_files_in_pack_mark_deletions", "0", "if enabled, empty files in a pak/pk3 count as not existing but cancel the search in further packs, effectively allowing patch pak/pk3 files to 'delete' files"} |
char fs_gamedir[MAX_OSPATH] |
Definition at line 443 of file fs.c.
Referenced by FS_AddGameDirectory(), FS_Init_Dir(), FS_OpenRealFile(), FS_Rescan(), and SCR_ScreenShot_f().
char fs_gamedirs[MAX_GAMEDIRS][MAX_QPATH] |
Definition at line 449 of file fs.c.
Referenced by COM_ChangeGameTypeForGameDirs(), FS_GameDir_f(), FS_Rescan(), FS_SetGameDirs(), and ModList_RebuildList().
mempool_t* fs_mempool |
Definition at line 434 of file fs.c.
Referenced by COM_InsertFlags(), FS_AddGameDirectory(), FS_AddPack_Fullpath(), FS_AddSelfPack(), FS_FileFromData(), FS_Init(), FS_ListGameDirs(), FS_LoadPackPAK(), FS_LoadPackPK3FromFD(), FS_LoadPackVirtual(), FS_OpenPackedFile(), FS_Shutdown(), and FS_SysOpen().
Definition at line 435 of file fs.c.
Referenced by FS_Init_Dir(), FS_OpenVirtualFile(), and FS_Shutdown().
int fs_numgamedirs = 0 |
Definition at line 448 of file fs.c.
Referenced by COM_ChangeGameTypeForGameDirs(), FS_GameDir_f(), FS_Rescan(), FS_SetGameDirs(), and ModList_RebuildList().
searchpath_t* fs_searchpaths = NULL |
Definition at line 437 of file fs.c.
Referenced by FS_AddGameDirectory(), FS_AddPack_Fullpath(), FS_AddSelfPack(), FS_ClearSearchPath(), FS_FindFile(), FS_IsRegisteredQuakePack(), FS_Path_f(), FS_Search(), and FS_UnloadPacks_dlcache().
Definition at line 445 of file fs.c.
Referenced by FS_AddSelfPack(), FS_ClearSearchPath(), and FS_Init_SelfPack().
cvar_t fs_unload_dlcache = {CF_CLIENT, "fs_unload_dlcache", "1", "if enabled, unload dlcache's loaded pak/pk3 files when changing server and/or map WARNING: disabling unloading can cause servers to override assets of other servers, \"memory leaking\" by dlcache assets never unloading and many more issues"} |
Definition at line 457 of file fs.c.
Referenced by FS_Init_Commands(), and FS_UnloadPacks_dlcache().
char fs_userdir[MAX_OSPATH] |
Definition at line 442 of file fs.c.
Referenced by Crypto_KeyGen_f(), Crypto_KeyGen_Finished(), Crypto_LoadFile(), Crypto_SavePubKeyTextFile(), FS_AddGameHierarchy(), FS_CheckGameDir(), FS_Init_Dir(), FS_ListGameDirs(), and Host_LockSession().
GLint level |
Definition at line 481 of file fs.c.
Referenced by FS_Deflate(), and libavw_message().
cvar_t scr_screenshot_name = {CF_CLIENT | CF_PERSISTENT, "scr_screenshot_name","dp", "prefix name for saved screenshots (changes based on -game commandline, as well as which game mode is running; the date is encoded using strftime escapes)"} |
Definition at line 455 of file fs.c.
Referenced by FS_Init_Commands(), FS_Rescan(), and SCR_ScreenShot_f().
Definition at line 479 of file fs.c.
Referenced by Mod_IDP0_Load(), Mod_IDP2_Load(), Mod_IDP3_Load(), Mod_IDS2_Load(), Mod_IDSP_Load(), Mod_PSKMODEL_Load(), Mod_Sprite_SharedSetup(), Protocol_NameForEnum(), Protocol_NumberForEnum(), SV_Loadgame_f(), SV_PrepareEntityForSending(), and VID_Init().
|
static |
Handle for Zlib DLL.
Definition at line 507 of file fs.c.
Referenced by FS_Deflate(), FS_HasZlib(), FS_Inflate(), FS_OpenPackedFile(), PK3_CloseLibrary(), and PK3_OpenLibrary().
|
static |
Definition at line 494 of file fs.c.
Referenced by PK3_OpenLibrary().