-
Notifications
You must be signed in to change notification settings - Fork 0
/
file.h
53 lines (40 loc) · 967 Bytes
/
file.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
#ifndef __FILE_H__
#define __FILE_H__
typedef struct Directory {
// The name of the directory
char *name;
// TODO: The list of files of the current directory
struct flist *crrntfile;
// TODO: The list of directories of the current directory
struct dlist *crrntdir;
// The parent directory of the current directory (NULL for the root directory)
struct Directory *parentDir;
} Directory;
// DO NOT MODIFY THIS STRUCTURE
typedef struct File {
// The name of the file
char *name;
// The size of the file
int size;
// The content of the file
char *data;
// The directory in which the file is located
Directory *dir;
} File;
typedef struct flist {
struct fnode *head;
int len;
} flist;
typedef struct fnode {
struct File *fisier;
struct fnode *next;
} fnode;
typedef struct dlist {
struct dnode *head;
int len;
} dlist;
typedef struct dnode {
struct Directory *directory;
struct dnode *next;
} dnode;
#endif /* __FILE_H__ */