-
Notifications
You must be signed in to change notification settings - Fork 0
/
fs.h
65 lines (45 loc) · 1.13 KB
/
fs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef _FAKEFS_H_
#define _FAKEFS_H_
#include "disk.h"
#define FFS_SEEK_SET 0
#define FFS_SEEK_CUR 1
#define FFS_SEEK_END 2
#define LEITURA 0
#define ESCRITA 1
#define LEITURAESCRITA 2
struct descritor{
struct i_node node;
int inumber;
int pointer_local_search;
int offset;
int bloco;
int seek;
};
struct Bloco{
void *data;
char *text;
};
struct arquivoAbertoProcesso{
struct arquivoAbertoTotal *aponta;
int seek_position;
int acesso; //modo de acesso
};
struct arquivoAbertoTotal{
struct descritor file_table[20];
struct arquivoAbertoProcesso abertos[20];
int contador; //quantas vezes esse descritor foi referenciado, quando chegar a 0 posso tirar
};
struct arquivoAbertoTotal descritorArq[20];
char *blocosLivres;
int ffs_format_disk(int size, int i_size);
int ffs_shutdown();
int ffs_create();
int ffs_open(int i_number);
int ffs_i_number(int fd);
int ffs_read(int fd, char * buffer, int size);
int ffs_write(int fd, char * buffer, int size);
int ffs_seek(int fd, int offset, int whence);
int ffs_close(int fd);
int ffs_delete(int i_number);
int ffs_check_range(int i_number);
#endif /* _FAKEFS_H_ */