diff options
author | inmarket <andrewh@inmarket.com.au> | 2014-02-07 01:34:38 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2014-02-07 01:34:38 +1000 |
commit | e72e2705381558ff2347543ed21b853a1168858c (patch) | |
tree | f0e3026640e71e4a78b9d8f46bb9daea7cee8743 /include | |
parent | 9ef10b9ec669bd6af0747b083b1b61b4a041e206 (diff) | |
download | uGFX-e72e2705381558ff2347543ed21b853a1168858c.tar.gz uGFX-e72e2705381558ff2347543ed21b853a1168858c.tar.bz2 uGFX-e72e2705381558ff2347543ed21b853a1168858c.zip |
Add support for GFILEs based on BaseFileStreams and Memory Pointers
Diffstat (limited to 'include')
-rw-r--r-- | include/gfile/gfile.h | 13 | ||||
-rw-r--r-- | include/gfile/options.h | 35 |
2 files changed, 32 insertions, 16 deletions
diff --git a/include/gfile/gfile.h b/include/gfile/gfile.h index 6cd2d9ad..b615cb8a 100644 --- a/include/gfile/gfile.h +++ b/include/gfile/gfile.h @@ -21,7 +21,7 @@ #include "gfx.h" -#if GFX_USE_GMISC || defined(__DOXYGEN__) +#if GFX_USE_GFILE || defined(__DOXYGEN__) /*===========================================================================*/ /* Type definitions */ @@ -99,6 +99,13 @@ extern "C" { long int gfileGetSize(GFILE *f); bool_t gfileEOF(GFILE *f); + #if GFILE_NEED_CHIBIOSFS && GFX_USE_OS_CHIBIOS + GFILE * gfileOpenBaseFileStream(void *BaseFileStreamPtr, const char *mode); + #endif + #if GFILE_NEED_MEMFS + GFILE * gfileOpenMemory(void *memptr, const char *mode); + #endif + #if GFILE_NEED_PRINTG int vfnprintg(GFILE *f, int maxlen, const char *fmt, va_list arg); int fnprintg(GFILE *f, int maxlen, const char *fmt, ...); @@ -192,8 +199,8 @@ extern "C" { } #endif -#endif /* GFX_USE_MISC */ +#endif /* GFX_USE_GFILE */ -#endif /* _GMISC_H */ +#endif /* _GFILE_H */ /** @} */ diff --git a/include/gfile/options.h b/include/gfile/options.h index 55c37f8e..d73af02c 100644 --- a/include/gfile/options.h +++ b/include/gfile/options.h @@ -44,13 +44,6 @@ #define GFILE_NEED_STRINGS FALSE #endif /** - * @brief Include scang, fscang, sscang etc functions - * @details Defaults to FALSE - */ - #ifndef GFILE_NEED_SCANG - #define GFILE_NEED_SCANG FALSE - #endif - /** * @brief Map many stdio functions to their GFILE equivalent * @details Defaults to FALSE * @note This replaces the functions in stdio.h with equivalents @@ -108,6 +101,28 @@ #ifndef GFILE_NEED_NATIVEFS #define GFILE_NEED_NATIVEFS FALSE #endif + /** + * @brief Include ChibiOS BaseFileStream support + * @details Defaults to FALSE + * @pre This is only relevant on the ChibiOS operating system. + * @note Use the @p gfileOpenBaseFileStream() call to open a GFILE based on a + * BaseFileStream. The BaseFileStream must already be open. + * @note A GFile of this type cannot be opened by filename. The BaseFileStream + * must be pre-opened using the operating system. + */ + #ifndef GFILE_NEED_CHIBIOSFS + #define GFILE_NEED_CHIBIOSFS FALSE + #endif + /** + * @brief Include raw memory pointer support + * @details Defaults to FALSE + * @note Use the @p gfileOpenMemory() call to open a GFILE based on a + * memory pointer. The GFILE opened appears to be of unlimited size. + * @note A GFile of this type cannot be opened by filename. + */ + #ifndef GFILE_NEED_MEMFS + #define GFILE_NEED_MEMFS FALSE + #endif /** * @} * @@ -137,12 +152,6 @@ #ifndef GFILE_MAX_GFILES #define GFILE_MAX_GFILES 3 #endif - /** - * @brief The size in bytes of the RAM file system - */ - #ifndef GFILE_RAMFS_SIZE - #define GFILE_RAMFS_SIZE 0 - #endif /** @} */ #endif /* _GFILE_OPTIONS_H */ |