From cd64085694c7c4aa96312e88905015eea4d8b63d Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Thu, 26 Dec 2024 18:01:31 -0700 Subject: lib9p: Split the generated tables up --- lib9p/internal.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'lib9p/internal.h') diff --git a/lib9p/internal.h b/lib9p/internal.h index b1a367d..5f49131 100644 --- a/lib9p/internal.h +++ b/lib9p/internal.h @@ -1,6 +1,6 @@ /* lib9p/internal.h - TODO * - * Copyright (C) 2024 Luke T. Shumaker + * Copyright (C) 2024-2025 Luke T. Shumaker * SPDX-License-Identifier: AGPL-3.0-or-later */ @@ -73,21 +73,23 @@ struct _marshal_ctx { }; typedef bool (*_marshal_fn_t)(struct _marshal_ctx *ctx, void *host_val); -/* tables *********************************************************************/ +/* tables / exports ***********************************************************/ -struct _table_msg { - char *name; +struct _lib9p_recv_tentry { size_t basesize; _validate_fn_t validate; _unmarshal_fn_t unmarshal; - _marshal_fn_t marshal; }; -struct _table_version { - struct _table_msg msgs[0x100]; +struct _lib9p_send_tentry { + _marshal_fn_t marshal; }; -extern struct _table_version _lib9p_versions[LIB9P_VER_NUM]; +extern const char * _lib9p_table_msg_name[LIB9P_VER_NUM][0x100]; +extern const struct _lib9p_recv_tentry _lib9p_table_Tmsg_recv[LIB9P_VER_NUM][0x80]; +extern const struct _lib9p_recv_tentry _lib9p_table_Rmsg_recv[LIB9P_VER_NUM][0x80]; +extern const struct _lib9p_send_tentry _lib9p_table_Tmsg_send[LIB9P_VER_NUM][0x80]; +extern const struct _lib9p_send_tentry _lib9p_table_Rmsg_send[LIB9P_VER_NUM][0x80]; 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 From f263b08d4457e36126f150566219472f3a05c906 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Mon, 16 Dec 2024 14:56:05 -0500 Subject: lib9p: Rename `lib9p_*_stat()` to `lib9p_stat_*()` for consistency --- lib9p/internal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib9p/internal.h') diff --git a/lib9p/internal.h b/lib9p/internal.h index 5f49131..57d61cb 100644 --- a/lib9p/internal.h +++ b/lib9p/internal.h @@ -91,9 +91,9 @@ extern const struct _lib9p_recv_tentry _lib9p_table_Rmsg_recv[LIB9P_VER_NUM][0x8 extern const struct _lib9p_send_tentry _lib9p_table_Tmsg_send[LIB9P_VER_NUM][0x80]; extern const struct _lib9p_send_tentry _lib9p_table_Rmsg_send[LIB9P_VER_NUM][0x80]; -bool _lib9p_validate_stat(struct _validate_ctx *ctx); -void _lib9p_unmarshal_stat(struct _unmarshal_ctx *ctx, struct lib9p_stat *out); -bool _lib9p_marshal_stat(struct _marshal_ctx *ctx, struct lib9p_stat *val); +bool _lib9p_stat_validate(struct _validate_ctx *ctx); +void _lib9p_stat_unmarshal(struct _unmarshal_ctx *ctx, struct lib9p_stat *out); +bool _lib9p_stat_marshal(struct _marshal_ctx *ctx, struct lib9p_stat *val); /* unmarshal utilities ********************************************************/ -- cgit v1.2.3-2-g168b