| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | #ifndef _BZLIB_H |
|---|
| 63 | #define _BZLIB_H |
|---|
| 64 | |
|---|
| 65 | #ifdef __cplusplus |
|---|
| 66 | extern "C" { |
|---|
| 67 | #endif |
|---|
| 68 | |
|---|
| 69 | #define BZ_RUN 0 |
|---|
| 70 | #define BZ_FLUSH 1 |
|---|
| 71 | #define BZ_FINISH 2 |
|---|
| 72 | |
|---|
| 73 | #define BZ_OK 0 |
|---|
| 74 | #define BZ_RUN_OK 1 |
|---|
| 75 | #define BZ_FLUSH_OK 2 |
|---|
| 76 | #define BZ_FINISH_OK 3 |
|---|
| 77 | #define BZ_STREAM_END 4 |
|---|
| 78 | #define BZ_SEQUENCE_ERROR (-1) |
|---|
| 79 | #define BZ_PARAM_ERROR (-2) |
|---|
| 80 | #define BZ_MEM_ERROR (-3) |
|---|
| 81 | #define BZ_DATA_ERROR (-4) |
|---|
| 82 | #define BZ_DATA_ERROR_MAGIC (-5) |
|---|
| 83 | #define BZ_IO_ERROR (-6) |
|---|
| 84 | #define BZ_UNEXPECTED_EOF (-7) |
|---|
| 85 | #define BZ_OUTBUFF_FULL (-8) |
|---|
| 86 | #define BZ_CONFIG_ERROR (-9) |
|---|
| 87 | |
|---|
| 88 | typedef |
|---|
| 89 | struct { |
|---|
| 90 | char *next_in; |
|---|
| 91 | unsigned int avail_in; |
|---|
| 92 | unsigned int total_in_lo32; |
|---|
| 93 | unsigned int total_in_hi32; |
|---|
| 94 | |
|---|
| 95 | char *next_out; |
|---|
| 96 | unsigned int avail_out; |
|---|
| 97 | unsigned int total_out_lo32; |
|---|
| 98 | unsigned int total_out_hi32; |
|---|
| 99 | |
|---|
| 100 | void *state; |
|---|
| 101 | |
|---|
| 102 | void *(*bzalloc)(void *,int,int); |
|---|
| 103 | void (*bzfree)(void *,void *); |
|---|
| 104 | void *opaque; |
|---|
| 105 | } |
|---|
| 106 | bz_stream; |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | #ifndef BZ_IMPORT |
|---|
| 110 | #define BZ_EXPORT |
|---|
| 111 | #endif |
|---|
| 112 | |
|---|
| 113 | #ifndef BZ_NO_STDIO |
|---|
| 114 | |
|---|
| 115 | #include <stdio.h> |
|---|
| 116 | #endif |
|---|
| 117 | |
|---|
| 118 | #ifdef _WIN32 |
|---|
| 119 | # include <windows.h> |
|---|
| 120 | # ifdef small |
|---|
| 121 | |
|---|
| 122 | # undef small |
|---|
| 123 | # endif |
|---|
| 124 | # ifdef BZ_EXPORT |
|---|
| 125 | # define BZ_API(func) WINAPI func |
|---|
| 126 | # define BZ_EXTERN extern |
|---|
| 127 | # else |
|---|
| 128 | |
|---|
| 129 | # define BZ_API(func) (WINAPI * func) |
|---|
| 130 | # define BZ_EXTERN |
|---|
| 131 | # endif |
|---|
| 132 | #else |
|---|
| 133 | # define BZ_API(func) func |
|---|
| 134 | # define BZ_EXTERN extern |
|---|
| 135 | #endif |
|---|
| 136 | |
|---|
| 137 | |
|---|
| 138 | |
|---|
| 139 | |
|---|
| 140 | BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( |
|---|
| 141 | bz_stream* strm, |
|---|
| 142 | int blockSize100k, |
|---|
| 143 | int verbosity, |
|---|
| 144 | int workFactor |
|---|
| 145 | ); |
|---|
| 146 | |
|---|
| 147 | BZ_EXTERN int BZ_API(BZ2_bzCompress) ( |
|---|
| 148 | bz_stream* strm, |
|---|
| 149 | int action |
|---|
| 150 | ); |
|---|
| 151 | |
|---|
| 152 | BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( |
|---|
| 153 | bz_stream* strm |
|---|
| 154 | ); |
|---|
| 155 | |
|---|
| 156 | BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( |
|---|
| 157 | bz_stream *strm, |
|---|
| 158 | int verbosity, |
|---|
| 159 | int small |
|---|
| 160 | ); |
|---|
| 161 | |
|---|
| 162 | BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( |
|---|
| 163 | bz_stream* strm |
|---|
| 164 | ); |
|---|
| 165 | |
|---|
| 166 | BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( |
|---|
| 167 | bz_stream *strm |
|---|
| 168 | ); |
|---|
| 169 | |
|---|
| 170 | |
|---|
| 171 | |
|---|
| 172 | |
|---|
| 173 | |
|---|
| 174 | #ifndef BZ_NO_STDIO |
|---|
| 175 | #define BZ_MAX_UNUSED 5000 |
|---|
| 176 | |
|---|
| 177 | typedef void BZFILE; |
|---|
| 178 | |
|---|
| 179 | BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( |
|---|
| 180 | int* bzerror, |
|---|
| 181 | FILE* f, |
|---|
| 182 | int verbosity, |
|---|
| 183 | int small, |
|---|
| 184 | void* unused, |
|---|
| 185 | int nUnused |
|---|
| 186 | ); |
|---|
| 187 | |
|---|
| 188 | BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( |
|---|
| 189 | int* bzerror, |
|---|
| 190 | BZFILE* b |
|---|
| 191 | ); |
|---|
| 192 | |
|---|
| 193 | BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( |
|---|
| 194 | int* bzerror, |
|---|
| 195 | BZFILE* b, |
|---|
| 196 | void** unused, |
|---|
| 197 | int* nUnused |
|---|
| 198 | ); |
|---|
| 199 | |
|---|
| 200 | BZ_EXTERN int BZ_API(BZ2_bzRead) ( |
|---|
| 201 | int* bzerror, |
|---|
| 202 | BZFILE* b, |
|---|
| 203 | void* buf, |
|---|
| 204 | int len |
|---|
| 205 | ); |
|---|
| 206 | |
|---|
| 207 | BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( |
|---|
| 208 | int* bzerror, |
|---|
| 209 | FILE* f, |
|---|
| 210 | int blockSize100k, |
|---|
| 211 | int verbosity, |
|---|
| 212 | int workFactor |
|---|
| 213 | ); |
|---|
| 214 | |
|---|
| 215 | BZ_EXTERN void BZ_API(BZ2_bzWrite) ( |
|---|
| 216 | int* bzerror, |
|---|
| 217 | BZFILE* b, |
|---|
| 218 | void* buf, |
|---|
| 219 | int len |
|---|
| 220 | ); |
|---|
| 221 | |
|---|
| 222 | BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( |
|---|
| 223 | int* bzerror, |
|---|
| 224 | BZFILE* b, |
|---|
| 225 | int abandon, |
|---|
| 226 | unsigned int* nbytes_in, |
|---|
| 227 | unsigned int* nbytes_out |
|---|
| 228 | ); |
|---|
| 229 | |
|---|
| 230 | BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( |
|---|
| 231 | int* bzerror, |
|---|
| 232 | BZFILE* b, |
|---|
| 233 | int abandon, |
|---|
| 234 | unsigned int* nbytes_in_lo32, |
|---|
| 235 | unsigned int* nbytes_in_hi32, |
|---|
| 236 | unsigned int* nbytes_out_lo32, |
|---|
| 237 | unsigned int* nbytes_out_hi32 |
|---|
| 238 | ); |
|---|
| 239 | #endif |
|---|
| 240 | |
|---|
| 241 | |
|---|
| 242 | |
|---|
| 243 | |
|---|
| 244 | BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( |
|---|
| 245 | char* dest, |
|---|
| 246 | unsigned int* destLen, |
|---|
| 247 | char* source, |
|---|
| 248 | unsigned int sourceLen, |
|---|
| 249 | int blockSize100k, |
|---|
| 250 | int verbosity, |
|---|
| 251 | int workFactor |
|---|
| 252 | ); |
|---|
| 253 | |
|---|
| 254 | BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( |
|---|
| 255 | char* dest, |
|---|
| 256 | unsigned int* destLen, |
|---|
| 257 | char* source, |
|---|
| 258 | unsigned int sourceLen, |
|---|
| 259 | int small, |
|---|
| 260 | int verbosity |
|---|
| 261 | ); |
|---|
| 262 | |
|---|
| 263 | |
|---|
| 264 | |
|---|
| 265 | |
|---|
| 266 | |
|---|
| 267 | |
|---|
| 268 | |
|---|
| 269 | |
|---|
| 270 | |
|---|
| 271 | |
|---|
| 272 | |
|---|
| 273 | |
|---|
| 274 | BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( |
|---|
| 275 | void |
|---|
| 276 | ); |
|---|
| 277 | |
|---|
| 278 | #ifndef BZ_NO_STDIO |
|---|
| 279 | BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( |
|---|
| 280 | const char *path, |
|---|
| 281 | const char *mode |
|---|
| 282 | ); |
|---|
| 283 | |
|---|
| 284 | BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( |
|---|
| 285 | int fd, |
|---|
| 286 | const char *mode |
|---|
| 287 | ); |
|---|
| 288 | |
|---|
| 289 | BZ_EXTERN int BZ_API(BZ2_bzread) ( |
|---|
| 290 | BZFILE* b, |
|---|
| 291 | void* buf, |
|---|
| 292 | int len |
|---|
| 293 | ); |
|---|
| 294 | |
|---|
| 295 | BZ_EXTERN int BZ_API(BZ2_bzwrite) ( |
|---|
| 296 | BZFILE* b, |
|---|
| 297 | void* buf, |
|---|
| 298 | int len |
|---|
| 299 | ); |
|---|
| 300 | |
|---|
| 301 | BZ_EXTERN int BZ_API(BZ2_bzflush) ( |
|---|
| 302 | BZFILE* b |
|---|
| 303 | ); |
|---|
| 304 | |
|---|
| 305 | BZ_EXTERN void BZ_API(BZ2_bzclose) ( |
|---|
| 306 | BZFILE* b |
|---|
| 307 | ); |
|---|
| 308 | |
|---|
| 309 | BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( |
|---|
| 310 | BZFILE *b, |
|---|
| 311 | int *errnum |
|---|
| 312 | ); |
|---|
| 313 | #endif |
|---|
| 314 | |
|---|
| 315 | #ifdef __cplusplus |
|---|
| 316 | } |
|---|
| 317 | #endif |
|---|
| 318 | |
|---|
| 319 | #endif |
|---|
| 320 | |
|---|
| 321 | |
|---|
| 322 | |
|---|
| 323 | |
|---|