Lines Matching defs:in
3 * For conditions of distribution and use, see copyright notice in zlib.h
8 stream is provided on the command line. The compressed stream is decoded in
10 in the uncompressed output. The compressed file is left open, and can then
18 point in the uncompressed stream. build_index() works by decompressing the
21 a new access point. If so, that point is saved in a data structure that
24 To use the index, an offset in the uncompressed data is provided, for which
25 the latest accees point at or preceding that offset is located in the index.
26 The input file is positioned to the specified location in the index, and if
29 the decompression then proceeds until the desired offset in the file is
46 use of pointers in the state. The approach here allows for storage of the
47 index in a file.
63 off_t out; /* corresponding offset in uncompressed data */
64 off_t in; /* offset in input file of first full byte */
65 int bits; /* number of bits (1-7) from byte at in - 1, or 0 */
71 int have; /* number of list entries filled in */
88 off_t in, off_t out, unsigned left, unsigned char *window)
116 /* fill in entry and increment how many we have */
119 next->in = in;
135 of the first zlib or gzip stream in the file is ignored. build_index()
137 of memory, Z_DATA_ERROR for an error in the input file, or Z_ERRNO for a
139 local int build_index(FILE *in, off_t span, struct access **built)
167 strm.avail_in = fread(input, 1, CHUNK, in);
168 if (ferror(in)) {
222 /* clean up and return index (release unused entries in list) */
244 local int extract(FILE *in, struct access *index, off_t offset,
257 /* find where in stream to start */
272 ret = fseeko(in, here->in - (here->bits ? 1 : 0), SEEK_SET);
276 ret = getc(in);
278 ret = ferror(in) ? Z_ERRNO : Z_DATA_ERROR;
310 strm.avail_in = fread(input, 1, CHUNK, in);
311 if (ferror(in)) {
353 FILE *in;
362 in = fopen(argv[1], "rb");
363 if (in == NULL) {
369 len = build_index(in, SPAN, &index);
371 fclose(in);
377 fprintf(stderr, "zran: compressed data error in %s\n", argv[1]);
391 len = extract(in, index, offset, buf, CHUNK);
402 fclose(in);