From 1b420b15b3c88ebbcd6789f78b69bd284e0a98f7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 7 Mar 2015 08:42:56 +0000 Subject: Add support for state deletion. Add lilv_node_get_path(). Add lilv_state_get_uri(). Add lilv_state_delete(). Fix creation of duplicate manifest entries when saving state. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5617 a436a847-0d15-0410-975c-d299462d15a1 --- src/world.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/world.c') diff --git a/src/world.c b/src/world.c index 566c862..2855885 100644 --- a/src/world.c +++ b/src/world.c @@ -564,7 +564,7 @@ lilv_world_load_dyn_manifest(LilvWorld* world, #endif // LILV_DYN_MANIFEST } -static LilvNode* +LilvNode* lilv_world_get_manifest_uri(LilvWorld* world, LilvNode* bundle_uri) { SerdNode manifest_uri = lilv_new_uri_relative_to_base( @@ -628,8 +628,7 @@ static int lilv_world_drop_graph(LilvWorld* world, LilvNode* graph) { SordIter* i = sord_search(world->model, NULL, NULL, NULL, graph->node); - while (!sord_iter_end(i) && - sord_node_equals(sord_iter_get_node(i, SORD_GRAPH), graph->node)) { + while (!sord_iter_end(i)) { const SerdStatus st = sord_erase(world->model, i); if (st) { LILV_ERRORF("Error removing statement from <%s> (%s)\n", @@ -657,6 +656,10 @@ lilv_world_unload_file(LilvWorld* world, LilvNode* file) LILV_API int lilv_world_unload_bundle(LilvWorld* world, LilvNode* bundle_uri) { + if (!bundle_uri) { + return 0; + } + // Remove loaded_files entry for manifest.ttl LilvNode* manifest = lilv_world_get_manifest_uri(world, bundle_uri); lilv_world_unload_file(world, manifest); -- cgit v1.2.1