API BREAKAGE: Changed PHYSFS_enumerateFilesCallback() to pass the originally
requested directory back to the app.
This commit is contained in:
parent
24ce834f44
commit
6e7e45cdaf
|
@ -2,6 +2,10 @@
|
||||||
* CHANGELOG.
|
* CHANGELOG.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
09182005 - API BREAKAGE: PHYSFS_enumerateFilesCallback() now passes the
|
||||||
|
original directory name back to the app in the callback. This
|
||||||
|
API was only in 1.1.0, and wasn't promised to be stable at this
|
||||||
|
point. Please update your apps.
|
||||||
09092005 - Some tweaks to PHYSFS_Allocator. Apparently configure.in doesn't
|
09092005 - Some tweaks to PHYSFS_Allocator. Apparently configure.in doesn't
|
||||||
work like I thought for version bumps, so it thinks 1.1.0 isn't
|
work like I thought for version bumps, so it thinks 1.1.0 isn't
|
||||||
binary compatible with 1.0...fixed, I think.
|
binary compatible with 1.0...fixed, I think.
|
||||||
|
|
|
@ -104,13 +104,14 @@ static void *DIR_openArchive(const char *name, int forWriting)
|
||||||
|
|
||||||
|
|
||||||
static void DIR_enumerateFiles(dvoid *opaque, const char *dname,
|
static void DIR_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
int omitSymLinks, PHYSFS_StringCallback cb,
|
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
|
||||||
void *callbackdata)
|
const char *origdir, void *callbackdata)
|
||||||
{
|
{
|
||||||
char *d = __PHYSFS_platformCvtToDependent((char *)opaque, dname, NULL);
|
char *d = __PHYSFS_platformCvtToDependent((char *)opaque, dname, NULL);
|
||||||
if (d != NULL)
|
if (d != NULL)
|
||||||
{
|
{
|
||||||
__PHYSFS_platformEnumerateFiles(d, omitSymLinks, cb, callbackdata);
|
__PHYSFS_platformEnumerateFiles(d, omitSymLinks, cb,
|
||||||
|
origdir, callbackdata);
|
||||||
allocator.Free(d);
|
allocator.Free(d);
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* DIR_enumerateFiles */
|
} /* DIR_enumerateFiles */
|
||||||
|
|
|
@ -295,8 +295,8 @@ GRP_openArchive_failed:
|
||||||
|
|
||||||
|
|
||||||
static void GRP_enumerateFiles(dvoid *opaque, const char *dname,
|
static void GRP_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
int omitSymLinks, PHYSFS_StringCallback cb,
|
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
|
||||||
void *callbackdata)
|
const char *origdir, void *callbackdata)
|
||||||
{
|
{
|
||||||
/* no directories in GRP files. */
|
/* no directories in GRP files. */
|
||||||
if (*dname != '\0')
|
if (*dname != '\0')
|
||||||
|
@ -307,7 +307,7 @@ static void GRP_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
PHYSFS_uint32 i;
|
PHYSFS_uint32 i;
|
||||||
|
|
||||||
for (i = 0; i < max; i++, entry++)
|
for (i = 0; i < max; i++, entry++)
|
||||||
cb(callbackdata, entry->name);
|
cb(callbackdata, origdir, entry->name);
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* GRP_enumerateFiles */
|
} /* GRP_enumerateFiles */
|
||||||
|
|
||||||
|
|
|
@ -334,8 +334,8 @@ HOG_openArchive_failed:
|
||||||
|
|
||||||
|
|
||||||
static void HOG_enumerateFiles(dvoid *opaque, const char *dname,
|
static void HOG_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
int omitSymLinks, PHYSFS_StringCallback cb,
|
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
|
||||||
void *callbackdata)
|
const char *origdir, void *callbackdata)
|
||||||
{
|
{
|
||||||
/* no directories in HOG files. */
|
/* no directories in HOG files. */
|
||||||
if (*dname != '\0')
|
if (*dname != '\0')
|
||||||
|
@ -346,7 +346,7 @@ static void HOG_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
PHYSFS_uint32 i;
|
PHYSFS_uint32 i;
|
||||||
|
|
||||||
for (i = 0; i < max; i++, entry++)
|
for (i = 0; i < max; i++, entry++)
|
||||||
cb(callbackdata, entry->name);
|
cb(callbackdata, origdir, entry->name);
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* HOG_enumerateFiles */
|
} /* HOG_enumerateFiles */
|
||||||
|
|
||||||
|
|
|
@ -288,8 +288,8 @@ MIX_openArchive_failed:
|
||||||
|
|
||||||
|
|
||||||
static void MIX_enumerateFiles(dvoid *opaque, const char *dname,
|
static void MIX_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
int omitSymLinks, PHYSFS_StringCallback cb,
|
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
|
||||||
void *callbackdata)
|
const char *origdir, void *callbackdata)
|
||||||
{
|
{
|
||||||
/* no directories in MIX files. */
|
/* no directories in MIX files. */
|
||||||
if (*dirname != '\0')
|
if (*dirname != '\0')
|
||||||
|
@ -302,7 +302,7 @@ static void MIX_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
for (i = 0; i < info->header.num_files; i++, entry++)
|
for (i = 0; i < info->header.num_files; i++, entry++)
|
||||||
{
|
{
|
||||||
sprintf(buffer, "%X", entry->hash);
|
sprintf(buffer, "%X", entry->hash);
|
||||||
cb(callbackdata, buffer);
|
cb(callbackdata, origdir, buffer);
|
||||||
} /* for */
|
} /* for */
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* MIX_enumerateFiles */
|
} /* MIX_enumerateFiles */
|
||||||
|
|
|
@ -291,8 +291,8 @@ MVL_openArchive_failed:
|
||||||
|
|
||||||
|
|
||||||
static void MVL_enumerateFiles(dvoid *opaque, const char *dname,
|
static void MVL_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
int omitSymLinks, PHYSFS_StringCallback cb,
|
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
|
||||||
void *callbackdata)
|
const char *origdir, void *callbackdata)
|
||||||
{
|
{
|
||||||
/* no directories in MVL files. */
|
/* no directories in MVL files. */
|
||||||
if (*dname != '\0')
|
if (*dname != '\0')
|
||||||
|
@ -303,7 +303,7 @@ static void MVL_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
PHYSFS_uint32 i;
|
PHYSFS_uint32 i;
|
||||||
|
|
||||||
for (i = 0; i < max; i++, entry++)
|
for (i = 0; i < max; i++, entry++)
|
||||||
cb(callbackdata, entry->name);
|
cb(callbackdata, origdir, entry->name);
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* MVL_enumerateFiles */
|
} /* MVL_enumerateFiles */
|
||||||
|
|
||||||
|
|
|
@ -379,8 +379,8 @@ static PHYSFS_sint32 qpak_find_start_of_dir(QPAKinfo *info, const char *path,
|
||||||
* Moved to seperate function so we can use alloca then immediately throw
|
* Moved to seperate function so we can use alloca then immediately throw
|
||||||
* away the allocated stack space...
|
* away the allocated stack space...
|
||||||
*/
|
*/
|
||||||
static void doEnumCallback(PHYSFS_StringCallback cb, void *callbackdata,
|
static void doEnumCallback(PHYSFS_EnumFilesCallback cb, void *callbackdata,
|
||||||
const char *str, PHYSFS_sint32 ln)
|
const char *odir, const char *str, PHYSFS_sint32 ln)
|
||||||
{
|
{
|
||||||
char *newstr = alloca(ln + 1);
|
char *newstr = alloca(ln + 1);
|
||||||
if (newstr == NULL)
|
if (newstr == NULL)
|
||||||
|
@ -388,13 +388,13 @@ static void doEnumCallback(PHYSFS_StringCallback cb, void *callbackdata,
|
||||||
|
|
||||||
memcpy(newstr, str, ln);
|
memcpy(newstr, str, ln);
|
||||||
newstr[ln] = '\0';
|
newstr[ln] = '\0';
|
||||||
cb(callbackdata, newstr);
|
cb(callbackdata, odir, newstr);
|
||||||
} /* doEnumCallback */
|
} /* doEnumCallback */
|
||||||
|
|
||||||
|
|
||||||
static void QPAK_enumerateFiles(dvoid *opaque, const char *dname,
|
static void QPAK_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
int omitSymLinks, PHYSFS_StringCallback cb,
|
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
|
||||||
void *callbackdata)
|
const char *origdir, void *callbackdata)
|
||||||
{
|
{
|
||||||
QPAKinfo *info = ((QPAKinfo *) opaque);
|
QPAKinfo *info = ((QPAKinfo *) opaque);
|
||||||
PHYSFS_sint32 dlen, dlen_inc, max, i;
|
PHYSFS_sint32 dlen, dlen_inc, max, i;
|
||||||
|
@ -421,7 +421,7 @@ static void QPAK_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
add = e + dlen_inc;
|
add = e + dlen_inc;
|
||||||
ptr = strchr(add, '/');
|
ptr = strchr(add, '/');
|
||||||
ln = (PHYSFS_sint32) ((ptr) ? ptr-add : strlen(add));
|
ln = (PHYSFS_sint32) ((ptr) ? ptr-add : strlen(add));
|
||||||
doEnumCallback(cb, callbackdata, add, ln);
|
doEnumCallback(cb, callbackdata, origdir, add, ln);
|
||||||
ln += dlen_inc; /* point past entry to children... */
|
ln += dlen_inc; /* point past entry to children... */
|
||||||
|
|
||||||
/* increment counter and skip children of subdirs... */
|
/* increment counter and skip children of subdirs... */
|
||||||
|
|
|
@ -322,8 +322,8 @@ WAD_openArchive_failed:
|
||||||
|
|
||||||
|
|
||||||
static void WAD_enumerateFiles(dvoid *opaque, const char *dname,
|
static void WAD_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
int omitSymLinks, PHYSFS_StringCallback cb,
|
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
|
||||||
void *callbackdata)
|
const char *origdir, void *callbackdata)
|
||||||
{
|
{
|
||||||
WADinfo *info = ((WADinfo *) opaque);
|
WADinfo *info = ((WADinfo *) opaque);
|
||||||
WADentry *entry = info->entries;
|
WADentry *entry = info->entries;
|
||||||
|
@ -338,7 +338,7 @@ static void WAD_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
{
|
{
|
||||||
name = entry->name;
|
name = entry->name;
|
||||||
if (strchr(name, '/') == NULL)
|
if (strchr(name, '/') == NULL)
|
||||||
cb(callbackdata, name);
|
cb(callbackdata, origdir, name);
|
||||||
} /* for */
|
} /* for */
|
||||||
} /* if */
|
} /* if */
|
||||||
else
|
else
|
||||||
|
|
|
@ -1178,8 +1178,8 @@ static PHYSFS_sint32 zip_find_start_of_dir(ZIPinfo *info, const char *path,
|
||||||
* Moved to seperate function so we can use alloca then immediately throw
|
* Moved to seperate function so we can use alloca then immediately throw
|
||||||
* away the allocated stack space...
|
* away the allocated stack space...
|
||||||
*/
|
*/
|
||||||
static void doEnumCallback(PHYSFS_StringCallback cb, void *callbackdata,
|
static void doEnumCallback(PHYSFS_EnumFilesCallback cb, void *callbackdata,
|
||||||
const char *str, PHYSFS_sint32 ln)
|
const char *odir, const char *str, PHYSFS_sint32 ln)
|
||||||
{
|
{
|
||||||
char *newstr = alloca(ln + 1);
|
char *newstr = alloca(ln + 1);
|
||||||
if (newstr == NULL)
|
if (newstr == NULL)
|
||||||
|
@ -1187,13 +1187,13 @@ static void doEnumCallback(PHYSFS_StringCallback cb, void *callbackdata,
|
||||||
|
|
||||||
memcpy(newstr, str, ln);
|
memcpy(newstr, str, ln);
|
||||||
newstr[ln] = '\0';
|
newstr[ln] = '\0';
|
||||||
cb(callbackdata, newstr);
|
cb(callbackdata, odir, newstr);
|
||||||
} /* doEnumCallback */
|
} /* doEnumCallback */
|
||||||
|
|
||||||
|
|
||||||
static void ZIP_enumerateFiles(dvoid *opaque, const char *dname,
|
static void ZIP_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
int omitSymLinks, PHYSFS_StringCallback cb,
|
int omitSymLinks, PHYSFS_EnumFilesCallback cb,
|
||||||
void *callbackdata)
|
const char *origdir, void *callbackdata)
|
||||||
{
|
{
|
||||||
ZIPinfo *info = ((ZIPinfo *) opaque);
|
ZIPinfo *info = ((ZIPinfo *) opaque);
|
||||||
PHYSFS_sint32 dlen, dlen_inc, max, i;
|
PHYSFS_sint32 dlen, dlen_inc, max, i;
|
||||||
|
@ -1221,7 +1221,7 @@ static void ZIP_enumerateFiles(dvoid *opaque, const char *dname,
|
||||||
char *add = e + dlen_inc;
|
char *add = e + dlen_inc;
|
||||||
char *ptr = strchr(add, '/');
|
char *ptr = strchr(add, '/');
|
||||||
PHYSFS_sint32 ln = (PHYSFS_sint32) ((ptr) ? ptr-add : strlen(add));
|
PHYSFS_sint32 ln = (PHYSFS_sint32) ((ptr) ? ptr-add : strlen(add));
|
||||||
doEnumCallback(cb, callbackdata, add, ln);
|
doEnumCallback(cb, callbackdata, origdir, add, ln);
|
||||||
ln += dlen_inc; /* point past entry to children... */
|
ln += dlen_inc; /* point past entry to children... */
|
||||||
|
|
||||||
/* increment counter and skip children of subdirs... */
|
/* increment counter and skip children of subdirs... */
|
||||||
|
|
9
physfs.c
9
physfs.c
|
@ -1494,7 +1494,7 @@ static int locateInStringList(const char *str,
|
||||||
} /* locateInStringList */
|
} /* locateInStringList */
|
||||||
|
|
||||||
|
|
||||||
static void enumFilesCallback(void *data, const char *str)
|
static void enumFilesCallback(void *data, const char *origdir, const char *str)
|
||||||
{
|
{
|
||||||
PHYSFS_uint32 pos;
|
PHYSFS_uint32 pos;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
|
@ -1546,7 +1546,7 @@ char **PHYSFS_enumerateFiles(const char *path)
|
||||||
|
|
||||||
|
|
||||||
void PHYSFS_enumerateFilesCallback(const char *_fname,
|
void PHYSFS_enumerateFilesCallback(const char *_fname,
|
||||||
PHYSFS_StringCallback callback,
|
PHYSFS_EnumFilesCallback callback,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
DirHandle *i;
|
DirHandle *i;
|
||||||
|
@ -1570,13 +1570,14 @@ void PHYSFS_enumerateFilesCallback(const char *_fname,
|
||||||
char *end = strchr(ptr, '/');
|
char *end = strchr(ptr, '/');
|
||||||
assert(end); /* should always find a terminating '/'. */
|
assert(end); /* should always find a terminating '/'. */
|
||||||
*end = '\0'; /* !!! FIXME: not safe in a callback... */
|
*end = '\0'; /* !!! FIXME: not safe in a callback... */
|
||||||
callback(data, ptr);
|
callback(data, _fname, ptr);
|
||||||
*end = '/'; /* !!! FIXME: not safe in a callback... */
|
*end = '/'; /* !!! FIXME: not safe in a callback... */
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
else if (verifyPath(i, &arcfname, 0))
|
else if (verifyPath(i, &arcfname, 0))
|
||||||
{
|
{
|
||||||
i->funcs->enumerateFiles(i->opaque,arcfname,noSyms,callback,data);
|
i->funcs->enumerateFiles(i->opaque, arcfname, noSyms,
|
||||||
|
callback, _fname, data);
|
||||||
} /* else if */
|
} /* else if */
|
||||||
} /* for */
|
} /* for */
|
||||||
__PHYSFS_platformReleaseMutex(stateLock);
|
__PHYSFS_platformReleaseMutex(stateLock);
|
||||||
|
|
5
physfs.h
5
physfs.h
|
@ -1978,14 +1978,15 @@ __EXPORT__ const char *PHYSFS_getMountPoint(const char *dir);
|
||||||
* be holding non recursive mutexes.
|
* be holding non recursive mutexes.
|
||||||
*/
|
*/
|
||||||
/* !!! FIXME: comment! */
|
/* !!! FIXME: comment! */
|
||||||
typedef void (*PHYSFS_StringCallback)(void *data, const char *);
|
typedef void (*PHYSFS_StringCallback)(void *, const char *);
|
||||||
|
typedef void (*PHYSFS_EnumFilesCallback)(void *, const char *, const char *);
|
||||||
|
|
||||||
__EXPORT__ void PHYSFS_getCdRomDirsCallback(PHYSFS_StringCallback c, void *d);
|
__EXPORT__ void PHYSFS_getCdRomDirsCallback(PHYSFS_StringCallback c, void *d);
|
||||||
|
|
||||||
__EXPORT__ void PHYSFS_getSearchPathCallback(PHYSFS_StringCallback c, void *d);
|
__EXPORT__ void PHYSFS_getSearchPathCallback(PHYSFS_StringCallback c, void *d);
|
||||||
|
|
||||||
__EXPORT__ void PHYSFS_enumerateFilesCallback(const char *dir,
|
__EXPORT__ void PHYSFS_enumerateFilesCallback(const char *dir,
|
||||||
PHYSFS_StringCallback c,
|
PHYSFS_EnumFilesCallback c,
|
||||||
void *d);
|
void *d);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -995,7 +995,8 @@ typedef struct
|
||||||
void (*enumerateFiles)(dvoid *opaque,
|
void (*enumerateFiles)(dvoid *opaque,
|
||||||
const char *dirname,
|
const char *dirname,
|
||||||
int omitSymLinks,
|
int omitSymLinks,
|
||||||
PHYSFS_StringCallback callback,
|
PHYSFS_EnumFilesCallback callback,
|
||||||
|
const char *origdir,
|
||||||
void *callbackdata);
|
void *callbackdata);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1568,7 +1569,8 @@ void __PHYSFS_platformTimeslice(void);
|
||||||
*/
|
*/
|
||||||
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
int omitSymLinks,
|
int omitSymLinks,
|
||||||
PHYSFS_StringCallback callback,
|
PHYSFS_EnumFilesCallback callback,
|
||||||
|
const char *origdir,
|
||||||
void *callbackdata);
|
void *callbackdata);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -563,7 +563,8 @@ void __PHYSFS_platformTimeslice(void)
|
||||||
/* returns int so we can use BAIL*MACRO... */
|
/* returns int so we can use BAIL*MACRO... */
|
||||||
static int macClassicEnumerateFiles(const char *dirname,
|
static int macClassicEnumerateFiles(const char *dirname,
|
||||||
int omitSymLinks,
|
int omitSymLinks,
|
||||||
PHYSFS_StringCallback callback,
|
PHYSFS_EnumFilesCallback callback,
|
||||||
|
const char *origdir,
|
||||||
void *callbackdata)
|
void *callbackdata)
|
||||||
{
|
{
|
||||||
UInt16 i;
|
UInt16 i;
|
||||||
|
@ -618,7 +619,7 @@ static int macClassicEnumerateFiles(const char *dirname,
|
||||||
size = (size_t) str255[0]; /* (convert to ASCIZ string...) */
|
size = (size_t) str255[0]; /* (convert to ASCIZ string...) */
|
||||||
memmove(&str255[0], &str255[1], size);
|
memmove(&str255[0], &str255[1], size);
|
||||||
str255[size] = '\0';
|
str255[size] = '\0';
|
||||||
callback(callbackdata, (const char *) str255);
|
callback(callbackdata, origdir, (const char *) str255);
|
||||||
} /* for */
|
} /* for */
|
||||||
|
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -627,10 +628,12 @@ static int macClassicEnumerateFiles(const char *dirname,
|
||||||
|
|
||||||
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
int omitSymLinks,
|
int omitSymLinks,
|
||||||
PHYSFS_StringCallback callback,
|
PHYSFS_EnumFilesCallback callback,
|
||||||
|
const char *origdir,
|
||||||
void *callbackdata)
|
void *callbackdata)
|
||||||
{
|
{
|
||||||
macClassicEnumerateFiles(dirname, omitSymLinks, callback, callbackdata);
|
macClassicEnumerateFiles(dirname, omitSymLinks, callback,
|
||||||
|
origdir, callbackdata);
|
||||||
} /* __PHYSFS_platformEnumerateFiles */
|
} /* __PHYSFS_platformEnumerateFiles */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -398,7 +398,8 @@ char *__PHYSFS_platformCvtToDependent(const char *prepend,
|
||||||
|
|
||||||
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
int omitSymLinks,
|
int omitSymLinks,
|
||||||
PHYSFS_StringCallback callback,
|
PHYSFS_EnumFilesCallback callback,
|
||||||
|
const char *origdir,
|
||||||
void *callbackdata)
|
void *callbackdata)
|
||||||
{
|
{
|
||||||
char spec[CCHMAXPATH];
|
char spec[CCHMAXPATH];
|
||||||
|
@ -427,7 +428,7 @@ void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
while (count == 1)
|
while (count == 1)
|
||||||
{
|
{
|
||||||
if ((strcmp(fb.achName, ".") != 0) && (strcmp(fb.achName, "..") != 0))
|
if ((strcmp(fb.achName, ".") != 0) && (strcmp(fb.achName, "..") != 0))
|
||||||
callback(callbackdata, fb.achName);
|
callback(callbackdata, origdir, fb.achName);
|
||||||
|
|
||||||
DosFindNext(hdir, &fb, sizeof (fb), &count);
|
DosFindNext(hdir, &fb, sizeof (fb), &count);
|
||||||
} /* while */
|
} /* while */
|
||||||
|
|
|
@ -296,7 +296,8 @@ void __PHYSFS_platformTimeslice(void)
|
||||||
|
|
||||||
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
int omitSymLinks,
|
int omitSymLinks,
|
||||||
PHYSFS_StringCallback callback,
|
PHYSFS_EnumFilesCallback callback,
|
||||||
|
const char *origdir,
|
||||||
void *callbackdata)
|
void *callbackdata)
|
||||||
{
|
{
|
||||||
HANDLE dir;
|
HANDLE dir;
|
||||||
|
@ -346,7 +347,7 @@ void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
if (str == NULL)
|
if (str == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
callback(callbackdata, str);
|
callback(callbackdata, origdir, str);
|
||||||
allocator.Free(str);
|
allocator.Free(str);
|
||||||
} while (FindNextFile(dir, &ent) != 0);
|
} while (FindNextFile(dir, &ent) != 0);
|
||||||
|
|
||||||
|
|
|
@ -227,7 +227,8 @@ char *__PHYSFS_platformCvtToDependent(const char *prepend,
|
||||||
|
|
||||||
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
int omitSymLinks,
|
int omitSymLinks,
|
||||||
PHYSFS_StringCallback callback,
|
PHYSFS_EnumFilesCallback callback,
|
||||||
|
const char *origdir,
|
||||||
void *callbackdata)
|
void *callbackdata)
|
||||||
{
|
{
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
|
@ -286,7 +287,7 @@ void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
continue;
|
continue;
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
callback(callbackdata, ent->d_name);
|
callback(callbackdata, origdir, ent->d_name);
|
||||||
} /* while */
|
} /* while */
|
||||||
|
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
|
|
|
@ -106,7 +106,8 @@ void __PHYSFS_platformTimeslice(void)
|
||||||
|
|
||||||
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
int omitSymLinks,
|
int omitSymLinks,
|
||||||
PHYSFS_StringCallback callback,
|
PHYSFS_EnumFilesCallback callback,
|
||||||
|
const char *origdir,
|
||||||
void *callbackdata)
|
void *callbackdata)
|
||||||
{
|
{
|
||||||
} /* __PHYSFS_platformEnumerateFiles */
|
} /* __PHYSFS_platformEnumerateFiles */
|
||||||
|
|
|
@ -440,7 +440,8 @@ void __PHYSFS_platformTimeslice(void)
|
||||||
|
|
||||||
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
int omitSymLinks,
|
int omitSymLinks,
|
||||||
PHYSFS_StringCallback callback,
|
PHYSFS_EnumFilesCallback callback,
|
||||||
|
const char *origdir,
|
||||||
void *callbackdata)
|
void *callbackdata)
|
||||||
{
|
{
|
||||||
HANDLE dir;
|
HANDLE dir;
|
||||||
|
@ -478,7 +479,7 @@ void __PHYSFS_platformEnumerateFiles(const char *dirname,
|
||||||
if (strcmp(ent.cFileName, "..") == 0)
|
if (strcmp(ent.cFileName, "..") == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
callback(callbackdata, ent.cFileName);
|
callback(callbackdata, origdir, ent.cFileName);
|
||||||
} while (FindNextFile(dir, &ent) != 0);
|
} while (FindNextFile(dir, &ent) != 0);
|
||||||
|
|
||||||
FindClose(dir);
|
FindClose(dir);
|
||||||
|
|
Loading…
Reference in New Issue