From 50b901d5ebdad40227de66cd5a0a0f62548f1563 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 29 May 2020 18:20:58 +0200 Subject: Support associating a user pointer with data blocks This commit modifies the block processor to support associating a user data pointer with data blocks that it forwards to the block writer, which is modified to accept an optional user data pointer. Signed-off-by: David Oberhollenzer --- include/sqfs/block_writer.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include/sqfs/block_writer.h') diff --git a/include/sqfs/block_writer.h b/include/sqfs/block_writer.h index f8bc671..6352f4d 100644 --- a/include/sqfs/block_writer.h +++ b/include/sqfs/block_writer.h @@ -58,6 +58,9 @@ struct sqfs_block_writer_t { * @ref SQFS_BLK_LAST_BLOCK flag, the padding is added afterwards. * * @param wr A pointer to a block writer. + * @param user An optional user data pointer. + * The @ref sqfs_block_processor_t can be told to pass this + * on to the block writer for each block. * @param size The size of the block to write. * @param checksum A 32 bit checksum of the block data. * @param flags A combination of @ref SQFS_BLK_FLAGS flag bits @@ -70,9 +73,10 @@ struct sqfs_block_writer_t { * * @return Zero on success, an @ref SQFS_ERROR error on failure. */ - int (*write_data_block)(sqfs_block_writer_t *wr, sqfs_u32 size, - sqfs_u32 checksum, sqfs_u32 flags, - const sqfs_u8 *data, sqfs_u64 *location); + int (*write_data_block)(sqfs_block_writer_t *wr, void *user, + sqfs_u32 size, sqfs_u32 checksum, + sqfs_u32 flags, const sqfs_u8 *data, + sqfs_u64 *location); /** * @brief Get the number of blocks actually written to disk. -- cgit v1.2.3