icculus quake2 doxygen  1.0 dev
files.c File Reference
#include "qcommon.h"

Go to the source code of this file.

Classes

struct  packfile_t
 
struct  pack_s
 
struct  filelink_s
 
struct  searchpath_s
 

Macros

#define PAK0_CHECKSUM   0x40e614e0
 
#define MAX_READ   0x10000
 

Typedefs

typedef struct pack_s pack_t
 
typedef struct filelink_s filelink_t
 
typedef struct searchpath_s searchpath_t
 

Functions

int FS_filelength (FILE *f)
 
void FS_CreatePath (char *path)
 
void FS_FCloseFile (FILE *f)
 
int Developer_searchpath (int who)
 
int FS_FOpenFile (char *filename, FILE **file)
 
void CDAudio_Stop (void)
 
void FS_Read (void *buffer, int len, FILE *f)
 
int FS_LoadFile (char *path, void **buffer)
 
void FS_FreeFile (void *buffer)
 
pack_tFS_LoadPackFile (char *packfile)
 
void FS_AddGameDirectory (char *dir)
 
void FS_AddHomeAsGameDirectory (char *dir)
 
char * FS_Gamedir (void)
 
void FS_ExecAutoexec (void)
 
void FS_SetGamedir (char *dir)
 
void FS_Link_f (void)
 
char ** FS_ListFiles (char *findname, int *numfiles, unsigned musthave, unsigned canthave)
 
void FS_Dir_f (void)
 
void FS_Path_f (void)
 
char * FS_NextPath (char *prevpath)
 
void FS_InitFilesystem (void)
 

Variables

char fs_gamedir [MAX_OSPATH]
 
cvar_tfs_basedir
 
cvar_tfs_cddir
 
cvar_tfs_gamedirvar
 
filelink_tfs_links
 
searchpath_tfs_searchpaths
 
searchpath_tfs_base_searchpaths
 
int file_from_pak = 0
 

Macro Definition Documentation

◆ MAX_READ

#define MAX_READ   0x10000

Definition at line 345 of file files.c.

◆ PAK0_CHECKSUM

#define PAK0_CHECKSUM   0x40e614e0

Definition at line 28 of file files.c.

Typedef Documentation

◆ filelink_t

typedef struct filelink_s filelink_t

◆ pack_t

typedef struct pack_s pack_t

◆ searchpath_t

typedef struct searchpath_s searchpath_t

Function Documentation

◆ CDAudio_Stop()

◆ Developer_searchpath()

int Developer_searchpath ( int  who)

Definition at line 159 of file files.c.

160 {
161 
162  int ch;
163  // PMM - warning removal
164 // char *start;
165  searchpath_t *search;
166 
167  if (who == 1) // xatrix
168  ch = 'x';
169  else if (who == 2)
170  ch = 'r';
171 
172  for (search = fs_searchpaths ; search ; search = search->next)
173  {
174  if (strstr (search->filename, "xatrix"))
175  return 1;
176 
177  if (strstr (search->filename, "rogue"))
178  return 2;
179 /*
180  start = strchr (search->filename, ch);
181 
182  if (start == NULL)
183  continue;
184 
185  if (strcmp (start ,"xatrix") == 0)
186  return (1);
187 */
188  }
189  return (0);
190 
191 }

Referenced by CL_AddPacketEntities(), DMFlagCallback(), DMOptions_MenuInit(), M_Menu_Credits_f(), RulesChangeFunc(), StartServer_MenuInit(), and StartServerActionFunc().

◆ FS_AddGameDirectory()

void FS_AddGameDirectory ( char *  dir)

Definition at line 513 of file files.c.

