aboutsummaryrefslogtreecommitdiffstats
path: root/tools/serd-pipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/serd-pipe.c')
-rw-r--r--tools/serd-pipe.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/serd-pipe.c b/tools/serd-pipe.c
index 1ad07719..7216445a 100644
--- a/tools/serd-pipe.c
+++ b/tools/serd-pipe.c
@@ -11,7 +11,6 @@
#include "serd/reader.h"
#include "serd/sink.h"
#include "serd/status.h"
-#include "serd/stream.h"
#include "serd/string_view.h"
#include "serd/syntax.h"
#include "serd/world.h"
@@ -255,7 +254,6 @@ main(int argc, char** argv)
}
serd_set_stream_utf8_mode(stdin);
- serd_set_stream_utf8_mode(stdout);
char* const* const inputs = argv + a;
const int n_inputs = argc - a;
@@ -283,7 +281,6 @@ main(int argc, char** argv)
zix_free(NULL, input_path);
}
- FILE* const out_fd = stdout;
SerdWorld* const world = serd_world_new();
const SerdLimits limits = {stack_size, MAX_DEPTH};
serd_world_set_limits(world, limits);
@@ -291,10 +288,11 @@ main(int argc, char** argv)
SerdEnv* const env =
serd_env_new(base ? serd_node_string_view(base) : serd_empty_string());
- SerdOutputStream out = serd_open_output_stream((SerdWriteFunc)fwrite,
- (SerdErrorFunc)ferror,
- (SerdCloseFunc)fclose,
- out_fd);
+ SerdOutputStream out = serd_open_tool_output("-");
+ if (!out.stream) {
+ perror("serdi: error opening output file");
+ return 1;
+ }
SerdWriter* const writer = serd_writer_new(
world, output_syntax, writer_flags, env, &out, bulk_write ? 4096U : 1U);