2 * THIS FILE IS NOT IDENTICAL TO THE ORIGINAL
3 * FROM THE BZIP2 DISTRIBUTION.
5 * It has been modified, mainly to break the library
9 * rsc@plan9.bell-labs.com
14 /*-------------------------------------------------------------*/
15 /*--- Public header file for the library. ---*/
17 /*-------------------------------------------------------------*/
20 This file is a part of bzip2 and/or libbzip2, a program and
21 library for lossless, block-sorting data compression.
23 Copyright (C) 1996-2000 Julian R Seward. All rights reserved.
25 Redistribution and use in source and binary forms, with or without
26 modification, are permitted provided that the following conditions
29 1. Redistributions of source code must retain the above copyright
30 notice, this list of conditions and the following disclaimer.
32 2. The origin of this software must not be misrepresented; you must
33 not claim that you wrote the original software. If you use this
34 software in a product, an acknowledgment in the product
35 documentation would be appreciated but is not required.
37 3. Altered source versions must be plainly marked as such, and must
38 not be misrepresented as being the original software.
40 4. The name of the author may not be used to endorse or promote
41 products derived from this software without specific prior written
44 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
45 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
46 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
47 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
48 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
50 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
51 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
52 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
53 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
54 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56 Julian Seward, Cambridge, UK.
58 bzip2/libbzip2 version 1.0 of 21 March 2000
60 This program is based on (at least) the work of:
70 For more information on these sources, see the manual.
87 #define BZ_FINISH_OK 3
88 #define BZ_STREAM_END 4
89 #define BZ_SEQUENCE_ERROR (-1)
90 #define BZ_PARAM_ERROR (-2)
91 #define BZ_MEM_ERROR (-3)
92 #define BZ_DATA_ERROR (-4)
93 #define BZ_DATA_ERROR_MAGIC (-5)
94 #define BZ_IO_ERROR (-6)
95 #define BZ_UNEXPECTED_EOF (-7)
96 #define BZ_OUTBUFF_FULL (-8)
97 #define BZ_CONFIG_ERROR (-9)
102 unsigned int avail_in;
103 unsigned int total_in_lo32;
104 unsigned int total_in_hi32;
107 unsigned int avail_out;
108 unsigned int total_out_lo32;
109 unsigned int total_out_hi32;
113 void *(*bzalloc)(void *,int,int);
114 void (*bzfree)(void *,void *);
126 # include <windows.h>
128 /* windows.h define small to char */
132 # define BZ_API(func) WINAPI func
133 # define BZ_EXTERN extern
135 /* import windows dll dynamically */
136 # define BZ_API(func) (WINAPI * func)
140 # define BZ_API(func) func
141 # define BZ_EXTERN extern
145 /*-- Core (low-level) library functions --*/
147 BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
154 BZ_EXTERN int BZ_API(BZ2_bzCompress) (
159 BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
163 BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
169 BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
173 BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
179 /*-- Utility functions --*/
181 BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
183 unsigned int* destLen,
185 unsigned int sourceLen,
191 BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
193 unsigned int* destLen,
195 unsigned int sourceLen,
202 Code contributed by Yoshioka Tsuneo
203 (QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp),
204 to support better zlib compatibility.
205 This code is not _officially_ part of libbzip2 (yet);
206 I haven't tested it, documented it, or considered the
207 threading-safeness of it.
208 If this code breaks, please contact both Yoshioka and me.
211 BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
221 /*-------------------------------------------------------------*/
222 /*--- end bzlib.h ---*/
223 /*-------------------------------------------------------------*/