misc/libphysfs/archiver_dir.c
author unc0rr
Sun, 08 Nov 2015 12:06:13 +0300
changeset 11321 71a46315c2d4
parent 8524 a65e9bcf0a03
child 12218 bb5522e88ab2
permissions -rw-r--r--
Fix replay sanity check
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7768
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
     1
/*
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
     2
 * Standard directory I/O support routines for PhysicsFS.
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
     3
 *
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
     4
 * Please see the file LICENSE.txt in the source's root directory.
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
     5
 *
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
     6
 *  This file written by Ryan C. Gordon.
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
     7
 */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
     8
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
     9
#define __PHYSICSFS_INTERNAL__
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    10
#include "physfs_internal.h"
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    11
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    12
/* There's no PHYSFS_Io interface here. Use __PHYSFS_createNativeIo(). */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    13
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    14
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    15
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    16
static char *cvtToDependent(const char *prepend, const char *path, char *buf)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    17
{
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    18
    BAIL_IF_MACRO(buf == NULL, PHYSFS_ERR_OUT_OF_MEMORY, NULL);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    19
    sprintf(buf, "%s%s", prepend ? prepend : "", path);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    20
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    21
    if (__PHYSFS_platformDirSeparator != '/')
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    22
    {
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    23
        char *p;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    24
        for (p = strchr(buf, '/'); p != NULL; p = strchr(p + 1, '/'))
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    25
            *p = __PHYSFS_platformDirSeparator;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    26
    } /* if */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    27
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    28
    return buf;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    29
} /* cvtToDependent */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    30
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    31
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    32
#define CVT_TO_DEPENDENT(buf, pre, dir) { \
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    33
    const size_t len = ((pre) ? strlen((char *) pre) : 0) + strlen(dir) + 1; \
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    34
    buf = cvtToDependent((char*)pre,dir,(char*)__PHYSFS_smallAlloc(len)); \
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    35
}
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    36
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    37
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    38
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    39
static void *DIR_openArchive(PHYSFS_Io *io, const char *name, int forWriting)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    40
{
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    41
    PHYSFS_Stat st;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    42
    const char dirsep = __PHYSFS_platformDirSeparator;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    43
    char *retval = NULL;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    44
    const size_t namelen = strlen(name);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    45
    const size_t seplen = 1;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    46
    int exists = 0;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    47
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    48
    assert(io == NULL);  /* shouldn't create an Io for these. */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    49
    BAIL_IF_MACRO(!__PHYSFS_platformStat(name, &exists, &st), ERRPASS, NULL);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    50
    if (st.filetype != PHYSFS_FILETYPE_DIRECTORY)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    51
        BAIL_MACRO(PHYSFS_ERR_UNSUPPORTED, NULL);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    52
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    53
    retval = allocator.Malloc(namelen + seplen + 1);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    54
    BAIL_IF_MACRO(retval == NULL, PHYSFS_ERR_OUT_OF_MEMORY, NULL);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    55
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    56
    strcpy(retval, name);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    57
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    58
    /* make sure there's a dir separator at the end of the string */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    59
    if (retval[namelen - 1] != dirsep)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    60
    {
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    61
        retval[namelen] = dirsep;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    62
        retval[namelen + 1] = '\0';
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    63
    } /* if */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    64
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    65
    return retval;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    66
} /* DIR_openArchive */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    67
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    68
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    69
static void DIR_enumerateFiles(PHYSFS_Dir *opaque, const char *dname,
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    70
                               int omitSymLinks, PHYSFS_EnumFilesCallback cb,
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    71
                               const char *origdir, void *callbackdata)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    72
{
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    73
    char *d;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    74
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    75
    CVT_TO_DEPENDENT(d, opaque, dname);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    76
    if (d != NULL)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    77
    {
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    78
        __PHYSFS_platformEnumerateFiles(d, omitSymLinks, cb,
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    79
                                        origdir, callbackdata);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    80
        __PHYSFS_smallFree(d);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    81
    } /* if */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    82
} /* DIR_enumerateFiles */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    83
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    84
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    85
static PHYSFS_Io *doOpen(PHYSFS_Dir *opaque, const char *name,
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    86
                         const int mode, int *fileExists)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    87
{
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    88
    char *f;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    89
    PHYSFS_Io *io = NULL;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    90
    int existtmp = 0;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    91
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    92
    CVT_TO_DEPENDENT(f, opaque, name);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    93
    BAIL_IF_MACRO(!f, ERRPASS, NULL);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    94
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    95
    if (fileExists == NULL)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    96
        fileExists = &existtmp;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    97
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    98
    io = __PHYSFS_createNativeIo(f, mode);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
    99
    if (io == NULL)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   100
    {
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   101
        const PHYSFS_ErrorCode err = PHYSFS_getLastErrorCode();
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   102
        PHYSFS_Stat statbuf;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   103
        __PHYSFS_platformStat(f, fileExists, &statbuf);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   104
        __PHYSFS_setError(err);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   105
    } /* if */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   106
    else
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   107
    {
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   108
        *fileExists = 1;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   109
    } /* else */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   110
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   111
    __PHYSFS_smallFree(f);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   112
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   113
    return io;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   114
} /* doOpen */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   115
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   116
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   117
static PHYSFS_Io *DIR_openRead(PHYSFS_Dir *opaque, const char *fnm, int *exist)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   118
{
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   119
    return doOpen(opaque, fnm, 'r', exist);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   120
} /* DIR_openRead */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   121
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   122
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   123
static PHYSFS_Io *DIR_openWrite(PHYSFS_Dir *opaque, const char *filename)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   124
{
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   125
    return doOpen(opaque, filename, 'w', NULL);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   126
} /* DIR_openWrite */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   127
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   128
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   129
static PHYSFS_Io *DIR_openAppend(PHYSFS_Dir *opaque, const char *filename)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   130
{
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   131
    return doOpen(opaque, filename, 'a', NULL);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   132
} /* DIR_openAppend */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   133
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   134
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   135
static int DIR_remove(PHYSFS_Dir *opaque, const char *name)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   136
{
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   137
    int retval;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   138
    char *f;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   139
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   140
    CVT_TO_DEPENDENT(f, opaque, name);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   141
    BAIL_IF_MACRO(!f, ERRPASS, 0);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   142
    retval = __PHYSFS_platformDelete(f);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   143
    __PHYSFS_smallFree(f);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   144
    return retval;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   145
} /* DIR_remove */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   146
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   147
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   148
static int DIR_mkdir(PHYSFS_Dir *opaque, const char *name)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   149
{
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   150
    int retval;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   151
    char *f;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   152
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   153
    CVT_TO_DEPENDENT(f, opaque, name);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   154
    BAIL_IF_MACRO(!f, ERRPASS, 0);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   155
    retval = __PHYSFS_platformMkDir(f);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   156
    __PHYSFS_smallFree(f);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   157
    return retval;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   158
} /* DIR_mkdir */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   159
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   160
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   161
static void DIR_closeArchive(PHYSFS_Dir *opaque)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   162
{
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   163
    allocator.Free(opaque);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   164
} /* DIR_closeArchive */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   165
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   166
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   167
static int DIR_stat(PHYSFS_Dir *opaque, const char *name,
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   168
                    int *exists, PHYSFS_Stat *stat)
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   169
{
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   170
    int retval = 0;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   171
    char *d;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   172
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   173
    CVT_TO_DEPENDENT(d, opaque, name);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   174
    BAIL_IF_MACRO(!d, ERRPASS, 0);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   175
    retval = __PHYSFS_platformStat(d, exists, stat);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   176
    __PHYSFS_smallFree(d);
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   177
    return retval;
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   178
} /* DIR_stat */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   179
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   180
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   181
const PHYSFS_Archiver __PHYSFS_Archiver_DIR =
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   182
{
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   183
    {
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   184
        "",
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   185
        "Non-archive, direct filesystem I/O",
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   186
        "Ryan C. Gordon <icculus@icculus.org>",
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   187
        "http://icculus.org/physfs/",
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   188
    },
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   189
    DIR_openArchive,        /* openArchive() method    */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   190
    DIR_enumerateFiles,     /* enumerateFiles() method */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   191
    DIR_openRead,           /* openRead() method       */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   192
    DIR_openWrite,          /* openWrite() method      */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   193
    DIR_openAppend,         /* openAppend() method     */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   194
    DIR_remove,             /* remove() method         */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   195
    DIR_mkdir,              /* mkdir() method          */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   196
    DIR_closeArchive,       /* closeArchive() method   */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   197
    DIR_stat                /* stat() method           */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   198
};
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   199
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   200
/* end of dir.c ... */
13e2037ebc79 Try using PhysicsFS.
unc0rr
parents:
diff changeset
   201