diff options
author | David Robillard <d@drobilla.net> | 2011-01-31 17:26:30 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-31 17:26:30 +0000 |
commit | e98533cbbd871495593879c3ae7b1fe204434a07 (patch) | |
tree | 73aefbfe2513ae5def2f8e235b32cbe37c00031d /src | |
parent | 920128cdb2bb7fe99a000965f26efb2f72cff524 (diff) | |
download | lilv-e98533cbbd871495593879c3ae7b1fe204434a07.tar.gz lilv-e98533cbbd871495593879c3ae7b1fe204434a07.tar.bz2 lilv-e98533cbbd871495593879c3ae7b1fe204434a07.zip |
Remove slv2_value_as_librdf_uri.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2892 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/plugin.c | 9 | ||||
-rw-r--r-- | src/plugininstance.c | 3 | ||||
-rw-r--r-- | src/port.c | 7 | ||||
-rw-r--r-- | src/slv2_internal.h | 14 | ||||
-rw-r--r-- | src/value.c | 7 |
5 files changed, 21 insertions, 19 deletions
diff --git a/src/plugin.c b/src/plugin.c index 57e0dc6..ec39749 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -263,7 +263,8 @@ slv2_plugin_load(SLV2Plugin p) // Parse all the plugin's data files into RDF model for (unsigned i=0; i < slv2_values_size(p->data_uris); ++i) { SLV2Value data_uri_val = slv2_values_get_at(p->data_uris, i); - librdf_uri* data_uri = slv2_value_as_librdf_uri(data_uri_val); + librdf_uri* data_uri = librdf_node_get_uri( + slv2_value_as_node(data_uri_val)); librdf_parser_parse_into_model(p->world->parser, data_uri, data_uri, p->rdf); } @@ -292,8 +293,10 @@ slv2_plugin_load(SLV2Plugin p) FILE* fd = tmpfile(); get_data_func(handle, fd, slv2_value_as_string(p->plugin_uri)); rewind(fd); - librdf_parser_parse_file_handle_into_model(p->world->parser, - fd, 0, slv2_value_as_librdf_uri(p->bundle_uri), p->rdf); + librdf_parser_parse_file_handle_into_model( + p->world->parser, fd, 0, + librdf_node_get_value(slv2_value_as_node(p->bundle_uri)), + p->rdf); fclose(fd); } diff --git a/src/plugininstance.c b/src/plugininstance.c index 237c2a5..7a0fa6e 100644 --- a/src/plugininstance.c +++ b/src/plugininstance.c @@ -81,7 +81,8 @@ slv2_plugin_instantiate(SLV2Plugin plugin, break; // return NULL } else { librdf_uri* absolute_uri = librdf_new_uri_relative_to_base( - slv2_value_as_librdf_uri(slv2_plugin_get_bundle_uri(plugin)), + librdf_node_get_uri(slv2_value_as_node( + slv2_plugin_get_bundle_uri(plugin))), (const uint8_t*)ld->URI); if (!strcmp((const char*)librdf_uri_as_string(absolute_uri), slv2_value_as_uri(slv2_plugin_get_uri(plugin)))) { @@ -107,7 +107,7 @@ slv2_port_has_property(SLV2Plugin p, 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))); + slv2_value_as_node(property)); const bool ret = !slv2_matches_end(results); END_MATCH(results); @@ -128,7 +128,7 @@ slv2_port_supports_event(SLV2Plugin p, 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))); + slv2_value_as_node(event)); const bool ret = !slv2_matches_end(results); END_MATCH(results); @@ -210,8 +210,7 @@ slv2_port_get_value(SLV2Plugin p, return slv2_port_get_value_by_node( p, port, - librdf_new_node_from_uri(p->world->world, - slv2_value_as_librdf_uri(predicate))); + slv2_value_as_node(predicate)); } diff --git a/src/slv2_internal.h b/src/slv2_internal.h index aa8e878..874c3f5 100644 --- a/src/slv2_internal.h +++ b/src/slv2_internal.h @@ -258,9 +258,9 @@ struct _SLV2Value { } val; }; -SLV2Value slv2_value_new(SLV2World world, SLV2ValueType type, const char* val); -SLV2Value slv2_value_new_from_node(SLV2World world, SLV2Node node); -librdf_uri* slv2_value_as_librdf_uri(SLV2Value value); +SLV2Value slv2_value_new(SLV2World world, SLV2ValueType type, const char* val); +SLV2Value slv2_value_new_from_node(SLV2World world, SLV2Node node); +SLV2Node slv2_value_as_node(SLV2Value value); static inline SLV2Node slv2_node_copy(SLV2Node node) { return librdf_new_node_from_node(node); @@ -290,10 +290,10 @@ void slv2_scale_point_free(SLV2ScalePoint point); typedef librdf_stream* SLV2Matches; -SLV2Matches slv2_plugin_find_statements(SLV2Plugin plugin, - librdf_node* subject, - librdf_node* predicate, - librdf_node* object); +SLV2Matches slv2_plugin_find_statements(SLV2Plugin plugin, + SLV2Node subject, + SLV2Node predicate, + SLV2Node object); static inline bool slv2_matches_next(SLV2Matches matches) { return librdf_stream_next(matches); diff --git a/src/value.c b/src/value.c index 6117528..6714ff9 100644 --- a/src/value.c +++ b/src/value.c @@ -310,12 +310,11 @@ slv2_value_as_uri(SLV2Value value) } -/* private */ -librdf_uri* -slv2_value_as_librdf_uri(SLV2Value value) +SLV2Node +slv2_value_as_node(SLV2Value value) { assert(slv2_value_is_uri(value)); - return librdf_node_get_uri(value->val.uri_val); + return value->val.uri_val; } |