Lines Matching refs:buffer_size

243 static int enlarge_buffer(void **buffer, size_t *buffer_size, size_t *buffer_allocated) {
247 if (*buffer_allocated > *buffer_size)
250 l = MAX(16*1024U, (*buffer_size * 2));
261 int import_compress(ImportCompress *c, const void *data, size_t size, void **buffer, size_t *buffer_size, size_t *buffer_allocated) {
266 assert(buffer_size);
277 *buffer_size = 0;
289 r = enlarge_buffer(buffer, buffer_size, buffer_allocated);
293 c->xz.next_out = (uint8_t*) *buffer + *buffer_size;
294 c->xz.avail_out = *buffer_allocated - *buffer_size;
300 *buffer_size += (*buffer_allocated - *buffer_size) - c->xz.avail_out;
311 r = enlarge_buffer(buffer, buffer_size, buffer_allocated);
315 c->gzip.next_out = (uint8_t*) *buffer + *buffer_size;
316 c->gzip.avail_out = *buffer_allocated - *buffer_size;
322 *buffer_size += (*buffer_allocated - *buffer_size) - c->gzip.avail_out;
333 r = enlarge_buffer(buffer, buffer_size, buffer_allocated);
337 c->bzip2.next_out = (void*) ((uint8_t*) *buffer + *buffer_size);
338 c->bzip2.avail_out = *buffer_allocated - *buffer_size;
344 *buffer_size += (*buffer_allocated - *buffer_size) - c->bzip2.avail_out;
363 *buffer_size = size;
373 int import_compress_finish(ImportCompress *c, void **buffer, size_t *buffer_size, size_t *buffer_allocated) {
378 assert(buffer_size);
384 *buffer_size = 0;
394 r = enlarge_buffer(buffer, buffer_size, buffer_allocated);
398 c->xz.next_out = (uint8_t*) *buffer + *buffer_size;
399 c->xz.avail_out = *buffer_allocated - *buffer_size;
405 *buffer_size += (*buffer_allocated - *buffer_size) - c->xz.avail_out;
415 r = enlarge_buffer(buffer, buffer_size, buffer_allocated);
419 c->gzip.next_out = (uint8_t*) *buffer + *buffer_size;
420 c->gzip.avail_out = *buffer_allocated - *buffer_size;
426 *buffer_size += (*buffer_allocated - *buffer_size) - c->gzip.avail_out;
435 r = enlarge_buffer(buffer, buffer_size, buffer_allocated);
439 c->bzip2.next_out = (void*) ((uint8_t*) *buffer + *buffer_size);
440 c->bzip2.avail_out = *buffer_allocated - *buffer_size;
446 *buffer_size += (*buffer_allocated - *buffer_size) - c->bzip2.avail_out;