diff options
Diffstat (limited to 'bzlib.h')
-rw-r--r-- | bzlib.h | 67 |
1 files changed, 40 insertions, 27 deletions
@@ -8,7 +8,7 @@ | |||
8 | This file is a part of bzip2 and/or libbzip2, a program and | 8 | This file is a part of bzip2 and/or libbzip2, a program and |
9 | library for lossless, block-sorting data compression. | 9 | library for lossless, block-sorting data compression. |
10 | 10 | ||
11 | Copyright (C) 1996-1999 Julian R Seward. All rights reserved. | 11 | Copyright (C) 1996-2000 Julian R Seward. All rights reserved. |
12 | 12 | ||
13 | Redistribution and use in source and binary forms, with or without | 13 | Redistribution and use in source and binary forms, with or without |
14 | modification, are permitted provided that the following conditions | 14 | modification, are permitted provided that the following conditions |
@@ -43,7 +43,7 @@ | |||
43 | 43 | ||
44 | Julian Seward, Cambridge, UK. | 44 | Julian Seward, Cambridge, UK. |
45 | jseward@acm.org | 45 | jseward@acm.org |
46 | bzip2/libbzip2 version 0.9.5 of 24 May 1999 | 46 | bzip2/libbzip2 version 1.0 of 21 March 2000 |
47 | 47 | ||
48 | This program is based on (at least) the work of: | 48 | This program is based on (at least) the work of: |
49 | Mike Burrows | 49 | Mike Burrows |
@@ -83,16 +83,19 @@ extern "C" { | |||
83 | #define BZ_IO_ERROR (-6) | 83 | #define BZ_IO_ERROR (-6) |
84 | #define BZ_UNEXPECTED_EOF (-7) | 84 | #define BZ_UNEXPECTED_EOF (-7) |
85 | #define BZ_OUTBUFF_FULL (-8) | 85 | #define BZ_OUTBUFF_FULL (-8) |
86 | #define BZ_CONFIG_ERROR (-9) | ||
86 | 87 | ||
87 | typedef | 88 | typedef |
88 | struct { | 89 | struct { |
89 | char *next_in; | 90 | char *next_in; |
90 | unsigned int avail_in; | 91 | unsigned int avail_in; |
91 | unsigned int total_in; | 92 | unsigned int total_in_lo32; |
93 | unsigned int total_in_hi32; | ||
92 | 94 | ||
93 | char *next_out; | 95 | char *next_out; |
94 | unsigned int avail_out; | 96 | unsigned int avail_out; |
95 | unsigned int total_out; | 97 | unsigned int total_out_lo32; |
98 | unsigned int total_out_hi32; | ||
96 | 99 | ||
97 | void *state; | 100 | void *state; |
98 | 101 | ||
@@ -130,33 +133,33 @@ typedef | |||
130 | 133 | ||
131 | /*-- Core (low-level) library functions --*/ | 134 | /*-- Core (low-level) library functions --*/ |
132 | 135 | ||
133 | BZ_EXTERN int BZ_API(bzCompressInit) ( | 136 | BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( |
134 | bz_stream* strm, | 137 | bz_stream* strm, |
135 | int blockSize100k, | 138 | int blockSize100k, |
136 | int verbosity, | 139 | int verbosity, |
137 | int workFactor | 140 | int workFactor |
138 | ); | 141 | ); |
139 | 142 | ||
140 | BZ_EXTERN int BZ_API(bzCompress) ( | 143 | BZ_EXTERN int BZ_API(BZ2_bzCompress) ( |
141 | bz_stream* strm, | 144 | bz_stream* strm, |
142 | int action | 145 | int action |
143 | ); | 146 | ); |
144 | 147 | ||
145 | BZ_EXTERN int BZ_API(bzCompressEnd) ( | 148 | BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( |
146 | bz_stream* strm | 149 | bz_stream* strm |
147 | ); | 150 | ); |
148 | 151 | ||
149 | BZ_EXTERN int BZ_API(bzDecompressInit) ( | 152 | BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( |
150 | bz_stream *strm, | 153 | bz_stream *strm, |
151 | int verbosity, | 154 | int verbosity, |
152 | int small | 155 | int small |
153 | ); | 156 | ); |
154 | 157 | ||
155 | BZ_EXTERN int BZ_API(bzDecompress) ( | 158 | BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( |
156 | bz_stream* strm | 159 | bz_stream* strm |
157 | ); | 160 | ); |
158 | 161 | ||
159 | BZ_EXTERN int BZ_API(bzDecompressEnd) ( | 162 | BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( |
160 | bz_stream *strm | 163 | bz_stream *strm |
161 | ); | 164 | ); |
162 | 165 | ||
@@ -169,7 +172,7 @@ BZ_EXTERN int BZ_API(bzDecompressEnd) ( | |||
169 | 172 | ||
170 | typedef void BZFILE; | 173 | typedef void BZFILE; |
171 | 174 | ||
172 | BZ_EXTERN BZFILE* BZ_API(bzReadOpen) ( | 175 | BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( |
173 | int* bzerror, | 176 | int* bzerror, |
174 | FILE* f, | 177 | FILE* f, |
175 | int verbosity, | 178 | int verbosity, |
@@ -178,26 +181,26 @@ BZ_EXTERN BZFILE* BZ_API(bzReadOpen) ( | |||
178 | int nUnused | 181 | int nUnused |
179 | ); | 182 | ); |
180 | 183 | ||
181 | BZ_EXTERN void BZ_API(bzReadClose) ( | 184 | BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( |
182 | int* bzerror, | 185 | int* bzerror, |
183 | BZFILE* b | 186 | BZFILE* b |
184 | ); | 187 | ); |
185 | 188 | ||
186 | BZ_EXTERN void BZ_API(bzReadGetUnused) ( | 189 | BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( |
187 | int* bzerror, | 190 | int* bzerror, |
188 | BZFILE* b, | 191 | BZFILE* b, |
189 | void** unused, | 192 | void** unused, |
190 | int* nUnused | 193 | int* nUnused |
191 | ); | 194 | ); |
192 | 195 | ||
193 | BZ_EXTERN int BZ_API(bzRead) ( | 196 | BZ_EXTERN int BZ_API(BZ2_bzRead) ( |
194 | int* bzerror, | 197 | int* bzerror, |
195 | BZFILE* b, | 198 | BZFILE* b, |
196 | void* buf, | 199 | void* buf, |
197 | int len | 200 | int len |
198 | ); | 201 | ); |
199 | 202 | ||
200 | BZ_EXTERN BZFILE* BZ_API(bzWriteOpen) ( | 203 | BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( |
201 | int* bzerror, | 204 | int* bzerror, |
202 | FILE* f, | 205 | FILE* f, |
203 | int blockSize100k, | 206 | int blockSize100k, |
@@ -205,26 +208,36 @@ BZ_EXTERN BZFILE* BZ_API(bzWriteOpen) ( | |||
205 | int workFactor | 208 | int workFactor |
206 | ); | 209 | ); |
207 | 210 | ||
208 | BZ_EXTERN void BZ_API(bzWrite) ( | 211 | BZ_EXTERN void BZ_API(BZ2_bzWrite) ( |
209 | int* bzerror, | 212 | int* bzerror, |
210 | BZFILE* b, | 213 | BZFILE* b, |
211 | void* buf, | 214 | void* buf, |
212 | int len | 215 | int len |
213 | ); | 216 | ); |
214 | 217 | ||
215 | BZ_EXTERN void BZ_API(bzWriteClose) ( | 218 | BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( |
216 | int* bzerror, | 219 | int* bzerror, |
217 | BZFILE* b, | 220 | BZFILE* b, |
218 | int abandon, | 221 | int abandon, |
219 | unsigned int* nbytes_in, | 222 | unsigned int* nbytes_in, |
220 | unsigned int* nbytes_out | 223 | unsigned int* nbytes_out |
221 | ); | 224 | ); |
225 | |||
226 | BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( | ||
227 | int* bzerror, | ||
228 | BZFILE* b, | ||
229 | int abandon, | ||
230 | unsigned int* nbytes_in_lo32, | ||
231 | unsigned int* nbytes_in_hi32, | ||
232 | unsigned int* nbytes_out_lo32, | ||
233 | unsigned int* nbytes_out_hi32 | ||
234 | ); | ||
222 | #endif | 235 | #endif |
223 | 236 | ||
224 | 237 | ||
225 | /*-- Utility functions --*/ | 238 | /*-- Utility functions --*/ |
226 | 239 | ||
227 | BZ_EXTERN int BZ_API(bzBuffToBuffCompress) ( | 240 | BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( |
228 | char* dest, | 241 | char* dest, |
229 | unsigned int* destLen, | 242 | unsigned int* destLen, |
230 | char* source, | 243 | char* source, |
@@ -234,7 +247,7 @@ BZ_EXTERN int BZ_API(bzBuffToBuffCompress) ( | |||
234 | int workFactor | 247 | int workFactor |
235 | ); | 248 | ); |
236 | 249 | ||
237 | BZ_EXTERN int BZ_API(bzBuffToBuffDecompress) ( | 250 | BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( |
238 | char* dest, | 251 | char* dest, |
239 | unsigned int* destLen, | 252 | unsigned int* destLen, |
240 | char* source, | 253 | char* source, |
@@ -254,42 +267,42 @@ BZ_EXTERN int BZ_API(bzBuffToBuffDecompress) ( | |||
254 | If this code breaks, please contact both Yoshioka and me. | 267 | If this code breaks, please contact both Yoshioka and me. |
255 | --*/ | 268 | --*/ |
256 | 269 | ||
257 | BZ_EXTERN const char * BZ_API(bzlibVersion) ( | 270 | BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( |
258 | void | 271 | void |
259 | ); | 272 | ); |
260 | 273 | ||
261 | #ifndef BZ_NO_STDIO | 274 | #ifndef BZ_NO_STDIO |
262 | BZ_EXTERN BZFILE * BZ_API(bzopen) ( | 275 | BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( |
263 | const char *path, | 276 | const char *path, |
264 | const char *mode | 277 | const char *mode |
265 | ); | 278 | ); |
266 | 279 | ||
267 | BZ_EXTERN BZFILE * BZ_API(bzdopen) ( | 280 | BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( |
268 | int fd, | 281 | int fd, |
269 | const char *mode | 282 | const char *mode |
270 | ); | 283 | ); |
271 | 284 | ||
272 | BZ_EXTERN int BZ_API(bzread) ( | 285 | BZ_EXTERN int BZ_API(BZ2_bzread) ( |
273 | BZFILE* b, | 286 | BZFILE* b, |
274 | void* buf, | 287 | void* buf, |
275 | int len | 288 | int len |
276 | ); | 289 | ); |
277 | 290 | ||
278 | BZ_EXTERN int BZ_API(bzwrite) ( | 291 | BZ_EXTERN int BZ_API(BZ2_bzwrite) ( |
279 | BZFILE* b, | 292 | BZFILE* b, |
280 | void* buf, | 293 | void* buf, |
281 | int len | 294 | int len |
282 | ); | 295 | ); |
283 | 296 | ||
284 | BZ_EXTERN int BZ_API(bzflush) ( | 297 | BZ_EXTERN int BZ_API(BZ2_bzflush) ( |
285 | BZFILE* b | 298 | BZFILE* b |
286 | ); | 299 | ); |
287 | 300 | ||
288 | BZ_EXTERN void BZ_API(bzclose) ( | 301 | BZ_EXTERN void BZ_API(BZ2_bzclose) ( |
289 | BZFILE* b | 302 | BZFILE* b |
290 | ); | 303 | ); |
291 | 304 | ||
292 | BZ_EXTERN const char * BZ_API(bzerror) ( | 305 | BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( |
293 | BZFILE *b, | 306 | BZFILE *b, |
294 | int *errnum | 307 | int *errnum |
295 | ); | 308 | ); |