aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--serd/serd.h11
-rw-r--r--src/world.c6
2 files changed, 17 insertions, 0 deletions
diff --git a/serd/serd.h b/serd/serd.h
index 272e9b97..1dc4db97 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -920,6 +920,17 @@ void
serd_world_free(SerdWorld* world);
/**
+ Return the nodes cache in `world`.
+
+ The returned cache is owned by the world and contains various nodes used
+ frequently by the implementation. For convenience, it may be used to store
+ additional nodes which will be freed when the world is freed.
+*/
+SERD_API
+SerdNodes*
+serd_world_get_nodes(SerdWorld* world);
+
+/**
Return a unique blank node.
The returned node is valid only until the next time serd_world_get_blank()
diff --git a/src/world.c b/src/world.c
index 21bce2f3..f950e948 100644
--- a/src/world.c
+++ b/src/world.c
@@ -108,6 +108,12 @@ serd_world_free(SerdWorld* world)
free(world);
}
+SerdNodes*
+serd_world_get_nodes(SerdWorld* world)
+{
+ return world->nodes;
+}
+
const SerdNode*
serd_world_get_blank(SerdWorld* world)
{