- path has been copied twice
[m6w6/ext-http] / php_http_encoding_api.h
index aeb75806119ed1ab48554c02443aa22498f65d93..8c18f3a39188453886b330f712941c5d46c9567b 100644 (file)
 #ifndef PHP_HTTP_ENCODING_API_H
 #define PHP_HTTP_ENCODING_API_H
 
-#ifdef HTTP_HAVE_ZLIB
-#      include <zlib.h>
-#endif
-
 #define http_encoding_dechunk(e, el, d, dl) _http_encoding_dechunk((e), (el), (d), (dl) TSRMLS_CC)
 PHP_HTTP_API const char *_http_encoding_dechunk(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len TSRMLS_DC);
 
@@ -36,26 +32,24 @@ PHP_HTTP_API zend_bool _http_encoding_response_start(size_t content_length TSRML
 
 typedef enum {
        HTTP_ENCODING_NONE = 0,
-       HTTP_ENCODING_ANY  = 1,
        HTTP_ENCODING_GZIP,
        HTTP_ENCODING_DEFLATE,
-       HTTP_ENCODING_COMPRESS
 } http_encoding_type;
 
-#define http_encode(t, l, d, dl, r, rl) _http_encode((t), (l), (d), (dl), (r), (rl) TSRMLS_CC)
-PHP_HTTP_API STATUS _http_encode(http_encoding_type type, int level, const char *data, size_t data_len, char **encoded, size_t *encoded_len TSRMLS_DC);
-#define http_decode(t, d, dl, r, rl) _http_decode((t), (l), (d), (dl), (r), (rl) TSRMLS_CC)
-PHP_HTTP_API STATUS _http_decode(http_encoding_type type, const char *data, size_t data_len, char **decoded, size_t *decoded_len TSRMLS_DC);
+#define HTTP_ENCODING_STREAM_GZIP_HEADER       0x1
+#define HTTP_ENCODING_STREAM_ZLIB_HEADER       0x2
+#define HTTP_ENCODING_STREAM_PERSISTENT                0x4
 
 typedef struct {
        z_stream Z;
        int gzip;
+       int persistent;
        ulong crc;
-       phpstr *storage;
+       void *storage;
 } http_encoding_stream;
 
 #define http_encoding_stream_init(s, g, l, e, el) _http_encoding_stream_init((s), (g), (l), (e), (el) TSRMLS_CC)
-PHP_HTTP_API STATUS _http_encoding_stream_init(http_encoding_stream *s, int gzip, int level, char **encoded, size_t *encoded_len TSRMLS_DC);
+PHP_HTTP_API STATUS _http_encoding_stream_init(http_encoding_stream *s, int flags, int level, char **encoded, size_t *encoded_len TSRMLS_DC);
 #define http_encoding_stream_update(s, d, dl, e, el) _http_encoding_stream_update((s), (d), (dl), (e), (el) TSRMLS_CC)
 PHP_HTTP_API STATUS _http_encoding_stream_update(http_encoding_stream *s, const char *data, size_t data_len, char **encoded, size_t *encoded_len TSRMLS_DC);
 #define http_encoding_stream_finish(s, e, el) _http_encoding_stream_finish((s), (e), (el) TSRMLS_CC)