Cleanups & Implementations to allow IPStack to compile
[tpg/acess2.git] / Kernel / include / vfs_ext.h
1 /*
2  * Acess 2
3  * vfs_ext.h
4  * - Exported Symbols from the VFS
5  */
6 #ifndef _VFS_EXT_H
7 #define _VFS_EXT_H
8
9 // === CONSTANTS ===
10 #define VFS_MEMPATH_SIZE        (3 + (BITS/8)*2)
11 #define VFS_OPENFLAG_EXEC       0x01
12 #define VFS_OPENFLAG_READ       0x02
13 #define VFS_OPENFLAG_WRITE      0x04
14 #define VFS_OPENFLAG_NOLINK     0x40
15 #define VFS_OPENFLAG_USER       0x80
16 #define VFS_KERNEL_FLAG 0x40000000
17
18 #define SEEK_SET        1
19 #define SEEK_CUR        0
20 #define SEEK_END        -1
21
22 // -- System Call Structures ---
23 /**
24  * \brief ACL Defintion Structure
25  */
26 typedef struct sVFS_ACL
27 {
28         struct {
29                 unsigned Group: 1;      //!< Group (as opposed to user) flag
30                 unsigned ID:    31;     //!< ID of Group/User (-1 for nobody/world)
31         };
32         struct {
33                 unsigned Inv:   1;      //!< Invert Permissions
34                 unsigned Perms: 31;     //!< Permission Flags
35         };
36 } tVFS_ACL;
37
38 struct s_sysFInfo {
39         Uint    uid, gid;
40         Uint    flags;
41         Uint64  size;
42         Sint64  atime;
43         Sint64  mtime;
44         Sint64  ctime;
45          int    numacls;
46         tVFS_ACL        acls[];
47 };
48
49 // === FUNCTIONS ===
50 extern int      VFS_Init();
51
52 extern int      VFS_Open(char *Path, Uint Flags);
53 extern void     VFS_Close(int FD);
54
55 extern int      VFS_Seek(int FD, Sint64 Offset, int Direction);
56 extern Uint64   VFS_Tell(int FD);
57
58 extern Uint64   VFS_Read(int FD, Uint64 Length, void *Buffer);
59 extern Uint64   VFS_Write(int FD, Uint64 Length, void *Buffer);
60
61 extern Uint64   VFS_ReadAt(int FD, Uint64 Offset, Uint64 Length, void *Buffer);
62 extern Uint64   VFS_WriteAt(int FD, Uint64 Offset, Uint64 Length, void *Buffer);
63
64 extern int      VFS_IOCtl(int FD, int ID, void *Buffer);
65
66 extern void     VFS_GetMemPath(void *Base, Uint Length, char *Dest);
67 extern char     *VFS_GetTruePath(char *Path);
68
69 extern int      VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *Options);
70 extern int      VFS_MkDir(char *Path);
71 extern int      VFS_Symlink(char *Link, char *Dest);
72 extern int      VFS_ReadDir(int FD, char *Dest);
73
74 #endif

UCC git Repository :: git.ucc.asn.au