-extern PHP_RINIT_FUNCTION(http_encoding);
-extern PHP_RSHUTDOWN_FUNCTION(http_encoding);
-
-#define PHP_HTTP_INFLATE_ROUNDS 100
-
-#define PHP_HTTP_DEFLATE_BUFFER_SIZE_GUESS(S) \
- (((size_t) ((double) S * (double) 1.015)) + 10 + 8 + 4 + 1)
-#define PHP_HTTP_INFLATE_BUFFER_SIZE_GUESS(S) \
- (((S) + 1) << 3)
-#define PHP_HTTP_INFLATE_BUFFER_SIZE_ALIGN(S) \
- ((S) += (S) >> (3))
-
-#define PHP_HTTP_DEFLATE_BUFFER_SIZE 0x8000
-#define PHP_HTTP_INFLATE_BUFFER_SIZE 0x1000
-
-#define PHP_HTTP_DEFLATE_LEVEL_DEF 0x00000000
-#define PHP_HTTP_DEFLATE_LEVEL_MIN 0x00000001
-#define PHP_HTTP_DEFLATE_LEVEL_MAX 0x00000009
-#define PHP_HTTP_DEFLATE_TYPE_ZLIB 0x00000000
-#define PHP_HTTP_DEFLATE_TYPE_GZIP 0x00000010
-#define PHP_HTTP_DEFLATE_TYPE_RAW 0x00000020
-#define PHP_HTTP_DEFLATE_STRATEGY_DEF 0x00000000
-#define PHP_HTTP_DEFLATE_STRATEGY_FILT 0x00000100
-#define PHP_HTTP_DEFLATE_STRATEGY_HUFF 0x00000200
-#define PHP_HTTP_DEFLATE_STRATEGY_RLE 0x00000300
-#define PHP_HTTP_DEFLATE_STRATEGY_FIXED 0x00000400
-
-#define PHP_HTTP_DEFLATE_LEVEL_SET(flags, level) \
- switch (flags & 0xf) \
- { \
- default: \
- if ((flags & 0xf) < 10) { \
- level = flags & 0xf; \
- break; \
- } \
- case PHP_HTTP_DEFLATE_LEVEL_DEF: \
- level = Z_DEFAULT_COMPRESSION; \
- break; \
- }
-
-#define PHP_HTTP_DEFLATE_WBITS_SET(flags, wbits) \
- switch (flags & 0xf0) \
- { \
- case PHP_HTTP_DEFLATE_TYPE_GZIP: \
- wbits = PHP_HTTP_WINDOW_BITS_GZIP; \
- break; \
- case PHP_HTTP_DEFLATE_TYPE_RAW: \
- wbits = PHP_HTTP_WINDOW_BITS_RAW; \
- break; \
- default: \
- wbits = PHP_HTTP_WINDOW_BITS_ZLIB; \
- break; \
- }
-
-#define PHP_HTTP_INFLATE_WBITS_SET(flags, wbits) \
- if (flags & PHP_HTTP_INFLATE_TYPE_RAW) { \
- wbits = PHP_HTTP_WINDOW_BITS_RAW; \
-} else { \
- wbits = PHP_HTTP_WINDOW_BITS_ANY; \
-}
-
-#define PHP_HTTP_DEFLATE_STRATEGY_SET(flags, strategy) \
- switch (flags & 0xf00) \
- { \
- case PHP_HTTP_DEFLATE_STRATEGY_FILT: \
- strategy = Z_FILTERED; \
- break; \
- case PHP_HTTP_DEFLATE_STRATEGY_HUFF: \
- strategy = Z_HUFFMAN_ONLY; \
- break; \
- case PHP_HTTP_DEFLATE_STRATEGY_RLE: \
- strategy = Z_RLE; \
- break; \
- case PHP_HTTP_DEFLATE_STRATEGY_FIXED: \
- strategy = Z_FIXED; \
- break; \
- default: \
- strategy = Z_DEFAULT_STRATEGY; \
- break; \
- }
-
-#define PHP_HTTP_WINDOW_BITS_ZLIB 0x0000000f
-#define PHP_HTTP_WINDOW_BITS_GZIP 0x0000001f
-#define PHP_HTTP_WINDOW_BITS_ANY 0x0000002f
-#define PHP_HTTP_WINDOW_BITS_RAW -0x000000f
-
-#ifndef Z_FIXED
-/* Z_FIXED does not exist prior 1.2.2.2 */
-# define Z_FIXED 0
-#endif