diff options
author | David Robillard <d@drobilla.net> | 2021-08-08 20:00:43 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-28 21:57:07 -0500 |
commit | 9547c806dbf76d6afd1e324fc924abdf944c4bda (patch) | |
tree | 012ecf59cac892711d5bcf8f717f0ca579bbf7cd /test/test_reader_writer.c | |
parent | dc01b7e301e91d0d7bfc358f569f4f3849471c52 (diff) | |
download | serd-9547c806dbf76d6afd1e324fc924abdf944c4bda.tar.gz serd-9547c806dbf76d6afd1e324fc924abdf944c4bda.tar.bz2 serd-9547c806dbf76d6afd1e324fc924abdf944c4bda.zip |
Add a close function to SerdByteSink
This simplifies everything by replacing special cases with a more general close
function. A type is no longer stored in the structure, so the other
constructors are now essentially syntactic sugar for the universal
serd_byte_sink_new_function().
Diffstat (limited to 'test/test_reader_writer.c')
-rw-r--r-- | test/test_reader_writer.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/test_reader_writer.c b/test/test_reader_writer.c index cab33ff5..c0af313a 100644 --- a/test/test_reader_writer.c +++ b/test/test_reader_writer.c @@ -43,8 +43,8 @@ test_writer(const char* const path) SerdWorld* world = serd_world_new(); SerdNodes* nodes = serd_world_nodes(world); - SerdByteSink* byte_sink = - serd_byte_sink_new_function((SerdWriteFunc)fwrite, fd, 1); + SerdByteSink* byte_sink = serd_byte_sink_new_function( + (SerdWriteFunc)fwrite, (SerdStreamCloseFunc)fclose, fd, 1); SerdWriter* writer = serd_writer_new(world, SERD_TURTLE, SERD_WRITE_LAX, env, byte_sink); @@ -131,7 +131,6 @@ test_writer(const char* const path) serd_env_free(env); serd_world_free(world); - fclose(fd); } static void |