- const char *key = list, *val = NULL;
- int vallen = 0, keylen = 0, done = 0;
- zval array;
-
- Z_ARRVAL(array) = items;
-
- if (!(val = strchr(list, '='))) {
- return FAILURE;
- }
-
-#define HTTP_KEYLIST_VAL(array, k, str, len) \
- { \
- char *decoded; \
- size_t decoded_len; \
- if (decode) { \
- decode(str, len, &decoded, &decoded_len TSRMLS_CC); \
- } else { \
- decoded_len = len; \
- decoded = estrndup(str, decoded_len); \
- } \
- add_assoc_stringl(array, k, decoded, decoded_len, 0); \
- }
-#define HTTP_KEYLIST_FIXKEY() \
- { \
- while (isspace(*key)) ++key; \
- keylen = val - key; \
- while (isspace(key[keylen - 1])) --keylen; \
- }
-#define HTTP_KEYLIST_FIXVAL() \
- { \
- ++val; \
- while (isspace(*val)) ++val; \
- vallen = key - val; \
- while (isspace(val[vallen - 1])) --vallen; \
- }
-
- HTTP_KEYLIST_FIXKEY();
-
- if (first_entry_is_name_value_pair) {
- HTTP_KEYLIST_VAL(&array, "name", key, keylen);
+ va_list args;
+
+ va_start(args, format);
+#ifdef ZEND_ENGINE_2
+ if ((type == E_THROW) || (PG(error_handling) == EH_THROW)) {
+ char *message;
+ zend_class_entry *ce = http_exception_get_for_code(code);
+
+ http_try {
+ vspprintf(&message, 0, format, args);
+ zend_throw_exception(ce, message, code TSRMLS_CC);
+ efree(message);
+ } http_catch(PG(exception_class) ? PG(exception_class) : HTTP_EX_DEF_CE);
+ } else
+#endif
+ php_verror(NULL, "", type, format, args TSRMLS_CC);
+ va_end(args);
+}
+/* }}} */