From 0abe1816da2706f87432c4e04918ad0eec902479 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 16 Jun 2023 19:46:46 +0200 Subject: Move data writer ostream into libsquashfs It is mainly a very thin wrapper on top of the block processor so far. Signed-off-by: David Oberhollenzer --- include/sqfs/block_processor.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/sqfs/block_processor.h') diff --git a/include/sqfs/block_processor.h b/include/sqfs/block_processor.h index a5eed33..cc40605 100644 --- a/include/sqfs/block_processor.h +++ b/include/sqfs/block_processor.h @@ -381,6 +381,27 @@ SQFS_API int sqfs_block_processor_finish(sqfs_block_processor_t *proc); SQFS_API const sqfs_block_processor_stats_t *sqfs_block_processor_get_stats(const sqfs_block_processor_t *proc); +/** + * @brief Create an @ref sqfs_ostream_t that writes to a data writer + * + * @memberof sqfs_block_processor_t + * + * @param out Receives a pointer to an @ref sqfs_ostream_t on success + * @param filename A filename that the ostream returns when queried. + * @param proc A pointer to a data writer object. + * @param inode An optional pointer to a pointer to an inode. If not NULL, the + * block processor creates a file inode and stores a pointer to + * it here and keeps updating the inode as the file grows. + * @param flags A combination of @ref SQFS_BLK_FLAGS that can be used to + * micro manage how the data is processed. + * + * @return Zero on sucess, a negative @ref SQFS_ERROR value on failure. + */ +SQFS_API int sqfs_block_processor_create_ostream(sqfs_ostream_t **out, + const char *filename, + sqfs_block_processor_t *proc, + sqfs_inode_generic_t **inode, + sqfs_u32 flags); #ifdef __cplusplus } #endif -- cgit v1.2.3