514 {
515  int i;
516  searchpath_t *search;
517  pack_t *pak;
518  char pakfile[MAX_OSPATH];
519 
520  //
521  // add the base directory to the search path
522  //
523  search = Z_Malloc (sizeof(searchpath_t));
524  strncpy (search->filename, dir, sizeof(search->filename)-1);
525  search->filename[sizeof(search->filename)-1] = 0;
526 
527  search->next = fs_searchpaths;
528  fs_searchpaths = search;
529 
530  //
531  // add any pak files in the format pak0.pak pak1.pak, ...
532  //
533  for (i=0; i<50; i++)
534  {
535  Com_sprintf (pakfile, sizeof(pakfile), "%s/pak%i.pak", dir, i);
536  pak = FS_LoadPackFile (pakfile);
537  if (!pak)
538  continue;
539  search = Z_Malloc (sizeof(searchpath_t));
540  search->pack = pak;
541  search->next = fs_searchpaths;
542  fs_searchpaths = search;
543  }
544 #ifdef QMAX
545  Com_sprintf (pakfile, sizeof(pakfile), "%s/maxpak.pak", dir);
546  pak = FS_LoadPackFile (pakfile);
547  search = Z_Malloc (sizeof(searchpath_t));
548  search->pack = pak;
549  search->next = fs_searchpaths;
550  fs_searchpaths = search;
551 #endif
552 }

Referenced by FS_AddHomeAsGameDirectory(), FS_InitFilesystem(), and FS_SetGamedir().

◆ FS_AddHomeAsGameDirectory()

void FS_AddHomeAsGameDirectory ( char *  dir)

Definition at line 561 of file files.c.

562 {
563 #ifndef _WIN32
564  char gdir[MAX_OSPATH];
565  char *homedir=getenv("HOME");
566  if(homedir)
567  {
568  int len = snprintf(gdir,sizeof(gdir),"%s/.quake2/%s/", homedir, dir);
569  Com_Printf("using %s for writing\n",gdir);
570  FS_CreatePath (gdir);
571 
572  if ((len > 0) && (len < sizeof(gdir)) && (gdir[len-1] == '/'))
573  gdir[len-1] = 0;
574 
575  strncpy(fs_gamedir,gdir,sizeof(fs_gamedir)-1);
576  fs_gamedir[sizeof(fs_gamedir)-1] = 0;
577 
578  FS_AddGameDirectory (gdir);
579  }
580 #endif
581 }

Referenced by FS_InitFilesystem(), and FS_SetGamedir().

◆ FS_CreatePath()

void FS_CreatePath ( char *  path)

Definition at line 125 of file files.c.

126 {
127  char *ofs;
128 
129  for (ofs = path+1 ; *ofs ; ofs++)
130  {
131  if (*ofs == '/')
132  { // create the directory
133  *ofs = 0;
134  Sys_Mkdir (path);
135  *ofs = '/';
136  }
137  }
138 }

Referenced by CL_ParseDownload(), CL_Record_f(), Con_Dump_f(), FS_AddHomeAsGameDirectory(), SV_CopySaveGame(), SV_GameMap_f(), and SV_ServerRecord_f().

◆ FS_Dir_f()

void FS_Dir_f ( void  )

Definition at line 784 of file files.c.

785 {
786  char *path = NULL;
787  char findname[1024];
788  char wildcard[1024] = "*.*";
789  char **dirnames;
790  int ndirs;
791 
792  if ( Cmd_Argc() != 1 )
793  {
794  strcpy( wildcard, Cmd_Argv( 1 ) );
795  }
796 
797  while ( ( path = FS_NextPath( path ) ) != NULL )
798  {
799  char *tmp = findname;
800 
801  Com_sprintf( findname, sizeof(findname), "%s/%s", path, wildcard );
802 
803  while ( *tmp != 0 )
804  {
805  if ( *tmp == '\\' )
806  *tmp = '/';
807  tmp++;
808  }
809  Com_Printf( "Directory of %s\n", findname );
810  Com_Printf( "----\n" );
811 
812  if ( ( dirnames = FS_ListFiles( findname, &ndirs, 0, 0 ) ) != 0 )
813  {
814  int i;
815 
816  for ( i = 0; i < ndirs-1; i++ )
817  {
818  if ( strrchr( dirnames[i], '/' ) )
819  Com_Printf( "%s\n", strrchr( dirnames[i], '/' ) + 1 );
820  else
821  Com_Printf( "%s\n", dirnames[i] );
822 
823  free( dirnames[i] );
824  }
825  free( dirnames );
826  }
827  Com_Printf( "\n" );
828  };
829 }

