Lines Matching refs:bzf
5222 if (bzf != NULL) bzf->lastErr = eee; \
5257 bzFile* bzf = NULL; in BZ_API() local
5270 bzf = malloc ( sizeof(bzFile) ); in BZ_API()
5271 if (bzf == NULL) in BZ_API()
5275 bzf->initialisedOk = False; in BZ_API()
5276 bzf->bufN = 0; in BZ_API()
5277 bzf->handle = f; in BZ_API()
5278 bzf->writing = True; in BZ_API()
5279 bzf->strm.bzalloc = NULL; in BZ_API()
5280 bzf->strm.bzfree = NULL; in BZ_API()
5281 bzf->strm.opaque = NULL; in BZ_API()
5284 ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, in BZ_API()
5287 { BZ_SETERR(ret); free(bzf); return NULL; }; in BZ_API()
5289 bzf->strm.avail_in = 0; in BZ_API()
5290 bzf->initialisedOk = True; in BZ_API()
5291 return bzf; in BZ_API()
5304 bzFile* bzf = (bzFile*)b; in BZ_API() local
5307 if (bzf == NULL || buf == NULL || len < 0) in BZ_API()
5309 if (!(bzf->writing)) in BZ_API()
5311 if (ferror(bzf->handle)) in BZ_API()
5317 bzf->strm.avail_in = len; in BZ_API()
5318 bzf->strm.next_in = buf; in BZ_API()
5321 bzf->strm.avail_out = BZ_MAX_UNUSED; in BZ_API()
5322 bzf->strm.next_out = bzf->buf; in BZ_API()
5323 ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN ); in BZ_API()
5327 if (bzf->strm.avail_out < BZ_MAX_UNUSED) { in BZ_API()
5328 n = BZ_MAX_UNUSED - bzf->strm.avail_out; in BZ_API()
5329 n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), in BZ_API()
5330 n, bzf->handle ); in BZ_API()
5331 if (n != n2 || ferror(bzf->handle)) in BZ_API()
5335 if (bzf->strm.avail_in == 0) in BZ_API()
5364 bzFile* bzf = (bzFile*)b; in BZ_API() local
5366 if (bzf == NULL) in BZ_API()
5368 if (!(bzf->writing)) in BZ_API()
5370 if (ferror(bzf->handle)) in BZ_API()
5378 if ((!abandon) && bzf->lastErr == BZ_OK) { in BZ_API()
5380 bzf->strm.avail_out = BZ_MAX_UNUSED; in BZ_API()
5381 bzf->strm.next_out = bzf->buf; in BZ_API()
5382 ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH ); in BZ_API()
5386 if (bzf->strm.avail_out < BZ_MAX_UNUSED) { in BZ_API()
5387 n = BZ_MAX_UNUSED - bzf->strm.avail_out; in BZ_API()
5388 n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), in BZ_API()
5389 n, bzf->handle ); in BZ_API()
5390 if (n != n2 || ferror(bzf->handle)) in BZ_API()
5398 if ( !abandon && !ferror ( bzf->handle ) ) { in BZ_API()
5399 fflush ( bzf->handle ); in BZ_API()
5400 if (ferror(bzf->handle)) in BZ_API()
5405 *nbytes_in_lo32 = bzf->strm.total_in_lo32; in BZ_API()
5407 *nbytes_in_hi32 = bzf->strm.total_in_hi32; in BZ_API()
5409 *nbytes_out_lo32 = bzf->strm.total_out_lo32; in BZ_API()
5411 *nbytes_out_hi32 = bzf->strm.total_out_hi32; in BZ_API()
5414 BZ2_bzCompressEnd ( &(bzf->strm) ); in BZ_API()
5415 free ( bzf ); in BZ_API()
5428 bzFile* bzf = NULL; in BZ_API() local
5443 bzf = malloc ( sizeof(bzFile) ); in BZ_API()
5444 if (bzf == NULL) in BZ_API()
5449 bzf->initialisedOk = False; in BZ_API()
5450 bzf->handle = f; in BZ_API()
5451 bzf->bufN = 0; in BZ_API()
5452 bzf->writing = False; in BZ_API()
5453 bzf->strm.bzalloc = NULL; in BZ_API()
5454 bzf->strm.bzfree = NULL; in BZ_API()
5455 bzf->strm.opaque = NULL; in BZ_API()
5458 bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++; in BZ_API()
5463 ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small ); in BZ_API()
5465 { BZ_SETERR(ret); free(bzf); return NULL; }; in BZ_API()
5467 bzf->strm.avail_in = bzf->bufN; in BZ_API()
5468 bzf->strm.next_in = bzf->buf; in BZ_API()
5470 bzf->initialisedOk = True; in BZ_API()
5471 return bzf; in BZ_API()
5478 bzFile* bzf = (bzFile*)b; in BZ_API() local
5481 if (bzf == NULL) in BZ_API()
5484 if (bzf->writing) in BZ_API()
5487 if (bzf->initialisedOk) in BZ_API()
5488 (void)BZ2_bzDecompressEnd ( &(bzf->strm) ); in BZ_API()
5489 free ( bzf ); in BZ_API()
5501 bzFile* bzf = (bzFile*)b; in BZ_API() local
5505 if (bzf == NULL || buf == NULL || len < 0) in BZ_API()
5508 if (bzf->writing) in BZ_API()
5514 bzf->strm.avail_out = len; in BZ_API()
5515 bzf->strm.next_out = buf; in BZ_API()
5519 if (ferror(bzf->handle)) in BZ_API()
5522 if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { in BZ_API()
5523 n = fread ( bzf->buf, sizeof(UChar), in BZ_API()
5524 BZ_MAX_UNUSED, bzf->handle ); in BZ_API()
5525 if (ferror(bzf->handle)) in BZ_API()
5527 bzf->bufN = n; in BZ_API()
5528 bzf->strm.avail_in = bzf->bufN; in BZ_API()
5529 bzf->strm.next_in = bzf->buf; in BZ_API()
5532 ret = BZ2_bzDecompress ( &(bzf->strm) ); in BZ_API()
5537 if (ret == BZ_OK && myfeof(bzf->handle) && in BZ_API()
5538 bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0) in BZ_API()
5543 return len - bzf->strm.avail_out; }; in BZ_API()
5544 if (bzf->strm.avail_out == 0) in BZ_API()
5560 bzFile* bzf = (bzFile*)b; in BZ_API() local
5561 if (bzf == NULL) in BZ_API()
5563 if (bzf->lastErr != BZ_STREAM_END) in BZ_API()
5569 *nUnused = bzf->strm.avail_in; in BZ_API()
5570 *unused = bzf->strm.next_in; in BZ_API()