summaryrefslogtreecommitdiffstats
path: root/filesys/directory.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2012-03-27 11:51:08 +0200
committermanuel <manuel@mausz.at>2012-03-27 11:51:08 +0200
commit4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b (patch)
tree868c52e06f207b5ec8a3cc141f4b8b2bdfcc165c /filesys/directory.h
parenteae0bd57f0a26314a94785061888d193d186944a (diff)
downloadprogos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.tar.gz
progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.tar.bz2
progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.zip
reorganize file structure to match the upstream requirements
Diffstat (limited to 'filesys/directory.h')
-rw-r--r--filesys/directory.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/filesys/directory.h b/filesys/directory.h
new file mode 100644
index 0000000..930acf9
--- /dev/null
+++ b/filesys/directory.h
@@ -0,0 +1,30 @@
1#ifndef FILESYS_DIRECTORY_H
2#define FILESYS_DIRECTORY_H
3
4#include <stdbool.h>
5#include <stddef.h>
6#include "devices/block.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
14struct inode;
15
16/* Opening and closing directories. */
17bool dir_create (block_sector_t sector, size_t entry_cnt);
18struct dir *dir_open (struct inode *);
19struct dir *dir_open_root (void);
20struct dir *dir_reopen (struct dir *);
21void dir_close (struct dir *);
22struct inode *dir_get_inode (struct dir *);
23
24/* Reading and writing. */
25bool dir_lookup (const struct dir *, const char *name, struct inode **);
26bool dir_add (struct dir *, const char *name, block_sector_t);
27bool dir_remove (struct dir *, const char *name);
28bool dir_readdir (struct dir *, char name[NAME_MAX + 1]);
29
30#endif /* filesys/directory.h */