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/serdi.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/serdi.c')
-rw-r--r-- | src/serdi.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/serdi.c b/src/serdi.c index 697f1217..c132eaf8 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -254,8 +254,9 @@ main(int argc, char** argv) base = serd_node_new_file_uri(input, NULL, &base_uri, true); } - FILE* out_fd = stdout; - SerdEnv* env = serd_env_new(base); + FILE* out_fd = stdout; + SerdWorld* world = serd_world_new(); + SerdEnv* env = serd_env_new(base); int output_style = 0; if (output_syntax == SERD_NTRIPLES || ascii) { @@ -277,7 +278,8 @@ main(int argc, char** argv) output_style |= SERD_STYLE_BULK; } - SerdWriter* writer = serd_writer_new(output_syntax, + SerdWriter* writer = serd_writer_new(world, + output_syntax, (SerdStyle)output_style, env, &base_uri, @@ -285,12 +287,11 @@ main(int argc, char** argv) out_fd); SerdReader* reader = - serd_reader_new(input_syntax, serd_writer_get_sink(writer)); + serd_reader_new(world, input_syntax, serd_writer_get_sink(writer)); 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_sink(world, quiet_error_sink, NULL); } SerdNode* root = serd_node_new_string(SERD_URI, root_uri); @@ -321,6 +322,7 @@ main(int argc, char** argv) serd_writer_free(writer); serd_env_free(env); serd_node_free(base); + serd_world_free(world); free(input_path); if (from_file) { |