headers/bsd: Add sys/queue.h.
[haiku.git] / src / system / boot / loader / RootFileSystem.h
blob6ce33de903bf107eec7bef984baaa4105e11c637
1 /*
2 * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef ROOT_FILE_SYSTEM_H
6 #define ROOT_FILE_SYSTEM_H
9 #include <boot/vfs.h>
10 #include <boot/partitions.h>
12 using namespace boot;
15 class RootFileSystem : public Directory {
16 public:
17 RootFileSystem();
18 virtual ~RootFileSystem();
20 virtual status_t Open(void **_cookie, int mode);
21 virtual status_t Close(void *cookie);
23 virtual Node* LookupDontTraverse(const char* name);
25 virtual status_t GetNextEntry(void *cookie, char *nameBuffer, size_t bufferSize);
26 virtual status_t GetNextNode(void *cookie, Node **_node);
27 virtual status_t Rewind(void *cookie);
28 virtual bool IsEmpty();
30 status_t AddVolume(Directory *volume, Partition *partition);
31 status_t AddLink(const char *name, Directory *target);
33 status_t GetPartitionFor(Directory *volume, Partition **_partition);
35 private:
36 struct entry : public DoublyLinkedListLinkImpl<entry> {
37 const char *name;
38 Directory *root;
39 Partition *partition;
41 typedef DoublyLinkedList<entry>::Iterator EntryIterator;
42 typedef DoublyLinkedList<entry> EntryList;
44 EntryList fList;
45 EntryList fLinks;
48 extern RootFileSystem *gRoot;
50 #endif /* ROOT_FILE_SYSTEM_H */