aboutsummaryrefslogtreecommitdiffstats
path: root/src/serdi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/serdi.c')
-rw-r--r--src/serdi.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/serdi.c b/src/serdi.c
index 27ffbe71..b066b265 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -208,8 +208,7 @@ main(int argc, char** argv)
}
const SerdWriterFlags writer_flags =
- ((ascii ? SERD_WRITE_ASCII : 0) | //
- (bulk_write ? SERD_WRITE_BULK : 0) | //
+ ((ascii ? SERD_WRITE_ASCII : 0) | //
(full_uris ? (SERD_WRITE_UNQUALIFIED | SERD_WRITE_UNRESOLVED) : 0));
SerdNode* base = NULL;
@@ -223,8 +222,16 @@ main(int argc, char** argv)
SerdWorld* const world = serd_world_new();
SerdEnv* const env = serd_env_new(serd_node_string_view(base));
- SerdWriter* const writer = serd_writer_new(
- world, output_syntax, writer_flags, env, (SerdWriteFunc)fwrite, out_fd);
+ SerdByteSink* const byte_sink =
+ serd_byte_sink_new((SerdWriteFunc)fwrite, out_fd, bulk_write ? 4096u : 1u);
+
+ SerdWriter* const writer =
+ serd_writer_new(world,
+ output_syntax,
+ writer_flags,
+ env,
+ (SerdWriteFunc)serd_byte_sink_write,
+ byte_sink);
SerdReader* const reader =
serd_reader_new(world, input_syntax, serd_writer_sink(writer), stack_size);
@@ -263,9 +270,9 @@ main(int argc, char** argv)
serd_reader_finish(reader);
serd_reader_free(reader);
- serd_writer_finish(writer);
serd_writer_free(writer);
serd_node_free(input_name);
+ serd_byte_sink_free(byte_sink);
serd_env_free(env);
serd_node_free(base);
serd_world_free(world);