Unit Zlib |
Classes |
Functions |
Trace - preset dictionary flag in zlib header
Tracec -
Tracecv -
Tracev -
Tracevv -
Tracevvv -
TRY_FREE -
ZALLOC -
zError - The application can compare zlibVersion and ZLIB_VERSION for consistency.
ZFREE -
zlibVersion -
Types |
alloc_func
check_func
free_func
huft_field
huft_ptr
inflate_blocks_state
inflate_block_mode
inflate_codes_mode
inflate_codes_state
inflate_huft
inflate_mode
internal_state
pInflate_blocks_state
pInflate_codes_state
pInflate_huft
pInternal_state
ppInflate_huft
z_stream
z_streamp
Constants |
DEF_MEM_LEVEL
DEF_WBITS
DYN_TREES
MAX_MATCH
MAX_MEM_LEVEL
MAX_WBITS
MIN_MATCH
PRESET_DICT
STATIC_TREES
STORED_BLOCK
ZLIB_VERSION
Z_ASCII
Z_BEST_COMPRESSION
Z_BEST_SPEED
Z_BINARY
Z_BUF_ERROR
Z_DATA_ERROR
Z_DEFAULT_COMPRESSION
Z_DEFAULT_STRATEGY
Z_DEFLATED
z_errbase
z_errmsg
Z_ERRNO
Z_FILTERED
Z_FINISH
Z_FULL_FLUSH
Z_HUFFMAN_ONLY
Z_MEM_ERROR
Z_NEED_DICT
Z_NO_COMPRESSION
Z_NO_FLUSH
Z_NULL
Z_OK
Z_PARTIAL_FLUSH
Z_STREAM_END
Z_STREAM_ERROR
Z_SYNC_FLUSH
Z_UNKNOWN
z_verbose
Z_VERSION_ERROR
Variables |
Functions |
Types |
alloc_func = function(opaque : voidpf; items : uInt; size : uInt) : voidpfcurrent inflate_blocks state
check_func = function(check : uLong; buf : pBytef; {const buf : array of byte;} len : uInt) : uLongdistance tree
free_func = procedure(opaque : voidpf; address : voidpf)
huft_field = Array[0..(MaxInt div SizeOf(inflate_huft))-1] of inflate_huft;literal, length base, or distance base } { or table offset
huft_ptr = ^huft_field
inflate_blocks_state = recordinflate blocks semi-private state
mode : inflate_block_mode;
last : boolean;
bitk : uInt;
bitb : uLong;
hufts : huft_ptr;
window : pBytef;
zend : pBytef;
pBytef : pBytef;
checkfn : check_func;
check : uLong;
end;
inflate_block_mode = (ZTYPE, { get type bits (3, including end bit) } LENS, { get lengths for stored } STORED, { processing stored block } TABLE, { get table lengths } BTREE, { get bit lengths tree for a dynamic block } DTREE, { get length, distance trees for a dynamic block } CODES, { processing fixed or dynamic block } DRY, { output remaining window bytes } BLKDONE, { finished last block, done } BLKBAD);const buf : array of byte;
inflate_codes_mode = ( { waiting for "i:"=input, "o:"=output, "x:"=nothing } START, { x: set up for LEN } LEN, { i: get length/literal/eob next } LENEXT, { i: getting length extra (have base) } DIST, { i: get distance next } DISTEXT, { i: getting distance extra } COPY, { o: copying bytes in window, waiting for space } LIT, { o: got literal, waiting for output space } WASH, { o: got eob, possibly still output waiting } ZEND, { x: got eob and all data flushed } BADCODE);
inflate_codes_state = record
mode : inflate_codes_mode;
len : uInt;
lbits : Byte;
dbits : Byte;
ltree : pInflate_huft;
dtree : pInflate_huft;
end;
inflate_huft = record
Exop : Byte;
bits : Byte;
base : uInt;
end;
inflate_mode = ( METHOD, { waiting for method byte } FLAG, { waiting for flag byte } DICT4, { four dictionary check bytes to go } DICT3, { three dictionary check bytes to go } DICT2, { two dictionary check bytes to go } DICT1, { one dictionary check byte to go } DICT0, { waiting for inflateSetDictionary } BLOCKS, { decompressing blocks } CHECK4, { four check bytes to go } CHECK3, { three check bytes to go } CHECK2, { two check bytes to go } CHECK1, { one check byte to go } DONE, { finished check, done } BAD);check on output
internal_state = recordor point to a deflate_state record
mode : inflate_mode;
nowrap : boolean;
wbits : uInt;
blocks : pInflate_blocks_state;
end;
pInflate_blocks_state = ^inflate_blocks_stategot a data error--stuck here
pInflate_codes_state = ^inflate_codes_statex: got error } { inflate codes private state
pInflate_huft = ^inflate_huftThe memory requirements for deflate are (in bytes): 1 shl (windowBits+2) + 1 shl (memLevel+9) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with DMAX_WBITS=14 DMAX_MEM_LEVEL=7 Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 shl windowBits that is, 32K for windowBits=15 (default value) plus a few kilobytes for small objects. } { Huffman code lookup table entry--this entry is four bytes for machines that have 16-bit pointers (e.g. PC's in the small or medium model).
pInternal_state = ^internal_stategot an error--stay here } { inflate private state
ppInflate_huft = ^pInflate_huft
z_stream = record
next_in : pBytef;
avail_in : uInt;
total_in : uLong;
next_out : pBytef;
avail_out : uInt;
total_out : uLong;
msg : string;
state : pInternal_state;
zalloc : alloc_func;
zfree : free_func;
opaque : voidpf;
data_type : int;
adler : uLong;
reserved : uLong;
end;
z_streamp = ^z_stream
Constants |
Variables |