Lines Matching refs:strm
179 int BZ_API(BZ2_bzCompressInit)(bz_stream* strm, int blockSize100k, int verbosity, int workFactor) { in BZ_API()
186 if (strm == nullptr || blockSize100k < 1 || blockSize100k > 9 || workFactor < 0 || in BZ_API()
192 if (strm->bzalloc == nullptr) in BZ_API()
193 strm->bzalloc = default_bzalloc; in BZ_API()
194 if (strm->bzfree == nullptr) in BZ_API()
195 strm->bzfree = default_bzfree; in BZ_API()
200 s->strm = strm; in BZ_API()
237 strm->state = s; in BZ_API()
238 strm->total_in_lo32 = 0; in BZ_API()
239 strm->total_in_hi32 = 0; in BZ_API()
240 strm->total_out_lo32 = 0; in BZ_API()
241 strm->total_out_hi32 = 0; in BZ_API()
333 if (s->strm->avail_in == 0) in copy_input_until_stop()
336 ADD_CHAR_TO_BLOCK(s, (UInt32)(*((UChar*)(s->strm->next_in)))); in copy_input_until_stop()
337 s->strm->next_in++; in copy_input_until_stop()
338 s->strm->avail_in--; in copy_input_until_stop()
339 s->strm->total_in_lo32++; in copy_input_until_stop()
340 if (s->strm->total_in_lo32 == 0) in copy_input_until_stop()
341 s->strm->total_in_hi32++; in copy_input_until_stop()
351 if (s->strm->avail_in == 0) in copy_input_until_stop()
357 ADD_CHAR_TO_BLOCK(s, (UInt32)(*((UChar*)(s->strm->next_in)))); in copy_input_until_stop()
358 s->strm->next_in++; in copy_input_until_stop()
359 s->strm->avail_in--; in copy_input_until_stop()
360 s->strm->total_in_lo32++; in copy_input_until_stop()
361 if (s->strm->total_in_lo32 == 0) in copy_input_until_stop()
362 s->strm->total_in_hi32++; in copy_input_until_stop()
375 if (s->strm->avail_out == 0) in copy_output_until_stop()
383 *(s->strm->next_out) = s->zbits[s->state_out_pos]; in copy_output_until_stop()
385 s->strm->avail_out--; in copy_output_until_stop()
386 s->strm->next_out++; in copy_output_until_stop()
387 s->strm->total_out_lo32++; in copy_output_until_stop()
388 if (s->strm->total_out_lo32 == 0) in copy_output_until_stop()
389 s->strm->total_out_hi32++; in copy_output_until_stop()
396 static Bool handle_compress(bz_stream* strm) { in handle_compress() argument
399 EState* s = (EState*)strm->state; in handle_compress()
425 else if (s->strm->avail_in == 0) { in handle_compress()
435 int BZ_API(BZ2_bzCompress)(bz_stream* strm, int action) { in BZ_API()
438 if (strm == nullptr) in BZ_API()
440 s = (EState*)strm->state; in BZ_API()
443 if (s->strm != strm) in BZ_API()
452 progress = handle_compress(strm); in BZ_API()
456 s->avail_in_expect = strm->avail_in; in BZ_API()
461 s->avail_in_expect = strm->avail_in; in BZ_API()
471 if (s->avail_in_expect != s->strm->avail_in) in BZ_API()
473 progress = handle_compress(strm); in BZ_API()
482 if (s->avail_in_expect != s->strm->avail_in) in BZ_API()
484 progress = handle_compress(strm); in BZ_API()
496 int BZ_API(BZ2_bzCompressEnd)(bz_stream* strm) { in BZ_API()
498 if (strm == nullptr) in BZ_API()
500 s = (EState*)strm->state; in BZ_API()
503 if (s->strm != strm) in BZ_API()
512 BZFREE(strm->state); in BZ_API()
514 strm->state = nullptr; in BZ_API()
524 int BZ_API(BZ2_bzDecompressInit)(bz_stream* strm, int verbosity, int small) { in BZ_API()
530 if (strm == nullptr) in BZ_API()
537 if (strm->bzalloc == nullptr) in BZ_API()
538 strm->bzalloc = default_bzalloc; in BZ_API()
539 if (strm->bzfree == nullptr) in BZ_API()
540 strm->bzfree = default_bzfree; in BZ_API()
545 s->strm = strm; in BZ_API()
546 strm->state = s; in BZ_API()
551 strm->total_in_lo32 = 0; in BZ_API()
552 strm->total_in_hi32 = 0; in BZ_API()
553 strm->total_out_lo32 = 0; in BZ_API()
554 strm->total_out_hi32 = 0; in BZ_API()
576 if (s->strm->avail_out == 0) in unRLE_obuf_to_output_FAST()
580 *((UChar*)(s->strm->next_out)) = s->state_out_ch; in unRLE_obuf_to_output_FAST()
583 s->strm->next_out++; in unRLE_obuf_to_output_FAST()
584 s->strm->avail_out--; in unRLE_obuf_to_output_FAST()
585 s->strm->total_out_lo32++; in unRLE_obuf_to_output_FAST()
586 if (s->strm->total_out_lo32 == 0) in unRLE_obuf_to_output_FAST()
587 s->strm->total_out_hi32++; in unRLE_obuf_to_output_FAST()
655 char* cs_next_out = s->strm->next_out; in unRLE_obuf_to_output_FAST()
656 unsigned int cs_avail_out = s->strm->avail_out; in unRLE_obuf_to_output_FAST()
736 total_out_lo32_old = s->strm->total_out_lo32; in unRLE_obuf_to_output_FAST()
737 s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out); in unRLE_obuf_to_output_FAST()
738 if (s->strm->total_out_lo32 < total_out_lo32_old) in unRLE_obuf_to_output_FAST()
739 s->strm->total_out_hi32++; in unRLE_obuf_to_output_FAST()
749 s->strm->next_out = cs_next_out; in unRLE_obuf_to_output_FAST()
750 s->strm->avail_out = cs_avail_out; in unRLE_obuf_to_output_FAST()
782 if (s->strm->avail_out == 0) in unRLE_obuf_to_output_SMALL()
786 *((UChar*)(s->strm->next_out)) = s->state_out_ch; in unRLE_obuf_to_output_SMALL()
789 s->strm->next_out++; in unRLE_obuf_to_output_SMALL()
790 s->strm->avail_out--; in unRLE_obuf_to_output_SMALL()
791 s->strm->total_out_lo32++; in unRLE_obuf_to_output_SMALL()
792 if (s->strm->total_out_lo32 == 0) in unRLE_obuf_to_output_SMALL()
793 s->strm->total_out_hi32++; in unRLE_obuf_to_output_SMALL()
856 if (s->strm->avail_out == 0) in unRLE_obuf_to_output_SMALL()
860 *((UChar*)(s->strm->next_out)) = s->state_out_ch; in unRLE_obuf_to_output_SMALL()
863 s->strm->next_out++; in unRLE_obuf_to_output_SMALL()
864 s->strm->avail_out--; in unRLE_obuf_to_output_SMALL()
865 s->strm->total_out_lo32++; in unRLE_obuf_to_output_SMALL()
866 if (s->strm->total_out_lo32 == 0) in unRLE_obuf_to_output_SMALL()
867 s->strm->total_out_hi32++; in unRLE_obuf_to_output_SMALL()
919 int BZ_API(BZ2_bzDecompress)(bz_stream* strm) { in BZ_API()
922 if (strm == nullptr) in BZ_API()
924 s = (DState*)strm->state; in BZ_API()
927 if (s->strm != strm) in BZ_API()
979 int BZ_API(BZ2_bzDecompressEnd)(bz_stream* strm) { in BZ_API()
981 if (strm == nullptr) in BZ_API()
983 s = (DState*)strm->state; in BZ_API()
986 if (s->strm != strm) in BZ_API()
996 BZFREE(strm->state); in BZ_API()
997 strm->state = nullptr; in BZ_API()
1020 bz_stream strm; member
1064 bzf->strm.bzalloc = nullptr; in BZ_API()
1065 bzf->strm.bzfree = nullptr; in BZ_API()
1066 bzf->strm.opaque = nullptr; in BZ_API()
1070 ret = BZ2_bzCompressInit(&(bzf->strm), blockSize100k, verbosity, workFactor); in BZ_API()
1077 bzf->strm.avail_in = 0; in BZ_API()
1106 bzf->strm.avail_in = len; in BZ_API()
1107 bzf->strm.next_in = (char*)buf; in BZ_API()
1110 bzf->strm.avail_out = BZ_MAX_UNUSED; in BZ_API()
1111 bzf->strm.next_out = bzf->buf; in BZ_API()
1112 ret = BZ2_bzCompress(&(bzf->strm), BZ_RUN); in BZ_API()
1118 if (bzf->strm.avail_out < BZ_MAX_UNUSED) { in BZ_API()
1119 n = BZ_MAX_UNUSED - bzf->strm.avail_out; in BZ_API()
1127 if (bzf->strm.avail_in == 0) { in BZ_API()
1177 bzf->strm.avail_out = BZ_MAX_UNUSED; in BZ_API()
1178 bzf->strm.next_out = bzf->buf; in BZ_API()
1179 ret = BZ2_bzCompress(&(bzf->strm), BZ_FINISH); in BZ_API()
1185 if (bzf->strm.avail_out < BZ_MAX_UNUSED) { in BZ_API()
1186 n = BZ_MAX_UNUSED - bzf->strm.avail_out; in BZ_API()
1208 *nbytes_in_lo32 = bzf->strm.total_in_lo32; in BZ_API()
1210 *nbytes_in_hi32 = bzf->strm.total_in_hi32; in BZ_API()
1212 *nbytes_out_lo32 = bzf->strm.total_out_lo32; in BZ_API()
1214 *nbytes_out_hi32 = bzf->strm.total_out_hi32; in BZ_API()
1217 BZ2_bzCompressEnd(&(bzf->strm)); in BZ_API()
1253 bzf->strm.bzalloc = nullptr; in BZ_API()
1254 bzf->strm.bzfree = nullptr; in BZ_API()
1255 bzf->strm.opaque = nullptr; in BZ_API()
1264 ret = BZ2_bzDecompressInit(&(bzf->strm), verbosity, small); in BZ_API()
1271 bzf->strm.avail_in = bzf->bufN; in BZ_API()
1272 bzf->strm.next_in = bzf->buf; in BZ_API()
1294 (void)BZ2_bzDecompressEnd(&(bzf->strm)); in BZ_API()
1320 bzf->strm.avail_out = len; in BZ_API()
1321 bzf->strm.next_out = (char*)buf; in BZ_API()
1329 if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { in BZ_API()
1336 bzf->strm.avail_in = bzf->bufN; in BZ_API()
1337 bzf->strm.next_in = bzf->buf; in BZ_API()
1340 ret = BZ2_bzDecompress(&(bzf->strm)); in BZ_API()
1347 if (ret == BZ_OK && myfeof(bzf->handle) && bzf->strm.avail_in == 0 && in BZ_API()
1348 bzf->strm.avail_out > 0) { in BZ_API()
1355 return len - bzf->strm.avail_out; in BZ_API()
1357 if (bzf->strm.avail_out == 0) { in BZ_API()
1383 *nUnused = bzf->strm.avail_in; in BZ_API()
1384 *unused = bzf->strm.next_in; in BZ_API()
1400 bz_stream strm; in BZ_API() local
1409 strm.bzalloc = nullptr; in BZ_API()
1410 strm.bzfree = nullptr; in BZ_API()
1411 strm.opaque = nullptr; in BZ_API()
1412 ret = BZ2_bzCompressInit(&strm, blockSize100k, verbosity, workFactor); in BZ_API()
1416 strm.next_in = source; in BZ_API()
1417 strm.next_out = dest; in BZ_API()
1418 strm.avail_in = sourceLen; in BZ_API()
1419 strm.avail_out = *destLen; in BZ_API()
1421 ret = BZ2_bzCompress(&strm, BZ_FINISH); in BZ_API()
1428 *destLen -= strm.avail_out; in BZ_API()
1429 BZ2_bzCompressEnd(&strm); in BZ_API()
1433 BZ2_bzCompressEnd(&strm); in BZ_API()
1437 BZ2_bzCompressEnd(&strm); in BZ_API()
1448 bz_stream strm; in BZ_API() local
1455 strm.bzalloc = nullptr; in BZ_API()
1456 strm.bzfree = nullptr; in BZ_API()
1457 strm.opaque = nullptr; in BZ_API()
1458 ret = BZ2_bzDecompressInit(&strm, verbosity, small); in BZ_API()
1462 strm.next_in = source; in BZ_API()
1463 strm.next_out = dest; in BZ_API()
1464 strm.avail_in = sourceLen; in BZ_API()
1465 strm.avail_out = *destLen; in BZ_API()
1467 ret = BZ2_bzDecompress(&strm); in BZ_API()
1474 *destLen -= strm.avail_out; in BZ_API()
1475 BZ2_bzDecompressEnd(&strm); in BZ_API()
1479 if (strm.avail_out > 0) { in BZ_API()
1480 BZ2_bzDecompressEnd(&strm); in BZ_API()
1484 BZ2_bzDecompressEnd(&strm); in BZ_API()
1489 BZ2_bzDecompressEnd(&strm); in BZ_API()