|
fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
#include "deflate.h"
Go to the source code of this file.
Classes | |
| struct | config_s |
| struct | static_tree_desc_s |
Defines | |
| #define | NIL 0 |
| #define | TOO_FAR 4096 |
| #define | MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) |
| #define | EQUAL 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 | check_match(s, start, match, length) |
| #define | FLUSH_BLOCK_ONLY(s, eof) |
| #define | FLUSH_BLOCK(s, eof) |
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 } |
Functions | |
| local void fill_window | OF ((deflate_state *s)) |
| local block_state deflate_stored | OF ((deflate_state *s, int flush)) |
| local void putShortMSB | OF ((deflate_state *s, uInt b)) |
| local void flush_pending | OF ((z_streamp strm)) |
| local int read_buf | OF ((z_streamp strm, Bytef *buf, unsigned size)) |
| local uInt longest_match | OF ((deflate_state *s, IPos cur_match)) |
| int ZEXPORT | deflateInit_ (z_streamp strm, int level, const char *version, int stream_size) |
| int ZEXPORT | deflateInit2_ (z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size) |
| int ZEXPORT | deflateSetDictionary (z_streamp strm, const Bytef *dictionary, uInt dictLength) |
| int ZEXPORT | deflateReset (z_streamp strm) |
| int ZEXPORT | deflateSetHeader (z_streamp strm, gz_headerp head) |
| int ZEXPORT | deflatePrime (z_streamp strm, int bits, int value) |
| int ZEXPORT | deflateParams (z_streamp strm, int level, int strategy) |
| int ZEXPORT | deflateTune (z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain) |
| uLong ZEXPORT | deflateBound (z_streamp strm, uLong sourceLen) |
| local void | putShortMSB (deflate_state *s, uInt b) |
| local void | flush_pending (z_streamp strm) |
| int ZEXPORT | deflate (z_streamp strm, int flush) |
| int ZEXPORT | deflateEnd (z_streamp strm) |
| int ZEXPORT | deflateCopy (z_streamp dest, z_streamp source) |
| local int | read_buf (z_streamp strm, Bytef *buf, unsigned size) |
| local void | lm_init (deflate_state *s) |
| local uInt | longest_match (deflate_state *s, IPos cur_match) |
| local uInt | longest_match_fast (deflate_state *s, IPos cur_match) |
| local void | fill_window (deflate_state *s) |
| local block_state | deflate_stored (deflate_state *s, int flush) |
| local block_state | deflate_fast (deflate_state *s, int flush) |
| local block_state | deflate_slow (deflate_state *s, int flush) |
Variables | |
| const char | deflate_copyright [] = " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly " |
| local const config | configuration_table [10] |
Definition at line 1253 of file deflate.c.
Referenced by deflate_fast(), and deflate_slow().
| #define CLEAR_HASH | ( | s | ) |
| #define FLUSH_BLOCK | ( | s, | |
| eof | |||
| ) |
{ \
FLUSH_BLOCK_ONLY(s, eof); \
if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \
}
Definition at line 1376 of file deflate.c.
Referenced by deflate_fast(), deflate_slow(), and deflate_stored().
| #define FLUSH_BLOCK_ONLY | ( | s, | |
| eof | |||
| ) |
{ \
_tr_flush_block(s, (s->block_start >= 0L ? \
(charf *)&s->window[(unsigned)s->block_start] : \
(charf *)Z_NULL), \
(ulg)((long)s->strstart - s->block_start), \
(eof)); \
s->block_start = s->strstart; \
flush_pending(s->strm); \
Tracev((stderr,"[FLUSH]")); \
}
Definition at line 1364 of file deflate.c.
Referenced by deflate_slow().
| #define INSERT_STRING | ( | s, | |
| str, | |||
| match_head | |||
| ) |
(UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \ s->head[s->ins_h] = (Pos)(str))
Definition at line 189 of file deflate.c.
Referenced by deflate_fast(), deflate_slow(), and deflateSetDictionary().
| #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) |
Definition at line 113 of file deflate.c.
Referenced by deflate_fast(), deflate_slow(), fill_window(), longest_match(), and longest_match_fast().
| #define NIL 0 |
Definition at line 105 of file deflate.c.
Referenced by deflate_fast(), deflate_slow(), fill_window(), and longest_match().
| #define TOO_FAR 4096 |
Definition at line 109 of file deflate.c.
Referenced by deflate_slow().
Definition at line 170 of file deflate.c.
Referenced by deflate_fast(), deflateSetDictionary(), and fill_window().
| ZEXTERN const uLongf *ZEXPORT get_crc_table OF | ( | (deflate_state *s, int flush) | ) |
| enum block_state |
| int ZEXPORT deflate | ( | z_streamp | strm, |
| int | flush | ||
| ) |
Definition at line 552 of file deflate.c.
References _tr_align(), _tr_stored_block(), adler32(), Assert, block_done, BUSY_STATE, CLEAR_HASH, COMMENT_STATE, crc32(), ERR_RETURN, EXTRA_STATE, finish_done, finish_started, FINISH_STATE, flush_pending(), internal_state::gzhead, internal_state::gzindex, HCRC_STATE, INIT_STATE, internal_state::last_flush, internal_state::level, internal_state::lookahead, NAME_STATE, need_more, NULL, OS_CODE, internal_state::pending, internal_state::pending_buf, internal_state::pending_buf_size, PRESET_DICT, put_byte, putShortMSB(), internal_state::status, internal_state::strategy, internal_state::strm, internal_state::strstart, val, internal_state::w_bits, internal_state::wrap, Z_BUF_ERROR, Z_DEFLATED, Z_FINISH, Z_FULL_FLUSH, Z_HUFFMAN_ONLY, Z_NO_FLUSH, Z_NULL, Z_OK, Z_PARTIAL_FLUSH, Z_STREAM_END, and Z_STREAM_ERROR.
Referenced by compress2(), deflateParams(), do_flush(), gzwrite(), png_write_filtered_row(), png_write_finish_row(), and png_write_flush().
| local block_state deflate_fast | ( | deflate_state * | s, |
| int | flush | ||
| ) |
Definition at line 1448 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(), longest_match_fast(), MAX_DIST, MIN_LOOKAHEAD, MIN_MATCH, need_more, NIL, Tracevv, UPDATE_HASH, Z_FINISH, Z_HUFFMAN_ONLY, Z_NO_FLUSH, and Z_RLE.
| local block_state deflate_slow | ( | deflate_state * | s, |
| int | flush | ||
| ) |
Definition at line 1554 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(), longest_match_fast(), MAX_DIST, MIN_LOOKAHEAD, MIN_MATCH, need_more, NIL, TOO_FAR, Tracevv, Z_FILTERED, Z_FINISH, Z_HUFFMAN_ONLY, Z_NO_FLUSH, and Z_RLE.
| local block_state deflate_stored | ( | deflate_state * | s, |
| int | flush | ||
| ) |
Definition at line 1390 of file deflate.c.
References Assert, block_done, fill_window(), finish_done, FLUSH_BLOCK, MAX_DIST, need_more, internal_state::pending_buf_size, Z_FINISH, and Z_NO_FLUSH.
Definition at line 489 of file deflate.c.
References compressBound(), internal_state::hash_bits, internal_state::w_bits, and Z_NULL.
Definition at line 894 of file deflate.c.
References internal_state::bl_desc, internal_state::bl_tree, internal_state::d_buf, internal_state::d_desc, deflateEnd(), internal_state::dyn_dtree, internal_state::dyn_ltree, tree_desc_s::dyn_tree, internal_state::hash_size, internal_state::head, internal_state::l_buf, internal_state::l_desc, internal_state::lit_bufsize, internal_state::pending_buf, internal_state::pending_buf_size, internal_state::pending_out, internal_state::prev, internal_state::strm, internal_state::w_size, 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 859 of file deflate.c.
References BUSY_STATE, COMMENT_STATE, EXTRA_STATE, FINISH_STATE, HCRC_STATE, INIT_STATE, NAME_STATE, internal_state::status, TRY_FREE, Z_DATA_ERROR, Z_NULL, Z_OK, Z_STREAM_ERROR, and ZFREE.
Referenced by compress2(), deflateCopy(), deflateInit2_(), destroy(), and png_write_destroy().
| 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 216 of file deflate.c.
References internal_state::d_buf, deflateEnd(), deflateReset(), ERR_MSG, FINISH_STATE, internal_state::gzhead, internal_state::hash_bits, internal_state::hash_mask, internal_state::hash_shift, internal_state::hash_size, internal_state::head, internal_state::l_buf, level, internal_state::level, internal_state::lit_bufsize, MAX_MEM_LEVEL, internal_state::method, MIN_MATCH, internal_state::pending_buf, internal_state::pending_buf_size, internal_state::prev, internal_state::status, strategy, internal_state::strategy, internal_state::strm, internal_state::w_bits, internal_state::w_mask, internal_state::w_size, internal_state::window, 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 204 of file deflate.c.
References DEF_MEM_LEVEL, deflateInit2_(), MAX_WBITS, Z_DEFAULT_STRATEGY, and Z_DEFLATED.
| int ZEXPORT deflateParams | ( | z_streamp | strm, |
| int | level, | ||
| int | strategy | ||
| ) |
Definition at line 416 of file deflate.c.
References deflate(), func, internal_state::good_match, level, internal_state::level, internal_state::max_chain_length, internal_state::max_lazy_match, internal_state::nice_match, strategy, internal_state::strategy, Z_DEFAULT_COMPRESSION, Z_FIXED, Z_NULL, Z_OK, Z_PARTIAL_FLUSH, and Z_STREAM_ERROR.
Referenced by gzsetparams().
| int ZEXPORT deflatePrime | ( | z_streamp | strm, |
| int | bits, | ||
| int | value | ||
| ) |
Definition at line 404 of file deflate.c.
References Z_NULL, Z_OK, and Z_STREAM_ERROR.
| int ZEXPORT deflateReset | ( | z_streamp | strm | ) |
Definition at line 357 of file deflate.c.
References _tr_init(), adler32(), BUSY_STATE, crc32(), INIT_STATE, internal_state::last_flush, lm_init(), internal_state::pending, internal_state::pending_buf, internal_state::pending_out, internal_state::status, internal_state::wrap, Z_NO_FLUSH, Z_NULL, Z_OK, Z_STREAM_ERROR, and Z_UNKNOWN.
Referenced by deflateInit2_(), and png_write_finish_row().
Definition at line 315 of file deflate.c.
References adler32(), internal_state::block_start, INIT_STATE, internal_state::ins_h, INSERT_STRING, length, MAX_DIST, MIN_MATCH, internal_state::strstart, UPDATE_HASH, internal_state::window, internal_state::wrap, Z_NULL, Z_OK, Z_STREAM_ERROR, and zmemcpy().
| int ZEXPORT deflateSetHeader | ( | z_streamp | strm, |
| gz_headerp | head | ||
| ) |
Definition at line 393 of file deflate.c.
References internal_state::head, Z_NULL, Z_OK, and Z_STREAM_ERROR.
| int ZEXPORT deflateTune | ( | z_streamp | strm, |
| int | good_length, | ||
| int | max_lazy, | ||
| int | nice_length, | ||
| int | max_chain | ||
| ) |
Definition at line 454 of file deflate.c.
References internal_state::good_match, internal_state::max_chain_length, internal_state::max_lazy_match, internal_state::nice_match, Z_NULL, Z_OK, and Z_STREAM_ERROR.
| local void fill_window | ( | deflate_state * | s | ) |
Definition at line 1266 of file deflate.c.
References Assert, m, MAX_DIST, MIN_LOOKAHEAD, MIN_MATCH, NIL, read_buf(), UPDATE_HASH, and zmemcpy().
Referenced by deflate_fast(), deflate_slow(), and deflate_stored().
| local void flush_pending | ( | z_streamp | strm | ) |
| local void lm_init | ( | deflate_state * | s | ) |
Definition at line 986 of file deflate.c.
References CLEAR_HASH, MIN_MATCH, and internal_state::window_size.
Referenced by deflateReset().
| local uInt longest_match | ( | deflate_state * | s, |
| IPos | cur_match | ||
| ) |
Definition at line 1027 of file deflate.c.
References Assert, int, internal_state::max_chain_length, MAX_DIST, MAX_MATCH, MIN_LOOKAHEAD, internal_state::nice_match, NIL, internal_state::prev, internal_state::strstart, and internal_state::window.
Referenced by deflate_fast(), and deflate_slow().
| local uInt longest_match_fast | ( | deflate_state * | s, |
| IPos | cur_match | ||
| ) |
Definition at line 1175 of file deflate.c.
References Assert, int, MAX_MATCH, MIN_LOOKAHEAD, MIN_MATCH, internal_state::strstart, and internal_state::window.
Referenced by deflate_fast(), and deflate_slow().
| local void fill_window OF | ( | (deflate_state *s) | ) |
| local block_state deflate_stored OF | ( | (deflate_state *s, int flush) | ) |
| local void putShortMSB OF | ( | (deflate_state *s, uInt b) | ) |
| local uInt longest_match OF | ( | (deflate_state *s, IPos cur_match) | ) |
| local void flush_pending OF | ( | (z_streamp strm) | ) |
| local void putShortMSB | ( | deflate_state * | s, |
| uInt | b | ||
| ) |
| local const config configuration_table[10] |
{
{0, 0, 0, 0, deflate_stored},
{4, 4, 8, 4, deflate_fast},
{4, 5, 16, 8, deflate_fast},
{4, 6, 32, 32, deflate_fast},
{4, 4, 16, 16, deflate_slow},
{8, 16, 32, 32, deflate_slow},
{8, 16, 128, 128, deflate_slow},
{8, 32, 128, 256, deflate_slow},
{32, 128, 258, 1024, deflate_slow},
{32, 258, 258, 4096, deflate_slow}}
| const char deflate_copyright[] = " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly " |