aboutsummaryrefslogtreecommitdiffstats
path: root/tools/serd-pipe.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-08-14 01:51:55 -0400
committerDavid Robillard <d@drobilla.net>2022-01-28 21:57:07 -0500
commitb3892cb6e4963e1bbeb346a8124101b7c3cf379b (patch)
tree4800918b6f4db5ce0d0f4802988c1935996d6ba3 /tools/serd-pipe.c
parent0e739f34801ff6810064a8fac570f6be2b61ae70 (diff)
downloadserd-b3892cb6e4963e1bbeb346a8124101b7c3cf379b.tar.gz
serd-b3892cb6e4963e1bbeb346a8124101b7c3cf379b.tar.bz2
serd-b3892cb6e4963e1bbeb346a8124101b7c3cf379b.zip
Simplify input stream API
More or less the same rationale as the previous commit, but for reading. This makes for nice symmetry with writing, at the cost of a slightly more annoying reader interface since the source doesn't know its block size or name.
Diffstat (limited to 'tools/serd-pipe.c')
-rw-r--r--tools/serd-pipe.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/serd-pipe.c b/tools/serd-pipe.c
index 08479a74..25607d15 100644
--- a/tools/serd-pipe.c
+++ b/tools/serd-pipe.c
@@ -64,18 +64,19 @@ run(const Options opts)
}
if (opts.input_string) {
- SerdByteSource* const in =
- serd_byte_source_new_string(opts.input_string, NULL);
+ const char* position = opts.input_string;
+ SerdInputStream in = serd_open_input_string(&position);
st = serd_read_source(
app.world,
opts.common,
app.env,
serd_choose_syntax(app.world, opts.common.input, NULL, SERD_TRIG),
- in,
+ &in,
+ "string",
sink);
- serd_byte_source_free(in);
+ serd_close_input(&in);
}
// Read all the inputs, which drives the writer to emit the output