|
Geant4-11
|
#include "deflate.h"Go to the source code of this file.
Data Structures | |
| struct | config_s |
Macros | |
| #define | check_match(s, start, match, length) |
| #define | CLEAR_HASH(s) |
| #define | FLUSH_BLOCK(s, last) |
| #define | FLUSH_BLOCK_ONLY(s, last) |
| #define | HCRC_UPDATE(beg) |
| #define | INSERT_STRING(s, str, match_head) |
| #define | MAX_STORED 65535 |
| #define | MIN(a, b) ((a) > (b) ? (b) : (a)) |
| #define | NIL 0 |
| #define | RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0)) |
| #define | TOO_FAR 4096 |
| #define | UPDATE_HASH(s, h, c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask) |
Typedefs | |
| typedef struct config_s | config |
| typedef block_state compress_func | OF((deflate_state *s, int flush)) |
Enumerations | |
| enum | block_state { need_more , block_done , finish_started , finish_done } |
Functions | |
| int ZEXPORT | deflate (z_streamp strm, int flush) |
| block_state | deflate_fast (deflate_state *s, int flush) |
| block_state | deflate_huff (deflate_state *s, int flush) |
| block_state | deflate_rle (deflate_state *s, int flush) |
| block_state | deflate_slow (deflate_state *s, int flush) |
| block_state | deflate_stored (deflate_state *s, int flush) |
| uLong ZEXPORT | deflateBound (z_streamp strm, uLong sourceLen) |
| int ZEXPORT | deflateCopy (z_streamp dest, z_streamp source) |
| int ZEXPORT | deflateEnd (z_streamp strm) |
| int ZEXPORT | deflateGetDictionary (z_streamp strm, Bytef *dictionary, uInt *dictLength) |
| int ZEXPORT | deflateInit2_ (z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size) |
| int ZEXPORT | deflateInit_ (z_streamp strm, int level, const char *version, int stream_size) |
| int ZEXPORT | deflateParams (z_streamp strm, int level, int strategy) |
| int ZEXPORT | deflatePending (z_streamp strm, unsigned *pending, int *bits) |
| int ZEXPORT | deflatePrime (z_streamp strm, int bits, int value) |
| int ZEXPORT | deflateReset (z_streamp strm) |
| int ZEXPORT | deflateResetKeep (z_streamp strm) |
| int ZEXPORT | deflateSetDictionary (z_streamp strm, const Bytef *dictionary, uInt dictLength) |
| int ZEXPORT | deflateSetHeader (z_streamp strm, gz_headerp head) |
| int | deflateStateCheck (z_streamp strm) |
| int ZEXPORT | deflateTune (z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain) |
| void | fill_window (deflate_state *s) |
| void | flush_pending (z_streamp strm) |
| void | lm_init (deflate_state *s) |
| uInt | longest_match (deflate_state *s, IPos cur_match) |
| 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)) |
| unsigned read_buf | OF ((z_streamp strm, Bytef *buf, unsigned size)) |
| void | putShortMSB (deflate_state *s, uInt b) |
| unsigned | read_buf (z_streamp strm, Bytef *buf, unsigned size) |
| void | slide_hash (deflate_state *s) |
Variables | |
| const config | configuration_table [10] |
| const char | deflate_copyright [] |
| #define CLEAR_HASH | ( | s | ) |
| #define FLUSH_BLOCK_ONLY | ( | s, | |
| last | |||
| ) |
| #define HCRC_UPDATE | ( | beg | ) |
| #define INSERT_STRING | ( | s, | |
| str, | |||
| match_head | |||
| ) |
| typedef block_state compress_func OF((deflate_state *s, int flush)) |
| enum block_state |
| Enumerator | |
|---|---|
| need_more | |
| block_done | |
| finish_started | |
| finish_done | |
Definition at line 65 of file deflate.c.
| int ZEXPORT deflate | ( | z_streamp | strm, |
| int | flush | ||
| ) |
Definition at line 762 of file deflate.c.
References _tr_align(), _tr_stored_block(), adler32(), block_done, BUSY_STATE, CLEAR_HASH, COMMENT_STATE, configuration_table, field_utils::copy(), 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, INIT_STATE, L, NAME_STATE, need_more, OS_CODE, PRESET_DICT, put_byte, putShortMSB(), RANK, s, internal_state::strm, 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(), deflateParams(), and gz_comp().
| block_state deflate_fast | ( | deflate_state * | s, |
| int | flush | ||
| ) |
Definition at line 1823 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, Tracevv, UPDATE_HASH, Z_FINISH, and Z_NO_FLUSH.
| block_state deflate_huff | ( | deflate_state * | s, |
| int | flush | ||
| ) |
Definition at line 2129 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 2056 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, internal_state::window, Z_FINISH, and Z_NO_FLUSH.
Referenced by deflate().
| block_state deflate_slow | ( | deflate_state * | s, |
| int | flush | ||
| ) |
Definition at line 1925 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 1642 of file deflate.c.
References _tr_stored_block(), block_done, finish_done, finish_started, flush_pending(), L, MAX_STORED, MIN, need_more, read_buf(), s, Z_FINISH, Z_NO_FLUSH, and zmemcpy().
Referenced by deflate().
| uLong ZEXPORT deflateBound | ( | z_streamp | strm, |
| uLong | sourceLen | ||
| ) |
Definition at line 651 of file deflate.c.
References deflateStateCheck(), s, internal_state::strm, and Z_NULL.
Definition at line 1101 of file deflate.c.
References deflateEnd(), deflateStateCheck(), anonymous_namespace{G4QuasiElRatios.cc}::ds, internal_state::head, internal_state::pending_buf, internal_state::pending_out, internal_state::prev, internal_state::window, Z_MEM_ERROR, Z_NULL, Z_OK, Z_STREAM_ERROR, ZALLOC, and zmemcpy().
| int ZEXPORT deflateEnd | ( | z_streamp | strm | ) |
Definition at line 1075 of file deflate.c.
References BUSY_STATE, deflateStateCheck(), internal_state::status, internal_state::strm, TRY_FREE, Z_DATA_ERROR, Z_NULL, Z_OK, Z_STREAM_ERROR, and ZFREE.
Referenced by compress2(), deflateCopy(), deflateInit2_(), and gzclose_w().
| int ZEXPORT deflateGetDictionary | ( | z_streamp | strm, |
| Bytef * | dictionary, | ||
| uInt * | dictLength | ||
| ) |
Definition at line 444 of file deflate.c.
References deflateStateCheck(), s, internal_state::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 239 of file deflate.c.
References deflateEnd(), deflateReset(), ERR_MSG, FINISH_STATE, INIT_STATE, internal_state::level, internal_state::method, MIN_MATCH, s, internal_state::strategy, internal_state::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_().
| int ZEXPORT deflateInit_ | ( | z_streamp | strm, |
| int | level, | ||
| const char * | version, | ||
| int | stream_size | ||
| ) |
Definition at line 227 of file deflate.c.
References DEF_MEM_LEVEL, deflateInit2_(), Z_DEFAULT_STRATEGY, and Z_DEFLATED.
| int ZEXPORT deflateParams | ( | z_streamp | strm, |
| int | level, | ||
| int | strategy | ||
| ) |
Definition at line 567 of file deflate.c.
References CLEAR_HASH, configuration_table, deflate(), deflateStateCheck(), config_s::func, config_s::good_length, internal_state::level, config_s::max_chain, config_s::max_lazy, config_s::nice_length, s, slide_hash(), internal_state::strategy, internal_state::strm, Z_BLOCK, Z_BUF_ERROR, Z_DEFAULT_COMPRESSION, Z_FIXED, Z_OK, and Z_STREAM_ERROR.
Referenced by gzsetparams().
| int ZEXPORT deflatePending | ( | z_streamp | strm, |
| unsigned * | pending, | ||
| int * | bits | ||
| ) |
Definition at line 527 of file deflate.c.
References deflateStateCheck(), internal_state::pending, internal_state::strm, Z_NULL, Z_OK, and Z_STREAM_ERROR.
| int ZEXPORT deflatePrime | ( | z_streamp | strm, |
| int | bits, | ||
| int | value | ||
| ) |
Definition at line 541 of file deflate.c.
References _tr_flush_bits(), Buf_size, deflateStateCheck(), s, internal_state::strm, Z_BUF_ERROR, Z_OK, and Z_STREAM_ERROR.
| int ZEXPORT deflateReset | ( | z_streamp | strm | ) |
Definition at line 504 of file deflate.c.
References deflateResetKeep(), lm_init(), internal_state::strm, and Z_OK.
Referenced by deflateInit2_(), and gz_comp().
| int ZEXPORT deflateResetKeep | ( | z_streamp | strm | ) |
Definition at line 466 of file deflate.c.
References _tr_init(), adler32(), BUSY_STATE, crc32(), deflateStateCheck(), GZIP_STATE, INIT_STATE, L, s, internal_state::strm, Z_NO_FLUSH, Z_NULL, Z_OK, Z_STREAM_ERROR, and Z_UNKNOWN.
Referenced by deflateReset().
| int ZEXPORT deflateSetDictionary | ( | z_streamp | strm, |
| const Bytef * | dictionary, | ||
| uInt | dictLength | ||
| ) |
Definition at line 375 of file deflate.c.
References adler32(), CLEAR_HASH, deflateStateCheck(), fill_window(), INIT_STATE, L, MIN_MATCH, CLHEP::detail::n, s, internal_state::strm, UPDATE_HASH, internal_state::wrap, Z_NULL, Z_OK, and Z_STREAM_ERROR.
| int ZEXPORT deflateSetHeader | ( | z_streamp | strm, |
| gz_headerp | head | ||
| ) |
Definition at line 516 of file deflate.c.
References deflateStateCheck(), internal_state::head, internal_state::strm, Z_OK, and Z_STREAM_ERROR.
| int deflateStateCheck | ( | z_streamp | strm | ) |
Definition at line 352 of file deflate.c.
References BUSY_STATE, COMMENT_STATE, EXTRA_STATE, FINISH_STATE, GZIP, GZIP_STATE, HCRC_STATE, INIT_STATE, NAME_STATE, s, internal_state::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 616 of file deflate.c.
References deflateStateCheck(), s, internal_state::strm, Z_OK, and Z_STREAM_ERROR.
| void fill_window | ( | deflate_state * | s | ) |
Definition at line 1481 of file deflate.c.
References Assert, MAX_DIST, MIN_LOOKAHEAD, MIN_MATCH, CLHEP::detail::n, read_buf(), s, slide_hash(), 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 729 of file deflate.c.
References _tr_flush_bits(), s, internal_state::strm, and zmemcpy().
Referenced by deflate(), and deflate_stored().
| void lm_init | ( | deflate_state * | s | ) |
Definition at line 1193 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 1235 of file deflate.c.
References Assert, MAX_DIST, MAX_MATCH, MIN_LOOKAHEAD, internal_state::nice_match, NIL, internal_state::prev, s, internal_state::strstart, and internal_state::window.
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 | ||
| ) |
| unsigned read_buf | ( | z_streamp | strm, |
| Bytef * | buf, | ||
| unsigned | size | ||
| ) |
Definition at line 1163 of file deflate.c.
References adler32(), crc32(), internal_state::strm, and zmemcpy().
Referenced by deflate_stored(), and fill_window().
| void slide_hash | ( | deflate_state * | s | ) |
Definition at line 200 of file deflate.c.
References m, CLHEP::detail::n, NIL, and s.
Referenced by deflateParams(), and fill_window().
| const config configuration_table[10] |
Definition at line 133 of file deflate.c.
Referenced by deflate(), deflateParams(), and lm_init().