diff options
author | David Robillard <d@drobilla.net> | 2011-05-11 23:31:28 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-11 23:31:28 +0000 |
commit | 7ad607b432e1fac40a62ed28bc9ddeb044153fa5 (patch) | |
tree | 4352e04c1da1b48a78f10401df1b7435b74a4961 /src | |
parent | 3cf7be0e7ad6cd9aaa0707a9d30fb9a78bef03d8 (diff) | |
download | lilv-7ad607b432e1fac40a62ed28bc9ddeb044153fa5.tar.gz lilv-7ad607b432e1fac40a62ed28bc9ddeb044153fa5.tar.bz2 lilv-7ad607b432e1fac40a62ed28bc9ddeb044153fa5.zip |
Pass environment to sord write methods for CURIE abbreviation.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3255 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/plugin.c | 6 | ||||
-rw-r--r-- | src/world.c | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/plugin.c b/src/plugin.c index 5c36180..c8cf9c5 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -117,10 +117,13 @@ lilv_plugin_load(LilvPlugin* p) // Parse all the plugin's data files into RDF model LILV_FOREACH(nodes, i, p->data_uris) { const LilvNode* data_uri_val = lilv_nodes_get(p->data_uris, i); + SerdEnv* env = serd_env_new(); sord_read_file(p->world->model, + env, sord_node_get_string(data_uri_val->val.uri_val), p->bundle_uri->val.uri_val, lilv_world_blank_node_prefix(p->world)); + serd_env_free(env); } #ifdef LILV_DYN_MANIFEST @@ -150,11 +153,14 @@ lilv_plugin_load(LilvPlugin* p) FILE* fd = tmpfile(); get_data_func(handle, fd, lilv_node_as_string(p->plugin_uri)); rewind(fd); + SerdEnv* env = serd_env_new(); sord_read_file_handle(p->world->model, + env, fd, (const uint8_t*)lilv_node_as_uri(p->dynman_uri), p->bundle_uri->val.uri_val, lilv_world_blank_node_prefix(p->world)); + serd_env_free(env); fclose(fd); } diff --git a/src/world.c b/src/world.c index 4dc7767..a7f25cc 100644 --- a/src/world.c +++ b/src/world.c @@ -462,8 +462,10 @@ lilv_world_load_dyn_manifest(LilvWorld* world, rewind(fd); // Parse generated data file - sord_read_file_handle(world->model, fd, lib_uri, bundle_node, + SerdEnv* env = serd_env_new(); + sord_read_file_handle(world->model, env, fd, lib_uri, bundle_node, lilv_world_blank_node_prefix(world)); + serd_env_free(env); // Close (and automatically delete) temporary data file fclose(fd); @@ -503,10 +505,13 @@ lilv_world_load_bundle(LilvWorld* world, LilvNode* bundle_uri) (const uint8_t*)"manifest.ttl", (const uint8_t*)sord_node_get_string(bundle_node)); - if (!sord_read_file(world->model, manifest_uri.buf, bundle_node, + SerdEnv* env = serd_env_new(); + if (!sord_read_file(world->model, env, manifest_uri.buf, bundle_node, lilv_world_blank_node_prefix(world))) { + serd_env_free(env); return; } + serd_env_free(env); // ?plugin a lv2:Plugin SordIter* plug_results = lilv_world_find_statements( @@ -663,10 +668,13 @@ lilv_world_load_specifications(LilvWorld* world) LilvSpec* spec = (LilvSpec*)l->data; LILV_FOREACH(nodes, f, spec->data_uris) { LilvNode* file = lilv_collection_get(spec->data_uris, f); + SerdEnv* env = serd_env_new(); sord_read_file(world->model, + env, (const uint8_t*)lilv_node_as_uri(file), NULL, lilv_world_blank_node_prefix(world)); + serd_env_free(env); } } } |