Lines Matching defs:len
14 local int gz_load(gz_statep state, unsigned char *buf, unsigned len,
22 get = len - *have;
33 } while (*have < len);
266 /* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */
267 local int gz_skip(gz_statep state, z_off64_t len)
271 /* skip over len bytes or reach end-of-file, whichever comes first */
272 while (len)
275 n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ?
276 (unsigned)len : state->x.have;
280 len -= n;
300 /* Read len bytes into buf from file, or less than len up to the end of the
304 local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len)
309 /* if len is zero, avoid unnecessary operations */
310 if (len == 0)
324 /* get len bytes to buf, or less than len if at the end */
327 /* set n to the maximum amount of len that fits in an unsigned int */
329 if (n > len)
331 n = (unsigned)len;
351 /* need output data -- for small len or new stream load up our output
364 /* large len -- read directly into user buffer */
372 /* large len -- decompress directly into user buffer */
385 len -= n;
389 } while (len);
396 int ZEXPORT gzread(gzFile file, voidp buf, unsigned len)
414 /* since an int is returned, make sure len fits in one, otherwise return
416 if ((int)len < 0) {
421 /* read len or fewer bytes to buf */
422 len = (unsigned)gz_read(state, buf, len);
425 if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR)
431 return (int)len;
437 z_size_t len;
455 len = nitems * size;
456 if (size && len / size != nitems) {
461 /* read len or fewer bytes to buf, return the number of full items read */
462 return len ? gz_read(state, buf, len) / size : 0;
580 char * ZEXPORT gzgets(gzFile file, char *buf, int len)
588 if (file == NULL || buf == NULL || len < 1)
610 /* copy output bytes up to new line or len - 1, whichever comes first --
614 left = (unsigned)len - 1;