icculus quake2 doxygen
1.0 dev
|
|
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");
261 *file = fopen (netpath,
"rb");
296 *file = fopen (netpath,
"rb");
321 *file = fopen (pak->
filename,
"rb");
345 #define MAX_READ 0x10000 // read in blocks of 64k
348 int block, remaining;
363 read = fread (buf, 1, block, f);
459 packhandle = fopen(packfile,
"rb");
463 fread (&header, 1,
sizeof(header), packhandle);
476 fseek (packhandle, header.
dirofs, SEEK_SET);
477 fread (info, 1, header.
dirlen, packhandle);
487 for (
i=0 ;
i<numpackfiles ;
i++)
500 Com_Printf (
"Added packfile %s (%i files)\n", packfile, numpackfiles);
535 Com_sprintf (pakfile,
sizeof(pakfile),
"%s/pak%i.pak", dir,
i);
545 Com_sprintf (pakfile,
sizeof(pakfile),
"%s/maxpak.pak", dir);
565 char *homedir=getenv(
"HOME");
568 int len = snprintf(gdir,
sizeof(gdir),
"%s/.quake2/%s/", homedir, dir);
572 if ((len > 0) && (len <
sizeof(gdir)) && (gdir[len-1] ==
'/'))
642 if (strstr(dir,
"..") || strstr(dir,
"/")
643 || strstr(dir,
"\\") || strstr(dir,
":") )
645 Com_Printf (
"Gamedir should be a single filename, not a path\n");
738 char **
FS_ListFiles(
char *findname,
int *numfiles,
unsigned musthave,
unsigned canthave )
747 if ( s[strlen(s)-1] !=
'.' )
759 list = malloc(
sizeof(
char * ) * nfiles );
760 memset( list, 0,
sizeof(
char * ) * nfiles );
766 if ( s[strlen(s)-1] !=
'.' )
768 list[nfiles] = strdup( s );
770 strlwr( list[nfiles] );
788 char wildcard[1024] =
"*.*";
799 char *tmp = findname;
801 Com_sprintf( findname,
sizeof(findname),
"%s/%s", path, wildcard );
812 if ( ( dirnames =
FS_ListFiles( findname, &ndirs, 0, 0 ) ) != 0 )
816 for (
i = 0;
i < ndirs-1;
i++ )
818 if ( strrchr( dirnames[
i],
'/' ) )
819 Com_Printf(
"%s\n", strrchr( dirnames[
i],
'/' ) + 1 );
875 if (prevpath ==
NULL)
877 if (prevpath == prev)
void FS_Read(void *buffer, int len, FILE *f)
char filename[MAX_OSPATH]
pack_t * FS_LoadPackFile(char *packfile)
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)
void FS_AddHomeAsGameDirectory(char *dir)
char fs_gamedir[MAX_OSPATH]
void Com_sprintf(char *dest, int size, char *fmt,...)