summaryrefslogtreecommitdiffstats
path: root/src/plugin.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-20 05:14:59 +0000
committerDavid Robillard <d@drobilla.net>2008-01-20 05:14:59 +0000
commit5d8ed7bec58131367d69840bfb299fe93568fe6d (patch)
treed68bb4cfa40a9aec620946f3517c08cc949e53f9 /src/plugin.c
parentfc33dd91c51f2806afa09cf53469bee6a1f53cfd (diff)
downloadlilv-5d8ed7bec58131367d69840bfb299fe93568fe6d.tar.gz
lilv-5d8ed7bec58131367d69840bfb299fe93568fe6d.tar.bz2
lilv-5d8ed7bec58131367d69840bfb299fe93568fe6d.zip
Fix slv2_plugin_has_feature.
git-svn-id: http://svn.drobilla.net/lad/slv2@1083 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/plugin.c')
-rw-r--r--src/plugin.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/plugin.c b/src/plugin.c
index ae47d81..2536277 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -535,22 +535,14 @@ slv2_plugin_has_feature(SLV2Plugin p,
const char* feature)
{
assert(feature);
+ SLV2Values features = slv2_plugin_get_supported_features(p);
+
+ SLV2Value val = slv2_value_new(SLV2_VALUE_URI, feature);
- const char* const query = slv2_strjoin(
- "ASK {\n"
- " { <> lv2:optionalFeature <", feature, "> }\n"
- " UNION\n"
- " { <> lv2:requiredFeature <", feature, "> }\n"
- "}\n", NULL);
-
-
- librdf_query_results* results = slv2_plugin_query(p, query);
- assert(librdf_query_results_is_boolean(results));
-
- const bool ret = results && (librdf_query_results_get_boolean(results) > 0);
+ const bool ret = features && slv2_values_contains(features, val);
- if (results)
- librdf_free_query_results(results);
+ slv2_values_free(features);
+ slv2_value_free(val);
return ret;
}