diff options
author | David Robillard <d@drobilla.net> | 2012-03-08 17:55:39 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-08 17:55:39 +0000 |
commit | 16dd9d7496ca907a68f9bae2aa92a5069fe9ef62 (patch) | |
tree | 27ec16d591e291e9b20110982ab4d3f818cae5f4 | |
parent | a442a47f3a6265de156ad278760f50438cbdde64 (diff) | |
download | lilv-16dd9d7496ca907a68f9bae2aa92a5069fe9ef62.tar.gz lilv-16dd9d7496ca907a68f9bae2aa92a5069fe9ef62.tar.bz2 lilv-16dd9d7496ca907a68f9bae2aa92a5069fe9ef62.zip |
Add base_uri parameter to lilv_state_to_string().
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4032 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | lilv/lilv.h | 3 | ||||
-rw-r--r-- | src/state.c | 8 | ||||
-rw-r--r-- | test/lilv_test.c | 2 | ||||
-rw-r--r-- | wscript | 2 |
4 files changed, 9 insertions, 6 deletions
diff --git a/lilv/lilv.h b/lilv/lilv.h index 7975945..cb9f172 100644 --- a/lilv/lilv.h +++ b/lilv/lilv.h @@ -1372,7 +1372,8 @@ lilv_state_to_string(LilvWorld* world, LV2_URID_Map* map, LV2_URID_Unmap* unmap, const LilvState* state, - const char* uri); + const char* uri, + const char* base_uri); /** @} diff --git a/src/state.c b/src/state.c index 1149b32..1d36f34 100644 --- a/src/state.c +++ b/src/state.c @@ -696,7 +696,7 @@ static SerdWriter* ttl_writer(SerdSink sink, void* stream, const SerdNode* base, SerdEnv** new_env) { SerdURI base_uri = SERD_URI_NULL; - if (base) { + if (base && base->buf) { serd_uri_parse(base->buf, &base_uri); } @@ -996,11 +996,13 @@ lilv_state_to_string(LilvWorld* world, LV2_URID_Map* map, LV2_URID_Unmap* unmap, const LilvState* state, - const char* uri) + const char* uri, + const char* base_uri) { SerdChunk chunk = { NULL, 0 }; SerdEnv* env = NULL; - SerdWriter* writer = ttl_writer(serd_chunk_sink, &chunk, NULL, &env); + SerdNode base = serd_node_from_string(SERD_URI, USTR(base_uri)); + SerdWriter* writer = ttl_writer(serd_chunk_sink, &chunk, &base, &env); lilv_state_write(world, map, unmap, state, writer, uri, NULL); diff --git a/test/lilv_test.c b/test/lilv_test.c index 5e2c54a..804b813 100644 --- a/test/lilv_test.c +++ b/test/lilv_test.c @@ -1214,7 +1214,7 @@ test_state(void) // Save state to a string char* state1_str = lilv_state_to_string( - world, &map, &unmap, state, "http://example.org/state1"); + world, &map, &unmap, state, "http://example.org/state1", NULL); // Restore from string LilvState* from_str = lilv_state_new_from_string(world, &map, state1_str); @@ -8,7 +8,7 @@ import waflib.Options as Options import waflib.Logs as Logs # Version of this package (even if built as a child) -LILV_VERSION = '0.12.0' +LILV_VERSION = '0.13.0' LILV_MAJOR_VERSION = '0' # Library version (UNIX style major, minor, micro) |