From 167811c7925cb4f37d454881d5dc15960395145a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 3 Jun 2018 19:42:30 +0200 Subject: Add sink interface --- serd/serd.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'serd') diff --git a/serd/serd.h b/serd/serd.h index ca2279e8..4cf030f5 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -941,6 +941,66 @@ serd_env_foreach(const SerdEnv* env, SerdPrefixSink func, void* handle); +/** + @} + @name Sink + @{ +*/ + +/** + Set the base URI. + + Simple wrapper for the `SerdBaseSink` of `sink`. +*/ +SERD_API +SerdStatus +serd_sink_write_base(const SerdSink* sink, const SerdNode* uri); + +/** + Set a namespace prefix. + + Simple wrapper for the `SerdPrefixSink` of `sink`. +*/ +SERD_API +SerdStatus +serd_sink_write_prefix(const SerdSink* sink, + const SerdNode* name, + const SerdNode* uri); + +/** + Write a statement. + + Simple wrapper for the `SerdStatementSink` of `sink`. +*/ +SERD_API +SerdStatus +serd_sink_write_statement(const SerdSink* sink, + SerdStatementFlags flags, + const SerdStatement* statement); + +/** + Write a statement from individual nodes. + + Simple wrapper for the `SerdStatementSink` of `sink`. +*/ +SERD_API +SerdStatus +serd_sink_write(const SerdSink* sink, + SerdStatementFlags flags, + const SerdNode* subject, + const SerdNode* predicate, + const SerdNode* object, + const SerdNode* graph); + +/** + Mark the end of an anonymous node. + + Simple wrapper for the `SerdEndSink` of `sink`. +*/ +SERD_API +SerdStatus +serd_sink_write_end(const SerdSink* sink, const SerdNode* node); + /** @} @name Reader -- cgit v1.2.1