]> icculus.org git repositories - taylor/freespace2.git/blob - include/cfile.h
rendering functions mostly done; more complete shader setup
[taylor/freespace2.git] / include / cfile.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/cfile.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * <insert description of file here>
16  *
17  * $Log$
18  * Revision 1.4  2004/07/04 11:26:21  taylor
19  * cleanup CFILE code a little, warning fixes, remove redundant dir checks
20  *
21  * Revision 1.3  2003/02/20 17:41:07  theoddone33
22  * Userdir patch from Taylor Richards
23  *
24  * Revision 1.2  2002/06/09 04:41:12  relnev
25  * added copyright header
26  *
27  * Revision 1.1.1.1  2002/05/03 03:28:11  root
28  * Initial import.
29  *
30  * 
31  * 11    9/08/99 12:03a Dave
32  * Make squad logos render properly in D3D all the time. Added intel anim
33  * directory.
34  * 
35  * 10    8/31/99 9:46a Dave
36  * Support for new cfile cbanims directory.
37  * 
38  * 9     5/19/99 4:07p Dave
39  * Moved versioning code into a nice isolated common place. Fixed up
40  * updating code on the pxo screen. Fixed several stub problems.
41  * 
42  * 8     3/28/99 5:58p Dave
43  * Added early demo code. Make objects move. Nice and framerate
44  * independant, but not much else. Don't use yet unless you're me :)
45  * 
46  * 7     3/24/99 4:05p Dave
47  * Put in support for assigning the player to a specific squadron with a
48  * specific logo. Preliminary work for doing pos/orient checksumming in
49  * multiplayer to reduce bandwidth.
50  * 
51  * 6     1/12/99 3:15a Dave
52  * Barracks screen support for selecting squad logos. We need real artwork
53  * :)
54  * 
55  * 5     10/29/98 10:41a Dave
56  * Change the way cfile initializes exe directory.
57  * 
58  * 4     10/13/98 9:19a Andsager
59  * Add localization support to cfile.  Optional parameter with cfopen that
60  * looks for localized files.
61  * 
62  * 3     10/12/98 9:54a Dave
63  * Fixed a few file organization things.
64  * 
65  * 2     10/07/98 10:52a Dave
66  * Initial checkin.
67  * 
68  * 1     10/07/98 10:48a Dave
69  * 
70  * 84    9/09/98 5:53p Dave
71  * Put in new tracker packets in API. Change cfile to be able to checksum
72  * portions of a file.
73  * 
74  * 83    8/12/98 4:53p Dave
75  * Put in 32 bit checksumming for PXO missions. No validation on the
76  * actual tracker yet, though.
77  * 
78  * 82    5/19/98 1:19p Allender
79  * new low level reliable socket reading code.  Make all missions/campaign
80  * load/save to data missions folder (i.e. we are rid of the player
81  * missions folder)
82  * 
83  * 81    5/13/98 10:22p John
84  * Added cfile functions to read/write rle compressed blocks of data.
85  * Made palman use it for .clr files.  Made alphacolors calculate on the
86  * fly rather than caching to/from disk.
87  * 
88  * 80    5/01/98 10:21a John
89  * Added code to find all pack files in all trees.   Added code to create
90  * any directories that we write to.
91  * 
92  * 79    4/30/98 10:29p John
93  * Added code to refresh filelist if cd-rom changed or packfiles created
94  * or deleted.
95  * 
96  * 78    4/30/98 10:06p John
97  * Started adding code for splitting the maps data tree for hardware
98  * textures.
99  * 
100  * 77    4/30/98 9:43p John
101  * Restructured some stuff.
102  * 
103  * 76    4/30/98 8:23p John
104  * Fixed some bugs with Fred caused by my new cfile code.
105  * 
106  * 75    4/30/98 4:53p John
107  * Restructured and cleaned up cfile code.  Added capability to read off
108  * of CD-ROM drive and out of multiple pack files.
109  * 
110  * 74    4/20/98 6:04p Dave
111  * Implement multidata cache flushing and xferring mission files to
112  * multidata. Make sure observers can't change hud config. Fix pilot image
113  * viewing in popup. Put in game status field. Tweaked multi options. 
114  * 
115  * 73    4/01/98 6:06p Hoffoss
116  * Added a command briefing directory for those voice files.
117  * 
118  * 72    3/31/98 4:51p Dave
119  * Removed medals screen and multiplayer buttons from demo version. Put in
120  * new pilot popup screen. Make ships in mp team vs. team have proper team
121  * ids. Make mp respawns a permanent option saved in the player file.
122  * 
123  * 71    3/26/98 6:01p Dave
124  * Put in file checksumming routine in cfile. Made pilot pic xferring more
125  * robust. Cut header size of voice data packets in half. Put in
126  * restricted game host query system.
127  * 
128  * 70    3/10/98 2:27p Hoffoss
129  * Added change directory with history stack functions, so you can switch
130  * to a new directory, do something, and restore to what it was.  useful
131  * for Fred.
132  * 
133  * 69    3/07/98 3:48p Lawrance
134  * get save game working, allow restore from main menu
135  * 
136  * 68    2/26/98 10:07p Hoffoss
137  * Rewrote state saving and restoring to fix bugs and simplify the code.
138  * 
139  * 67    2/20/98 4:43p Dave
140  * Finished support for multiplayer player data files. Split off
141  * multiplayer campaign functionality.
142  * 
143  * 66    2/19/98 6:26p Dave
144  * Fixed a few file xfer bugs. Tweaked mp team select screen. Put in
145  * initial support for player data uploading.
146  * 
147  * 65    2/06/98 3:47p Allender
148  * subtitling for movies
149  * 
150  * 64    2/05/98 10:15p Lawrance
151  * Add support for .svg filenames.
152  * 
153  * 63    1/12/98 10:07p Hoffoss
154  * Made tab cycle properly in debriefing screen and put in aux. pilot
155  * image directory.
156  * 
157  * 62    1/11/98 2:45p John
158  * Changed .lst to .clt
159  * 
160  * 61    1/11/98 2:14p John
161  * Changed a lot of stuff that had to do with bitmap loading.   Made cfile
162  * not do callbacks, I put that in global code.   Made only bitmaps that
163  * need to load for a level load.
164  * 
165  * 60    1/02/98 4:41p Allender
166  * added new mission folder for "player" missions
167  * 
168  * 59    12/28/97 12:42p John
169  * Put in support for reading archive files; Made missionload use the
170  * cf_get_file_list function.   Moved demos directory out of data tree.
171  * 
172  * 58    12/17/97 10:16p Allender
173  * implemented a "no callback" flag to tell the cfile code not to use the
174  * cf_callback on files which specify this flag
175  * 
176  * 57    12/08/97 6:23p Lawrance
177  * add cflush()
178  * 
179  * 56    12/07/97 4:30p John
180  * Fixed bug with cfile versioning if two files use it at once.   Added
181  * code to cfile so I could display a loading box while loading.
182  * 
183  * 55    11/24/97 9:28a Hoffoss
184  * Moved define of CF_TYPE_MULTI_PLAYERS so it's in order.  I started to
185  * add it because I couldn't find it, so that's indication enough it
186  * needed it.
187  * 
188  * 54    11/20/97 1:07a Lawrance
189  * add support for voice/debriefings directory
190  * 
191  * 53    11/19/97 7:27p Hoffoss
192  * Added version checking read functions.
193  * 
194  * 52    11/18/97 10:53a Hoffoss
195  * 
196  * 51    11/17/97 6:07p Hoffoss
197  * Make get_file_list() allow filtering via a callback function.
198  * 
199  * 50    11/16/97 2:29p John
200  * added versioning to nebulas; put nebula code into freespace.
201  * 
202  * 49    11/15/97 6:10p Lawrance
203  * add in support for new voice directories
204  * 
205  * 48    11/11/97 4:54p Dave
206  * Put in support for single vs. multiplayer pilots. Put in initial player
207  * selection screen (no command line option yet). Started work on
208  * multiplayer campaign file save gaming.
209  * 
210  * 47    11/07/97 4:00p Hoffoss
211  * Capitalized directory names, changed the player/image directory to work
212  * like the rest, and forced the player/images directory to be created.
213  * 
214  * 46    11/06/97 5:38p Hoffoss
215  * Added a new player image directory and added support for it.
216  * 
217  * 45    11/04/97 7:46p Lawrance
218  * Add support for data\interface\HUD directory
219  * 
220  * 44    10/29/97 6:22p Hoffoss
221  * Added some new file listing functions.
222  * 
223  * 43    10/28/97 10:54a Lawrance
224  * support for 8b22k and 16b11k directories under the sound directory
225  * 
226  * 42    10/14/97 11:34p Lawrance
227  * add function to get full path for a given filename
228  * 
229  * 41    9/24/97 5:30p Lawrance
230  * add directory for voices
231  * 
232  * 40    9/20/97 8:16a John
233  * Made .clr files go into the Cache directory. Replaced cfopen(name,NULL)
234  * to delete a file with cf_delete.
235  * 
236  * 39    9/09/97 6:50p Hoffoss
237  * Fixed bug with mission saving.
238  * 
239  * 38    9/05/97 4:52p Lawrance
240  * fix prototype for cfread_angles() and cfwrite_angles()
241  * 
242  * 37    8/29/97 4:47p Dave
243  * Added an extension for state transfer status files.
244  * 
245  * 36    8/21/97 12:14p Dave
246  * Changed demo file extension from .keg to .fsd
247  * 
248  * 35    8/19/97 5:51p Hoffoss
249  * Fixes to cfopen to not check the default directory first, but check it
250  * last.  Also tracks info as to where a file is located when opened.
251  * 
252  * 34    8/17/97 10:22p Hoffoss
253  * Fixed several bugs in Fred with Undo feature.  In the process, recoded
254  * a lot of CFile.cpp.
255  * 
256  * 33    8/17/97 12:47p Hoffoss
257  * Changed code so I can force missions to load from the missions
258  * directory regardless of it's extension.
259  * 
260  * 32    8/13/97 1:39p Adam
261  * make .ani files available in the data/effects directory
262  * 
263  * 31    8/13/97 12:24p Lawrance
264  * Add support for effects directory
265  * 
266  * 30    7/30/97 5:23p Dave
267  * Added file extensions for demo stuff
268  * 
269  * 29    7/28/97 10:42p Lawrance
270  * added ctmpfile(), analog to tmpfile()
271  * 
272  * 28    7/16/97 5:29p John
273  * added palette table caching and made scaler and liner no light tmapper
274  * do alpha blending in 8 bpp mode.
275  * 
276  * 27    6/05/97 4:53p John
277  * First rev of new antialiased font stuff.
278  * 
279  * 26    6/05/97 1:22p Allender
280  * added .ntl as an extension for nettest program
281  * 
282  * 25    4/25/97 11:31a Allender
283  * Campaign state now saved in campaign save file in player directory.
284  * Made some global variables follow naming convention.  Solidified
285  * continuing campaigns based on new structure
286  * 
287  * 24    4/17/97 9:01p Allender
288  * start of campaign stuff.  Campaigns now stored in external file (no
289  * filenames in code).  Continuing campaign won't work at this point
290  * 
291  * 23    4/03/97 4:26p Lawrance
292  * adding .wav search to music directory
293  * 
294  * 22    4/01/97 9:26a Allender
295  * added support for descent style fonts although they are not used in the
296  * game yet
297  * 
298  * 21    3/04/97 8:17a John
299  * Fixed movie code to not require a file handle.  Used CFILE instead.
300  * Took cfile_get_handle or whatever out.
301  * 
302  * 20    3/03/97 8:57a Lawrance
303  * took out cf_returnfp()
304  * 
305  * 19    3/01/97 2:09p Lawrance
306  * supporting memory mapped files, moved cfile implementation details into
307  * .cpp file
308  * 
309  * 18    2/17/97 3:00p Lawrance
310  * added .ani type to MAPS_EXT and INTERFACE_EXT
311  * 
312  * 17    2/07/97 9:00a Lawrance
313  * added cfread_uint() and cwrite_uint()
314  * 
315  * 16    2/04/97 9:29a Allender
316  * added cfwrite* functions
317  * 
318  * 15    1/22/97 10:48a Lawrance
319  * supporting AVI playback
320  * 
321  * 14    12/23/96 10:56a John
322  * Totally restructured the POF stuff to support multiple 
323  * detail levels in one POF file.
324  *  
325  * 
326  * 13    11/20/96 10:00a Hoffoss
327  * Added cfile_chdir() function.
328  * 
329  * 12    11/13/96 10:14a Allender
330  * added small routines to read basic data types.  Also changed code to
331  * try to find extensions in more than 1 directory.
332  * 
333  * 11    11/11/96 3:21p Allender
334  * added extension for movies
335  *
336  * $NoKeywords: $
337  */
338
339 #ifndef __CFILE_H__
340 #define __CFILE_H__
341
342 #include <time.h>
343 #include "pstypes.h"
344
345
346 #define CF_EOF (-1)
347
348 #define CF_SEEK_SET (0)
349 #define CF_SEEK_CUR (1)
350 #define CF_SEEK_END (2)
351
352 typedef struct CFILE {
353         int             id;                     // Index into cfile.cpp specific structure
354         int             version;                // version of this file
355 } CFILE;
356
357 // extra info that can be returned when getting a file listing
358 typedef struct {
359         time_t write_time;
360 } file_list_info;
361
362
363 #define CF_MAX_FILENAME_LENGTH  32              // Includes null terminater, so real length is 31
364 #define CF_MAX_PATHNAME_LENGTH  256     // Includes null terminater, so real length is 255
365
366 #define CF_TYPE_ANY                                             -1              // Used to check in any directory
367
368 #define CF_TYPE_INVALID                                 0
369 #define CF_TYPE_ROOT                                            1                       // Root must be 1!!
370 #define CF_TYPE_DATA                                            2
371 #define CF_TYPE_MAPS                                            3
372 #define CF_TYPE_TEXT                                            4
373 #define CF_TYPE_MISSIONS                                5
374 #define CF_TYPE_MODELS                                  6
375 #define CF_TYPE_TABLES                                  7
376 #define CF_TYPE_SOUNDS                                  8
377 #define CF_TYPE_SOUNDS_8B22K                    9
378 #define CF_TYPE_SOUNDS_16B11K                   10
379 #define CF_TYPE_VOICE                                   11
380 #define CF_TYPE_VOICE_BRIEFINGS         12
381 #define CF_TYPE_VOICE_CMD_BRIEF         13
382 #define CF_TYPE_VOICE_DEBRIEFINGS       14
383 #define CF_TYPE_VOICE_PERSONAS          15
384 #define CF_TYPE_VOICE_SPECIAL                   16
385 #define CF_TYPE_VOICE_TRAINING          17
386 #define CF_TYPE_MUSIC                                   18
387 #define CF_TYPE_MOVIES                                  19
388 #define CF_TYPE_INTERFACE                               20
389 #define CF_TYPE_FONT                                            21
390 #define CF_TYPE_EFFECTS                                 22
391 #define CF_TYPE_HUD                                             23
392 #define CF_TYPE_PLAYER_MAIN                     24
393 #define CF_TYPE_PLAYER_IMAGES_MAIN      25
394 #define CF_TYPE_CACHE                                   26
395 #define CF_TYPE_PLAYERS                                 27
396 #define CF_TYPE_SINGLE_PLAYERS          28
397 #define CF_TYPE_MULTI_PLAYERS                   29
398 #define CF_TYPE_MULTI_CACHE                     30
399 #define CF_TYPE_CONFIG                                  31
400 #define CF_TYPE_SQUAD_IMAGES_MAIN       32
401 #define CF_TYPE_DEMOS                                   33
402 #define CF_TYPE_CBANIMS                                 34
403 #define CF_TYPE_INTEL_ANIMS                     35
404
405 #define CF_MAX_PATH_TYPES                               36                      // Can be as high as you'd like
406
407 // TRUE if type is specified and valid
408 #define CF_TYPE_SPECIFIED(path_type) (((path_type)>CF_TYPE_INVALID) && ((path_type)<CF_MAX_PATH_TYPES))
409
410 // #define's for the type parameter in cfopen.  
411 #define CFILE_NORMAL                            0                       // open file normally
412
413 #define CF_SORT_NONE    0
414 #define CF_SORT_NAME 1
415 #define CF_SORT_TIME 2
416
417 #define cfread_fix(file) (fix)cfread_int(file)
418 #define cfwrite_fix(i,file) cfwrite_int(i,file)
419
420 // callback function used for get_file_list() to filter files to be added to list.  Return 1
421 // to add file to list, or 0 to not add it.
422 extern int (*Get_file_list_filter)(const char *filename);
423
424 // cfile directory. valid after cfile_init() returns successfully
425 #define CFILE_ROOT_DIRECTORY_LEN                        256
426 extern char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN];
427 extern char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN];
428
429 //================= LOW-LEVEL FUNCTIONS ==================
430 // Call this once at the beginning of the program
431 int cfile_init();
432
433 // add an extension to a filename if it doesn't already have it
434 char *cf_add_ext(const char *filename, const char *ext);
435
436 // return CF_TYPE (directory location type) of a CFILE you called cfopen() successfully on.
437 int cf_get_dir_type(CFILE *cfile);
438
439 // Opens the file.  If no path is given, use the extension to look into the
440 // default path.  If mode is NULL, delete the file.  
441 CFILE *cfopen(const char *filename, const char *mode, int type = CFILE_NORMAL, int dir_type = CF_TYPE_ANY, bool localize = false);
442
443 // Flush the open file buffer
444 int cflush(CFILE *cfile);
445
446 // version number of opened file.  Will be 0 unless you put something else here after you
447 // open a file.  Once set, you can use minimum version numbers with the read functions.
448 void cf_set_version( CFILE * cfile, int version );
449
450 // Deletes a file.
451 void cf_delete( const char *filename, int dir_type );
452
453 // Same as _access function to read a file's access bits
454 int cf_access( const char *filename, int dir_type, int mode );
455
456 // Returns 1 if file exists, 0 if not.
457 int cf_exist( const char *filename, int dir_type );
458
459 // ctmpfile() opens a temporary file stream.  File is deleted automatically when closed
460 CFILE *ctmpfile();
461
462 // Closes the file
463 int cfclose(CFILE *cfile);
464
465 // Returns size of file...
466 int cfilelength(CFILE *fp);
467
468 // Reads data
469 int cfread(void *buf, int elsize, int nelem, CFILE *fp);
470
471 // cfwrite() writes to the file
472 int cfwrite(const void *buf, int elsize, int nelem, CFILE *cfile);
473
474 // Reads/writes RLE compressed data.
475 int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile);
476 int cfwrite_compressed(void *param_buf, int param_elsize, int param_nelem, CFILE *cfile);
477
478 // Moves the file pointer
479 int cfseek(CFILE *fp, int offset, int where);
480
481 // Returns current position of file.
482 int cftell(CFILE *fp);
483
484 // cfputc() writes a character to a file
485 int cfputc(int c, CFILE *cfile);
486
487 // cfputs() writes a string to a file
488 int cfputs(const char *str, CFILE *cfile);
489
490 // cfgetc() reads a character to a file
491 int cfgetc(CFILE *cfile);
492
493 // cfgets() reads a string from a file
494 char *cfgets(char *buf, int n, CFILE *cfile);
495
496 // cfeof() Tests for end-of-file on a stream
497 int cfeof(CFILE *cfile);
498
499 // get the 2 byte checksum of the passed filename - return 0 if operation failed, 1 if succeeded
500 int cf_chksum_short(const char *filename, ushort *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
501
502 // get the 2 byte checksum of the passed file - return 0 if operation failed, 1 if succeeded
503 // NOTE : preserves current file position
504 int cf_chksum_short(CFILE *file, ushort *chksum, int max_size = -1);
505
506 // get the 32 bit CRC checksum of the passed filename - return 0 if operation failed, 1 if succeeded
507 int cf_chksum_long(const char *filename, uint *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
508
509 // get the 32 bit CRC checksum of the passed file - return 0 if operation failed, 1 if succeeded
510 // NOTE : preserves current file position
511 int cf_chksum_long(CFILE *file, uint *chksum, int max_size = -1);
512
513 // convenient for misc checksumming purposes ------------------------------------------
514
515 // update cur_chksum with the chksum of the new_data of size new_data_size
516 ushort cf_add_chksum_short(ushort seed, const char *buffer, int size);
517
518 // update cur_chksum with the chksum of the new_data of size new_data_size
519 uint cf_add_chksum_long(uint seed, const char *buffer, int size);
520
521 // convenient for misc checksumming purposes ------------------------------------------
522
523 //================= HIGH LEVEL FUNCTIONS ==================
524 int cfexist(const char *filename);      // Returns true if file exists on disk (1) or in hog (2).
525
526 // rename a file, utilizing the extension to determine where file is.
527 #define CF_RENAME_SUCCESS                               0                                       // successfully renamed the file
528 #define CF_RENAME_FAIL_ACCESS                   1                                       // new name could not be created
529 #define CF_RENAME_FAIL_EXIST                    2                                       // old name does not exist
530 int cf_rename(const char *old_name, const char *name, int type = CF_TYPE_ANY );
531
532 // flush (delete all files in) the passed directory (by type), return the # of files deleted
533 // NOTE : WILL NOT DELETE READ-ONLY FILES
534 int cfile_flush_dir(int type);
535
536 // functions for reading from cfile
537 // These are all high level, built up from
538 // cfread.
539 char cfread_char(CFILE *file, int ver = 0, char deflt = 0);
540 ubyte cfread_ubyte(CFILE *file, int ver = 0, ubyte deflt = 0);
541 short cfread_short(CFILE *file, int ver = 0, short deflt = 0);
542 ushort cfread_ushort(CFILE *file, int ver = 0, ushort deflt = 0);
543 int cfread_int(CFILE *file, int ver = 0, int deflt = 0);
544 uint cfread_uint(CFILE *file, int ver = 0, uint deflt = 0);
545 float cfread_float(CFILE *file, int ver = 0, float deflt = 0.0f);
546 void cfread_vector(vector *vec, CFILE *file, int ver = 0, vector *deflt = NULL);
547 void cfread_angles(angles *ang, CFILE *file, int ver = 0, angles *deflt = NULL);
548
549 // Reads variable length, null-termined string.   Will only read up
550 // to n characters.
551 void cfread_string(char *buf, int n, CFILE *file);
552 // Read a fixed length that is null-terminatedm, and has the length
553 // stored in file
554 void cfread_string_len(char *buf, int n, CFILE *file);
555
556 // functions for writing cfiles
557 int cfwrite_char(char c, CFILE *file);
558 int cfwrite_float(float f, CFILE *file);
559 int cfwrite_int(int i, CFILE *file);
560 int cfwrite_uint(uint i, CFILE *file);
561 int cfwrite_short(short s, CFILE *file);
562 int cfwrite_ushort(ushort s, CFILE *file);
563 int cfwrite_ubyte(ubyte u, CFILE *file);
564 int cfwrite_vector(vector *vec, CFILE *file);
565 int cfwrite_angles(angles *ang, CFILE *file);
566
567 // writes variable length, null-termined string.
568 int cfwrite_string(const char *buf, CFILE *file);
569
570 // write a fixed length that is null-terminatedm, and has the length
571 // stored in file
572 int cfwrite_string_len(const char *buf, CFILE *file);
573
574 int cf_get_file_list( int max, char **list, int type, const char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
575 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 );
576 void cf_sort_filenames( int n, char **list, int sort, file_list_info *info = NULL );
577
578 // Searches for a file.   Follows all rules and precedence and searches
579 // CD's and pack files.
580 // Input:  filespace   - Filename & extension
581 //         pathtype    - See CF_TYPE_ defines in CFILE.H
582 // Output: pack_filename - Absolute path and filename of this file.   Could be a packfile or the actual file.
583 //         size        - File size
584 //         offset      - Offset into pack file.  0 if not a packfile.
585 // Returns: If not found returns 0.
586 int cf_find_file_location( const char *filespec, int pathtype, char *pack_filename, int *size, int *offset, bool localize = false);
587
588 // initializes Cfile_root_dir[] and Cfile_user_dir[]
589 int cfile_init_paths();
590
591 // Creates the directory path if it doesn't exist. Even creates all its
592 // parent paths.
593 void cf_create_directory( int dir_type );
594
595 #endif  /* __CFILE_H__ */
596