summaryrefslogtreecommitdiff
path: root/ext/tidy/php_tidy.h
diff options
context:
space:
mode:
authorJohn Coggeshall <john@php.net>2003-09-22 18:40:38 +0000
committerJohn Coggeshall <john@php.net>2003-09-22 18:40:38 +0000
commitd8eeb8e28673236bca3f066ded75037a5bdf6378 (patch)
tree86098c5a695e81f72741d5c9d6ade955c6491fbd /ext/tidy/php_tidy.h
parent6b567f80c7ffc57957107949f90080d7bcb24744 (diff)
downloadphp-git-d8eeb8e28673236bca3f066ded75037a5bdf6378.tar.gz
Updated test cases and examples and cleaned up the new OO code so it will
be easier to maintain.
Diffstat (limited to 'ext/tidy/php_tidy.h')
-rw-r--r--ext/tidy/php_tidy.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/tidy/php_tidy.h b/ext/tidy/php_tidy.h
index 0e077aac36..e170d37086 100644
--- a/ext/tidy/php_tidy.h
+++ b/ext/tidy/php_tidy.h
@@ -95,6 +95,33 @@ extern zend_module_entry tidy_module_entry;
obj = (PHPTidyObj *)zend_object_store_get_object(object TSRMLS_CC); \
}
+#define INSTANCIATE_NODE(_zval, _container, _node) \
+ tidy_instanciate(tidy_ce_node, _zval TSRMLS_CC); \
+ _container = (PHPTidyObj *) zend_object_store_get_object(_zval TSRMLS_CC); \
+ _container->node = _node; \
+ _container->attr = NULL; \
+ _container->type = is_node; \
+ tidy_add_default_properities(_container, is_node TSRMLS_CC);
+
+#define INSTANCIATE_ATTR(_zval, _container, _attr) \
+ tidy_instanciate(tidy_ce_attr, _zval TSRMLS_CC); \
+ _container = (PHPTidyObj *) zend_object_store_get_object(_zval TSRMLS_CC); \
+ _container->node = NULL; \
+ _container->attr = _attr; \
+ _container->type = is_attr; \
+ tidy_add_default_properities(_container, is_attr TSRMLS_CC);
+
+#define PHP_NODE_METHOD_IS_TYPE(_type, _const) \
+PHP_NODE_METHOD(is_ ##_type) \
+{ \
+ GET_THIS_CONTAINER(); \
+ if(tidyNodeGetType(obj->node) == _const) {\
+ RETURN_TRUE; \
+ } else { \
+ RETURN_FALSE; \
+ } \
+}
+
typedef enum {
is_node,
is_attr