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

Function xmlXPtrNewLocationSetNodeSet

ThirdParty/libxml2/vtklibxml2/xpointer.c:781–807  ·  view source on GitHub ↗

* xmlXPtrNewLocationSetNodeSet: * @set: a node set * * Create a new xmlXPathObjectPtr of type LocationSet and initialize * it with all the nodes from @set * * Returns the newly created object. */

Source from the content-addressed store, hash-verified

779 * Returns the newly created object.
780 */
781xmlXPathObjectPtr
782xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set) {
783 xmlXPathObjectPtr ret;
784
785 ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
786 if (ret == NULL) {
787 xmlXPtrErrMemory("allocating locationset");
788 return(NULL);
789 }
790 memset(ret, 0, sizeof(xmlXPathObject));
791 ret->type = XPATH_LOCATIONSET;
792 if (set != NULL) {
793 int i;
794 xmlLocationSetPtr newset;
795
796 newset = xmlXPtrLocationSetCreate(NULL);
797 if (newset == NULL)
798 return(ret);
799
800 for (i = 0;i < set->nodeNr;i++)
801 xmlXPtrLocationSetAdd(newset,
802 xmlXPtrNewCollapsedRange(set->nodeTab[i]));
803
804 ret->user = (void *) newset;
805 }
806 return(ret);
807}
808
809/**
810 * xmlXPtrWrapLocationSet:

Callers 5

xmlXPtrEndPointFunctionFunction · 0.70
xmlXPtrRangeFunctionFunction · 0.70

Calls 4

xmlXPtrErrMemoryFunction · 0.85
xmlXPtrLocationSetCreateFunction · 0.70
xmlXPtrLocationSetAddFunction · 0.70
xmlXPtrNewCollapsedRangeFunction · 0.70

Tested by

no test coverage detected