aboutsummaryrefslogtreecommitdiffstats
path: root/src/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/env.c')
-rw-r--r--src/env.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/env.c b/src/env.c
index 8b3970b3..4ce0add4 100644
--- a/src/env.c
+++ b/src/env.c
@@ -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;
}