X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fio%2Fkfile.h;h=9a750feb29a2dfe6135f8c1a4f13647de0b4db9c;hb=82f41e5602dce5e8b7a3a8c2872c2091c79eefe2;hp=c5529822ccfa704a5ce89ba8fbd594b8627a04c0;hpb=1c11ac0ab0636d07db3899b02c5d89e2d0b020bc;p=bertos.git diff --git a/bertos/io/kfile.h b/bertos/io/kfile.h index c5529822..9a750feb 100644 --- a/bertos/io/kfile.h +++ b/bertos/io/kfile.h @@ -31,9 +31,6 @@ * * --> * - * \defgroup core BeRTOS core functionality - * \{ - * * \defgroup io_kfile KFile interface * \ingroup core * \{ @@ -226,6 +223,12 @@ int kfile_genericClose(struct KFile *fd); /** * Read \a size bytes from file \a fd into \a buf. * + * This function reads at most the number of requested bytes into the + * provided buffer. + * The value returned may be less than the requested bytes in case EOF is + * reached OR an error occurred. You need to check the error conditions + * using kfile_error() to understand which case happened. + * * \note This function will block if there are less than \a size bytes * to read. * @@ -242,6 +245,16 @@ INLINE size_t kfile_read(struct KFile *fd, void *buf, size_t size) int kfile_gets(struct KFile *fd, char *buf, int size); int kfile_gets_echo(struct KFile *fd, char *buf, int size, bool echo); +/** + * Copy \a size bytes from file \a src to \a dst. + * + * \param src Source KFile. + * \param dst Destionation KFile. + * \param size number of bytes to copy. + * \return the number of bytes copied. + */ +kfile_off_t kfile_copy(KFile *src, KFile *dst, kfile_off_t size); + /** * Write \a size bytes from buffer \a buf into KFile \a fd. * @@ -341,7 +354,6 @@ int kfile_testSetup(void); int kfile_testRun(void); int kfile_testRunGeneric(KFile *fd, uint8_t *test_buf, uint8_t *save_buf, size_t size); int kfile_testTearDown(void); -/** \} */ //defgroup core #endif /* KERN_KFILE_H */