aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-20 13:08:46 -0500
committerDavid Robillard <d@drobilla.net>2018-12-31 11:37:49 -0500
commitb1c007c9989d0b769a040b98d4dc50ec456a5d4b (patch)
treebf677d1fdb3c5eedc6a502b3062a4c9d7e6e832f
parentbb495bd3c02629f1e0396fd89d2ff503b889d3dd (diff)
downloadserd-b1c007c9989d0b769a040b98d4dc50ec456a5d4b.tar.gz
serd-b1c007c9989d0b769a040b98d4dc50ec456a5d4b.tar.bz2
serd-b1c007c9989d0b769a040b98d4dc50ec456a5d4b.zip
Add serd_env_send_prefixes()
-rw-r--r--serd/serd.h7
-rw-r--r--src/env.c8
2 files changed, 15 insertions, 0 deletions
diff --git a/serd/serd.h b/serd/serd.h
index 06bff454..fff3eecd 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -1004,6 +1004,13 @@ serd_env_foreach(const SerdEnv* env,
void* handle);
/**
+ Send all prefixes in `env` to `sink`.
+*/
+SERD_API
+void
+serd_env_send_prefixes(const SerdEnv* env, SerdSink* sink);
+
+/**
@}
@name Sink
@{
diff --git a/src/env.c b/src/env.c
index 00585426..e749f050 100644
--- a/src/env.c
+++ b/src/env.c
@@ -326,3 +326,11 @@ serd_env_foreach(const SerdEnv* env,
func(handle, env->prefixes[i].name, env->prefixes[i].uri);
}
}
+
+void
+serd_env_send_prefixes(const SerdEnv* env, SerdSink* sink)
+{
+ for (size_t i = 0; i < env->n_prefixes; ++i) {
+ serd_sink_set_prefix(sink, env->prefixes[i].name, env->prefixes[i].uri);
+ }
+}