vkQuake2 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)
 
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 349 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()

void CDAudio_Stop ( void  )

Definition at line 194 of file cd_win.c.

195 {
196  DWORD dwReturn;
197 
198  if (!enabled)
199  return;
200 
201  if (!playing)
202  return;
203 
204  if (dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (DWORD_PTR)NULL))
205  Com_DPrintf("MCI_STOP failed (%i)", dwReturn);
206 
207  wasPlaying = false;
208  playing = false;
209 }

Referenced by FS_Read(), SCR_BeginLoadingPlaque(), and SCR_PlayCinematic().

◆ 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 517 of file files.c.

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

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(), SV_CopySaveGame(), SV_GameMap_f(), and SV_ServerRecord_f().

◆ FS_Dir_f()

void FS_Dir_f ( void  )

Definition at line 740 of file files.c.

741 {
742  char *path = NULL;
743  char findname[1024];
744  char wildcard[1024] = "*.*";
745  char **dirnames;
746  int ndirs;
747 
748  if ( Cmd_Argc() != 1 )
749  {
750  strcpy( wildcard, Cmd_Argv( 1 ) );
751  }
752 
753  while ( ( path = FS_NextPath( path ) ) != NULL )
754  {
755  char *tmp = findname;
756 
757  Com_sprintf( findname, sizeof(findname), "%s/%s", path, wildcard );
758 
759  while ( *tmp != 0 )
760  {
761  if ( *tmp == '\\' )
762  *tmp = '/';
763  tmp++;
764  }
765  Com_Printf( "Directory of %s\n", findname );
766  Com_Printf( "----\n" );
767 
768  if ( ( dirnames = FS_ListFiles( findname, &ndirs, 0, 0 ) ) != 0 )
769  {
770  int i;
771 
772  for ( i = 0; i < ndirs-1; i++ )
773  {
774  if ( strrchr( dirnames[i], '/' ) )
775  Com_Printf( "%s\n", strrchr( dirnames[i], '/' ) + 1 );
776  else
777  Com_Printf( "%s\n", dirnames[i] );
778 
779  free( dirnames[i] );
780  }
781  free( dirnames );
782  }
783  Com_Printf( "\n" );
784  };
785 }

Referenced by FS_InitFilesystem().

◆ FS_ExecAutoexec()

void FS_ExecAutoexec ( void  )

Definition at line 572 of file files.c.

573 {
574  char *dir;
575  char name [MAX_QPATH];
576 
577  dir = Cvar_VariableString("gamedir");
578  if (*dir)
579  Com_sprintf(name, sizeof(name), "%s/%s/autoexec.cfg", fs_basedir->string, dir);
580  else
581  Com_sprintf(name, sizeof(name), "%s/%s/autoexec.cfg", fs_basedir->string, BASEDIRNAME);
583  Cbuf_AddText ("exec autoexec.cfg\n");
584  Sys_FindClose();
585 }

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 #ifndef _WIN32
261  // some expansion packs use backslashes in file paths which works only on Windows
262  char *np = netpath;
263  while ( *np++ ) *np = *np == '\\' ? '/' : *np;
264 #endif
265  *file = fopen (netpath, "rb");
266  if (!*file)
267  continue;
268 
269  Com_DPrintf ("FindFile: %s\n",netpath);
270 
271  return FS_filelength (*file);
272  }
273 
274  }
275 
276  Com_DPrintf ("FindFile: can't find %s\n", filename);
277 
278  *file = NULL;
279  return -1;
280 }

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

◆ FS_FreeFile()

◆ FS_Gamedir()

◆ FS_InitFilesystem()

void FS_InitFilesystem ( void  )

Definition at line 848 of file files.c.

849 {
850  Cmd_AddCommand ("path", FS_Path_f);
851  Cmd_AddCommand ("link", FS_Link_f);
852  Cmd_AddCommand ("dir", FS_Dir_f );
853 
854  //
855  // basedir <path>
856  // allows the game to run from outside the data tree
857  //
858  fs_basedir = Cvar_Get ("basedir", ".", CVAR_NOSET);
859 
860  //
861  // cddir <path>
862  // Logically concatenates the cddir after the basedir for
863  // allows the game to run from outside the data tree
864  //
865  fs_cddir = Cvar_Get ("cddir", "", CVAR_NOSET);
866  if (fs_cddir->string[0])
868 
869  //
870  // start up with baseq2 by default
871  //
873 
874  // any set gamedirs will be freed up to here
876 
877  // check for game override
879  if (fs_gamedirvar->string[0])
881 }

Referenced by Qcommon_Init().

◆ FS_Link_f()

