Rizin
unix-like reverse engineering framework and cli tools
|
#include "deflate.h"
Go to the source code of this file.
Classes | |
struct | config_s |
Macros | |
#define | NIL 0 |
#define | TOO_FAR 4096 |
#define | RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0)) |
#define | UPDATE_HASH(s, h, c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask) |
#define | INSERT_STRING(s, str, match_head) |
#define | CLEAR_HASH(s) |
#define | HCRC_UPDATE(beg) |
#define | check_match(s, start, match, length) |
#define | FLUSH_BLOCK_ONLY(s, last) |
#define | FLUSH_BLOCK(s, last) |
#define | MAX_STORED 65535 |
#define | MIN(a, b) ((a) > (b) ? (b) : (a)) |
Typedefs | |
typedef block_state compress_func | OF((deflate_state *s, int flush)) |
typedef struct config_s | config |
Enumerations | |
enum | block_state { need_more , block_done , finish_started , finish_done } |
Variables | |
const char | deflate_copyright [] |
const config | configuration_table [10] |
#define CLEAR_HASH | ( | s | ) |
#define FLUSH_BLOCK_ONLY | ( | s, | |
last | |||
) |
#define HCRC_UPDATE | ( | beg | ) |
enum block_state |
Definition at line 804 of file deflate.c.
References _tr_align(), _tr_stored_block(), adler32(), lzma_stream::avail_in, lzma_stream::avail_out, block_done, BUSY_STATE, CLEAR_HASH, COMMENT_STATE, configuration_table, crc32(), deflate_huff(), deflate_rle(), deflate_stored(), deflateStateCheck(), ERR_RETURN, EXTRA_STATE, finish_done, finish_started, FINISH_STATE, flush_pending(), config_s::func, GZIP_STATE, HCRC_STATE, HCRC_UPDATE, header, INIT_STATE, L, NAME_STATE, need_more, lzma_stream::next_in, lzma_stream::next_out, OS_CODE, PRESET_DICT, put_byte, putShortMSB(), RANK, s, strm, lzma_stream::total_in, val, while(), Z_BLOCK, Z_BUF_ERROR, Z_DEFLATED, Z_FINISH, Z_FULL_FLUSH, Z_HUFFMAN_ONLY, Z_NO_FLUSH, Z_NULL, Z_OK, Z_PARTIAL_FLUSH, Z_RLE, Z_STREAM_END, Z_STREAM_ERROR, and zmemcpy().
Referenced by compress2(), def(), deflateParams(), gz_comp(), gztack(), log_compress(), main(), partcompress(), process(), recompress(), rz_core_flirt_convert_file(), rz_core_flirt_create_file(), zipCloseFileInZipRaw64(), and zipWriteInFileInZip().
block_state deflate_fast | ( | deflate_state * | s, |
int | flush | ||
) |
Definition at line 1872 of file deflate.c.
References _tr_tally_dist, _tr_tally_lit, block_done, check_match, fill_window(), finish_done, FLUSH_BLOCK, INSERT_STRING, longest_match(), MAX_DIST, MIN_LOOKAHEAD, MIN_MATCH, need_more, NIL, s, times, Tracevv, UPDATE_HASH, Z_FINISH, and Z_NO_FLUSH.
block_state deflate_huff | ( | deflate_state * | s, |
int | flush | ||
) |
Definition at line 2178 of file deflate.c.
References _tr_tally_lit, block_done, fill_window(), finish_done, FLUSH_BLOCK, need_more, s, Tracevv, Z_FINISH, and Z_NO_FLUSH.
Referenced by deflate().
block_state deflate_rle | ( | deflate_state * | s, |
int | flush | ||
) |
Definition at line 2105 of file deflate.c.
References _tr_tally_dist, _tr_tally_lit, Assert, block_done, check_match, fill_window(), finish_done, FLUSH_BLOCK, MAX_MATCH, MIN_MATCH, need_more, internal_state::prev, s, Tracevv, Z_FINISH, and Z_NO_FLUSH.
Referenced by deflate().
block_state deflate_slow | ( | deflate_state * | s, |
int | flush | ||
) |
Definition at line 1974 of file deflate.c.
References _tr_tally_dist, _tr_tally_lit, Assert, block_done, check_match, fill_window(), finish_done, FLUSH_BLOCK, FLUSH_BLOCK_ONLY, INSERT_STRING, longest_match(), MAX_DIST, MIN_LOOKAHEAD, MIN_MATCH, need_more, NIL, s, TOO_FAR, Tracevv, Z_FILTERED, Z_FINISH, and Z_NO_FLUSH.
block_state deflate_stored | ( | deflate_state * | s, |
int | flush | ||
) |
Definition at line 1685 of file deflate.c.
References _tr_stored_block(), block_done, finish_done, finish_started, flush_pending(), if(), L, len, MAX_STORED, MIN, need_more, read_buf(), s, Z_FINISH, Z_NO_FLUSH, and zmemcpy().
Referenced by deflate().
Definition at line 693 of file deflate.c.
References deflateStateCheck(), s, cmd_descs_generate::str, strm, and Z_NULL.
Definition at line 1145 of file deflate.c.
References internal_state::bl_desc, internal_state::bl_tree, internal_state::d_desc, deflateEnd(), deflateStateCheck(), dest, internal_state::dyn_dtree, internal_state::dyn_ltree, tree_desc_s::dyn_tree, FAR, internal_state::hash_size, internal_state::head, internal_state::l_desc, internal_state::lit_bufsize, internal_state::pending_buf, internal_state::pending_buf_size, internal_state::pending_out, internal_state::prev, source, internal_state::strm, internal_state::sym_buf, internal_state::w_size, internal_state::window, Z_MEM_ERROR, Z_NULL, Z_OK, Z_STREAM_ERROR, ZALLOC, and zmemcpy().
Definition at line 1119 of file deflate.c.
References BUSY_STATE, deflateStateCheck(), status, strm, TRY_FREE, Z_DATA_ERROR, Z_NULL, Z_OK, Z_STREAM_ERROR, and ZFREE.
Referenced by compress2(), def(), deflateCopy(), deflateInit2_(), end(), gzclose_w(), gztack(), log_compress(), main(), and zipCloseFileInZipRaw64().
Definition at line 485 of file deflate.c.
References deflateStateCheck(), len, s, strm, Z_NULL, Z_OK, Z_STREAM_ERROR, and zmemcpy().
int ZEXPORT deflateInit2_ | ( | z_streamp | strm, |
int | level, | ||
int | method, | ||
int | windowBits, | ||
int | memLevel, | ||
int | strategy, | ||
const char * | version, | ||
int | stream_size | ||
) |
Definition at line 243 of file deflate.c.
References deflateEnd(), deflateReset(), ERR_MSG, FAR, FINISH_STATE, if(), INIT_STATE, level, MAX_MEM_LEVEL, internal_state::method, MIN_MATCH, s, internal_state::strategy, strm, internal_state::wrap, Z_DEFAULT_COMPRESSION, Z_DEFLATED, Z_FIXED, Z_MEM_ERROR, Z_NULL, Z_STREAM_ERROR, Z_VERSION_ERROR, ZALLOC, zcalloc(), zcfree(), and ZLIB_VERSION.
Referenced by deflateInit_().
Definition at line 231 of file deflate.c.
References DEF_MEM_LEVEL, deflateInit2_(), level, MAX_WBITS, strm, Z_DEFAULT_STRATEGY, and Z_DEFLATED.
Definition at line 609 of file deflate.c.
References lzma_stream::avail_in, CLEAR_HASH, configuration_table, deflate(), deflateStateCheck(), err, config_s::func, config_s::good_length, level, config_s::max_chain, config_s::max_lazy, config_s::nice_length, s, slide_hash(), internal_state::strategy, strm, Z_BLOCK, Z_BUF_ERROR, Z_DEFAULT_COMPRESSION, Z_FIXED, Z_OK, and Z_STREAM_ERROR.
Referenced by gzsetparams().
Definition at line 568 of file deflate.c.
References bits(), deflateStateCheck(), internal_state::pending, strm, Z_NULL, Z_OK, and Z_STREAM_ERROR.
Definition at line 582 of file deflate.c.
References _tr_flush_bits(), bits(), Buf_size, deflateStateCheck(), s, strm, value, Z_BUF_ERROR, Z_OK, and Z_STREAM_ERROR.
Referenced by gzscan(), and log_compress().
Definition at line 545 of file deflate.c.
References deflateResetKeep(), lm_init(), strm, and Z_OK.
Referenced by deflateInit2_(), gz_comp(), and main().
Definition at line 507 of file deflate.c.
References _tr_init(), adler32(), crc32(), deflateStateCheck(), GZIP_STATE, if(), INIT_STATE, L, s, strm, lzma_stream::total_in, lzma_stream::total_out, Z_NULL, Z_OK, Z_STREAM_ERROR, and Z_UNKNOWN.
Referenced by deflateReset().
Definition at line 416 of file deflate.c.
References adler32(), lzma_stream::avail_in, CLEAR_HASH, deflateStateCheck(), fill_window(), INIT_STATE, L, long, MIN_MATCH, n, lzma_stream::next_in, s, cmd_descs_generate::str, strm, UPDATE_HASH, internal_state::wrap, z_const, Z_NULL, Z_OK, and Z_STREAM_ERROR.
Referenced by gzscan(), and log_compress().
int ZEXPORT deflateSetHeader | ( | z_streamp | strm, |
gz_headerp | head | ||
) |
Definition at line 557 of file deflate.c.
References deflateStateCheck(), test-lz4-versions::head, strm, Z_OK, and Z_STREAM_ERROR.
Definition at line 393 of file deflate.c.
References BUSY_STATE, COMMENT_STATE, EXTRA_STATE, FINISH_STATE, GZIP, GZIP_STATE, HCRC_STATE, INIT_STATE, NAME_STATE, s, strm, and Z_NULL.
Referenced by deflate(), deflateBound(), deflateCopy(), deflateEnd(), deflateGetDictionary(), deflateParams(), deflatePending(), deflatePrime(), deflateResetKeep(), deflateSetDictionary(), deflateSetHeader(), and deflateTune().
int ZEXPORT deflateTune | ( | z_streamp | strm, |
int | good_length, | ||
int | max_lazy, | ||
int | nice_length, | ||
int | max_chain | ||
) |
Definition at line 658 of file deflate.c.
References deflateStateCheck(), s, strm, Z_OK, and Z_STREAM_ERROR.
void fill_window | ( | deflate_state * | s | ) |
Definition at line 1522 of file deflate.c.
References Assert, if(), init, long, MAX_DIST, MIN_LOOKAHEAD, MIN_MATCH, n, read_buf(), s, slide_hash(), cmd_descs_generate::str, times, unsigned, UPDATE_HASH, WIN_INIT, zmemcpy(), and zmemzero().
Referenced by deflate_fast(), deflate_huff(), deflate_rle(), deflate_slow(), and deflateSetDictionary().
void flush_pending | ( | z_streamp | strm | ) |
Definition at line 771 of file deflate.c.
References _tr_flush_bits(), lzma_stream::avail_out, len, lzma_stream::next_out, s, strm, lzma_stream::total_out, and zmemcpy().
Referenced by deflate(), and deflate_stored().
void lm_init | ( | deflate_state * | s | ) |
Definition at line 1234 of file deflate.c.
References CLEAR_HASH, configuration_table, config_s::good_length, L, config_s::max_chain, config_s::max_lazy, MIN_MATCH, config_s::nice_length, and s.
Referenced by deflateReset().
uInt longest_match | ( | deflate_state * | s, |
IPos | cur_match | ||
) |
Definition at line 1276 of file deflate.c.
References Assert, int, len, limit, match, MAX_DIST, MAX_MATCH, MIN_LOOKAHEAD, internal_state::nice_match, NIL, internal_state::prev, s, and internal_state::strstart.
Referenced by deflate_fast(), and deflate_slow().
void slide_hash OF | ( | (deflate_state *s) | ) |
uInt longest_match OF | ( | (deflate_state *s, IPos cur_match) | ) |
void putShortMSB OF | ( | (deflate_state *s, uInt b) | ) |
int deflateStateCheck OF | ( | (z_streamp strm) | ) |
void putShortMSB | ( | deflate_state * | s, |
uInt | b | ||
) |
Definition at line 1204 of file deflate.c.
References adler32(), lzma_stream::avail_in, crc32(), len, lzma_stream::next_in, strm, lzma_stream::total_in, and zmemcpy().
Referenced by deflate_stored(), and fill_window().
void slide_hash | ( | deflate_state * | s | ) |
Definition at line 204 of file deflate.c.
References regress::m, n, NIL, p, and s.
Referenced by deflateParams(), and fill_window().
Definition at line 134 of file deflate.c.
Referenced by deflate(), deflateParams(), and lm_init().