aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-03-27 05:39:26 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit7ffa2c0488fcd96c3c12713e5650633eb03e91f7 (patch)
tree9ca96bb40f71b6c37789ae641af75e39a2751c18 /tools
parent5e4538756d601e6a941c5290777af95ea8848e1a (diff)
downloadserd-7ffa2c0488fcd96c3c12713e5650633eb03e91f7.tar.gz
serd-7ffa2c0488fcd96c3c12713e5650633eb03e91f7.tar.bz2
serd-7ffa2c0488fcd96c3c12713e5650633eb03e91f7.zip
[WIP] Move SerdEnv mutation from writer to reader
Writing having side-effects seems questionable in general, and this prepares things for expanding URIs in the reader.
Diffstat (limited to 'tools')
-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 734d02f4..8bf26f2a 100644
--- a/tools/serd-pipe.c
+++ b/tools/serd-pipe.c
@@ -72,6 +72,7 @@ static SerdStatus
read_file(SerdWorld* const world,
const SerdSyntax syntax,
const SerdReaderFlags flags,
+ SerdEnv* const env,
const SerdSink* const sink,
const size_t stack_size,
const char* const filename,
@@ -86,12 +87,10 @@ read_file(SerdWorld* const world,
return SERD_BAD_STREAM;
}
- SerdLimits limits = serd_world_limits(world);
- limits.reader_stack_size = stack_size;
+ const SerdLimits limits = {stack_size, MAX_DEPTH};
serd_world_set_limits(world, limits);
- SerdReader* reader = serd_reader_new(world, syntax, flags, sink);
-
+ SerdReader* reader = serd_reader_new(world, syntax, flags, env, sink);
serd_reader_add_blank_prefix(reader, add_prefix);
SerdStatus st = serd_reader_start(reader, &in, NULL, block_size);
@@ -315,6 +314,7 @@ main(int argc, char** argv)
serd_reader_new(world,
input_syntax ? input_syntax : SERD_TRIG,
reader_flags,
+ env,
serd_writer_sink(writer));
serd_reader_add_blank_prefix(reader, add_prefix);
@@ -349,6 +349,7 @@ main(int argc, char** argv)
if ((st = read_file(world,
serd_choose_syntax(world, input_syntax, inputs[i]),
reader_flags,
+ env,
serd_writer_sink(writer),
stack_size,
inputs[i],