Sink¶
-
typedef void (*
SerdFreeFunc
)(void *ptr)¶ Function to free an opaque handle.
-
SerdSink *
serd_sink_new
(void *handle, SerdEventFunc event_func, SerdFreeFunc free_handle)¶ Create a new sink.
Initially, the sink has no set functions and will do nothing. Use the serd_sink_set_*_func functions to set handlers for various events.
- Parameters
handle – Opaque handle that will be passed to sink functions.
event_func – Function that will be called for every event
free_handle – Free function to call on handle in
serd_sink_free()
.
-
SerdStatus
serd_sink_write_event
(const SerdSink *sink, const SerdEvent *event)¶ Send an event to the sink.
-
SerdStatus
serd_sink_write_base
(const SerdSink *sink, const SerdNode *uri)¶ Set the base URI.
-
SerdStatus
serd_sink_write_prefix
(const SerdSink *sink, const SerdNode *name, const SerdNode *uri)¶ Set a namespace prefix.
-
SerdStatus
serd_sink_write_statement
(const SerdSink *sink, SerdStatementFlags flags, const SerdStatement *statement)¶ Write a statement.
-
SerdStatus
serd_sink_write
(const SerdSink *sink, SerdStatementFlags flags, const SerdNode *subject, const SerdNode *predicate, const SerdNode *object, const SerdNode *graph)¶ Write a statement from individual nodes.
-
SerdStatus
serd_sink_write_end
(const SerdSink *sink, const SerdNode *node)¶ Mark the end of an anonymous node.