#ifndef __FS_SFILE_H #define __FS_SFILE_H #include #include "inode.h" /* Codes de retour */ enum file_open_ret { OPEN_SUCCESS, OPEN_FAILED }; enum file_read_ret { READ_EOF = -1 }; /* 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; }; inode_t create_sfile(unsigned int volume, enum file_type_e type); int delete_sfile(unsigned int volume); int open_sfile(unsigned int volume, struct file_desc_t *fd); void flush_sfile(struct file_desc_t *fd); void close_sfile(struct file_desc_t *fd); void seek_sfile(struct file_desc_t *fd, int r_offset); /* relatif */ void seek2_sfile(struct file_desc_t *fd, unsigned int a_offset); /* absolu */ int readc_sfile(struct file_desc_t *fd); int writec_sfile(struct file_desc_t *fd, char c); int read_sfile(struct file_desc_t *fd, void *buf, unsigned int nbyte); int write_sfile(struct file_desc_t *fd, const void *buf, unsigned int nbyte); #endif /* __FS_SFILE_H */