void FS_Link_f ( void  )

Definition at line 652 of file files.c.

653 {
654  filelink_t *l, **prev;
655 
656  if (Cmd_Argc() != 3)
657  {
658  Com_Printf ("USAGE: link <from> <to>\n");
659  return;
660  }
661 
662  // see if the link already exists
663  prev = &fs_links;
664  for (l=fs_links ; l ; l=l->next)
665  {
666  if (!strcmp (l->from, Cmd_Argv(1)))
667  {
668  Z_Free (l->to);
669  if (!strlen(Cmd_Argv(2)))
670  { // delete it
671  *prev = l->next;
672  Z_Free (l->from);
673  Z_Free (l);
674  return;
675  }
676  l->to = CopyString (Cmd_Argv(2));
677  return;
678  }
679  prev = &l->next;
680  }
681 
682  // create a new link
683  l = Z_Malloc(sizeof(*l));
684  l->next = fs_links;
685  fs_links = l;
686  l->from = CopyString(Cmd_Argv(1));
687  l->fromlength = (int)strlen(l->from);
688  l->to = CopyString(Cmd_Argv(2));
689 }

Referenced by FS_InitFilesystem().

◆ FS_ListFiles()

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

Definition at line 694 of file files.c.

695 {
696  char *s;
697  int nfiles = 0;
698  char **list = 0;
699 
700  s = Sys_FindFirst( findname, musthave, canthave );
701  while ( s )
702  {
703  if ( s[strlen(s)-1] != '.' )
704  nfiles++;
705  s = Sys_FindNext( musthave, canthave );
706  }
707  Sys_FindClose ();
708 
709  if ( !nfiles )
710  return NULL;
711 
712  nfiles++; // add space for a guard
713  *numfiles = nfiles;
714 
715  list = malloc( sizeof( char * ) * nfiles );
716  memset( list, 0, sizeof( char * ) * nfiles );
717 
718  s = Sys_FindFirst( findname, musthave, canthave );
719  nfiles = 0;
720  while ( s )
721  {
722  if ( s[strlen(s)-1] != '.' )
723  {
724  list[nfiles] = strdup( s );
725 #ifdef _WIN32
726  strlwr( list[nfiles] );
727 #endif
728  nfiles++;
729  }
730  s = Sys_FindNext( musthave, canthave );
731  }
732  Sys_FindClose ();
733 
734  return list;
735 }

Referenced by FS_Dir_f(), and PlayerConfig_ScanDirectories().

◆ FS_LoadFile()

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

Definition at line 398 of file files.c.

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

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 452 of file files.c.

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

Referenced by FS_AddGameDirectory().

◆ FS_NextPath()

char* FS_NextPath ( char *  prevpath)

Definition at line 821 of file files.c.

822 {
823  searchpath_t *s;
824  char *prev;
825 
826  if (!prevpath)
827  return fs_gamedir;
828 
829  prev = fs_gamedir;
830  for (s=fs_searchpaths ; s ; s=s->next)
831  {
832  if (s->pack)
833  continue;
834  if (prevpath == prev)
835  return s->filename;
836  prev = s->filename;
837  }
838 
839  return NULL;
840 }

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

◆ FS_Path_f()

void FS_Path_f ( void  )

Definition at line 793 of file files.c.

794 {
795  searchpath_t *s;
796  filelink_t *l;
797 
798  Com_Printf ("Current search path:\n");
799  for (s=fs_searchpaths ; s ; s=s->next)
800  {
801  if (s == fs_base_searchpaths)
802  Com_Printf ("----------\n");
803  if (s->pack)
804  Com_Printf ("%s (%i files)\n", s->pack->filename, s->pack->numfiles);
805  else
806  Com_Printf ("%s\n", s->filename);
807  }
808 
809  Com_Printf ("\nLinks:\n");
810  for (l=fs_links ; l ; l=l->next)
811  Com_Printf ("%s : %s\n", l->from, l->to);
812 }

Referenced by FS_InitFilesystem().

◆ FS_Read()

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

Definition at line 350 of file files.c.

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

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 595 of file files.c.

