summaryrefslogtreecommitdiffstats
path: root/src/sord.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-06-09 06:11:04 +0000
committerDavid Robillard <d@drobilla.net>2011-06-09 06:11:04 +0000
commit0c28ca816f7d28d8a522d41f2d6d31d0112324da (patch)
tree143963fd5f8f89424936a3479e9b7cdc8377e24a /src/sord.c
parentedcd7137e091df562f70daa1092f09d4e92f15a3 (diff)
downloadsord-0c28ca816f7d28d8a522d41f2d6d31d0112324da.tar.gz
sord-0c28ca816f7d28d8a522d41f2d6d31d0112324da.tar.bz2
sord-0c28ca816f7d28d8a522d41f2d6d31d0112324da.zip
Add sord_contains (ticket #711).
git-svn-id: http://svn.drobilla.net/sord/trunk@148 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'src/sord.c')
-rw-r--r--src/sord.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sord.c b/src/sord.c
index 17f90e5..1142b41 100644
--- a/src/sord.c
+++ b/src/sord.c
@@ -793,6 +793,15 @@ sord_find(SordModel* sord, const SordQuad pat)
return sord_iter_new(sord, cur, pat, index_order, mode, prefix_len);
}
+bool
+sord_contains(SordModel* sord, const SordQuad pat)
+{
+ SordIter* iter = sord_find(sord, pat);
+ bool ret = (iter != NULL);
+ sord_iter_free(iter);
+ return ret;
+}
+
static SordNode*
sord_lookup_name(SordWorld* world, const uint8_t* str)
{