aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-01-22 18:32:18 +0000
committerDavid Robillard <d@drobilla.net>2011-01-22 18:32:18 +0000
commit752051a76a46c5d3c19c65ac8a8f24019a81df35 (patch)
treedd6266c7d1e3b10f125332a065ca131ea937e6dc /src/writer.c
parentaf3398a40718821c03817df32f712cdb2814b077 (diff)
downloadserd-752051a76a46c5d3c19c65ac8a8f24019a81df35.tar.gz
serd-752051a76a46c5d3c19c65ac8a8f24019a81df35.tar.bz2
serd-752051a76a46c5d3c19c65ac8a8f24019a81df35.zip
SerdNamespaces => SerdEnv.
git-svn-id: http://svn.drobilla.net/serd/trunk@36 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/writer.c b/src/writer.c
index 7c31106b..1e50b7b0 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -41,7 +41,7 @@ typedef bool (*NodeWriter)(SerdWriter writer,
struct SerdWriterImpl {
SerdSyntax syntax;
SerdStyle style;
- SerdNamespaces ns;
+ SerdEnv env;
SerdURI base_uri;
SerdSink sink;
void* stream;
@@ -154,9 +154,6 @@ write_node(SerdWriter writer,
const SerdString* datatype,
const SerdString* lang)
{
- const SerdURI* base_uri = &writer->base_uri;
- SerdNamespaces ns = writer->ns;
-
SerdChunk uri_prefix;
SerdChunk uri_suffix;
switch (type) {
@@ -167,7 +164,7 @@ write_node(SerdWriter writer,
case QNAME:
switch (writer->syntax) {
case SERD_NTRIPLES:
- if (!serd_namespaces_expand(ns, str, &uri_prefix, &uri_suffix)) {
+ if (!serd_env_expand(writer->env, str, &uri_prefix, &uri_suffix)) {
fprintf(stderr, "error: undefined namespace prefix `%s'\n", str->buf);
return false;
}
@@ -185,7 +182,7 @@ write_node(SerdWriter writer,
SerdURI uri;
if (serd_uri_parse(str->buf, &uri)) {
SerdURI abs_uri;
- if (serd_uri_resolve(&uri, base_uri, &abs_uri)) {
+ if (serd_uri_resolve(&uri, &writer->base_uri, &abs_uri)) {
writer->sink("<", 1, writer->stream);
serd_uri_serialise(&abs_uri, writer->sink, writer->stream);
writer->sink(">", 1, writer->stream);
@@ -336,7 +333,7 @@ SERD_API
SerdWriter
serd_writer_new(SerdSyntax syntax,
SerdStyle style,
- SerdNamespaces ns,
+ SerdEnv env,
const SerdURI* base_uri,
SerdSink sink,
void* stream)
@@ -344,7 +341,7 @@ serd_writer_new(SerdSyntax syntax,
SerdWriter writer = malloc(sizeof(struct SerdWriterImpl));
writer->syntax = syntax;
writer->style = style;
- writer->ns = ns;
+ writer->env = env;
writer->base_uri = *base_uri;
writer->sink = sink;
writer->stream = stream;