-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstructs.h
95 lines (67 loc) · 1.3 KB
/
structs.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#ifndef __STRUCTS__
#define __STRUCTS__
#define MAX_HOLES 1000
#define PERMS 0777
#define _XOPEN_SOURCE 700
#define READ_WRITE_USER_GROUP_PERMS 0660
#define LINK 0
#define DIRECTORY 1
#define FILE 2
#define MAX_CFS_FILENAME_SIZE 30
#define MAX_DIGITS 15
#define DEFAULT_BLOCK_SIZE 512
#define DEFAULT_FNS 30
#define DEFAULT_CFS 4096
#define DEFAULT_MDFN 69
#define PRINT_HIERARCHY 5
#include "time.h"
typedef unsigned int uint;
typedef unsigned char byte;
typedef unsigned long long ull;
typedef struct hole
{
off_t start;
off_t end;
} hole;
typedef struct hole_map
{
long unsigned int current_hole_number;
hole holes_table[MAX_HOLES];
} hole_map;
typedef struct
{
uint id;
uint type;
uint number_of_hard_links;
uint blocks_using;
size_t size;
off_t parent_offset;
off_t first_block;
time_t creation_time;
time_t access_time;
time_t modification_time;
} MDS;
typedef struct pair
{
char* name;
off_t offset;
} pair;
typedef struct Block
{
off_t next_block;
size_t bytes_used;
byte data[];
} Block;
typedef struct superblock
{
uint fd;
char cfs_filename[MAX_CFS_FILENAME_SIZE];
uint total_entities;
off_t root_directory;
size_t current_size;
size_t block_size;
size_t filename_size;
size_t max_file_size;
uint max_dir_file_number;
} superblock;
#endif