From 4b918e6f721f34e4014fa3f0b5032037991e321f Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Wed, 11 Dec 2024 10:22:19 -0700 Subject: Pull out lib9p_util from srv9p --- cmd/srv9p/main.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'cmd/srv9p/main.c') diff --git a/cmd/srv9p/main.c b/cmd/srv9p/main.c index 05368e5..394bf84 100644 --- a/cmd/srv9p/main.c +++ b/cmd/srv9p/main.c @@ -11,8 +11,8 @@ #include #include #include +#include -#include "static9p.h" #include "static.h" /* configuration **************************************************************/ @@ -29,8 +29,8 @@ /* 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 +43,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 +57,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 -- cgit v1.2.3-2-g168b From c755f88f8c6862ef1497375df2d09454c99a0632 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Fri, 13 Dec 2024 17:36:53 -0500 Subject: Gather macros into libmisc/macro.h --- cmd/srv9p/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cmd/srv9p/main.c') diff --git a/cmd/srv9p/main.c b/cmd/srv9p/main.c index 394bf84..b5cb122 100644 --- a/cmd/srv9p/main.c +++ b/cmd/srv9p/main.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "static.h" @@ -25,8 +26,6 @@ /* implementation *************************************************************/ -#define UNUSED(name) - /* file tree ******************************************************************/ #define FILE_COMMON(NAME) { \ @@ -79,7 +78,7 @@ static struct util9p_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; } -- cgit v1.2.3-2-g168b