* xmlListAppend: * @l: a list * @data: the data * * Insert data in the ordered list at the end for this value * * Returns 0 in case of success, 1 in case of failure */
| 295 | * Returns 0 in case of success, 1 in case of failure |
| 296 | */ |
| 297 | int xmlListAppend(xmlListPtr l, void *data) |
| 298 | { |
| 299 | xmlLinkPtr lkPlace, lkNew; |
| 300 | |
| 301 | if (l == NULL) |
| 302 | return(1); |
| 303 | lkPlace = xmlListHigherSearch(l, data); |
| 304 | /* Add the new link */ |
| 305 | lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink)); |
| 306 | if (lkNew == NULL) |
| 307 | return (1); |
| 308 | lkNew->data = data; |
| 309 | lkNew->next = lkPlace->next; |
| 310 | (lkPlace->next)->prev = lkNew; |
| 311 | lkPlace->next = lkNew; |
| 312 | lkNew->prev = lkPlace; |
| 313 | return 0; |
| 314 | } |
| 315 | |
| 316 | /** |
| 317 | * xmlListDelete: |
no test coverage detected