Lines Matching refs:nodes
96 static bool dom_is_node_in_list(const zval *nodes, uint32_t nodesc, const xmlNode *node_to_find) in dom_is_node_in_list() argument
99 if (Z_TYPE(nodes[i]) == IS_OBJECT) { in dom_is_node_in_list()
100 if (dom_object_get_node(Z_DOMOBJ_P(nodes + i)) == node_to_find) { in dom_is_node_in_list()
344 xmlNode* dom_zvals_to_single_node(php_libxml_ref_obj *document, xmlNode *contextNode, zval *nodes, … in dom_zvals_to_single_node() argument
360 if (Z_TYPE_P(nodes) == IS_OBJECT) { in dom_zvals_to_single_node()
361 return dom_object_get_node(Z_DOMOBJ_P(nodes)); in dom_zvals_to_single_node()
363 ZEND_ASSERT(Z_TYPE_P(nodes) == IS_STRING); in dom_zvals_to_single_node()
364 node = xmlNewDocTextLen(documentNode, BAD_CAST Z_STRVAL_P(nodes), Z_STRLEN_P(nodes)); in dom_zvals_to_single_node()
381 if (Z_TYPE(nodes[i]) == IS_OBJECT) { in dom_zvals_to_single_node()
382 newNodeObj = Z_DOMOBJ_P(&nodes[i]); in dom_zvals_to_single_node()
414 ZEND_ASSERT(Z_TYPE(nodes[i]) == IS_STRING); in dom_zvals_to_single_node()
417 newNode = xmlNewDocTextLen(documentNode, BAD_CAST Z_STRVAL(nodes[i]), Z_STRLEN(nodes[i])); in dom_zvals_to_single_node()
437 static zend_result dom_sanity_check_node_list_types(zval *nodes, uint32_t nodesc, zend_class_entry … in dom_sanity_check_node_list_types() argument
440 zend_uchar type = Z_TYPE(nodes[i]); in dom_sanity_check_node_list_types()
442 const zend_class_entry *ce = Z_OBJCE(nodes[i]); in dom_sanity_check_node_list_types()
445 …1, "must be of type %s|string, %s given", ZSTR_VAL(node_ce->name), zend_zval_type_name(&nodes[i])); in dom_sanity_check_node_list_types()
449 if (Z_STRLEN(nodes[i]) > INT_MAX) { in dom_sanity_check_node_list_types()
454 …1, "must be of type %s|string, %s given", ZSTR_VAL(node_ce->name), zend_zval_type_name(&nodes[i])); in dom_sanity_check_node_list_types()
583 void dom_parent_node_append(dom_object *context, zval *nodes, uint32_t nodesc) in dom_parent_node_append() argument
585 …if (UNEXPECTED(dom_sanity_check_node_list_types(nodes, nodesc, dom_get_node_ce(php_dom_follow_spec… in dom_parent_node_append()
594 xmlNodePtr node = dom_zvals_to_single_node(context->document, parentNode, nodes, nodesc); in dom_parent_node_append()
604 void dom_parent_node_prepend(dom_object *context, zval *nodes, uint32_t nodesc) in dom_parent_node_prepend() argument
609 dom_parent_node_append(context, nodes, nodesc); in dom_parent_node_prepend()
613 …if (UNEXPECTED(dom_sanity_check_node_list_types(nodes, nodesc, dom_get_node_ce(php_dom_follow_spec… in dom_parent_node_prepend()
620 xmlNodePtr node = dom_zvals_to_single_node(context->document, parentNode, nodes, nodesc); in dom_parent_node_prepend()
630 void dom_parent_node_after(dom_object *context, zval *nodes, uint32_t nodesc) in dom_parent_node_after() argument
632 …if (UNEXPECTED(dom_sanity_check_node_list_types(nodes, nodesc, dom_get_node_ce(php_dom_follow_spec… in dom_parent_node_after()
648 while (viable_next_sibling && dom_is_node_in_list(nodes, nodesc, viable_next_sibling)) { in dom_parent_node_after()
655 xmlNodePtr fragment = dom_zvals_to_single_node(context->document, parentNode, nodes, nodesc); in dom_parent_node_after()
662 void dom_parent_node_before(dom_object *context, zval *nodes, uint32_t nodesc) in dom_parent_node_before() argument
664 …if (UNEXPECTED(dom_sanity_check_node_list_types(nodes, nodesc, dom_get_node_ce(php_dom_follow_spec… in dom_parent_node_before()
680 while (viable_previous_sibling && dom_is_node_in_list(nodes, nodesc, viable_previous_sibling)) { in dom_parent_node_before()
687 xmlNodePtr fragment = dom_zvals_to_single_node(context->document, parentNode, nodes, nodesc); in dom_parent_node_before()
730 void dom_child_replace_with(dom_object *context, zval *nodes, uint32_t nodesc) in dom_child_replace_with() argument
732 …if (UNEXPECTED(dom_sanity_check_node_list_types(nodes, nodesc, dom_get_node_ce(php_dom_follow_spec… in dom_child_replace_with()
748 while (viable_next_sibling && dom_is_node_in_list(nodes, nodesc, viable_next_sibling)) { in dom_child_replace_with()
759 xmlNodePtr node = dom_zvals_to_single_node(context->document, parentNode, nodes, nodesc); in dom_child_replace_with()
779 void dom_parent_node_replace_children(dom_object *context, zval *nodes, uint32_t nodesc) in dom_parent_node_replace_children() argument
781 …if (UNEXPECTED(dom_sanity_check_node_list_types(nodes, nodesc, dom_get_node_ce(php_dom_follow_spec… in dom_parent_node_replace_children()
790 xmlNodePtr node = dom_zvals_to_single_node(context->document, thisp, nodes, nodesc); in dom_parent_node_replace_children()