summaryrefslogtreecommitdiffstats
path: root/src/plugin.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-10-04 20:24:44 +0000
committerDavid Robillard <d@drobilla.net>2008-10-04 20:24:44 +0000
commit812e8b14571cf6fbe4a14f295448d6fe90eae1ba (patch)
tree25a585b0952de02ca4af7fd70a8ff7ec4e5f382c /src/plugin.c
parentb009334a06961360ebf5e7de0a07b303bff915d3 (diff)
downloadlilv-812e8b14571cf6fbe4a14f295448d6fe90eae1ba.tar.gz
lilv-812e8b14571cf6fbe4a14f295448d6fe90eae1ba.tar.bz2
lilv-812e8b14571cf6fbe4a14f295448d6fe90eae1ba.zip
Fix slv2_plugin_get_supported_features.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@1613 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/plugin.c')
-rw-r--r--src/plugin.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/plugin.c b/src/plugin.c
index cb98d69..25ddd5c 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -663,14 +663,26 @@ slv2_plugin_has_feature(SLV2Plugin p,
SLV2Values
slv2_plugin_get_supported_features(SLV2Plugin p)
{
- const char* const query =
+ /* Work around broken UNION in Redland :( */
+ /*const char* const query =
"SELECT DISTINCT ?feature WHERE {\n"
" { <> lv2:optionalFeature ?feature }\n"
" UNION\n"
" { <> lv2:requiredFeature ?feature }\n"
"}\n";
+
+ SLV2Values result = slv2_plugin_query_variable(p, query, 0);*/
- SLV2Values result = slv2_plugin_query_variable(p, query, 0);
+ SLV2Values optional = slv2_plugin_get_optional_features(p);
+ SLV2Values required = slv2_plugin_get_required_features(p);
+
+ SLV2Values result = slv2_values_new();
+ unsigned n_optional = slv2_values_size(optional);
+ unsigned i = 0;
+ for ( ; i < n_optional; ++i)
+ slv2_values_set_at(result, i, slv2_values_get_at(optional, i));
+ for ( ; i < n_optional + slv2_values_size(required); ++i)
+ slv2_values_set_at(result, i, slv2_values_get_at(required, i - n_optional));
return result;
}