Core: Add ENABLE_DIRECTORIES to optionally slim down VFS further
This commit is contained in:
parent
c302d99d1b
commit
51e813aa9a
@ -857,7 +857,7 @@ if(ENABLE_SCRIPTING)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_VFS)
|
if(ENABLE_VFS)
|
||||||
list(APPEND ENABLES VFS)
|
list(APPEND ENABLES VFS DIRECTORIES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(FEATURE IN LISTS FEATURES)
|
foreach(FEATURE IN LISTS FEATURES)
|
||||||
@ -1001,7 +1001,7 @@ endif()
|
|||||||
|
|
||||||
if(BUILD_LIBRETRO)
|
if(BUILD_LIBRETRO)
|
||||||
file(GLOB RETRO_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/libretro/*.c)
|
file(GLOB RETRO_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/libretro/*.c)
|
||||||
add_library(${BINARY_NAME}_libretro SHARED ${CORE_SRC} ${RETRO_SRC} ${VFS_SRC})
|
add_library(${BINARY_NAME}_libretro SHARED ${CORE_SRC} ${RETRO_SRC} ${CORE_VFS_SRC})
|
||||||
add_dependencies(${BINARY_NAME}_libretro ${BINARY_NAME}-version-info)
|
add_dependencies(${BINARY_NAME}_libretro ${BINARY_NAME}-version-info)
|
||||||
set_target_properties(${BINARY_NAME}_libretro PROPERTIES PREFIX "" COMPILE_DEFINITIONS "__LIBRETRO__;COLOR_16_BIT;COLOR_5_6_5;DISABLE_THREADING;MGBA_STANDALONE;${OS_DEFINES};${FUNCTION_DEFINES};ENABLE_VFS;MINIMAL_CORE=2")
|
set_target_properties(${BINARY_NAME}_libretro PROPERTIES PREFIX "" COMPILE_DEFINITIONS "__LIBRETRO__;COLOR_16_BIT;COLOR_5_6_5;DISABLE_THREADING;MGBA_STANDALONE;${OS_DEFINES};${FUNCTION_DEFINES};ENABLE_VFS;MINIMAL_CORE=2")
|
||||||
target_link_libraries(${BINARY_NAME}_libretro ${OS_LIB})
|
target_link_libraries(${BINARY_NAME}_libretro ${OS_LIB})
|
||||||
|
@ -50,7 +50,7 @@ struct VFile {
|
|||||||
bool (*sync)(struct VFile* vf, void* buffer, size_t size);
|
bool (*sync)(struct VFile* vf, void* buffer, size_t size);
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
struct VDirEntry {
|
struct VDirEntry {
|
||||||
const char* (*name)(struct VDirEntry* vde);
|
const char* (*name)(struct VDirEntry* vde);
|
||||||
enum VFSType (*type)(struct VDirEntry* vde);
|
enum VFSType (*type)(struct VDirEntry* vde);
|
||||||
@ -64,7 +64,9 @@ struct VDir {
|
|||||||
struct VDir* (*openDir)(struct VDir* vd, const char* name);
|
struct VDir* (*openDir)(struct VDir* vd, const char* name);
|
||||||
bool (*deleteFile)(struct VDir* vd, const char* name);
|
bool (*deleteFile)(struct VDir* vd, const char* name);
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_VFS
|
||||||
struct VFile* VFileOpen(const char* path, int flags);
|
struct VFile* VFileOpen(const char* path, int flags);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -85,7 +87,7 @@ struct VFile* VFileMemChunk(const void* mem, size_t size);
|
|||||||
struct mCircleBuffer;
|
struct mCircleBuffer;
|
||||||
struct VFile* VFileFIFO(struct mCircleBuffer* backing);
|
struct VFile* VFileFIFO(struct mCircleBuffer* backing);
|
||||||
|
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
struct VDir* VDirOpen(const char* path);
|
struct VDir* VDirOpen(const char* path);
|
||||||
struct VDir* VDirOpenArchive(const char* path);
|
struct VDir* VDirOpenArchive(const char* path);
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ bool mCheatSaveFile(struct mCheatDevice*, struct VFile*);
|
|||||||
bool mCheatParseLibretroFile(struct mCheatDevice*, struct VFile*);
|
bool mCheatParseLibretroFile(struct mCheatDevice*, struct VFile*);
|
||||||
bool mCheatParseEZFChtFile(struct mCheatDevice*, struct VFile*);
|
bool mCheatParseEZFChtFile(struct mCheatDevice*, struct VFile*);
|
||||||
|
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
void mCheatAutosave(struct mCheatDevice*);
|
void mCheatAutosave(struct mCheatDevice*);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ struct mCore {
|
|||||||
struct mDebuggerSymbols* symbolTable;
|
struct mDebuggerSymbols* symbolTable;
|
||||||
struct mVideoLogger* videoLogger;
|
struct mVideoLogger* videoLogger;
|
||||||
|
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
struct mDirectorySet dirs;
|
struct mDirectorySet dirs;
|
||||||
#endif
|
#endif
|
||||||
#ifndef MINIMAL_CORE
|
#ifndef MINIMAL_CORE
|
||||||
@ -188,18 +188,20 @@ bool mCorePreloadFile(struct mCore* core, const char* path);
|
|||||||
bool mCorePreloadVFCB(struct mCore* core, struct VFile* vf, void (cb)(size_t, size_t, void*), void* context);
|
bool mCorePreloadVFCB(struct mCore* core, struct VFile* vf, void (cb)(size_t, size_t, void*), void* context);
|
||||||
bool mCorePreloadFileCB(struct mCore* core, const char* path, void (cb)(size_t, size_t, void*), void* context);
|
bool mCorePreloadFileCB(struct mCore* core, const char* path, void (cb)(size_t, size_t, void*), void* context);
|
||||||
|
|
||||||
|
bool mCoreLoadSaveFile(struct mCore* core, const char* path, bool temporary);
|
||||||
|
|
||||||
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
bool mCoreAutoloadSave(struct mCore* core);
|
bool mCoreAutoloadSave(struct mCore* core);
|
||||||
bool mCoreAutoloadPatch(struct mCore* core);
|
bool mCoreAutoloadPatch(struct mCore* core);
|
||||||
bool mCoreAutoloadCheats(struct mCore* core);
|
bool mCoreAutoloadCheats(struct mCore* core);
|
||||||
|
|
||||||
bool mCoreLoadSaveFile(struct mCore* core, const char* path, bool temporary);
|
|
||||||
|
|
||||||
bool mCoreSaveState(struct mCore* core, int slot, int flags);
|
bool mCoreSaveState(struct mCore* core, int slot, int flags);
|
||||||
bool mCoreLoadState(struct mCore* core, int slot, int flags);
|
bool mCoreLoadState(struct mCore* core, int slot, int flags);
|
||||||
struct VFile* mCoreGetState(struct mCore* core, int slot, bool write);
|
struct VFile* mCoreGetState(struct mCore* core, int slot, bool write);
|
||||||
void mCoreDeleteState(struct mCore* core, int slot);
|
void mCoreDeleteState(struct mCore* core, int slot);
|
||||||
|
|
||||||
void mCoreTakeScreenshot(struct mCore* core);
|
void mCoreTakeScreenshot(struct mCore* core);
|
||||||
|
#endif
|
||||||
bool mCoreTakeScreenshotVF(struct mCore* core, struct VFile* vf);
|
bool mCoreTakeScreenshotVF(struct mCore* core, struct VFile* vf);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
CXX_GUARD_START
|
CXX_GUARD_START
|
||||||
|
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
struct VDir;
|
struct VDir;
|
||||||
|
|
||||||
struct mDirectorySet {
|
struct mDirectorySet {
|
||||||
|
@ -622,7 +622,7 @@ bool mCheatSaveFile(struct mCheatDevice* device, struct VFile* vf) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
void mCheatAutosave(struct mCheatDevice* device) {
|
void mCheatAutosave(struct mCheatDevice* device) {
|
||||||
if (!device->autosave) {
|
if (!device->autosave) {
|
||||||
return;
|
return;
|
||||||
|
@ -96,8 +96,9 @@ struct mCore* mCoreCreate(enum mPlatform platform) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct mCore* mCoreFind(const char* path) {
|
struct mCore* mCoreFind(const char* path) {
|
||||||
struct VDir* archive = VDirOpenArchive(path);
|
|
||||||
struct mCore* core = NULL;
|
struct mCore* core = NULL;
|
||||||
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
|
struct VDir* archive = VDirOpenArchive(path);
|
||||||
if (archive) {
|
if (archive) {
|
||||||
struct VDirEntry* dirent = archive->listNext(archive);
|
struct VDirEntry* dirent = archive->listNext(archive);
|
||||||
while (dirent) {
|
while (dirent) {
|
||||||
@ -114,7 +115,9 @@ struct mCore* mCoreFind(const char* path) {
|
|||||||
dirent = archive->listNext(archive);
|
dirent = archive->listNext(archive);
|
||||||
}
|
}
|
||||||
archive->close(archive);
|
archive->close(archive);
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
struct VFile* vf = VFileOpen(path, O_RDONLY);
|
struct VFile* vf = VFileOpen(path, O_RDONLY);
|
||||||
if (!vf) {
|
if (!vf) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -133,7 +136,15 @@ bool mCoreLoadFile(struct mCore* core, const char* path) {
|
|||||||
#ifdef FIXED_ROM_BUFFER
|
#ifdef FIXED_ROM_BUFFER
|
||||||
return mCorePreloadFile(core, path);
|
return mCorePreloadFile(core, path);
|
||||||
#else
|
#else
|
||||||
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
struct VFile* rom = mDirectorySetOpenPath(&core->dirs, path, core->isROM);
|
struct VFile* rom = mDirectorySetOpenPath(&core->dirs, path, core->isROM);
|
||||||
|
#else
|
||||||
|
struct VFile* rom = VFileOpen(path, O_RDONLY);
|
||||||
|
if (rom && !core->isROM(rom)) {
|
||||||
|
rom->close(rom);
|
||||||
|
rom = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!rom) {
|
if (!rom) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -210,7 +221,15 @@ bool mCorePreloadVFCB(struct mCore* core, struct VFile* vf, void (cb)(size_t, si
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool mCorePreloadFileCB(struct mCore* core, const char* path, void (cb)(size_t, size_t, void*), void* context) {
|
bool mCorePreloadFileCB(struct mCore* core, const char* path, void (cb)(size_t, size_t, void*), void* context) {
|
||||||
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
struct VFile* rom = mDirectorySetOpenPath(&core->dirs, path, core->isROM);
|
struct VFile* rom = mDirectorySetOpenPath(&core->dirs, path, core->isROM);
|
||||||
|
#else
|
||||||
|
struct VFile* rom = VFileOpen(path, O_RDONLY);
|
||||||
|
if (rom && !core->isROM(rom)) {
|
||||||
|
rom->close(rom);
|
||||||
|
rom = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!rom) {
|
if (!rom) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -222,6 +241,19 @@ bool mCorePreloadFileCB(struct mCore* core, const char* path, void (cb)(size_t,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool mCoreLoadSaveFile(struct mCore* core, const char* path, bool temporary) {
|
||||||
|
struct VFile* vf = VFileOpen(path, O_CREAT | O_RDWR);
|
||||||
|
if (!vf) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (temporary) {
|
||||||
|
return core->loadTemporarySave(core, vf);
|
||||||
|
} else {
|
||||||
|
return core->loadSave(core, vf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
bool mCoreAutoloadSave(struct mCore* core) {
|
bool mCoreAutoloadSave(struct mCore* core) {
|
||||||
if (!core->dirs.save) {
|
if (!core->dirs.save) {
|
||||||
return false;
|
return false;
|
||||||
@ -277,18 +309,6 @@ bool mCoreAutoloadCheats(struct mCore* core) {
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mCoreLoadSaveFile(struct mCore* core, const char* path, bool temporary) {
|
|
||||||
struct VFile* vf = VFileOpen(path, O_CREAT | O_RDWR);
|
|
||||||
if (!vf) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (temporary) {
|
|
||||||
return core->loadTemporarySave(core, vf);
|
|
||||||
} else {
|
|
||||||
return core->loadSave(core, vf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool mCoreSaveState(struct mCore* core, int slot, int flags) {
|
bool mCoreSaveState(struct mCore* core, int slot, int flags) {
|
||||||
struct VFile* vf = mCoreGetState(core, slot, true);
|
struct VFile* vf = mCoreGetState(core, slot, true);
|
||||||
if (!vf) {
|
if (!vf) {
|
||||||
@ -373,6 +393,7 @@ void mCoreTakeScreenshot(struct mCore* core) {
|
|||||||
mLOG(STATUS, WARN, "Failed to take screenshot");
|
mLOG(STATUS, WARN, "Failed to take screenshot");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
bool mCoreTakeScreenshotVF(struct mCore* core, struct VFile* vf) {
|
bool mCoreTakeScreenshotVF(struct mCore* core, struct VFile* vf) {
|
||||||
#ifdef USE_PNG
|
#ifdef USE_PNG
|
||||||
@ -406,7 +427,7 @@ void mCoreLoadConfig(struct mCore* core) {
|
|||||||
|
|
||||||
void mCoreLoadForeignConfig(struct mCore* core, const struct mCoreConfig* config) {
|
void mCoreLoadForeignConfig(struct mCore* core, const struct mCoreConfig* config) {
|
||||||
mCoreConfigMap(config, &core->opts);
|
mCoreConfigMap(config, &core->opts);
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
mDirectorySetMapOptions(&core->dirs, &core->opts);
|
mDirectorySetMapOptions(&core->dirs, &core->opts);
|
||||||
#endif
|
#endif
|
||||||
if (core->opts.audioBuffers) {
|
if (core->opts.audioBuffers) {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include <mgba/core/config.h>
|
#include <mgba/core/config.h>
|
||||||
#include <mgba-util/vfs.h>
|
#include <mgba-util/vfs.h>
|
||||||
|
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
void mDirectorySetInit(struct mDirectorySet* dirs) {
|
void mDirectorySetInit(struct mDirectorySet* dirs) {
|
||||||
dirs->base = NULL;
|
dirs->base = NULL;
|
||||||
dirs->archive = NULL;
|
dirs->archive = NULL;
|
||||||
|
@ -53,6 +53,10 @@
|
|||||||
#cmakedefine ENABLE_DEBUGGERS
|
#cmakedefine ENABLE_DEBUGGERS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ENABLE_DIRECTORIES
|
||||||
|
#cmakedefine ENABLE_DIRECTORIES
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef ENABLE_GDB_STUB
|
#ifndef ENABLE_GDB_STUB
|
||||||
#cmakedefine ENABLE_GDB_STUB
|
#cmakedefine ENABLE_GDB_STUB
|
||||||
#endif
|
#endif
|
||||||
|
@ -150,7 +150,7 @@ static bool _GBCoreInit(struct mCore* core) {
|
|||||||
gbcore->keys = 0;
|
gbcore->keys = 0;
|
||||||
gb->keySource = &gbcore->keys;
|
gb->keySource = &gbcore->keys;
|
||||||
|
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
mDirectorySetInit(&core->dirs);
|
mDirectorySetInit(&core->dirs);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ static void _GBCoreDeinit(struct mCore* core) {
|
|||||||
GBDestroy(core->board);
|
GBDestroy(core->board);
|
||||||
mappedMemoryFree(core->cpu, sizeof(struct SM83Core));
|
mappedMemoryFree(core->cpu, sizeof(struct SM83Core));
|
||||||
mappedMemoryFree(core->board, sizeof(struct GB));
|
mappedMemoryFree(core->board, sizeof(struct GB));
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
mDirectorySetDeinit(&core->dirs);
|
mDirectorySetDeinit(&core->dirs);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_DEBUGGERS
|
#ifdef ENABLE_DEBUGGERS
|
||||||
@ -651,6 +651,7 @@ static void _GBCoreReset(struct mCore* core) {
|
|||||||
bios = NULL;
|
bios = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
if (!found) {
|
if (!found) {
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
mCoreConfigDirectory(path, PATH_MAX);
|
mCoreConfigDirectory(path, PATH_MAX);
|
||||||
@ -679,6 +680,7 @@ static void _GBCoreReset(struct mCore* core) {
|
|||||||
bios = NULL;
|
bios = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (found && bios) {
|
if (found && bios) {
|
||||||
GBLoadBIOS(gb, bios);
|
GBLoadBIOS(gb, bios);
|
||||||
}
|
}
|
||||||
@ -1128,7 +1130,7 @@ static void _GBCoreLoadSymbols(struct mCore* core, struct VFile* vf) {
|
|||||||
if (!core->symbolTable) {
|
if (!core->symbolTable) {
|
||||||
core->symbolTable = mDebuggerSymbolTableCreate();
|
core->symbolTable = mDebuggerSymbolTableCreate();
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
if (!vf && core->dirs.base) {
|
if (!vf && core->dirs.base) {
|
||||||
vf = mDirectorySetOpenSuffix(&core->dirs, core->dirs.base, ".sym", O_RDONLY);
|
vf = mDirectorySetOpenSuffix(&core->dirs, core->dirs.base, ".sym", O_RDONLY);
|
||||||
}
|
}
|
||||||
|
@ -296,7 +296,7 @@ static bool _GBACoreInit(struct mCore* core) {
|
|||||||
gbacore->proxyRenderer.logger = NULL;
|
gbacore->proxyRenderer.logger = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
mDirectorySetInit(&core->dirs);
|
mDirectorySetInit(&core->dirs);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -308,7 +308,7 @@ static void _GBACoreDeinit(struct mCore* core) {
|
|||||||
GBADestroy(core->board);
|
GBADestroy(core->board);
|
||||||
mappedMemoryFree(core->cpu, sizeof(struct ARMCore));
|
mappedMemoryFree(core->cpu, sizeof(struct ARMCore));
|
||||||
mappedMemoryFree(core->board, sizeof(struct GBA));
|
mappedMemoryFree(core->board, sizeof(struct GBA));
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
mDirectorySetDeinit(&core->dirs);
|
mDirectorySetDeinit(&core->dirs);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_DEBUGGERS
|
#ifdef ENABLE_DEBUGGERS
|
||||||
@ -1352,7 +1352,7 @@ static void _GBACoreLoadSymbols(struct mCore* core, struct VFile* vf) {
|
|||||||
seek = vf->seek(vf, 0, SEEK_CUR);
|
seek = vf->seek(vf, 0, SEEK_CUR);
|
||||||
vf->seek(vf, 0, SEEK_SET);
|
vf->seek(vf, 0, SEEK_SET);
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
#ifdef USE_ELF
|
#ifdef USE_ELF
|
||||||
if (!vf && core->dirs.base) {
|
if (!vf && core->dirs.base) {
|
||||||
closeAfter = true;
|
closeAfter = true;
|
||||||
|
@ -103,6 +103,7 @@ struct VFile* VFileOpen(const char* path, int flags) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_DIRECTORIES
|
||||||
struct VDir* VDirOpenArchive(const char* path) {
|
struct VDir* VDirOpenArchive(const char* path) {
|
||||||
struct VDir* dir = 0;
|
struct VDir* dir = 0;
|
||||||
UNUSED(path);
|
UNUSED(path);
|
||||||
@ -119,6 +120,7 @@ struct VDir* VDirOpenArchive(const char* path) {
|
|||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
ssize_t VFileReadline(struct VFile* vf, char* buffer, size_t size) {
|
ssize_t VFileReadline(struct VFile* vf, char* buffer, size_t size) {
|
||||||
size_t bytesRead = 0;
|
size_t bytesRead = 0;
|
||||||
@ -250,7 +252,7 @@ void makeAbsolute(const char* path, const char* base, char* out) {
|
|||||||
strncpy(out, buf, PATH_MAX);
|
strncpy(out, buf, PATH_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_VFS
|
#if defined(ENABLE_VFS) && defined(ENABLE_DIRECTORIES)
|
||||||
struct VFile* VDirFindFirst(struct VDir* dir, bool (*filter)(struct VFile*)) {
|
struct VFile* VDirFindFirst(struct VDir* dir, bool (*filter)(struct VFile*)) {
|
||||||
dir->rewind(dir);
|
dir->rewind(dir);
|
||||||
struct VDirEntry* dirent = dir->listNext(dir);
|
struct VDirEntry* dirent = dir->listNext(dir);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user