diff options
Diffstat (limited to 'src/byte_sink.h')
-rw-r--r-- | src/byte_sink.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/byte_sink.h b/src/byte_sink.h index d5222843..576f9c2e 100644 --- a/src/byte_sink.h +++ b/src/byte_sink.h @@ -26,15 +26,15 @@ #include <string.h> typedef struct SerdByteSinkImpl { - SerdSink sink; - void* stream; - char* buf; - size_t size; - size_t block_size; + SerdWriteFunc sink; + void* stream; + char* buf; + size_t size; + size_t block_size; } SerdByteSink; static inline SerdByteSink -serd_byte_sink_new(SerdSink sink, void* stream, size_t block_size) +serd_byte_sink_new(SerdWriteFunc sink, void* stream, size_t block_size) { SerdByteSink bsink; bsink.sink = sink; @@ -50,7 +50,7 @@ static inline void serd_byte_sink_flush(SerdByteSink* bsink) { if (bsink->block_size > 1 && bsink->size > 0) { - bsink->sink(bsink->buf, bsink->size, bsink->stream); + bsink->sink(bsink->buf, 1, bsink->size, bsink->stream); bsink->size = 0; } } @@ -71,7 +71,7 @@ serd_byte_sink_write(const void* buf, size_t len, SerdByteSink* bsink) } if (bsink->block_size == 1) { - return bsink->sink(buf, len, bsink->stream); + return bsink->sink(buf, 1, len, bsink->stream); } const size_t orig_len = len; @@ -87,7 +87,7 @@ serd_byte_sink_write(const void* buf, size_t len, SerdByteSink* bsink) // Flush page if buffer is full if (bsink->size == bsink->block_size) { - bsink->sink(bsink->buf, bsink->block_size, bsink->stream); + bsink->sink(bsink->buf, 1, bsink->block_size, bsink->stream); bsink->size = 0; } } |