From 16dd9d7496ca907a68f9bae2aa92a5069fe9ef62 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 8 Mar 2012 17:55:39 +0000 Subject: 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 --- src/state.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/state.c') 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); -- cgit v1.2.1