summaryrefslogtreecommitdiff
path: root/ext/dom/document.c
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2003-10-26 15:57:02 +0000
committerRob Richards <rrichards@php.net>2003-10-26 15:57:02 +0000
commit207dc90924f69b662efedd83a95970fda4685cb0 (patch)
treefbc237f51941ffa0835ce068f3a02a653a27372d /ext/dom/document.c
parentd29fb55bbb6c33aa10861f312176c07dafe61046 (diff)
downloadphp-git-207dc90924f69b662efedd83a95970fda4685cb0.tar.gz
add interop with simplexml - dom_import_simplexml
fix cloneNode with elements
Diffstat (limited to 'ext/dom/document.c')
-rw-r--r--ext/dom/document.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 4982a6b7e8..d8df916477 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -1164,16 +1164,15 @@ PHP_FUNCTION(dom_document_document)
if (intern != NULL) {
olddoc = (xmlDocPtr) dom_object_get_node(intern);
if (olddoc != NULL) {
- decrement_node_ptr(intern TSRMLS_CC);
- refcount = decrement_document_reference(intern TSRMLS_CC);
+ php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC);
+ refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
if (refcount != 0) {
olddoc->_private = NULL;
}
}
intern->document = NULL;
- increment_document_reference(intern, docp TSRMLS_CC);
-
- php_dom_set_object(intern, (xmlNodePtr) docp TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern TSRMLS_CC);
}
}
/* }}} end dom_document_document */
@@ -1230,7 +1229,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source TSRMLS_DC)
xmlParserCtxtPtr ctxt = NULL;
dom_doc_props *doc_props;
dom_object *intern;
- dom_ref_obj *document = NULL;
+ php_libxml_ref_obj *document = NULL;
int validate, resolve_externals, keep_blanks, substitute_ent;
int resolved_path_len;
char *directory=NULL, resolved_path[MAXPATHLEN];
@@ -1352,20 +1351,20 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
docp = (xmlDocPtr) dom_object_get_node(intern);
doc_prop = NULL;
if (docp != NULL) {
- decrement_node_ptr(intern TSRMLS_CC);
+ php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC);
doc_prop = intern->document->doc_props;
intern->document->doc_props = NULL;
- refcount = decrement_document_reference(intern TSRMLS_CC);
+ refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
if (refcount != 0) {
docp->_private = NULL;
}
}
intern->document = NULL;
- increment_document_reference(intern, newdoc TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC);
intern->document->doc_props = doc_prop;
}
- php_dom_set_object(intern, (xmlNodePtr) newdoc TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern TSRMLS_CC);
RETURN_TRUE;
} else {
@@ -1710,20 +1709,20 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode)
docp = (xmlDocPtr) dom_object_get_node(intern);
doc_prop = NULL;
if (docp != NULL) {
- decrement_node_ptr(intern TSRMLS_CC);
+ php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC);
doc_prop = intern->document->doc_props;
intern->document->doc_props = NULL;
- refcount = decrement_document_reference(intern TSRMLS_CC);
+ refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
if (refcount != 0) {
docp->_private = NULL;
}
}
intern->document = NULL;
- increment_document_reference(intern, newdoc TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC);
intern->document->doc_props = doc_prop;
}
- php_dom_set_object(intern, (xmlNodePtr) newdoc TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern TSRMLS_CC);
RETURN_TRUE;
} else {