2019-12-30 16:31:03 +01:00
|
|
|
#ifndef __FILE_H__
|
|
|
|
# define __FILE_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
2020-02-24 00:05:27 +01:00
|
|
|
#include <kernel/util/types.h>
|
2020-01-05 09:00:43 +01:00
|
|
|
#include <kernel/fs/filesystem.h>
|
2019-12-30 16:31:03 +01:00
|
|
|
|
|
|
|
#ifndef FILE_OPEN_NUMBER
|
|
|
|
# define FILE_OPEN_NUMBER 4
|
|
|
|
#endif
|
|
|
|
|
2020-03-28 19:52:59 +01:00
|
|
|
// TODO: fix me
|
|
|
|
#ifndef __LIB_UNISTD_H__
|
|
|
|
# define O_RDONLY 0x00
|
|
|
|
# define O_WRONLY 0x01
|
|
|
|
# define O_RDWR 0x02
|
2020-01-05 09:00:43 +01:00
|
|
|
|
2020-03-28 19:52:59 +01:00
|
|
|
# define SEEK_SET 0
|
|
|
|
# define SEEK_CUR 1
|
|
|
|
# define SEEK_END 2
|
|
|
|
#endif
|
2020-01-05 09:00:43 +01:00
|
|
|
|
2019-12-30 16:31:03 +01:00
|
|
|
struct file_s
|
|
|
|
{
|
2020-01-05 09:00:43 +01:00
|
|
|
void *private;
|
2019-12-30 16:31:03 +01:00
|
|
|
off_t cursor;
|
2020-01-05 09:00:43 +01:00
|
|
|
int permission;
|
|
|
|
struct file_operations *file_op;
|
2019-12-30 16:31:03 +01:00
|
|
|
};
|
|
|
|
typedef struct file_s FILE;
|
|
|
|
|
|
|
|
#endif /*__FILE_H__*/
|