Go to the documentation of this file.
28 #define PAK0_CHECKSUM 0x40e614e0
110 fseek (f, 0, SEEK_END);
112 fseek (f, pos, SEEK_SET);
129 for (ofs = path+1 ; *ofs ; ofs++)
174 if (strstr (search->
filename,
"xatrix"))
177 if (strstr (search->
filename,
"rogue"))
222 *file = fopen (netpath,
"rb");
248 *file = fopen (pak->
filename,
"rb");
263 while ( *np++ ) *np = *np ==
'\\' ?
'/' : *np;
265 *file = fopen (netpath,
"rb");
300 *file = fopen (netpath,
"rb");
325 *file = fopen (pak->
filename,
"rb");
349 #define MAX_READ 0x10000 // read in blocks of 64k
352 int block, remaining;
367 read = (
int)fread (buf, 1, block, f);
463 packhandle = fopen(packfile,
"rb");
467 fread (&header, 1,
sizeof(header), packhandle);
480 fseek (packhandle, header.
dirofs, SEEK_SET);
481 fread (info, 1, header.
dirlen, packhandle);
491 for (
i=0 ;
i<numpackfiles ;
i++)
504 Com_Printf (
"Added packfile %s (%i files)\n", packfile, numpackfiles);
539 Com_sprintf (pakfile,
sizeof(pakfile),
"%s/pak%i.pak", dir,
i);
599 if (strstr(dir,
"..") || strstr(dir,
"/")
600 || strstr(dir,
"\\") || strstr(dir,
":") )
602 Com_Printf (
"Gamedir should be a single filename, not a path\n");
694 char **
FS_ListFiles(
char *findname,
int *numfiles,
unsigned musthave,
unsigned canthave )
703 if (
s[strlen(
s)-1] !=
'.' )
715 list = malloc(
sizeof(
char * ) * nfiles );
716 memset( list, 0,
sizeof(
char * ) * nfiles );
722 if (
s[strlen(
s)-1] !=
'.' )
724 list[nfiles] = strdup(
s );
726 strlwr( list[nfiles] );
744 char wildcard[1024] =
"*.*";
755 char *tmp = findname;
757 Com_sprintf( findname,
sizeof(findname),
"%s/%s", path, wildcard );
768 if ( ( dirnames =
FS_ListFiles( findname, &ndirs, 0, 0 ) ) != 0 )
772 for (
i = 0;
i < ndirs-1;
i++ )
774 if ( strrchr( dirnames[
i],
'/' ) )
775 Com_Printf(
"%s\n", strrchr( dirnames[
i],
'/' ) + 1 );
804 Com_Printf (
"%s (%i files)\n",
s->pack->filename,
s->pack->numfiles);
834 if (prevpath == prev)
void FS_Read(void *buffer, int len, FILE *f)
char filename[MAX_OSPATH]
pack_t * FS_LoadPackFile(char *packfile)
CONST PIXELFORMATDESCRIPTOR int
void Sys_Mkdir(char *path)
void FS_SetGamedir(char *dir)
char * FS_NextPath(char *prevpath)
char * CopyString(char *in)
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
void FS_CreatePath(char *path)
int FS_FOpenFile(char *filename, FILE **file)
char * va(char *format,...)
struct searchpath_s * next
char * Sys_FindFirst(char *path, unsigned musthave, unsigned canthave)
cvar_t * Cvar_FullSet(char *var_name, char *value, int flags)
struct searchpath_s searchpath_t
void FS_AddGameDirectory(char *dir)
void FS_ExecAutoexec(void)
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
int FS_LoadFile(char *path, void **buffer)
void Cbuf_AddText(char *text)
searchpath_t * fs_base_searchpaths
char ** FS_ListFiles(char *findname, int *numfiles, unsigned musthave, unsigned canthave)
void FS_InitFilesystem(void)
int FS_filelength(FILE *f)
void Com_Error(int code, char *fmt,...)
struct filelink_s filelink_t
void * Z_Malloc(int size)
int Developer_searchpath(int who)
void FS_FCloseFile(FILE *f)
char * Sys_FindNext(unsigned musthave, unsigned canthave)
char filename[MAX_OSPATH]
unsigned Com_BlockChecksum(void *buffer, int length)
#define MAX_FILES_IN_PACK
searchpath_t * fs_searchpaths
void Com_DPrintf(char *fmt,...)
void FS_FreeFile(void *buffer)
void Com_Printf(char *fmt,...)
int Q_strcasecmp(char *s1, char *s2)
char * Cvar_VariableString(char *var_name)
char fs_gamedir[MAX_OSPATH]
void Com_sprintf(char *dest, int size, char *fmt,...)