From bb14e1f16b5d42934e55c7a53117cf50e1153188 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Tue, 25 Mar 2025 00:15:43 -0600 Subject: lib9p: protogen: flatten the validate functions, same as (un)marshal --- lib9p/internal.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib9p/internal.h') diff --git a/lib9p/internal.h b/lib9p/internal.h index 801dc4c..4820f10 100644 --- a/lib9p/internal.h +++ b/lib9p/internal.h @@ -43,14 +43,8 @@ struct _validate_ctx { struct lib9p_ctx *ctx; uint32_t net_size; uint8_t *net_bytes; - - /* output */ - uint32_t net_offset; - /* Increment `host_extra` to pre-allocate space that is - * "extra" beyond sizeof(). */ - size_t host_extra; }; -typedef bool (*_validate_fn_t)(struct _validate_ctx *ctx); +typedef ssize_t (*_validate_fn_t)(struct _validate_ctx *ctx); struct _unmarshal_ctx { /* input */ @@ -96,7 +90,7 @@ 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_stat_validate(struct _validate_ctx *ctx); +ssize_t _lib9p_stat_validate(struct _validate_ctx *ctx, uint32_t *ret_net_size); void _lib9p_stat_unmarshal(struct _unmarshal_ctx *ctx, struct lib9p_stat *out); bool _lib9p_stat_marshal(struct _marshal_ctx *ctx, struct lib9p_stat *val); -- cgit v1.2.3-2-g168b