Comment.
[pintos-anon] / src / filesys / directory.h
1 #ifndef FILESYS_DIRECTORY_H
2 #define FILESYS_DIRECTORY_H
3
4 #include <stdbool.h>
5 #include <stddef.h>
6 #include "devices/disk.h"
7
8 /* Maximum length of a file name component.
9    This is the traditional UNIX maximum length.
10    After directories are implemented, this maximum length may be
11    retained, but much longer full path names must be allowed. */
12 #define NAME_MAX 14
13
14 struct file;
15 struct dir *dir_create (size_t entry_cnt);
16 size_t dir_size (size_t entry_cnt);
17 void dir_destroy (struct dir *);
18 void dir_read (struct dir *, struct file *);
19 void dir_write (struct dir *, struct file *);
20 bool dir_lookup (const struct dir *, const char *name, disk_sector_t *);
21 bool dir_add (struct dir *, const char *name, disk_sector_t);
22 bool dir_remove (struct dir *, const char *name);
23 void dir_list (const struct dir *);
24 void dir_dump (const struct dir *);
25
26 #endif /* filesys/directory.h */