diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-05 18:22:28 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-05 18:22:28 +0200 |
commit | f92cf3b98f51d355c92900f1d316b141b2b9d4fd (patch) | |
tree | 87d86e178288ef4c70831ac3b6ae977786fcab34 /lib/sqfs/block_processor.c | |
parent | f85394c5887350a9728e108e72d908e08fc4cb78 (diff) |
Cleanup: add SQFS_*/sqfs_* prefix to block processor
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/block_processor.c')
-rw-r--r-- | lib/sqfs/block_processor.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/lib/sqfs/block_processor.c b/lib/sqfs/block_processor.c index 3a6926c..2bf307f 100644 --- a/lib/sqfs/block_processor.c +++ b/lib/sqfs/block_processor.c @@ -13,25 +13,27 @@ #include <stdlib.h> #include <stdio.h> -struct block_processor_t { +struct sqfs_block_processor_t { size_t max_block_size; compressor_t *cmp; - block_cb cb; + sqfs_block_cb cb; void *user; int status; uint8_t scratch[]; }; -block_processor_t *block_processor_create(size_t max_block_size, - compressor_t *cmp, - unsigned int num_workers, - void *user, - block_cb callback) +sqfs_block_processor_t *sqfs_block_processor_create(size_t max_block_size, + compressor_t *cmp, + unsigned int num_workers, + void *user, + sqfs_block_cb callback) { - block_processor_t *proc = alloc_flex(sizeof(*proc), 1, max_block_size); + sqfs_block_processor_t *proc; (void)num_workers; + proc = alloc_flex(sizeof(*proc), 1, max_block_size); + if (proc == NULL) { perror("Creating block processor"); return NULL; @@ -44,15 +46,16 @@ block_processor_t *block_processor_create(size_t max_block_size, return proc; } -void block_processor_destroy(block_processor_t *proc) +void sqfs_block_processor_destroy(sqfs_block_processor_t *proc) { free(proc); } -int block_processor_enqueue(block_processor_t *proc, block_t *block) +int sqfs_block_processor_enqueue(sqfs_block_processor_t *proc, + sqfs_block_t *block) { - if (process_block(block, proc->cmp, - proc->scratch, proc->max_block_size)) + if (sqfs_block_process(block, proc->cmp, + proc->scratch, proc->max_block_size)) goto fail; if (proc->cb(proc->user, block)) @@ -66,7 +69,7 @@ fail: return -1; } -int block_processor_finish(block_processor_t *proc) +int sqfs_block_processor_finish(sqfs_block_processor_t *proc) { return proc->status; } |