diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-31 16:22:31 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-31 16:22:31 +0200 |
commit | 9b3d958fb7c37855a63ed75707281c61dc1d44c4 (patch) | |
tree | 053c117a09a7eb83b2d17dc582668979cf344102 /lib/comp/process_block.c | |
parent | f7801346c0913032e99105088b962a986edb24f4 (diff) |
Merge libcompress.a into libsquashfs.a
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/comp/process_block.c')
-rw-r--r-- | lib/comp/process_block.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/lib/comp/process_block.c b/lib/comp/process_block.c deleted file mode 100644 index 0fcbae0..0000000 --- a/lib/comp/process_block.c +++ /dev/null @@ -1,38 +0,0 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later */ -/* - * process_block.c - * - * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at> - */ -#include "config.h" - -#include "block_processor.h" -#include "util.h" - -#include <string.h> -#include <zlib.h> - -int process_block(block_t *block, compressor_t *cmp, - uint8_t *scratch, size_t scratch_size) -{ - ssize_t ret; - - if (!(block->flags & BLK_DONT_CHECKSUM)) - block->checksum = crc32(0, block->data, block->size); - - if (!(block->flags & BLK_DONT_COMPRESS)) { - ret = cmp->do_block(cmp, block->data, block->size, - scratch, scratch_size); - - if (ret < 0) - return -1; - - if (ret > 0) { - memcpy(block->data, scratch, ret); - block->size = ret; - block->flags |= BLK_IS_COMPRESSED; - } - } - - return 0; -} |