00001
00006 #ifndef _VFS_EXT_H
00007 #define _VFS_EXT_H
00008
00009
00011 #define VFS_MEMPATH_SIZE (3 + (BITS/4)*2)
00012
00016
00017 #define VFS_OPENFLAG_EXEC 0x01
00018
00019 #define VFS_OPENFLAG_READ 0x02
00020
00021 #define VFS_OPENFLAG_WRITE 0x04
00022
00023 #define VFS_OPENFLAG_NOLINK 0x40
00024
00025 #define VFS_OPENFLAG_USER 0x80
00026
00029
00030 #define VFS_KERNEL_FLAG 0x40000000
00031
00035 enum eVFS_SeekDirs
00036 {
00037 SEEK_SET = 1,
00038 SEEK_CUR = 0,
00039 SEEK_END = -1
00040 };
00041
00049 #define VFS_PERM_READ 0x00000001
00050
00053 #define VFS_PERM_WRITE 0x00000002
00054
00057 #define VFS_PERM_APPEND 0x00000004
00058
00061 #define VFS_PERM_EXECUTE 0x00000008
00062
00065 #define VFS_PERM_ALL 0x7FFFFFFF // Mask for permissions
00066
00070 #define VFS_PERM_DENY 0x80000000 // Inverts permissions
00071
00075
00079 typedef struct sVFS_ACL
00080 {
00081 struct {
00082 unsigned Group: 1;
00083 unsigned ID: 31;
00084 };
00085 struct {
00086 unsigned Inv: 1;
00087 unsigned Perms: 31;
00088 };
00089 } tVFS_ACL;
00090
00094 typedef struct sFInfo
00095 {
00096 Uint uid;
00097 Uint gid;
00098 Uint flags;
00099 Uint64 size;
00100 Sint64 atime;
00101 Sint64 mtime;
00102 Sint64 ctime;
00103 int numacls;
00104 tVFS_ACL acls[];
00105 } tFInfo;
00106
00107
00112 extern int VFS_Init(void);
00113
00120 extern int VFS_Open(const char *Path, Uint Mode);
00125 extern void VFS_Close(int FD);
00126
00139 extern int VFS_FInfo(int FD, tFInfo *Dest, int MaxACLs);
00149 extern int VFS_GetACL(int FD, tVFS_ACL *Dest);
00155 extern int VFS_ChDir(char *Dest);
00162 extern int VFS_ChRoot(char *New);
00163
00171 extern int VFS_Seek(int FD, Sint64 Offset, int Whence);
00177 extern Uint64 VFS_Tell(int FD);
00178
00186 extern Uint64 VFS_Read(int FD, Uint64 Length, void *Buffer);
00194 extern Uint64 VFS_Write(int FD, Uint64 Length, const void *Buffer);
00195
00204 extern Uint64 VFS_ReadAt(int FD, Uint64 Offset, Uint64 Length, void *Buffer);
00213 extern Uint64 VFS_WriteAt(int FD, Uint64 Offset, Uint64 Length, const void *Buffer);
00214
00222 extern int VFS_IOCtl(int FD, int ID, void *Buffer);
00223
00231 extern void VFS_GetMemPath(char *Dest, void *Base, Uint Length);
00237 extern char *VFS_GetTruePath(const char *Path);
00238
00247 extern int VFS_Mount(const char *Device, const char *MountPoint, const char *Filesystem, const char *Options);
00254 extern int VFS_MkDir(const char *Path);
00261 extern int VFS_Symlink(const char *Name, const char *Link);
00268 extern int VFS_ReadDir(int FD, char *Dest);
00278 extern int VFS_OpenChild(Uint *Errno, int FD, const char *Name, Uint Mode);
00279
00280 #endif