The hu.dwim.zlib Reference Manual

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 4.0 beta 2 "William Riker" on Wed Jun 15 04:48:34 2022 GMT+0.

Table of Contents


1 Introduction

hu.dwim.zlib

What

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

Why

It uses CFFI/C2FFI to automatically generate the CFFI definitions, so it's a complete interface based on the C header files.

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 (except some va_list stuff).

No fancy lispy overlay API has been added; it seems to be convenient enough without it.

It's used in hu.dwim.web-server to compress HTTP responses.

It has a 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/bugs that are avoided by the test code).


2 Systems

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


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

2.1 hu.dwim.zlib

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

Author

Attila Lendvai

License

BSD or Bugroff

Version

0.1

Defsystem Dependency

cffi/c2ffi (system).

Dependencies
  • alexandria (system).
  • cffi (system).
  • cffi/c2ffi (system).
  • cffi-libffi (system).
Source

hu.dwim.zlib.asd.

Child Components

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
Source

hu.dwim.zlib.asd.

Parent Component

hu.dwim.zlib (system).

Child Components

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

3.2 hu.dwim.zlib/c2ffi-spec

Dependency

package-stage-1.lisp (file).

Source

hu.dwim.zlib.asd.

Parent Component

hu.dwim.zlib (system).

Child Component

zlib.h (file).


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


4.1.1 hu.dwim.zlib/hu.dwim.zlib.asd

Source

hu.dwim.zlib.asd.

Parent Component

hu.dwim.zlib (system).

ASDF Systems

hu.dwim.zlib.


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

Source

hu.dwim.zlib.asd.

Parent Component

hu.dwim.zlib (system).

Packages

hu.dwim.zlib.


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

Source

hu.dwim.zlib.asd.

Parent Component

source (module).

Internals

import-all-owned-symbols (function).


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

Dependency

package-stage-2.lisp (file).

Source

hu.dwim.zlib.asd.

Parent Component

source (module).


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

Dependency

package-stage-3.lisp (file).

Source

hu.dwim.zlib.asd.

Parent Component

source (module).

Public Interface
Internals

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

Source

hu.dwim.zlib.asd.

Parent Component

c2ffi-spec (module).


5 Packages

Packages are listed by definition order.


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

5.1 hu.dwim.zlib

Source

package-stage-1.lisp.

Use List
  • alexandria.
  • cffi.
  • common-lisp.
Public Interface
Internals

6 Definitions

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


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

6.1 Public Interface


Next: , Previous: , Up: Public Interface   [Contents][Index]

6.1.1 Constants

Constant: +default-buffer-size+
Package

hu.dwim.zlib.

Source

zlib.lisp.


6.1.2 Macros

Macro: c-fun/zlib (fn-name &rest args)
Package

hu.dwim.zlib.

Source

zlib.lisp.


Previous: , Up: Public Interface   [Contents][Index]

6.1.3 Ordinary functions

Function: allocate-compress-buffer (source &key start end)
Package

hu.dwim.zlib.

Source

zlib.lisp.

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.

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.

Function: deflate-sequence (source &rest args &key start end &allow-other-keys)
Package

hu.dwim.zlib.

Source

zlib.lisp.

Function: free-deflate-z-stream (stream)
Package

hu.dwim.zlib.

Source

zlib.lisp.

Function: free-inflate-z-stream (stream)
Package

hu.dwim.zlib.

Source

zlib.lisp.

Function: inflate (input-fn output-fn &key buffer-size window-bits container)
Package

hu.dwim.zlib.

Source

zlib.lisp.

Function: inflate-sequence (compressed-bytes &key start end buffer-size window-bits container)
Package

hu.dwim.zlib.

Source

zlib.lisp.

Function: make-deflate-z-stream (&key level method window-bits container memory-level strategy)
Package

hu.dwim.zlib.

Source

zlib.lisp.

Function: make-inflate-z-stream (&key window-bits container)
Package

hu.dwim.zlib.

Source

zlib.lisp.

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.


6.2 Internals


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

6.2.1 Constants

Constant: +default-memory-level+
Package

hu.dwim.zlib.

Source

zlib.lisp.


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

6.2.2 Macros

Macro: c-ref (object type slot)
Package

hu.dwim.zlib.

Source

zlib.lisp.

Macro: stream-ref (stream slot)
Package

hu.dwim.zlib.

Source

zlib.lisp.


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

6.2.3 Ordinary functions

Function: %c-fun/zlib/check-error (rc fn-name whole-form)
Package

hu.dwim.zlib.

Source

zlib.lisp.

Function: %encode-container (container window-bits)
Package

hu.dwim.zlib.

Source

zlib.lisp.

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.

Function: import-all-owned-symbols (source-package target-package &key overwrite)
Package

hu.dwim.zlib.

Source

package-stage-2.lisp.


6.2.4 Types

Type: container-kind ()
Package

hu.dwim.zlib.

Source

zlib.lisp.

Type: operation-kind ()
Package

hu.dwim.zlib.

Source

zlib.lisp.

Type: ub8-vector ()
Package

hu.dwim.zlib.

Source

zlib.lisp.

Type: window-bits ()
Package

hu.dwim.zlib.

Source

zlib.lisp.


Appendix A Indexes


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

A.1 Concepts


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: Private ordinary functions
%encode-container: Private ordinary functions
%inflate-or-deflate: Private ordinary functions

A
allocate-compress-buffer: Public ordinary functions

C
c-fun/zlib: Public macros
c-ref: Private macros
compress: Public ordinary functions

D
deflate: Public ordinary functions
deflate-sequence: Public ordinary functions

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

I
import-all-owned-symbols: Private ordinary functions
inflate: Public ordinary functions
inflate-sequence: Public ordinary functions

M
Macro, c-fun/zlib: Public macros
Macro, c-ref: Private macros
Macro, stream-ref: Private macros
make-deflate-z-stream: Public ordinary functions
make-inflate-z-stream: Public ordinary functions

S
stream-ref: Private macros

U
uncompress: Public ordinary functions

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

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

A.4 Data types

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

C
c2ffi-spec: The hu․dwim․zlib/c2ffi-spec module
container-kind: Private types

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

H
hu.dwim.zlib: The hu․dwim․zlib system
hu.dwim.zlib: The hu․dwim․zlib package
hu.dwim.zlib.asd: The hu․dwim․zlib/hu․dwim․zlib․asd file

M
Module, c2ffi-spec: The hu․dwim․zlib/c2ffi-spec module
Module, source: The hu․dwim․zlib/source module

O
operation-kind: Private types

P
Package, hu.dwim.zlib: The hu․dwim․zlib package
package-stage-1.lisp: The hu․dwim․zlib/package-stage-1․lisp file
package-stage-2.lisp: The hu․dwim․zlib/source/package-stage-2․lisp file
package-stage-3.lisp: The hu․dwim․zlib/source/package-stage-3․lisp file

S
source: The hu․dwim․zlib/source module
System, hu.dwim.zlib: The hu․dwim․zlib system

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

U
ub8-vector: Private types

W
window-bits: Private types

Z
zlib.h: The hu․dwim․zlib/c2ffi-spec/zlib․h file
zlib.lisp: The hu․dwim․zlib/source/zlib․lisp file

Jump to:   C   F   H   M   O   P   S   T   U   W   Z