+ freeObject(o);
+}
+
+/* {{{ proto void HttpInflateStream::__construct([int flags = 0])
+ Creates a new HttpInflateStream object instance. */
+PHP_METHOD(HttpInflateStream, __construct)
+{
+ long flags = 0;
+
+ SET_EH_THROW_HTTP();
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags)) {
+ getObject(http_inflatestream_object, obj);
+
+ if (!obj->stream) {
+ obj->stream = http_encoding_inflate_stream_init(NULL, flags & 0x0fffffff);
+ } else {
+ http_error_ex(HE_WARNING, HTTP_E_ENCODING, "HttpInflateStream cannot be initialized twice");
+ }
+ }
+ SET_EH_NORMAL();
+}
+/* }}} */
+
+/* {{{ proto HttpInflateStream HttpInflateStream::factory([int flags[, string class = "HttpInflateStream"]])
+ Creates a new HttpInflateStream object instance. */
+PHP_METHOD(HttpInflateStream, factory)
+{
+ long flags = 0;
+ char *cn = NULL;
+ int cl = 0;
+
+ SET_EH_THROW_HTTP();
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &flags, &cn, &cl)) {
+ zend_object_value ov;
+ http_encoding_stream *s = http_encoding_inflate_stream_init(NULL, flags & 0x0fffffff);
+
+ if (SUCCESS == http_object_new(&ov, cn, cl, _http_inflatestream_object_new_ex, http_inflatestream_object_ce, s, NULL)) {
+ RETVAL_OBJVAL(ov, 0);
+ }
+ }
+ SET_EH_NORMAL();