rulimine/stage23/fs/echfs.h

42 lines
992 B
C
Raw Normal View History

2020-01-23 03:48:35 +03:00
#ifndef __FS__ECHFS_H__
#define __FS__ECHFS_H__
2020-03-15 02:12:09 +03:00
#include <stdint.h>
2020-11-01 23:25:35 +03:00
#include <stdbool.h>
2020-04-15 14:21:44 +03:00
#include <lib/part.h>
2020-11-01 23:25:35 +03:00
#include <lib/blib.h>
2020-03-15 02:12:09 +03:00
struct echfs_dir_entry {
uint64_t parent_id;
uint8_t type;
char name[201];
uint64_t atime;
uint64_t mtime;
uint16_t perms;
uint16_t owner;
uint16_t group;
uint64_t ctime;
uint64_t payload;
uint64_t size;
} __attribute__((packed));
struct echfs_file_handle {
2021-03-04 11:15:10 +03:00
struct volume *part;
2020-03-15 02:12:09 +03:00
uint64_t block_size;
uint64_t block_count;
uint64_t dir_length;
uint64_t alloc_table_size;
uint64_t alloc_table_offset;
uint64_t dir_offset;
uint64_t *alloc_map;
2020-03-15 02:12:09 +03:00
struct echfs_dir_entry dir_entry;
};
int echfs_check_signature(struct volume *part);
bool echfs_get_guid(struct guid *guid, struct volume *part);
2020-04-14 06:20:55 +03:00
int echfs_open(struct echfs_file_handle *ret, struct volume *part, const char *filename);
2020-03-15 02:12:09 +03:00
int echfs_read(struct echfs_file_handle *file, void *buf, uint64_t loc, uint64_t count);
#endif