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/CfileArchive.h $
15 * External def's for CfileArchive.cpp. This should only be used
16 * internally by cfile stuff.
19 * Revision 1.2 2002/06/09 04:41:12 relnev
20 * added copyright header
22 * Revision 1.1.1.1 2002/05/03 03:28:11 root
26 * 2 10/07/98 10:52a Dave
29 * 1 10/07/98 10:48a Dave
31 * 4 5/11/98 10:59a John
32 * Moved the low-level file reading code into cfilearchive.cpp.
34 * 3 4/30/98 4:53p John
35 * Restructured and cleaned up cfile code. Added capability to read off
36 * of CD-ROM drive and out of multiple pack files.
38 * 2 12/28/97 12:42p John
39 * Put in support for reading archive files; Made missionload use the
40 * cf_get_file_list function. Moved demos directory out of data tree.
42 * 1 12/28/97 11:48a John
47 #ifndef _CFILEARCHIVE_H
48 #define _CFILEARCHIVE_H
50 #ifndef _CFILE_INTERNAL
51 #error This file should only be included internally in CFILE!!
54 // The following Cfile_block data is private to cfile.cpp
55 // DO NOT MOVE the Cfile_block* information to cfile.h / do not extern this data
57 #define CFILE_BLOCK_UNUSED 0
58 #define CFILE_BLOCK_USED 1
60 typedef struct Cfile_block {
61 int type; // CFILE_BLOCK_UNUSED, CFILE_BLOCK_USED
62 int dir_type; // directory location
63 FILE *fp; // File pointer if opening an individual file
64 void *data; // Pointer for memory-mapped file access. NULL if not mem-mapped.
65 HANDLE hInFile; // Handle from CreateFile()
66 HANDLE hMapFile; // Handle from CreateFileMapping()
69 int size; // for packed files
73 #define MAX_CFILE_BLOCKS 64
74 extern Cfile_block Cfile_block_list[MAX_CFILE_BLOCKS];
75 extern CFILE Cfile_list[MAX_CFILE_BLOCKS];
77 // Called once to setup the low-level reading code.
78 void cf_init_lowlevel_read_code( CFILE * cfile, int offset, int size );