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.4 2004/07/04 11:26:21 taylor
23 * cleanup CFILE code a little, warning fixes, remove redundant dir checks
25 * Revision 1.3 2003/05/27 03:23:23 taylor
26 * fix second root (gamedir) searching
28 * Revision 1.2 2002/06/09 04:41:12 relnev
29 * added copyright header
31 * Revision 1.1.1.1 2002/05/03 03:28:11 root
35 * 3 10/13/98 9:19a Andsager
36 * Add localization support to cfile. Optional parameter with cfopen that
37 * looks for localized files.
39 * 2 10/07/98 10:52a Dave
42 * 1 10/07/98 10:48a Dave
44 * 5 5/01/98 10:21a John
45 * Added code to find all pack files in all trees. Added code to create
46 * any directories that we write to.
48 * 4 4/30/98 10:21p John
49 * Added code to cleanup cfilesystem
54 #ifndef _CFILESYSTEM_H
55 #define _CFILESYSTEM_H
57 // Builds a list of all the files
58 void cf_build_secondary_filelist( const char *extras_path );
59 void cf_free_secondary_filelist();
62 typedef struct cf_pathtype {
63 int index; // To verify that the CF_TYPE define is correctly indexed into this array
64 const char *path; // Path relative to Freespace root, has ending backslash.
65 const char *extensions; // Extensions used in this pathtype, separated by spaces
66 int parent_index; // Index of this directory's parent. Used for creating directories when writing.
69 // During cfile_init, verify that Pathtypes[n].index == n for each item
70 extern cf_pathtype Pathtypes[CF_MAX_PATH_TYPES];
72 // Returns the default storage path for files given a
73 // particular pathtype. In other words, the path to
74 // the unpacked, non-cd'd, stored on hard drive path.
75 // If filename isn't null it will also tack the filename
76 // on the end, creating a completely valid filename.
77 // Input: pathtype - CF_TYPE_??
78 // filename - optional, if set, tacks the filename onto end of path.
79 // Output: path - Fully qualified pathname.
80 void cf_create_default_path_string( char *path, int pathtype, const char *filename=NULL, bool localize = false);
83 #endif //_CFILESYSTEM_H