aboutsummaryrefslogtreecommitdiffstats
path: root/src/sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sink.c')
-rw-r--r--src/sink.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sink.c b/src/sink.c
index 4b7c6646..bd6f1193 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -52,12 +52,18 @@ serd_sink_free(SerdSink* sink)
SerdStatus
serd_sink_write_event(const SerdSink* sink, const SerdEvent* event)
{
+ assert(sink);
+ assert(event);
+
return sink->on_event ? sink->on_event(sink->handle, event) : SERD_SUCCESS;
}
SerdStatus
serd_sink_write_base(const SerdSink* sink, const SerdNode* uri)
{
+ assert(sink);
+ assert(uri);
+
const SerdBaseEvent ev = {SERD_BASE, uri};
return sink->on_event ? sink->on_event(sink->handle, (const SerdEvent*)&ev)
@@ -69,6 +75,10 @@ serd_sink_write_prefix(const SerdSink* sink,
const SerdNode* name,
const SerdNode* uri)
{
+ assert(sink);
+ assert(name);
+ assert(uri);
+
const SerdPrefixEvent ev = {SERD_PREFIX, name, uri};
return sink->on_event ? sink->on_event(sink->handle, (const SerdEvent*)&ev)
@@ -80,6 +90,9 @@ serd_sink_write_statement(const SerdSink* sink,
const SerdStatementFlags flags,
const SerdStatement* statement)
{
+ assert(sink);
+ assert(statement);
+
const SerdStatementEvent statement_ev = {SERD_STATEMENT, flags, statement};
SerdEvent ev = {SERD_STATEMENT};
ev.statement = statement_ev;
@@ -107,6 +120,9 @@ serd_sink_write(const SerdSink* sink,
SerdStatus
serd_sink_write_end(const SerdSink* sink, const SerdNode* node)
{
+ assert(sink);
+ assert(node);
+
const SerdEndEvent ev = {SERD_END, node};
return sink->on_event ? sink->on_event(sink->handle, (const SerdEvent*)&ev)