summaryrefslogtreecommitdiff
path: root/lib9p/internal.h
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-14 01:11:17 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-14 01:11:17 -0700
commitf7c75fe0113cdbd3e13b4e22edf76d9456c4b064 (patch)
treed65c0c26f7d100085d6a563aea9df1b501cbbd19 /lib9p/internal.h
parent7eda822ef31a15d22de03fc1eec7d995f661b26d (diff)
parenta02f59f255006a2d6cb236fe2448b69c9c223adb (diff)
Merge branch 'lukeshu/9p-code-size'
Diffstat (limited to 'lib9p/internal.h')
-rw-r--r--lib9p/internal.h24
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 ********************************************************/