# bzip2 and libbzip2

## a program and library for data compression

## copyright (C) 1996-2000 Julian Seward

## version 1.0 of 21 March 2000

This program, `bzip2`, and associated library `libbzip2`, are Copyright (C) 1996-2000 Julian R Seward. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
- The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Julian Seward, Cambridge, UK.

`jseward@acm.org`

`http://sourceware.cygnus.com/bzip2`

`http://www.cacheprof.org`

`http://www.muraroa.demon.co.uk`

`bzip2`/`libbzip2` version 1.0 of 21 March 2000.

PATENTS: To the best of my knowledge, `bzip2` does not use any patented algorithms. However, I do not have the resources available to carry out a full patent search. Therefore I cannot give any guarantee of the above statement.

- Introduction
- How to use `bzip2`
  - NAME
  - SYNOPSIS
  - DESCRIPTION
  - OPTIONS
  - MEMORY MANAGEMENT
  - RECOVERING DATA FROM DAMAGED FILES
  - PERFORMANCE NOTES
  - CAVEATS
  - AUTHOR
- Programming with `libbzip2`
  - Top-level structure
    - Low-level summary
    - High-level summary
    - Utility functions summary
  - Error handling
  - Low-level interface
    - `BZ2_bzCompressInit`
    - `BZ2_bzCompress`
    - `BZ2_bzCompressEnd`
    - `BZ2_bzDecompressInit`
    - `BZ2_bzDecompress`
    - `BZ2_bzDecompressEnd`
  - High-level interface
    - `BZ2_bzReadOpen`
    - `BZ2_bzRead`
    - `BZ2_bzReadGetUnused`
    - `BZ2_bzReadClose`
    - `BZ2_bzWriteOpen`
    - `BZ2_bzWrite`
    - `BZ2_bzWriteClose`
    - Handling embedded compressed data streams
    - Standard file-reading/writing code
  - Utility functions
    - `BZ2_bzBuffToBuffCompress`
    - `BZ2_bzBuffToBuffDecompress`
  - `zlib` compatibility functions
  - Using the library in a `stdio`-free environment
    - Getting rid of `stdio`
    - Critical error handling
  - Making a Windows DLL
- Miscellanea
  - Limitations of the compressed file format
  - Portability issues
  - Reporting bugs
  - Did you get the right package?
  - Testing
  - Further reading

This document was generated on 23 March 2000 using the texi2html translator version 1.51a.