The hu.dwim.zlib Reference Manual

Table of Contents

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

The hu.dwim.zlib Reference Manual

This is the hu.dwim.zlib Reference Manual, version 0.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:59:42 2018 GMT+0.


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

1 Introduction

hu.dwim.zlib

What

A Common Lisp FFI for zlib (a compression library for deflate and gzip written in C).

Why

This FFI binding uses CFFI/C2FFI to automatically generate the CFFI definitions, so it's a (mostly) complete interface.

zlib's gzip format can be used for compressing HTTP responses to browsers.

Who

Written by attila@lendvai.name.

Where

The primary communication channel is the facilities on the project's GitHub page.

Status

The raw FFI part is almost complete (modulo some va_list stuff). It works well enough to be used in a web server to compress responses.

It doesn't (yet?) have any lispy extras over the raw zlib interface, but it seems to be fine without it.

It has an autoamted test that compresses and decompresses random data in random zlib configurations, and it doesn't yield any errors for me when run for minutes (besides some zlib peculiarities that are not excercised by default).


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 hu.dwim.zlib

Author

Attila Lendvai

License

BSD or Bugroff

Description

Common Lisp FFI wrapper for zlib, aka http://zlib.net/

Version

0.1

Defsystem Dependency

cffi/c2ffi

Dependencies
Source

hu.dwim.zlib.asd (file)

Components

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

3 Modules

Modules are listed depth-first from the system components tree.


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

3.1 hu.dwim.zlib/source

Dependencies
Parent

hu.dwim.zlib (system)

Location

source/

Components

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

3.2 hu.dwim.zlib/c2ffi-spec

Dependency

package-stage-1.lisp (file)

Parent

hu.dwim.zlib (system)

Location

c2ffi-spec/

Component

zlib.h (file)


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

4 Files

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


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

4.1 Lisp


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

4.1.1 hu.dwim.zlib.asd

Location

hu.dwim.zlib.asd

Systems

hu.dwim.zlib (system)


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

4.1.2 hu.dwim.zlib/package-stage-1.lisp

Parent

hu.dwim.zlib (system)

Location

source/package-stage-1.lisp

Packages

hu.dwim.zlib


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

4.1.3 hu.dwim.zlib/source/package-stage-2.lisp

Parent

source (module)

Location

source/package-stage-2.lisp

Internal Definitions

import-all-owned-symbols (function)


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

4.1.4 hu.dwim.zlib/source/package-stage-3.lisp

Dependency

package-stage-2.lisp (file)

Parent

source (module)

Location

source/package-stage-3.lisp


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

4.1.5 hu.dwim.zlib/source/zlib.lisp

Dependency

package-stage-3.lisp (file)

Parent

source (module)

Location

source/zlib.lisp

Exported Definitions
Internal Definitions

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

4.1.6 hu.dwim.zlib/c2ffi-spec/zlib.h

Parent

c2ffi-spec (module)

Location

c2ffi-spec/zlib.h


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

5 Packages

Packages are listed by definition order.


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

5.1 hu.dwim.zlib

Source

package-stage-1.lisp (file)

Use List
Exported Definitions
Internal Definitions

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

6 Definitions

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


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

6.1 Exported definitions


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

6.1.1 Constants

Constant: +default-buffer-size+
Package

hu.dwim.zlib

Source

zlib.lisp (file)


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

6.1.2 Macros

Macro: c-fun/zlib FN-NAME &rest ARGS
Package

hu.dwim.zlib

Source

zlib.lisp (file)


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

6.1.3 Functions

Function: allocate-compress-buffer SOURCE &key START END
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: compress SOURCE DESTINATION &key SOURCE-START SOURCE-END DESTINATION-START LEVEL

A simpler API for the stream based DEFLATE.

Compress the first SOURCE-START bytes of SOURCE into DESTINATION. DESTINATION should be an array of (unsigned-byte 8), and should be large enough to hold the compressed contents. ALLOCATE-COMPRESS-BUFFER can be used to allocate a proper buffer.

Note that the size of the DESTINATION array should be at least 0.1% more than the souce plus 12 bytes, but the actual number of array elements filled in by the compression algorithm will usually be smaller (depending on how ’predictable’ the input data is).

Returns DESTINATION-END i.e. compressed length if DESTINATION-START was zero.

Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: deflate INPUT-FN OUTPUT-FN &key BUFFER-SIZE LEVEL METHOD WINDOW-BITS CONTAINER MEMORY-LEVEL STRATEGY

See DEFLATE-SEQUENCE for usage.

Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: deflate-sequence SOURCE &rest ARGS &key START END &allow-other-keys
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: free-deflate-z-stream STREAM
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: free-inflate-z-stream STREAM
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: inflate INPUT-FN OUTPUT-FN &key BUFFER-SIZE WINDOW-BITS CONTAINER
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: inflate-sequence COMPRESSED-BYTES &key START END BUFFER-SIZE WINDOW-BITS CONTAINER
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: make-deflate-z-stream &key LEVEL METHOD WINDOW-BITS CONTAINER MEMORY-LEVEL STRATEGY
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: make-inflate-z-stream &key WINDOW-BITS CONTAINER
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: uncompress SOURCE DESTINATION &key SOURCE-START SOURCE-END DESTINATION-START

A simpler API for the stream based INFLATE.

Pretty useless because DESTINATION must be long enough to hold the uncompressed contents, otherwise it errors out. Returns (values destination-end).

Package

hu.dwim.zlib

Source

zlib.lisp (file)


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

6.2 Internal definitions


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

6.2.1 Constants

Constant: +default-memory-level+
Package

hu.dwim.zlib

Source

zlib.lisp (file)


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

6.2.2 Macros

Macro: c-ref OBJECT TYPE SLOT
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Macro: stream-ref STREAM SLOT
Package

hu.dwim.zlib

Source

zlib.lisp (file)


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

6.2.3 Functions

Function: %c-fun/zlib/check-error RC FN-NAME WHOLE-FORM
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: %encode-container CONTAINER WINDOW-BITS
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: %inflate-or-deflate OPERATION MAKE-STREAM-FN FREE-STREAM-FN INPUT-FN OUTPUT-FN &key BUFFER-SIZE
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Function: import-all-owned-symbols SOURCE-PACKAGE TARGET-PACKAGE &key OVERWRITE
Package

hu.dwim.zlib

Source

package-stage-2.lisp (file)


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

6.2.4 Types

Type: container-kind ()
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Type: operation-kind ()
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Type: ub8-vector ()
Package

hu.dwim.zlib

Source

zlib.lisp (file)

Type: window-bits ()
Package

hu.dwim.zlib

Source

zlib.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   H   L   M  
Index Entry  Section

F
File, Lisp, hu.dwim.zlib.asd: The hu<dot>dwim<dot>zlib<dot>asd file
File, Lisp, hu.dwim.zlib/c2ffi-spec/zlib.h: The hu<dot>dwim<dot>zlib/c2ffi-spec/zlib<dot>h file
File, Lisp, hu.dwim.zlib/package-stage-1.lisp: The hu<dot>dwim<dot>zlib/package-stage-1<dot>lisp file
File, Lisp, hu.dwim.zlib/source/package-stage-2.lisp: The hu<dot>dwim<dot>zlib/source/package-stage-2<dot>lisp file
File, Lisp, hu.dwim.zlib/source/package-stage-3.lisp: The hu<dot>dwim<dot>zlib/source/package-stage-3<dot>lisp file
File, Lisp, hu.dwim.zlib/source/zlib.lisp: The hu<dot>dwim<dot>zlib/source/zlib<dot>lisp file

H
hu.dwim.zlib.asd: The hu<dot>dwim<dot>zlib<dot>asd file
hu.dwim.zlib/c2ffi-spec: The hu<dot>dwim<dot>zlib/c2ffi-spec module
hu.dwim.zlib/c2ffi-spec/zlib.h: The hu<dot>dwim<dot>zlib/c2ffi-spec/zlib<dot>h file
hu.dwim.zlib/package-stage-1.lisp: The hu<dot>dwim<dot>zlib/package-stage-1<dot>lisp file
hu.dwim.zlib/source: The hu<dot>dwim<dot>zlib/source module
hu.dwim.zlib/source/package-stage-2.lisp: The hu<dot>dwim<dot>zlib/source/package-stage-2<dot>lisp file
hu.dwim.zlib/source/package-stage-3.lisp: The hu<dot>dwim<dot>zlib/source/package-stage-3<dot>lisp file
hu.dwim.zlib/source/zlib.lisp: The hu<dot>dwim<dot>zlib/source/zlib<dot>lisp file

