projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove kfile sub-classes aggregation.
[bertos.git]
/
kern
/
kfile.h
diff --git
a/kern/kfile.h
b/kern/kfile.h
index 4e529bcff871930804465134f4c934c32cf82d1f..60b0ad64948602502fec65ffa55621dfa546f736 100644
(file)
--- a/
kern/kfile.h
+++ b/
kern/kfile.h
@@
-164,19
+164,6
@@
typedef int (*ErrorFunc_t) (struct KFile *fd);
typedef void (*ClearErrFunc_t) (struct KFile *fd);
/* \} */
typedef void (*ClearErrFunc_t) (struct KFile *fd);
/* \} */
-/**
- * KFile type.
- * Used at runtime and in debug mode only to check
- * "dynamic casts".
- * \note Add here new KFile types.
- */
-typedef enum KFileType
-{
- KFT_GENERIC, ///< Generic
- KFT_SERIAL, ///< Serial driver
- KFT_CNT
-} KFileType;
-
/**
* Context data for callback functions which operate on
* pseudo files.
/**
* Context data for callback functions which operate on
* pseudo files.
@@
-192,7
+179,7
@@
typedef struct KFile
FlushFunc_t flush;
ErrorFunc_t error;
ClearErrFunc_t clearerr;
FlushFunc_t flush;
ErrorFunc_t error;
ClearErrFunc_t clearerr;
- DB(
KFileType
_type); ///< Used to keep trace, at runtime, of obj type.
+ DB(
id_t
_type); ///< Used to keep trace, at runtime, of obj type.
/* NOTE: these must _NOT_ be size_t on 16bit CPUs! */
uint32_t seek_pos;
/* NOTE: these must _NOT_ be size_t on 16bit CPUs! */
uint32_t seek_pos;
@@
-200,14
+187,14
@@
typedef struct KFile
} KFile;
/**
} KFile;
/**
- *
Check if \a fd is a generic KFile type
.
+ *
Generic implementation of kfile_seek
.
*/
*/
-#define KFILE_ASSERT_GENERIC(fd) ASSERT(fd->_type == KFT_GENERIC)
+kfile_off_t kfile_genericSeek(struct KFile *fd, kfile_off_t offset, KSeekMode whence);
/**
/**
- * Generic implementation of kfile_
seek
.
+ * Generic implementation of kfile_
reopen
.
*/
*/
-
kfile_off_t kfile_genericSeek(struct KFile *fd, kfile_off_t offset, KSeekMode whence
);
+
struct KFile * kfile_genericReopen(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_putc(int c, struct KFile *fd); ///< Generic putc implementation using kfile_write.
int kfile_getc(struct KFile *fd); ///< Generic getc implementation using kfile_read.