From 46c24939e2e0f41f0719289cd3b491367cf3355e Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Wed, 2 Apr 2025 17:28:53 -0600 Subject: lib9p: Add lo_box_lib9p_msg_as_fmt_formatter() to tables --- lib9p/protogen/c.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib9p/protogen/c.py') diff --git a/lib9p/protogen/c.py b/lib9p/protogen/c.py index 722db7f..a6824ce 100644 --- a/lib9p/protogen/c.py +++ b/lib9p/protogen/c.py @@ -156,7 +156,12 @@ def gen_c(versions: set[str], typs: list[idl.UserType]) -> str: return ret ret += "\n" - ret += f"#define _MSG(typ) [{c9util.Ident('TYP_')}##typ] = {{.name=#typ}}\n" + ret += cutil.macro( + f"#define _MSG(typ) [{c9util.Ident('TYP_')}##typ] = {{\n" + f"\t\t.name = #typ,\n" + f"\t\t.box_as_fmt_formatter = (_box_as_fmt_formatter_fn_t)lo_box_{c9util.ident('msg_')}##typ##_as_fmt_formatter,\n" + f"\t}}\n" + ) ret += msg_table("_msg_tentry", "_table_msg", "_MSG", (0, 0x100, 1)) ret += "\n" -- cgit v1.2.3-2-g168b