* xmlUnlinkNodeInternal: * @cur: the node * * Unlink a node from its tree. * * This function only unlinks the node from the tree. It doesn't * clear references to DTD nodes. */
| 3803 | * clear references to DTD nodes. |
| 3804 | */ |
| 3805 | static void |
| 3806 | xmlUnlinkNodeInternal(xmlNodePtr cur) { |
| 3807 | if (cur->parent != NULL) { |
| 3808 | xmlNodePtr parent; |
| 3809 | parent = cur->parent; |
| 3810 | if (cur->type == XML_ATTRIBUTE_NODE) { |
| 3811 | if (parent->properties == (xmlAttrPtr) cur) |
| 3812 | parent->properties = ((xmlAttrPtr) cur)->next; |
| 3813 | } else { |
| 3814 | if (parent->children == cur) |
| 3815 | parent->children = cur->next; |
| 3816 | if (parent->last == cur) |
| 3817 | parent->last = cur->prev; |
| 3818 | } |
| 3819 | cur->parent = NULL; |
| 3820 | } |
| 3821 | |
| 3822 | if (cur->next != NULL) |
| 3823 | cur->next->prev = cur->prev; |
| 3824 | if (cur->prev != NULL) |
| 3825 | cur->prev->next = cur->next; |
| 3826 | cur->next = NULL; |
| 3827 | cur->prev = NULL; |
| 3828 | } |
| 3829 | |
| 3830 | /** |
| 3831 | * xmlUnlinkNode: |
no outgoing calls
no test coverage detected