diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-12-13 18:49:15 -0500 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-12-13 18:49:15 -0500 |
commit | c578a300c7d0d46662fcd0bdce69af95a821bc18 (patch) | |
tree | a99de333f2812d7c018820f39d78b8c4e744f705 /cmd/srv9p/main.c | |
parent | 6a719c63ecb83a850c317ea94b8932aa0c857770 (diff) | |
parent | 57cc0523f600575feda09bd9fae13f685ce85b0f (diff) |
Merge commit '57cc0523f600575feda09bd9fae13f685ce85b0f'
Diffstat (limited to 'cmd/srv9p/main.c')
-rw-r--r-- | cmd/srv9p/main.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/cmd/srv9p/main.c b/cmd/srv9p/main.c index 05368e5..b5cb122 100644 --- a/cmd/srv9p/main.c +++ b/cmd/srv9p/main.c @@ -11,8 +11,9 @@ #include <libhw/generic/net.h> #include <libhw/generic/alarmclock.h> #include <libhw/host_net.h> +#include <libmisc/macro.h> +#include <util9p/static.h> -#include "static9p.h" #include "static.h" /* configuration **************************************************************/ @@ -25,12 +26,10 @@ /* implementation *************************************************************/ -#define UNUSED(name) - /* file tree ******************************************************************/ -#define FILE_COMMON(NAME) { \ - .vtable = &static_file_vtable, \ +#define FILE_COMMON(NAME) { \ + .vtable = &util9p_static_file_vtable, \ \ .u_name = "root", .u_num = 0, /* owner user */ \ .g_name = "root", .g_num = 0, /* owner group */ \ @@ -43,8 +42,8 @@ .mtime = 1728337904, \ } -#define DIR_COMMON(NAME) { \ - .vtable = &static_dir_vtable, \ +#define DIR_COMMON(NAME) { \ + .vtable = &util9p_static_dir_vtable, \ \ .u_name = "root", .u_num = 0, /* owner user */ \ .g_name = "root", .g_num = 0, /* owner group */ \ @@ -57,18 +56,18 @@ .mtime = 1728337904, \ } -#define STATIC_FILE(STRNAME, SYMNAME) \ - &((static struct static_file){ \ - ._static_common = FILE_COMMON(STRNAME), \ - .data_start = _binary_static_##SYMNAME##_start, \ - .data_end = _binary_static_##SYMNAME##_end, \ +#define STATIC_FILE(STRNAME, SYMNAME) \ + &((static struct util9p_static_file){ \ + ._util9p_static_common = FILE_COMMON(STRNAME), \ + .data_start = _binary_static_##SYMNAME##_start, \ + .data_end = _binary_static_##SYMNAME##_end, \ }) -static struct static_dir root = { - ._static_common = DIR_COMMON(""), +static struct util9p_static_dir root = { + ._util9p_static_common = DIR_COMMON(""), .members = { - &((static struct static_dir){ - ._static_common = DIR_COMMON("Documentation"), + &((static struct util9p_static_dir){ + ._util9p_static_common = DIR_COMMON("Documentation"), .members = { STATIC_FILE("x", Documentation_x), NULL @@ -79,7 +78,7 @@ static struct static_dir root = { }, }; -static implements_lib9p_srv_file *get_root(struct lib9p_srv_ctx *UNUSED(ctx), char *UNUSED(treename)) { +static implements_lib9p_srv_file *get_root(struct lib9p_srv_ctx *LM_UNUSED(ctx), char *LM_UNUSED(treename)) { return &root; } |