aboutsummaryrefslogtreecommitdiffstats
path: root/tools/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/console.c')
-rw-r--r--tools/console.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/console.c b/tools/console.c
index c187f500..f07573fa 100644
--- a/tools/console.c
+++ b/tools/console.c
@@ -93,3 +93,17 @@ serd_open_tool_input(const char* const filename)
return serd_open_input_file(filename);
}
+
+SerdOutputStream
+serd_open_tool_output(const char* const filename)
+{
+ if (!filename || !strcmp(filename, "-")) {
+ serd_set_stream_utf8_mode(stdout);
+ return serd_open_output_stream((SerdWriteFunc)fwrite,
+ (SerdErrorFunc)ferror,
+ (SerdCloseFunc)fclose,
+ stdout);
+ }
+
+ return serd_open_output_file(filename);
+}