diff options
Diffstat (limited to 'src/gfile/gfile.c')
-rw-r--r-- | src/gfile/gfile.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gfile/gfile.c b/src/gfile/gfile.c index 7af27cbf..a410a801 100644 --- a/src/gfile/gfile.c +++ b/src/gfile/gfile.c @@ -56,6 +56,8 @@ typedef struct GFILEVMT { bool_t (*setpos) (GFILE *f, long int pos); long int (*getsize) (GFILE *f); bool_t (*eof) (GFILE *f); + bool_t (*mount) (const char *drive); + bool_t (*unmount) (const char *drive); } GFILEVMT; // The chain of FileSystems @@ -475,6 +477,36 @@ bool_t gfileEOF(GFILE *f) { return f->vmt->eof(f); } +#if GFILE_NEED_FATFS + bool_t gfileMount(char fs, const char* drive) { + const GFILEVMT *p; + + // Find the correct VMT + for(p = FsChain; p; p = p->next) { + if (p->prefix == fs) { + if (!p->mount) + return FALSE; + return p->mount(drive); + } + } + return FALSE; + } + + bool_t gfileUnmount(char fs, const char* drive) { + const GFILEVMT *p; + + // Find the correct VMT + for(p = FsChain; p; p = p->next) { + if (p->prefix == fs) { + if (!p->mount) + return FALSE; + return p->unmount(drive); + } + } + return FALSE; + } +#endif + /******************************************************** * String VMT routines ********************************************************/ |