diff options
author | David Robillard <d@drobilla.net> | 2018-04-29 15:24:05 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-06-21 18:12:03 +0200 |
commit | f814ec24583a2dc11fc70421aec1aeb950a78244 (patch) | |
tree | a9d0e701e63a207161b7958a4d59840816ab48e8 /src/writer.c | |
parent | 4a9e954904faedc5da79c0f549722e2c4eb73a29 (diff) | |
download | serd-f814ec24583a2dc11fc70421aec1aeb950a78244.tar.gz serd-f814ec24583a2dc11fc70421aec1aeb950a78244.tar.bz2 serd-f814ec24583a2dc11fc70421aec1aeb950a78244.zip |
Add SerdWorld for shared library state
Diffstat (limited to 'src/writer.c')
-rw-r--r-- | src/writer.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/writer.c b/src/writer.c index da26d9f6..bee4bf9a 100644 --- a/src/writer.c +++ b/src/writer.c @@ -93,6 +93,7 @@ static const SepRule rules[] = { }; struct SerdWriterImpl { + SerdWorld* world; SerdSink iface; SerdSyntax syntax; SerdStyle style; @@ -147,8 +148,8 @@ w_err(SerdWriter* writer, SerdStatus st, const char* fmt, ...) va_list args; va_start(args, fmt); - const SerdError e = { st, "", 0, 0, fmt, &args }; - serd_error(writer->error_sink, writer->error_handle, &e); + const SerdError e = { st, NULL, 0, 0, fmt, &args }; + serd_error(writer->world, &e); va_end(args); } @@ -879,7 +880,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, @@ -888,6 +890,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; @@ -911,15 +914,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) { |