summaryrefslogtreecommitdiff
path: root/lib9p/idl.gen
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-13 23:20:13 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-02-11 16:55:04 -0700
commitd243a00001d4e8ab3ce30a34021c26fa0e96825d (patch)
treed071db88b01c17b969cdd4ab375054d4d9543271 /lib9p/idl.gen
parenta0f5064ed0f3ee42a0b303e111bd89641a926676 (diff)
lib9p: idl.gen: Touch up
Diffstat (limited to 'lib9p/idl.gen')
-rwxr-xr-xlib9p/idl.gen10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib9p/idl.gen b/lib9p/idl.gen
index 8782771..9f8f307 100755
--- a/lib9p/idl.gen
+++ b/lib9p/idl.gen
@@ -53,13 +53,13 @@ def c_ver_enum(ver: str) -> str:
return f"{idprefix.upper()}VER_{ver.replace('.', '_')}"
-def c_ver_ifdef(versions: set[str]) -> str:
+def c_ver_ifdef(versions: typing.Collection[str]) -> str:
return " || ".join(
f"CONFIG_9P_ENABLE_{v.replace('.', '_')}" for v in sorted(versions)
)
-def c_ver_cond(versions: set[str]) -> str:
+def c_ver_cond(versions: typing.Collection[str]) -> str:
if len(versions) == 1:
v = next(v for v in versions)
return f"is_ver(ctx, {v.replace('.', '_')})"
@@ -411,7 +411,7 @@ def gen_c(versions: set[str], typs: list[idl.Type]) -> str:
ret += f"""
/* strings ********************************************************************/
-const char *_lib9p_table_ver_name[{c_ver_enum('NUM')}] = {{
+const char *_{idprefix}table_ver_name[{c_ver_enum('NUM')}] = {{
"""
for ver in ["unknown", *sorted(versions)]:
if ver in versions:
@@ -815,10 +815,10 @@ LM_ALWAYS_INLINE static bool marshal_8(struct _marshal_ctx *ctx, uint64_t *val)
LM_FLATTEN bool _{idprefix}stat_validate(struct _validate_ctx *ctx) {{
\treturn validate_stat(ctx);
}}
-LM_FLATTEN void _{idprefix}stat_unmarshal(struct _unmarshal_ctx *ctx, struct lib9p_stat *out) {{
+LM_FLATTEN void _{idprefix}stat_unmarshal(struct _unmarshal_ctx *ctx, struct {idprefix}stat *out) {{
\tunmarshal_stat(ctx, out);
}}
-LM_FLATTEN bool _{idprefix}stat_marshal(struct _marshal_ctx *ctx, struct lib9p_stat *val) {{
+LM_FLATTEN bool _{idprefix}stat_marshal(struct _marshal_ctx *ctx, struct {idprefix}stat *val) {{
\treturn marshal_stat(ctx, val);
}}
"""