From 40268925466dba7a37b468be0bba951e7f6ca5d1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 29 Apr 2018 15:24:05 +0200 Subject: Add SerdWorld for shared library state --- src/writer.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/writer.c') diff --git a/src/writer.c b/src/writer.c index c57323b0..f478524e 100644 --- a/src/writer.c +++ b/src/writer.c @@ -89,6 +89,7 @@ static const SepRule rules[] = { }; struct SerdWriterImpl { + SerdWorld* world; SerdSinkInterface 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; @@ -905,15 +908,6 @@ serd_writer_new(SerdSyntax syntax, return writer; } -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) -- cgit v1.2.1