- adjust ini entry names to those of the globals struct
[m6w6/ext-http] / php_http_api.h
index ac56e9a295602976d8a6fe8c86ed060d2b8e2dcf..a7349b21d8bde8853f09bce4d354404de201b803 100644 (file)
 #define HTTP_SUPPORT_ENCODINGS         0x08L
 #define HTTP_SUPPORT_SSLREQUESTS       0x20L
 
+#define HTTP_PARAMS_ALLOW_COMMA                0x01
+#define HTTP_PARAMS_ALLOW_FAILURE      0x02
+#define HTTP_PARAMS_RAISE_ERROR                0x04
+#define HTTP_PARAMS_DEFAULT    (HTTP_PARAMS_ALLOW_COMMA|HTTP_PARAMS_ALLOW_FAILURE|HTTP_PARAMS_RAISE_ERROR)
+
 extern PHP_MINIT_FUNCTION(http_support);
 
 #define http_support(f) _http_support(f)
@@ -125,9 +130,9 @@ typedef void (*http_parse_params_callback)(void *cb_arg, const char *key, int ke
 #define http_parse_params_default_callback _http_parse_params_default_callback
 PHP_HTTP_API void _http_parse_params_default_callback(void *ht, const char *key, int keylen, const char *val, int vallen TSRMLS_DC);
 
-#define http_parse_params(s, ht) _http_parse_params_ex((s), 1, _http_parse_params_default_callback, (ht) TSRMLS_CC)
-#define http_parse_params_ex(s, comma, cb, a) _http_parse_params_ex((s), (comma), (cb), (a) TSRMLS_CC)
-PHP_HTTP_API STATUS _http_parse_params_ex(const char *params, int alloc_comma_sep, http_parse_params_callback cb, void *cb_arg TSRMLS_DC);
+#define http_parse_params(s, f, ht) _http_parse_params_ex((s), (f), _http_parse_params_default_callback, (ht) TSRMLS_CC)
+#define http_parse_params_ex(s, f, cb, a) _http_parse_params_ex((s), (f), (cb), (a) TSRMLS_CC)
+PHP_HTTP_API STATUS _http_parse_params_ex(const char *params, int flags, http_parse_params_callback cb, void *cb_arg TSRMLS_DC);
 
 
 #define http_locate_body _http_locate_body
@@ -165,8 +170,7 @@ static inline const char *_http_locate_eol(const char *line, int *eol_len)
 static inline zval *_convert_to_type(int type, zval *z)
 {
        if (Z_TYPE_P(z) != type) {
-               switch (type)
-               {
+               switch (type) {
                        case IS_NULL:   convert_to_null(z);             break;
                        case IS_BOOL:   convert_to_boolean(z);  break;
                        case IS_LONG:   convert_to_long(z);             break;
@@ -183,8 +187,7 @@ static inline zval *_convert_to_type_ex(int type, zval *z, zval **p)
 {
        *p = z;
        if (Z_TYPE_P(z) != type) {
-               switch (type)
-               {
+               switch (type) {
                        case IS_NULL:   convert_to_null_ex(&z);         break;
                        case IS_BOOL:   convert_to_boolean_ex(&z);      break;
                        case IS_LONG:   convert_to_long_ex(&z);         break;