aboutsummaryrefslogtreecommitdiffstats
path: root/src/sink.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-10-02 14:47:14 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:07 -0500
commitaa6b5ec5b9344bce0ea38d294aef0782c3745548 (patch)
tree0481c7a3b690a35728b0649d281e0ba3e321a428 /src/sink.c
parent6076b31090176be685c30aa198edd3cebfd4fd7a (diff)
downloadserd-aa6b5ec5b9344bce0ea38d294aef0782c3745548.tar.gz
serd-aa6b5ec5b9344bce0ea38d294aef0782c3745548.tar.bz2
serd-aa6b5ec5b9344bce0ea38d294aef0782c3745548.zip
Add assertions for all non-null pointers in the public API
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 8343a62a..adf85b08 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -42,12 +42,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)
@@ -59,6 +65,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)
@@ -70,6 +80,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;
@@ -97,6 +110,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)