2 /*-------------------------------------------------------------*/
3 /*--- Public header file for the library. ---*/
5 /*-------------------------------------------------------------*/
7 /* ------------------------------------------------------------------
8 This file is part of bzip2/libbzip2, a program and library for
9 lossless, block-sorting data compression.
11 bzip2/libbzip2 version 1.0.6 of 6 September 2010
12 Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
14 Please read the WARNING, DISCLAIMER and PATENTS sections in the
17 This program is released under the terms of the license contained
19 ------------------------------------------------------------------ */
39 #define BZ_FINISH_OK 3
40 #define BZ_STREAM_END 4
41 #define BZ_SEQUENCE_ERROR (-1)
42 #define BZ_PARAM_ERROR (-2)
43 #define BZ_MEM_ERROR (-3)
44 #define BZ_DATA_ERROR (-4)
45 #define BZ_DATA_ERROR_MAGIC (-5)
46 #define BZ_IO_ERROR (-6)
47 #define BZ_UNEXPECTED_EOF (-7)
48 #define BZ_OUTBUFF_FULL (-8)
49 #define BZ_CONFIG_ERROR (-9)
54 unsigned int avail_in
;
55 unsigned int total_in_lo32
;
56 unsigned int total_in_hi32
;
59 unsigned int avail_out
;
60 unsigned int total_out_lo32
;
61 unsigned int total_out_hi32
;
65 void *(*bzalloc
)(void *,int,int);
66 void (*bzfree
)(void *,void *);
77 /* Need a definitition for FILE */
84 /* windows.h define small to char */
88 # define BZ_API(func) WINAPI func
89 # define BZ_EXTERN extern
91 /* import windows dll dynamically */
92 # define BZ_API(func) (WINAPI * func)
96 # define BZ_API(func) func
97 # define BZ_EXTERN extern
101 /*-- Core (low-level) library functions --*/
103 #define BZ2_BZALLOC_ALIGN (64)
105 BZ_EXTERN
int BZ_API(BZ2_bzCompressInit
) (
112 BZ_EXTERN
int BZ_API(BZ2_bzCompressInitSize
) (
116 BZ_EXTERN
int BZ_API(BZ2_bzCompressReset
) (
120 BZ_EXTERN
int BZ_API(BZ2_bzCompress
) (
125 BZ_EXTERN
int BZ_API(BZ2_bzCompressEnd
) (
129 BZ_EXTERN
int BZ_API(BZ2_bzDecompressInit
) (
135 BZ_EXTERN
int BZ_API(BZ2_bzDecompressReset
) (
139 BZ_EXTERN
int BZ_API(BZ2_bzDecompress
) (
143 BZ_EXTERN
int BZ_API(BZ2_bzDecompressEnd
) (
147 BZ_EXTERN
const char * BZ_API(BZ2_bzErrorString
) (
153 /*-- High(er) level library functions --*/
156 #define BZ_MAX_UNUSED 5000
160 BZ_EXTERN BZFILE
* BZ_API(BZ2_bzReadOpen
) (
169 BZ_EXTERN
void BZ_API(BZ2_bzReadClose
) (
174 BZ_EXTERN
void BZ_API(BZ2_bzReadGetUnused
) (
181 BZ_EXTERN
int BZ_API(BZ2_bzRead
) (
188 BZ_EXTERN BZFILE
* BZ_API(BZ2_bzWriteOpen
) (
196 BZ_EXTERN
void BZ_API(BZ2_bzWrite
) (
203 BZ_EXTERN
void BZ_API(BZ2_bzWriteClose
) (
207 unsigned int* nbytes_in
,
208 unsigned int* nbytes_out
211 BZ_EXTERN
void BZ_API(BZ2_bzWriteClose64
) (
215 unsigned int* nbytes_in_lo32
,
216 unsigned int* nbytes_in_hi32
,
217 unsigned int* nbytes_out_lo32
,
218 unsigned int* nbytes_out_hi32
223 /*-- Utility functions --*/
225 BZ_EXTERN
int BZ_API(BZ2_bzBuffToBuffCompress
) (
227 unsigned int* destLen
,
229 unsigned int sourceLen
,
235 BZ_EXTERN
int BZ_API(BZ2_bzBuffToBuffDecompress
) (
237 unsigned int* destLen
,
239 unsigned int sourceLen
,
246 Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp)
247 to support better zlib compatibility.
248 This code is not _officially_ part of libbzip2 (yet);
249 I haven't tested it, documented it, or considered the
250 threading-safeness of it.
251 If this code breaks, please contact both Yoshioka and me.
254 BZ_EXTERN
const char * BZ_API(BZ2_bzlibVersion
) (
259 BZ_EXTERN BZFILE
* BZ_API(BZ2_bzopen
) (
264 BZ_EXTERN BZFILE
* BZ_API(BZ2_bzdopen
) (
269 BZ_EXTERN
int BZ_API(BZ2_bzread
) (
275 BZ_EXTERN
int BZ_API(BZ2_bzwrite
) (
281 BZ_EXTERN
int BZ_API(BZ2_bzflush
) (
285 BZ_EXTERN
void BZ_API(BZ2_bzclose
) (
289 BZ_EXTERN
const char * BZ_API(BZ2_bzerror
) (
299 /*-------------------------------------------------------------*/
300 /*--- end bzlib.h ---*/
301 /*-------------------------------------------------------------*/
302 #endif /* _BZLIB_H */