20#ifndef SFQS_BLOCK_PROCESSOR_H
21#define SFQS_BLOCK_PROCESSOR_H
219 unsigned int num_workers,
274 void *user, sqfs_u32 flags);
291 const void *data,
size_t size);
338 void *user, sqfs_u32 flags,
339 const void *data,
size_t size);
Includes forward declarations of data structures, macros and integer types.
Encapsulates a description for an sqfs_block_processor_t.
sqfs_frag_table_t * tbl
A fragment table to use for storing block locations.
sqfs_u32 size
Holds the size of the structure.
sqfs_u32 max_block_size
The maximum size of a data block.
sqfs_u32 num_workers
The number of worker threads to create.
sqfs_file_t * file
Pointer to a file to read back fragment blocks from.
sqfs_u32 max_backlog
The maximum number of blocks currently in flight.
sqfs_compressor_t * uncmp
A pointer to a compressor the decompresses data.
sqfs_block_writer_t * wr
A block writer to send to finished blocks to.
sqfs_compressor_t * cmp
A pointer to a compressor.
Used to store runtime statistics about the sqfs_block_processor_t.
sqfs_u64 data_block_count
Total number of data blocks produced.
sqfs_u64 sparse_block_count
Total number of sparse blocks encountered.
sqfs_u64 actual_frag_count
Total number of tail-end fragments actually stored in fragment blocks.
sqfs_u64 total_frag_count
Total number of tail-end fragments produced.
size_t size
Holds the size of the structure.
sqfs_u64 output_bytes_generated
Total number of bytes sent down to the block processor.
sqfs_u64 frag_block_count
Total number of fragment blocks produced.
sqfs_u64 input_bytes_read
Total number of bytes fed into the front end API.
Abstracts generating of file data and fragment blocks.
SQFS_API sqfs_block_processor_t * sqfs_block_processor_create(size_t max_block_size, sqfs_compressor_t *cmp, unsigned int num_workers, size_t max_backlog, sqfs_block_writer_t *wr, sqfs_frag_table_t *tbl)
Create a data block processor.
SQFS_API int sqfs_block_processor_end_file(sqfs_block_processor_t *proc)
Stop writing the current file and flush everything that is buffered internally.
SQFS_API int sqfs_block_processor_submit_block(sqfs_block_processor_t *proc, void *user, sqfs_u32 flags, const void *data, size_t size)
Submit a raw block for processing.
SQFS_API int sqfs_block_processor_append(sqfs_block_processor_t *proc, const void *data, size_t size)
Append data to the current file.
SQFS_API int sqfs_block_processor_create_ex(const sqfs_block_processor_desc_t *desc, sqfs_block_processor_t **out)
Create a data block processor.
SQFS_API int sqfs_block_processor_begin_file(sqfs_block_processor_t *proc, sqfs_inode_generic_t **inode, void *user, sqfs_u32 flags)
Start writing a file.
SQFS_API const sqfs_block_processor_stats_t * sqfs_block_processor_get_stats(const sqfs_block_processor_t *proc)
Get accumulated runtime statistics from a block processor.
SQFS_API int sqfs_block_processor_finish(sqfs_block_processor_t *proc)
Wait for the in-flight data blocks to finish and finally flush the current fragment block.
SQFS_API int sqfs_block_processor_sync(sqfs_block_processor_t *proc)
Wait for the in-flight data blocks to finish.
Abstracts writing and deduplicating of data and fragment blocks.
Encapsultes a compressor with a simple interface to compress or extract chunks of data.
Abstracts file I/O to make it easy to embedd SquashFS.
Abstracts reading, writing and management of the fragment table.
A generic inode structure that combines all others and provides additional information.