Lines Matching defs:len
23 local int gz_load(state, buf, len, have)
26 unsigned len;
33 ret = read(state->fd, buf + *have, len - *have);
37 } while (*have < len);
258 /* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */
259 local int gz_skip(state, len)
261 z_off64_t len;
265 /* skip over len bytes or reach end-of-file, whichever comes first */
266 while (len)
269 n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ?
270 (unsigned)len : state->x.have;
274 len -= n;
291 int ZEXPORT gzread(file, buf, len)
294 unsigned len;
311 /* since an int is returned, make sure len fits in one, otherwise return
313 if ((int)len < 0) {
318 /* if len is zero, avoid unnecessary operations */
319 if (len == 0)
329 /* get len bytes to buf, or less than len if at the end */
334 n = state->x.have > len ? len : state->x.have;
346 /* need output data -- for small len or new stream load up our output
348 else if (state->how == LOOK || len < (state->size << 1)) {
357 /* large len -- read directly into user buffer */
359 if (gz_load(state, (unsigned char *)buf, len, &n) == -1)
363 /* large len -- decompress directly into user buffer */
365 strm->avail_out = len;
374 len -= n;
378 } while (len);
486 char * ZEXPORT gzgets(file, buf, len)
489 int len;
497 if (file == NULL || buf == NULL || len < 1)
513 /* copy output bytes up to new line or len - 1, whichever comes first --
517 left = (unsigned)len - 1;