MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlListCopy

Function xmlListCopy

ThirdParty/libxml2/vtklibxml2/list.c:743–758  ·  view source on GitHub ↗

* xmlListCopy: * @cur: the new list * @old: the old list * * Move all the element from the old list in the new list * * Returns 0 in case of success 1 in case of error */

Source from the content-addressed store, hash-verified

741 * Returns 0 in case of success 1 in case of error
742 */
743int
744xmlListCopy(xmlListPtr cur, xmlListPtr old)
745{
746 /* Walk the old tree and insert the data into the new one */
747 xmlLinkPtr lk;
748
749 if ((old == NULL) || (cur == NULL))
750 return(1);
751 for(lk = old->sentinel->next; lk != old->sentinel; lk = lk->next) {
752 if (0 !=xmlListInsert(cur, lk->data)) {
753 xmlListDelete(cur);
754 return (1);
755 }
756 }
757 return (0);
758}
759/* xmlListUnique() */
760/* xmlListSwap */

Callers 2

xmlListMergeFunction · 0.85
xmlListDupFunction · 0.85

Calls 2

xmlListInsertFunction · 0.85
xmlListDeleteFunction · 0.85

Tested by

no test coverage detected