diff options
author | dzwdz | 2022-12-25 21:47:23 +0100 |
---|---|---|
committer | dzwdz | 2022-12-25 21:47:23 +0100 |
commit | f6bc1ccf2462642383d1644321a101e62105c2a7 (patch) | |
tree | 98b78da8a9f155adaaffdb92235572c222c97371 /src/user/lib/fs | |
parent | fb6f520e0b65c08d0c01eee75e5216540786ac6b (diff) |
user/lib: reorganize a few header files
Diffstat (limited to 'src/user/lib/fs')
-rw-r--r-- | src/user/lib/fs/dir.c | 2 | ||||
-rw-r--r-- | src/user/lib/fs/dir.h | 17 | ||||
-rw-r--r-- | src/user/lib/fs/misc.c | 7 | ||||
-rw-r--r-- | src/user/lib/fs/misc.h | 23 | ||||
-rw-r--r-- | src/user/lib/fs/whitelist.c | 4 |
5 files changed, 6 insertions, 47 deletions
diff --git a/src/user/lib/fs/dir.c b/src/user/lib/fs/dir.c index 4235ea6..71b2209 100644 --- a/src/user/lib/fs/dir.c +++ b/src/user/lib/fs/dir.c @@ -2,7 +2,7 @@ #include <errno.h> #include <limits.h> #include <string.h> -#include <user/lib/fs/dir.h> +#include <camellia/fs/dir.h> void dir_start(struct dirbuild *db, long offset, char *buf, size_t buflen) { db->offset = offset; diff --git a/src/user/lib/fs/dir.h b/src/user/lib/fs/dir.h deleted file mode 100644 index c3bbfe7..0000000 --- a/src/user/lib/fs/dir.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once -#include <camellia/types.h> -#include <stdbool.h> -#include <stddef.h> - -struct dirbuild { - long offset; - char *buf; - long bpos, blen; - long error; -}; - -void dir_start(struct dirbuild *db, long offset, char *buf, size_t buflen); -bool dir_append(struct dirbuild *db, const char *name); -bool dir_appendl(struct dirbuild *db, const char *name, size_t len); -bool dir_append_from(struct dirbuild *db, handle_t h); -long dir_finish(struct dirbuild *db); diff --git a/src/user/lib/fs/misc.c b/src/user/lib/fs/misc.c index 860b312..11428b8 100644 --- a/src/user/lib/fs/misc.c +++ b/src/user/lib/fs/misc.c @@ -1,15 +1,14 @@ #include <camellia/flags.h> #include <camellia/syscalls.h> #include <errno.h> -#include <shared/mem.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <user/lib/compat.h> -#include <user/lib/fs/dir.h> -#include <user/lib/fs/misc.h> +#include <camellia/compat.h> +#include <camellia/fs/dir.h> +#include <camellia/fs/misc.h> bool fork2_n_mount(const char *path) { handle_t h; diff --git a/src/user/lib/fs/misc.h b/src/user/lib/fs/misc.h deleted file mode 100644 index 35184e1..0000000 --- a/src/user/lib/fs/misc.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -#include <stdbool.h> -#include <stdlib.h> - -bool fork2_n_mount(const char *path); - -void forward_open(handle_t reqh, const char *path, long len, int flags); - -void fs_passthru(const char *prefix); -void fs_whitelist(const char **list); -void fs_union(const char **list); - -void fs_dir_inject(const char *path); - -bool mount_at_pred(const char *path); - -// TODO separate fs drivers and wrappers around syscalls - -/** like _syscall_fs_wait, but ensures *buf is a null terminated string on VFSOP_OPEN */ -handle_t ufs_wait(char *buf, size_t len, struct ufs_request *req); - -/** Mounts something and injects its path into the fs */ -#define MOUNT_AT(path) for (; mount_at_pred(path); exit(1)) diff --git a/src/user/lib/fs/whitelist.c b/src/user/lib/fs/whitelist.c index 571ebfb..5612d9a 100644 --- a/src/user/lib/fs/whitelist.c +++ b/src/user/lib/fs/whitelist.c @@ -3,8 +3,8 @@ #include <errno.h> #include <stdlib.h> #include <string.h> -#include <user/lib/fs/dir.h> -#include <user/lib/fs/misc.h> +#include <camellia/fs/dir.h> +#include <camellia/fs/misc.h> static int dir_seglen2(const char *path, size_t len) { /* returns the length of the first segment of the path, including the trailing / (if any). */ |