The snappy Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The snappy Reference Manual

This is the snappy Reference Manual, version 0.3, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Apr 28 12:59:13 2020 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Snappy

A Common Lisp implementation of Google's Snappy data compression library. The original name for Google's Snappy compression library was Zippy.

The Snappy API

compress                     Compress a vector.
maximum-compressed-length    The maximum size of data after compression.
uncompress                   Uncompress a vector.
uncompressed-length          Size of compressed data after decompression.

For more information, see the documentation strings in snappy.lisp, the example code in snappy-test.lisp, and Google's GitHub Snappy page.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 snappy

Author

Robert Brown <robert.brown@gmail.com>

License

New BSD license. See the copyright messages in individual files.

Description

An implementation of Snappy compression.

Long Description

An implementation of Google’s Snappy compression algorithm, which is designed for speed of compression and decompression.

Version

0.3

Defsystem Dependency

com.google.base

Dependencies
Source

snappy.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 snappy.asd

Location

snappy.asd

Systems

snappy (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 snappy/package.lisp

Parent

snappy (system)

Location

package.lisp

Packages

snappy


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 snappy/snappy.lisp

Dependency

package.lisp (file)

Parent

snappy (system)

Location

snappy.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 snappy

An implementation of Google’s Snappy compression algorithm, which is designed for speed of compression and decompression.

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: compress BUFFER INDEX LIMIT

Compresses the contents of BUFFER, a vector of (UNSIGNED-BYTE 8), from position INDEX to position LIMIT. Returns two values, a vector of
type (UNSIGNED-BYTE 8) holding the compressed data and an integer indicating the number of compressed octets in the vector.

Package

snappy

Source

snappy.lisp (file)

Function: maximum-compressed-length UNCOMPRESSED-LENGTH

Returns the maximum size a vector of length UNCOMPRESSED-LENGTH may take up after it is compressed.

Package

snappy

Source

snappy.lisp (file)

Function: uncompress BUFFER INDEX LIMIT

Uncompresses BUFFER, a vector of (UNSIGNED-BYTE 8), from position INDEX to LIMIT. Returns the uncompressed data as a vector of (UNSIGNED-BYTE 8).

Package

snappy

Source

snappy.lisp (file)

Function: uncompressed-length BUFFER INDEX LIMIT

Returns the uncompressed length of the compressed data stored in BUFFER from position INDEX to LIMIT.

Package

snappy

Source

snappy.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Constants

Constant: +copy-1-byte-offset+
Package

snappy

Source

snappy.lisp (file)

Constant: +copy-2-byte-offset+
Package

snappy

Source

snappy.lisp (file)

Constant: +copy-4-byte-offset+
Package

snappy

Source

snappy.lisp (file)

Constant: +decompression-table+

Data stored per entry in lookup table:
Range Bits-used Description ————————————
1..64 0..7 Literal/copy length encoded in opcode byte 0..7 8..10 Copy offset encoded in opcode byte / 256 0..4 11..13 Extra bytes after opcode

We use eight bits for the length even though 7 would have sufficed because of efficiency reasons:
(1) Extracting a byte is faster than a bit field
(2) It properly aligns copy offset so we do not need a <<8

Package

snappy

Source

snappy.lisp (file)

Constant: +literal+
Package

snappy

Source

snappy.lisp (file)

Constant: +maximum-hash-bits+
Package

snappy

Source

snappy.lisp (file)

Constant: +maximum-hash-table-size+
Package

snappy

Source

snappy.lisp (file)

Constant: +vector-index-bits+
Package

snappy

Source

snappy.lisp (file)

Constant: +word-mask+

Mapping from i in range [0,4] to a mask to extract the bottom 8*i bits.

Package

snappy

Source

snappy.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Macros

Macro: postincf VARIABLE
Package

snappy

Source

snappy.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Functions

Function: emit-copy OUTPUT-BUFFER OUT OFFSET LENGTH
Package

snappy

Source

snappy.lisp (file)

Function: emit-copy-less-than-64 OUTPUT-BUFFER OUT OFFSET LENGTH
Package

snappy

Source

snappy.lisp (file)

Function: emit-literal INPUT-BUFFER LITERAL OUTPUT-BUFFER OUT LENGTH
Package

snappy

Source

snappy.lisp (file)

Function: hash BUFFER INDEX MASK
Package

snappy

Source

snappy.lisp (file)

Function: raw-compress INPUT-BUFFER IN IN-LIMIT OUTPUT-BUFFER OUT OUT-LIMIT
Package

snappy

Source

snappy.lisp (file)

Function: raw-uncompress INPUT-BUFFER IN IN-LIMIT OUTPUT-BUFFER OUT OUT-LIMIT
Package

snappy

Source

snappy.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Types

Type: decompression-entry ()
Package

snappy

Source

snappy.lisp (file)

Type: hash-result ()
Package

snappy

Source

snappy.lisp (file)

Type: table-size ()
Package

snappy

Source

snappy.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   S  
Index Entry  Section

F
File, Lisp, snappy.asd: The snappy․asd file
File, Lisp, snappy/package.lisp: The snappy/package․lisp file
File, Lisp, snappy/snappy.lisp: The snappy/snappy․lisp file

L
Lisp File, snappy.asd: The snappy․asd file
Lisp File, snappy/package.lisp: The snappy/package․lisp file
Lisp File, snappy/snappy.lisp: The snappy/snappy․lisp file

S
snappy.asd: The snappy․asd file
snappy/package.lisp: The snappy/package․lisp file
snappy/snappy.lisp: The snappy/snappy․lisp file

Jump to:   F   L   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   E   F   H   M   P   R   U  
Index Entry  Section

C
compress: Exported functions

E
emit-copy: Internal functions
emit-copy-less-than-64: Internal functions
emit-literal: Internal functions

F
Function, compress: Exported functions
Function, emit-copy: Internal functions
Function, emit-copy-less-than-64: Internal functions
Function, emit-literal: Internal functions
Function, hash: Internal functions
Function, maximum-compressed-length: Exported functions
Function, raw-compress: Internal functions
Function, raw-uncompress: Internal functions
Function, uncompress: Exported functions
Function, uncompressed-length: Exported functions

H
hash: Internal functions

M
Macro, postincf: Internal macros
maximum-compressed-length: Exported functions

P
postincf: Internal macros

R
raw-compress: Internal functions
raw-uncompress: Internal functions

U
uncompress: Exported functions
uncompressed-length: Exported functions

Jump to:   C   E   F   H   M   P   R   U  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   +  
C  
Index Entry  Section

+
+copy-1-byte-offset+: Internal constants
+copy-2-byte-offset+: Internal constants
+copy-4-byte-offset+: Internal constants
+decompression-table+: Internal constants
+literal+: Internal constants
+maximum-hash-bits+: Internal constants
+maximum-hash-table-size+: Internal constants
+vector-index-bits+: Internal constants
+word-mask+: Internal constants

C
Constant, +copy-1-byte-offset+: Internal constants
Constant, +copy-2-byte-offset+: Internal constants
Constant, +copy-4-byte-offset+: Internal constants
Constant, +decompression-table+: Internal constants
Constant, +literal+: Internal constants
Constant, +maximum-hash-bits+: Internal constants
Constant, +maximum-hash-table-size+: Internal constants
Constant, +vector-index-bits+: Internal constants
Constant, +word-mask+: Internal constants

Jump to:   +  
C  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   D   H   P   S   T  
Index Entry  Section

D
decompression-entry: Internal types

H
hash-result: Internal types

P
Package, snappy: The snappy package

S
snappy: The snappy system
snappy: The snappy package
System, snappy: The snappy system

T
table-size: Internal types
Type, decompression-entry: Internal types
Type, hash-result: Internal types
Type, table-size: Internal types

Jump to:   D   H   P   S   T