2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/CFile/CfileSystem.h $
15 * Functions to keep track of and find files that can exist
16 * on the harddrive, cd-rom, or in a pack file on either of those.
17 * This keeps a list of all the files in packfiles or on CD-rom
18 * and when you need a file you call one function which then searches
19 * all those locations, inherently enforcing precedence orders.
22 * Revision 1.3 2003/05/27 03:23:23 taylor
23 * fix second root (gamedir) searching
25 * Revision 1.2 2002/06/09 04:41:12 relnev
26 * added copyright header
28 * Revision 1.1.1.1 2002/05/03 03:28:11 root
32 * 3 10/13/98 9:19a Andsager
33 * Add localization support to cfile. Optional parameter with cfopen that
34 * looks for localized files.
36 * 2 10/07/98 10:52a Dave
39 * 1 10/07/98 10:48a Dave
41 * 5 5/01/98 10:21a John
42 * Added code to find all pack files in all trees. Added code to create
43 * any directories that we write to.
45 * 4 4/30/98 10:21p John
46 * Added code to cleanup cfilesystem
51 #ifndef _CFILESYSTEM_H
52 #define _CFILESYSTEM_H
54 // Builds a list of all the files
55 void cf_build_secondary_filelist( char *cdrom_path );
56 void cf_free_secondary_filelist();
59 typedef struct cf_pathtype {
60 int index; // To verify that the CF_TYPE define is correctly indexed into this array
61 char *path; // Path relative to Freespace root, has ending backslash.
62 char *extensions; // Extensions used in this pathtype, separated by spaces
63 int parent_index; // Index of this directory's parent. Used for creating directories when writing.
66 // During cfile_init, verify that Pathtypes[n].index == n for each item
67 extern cf_pathtype Pathtypes[CF_MAX_PATH_TYPES];
69 // Returns the default storage path for files given a
70 // particular pathtype. In other words, the path to
71 // the unpacked, non-cd'd, stored on hard drive path.
72 // If filename isn't null it will also tack the filename
73 // on the end, creating a completely valid filename.
74 // Input: pathtype - CF_TYPE_??
75 // filename - optional, if set, tacks the filename onto end of path.
76 // Output: path - Fully qualified pathname.
77 void cf_create_default_path_string( char *path, int pathtype, char *filename=NULL, bool localize = false);
79 void cf_create_secondary_path_string( char *path, int pathtype, char *filename=NULL, bool localize = false);
83 #endif //_CFILESYSTEM_H