void DevFS_DelDevice(tDevFS_Driver *Device);
#endif
tVFS_Node *DevFS_InitDevice(const char *Device, const char **Options);
-char *DevFS_ReadDir(tVFS_Node *Node, int Pos);
-tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name);
+void DevFS_Unmount(tVFS_Node *RootNode);
+ int DevFS_ReadDir(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX]);
+tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name, Uint Flags);
// === GLOBALS ===
tVFS_Driver gDevFS_Info = {
- "devfs", 0, DevFS_InitDevice, NULL, NULL
+ .Name = "devfs",
+ .InitDevice = DevFS_InitDevice,
+ .Unmount = DevFS_Unmount
};
tVFS_NodeType gDevFS_DirType = {
.TypeName = "DevFS-Dir",
return &gDevFS_RootNode;
}
+void DevFS_Unmount(tVFS_Node *RootNode)
+{
+
+}
+
/**
* \fn char *DevFS_ReadDir(tVFS_Node *Node, int Pos)
*/
-char *DevFS_ReadDir(tVFS_Node *Node, int Pos)
+int DevFS_ReadDir(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX])
{
tDevFS_Driver *dev;
- if(Pos < 0) return NULL;
+ if(Pos < 0) return -EINVAL;
for(dev = gDevFS_Drivers;
dev && Pos--;
dev = dev->Next
);
- if(dev)
- return strdup(dev->Name);
- else
- return NULL;
+ if(dev) {
+ strncpy(Dest, dev->Name, FILENAME_MAX);
+ return 0;
+ }
+ else {
+ return -ENOENT;
+ }
}
/**
* \fn tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name)
* \brief Get an entry from the devices directory
*/
-tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name)
+tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name, Uint Flags)
{
tDevFS_Driver *dev;