From d136e0bbd0f0d30a1a6d519462f4ad7bee4812b1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 30 Jan 2011 22:18:41 +0000 Subject: Completely abstract away use of librdf_stream for statement matching. git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2876 a436a847-0d15-0410-975c-d299462d15a1 --- src/slv2_internal.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'src/slv2_internal.h') diff --git a/src/slv2_internal.h b/src/slv2_internal.h index 35a8f12..2d161cb 100644 --- a/src/slv2_internal.h +++ b/src/slv2_internal.h @@ -95,11 +95,6 @@ void slv2_plugin_load_if_necessary(SLV2Plugin p); void slv2_plugin_load_ports_if_necessary(SLV2Plugin p); void slv2_plugin_free(SLV2Plugin plugin); -librdf_stream* slv2_plugin_find_statements(SLV2Plugin plugin, - librdf_node* subject, - librdf_node* predicate, - librdf_node* object); - SLV2Value slv2_plugin_get_unique(SLV2Plugin p, librdf_node* subject, @@ -279,8 +274,23 @@ void slv2_scale_point_free(SLV2ScalePoint point); /* ********* Query Results********* */ -SLV2Values slv2_values_from_stream_i18n(SLV2Plugin p, - librdf_stream* stream); +typedef librdf_stream* SLV2Matches; + +SLV2Matches slv2_plugin_find_statements(SLV2Plugin plugin, + librdf_node* subject, + librdf_node* predicate, + librdf_node* object); + +static inline bool slv2_matches_next(SLV2Matches matches) { + return librdf_stream_next(matches); +} + +static inline bool slv2_matches_end(SLV2Matches matches) { + return librdf_stream_end(matches); +} + +SLV2Values slv2_values_from_stream_i18n(SLV2Plugin p, + SLV2Matches stream); /* ********* Utilities ********* */ -- cgit v1.2.1