Referenced by FS_InitFilesystem().

◆ FS_ExecAutoexec()

void FS_ExecAutoexec ( void  )

Definition at line 600 of file files.c.

601 {
602  char name [MAX_QPATH];
603  searchpath_t *s, *end;
604 
605  // don't look in baseq2 if gamedir is set
607  end = NULL;
608  else
609  end = fs_base_searchpaths;
610 
611  // search through all the paths for an autoexec.cfg file
612  for (s = fs_searchpaths ; s != end ; s = s->next)
613  {
614  if (s->pack)
615  continue;
616 
617  Com_sprintf(name, sizeof(name), "%s/autoexec.cfg", s->filename);
618 
620  {
621  Cbuf_AddText ("exec autoexec.cfg\n");
622  Sys_FindClose();
623  break;
624  }
625  Sys_FindClose();
626  }
627 }

Referenced by CL_Init(), Cvar_GetLatchedVars(), and Cvar_Set2().

◆ FS_FCloseFile()

void FS_FCloseFile ( FILE *  f)

Definition at line 149 of file files.c.

150 {
151  fclose (f);
152 }

Referenced by S_RegisterSexedSound().

◆ FS_filelength()

int FS_filelength ( FILE *  f)

Definition at line 104 of file files.c.

105 {
106  int pos;
107  int end;
108 
109  pos = ftell (f);
110  fseek (f, 0, SEEK_END);
111  end = ftell (f);
112  fseek (f, pos, SEEK_SET);
113 
114  return end;
115 }

Referenced by FS_FOpenFile().

◆ FS_FOpenFile()

int FS_FOpenFile ( char *  filename,
FILE **  file 
)

Definition at line 206 of file files.c.

207 {
208  searchpath_t *search;
209  char netpath[MAX_OSPATH];
210  pack_t *pak;
211  int i;
212  filelink_t *link;
213 
214  file_from_pak = 0;
215 
216  // check for links first
217  for (link = fs_links ; link ; link=link->next)
218  {
219  if (!strncmp (filename, link->from, link->fromlength))
220  {
221  Com_sprintf (netpath, sizeof(netpath), "%s%s",link->to, filename+link->fromlength);
222  *file = fopen (netpath, "rb");
223  if (*file)
224  {
225  Com_DPrintf ("link file: %s\n",netpath);
226  return FS_filelength (*file);
227  }
228  return -1;
229  }
230  }
231 
232 //
233 // search through the path, one element at a time
234 //
235  for (search = fs_searchpaths ; search ; search = search->next)
236  {
237  // is the element a pak file?
238  if (search->pack)
239  {
240  // look through all the pak file elements
241  pak = search->pack;
242  for (i=0 ; i<pak->numfiles ; i++)
243  if (!Q_strcasecmp (pak->files[i].name, filename))
244  { // found it!
245  file_from_pak = 1;
246  Com_DPrintf ("PackFile: %s : %s\n",pak->filename, filename);
247  // open a new file on the pakfile
248  *file = fopen (pak->filename, "rb");
249  if (!*file)
250  Com_Error (ERR_FATAL, "Couldn't reopen %s", pak->filename);
251  fseek (*file, pak->files[i].filepos, SEEK_SET);
252  return pak->files[i].filelen;
253  }
254  }
255  else
256  {
257  // check a file in the directory tree
258 
259  Com_sprintf (netpath, sizeof(netpath), "%s/%s",search->filename, filename);
260 
261  *file = fopen (netpath, "rb");
262  if (!*file)
263  continue;
264 
265  Com_DPrintf ("FindFile: %s\n",netpath);
266 
267  return FS_filelength (*file);
268  }
269 
270  }
271 
272  Com_DPrintf ("FindFile: can't find %s\n", filename);
273 
274  *file = NULL;
275  return -1;
276 }

