aboutgitcodelistschat:MatrixIRC
path: root/cooker/call.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2023-06-14 07:25:52 +0200
committerStefano Brivio <sbrivio@redhat.com>2023-06-14 07:25:52 +0200
commit00614c5e6702db8ac3f18a9e193c7a8382f16e6b (patch)
treeb8275d1060e994e18d7fbfead0244629752cb555 /cooker/call.c
parent8bc937c1442d212926dadb6227b759966bc13925 (diff)
downloadseitan-00614c5e6702db8ac3f18a9e193c7a8382f16e6b.tar
seitan-00614c5e6702db8ac3f18a9e193c7a8382f16e6b.tar.gz
seitan-00614c5e6702db8ac3f18a9e193c7a8382f16e6b.tar.bz2
seitan-00614c5e6702db8ac3f18a9e193c7a8382f16e6b.tar.lz
seitan-00614c5e6702db8ac3f18a9e193c7a8382f16e6b.tar.xz
seitan-00614c5e6702db8ac3f18a9e193c7a8382f16e6b.tar.zst
seitan-00614c5e6702db8ac3f18a9e193c7a8382f16e6b.zip
cooker: Support for read(), OP_STORE, field-based filters
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'cooker/call.c')
-rw-r--r--cooker/call.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/cooker/call.c b/cooker/call.c
index 4e9cb9c..c3f290c 100644
--- a/cooker/call.c
+++ b/cooker/call.c
@@ -100,6 +100,9 @@ static union value parse_field(struct gluten_ctx *g, struct arg *args,
if (!dry_run)
gluten_add_tag_post(g, tag_set, offset);
+
+ if (f->flags & RBUF)
+ return v;
}
if ((tag_get = json_object_get_string(tmp2, "get"))) {
@@ -199,13 +202,13 @@ static union value parse_field(struct gluten_ctx *g, struct arg *args,
}
break;
case STRING:
+ if (dry_run)
+ break;
+
v.v_str = json_value_get_string(jvalue);
if (strlen(v.v_str) + 1 > f->size)
die(" string %s too long for field", v.v_str);
- if (dry_run)
- break;
-
emit_data_at(g, offset, f->type, &v);
break;
case STRUCT:
@@ -327,7 +330,7 @@ static struct gluten_offset parse_arg(struct gluten_ctx *g, struct arg *args,
}
if (arg_needs_temp(&a->f, a->pos, jvalue, &top_level_tag, 0) ||
- multi_field) {
+ multi_field || (a->f.flags & RBUF)) {
if (a->f.size)
offset = gluten_rw_alloc(g, a->f.size);
else