The zlib Reference Manual

This is the zlib Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 18:20:07 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 zlib

Source

zlib.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 zlib/zlib.asd

Source

zlib.asd.

Parent Component

zlib (system).

ASDF Systems

zlib.

Packages

zlib-system.


3.1.2 zlib/package.lisp

Source

zlib.asd.

Parent Component

zlib (system).

Packages

zlib.


3.1.3 zlib/zlib.lisp

Source

zlib.asd.

Parent Component

zlib (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 zlib

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

4.2 zlib-system

Source

zlib.asd.

Use List
  • asdf/interface.
  • common-lisp.

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: compress (buffer btype)

Compresses BUFFER using deflate algorithm of type BTYPE. Recognized types are :NO-COMPRESSION, :FIXED and :DYNAMIC.

Package

zlib.

Source

zlib.lisp.

Function: uncompress (buffer &key uncompressed-size output-buffer start end)

Uncompresses BUFFER. Returns a vector of bytes containing the uncompressed data, and the length of the uncompressed data.
UNCOMPRESSED-SIZE is a hint to set the result buffer size.
If UNCOMPRESSED-SIZE is not specified it is set as double of comressed BUFFER size.
If OUTPUT-BUFFER is specified, the result will be written to this buffer, and the UNCOMPRESSED-SIZE is ignored.
Otherwise (default) a new array will be created of size UNCOMPRESSED-SIZE START specifies the start position in the BUFFER (0 by default)
END specifies the end position in the BUFFER (length of BUFFER by default)

Package

zlib.

Source

zlib.lisp.


5.2 Internals


5.2.1 Constants

Constant: +adler-base+
Package

zlib.

Source

zlib.lisp.

Constant: +deflate-max-hash-table-contents-length+
Package

zlib.

Source

zlib.lisp.

Constant: +huffman-end-of-block-symbol+
Package

zlib.

Source

zlib.lisp.

Constant: +max-distance+
Package

zlib.

Source

zlib.lisp.

Constant: +max-length+
Package

zlib.

Source

zlib.lisp.

Constant: +max-non-compressed-block-size+
Package

zlib.

Source

zlib.lisp.

Constant: +min-distance+
Package

zlib.

Source

zlib.lisp.

Constant: +min-length+
Package

zlib.

Source

zlib.lisp.

Constant: +zlib-major-version+
Package

zlib.

Source

zlib.lisp.

Constant: +zlib-minor-version+
Package

zlib.

Source

zlib.lisp.


5.2.2 Special variables

Special Variable: *debug-level*
Package

zlib.

Source

zlib.lisp.

Special Variable: *debug-stream*
Package

zlib.

Source

zlib.lisp.

Special Variable: +distance-encoding+

Gives the relationship between a code, and extra bits and distance

Package

zlib.

Source

zlib.lisp.

Special Variable: +dynamic-huffman-code-lengths-order+
Package

zlib.

Source

zlib.lisp.

Special Variable: +fixed-huffman-code-bitlist+
Package

zlib.

Source

zlib.lisp.

Special Variable: +fixed-huffman-code-lengths+

The number of bits used to represent a code length

Package

zlib.

Source

zlib.lisp.

Special Variable: +fixed-huffman-codes+
Package

zlib.

Source

zlib.lisp.

Special Variable: +length-encoding+

Gives the relationship between a code, and extra bits and length

Package

zlib.

Source

zlib.lisp.


5.2.3 Macros

Macro: debug-format-1 (&body body)
Package

zlib.

Source

zlib.lisp.

Macro: debug-format-2 (&body body)
Package

zlib.

Source

zlib.lisp.

Macro: decision-tree (expression &rest clauses)

CLAUSES: Each clause is of the forms:
(less|:less . <body>) ; must be the first clause if present. (<real> . <body>)
DO: Evaluate the expression, which must be a real,
and generate a binary decision tree to select the <body> of the clause whose limit is <= the expression and
the next clause limit is > the expression.

Package

zlib.

Source

zlib.lisp.


5.2.4 Ordinary functions

Function: add-hash-value (hash-table hash-value index)

Remove oldest hash-value index from HASH-TABLE (if necessary) and push INDEX into HASH-TABLE

Package

zlib.

Source

zlib.lisp.

Function: adler-32 (buffer)

Compute Adler-32 checksum of BUFFER. Based on the sample code in appendix C of RFC 1950. update-adler-32 does all the work

Package

zlib.

Source

zlib.lisp.

Function: bit-list-from-value (value length)

Return a list with a bit representation of VALUE. The list has LENGTH elements

Package

zlib.

Source

zlib.lisp.

Reader: bit-stream-bytes (instance)
Writer: (setf bit-stream-bytes) (instance)
Package

zlib.

Source

zlib.lisp.

Target Slot

bytes.

Function: bit-stream-p (object)
Package

zlib.

Source

zlib.lisp.

Function: bit-stream-pad-to-byte-boundary (bit-stream)

If necessary, pads the current byte in BIT-STREAM with zeroes

Package

zlib.

Source

zlib.lisp.

Reader: bit-stream-position (instance)
Writer: (setf bit-stream-position) (instance)
Package

zlib.

Source

zlib.lisp.

Target Slot

position.

Function: bit-stream-read-bit (bit-stream)

Return the next bit from BIT-STREAM

Package

zlib.

Source

zlib.lisp.

Function: bit-stream-read-bits (bit-stream n)

Read N bits from BIT-STREAM

Package

zlib.

Source

zlib.lisp.

Function: bit-stream-read-byte (bit-stream)

Read the next byte (8 bits) from BIT-STREAM

Package

zlib.

Source

zlib.lisp.

Function: bit-stream-read-length-and-distance (bit-stream code &optional distance-huffman-tree)

Find the length and distance for CODE from BIT-STREAM and return them

Package

zlib.

Source

zlib.lisp.

Function: bit-stream-read-n-bytes (bit-stream n)

Read N bytes from BIT-STREAM

Package

zlib.

Source

zlib.lisp.

Function: bit-stream-read-reversed-bit (bit-stream)
Package

zlib.

Source

zlib.lisp.

Function: bit-stream-read-reversed-bits (bit-stream n)
Package

zlib.

Source

zlib.lisp.

Function: bit-stream-read-symbol (bit-stream huffman-tree)

Read bits from BIT-STREAM and find the corresponding symbol in HUFFMAN-TREE

Package

zlib.

Source

zlib.lisp.

Function: bit-stream-write-bit (bit-stream bit)

Write BIT to BIT-STREAM

Package

zlib.

Source

zlib.lisp.

Function: bit-stream-write-bits (bit-stream bit-list)

Write bits from BIT-LIST to BIT-STREAM

Package

zlib.

Source

zlib.lisp.

Function: bit-stream-write-bits2 (bit-stream bit-vector)
Package

zlib.

Source

zlib.lisp.

Function: bit-stream-write-byte (bit-stream byte)

Write BYTE to BIT-STREAM

Package

zlib.

Source

zlib.lisp.

Function: bit-vector-from-value (value length)
Package

zlib.

Source

zlib.lisp.

Function: copy-bit-stream (instance)
Package

zlib.

Source

zlib.lisp.

Function: decode-dynamic-huffman-block (bit-stream result)

Decode one block in BIT-STREAM with dynamic Huffman coding and store the result in RESULT

Package

zlib.

Source

zlib.lisp.

Function: decode-fixed-huffman-block (bit-stream result)

Decode one block in BIT-STREAM with fixed Huffman coding and store the result in RESULT.

Package

zlib.

Source

zlib.lisp.

Function: decode-non-compressed-block (bit-stream result)

Decode one non-compressed block in BIT-STREAM and store the result in RESULT

Package

zlib.

Source

zlib.lisp.

Function: distance-code (distance)

Return the distance-code for a given DISTANCE

Package

zlib.

Source

zlib.lisp.

Function: distance-code-bits (code)

Return a list with 5 elements that are the binary representation of CODE.

Package

zlib.

Source

zlib.lisp.

Function: distance-code-bits2 (code)
Package

zlib.

Source

zlib.lisp.

Function: encode-dynamic-huffman-block (bit-stream buffer)
Package

zlib.

Source

zlib.lisp.

Function: encode-fixed-huffman-block (bit-stream buffer hash-table start end)

Encode a DEFLATE block using the fixed Huffman code method

Package

zlib.

Source

zlib.lisp.

Function: encode-non-compressed-block (bit-stream buffer start end)

Encode a DEFLATE block using the non-compressing method

Package

zlib.

Source

zlib.lisp.

Function: extra-distance-bits (distance)

The number of extra distance bits that are needed for a given DISTANCE.

Package

zlib.

Source

zlib.lisp.

Function: extra-length-bits (length)

The number of extra length bits that are needed for a given DISTANCE.

Package

zlib.

Source

zlib.lisp.

Function: find-best-match (buffer match index)

Searches all elements in MATCH to find the one with the lowest position. INDEX is the index to the current position in BUFFER

Package

zlib.

Source

zlib.lisp.

Function: fixed-huffman-code (symbol)

Return the code for the given SYMBOL.

Package

zlib.

Source

zlib.lisp.

Function: fixed-huffman-code2 (symbol)
Package

zlib.

Source

zlib.lisp.

Function: huffman-insert-element (tree length code symbol)

Insert SYMBOL into TREE

Package

zlib.

Source

zlib.lisp.

Function: infix-to-tree (sequence)
Package

zlib.

Source

zlib.lisp.

Function: length-code (length)

Return the length-code for a given LENGTH

Package

zlib.

Source

zlib.lisp.

Function: make-bit-stream (&key bytes position)
Package

zlib.

Source

zlib.lisp.

Function: make-huffman-tree (huffman-code-lengths)

Create a Huffman tree from HUFFMAN-CODE-LENGTHS

Package

zlib.

Source

zlib.lisp.

Function: map-tree-postfix (fun tree)
Package

zlib.

Source

zlib.lisp.

Function: number-of-blocks (buffer btype)

Return the number of blocks that should be used to encode the BUFFER.

Package

zlib.

Source

zlib.lisp.

Function: read-32-bits-from-array (array &optional start)

Read a 32-bit word from ARRAY, MSB first starting from position START

Package

zlib.

Source

zlib.lisp.

Function: read-huffman-code-lengths (bit-stream huffman-tree items)
Package

zlib.

Source

zlib.lisp.

Function: update-adler-32 (adler buffer)
Package

zlib.

Source

zlib.lisp.


5.2.5 Structures

Structure: bit-stream
Package

zlib.

Source

zlib.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: bytes
Readers

bit-stream-bytes.

Writers

(setf bit-stream-bytes).

Slot: position
Package

common-lisp.

Type

fixnum

Initform

0

Readers

bit-stream-position.

Writers

(setf bit-stream-position).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   B   C   D   E   F   H   I   L   M   N   R   U  
Index Entry  Section

(
(setf bit-stream-bytes): Private ordinary functions
(setf bit-stream-position): Private ordinary functions

A
add-hash-value: Private ordinary functions
adler-32: Private ordinary functions

B
bit-list-from-value: Private ordinary functions
bit-stream-bytes: Private ordinary functions
bit-stream-p: Private ordinary functions
bit-stream-pad-to-byte-boundary: Private ordinary functions
bit-stream-position: Private ordinary functions
bit-stream-read-bit: Private ordinary functions
bit-stream-read-bits: Private ordinary functions
bit-stream-read-byte: Private ordinary functions
bit-stream-read-length-and-distance: Private ordinary functions
bit-stream-read-n-bytes: Private ordinary functions
bit-stream-read-reversed-bit: Private ordinary functions
bit-stream-read-reversed-bits: Private ordinary functions
bit-stream-read-symbol: Private ordinary functions
bit-stream-write-bit: Private ordinary functions
bit-stream-write-bits: Private ordinary functions
bit-stream-write-bits2: Private ordinary functions
bit-stream-write-byte: Private ordinary functions
bit-vector-from-value: Private ordinary functions

C
compress: Public ordinary functions
copy-bit-stream: Private ordinary functions

D
debug-format-1: Private macros
debug-format-2: Private macros
decision-tree: Private macros
decode-dynamic-huffman-block: Private ordinary functions
decode-fixed-huffman-block: Private ordinary functions
decode-non-compressed-block: Private ordinary functions
distance-code: Private ordinary functions
distance-code-bits: Private ordinary functions
distance-code-bits2: Private ordinary functions

E
encode-dynamic-huffman-block: Private ordinary functions
encode-fixed-huffman-block: Private ordinary functions
encode-non-compressed-block: Private ordinary functions
extra-distance-bits: Private ordinary functions
extra-length-bits: Private ordinary functions

F
find-best-match: Private ordinary functions
fixed-huffman-code: Private ordinary functions
fixed-huffman-code2: Private ordinary functions
Function, (setf bit-stream-bytes): Private ordinary functions
Function, (setf bit-stream-position): Private ordinary functions
Function, add-hash-value: Private ordinary functions
Function, adler-32: Private ordinary functions
Function, bit-list-from-value: Private ordinary functions
Function, bit-stream-bytes: Private ordinary functions
Function, bit-stream-p: Private ordinary functions
Function, bit-stream-pad-to-byte-boundary: Private ordinary functions
Function, bit-stream-position: Private ordinary functions
Function, bit-stream-read-bit: Private ordinary functions
Function, bit-stream-read-bits: Private ordinary functions
Function, bit-stream-read-byte: Private ordinary functions
Function, bit-stream-read-length-and-distance: Private ordinary functions
Function, bit-stream-read-n-bytes: Private ordinary functions
Function, bit-stream-read-reversed-bit: Private ordinary functions
Function, bit-stream-read-reversed-bits: Private ordinary functions
Function, bit-stream-read-symbol: Private ordinary functions
Function, bit-stream-write-bit: Private ordinary functions
Function, bit-stream-write-bits: Private ordinary functions
Function, bit-stream-write-bits2: Private ordinary functions
Function, bit-stream-write-byte: Private ordinary functions
Function, bit-vector-from-value: Private ordinary functions
Function, compress: Public ordinary functions
Function, copy-bit-stream: Private ordinary functions
Function, decode-dynamic-huffman-block: Private ordinary functions
Function, decode-fixed-huffman-block: Private ordinary functions
Function, decode-non-compressed-block: Private ordinary functions
Function, distance-code: Private ordinary functions
Function, distance-code-bits: Private ordinary functions
Function, distance-code-bits2: Private ordinary functions
Function, encode-dynamic-huffman-block: Private ordinary functions
Function, encode-fixed-huffman-block: Private ordinary functions
Function, encode-non-compressed-block: Private ordinary functions
Function, extra-distance-bits: Private ordinary functions
Function, extra-length-bits: Private ordinary functions
Function, find-best-match: Private ordinary functions
Function, fixed-huffman-code: Private ordinary functions
Function, fixed-huffman-code2: Private ordinary functions
Function, huffman-insert-element: Private ordinary functions
Function, infix-to-tree: Private ordinary functions
Function, length-code: Private ordinary functions
Function, make-bit-stream: Private ordinary functions
Function, make-huffman-tree: Private ordinary functions
Function, map-tree-postfix: Private ordinary functions
Function, number-of-blocks: Private ordinary functions
Function, read-32-bits-from-array: Private ordinary functions
Function, read-huffman-code-lengths: Private ordinary functions
Function, uncompress: Public ordinary functions
Function, update-adler-32: Private ordinary functions

H
huffman-insert-element: Private ordinary functions

I
infix-to-tree: Private ordinary functions

L
length-code: Private ordinary functions

M
Macro, debug-format-1: Private macros
Macro, debug-format-2: Private macros
Macro, decision-tree: Private macros
make-bit-stream: Private ordinary functions
make-huffman-tree: Private ordinary functions
map-tree-postfix: Private ordinary functions

N
number-of-blocks: Private ordinary functions

R
read-32-bits-from-array: Private ordinary functions
read-huffman-code-lengths: Private ordinary functions

U
uncompress: Public ordinary functions
update-adler-32: Private ordinary functions


A.3 Variables

Jump to:   *   +  
B   C   P   S  
Index Entry  Section

*
*debug-level*: Private special variables
*debug-stream*: Private special variables

+
+adler-base+: Private constants
+deflate-max-hash-table-contents-length+: Private constants
+distance-encoding+: Private special variables
+dynamic-huffman-code-lengths-order+: Private special variables
+fixed-huffman-code-bitlist+: Private special variables
+fixed-huffman-code-lengths+: Private special variables
+fixed-huffman-codes+: Private special variables
+huffman-end-of-block-symbol+: Private constants
+length-encoding+: Private special variables
+max-distance+: Private constants
+max-length+: Private constants
+max-non-compressed-block-size+: Private constants
+min-distance+: Private constants
+min-length+: Private constants
+zlib-major-version+: Private constants
+zlib-minor-version+: Private constants

B
bytes: Private structures

C
Constant, +adler-base+: Private constants
Constant, +deflate-max-hash-table-contents-length+: Private constants
Constant, +huffman-end-of-block-symbol+: Private constants
Constant, +max-distance+: Private constants
Constant, +max-length+: Private constants
Constant, +max-non-compressed-block-size+: Private constants
Constant, +min-distance+: Private constants
Constant, +min-length+: Private constants
Constant, +zlib-major-version+: Private constants
Constant, +zlib-minor-version+: Private constants

P
position: Private structures

S
Slot, bytes: Private structures
Slot, position: Private structures
Special Variable, *debug-level*: Private special variables
Special Variable, *debug-stream*: Private special variables
Special Variable, +distance-encoding+: Private special variables
Special Variable, +dynamic-huffman-code-lengths-order+: Private special variables
Special Variable, +fixed-huffman-code-bitlist+: Private special variables
Special Variable, +fixed-huffman-code-lengths+: Private special variables
Special Variable, +fixed-huffman-codes+: Private special variables
Special Variable, +length-encoding+: Private special variables