summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-08 17:55:39 +0000
committerDavid Robillard <d@drobilla.net>2012-03-08 17:55:39 +0000
commit16dd9d7496ca907a68f9bae2aa92a5069fe9ef62 (patch)
tree27ec16d591e291e9b20110982ab4d3f818cae5f4 /src
parenta442a47f3a6265de156ad278760f50438cbdde64 (diff)
downloadlilv-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
Diffstat (limited to 'src')
-rw-r--r--src/state.c8
1 files changed, 5 insertions, 3 deletions
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);