- Reverted macro moving stupidity (thx to Sterling).

This commit is contained in:
Markus Fischer 2001-12-02 12:21:50 +00:00
parent 896faf0b34
commit 31a74b4aec
2 changed files with 39 additions and 39 deletions

View File

@ -31,6 +31,45 @@
#define PHP_XPATH 1
#define PHP_XPTR 2
/* General macros used by domxml */
#define DOMXML_DOMOBJ_NEW(zval, obj, ret) if (NULL == (zval = php_domobject_new(obj, ret TSRMLS_CC))) { \
php_error(E_WARNING, "%s() cannot create required DOM object", \
get_active_function_name(TSRMLS_C)); \
RETURN_FALSE; \
}
#define DOMXML_RET_ZVAL(zval) SEPARATE_ZVAL(&zval); \
*return_value = *zval; \
FREE_ZVAL(zval);
#define DOMXML_RET_OBJ(zval, obj, ret) DOMXML_DOMOBJ_NEW(zval, obj, ret); \
DOMXML_RET_ZVAL(zval);
#define DOMXML_GET_THIS(zval) if (NULL == (zval = getThis())) { \
php_error(E_WARNING, "%s() underlying object missing", \
get_active_function_name(TSRMLS_C)); \
RETURN_FALSE; \
}
#define DOMXML_GET_OBJ(ret, zval, le) if (NULL == (ret = php_dom_get_object(zval, le, 0 TSRMLS_CC))) { \
php_error(E_WARNING, "%s() cannot fetch DOM object", \
get_active_function_name(TSRMLS_C)); \
RETURN_FALSE; \
}
#define DOMXML_GET_THIS_OBJ(ret, zval, le) DOMXML_GET_THIS(zval); \
DOMXML_GET_OBJ(ret, zval, le);
#define DOMXML_NO_ARGS() if (ZEND_NUM_ARGS() != 0) { \
php_error(E_WARNING, "%s() expects exactly 0 parameters, %d given", \
get_active_function_name(TSRMLS_C), ZEND_NUM_ARGS()); \
return; \
}
#define DOMXML_NOT_IMPLEMENTED() php_error(E_WARNING, "%s() not yet implemented", \
get_active_function_name(TSRMLS_C)); \
return;
static int le_domxmldocp;
static int le_domxmldoctypep;
static int le_domxmldtdp;

View File

@ -142,45 +142,6 @@ PHP_FUNCTION(xptr_eval);
#endif
PHP_FUNCTION(domxml_test);
/* General macros used by domxml */
#define DOMXML_DOMOBJ_NEW(zval, obj, ret) if (NULL == (zval = php_domobject_new(obj, ret TSRMLS_CC))) { \
php_error(E_WARNING, "%s() cannot create required DOM object", \
get_active_function_name(TSRMLS_C)); \
RETURN_FALSE; \
}
#define DOMXML_RET_ZVAL(zval) SEPARATE_ZVAL(&zval); \
*return_value = *zval; \
FREE_ZVAL(zval);
#define DOMXML_RET_OBJ(zval, obj, ret) DOMXML_DOMOBJ_NEW(zval, obj, ret); \
DOMXML_RET_ZVAL(zval);
#define DOMXML_GET_THIS(zval) if (NULL == (zval = getThis())) { \
php_error(E_WARNING, "%s() underlying object missing", \
get_active_function_name(TSRMLS_C)); \
RETURN_FALSE; \
}
#define DOMXML_GET_OBJ(ret, zval, le) if (NULL == (ret = php_dom_get_object(zval, le, 0 TSRMLS_CC))) { \
php_error(E_WARNING, "%s() cannot fetch DOM object", \
get_active_function_name(TSRMLS_C)); \
RETURN_FALSE; \
}
#define DOMXML_GET_THIS_OBJ(ret, zval, le) DOMXML_GET_THIS(zval); \
DOMXML_GET_OBJ(ret, zval, le);
#define DOMXML_NO_ARGS() if (ZEND_NUM_ARGS() != 0) { \
php_error(E_WARNING, "%s() expects exactly 0 parameters, %d given", \
get_active_function_name(TSRMLS_C), ZEND_NUM_ARGS()); \
return; \
}
#define DOMXML_NOT_IMPLEMENTED() php_error(E_WARNING, "%s() not yet implemented", \
get_active_function_name(TSRMLS_C)); \
return;
#else
#define domxml_module_ptr NULL
#endif /* HAVE_DOMXML */