Referenced by FS_LoadFile(), S_RegisterSexedSound(), SCR_PlayCinematic(), and SV_BeginDemoserver().

◆ FS_FreeFile()

◆ FS_Gamedir()

◆ FS_InitFilesystem()

void FS_InitFilesystem ( void  )

Definition at line 891 of file files.c.

892 {
893  Cmd_AddCommand ("path", FS_Path_f);
894  Cmd_AddCommand ("link", FS_Link_f);
895  Cmd_AddCommand ("dir", FS_Dir_f );
896 
897  //
898  // basedir <path>
899  // allows the game to run from outside the data tree
900  //
901  fs_basedir = Cvar_Get ("basedir", ".", CVAR_NOSET);
902 
903  //
904  // cddir <path>
905  // Logically concatenates the cddir after the basedir for
906  // allows the game to run from outside the data tree
907  //
908  fs_cddir = Cvar_Get ("cddir", "", CVAR_NOSET);
909  if (fs_cddir->string[0])
911 
912  //
913  // add baseq2 to search path
914  //
916 
917  //
918  // then add a '.quake2/baseq2' directory in home directory by default
919  //
921 
922  // any set gamedirs will be freed up to here
924 
925  // check for game override
927  if (fs_gamedirvar->string[0])
929 }

Referenced by Qcommon_Init().

◆ FS_Link_f()

void FS_Link_f ( void  )

Definition at line 696 of file files.c.

697 {
698  filelink_t *l, **prev;
699 
700  if (Cmd_Argc() != 3)
701  {
702  Com_Printf ("USAGE: link <from> <to>\n");
703  return;
704  }
705 
706  // see if the link already exists
707  prev = &fs_links;
708  for (l=fs_links ; l ; l=l->next)
709  {
710  if (!strcmp (l->from, Cmd_Argv(1)))
711  {
712  Z_Free (l->to);
713  if (!strlen(Cmd_Argv(2)))
714  { // delete it
715  *prev = l->next;
716  Z_Free (l->from);
717  Z_Free (l);
718  return;
719  }
720  l->to = CopyString (Cmd_Argv(2));
721  return;
722  }
723  prev = &l->next;
724  }
725 
726  // create a new link
727  l = Z_Malloc(sizeof(*l));
728  l->next = fs_links;
729  fs_links = l;
730  l->from = CopyString(Cmd_Argv(1));
731  l->fromlength = strlen(l->from);
732  l->to = CopyString(Cmd_Argv(2));
733 }

Referenced by FS_InitFilesystem().

◆ FS_ListFiles()

char** FS_ListFiles ( char *  findname,
int numfiles,
unsigned  musthave,
unsigned  canthave 
)

Definition at line 738 of file files.c.

739 {
740  char *s;
741  int nfiles = 0;
742  char **list = 0;
743 
744  s = Sys_FindFirst( findname, musthave, canthave );
745  while ( s )
746  {
747  if ( s[strlen(s)-1] != '.' )
748  nfiles++;
749  s = Sys_FindNext( musthave, canthave );
750  }
751  Sys_FindClose ();
752 
753  if ( !nfiles )
754  return NULL;
755 
756  nfiles++; // add space for a guard
757  *numfiles = nfiles;
758 
759  list = malloc( sizeof( char * ) * nfiles );
760  memset( list, 0, sizeof( char * ) * nfiles );
761 
762  s = Sys_FindFirst( findname, musthave, canthave );
763  nfiles = 0;
764  while ( s )
765  {
766  if ( s[strlen(s)-1] != '.' )
767  {
768  list[nfiles] = strdup( s );
769 #ifdef _WIN32
770  strlwr( list[nfiles] );
771 #endif
772  nfiles++;
773  }
774  s = Sys_FindNext( musthave, canthave );
775  }
776  Sys_FindClose ();
777 
778  return list;
779 }

