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

Function xmlXPtrLocationSetCreate

ThirdParty/libxml2/vtklibxml2/xpointer.c:573–597  ·  view source on GitHub ↗

* xmlXPtrLocationSetCreate: * @val: an initial xmlXPathObjectPtr, or NULL * * Create a new xmlLocationSetPtr of type double and of value @val * * Returns the newly created object. */

Source from the content-addressed store, hash-verified

571 * Returns the newly created object.
572 */
573xmlLocationSetPtr
574xmlXPtrLocationSetCreate(xmlXPathObjectPtr val) {
575 xmlLocationSetPtr ret;
576
577 ret = (xmlLocationSetPtr) xmlMalloc(sizeof(xmlLocationSet));
578 if (ret == NULL) {
579 xmlXPtrErrMemory("allocating locationset");
580 return(NULL);
581 }
582 memset(ret, 0 , sizeof(xmlLocationSet));
583 if (val != NULL) {
584 ret->locTab = (xmlXPathObjectPtr *) xmlMalloc(XML_RANGESET_DEFAULT *
585 sizeof(xmlXPathObjectPtr));
586 if (ret->locTab == NULL) {
587 xmlXPtrErrMemory("allocating locationset");
588 xmlFree(ret);
589 return(NULL);
590 }
591 memset(ret->locTab, 0 ,
592 XML_RANGESET_DEFAULT * sizeof(xmlXPathObjectPtr));
593 ret->locMax = XML_RANGESET_DEFAULT;
594 ret->locTab[ret->locNr++] = val;
595 }
596 return(ret);
597}
598
599/**
600 * xmlXPtrLocationSetAdd:

Callers 8

xmlXPtrEndPointFunctionFunction · 0.70
xmlXPtrRangeFunctionFunction · 0.70

Calls 1

xmlXPtrErrMemoryFunction · 0.85

Tested by

no test coverage detected