L
Lisp File, hu.dwim.zlib.asd: The hu<dot>dwim<dot>zlib<dot>asd file
Lisp File, hu.dwim.zlib/c2ffi-spec/zlib.h: The hu<dot>dwim<dot>zlib/c2ffi-spec/zlib<dot>h file
Lisp File, hu.dwim.zlib/package-stage-1.lisp: The hu<dot>dwim<dot>zlib/package-stage-1<dot>lisp file
Lisp File, hu.dwim.zlib/source/package-stage-2.lisp: The hu<dot>dwim<dot>zlib/source/package-stage-2<dot>lisp file
Lisp File, hu.dwim.zlib/source/package-stage-3.lisp: The hu<dot>dwim<dot>zlib/source/package-stage-3<dot>lisp file
Lisp File, hu.dwim.zlib/source/zlib.lisp: The hu<dot>dwim<dot>zlib/source/zlib<dot>lisp file

M
Module, hu.dwim.zlib/c2ffi-spec: The hu<dot>dwim<dot>zlib/c2ffi-spec module
Module, hu.dwim.zlib/source: The hu<dot>dwim<dot>zlib/source module

Jump to:   F   H   L   M  

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

A.2 Functions

Jump to:   %  
A   C   D   F   I   M   S   U  
Index Entry  Section

%
%c-fun/zlib/check-error: Internal functions
%encode-container: Internal functions
%inflate-or-deflate: Internal functions

A
allocate-compress-buffer: Exported functions

C
c-fun/zlib: Exported macros
c-ref: Internal macros
compress: Exported functions

D
deflate: Exported functions
deflate-sequence: Exported functions

F
free-deflate-z-stream: Exported functions
free-inflate-z-stream: Exported functions
Function, %c-fun/zlib/check-error: Internal functions
Function, %encode-container: Internal functions
Function, %inflate-or-deflate: Internal functions
Function, allocate-compress-buffer: Exported functions
Function, compress: Exported functions
Function, deflate: Exported functions
Function, deflate-sequence: Exported functions
Function, free-deflate-z-stream: Exported functions
Function, free-inflate-z-stream: Exported functions
Function, import-all-owned-symbols: Internal functions
Function, inflate: Exported functions
Function, inflate-sequence: Exported functions
Function, make-deflate-z-stream: Exported functions
Function, make-inflate-z-stream: Exported functions
Function, uncompress: Exported functions

I
import-all-owned-symbols: Internal functions
inflate: Exported functions
inflate-sequence: Exported functions

M
Macro, c-fun/zlib: Exported macros
Macro, c-ref: Internal macros
Macro, stream-ref: Internal macros
make-deflate-z-stream: Exported functions
make-inflate-z-stream: Exported functions

S
stream-ref: Internal macros

U
uncompress: Exported functions

Jump to:   %  
A   C   D   F   I   M   S   U  

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

A.3 Variables

Jump to:   +  
C  
Index Entry  Section

+
+default-buffer-size+: Exported constants
+default-memory-level+: Internal constants

C
Constant, +default-buffer-size+: Exported constants
Constant, +default-memory-level+: Internal constants

Jump to:   +  
C  

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

A.4 Data types

Jump to:   C   H   O   P   S   T   U   W  
Index Entry  Section

C
container-kind: Internal types

H
hu.dwim.zlib: The hu<dot>dwim<dot>zlib system
hu.dwim.zlib: The hu<dot>dwim<dot>zlib package

O
operation-kind: Internal types

P
Package, hu.dwim.zlib: The hu<dot>dwim<dot>zlib package

S
System, hu.dwim.zlib: The hu<dot>dwim<dot>zlib system

T
Type, container-kind: Internal types
Type, operation-kind: Internal types
Type, ub8-vector: Internal types
Type, window-bits: Internal types

U
ub8-vector: Internal types

W
window-bits: Internal types

Jump to:   C   H   O   P   S   T   U   W