summaryrefslogtreecommitdiff
path: root/lib9p
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p')
-rw-r--r--lib9p/CMakeLists.txt3
-rw-r--r--lib9p/srv.c9
-rw-r--r--lib9p/types.c16
-rwxr-xr-xlib9p/types.gen8
4 files changed, 20 insertions, 16 deletions
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 <assert.h>
-#include "coroutine.h"
-#include "netio.h"
-#include "9p/9p.h"
+#include <libcr/coroutine.h>
+#include <libcr_ipc/chan.h>
+#include <libnetio/netio.h>
-#include "9p/internal.h"
+#include <lib9p/9p.h>
+#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"
############################################################################