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

Function xmlRemoveProp

ThirdParty/libxml2/vtklibxml2/tree.c:1952–1980  ·  view source on GitHub ↗

* xmlRemoveProp: * @cur: an attribute * * Unlink and free an attribute including all children. * * Note this doesn't work for namespace declarations. * * The attribute must have a non-NULL parent pointer. * * Returns 0 on success or -1 if the attribute was not found or * arguments are invalid. */

Source from the content-addressed store, hash-verified

1950 * arguments are invalid.
1951 */
1952int
1953xmlRemoveProp(xmlAttrPtr cur) {
1954 xmlAttrPtr tmp;
1955 if (cur == NULL) {
1956 return(-1);
1957 }
1958 if (cur->parent == NULL) {
1959 return(-1);
1960 }
1961 tmp = cur->parent->properties;
1962 if (tmp == cur) {
1963 cur->parent->properties = cur->next;
1964 if (cur->next != NULL)
1965 cur->next->prev = NULL;
1966 xmlFreeProp(cur);
1967 return(0);
1968 }
1969 while (tmp != NULL) {
1970 if (tmp->next == cur) {
1971 tmp->next = cur->next;
1972 if (tmp->next != NULL)
1973 tmp->next->prev = tmp;
1974 xmlFreeProp(cur);
1975 return(0);
1976 }
1977 tmp = tmp->next;
1978 }
1979 return(-1);
1980}
1981
1982/**
1983 * xmlNewDocPI:

Callers 1

xmlInsertPropFunction · 0.85

Calls 1

xmlFreePropFunction · 0.85

Tested by

no test coverage detected