diff options
author | David Robillard <d@drobilla.net> | 2011-01-30 22:18:41 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-30 22:18:41 +0000 |
commit | d136e0bbd0f0d30a1a6d519462f4ad7bee4812b1 (patch) | |
tree | e526472cf21ba671e7ec675033b8b70669724459 /src/query.c | |
parent | d2ca87e3f2b8e38222f9c2a9f3235e4d270528c7 (diff) | |
download | lilv-d136e0bbd0f0d30a1a6d519462f4ad7bee4812b1.tar.gz lilv-d136e0bbd0f0d30a1a6d519462f4ad7bee4812b1.tar.bz2 lilv-d136e0bbd0f0d30a1a6d519462f4ad7bee4812b1.zip |
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
Diffstat (limited to 'src/query.c')
-rw-r--r-- | src/query.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/query.c b/src/query.c index 187bf5d..ac49ece 100644 --- a/src/query.c +++ b/src/query.c @@ -29,7 +29,7 @@ #include "slv2_internal.h" -librdf_stream* +SLV2Matches slv2_plugin_find_statements(SLV2Plugin plugin, librdf_node* subject, librdf_node* predicate, @@ -45,14 +45,13 @@ slv2_plugin_find_statements(SLV2Plugin plugin, SLV2Values -slv2_values_from_stream_i18n(SLV2Plugin p, - librdf_stream* stream) +slv2_values_from_stream_i18n(SLV2Plugin p, + SLV2Matches stream) { SLV2Values values = slv2_values_new(); librdf_node* nolang = NULL; - for (; !librdf_stream_end(stream); librdf_stream_next(stream)) { - librdf_statement* s = librdf_stream_get_object(stream); - librdf_node* value = librdf_statement_get_object(s); + FOREACH_MATCH(stream) { + librdf_node* value = MATCH_OBJECT(stream); if (librdf_node_is_literal(value)) { const char* lang = librdf_node_get_literal_value_language(value); if (lang) { @@ -67,7 +66,7 @@ slv2_values_from_stream_i18n(SLV2Plugin p, } break; } - librdf_free_stream(stream); + END_MATCH(stream); if (slv2_values_size(values) == 0) { // No value with a matching language, use untranslated default |