-#define HTTP_DO_NEGOTIATE(type, supported, rs_array) \
-{ \
- HashTable *result; \
- if ((result = http_negotiate_ ##type(supported))) { \
+#define HTTP_DO_NEGOTIATE_DEFAULT(supported) \
+ { \
+ zval **value; \
+ \
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(supported)); \
+ if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(supported), (void *) &value)) { \
+ RETVAL_ZVAL(*value, 1, 0); \
+ } else { \
+ RETVAL_NULL(); \
+ } \
+ }
+
+#define HTTP_DO_NEGOTIATE_HANDLE_DEFAULT(supported, rs_array) \
+ HTTP_DO_NEGOTIATE_DEFAULT(supported); \
+ if (rs_array) { \
+ HashPosition pos; \
+ zval **value_ptr; \
+ \
+ FOREACH_VAL(pos, supported, value_ptr) { \
+ zval *value = http_zsep(IS_STRING, *value_ptr); \
+ add_assoc_double(rs_array, Z_STRVAL_P(value), 1.0); \
+ zval_ptr_dtor(&value); \
+ } \
+ }
+
+#define HTTP_DO_NEGOTIATE_HANDLE_RESULT(result, supported, rs_array) \
+ { \