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

Function xmlXPtrNewRangeInternal

ThirdParty/libxml2/vtklibxml2/xpointer.c:338–364  ·  view source on GitHub ↗

* xmlXPtrNewRangeInternal: * @start: the starting node * @startindex: the start index * @end: the ending point * @endindex: the ending index * * Internal function to create a new xmlXPathObjectPtr of type range * * Returns the newly created object. */

Source from the content-addressed store, hash-verified

336 * Returns the newly created object.
337 */
338static xmlXPathObjectPtr
339xmlXPtrNewRangeInternal(xmlNodePtr start, int startindex,
340 xmlNodePtr end, int endindex) {
341 xmlXPathObjectPtr ret;
342
343 /*
344 * Namespace nodes must be copied (see xmlXPathNodeSetDupNs).
345 * Disallow them for now.
346 */
347 if ((start != NULL) && (start->type == XML_NAMESPACE_DECL))
348 return(NULL);
349 if ((end != NULL) && (end->type == XML_NAMESPACE_DECL))
350 return(NULL);
351
352 ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
353 if (ret == NULL) {
354 xmlXPtrErrMemory("allocating range");
355 return(NULL);
356 }
357 memset(ret, 0, sizeof(xmlXPathObject));
358 ret->type = XPATH_RANGE;
359 ret->user = start;
360 ret->index = startindex;
361 ret->user2 = end;
362 ret->index2 = endindex;
363 return(ret);
364}
365
366/**
367 * xmlXPtrNewRange:

Callers 7

xmlXPtrNewRangeFunction · 0.85
xmlXPtrNewRangePointsFunction · 0.85
xmlXPtrNewRangePointNodeFunction · 0.85
xmlXPtrNewRangeNodePointFunction · 0.85
xmlXPtrNewRangeNodesFunction · 0.85
xmlXPtrNewCollapsedRangeFunction · 0.85

Calls 1

xmlXPtrErrMemoryFunction · 0.85

Tested by

no test coverage detected