Go to the documentation of this file.
64 #define WINSIZE 32768U
90 off_t
in, off_t
out,
unsigned left,
91 unsigned char *window)
98 if (
index == NULL)
return NULL;
99 index->list = malloc(
sizeof(
struct point) << 3);
100 if (
index->list == NULL) {
159 totin = totout = last = 0;
167 goto deflate_index_build_error;
171 goto deflate_index_build_error;
176 if (totin == 0 && strm.
avail_in >= 3 &&
198 goto deflate_index_build_error;
204 goto deflate_index_build_error;
220 (totout == 0 || totout - last > span)) {
225 goto deflate_index_build_error;
236 index->length = totout;
241 deflate_index_build_error:
249 unsigned char *
buf,
int len)
255 unsigned char discard[
WINSIZE];
278 goto deflate_index_extract_ret;
283 goto deflate_index_extract_ret;
317 goto deflate_index_extract_ret;
321 goto deflate_index_extract_ret;
329 goto deflate_index_extract_ret;
332 if (
index->gzip == 0)
355 goto deflate_index_extract_ret;
361 goto deflate_index_extract_ret;
365 goto deflate_index_extract_ret;
371 goto deflate_index_extract_ret;
378 goto deflate_index_extract_ret;
396 deflate_index_extract_ret:
403 #define SPAN 1048576L
411 int main(
int argc,
char **argv)
420 if (argc < 2 || argc > 3) {
421 fprintf(
stderr,
"usage: zran file.gz [offset]\n");
424 in = fopen(argv[1],
"rb");
426 fprintf(
stderr,
"zran: could not open %s for reading\n", argv[1]);
435 fprintf(
stderr,
"zran: %s is not a valid offset\n", argv[2]);
446 fprintf(
stderr,
"zran: out of memory\n");
449 fprintf(
stderr,
"zran: compressed data error in %s\n", argv[1]);
452 fprintf(
stderr,
"zran: read error on %s\n", argv[1]);
455 fprintf(
stderr,
"zran: error %d while building index\n",
len);
459 fprintf(
stderr,
"zran: built index with %d access points\n",
len);
466 fprintf(
stderr,
"zran: extraction failed: %s error\n",
int ZEXPORT inflateEnd(z_streamp strm)
int ZEXPORT inflate(z_streamp strm, int flush)
int ZEXPORT inflateReset2(z_streamp strm, int windowBits)
int deflate_index_extract(FILE *in, struct deflate_index *index, off_t offset, unsigned char *buf, int len)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
int main(int argc, char **argv)
OPENSSL_EXPORT ASN1_BIT_STRING * bits
int deflate_index_build(FILE *in, off_t span, struct deflate_index **built)
int ZEXPORT inflatePrime(z_streamp strm, int bits, int value)
static struct deflate_index * addpoint(struct deflate_index *index, int bits, off_t in, off_t out, unsigned left, unsigned char *window)
void deflate_index_free(struct deflate_index *index)
int ZEXPORT inflateReset(z_streamp strm)
UniquePtr< SSL_SESSION > ret
AllocList * next[kMaxLevel]
int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary, uInt dictLength)
unsigned char window[WINSIZE]
#define inflateInit2(strm, windowBits)
grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:01