• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/timemachine/zlib-1.2.3/examples/

Lines Matching defs:access

1 /* zran.c -- example of zlib/gzip stream indexing and random access
7 for random access of a compressed file. A file containing a zlib or gzip
9 its entirety, and an index built with access points about every SPAN bytes
14 An access point can be created at the start of any deflate block, by saving
21 a new access point. If so, that point is saved in a data structure that
34 requests for random access reads from the compressed data would try to use
39 access, mainly copying the 32K byte dictionary. So if small pieces of the
44 not be constrained to have access points at block boundaries, but requires
45 more memory per access point, and also cannot be saved to file due to the
57 #define SPAN 1048576L /* desired distance between access points */
61 /* access point entry */
69 /* access point list */
70 struct access {
77 local void free_index(struct access *index)
85 /* Add an entry to the access point list. If out of memory, deallocate the
87 local struct access *addpoint(struct access *index, int bits,
94 index = malloc(sizeof(struct access));
132 access points about every span bytes of uncompressed output -- span is
133 chosen to balance the speed of random access against the memory requirements
134 of the list, about 32K bytes per access point. Note that data after the end
136 returns the number of access points on success (>= 1), Z_MEM_ERROR for out
139 local int build_index(FILE *in, off_t span, struct access **built)
143 off_t last; /* totout value of last access point */
144 struct access *index; /* access points being generated */
206 index always has at least one access point; we avoid creating an
207 access point after the last block by checking bit 6 of data_type
244 local int extract(FILE *in, struct access *index, off_t offset,
354 struct access *index;
387 fprintf(stderr, "zran: built index with %d access points\n", len);