diff options
Diffstat (limited to 'include/serd/serd.h')
-rw-r--r-- | include/serd/serd.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h index 96890dbd..e99e4e6a 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -2388,6 +2388,8 @@ typedef struct SerdByteSinkImpl SerdByteSink; Create a new byte sink that writes to a buffer. The `buffer` is owned by the caller, but will be expanded as necessary. + Note that the string in the buffer will not be null terminated until the + byte sink is closed. @param buffer Buffer to write output to. */ @@ -2415,15 +2417,17 @@ serd_byte_sink_new_filename(const char* SERD_NONNULL path, size_t block_size); The `stream` will be passed to the `write_func`, which is compatible with the standard C `fwrite` if `stream` is a `FILE*`. - @param write_func Function called with bytes to consume. + @param write_func Stream write function, like `fwrite`. + @param close_func Stream close function, like `fclose`. @param stream Context parameter passed to `sink`. @param block_size Number of bytes to write per call. */ SERD_API SerdByteSink* SERD_ALLOCATED -serd_byte_sink_new_function(SerdWriteFunc SERD_NONNULL write_func, - void* SERD_NULLABLE stream, - size_t block_size); +serd_byte_sink_new_function(SerdWriteFunc SERD_NONNULL write_func, + SerdStreamCloseFunc SERD_NULLABLE close_func, + void* SERD_NULLABLE stream, + size_t block_size); /// Flush any pending output in `sink` to the underlying write function SERD_API |