* xmlXPtrLocationSetCreate: * @val: an initial xmlXPathObjectPtr, or NULL * * Create a new xmlLocationSetPtr of type double and of value @val * * Returns the newly created object. */
| 571 | * Returns the newly created object. |
| 572 | */ |
| 573 | xmlLocationSetPtr |
| 574 | xmlXPtrLocationSetCreate(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: |
no test coverage detected