]> icculus.org git repositories - taylor/freespace2.git/blob - include/cfilesystem.h
rendering functions mostly done; more complete shader setup
[taylor/freespace2.git] / include / cfilesystem.h
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
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
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/CFile/CfileSystem.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
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.
20  *
21  * $Log$
22  * Revision 1.4  2004/07/04 11:26:21  taylor
23  * cleanup CFILE code a little, warning fixes, remove redundant dir checks
24  *
25  * Revision 1.3  2003/05/27 03:23:23  taylor
26  * fix second root (gamedir) searching
27  *
28  * Revision 1.2  2002/06/09 04:41:12  relnev
29  * added copyright header
30  *
31  * Revision 1.1.1.1  2002/05/03 03:28:11  root
32  * Initial import.
33  *
34  * 
35  * 3     10/13/98 9:19a Andsager
36  * Add localization support to cfile.  Optional parameter with cfopen that
37  * looks for localized files.
38  * 
39  * 2     10/07/98 10:52a Dave
40  * Initial checkin.
41  * 
42  * 1     10/07/98 10:48a Dave
43  * 
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.
47  * 
48  * 4     4/30/98 10:21p John
49  * Added code to cleanup cfilesystem
50  *
51  * $NoKeywords: $
52  */
53
54 #ifndef _CFILESYSTEM_H
55 #define _CFILESYSTEM_H
56
57 // Builds a list of all the files
58 void cf_build_secondary_filelist( const char *extras_path );
59 void cf_free_secondary_filelist();
60
61 // Internal stuff
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.
67 } cf_pathtype;
68
69 // During cfile_init, verify that Pathtypes[n].index == n for each item
70 extern cf_pathtype Pathtypes[CF_MAX_PATH_TYPES];
71
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);
81
82 // returns true if packfile has been indexed by CFILE (case-insensitive search)
83 bool cf_has_packfile(const char *fn);
84
85 #endif  //_CFILESYSTEM_H