From a909c448b72481e517eb792930a5455ffbf6ff21 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 20 Feb 2007 01:42:50 +0000 Subject: Added simple accessor for values with subjects other than the plugin itself. git-svn-id: http://svn.drobilla.net/lad/slv2@321 a436a847-0d15-0410-975c-d299462d15a1 --- src/plugin.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') diff --git a/src/plugin.c b/src/plugin.c index 8441aec..abb577b 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -172,6 +172,26 @@ slv2_plugin_get_value(SLV2Plugin p, return result; } + +SLV2Strings +slv2_plugin_get_value_for_subject(SLV2Plugin p, + const char* subject, + const char* predicate) +{ + assert(predicate); + + char* query = slv2_strjoin( + "SELECT DISTINCT ?value WHERE {\n", + subject, " ", predicate, " ?value .\n" + "}\n", NULL); + + SLV2Strings result = slv2_plugin_simple_query(p, query, "value"); + + free(query); + + return result; +} + SLV2Strings slv2_plugin_get_properties(SLV2Plugin p) -- cgit v1.2.1