diff options
author | David Robillard <d@drobilla.net> | 2019-10-14 19:18:17 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:58 +0100 |
commit | 0e8a72aae08b64beb11d97f020c14126178d7545 (patch) | |
tree | 0cf783d174f2ddd95453c34aba3ef46fc3a5b9d7 /tests | |
parent | 3ff6565bdf0861f9db3527b58919ca7481deca6c (diff) | |
download | serd-0e8a72aae08b64beb11d97f020c14126178d7545.tar.gz serd-0e8a72aae08b64beb11d97f020c14126178d7545.tar.bz2 serd-0e8a72aae08b64beb11d97f020c14126178d7545.zip |
Add function to SerdSink for freeing opaque handle
This can be used to associate dynamically allocated data with a sink and have
it managed along with the sink's lifetime.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/env_test.c | 2 | ||||
-rw-r--r-- | tests/overflow_test.c | 2 | ||||
-rw-r--r-- | tests/read_chunk_test.c | 2 | ||||
-rw-r--r-- | tests/serd_test.c | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/env_test.c b/tests/env_test.c index c0629da5..ee172fff 100644 --- a/tests/env_test.c +++ b/tests/env_test.c @@ -86,7 +86,7 @@ test_env(void) serd_node_free(blank); size_t n_prefixes = 0; - SerdSink* count_prefixes_sink = serd_sink_new(&n_prefixes); + SerdSink* count_prefixes_sink = serd_sink_new(&n_prefixes, NULL); serd_sink_set_prefix_func(count_prefixes_sink, count_prefixes); serd_env_set_prefix(env, pre, eg); serd_env_write_prefixes(env, count_prefixes_sink); diff --git a/tests/overflow_test.c b/tests/overflow_test.c index 4a942f58..7e545793 100644 --- a/tests/overflow_test.c +++ b/tests/overflow_test.c @@ -56,7 +56,7 @@ main(void) {NULL, 0}}; SerdWorld* world = serd_world_new(); - SerdSink* sink = serd_sink_new(NULL); + SerdSink* sink = serd_sink_new(NULL, NULL); for (const Test* t = tests; t->str; ++t) { const SerdStatus st = test(world, sink, t->str, t->stack_size); diff --git a/tests/read_chunk_test.c b/tests/read_chunk_test.c index 8ff3e03e..56c6abdc 100644 --- a/tests/read_chunk_test.c +++ b/tests/read_chunk_test.c @@ -74,7 +74,7 @@ int main(void) { SerdWorld* world = serd_world_new(); - SerdSink* sink = serd_sink_new(NULL); + SerdSink* sink = serd_sink_new(NULL, NULL); serd_sink_set_base_func(sink, on_base); serd_sink_set_prefix_func(sink, on_prefix); serd_sink_set_statement_func(sink, on_statement); diff --git a/tests/serd_test.c b/tests/serd_test.c index da3780f7..3b622c7a 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -119,7 +119,7 @@ test_read_chunks(void) size_t n_statements = 0; FILE* const f = tmpfile(); static const char null = 0; - SerdSink* sink = serd_sink_new(&n_statements); + SerdSink* sink = serd_sink_new(&n_statements, NULL); assert(sink); serd_sink_set_statement_func(sink, count_statements); @@ -202,7 +202,7 @@ test_read_string(void) { SerdWorld* world = serd_world_new(); size_t n_statements = 0; - SerdSink* sink = serd_sink_new(&n_statements); + SerdSink* sink = serd_sink_new(&n_statements, NULL); SerdReader* reader = serd_reader_new(world, SERD_TURTLE, sink, 4096); assert(reader); @@ -703,7 +703,7 @@ test_reader(const char* path) SerdWorld* world = serd_world_new(); size_t n_statements = 0; - SerdSink* sink = serd_sink_new(&n_statements); + SerdSink* sink = serd_sink_new(&n_statements, NULL); serd_sink_set_statement_func(sink, count_statements); SerdReader* reader = serd_reader_new(world, SERD_TURTLE, sink, 4096); |