]> icculus.org git repositories - taylor/freespace2.git/blob - include/cfilearchive.h
Initial revision
[taylor/freespace2.git] / include / cfilearchive.h
1 /*
2  * $Logfile: /Freespace2/code/CFile/CfileArchive.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * External def's for CfileArchive.cpp.  This should only be used 
8  * internally by cfile stuff.
9  *
10  * $Log$
11  * Revision 1.1  2002/05/03 03:28:11  root
12  * Initial revision
13  *
14  * 
15  * 2     10/07/98 10:52a Dave
16  * Initial checkin.
17  * 
18  * 1     10/07/98 10:48a Dave
19  * 
20  * 4     5/11/98 10:59a John
21  * Moved the low-level file reading code into cfilearchive.cpp.
22  * 
23  * 3     4/30/98 4:53p John
24  * Restructured and cleaned up cfile code.  Added capability to read off
25  * of CD-ROM drive and out of multiple pack files.
26  * 
27  * 2     12/28/97 12:42p John
28  * Put in support for reading archive files; Made missionload use the
29  * cf_get_file_list function.   Moved demos directory out of data tree.
30  * 
31  * 1     12/28/97 11:48a John
32  *
33  * $NoKeywords: $
34  */
35
36 #ifndef _CFILEARCHIVE_H
37 #define _CFILEARCHIVE_H
38
39 #ifndef _CFILE_INTERNAL 
40 #error This file should only be included internally in CFILE!!
41 #endif
42
43 // The following Cfile_block data is private to cfile.cpp
44 // DO NOT MOVE the Cfile_block* information to cfile.h / do not extern this data
45 //
46 #define CFILE_BLOCK_UNUSED              0
47 #define CFILE_BLOCK_USED                1
48
49 typedef struct Cfile_block {
50         int             type;                           // CFILE_BLOCK_UNUSED, CFILE_BLOCK_USED
51         int             dir_type;               // directory location
52         FILE            *fp;                            // File pointer if opening an individual file
53         void            *data;                  // Pointer for memory-mapped file access.  NULL if not mem-mapped.
54         HANDLE  hInFile;                        // Handle from CreateFile()
55         HANDLE  hMapFile;               // Handle from CreateFileMapping()
56         int             lib_offset;
57         int             raw_position;
58         int             size;                           // for packed files
59         
60 } Cfile_block;
61
62 #define MAX_CFILE_BLOCKS        64
63 extern Cfile_block Cfile_block_list[MAX_CFILE_BLOCKS];
64 extern CFILE Cfile_list[MAX_CFILE_BLOCKS];
65
66 // Called once to setup the low-level reading code.
67 void cf_init_lowlevel_read_code( CFILE * cfile, int offset, int size );
68
69 #endif
70