summaryrefslogtreecommitdiff
path: root/Source/Library
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-10-23 19:40:08 +0200
committerAlexis211 <alexis211@gmail.com>2009-10-23 19:40:08 +0200
commit48de0cd029b52f64f76345b6e1fdf3cde5c58de3 (patch)
tree792061381c556bef6639b327716cca107f6168c5 /Source/Library
parentf0556ed7f051fb101dc68752526696365bf79a11 (diff)
downloadMelon-48de0cd029b52f64f76345b6e1fdf3cde5c58de3.tar.gz
Melon-48de0cd029b52f64f76345b6e1fdf3cde5c58de3.zip
More work on syscalls and shell
Diffstat (limited to 'Source/Library')
-rw-r--r--Source/Library/Interface/FSNode.iface.h6
-rw-r--r--Source/Library/Userland/Binding/FSNode.class.h20
2 files changed, 25 insertions, 1 deletions
diff --git a/Source/Library/Interface/FSNode.iface.h b/Source/Library/Interface/FSNode.iface.h
index fd99bab..cba4621 100644
--- a/Source/Library/Interface/FSNode.iface.h
+++ b/Source/Library/Interface/FSNode.iface.h
@@ -12,6 +12,8 @@ enum {
//S : static, GET : get, R : root, FN : fsnode
#define FNIF_SGETRFN 0
+#define FNIF_SGETCWD 1 //Get current working directory
+#define FNIF_SFIND 2 //Find a node following a path from a node
#define FNIF_GETNAME 0x10
#define FNIF_TYPE 0x11
@@ -21,5 +23,9 @@ enum {
#define FNIF_GETGID 0x15
#define FNIF_GETPERM 0x16
#define FNIF_GETPATH 0x17
+#define FNIF_SETCWD 0x18 //Sets node as current working directory
+
+#define FNIF_GETIDXCHILD 0x20 //Get child node from index
+#define FNIF_GETNAMECHILD 0x21 //Get child node from name
#endif
diff --git a/Source/Library/Userland/Binding/FSNode.class.h b/Source/Library/Userland/Binding/FSNode.class.h
index 95802a4..61ac991 100644
--- a/Source/Library/Userland/Binding/FSNode.class.h
+++ b/Source/Library/Userland/Binding/FSNode.class.h
@@ -4,7 +4,13 @@
class FSNode : public RessourceCaller {
public:
static FSNode getRoot() {
- return FSNode(RessourceCaller::sCall(FNIF_OBJTYPE, FNIF_SGETRFN));
+ return FSNode(sCall(FNIF_OBJTYPE, FNIF_SGETRFN));
+ }
+ static FSNode getCwd() {
+ return FSNode(sCall(FNIF_OBJTYPE, FNIF_SGETCWD));
+ }
+ static FSNode find(String path) { //Finds a node starting from root node
+ return FSNode(sCall(FNIF_OBJTYPE, FNIF_SFIND, (u32int)&path, 0));
}
FSNode(u32int id) : RessourceCaller(id, FNIF_OBJTYPE) {}
@@ -32,4 +38,16 @@ class FSNode : public RessourceCaller {
String path() {
return String::unserialize(doCall(FNIF_GETPATH));
}
+ void setCwd() {
+ doCall(FNIF_SETCWD);
+ }
+ FSNode getChild(u32int idx) {
+ return FSNode(doCall(FNIF_GETIDXCHILD, idx));
+ }
+ FSNode getChild(String name) {
+ return FSNode(doCall(FNIF_GETNAMECHILD, (u32int)&name));
+ }
+ FSNode findFrom(String path) { //Search a filesystem node starting from here
+ return FSNode(sCall(FNIF_OBJTYPE, FNIF_SFIND, (u32int)&path, resId()));
+ }
};