Lines Matching refs:bzf
889 if (bzf != NULL) bzf->lastErr = eee; \
924 bzFile* bzf = NULL; in BZ_API() local
937 bzf = malloc ( sizeof(bzFile) ); in BZ_API()
938 if (bzf == NULL) in BZ_API()
942 bzf->initialisedOk = False; in BZ_API()
943 bzf->bufN = 0; in BZ_API()
944 bzf->handle = f; in BZ_API()
945 bzf->writing = True; in BZ_API()
946 bzf->strm.bzalloc = NULL; in BZ_API()
947 bzf->strm.bzfree = NULL; in BZ_API()
948 bzf->strm.opaque = NULL; in BZ_API()
951 ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, in BZ_API()
954 { BZ_SETERR(ret); free(bzf); return NULL; }; in BZ_API()
956 bzf->strm.avail_in = 0; in BZ_API()
957 bzf->initialisedOk = True; in BZ_API()
958 return bzf; in BZ_API()
971 bzFile* bzf = (bzFile*)b; in BZ_API() local
974 if (bzf == NULL || buf == NULL || len < 0) in BZ_API()
976 if (!(bzf->writing)) in BZ_API()
978 if (ferror(bzf->handle)) in BZ_API()
984 bzf->strm.avail_in = len; in BZ_API()
985 bzf->strm.next_in = buf; in BZ_API()
988 bzf->strm.avail_out = BZ_MAX_UNUSED; in BZ_API()
989 bzf->strm.next_out = bzf->buf; in BZ_API()
990 ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN ); in BZ_API()
994 if (bzf->strm.avail_out < BZ_MAX_UNUSED) { in BZ_API()
995 n = BZ_MAX_UNUSED - bzf->strm.avail_out; in BZ_API()
996 n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), in BZ_API()
997 n, bzf->handle ); in BZ_API()
998 if (n != n2 || ferror(bzf->handle)) in BZ_API()
1002 if (bzf->strm.avail_in == 0) in BZ_API()
1031 bzFile* bzf = (bzFile*)b; in BZ_API() local
1033 if (bzf == NULL) in BZ_API()
1035 if (!(bzf->writing)) in BZ_API()
1037 if (ferror(bzf->handle)) in BZ_API()
1045 if ((!abandon) && bzf->lastErr == BZ_OK) { in BZ_API()
1047 bzf->strm.avail_out = BZ_MAX_UNUSED; in BZ_API()
1048 bzf->strm.next_out = bzf->buf; in BZ_API()
1049 ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH ); in BZ_API()
1053 if (bzf->strm.avail_out < BZ_MAX_UNUSED) { in BZ_API()
1054 n = BZ_MAX_UNUSED - bzf->strm.avail_out; in BZ_API()
1055 n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), in BZ_API()
1056 n, bzf->handle ); in BZ_API()
1057 if (n != n2 || ferror(bzf->handle)) in BZ_API()
1065 if ( !abandon && !ferror ( bzf->handle ) ) { in BZ_API()
1066 fflush ( bzf->handle ); in BZ_API()
1067 if (ferror(bzf->handle)) in BZ_API()
1072 *nbytes_in_lo32 = bzf->strm.total_in_lo32; in BZ_API()
1074 *nbytes_in_hi32 = bzf->strm.total_in_hi32; in BZ_API()
1076 *nbytes_out_lo32 = bzf->strm.total_out_lo32; in BZ_API()
1078 *nbytes_out_hi32 = bzf->strm.total_out_hi32; in BZ_API()
1081 BZ2_bzCompressEnd ( &(bzf->strm) ); in BZ_API()
1082 free ( bzf ); in BZ_API()
1095 bzFile* bzf = NULL; in BZ_API() local
1110 bzf = malloc ( sizeof(bzFile) ); in BZ_API()
1111 if (bzf == NULL) in BZ_API()
1116 bzf->initialisedOk = False; in BZ_API()
1117 bzf->handle = f; in BZ_API()
1118 bzf->bufN = 0; in BZ_API()
1119 bzf->writing = False; in BZ_API()
1120 bzf->strm.bzalloc = NULL; in BZ_API()
1121 bzf->strm.bzfree = NULL; in BZ_API()
1122 bzf->strm.opaque = NULL; in BZ_API()
1125 bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++; in BZ_API()
1130 ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small ); in BZ_API()
1132 { BZ_SETERR(ret); free(bzf); return NULL; }; in BZ_API()
1134 bzf->strm.avail_in = bzf->bufN; in BZ_API()
1135 bzf->strm.next_in = bzf->buf; in BZ_API()
1137 bzf->initialisedOk = True; in BZ_API()
1138 return bzf; in BZ_API()
1145 bzFile* bzf = (bzFile*)b; in BZ_API() local
1148 if (bzf == NULL) in BZ_API()
1151 if (bzf->writing) in BZ_API()
1154 if (bzf->initialisedOk) in BZ_API()
1155 (void)BZ2_bzDecompressEnd ( &(bzf->strm) ); in BZ_API()
1156 free ( bzf ); in BZ_API()
1168 bzFile* bzf = (bzFile*)b; in BZ_API() local
1172 if (bzf == NULL || buf == NULL || len < 0) in BZ_API()
1175 if (bzf->writing) in BZ_API()
1181 bzf->strm.avail_out = len; in BZ_API()
1182 bzf->strm.next_out = buf; in BZ_API()
1186 if (ferror(bzf->handle)) in BZ_API()
1189 if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { in BZ_API()
1190 n = fread ( bzf->buf, sizeof(UChar), in BZ_API()
1191 BZ_MAX_UNUSED, bzf->handle ); in BZ_API()
1192 if (ferror(bzf->handle)) in BZ_API()
1194 bzf->bufN = n; in BZ_API()
1195 bzf->strm.avail_in = bzf->bufN; in BZ_API()
1196 bzf->strm.next_in = bzf->buf; in BZ_API()
1199 ret = BZ2_bzDecompress ( &(bzf->strm) ); in BZ_API()
1204 if (ret == BZ_OK && myfeof(bzf->handle) && in BZ_API()
1205 bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0) in BZ_API()
1210 return len - bzf->strm.avail_out; }; in BZ_API()
1211 if (bzf->strm.avail_out == 0) in BZ_API()
1227 bzFile* bzf = (bzFile*)b; in BZ_API() local
1228 if (bzf == NULL) in BZ_API()
1230 if (bzf->lastErr != BZ_STREAM_END) in BZ_API()
1236 *nUnused = bzf->strm.avail_in; in BZ_API()
1237 *unused = bzf->strm.next_in; in BZ_API()