Referenced by FS_Dir_f(), and PlayerConfig_ScanDirectories().

◆ FS_LoadFile()

int FS_LoadFile ( char *  path,
void **  buffer 
)

Definition at line 394 of file files.c.

395 {
396  FILE *h;
397  byte *buf;
398  int len;
399 
400  buf = NULL; // quiet compiler warning
401 
402 // look for it in the filesystem or pack files
403  len = FS_FOpenFile (path, &h);
404  if (!h)
405  {
406  if (buffer)
407  *buffer = NULL;
408  return -1;
409  }
410 
411  if (!buffer)
412  {
413  fclose (h);
414  return len;
415  }
416 
417  buf = Z_Malloc(len);
418  *buffer = buf;
419 
420  FS_Read (buf, len, h);
421 
422  fclose (h);
423 
424  return len;
425 }

Referenced by CL_CheckOrDownloadFile(), CL_Download_f(), CL_RequestNextDownload(), CM_LoadMap(), Cmd_Exec_f(), M_Menu_Credits_f(), S_LoadSound(), SCR_LoadPCX(), StartServer_MenuInit(), SV_BeginDownload_f(), SV_Map_f(), and VID_LoadRefresh().

◆ FS_LoadPackFile()

pack_t* FS_LoadPackFile ( char *  packfile)

Definition at line 448 of file files.c.

449 {
450  dpackheader_t header;
451  int i;
452  packfile_t *newfiles;
453  int numpackfiles;
454  pack_t *pack;
455  FILE *packhandle;
457  unsigned checksum;
458 
459  packhandle = fopen(packfile, "rb");
460  if (!packhandle)
461  return NULL;
462 
463  fread (&header, 1, sizeof(header), packhandle);
464  if (LittleLong(header.ident) != IDPAKHEADER)
465  Com_Error (ERR_FATAL, "%s is not a packfile", packfile);
466  header.dirofs = LittleLong (header.dirofs);
467  header.dirlen = LittleLong (header.dirlen);
468 
469  numpackfiles = header.dirlen / sizeof(dpackfile_t);
470 
471  if (numpackfiles > MAX_FILES_IN_PACK)
472  Com_Error (ERR_FATAL, "%s has %i files", packfile, numpackfiles);
473 
474  newfiles = Z_Malloc (numpackfiles * sizeof(packfile_t));
475 
476  fseek (packhandle, header.dirofs, SEEK_SET);
477  fread (info, 1, header.dirlen, packhandle);
478 
479 // crc the directory to check for modifications
480  checksum = Com_BlockChecksum ((void *)info, header.dirlen);
481 
482 #ifdef NO_ADDONS
483  if (checksum != PAK0_CHECKSUM)
484  return NULL;
485 #endif
486 // parse the directory
487  for (i=0 ; i<numpackfiles ; i++)
488  {
489  strcpy (newfiles[i].name, info[i].name);
490  newfiles[i].filepos = LittleLong(info[i].filepos);
491  newfiles[i].filelen = LittleLong(info[i].filelen);
492  }
493 
494  pack = Z_Malloc (sizeof (pack_t));
495  strcpy (pack->filename, packfile);
496  pack->handle = packhandle;
497  pack->numfiles = numpackfiles;
498  pack->files = newfiles;
499 
500  Com_Printf ("Added packfile %s (%i files)\n", packfile, numpackfiles);
501  return pack;
502 }

Referenced by FS_AddGameDirectory().

◆ FS_NextPath()

char* FS_NextPath ( char *  prevpath)

Definition at line 865 of file files.c.

