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

Function xmlXPtrCmpPoints

ThirdParty/libxml2/vtklibxml2/xpointer.c:222–237  ·  view source on GitHub ↗

* xmlXPtrCmpPoints: * @node1: the first node * @index1: the first index * @node2: the second node * @index2: the second index * * Compare two points w.r.t document order * * Returns -2 in case of error 1 if first point < second point, 0 if * that's the same point, -1 otherwise */

Source from the content-addressed store, hash-verified

220 * that's the same point, -1 otherwise
221 */
222static int
223xmlXPtrCmpPoints(xmlNodePtr node1, int index1, xmlNodePtr node2, int index2) {
224 if ((node1 == NULL) || (node2 == NULL))
225 return(-2);
226 /*
227 * a couple of optimizations which will avoid computations in most cases
228 */
229 if (node1 == node2) {
230 if (index1 < index2)
231 return(1);
232 if (index1 > index2)
233 return(-1);
234 return(0);
235 }
236 return(xmlXPathCmpNodes(node1, node2));
237}
238
239/**
240 * xmlXPtrNewPoint:

Callers 1

xmlXPtrRangeCheckOrderFunction · 0.85

Calls 1

xmlXPathCmpNodesFunction · 0.85

Tested by

no test coverage detected