- Fixed build on php-trunk
[m6w6/ext-http] / php_http_api.h
index fa0c1c89594f46d770e146f611f98b9bb4f3e215..fdee36d80bfcec98c42fa38e7b4da2c7e76fb147 100644 (file)
@@ -6,7 +6,7 @@
     | modification, are permitted provided that the conditions mentioned |
     | in the accompanying LICENSE file are met.                          |
     +--------------------------------------------------------------------+
-    | Copyright (c) 2004-2007, Michael Wallner <mike@php.net>            |
+    | Copyright (c) 2004-2010, Michael Wallner <mike@php.net>            |
     +--------------------------------------------------------------------+
 */
 
@@ -27,6 +27,7 @@
 #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)
+#define HTTP_PARAMS_COLON_SEPARATOR    0x10
 
 extern PHP_MINIT_FUNCTION(http_support);
 
@@ -110,23 +111,6 @@ extern STATUS _http_object_new(zend_object_value *ov, const char *cname_str, uin
                action; \
        }
 
-#define HTTP_CHECK_OPEN_BASEDIR(file, act) \
-       if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) \
-       { \
-               const char *tmp = file; \
- \
-               if (!strncasecmp(tmp, "file:", lenof("file:"))) { \
-                       tmp += lenof("file:"); \
-                       while ((tmp - (const char *)file < 7) && (*tmp == '/' || *tmp == '\\')) ++tmp; \
-               } \
- \
-               if (    (tmp != file || !strstr(file, "://")) && \
-                               (!*tmp || php_check_open_basedir(tmp TSRMLS_CC) || \
-                               (PG(safe_mode) && !php_checkuid(tmp, "rb+", CHECKUID_CHECK_MODE_PARAM)))) { \
-                               act; \
-               } \
-       }
-
 #define http_log(f, i, m) _http_log_ex((f), (i), (m) TSRMLS_CC)
 extern void _http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC);
 
@@ -248,8 +232,8 @@ static inline const char *_http_locate_eol(const char *line, int *eol_len)
        return eol;
 }
 
-#define convert_to_type(t, z) _convert_to_type((t), (z))
-static inline zval *_convert_to_type(int type, zval *z)
+#define http_zset(t, z) _http_zset((t), (z))
+static inline zval *_http_zset(int type, zval *z)
 {
        if (Z_TYPE_P(z) != type) {
                switch (type) {
@@ -264,12 +248,10 @@ static inline zval *_convert_to_type(int type, zval *z)
        }
        return z;
 }
-#define convert_to_type_ex(t, z, p) _convert_to_type_ex((t), (z), (p))
-static inline zval *_convert_to_type_ex(int type, zval *z, zval **p)
-{
-       if (p) {
-               *p = z;
-       }
+#define http_zsep(t, z) _http_zsep_ex((t), (z), NULL)
+#define http_zsep_ex(t, z, p) _http_zsep_ex((t), (z), (p))
+static inline zval *_http_zsep_ex(int type, zval *z, zval **p) {
+       SEPARATE_ARG_IF_REF(z);
        if (Z_TYPE_P(z) != type) {
                switch (type) {
                        case IS_NULL:   convert_to_null_ex(&z);         break;
@@ -282,11 +264,7 @@ static inline zval *_convert_to_type_ex(int type, zval *z, zval **p)
                }
        }
        if (p) {
-               if (*p == z) {
-                       *p = NULL;
-               } else {
-                       *p = z;
-               }
+               *p = z;
        }
        return z;
 }