zlib

  1. zlib
    1. Description
    2. Author
    3. Requirements
    4. Documentation
      1. Procedures
      2. Examples
        1. Inflating a stream:
        2. Deflating a stream:
    5. Notes
    6. Source
    7. Version
    8. License

Description

zlib bindings for Chicken Scheme

zlib is a popular data compression library that uses the DEFLATE algorithm internally. It is defined in RFC 1950.

Note: if you are using a CHICKEN version < 4.8.3 and experiencing unexpected behavior with this egg, check ticket #1033.

Author

Ismay Gay

Requirements

foreigners

miscmacros

Documentation

Procedures

These bindings provide two procedures:

[procedure] (open-zlib-compressed-input-port [INPUT-PORT])

Returns an input-port.

[procedure] (open-zlib-compressed-output-port [OUTPUT-PORT])

Returns an output-port.

The first is for inflating an existing zlib stream and the second for deflating data into a new stream.

Examples

Inflating a stream:
  (with-input-from-port (open-zlib-compressed-input-port)
    read-string)
Deflating a stream:
  (with-output-to-port (open-zlib-compressed-output-port)
    (lambda ()
      (write-string (read-string))
      (close-output-port (current-output-port))))  

Notes

Source

Source code is available in the eggs repository as well as on github: https://github.com/r1b/zlib

Version

0.6.1
added missing test dependencies
0.6
Port to chicken 5
0.5.1
added missing dependency to miscmacros
0.5
Initial release

License

 Copyright (C) 2011 by Ismay Gay

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

 zlib: Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
 see http://zlib.net/zlib_license.html