00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 #ifndef _BZLIB_H
00063 #define _BZLIB_H
00064
00065 #ifdef __cplusplus
00066 extern "C" {
00067 #endif
00068
00069 #define BZ_RUN 0
00070 #define BZ_FLUSH 1
00071 #define BZ_FINISH 2
00072
00073 #define BZ_OK 0
00074 #define BZ_RUN_OK 1
00075 #define BZ_FLUSH_OK 2
00076 #define BZ_FINISH_OK 3
00077 #define BZ_STREAM_END 4
00078 #define BZ_SEQUENCE_ERROR (-1)
00079 #define BZ_PARAM_ERROR (-2)
00080 #define BZ_MEM_ERROR (-3)
00081 #define BZ_DATA_ERROR (-4)
00082 #define BZ_DATA_ERROR_MAGIC (-5)
00083 #define BZ_IO_ERROR (-6)
00084 #define BZ_UNEXPECTED_EOF (-7)
00085 #define BZ_OUTBUFF_FULL (-8)
00086 #define BZ_CONFIG_ERROR (-9)
00087
00088 typedef
00089 struct {
00090 char *next_in;
00091 unsigned int avail_in;
00092 unsigned int total_in_lo32;
00093 unsigned int total_in_hi32;
00094
00095 char *next_out;
00096 unsigned int avail_out;
00097 unsigned int total_out_lo32;
00098 unsigned int total_out_hi32;
00099
00100 void *state;
00101
00102 void *(*bzalloc)(void *,int,int);
00103 void (*bzfree)(void *,void *);
00104 void *opaque;
00105 }
00106 bz_stream;
00107
00108
00109 #ifndef BZ_IMPORT
00110 #define BZ_EXPORT
00111 #endif
00112
00113
00114 #include <stdio.h>
00115
00116 #ifdef _WIN32
00117 # include <windows.h>
00118 # ifdef small
00119
00120 # undef small
00121 # endif
00122 # ifdef BZ_EXPORT
00123 # define BZ_API(func) WINAPI func
00124 # define BZ_EXTERN extern
00125 # else
00126
00127 # define BZ_API(func) (WINAPI * func)
00128 # define BZ_EXTERN
00129 # endif
00130 #else
00131 # define BZ_API(func) func
00132 # define BZ_EXTERN extern
00133 #endif
00134
00135
00136
00137
00138 BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
00139 bz_stream* strm,
00140 int blockSize100k,
00141 int verbosity,
00142 int workFactor
00143 );
00144
00145 BZ_EXTERN int BZ_API(BZ2_bzCompress) (
00146 bz_stream* strm,
00147 int action
00148 );
00149
00150 BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
00151 bz_stream* strm
00152 );
00153
00154 BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
00155 bz_stream *strm,
00156 int verbosity,
00157 int small
00158 );
00159
00160 BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
00161 bz_stream* strm
00162 );
00163
00164 BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
00165 bz_stream *strm
00166 );
00167
00168
00169
00170
00171
00172 #ifndef BZ_NO_STDIO
00173 #define BZ_MAX_UNUSED 5000
00174
00175 typedef void BZFILE;
00176
00177 BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
00178 int* bzerror,
00179 FILE* f,
00180 int verbosity,
00181 int small,
00182 void* unused,
00183 int nUnused
00184 );
00185
00186 BZ_EXTERN void BZ_API(BZ2_bzReadClose) (
00187 int* bzerror,
00188 BZFILE* b
00189 );
00190
00191 BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) (
00192 int* bzerror,
00193 BZFILE* b,
00194 void** unused,
00195 int* nUnused
00196 );
00197
00198 BZ_EXTERN int BZ_API(BZ2_bzRead) (
00199 int* bzerror,
00200 BZFILE* b,
00201 void* buf,
00202 int len
00203 );
00204
00205 BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) (
00206 int* bzerror,
00207 FILE* f,
00208 int blockSize100k,
00209 int verbosity,
00210 int workFactor
00211 );
00212
00213 BZ_EXTERN void BZ_API(BZ2_bzWrite) (
00214 int* bzerror,
00215 BZFILE* b,
00216 void* buf,
00217 int len
00218 );
00219
00220 BZ_EXTERN void BZ_API(BZ2_bzWriteClose) (
00221 int* bzerror,
00222 BZFILE* b,
00223 int abandon,
00224 unsigned int* nbytes_in,
00225 unsigned int* nbytes_out
00226 );
00227
00228 BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
00229 int* bzerror,
00230 BZFILE* b,
00231 int abandon,
00232 unsigned int* nbytes_in_lo32,
00233 unsigned int* nbytes_in_hi32,
00234 unsigned int* nbytes_out_lo32,
00235 unsigned int* nbytes_out_hi32
00236 );
00237 #endif
00238
00239
00240
00241
00242 BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
00243 char* dest,
00244 unsigned int* destLen,
00245 char* source,
00246 unsigned int sourceLen,
00247 int blockSize100k,
00248 int verbosity,
00249 int workFactor
00250 );
00251
00252 BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
00253 char* dest,
00254 unsigned int* destLen,
00255 char* source,
00256 unsigned int sourceLen,
00257 int small,
00258 int verbosity
00259 );
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272 BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
00273 void
00274 );
00275
00276 #ifndef BZ_NO_STDIO
00277 BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
00278 const char *path,
00279 const char *mode
00280 );
00281
00282 BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
00283 int fd,
00284 const char *mode
00285 );
00286
00287 BZ_EXTERN int BZ_API(BZ2_bzread) (
00288 BZFILE* b,
00289 void* buf,
00290 int len
00291 );
00292
00293 BZ_EXTERN int BZ_API(BZ2_bzwrite) (
00294 BZFILE* b,
00295 void* buf,
00296 int len
00297 );
00298
00299 BZ_EXTERN int BZ_API(BZ2_bzflush) (
00300 BZFILE* b
00301 );
00302
00303 BZ_EXTERN void BZ_API(BZ2_bzclose) (
00304 BZFILE* b
00305 );
00306
00307 BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
00308 BZFILE *b,
00309 int *errnum
00310 );
00311 #endif
00312
00313 #ifdef __cplusplus
00314 }
00315 #endif
00316
00317 #endif
00318
00319
00320
00321
00322
00323