diff options
-rw-r--r-- | serd/serd.h | 7 | ||||
-rw-r--r-- | src/env.c | 8 |
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 @{ @@ -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); + } +} |