aboutsummaryrefslogtreecommitdiffstats
path: root/src/gfile
diff options
context:
space:
mode:
authorinmarket <inmarket@ugfx.org>2017-01-09 10:25:30 +1000
committerinmarket <inmarket@ugfx.org>2017-01-09 10:25:30 +1000
commitc7cce84274a8843f036a128fbb0185c84feaabc1 (patch)
treeda96e85ffcff68c146baed36448fd76ba831b127 /src/gfile
parent9216504ce3f825f59494facac637ded42f1cbe04 (diff)
downloaduGFX-c7cce84274a8843f036a128fbb0185c84feaabc1.tar.gz
uGFX-c7cce84274a8843f036a128fbb0185c84feaabc1.tar.bz2
uGFX-c7cce84274a8843f036a128fbb0185c84feaabc1.zip
Add support for a user provided file system.
Diffstat (limited to 'src/gfile')
-rw-r--r--src/gfile/gfile.c6
-rw-r--r--src/gfile/gfile_options.h15
2 files changed, 21 insertions, 0 deletions
diff --git a/src/gfile/gfile.c b/src/gfile/gfile.c
index a7731130..4bc39189 100644
--- a/src/gfile/gfile.c
+++ b/src/gfile/gfile.c
@@ -16,6 +16,9 @@
* Virtual file-systems that have special open() calls do not need to
* be in this list.
*/
+#if GFILE_NEED_USERFS
+ extern const GFILEVMT FsUSERVMT;
+#endif
#if GFILE_NEED_ROMFS
extern const GFILEVMT FsROMVMT;
#endif
@@ -35,6 +38,9 @@
* that they are searched to find a file.
*/
static const GFILEVMT const * FsArray[] = {
+ #if GFILE_NEED_USERFS
+ &FsUSERVMT,
+ #endif
#if GFILE_NEED_ROMFS
&FsROMVMT,
#endif
diff --git a/src/gfile/gfile_options.h b/src/gfile/gfile_options.h
index ab23a1cb..7b157b9f 100644
--- a/src/gfile/gfile_options.h
+++ b/src/gfile/gfile_options.h
@@ -76,6 +76,21 @@
#define GFILE_NEED_STDIO FALSE
#endif
/**
+ * @brief Include the USER file system
+ * @details Defaults to FALSE
+ * @note The User FS vmt strcture 'FsUSERVMT' must be defined and implemented in the user's project.
+ * @note If GFILE_ALLOW_DEVICESPECIFIC is on then you can ensure that you are
+ * opening a file on the USER file system by prefixing
+ * its name with "U|" (the letter 'U', followed by a vertical bar).
+ * The letter 'U' as described above should be replaced by the actual
+ * device specifier letter in the user's FsUSERVMT structure. It is suggested
+ * that it is actually the letter 'U' that is used and it is important that the letter
+ * used is not one used by the other file systems.
+ */
+ #ifndef GFILE_NEED_USERFS
+ #define GFILE_NEED_USERFS FALSE
+ #endif
+ /**
* @brief Include the ROM file system
* @details Defaults to FALSE
* @note If GFILE_ALLOW_DEVICESPECIFIC is on then you can ensure that you are