diff options
author | David Robillard <d@drobilla.net> | 2021-07-11 20:47:51 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:07 -0500 |
commit | 6eb1fa15a06ab7de08e33add1540a45b83c5f0d8 (patch) | |
tree | 86d3cfedbf2ff76878eba6d14dc7fc259d1cbf46 /src/reader.c | |
parent | d1ba721d37af61f2b529faaa16bd20ba1e161b06 (diff) | |
download | serd-6eb1fa15a06ab7de08e33add1540a45b83c5f0d8.tar.gz serd-6eb1fa15a06ab7de08e33add1540a45b83c5f0d8.tar.bz2 serd-6eb1fa15a06ab7de08e33add1540a45b83c5f0d8.zip |
Add SerdWorld for shared library state
Diffstat (limited to 'src/reader.c')
-rw-r--r-- | src/reader.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/reader.c b/src/reader.c index 25c4b3b1..c2c20b82 100644 --- a/src/reader.c +++ b/src/reader.c @@ -28,7 +28,7 @@ r_err(SerdReader* const reader, const SerdStatus st, const char* const fmt, ...) va_start(args, fmt); const Cursor* const cur = &reader->source.cur; const SerdError e = {st, cur->filename, cur->line, cur->col, fmt, &args}; - serd_error(reader->error_func, reader->error_handle, &e); + serd_error(reader->world, &e); va_end(args); return st; } @@ -144,7 +144,8 @@ serd_reader_read_document(SerdReader* const reader) } SerdReader* -serd_reader_new(const SerdSyntax syntax, +serd_reader_new(SerdWorld* const world, + const SerdSyntax syntax, const SerdSink* const sink, const size_t stack_size) { @@ -154,6 +155,7 @@ serd_reader_new(const SerdSyntax syntax, SerdReader* me = (SerdReader*)calloc(1, sizeof(SerdReader)); + me->world = world; me->sink = sink; me->default_graph = NULL; me->stack = serd_stack_new(stack_size); @@ -183,15 +185,6 @@ serd_reader_set_strict(SerdReader* const reader, const bool strict) } void -serd_reader_set_error_sink(SerdReader* const reader, - const SerdErrorFunc error_func, - void* const error_handle) -{ - reader->error_func = error_func; - reader->error_handle = error_handle; -} - -void serd_reader_free(SerdReader* const reader) { if (!reader) { |