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