]> 4ch.mooo.com Git - 16.git/blob - 16/v2/source/ENGINE/VFILE.H
cleaned up the repo from debugging watcom2 ^^
[16.git] / 16 / v2 / source / ENGINE / VFILE.H
1 /*\r
2 Copyright (C) 1998 BJ Eirich (aka vecna)\r
3 This program is free software; you can redistribute it and/or\r
4 modify it under the terms of the GNU General Public License\r
5 as published by the Free Software Foundation; either version 2\r
6 of the License, or (at your option) any later version.\r
7 This program is distributed in the hope that it will be useful,\r
8 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r
10 See the GNU General Public Lic\r
11 See the GNU General Public License for more details.\r
12 You should have received a copy of the GNU General Public License\r
13 along with this program; if not, write to the Free Software\r
14 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
15 */\r
16 \r
17 #ifndef VFILE_H\r
18 #define VFILE_H\r
19 \r
20 #define vscanf _vscanf\r
21 \r
22 typedef struct\r
23 {\r
24   FILE *fp;                           // real file pointer.\r
25   byte s;                             // 0=real file 1=vfile;\r
26   byte v;                             // if vfile, which vfile index\r
27   byte i;                             // which file index in vfile is it?\r
28   byte p;                             // data alignment pad. :)\r
29 } VFILE;\r
30 \r
31 struct filestruct\r
32 {\r
33   unsigned char fname[84];            // pathname thingo\r
34   int size;                           // size of the file\r
35   int packofs;                        // where the file can be found in PACK\r
36   int curofs;                         // current file offset.\r
37   char extractable;                   // irrelevant to runtime, but...\r
38   char override;                      // should we override?\r
39 };\r
40 \r
41 struct mountstruct\r
42 {\r
43   char mountname[80];                 // name of VRG packfile.\r
44   FILE *vhandle;                      // Real file-handle of packfile.\r
45   struct filestruct *files;           // File record array.\r
46   int numfiles;                       // number of files in pack.\r
47   int curofs;                         // Current filepointer.\r
48 };\r
49 \r
50 extern struct mountstruct pack[3];\r
51 extern char filesmounted;\r
52 \r
53 int Exist(char *fname);\r
54 VFILE *vopen(char *fname);\r
55 void MountVFile(char *fname);\r
56 void vread(void *dest, int len, VFILE *f);\r
57 void vclose(VFILE *f);\r
58 int filesize(VFILE *f);\r
59 int vtell(VFILE *f);\r
60 void vseek(VFILE *f, int offset, int origin);\r
61 void vscanf(VFILE *f, char *format, char *dest);\r
62 char vgetc(VFILE *f);\r
63 word vgetw(VFILE *f);\r
64 void vgets(char *str, int len, VFILE *f);\r
65 #endif\r