aboutsummaryrefslogtreecommitdiffstats
path: root/src/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/env.c')
-rw-r--r--src/env.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/env.c b/src/env.c
index a6f1b5a9..71cb196f 100644
--- a/src/env.c
+++ b/src/env.c
@@ -32,6 +32,7 @@ typedef struct {
} SerdPrefix;
struct SerdEnvImpl {
+ SerdWorld* world;
SerdNodes* nodes;
SerdPrefix* prefixes;
size_t n_prefixes;
@@ -40,10 +41,13 @@ struct SerdEnvImpl {
};
SerdEnv*
-serd_env_new(const SerdStringView base_uri)
+serd_env_new(SerdWorld* const world, const SerdStringView base_uri)
{
+ assert(world);
+
SerdEnv* env = (SerdEnv*)calloc(1, sizeof(struct SerdEnvImpl));
+ env->world = world;
env->nodes = serd_nodes_new();
if (env && base_uri.len) {
@@ -62,6 +66,7 @@ serd_env_copy(const SerdEnv* const env)
SerdEnv* copy = (SerdEnv*)calloc(1, sizeof(struct SerdEnvImpl));
if (copy) {
+ copy->world = env->world;
copy->nodes = serd_nodes_new();
copy->n_prefixes = env->n_prefixes;
@@ -115,6 +120,12 @@ serd_env_equals(const SerdEnv* const a, const SerdEnv* const b)
return true;
}
+SerdWorld*
+serd_env_world(const SerdEnv* const env)
+{
+ return env->world;
+}
+
SerdURIView
serd_env_base_uri_view(const SerdEnv* const env)
{