diff options
Diffstat (limited to 'cmd/srv9p/main.c')
-rw-r--r-- | cmd/srv9p/main.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/cmd/srv9p/main.c b/cmd/srv9p/main.c index ae0e34e..d83fac4 100644 --- a/cmd/srv9p/main.c +++ b/cmd/srv9p/main.c @@ -8,7 +8,7 @@ #include <stdio.h> #include <libcr/coroutine.h> -#include <libnet/libnet.h> +#include <libmisc/net.h> #include <lib9p/srv.h> #include "static9p.h" @@ -29,8 +29,8 @@ /* file tree ******************************************************************/ -#define FILE_METADATA(NAME) { \ - .header = { .vtable = &static_file_vtable }, \ +#define FILE_COMMON(NAME) { \ + .vtable = &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_METADATA(NAME) { \ - .header = { .vtable = &static_dir_vtable }, \ +#define DIR_COMMON(NAME) { \ + .vtable = &static_dir_vtable, \ \ .u_name = "root", .u_num = 0, /* owner user */ \ .g_name = "root", .g_num = 0, /* owner group */ \ @@ -59,28 +59,28 @@ #define STATIC_FILE(STRNAME, SYMNAME) \ &((static struct static_file){ \ - .metadata = FILE_METADATA(STRNAME), \ - .data_start = _binary_static_##SYMNAME##_start, \ - .data_end = _binary_static_##SYMNAME##_end, \ - }).metadata.header + ._static_common = FILE_COMMON(STRNAME), \ + .data_start = _binary_static_##SYMNAME##_start, \ + .data_end = _binary_static_##SYMNAME##_end, \ + }) static struct static_dir root = { - .metadata = DIR_METADATA(""), + ._static_common = DIR_COMMON(""), .members = { &((static struct static_dir){ - .metadata = DIR_METADATA("Documentation"), + ._static_common = DIR_COMMON("Documentation"), .members = { STATIC_FILE("x", Documentation_x), NULL }, - }).metadata.header, + }), STATIC_FILE("README.md", README_md), NULL, }, }; -static struct lib9p_srv_file *get_root(struct lib9p_srv_ctx *UNUSED(ctx), char *UNUSED(treename)) { - return &root.metadata.header; +static implements_lib9p_srv_file *get_root(struct lib9p_srv_ctx *UNUSED(ctx), char *UNUSED(treename)) { + return &root; } /* main ***********************************************************************/ @@ -94,7 +94,7 @@ static COROUTINE read_cr(void *_srv) { struct gnet_listener listener; gnet_listener_init(&listener, 9000); - lib9p_srv_read_cr(srv, (struct libnet_listener *)&listener); + lib9p_srv_read_cr(srv, &listener); cr_end(); } |