From eb804125430e3445e85c423b28e1c41346772ed0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 10 Sep 2021 13:20:47 -0400 Subject: Make environments and sinks part of the world Although functions/components that require minimal pre-existing state are nice, these allocate memory and could potentially share resources. So, give them a pointer to a world which can be used to configure such things. In particular, this is working towards supporting custom allocators everywhere. --- tools/serd-filter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/serd-filter.c') diff --git a/tools/serd-filter.c b/tools/serd-filter.c index b172d05d..199125d5 100644 --- a/tools/serd-filter.c +++ b/tools/serd-filter.c @@ -71,9 +71,9 @@ parse_pattern(SerdWorld* const world, SerdInputStream* const in, const bool inclusive) { - SerdEnv* const env = serd_env_new(SERD_EMPTY_STRING()); + SerdEnv* const env = serd_env_new(world, SERD_EMPTY_STRING()); FilterPattern pat = {NULL, NULL, NULL, NULL}; - SerdSink* in_sink = serd_sink_new(&pat, on_pattern_event, NULL); + SerdSink* in_sink = serd_sink_new(world, &pat, on_pattern_event, NULL); SerdReader* reader = serd_reader_new( world, SERD_NQUADS, SERD_READ_VARIABLES, env, in_sink, 4096); @@ -99,7 +99,7 @@ parse_pattern(SerdWorld* const world, } SerdSink* filter = - serd_filter_new(sink, pat.s, pat.p, pat.o, pat.g, inclusive); + serd_filter_new(world, sink, pat.s, pat.p, pat.o, pat.g, inclusive); serd_node_free(pat.s); serd_node_free(pat.p); -- cgit v1.2.1