diff options
author | David Robillard <d@drobilla.net> | 2018-06-03 19:42:30 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-11-25 22:12:47 +0100 |
commit | cd63c3d8d0627b5cb6c060db5f5132c0dbcc9a79 (patch) | |
tree | 4d9e339fb52330a1846814df0d75c126b8575c50 /src | |
parent | b2e692cb13040e569b964b884867011cceb9d4c3 (diff) | |
download | serd-cd63c3d8d0627b5cb6c060db5f5132c0dbcc9a79.tar.gz serd-cd63c3d8d0627b5cb6c060db5f5132c0dbcc9a79.tar.bz2 serd-cd63c3d8d0627b5cb6c060db5f5132c0dbcc9a79.zip |
Add sink interface
Diffstat (limited to 'src')
-rw-r--r-- | src/sink.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/sink.c b/src/sink.c new file mode 100644 index 00000000..52e85c48 --- /dev/null +++ b/src/sink.c @@ -0,0 +1,62 @@ +/* + Copyright 2011-2014 David Robillard <http://drobilla.net> + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#include "serd/serd.h" + +SerdStatus +serd_sink_set_base(const SerdSink* sink, const SerdNode* uri) +{ + return sink->base(sink->handle, uri); +} + +SerdStatus +serd_sink_set_prefix(const SerdSink* sink, + const SerdNode* name, + const SerdNode* uri) +{ + return sink->prefix(sink->handle, name, uri); +} + +SerdStatus +serd_sink_write_statement(const SerdSink* sink, + const SerdStatementFlags flags, + const SerdStatement* statement) +{ + return sink->statement(sink->handle, + flags, + serd_statement_get_graph(statement), + serd_statement_get_subject(statement), + serd_statement_get_predicate(statement), + serd_statement_get_object(statement)); +} + +SerdStatus +serd_sink_write_nodes(const SerdSink* sink, + const SerdStatementFlags flags, + const SerdNode* subject, + const SerdNode* predicate, + const SerdNode* object, + const SerdNode* graph) +{ + return sink->statement( + sink->handle, flags, graph, subject, predicate, object); +} + +SerdStatus +serd_sink_end(const SerdSink* sink, const SerdNode* node) +{ + return sink->end(sink->handle, node); +} |