aboutsummaryrefslogtreecommitdiffstats
path: root/src/serdi.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-04-29 15:24:05 +0200
committerDavid Robillard <d@drobilla.net>2020-06-21 18:12:03 +0200
commitf814ec24583a2dc11fc70421aec1aeb950a78244 (patch)
treea9d0e701e63a207161b7958a4d59840816ab48e8 /src/serdi.c
parent4a9e954904faedc5da79c0f549722e2c4eb73a29 (diff)
downloadserd-f814ec24583a2dc11fc70421aec1aeb950a78244.tar.gz
serd-f814ec24583a2dc11fc70421aec1aeb950a78244.tar.bz2
serd-f814ec24583a2dc11fc70421aec1aeb950a78244.zip
Add SerdWorld for shared library state
Diffstat (limited to 'src/serdi.c')
-rw-r--r--src/serdi.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/serdi.c b/src/serdi.c
index b0e892f5..70badb52 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -267,8 +267,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) {
@@ -290,7 +291,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,
@@ -298,12 +300,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);
@@ -336,6 +337,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) {