- toggle debugging flag
[m6w6/ext-http] / php_http_api.h
index 99153df81b9ae0c991206b71c24f613cbce6b77d..f6cd59ffe624278ddc42ceae916ef54584286396 100644 (file)
@@ -1,16 +1,13 @@
 /*
-   +----------------------------------------------------------------------+
-   | PECL :: http                                                         |
-   +----------------------------------------------------------------------+
-   | This source file is subject to version 3.0 of the PHP license, that  |
-   | is bundled with this package in the file LICENSE, and is available   |
-   | through the world-wide-web at http://www.php.net/license/3_0.txt.    |
-   | If you did not receive a copy of the PHP license and are unable to   |
-   | obtain it through the world-wide-web, please send a note to          |
-   | license@php.net so we can mail you a copy immediately.               |
-   +----------------------------------------------------------------------+
-   | Copyright (c) 2004-2005 Michael Wallner <mike@php.net>               |
-   +----------------------------------------------------------------------+
+    +--------------------------------------------------------------------+
+    | PECL :: http                                                       |
+    +--------------------------------------------------------------------+
+    | Redistribution and use in source and binary forms, with or without |
+    | modification, are permitted provided that the conditions mentioned |
+    | in the accompanying LICENSE file are met.                          |
+    +--------------------------------------------------------------------+
+    | Copyright (c) 2004-2005, Michael Wallner <mike@php.net>            |
+    +--------------------------------------------------------------------+
 */
 
 /* $Id$ */
 
 #define HTTP_SUPPORT                           0x01L
 #define HTTP_SUPPORT_REQUESTS          0x02L
-#define HTTP_SUPPORT_MIMEMAGIC         0x04L
+#define HTTP_SUPPORT_MAGICMIME         0x04L
 #define HTTP_SUPPORT_ENCODINGS         0x08L
 #define HTTP_SUPPORT_MHASHETAGS                0x10L
 #define HTTP_SUPPORT_SSLREQUESTS       0x20L
 
-#define http_support_global_init() _http_support_global_init(INIT_FUNC_ARGS_PASSTHRU)
-extern STATUS _http_support_global_init(INIT_FUNC_ARGS);
+extern PHP_MINIT_FUNCTION(http_support);
 
 #define http_support(f) _http_support(f)
 PHP_HTTP_API long _http_support(long feature);
@@ -148,9 +144,10 @@ static inline zval *_convert_to_type(int type, zval *z)
        }
        return z;
 }
-#define convert_to_type_ex(t, z) _convert_to_type_ex((t), (z))
-static inline zval *_convert_to_type_ex(int type, zval *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)
 {
+       *p = z;
        if (Z_TYPE_P(z) != type) {
                switch (type)
                {
@@ -163,6 +160,11 @@ static inline zval *_convert_to_type_ex(int type, zval *z)
                        case IS_OBJECT: convert_to_object_ex(&z);       break;
                }
        }
+       if (*p == z) {
+               *p = NULL;
+       } else {
+               *p = z;
+       }
        return z;
 }