Lines Matching refs:bzf
918 if (bzf != NULL) bzf->lastErr = eee; \
953 bzFile* bzf = NULL; in BZ_API() local
966 bzf = malloc ( sizeof(bzFile) ); in BZ_API()
967 if (bzf == NULL) in BZ_API()
971 bzf->initialisedOk = False; in BZ_API()
972 bzf->bufN = 0; in BZ_API()
973 bzf->handle = f; in BZ_API()
974 bzf->writing = True; in BZ_API()
975 bzf->strm.bzalloc = NULL; in BZ_API()
976 bzf->strm.bzfree = NULL; in BZ_API()
977 bzf->strm.opaque = NULL; in BZ_API()
980 ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, in BZ_API()
983 { BZ_SETERR(ret); free(bzf); return NULL; }; in BZ_API()
985 bzf->strm.avail_in = 0; in BZ_API()
986 bzf->initialisedOk = True; in BZ_API()
987 return bzf; in BZ_API()
999 bzFile* bzf = (bzFile*)b; in BZ_API() local
1002 if (bzf == NULL || buf == NULL || len < 0) in BZ_API()
1004 if (!(bzf->writing)) in BZ_API()
1006 if (ferror(bzf->handle)) in BZ_API()
1012 bzf->strm.avail_in = len; in BZ_API()
1013 bzf->strm.next_in = buf; in BZ_API()
1016 bzf->strm.avail_out = BZ_MAX_UNUSED; in BZ_API()
1017 bzf->strm.next_out = bzf->buf; in BZ_API()
1018 ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN ); in BZ_API()
1022 if (bzf->strm.avail_out < BZ_MAX_UNUSED) { in BZ_API()
1023 n = BZ_MAX_UNUSED - bzf->strm.avail_out; in BZ_API()
1024 n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), in BZ_API()
1025 n, bzf->handle ); in BZ_API()
1026 if (n != n2 || ferror(bzf->handle)) in BZ_API()
1030 if (bzf->strm.avail_in == 0) in BZ_API()
1059 bzFile* bzf = (bzFile*)b; in BZ_API() local
1061 if (bzf == NULL) in BZ_API()
1063 if (!(bzf->writing)) in BZ_API()
1065 if (ferror(bzf->handle)) in BZ_API()
1073 if ((!abandon) && bzf->lastErr == BZ_OK) { in BZ_API()
1075 bzf->strm.avail_out = BZ_MAX_UNUSED; in BZ_API()
1076 bzf->strm.next_out = bzf->buf; in BZ_API()
1077 ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH ); in BZ_API()
1081 if (bzf->strm.avail_out < BZ_MAX_UNUSED) { in BZ_API()
1082 n = BZ_MAX_UNUSED - bzf->strm.avail_out; in BZ_API()
1083 n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), in BZ_API()
1084 n, bzf->handle ); in BZ_API()
1085 if (n != n2 || ferror(bzf->handle)) in BZ_API()
1093 if ( !abandon && !ferror ( bzf->handle ) ) { in BZ_API()
1094 fflush ( bzf->handle ); in BZ_API()
1095 if (ferror(bzf->handle)) in BZ_API()
1100 *nbytes_in_lo32 = bzf->strm.total_in_lo32; in BZ_API()
1102 *nbytes_in_hi32 = bzf->strm.total_in_hi32; in BZ_API()
1104 *nbytes_out_lo32 = bzf->strm.total_out_lo32; in BZ_API()
1106 *nbytes_out_hi32 = bzf->strm.total_out_hi32; in BZ_API()
1109 BZ2_bzCompressEnd ( &(bzf->strm) ); in BZ_API()
1110 free ( bzf ); in BZ_API()
1123 bzFile* bzf = NULL; in BZ_API() local
1138 bzf = malloc ( sizeof(bzFile) ); in BZ_API()
1139 if (bzf == NULL) in BZ_API()
1144 bzf->initialisedOk = False; in BZ_API()
1145 bzf->handle = f; in BZ_API()
1146 bzf->bufN = 0; in BZ_API()
1147 bzf->writing = False; in BZ_API()
1148 bzf->strm.bzalloc = NULL; in BZ_API()
1149 bzf->strm.bzfree = NULL; in BZ_API()
1150 bzf->strm.opaque = NULL; in BZ_API()
1153 bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++; in BZ_API()
1158 ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small ); in BZ_API()
1160 { BZ_SETERR(ret); free(bzf); return NULL; }; in BZ_API()
1162 bzf->strm.avail_in = bzf->bufN; in BZ_API()
1163 bzf->strm.next_in = bzf->buf; in BZ_API()
1165 bzf->initialisedOk = True; in BZ_API()
1166 return bzf; in BZ_API()
1173 bzFile* bzf = (bzFile*)b; in BZ_API() local
1176 if (bzf == NULL) in BZ_API()
1179 if (bzf->writing) in BZ_API()
1182 if (bzf->initialisedOk) in BZ_API()
1183 (void)BZ2_bzDecompressEnd ( &(bzf->strm) ); in BZ_API()
1184 free ( bzf ); in BZ_API()
1196 bzFile* bzf = (bzFile*)b; in BZ_API() local
1200 if (bzf == NULL || buf == NULL || len < 0) in BZ_API()
1203 if (bzf->writing) in BZ_API()
1209 bzf->strm.avail_out = len; in BZ_API()
1210 bzf->strm.next_out = buf; in BZ_API()
1214 if (ferror(bzf->handle)) in BZ_API()
1217 if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { in BZ_API()
1218 n = fread ( bzf->buf, sizeof(UChar), in BZ_API()
1219 BZ_MAX_UNUSED, bzf->handle ); in BZ_API()
1220 if (ferror(bzf->handle)) in BZ_API()
1222 bzf->bufN = n; in BZ_API()
1223 bzf->strm.avail_in = bzf->bufN; in BZ_API()
1224 bzf->strm.next_in = bzf->buf; in BZ_API()
1227 ret = BZ2_bzDecompress ( &(bzf->strm) ); in BZ_API()
1232 if (ret == BZ_OK && myfeof(bzf->handle) && in BZ_API()
1233 bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0) in BZ_API()
1238 return len - bzf->strm.avail_out; }; in BZ_API()
1239 if (bzf->strm.avail_out == 0) in BZ_API()
1255 bzFile* bzf = (bzFile*)b; in BZ_API() local
1256 if (bzf == NULL) in BZ_API()
1258 if (bzf->lastErr != BZ_STREAM_END) in BZ_API()
1264 *nUnused = bzf->strm.avail_in; in BZ_API()
1265 *unused = bzf->strm.next_in; in BZ_API()