diff options
author | Rob Richards <rrichards@php.net> | 2003-10-26 15:53:20 +0000 |
---|---|---|
committer | Rob Richards <rrichards@php.net> | 2003-10-26 15:53:20 +0000 |
commit | d29fb55bbb6c33aa10861f312176c07dafe61046 (patch) | |
tree | ddd82e4c132b17e9c36a34be31cbbc957bdfd1de /ext/libxml/php_libxml.h | |
parent | 7e906476117df84ae22d498b935ec3531c62ae57 (diff) | |
download | php-git-d29fb55bbb6c33aa10861f312176c07dafe61046.tar.gz |
common functions for interoperability
Diffstat (limited to 'ext/libxml/php_libxml.h')
-rw-r--r-- | ext/libxml/php_libxml.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h index 9db788496f..6ed39f88ef 100644 --- a/ext/libxml/php_libxml.h +++ b/ext/libxml/php_libxml.h @@ -37,14 +37,40 @@ extern zend_module_entry libxml_module_entry; #define PHP_LIBXML_API #endif - +#include <libxml/tree.h> typedef struct { zval *stream_context; } php_libxml_globals; - +typedef struct _php_libxml_ref_obj { + void *ptr; + int refcount; + void *doc_props; +} php_libxml_ref_obj; + +typedef struct _php_libxml_node_ptr { + xmlNodePtr node; + int refcount; + void *_private; +} php_libxml_node_ptr; + +typedef struct _php_libxml_node_object { + zend_object std; + php_libxml_node_ptr *node; + php_libxml_ref_obj *document; + HashTable *properties; +} php_libxml_node_object; + PHP_FUNCTION(libxml_set_streams_context); +int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data TSRMLS_DC); +int php_libxml_decrement_node_ptr(php_libxml_node_object *object TSRMLS_DC); +int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp TSRMLS_DC); +int php_libxml_decrement_doc_ref(php_libxml_node_object *object TSRMLS_DC); +/* When an explicit freeing of node and children is required */ +void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC); +/* When object dtor is called as node may still be referenced */ +void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC); #endif /* HAVE_LIBXML */ |