author | Ryan C. Gordon <icculus@icculus.org> |
Mon, 15 Feb 2010 14:02:36 -0500 | |
changeset 1054 | 57f4af811ffb |
parent 1053 | a277a93ac1aa |
child 1098 | 4e86cec1143f |
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 |
||
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
|
88 |
static PHYSFS_sint64 WAD_read(fvoid *opaque, void *buffer, |
609 | 89 |
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount) |
90 |
{ |
|
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
|
91 |
WADfileinfo *finfo = (WADfileinfo *) opaque; |
609 | 92 |
WADentry *entry = finfo->entry; |
93 |
PHYSFS_uint32 bytesLeft = entry->size - finfo->curPos; |
|
94 |
PHYSFS_uint32 objsLeft = (bytesLeft / objSize); |
|
95 |
PHYSFS_sint64 rc; |
|
96 |
||
97 |
if (objsLeft < objCount) |
|
98 |
objCount = objsLeft; |
|
99 |
||
100 |
rc = __PHYSFS_platformRead(finfo->handle, buffer, objSize, objCount); |
|
101 |
if (rc > 0) |
|
102 |
finfo->curPos += (PHYSFS_uint32) (rc * objSize); |
|
103 |
||
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
|
104 |
return rc; |
609 | 105 |
} /* WAD_read */ |
106 |
||
107 |
||
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
|
108 |
static PHYSFS_sint64 WAD_write(fvoid *opaque, const void *buffer, |
609 | 109 |
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount) |
110 |
{ |
|
111 |
BAIL_MACRO(ERR_NOT_SUPPORTED, -1); |
|
112 |
} /* WAD_write */ |
|
113 |
||
114 |
||
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
|
115 |
static int WAD_eof(fvoid *opaque) |
609 | 116 |
{ |
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
|
117 |
WADfileinfo *finfo = (WADfileinfo *) opaque; |
609 | 118 |
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
|
119 |
return (finfo->curPos >= entry->size); |
609 | 120 |
} /* WAD_eof */ |
121 |
||
122 |
||
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
|
123 |
static PHYSFS_sint64 WAD_tell(fvoid *opaque) |
609 | 124 |
{ |
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
|
125 |
return ((WADfileinfo *) opaque)->curPos; |
609 | 126 |
} /* WAD_tell */ |
127 |
||
128 |
||
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
|
129 |
static int WAD_seek(fvoid *opaque, PHYSFS_uint64 offset) |
609 | 130 |
{ |
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
|
131 |
WADfileinfo *finfo = (WADfileinfo *) opaque; |
609 | 132 |
WADentry *entry = finfo->entry; |
133 |
int rc; |
|
134 |
||
135 |
BAIL_IF_MACRO(offset < 0, ERR_INVALID_ARGUMENT, 0); |
|
136 |
BAIL_IF_MACRO(offset >= entry->size, ERR_PAST_EOF, 0); |
|
137 |
rc = __PHYSFS_platformSeek(finfo->handle, entry->startPos + offset); |
|
138 |
if (rc) |
|
139 |
finfo->curPos = (PHYSFS_uint32) offset; |
|
140 |
||
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
|
141 |
return rc; |
609 | 142 |
} /* WAD_seek */ |
143 |
||
144 |
||
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
|
145 |
static PHYSFS_sint64 WAD_fileLength(fvoid *opaque) |
609 | 146 |
{ |
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
|
147 |
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
|
148 |
return ((PHYSFS_sint64) finfo->entry->size); |
609 | 149 |
} /* WAD_fileLength */ |
150 |
||
151 |
||
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
|
152 |
static int WAD_fileClose(fvoid *opaque) |
609 | 153 |
{ |
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
|
154 |
WADfileinfo *finfo = (WADfileinfo *) opaque; |
609 | 155 |
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
|
156 |
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
|
157 |
return 1; |
609 | 158 |
} /* WAD_fileClose */ |
159 |
||
160 |
||
161 |
static int wad_open(const char *filename, int forWriting, |
|
162 |
void **fh, PHYSFS_uint32 *count,PHYSFS_uint32 *offset) |
|
163 |
{ |
|
164 |
PHYSFS_uint8 buf[4]; |
|
165 |
||
166 |
*fh = NULL; |
|
167 |
BAIL_IF_MACRO(forWriting, ERR_ARC_IS_READ_ONLY, 0); |
|
168 |
||
169 |
*fh = __PHYSFS_platformOpenRead(filename); |
|
170 |
BAIL_IF_MACRO(*fh == NULL, NULL, 0); |
|
171 |
||
172 |
if (__PHYSFS_platformRead(*fh, buf, 4, 1) != 1) |
|
173 |
goto openWad_failed; |
|
174 |
||
175 |
if (memcmp(buf, "IWAD", 4) != 0 && memcmp(buf, "PWAD", 4) != 0) |
|
176 |
{ |
|
177 |
__PHYSFS_setError(ERR_UNSUPPORTED_ARCHIVE); |
|
178 |
goto openWad_failed; |
|
179 |
} /* if */ |
|
180 |
||
181 |
if (__PHYSFS_platformRead(*fh, count, sizeof (PHYSFS_uint32), 1) != 1) |
|
182 |
goto openWad_failed; |
|
183 |
||
184 |
*count = PHYSFS_swapULE32(*count); |
|
185 |
||
186 |
if (__PHYSFS_platformRead(*fh, offset, sizeof (PHYSFS_uint32), 1) != 1) |
|
187 |
goto openWad_failed; |
|
188 |
||
189 |
*offset = PHYSFS_swapULE32(*offset); |
|
190 |
||
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
|
191 |
return 1; |
609 | 192 |
|
193 |
openWad_failed: |
|
194 |
if (*fh != NULL) |
|
195 |
__PHYSFS_platformClose(*fh); |
|
196 |
||
197 |
*count = -1; |
|
198 |
*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
|
199 |
return 0; |
609 | 200 |
} /* wad_open */ |
201 |
||
202 |
||
203 |
static int WAD_isArchive(const char *filename, int forWriting) |
|
204 |
{ |
|
205 |
void *fh; |
|
206 |
PHYSFS_uint32 fileCount,offset; |
|
207 |
int retval = wad_open(filename, forWriting, &fh, &fileCount,&offset); |
|
208 |
||
209 |
if (fh != NULL) |
|
210 |
__PHYSFS_platformClose(fh); |
|
211 |
||
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
|
212 |
return retval; |
609 | 213 |
} /* WAD_isArchive */ |
214 |
||
215 |
||
216 |
static int wad_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two) |
|
217 |
{ |
|
928
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
218 |
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
|
219 |
{ |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
220 |
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
|
221 |
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
|
222 |
} /* if */ |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
223 |
|
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
224 |
return 0; |
609 | 225 |
} /* wad_entry_cmp */ |
226 |
||
227 |
||
228 |
static void wad_entry_swap(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two) |
|
229 |
{ |
|
928
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
230 |
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
|
231 |
{ |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
232 |
WADentry tmp; |
0e37b8163248
Various archiver swap and compare functions now check if they are
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
233 |
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
|
234 |
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
|
235 |
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
|
236 |
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
|
237 |
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
|
238 |
} /* if */ |
609 | 239 |
} /* wad_entry_swap */ |
240 |
||
241 |
||
242 |
static int wad_load_entries(const char *name, int forWriting, WADinfo *info) |
|
243 |
{ |
|
244 |
void *fh = NULL; |
|
245 |
PHYSFS_uint32 fileCount; |
|
246 |
PHYSFS_uint32 directoryOffset; |
|
247 |
WADentry *entry; |
|
622
c8e67ca63ad6
Patches to get this building on Mac Classic again.
Ryan C. Gordon <icculus@icculus.org>
parents:
610
diff
changeset
|
248 |
char lastDirectory[9]; |
610 | 249 |
|
250 |
lastDirectory[8] = 0; /* Make sure lastDirectory stays null-terminated. */ |
|
609 | 251 |
|
252 |
BAIL_IF_MACRO(!wad_open(name, forWriting, &fh, &fileCount,&directoryOffset), NULL, 0); |
|
253 |
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
|
254 |
info->entries = (WADentry *) allocator.Malloc(sizeof(WADentry)*fileCount); |
609 | 255 |
if (info->entries == NULL) |
256 |
{ |
|
257 |
__PHYSFS_platformClose(fh); |
|
258 |
BAIL_MACRO(ERR_OUT_OF_MEMORY, 0); |
|
259 |
} /* if */ |
|
260 |
||
261 |
__PHYSFS_platformSeek(fh,directoryOffset); |
|
262 |
||
263 |
for (entry = info->entries; fileCount > 0; fileCount--, entry++) |
|
264 |
{ |
|
265 |
if (__PHYSFS_platformRead(fh, &entry->startPos, 4, 1) != 1) |
|
266 |
{ |
|
267 |
__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
|
268 |
return 0; |
609 | 269 |
} /* if */ |
270 |
||
271 |
if (__PHYSFS_platformRead(fh, &entry->size, 4, 1) != 1) |
|
272 |
{ |
|
273 |
__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
|
274 |
return 0; |
609 | 275 |
} /* if */ |
276 |
||
277 |
if (__PHYSFS_platformRead(fh, &entry->name, 8, 1) != 1) |
|
278 |
{ |
|
279 |
__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
|
280 |
return 0; |
609 | 281 |
} /* if */ |
282 |
||
283 |
entry->name[8] = '\0'; /* name might not be null-terminated in file. */ |
|
284 |
entry->size = PHYSFS_swapULE32(entry->size); |
|
285 |
entry->startPos = PHYSFS_swapULE32(entry->startPos); |
|
286 |
} /* for */ |
|
287 |
||
288 |
__PHYSFS_platformClose(fh); |
|
289 |
||
290 |
__PHYSFS_sort(info->entries, info->entryCount, |
|
291 |
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
|
292 |
return 1; |
609 | 293 |
} /* wad_load_entries */ |
294 |
||
295 |
||
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
296 |
static void *WAD_openArchive(const char *name, int forWriting) |
609 | 297 |
{ |
298 |
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
|
299 |
WADinfo *info = (WADinfo *) allocator.Malloc(sizeof (WADinfo)); |
609 | 300 |
|
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
301 |
BAIL_IF_MACRO(info == NULL, ERR_OUT_OF_MEMORY, NULL); |
609 | 302 |
memset(info, '\0', sizeof (WADinfo)); |
303 |
||
691
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
304 |
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
|
305 |
GOTO_IF_MACRO(!info->filename, ERR_OUT_OF_MEMORY, WAD_openArchive_failed); |
609 | 306 |
|
307 |
if (!wad_load_entries(name, forWriting, info)) |
|
308 |
goto WAD_openArchive_failed; |
|
309 |
||
310 |
strcpy(info->filename, name); |
|
311 |
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
|
312 |
return info; |
609 | 313 |
|
314 |
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
|
315 |
if (info != NULL) |
609 | 316 |
{ |
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
317 |
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
|
318 |
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
|
319 |
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
|
320 |
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
|
321 |
allocator.Free(info); |
609 | 322 |
} /* if */ |
323 |
||
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
|
324 |
return NULL; |
609 | 325 |
} /* WAD_openArchive */ |
326 |
||
327 |
||
657
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
328 |
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
|
329 |
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
|
330 |
const char *origdir, void *callbackdata) |
609 | 331 |
{ |
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
332 |
WADinfo *info = ((WADinfo *) opaque); |
609 | 333 |
WADentry *entry = info->entries; |
334 |
PHYSFS_uint32 max = info->entryCount; |
|
335 |
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
|
336 |
const char *name; |
610 | 337 |
char *sep; |
609 | 338 |
|
657
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
339 |
if (*dname == '\0') /* root directory enumeration? */ |
610 | 340 |
{ |
341 |
for (i = 0; i < max; i++, entry++) |
|
342 |
{ |
|
657
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
343 |
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
|
344 |
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
|
345 |
cb(callbackdata, origdir, name); |
610 | 346 |
} /* for */ |
347 |
} /* if */ |
|
348 |
else |
|
349 |
{ |
|
350 |
for (i = 0; i < max; i++, entry++) |
|
351 |
{ |
|
657
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
352 |
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
|
353 |
sep = strchr(name, '/'); |
610 | 354 |
if (sep != NULL) |
355 |
{ |
|
657
dad3b5c307a9
Added callback APIs and ripped up the internals everywhere to use them.
Ryan C. Gordon <icculus@icculus.org>
parents:
650
diff
changeset
|
356 |
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
|
357 |
cb(callbackdata, origdir, sep + 1); |
610 | 358 |
} /* if */ |
359 |
} /* for */ |
|
360 |
} /* else */ |
|
609 | 361 |
} /* WAD_enumerateFiles */ |
362 |
||
363 |
||
1054
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
364 |
static WADentry *wad_find_entry(const WADinfo *info, const char *name) |
609 | 365 |
{ |
366 |
WADentry *a = info->entries; |
|
367 |
PHYSFS_sint32 lo = 0; |
|
368 |
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1); |
|
369 |
PHYSFS_sint32 middle; |
|
370 |
int rc; |
|
371 |
||
372 |
while (lo <= hi) |
|
373 |
{ |
|
374 |
middle = lo + ((hi - lo) / 2); |
|
375 |
rc = strcmp(name, a[middle].name); |
|
376 |
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
|
377 |
return &a[middle]; |
609 | 378 |
else if (rc > 0) |
379 |
lo = middle + 1; |
|
380 |
else |
|
381 |
hi = middle - 1; |
|
382 |
} /* while */ |
|
383 |
||
384 |
BAIL_MACRO(ERR_NO_SUCH_FILE, NULL); |
|
385 |
} /* wad_find_entry */ |
|
386 |
||
387 |
||
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
|
388 |
static int WAD_exists(dvoid *opaque, const char *name) |
609 | 389 |
{ |
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
|
390 |
return (wad_find_entry((WADinfo *) opaque, name) != NULL); |
609 | 391 |
} /* WAD_exists */ |
392 |
||
393 |
||
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
|
394 |
static int WAD_isDirectory(dvoid *opaque, const char *name, int *fileExists) |
609 | 395 |
{ |
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
396 |
WADentry *entry = wad_find_entry(((WADinfo *) opaque), name); |
610 | 397 |
if (entry != NULL) |
398 |
{ |
|
399 |
char *n; |
|
400 |
||
401 |
*fileExists = 1; |
|
402 |
||
403 |
/* Can't be a directory if it's a subdirectory. */ |
|
404 |
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
|
405 |
return 0; |
610 | 406 |
|
407 |
/* Check if it matches "MAP??" or "E?M?" ... */ |
|
408 |
n = entry->name; |
|
409 |
if ((n[0] == 'E' && n[2] == 'M') || |
|
410 |
(n[0] == 'M' && n[1] == 'A' && n[2] == 'P' && n[6] == 0)) |
|
411 |
{ |
|
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 1; |
610 | 413 |
} /* 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
|
414 |
return 0; |
610 | 415 |
} /* if */ |
416 |
else |
|
417 |
{ |
|
418 |
*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
|
419 |
return 0; |
610 | 420 |
} /* else */ |
609 | 421 |
} /* WAD_isDirectory */ |
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 int WAD_isSymLink(dvoid *opaque, const char *name, 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 |
*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
|
427 |
return 0; /* never symlinks in a wad. */ |
609 | 428 |
} /* WAD_isSymLink */ |
429 |
||
430 |
||
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
|
431 |
static PHYSFS_sint64 WAD_getLastModTime(dvoid *opaque, |
609 | 432 |
const char *name, |
433 |
int *fileExists) |
|
434 |
{ |
|
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
435 |
WADinfo *info = ((WADinfo *) opaque); |
609 | 436 |
PHYSFS_sint64 retval = -1; |
437 |
||
438 |
*fileExists = (wad_find_entry(info, name) != NULL); |
|
439 |
if (*fileExists) /* use time of WAD itself in the physical filesystem. */ |
|
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
440 |
retval = info->last_mod_time; |
609 | 441 |
|
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 retval; |
609 | 443 |
} /* WAD_getLastModTime */ |
444 |
||
445 |
||
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
|
446 |
static fvoid *WAD_openRead(dvoid *opaque, const char *fnm, int *fileExists) |
609 | 447 |
{ |
648
5c993684b8f2
Cleaned up archiver interface to not deal with DirHandles anymore,
Ryan C. Gordon <icculus@icculus.org>
parents:
622
diff
changeset
|
448 |
WADinfo *info = ((WADinfo *) opaque); |
609 | 449 |
WADfileinfo *finfo; |
450 |
WADentry *entry; |
|
451 |
||
452 |
entry = wad_find_entry(info, fnm); |
|
453 |
*fileExists = (entry != NULL); |
|
454 |
BAIL_IF_MACRO(entry == NULL, NULL, NULL); |
|
455 |
||
691
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
456 |
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
|
457 |
BAIL_IF_MACRO(finfo == NULL, ERR_OUT_OF_MEMORY, NULL); |
609 | 458 |
|
459 |
finfo->handle = __PHYSFS_platformOpenRead(info->filename); |
|
460 |
if ( (finfo->handle == NULL) || |
|
461 |
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) ) |
|
462 |
{ |
|
691
71d9affe0d8a
All memory management now goes through allocation hooks instead of directly to
Ryan C. Gordon <icculus@icculus.org>
parents:
678
diff
changeset
|
463 |
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
|
464 |
return NULL; |
609 | 465 |
} /* if */ |
466 |
||
467 |
finfo->curPos = 0; |
|
468 |
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
|
469 |
return finfo; |
609 | 470 |
} /* WAD_openRead */ |
471 |
||
472 |
||
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
|
473 |
static fvoid *WAD_openWrite(dvoid *opaque, const char *name) |
609 | 474 |
{ |
475 |
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL); |
|
476 |
} /* WAD_openWrite */ |
|
477 |
||
478 |
||
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
|
479 |
static fvoid *WAD_openAppend(dvoid *opaque, const char *name) |
609 | 480 |
{ |
481 |
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL); |
|
482 |
} /* WAD_openAppend */ |
|
483 |
||
484 |
||
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
|
485 |
static int WAD_remove(dvoid *opaque, const char *name) |
609 | 486 |
{ |
487 |
BAIL_MACRO(ERR_NOT_SUPPORTED, 0); |
|
488 |
} /* WAD_remove */ |
|
489 |
||
490 |
||
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
|
491 |
static int WAD_mkdir(dvoid *opaque, const char *name) |
609 | 492 |
{ |
493 |
BAIL_MACRO(ERR_NOT_SUPPORTED, 0); |
|
494 |
} /* WAD_mkdir */ |
|
495 |
||
658
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
496 |
|
1054
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
497 |
static int WAD_stat(fvoid *opaque, const char *filename, int *exists, |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
498 |
PHYSFS_Stat *stat) |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
499 |
{ |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
500 |
const WADinfo *info = (const WADinfo *) opaque; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
501 |
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
|
502 |
|
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
503 |
*exists = (entry != 0); |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
504 |
if (!entry) |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
505 |
return 0; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
506 |
|
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
507 |
stat->filesize = entry->size; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
508 |
stat->filetype = PHYSFS_FILETYPE_REGULAR; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
509 |
stat->accesstime = 0; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
510 |
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
|
511 |
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
|
512 |
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
|
513 |
|
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
514 |
return 0; |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
515 |
} /* WAD_stat */ |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
516 |
|
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
517 |
|
658
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
518 |
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
|
519 |
{ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
520 |
"WAD", |
694
80bc8858b4ab
Added translation for WAD file type.
Ryan C. Gordon <icculus@icculus.org>
parents:
691
diff
changeset
|
521 |
WAD_ARCHIVE_DESCRIPTION, |
658
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
522 |
"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
|
523 |
"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
|
524 |
}; |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
525 |
|
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
526 |
|
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
527 |
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
|
528 |
{ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
529 |
&__PHYSFS_ArchiveInfo_WAD, |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
530 |
WAD_isArchive, /* isArchive() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
531 |
WAD_openArchive, /* openArchive() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
532 |
WAD_enumerateFiles, /* enumerateFiles() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
533 |
WAD_exists, /* exists() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
534 |
WAD_isDirectory, /* isDirectory() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
535 |
WAD_isSymLink, /* isSymLink() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
536 |
WAD_getLastModTime, /* getLastModTime() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
537 |
WAD_openRead, /* openRead() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
538 |
WAD_openWrite, /* openWrite() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
539 |
WAD_openAppend, /* openAppend() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
540 |
WAD_remove, /* remove() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
541 |
WAD_mkdir, /* mkdir() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
542 |
WAD_dirClose, /* dirClose() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
543 |
WAD_read, /* read() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
544 |
WAD_write, /* write() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
545 |
WAD_eof, /* eof() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
546 |
WAD_tell, /* tell() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
547 |
WAD_seek, /* seek() method */ |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
548 |
WAD_fileLength, /* fileLength() method */ |
1054
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
549 |
WAD_fileClose, /* fileClose() method */ |
57f4af811ffb
THIS is Christoph's PHYSFS_stat() work.
Ryan C. Gordon <icculus@icculus.org>
parents:
1053
diff
changeset
|
550 |
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
|
551 |
}; |
1981818c6170
Removed all the forward declaration cruft from the archivers.
Ryan C. Gordon <icculus@icculus.org>
parents:
657
diff
changeset
|
552 |
|
609 | 553 |
#endif /* defined PHYSFS_SUPPORTS_WAD */ |
554 |
||
555 |
/* end of wad.c ... */ |
|
556 |