Skip to content

Latest commit

 

History

History
503 lines (394 loc) · 14.2 KB

grp.c

File metadata and controls

503 lines (394 loc) · 14.2 KB
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
* GRP support routines for PhysicsFS.
*
* This driver handles BUILD engine archives ("groupfiles"). This format
* (but not this driver) was put together by Ken Silverman.
*
* The format is simple enough. In Ken's words:
*
* What's the .GRP file format?
*
* The ".grp" file format is just a collection of a lot of files stored
* into 1 big one. I tried to make the format as simple as possible: The
* first 12 bytes contains my name, "KenSilverman". The next 4 bytes is
* the number of files that were compacted into the group file. Then for
* each file, there is a 16 byte structure, where the first 12 bytes are
* the filename, and the last 4 bytes are the file's size. The rest of
* the group file is just the raw data packed one after the other in the
* same order as the list of files.
*
* (That info is from http://www.advsys.net/ken/build.htm ...)
*
* Please see the file LICENSE in the source's root directory.
*
* This file written by Ryan C. Gordon.
*/
May 10, 2002
May 10, 2002
27
28
29
30
31
32
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if (defined PHYSFS_SUPPORTS_GRP)
33
34
35
36
37
38
39
40
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "physfs.h"
#define __PHYSICSFS_INTERNAL__
#include "physfs_internal.h"
Jul 23, 2002
Jul 23, 2002
41
42
43
typedef struct
{
char name[13];
Aug 28, 2002
Aug 28, 2002
44
45
PHYSFS_uint32 startPos;
PHYSFS_uint32 size;
Jul 23, 2002
Jul 23, 2002
46
47
} GRPentry;
48
49
typedef struct
{
Mar 25, 2002
Mar 25, 2002
50
char *filename;
Jul 23, 2002
Jul 23, 2002
51
52
53
PHYSFS_sint64 last_mod_time;
PHYSFS_uint32 entryCount;
GRPentry *entries;
54
55
56
57
} GRPinfo;
typedef struct
{
Mar 25, 2002
Mar 25, 2002
58
void *handle;
Jul 23, 2002
Jul 23, 2002
59
GRPentry *entry;
Aug 28, 2002
Aug 28, 2002
60
PHYSFS_uint32 curPos;
61
62
63
} GRPfileinfo;
Sep 26, 2004
Sep 26, 2004
64
static PHYSFS_sint64 GRP_read(fvoid *opaque, void *buffer,
Mar 24, 2002
Mar 24, 2002
65
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
Sep 26, 2004
Sep 26, 2004
66
static PHYSFS_sint64 GRP_write(fvoid *opaque, const void *buffer,
Aug 21, 2002
Aug 21, 2002
67
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
Sep 26, 2004
Sep 26, 2004
68
69
70
71
72
static int GRP_eof(fvoid *opaque);
static PHYSFS_sint64 GRP_tell(fvoid *opaque);
static int GRP_seek(fvoid *opaque, PHYSFS_uint64 offset);
static PHYSFS_sint64 GRP_fileLength(fvoid *opaque);
static int GRP_fileClose(fvoid *opaque);
Sep 2, 2001
Sep 2, 2001
73
static int GRP_isArchive(const char *filename, int forWriting);
Sep 26, 2004
Sep 26, 2004
74
static void *GRP_openArchive(const char *name, int forWriting);
Sep 26, 2004
Sep 26, 2004
75
static LinkedStringList *GRP_enumerateFiles(dvoid *opaque,
Sep 2, 2001
Sep 2, 2001
76
77
const char *dirname,
int omitSymLinks);
Sep 26, 2004
Sep 26, 2004
78
79
80
81
82
83
84
85
86
87
static int GRP_exists(dvoid *opaque, const char *name);
static int GRP_isDirectory(dvoid *opaque, const char *name, int *fileExists);
static int GRP_isSymLink(dvoid *opaque, const char *name, int *fileExists);
static PHYSFS_sint64 GRP_getLastModTime(dvoid *opaque, const char *n, int *e);
static fvoid *GRP_openRead(dvoid *opaque, const char *name, int *exist);
static fvoid *GRP_openWrite(dvoid *opaque, const char *name);
static fvoid *GRP_openAppend(dvoid *opaque, const char *name);
static int GRP_remove(dvoid *opaque, const char *name);
static int GRP_mkdir(dvoid *opaque, const char *name);
static void GRP_dirClose(dvoid *opaque);
Sep 2, 2001
Sep 2, 2001
88
Jul 26, 2002
Jul 26, 2002
89
90
91
const PHYSFS_ArchiveInfo __PHYSFS_ArchiveInfo_GRP =
{
"GRP",
Jul 28, 2002
Jul 28, 2002
92
GRP_ARCHIVE_DESCRIPTION,
Jul 26, 2002
Jul 26, 2002
93
94
95
96
97
"Ryan C. Gordon <icculus@clutteredmind.org>",
"http://icculus.org/physfs/",
};
Sep 26, 2004
Sep 26, 2004
98
const PHYSFS_Archiver __PHYSFS_Archiver_GRP =
Sep 2, 2001
Sep 2, 2001
99
{
Jul 26, 2002
Jul 26, 2002
100
&__PHYSFS_ArchiveInfo_GRP,
Sep 2, 2001
Sep 2, 2001
101
102
103
104
105
106
GRP_isArchive, /* isArchive() method */
GRP_openArchive, /* openArchive() method */
GRP_enumerateFiles, /* enumerateFiles() method */
GRP_exists, /* exists() method */
GRP_isDirectory, /* isDirectory() method */
GRP_isSymLink, /* isSymLink() method */
Jun 6, 2002
Jun 6, 2002
107
GRP_getLastModTime, /* getLastModTime() method */
Sep 2, 2001
Sep 2, 2001
108
GRP_openRead, /* openRead() method */
Aug 21, 2002
Aug 21, 2002
109
110
111
112
GRP_openWrite, /* openWrite() method */
GRP_openAppend, /* openAppend() method */
GRP_remove, /* remove() method */
GRP_mkdir, /* mkdir() method */
Sep 26, 2004
Sep 26, 2004
113
114
115
116
117
118
119
120
GRP_dirClose, /* dirClose() method */
GRP_read, /* read() method */
GRP_write, /* write() method */
GRP_eof, /* eof() method */
GRP_tell, /* tell() method */
GRP_seek, /* seek() method */
GRP_fileLength, /* fileLength() method */
GRP_fileClose /* fileClose() method */
Sep 2, 2001
Sep 2, 2001
121
122
123
124
};
Sep 26, 2004
Sep 26, 2004
125
static void GRP_dirClose(dvoid *opaque)
Sep 2, 2001
Sep 2, 2001
126
{
Sep 26, 2004
Sep 26, 2004
127
GRPinfo *info = ((GRPinfo *) opaque);
Jul 23, 2002
Jul 23, 2002
128
129
130
free(info->filename);
free(info->entries);
free(info);
Sep 2, 2001
Sep 2, 2001
131
} /* GRP_dirClose */
Sep 26, 2004
Sep 26, 2004
134
static PHYSFS_sint64 GRP_read(fvoid *opaque, void *buffer,
Mar 24, 2002
Mar 24, 2002
135
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
Sep 26, 2004
Sep 26, 2004
137
GRPfileinfo *finfo = (GRPfileinfo *) opaque;
Jul 23, 2002
Jul 23, 2002
138
GRPentry *entry = finfo->entry;
Aug 28, 2002
Aug 28, 2002
139
140
PHYSFS_uint32 bytesLeft = entry->size - finfo->curPos;
PHYSFS_uint32 objsLeft = (bytesLeft / objSize);
Jul 23, 2002
Jul 23, 2002
141
PHYSFS_sint64 rc;
142
143
if (objsLeft < objCount)
Aug 28, 2002
Aug 28, 2002
144
objCount = objsLeft;
Jul 23, 2002
Jul 23, 2002
146
147
rc = __PHYSFS_platformRead(finfo->handle, buffer, objSize, objCount);
if (rc > 0)
Aug 28, 2002
Aug 28, 2002
148
finfo->curPos += (PHYSFS_uint32) (rc * objSize);
Jul 23, 2002
Jul 23, 2002
149
150
return(rc);
151
152
153
} /* GRP_read */
Sep 26, 2004
Sep 26, 2004
154
static PHYSFS_sint64 GRP_write(fvoid *opaque, const void *buffer,
Aug 21, 2002
Aug 21, 2002
155
156
157
158
159
160
PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
{
BAIL_MACRO(ERR_NOT_SUPPORTED, -1);
} /* GRP_write */
Sep 26, 2004
Sep 26, 2004
161
static int GRP_eof(fvoid *opaque)
Sep 26, 2004
Sep 26, 2004
163
GRPfileinfo *finfo = (GRPfileinfo *) opaque;
Jul 23, 2002
Jul 23, 2002
164
GRPentry *entry = finfo->entry;
Aug 28, 2002
Aug 28, 2002
165
return(finfo->curPos >= entry->size);
166
167
168
} /* GRP_eof */
Sep 26, 2004
Sep 26, 2004
169
static PHYSFS_sint64 GRP_tell(fvoid *opaque)
Sep 26, 2004
Sep 26, 2004
171
return(((GRPfileinfo *) opaque)->curPos);
172
173
174
} /* GRP_tell */
Sep 26, 2004
Sep 26, 2004
175
static int GRP_seek(fvoid *opaque, PHYSFS_uint64 offset)
Sep 26, 2004
Sep 26, 2004
177
GRPfileinfo *finfo = (GRPfileinfo *) opaque;
Jul 23, 2002
Jul 23, 2002
178
179
GRPentry *entry = finfo->entry;
int rc;
180
181
BAIL_IF_MACRO(offset < 0, ERR_INVALID_ARGUMENT, 0);
Aug 28, 2002
Aug 28, 2002
182
183
BAIL_IF_MACRO(offset >= entry->size, ERR_PAST_EOF, 0);
rc = __PHYSFS_platformSeek(finfo->handle, entry->startPos + offset);
Jul 23, 2002
Jul 23, 2002
184
if (rc)
Aug 28, 2002
Aug 28, 2002
185
finfo->curPos = (PHYSFS_uint32) offset;
Jul 23, 2002
Jul 23, 2002
186
187
return(rc);
188
189
190
} /* GRP_seek */
Sep 26, 2004
Sep 26, 2004
191
static PHYSFS_sint64 GRP_fileLength(fvoid *opaque)
Jul 9, 2001
Jul 9, 2001
192
{
Sep 26, 2004
Sep 26, 2004
193
GRPfileinfo *finfo = (GRPfileinfo *) opaque;
Aug 28, 2002
Aug 28, 2002
194
return((PHYSFS_sint64) finfo->entry->size);
Jul 9, 2001
Jul 9, 2001
195
196
197
} /* GRP_fileLength */
Sep 26, 2004
Sep 26, 2004
198
static int GRP_fileClose(fvoid *opaque)
Sep 26, 2004
Sep 26, 2004
200
GRPfileinfo *finfo = (GRPfileinfo *) opaque;
Jul 23, 2002
Jul 23, 2002
201
202
BAIL_IF_MACRO(!__PHYSFS_platformClose(finfo->handle), NULL, 0);
free(finfo);
203
204
205
206
return(1);
} /* GRP_fileClose */
Jul 23, 2002
Jul 23, 2002
207
208
static int grp_open(const char *filename, int forWriting,
void **fh, PHYSFS_uint32 *count)
Mar 25, 2002
Mar 25, 2002
210
PHYSFS_uint8 buf[12];
211
212
213
214
*fh = NULL;
BAIL_IF_MACRO(forWriting, ERR_ARC_IS_READ_ONLY, 0);
Mar 25, 2002
Mar 25, 2002
215
216
*fh = __PHYSFS_platformOpenRead(filename);
BAIL_IF_MACRO(*fh == NULL, NULL, 0);
Mar 25, 2002
Mar 25, 2002
218
219
220
221
222
223
224
225
if (__PHYSFS_platformRead(*fh, buf, 12, 1) != 1)
goto openGrp_failed;
if (memcmp(buf, "KenSilverman", 12) != 0)
{
__PHYSFS_setError(ERR_UNSUPPORTED_ARCHIVE);
goto openGrp_failed;
} /* if */
Jul 23, 2002
Jul 23, 2002
227
if (__PHYSFS_platformRead(*fh, count, sizeof (PHYSFS_uint32), 1) != 1)
Mar 25, 2002
Mar 25, 2002
228
goto openGrp_failed;
Jul 23, 2002
Jul 23, 2002
230
*count = PHYSFS_swapULE32(*count);
Apr 5, 2002
Apr 5, 2002
231
232
return(1);
Mar 25, 2002
Mar 25, 2002
233
234
235
236
237
238
239
240
openGrp_failed:
if (*fh != NULL)
__PHYSFS_platformClose(*fh);
*count = -1;
*fh = NULL;
return(0);
Jul 23, 2002
Jul 23, 2002
241
} /* grp_open */
242
243
244
245
static int GRP_isArchive(const char *filename, int forWriting)
{
Mar 25, 2002
Mar 25, 2002
246
void *fh;
Jul 23, 2002
Jul 23, 2002
247
248
PHYSFS_uint32 fileCount;
int retval = grp_open(filename, forWriting, &fh, &fileCount);
249
250
if (fh != NULL)
Mar 25, 2002
Mar 25, 2002
251
__PHYSFS_platformClose(fh);
252
253
254
255
256
return(retval);
} /* GRP_isArchive */
Aug 20, 2002
Aug 20, 2002
257
static int grp_entry_cmp(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
Jul 23, 2002
Jul 23, 2002
258
{
Aug 20, 2002
Aug 20, 2002
259
260
261
GRPentry *a = (GRPentry *) _a;
return(strcmp(a[one].name, a[two].name));
} /* grp_entry_cmp */
Jul 23, 2002
Jul 23, 2002
262
263
Aug 20, 2002
Aug 20, 2002
264
static void grp_entry_swap(void *_a, PHYSFS_uint32 one, PHYSFS_uint32 two)
Jul 23, 2002
Jul 23, 2002
265
266
{
GRPentry tmp;
Aug 20, 2002
Aug 20, 2002
267
268
269
270
271
272
GRPentry *first = &(((GRPentry *) _a)[one]);
GRPentry *second = &(((GRPentry *) _a)[two]);
memcpy(&tmp, first, sizeof (GRPentry));
memcpy(first, second, sizeof (GRPentry));
memcpy(second, &tmp, sizeof (GRPentry));
} /* grp_entry_swap */
Jul 23, 2002
Jul 23, 2002
273
274
275
static int grp_load_entries(const char *name, int forWriting, GRPinfo *info)
Mar 25, 2002
Mar 25, 2002
277
void *fh = NULL;
Jul 23, 2002
Jul 23, 2002
278
PHYSFS_uint32 fileCount;
Jul 23, 2002
Jul 23, 2002
279
PHYSFS_uint32 location = 16; /* sizeof sig. */
Jul 23, 2002
Jul 23, 2002
280
281
282
283
284
285
286
287
288
289
290
291
GRPentry *entry;
char *ptr;
BAIL_IF_MACRO(!grp_open(name, forWriting, &fh, &fileCount), NULL, 0);
info->entryCount = fileCount;
info->entries = (GRPentry *) malloc(sizeof (GRPentry) * fileCount);
if (info->entries == NULL)
{
__PHYSFS_platformClose(fh);
BAIL_MACRO(ERR_OUT_OF_MEMORY, 0);
} /* if */
Jul 23, 2002
Jul 23, 2002
292
293
location += (16 * fileCount);
Jul 23, 2002
Jul 23, 2002
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
for (entry = info->entries; fileCount > 0; fileCount--, entry++)
{
if (__PHYSFS_platformRead(fh, &entry->name, 12, 1) != 1)
{
__PHYSFS_platformClose(fh);
return(0);
} /* if */
entry->name[12] = '\0'; /* name isn't null-terminated in file. */
if ((ptr = strchr(entry->name, ' ')) != NULL)
*ptr = '\0'; /* trim extra spaces. */
if (__PHYSFS_platformRead(fh, &entry->size, 4, 1) != 1)
{
__PHYSFS_platformClose(fh);
return(0);
} /* if */
entry->size = PHYSFS_swapULE32(entry->size);
entry->startPos = location;
Jul 23, 2002
Jul 23, 2002
314
location += entry->size;
Jul 23, 2002
Jul 23, 2002
315
316
317
318
} /* for */
__PHYSFS_platformClose(fh);
Aug 20, 2002
Aug 20, 2002
319
320
__PHYSFS_sort(info->entries, info->entryCount,
grp_entry_cmp, grp_entry_swap);
Jul 23, 2002
Jul 23, 2002
321
322
323
324
return(1);
} /* grp_load_entries */
Sep 26, 2004
Sep 26, 2004
325
static void *GRP_openArchive(const char *name, int forWriting)
Jul 23, 2002
Jul 23, 2002
326
327
{
PHYSFS_sint64 modtime = __PHYSFS_platformGetLastModTime(name);
Sep 26, 2004
Sep 26, 2004
328
GRPinfo *info = malloc(sizeof (GRPinfo));
Sep 26, 2004
Sep 26, 2004
330
BAIL_IF_MACRO(info == NULL, ERR_OUT_OF_MEMORY, 0);
Jul 23, 2002
Jul 23, 2002
332
333
334
memset(info, '\0', sizeof (GRPinfo));
info->filename = (char *) malloc(strlen(name) + 1);
if (info->filename == NULL)
Mar 25, 2002
Mar 25, 2002
336
337
__PHYSFS_setError(ERR_OUT_OF_MEMORY);
goto GRP_openArchive_failed;
338
339
} /* if */
Jul 23, 2002
Jul 23, 2002
340
if (!grp_load_entries(name, forWriting, info))
Mar 25, 2002
Mar 25, 2002
341
342
goto GRP_openArchive_failed;
Jul 23, 2002
Jul 23, 2002
343
344
strcpy(info->filename, name);
info->last_mod_time = modtime;
Sep 26, 2004
Sep 26, 2004
345
346
return(info);
Mar 25, 2002
Mar 25, 2002
347
348
GRP_openArchive_failed:
Sep 26, 2004
Sep 26, 2004
349
if (info != NULL)
Mar 25, 2002
Mar 25, 2002
350
{
Sep 26, 2004
Sep 26, 2004
351
352
353
354
355
if (info->filename != NULL)
free(info->filename);
if (info->entries != NULL)
free(info->entries);
free(info);
Mar 25, 2002
Mar 25, 2002
356
357
358
} /* if */
return(NULL);
359
360
361
} /* GRP_openArchive */
Sep 26, 2004
Sep 26, 2004
362
static LinkedStringList *GRP_enumerateFiles(dvoid *opaque,
Jul 16, 2001
Jul 16, 2001
363
364
const char *dirname,
int omitSymLinks)
Sep 26, 2004
Sep 26, 2004
366
GRPinfo *info = (GRPinfo *) opaque;
Jul 23, 2002
Jul 23, 2002
367
368
369
GRPentry *entry = info->entries;
LinkedStringList *retval = NULL, *p = NULL;
PHYSFS_uint32 max = info->entryCount;
Apr 3, 2002
Apr 3, 2002
370
PHYSFS_uint32 i;
Jul 23, 2002
Jul 23, 2002
372
373
/* no directories in GRP files. */
BAIL_IF_MACRO(*dirname != '\0', ERR_NOT_A_DIR, NULL);
Jul 23, 2002
Jul 23, 2002
375
376
for (i = 0; i < max; i++, entry++)
retval = __PHYSFS_addToLinkedStringList(retval, &p, entry->name, -1);
377
378
379
380
381
return(retval);
} /* GRP_enumerateFiles */
Jul 23, 2002
Jul 23, 2002
382
static GRPentry *grp_find_entry(GRPinfo *info, const char *name)
Jul 23, 2002
Jul 23, 2002
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
char *ptr = strchr(name, '.');
GRPentry *a = info->entries;
PHYSFS_sint32 lo = 0;
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
PHYSFS_sint32 middle;
int rc;
/*
* Rule out filenames to avoid unneeded processing...no dirs,
* big filenames, or extensions > 3 chars.
*/
BAIL_IF_MACRO((ptr) && (strlen(ptr) > 4), ERR_NO_SUCH_FILE, NULL);
BAIL_IF_MACRO(strlen(name) > 12, ERR_NO_SUCH_FILE, NULL);
BAIL_IF_MACRO(strchr(name, '/') != NULL, ERR_NO_SUCH_FILE, NULL);
while (lo <= hi)
Jul 23, 2002
Jul 23, 2002
401
402
403
404
405
406
407
408
409
middle = lo + ((hi - lo) / 2);
rc = strcmp(name, a[middle].name);
if (rc == 0) /* found it! */
return(&a[middle]);
else if (rc > 0)
lo = middle + 1;
else
hi = middle - 1;
} /* while */
Jul 23, 2002
Jul 23, 2002
411
412
BAIL_MACRO(ERR_NO_SUCH_FILE, NULL);
} /* grp_find_entry */
Sep 26, 2004
Sep 26, 2004
415
static int GRP_exists(dvoid *opaque, const char *name)
Sep 26, 2004
Sep 26, 2004
417
return(grp_find_entry((GRPinfo *) opaque, name) != NULL);
418
419
420
} /* GRP_exists */
Sep 26, 2004
Sep 26, 2004
421
static int GRP_isDirectory(dvoid *opaque, const char *name, int *fileExists)
Sep 26, 2004
Sep 26, 2004
423
*fileExists = GRP_exists(opaque, name);
424
425
426
427
return(0); /* never directories in a groupfile. */
} /* GRP_isDirectory */
Sep 26, 2004
Sep 26, 2004
428
static int GRP_isSymLink(dvoid *opaque, const char *name, int *fileExists)
Sep 26, 2004
Sep 26, 2004
430
*fileExists = GRP_exists(opaque, name);
431
432
433
434
return(0); /* never symlinks in a groupfile. */
} /* GRP_isSymLink */
Sep 26, 2004
Sep 26, 2004
435
static PHYSFS_sint64 GRP_getLastModTime(dvoid *opaque,
Aug 21, 2002
Aug 21, 2002
436
437
const char *name,
int *fileExists)
Jun 6, 2002
Jun 6, 2002
438
{
Sep 26, 2004
Sep 26, 2004
439
GRPinfo *info = (GRPinfo *) opaque;
Aug 21, 2002
Aug 21, 2002
440
PHYSFS_sint64 retval = -1;
Jul 25, 2002
Jul 25, 2002
441
Aug 21, 2002
Aug 21, 2002
442
443
*fileExists = (grp_find_entry(info, name) != NULL);
if (*fileExists) /* use time of GRP itself in the physical filesystem. */
Sep 26, 2004
Sep 26, 2004
444
retval = info->last_mod_time;
Aug 21, 2002
Aug 21, 2002
445
446
return(retval);
Jun 6, 2002
Jun 6, 2002
447
448
449
} /* GRP_getLastModTime */
Sep 26, 2004
Sep 26, 2004
450
static fvoid *GRP_openRead(dvoid *opaque, const char *fnm, int *fileExists)
Sep 26, 2004
Sep 26, 2004
452
GRPinfo *info = (GRPinfo *) opaque;
453
GRPfileinfo *finfo;
Jul 23, 2002
Jul 23, 2002
454
GRPentry *entry;
Aug 21, 2002
Aug 21, 2002
456
457
entry = grp_find_entry(info, fnm);
*fileExists = (entry != NULL);
Jul 23, 2002
Jul 23, 2002
458
BAIL_IF_MACRO(entry == NULL, NULL, NULL);
459
460
finfo = (GRPfileinfo *) malloc(sizeof (GRPfileinfo));
Sep 26, 2004
Sep 26, 2004
461
BAIL_IF_MACRO(finfo == NULL, ERR_OUT_OF_MEMORY, NULL);
Jul 23, 2002
Jul 23, 2002
463
finfo->handle = __PHYSFS_platformOpenRead(info->filename);
Mar 25, 2002
Mar 25, 2002
464
if ( (finfo->handle == NULL) ||
Jul 23, 2002
Jul 23, 2002
465
(!__PHYSFS_platformSeek(finfo->handle, entry->startPos)) )
Mar 25, 2002
Mar 25, 2002
466
467
468
469
470
{
free(finfo);
return(NULL);
} /* if */
Jul 23, 2002
Jul 23, 2002
471
472
finfo->curPos = 0;
finfo->entry = entry;
Sep 26, 2004
Sep 26, 2004
473
return(finfo);
474
475
} /* GRP_openRead */
Aug 21, 2002
Aug 21, 2002
476
Sep 26, 2004
Sep 26, 2004
477
static fvoid *GRP_openWrite(dvoid *opaque, const char *name)
Aug 21, 2002
Aug 21, 2002
478
479
480
481
482
{
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL);
} /* GRP_openWrite */
Sep 26, 2004
Sep 26, 2004
483
static fvoid *GRP_openAppend(dvoid *opaque, const char *name)
Aug 21, 2002
Aug 21, 2002
484
485
486
487
488
{
BAIL_MACRO(ERR_NOT_SUPPORTED, NULL);
} /* GRP_openAppend */
Sep 26, 2004
Sep 26, 2004
489
static int GRP_remove(dvoid *opaque, const char *name)
Aug 21, 2002
Aug 21, 2002
490
491
492
493
494
{
BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
} /* GRP_remove */
Sep 26, 2004
Sep 26, 2004
495
static int GRP_mkdir(dvoid *opaque, const char *name)
Aug 21, 2002
Aug 21, 2002
496
497
498
499
{
BAIL_MACRO(ERR_NOT_SUPPORTED, 0);
} /* GRP_mkdir */
May 10, 2002
May 10, 2002
500
501
#endif /* defined PHYSFS_SUPPORTS_GRP */
502
/* end of grp.c ... */