866 {
867  searchpath_t *s;
868  char *prev;
869 
870  prev = NULL; /* fs_gamedir is the first directory in the searchpath */
871  for (s=fs_searchpaths ; s ; s=s->next)
872  {
873  if (s->pack)
874  continue;
875  if (prevpath == NULL)
876  return s->filename;
877  if (prevpath == prev)
878  return s->filename;
879  prev = s->filename;
880  }
881 
882  return NULL;
883 }

Referenced by FS_Dir_f(), PlayerConfig_ScanDirectories(), and Sys_GetGameAPI().

◆ FS_Path_f()

void FS_Path_f ( void  )

Definition at line 837 of file files.c.

838 {
839  searchpath_t *s;
840  filelink_t *l;
841 
842  Com_Printf ("Current search path:\n");
843  for (s=fs_searchpaths ; s ; s=s->next)
844  {
845  if (s == fs_base_searchpaths)
846  Com_Printf ("----------\n");
847  if (s->pack)
848  Com_Printf ("%s (%i files)\n", s->pack->filename, s->pack->numfiles);
849  else
850  Com_Printf ("%s\n", s->filename);
851  }
852 
853  Com_Printf ("\nLinks:\n");
854  for (l=fs_links ; l ; l=l->next)
855  Com_Printf ("%s : %s\n", l->from, l->to);
856 }

Referenced by FS_InitFilesystem().

◆ FS_Read()

void FS_Read ( void buffer,
int  len,
FILE *  f 
)

Definition at line 346 of file files.c.

347 {
348  int block, remaining;
349  int read;
350  byte *buf;
351  int tries;
352 
353  buf = (byte *)buffer;
354 
355  // read in chunks for progress bar
356  remaining = len;
357  tries = 0;
358  while (remaining)
359  {
360  block = remaining;
361  if (block > MAX_READ)
362  block = MAX_READ;
363  read = fread (buf, 1, block, f);
364  if (read == 0)
365  {
366  // we might have been trying to read from a CD
367  if (!tries)
368  {
369  tries = 1;
370  CDAudio_Stop();
371  }
372  else
373  Com_Error (ERR_FATAL, "FS_Read: 0 bytes read");
374  }
375 
376  if (read == -1)
377  Com_Error (ERR_FATAL, "FS_Read: -1 bytes read");
378 
379  // do some progress bar thing here...
380 
381  remaining -= read;
382  buf += read;
383  }
384 }

Referenced by CM_ReadPortalState(), Create_Savestrings(), FS_LoadFile(), Huff1TableInit(), SCR_PlayCinematic(), SCR_ReadNextFrame(), SV_ReadLevelFile(), and SV_ReadServerFile().

◆ FS_SetGamedir()

void FS_SetGamedir ( char *  dir)

Definition at line 638 of file files.c.

639 {
640  searchpath_t *next;
641 
642  if (strstr(dir, "..") || strstr(dir, "/")
643  || strstr(dir, "\\") || strstr(dir, ":") )
644  {
645  Com_Printf ("Gamedir should be a single filename, not a path\n");
646  return;
647  }
648 
649  //
650  // free up any current game dir info
651  //
653  {
654  if (fs_searchpaths->pack)
655  {
656  fclose (fs_searchpaths->pack->handle);
659  }
660  next = fs_searchpaths->next;
662  fs_searchpaths = next;
663  }
664 
665  //
666  // flush all data, so it will be forced to reload
667  //
668  if (dedicated && !dedicated->value)
669  Cbuf_AddText ("vid_restart\nsnd_restart\n");
670 
671 
672  // now add new entries for
673  if (!strcmp(dir,BASEDIRNAME) || (*dir == 0))
674  {
675  Cvar_FullSet ("gamedir", "", CVAR_SERVERINFO|CVAR_NOSET);
677  }
678  else
679  {
680  Cvar_FullSet ("gamedir", dir, CVAR_SERVERINFO|CVAR_NOSET);
681  if (fs_cddir->string[0])
682  FS_AddGameDirectory (va("%s/%s", fs_cddir->string, dir) );
683  FS_AddGameDirectory (va("%s/%s", fs_basedir->string, dir) );
685  }
686 }

