From f132dab76a07473d41e14f5f4fb1857a3229ec6a Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Thu, 17 Oct 2024 14:31:03 -0600 Subject: libmisc --- lib9p/internal.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib9p/internal.h') diff --git a/lib9p/internal.h b/lib9p/internal.h index 013024e..d78823d 100644 --- a/lib9p/internal.h +++ b/lib9p/internal.h @@ -45,7 +45,7 @@ static_assert(CONFIG_9P_MAX_HOSTMSG_SIZE <= SSIZE_MAX); #define CAT2(a, b) a##b #define CAT3(a, b, c) a##b##c -/* vtables ********************************************************************/ +/* specialized contexts *******************************************************/ struct _validate_ctx { struct lib9p_ctx *ctx; @@ -77,18 +77,21 @@ struct _marshal_ctx { }; typedef bool (*_marshal_fn_t)(struct _marshal_ctx *ctx, void *host_val); -struct _vtable_msg { +/* tables *********************************************************************/ + +struct _table_msg { + char *name; size_t basesize; _validate_fn_t validate; _unmarshal_fn_t unmarshal; _marshal_fn_t marshal; }; -struct _vtable_version { - struct _vtable_msg msgs[0xFF]; +struct _table_version { + struct _table_msg msgs[0x100]; }; -extern struct _vtable_version _lib9p_vtables[LIB9P_VER_NUM]; +extern struct _table_version _lib9p_versions[LIB9P_VER_NUM]; bool _lib9p_validate_stat(struct _validate_ctx *ctx); void _lib9p_unmarshal_stat(struct _unmarshal_ctx *ctx, struct lib9p_stat *out); -- cgit v1.2.3-2-g168b