* 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. */
| 336 | * Returns the newly created object. |
| 337 | */ |
| 338 | static xmlXPathObjectPtr |
| 339 | xmlXPtrNewRangeInternal(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: |
no test coverage detected