((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/lzma" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg")) (section 2 "lzma" (section 3 "Introduction" (p "The lzma egg provides a simple wrapper around the C library lzmalib, which in turn provides access to the excellent " (link "http://en.wikipedia.org/wiki/LZMA" "Lempel-Ziv-Markov chain algorithm") ".") (p "Two functions are provided, which simply compress or decompress a buffer represented as a Chicken blob object.")) (section 3 "Examples" (highlight scheme "(use lzma)\n\n(blob->string (decompress (compress (string->blob \"Hello, World!\"))))\n => \"Hello, World!\"\n\n(blob-size (compress (string->blob \"Hello, World!\")))\n => 32\n\n(blob-size (compress (string->blob \"Hello, World! Hello, World! Hello, World!\")))\n => 36")) (section 3 "Library functions" (def (sig (procedure "(compress BLOB) => BLOB" (id compress))) (p "Given a blob, returns a blob that's hopefully smaller, and contains all the entropy of the original blob. Returns #f in the event of failure (typically, an out-of-memory condition).")) (def (sig (procedure "(decompress BLOB) => BLOB" (id decompress))) (p "Given a blob returned by " (tt "compress") ", returns the original blob. Returns #f in the event of failure (typically, an out-of-memory condition or an invalid input)."))) (section 3 "Authors" (p (int-link "alaric-blagrave-snellpym" "Alaric B. Snell-Pym"))) (section 3 "License" (pre " Copyright (c) 2003-2009, Warhead.org.uk Ltd\n All rights reserved.") (pre " Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:") (pre " Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.") (pre " Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.") (pre " Neither the names of Warhead.org.uk Ltd, Snell Systems, nor Kitten\n Technologies, nor the names of their contributors may be used to\n endorse or promote products derived from this software without\n specific prior written permission.") (pre " THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE.")) (section 3 "Requirements" (p "You'll need lzmalib installed. Source of this can be had from " (link "http://tokyocabinet.sourceforge.net/misc/lzmalib-0.0.1.tar.gz") ".")) (section 3 "Version History" (ul (li "1.1: Schoolboy errors fixed") (li "1.0: Initial release")))))