FS2_Open
Open source remastering of the Freespace 2 engine
cfilearchive.h
Go to the documentation of this file.
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 the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef _CFILEARCHIVE_H
13 #define _CFILEARCHIVE_H
14 
15 #ifndef _CFILE_INTERNAL
16 #error This file should only be included internally in CFILE!!
17 #endif
18 
19 // The following Cfile_block data is private to cfile.cpp
20 // DO NOT MOVE the Cfile_block* information to cfile.h / do not extern this data
21 //
22 #define CFILE_BLOCK_UNUSED 0
23 #define CFILE_BLOCK_USED 1
24 
25 typedef struct Cfile_block {
26  int type; // CFILE_BLOCK_UNUSED, CFILE_BLOCK_USED
27  int dir_type; // directory location
28  FILE *fp; // File pointer if opening an individual file
29  void *data; // Pointer for memory-mapped file access. NULL if not mem-mapped.
30 #ifdef _WIN32
31  HANDLE hInFile; // Handle from CreateFile()
32  HANDLE hMapFile; // Handle from CreateFileMapping()
33 #else
34 // int fd; // file descriptor
35  size_t data_length; // length of data for mmap
36 #endif
39  int size; // for packed files
40 
41  size_t max_read_len; // max read offset, for special error handling
42 
43  const char* source_file;
44  int line_num;
45 } Cfile_block;
46 
47 #define MAX_CFILE_BLOCKS 64
49 
50 // Called once to setup the low-level reading code.
51 void cf_init_lowlevel_read_code( CFILE * cfile, int lib_offset, int size, int pos );
52 
53 #endif
#define MAX_CFILE_BLOCKS
Definition: cfilearchive.h:47
int raw_position
Definition: cfilearchive.h:38
void cf_init_lowlevel_read_code(CFILE *cfile, int lib_offset, int size, int pos)
Definition: cfile.h:28
size_t max_read_len
Definition: cfilearchive.h:41
GLsizeiptr size
Definition: Glext.h:5496
void * data
Definition: cfilearchive.h:29
size_t data_length
Definition: cfilearchive.h:35
Definition: cfile.h:354
struct Cfile_block Cfile_block
const char * source_file
Definition: cfilearchive.h:43
hull_check pos
Definition: lua.cpp:5050
Cfile_block Cfile_block_list[MAX_CFILE_BLOCKS]
Definition: cfile.cpp:99
void * HANDLE
Definition: config.h:106