Lines Matching refs:Z
79 inflateEnd(&intern->Z); in inflate_context_free_obj()
114 deflateEnd(&intern->Z); in deflate_context_free_obj()
175 …if (Z_OK != deflateInit2(&ctx->Z, ZLIBG(output_compression_level), Z_DEFLATED, ZLIBG(compression_c… in php_zlib_output_handler_ex()
182 deflateEnd(&ctx->Z); in php_zlib_output_handler_ex()
189 …if (Z_OK != deflateInit2(&ctx->Z, ZLIBG(output_compression_level), Z_DEFLATED, ZLIBG(compression_c… in php_zlib_output_handler_ex()
199 deflateEnd(&ctx->Z); in php_zlib_output_handler_ex()
214 ctx->Z.avail_in = ctx->buffer.used; in php_zlib_output_handler_ex()
215 ctx->Z.next_in = (Bytef *) ctx->buffer.data; in php_zlib_output_handler_ex()
216 ctx->Z.avail_out = output_context->out.size; in php_zlib_output_handler_ex()
217 ctx->Z.next_out = (Bytef *) output_context->out.data; in php_zlib_output_handler_ex()
225 switch (deflate(&ctx->Z, flags)) { in php_zlib_output_handler_ex()
228 deflateEnd(&ctx->Z); in php_zlib_output_handler_ex()
233 if (ctx->Z.avail_in) { in php_zlib_output_handler_ex()
234 … memmove(ctx->buffer.data, ctx->buffer.data + ctx->buffer.used - ctx->Z.avail_in, ctx->Z.avail_in); in php_zlib_output_handler_ex()
236 ctx->buffer.free += ctx->buffer.used - ctx->Z.avail_in; in php_zlib_output_handler_ex()
237 ctx->buffer.used = ctx->Z.avail_in; in php_zlib_output_handler_ex()
238 output_context->out.used = output_context->out.size - ctx->Z.avail_out; in php_zlib_output_handler_ex()
241 deflateEnd(&ctx->Z); in php_zlib_output_handler_ex()
246 deflateEnd(&ctx->Z); in php_zlib_output_handler_ex()
289 deflateEnd(&ctx->Z); in php_zlib_output_handler()
300 deflateEnd(&ctx->Z); in php_zlib_output_handler()
317 ctx->Z.zalloc = php_zlib_alloc; in php_zlib_output_handler_context_init()
318 ctx->Z.zfree = php_zlib_free; in php_zlib_output_handler_context_init()
387 z_stream Z; in php_zlib_encode() local
390 memset(&Z, 0, sizeof(z_stream)); in php_zlib_encode()
391 Z.zalloc = php_zlib_alloc; in php_zlib_encode()
392 Z.zfree = php_zlib_free; in php_zlib_encode()
394 …if (Z_OK == (status = deflateInit2(&Z, level, Z_DEFLATED, encoding, MAX_MEM_LEVEL, Z_DEFAULT_STRAT… in php_zlib_encode()
397 Z.next_in = (Bytef *) in_buf; in php_zlib_encode()
398 Z.next_out = (Bytef *) ZSTR_VAL(out); in php_zlib_encode()
399 Z.avail_in = in_len; in php_zlib_encode()
400 Z.avail_out = ZSTR_LEN(out); in php_zlib_encode()
402 status = deflate(&Z, Z_FINISH); in php_zlib_encode()
403 deflateEnd(&Z); in php_zlib_encode()
407 out = zend_string_truncate(out, Z.total_out, 0); in php_zlib_encode()
421 static inline int php_zlib_inflate_rounds(z_stream *Z, size_t max, char **buf, size_t *len) in php_zlib_inflate_rounds() argument
429 buffer.size = (max && (max < Z->avail_in)) ? max : Z->avail_in; in php_zlib_inflate_rounds()
436 Z->avail_out = buffer.free = buffer.size - buffer.used; in php_zlib_inflate_rounds()
437 Z->next_out = (Bytef *) buffer.data + buffer.used; in php_zlib_inflate_rounds()
439 …vail_out=%7lu\n", round, status, buffer.size, buffer.free, buffer.used, Z->avail_in, Z->avail_out); in php_zlib_inflate_rounds()
441 status = inflate(Z, Z_NO_FLUSH); in php_zlib_inflate_rounds()
443 buffer.used += buffer.free - Z->avail_out; in php_zlib_inflate_rounds()
444 buffer.free = Z->avail_out; in php_zlib_inflate_rounds()
446 …vail_out=%7lu\n", round, status, buffer.size, buffer.free, buffer.used, Z->avail_in, Z->avail_out); in php_zlib_inflate_rounds()
450 } while ((Z_BUF_ERROR == status || (Z_OK == status && Z->avail_in)) && ++round < 100); in php_zlib_inflate_rounds()
473 z_stream Z; in php_zlib_decode() local
475 memset(&Z, 0, sizeof(z_stream)); in php_zlib_decode()
476 Z.zalloc = php_zlib_alloc; in php_zlib_decode()
477 Z.zfree = php_zlib_free; in php_zlib_decode()
481 status = inflateInit2(&Z, encoding); in php_zlib_decode()
483 Z.next_in = (Bytef *) in_buf; in php_zlib_decode()
484 Z.avail_in = in_len + 1; /* NOTE: data must be zero terminated */ in php_zlib_decode()
486 switch (status = php_zlib_inflate_rounds(&Z, max_len, out_buf, out_len)) { in php_zlib_decode()
488 inflateEnd(&Z); in php_zlib_decode()
494 inflateEnd(&Z); in php_zlib_decode()
499 inflateEnd(&Z); in php_zlib_decode()
515 deflateEnd(&(ZLIBG(ob_gzhandler)->Z)); in php_zlib_cleanup_ob_gzhandler_mess()
897 ctx->Z.zalloc = php_zlib_alloc; in PHP_FUNCTION()
898 ctx->Z.zfree = php_zlib_free; in PHP_FUNCTION()
909 if (inflateInit2(&ctx->Z, encoding) != Z_OK) { in PHP_FUNCTION()
916 switch (inflateSetDictionary(&ctx->Z, (Bytef *) ctx->inflateDict, ctx->inflateDictlen)) { in PHP_FUNCTION()
967 inflateReset(&ctx->Z); in PHP_FUNCTION()
975 ctx->Z.next_in = (Bytef *) in_buf; in PHP_FUNCTION()
976 ctx->Z.next_out = (Bytef *) ZSTR_VAL(out); in PHP_FUNCTION()
977 ctx->Z.avail_in = in_len; in PHP_FUNCTION()
978 ctx->Z.avail_out = ZSTR_LEN(out); in PHP_FUNCTION()
981 status = inflate(&ctx->Z, flush_type); in PHP_FUNCTION()
982 buffer_used = ZSTR_LEN(out) - ctx->Z.avail_out; in PHP_FUNCTION()
988 if (ctx->Z.avail_out == 0) { in PHP_FUNCTION()
991 ctx->Z.avail_out = CHUNK_SIZE; in PHP_FUNCTION()
992 ctx->Z.next_out = (Bytef *) ZSTR_VAL(out) + buffer_used; in PHP_FUNCTION()
1000 if (flush_type == Z_FINISH && ctx->Z.avail_out == 0) { in PHP_FUNCTION()
1003 ctx->Z.avail_out = CHUNK_SIZE; in PHP_FUNCTION()
1004 ctx->Z.next_out = (Bytef *) ZSTR_VAL(out) + buffer_used; in PHP_FUNCTION()
1012 switch (inflateSetDictionary(&ctx->Z, (Bytef *) ctx->inflateDict, ctx->inflateDictlen)) { in PHP_FUNCTION()
1072 RETURN_LONG(ctx->Z.total_in); in PHP_FUNCTION()
1146 ctx->Z.zalloc = php_zlib_alloc; in PHP_FUNCTION()
1147 ctx->Z.zfree = php_zlib_free; in PHP_FUNCTION()
1155 if (deflateInit2(&ctx->Z, level, Z_DEFLATED, encoding, memory, strategy) != Z_OK) { in PHP_FUNCTION()
1162 int success = deflateSetDictionary(&ctx->Z, (Bytef *) dict, dictlen); in PHP_FUNCTION()
1212 ctx->Z.next_in = (Bytef *) in_buf; in PHP_FUNCTION()
1213 ctx->Z.next_out = (Bytef *) ZSTR_VAL(out); in PHP_FUNCTION()
1214 ctx->Z.avail_in = in_len; in PHP_FUNCTION()
1215 ctx->Z.avail_out = ZSTR_LEN(out); in PHP_FUNCTION()
1220 if (ctx->Z.avail_out == 0) { in PHP_FUNCTION()
1224 ctx->Z.avail_out = 64; in PHP_FUNCTION()
1225 ctx->Z.next_out = (Bytef *) ZSTR_VAL(out) + buffer_used; in PHP_FUNCTION()
1227 status = deflate(&ctx->Z, flush_type); in PHP_FUNCTION()
1228 buffer_used = ZSTR_LEN(out) - ctx->Z.avail_out; in PHP_FUNCTION()
1229 } while (status == Z_OK && ctx->Z.avail_out == 0); in PHP_FUNCTION()
1233 ZSTR_LEN(out) = (char *) ctx->Z.next_out - ZSTR_VAL(out); in PHP_FUNCTION()
1238 ZSTR_LEN(out) = (char *) ctx->Z.next_out - ZSTR_VAL(out); in PHP_FUNCTION()
1240 deflateReset(&ctx->Z); in PHP_FUNCTION()