Lines Matching defs:offset

28 // the starting file offset and bit of that block, and the 32K bytes of
29 // uncompressed data that precede that block. Also the uncompressed offset of
37 // To use the index, an offset in the uncompressed data is provided, for which
38 // the latest access point at or preceding that offset is located in the index.
42 // decompression then proceeds until the desired offset in the file is reached.
146 off_t last; // last access point uncompressed offset
335 off_t offset, unsigned char *buf, size_t len)
342 if (len == 0 || offset < 0 || offset >= index->length)
345 // Find the access point closest to but not after offset.
350 if (offset < point[mid].out)
372 // Skip uncompressed bytes until offset reached, then satisfy request.
375 offset -= point->out; // number of bytes to skip to get to offset
376 size_t left = len; // number of bytes left to read after offset
378 if (offset) {
379 // Discard up to offset uncompressed bytes.
380 strm.avail_out = offset < WINSIZE ? (unsigned)offset : WINSIZE;
404 if (offset)
405 offset -= got;
469 // stdout. An offset can be provided as the second argument, in which case the
475 fprintf(stderr, "usage: zran file.raw [offset]\n");
484 // Get optional offset.
485 off_t offset = -1;
488 offset = strtoll(argv[2], &end, 10);
489 if (*end || offset < 0) {
490 fprintf(stderr, "zran: %s is not a valid offset\n", argv[2]);
520 // Use index by reading some bytes from an arbitrary offset.
522 if (offset == -1)
523 offset = ((index->length + 1) << 1) / 3;
524 ptrdiff_t got = deflate_index_extract(in, index, offset, buf, LEN);
530 fprintf(stderr, "zran: extracted %ld bytes at %lld\n", got, offset);