author | Ryan C. Gordon <icculus@icculus.org> |
Sun, 22 Aug 2010 20:20:04 -0400 | |
changeset 1111 | 20d7c2d95a98 |
parent 1109 | c69df75dbcc3 |
child 1113 | 2136d64bd1ad |
permissions | -rw-r--r-- |
609 | 1 |
/* |
2 |
* WAD support routines for PhysicsFS. |
|
3 |
* |
|
4 |
* This driver handles DOOM engine archives ("wads"). |
|
5 |
* This format (but not this driver) was designed by id Software for use |
|
6 |
* with the DOOM engine. |
|
7 |
* The specs of the format are from the unofficial doom specs v1.666 |
|
8 |
* found here: http://www.gamers.org/dhs/helpdocs/dmsp1666.html |
|
9 |
* The format of the archive: (from the specs) |
|
10 |
* |
|
11 |
* A WAD file has three parts: |
|
12 |
* (1) a twelve-byte header |
|
13 |
* (2) one or more "lumps" |
|
14 |
* (3) a directory or "info table" that contains the names, offsets, and |
|
15 |
* sizes of all the lumps in the WAD |
|
16 |
* |
|
17 |
* The header consists of three four-byte parts: |
|
18 |
* (a) an ASCII string which must be either "IWAD" or "PWAD" |
|
19 |
* (b) a 4-byte (long) integer which is the number of lumps in the wad |
|
20 |
* (c) a long integer which is the file offset to the start of |
|
21 |
* the directory |
|
22 |
* |
|
23 |
* The directory has one 16-byte entry for every lump. Each entry consists |
|
24 |
* of three parts: |
|
25 |
* |
|
26 |
* (a) a long integer, the file offset to the start of the lump |
|
27 |
* (b) a long integer, the size of the lump in bytes |
|
28 |
* (c) an 8-byte ASCII string, the name of the lump, padded with zeros. |
|
29 |
* For example, the "DEMO1" entry in hexadecimal would be |
|
30 |
* (44 45 4D 4F 31 00 00 00) |
|
31 |
* |
|
32 |
* Note that there is no way to tell if an opened WAD archive is a |
|
33 |
* IWAD or PWAD with this archiver. |
|
34 |
* I couldn't think of a way to provide that information, without being too |
|
35 |
* hacky. |
|
36 |
* I don't think it's really that important though. |
|
37 |
* |
|
38 |
* |
|
809
116b8fe30371
Renamed LICENSE to LICENSE.txt
Ryan C. Gordon <icculus@icculus.org>
parents:
808
diff
changeset
|
39 |
* Please see the file LICENSE.txt in the source's root directory. |
609 | 40 |
* |
41 |
* This file written by Travis Wells, based on the GRP archiver by |
|
42 |
* Ryan C. Gordon. |
|
43 |
*/ |
|
44 |
||
45 |
#if (defined PHYSFS_SUPPORTS_WAD) |
|
46 |
||
47 |
#include <stdio.h> |
|
48 |
#include <stdlib.h> |
|
49 |
#include <string.h> |
|
50 |
#include "physfs.h" |
|
51 |
||
52 |
#define __PHYSICSFS_INTERNAL__ |
|
53 |
#include "physfs_internal.h" |
|
54 |
||
55 |
typedef struct |
|
56 |
{ |
|
610 | 57 |
char name[18]; |
609 | 58 |
PHYSFS_uint32 startPos; |
59 |
PHYSFS_uint32 size; |
|
60 |
} WADentry; |
|
61 |
||
62 |
typedef struct |
|
63 |
{ |
|
64 |
char *filename; |
|
65 |
PHYSFS_sint64 last_mod_time; |
|
66 |
PHYSFS_uint32 entryCount; |
|
67 |
PHYSFS_uint32 entryOffset; |
|
68 |
WADentry *entries; |
|
69 |
} WADinfo; |
|
70 |
||
71 |
typedef struct |
|
72 |
{ |
|
73 |
void *handle; |
|
74 |
WADentry *entry; |
|
75 |
PHYSFS_uint32 curPos; |
|
76 |
} WADfileinfo; |
|
77 |
||
78 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
79 |
static void WAD_dirClose(dvoid *opaque) |
609 | 80 |
{ |
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
81 |
WADinfo *info = ((WADinfo *) opaque); |
691
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
82 |
allocator.Free(info->filename); |
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
83 |
allocator.Free(info->entries); |
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
84 |
allocator.Free(info); |
609 | 85 |
} /* WAD_dirClose */ |
86 |
||
87 |
||
1098
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
88 |
static PHYSFS_sint64 WAD_read(fvoid *opaque, void *buffer, PHYSFS_uint64 len) |
609 | 89 |
{ |
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
90 |
WADfileinfo *finfo = (WADfileinfo *) opaque; |
1098
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
91 |
const WADentry *entry = finfo->entry; |
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
92 |
const PHYSFS_uint64 bytesLeft = (PHYSFS_uint64)(entry->size-finfo->curPos); |
609 | 93 |
PHYSFS_sint64 rc; |
94 |
||
1098
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
95 |
if (bytesLeft < len) |
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
96 |
len = bytesLeft; |
609 | 97 |
|
1098
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
98 |
rc = __PHYSFS_platformRead(finfo->handle, buffer, len); |
609 | 99 |
if (rc > 0) |
1098
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
100 |
finfo->curPos += (PHYSFS_uint32) rc; |
609 | 101 |
|
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
102 |
return rc; |
609 | 103 |
} /* WAD_read */ |
104 |
||
105 |
||
1098
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
106 |
static PHYSFS_sint64 WAD_write(fvoid *f, const void *buf, PHYSFS_uint64 len) |
609 | 107 |
{ |
108 |
BAIL_MACRO(ERR_NOT_SUPPORTED, -1); |
|
109 |
} /* WAD_write */ |
|
110 |
||
111 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
112 |
static int WAD_eof(fvoid *opaque) |
609 | 113 |
{ |
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
114 |
WADfileinfo *finfo = (WADfileinfo *) opaque; |
609 | 115 |
WADentry *entry = finfo->entry; |
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
116 |
return (finfo->curPos >= entry->size); |
609 | 117 |
} /* WAD_eof */ |
118 |
||
119 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
120 |
static PHYSFS_sint64 WAD_tell(fvoid *opaque) |
609 | 121 |
{ |
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
122 |
return ((WADfileinfo *) opaque)->curPos; |
609 | 123 |
} /* WAD_tell */ |
124 |
||
125 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
126 |
static int WAD_seek(fvoid *opaque, PHYSFS_uint64 offset) |
609 | 127 |
{ |
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
128 |
WADfileinfo *finfo = (WADfileinfo *) opaque; |
609 | 129 |
WADentry *entry = finfo->entry; |
130 |
int rc; |
|
131 |
||
132 |
BAIL_IF_MACRO(offset < 0, ERR_INVALID_ARGUMENT, 0); |
|
133 |
BAIL_IF_MACRO(offset >= entry->size, ERR_PAST_EOF, 0); |
|
134 |
rc = __PHYSFS_platformSeek(finfo->handle, entry->startPos + offset); |
|
135 |
if (rc) |
|
136 |
finfo->curPos = (PHYSFS_uint32) offset; |
|
137 |
||
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
138 |
return rc; |
609 | 139 |
} /* WAD_seek */ |
140 |
||
141 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
142 |
static PHYSFS_sint64 WAD_fileLength(fvoid *opaque) |
609 | 143 |
{ |
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
144 |
WADfileinfo *finfo = (WADfileinfo *) opaque; |
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
145 |
return ((PHYSFS_sint64) finfo->entry->size); |
609 | 146 |
} /* WAD_fileLength */ |
147 |
||
148 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
149 |
static int WAD_fileClose(fvoid *opaque) |
609 | 150 |
{ |
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
151 |
WADfileinfo *finfo = (WADfileinfo *) opaque; |
609 | 152 |
BAIL_IF_MACRO(!__PHYSFS_platformClose(finfo->handle), NULL, 0); |
691
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
153 |
allocator.Free(finfo); |
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
154 |
return 1; |
609 | 155 |
} /* WAD_fileClose */ |
156 |
||
157 |
||
1098
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
158 |
static inline int readAll(void *fh, void *buf, const PHYSFS_uint64 len) |
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
159 |
{ |
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
160 |
return (__PHYSFS_platformRead(fh, buf, len) == len); |
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
161 |
} /* readAll */ |
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
162 |
|
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
163 |
|
609 | 164 |
static int wad_open(const char *filename, int forWriting, |
165 |
void **fh, PHYSFS_uint32 *count,PHYSFS_uint32 *offset) |
|
166 |
{ |
|
167 |
PHYSFS_uint8 buf[4]; |
|
168 |
||
169 |
*fh = NULL; |
|
170 |
BAIL_IF_MACRO(forWriting, ERR_ARC_IS_READ_ONLY, 0); |
|
171 |
||
172 |
*fh = __PHYSFS_platformOpenRead(filename); |
|
173 |
BAIL_IF_MACRO(*fh == NULL, NULL, 0); |
|
174 |
||
1098
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
175 |
if (!readAll(*fh, buf, 4)) |
609 | 176 |
goto openWad_failed; |
177 |
||
178 |
if (memcmp(buf, "IWAD", 4) != 0 && memcmp(buf, "PWAD", 4) != 0) |
|
179 |
{ |
|
180 |
__PHYSFS_setError(ERR_UNSUPPORTED_ARCHIVE); |
|
181 |
goto openWad_failed; |
|
182 |
} /* if */ |
|
183 |
||
1098
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
184 |
if (!readAll(*fh, count, sizeof (PHYSFS_uint32))) |
609 | 185 |
goto openWad_failed; |
186 |
||
187 |
*count = PHYSFS_swapULE32(*count); |
|
188 |
||
1098
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
189 |
if (!readAll(*fh, offset, sizeof (PHYSFS_uint32))) |
609 | 190 |
goto openWad_failed; |
191 |
||
192 |
*offset = PHYSFS_swapULE32(*offset); |
|
193 |
||
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
194 |
return 1; |
609 | 195 |
|
196 |
openWad_failed: |
|
197 |
if (*fh != NULL) |
|
198 |
__PHYSFS_platformClose(*fh); |
|
199 |
||
200 |
*count = -1; |
|
201 |
*fh = NULL; |
|
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
202 |
return 0; |
609 | 203 |
} /* wad_open */ |
204 |
||
205 |
||
206 |
static int WAD_isArchive(const char *filename, int forWriting) |
|
207 |
{ |
|
208 |
void *fh; |
|
209 |
PHYSFS_uint32 fileCount,offset; |
|
210 |
int retval = wad_open(filename, forWriting, &fh, &fileCount,&offset); |
|
211 |
||
212 |
if (fh != NULL) |
|
213 |
__PHYSFS_platformClose(fh); |
|
214 |
||
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
215 |
return retval; |
609 | 216 |
} /* WAD_isArchive */ |
217 |
||
218 |
||
219 |
static int wad_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two) |
|
220 |
{ |
|
928
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
221 |
if (one != two) |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
222 |
{ |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
223 |
const WADentry *a = (const WADentry *) _a; |
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
224 |
return strcmp(a[one].name, a[two].name); |
928
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
225 |
} /* if */ |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
226 |
|
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
227 |
return 0; |
609 | 228 |
} /* wad_entry_cmp */ |
229 |
||
230 |
||
231 |
static void wad_entry_swap(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two) |
|
232 |
{ |
|
928
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
233 |
if (one != two) |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
234 |
{ |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
235 |
WADentry tmp; |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
236 |
WADentry *first = &(((WADentry *) _a)[one]); |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
237 |
WADentry *second = &(((WADentry *) _a)[two]); |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
238 |
memcpy(&tmp, first, sizeof (WADentry)); |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
239 |
memcpy(first, second, sizeof (WADentry)); |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
240 |
memcpy(second, &tmp, sizeof (WADentry)); |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
241 |
} /* if */ |
609 | 242 |
} /* wad_entry_swap */ |
243 |
||
244 |
||
245 |
static int wad_load_entries(const char *name, int forWriting, WADinfo *info) |
|
246 |
{ |
|
247 |
void *fh = NULL; |
|
248 |
PHYSFS_uint32 fileCount; |
|
249 |
PHYSFS_uint32 directoryOffset; |
|
250 |
WADentry *entry; |
|
622
c8e67ca63ad6
Patches to get this building on Mac Classic again.
Ryan C. Gordon <icculus@icculus.org>
parents:
610
diff
changeset
|
251 |
char lastDirectory[9]; |
610 | 252 |
|
253 |
lastDirectory[8] = 0; /* Make sure lastDirectory stays null-terminated. */ |
|
609 | 254 |
|
255 |
BAIL_IF_MACRO(!wad_open(name, forWriting, &fh, &fileCount,&directoryOffset), NULL, 0); |
|
256 |
info->entryCount = fileCount; |
|
691
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
257 |
info->entries = (WADentry *) allocator.Malloc(sizeof(WADentry)*fileCount); |
609 | 258 |
if (info->entries == NULL) |
259 |
{ |
|
260 |
__PHYSFS_platformClose(fh); |
|
261 |
BAIL_MACRO(ERR_OUT_OF_MEMORY, 0); |
|
262 |
} /* if */ |
|
263 |
||
264 |
__PHYSFS_platformSeek(fh,directoryOffset); |
|
265 |
||
266 |
for (entry = info->entries; fileCount > 0; fileCount--, entry++) |
|
267 |
{ |
|
1098
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
268 |
if ( (!readAll(fh, &entry->startPos, sizeof (PHYSFS_uint32))) || |
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
269 |
(!readAll(fh, &entry->size, sizeof (PHYSFS_uint32))) || |
4e86cec1143f
Moved all the file i/o from stdio-style to POSIX-style.
Ryan C. Gordon <icculus@icculus.org>
parents:
1054
diff
changeset
|
270 |
(!readAll(fh, &entry->name, 8)) ) |
609 | 271 |
{ |
272 |
__PHYSFS_platformClose(fh); |
|
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
273 |
return 0; |
609 | 274 |
} /* if */ |
275 |
||
276 |
entry->name[8] = '\0'; /* name might not be null-terminated in file. */ |
|
277 |
entry->size = PHYSFS_swapULE32(entry->size); |
|
278 |
entry->startPos = PHYSFS_swapULE32(entry->startPos); |
|
279 |
} /* for */ |
|
280 |
||
281 |
__PHYSFS_platformClose(fh); |
|
282 |
||
283 |
__PHYSFS_sort(info->entries, info->entryCount, |
|
284 |
wad_entry_cmp, wad_entry_swap); |
|
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
285 |
return 1; |
609 | 286 |
} /* wad_load_entries */ |
287 |
||
288 |
||
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
289 |
static void *WAD_openArchive(const char *name, int forWriting) |
609 | 290 |
{ |
291 |
PHYSFS_sint64 modtime = __PHYSFS_platformGetLastModTime(name); |
|
691
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
292 |
WADinfo *info = (WADinfo *) allocator.Malloc(sizeof (WADinfo)); |
609 | 293 |
|
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
294 |
BAIL_IF_MACRO(info == NULL, ERR_OUT_OF_MEMORY, NULL); |
609 | 295 |
memset(info, '\0', sizeof (WADinfo)); |
296 |
||
691
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
297 |
info->filename = (char *) allocator.Malloc(strlen(name) + 1); |
678
73a2641375a0
Cleaned up some minor bloat with my new evil GOTO_*_MACRO macros.
Ryan C. Gordon <icculus@icculus.org>
parents:
658
diff
changeset
|
298 |
GOTO_IF_MACRO(!info->filename, ERR_OUT_OF_MEMORY, WAD_openArchive_failed); |
609 | 299 |
|
300 |
if (!wad_load_entries(name, forWriting, info)) |
|
301 |
goto WAD_openArchive_failed; |
|
302 |
||
303 |
strcpy(info->filename, name); |
|
304 |
info->last_mod_time = modtime; |
|
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
305 |
return info; |
609 | 306 |
|
307 |
WAD_openArchive_failed: |
|
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
308 |
if (info != NULL) |
609 | 309 |
{ |
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
310 |
if (info->filename != NULL) |
691
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
311 |
allocator.Free(info->filename); |
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
312 |
if (info->entries != NULL) |
691
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
313 |
allocator.Free(info->entries); |
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
314 |
allocator.Free(info); |
609 | 315 |
} /* if */ |
316 |
||
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
317 |
return NULL; |
609 | 318 |
} /* WAD_openArchive */ |
319 |
||
320 |
||
657
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
321 |
static void WAD_enumerateFiles(dvoid *opaque, const char *dname, |
754
e7cd7411eadf
API BREAKAGE: Changed PHYSFS_enumerateFilesCallback() to pass the originally
Ryan C. Gordon <icculus@icculus.org>
parents:
694
diff
changeset
|
322 |
int omitSymLinks, PHYSFS_EnumFilesCallback cb, |
e7cd7411eadf
API BREAKAGE: Changed PHYSFS_enumerateFilesCallback() to pass the originally
Ryan C. Gordon <icculus@icculus.org>
parents:
694
diff
changeset
|
323 |
const char *origdir, void *callbackdata) |
609 | 324 |
{ |
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
325 |
WADinfo *info = ((WADinfo *) opaque); |
609 | 326 |
WADentry *entry = info->entries; |
327 |
PHYSFS_uint32 max = info->entryCount; |
|
328 |
PHYSFS_uint32 i; |
|
657
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
329 |
const char *name; |
610 | 330 |
char *sep; |
609 | 331 |
|
657
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
332 |
if (*dname == '\0') /* root directory enumeration? */ |
610 | 333 |
{ |
334 |
for (i = 0; i < max; i++, entry++) |
|
335 |
{ |
|
657
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
336 |
name = entry->name; |
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
337 |
if (strchr(name, '/') == NULL) |
754
e7cd7411eadf
API BREAKAGE: Changed PHYSFS_enumerateFilesCallback() to pass the originally
Ryan C. Gordon <icculus@icculus.org>
parents:
694
diff
changeset
|
338 |
cb(callbackdata, origdir, name); |
610 | 339 |
} /* for */ |
340 |
} /* if */ |
|
341 |
else |
|
342 |
{ |
|
343 |
for (i = 0; i < max; i++, entry++) |
|
344 |
{ |
|
657
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
345 |
name = entry->name; |
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
346 |
sep = strchr(name, '/'); |
610 | 347 |
if (sep != NULL) |
348 |
{ |
|
657
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
349 |
if (strncmp(dname, name, (sep - name)) == 0) |
759
e4f83afe8969
Patched archivers/wad.c to compile again.
Ryan C. Gordon <icculus@icculus.org>
parents:
754
diff
changeset
|
350 |
cb(callbackdata, origdir, sep + 1); |
610 | 351 |
} /* if */ |
352 |
} /* for */ |
|
353 |
} /* else */ |
|
609 | 354 |
} /* WAD_enumerateFiles */ |
355 |
||
356 |
||
1054
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
357 |
static WADentry *wad_find_entry(const WADinfo *info, const char *name) |
609 | 358 |
{ |
359 |
WADentry *a = info->entries; |
|
360 |
PHYSFS_sint32 lo = 0; |
|
361 |
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1); |
|
362 |
PHYSFS_sint32 middle; |
|
363 |
int rc; |
|
364 |
||
365 |
while (lo <= hi) |
|
366 |
{ |
|
367 |
middle = lo + ((hi - lo) / 2); |
|
368 |
rc = strcmp(name, a[middle].name); |
|
369 |
if (rc == 0) /* found it! */ |
|
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
370 |
return &a[middle]; |
609 | 371 |
else if (rc > 0) |
372 |
lo = middle + 1; |
|
373 |
else |
|
374 |
hi = middle - 1; |
|
375 |
} /* while */ |
|
376 |
||
377 |
BAIL_MACRO(ERR_NO_SUCH_FILE, NULL); |
|
378 |
} /* wad_find_entry */ |
|
379 |
||
380 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
381 |
static int WAD_exists(dvoid *opaque, const char *name) |
609 | 382 |
{ |
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
383 |
return (wad_find_entry((WADinfo *) opaque, name) != NULL); |
609 | 384 |
} /* WAD_exists */ |
385 |
||
386 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
387 |
static int WAD_isDirectory(dvoid *opaque, const char *name, int *fileExists) |
609 | 388 |
{ |
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
389 |
WADentry *entry = wad_find_entry(((WADinfo *) opaque), name); |
610 | 390 |
if (entry != NULL) |
391 |
{ |
|
392 |
char *n; |
|
393 |
||
394 |
*fileExists = 1; |
|
395 |
||
396 |
/* Can't be a directory if it's a subdirectory. */ |
|
397 |
if (strchr(entry->name, '/') != NULL) |
|
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
398 |
return 0; |
610 | 399 |
|
400 |
/* Check if it matches "MAP??" or "E?M?" ... */ |
|
401 |
n = entry->name; |
|
402 |
if ((n[0] == 'E' && n[2] == 'M') || |
|
403 |
(n[0] == 'M' && n[1] == 'A' && n[2] == 'P' && n[6] == 0)) |
|
404 |
{ |
|
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
405 |
return 1; |
610 | 406 |
} /* if */ |
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
407 |
return 0; |
610 | 408 |
} /* if */ |
409 |
else |
|
410 |
{ |
|
411 |
*fileExists = 0; |
|
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
412 |
return 0; |
610 | 413 |
} /* else */ |
609 | 414 |
} /* WAD_isDirectory */ |
415 |
||
416 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
417 |
static int WAD_isSymLink(dvoid *opaque, const char *name, int *fileExists) |
609 | 418 |
{ |
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
419 |
*fileExists = WAD_exists(opaque, name); |
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
420 |
return 0; /* never symlinks in a wad. */ |
609 | 421 |
} /* WAD_isSymLink */ |
422 |
||
423 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
424 |
static fvoid *WAD_openRead(dvoid *opaque, const char *fnm, int *fileExists) |
609 | 425 |
{ |
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
426 |
WADinfo *info = ((WADinfo *) opaque); |
609 | 427 |
WADfileinfo *finfo; |
428 |
WADentry *entry; |
|
429 |
||
430 |
entry = wad_find_entry(info, fnm); |
|
431 |
*fileExists = (entry != NULL); |
|
432 |
BAIL_IF_MACRO(entry == NULL, NULL, NULL); |
|
433 |
||
691
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
434 |
finfo = (WADfileinfo *) allocator.Malloc(sizeof (WADfileinfo)); |
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
435 |
BAIL_IF_MACRO(finfo == NULL, ERR_OUT_OF_MEMORY, NULL); |
609 | 436 |
|
437 |
finfo->handle = __PHYSFS_platformOpenRead(info->filename); |
|
438 |
if ( (finfo->handle == NULL) || |
|
439 |
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) ) |
|
440 |
{ |
|
691
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
441 |
allocator.Free(finfo); |
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
442 |
return NULL; |
609 | 443 |
} /* if */ |
444 |
||
445 |
finfo->curPos = 0; |
|
446 |
finfo->entry = entry; |
|
1016
957c97389257
Cleaned up returns that look like function calls for my updated coding style.
Ryan C. Gordon <icculus@icculus.org>
parents:
972
diff
changeset
|
447 |
return finfo; |
609 | 448 |
} /* WAD_openRead */ |
449 |
||
450 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
451 |
static fvoid *WAD_openWrite(dvoid *opaque, const char *name) |
609 | 452 |
{ |
453 |
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL); |
|
454 |
} /* WAD_openWrite */ |
|
455 |
||
456 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
457 |
static fvoid *WAD_openAppend(dvoid *opaque, const char *name) |
609 | 458 |
{ |
459 |
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL); |
|
460 |
} /* WAD_openAppend */ |
|
461 |
||
462 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
463 |
static int WAD_remove(dvoid *opaque, const char *name) |
609 | 464 |
{ |
465 |
BAIL_MACRO(ERR_NOT_SUPPORTED, 0); |
|
466 |
} /* WAD_remove */ |
|
467 |
||
468 |
||
650
298b8bb26775
Did the same thing to FileHandles than I did to DirHandles, but this
Ryan C. Gordon <icculus@icculus.org>
parents:
648
diff
changeset
|
469 |
static int WAD_mkdir(dvoid *opaque, const char *name) |
609 | 470 |
{ |
471 |
BAIL_MACRO(ERR_NOT_SUPPORTED, 0); |
|
472 |
} /* WAD_mkdir */ |
|
473 |
||
658
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
474 |
|
1108
b63e39d5be04
Fixed details of PHYSFS_Archiver's stat method.
Ryan C. Gordon <icculus@icculus.org>
parents:
1106
diff
changeset
|
475 |
static int WAD_stat(dvoid *opaque, const char *filename, int *exists, |
1054
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
476 |
PHYSFS_Stat *stat) |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
477 |
{ |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
478 |
const WADinfo *info = (const WADinfo *) opaque; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
479 |
const WADentry *entry = wad_find_entry(info, filename); |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
480 |
|
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
481 |
*exists = (entry != 0); |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
482 |
if (!entry) |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
483 |
return 0; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
484 |
|
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
485 |
stat->filesize = entry->size; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
486 |
stat->filetype = PHYSFS_FILETYPE_REGULAR; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
487 |
stat->accesstime = 0; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
488 |
stat->modtime = ((WADinfo *) opaque)->last_mod_time; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
489 |
stat->createtime = ((WADinfo *) opaque)->last_mod_time; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
490 |
stat->readonly = 1; /* WADs are always readonly */ |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
491 |
|
1106
94c3669d0311
Fixed PHYSFS_stat()'s return value to match rest of PhysicsFS API.
Ryan C. Gordon <icculus@icculus.org>
parents:
1098
diff
changeset
|
492 |
return 1; |
1054
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
493 |
} /* WAD_stat */ |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
494 |
|
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
495 |
|
658
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
496 |
const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_WAD = |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
497 |
{ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
498 |
"WAD", |
694
80bc8858b4ab
Added translation for WAD file type.
Ryan C. Gordon <icculus@icculus.org>
parents:
691
diff
changeset
|
499 |
WAD_ARCHIVE_DESCRIPTION, |
658
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
500 |
"Travis Wells <traviswells@mchsi.com>", |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
501 |
"http://www.3dmm2.com/doom/", |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
502 |
}; |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
503 |
|
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
504 |
|
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
505 |
const PHYSFS_Archiver __PHYSFS_Archiver_WAD = |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
506 |
{ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
507 |
&__PHYSFS_ArchiveInfo_WAD, |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
508 |
WAD_isArchive, /* isArchive() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
509 |
WAD_openArchive, /* openArchive() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
510 |
WAD_enumerateFiles, /* enumerateFiles() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
511 |
WAD_exists, /* exists() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
512 |
WAD_isDirectory, /* isDirectory() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
513 |
WAD_isSymLink, /* isSymLink() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
514 |
WAD_openRead, /* openRead() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
515 |
WAD_openWrite, /* openWrite() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
516 |
WAD_openAppend, /* openAppend() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
517 |
WAD_remove, /* remove() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
518 |
WAD_mkdir, /* mkdir() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
519 |
WAD_dirClose, /* dirClose() method */ |
1109 | 520 |
WAD_stat, /* stat() method */ |
658
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
521 |
WAD_read, /* read() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
522 |
WAD_write, /* write() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
523 |
WAD_eof, /* eof() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
524 |
WAD_tell, /* tell() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
525 |
WAD_seek, /* seek() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
526 |
WAD_fileLength, /* fileLength() method */ |
1109 | 527 |
WAD_fileClose /* fileClose() method */ |
658
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
528 |
}; |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
529 |
|
609 | 530 |
#endif /* defined PHYSFS_SUPPORTS_WAD */ |
531 |
||
532 |
/* end of wad.c ... */ |
|
533 |