Lines Matching refs:bzf
5239 if (bzf != NULL) bzf->lastErr = eee; \
5274 bzFile* bzf = NULL; in BZ_API() local
5287 bzf = malloc ( sizeof(bzFile) ); in BZ_API()
5288 if (bzf == NULL) in BZ_API()
5292 bzf->initialisedOk = False; in BZ_API()
5293 bzf->bufN = 0; in BZ_API()
5294 bzf->handle = f; in BZ_API()
5295 bzf->writing = True; in BZ_API()
5296 bzf->strm.bzalloc = NULL; in BZ_API()
5297 bzf->strm.bzfree = NULL; in BZ_API()
5298 bzf->strm.opaque = NULL; in BZ_API()
5301 ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, in BZ_API()
5304 { BZ_SETERR(ret); free(bzf); return NULL; }; in BZ_API()
5306 bzf->strm.avail_in = 0; in BZ_API()
5307 bzf->initialisedOk = True; in BZ_API()
5308 return bzf; in BZ_API()
5321 bzFile* bzf = (bzFile*)b; in BZ_API() local
5324 if (bzf == NULL || buf == NULL || len < 0) in BZ_API()
5326 if (!(bzf->writing)) in BZ_API()
5328 if (ferror(bzf->handle)) in BZ_API()
5334 bzf->strm.avail_in = len; in BZ_API()
5335 bzf->strm.next_in = buf; in BZ_API()
5338 bzf->strm.avail_out = BZ_MAX_UNUSED; in BZ_API()
5339 bzf->strm.next_out = bzf->buf; in BZ_API()
5340 ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN ); in BZ_API()
5344 if (bzf->strm.avail_out < BZ_MAX_UNUSED) { in BZ_API()
5345 n = BZ_MAX_UNUSED - bzf->strm.avail_out; in BZ_API()
5346 n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), in BZ_API()
5347 n, bzf->handle ); in BZ_API()
5348 if (n != n2 || ferror(bzf->handle)) in BZ_API()
5352 if (bzf->strm.avail_in == 0) in BZ_API()
5381 bzFile* bzf = (bzFile*)b; in BZ_API() local
5383 if (bzf == NULL) in BZ_API()
5385 if (!(bzf->writing)) in BZ_API()
5387 if (ferror(bzf->handle)) in BZ_API()
5395 if ((!abandon) && bzf->lastErr == BZ_OK) { in BZ_API()
5397 bzf->strm.avail_out = BZ_MAX_UNUSED; in BZ_API()
5398 bzf->strm.next_out = bzf->buf; in BZ_API()
5399 ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH ); in BZ_API()
5403 if (bzf->strm.avail_out < BZ_MAX_UNUSED) { in BZ_API()
5404 n = BZ_MAX_UNUSED - bzf->strm.avail_out; in BZ_API()
5405 n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), in BZ_API()
5406 n, bzf->handle ); in BZ_API()
5407 if (n != n2 || ferror(bzf->handle)) in BZ_API()
5415 if ( !abandon && !ferror ( bzf->handle ) ) { in BZ_API()
5416 fflush ( bzf->handle ); in BZ_API()
5417 if (ferror(bzf->handle)) in BZ_API()
5422 *nbytes_in_lo32 = bzf->strm.total_in_lo32; in BZ_API()
5424 *nbytes_in_hi32 = bzf->strm.total_in_hi32; in BZ_API()
5426 *nbytes_out_lo32 = bzf->strm.total_out_lo32; in BZ_API()
5428 *nbytes_out_hi32 = bzf->strm.total_out_hi32; in BZ_API()
5431 BZ2_bzCompressEnd ( &(bzf->strm) ); in BZ_API()
5432 free ( bzf ); in BZ_API()
5445 bzFile* bzf = NULL; in BZ_API() local
5460 bzf = malloc ( sizeof(bzFile) ); in BZ_API()
5461 if (bzf == NULL) in BZ_API()
5466 bzf->initialisedOk = False; in BZ_API()
5467 bzf->handle = f; in BZ_API()
5468 bzf->bufN = 0; in BZ_API()
5469 bzf->writing = False; in BZ_API()
5470 bzf->strm.bzalloc = NULL; in BZ_API()
5471 bzf->strm.bzfree = NULL; in BZ_API()
5472 bzf->strm.opaque = NULL; in BZ_API()
5475 bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++; in BZ_API()
5480 ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small ); in BZ_API()
5482 { BZ_SETERR(ret); free(bzf); return NULL; }; in BZ_API()
5484 bzf->strm.avail_in = bzf->bufN; in BZ_API()
5485 bzf->strm.next_in = bzf->buf; in BZ_API()
5487 bzf->initialisedOk = True; in BZ_API()
5488 return bzf; in BZ_API()
5495 bzFile* bzf = (bzFile*)b; in BZ_API() local
5498 if (bzf == NULL) in BZ_API()
5501 if (bzf->writing) in BZ_API()
5504 if (bzf->initialisedOk) in BZ_API()
5505 (void)BZ2_bzDecompressEnd ( &(bzf->strm) ); in BZ_API()
5506 free ( bzf ); in BZ_API()
5518 bzFile* bzf = (bzFile*)b; in BZ_API() local
5522 if (bzf == NULL || buf == NULL || len < 0) in BZ_API()
5525 if (bzf->writing) in BZ_API()
5531 bzf->strm.avail_out = len; in BZ_API()
5532 bzf->strm.next_out = buf; in BZ_API()
5536 if (ferror(bzf->handle)) in BZ_API()
5539 if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { in BZ_API()
5540 n = fread ( bzf->buf, sizeof(UChar), in BZ_API()
5541 BZ_MAX_UNUSED, bzf->handle ); in BZ_API()
5542 if (ferror(bzf->handle)) in BZ_API()
5544 bzf->bufN = n; in BZ_API()
5545 bzf->strm.avail_in = bzf->bufN; in BZ_API()
5546 bzf->strm.next_in = bzf->buf; in BZ_API()
5549 ret = BZ2_bzDecompress ( &(bzf->strm) ); in BZ_API()
5554 if (ret == BZ_OK && myfeof(bzf->handle) && in BZ_API()
5555 bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0) in BZ_API()
5560 return len - bzf->strm.avail_out; }; in BZ_API()
5561 if (bzf->strm.avail_out == 0) in BZ_API()
5577 bzFile* bzf = (bzFile*)b; in BZ_API() local
5578 if (bzf == NULL) in BZ_API()
5580 if (bzf->lastErr != BZ_STREAM_END) in BZ_API()
5586 *nUnused = bzf->strm.avail_in; in BZ_API()
5587 *unused = bzf->strm.next_in; in BZ_API()