summaryrefslogtreecommitdiffstats
path: root/sord/sord.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-01-14 06:53:05 +0000
committerDavid Robillard <d@drobilla.net>2013-01-14 06:53:05 +0000
commit5cd549c8e512d9a85d7d666db5da8b8a444a281f (patch)
tree2aa2c443cf9aaf675588242bf86e8c6e0fb547e5 /sord/sord.h
parentfb40f19426ce147083c26c2fe9a9805f89fb8e9b (diff)
downloadsord-5cd549c8e512d9a85d7d666db5da8b8a444a281f.tar.gz
sord-5cd549c8e512d9a85d7d666db5da8b8a444a281f.tar.bz2
sord-5cd549c8e512d9a85d7d666db5da8b8a444a281f.zip
Add sord_node_get() for easily getting single property values.
git-svn-id: http://svn.drobilla.net/sord/trunk@280 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'sord/sord.h')
-rw-r--r--sord/sord.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sord/sord.h b/sord/sord.h
index 8f1ef38..ee49764 100644
--- a/sord/sord.h
+++ b/sord/sord.h
@@ -397,6 +397,19 @@ sord_search(SordModel* model,
const SordNode* p,
const SordNode* o,
const SordNode* g);
+/**
+ Search for a single node that matches a pattern.
+ Exactly one of @p s, @p p, @p o must be NULL.
+ This function is mainly useful for predicates that only have one value.
+ @return the first matching node, or NULL if no matches are found.
+*/
+SORD_API
+const SordNode*
+sord_get(SordModel* model,
+ const SordNode* s,
+ const SordNode* p,
+ const SordNode* o,
+ const SordNode* g);
/**
Return true iff a statement exists.