diff options
author | David Robillard <d@drobilla.net> | 2018-06-03 19:47:07 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-06-21 18:12:04 +0200 |
commit | bdd403e7745a2b53323721cc63c05c2b26e651c9 (patch) | |
tree | 00a57a30853ce7cb7d483d9e05d94c762a9fa0ba /src/writer.c | |
parent | 167811c7925cb4f37d454881d5dc15960395145a (diff) | |
download | serd-bdd403e7745a2b53323721cc63c05c2b26e651c9.tar.gz serd-bdd403e7745a2b53323721cc63c05c2b26e651c9.tar.bz2 serd-bdd403e7745a2b53323721cc63c05c2b26e651c9.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/writer.c')
-rw-r--r-- | src/writer.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/writer.c b/src/writer.c index d16b18b3..9f0f282a 100644 --- a/src/writer.c +++ b/src/writer.c @@ -685,13 +685,15 @@ write_list_obj(SerdWriter* writer, } static SerdStatus -serd_writer_write_statement(SerdWriter* writer, - SerdStatementFlags flags, - const SerdNode* graph, - const SerdNode* subject, - const SerdNode* predicate, - const SerdNode* object) +serd_writer_write_statement(SerdWriter* writer, + SerdStatementFlags flags, + const SerdStatement* statement) { + const SerdNode* const subject = serd_statement_get_subject(statement); + const SerdNode* const predicate = serd_statement_get_predicate(statement); + const SerdNode* const object = serd_statement_get_object(statement); + const SerdNode* const graph = serd_statement_get_graph(statement); + if (!subject || !predicate || !object || !is_resource(subject) || !is_resource(predicate)) { return SERD_ERR_BAD_ARG; |