summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-02-20 02:55:56 +0000
committerDavid Robillard <d@drobilla.net>2007-02-20 02:55:56 +0000
commit9cf2ff4d0e311b9dbed9ff3e6c493e840c1a4b2d (patch)
treedc34ca646a90a4cf0b6eca3c68bdcb3d8b16c1e8 /src
parenta909c448b72481e517eb792930a5455ffbf6ff21 (diff)
downloadlilv-9cf2ff4d0e311b9dbed9ff3e6c493e840c1a4b2d.tar.gz
lilv-9cf2ff4d0e311b9dbed9ff3e6c493e840c1a4b2d.tar.bz2
lilv-9cf2ff4d0e311b9dbed9ff3e6c493e840c1a4b2d.zip
Updated Ingen for most recent SLV2 API.
Minor (unlikely) SLV2 bug fixes. git-svn-id: http://svn.drobilla.net/lad/slv2@322 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/query.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/query.c b/src/query.c
index 4d259f2..df0f6d4 100644
--- a/src/query.c
+++ b/src/query.c
@@ -117,6 +117,11 @@ slv2_plugin_query(SLV2Plugin plugin,
rasqal_query *rq = rasqal_new_query("sparql", NULL);
+ if (!rq) {
+ fprintf(stderr, "ERROR: Could not create Rasqal query\n");
+ return NULL;
+ }
+
char* header = slv2_query_header(plugin);
char* query_str = slv2_strjoin(header, sparql_str, NULL);
@@ -182,10 +187,14 @@ slv2_plugin_query_count(SLV2Plugin plugin,
const char* sparql_str)
{
rasqal_query_results* results = slv2_plugin_query(plugin, sparql_str);
- unsigned ret = slv2_query_count_bindings(results);
- rasqal_free_query_results(results);
- return ret;
+ if (results) {
+ unsigned ret = slv2_query_count_bindings(results);
+ rasqal_free_query_results(results);
+ return ret;
+ } else {
+ return 0;
+ }
}