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

Function xmlCopyNamespaceList

ThirdParty/libxml2/vtklibxml2/tree.c:3967–3987  ·  view source on GitHub ↗

* xmlCopyNamespaceList: * @cur: the first namespace * * Copy a namespace list. * * Returns the head of the copied list or NULL if a memory * allocation failed. */

Source from the content-addressed store, hash-verified

3965 * allocation failed.
3966 */
3967xmlNsPtr
3968xmlCopyNamespaceList(xmlNsPtr cur) {
3969 xmlNsPtr ret = NULL;
3970 xmlNsPtr p = NULL,q;
3971
3972 while (cur != NULL) {
3973 q = xmlCopyNamespace(cur);
3974 if (q == NULL) {
3975 xmlFreeNsList(ret);
3976 return(NULL);
3977 }
3978 if (p == NULL) {
3979 ret = p = q;
3980 } else {
3981 p->next = q;
3982 p = q;
3983 }
3984 cur = cur->next;
3985 }
3986 return(ret);
3987}
3988
3989static xmlAttrPtr
3990xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) {

Callers 2

xmlStaticCopyNodeFunction · 0.85
xmlCopyDocFunction · 0.85

Calls 2

xmlCopyNamespaceFunction · 0.85
xmlFreeNsListFunction · 0.85

Tested by

no test coverage detected