From 05950ac684d467eb609476d1aa531e221abcffa0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 26 Dec 2018 14:21:37 -0500 Subject: Expose the node cache in the world --- serd/serd.h | 11 +++++++++++ src/world.c | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/serd/serd.h b/serd/serd.h index bb68f21f..2b4f0410 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -919,6 +919,17 @@ SERD_API 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. 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) { -- cgit v1.2.1