diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-17 14:31:03 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-17 14:31:03 -0600 |
commit | f132dab76a07473d41e14f5f4fb1857a3229ec6a (patch) | |
tree | 621a8f1ae6cb15d360cd47c0bccd08a1c2226f4e /lib9p/internal.h | |
parent | a1fb6a6103cc7d38d54270bcdb9779982d329c9e (diff) |
libmisc
Diffstat (limited to 'lib9p/internal.h')
-rw-r--r-- | lib9p/internal.h | 13 |
1 files changed, 8 insertions, 5 deletions
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); |