diff options
author | David Robillard <d@drobilla.net> | 2011-01-31 16:54:11 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-31 16:54:11 +0000 |
commit | d394e7d292c8cc686a11a08984e2d11d704cf329 (patch) | |
tree | ff01905f19fbd0333e5c82d60a5eb4abaedb2d2f /src | |
parent | 5872789853f4daba7d558c2a42b222862b45e269 (diff) | |
download | lilv-d394e7d292c8cc686a11a08984e2d11d704cf329.tar.gz lilv-d394e7d292c8cc686a11a08984e2d11d704cf329.tar.bz2 lilv-d394e7d292c8cc686a11a08984e2d11d704cf329.zip |
Typedef away most use of librdf_node.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2890 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/plugin.c | 54 | ||||
-rw-r--r-- | src/pluginclass.c | 8 | ||||
-rw-r--r-- | src/port.c | 38 | ||||
-rw-r--r-- | src/query.c | 14 | ||||
-rw-r--r-- | src/slv2_internal.h | 76 | ||||
-rw-r--r-- | src/value.c | 9 | ||||
-rw-r--r-- | src/world.c | 42 |
7 files changed, 122 insertions, 119 deletions
diff --git a/src/plugin.c b/src/plugin.c index 2a4abe3..c1272aa 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -111,7 +111,7 @@ slv2_plugin_load_if_necessary(SLV2Plugin p) static SLV2Values -slv2_plugin_query_node(SLV2Plugin p, librdf_node* subject, librdf_node* predicate) +slv2_plugin_query_node(SLV2Plugin p, SLV2Node subject, SLV2Node predicate) { // <subject> <predicate> ?value SLV2Matches results = slv2_plugin_find_statements( @@ -124,8 +124,8 @@ slv2_plugin_query_node(SLV2Plugin p, librdf_node* subject, librdf_node* predicat SLV2Values result = slv2_values_new(); FOREACH_MATCH(results) { - librdf_node* node = MATCH_OBJECT(results); - SLV2Value value = slv2_value_new_librdf_node(p->world, node); + SLV2Node node = MATCH_OBJECT(results); + SLV2Value value = slv2_value_new_librdf_node(p->world, node); if (value) raptor_sequence_push(result, value); } @@ -136,7 +136,7 @@ slv2_plugin_query_node(SLV2Plugin p, librdf_node* subject, librdf_node* predicat SLV2Value -slv2_plugin_get_unique(SLV2Plugin p, librdf_node* subject, librdf_node* predicate) +slv2_plugin_get_unique(SLV2Plugin p, SLV2Node subject, SLV2Node predicate) { SLV2Values values = slv2_plugin_query_node(p, subject, predicate); if (!values || slv2_values_size(values) != 1) { @@ -151,7 +151,7 @@ slv2_plugin_get_unique(SLV2Plugin p, librdf_node* subject, librdf_node* predicat static SLV2Value -slv2_plugin_get_one(SLV2Plugin p, librdf_node* subject, librdf_node* predicate) +slv2_plugin_get_one(SLV2Plugin p, SLV2Node subject, SLV2Node predicate) { SLV2Values values = slv2_plugin_query_node(p, subject, predicate); if (!values) { @@ -181,8 +181,8 @@ slv2_plugin_load_ports_if_necessary(SLV2Plugin p) NULL); FOREACH_MATCH(ports) { - librdf_node* port = MATCH_OBJECT(ports); - SLV2Value symbol = slv2_plugin_get_unique( + SLV2Node port = MATCH_OBJECT(ports); + SLV2Value symbol = slv2_plugin_get_unique( p, port, p->world->lv2_symbol_node); if (!slv2_value_is_string(symbol)) { @@ -222,7 +222,7 @@ slv2_plugin_load_ports_if_necessary(SLV2Plugin p) SLV2Matches types = slv2_plugin_find_statements( p, port, p->world->rdf_a_node, NULL); FOREACH_MATCH(types) { - librdf_node* type = MATCH_OBJECT(types); + SLV2Node type = MATCH_OBJECT(types); if (librdf_node_is_resource(type)) { raptor_sequence_push( this_port->classes, @@ -337,7 +337,7 @@ slv2_plugin_get_library_uri(SLV2Plugin p) p->world->lv2_binary_node, NULL); FOREACH_MATCH(results) { - librdf_node* binary_node = MATCH_OBJECT(results); + SLV2Node binary_node = MATCH_OBJECT(results); if (librdf_node_is_resource(binary_node)) { p->binary_uri = slv2_value_new_librdf_uri(p->world, binary_node); break; @@ -368,7 +368,7 @@ slv2_plugin_get_class(SLV2Plugin p) p->world->rdf_a_node, NULL); FOREACH_MATCH(results) { - librdf_node* class_node = slv2_node_copy(MATCH_OBJECT(results)); + SLV2Node class_node = slv2_node_copy(MATCH_OBJECT(results)); if (!librdf_node_is_resource(class_node)) { continue; } @@ -491,7 +491,7 @@ slv2_plugin_get_value_by_qname_i18n(SLV2Plugin p, return NULL; } - librdf_node* pred_node = librdf_new_node_from_uri_string( + SLV2Node pred_node = librdf_new_node_from_uri_string( p->world->world, (const uint8_t*)pred_uri); SLV2Matches results = slv2_plugin_find_statements( @@ -520,7 +520,7 @@ slv2_plugin_get_value_for_subject(SLV2Plugin p, return NULL; } - librdf_node* subject_node = (slv2_value_is_uri(subject)) + SLV2Node subject_node = (slv2_value_is_uri(subject)) ? slv2_node_copy(subject->val.uri_val) : librdf_new_node_from_blank_identifier( p->world->world, (const uint8_t*)slv2_value_as_blank(subject)); @@ -613,14 +613,14 @@ slv2_plugin_has_latency(SLV2Plugin p) bool ret = false; FOREACH_MATCH(ports) { - librdf_node* port = MATCH_OBJECT(ports); - SLV2Matches reports_latency = slv2_plugin_find_statements( + SLV2Node port = MATCH_OBJECT(ports); + SLV2Matches reports_latency = slv2_plugin_find_statements( p, port, p->world->lv2_portproperty_node, p->world->lv2_reportslatency_node); const bool end = slv2_matches_end(reports_latency); - librdf_free_stream(reports_latency); + END_MATCH(reports_latency); if (!end) { ret = true; break; @@ -643,8 +643,8 @@ slv2_plugin_get_latency_port_index(SLV2Plugin p) uint32_t ret = 0; FOREACH_MATCH(ports) { - librdf_node* port = MATCH_OBJECT(ports); - SLV2Matches reports_latency = slv2_plugin_find_statements( + SLV2Node port = MATCH_OBJECT(ports); + SLV2Matches reports_latency = slv2_plugin_find_statements( p, port, p->world->lv2_portproperty_node, @@ -744,10 +744,10 @@ slv2_plugin_get_port_by_symbol(SLV2Plugin p, #define NS_DOAP (const uint8_t*)"http://usefulinc.com/ns/doap#" #define NS_FOAF (const uint8_t*)"http://xmlns.com/foaf/0.1/" -static librdf_node* +static SLV2Node slv2_plugin_get_author(SLV2Plugin p) { - librdf_node* doap_maintainer = librdf_new_node_from_uri_string( + SLV2Node doap_maintainer = librdf_new_node_from_uri_string( p->world->world, NS_DOAP "maintainer"); SLV2Matches maintainers = slv2_plugin_find_statements( @@ -762,9 +762,9 @@ slv2_plugin_get_author(SLV2Plugin p) return NULL; } - librdf_node* author = slv2_node_copy(MATCH_OBJECT(maintainers)); + SLV2Node author = slv2_node_copy(MATCH_OBJECT(maintainers)); - librdf_free_stream(maintainers); + END_MATCH(maintainers); return author; } @@ -772,7 +772,7 @@ slv2_plugin_get_author(SLV2Plugin p) SLV2Value slv2_plugin_get_author_name(SLV2Plugin plugin) { - librdf_node* author = slv2_plugin_get_author(plugin); + SLV2Node author = slv2_plugin_get_author(plugin); if (author) { return slv2_plugin_get_one( plugin, author, librdf_new_node_from_uri_string( @@ -785,7 +785,7 @@ slv2_plugin_get_author_name(SLV2Plugin plugin) SLV2Value slv2_plugin_get_author_email(SLV2Plugin plugin) { - librdf_node* author = slv2_plugin_get_author(plugin); + SLV2Node author = slv2_plugin_get_author(plugin); if (author) { return slv2_plugin_get_one( plugin, author, librdf_new_node_from_uri_string( @@ -798,7 +798,7 @@ slv2_plugin_get_author_email(SLV2Plugin plugin) SLV2Value slv2_plugin_get_author_homepage(SLV2Plugin plugin) { - librdf_node* author = slv2_plugin_get_author(plugin); + SLV2Node author = slv2_plugin_get_author(plugin); if (author) { return slv2_plugin_get_one( plugin, author, librdf_new_node_from_uri_string( @@ -813,7 +813,7 @@ slv2_plugin_get_uis(SLV2Plugin p) { #define NS_UI (const uint8_t*)"http://lv2plug.in/ns/extensions/ui#" - librdf_node* ui_ui = librdf_new_node_from_uri_string( + SLV2Node ui_ui = librdf_new_node_from_uri_string( p->world->world, NS_UI "ui"); SLV2UIs result = slv2_uis_new(); @@ -824,12 +824,12 @@ slv2_plugin_get_uis(SLV2Plugin p) NULL); FOREACH_MATCH(uis) { - librdf_node* ui = MATCH_OBJECT(uis); + SLV2Node ui = MATCH_OBJECT(uis); SLV2Value type = slv2_plugin_get_unique( p, ui, p->world->rdf_a_node); - librdf_node* ui_binary_node = librdf_new_node_from_uri_string( + SLV2Node ui_binary_node = librdf_new_node_from_uri_string( p->world->world, NS_UI "binary"); SLV2Value binary = slv2_plugin_get_unique( diff --git a/src/pluginclass.c b/src/pluginclass.c index 910375c..39f1764 100644 --- a/src/pluginclass.c +++ b/src/pluginclass.c @@ -29,10 +29,10 @@ /* private */ SLV2PluginClass -slv2_plugin_class_new(SLV2World world, - librdf_node* parent_node, - librdf_node* uri, - const char* label) +slv2_plugin_class_new(SLV2World world, + SLV2Node parent_node, + SLV2Node uri, + const char* label) { assert(!parent_node || librdf_node_is_resource(parent_node)); SLV2PluginClass pc = (SLV2PluginClass)malloc(sizeof(struct _SLV2PluginClass)); @@ -64,7 +64,7 @@ slv2_port_is_a(SLV2Plugin plugin, } -static librdf_node* +static SLV2Node slv2_port_get_node(SLV2Plugin p, SLV2Port port) { @@ -73,10 +73,10 @@ slv2_port_get_node(SLV2Plugin p, slv2_node_copy(p->plugin_uri->val.uri_val), slv2_node_copy(p->world->lv2_port_node), NULL); - librdf_node* ret = NULL; + SLV2Node ret = NULL; FOREACH_MATCH(ports) { - librdf_node* node = MATCH_OBJECT(ports); - SLV2Value symbol = slv2_plugin_get_unique( + SLV2Node node = MATCH_OBJECT(ports); + SLV2Value symbol = slv2_plugin_get_unique( p, slv2_node_copy(node), slv2_node_copy(p->world->lv2_symbol_node)); @@ -102,15 +102,15 @@ slv2_port_has_property(SLV2Plugin p, SLV2Value property) { assert(property); - librdf_node* port_node = slv2_port_get_node(p, port); - SLV2Matches results = slv2_plugin_find_statements( + SLV2Node port_node = slv2_port_get_node(p, port); + SLV2Matches results = slv2_plugin_find_statements( p, port_node, librdf_new_node_from_uri_string(p->world->world, SLV2_NS_LV2 "portProperty"), librdf_new_node_from_uri(p->world->world, slv2_value_as_librdf_uri(property))); const bool ret = !slv2_matches_end(results); - librdf_free_stream(results); + END_MATCH(results); return ret; } @@ -123,15 +123,15 @@ slv2_port_supports_event(SLV2Plugin p, #define NS_EV (const uint8_t*)"http://lv2plug.in/ns/ext/event#" assert(event); - librdf_node* port_node = slv2_port_get_node(p, port); - SLV2Matches results = slv2_plugin_find_statements( + SLV2Node port_node = slv2_port_get_node(p, port); + SLV2Matches results = slv2_plugin_find_statements( p, port_node, librdf_new_node_from_uri_string(p->world->world, NS_EV "supportsEvent"), librdf_new_node_from_uri(p->world->world, slv2_value_as_librdf_uri(event))); const bool ret = !slv2_matches_end(results); - librdf_free_stream(results); + END_MATCH(results); return ret; } @@ -168,8 +168,8 @@ slv2_port_get_value_by_qname(SLV2Plugin p, return NULL; } - librdf_node* port_node = slv2_port_get_node(p, port); - SLV2Matches results = slv2_plugin_find_statements( + SLV2Node port_node = slv2_port_get_node(p, port); + SLV2Matches results = slv2_plugin_find_statements( p, port_node, librdf_new_node_from_uri_string(p->world->world, (const uint8_t*)pred_uri), @@ -183,12 +183,12 @@ slv2_port_get_value_by_qname(SLV2Plugin p, static SLV2Values slv2_port_get_value_by_node(SLV2Plugin p, SLV2Port port, - librdf_node* predicate) + SLV2Node predicate) { assert(librdf_node_is_resource(predicate)); - librdf_node* port_node = slv2_port_get_node(p, port); - SLV2Matches results = slv2_plugin_find_statements( + SLV2Node port_node = slv2_port_get_node(p, port); + SLV2Matches results = slv2_plugin_find_statements( p, port_node, predicate, @@ -226,8 +226,8 @@ slv2_port_get_value_by_qname_i18n(SLV2Plugin p, return NULL; } - librdf_node* port_node = slv2_port_get_node(p, port); - SLV2Matches results = slv2_plugin_find_statements( + SLV2Node port_node = slv2_port_get_node(p, port); + SLV2Matches results = slv2_plugin_find_statements( p, port_node, librdf_new_node_from_uri_string(p->world->world, (const uint8_t*)pred_uri), @@ -313,7 +313,7 @@ SLV2ScalePoints slv2_port_get_scale_points(SLV2Plugin p, SLV2Port port) { - librdf_node* port_node = slv2_port_get_node(p, port); + SLV2Node port_node = slv2_port_get_node(p, port); SLV2Matches points = slv2_plugin_find_statements( p, port_node, @@ -325,7 +325,7 @@ slv2_port_get_scale_points(SLV2Plugin p, ret = slv2_scale_points_new(); FOREACH_MATCH(points) { - librdf_node* point = MATCH_OBJECT(points); + SLV2Node point = MATCH_OBJECT(points); SLV2Value value = slv2_plugin_get_unique( p, diff --git a/src/query.c b/src/query.c index 085ed04..9d1088e 100644 --- a/src/query.c +++ b/src/query.c @@ -30,10 +30,10 @@ SLV2Matches -slv2_plugin_find_statements(SLV2Plugin plugin, - librdf_node* subject, - librdf_node* predicate, - librdf_node* object) +slv2_plugin_find_statements(SLV2Plugin plugin, + SLV2Node subject, + SLV2Node predicate, + SLV2Node object) { slv2_plugin_load_if_necessary(plugin); librdf_statement* q = librdf_new_statement_from_nodes( @@ -51,10 +51,10 @@ SLV2Values slv2_values_from_stream_i18n(SLV2Plugin p, SLV2Matches stream) { - SLV2Values values = slv2_values_new(); - librdf_node* nolang = NULL; + SLV2Values values = slv2_values_new(); + SLV2Node nolang = NULL; FOREACH_MATCH(stream) { - librdf_node* value = MATCH_OBJECT(stream); + SLV2Node value = MATCH_OBJECT(stream); if (librdf_node_is_literal(value)) { const char* lang = librdf_node_get_literal_value_language(value); if (lang) { diff --git a/src/slv2_internal.h b/src/slv2_internal.h index b05ea25..0bd1d60 100644 --- a/src/slv2_internal.h +++ b/src/slv2_internal.h @@ -54,6 +54,10 @@ extern "C" { #define END_MATCH(stream) librdf_free_stream(stream) + +typedef librdf_node* SLV2Node; ///< RDF node + + /* ********* PORT ********* */ /** Reference to a port on some plugin. */ @@ -96,9 +100,9 @@ void slv2_plugin_load_ports_if_necessary(SLV2Plugin p); void slv2_plugin_free(SLV2Plugin plugin); SLV2Value -slv2_plugin_get_unique(SLV2Plugin p, - librdf_node* subject, - librdf_node* predicate); +slv2_plugin_get_unique(SLV2Plugin p, + SLV2Node subject, + SLV2Node predicate); /* ********* Plugins ********* */ @@ -137,10 +141,10 @@ struct _SLV2PluginClass { SLV2Value label; }; -SLV2PluginClass slv2_plugin_class_new(SLV2World world, - librdf_node* parent_uri, - librdf_node* uri, - const char* label); +SLV2PluginClass slv2_plugin_class_new(SLV2World world, + SLV2Node parent_uri, + SLV2Node uri, + const char* label); void slv2_plugin_class_free(SLV2PluginClass plugin_class); @@ -165,28 +169,28 @@ struct _SLV2World { SLV2PluginClass lv2_plugin_class; SLV2PluginClasses plugin_classes; SLV2Plugins plugins; - librdf_node* dyn_manifest_node; - librdf_node* lv2_specification_node; - librdf_node* lv2_plugin_node; - librdf_node* lv2_binary_node; - librdf_node* lv2_default_node; - librdf_node* lv2_minimum_node; - librdf_node* lv2_maximum_node; - librdf_node* lv2_port_node; - librdf_node* lv2_portproperty_node; - librdf_node* lv2_reportslatency_node; - librdf_node* lv2_index_node; - librdf_node* lv2_symbol_node; - librdf_node* rdf_a_node; - librdf_node* rdf_value_node; - librdf_node* rdfs_class_node; - librdf_node* rdfs_label_node; - librdf_node* rdfs_seealso_node; - librdf_node* rdfs_subclassof_node; - librdf_node* slv2_bundleuri_node; - librdf_node* slv2_dmanifest_node; - librdf_node* xsd_integer_node; - librdf_node* xsd_decimal_node; + SLV2Node dyn_manifest_node; + SLV2Node lv2_specification_node; + SLV2Node lv2_plugin_node; + SLV2Node lv2_binary_node; + SLV2Node lv2_default_node; + SLV2Node lv2_minimum_node; + SLV2Node lv2_maximum_node; + SLV2Node lv2_port_node; + SLV2Node lv2_portproperty_node; + SLV2Node lv2_reportslatency_node; + SLV2Node lv2_index_node; + SLV2Node lv2_symbol_node; + SLV2Node rdf_a_node; + SLV2Node rdf_value_node; + SLV2Node rdfs_class_node; + SLV2Node rdfs_label_node; + SLV2Node rdfs_seealso_node; + SLV2Node rdfs_subclassof_node; + SLV2Node slv2_bundleuri_node; + SLV2Node slv2_dmanifest_node; + SLV2Node xsd_integer_node; + SLV2Node xsd_decimal_node; }; /** Load all bundles found in \a search_path. @@ -248,22 +252,22 @@ struct _SLV2Value { SLV2ValueType type; char* str_val; ///< always present union { - int int_val; - float float_val; - librdf_node* uri_val; + int int_val; + float float_val; + SLV2Node uri_val; } val; }; SLV2Value slv2_value_new(SLV2World world, SLV2ValueType type, const char* val); -SLV2Value slv2_value_new_librdf_node(SLV2World world, librdf_node* node); -SLV2Value slv2_value_new_librdf_uri(SLV2World world, librdf_node* node); +SLV2Value slv2_value_new_librdf_node(SLV2World world, SLV2Node node); +SLV2Value slv2_value_new_librdf_uri(SLV2World world, SLV2Node node); librdf_uri* slv2_value_as_librdf_uri(SLV2Value value); -static inline librdf_node* slv2_node_copy(librdf_node* node) { +static inline SLV2Node slv2_node_copy(SLV2Node node) { return librdf_new_node_from_node(node); } -static inline void slv2_node_free(librdf_node* node) { +static inline void slv2_node_free(SLV2Node node) { librdf_free_node(node); } diff --git a/src/value.c b/src/value.c index f2f15b8..93fb218 100644 --- a/src/value.c +++ b/src/value.c @@ -94,14 +94,13 @@ slv2_value_new(SLV2World world, SLV2ValueType type, const char* str) } -/** Create a new SLV2Value from a librdf_node, or return NULL if impossible */ +/** Create a new SLV2Value from @a node, or return NULL if impossible */ SLV2Value slv2_value_new_librdf_node(SLV2World world, librdf_node* node) { - SLV2Value result = NULL; - - librdf_uri* datatype_uri = NULL; - SLV2ValueType type = SLV2_VALUE_STRING; + SLV2Value result = NULL; + librdf_uri* datatype_uri = NULL; + SLV2ValueType type = SLV2_VALUE_STRING; switch (librdf_node_get_type(node)) { case LIBRDF_NODE_TYPE_RESOURCE: diff --git a/src/world.c b/src/world.c index 652d3f9..f9f4006 100644 --- a/src/world.c +++ b/src/world.c @@ -266,8 +266,8 @@ slv2_world_load_bundle(SLV2World world, SLV2Value bundle_uri) slv2_node_copy(world->rdf_a_node), slv2_node_copy(world->dyn_manifest_node)); FOREACH_MATCH(dmanifests) { - librdf_node* dmanifest = MATCH_SUBJECT(dmanifests); - SLV2Matches binaries = slv2_world_find_statements( + SLV2Node dmanifest = MATCH_SUBJECT(dmanifests); + SLV2Matches binaries = slv2_world_find_statements( world, world->model, slv2_node_copy(dmanifest), slv2_node_copy(world->lv2_binary_node), @@ -279,7 +279,7 @@ slv2_world_load_bundle(SLV2World world, SLV2Value bundle_uri) continue; } - librdf_node* binary = slv2_node_copy(MATCH_OBJECT(binaries)); + SLV2Node binary = slv2_node_copy(MATCH_OBJECT(binaries)); const uint8_t* lib_uri = librdf_uri_as_string(librdf_node_get_uri(binary)); const char* lib_path = slv2_uri_to_path((const char*)lib_uri); if (!lib_path) @@ -322,7 +322,7 @@ slv2_world_load_bundle(SLV2World world, SLV2Value bundle_uri) slv2_node_copy(world->rdf_a_node), slv2_node_copy(world->lv2_plugin_node)); FOREACH_MATCH(dyn_plugins) { - librdf_node* plugin = MATCH_SUBJECT(dyn_plugins); + SLV2Node plugin = MATCH_SUBJECT(dyn_plugins); // Add ?plugin slv2:dynamic-manifest ?binary to dynamic model librdf_model_add( @@ -349,7 +349,7 @@ slv2_world_load_bundle(SLV2World world, SLV2Value bundle_uri) slv2_node_copy(world->rdf_a_node), slv2_node_copy(world->lv2_plugin_node)); FOREACH_MATCH(results) { - librdf_node* plugin = MATCH_SUBJECT(results); + SLV2Node plugin = MATCH_SUBJECT(results); // Add ?plugin rdfs:seeAlso <manifest.ttl> librdf_model_add( @@ -374,7 +374,7 @@ slv2_world_load_bundle(SLV2World world, SLV2Value bundle_uri) slv2_node_copy(world->rdf_a_node), slv2_node_copy(world->lv2_specification_node)); FOREACH_MATCH(results) { - librdf_node* spec = MATCH_SUBJECT(results); + SLV2Node spec = MATCH_SUBJECT(results); // Add ?specification rdfs:seeAlso <manifest.ttl> librdf_model_add( @@ -493,14 +493,14 @@ slv2_world_load_specifications(SLV2World world) slv2_node_copy(world->rdf_a_node), slv2_node_copy(world->lv2_specification_node)); FOREACH_MATCH(specs) { - librdf_node* spec_node = MATCH_SUBJECT(specs); - SLV2Matches files = slv2_world_find_statements( + SLV2Node spec_node = MATCH_SUBJECT(specs); + SLV2Matches files = slv2_world_find_statements( world, world->model, slv2_node_copy(spec_node), slv2_node_copy(world->rdfs_seealso_node), NULL); FOREACH_MATCH(files) { - librdf_node* file_node = MATCH_OBJECT(files); + SLV2Node file_node = MATCH_OBJECT(files); slv2_world_load_file(world, librdf_node_get_uri(file_node)); } END_MATCH(files); @@ -524,7 +524,7 @@ slv2_world_load_plugin_classes(SLV2World world) slv2_node_copy(world->rdf_a_node), slv2_node_copy(world->rdfs_class_node)); FOREACH_MATCH(classes) { - librdf_node* class_node = MATCH_SUBJECT(classes); + SLV2Node class_node = MATCH_SUBJECT(classes); // Get parents (superclasses) SLV2Matches parents = slv2_world_find_statements( @@ -538,7 +538,7 @@ slv2_world_load_plugin_classes(SLV2World world) continue; } - librdf_node* parent_node = slv2_node_copy(MATCH_OBJECT(parents)); + SLV2Node parent_node = slv2_node_copy(MATCH_OBJECT(parents)); END_MATCH(parents); if (!librdf_node_is_resource(parent_node)) { @@ -554,13 +554,13 @@ slv2_world_load_plugin_classes(SLV2World world) NULL); if (slv2_matches_end(labels)) { - librdf_free_stream(labels); + END_MATCH(labels); continue; } - librdf_node* label_node = slv2_node_copy(MATCH_OBJECT(labels)); + SLV2Node label_node = slv2_node_copy(MATCH_OBJECT(labels)); const uint8_t* label = librdf_node_get_literal_value(label_node); - librdf_free_stream(labels); + END_MATCH(labels); SLV2PluginClasses classes = world->plugin_classes; const unsigned n_classes = raptor_sequence_size(classes); @@ -644,8 +644,8 @@ slv2_world_load_all(SLV2World world) slv2_node_copy(world->rdf_a_node), slv2_node_copy(world->lv2_plugin_node)); FOREACH_MATCH(plugins) { - librdf_node* plugin_node = MATCH_SUBJECT(plugins); - const char* plugin_uri = (const char*)librdf_uri_as_string( + SLV2Node plugin_node = MATCH_SUBJECT(plugins); + const char* plugin_uri = (const char*)librdf_uri_as_string( librdf_node_get_uri(plugin_node)); SLV2Matches bundles = slv2_world_find_statements( @@ -660,7 +660,7 @@ slv2_world_load_all(SLV2World world) continue; } - librdf_node* bundle_node = slv2_node_copy(MATCH_OBJECT(bundles)); + SLV2Node bundle_node = slv2_node_copy(MATCH_OBJECT(bundles)); slv2_matches_next(bundles); if (!slv2_matches_end(bundles)) { @@ -670,7 +670,7 @@ slv2_world_load_all(SLV2World world) continue; } - librdf_free_stream(bundles); + END_MATCH(bundles); // Add a new plugin to the world SLV2Value uri = slv2_value_new_librdf_uri(world, plugin_node); @@ -697,8 +697,8 @@ slv2_world_load_all(SLV2World world) slv2_node_copy(world->slv2_dmanifest_node), NULL); FOREACH_MATCH(dmanifests) { - librdf_node* lib_node = MATCH_OBJECT(dmanifests); - const char* lib_uri = (const char*)librdf_uri_as_string( + SLV2Node lib_node = MATCH_OBJECT(dmanifests); + const char* lib_uri = (const char*)librdf_uri_as_string( librdf_node_get_uri(lib_node)); if (dlopen(slv2_uri_to_path(lib_uri, RTLD_LAZY))) { @@ -714,7 +714,7 @@ slv2_world_load_all(SLV2World world) slv2_node_copy(world->rdfs_seealso_node), NULL); FOREACH_MATCH(files) { - librdf_node* file_node = MATCH_OBJECT(files); + SLV2Node file_node = MATCH_OBJECT(files); raptor_sequence_push(plugin->data_uris, slv2_value_new_librdf_uri(world, file_node)); } |