aboutsummaryrefslogtreecommitdiffstats
path: root/src/filter.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-09-10 13:20:47 -0400
committerDavid Robillard <d@drobilla.net>2022-01-28 21:57:07 -0500
commiteb804125430e3445e85c423b28e1c41346772ed0 (patch)
tree532f6995ace537170fbbfde2d0d8226d1a48279b /src/filter.c
parentcbf01be4126cbc0f6d80364a7e0b6ad777a7d8ae (diff)
downloadserd-eb804125430e3445e85c423b28e1c41346772ed0.tar.gz
serd-eb804125430e3445e85c423b28e1c41346772ed0.tar.bz2
serd-eb804125430e3445e85c423b28e1c41346772ed0.zip
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.
Diffstat (limited to 'src/filter.c')
-rw-r--r--src/filter.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/filter.c b/src/filter.c
index e5e8fa29..8efe1e91 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -70,13 +70,15 @@ serd_filter_on_event(void* const handle, const SerdEvent* const event)
}
SerdSink*
-serd_filter_new(const SerdSink* const target,
- const SerdNode* const subject,
- const SerdNode* const predicate,
- const SerdNode* const object,
- const SerdNode* const graph,
- const bool inclusive)
+serd_filter_new(const SerdWorld* const world,
+ const SerdSink* const target,
+ const SerdNode* const subject,
+ const SerdNode* const predicate,
+ const SerdNode* const object,
+ const SerdNode* const graph,
+ const bool inclusive)
{
+ assert(world);
assert(target);
SerdFilterData* const data =
@@ -101,5 +103,5 @@ serd_filter_new(const SerdSink* const target,
data->graph = serd_node_copy(graph);
}
- return serd_sink_new(data, serd_filter_on_event, free_data);
+ return serd_sink_new(world, data, serd_filter_on_event, free_data);
}