summaryrefslogtreecommitdiff
path: root/lib9p/idl.gen
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-10 21:48:16 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-10 21:48:16 -0600
commit2145808d29f495cf872d9b3ffe05420ff9fc5be6 (patch)
tree78ec87bcb6bdf9a19bd6f5a2cb6cb3f8333bfdbc /lib9p/idl.gen
parentdb92bd35807305e6daec5ec40bd67cbc43fe88ee (diff)
implement dread
Diffstat (limited to 'lib9p/idl.gen')
-rwxr-xr-xlib9p/idl.gen18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib9p/idl.gen b/lib9p/idl.gen
index 8e7639a..c0a2444 100755
--- a/lib9p/idl.gen
+++ b/lib9p/idl.gen
@@ -1045,7 +1045,7 @@ static ALWAYS_INLINE bool marshal_8(struct _marshal_ctx *ctx, uint64_t *val) {
for tok in member.val.tokens:
if isinstance(tok, ExprSym) and tok.name.startswith("&"):
if tok.name[1:] not in mark_offset:
- ret += f"\n\tuint32_t _{tok.name[1:]}_offset;"
+ ret += f"\tuint32_t _{tok.name[1:]}_offset;\n"
mark_offset.add(tok.name[1:])
# Pass 2 - main pass
@@ -1092,9 +1092,9 @@ static ALWAYS_INLINE bool marshal_8(struct _marshal_ctx *ctx, uint64_t *val) {
ret += "\t ;\n"
ret += "}\n"
- # vtables ##################################################################
+ # vtables / exports ########################################################
ret += f"""
-/* vtables ********************************************************************/
+/* vtables / exports **********************************************************/
#define _MSG(typ) [{idprefix.upper()}TYP_##typ] = {{ \\
.basesize = sizeof(struct {idprefix}msg_##typ), \\
@@ -1123,6 +1123,18 @@ struct _vtable_version _{idprefix}vtables[{c_ver_enum('NUM')}] = {{
ret += ifdef_pop(0)
ret += "};\n"
+ ret += f"""
+FLATTEN bool _{idprefix}validate_stat(struct _validate_ctx *ctx) {{
+ return validate_stat(ctx);
+}}
+FLATTEN void _{idprefix}unmarshal_stat(struct _unmarshal_ctx *ctx, struct lib9p_stat *out) {{
+ unmarshal_stat(ctx, out);
+}}
+FLATTEN bool _{idprefix}marshal_stat(struct _marshal_ctx *ctx, struct lib9p_stat *val) {{
+ return marshal_stat(ctx, val);
+}}
+"""
+
############################################################################
return ret