aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-26 14:21:37 -0500
committerDavid Robillard <d@drobilla.net>2020-06-21 18:12:04 +0200
commitd94fa6a5e5599a7dcfda89bc582df36a0cd7f42e (patch)
tree6e45904dca5d83649e2f6247f52fb5b6848763a7
parent5c5a3b0048eb024f9d6b4657778830731e4f1f87 (diff)
downloadserd-d94fa6a5e5599a7dcfda89bc582df36a0cd7f42e.tar.gz
serd-d94fa6a5e5599a7dcfda89bc582df36a0cd7f42e.tar.bz2
serd-d94fa6a5e5599a7dcfda89bc582df36a0cd7f42e.zip
Expose the node cache in the world
-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 e6fc5e86..fa63e0de 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -914,6 +914,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 7b8ea5b7..16e89566 100644
--- a/src/world.c
+++ b/src/world.c
@@ -109,6 +109,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)
{