+typedef uint8_t filemode_t; ///< Type for file open modes.
+typedef uint32_t file_size_t; ///< Type for file sizes.
+
+/**
+ * Modes for battfs_fileopen.
+ * \{
+ */
+#define BATTFS_CREATE BV(0) ///< Create file if does not exist
+#define BATTFS_RD BV(1) ///< Open file for reading
+#define BATTFS_WR BV(2) ///< Open file fir writing
+/*/}*/
+
+
+/**
+ * Describe a BattFs file usign a KFile.
+ */
+typedef struct KFileBattFs
+{
+ KFile fd; ///< KFile context
+ Node link; ///< Link for inserting in opened file list
+ inode_t inode; ///< inode of the opened file
+ BattFsSuper *disk; ///< Disk context
+ filemode_t mode; ///< File open mode
+ pgcnt_t *start; ///< Pointer to page_array file start position.
+} KFileBattFs;
+
+/**
+ * Macro used to cast a KFile to a KFileBattFs.
+ * Also perform dynamic type check.
+ */
+INLINE KFileBattFs * KFILEBATTFS(KFile *fd)
+{
+ ASSERT(fd->_type == KFT_BATTFS);
+ return (KFileBattFs *)fd;
+}
+