1 /* $Id: cfile.h,v 1.8 2003-04-12 00:11:46 btb Exp $ */
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
17 * Prototypes for compressed file functions...
20 * Revision 1.1 1995/03/30 10:25:08 allender
24 * -- PC RCS Information ---
25 * Revision 1.10 1995/03/13 15:16:47 john
26 * Added alternate directory stuff.
28 * Revision 1.9 1995/02/01 20:56:40 john
29 * Added cfexist function
31 * Revision 1.8 1995/01/21 17:53:41 john
32 * Added alternate pig file thing.
34 * Revision 1.7 1994/12/12 13:19:47 john
35 * Made cfile work with fiellentth.
37 * Revision 1.6 1994/12/08 19:02:52 john
40 * Revision 1.5 1994/12/07 21:34:07 john
41 * Stripped out compression stuff...
43 * Revision 1.4 1994/07/13 00:16:53 matt
46 * Revision 1.3 1994/02/17 17:36:19 john
47 * Added CF_READ_MODE and CF_WRITE_MODE constants.
49 * Revision 1.2 1994/02/15 12:52:08 john
50 * Crappy inbetween version
52 * Revision 1.1 1994/02/15 10:54:23 john
55 * Revision 1.1 1994/02/10 15:50:54 john
69 typedef struct CFILE {
76 //Specify the name of the hogfile. Returns 1 if hogfile found & had files
77 int cfile_init(char *hogname);
79 int cfile_size(char *hogname);
81 CFILE * cfopen(char * filename, char * mode);
82 int cfilelength( CFILE *fp ); // Returns actual size of file...
83 size_t cfread( void * buf, size_t elsize, size_t nelem, CFILE * fp );
84 void cfclose( CFILE * cfile );
85 int cfgetc( CFILE * fp );
86 int cfseek( CFILE *fp, long int offset, int where );
87 int cftell( CFILE * fp );
88 char * cfgets( char * buf, size_t n, CFILE * fp );
90 int cfexist( char * filename ); // Returns true if file exists on disk (1) or in hog (2).
92 // Allows files to be gotten from an alternate hog file.
93 // Passing NULL disables this.
94 // Returns 1 if hogfile found (& contains file), else 0.
95 // If NULL passed, returns 1
96 int cfile_use_alternate_hogfile( char * name );
98 // Allows files to be gotten from the Descent 1 hog file.
99 // Passing NULL disables this.
100 // Returns 1 if hogfile found (& contains file), else 0.
101 // If NULL passed, returns 1
102 int cfile_use_descent1_hogfile(char * name);
104 // All cfile functions will check this directory if no file exists
105 // in the current directory.
106 void cfile_use_alternate_hogdir( char * path );
108 //tell cfile about your critical error counter
109 void cfile_set_critical_error_counter_ptr(int *ptr);
111 // prototypes for reading basic types from cfile
112 int cfile_read_int(CFILE *file);
113 short cfile_read_short(CFILE *file);
114 byte cfile_read_byte(CFILE *file);
115 fix cfile_read_fix(CFILE *file);
116 fixang cfile_read_fixang(CFILE *file);
117 void cfile_read_vector(vms_vector *v, CFILE *file);
118 void cfile_read_angvec(vms_angvec *v, CFILE *file);
119 void cfile_read_matrix(vms_matrix *v, CFILE *file);
121 extern char AltHogDir[];
122 extern char AltHogdir_initialized;