- move that at the end for PHP4
[m6w6/ext-http] / php_http_std_defs.h
index 186a8b0834098d4f3f5f750f202fe4a3efc707a2..42b67edf9ade6bf635f6f7ea309e9edf1a869cd4 100644 (file)
@@ -36,6 +36,11 @@ typedef int STATUS;
 /* lenof() */
 #define lenof(S) (sizeof(S) - 1)
 
+/* STR_SET() */
+#define STR_SET(target, source) \
+       if(target) efree(target); \
+       target = source
+
 /* return bool (v == SUCCESS) */
 #define RETVAL_SUCCESS(v) RETVAL_BOOL(SUCCESS == (v))
 #define RETURN_SUCCESS(v) RETURN_BOOL(SUCCESS == (v))
@@ -63,6 +68,12 @@ typedef int STATUS;
                zend_error(E_NOTICE, "Wrong parameter count for %s()", get_active_function_name(TSRMLS_C)); \
        }
 
+/* check if return value is used */
+#define IF_RETVAL_USED \
+       if (!return_value_used) { \
+               return; \
+       } else
+
 /* CR LF */
 #define HTTP_CRLF "\r\n"
 
@@ -100,8 +111,8 @@ typedef int STATUS;
 /* server vars shorthand */
 #define HTTP_SERVER_VARS Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])
 
-#define HTTP_INI_ENTRY(entry, default, scope, global) \
-       STD_PHP_INI_ENTRY(entry, default, scope, http_update_##global, global, zend_http_globals, http_globals)
+#define HTTP_PHP_INI_ENTRY(entry, default, scope, updater, global) \
+       STD_PHP_INI_ENTRY(entry, default, scope, updater, global, zend_http_globals, http_globals)
 
 /* {{{ arrays */
 #define FOREACH_VAL(array, val) FOREACH_HASH_VAL(Z_ARRVAL_P(array), val)
@@ -155,11 +166,12 @@ typedef int STATUS;
        }
 /* }}} */
 
-#define HTTP_LONG_CONSTANT(name, const) REGISTER_LONG_CONSTANT(name, const, CONST_CS | CONST_PERSISTENT);
+#define HTTP_LONG_CONSTANT(name, const) REGISTER_LONG_CONSTANT(name, const, CONST_CS | CONST_PERSISTENT)
 
 /* {{{ objects & properties */
 #ifdef ZEND_ENGINE_2
 
+#      define HTTP_STATIC_ME_ALIAS(me, al, ai) ZEND_FENTRY(me, ZEND_FN(al), ai, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
 
 #      define HTTP_REGISTER_CLASS_EX(classname, name, parent, flags) \
        { \