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

Function xmlXPathNodeSetDel

ThirdParty/libxml2/vtklibxml2/xpath.c:3244–3267  ·  view source on GitHub ↗

* xmlXPathNodeSetDel: * @cur: the initial node set * @val: an xmlNodePtr * * Removes an xmlNodePtr from an existing NodeSet */

Source from the content-addressed store, hash-verified

3242 * Removes an xmlNodePtr from an existing NodeSet
3243 */
3244void
3245xmlXPathNodeSetDel(xmlNodeSetPtr cur, xmlNodePtr val) {
3246 int i;
3247
3248 if (cur == NULL) return;
3249 if (val == NULL) return;
3250
3251 /*
3252 * find node in nodeTab
3253 */
3254 for (i = 0;i < cur->nodeNr;i++)
3255 if (cur->nodeTab[i] == val) break;
3256
3257 if (i >= cur->nodeNr) { /* not found */
3258 return;
3259 }
3260 if ((cur->nodeTab[i] != NULL) &&
3261 (cur->nodeTab[i]->type == XML_NAMESPACE_DECL))
3262 xmlXPathNodeSetFreeNs((xmlNsPtr) cur->nodeTab[i]);
3263 cur->nodeNr--;
3264 for (;i < cur->nodeNr;i++)
3265 cur->nodeTab[i] = cur->nodeTab[i + 1];
3266 cur->nodeTab[cur->nodeNr] = NULL;
3267}
3268
3269/**
3270 * xmlXPathNodeSetRemove:

Callers

nothing calls this directly

Calls 1

xmlXPathNodeSetFreeNsFunction · 0.85

Tested by

no test coverage detected