// vfs.h // Virtual file system subsystem for HOS // Author: Josh Holtrop // Date: 05/10/05 // Modified: 05/10/05 #ifndef __HOS_VFS_H__ #define __HOS_VFS_H__ __HOS_VFS_H__ #define VFS_FT_UNKNOWN 0 #define VFS_FT_FILE 1 #define VFS_FT_DIR 2 #define VFS_FT_CHAR 3 #define VFS_FT_BLOCK 4 #define VFS_FT_FIFO 5 #define VFS_FT_SOCK 6 #define VFS_FT_SYMLINK 7 #define VFS_PERMS_OX 0x0001 #define VFS_PERMS_OW 0x0002 #define VFS_PERMS_OR 0x0004 #define VFS_PERMS_GX 0x0008 #define VFS_PERMS_GW 0x0010 #define VFS_PERMS_GR 0x0020 #define VFS_PERMS_UX 0x0040 #define VFS_PERMS_UW 0x0080 #define VFS_PERMS_UR 0x0100 #define VFS_PERMS_STICKY 0x0200 #define VFS_PERMS_SGID 0x0400 #define VFS_PERMS_SUID 0x0800 #define EOF 1000000 #include "hos_defines.h" #include "devices.h" typedef u64_t inode_num_t; #ifdef _HOS_CPP_ extern "C" { #endif int vfs_init(); int vfs_mount(device_t device, char *fsType, char *mountPoint); #ifdef _HOS_CPP_ } #include "lang/string.h" #include "fs/FileSystem.h" #include "fs/VFSMount.h" typedef FileSystem *(*mount_func_t)(device_t); typedef struct { string name; mount_func_t mount_func; } FSHandle; FileSystem *vfs_attempt_mount(device_t device, char *fsType); int vfs_register(char *fs, FileSystem *(*mount_func)(device_t)); mount_func_t vfs_get_mount_func(const string & fsName); #endif #endif