Lines Matching refs:node
165 if (nodeptr->node != NULL && nodeptr->node->type != XML_DOCUMENT_NODE) { in php_libxml_unregister_node()
166 nodeptr->node->_private = NULL; in php_libxml_unregister_node()
168 nodeptr->node = NULL; in php_libxml_unregister_node()
175 static void php_libxml_node_free(xmlNodePtr node) in php_libxml_node_free() argument
177 if(node) { in php_libxml_node_free()
178 if (node->_private != NULL) { in php_libxml_node_free()
179 ((php_libxml_node_ptr *) node->_private)->node = NULL; in php_libxml_node_free()
181 switch (node->type) { in php_libxml_node_free()
183 xmlFreeProp((xmlAttrPtr) node); in php_libxml_node_free()
191 if (node->name != NULL) { in php_libxml_node_free()
192 xmlFree((char *) node->name); in php_libxml_node_free()
194 if (((xmlEntityPtr) node)->ExternalID != NULL) { in php_libxml_node_free()
195 xmlFree((char *) ((xmlEntityPtr) node)->ExternalID); in php_libxml_node_free()
197 if (((xmlEntityPtr) node)->SystemID != NULL) { in php_libxml_node_free()
198 xmlFree((char *) ((xmlEntityPtr) node)->SystemID); in php_libxml_node_free()
200 xmlFree(node); in php_libxml_node_free()
203 if (node->ns) { in php_libxml_node_free()
204 xmlFreeNs(node->ns); in php_libxml_node_free()
205 node->ns = NULL; in php_libxml_node_free()
207 node->type = XML_ELEMENT_NODE; in php_libxml_node_free()
209 xmlFreeNode(node); in php_libxml_node_free()
214 static void php_libxml_node_free_list(xmlNodePtr node TSRMLS_DC) in php_libxml_node_free_list()
218 if (node != NULL) { in php_libxml_node_free_list()
219 curnode = node; in php_libxml_node_free_list()
221 node = curnode; in php_libxml_node_free_list()
222 switch (node->type) { in php_libxml_node_free_list()
228 php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC); in php_libxml_node_free_list()
231 if ((node->doc != NULL) && (((xmlAttrPtr) node)->atype == XML_ATTRIBUTE_ID)) { in php_libxml_node_free_list()
232 xmlRemoveID(node->doc, (xmlAttrPtr) node); in php_libxml_node_free_list()
239 php_libxml_node_free_list(node->children TSRMLS_CC); in php_libxml_node_free_list()
242 php_libxml_node_free_list(node->children TSRMLS_CC); in php_libxml_node_free_list()
243 php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC); in php_libxml_node_free_list()
246 curnode = node->next; in php_libxml_node_free_list()
247 xmlUnlinkNode(node); in php_libxml_node_free_list()
248 if (php_libxml_unregister_node(node TSRMLS_CC) == 0) { in php_libxml_node_free_list()
249 node->doc = NULL; in php_libxml_node_free_list()
251 php_libxml_node_free(node); in php_libxml_node_free_list()
451 error_copy.node = NULL; in _php_list_set_error_structure()
900 xmlNodePtr node = NULL; in php_libxml_import_node() local
909 node = export_hnd->export_func(object TSRMLS_CC); in php_libxml_import_node()
912 return node; in php_libxml_import_node()
915 PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, v… in php_libxml_increment_node_ptr() argument
919 if (object != NULL && node != NULL) { in php_libxml_increment_node_ptr()
920 if (object->node != NULL) { in php_libxml_increment_node_ptr()
921 if (object->node->node == node) { in php_libxml_increment_node_ptr()
922 return object->node->refcount; in php_libxml_increment_node_ptr()
927 if (node->_private != NULL) { in php_libxml_increment_node_ptr()
928 object->node = node->_private; in php_libxml_increment_node_ptr()
929 ret_refcount = ++object->node->refcount; in php_libxml_increment_node_ptr()
931 if (object->node->_private == NULL) { in php_libxml_increment_node_ptr()
932 object->node->_private = private_data; in php_libxml_increment_node_ptr()
936 object->node = emalloc(sizeof(php_libxml_node_ptr)); in php_libxml_increment_node_ptr()
937 object->node->node = node; in php_libxml_increment_node_ptr()
938 object->node->refcount = 1; in php_libxml_increment_node_ptr()
939 object->node->_private = private_data; in php_libxml_increment_node_ptr()
940 node->_private = object->node; in php_libxml_increment_node_ptr()
952 if (object != NULL && object->node != NULL) { in php_libxml_decrement_node_ptr()
953 obj_node = (php_libxml_node_ptr *) object->node; in php_libxml_decrement_node_ptr()
956 if (obj_node->node != NULL) { in php_libxml_decrement_node_ptr()
957 obj_node->node->_private = NULL; in php_libxml_decrement_node_ptr()
961 object->node = NULL; in php_libxml_decrement_node_ptr()
1010 PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC) in php_libxml_node_free_resource()
1012 if (!node) { in php_libxml_node_free_resource()
1016 switch (node->type) { in php_libxml_node_free_resource()
1021 if (node->parent == NULL || node->type == XML_NAMESPACE_DECL) { in php_libxml_node_free_resource()
1022 php_libxml_node_free_list((xmlNodePtr) node->children TSRMLS_CC); in php_libxml_node_free_resource()
1023 switch (node->type) { in php_libxml_node_free_resource()
1034 php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC); in php_libxml_node_free_resource()
1036 if (php_libxml_unregister_node(node TSRMLS_CC) == 0) { in php_libxml_node_free_resource()
1037 node->doc = NULL; in php_libxml_node_free_resource()
1039 php_libxml_node_free(node); in php_libxml_node_free_resource()
1041 php_libxml_unregister_node(node TSRMLS_CC); in php_libxml_node_free_resource()
1052 if (object != NULL && object->node != NULL) { in php_libxml_node_decrement_resource()
1053 obj_node = (php_libxml_node_ptr *) object->node; in php_libxml_node_decrement_resource()
1054 nodep = object->node->node; in php_libxml_node_decrement_resource()