From 63e7e57237a79d0447b0450a7fd3148c43052299 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 13 Aug 2021 19:31:26 -0400 Subject: Provide a full output stream implementation for SerdBuffer Essentially replaces serd_buffer_sink_finish() with serd_buffer_close(), which makes writing to a buffer consistent with writing to a file or anything else. --- src/byte_sink.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/byte_sink.c') diff --git a/src/byte_sink.c b/src/byte_sink.c index febd11cd..b5b4039e 100644 --- a/src/byte_sink.c +++ b/src/byte_sink.c @@ -30,21 +30,13 @@ # include #endif -static int -close_buffer(void* const stream) -{ - serd_buffer_sink("", 1, 1, stream); // Write null terminator - - return 0; -} - SerdByteSink* serd_byte_sink_new_buffer(SerdBuffer* const buffer) { assert(buffer); return serd_byte_sink_new_function( - serd_buffer_sink, close_buffer, buffer, 1u); + serd_buffer_write, serd_buffer_close, buffer, 1u); } SerdByteSink* -- cgit v1.2.1