#ifndef __FS_FILE_H #define __FS_FILE_H #include #include "inode.h" /* File flags */ #define BUFFER_MODIF 0x1 struct file_desc_t { unsigned int volume; uint32_t inode_block; uint16_t cur_pos; void *buffer; int flags; uint16_t filesize; enum file_type_e type; }; /* Codes de retour */ enum file_read_ret { READ_EOF = -1 }; void flush_ifile(struct file_desc_t *fd); void close_ifile(struct file_desc_t *fd); void seek_ifile(struct file_desc_t *fd, int r_offset); /* relatif */ void seek2_ifile(struct file_desc_t *fd, unsigned int a_offset); /* absolu */ int readc_ifile(struct file_desc_t *fd); int writec_ifile(struct file_desc_t *fd, char c); int read_ifile(struct file_desc_t *fd, void *buf, unsigned int nbyte); int write_ifile(struct file_desc_t *fd, const void *buf, unsigned int nbyte); #endif /* __FS_FILE_H */