Lines Matching defs:len
110 /* Compress len zeros to output. Return -1 on error, 0 on success. */
111 local int gz_zero(state, len)
113 z_off64_t len;
123 /* compress len zeros (len guaranteed > 0) */
125 while (len) {
126 n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
127 (unsigned)len : state->size;
137 len -= n;
143 int ZEXPORT gzwrite(file, buf, len)
146 unsigned len;
148 unsigned put = len;
163 /* since an int is returned, make sure len fits in one, otherwise return
165 if ((int)len < 0) {
170 /* if len is zero, avoid unnecessary operations */
171 if (len == 0)
185 /* for small len, copy to input buffer, otherwise compress directly */
186 if (len < state->size) {
192 if (n > len)
193 n = len;
198 len -= n;
199 if (len && gz_comp(state, Z_NO_FLUSH) == -1)
201 } while (len);
209 strm->avail_in = len;
211 state->pos += len;
269 unsigned len;
272 len = (unsigned)strlen(str);
273 ret = gzwrite(file, str, len);
274 return ret == 0 && len != 0 ? -1 : ret;
283 int size, len;
313 /* do the printf() into the input buffer, put length in len */
321 for (len = 0; len < size; len++)
322 if (state->in[len] == 0) break;
324 len = vsprintf(state->in, format, va);
331 len = strlen(state->in);
333 len = vsnprintf((char *)(state->in), size, format, va);
339 if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
343 strm->avail_in = (unsigned)len;
345 state->pos += len;
346 return len;
359 int size, len;
388 /* do the printf() into the input buffer, put length in len */
395 for (len = 0; len < size; len++)
396 if (state->in[len] == 0) break;
398 len = sprintf(state->in, format, a1, a2, a3, a4, a5, a6, a7, a8,
405 len = strlen(state->in);
407 len = snprintf(state->in, size, format, a1, a2, a3, a4, a5, a6, a7, a8,
413 if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
417 strm->avail_in = (unsigned)len;
419 state->pos += len;
420 return len;