diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugin.c | 20 |
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; } |