596 {
597  searchpath_t *next;
598 
599  if (strstr(dir, "..") || strstr(dir, "/")
600  || strstr(dir, "\\") || strstr(dir, ":") )
601  {
602  Com_Printf ("Gamedir should be a single filename, not a path\n");
603  return;
604  }
605 
606  //
607  // free up any current game dir info
608  //
610  {
611  if (fs_searchpaths->pack)
612  {
613  fclose (fs_searchpaths->pack->handle);
616  }
617  next = fs_searchpaths->next;
619  fs_searchpaths = next;
620  }
621 
622  //
623  // flush all data, so it will be forced to reload
624  //
625  if (dedicated && !dedicated->value)
626  Cbuf_AddText ("vid_restart\nsnd_restart\n");
627 
628  Com_sprintf (fs_gamedir, sizeof(fs_gamedir), "%s/%s", fs_basedir->string, dir);
629 
630  if (!strcmp(dir,BASEDIRNAME) || (*dir == 0))
631  {
632  Cvar_FullSet ("gamedir", "", CVAR_SERVERINFO|CVAR_NOSET);
634  }
635  else
636  {
637  Cvar_FullSet ("gamedir", dir, CVAR_SERVERINFO|CVAR_NOSET);
638  if (fs_cddir->string[0])
639  FS_AddGameDirectory (va("%s/%s", fs_cddir->string, dir) );
640  FS_AddGameDirectory (va("%s/%s", fs_basedir->string, dir) );
641  }
642 }

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_InitFilesystem(), FS_Path_f(), and FS_SetGamedir().

◆ fs_basedir

cvar_t* fs_basedir

Definition at line 62 of file files.c.

Referenced by FS_ExecAutoexec(), 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_AddGameDirectory(), FS_Gamedir(), FS_NextPath(), and FS_SetGamedir().

◆ 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

wDeviceID
UINT wDeviceID
Definition: cd_win.c:43
CDAudio_Stop
void CDAudio_Stop(void)
Definition: cd_win.c:194
dpackheader_t::dirofs
int dirofs
Definition: qfiles.h:45
FS_Read
void FS_Read(void *buffer, int len, FILE *f)
Definition: files.c:350
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:80
FS_LoadPackFile
pack_t * FS_LoadPackFile(char *packfile)
Definition: files.c:452
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
FS_Path_f
void FS_Path_f(void)
Definition: files.c:793
file_from_pak
int file_from_pak
Definition: files.c:204
CVAR_NOSET
#define CVAR_NOSET
Definition: q_shared.h:319
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:595
cvar_s::string
char * string
Definition: q_shared.h:327
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:740
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:821
pack_s::numfiles
int numfiles
Definition: files.c:57
CopyString
char * CopyString(char *in)
Definition: common.c:1038
Cvar_Get
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
Definition: cvar.c:127
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:318
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:652
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:349
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:517
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:331
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:81
fs_base_searchpaths
searchpath_t * fs_base_searchpaths
Definition: files.c:84
NULL
#define NULL
Definition: q_shared.h:67
FS_ListFiles
char ** FS_ListFiles(char *findname, int *numfiles, unsigned musthave, unsigned canthave)
Definition: files.c:694
CVAR_LATCH
#define CVAR_LATCH
Definition: q_shared.h:321
FS_filelength
int FS_filelength(FILE *f)
Definition: files.c:104
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:181
packfile_t
Definition: files.c:47
Z_Malloc
void * Z_Malloc(int size)
Definition: common.c:1200
name
cvar_t * name
Definition: cl_main.c:79
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:743
s
static fixed16_t s
Definition: r_scan.c:30
wasPlaying
static qboolean wasPlaying
Definition: cd_win.c:30
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:213
MAX_FILES_IN_PACK
#define MAX_FILES_IN_PACK
Definition: qfiles.h:49
Z_Free
void Z_Free(void *ptr)
Definition: common.c:1122
searchpath_s::pack
pack_t * pack
Definition: files.c:79
fs_searchpaths
searchpath_t * fs_searchpaths
Definition: files.c:83
playing
static qboolean playing
Definition: cd_win.c:29
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:157
DWORD
DWORD
Definition: qgl_win.c:49
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:104
SFF_HIDDEN
#define SFF_HIDDEN
Definition: q_shared.h:287
Q_strcasecmp
int Q_strcasecmp(char *s1, char *s2)
Definition: q_shared.c:1216
pack_s::files
packfile_t * files
Definition: files.c:58
Cvar_VariableString
char * Cvar_VariableString(char *var_name)
Definition: cvar.c:79
fs_gamedir
char fs_gamedir[MAX_OSPATH]
Definition: files.c:61
SFF_SUBDIR
#define SFF_SUBDIR
Definition: q_shared.h:289
enabled
static qboolean enabled
Definition: cd_win.c:32
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1223
fs_gamedirvar
cvar_t * fs_gamedirvar
Definition: files.c:64
SFF_SYSTEM
#define SFF_SYSTEM
Definition: q_shared.h:290
dpackheader_t::dirlen
int dirlen
Definition: qfiles.h:46
dpackheader_t::ident
int ident
Definition: qfiles.h:44