diff options
Diffstat (limited to 'lib9p/internal.h')
-rw-r--r-- | lib9p/internal.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib9p/internal.h b/lib9p/internal.h index b1a367d..57d61cb 100644 --- a/lib9p/internal.h +++ b/lib9p/internal.h @@ -1,6 +1,6 @@ /* lib9p/internal.h - TODO * - * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com> * SPDX-License-Identifier: AGPL-3.0-or-later */ @@ -73,25 +73,27 @@ 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); -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 ********************************************************/ |