2022-04-23 16:28:25 +00:00
|
|
|
#ifndef FD_H
|
|
|
|
#define FD_H
|
|
|
|
|
|
|
|
#include <k/types.h>
|
|
|
|
|
|
|
|
#define MAX_FD 65535
|
|
|
|
|
|
|
|
struct file_entry
|
|
|
|
{
|
|
|
|
u8 open;
|
|
|
|
u32 lba;
|
2022-04-23 19:37:54 +00:00
|
|
|
u32 file_offset;
|
|
|
|
u32 file_size;
|
2022-04-24 00:17:53 +00:00
|
|
|
u8 is_dir;
|
2022-04-23 16:28:25 +00:00
|
|
|
};
|
|
|
|
|
2022-04-24 00:17:53 +00:00
|
|
|
extern struct file_entry fd_table[MAX_FD];
|
|
|
|
|
|
|
|
int register_fd(u32 lba, u32 file_size, u8 is_dir);
|
2022-04-23 16:28:25 +00:00
|
|
|
int destroy_fd(int fd);
|
|
|
|
|
|
|
|
#endif /* !FD_H */
|