summaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-11-23 05:59:09 +0000
committerDavid Robillard <d@drobilla.net>2012-11-23 05:59:09 +0000
commit6ce5332b4e27d4fec3ed317386ea6839d217f7fd (patch)
tree2bef8a76b9c46bbe3491fcf268f9c1b3c08151dd /src/world.c
parentc28f70ab84dcbc2a185b1dc9577ea97cb1042701 (diff)
downloadlilv-6ce5332b4e27d4fec3ed317386ea6839d217f7fd.tar.gz
lilv-6ce5332b4e27d4fec3ed317386ea6839d217f7fd.tar.bz2
lilv-6ce5332b4e27d4fec3ed317386ea6839d217f7fd.zip
Add lilv_nodes_merge() to API (address part of #835).
More lightweight version of lilv_plugin_has_feature() and lilv_world_find_nodes(). git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4860 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/world.c')
-rw-r--r--src/world.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/world.c b/src/world.c
index afa3422..121f59c 100644
--- a/src/world.c
+++ b/src/world.c
@@ -185,31 +185,20 @@ lilv_world_find_nodes(LilvWorld* world,
LILV_ERRORF("Subject `%s' is not a resource\n",
sord_node_get_string(subject->node));
return NULL;
- }
- if (!lilv_node_is_uri(predicate)) {
+ } else if (!lilv_node_is_uri(predicate)) {
LILV_ERRORF("Predicate `%s' is not a URI\n",
sord_node_get_string(predicate->node));
return NULL;
- }
- if (!subject && !object) {
+ } else if (!subject && !object) {
LILV_ERROR("Both subject and object are NULL\n");
return NULL;
}
-
- SordNode* const subject_node = subject
- ? sord_node_copy(subject->node)
- : NULL;
-
- SordNode* const object_node = object
- ? sord_node_copy(object->node)
- : NULL;
-
- LilvNodes* ret = lilv_world_query_values_internal(
- world, subject_node, predicate->node, object_node);
-
- sord_node_free(world->world, subject_node);
- sord_node_free(world->world, object_node);
- return ret;
+
+ return lilv_world_query_values_internal(
+ world,
+ subject ? subject->node : NULL,
+ predicate->node,
+ object ? object->node : NULL);
}
SordIter*