* 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 */
| 741 | * Returns 0 in case of success 1 in case of error |
| 742 | */ |
| 743 | int |
| 744 | xmlListCopy(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 */ |
no test coverage detected