Lines Matching defs:rb
455 rbzs_grow(resbuf_t *rb)
457 off_t ptroff = (caddr_t)rb->rb_zstr.next_out - rb->rb_base;
459 rb->rb_size += RES_BUF_CHUNK_SIZE;
460 rb->rb_base = xrealloc(rb->rb_base, rb->rb_size);
461 rb->rb_ptr = rb->rb_base + ptroff;
462 rb->rb_zstr.next_out = (Bytef *)(rb->rb_ptr);
463 rb->rb_zstr.avail_out += RES_BUF_CHUNK_SIZE;
467 compress_start(resbuf_t *rb)
471 rb->rb_zstr.zalloc = (alloc_func)0;
472 rb->rb_zstr.zfree = (free_func)0;
473 rb->rb_zstr.opaque = (voidpf)0;
475 if ((rc = deflateInit(&rb->rb_zstr, Z_BEST_COMPRESSION)) != Z_OK)
482 resbuf_t *rb = (resbuf_t *)data;
485 rb->rb_zstr.next_out = (Bytef *)rb->rb_ptr;
486 rb->rb_zstr.avail_out = rb->rb_size - (rb->rb_ptr - rb->rb_base);
487 rb->rb_zstr.next_in = (Bytef *)buf;
488 rb->rb_zstr.avail_in = n;
490 while (rb->rb_zstr.avail_in) {
491 if (rb->rb_zstr.avail_out == 0)
492 rbzs_grow(rb);
494 if ((rc = deflate(&rb->rb_zstr, Z_NO_FLUSH)) != Z_OK)
497 rb->rb_ptr = (caddr_t)rb->rb_zstr.next_out;
503 compress_flush(resbuf_t *rb, int type)
508 if (rb->rb_zstr.avail_out == 0)
509 rbzs_grow(rb);
511 rc = deflate(&rb->rb_zstr, type);
518 rb->rb_ptr = (caddr_t)rb->rb_zstr.next_out;
522 compress_end(resbuf_t *rb)
526 compress_flush(rb, Z_FINISH);
528 if ((rc = deflateEnd(&rb->rb_zstr)) != Z_OK)