diff options
author | David Robillard <d@drobilla.net> | 2018-04-29 15:24:05 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-12-30 17:58:17 -0500 |
commit | 9fd4ff5a6470f58916d7cd8578bcb839f9b5feaa (patch) | |
tree | 89fa93f202f9e992d3ea24650ec4c418493ffe6c /src/writer.c | |
parent | aebfe13a070ee542929e0ec19b4b2e9221dc1582 (diff) | |
download | serd-9fd4ff5a6470f58916d7cd8578bcb839f9b5feaa.tar.gz serd-9fd4ff5a6470f58916d7cd8578bcb839f9b5feaa.tar.bz2 serd-9fd4ff5a6470f58916d7cd8578bcb839f9b5feaa.zip |
Add SerdWorld for shared library state
Diffstat (limited to 'src/writer.c')
-rw-r--r-- | src/writer.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/writer.c b/src/writer.c index 11ef0692..7bdc05f3 100644 --- a/src/writer.c +++ b/src/writer.c @@ -89,6 +89,7 @@ static const SepRule rules[] = { }; struct SerdWriterImpl { + SerdWorld* world; SerdSink iface; SerdSyntax syntax; SerdStyle style; @@ -144,7 +145,7 @@ w_err(SerdWriter* writer, SerdStatus st, const char* fmt, ...) va_list args; va_start(args, fmt); const SerdError e = { st, NULL, 0, 0, fmt, &args }; - serd_error(writer->error_sink, writer->error_handle, &e); + serd_error(writer->world, &e); va_end(args); } @@ -874,7 +875,8 @@ serd_writer_finish(SerdWriter* writer) } SerdWriter* -serd_writer_new(SerdSyntax syntax, +serd_writer_new(SerdWorld* world, + SerdSyntax syntax, SerdStyle style, SerdEnv* env, const SerdURI* base_uri, @@ -883,6 +885,7 @@ serd_writer_new(SerdSyntax syntax, { const WriteContext context = WRITE_CONTEXT_NULL; SerdWriter* writer = (SerdWriter*)calloc(1, sizeof(SerdWriter)); + writer->world = world; writer->syntax = syntax; writer->style = style; writer->env = env; @@ -906,15 +909,6 @@ serd_writer_new(SerdSyntax syntax, } void -serd_writer_set_error_sink(SerdWriter* writer, - SerdErrorSink error_sink, - void* error_handle) -{ - writer->error_sink = error_sink; - writer->error_handle = error_handle; -} - -void serd_writer_chop_blank_prefix(SerdWriter* writer, const char* prefix) { |