28 |
28 |
29 #ifndef VFS_H |
29 #ifndef VFS_H |
30 #define VFS_H |
30 #define VFS_H |
31 |
31 |
32 #include "../public/vfs.h" |
32 #include "../public/vfs.h" |
|
33 #include "acl.h" |
33 |
34 |
34 #ifdef __cplusplus |
35 #ifdef __cplusplus |
35 extern "C" { |
36 extern "C" { |
36 #endif |
37 #endif |
37 |
38 |
38 // private |
|
39 int vfs_init(); |
39 int vfs_init(); |
40 |
40 |
41 typedef int(*vfs_op_f)(VFSContext *, char *); |
41 typedef int(*vfs_op_f)(VFSContext *, char *); |
|
42 typedef int(*sys_op_f)(VFSContext *, char *, SysACL *); |
42 int vfs_path_op(VFSContext *ctx, char *path, vfs_op_f op, uint32_t access); |
43 int vfs_path_op(VFSContext *ctx, char *path, vfs_op_f op, uint32_t access); |
|
44 int sys_path_op(VFSContext *ctx, char *path, sys_op_f op, uint32_t access); |
43 |
45 |
44 int sys_acl_check(VFSContext *ctx, uint32_t acm, uid_t *uid, gid_t *gid); |
46 int sys_acl_check(VFSContext *ctx, uint32_t access_mask, SysACL *externacl); |
45 void sys_set_error_status(VFSContext *ctx); |
47 void sys_set_error_status(VFSContext *ctx); |
46 ssize_t sys_file_read(SYS_FILE fd, void *buf, size_t nbyte); |
48 ssize_t sys_file_read(SYS_FILE fd, void *buf, size_t nbyte); |
47 ssize_t sys_file_write(SYS_FILE fd, const void *buf, size_t nbyte); |
49 ssize_t sys_file_write(SYS_FILE fd, const void *buf, size_t nbyte); |
48 void sys_file_close(SYS_FILE fd); |
50 void sys_file_close(SYS_FILE fd); |
49 int sys_dir_read(VFS_DIR dir, VFS_ENTRY *entry, int getstat); |
51 int sys_dir_read(VFS_DIR dir, VFS_ENTRY *entry, int getstat); |
50 void sys_dir_close(VFS_DIR dir); |
52 void sys_dir_close(VFS_DIR dir); |
51 int sys_mkdir(VFSContext *ctx, char *path); |
53 int sys_mkdir(VFSContext *ctx, char *path, SysACL *sysacl); |
52 int sys_unlink(VFSContext *ctx, char *path); |
54 int sys_unlink(VFSContext *ctx, char *path, SysACL *sysacl); |
53 |
55 |
54 #ifdef __cplusplus |
56 #ifdef __cplusplus |
55 } |
57 } |
56 #endif |
58 #endif |
57 |
59 |