Lines Matching refs:bzf
5248 if (bzf != NULL) bzf->lastErr = eee; \
5283 bzFile* bzf = NULL; in BZ_API() local
5296 bzf = malloc ( sizeof(bzFile) ); in BZ_API()
5297 if (bzf == NULL) in BZ_API()
5301 bzf->initialisedOk = False; in BZ_API()
5302 bzf->bufN = 0; in BZ_API()
5303 bzf->handle = f; in BZ_API()
5304 bzf->writing = True; in BZ_API()
5305 bzf->strm.bzalloc = NULL; in BZ_API()
5306 bzf->strm.bzfree = NULL; in BZ_API()
5307 bzf->strm.opaque = NULL; in BZ_API()
5310 ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, in BZ_API()
5313 { BZ_SETERR(ret); free(bzf); return NULL; }; in BZ_API()
5315 bzf->strm.avail_in = 0; in BZ_API()
5316 bzf->initialisedOk = True; in BZ_API()
5317 return bzf; in BZ_API()
5330 bzFile* bzf = (bzFile*)b; in BZ_API() local
5333 if (bzf == NULL || buf == NULL || len < 0) in BZ_API()
5335 if (!(bzf->writing)) in BZ_API()
5337 if (ferror(bzf->handle)) in BZ_API()
5343 bzf->strm.avail_in = len; in BZ_API()
5344 bzf->strm.next_in = buf; in BZ_API()
5347 bzf->strm.avail_out = BZ_MAX_UNUSED; in BZ_API()
5348 bzf->strm.next_out = bzf->buf; in BZ_API()
5349 ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN ); in BZ_API()
5353 if (bzf->strm.avail_out < BZ_MAX_UNUSED) { in BZ_API()
5354 n = BZ_MAX_UNUSED - bzf->strm.avail_out; in BZ_API()
5355 n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), in BZ_API()
5356 n, bzf->handle ); in BZ_API()
5357 if (n != n2 || ferror(bzf->handle)) in BZ_API()
5361 if (bzf->strm.avail_in == 0) in BZ_API()
5390 bzFile* bzf = (bzFile*)b; in BZ_API() local
5392 if (bzf == NULL) in BZ_API()
5394 if (!(bzf->writing)) in BZ_API()
5396 if (ferror(bzf->handle)) in BZ_API()
5404 if ((!abandon) && bzf->lastErr == BZ_OK) { in BZ_API()
5406 bzf->strm.avail_out = BZ_MAX_UNUSED; in BZ_API()
5407 bzf->strm.next_out = bzf->buf; in BZ_API()
5408 ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH ); in BZ_API()
5412 if (bzf->strm.avail_out < BZ_MAX_UNUSED) { in BZ_API()
5413 n = BZ_MAX_UNUSED - bzf->strm.avail_out; in BZ_API()
5414 n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), in BZ_API()
5415 n, bzf->handle ); in BZ_API()
5416 if (n != n2 || ferror(bzf->handle)) in BZ_API()
5424 if ( !abandon && !ferror ( bzf->handle ) ) { in BZ_API()
5425 fflush ( bzf->handle ); in BZ_API()
5426 if (ferror(bzf->handle)) in BZ_API()
5431 *nbytes_in_lo32 = bzf->strm.total_in_lo32; in BZ_API()
5433 *nbytes_in_hi32 = bzf->strm.total_in_hi32; in BZ_API()
5435 *nbytes_out_lo32 = bzf->strm.total_out_lo32; in BZ_API()
5437 *nbytes_out_hi32 = bzf->strm.total_out_hi32; in BZ_API()
5440 BZ2_bzCompressEnd ( &(bzf->strm) ); in BZ_API()
5441 free ( bzf ); in BZ_API()
5454 bzFile* bzf = NULL; in BZ_API() local
5469 bzf = malloc ( sizeof(bzFile) ); in BZ_API()
5470 if (bzf == NULL) in BZ_API()
5475 bzf->initialisedOk = False; in BZ_API()
5476 bzf->handle = f; in BZ_API()
5477 bzf->bufN = 0; in BZ_API()
5478 bzf->writing = False; in BZ_API()
5479 bzf->strm.bzalloc = NULL; in BZ_API()
5480 bzf->strm.bzfree = NULL; in BZ_API()
5481 bzf->strm.opaque = NULL; in BZ_API()
5484 bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++; in BZ_API()
5489 ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small ); in BZ_API()
5491 { BZ_SETERR(ret); free(bzf); return NULL; }; in BZ_API()
5493 bzf->strm.avail_in = bzf->bufN; in BZ_API()
5494 bzf->strm.next_in = bzf->buf; in BZ_API()
5496 bzf->initialisedOk = True; in BZ_API()
5497 return bzf; in BZ_API()
5504 bzFile* bzf = (bzFile*)b; in BZ_API() local
5507 if (bzf == NULL) in BZ_API()
5510 if (bzf->writing) in BZ_API()
5513 if (bzf->initialisedOk) in BZ_API()
5514 (void)BZ2_bzDecompressEnd ( &(bzf->strm) ); in BZ_API()
5515 free ( bzf ); in BZ_API()
5527 bzFile* bzf = (bzFile*)b; in BZ_API() local
5531 if (bzf == NULL || buf == NULL || len < 0) in BZ_API()
5534 if (bzf->writing) in BZ_API()
5540 bzf->strm.avail_out = len; in BZ_API()
5541 bzf->strm.next_out = buf; in BZ_API()
5545 if (ferror(bzf->handle)) in BZ_API()
5548 if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { in BZ_API()
5549 n = fread ( bzf->buf, sizeof(UChar), in BZ_API()
5550 BZ_MAX_UNUSED, bzf->handle ); in BZ_API()
5551 if (ferror(bzf->handle)) in BZ_API()
5553 bzf->bufN = n; in BZ_API()
5554 bzf->strm.avail_in = bzf->bufN; in BZ_API()
5555 bzf->strm.next_in = bzf->buf; in BZ_API()
5558 ret = BZ2_bzDecompress ( &(bzf->strm) ); in BZ_API()
5563 if (ret == BZ_OK && myfeof(bzf->handle) && in BZ_API()
5564 bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0) in BZ_API()
5569 return len - bzf->strm.avail_out; }; in BZ_API()
5570 if (bzf->strm.avail_out == 0) in BZ_API()
5586 bzFile* bzf = (bzFile*)b; in BZ_API() local
5587 if (bzf == NULL) in BZ_API()
5589 if (bzf->lastErr != BZ_STREAM_END) in BZ_API()
5595 *nUnused = bzf->strm.avail_in; in BZ_API()
5596 *unused = bzf->strm.next_in; in BZ_API()