aboutsummaryrefslogtreecommitdiffstats
path: root/serd
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-29 17:36:15 -0500
committerDavid Robillard <d@drobilla.net>2018-12-31 11:37:49 -0500
commit904d3d9b0bcdbb1507adccdde831db0d5f7ae251 (patch)
treebe485f9684819534972a40ced925138f5e4d850c /serd
parentbeb2eba61195d6ef838cd3bfd363ae74785aaff9 (diff)
downloadserd-904d3d9b0bcdbb1507adccdde831db0d5f7ae251.tar.gz
serd-904d3d9b0bcdbb1507adccdde831db0d5f7ae251.tar.bz2
serd-904d3d9b0bcdbb1507adccdde831db0d5f7ae251.zip
Add Env to Sink
This isn't technically necessary for any sink, but is a pattern common to every sink implementation in serd, so having it here reduces boilerplate and parameters in user code.
Diffstat (limited to 'serd')
-rw-r--r--serd/serd.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/serd/serd.h b/serd/serd.h
index 0346d32e..c0b22504 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -1025,10 +1025,11 @@ serd_env_send_prefixes(const SerdEnv* env, SerdSink* sink);
serd_sink_set_*_func functions to set handlers for various events.
@param handle Opaque handle that will be passed to sink functions.
+ @param env Environment for sink, updated as base uri or prefixes change.
*/
SERD_API
SerdSink*
-serd_sink_new(void* handle);
+serd_sink_new(void* handle, SerdEnv* env);
/**
Free `sink`.
@@ -1038,6 +1039,13 @@ void
serd_sink_free(SerdSink* sink);
/**
+ Return the env used by `writer`.
+*/
+SERD_API
+SerdEnv*
+serd_sink_get_env(SerdSink* sink);
+
+/**
Set a function to be called when the base URI changes.
*/
SERD_API