mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-11 13:04:03 +08:00
9fec9f8ea5
Currently deflate and inflate both use a common state struct. There are several variables in this struct that we don't need for inflate, and more may be coming in the future. Therefore split them in two separate structs. Apart from that, introduce separate headers for dfltcc_deflate and dfltcc_inflate. This commit is based on: https://github.com/zlib-ng/zlib-ng/commit/c592b1b Link: https://lkml.kernel.org/r/20230126131428.1222214-7-zaslonko@linux.ibm.com Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
22 lines
535 B
C
22 lines
535 B
C
// SPDX-License-Identifier: Zlib
|
|
#ifndef DFLTCC_DEFLATE_H
|
|
#define DFLTCC_DEFLATE_H
|
|
|
|
#include "dfltcc.h"
|
|
|
|
/* External functions */
|
|
int dfltcc_can_deflate(z_streamp strm);
|
|
int dfltcc_deflate(z_streamp strm,
|
|
int flush,
|
|
block_state *result);
|
|
void dfltcc_reset_deflate_state(z_streamp strm);
|
|
|
|
#define DEFLATE_RESET_HOOK(strm) \
|
|
dfltcc_reset_deflate_state((strm))
|
|
|
|
#define DEFLATE_HOOK dfltcc_deflate
|
|
|
|
#define DEFLATE_NEED_CHECKSUM(strm) (!dfltcc_can_deflate((strm)))
|
|
|
|
#endif /* DFLTCC_DEFLATE_H */
|