summaryrefslogtreecommitdiffstats
path: root/src/slv2_internal.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-02-01 20:16:06 +0000
committerDavid Robillard <d@drobilla.net>2011-02-01 20:16:06 +0000
commitcded478d952f14fee667e5ba9407923b17daaa65 (patch)
treeed333f481dc1c720dac1a766ed8bcc298f28ac57 /src/slv2_internal.h
parent09f8cfc848d94ecf3be94915f1592fa6d10925e1 (diff)
downloadlilv-cded478d952f14fee667e5ba9407923b17daaa65.tar.gz
lilv-cded478d952f14fee667e5ba9407923b17daaa65.tar.bz2
lilv-cded478d952f14fee667e5ba9407923b17daaa65.zip
Wrap match accessor stuff with functions rather than macros.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2894 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/slv2_internal.h')
-rw-r--r--src/slv2_internal.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/slv2_internal.h b/src/slv2_internal.h
index 874c3f5..e9847fe 100644
--- a/src/slv2_internal.h
+++ b/src/slv2_internal.h
@@ -43,19 +43,28 @@ extern "C" {
#define SLV2_NS_XSD (const uint8_t*)"http://www.w3.org/2001/XMLSchema#"
#define SLV2_NS_RDF (const uint8_t*)"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+typedef librdf_stream* SLV2Matches;
+typedef librdf_node* SLV2Node; ///< RDF node
+
#define FOREACH_MATCH(stream) \
for (; !librdf_stream_end(stream); librdf_stream_next(stream))
-#define MATCH_SUBJECT(stream) \
- librdf_statement_get_subject(librdf_stream_get_object(stream))
-
-#define MATCH_OBJECT(stream) \
- librdf_statement_get_object(librdf_stream_get_object(stream))
+static inline SLV2Node
+slv2_match_subject(SLV2Matches stream) {
+ return librdf_statement_get_subject(librdf_stream_get_object(stream));
+}
-#define END_MATCH(stream) librdf_free_stream(stream)
+static inline SLV2Node
+slv2_match_object(SLV2Matches stream) {
+ return librdf_statement_get_object(librdf_stream_get_object(stream));
+}
+static inline void
+slv2_match_end(SLV2Matches stream)
+{
+ librdf_free_stream(stream);
+}
-typedef librdf_node* SLV2Node; ///< RDF node
/* ********* PORT ********* */
@@ -288,8 +297,6 @@ void slv2_scale_point_free(SLV2ScalePoint point);
/* ********* Query Results********* */
-typedef librdf_stream* SLV2Matches;
-
SLV2Matches slv2_plugin_find_statements(SLV2Plugin plugin,
SLV2Node subject,
SLV2Node predicate,