diff options
author | David Robillard <d@drobilla.net> | 2018-12-26 14:21:37 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:58 +0100 |
commit | 05950ac684d467eb609476d1aa531e221abcffa0 (patch) | |
tree | 5fd07fe579f76051d2422aa6387caf51243561ae | |
parent | 18b0689fe567929b6eb6a1986b16139a122ca12c (diff) | |
download | serd-05950ac684d467eb609476d1aa531e221abcffa0.tar.gz serd-05950ac684d467eb609476d1aa531e221abcffa0.tar.bz2 serd-05950ac684d467eb609476d1aa531e221abcffa0.zip |
Expose the node cache in the world
-rw-r--r-- | serd/serd.h | 11 | ||||
-rw-r--r-- | src/world.c | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/serd/serd.h b/serd/serd.h index bb68f21f..2b4f0410 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_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 800a8bbc..f449ed50 100644 --- a/src/world.c +++ b/src/world.c @@ -111,6 +111,12 @@ serd_world_free(SerdWorld* world) } } +SerdNodes* +serd_world_nodes(SerdWorld* world) +{ + return world->nodes; +} + const SerdNode* serd_world_get_blank(SerdWorld* world) { |