Lines Matching refs:zs

118 static z_stream zs;  variable
122 memset(&zs, 0, sizeof(z_stream)); in init_compression()
124 zs.zalloc = Z_NULL; in init_compression()
125 zs.zfree = Z_NULL; in init_compression()
126 zs.opaque = Z_NULL; in init_compression()
131 if(deflateInit2(&zs, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -MAX_WBITS, in init_compression()
148 zs.avail_in = 0; in compress_file()
149 zs.next_in = in_buff; in compress_file()
151 zs.next_out = out_buff; in compress_file()
152 zs.avail_out = (uInt)RDSZ; in compress_file()
159 if(zs.avail_in == 0 && zs.avail_out > 0){ in compress_file()
176 zs.next_in = in_buff; in compress_file()
177 zs.avail_in = rdamt; in compress_file()
181 if(deflate(&zs, 0) != Z_OK){ in compress_file()
187 if(zs.avail_out == 0){ in compress_file()
195 zs.next_out = out_buff; in compress_file()
196 zs.avail_out = (uInt)RDSZ; in compress_file()
203 if(zs.avail_out < RDSZ){ in compress_file()
205 wramt = RDSZ - zs.avail_out; in compress_file()
212 zs.next_out = out_buff; in compress_file()
213 zs.avail_out = (uInt)RDSZ; in compress_file()
218 while(deflate(&zs, Z_FINISH) == Z_OK){ in compress_file()
219 wramt = RDSZ - zs.avail_out; in compress_file()
226 zs.next_out = out_buff; in compress_file()
227 zs.avail_out = (uInt)RDSZ; in compress_file()
231 if(zs.avail_out != RDSZ){ in compress_file()
232 wramt = RDSZ - zs.avail_out; in compress_file()
241 ze->usize = (ub4)zs.total_in; in compress_file()
242 ze->csize = (ub4)zs.total_out; in compress_file()
245 if(deflateReset(&zs) != Z_OK){ in compress_file()
258 if((rtval = deflateEnd(&zs)) != Z_OK && rtval != Z_DATA_ERROR){ in end_compression()
260 fprintf(stderr, "error: (%d) %s\n", rtval, zs.msg); in end_compression()
268 memset(&zs, 0, sizeof(z_stream)); in init_inflation()
270 zs.zalloc = Z_NULL; in init_inflation()
271 zs.zfree = Z_NULL; in init_inflation()
272 zs.opaque = Z_NULL; in init_inflation()
274 if(inflateInit2(&zs, -15) != Z_OK){ in init_inflation()
288 zs.avail_in = 0; in inflate_file()
295 if(zs.avail_in == 0){ in inflate_file()
307 zs.next_in = in_buff; in inflate_file()
308 zs.avail_in = rdamt; in inflate_file()
311 zs.next_out = out_buff; in inflate_file()
312 zs.avail_out = RDSZ; in inflate_file()
314 if((rtval = inflate(&zs, 0)) != Z_OK){ in inflate_file()
319 if(zs.avail_out != RDSZ){ in inflate_file()
320 crc = crc32(crc, out_buff, (RDSZ - zs.avail_out)); in inflate_file()
323 if(write(out_fd, out_buff, (RDSZ - zs.avail_out)) != in inflate_file()
324 (int)(RDSZ - zs.avail_out)){ in inflate_file()
336 if(zs.avail_out != RDSZ){ in inflate_file()
337 crc = crc32(crc, out_buff, (RDSZ - zs.avail_out)); in inflate_file()
340 if(write(out_fd, out_buff, (RDSZ - zs.avail_out)) != in inflate_file()
341 (int)(RDSZ - zs.avail_out)){ in inflate_file()
345 zs.next_out = out_buff; in inflate_file()
346 zs.avail_out = RDSZ; in inflate_file()
355 printf("%d bytes left over\n", zs.avail_in); in inflate_file()
364 pb_push(pbf, zs.next_in, zs.avail_in); in inflate_file()
366 ze->usize = zs.total_out; in inflate_file()
368 inflateReset(&zs); in inflate_file()
421 if((zs.next_in = in_buff = (Bytef *) malloc(csize))) { in ez_inflate_str()
422 if((zs.next_out = out_buff = (Bytef *) malloc(usize + 1))) { in ez_inflate_str()
423 if((rdamt = pb_read(pbf, zs.next_in, csize)) == csize) { in ez_inflate_str()
424 zs.avail_in = csize; in ez_inflate_str()
425 zs.avail_out = usize; in ez_inflate_str()
426 report_str_error(inflate(&zs, 0)); in ez_inflate_str()
428 inflateReset(&zs); in ez_inflate_str()
479 zs.avail_in = rdamt; in hrd_inflate_str()
480 zs.avail_out = 0; in hrd_inflate_str()
481 zs.next_in = in_buff; in hrd_inflate_str()
485 zs.next_out = &(out_buff[(RDSZ * (i - 1)) - zs.avail_out]); in hrd_inflate_str()
486 zs.avail_out += RDSZ; in hrd_inflate_str()
494 } while((zret = inflate(&zs, 0)) == Z_OK); in hrd_inflate_str()
497 pb_push(pbf, zs.next_in, zs.avail_in); in hrd_inflate_str()
499 out_buff[(RDSZ * (i - 1)) - zs.avail_out] = '\0'; in hrd_inflate_str()
500 *usize = zs.total_out; in hrd_inflate_str()
501 *csize = zs.total_in; in hrd_inflate_str()
503 inflateReset(&zs); in hrd_inflate_str()