summaryrefslogtreecommitdiffstats
path: root/lilv
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-02-10 08:56:33 +0000
committerDavid Robillard <d@drobilla.net>2013-02-10 08:56:33 +0000
commit36c22be51af07fc96a9168684949b82b8f6e325c (patch)
tree0cbdde26bbcd2d94727dd87ba61e2e7975eb9bc2 /lilv
parent1ad20b172af88a909991289e6a11c8cc7934a875 (diff)
downloadlilv-36c22be51af07fc96a9168684949b82b8f6e325c.tar.gz
lilv-36c22be51af07fc96a9168684949b82b8f6e325c.tar.bz2
lilv-36c22be51af07fc96a9168684949b82b8f6e325c.zip
Add lilv_world_ask() for easily checking if a statement exists.
Add lilv_world_get() and lilv_port_get() for easily getting one value. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5053 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'lilv')
-rw-r--r--lilv/lilv.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/lilv/lilv.h b/lilv/lilv.h
index 6719e67..f2dd17a 100644
--- a/lilv/lilv.h
+++ b/lilv/lilv.h
@@ -650,6 +650,21 @@ lilv_world_find_nodes(LilvWorld* world,
const LilvNode* object);
/**
+ Find a single node that matches a pattern.
+ Exactly one of @p subject, @p predicate, @p object must be NULL.
+ This function is equivalent to
+ lilv_nodes_get_first(lilv_world_find_nodes(...)) but simplifies the common
+ case of only wanting a single value.
+ @return the first matching node, or NULL if no matches are found.
+*/
+LILV_API
+LilvNode*
+lilv_world_get(LilvWorld* world,
+ const LilvNode* subject,
+ const LilvNode* predicate,
+ const LilvNode* object);
+
+/**
Return true iff a statement matching a certain pattern exists.
This is useful for checking if particular statement exists without having to
@@ -1058,6 +1073,19 @@ lilv_port_get_value(const LilvPlugin* plugin,
const LilvNode* predicate);
/**
+ Get a single property value of a port.
+
+ This is equivalent to lilv_nodes_get_first(lilv_port_get_value(...)) but is
+ simpler to use in the common case of only caring about one value. The
+ caller is responsible for freeing the returned node.
+*/
+LILV_API
+LilvNode*
+lilv_port_get(const LilvPlugin* plugin,
+ const LilvPort* port,
+ const LilvNode* predicate);
+
+/**
Return the LV2 port properties of a port.
*/
LILV_API