FS2_Open
Open source remastering of the Freespace 2 engine
cfile.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 __CFILE_H__
13 #define __CFILE_H__
14 
15 
16 #include <time.h>
17 #include "globalincs/pstypes.h"
18 
19 #include <stdexcept>
20 
21 
22 #define CF_EOF (-1)
23 
24 #define CF_SEEK_SET (0)
25 #define CF_SEEK_CUR (1)
26 #define CF_SEEK_END (2)
27 
28 typedef struct CFILE {
29  int id; // Index into cfile.cpp specific structure
30  int version; // version of this file
31 } CFILE;
32 
33 // extra info that can be returned when getting a file listing
34 typedef struct {
35  time_t write_time;
37 
38 
39 #define CF_MAX_FILENAME_LENGTH 32 // Includes null terminater, so real length is 31
40 #define CF_MAX_PATHNAME_LENGTH 256 // Includes null terminater, so real length is 255
41 
42 #define CF_TYPE_ANY -1 // Used to check in any directory
43 
44 #define CF_TYPE_INVALID 0
45 #define CF_TYPE_ROOT 1 // Root must be 1!!
46 #define CF_TYPE_DATA 2
47 #define CF_TYPE_MAPS 3
48 #define CF_TYPE_TEXT 4
49 #define CF_TYPE_MODELS 5
50 #define CF_TYPE_TABLES 6
51 #define CF_TYPE_SOUNDS 7
52 #define CF_TYPE_SOUNDS_8B22K 8
53 #define CF_TYPE_SOUNDS_16B11K 9
54 #define CF_TYPE_VOICE 10
55 #define CF_TYPE_VOICE_BRIEFINGS 11
56 #define CF_TYPE_VOICE_CMD_BRIEF 12
57 #define CF_TYPE_VOICE_DEBRIEFINGS 13
58 #define CF_TYPE_VOICE_PERSONAS 14
59 #define CF_TYPE_VOICE_SPECIAL 15
60 #define CF_TYPE_VOICE_TRAINING 16
61 #define CF_TYPE_MUSIC 17
62 #define CF_TYPE_MOVIES 18
63 #define CF_TYPE_INTERFACE 19
64 #define CF_TYPE_FONT 20
65 #define CF_TYPE_EFFECTS 21
66 #define CF_TYPE_HUD 22
67 #define CF_TYPE_PLAYERS 23
68 #define CF_TYPE_PLAYER_IMAGES 24
69 #define CF_TYPE_SQUAD_IMAGES 25
70 #define CF_TYPE_SINGLE_PLAYERS 26
71 #define CF_TYPE_MULTI_PLAYERS 27
72 #define CF_TYPE_CACHE 28
73 #define CF_TYPE_MULTI_CACHE 29
74 #define CF_TYPE_MISSIONS 30
75 #define CF_TYPE_CONFIG 31
76 #define CF_TYPE_DEMOS 32
77 #define CF_TYPE_CBANIMS 33
78 #define CF_TYPE_INTEL_ANIMS 34
79 #define CF_TYPE_SCRIPTS 35
80 #define CF_TYPE_FICTION 36
81 
82 #define CF_MAX_PATH_TYPES 37 // Can be as high as you'd like //DTP; yeah but beware alot of things uses CF_MAX_PATH_TYPES
83 
84 
85 // TRUE if type is specified and valid
86 #define CF_TYPE_SPECIFIED(path_type) (((path_type)>CF_TYPE_INVALID) && ((path_type)<CF_MAX_PATH_TYPES))
87 
88 // #define's for the type parameter in cfopen.
89 #define CFILE_NORMAL 0 // open file normally
90 #define CFILE_MEMORY_MAPPED (1<<0) // open file as a memory-mapped file
91 
92 #define CF_SORT_NONE 0
93 #define CF_SORT_NAME 1
94 #define CF_SORT_TIME 2
95 #define CF_SORT_REVERSE 3
96 
97 #define cfread_fix(file) (fix)cfread_int(file)
98 #define cfwrite_fix(i,file) cfwrite_int(i,file)
99 
100 // callback function used for get_file_list() to filter files to be added to list. Return 1
101 // to add file to list, or 0 to not add it.
102 extern int (*Get_file_list_filter)(const char *filename);
103 
104 // extra check for child directory under CF_TYPE_*
105 // NOTE: if specified cf_get_file_list() will not search pack files!
106 // NOTE: specified string must not contain ':' or spaces or begin with DIR_SEPARATOR!
107 extern const char *Get_file_list_child;
108 
109 // cfile directory. valid after cfile_init() returns successfully
110 #define CFILE_ROOT_DIRECTORY_LEN 256
112 #ifdef SCP_UNIX
113 extern char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN];
114 #endif
115 
116 //================= LOW-LEVEL FUNCTIONS ==================
117 int cfile_init(const char *exe_dir, const char *cdrom_dir=NULL);
118 
119 // Call this if pack files got added or removed or the
120 // cdrom changed. This will refresh the list of filenames
121 // stored in packfiles and on the cdrom.
122 void cfile_refresh();
123 
124 // add an extension to a filename if it doesn't already have it
125 char *cf_add_ext(const char *filename, const char *ext);
126 
127 // return CF_TYPE (directory location type) of a CFILE you called cfopen() successfully on.
129 
130 // Opens the file. If no path is given, use the extension to look into the
131 // default path. If mode is NULL, delete the file.
132 CFILE *_cfopen(const char* source_file, int line, const char *filename, const char *mode,
133  int type = CFILE_NORMAL, int dir_type = CF_TYPE_ANY, bool localize = false);
134 #define cfopen(...) _cfopen(LOCATION, __VA_ARGS__) // Pass source location to the function
135 
136 // like cfopen(), but it accepts a fully qualified path only (ie, the result of a cf_find_file_location() call)
137 // NOTE: only supports reading files!!
138 CFILE *_cfopen_special(const char* source_file, int line, const char *file_path, const char *mode,
139  const int size, const int offset, int dir_type = CF_TYPE_ANY);
140 #define cfopen_special(...) _cfopen_special(LOCATION, __VA_ARGS__) // Pass source location to the function
141 
142 // Flush the open file buffer
143 int cflush(CFILE *cfile);
144 
145 // version number of opened file. Will be 0 unless you put something else here after you
146 // open a file. Once set, you can use minimum version numbers with the read functions.
147 void cf_set_version( CFILE * cfile, int version );
148 
149 // will throw an error if cfread*() functions read past this mark
150 // converted to raw offsets when used, but gets passed actual length from current position
151 // setting 'len' to zero will disable the check
152 void cf_set_max_read_len(CFILE *cfile, size_t len);
153 
154 // Deletes a file. Returns 0 on error, 1 if successful
155 int cf_delete(const char *filename, int dir_type);
156 
157 // Same as _access function to read a file's access bits
158 int cf_access(const char *filename, int dir_type, int mode);
159 
160 // Returns 1 if the file exists, 0 if not.
161 // Checks only the file system.
162 int cf_exists(const char *filename, int dir_type);
163 
164 // Goober5000
165 // Returns 1 if the file exists, 0 if not.
166 // Checks both the file system and the VPs.
167 int cf_exists_full(const char *filename, int dir_type);
168 // check num_ext worth of ext_list extensions
169 int cf_exists_full_ext(const char *filename, int dir_type, const int num_ext, const char **ext_list);
170 
171 // ctmpfile() opens a temporary file stream. File is deleted automatically when closed
172 CFILE *ctmpfile();
173 
174 // Closes the file
175 int cfclose(CFILE *cfile);
176 
177 //Checks if the given handle is valid
178 int cf_is_valid(CFILE *cfile);
179 
180 // Returns size of file...
181 int cfilelength(CFILE *fp);
182 
183 // Reads data
184 int cfread(void *buf, int elsize, int nelem, CFILE *fp);
185 
186 // cfwrite() writes to the file
187 int cfwrite(const void *buf, int elsize, int nelem, CFILE *cfile);
188 
189 // Reads/writes RLE compressed data.
190 int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile);
191 int cfwrite_compressed(void *param_buf, int param_elsize, int param_nelem, CFILE *cfile);
192 
193 // Moves the file pointer
194 int cfseek(CFILE *fp, int offset, int where);
195 
196 // Returns current position of file.
197 int cftell(CFILE *fp);
198 
199 // cfputc() writes a character to a file
200 int cfputc(int c, CFILE *cfile);
201 
202 // cfputs() writes a string to a file
203 int cfputs(const char *str, CFILE *cfile);
204 
205 // cfgetc() reads a character to a file
206 int cfgetc(CFILE *cfile);
207 
208 // cfgets() reads a string from a file
209 char *cfgets(char *buf, int n, CFILE *cfile);
210 
211 // cfeof() Tests for end-of-file on a stream
212 int cfeof(CFILE *cfile);
213 
214 // Return the data pointer associated with the CFILE structure (for memory mapped files)
215 void *cf_returndata(CFILE *cfile);
216 
217 // get the 2 byte checksum of the passed filename - return 0 if operation failed, 1 if succeeded
218 int cf_chksum_short(const char *filename, ushort *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
219 
220 // get the 2 byte checksum of the passed file - return 0 if operation failed, 1 if succeeded
221 // NOTE : preserves current file position
222 int cf_chksum_short(CFILE *file, ushort *chksum, int max_size = -1);
223 
224 // get the 32 bit CRC checksum of the passed filename - return 0 if operation failed, 1 if succeeded
225 int cf_chksum_long(const char *filename, uint *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
226 
227 // get the 32 bit CRC checksum of the passed file - return 0 if operation failed, 1 if succeeded
228 // NOTE : preserves current file position
229 int cf_chksum_long(CFILE *file, uint *chksum, int max_size = -1);
230 
231 int cf_chksum_pack(const char *filename, uint *chk_long, bool full = false);
232 
233 // convenient for misc checksumming purposes ------------------------------------------
234 
235 // update cur_chksum with the chksum of the new_data of size new_data_size
237 
238 // update cur_chksum with the chksum of the new_data of size new_data_size
240 
241 // convenient for misc checksumming purposes ------------------------------------------
242 
243 //================= HIGH LEVEL FUNCTIONS ==================
244 int cfexist(const char *filename); // Returns true if file exists on disk (1) or in hog (2).
245 
246 // rename a file, utilizing the extension to determine where file is.
247 #define CF_RENAME_SUCCESS 0 // successfully renamed the file
248 #define CF_RENAME_FAIL_ACCESS 1 // new name could not be created
249 #define CF_RENAME_FAIL_EXIST 2 // old name does not exist
250 int cf_rename(const char *old_name, const char *name, int type = CF_TYPE_ANY );
251 
252 // changes the attributes of a file
253 void cf_attrib(const char *name, int set, int clear, int type);
254 
255 // flush (delete all files in) the passed directory (by type), return the # of files deleted
256 // NOTE : WILL NOT DELETE READ-ONLY FILES
257 int cfile_flush_dir(int type);
258 
259 // functions for reading from cfile
260 // These are all high level, built up from
261 // cfread.
262 int cfgetc(CFILE *fp);
263 char *cfgets(char *buf, size_t n, CFILE *fp);
264 char cfread_char(CFILE *file, int ver = 0, char deflt = 0);
265 ubyte cfread_ubyte(CFILE *file, int ver = 0, ubyte deflt = 0);
266 short cfread_short(CFILE *file, int ver = 0, short deflt = 0);
267 ushort cfread_ushort(CFILE *file, int ver = 0, ushort deflt = 0);
268 int cfread_int(CFILE *file, int ver = 0, int deflt = 0);
269 uint cfread_uint(CFILE *file, int ver = 0, uint deflt = 0);
270 float cfread_float(CFILE *file, int ver = 0, float deflt = 0.0f);
271 void cfread_vector(vec3d *vec, CFILE *file, int ver = 0, vec3d *deflt = NULL);
272 void cfread_angles(angles *ang, CFILE *file, int ver = 0, angles *deflt = NULL);
273 
274 // Reads variable length, null-termined string. Will only read up
275 // to n characters.
276 void cfread_string(char *buf,int n, CFILE *file);
286 void cfread_string_len(char *buf,int n, CFILE *file);
287 
288 // functions for writing cfiles
289 int cfwrite_char(char c, CFILE *file);
290 int cfwrite_float(float f, CFILE *file);
291 int cfwrite_int(int i, CFILE *file);
292 int cfwrite_uint(uint i, CFILE *file);
293 int cfwrite_short(short s, CFILE *file);
294 int cfwrite_ushort(ushort s, CFILE *file);
295 int cfwrite_ubyte(ubyte u, CFILE *file);
296 int cfwrite_vector(vec3d *vec, CFILE *file);
297 int cfwrite_angles(angles *ang, CFILE *file);
298 
299 // writes variable length, null-termined string.
300 int cfwrite_string(const char *buf, CFILE *file);
301 
308 int cfwrite_string_len(const char *buf, CFILE *file);
309 
310 int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, const char *filter, int sort = CF_SORT_NONE, SCP_vector<file_list_info> *info = NULL );
311 int cf_get_file_list( int max, char **list, int type, const char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
312 int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int type, const char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
313 void cf_sort_filenames( int n, char **list, int sort, file_list_info *info = NULL );
314 void cf_sort_filenames( SCP_vector<SCP_string> &list, int sort, SCP_vector<file_list_info> *info = NULL );
315 
316 // Searches for a file. Follows all rules and precedence and searches
317 // CD's and pack files.
318 // Input: filespace - Filename & extension
319 // pathtype - See CF_TYPE_ defines in CFILE.H
320 // max_out - Maximum string size to be stuffed into pack_filename
321 // Output: pack_filename - Absolute path and filename of this file. Could be a packfile or the actual file.
322 // size - File size
323 // offset - Offset into pack file. 0 if not a packfile.
324 // Returns: If not found returns 0.
325 int cf_find_file_location( const char *filespec, int pathtype, int max_out, char *pack_filename, int *size, int *offset, bool localize = false);
326 
327 // Searches for a file. Follows all rules and precedence and searches
328 // CD's and pack files. Searches all locations in order for first filename using ext filter list.
329 // Input: filename - Filename & extension
330 // ext_num - number of extensions to look for
331 // ext_list - extension filter list
332 // pathtype - See CF_TYPE_ defines in CFILE.H
333 // max_out - Maximum string length that should be stuffed into pack_filename
334 // Output: pack_filename - Absolute path and filename of this file. Could be a packfile or the actual file.
335 // size - File size
336 // offset - Offset into pack file. 0 if not a packfile.
337 // Returns: If not found returns -1, else returns offset into ext_list.
338 // (NOTE: This function is exponentially slow, so don't use it unless truely needed!!)
339 int cf_find_file_location_ext(const char *filename, const int ext_num, const char **ext_list, int pathtype, int max_out = 0, char *pack_filename = NULL, int *size = NULL, int *offset = NULL, bool localize = false);
340 
341 // Functions to change directories
342 int cfile_chdir(const char *dir);
343 
344 #ifdef _WIN32
345 int cfile_chdrive(int DriveNum, int flag);
346 #endif
347 
348 // push current directory on a 'stack' (so we can restore it) and change the directory
349 int cfile_push_chdir(int type);
350 
351 // restore directory on top of the stack
352 int cfile_pop_dir();
353 
354 namespace cfile
355 {
356  // exceptions and other errors
357  class cfile_error : public std::exception
358  {
359  public:
360  cfile_error() : m_excuse("CFILE Exception")
361  {
362  }
363 
364  cfile_error(const std::string &excuse) : m_excuse(excuse)
365  {
366  }
367 
368  ~cfile_error() throw()
369  {
370  }
371 
372  virtual const char *what() const throw()
373  {
374  return m_excuse.c_str();
375  }
376 
377  private:
378  std::string m_excuse;
379  };
380 
382  {
383  public:
384  max_read_length(const std::string &excuse) : cfile_error(excuse)
385  {
386  }
387 
388  max_read_length() : cfile_error("Attempted to read beyond length limit")
389  {
390  }
391  };
392 
393 }
394 
395 #endif /* __CFILE_H__ */
int cfwrite_ushort(ushort s, CFILE *file)
Definition: cfile.cpp:1328
cfbp dir_type
Definition: cfile.cpp:1069
#define MAX_FILENAME_LEN
Definition: pstypes.h:324
cfile_error(const std::string &excuse)
Definition: cfile.h:364
#define CFILE_NORMAL
Definition: cfile.h:89
int i
Definition: multi_pxo.cpp:466
void cfread_string(char *buf, int n, CFILE *file)
Definition: cfile.cpp:1278
int cf_is_valid(CFILE *cfile)
Definition: cfile.cpp:935
int cfwrite_compressed(void *param_buf, int param_elsize, int param_nelem, CFILE *cfile)
Definition: cfilelist.cpp:426
int cfgetc(CFILE *cfile)
Definition: cfile.cpp:1548
ubyte cfread_ubyte(CFILE *file, int ver=0, ubyte deflt=0)
Definition: cfile.cpp:1220
ushort cf_add_chksum_short(ushort seed, ubyte *buffer, int size)
Definition: cfile.cpp:1614
int cfputc(int c, CFILE *cfile)
Definition: cfile.cpp:1460
int cfwrite_angles(angles *ang, CFILE *file)
Definition: cfile.cpp:1350
char * cfgets(char *buf, int n, CFILE *cfile)
Definition: cfile.cpp:1571
int cfile_pop_dir()
Definition: cfile.cpp:381
void cfile_refresh()
Definition: cfile.cpp:248
int cfread(void *buf, int elsize, int nelem, CFILE *fp)
int cfwrite(const void *buf, int elsize, int nelem, CFILE *cfile)
Definition: cfile.cpp:1414
void cf_attrib(const char *name, int set, int clear, int type)
int cf_chksum_long(const char *filename, uint *chksum, int max_size=-1, int cf_type=CF_TYPE_ANY)
Definition: cfile.cpp:1841
void cf_set_max_read_len(CFILE *cfile, size_t len)
Definition: cfile.cpp:1133
int cf_get_dir_type(CFILE *cfile)
Definition: cfile.cpp:1100
int cf_exists_full_ext(const char *filename, int dir_type, const int num_ext, const char **ext_list)
Definition: cfile.cpp:536
virtual const char * what() const
Definition: cfile.h:372
Definition: pstypes.h:88
int cfwrite_string_len(const char *buf, CFILE *file)
Write a fixed length string (not including its null terminator), with the length stored in file...
Definition: cfile.cpp:1378
GLclampf f
Definition: Glext.h:7097
Definition: cfile.h:28
enum_h * u
Definition: lua.cpp:12649
int cf_find_file_location_ext(const char *filename, const int ext_num, const char **ext_list, int pathtype, int max_out=0, char *pack_filename=NULL, int *size=NULL, int *offset=NULL, bool localize=false)
GLenum mode
Definition: Glext.h:5794
int cfile_flush_dir(int type)
Definition: cfile.cpp:394
GLsizeiptr size
Definition: Glext.h:5496
int cfwrite_short(short s, CFILE *file)
Definition: cfile.cpp:1322
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: Glext.h:7308
time_t write_time
Definition: cfile.h:35
int cfile_push_chdir(int type)
Push current directory onto a 'stack' and change to a new directory.
Definition: cfile.cpp:342
void cfread_string_len(char *buf, int n, CFILE *file)
Read a fixed length string that is not null-terminated, with the length stored in file...
Definition: cfile.cpp:1291
GLenum type
Definition: Gl.h:1492
int cf_get_file_list_preallocated(int max, char arr[][MAX_FILENAME_LEN], char **list, int type, const char *filter, int sort=CF_SORT_NONE, file_list_info *info=NULL)
max_read_length(const std::string &excuse)
Definition: cfile.h:384
int cf_chksum_pack(const char *filename, uint *chk_long, bool full=false)
Definition: cfile.cpp:1722
void cfread_vector(vec3d *vec, CFILE *file, int ver=0, vec3d *deflt=NULL)
Definition: cfile.cpp:1233
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
GLintptr offset
Definition: Glext.h:5497
int cf_find_file_location(const char *filespec, int pathtype, int max_out, char *pack_filename, int *size, int *offset, bool localize=false)
unsigned int uint
Definition: pstypes.h:64
int cfwrite_vector(vec3d *vec, CFILE *file)
Definition: cfile.cpp:1339
int cf_rename(const char *old_name, const char *name, int type=CF_TYPE_ANY)
Definition: cfile.cpp:567
int cf_exists(const char *filename, int dir_type)
Definition: cfile.cpp:514
void * cf_returndata(CFILE *cfile)
Definition: cfile.cpp:1110
char * filename
int cf_chksum_short(const char *filename, ushort *chksum, int max_size=-1, int cf_type=CF_TYPE_ANY)
Definition: cfile.cpp:1791
cfbp source_file
Definition: cfile.cpp:1071
uint cf_add_chksum_long(uint seed, ubyte *buffer, int size)
Definition: cfile.cpp:1632
char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN]
Definition: cfile.cpp:38
int cf_delete(const char *filename, int dir_type)
Delete the specified file.
Definition: cfile.cpp:483
GLuint buffer
Definition: Glext.h:5492
int cf_access(const char *filename, int dir_type, int mode)
Definition: cfile.cpp:497
GLdouble s
Definition: Glext.h:5321
GLsizei const GLchar ** string
Definition: Glext.h:5636
int cfwrite_float(float f, CFILE *file)
Definition: cfile.cpp:1304
int id
Definition: cfile.h:29
float cfread_float(CFILE *file, int ver=0, float deflt=0.0f)
Definition: cfile.cpp:1150
Definition: cfile.h:354
int cfilelength(CFILE *fp)
Definition: cfile.cpp:1393
cfbp fp
Definition: cfile.cpp:1065
void cf_sort_filenames(int n, char **list, int sort, file_list_info *info=NULL)
Definition: cfilelist.cpp:115
int cf_exists_full(const char *filename, int dir_type)
Definition: cfile.cpp:527
void cf_set_version(CFILE *cfile, int version)
Definition: cfile.cpp:1124
int cfwrite_uint(uint i, CFILE *file)
Definition: cfile.cpp:1316
int cfile_chdir(const char *dir)
Change to the specified directory.
Definition: cfile.cpp:372
GLclampd n
Definition: Glext.h:7286
unsigned char ubyte
Definition: pstypes.h:62
#define CF_SORT_NONE
Definition: cfile.h:92
int cfile_init(const char *exe_dir, const char *cdrom_dir=NULL)
Initialize the cfile system. Called once at application start.
Definition: cfile.cpp:183
char cfread_char(CFILE *file, int ver=0, char deflt=0)
Definition: cfile.cpp:1265
int cfeof(CFILE *cfile)
uint cfread_uint(CFILE *file, int ver=0, uint deflt=0)
Definition: cfile.cpp:1178
vec3d vec
Definition: lua.cpp:2173
short cfread_short(CFILE *file, int ver=0, short deflt=0)
Definition: cfile.cpp:1192
GLuint const GLchar * name
Definition: Glext.h:5608
int cfwrite_string(const char *buf, CFILE *file)
Definition: cfile.cpp:1366
int cftell(CFILE *fp)
int cfwrite_char(char c, CFILE *file)
Definition: cfile.cpp:1361
int cfwrite_int(int i, CFILE *file)
Definition: cfile.cpp:1310
struct CFILE CFILE
char * cf_add_ext(const char *filename, const char *ext)
Definition: cfile.cpp:458
unsigned short ushort
Definition: pstypes.h:63
CFILE * ctmpfile()
Definition: cfile.cpp:844
CFILE * _cfopen(const char *source_file, int line, const char *filename, const char *mode, int type=CFILE_NORMAL, int dir_type=CF_TYPE_ANY, bool localize=false)
Definition: cfile.cpp:647
const char * Get_file_list_child
#define CFILE_ROOT_DIRECTORY_LEN
Definition: cfile.h:110
int version
Definition: cfile.h:30
int cfexist(const char *filename)
int cfputs(const char *str, CFILE *cfile)
Definition: cfile.cpp:1504
GLenum GLsizei len
Definition: Glext.h:6283
int cfclose(CFILE *cfile)
Definition: cfile.cpp:895
int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile)
Definition: cfilelist.cpp:385
int cflush(CFILE *cfile)
Definition: cfile.cpp:1895
int cfread_int(CFILE *file, int ver=0, int deflt=0)
Definition: cfile.cpp:1164
#define CF_TYPE_ANY
Definition: cfile.h:42
CFILE * _cfopen_special(const char *source_file, int line, const char *file_path, const char *mode, const int size, const int offset, int dir_type=CF_TYPE_ANY)
Definition: cfile.cpp:802
int cfwrite_ubyte(ubyte u, CFILE *file)
Definition: cfile.cpp:1334
int cf_get_file_list(SCP_vector< SCP_string > &list, int pathtype, const char *filter, int sort=CF_SORT_NONE, SCP_vector< file_list_info > *info=NULL)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: Glext.h:6566
const GLubyte * c
Definition: Glext.h:8376
void cfread_angles(angles *ang, CFILE *file, int ver=0, angles *deflt=NULL)
Definition: cfile.cpp:1249
ushort cfread_ushort(CFILE *file, int ver=0, ushort deflt=0)
Definition: cfile.cpp:1206
int(* Get_file_list_filter)(const char *filename)
int cfseek(CFILE *fp, int offset, int where)