((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/zlib" "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 "zlib" (toc) (section 3 "Description" (p "zlib bindings for Chicken Scheme") (p "zlib is a popular data compression library that uses the DEFLATE algorithm internally. It is defined in " (link "http://tools.ietf.org/html/rfc1950" "RFC 1950") ".") (p "Note: if you are using a CHICKEN version < 4.8.3 and experiencing unexpected behavior with this egg, check " (link "http://bugs.call-cc.org/ticket/1033" "ticket #1033") ".")) (section 3 "Author" (p "Joseph Gay")) (section 3 "Requirements" (p (int-link "foreigners")) (p (int-link "miscmacros"))) (section 3 "Documentation" (section 4 "Procedures" (p "These bindings provide two procedures:") (def (sig (procedure "(open-zlib-compressed-input-port [INPUT-PORT])" (id open-zlib-compressed-input-port))) (p "Returns an input-port.")) (def (sig (procedure "(open-zlib-compressed-output-port [OUTPUT-PORT])" (id open-zlib-compressed-output-port))) (p "Returns an output-port.") (p "The first is for inflating an existing zlib stream and the second for deflating data into a new stream."))) (section 4 "Examples" (section 5 "Inflating a stream:" (highlight scheme "  (with-input-from-port (open-zlib-compressed-input-port)\n    read-string)")) (section 5 "Deflating a stream:" (highlight scheme "  (with-output-to-port (open-zlib-compressed-output-port)\n    (lambda ()\n      (write-string (read-string))\n      (close-output-port (current-output-port))))  ")))) (section 3 "Notes" (ul (li "This is expecting the zlib format, not raw DEFLATE or the gzip format, which are defined in RFCs 1951 and 1952 respectively. See " (int-link "z3") " for DEFLATE and gzip support. ") (li "When finished deflating, it is important to always close the zlib output-port. This will ensure that the zlib trailing data is written along with any data still buffered. The destination port will remain open after the zlib port is closed."))) (section 3 "Source" (p "Source code is available in the eggs repository as well as on github: " (link "https://github.com/joseph-gay/cscm-zlib"))) (section 3 "Version" (dl (dt "0.5.1") (dd "added missing dependency to miscmacros") (dt "0.5") (dd "Initial release"))) (section 3 "License" (pre " Copyright (C) 2011 by Joseph Gay\n\n This program is free software; you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation; either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA\n\n zlib: Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler\n see http://zlib.net/zlib_license.html"))))