diff options
author | David Robillard <d@drobilla.net> | 2007-02-19 00:46:59 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-02-19 00:46:59 +0000 |
commit | d3d736deba06ca2ef655858ac22d8267c5cc6363 (patch) | |
tree | 1f21bcdb93d2935a3641c7e150771688bb1b63bb /src/query.c | |
parent | 0153919a422e7a520c38f9cd01e9a079f73c80fd (diff) | |
download | lilv-d3d736deba06ca2ef655858ac22d8267c5cc6363.tar.gz lilv-d3d736deba06ca2ef655858ac22d8267c5cc6363.tar.bz2 lilv-d3d736deba06ca2ef655858ac22d8267c5cc6363.zip |
Header/API cleanups.
Removed public exposure of raptor/rasqal.
Redefined opaque types properly.
git-svn-id: http://svn.drobilla.net/lad/slv2@317 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/query.c')
-rw-r--r-- | src/query.c | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/src/query.c b/src/query.c index 617b1df..b671ac8 100644 --- a/src/query.c +++ b/src/query.c @@ -17,10 +17,11 @@ */ #define _XOPEN_SOURCE 500 +#include <string.h> #include <stdlib.h> #include <assert.h> +#include <rasqal.h> #include <slv2/plugin.h> -#include <slv2/query.h> #include <slv2/library.h> #include <slv2/util.h> #include <slv2/stringlist.h> @@ -28,7 +29,7 @@ char* -slv2_query_header(const SLV2Plugin* p) +slv2_query_header(SLV2Plugin p) { const char* const plugin_uri = slv2_plugin_get_uri(p); //SLV2Strings files = slv2_plugin_get_data_uris(p); @@ -109,7 +110,7 @@ slv2_query_count_bindings(rasqal_query_results* results) rasqal_query_results* -slv2_plugin_query(SLV2Plugin* plugin, +slv2_plugin_query(SLV2Plugin plugin, const char* sparql_str) { raptor_uri* base_uri = raptor_new_uri((unsigned char*)slv2_plugin_get_uri(plugin)); @@ -156,7 +157,7 @@ slv2_plugin_query(SLV2Plugin* plugin, /** Query a single variable */ SLV2Strings -slv2_plugin_simple_query(SLV2Plugin* plugin, +slv2_plugin_simple_query(SLV2Plugin plugin, const char* sparql_str, const char* variable) { @@ -174,7 +175,7 @@ slv2_plugin_simple_query(SLV2Plugin* plugin, * in the number of results (ie slv2_plugin_num_ports). */ unsigned -slv2_plugin_query_count(SLV2Plugin* plugin, +slv2_plugin_query_count(SLV2Plugin plugin, const char* sparql_str) { rasqal_query_results* results = slv2_plugin_query(plugin, sparql_str); @@ -185,10 +186,9 @@ slv2_plugin_query_count(SLV2Plugin* plugin, } -// FIXME: stupid interface size_t -slv2_query_count_results(const SLV2Plugin* p, - const char* query) +slv2_query_count_results(SLV2Plugin p, + const char* query) { char* header = slv2_query_header(p); char* query_str = slv2_strjoin(header, query, NULL); @@ -222,27 +222,3 @@ slv2_query_count_results(const SLV2Plugin* p, return count; } - -/* -size_t -slv2_query_get_num_results(rasqal_query_results* results, const char* var_name) -{ - size_t result = 0; - - while (!rasqal_query_results_finished(results)) { - if (!strcmp((const char*)rasqal_query_results_get_binding_name(results, 0), var_name)) { - ++result; - } - rasqal_query_results_next(results); - } - - return result; -} -*/ - -void -slv2_strings_free(SLV2Strings list) -{ - raptor_free_sequence(list); -} - |