X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fkfile.h;h=5d3ebc677a52cc2ada60d446d72d12f603fb4d4a;hb=37efb5bdc0504ab6df2e8db0635c9c6f7477e23e;hp=609c8d635030edc777a12160ff9e364c66fe6f09;hpb=3cbd165e74aa527dc81b1ffd0e711ab95563f66c;p=bertos.git diff --git a/bertos/kern/kfile.h b/bertos/kern/kfile.h index 609c8d63..5d3ebc67 100644 --- a/bertos/kern/kfile.h +++ b/bertos/kern/kfile.h @@ -92,6 +92,9 @@ * \author Bernie Innocenti * \author Francesco Sacchi * \author Daniele Basile + * + * $WIZ$ module_name = "kfile" + * $WIZ$ module_configuration = "bertos/cfg/cfg_kfile.h" */ #ifndef KERN_KFILE_H @@ -105,7 +108,6 @@ struct KFile; typedef int32_t kfile_off_t; ///< KFile offset type, used by kfile_seek(). -typedef uint32_t kfile_size_t; ///< KFile size type, used in struct KFile. /** * Costants for repositioning read/write file offset. @@ -178,7 +180,9 @@ typedef void (*ClearErrFunc_t) (struct KFile *fd); /** * Context data for callback functions which operate on * pseudo files. - * \note If you change interface, remember to add corresponding access function. + * + * \note Remember to add the corresponding accessor functions + * when extending this interface. */ typedef struct KFile { @@ -190,11 +194,11 @@ typedef struct KFile FlushFunc_t flush; ErrorFunc_t error; ClearErrFunc_t clearerr; - DB(id_t _type); ///< Used to keep trace, at runtime, of obj type. + DB(id_t _type); ///< Used to keep track, at runtime, of the class type. /* NOTE: these must _NOT_ be size_t on 16bit CPUs! */ - kfile_off_t seek_pos; - kfile_size_t size; + kfile_off_t seek_pos; + kfile_off_t size; } KFile; /** @@ -207,12 +211,15 @@ kfile_off_t kfile_genericSeek(struct KFile *fd, kfile_off_t offset, KSeekMode wh */ struct KFile * kfile_genericReopen(struct KFile *fd); +int kfile_genericClose(struct KFile *fd); + int kfile_putc(int c, struct KFile *fd); ///< Generic putc implementation using kfile_write. int kfile_getc(struct KFile *fd); ///< Generic getc implementation using kfile_read. int kfile_printf(struct KFile *fd, const char *format, ...); int kfile_print(struct KFile *fd, const char *s); int kfile_gets(struct KFile *fd, char *buf, int size); int kfile_gets_echo(struct KFile *fd, char *buf, int size, bool echo); +void kfile_resync(KFile *fd, mtime_t delay); /** * Interface functions for KFile access. @@ -271,8 +278,8 @@ INLINE void kfile_clearerr(struct KFile *fd) /** * Kfile test function. */ -int kfile_testSetUp(void); -int kfile_testRun(KFile *fd, uint8_t *test_buf, uint8_t *save_buf, size_t size); +int kfile_testSetup(void); +int kfile_testRunGeneric(KFile *fd, uint8_t *test_buf, uint8_t *save_buf, size_t size); int kfile_testTearDown(void); #endif /* KERN_KFILE_H */