diff options
Diffstat (limited to 'src/env.c')
-rw-r--r-- | src/env.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -238,12 +238,16 @@ serd_env_expand_node(const SerdEnv* const env, const SerdNode* const node) return NULL; } -void -serd_env_foreach(const SerdEnv* const env, - const SerdPrefixFunc func, - void* const handle) +SerdStatus +serd_env_write_prefixes(const SerdEnv* const env, const SerdSink* const sink) { - for (size_t i = 0; i < env->n_prefixes; ++i) { - func(handle, env->prefixes[i].name, env->prefixes[i].uri); + SerdStatus st = SERD_SUCCESS; + + for (size_t i = 0; !st && i < env->n_prefixes; ++i) { + const SerdPrefix* const prefix = &env->prefixes[i]; + + st = serd_sink_write_prefix(sink, prefix->name, prefix->uri); } + + return st; } |