From fa357459f88bb8f0170d1a68df66e7d068d59996 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Fri, 27 Sep 2024 20:45:36 -0600 Subject: fixes --- lib9p/CMakeLists.txt | 3 +++ lib9p/srv.c | 9 +++++---- lib9p/types.c | 16 ++++++++-------- lib9p/types.gen | 8 ++++---- 4 files changed, 20 insertions(+), 16 deletions(-) (limited to 'lib9p') diff --git a/lib9p/CMakeLists.txt b/lib9p/CMakeLists.txt index af73ba9..cd3156c 100644 --- a/lib9p/CMakeLists.txt +++ b/lib9p/CMakeLists.txt @@ -10,4 +10,7 @@ target_sources(lib9p INTERFACE 9p.c srv.c ) +target_link_libraries(lib9p INTERFACE + libcr_ipc +) set_source_files_properties(types.c PROPERTIES COMPILE_FLAGS -O3) diff --git a/lib9p/srv.c b/lib9p/srv.c index 59326c9..c6558d6 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -1,10 +1,11 @@ #include -#include "coroutine.h" -#include "netio.h" -#include "9p/9p.h" +#include +#include +#include -#include "9p/internal.h" +#include +#include "internal.h" struct p9_srvconn { /* immutable */ diff --git a/lib9p/types.c b/lib9p/types.c index c006d69..deceb4e 100644 --- a/lib9p/types.c +++ b/lib9p/types.c @@ -786,7 +786,7 @@ static bool marshal_Rswrite(struct _marshal_ctx *ctx, struct lib9p_msg_Rswrite * /* vtables ********************************************************************/ struct _vtable_version _lib9p_vtables[LIB9P_VER_NUM] = { - [LIB9P_VER_UNINITIALIZED] = { + [LIB9P_VER_UNINITIALIZED] = { .msgs = { [LIB9P_TYP_Tversion] = { r.unmarshal_basesize = sizeof(struct lib9p_msg_Tversion), r.unmarshal_extrasize = checksize_Tversion, @@ -799,8 +799,8 @@ struct _vtable_version _lib9p_vtables[LIB9P_VER_NUM] = { r.unmarshal = unmarshal_Rversion, r.marshal = (_marshal_fn_t)marshal_Rversion, }, - }, - [LIB9P_VER_9P2000] = { + }}, + [LIB9P_VER_9P2000] = { .msgs = { [LIB9P_TYP_Tversion] = { r.unmarshal_basesize = sizeof(struct lib9p_msg_Tversion), r.unmarshal_extrasize = checksize_Tversion, @@ -963,8 +963,8 @@ struct _vtable_version _lib9p_vtables[LIB9P_VER_NUM] = { r.unmarshal = unmarshal_Rwstat, r.marshal = (_marshal_fn_t)marshal_Rwstat, }, - }, - [LIB9P_VER_9P2000_e] = { + }}, + [LIB9P_VER_9P2000_e] = { .msgs = { [LIB9P_TYP_Tversion] = { r.unmarshal_basesize = sizeof(struct lib9p_msg_Tversion), r.unmarshal_extrasize = checksize_Tversion, @@ -1163,8 +1163,8 @@ struct _vtable_version _lib9p_vtables[LIB9P_VER_NUM] = { r.unmarshal = unmarshal_Rswrite, r.marshal = (_marshal_fn_t)marshal_Rswrite, }, - }, - [LIB9P_VER_9P2000_u] = { + }}, + [LIB9P_VER_9P2000_u] = { .msgs = { [LIB9P_TYP_Tversion] = { r.unmarshal_basesize = sizeof(struct lib9p_msg_Tversion), r.unmarshal_extrasize = checksize_Tversion, @@ -1327,5 +1327,5 @@ struct _vtable_version _lib9p_vtables[LIB9P_VER_NUM] = { r.unmarshal = unmarshal_Rwstat, r.marshal = (_marshal_fn_t)marshal_Rwstat, }, - }, + }}, }; diff --git a/lib9p/types.gen b/lib9p/types.gen index 5eee551..0de5068 100755 --- a/lib9p/types.gen +++ b/lib9p/types.gen @@ -586,18 +586,18 @@ static inline bool marshal_8(struct _marshal_ctx *ctx, uint64_t *val) { /* vtables ********************************************************************/ struct _vtable_version _{idprefix}vtables[LIB9P_VER_NUM] = {{ - [{idprefix.upper()}VER_UNINITIALIZED] = {{ + [{idprefix.upper()}VER_UNINITIALIZED] = {{ .msgs = {{ {msg_entry(next(msg for msg in structs if msg.name == 'Tversion'))}, {msg_entry(next(msg for msg in structs if msg.name == 'Rversion'))}, - }}, + }}}}, """ for ver in sorted(versions): - ret += f"\t[{c_ver(idprefix, ver)}] = {{\n" + ret += f"\t[{c_ver(idprefix, ver)}] = {{ .msgs = {{\n" for msg in structs: if ver not in msg.msgver: continue ret += msg_entry(msg) + ",\n" - ret += "\t},\n" + ret += "\t}},\n" ret += "};\n" ############################################################################ -- cgit v1.2.3-2-g168b