diff options
Diffstat (limited to 'lib9p/idl.gen')
-rwxr-xr-x | lib9p/idl.gen | 10 |
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); }} """ |