aboutsummaryrefslogtreecommitdiffstats
path: root/src/reader.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-06-03 19:47:07 +0200
committerDavid Robillard <d@drobilla.net>2018-12-31 11:37:47 -0500
commit6413746068d35e8e88111f930cbaadc56e2cf0cf (patch)
treeac2fdc094ed1e0409a5b2fdcdda3ec4034a3ab14 /src/reader.c
parent39fabf4d292f674f4d669b98e446e66d8ef11aa0 (diff)
downloadserd-6413746068d35e8e88111f930cbaadc56e2cf0cf.tar.gz
serd-6413746068d35e8e88111f930cbaadc56e2cf0cf.tar.bz2
serd-6413746068d35e8e88111f930cbaadc56e2cf0cf.zip
Make statement sink take a statement rather than nodes
This makes the interface more extensible, towards associating more information with statements. The serd_sink_write_nodes wrapper remains so that user code does not need to allocate in order to write statement.
Diffstat (limited to 'src/reader.c')
-rw-r--r--src/reader.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/reader.c b/src/reader.c
index ee27a2fb..40c48a41 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -21,6 +21,7 @@
#include "serd/serd.h"
#include "serd_internal.h"
#include "stack.h"
+#include "statement.h"
#include "system.h"
#include "world.h"
@@ -125,9 +126,12 @@ emit_statement(SerdReader* reader, ReadContext ctx, SerdNode* o)
(subject and predicate) were already zeroed by subsequent pushes. */
serd_node_zero_pad(o);
+ const SerdStatement statement = {
+ { ctx.subject, ctx.predicate, o, graph }
+ };
+
const SerdStatus st = reader->sink->statement(
- reader->sink->handle, *ctx.flags, graph,
- ctx.subject, ctx.predicate, o);
+ reader->sink->handle, *ctx.flags, &statement);
*ctx.flags &= SERD_ANON_CONT|SERD_LIST_CONT; // Preserve only cont flags
return st;
}