+/* {{{ proto string http_negotiate(mixed value, array supported[, array &result])
+ Negotiate the user supplied value. */
+PHP_FUNCTION(http_negotiate)
+{
+ zval *value, *supported, *rs_array = NULL;
+ HashTable *rs;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za|z", &value, &supported, &rs_array)) {
+ RETURN_FALSE;
+ }
+
+ if (rs_array) {
+ zval_dtor(rs_array);
+ array_init(rs_array);
+ }
+
+ if ((rs = http_negotiate_z(value, Z_ARRVAL_P(supported), http_negotiate_default_func))) {
+ HTTP_DO_NEGOTIATE_HANDLE_RESULT(rs, supported, rs_array);
+ } else {
+ HTTP_DO_NEGOTIATE_HANDLE_DEFAULT(supported, rs_array);
+ }
+}
+/* }}} */
+