diff options
Diffstat (limited to 'src/serdi.c')
-rw-r--r-- | src/serdi.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/serdi.c b/src/serdi.c index 628ae004..3f0185ec 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -80,7 +80,7 @@ missing_arg(const char* name, char opt) } static SerdStatus -quiet_error_sink(void* handle, const SerdError* e) +quiet_error_func(void* const handle, const SerdError* const e) { (void)handle; (void)e; @@ -247,19 +247,19 @@ main(int argc, char** argv) base = serd_new_file_uri(SERD_MEASURE_STRING(input), SERD_EMPTY_STRING()); } - FILE* const out_fd = stdout; - SerdEnv* const env = serd_env_new(serd_node_string_view(base)); + FILE* const out_fd = stdout; + SerdWorld* const world = serd_world_new(); + SerdEnv* const env = serd_env_new(serd_node_string_view(base)); - SerdWriter* writer = serd_writer_new( - output_syntax, writer_flags, env, (SerdWriteFunc)fwrite, out_fd); + SerdWriter* const writer = serd_writer_new( + world, output_syntax, writer_flags, env, (SerdWriteFunc)fwrite, out_fd); SerdReader* const reader = - serd_reader_new(input_syntax, serd_writer_sink(writer), stack_size); + serd_reader_new(world, input_syntax, serd_writer_sink(writer), stack_size); serd_reader_set_strict(reader, !lax); if (quiet) { - serd_reader_set_error_sink(reader, quiet_error_sink, NULL); - serd_writer_set_error_sink(writer, quiet_error_sink, NULL); + serd_world_set_error_func(world, quiet_error_func, NULL); } SerdNode* root = serd_new_uri(SERD_MEASURE_STRING(root_uri)); @@ -292,6 +292,7 @@ main(int argc, char** argv) serd_writer_free(writer); serd_env_free(env); serd_node_free(base); + serd_world_free(world); if (fclose(stdout)) { perror("serdi: write error"); |