aboutsummaryrefslogtreecommitdiff
path: root/include/sqfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-02-11 15:02:24 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-02-12 00:19:05 +0100
commit3c18216e23eb74af23672d0687692d785647223d (patch)
tree2661f9b091a98efc999e10dce48737a58491222b /include/sqfs
parent8f316f670e4e1e3b0bff0cb599fbfa47ed73f3bc (diff)
Clenaup: remove useage of sqfs_block_t from block writer
The sqfs_block_t structure has been written for the block processor and exposes way too many internals. This commit removes its usage from the block writer, cutting it down to the bare essentials, so the structure can be removed from the public API later on. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/sqfs')
-rw-r--r--include/sqfs/block_writer.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/include/sqfs/block_writer.h b/include/sqfs/block_writer.h
index 4ac0762..e921141 100644
--- a/include/sqfs/block_writer.h
+++ b/include/sqfs/block_writer.h
@@ -69,15 +69,19 @@ struct sqfs_block_hooks_t {
* disk. If the block has the @ref SQFS_BLK_ALIGN flag set, the
* function is called before padding the file.
*
- * The function may modify the block itself or write data to the file.
- * which is taken into account when padding the file.
+ * The function may write additional data to the file, which is taken
+ * into account when padding the file.
*
* @param user A user pointer.
- * @param block The block that is about to be written.
+ * @param flags A pointer to a combination of @ref E_SQFS_BLK_FLAGS
+ * describing the block. The callback can modify the
+ * user settable flags.
+ * @param size The size of the block in bytes.
+ * @param data A pointer to the raw block data.
* @param file The file that the block will be written to.
*/
- void (*pre_block_write)(void *user, sqfs_block_t *block,
- sqfs_file_t *file);
+ void (*pre_block_write)(void *user, sqfs_u32 *flags, sqfs_u32 size,
+ const sqfs_u8 *data, sqfs_file_t *file);
/**
* @brief Gets called after writing a block to disk.
@@ -91,11 +95,14 @@ struct sqfs_block_hooks_t {
* the file.
*
* @param user A user pointer.
- * @param block The block that is about to be written.
+ * @param flags A combination of @ref E_SQFS_BLK_FLAGS describing
+ * the block.
+ * @param size The size of the block in bytes.
+ * @param data A pointer to the raw block data.
* @param file The file that the block was written to.
*/
- void (*post_block_write)(void *user, const sqfs_block_t *block,
- sqfs_file_t *file);
+ void (*post_block_write)(void *user, sqfs_u32 flags, sqfs_u32 size,
+ const sqfs_u8 *data, sqfs_file_t *file);
/**
* @brief Gets called before writing a block of padding bytes to disk.
@@ -216,7 +223,8 @@ SQFS_API void sqfs_block_writer_destroy(sqfs_block_writer_t *wr);
* @return Zero on success, an @ref E_SQFS_ERROR error on failure.
*/
SQFS_API int sqfs_block_writer_write(sqfs_block_writer_t *wr,
- sqfs_block_t *block,
+ sqfs_u32 size, sqfs_u32 checksum,
+ sqfs_u32 flags, const sqfs_u8 *data,
sqfs_u64 *location);
/**