Removed the reserved parameter from SDL_EnumerateDirectoryCallback

If someone needs to, say, include an SDL_Storage object, they can simply point userdata at a structure that includes the the storage and any other data needed in enumeration.
This commit is contained in:
Sam Lantinga
2024-03-16 09:18:32 -07:00
parent ec3ba387d1
commit 7a088527c1
5 changed files with 10 additions and 10 deletions

View File

@@ -50,5 +50,5 @@ int SDL_SYS_FSstat(const char *fullpath, SDL_PathInfo *st)
return SDL_Unsupported();
}
#endif
#endif // SDL_FSOPS_DUMMY

View File

@@ -47,7 +47,7 @@ int SDL_SYS_FSenumerate(const char *fullpath, const char *dirname, SDL_Enumerate
if ((SDL_strcmp(name, ".") == 0) || (SDL_strcmp(name, "..") == 0)) {
continue;
}
retval = cb(userdata, NULL, dirname, name);
retval = cb(userdata, dirname, name);
}
closedir(dir);
@@ -134,5 +134,5 @@ int SDL_SYS_FSstat(const char *fullpath, SDL_PathInfo *info)
return 0;
}
#endif
#endif // SDL_FSOPS_POSIX

View File

@@ -35,7 +35,7 @@ int SDL_SYS_FSenumerate(const char *fullpath, const char *dirname, SDL_Enumerate
for (int i = 'A'; (retval == 1) && (i <= 'Z'); i++) {
if (drives & (1 << (i - 'A'))) {
name[0] = (char) i;
retval = cb(userdata, NULL, dirname, name);
retval = cb(userdata, dirname, name);
}
}
} else {
@@ -49,7 +49,7 @@ int SDL_SYS_FSenumerate(const char *fullpath, const char *dirname, SDL_Enumerate
// filename element at the end of the path string, so always tack on a "\\*" to get everything, and
// also prevent any wildcards inserted by the app from being respected.
SDL_snprintf(pattern, patternlen, "%s\\*", fullpath);
WCHAR *wpattern = WIN_UTF8ToString(pattern);
SDL_free(pattern);
if (!wpattern) {
@@ -76,7 +76,7 @@ int SDL_SYS_FSenumerate(const char *fullpath, const char *dirname, SDL_Enumerate
if (!utf8fn) {
retval = -1;
} else {
retval = cb(userdata, NULL, dirname, utf8fn);
retval = cb(userdata, dirname, utf8fn);
SDL_free(utf8fn);
}
} while ((retval == 1) && (FindNextFileW(dir, &entw) != 0));
@@ -184,5 +184,5 @@ int SDL_SYS_FSstat(const char *fullpath, SDL_PathInfo *info)
return 1;
}
#endif
#endif // SDL_FSOPS_WINDOWS