Referenced by Cvar_GetLatchedVars(), Cvar_Set2(), and FS_InitFilesystem().

Variable Documentation

◆ file_from_pak

int file_from_pak = 0

Definition at line 204 of file files.c.

Referenced by FS_FOpenFile(), and SV_BeginDownload_f().

◆ fs_base_searchpaths

searchpath_t* fs_base_searchpaths

Definition at line 84 of file files.c.

Referenced by FS_ExecAutoexec(), FS_InitFilesystem(), FS_Path_f(), and FS_SetGamedir().

◆ fs_basedir

cvar_t* fs_basedir

Definition at line 62 of file files.c.

Referenced by FS_InitFilesystem(), and FS_SetGamedir().

◆ fs_cddir

cvar_t* fs_cddir

Definition at line 63 of file files.c.

Referenced by FS_InitFilesystem(), and FS_SetGamedir().

◆ fs_gamedir

char fs_gamedir[MAX_OSPATH]

Definition at line 61 of file files.c.

Referenced by FS_AddHomeAsGameDirectory(), and FS_Gamedir().

◆ fs_gamedirvar

cvar_t* fs_gamedirvar

Definition at line 64 of file files.c.

Referenced by CL_ParseServerData(), and FS_InitFilesystem().

◆ fs_links

filelink_t* fs_links

Definition at line 74 of file files.c.

Referenced by FS_FOpenFile(), FS_Link_f(), and FS_Path_f().

◆ fs_searchpaths

