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