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

Function xmlListAppend

ThirdParty/libxml2/vtklibxml2/list.c:297–314  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

295 * Returns 0 in case of success, 1 in case of failure
296 */
297int 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:

Callers 1

xmlAddRefFunction · 0.85

Calls 1

xmlListHigherSearchFunction · 0.85

Tested by

no test coverage detected