Lines Matching refs:strm

157                     ( bz_stream* strm, 
167 if (strm == NULL ||
173 if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
174 if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
178 s->strm = strm;
211 strm->state = s;
212 strm->total_in_lo32 = 0;
213 strm->total_in_hi32 = 0;
214 strm->total_out_lo32 = 0;
215 strm->total_out_hi32 = 0;
308 if (s->strm->avail_in == 0) break;
310 ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
311 s->strm->next_in++;
312 s->strm->avail_in--;
313 s->strm->total_in_lo32++;
314 if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;
324 if (s->strm->avail_in == 0) break;
328 ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
329 s->strm->next_in++;
330 s->strm->avail_in--;
331 s->strm->total_in_lo32++;
332 if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;
349 if (s->strm->avail_out == 0) break;
355 *(s->strm->next_out) = s->zbits[s->state_out_pos];
357 s->strm->avail_out--;
358 s->strm->next_out++;
359 s->strm->total_out_lo32++;
360 if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
369 Bool handle_compress ( bz_stream* strm )
373 EState* s = strm->state;
403 if (s->strm->avail_in == 0) {
415 int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action )
419 if (strm == NULL) return BZ_PARAM_ERROR;
420 s = strm->state;
422 if (s->strm != strm) return BZ_PARAM_ERROR;
432 progress = handle_compress ( strm );
437 s->avail_in_expect = strm->avail_in;
443 s->avail_in_expect = strm->avail_in;
452 if (s->avail_in_expect != s->strm->avail_in)
454 progress = handle_compress ( strm );
462 if (s->avail_in_expect != s->strm->avail_in)
464 progress = handle_compress ( strm );
476 int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm )
479 if (strm == NULL) return BZ_PARAM_ERROR;
480 s = strm->state;
482 if (s->strm != strm) return BZ_PARAM_ERROR;
487 BZFREE(strm->state);
489 strm->state = NULL;
501 ( bz_stream* strm,
509 if (strm == NULL) return BZ_PARAM_ERROR;
513 if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
514 if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
518 s->strm = strm;
519 strm->state = s;
524 strm->total_in_lo32 = 0;
525 strm->total_in_hi32 = 0;
526 strm->total_out_lo32 = 0;
527 strm->total_out_hi32 = 0;
553 if (s->strm->avail_out == 0) return False;
555 *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
557 s->strm->next_out++;
558 s->strm->avail_out--;
559 s->strm->total_out_lo32++;
560 if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
605 char* cs_next_out = s->strm->next_out;
606 unsigned int cs_avail_out = s->strm->avail_out;
668 total_out_lo32_old = s->strm->total_out_lo32;
669 s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out);
670 if (s->strm->total_out_lo32 < total_out_lo32_old)
671 s->strm->total_out_hi32++;
680 s->strm->next_out = cs_next_out;
681 s->strm->avail_out = cs_avail_out;
718 if (s->strm->avail_out == 0) return False;
720 *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
722 s->strm->next_out++;
723 s->strm->avail_out--;
724 s->strm->total_out_lo32++;
725 if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
766 if (s->strm->avail_out == 0) return False;
768 *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
770 s->strm->next_out++;
771 s->strm->avail_out--;
772 s->strm->total_out_lo32++;
773 if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
809 int BZ_API(BZ2_bzDecompress) ( bz_stream *strm )
821 if (strm == NULL) return BZ_PARAM_ERROR;
822 s = strm->state;
824 if (s->strm != strm) return BZ_PARAM_ERROR;
832 char * p = (char *) s->strm->next_out;
840 int crc_length = s->strm->next_out - p;
892 int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm )
895 if (strm == NULL) return BZ_PARAM_ERROR;
896 s = strm->state;
898 if (s->strm != strm) return BZ_PARAM_ERROR;
904 BZFREE(strm->state);
905 strm->state = NULL;
928 bz_stream strm;
976 bzf->strm.bzalloc = NULL;
977 bzf->strm.bzfree = NULL;
978 bzf->strm.opaque = NULL;
981 ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k,
986 bzf->strm.avail_in = 0;
1014 bzf->strm.avail_in = len;
1015 bzf->strm.next_in = buf;
1018 bzf->strm.avail_out = BZ_MAX_UNUSED;
1019 bzf->strm.next_out = bzf->buf;
1020 ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN );
1024 if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
1025 n = BZ_MAX_UNUSED - bzf->strm.avail_out;
1032 if (bzf->strm.avail_in == 0)
1077 bzf->strm.avail_out = BZ_MAX_UNUSED;
1078 bzf->strm.next_out = bzf->buf;
1079 ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH );
1083 if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
1084 n = BZ_MAX_UNUSED - bzf->strm.avail_out;
1102 *nbytes_in_lo32 = bzf->strm.total_in_lo32;
1104 *nbytes_in_hi32 = bzf->strm.total_in_hi32;
1106 *nbytes_out_lo32 = bzf->strm.total_out_lo32;
1108 *nbytes_out_hi32 = bzf->strm.total_out_hi32;
1111 BZ2_bzCompressEnd ( &(bzf->strm) );
1150 bzf->strm.bzalloc = NULL;
1151 bzf->strm.bzfree = NULL;
1152 bzf->strm.opaque = NULL;
1160 ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small );
1164 bzf->strm.avail_in = bzf->bufN;
1165 bzf->strm.next_in = bzf->buf;
1185 (void)BZ2_bzDecompressEnd ( &(bzf->strm) );
1211 bzf->strm.avail_out = len;
1212 bzf->strm.next_out = buf;
1219 if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) {
1225 bzf->strm.avail_in = bzf->bufN;
1226 bzf->strm.next_in = bzf->buf;
1229 ret = BZ2_bzDecompress ( &(bzf->strm) );
1235 bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0)
1240 return len - bzf->strm.avail_out; };
1241 if (bzf->strm.avail_out == 0)
1266 *nUnused = bzf->strm.avail_in;
1267 *unused = bzf->strm.next_in;
1286 bz_stream strm;
1297 strm.bzalloc = NULL;
1298 strm.bzfree = NULL;
1299 strm.opaque = NULL;
1300 ret = BZ2_bzCompressInit ( &strm, blockSize100k,
1304 strm.next_in = source;
1305 strm.next_out = dest;
1306 strm.avail_in = sourceLen;
1307 strm.avail_out = *destLen;
1309 ret = BZ2_bzCompress ( &strm, BZ_FINISH );
1314 *destLen -= strm.avail_out;
1315 BZ2_bzCompressEnd ( &strm );
1319 BZ2_bzCompressEnd ( &strm );
1323 BZ2_bzCompressEnd ( &strm );
1337 bz_stream strm;
1346 strm.bzalloc = NULL;
1347 strm.bzfree = NULL;
1348 strm.opaque = NULL;
1349 ret = BZ2_bzDecompressInit ( &strm, verbosity, small );
1352 strm.next_in = source;
1353 strm.next_out = dest;
1354 strm.avail_in = sourceLen;
1355 strm.avail_out = *destLen;
1357 ret = BZ2_bzDecompress ( &strm );
1362 *destLen -= strm.avail_out;
1363 BZ2_bzDecompressEnd ( &strm );
1367 if (strm.avail_out > 0) {
1368 BZ2_bzDecompressEnd ( &strm );
1371 BZ2_bzDecompressEnd ( &strm );
1376 BZ2_bzDecompressEnd ( &strm );