aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--serd/serd.h9
-rw-r--r--src/env.c10
-rw-r--r--tests/serd_test.c6
3 files changed, 4 insertions, 21 deletions
diff --git a/serd/serd.h b/serd/serd.h
index 4e99e39f..272e9b97 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -1024,15 +1024,6 @@ SerdNode*
serd_env_expand(const SerdEnv* env, const SerdNode* node);
/**
- Call `func` for each prefix defined in `env`.
-*/
-SERD_API
-void
-serd_env_foreach(const SerdEnv* env,
- SerdPrefixSink func,
- void* handle);
-
-/**
Write all prefixes in `env` to `sink`.
*/
SERD_API
diff --git a/src/env.c b/src/env.c
index dac6fdae..e1d173bc 100644
--- a/src/env.c
+++ b/src/env.c
@@ -317,16 +317,6 @@ serd_env_expand(const SerdEnv* env, const SerdNode* node)
}
void
-serd_env_foreach(const SerdEnv* env,
- SerdPrefixSink func,
- void* handle)
-{
- for (size_t i = 0; i < env->n_prefixes; ++i) {
- func(handle, env->prefixes[i].name, env->prefixes[i].uri);
- }
-}
-
-void
serd_env_write_prefixes(const SerdEnv* env, const SerdSink* sink)
{
for (size_t i = 0; i < env->n_prefixes; ++i) {
diff --git a/tests/serd_test.c b/tests/serd_test.c
index bda58668..09eb57ad 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -590,9 +590,11 @@ test_env(void)
SerdNode* lit = serd_new_string("hello");
assert(serd_env_set_prefix(env, b, lit));
- int n_prefixes = 0;
+ size_t n_prefixes = 0;
+ SerdSink* count_prefixes_sink = serd_sink_new(&n_prefixes);
+ serd_sink_set_prefix_func(count_prefixes_sink, count_prefixes);
serd_env_set_prefix(env, pre, eg);
- serd_env_foreach(env, count_prefixes, &n_prefixes);
+ serd_env_write_prefixes(env, count_prefixes_sink);
assert(n_prefixes == 1);
SerdNode* shorter_uri = serd_new_uri("urn:foo");