From e7f3db0679e5d37970a06f428208c3f5b51db5d2 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Tue, 18 Mar 2025 10:53:12 -0600 Subject: wip --- lib9p/protogen/h.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib9p/protogen/h.py') diff --git a/lib9p/protogen/h.py b/lib9p/protogen/h.py index 7785ca1..3e743e9 100644 --- a/lib9p/protogen/h.py +++ b/lib9p/protogen/h.py @@ -166,6 +166,11 @@ def gen_h(versions: set[str], typs: list[idl.UserType]) -> str: #include /* for uint{{n}}_t types */ #include /* for struct iovec */ + +struct {c9util.ident('_iovec_list')} {{ +\tstruct iovec *iov; +\tint iovcnt; +}}; """ id2typ: dict[int, idl.Message] = {} @@ -224,6 +229,7 @@ enum {c9util.ident('version')} {{ ret += """ /* payload types **************************************************************/ + """ def per_version_comment( @@ -357,7 +363,13 @@ enum {c9util.ident('version')} {{ if member.val: continue ret += cutil.ifdef_push(2, c9util.ver_ifdef(member.in_versions)) - ret += f"\t{c9util.typename(member.typ, member):<{typewidth}} {'*' if member.cnt else ' '}{member.membname};\n" + ptr = bool(member.cnt) + if ( + c9util.typename(member.typ, member) + == f"struct {c9util.ident('_iovec')}" + ): # SPECIAL (zerocopy) + ptr = False + ret += f"\t{c9util.typename(member.typ, member):<{typewidth}} {'*' if ptr else ' '}{member.membname};\n" ret += cutil.ifdef_pop(1) ret += "};\n" del typ -- cgit v1.2.3-2-g168b