Lines Matching refs:len
135 /* Compress len zeros to output. Return -1 on error, 0 on success. */
136 local int gz_zero(state, len)
138 z_off64_t len;
148 /* compress len zeros (len guaranteed > 0) */
150 while (len) {
151 n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
152 (unsigned)len : state->size;
162 len -= n;
168 int ZEXPORT gzwrite(file, buf, len)
171 unsigned len;
173 unsigned put = len;
187 /* since an int is returned, make sure len fits in one, otherwise return
189 if ((int)len < 0) {
194 /* if len is zero, avoid unnecessary operations */
195 if (len == 0)
209 /* for small len, copy to input buffer, otherwise compress directly */
210 if (len < state->size) {
219 if (copy > len)
220 copy = len;
225 len -= copy;
226 if (len && gz_comp(state, Z_NO_FLUSH) == -1)
228 } while (len);
236 strm->avail_in = len;
238 state->x.pos += len;
301 unsigned len;
304 len = (unsigned)strlen(str);
305 ret = gzwrite(file, str, len);
306 return ret == 0 && len != 0 ? -1 : ret;
315 int size, len;
344 /* do the printf() into the input buffer, put length in len */
350 for (len = 0; len < size; len++)
351 if (state->in[len] == 0) break;
353 len = vsprintf((char *)(state->in), format, va);
358 len = strlen((char *)(state->in));
360 len = vsnprintf((char *)(state->in), size, format, va);
365 if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
369 strm->avail_in = (unsigned)len;
371 state->x.pos += len;
372 return len;
396 int size, len;
429 /* do the printf() into the input buffer, put length in len */
436 for (len = 0; len < size; len++)
437 if (state->in[len] == 0) break;
439 len = sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,
446 len = strlen((char *)(state->in));
448 len = snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6,
455 if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
459 strm->avail_in = (unsigned)len;
461 state->x.pos += len;
462 return len;