Lines Matching defs:size
1 /* fitblk.c: example of fitting compressed output to a specified size
8 Use fixed-size, stack-allocated raw buffers
14 /* Approach to just fitting a requested compressed size:
18 nearly the requested output block size. The first pass generates
20 output size plus a specfied excess amount (see the EXCESS define
26 The last deflate block of the result will be of a comparable size
31 requested size minus an amount to allow the compressed stream to
34 requested size. Assuming sufficient input and a requested size
39 before filling the requested output size, then that compressed
47 out the requested size, and small enough so that the final deflate
48 block of the second pass will be close in size to the final deflate
68 #define RAWLEN 4096 /* intermediate uncompressed buffer size */
126 /* compress from stdin to fixed-size block on stdout */
130 unsigned size; /* requested fixed output block size */
133 unsigned char *tmp; /* close to desired size stream */
136 /* get requested output size */
138 quit("need one argument: size of output block");
142 if (ret < 8) /* 8 is minimum zlib stream size */
143 quit("need positive size of 8 or greater");
144 size = (unsigned)ret;
147 blk = malloc(size + EXCESS);
156 def.avail_out = size + EXCESS;
162 /* if it all fit, then size was undersubscribed -- done! */
165 have = size + EXCESS - def.avail_out;
175 size - have, size);
186 tmp = malloc(size + EXCESS);
193 inf.avail_in = size + EXCESS;
195 def.avail_out = size + EXCESS;
208 inf.avail_in = size - MARGIN; /* assure stream will complete */
210 def.avail_out = size;
218 have = size - def.avail_out;
231 size - have, size, def.total_in);