-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathll.h
More file actions
59 lines (52 loc) · 1.44 KB
/
ll.h
File metadata and controls
59 lines (52 loc) · 1.44 KB
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
#include <stdint.h>
#define nbPartMax 512
#define magicnumber 31534654
#define TTTFS_VOLUME_BLOCK_SIZE 1024
typedef struct { // creer un structure block
char t[1024];
} block;
typedef struct {
int erro;
} error;
// description d'un bloc
typedef struct {
int taille; // nombre de bloc dans la partition
int nbBlocLibre; // bloc libre
int firstFreeBloc;
int maxFile;
int nbFreeFile;
int firstFile;
} partition;
// fichier dans le disque
typedef struct {
int sizeFile; // nombre de bloc dans la partition
int typeFile; // bloc libre
int subtypeFile;
// les 10 premiers numero des bloc ou sont situés le contenu des format
int directFile[10];
//
int indirectFile1[256];
// contient un tableau de tableau de numero de bloc
// ou sont situé le contenu du fichier
int indirectFile2[256][256];
int freeFile;
} file;
typedef struct { // creer un structure block
int fd;
int nbbloc;
int taille;
int nbPart;
int taillePart[512];
} disk_id;
int estNombre(char * c);
void int_to_little_endian2(unsigned char* t,int i, int x);
error read_physical_block(disk_id id,block* b,uint32_t num);
error write_physical_block(disk_id id,block b,uint32_t num);
error start_disk(char *name,disk_id *id);
error write_block(disk_id id,block b,uint32_t num);
error read_block(disk_id id,block* b,uint32_t num);
error sync_disk(disk_id id);
error stop_disk(disk_id id);
int estNombre(char * c);
int little_endian_to_int_(uint32_t u);
uint32_t int_to_little_endian(int size);