CDAudio_Stop
void CDAudio_Stop(void)
dpackheader_t::dirofs
int dirofs
Definition: qfiles.h:45
FS_Read
void FS_Read(void *buffer, int len, FILE *f)
Definition: files.c:346
dedicated
cvar_t * dedicated
Definition: common.c:47
searchpath_s::filename
char filename[MAX_OSPATH]
Definition: files.c:78
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:73
FS_LoadPackFile
pack_t * FS_LoadPackFile(char *packfile)
Definition: files.c:448
FS_Path_f
void FS_Path_f(void)
Definition: files.c:837
file_from_pak
int file_from_pak
Definition: files.c:204
CVAR_NOSET
#define CVAR_NOSET
Definition: q_shared.h:312
Sys_Mkdir
void Sys_Mkdir(char *path)
Definition: q_shwin.c:135
fs_cddir
cvar_t * fs_cddir
Definition: files.c:63
fs_links
filelink_t * fs_links
Definition: files.c:74
BASEDIRNAME
#define BASEDIRNAME
Definition: qcommon.h:28
FS_SetGamedir
void FS_SetGamedir(char *dir)
Definition: files.c:638
cvar_s::string
char * string
Definition: q_shared.h:320
i
int i
Definition: q_shared.c:305
fs_basedir
cvar_t * fs_basedir
Definition: files.c:62
FS_Dir_f
void FS_Dir_f(void)
Definition: files.c:784
dpackfile_t
Definition: qfiles.h:36
buffer
GLenum GLfloat * buffer
Definition: qgl_win.c:151
FS_NextPath
char * FS_NextPath(char *prevpath)
Definition: files.c:865
pack_s::numfiles
int numfiles
Definition: files.c:57
CopyString
char * CopyString(char *in)
Definition: common.c:1057
Cvar_Get
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
Definition: cvar.c:127
FS_CreatePath
void FS_CreatePath(char *path)
Definition: files.c:125
packfile_t::filelen
int filelen
Definition: files.c:50
FS_FOpenFile
int FS_FOpenFile(char *filename, FILE **file)
Definition: files.c:206
CVAR_SERVERINFO
#define CVAR_SERVERINFO
Definition: q_shared.h:311
PAK0_CHECKSUM
#define PAK0_CHECKSUM
Definition: files.c:28
packfile_t::name
char name[MAX_QPATH]
Definition: files.c:49
dpackheader_t
Definition: qfiles.h:42
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:517
va
char * va(char *format,...)
Definition: q_shared.c:1050
Cmd_Argc
int Cmd_Argc(void)
Definition: cmd.c:507
FS_Link_f
void FS_Link_f(void)
Definition: files.c:696
searchpath_s::next
struct searchpath_s * next
Definition: files.c:80
searchpath_s
Definition: files.c:76
IDPAKHEADER
#define IDPAKHEADER
Definition: qfiles.h:34
MAX_READ
#define MAX_READ
Definition: files.c:345
LittleLong
int LittleLong(int l)
Definition: q_shared.c:948
Sys_FindFirst
char * Sys_FindFirst(char *path, unsigned musthave, unsigned canthave)
Definition: q_shwin.c:173
Cvar_FullSet
cvar_t * Cvar_FullSet(char *var_name, char *value, int flags)
Definition: cvar.c:288
FS_AddGameDirectory
void FS_AddGameDirectory(char *dir)
Definition: files.c:513
pack_s::handle
FILE * handle
Definition: files.c:56
Cmd_AddCommand
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
Definition: cmd.c:691
cvar_s::value
float value
Definition: q_shared.h:324
Cbuf_AddText
void Cbuf_AddText(char *text)
Definition: cmd.c:90
pack_s
Definition: files.c:53
MAX_OSPATH
#define MAX_OSPATH
Definition: q_shared.h:74
fs_base_searchpaths
searchpath_t * fs_base_searchpaths
Definition: files.c:84
NULL
#define NULL
Definition: q_shared.h:60
FS_ListFiles
char ** FS_ListFiles(char *findname, int *numfiles, unsigned musthave, unsigned canthave)
Definition: files.c:738
CVAR_LATCH
#define CVAR_LATCH
Definition: q_shared.h:314
FS_filelength
int FS_filelength(FILE *f)
Definition: files.c:104
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:203
packfile_t
Definition: files.c:47
Z_Malloc
void * Z_Malloc(int size)
Definition: common.c:1223
name
cvar_t * name
Definition: cl_main.c:94
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:735
Sys_FindNext
char * Sys_FindNext(unsigned musthave, unsigned canthave)
Definition: q_shwin.c:191
pack_s::filename
char filename[MAX_OSPATH]
Definition: files.c:55
Com_BlockChecksum
unsigned Com_BlockChecksum(void *buffer, int length)
Definition: md4.c:165
MAX_FILES_IN_PACK
#define MAX_FILES_IN_PACK
Definition: qfiles.h:49
Z_Free
void Z_Free(void *ptr)
Definition: common.c:1141
searchpath_s::pack
pack_t * pack
Definition: files.c:79
fs_searchpaths
searchpath_t * fs_searchpaths
Definition: files.c:83
packfile_t::filepos
int filepos
Definition: files.c:50
Sys_FindClose
void Sys_FindClose(void)
Definition: q_shwin.c:206
Com_DPrintf
void Com_DPrintf(char *fmt,...)
Definition: common.c:155
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:102
SFF_HIDDEN
#define SFF_HIDDEN
Definition: q_shared.h:280
Q_strcasecmp
int Q_strcasecmp(char *s1, char *s2)
Definition: q_shared.c:1229
pack_s::files
packfile_t * files
Definition: files.c:58
FS_AddHomeAsGameDirectory
void FS_AddHomeAsGameDirectory(char *dir)
Definition: files.c:561
fs_gamedir
char fs_gamedir[MAX_OSPATH]
Definition: files.c:61
SFF_SUBDIR
#define SFF_SUBDIR
Definition: q_shared.h:282
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1236
fs_gamedirvar
cvar_t * fs_gamedirvar
Definition: files.c:64
SFF_SYSTEM
#define SFF_SYSTEM
Definition: q_shared.h:283
dpackheader_t::dirlen
int dirlen
Definition: qfiles.h:46
dpackheader_t::ident
int ident
Definition: qfiles.h:44