Lines Matching refs:bzf
1064 if (bzf != NULL) bzf->lastErr = eee; \
1099 bzFile* bzf = NULL;
1112 bzf = malloc ( sizeof(bzFile) );
1113 if (bzf == NULL)
1117 bzf->initialisedOk = False;
1118 bzf->bufN = 0;
1119 bzf->handle = f;
1120 bzf->writing = True;
1121 bzf->strm.bzalloc = NULL;
1122 bzf->strm.bzfree = NULL;
1123 bzf->strm.opaque = NULL;
1126 ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k,
1129 { BZ_SETERR(ret); free(bzf); return NULL; };
1131 bzf->strm.avail_in = 0;
1132 bzf->initialisedOk = True;
1133 return bzf;
1146 bzFile* bzf = (bzFile*)b;
1149 if (bzf == NULL || buf == NULL || len < 0)
1151 if (!(bzf->writing))
1153 if (ferror(bzf->handle))
1159 bzf->strm.avail_in = len;
1160 bzf->strm.next_in = buf;
1163 bzf->strm.avail_out = BZ_MAX_UNUSED;
1164 bzf->strm.next_out = bzf->buf;
1165 ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN );
1169 if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
1170 n = BZ_MAX_UNUSED - bzf->strm.avail_out;
1171 n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
1172 n, bzf->handle );
1173 if (n != n2 || ferror(bzf->handle))
1177 if (bzf->strm.avail_in == 0)
1206 bzFile* bzf = (bzFile*)b;
1208 if (bzf == NULL)
1210 if (!(bzf->writing))
1212 if (ferror(bzf->handle))
1220 if ((!abandon) && bzf->lastErr == BZ_OK) {
1222 bzf->strm.avail_out = BZ_MAX_UNUSED;
1223 bzf->strm.next_out = bzf->buf;
1224 ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH );
1228 if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
1229 n = BZ_MAX_UNUSED - bzf->strm.avail_out;
1230 n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
1231 n, bzf->handle );
1232 if (n != n2 || ferror(bzf->handle))
1240 if ( !abandon && !ferror ( bzf->handle ) ) {
1241 fflush ( bzf->handle );
1242 if (ferror(bzf->handle))
1247 *nbytes_in_lo32 = bzf->strm.total_in_lo32;
1249 *nbytes_in_hi32 = bzf->strm.total_in_hi32;
1251 *nbytes_out_lo32 = bzf->strm.total_out_lo32;
1253 *nbytes_out_hi32 = bzf->strm.total_out_hi32;
1256 (void) BZ2_bzCompressEnd ( &(bzf->strm) );
1257 free ( bzf );
1270 bzFile* bzf = NULL;
1285 bzf = malloc ( sizeof(bzFile) );
1286 if (bzf == NULL)
1291 bzf->initialisedOk = False;
1292 bzf->handle = f;
1293 bzf->bufN = 0;
1294 bzf->writing = False;
1295 bzf->strm.bzalloc = NULL;
1296 bzf->strm.bzfree = NULL;
1297 bzf->strm.opaque = NULL;
1300 bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++;
1305 ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small );
1307 { BZ_SETERR(ret); free(bzf); return NULL; };
1309 bzf->strm.avail_in = bzf->bufN;
1310 bzf->strm.next_in = bzf->buf;
1312 bzf->initialisedOk = True;
1313 return bzf;
1320 bzFile* bzf = (bzFile*)b;
1323 if (bzf == NULL)
1326 if (bzf->writing)
1329 if (bzf->initialisedOk)
1330 (void) BZ2_bzDecompressEnd ( &(bzf->strm) );
1331 free ( bzf );
1343 bzFile* bzf = (bzFile*)b;
1347 if (bzf == NULL || buf == NULL || len < 0)
1350 if (bzf->writing)
1356 bzf->strm.avail_out = len;
1357 bzf->strm.next_out = buf;
1361 if (ferror(bzf->handle))
1364 if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) {
1365 n = fread ( bzf->buf, sizeof(UChar),
1366 BZ_MAX_UNUSED, bzf->handle );
1367 if (ferror(bzf->handle))
1369 bzf->bufN = n;
1370 bzf->strm.avail_in = bzf->bufN;
1371 bzf->strm.next_in = bzf->buf;
1374 ret = BZ2_bzDecompress ( &(bzf->strm) );
1379 if (ret == BZ_OK && myfeof(bzf->handle) &&
1380 bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0)
1385 return len - bzf->strm.avail_out; };
1386 if (bzf->strm.avail_out == 0)
1402 bzFile* bzf = (bzFile*)b;
1403 if (bzf == NULL)
1405 if (bzf->lastErr != BZ_STREAM_END)
1411 *nUnused = bzf->strm.avail_in;
1412 *unused = bzf->strm.next_in;