5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonZLIB DATA COMPRESSION LIBRARY
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonzlib 1.2.8 is a general purpose data compression library. All the code is
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonthread safe. The data format used by the zlib library is described by RFCs
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson(Request for Comments) 1950 to 1952 in the files
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonhttp://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonrfc1952 (gzip format).
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonAll functions of the compression library are documented in the file zlib.h
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonof the library is given in the file test/example.c which also tests that
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonthe library is working correctly. Another example is given in the file
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssontest/minigzip.c. The compression library itself is composed of all source
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonfiles in the root directory.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonTo compile all files and run the test program, follow the instructions given at
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonthe top of Makefile.in. In short "./configure; make test", and if that goes
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonwell, "make install" should work for most flavors of Unix. For Windows, use
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonone of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonmake_vms.com.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonQuestions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson<info@winimage.com> for the Windows DLL version. The zlib home page is
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonhttp://zlib.net/ . Before reporting a problem, please check this site to
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonverify that you have the latest version of zlib; otherwise get the latest
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonversion and check whether the problem still exists or not.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonPLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonMark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonissue of Dr. Dobb's Journal; a copy of the article is available at
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonhttp://marknelson.us/1997/01/01/zlib-engine/ .
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonThe changes made in version 1.2.8 are documented in the file ChangeLog.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonUnsupported third party contributions are provided in directory contrib/ .
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonzlib is available in Java using the java.util.zip package, documented at
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonhttp://java.sun.com/developer/technicalArticles/Programming/compression/ .
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonA Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonat CPAN (Comprehensive Perl Archive Network) sites, including
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonhttp://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonA Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonavailable in Python 1.5 and later versions, see
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonhttp://docs.python.org/library/zlib.html .
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonzlib is built into tcl: http://wiki.tcl.tk/4610 .
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonAn experimental package to read and write files in .zip format, written on top
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonof zlib by Gilles Vollant <info@winimage.com>, is available in the
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssoncontrib/minizip directory of zlib.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonNotes for some targets:
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson- For Windows DLL versions, please see win32/DLL_FAQ.txt
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson- For 64-bit Irix, deflate.c must be compiled without any optimization. With
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson -O, one libpng test fails. The test works in 32 bit mode (with the -n32
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson compiler flag). The compiler bug has been reported to SGI.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson when compiled with cc.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson necessary to get gzprintf working correctly. This is done by configure.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson other compilers. Use "make test" to check your compiler.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson- gzdopen is not supported on RISCOS or BEOS.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson- For PalmOs, see http://palmzlib.sourceforge.net/
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonAcknowledgments:
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson The deflate format used by zlib was defined by Phil Katz. The deflate and
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson zlib specifications were written by L. Peter Deutsch. Thanks to all the
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson people who reported problems and suggested various improvements in zlib; they
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson are too numerous to cite here.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonCopyright notice:
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson (C) 1995-2013 Jean-loup Gailly and Mark Adler
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson This software is provided 'as-is', without any express or implied
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson warranty. In no event will the authors be held liable for any damages
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson arising from the use of this software.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson Permission is granted to anyone to use this software for any purpose,
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson including commercial applications, and to alter it and redistribute it
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson freely, subject to the following restrictions:
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson 1. The origin of this software must not be misrepresented; you must not
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson claim that you wrote the original software. If you use this software
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson in a product, an acknowledgment in the product documentation would be
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson appreciated but is not required.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson 2. Altered source versions must be plainly marked as such, and must not be
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson misrepresented as being the original software.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson 3. This notice may not be removed or altered from any source distribution.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson Jean-loup Gailly Mark Adler
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson jloup@gzip.org madler@alumni.caltech.edu
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonIf you use the zlib library in a product, we would appreciate *not* receiving
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonlengthy legal documents to sign. The sources are provided for free but without
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonwarranty of any kind. The library has been entirely written by Jean-loup
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonGailly and Mark Adler; it does not include third-party code.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas GustafssonIf you redistribute modified sources, we would appreciate that you include in
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonthe file ChangeLog history information documenting your changes. Please read
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonthe FAQ for more information on the distribution of modified source versions.
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson