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

Function xmlListInsert

ThirdParty/libxml2/vtklibxml2/list.c:267–286  ·  view source on GitHub ↗

* xmlListInsert: * @l: a list * @data: the data * * Insert data in the ordered list at the beginning for this value * * Returns 0 in case of success, 1 in case of failure */

Source from the content-addressed store, hash-verified

265 * Returns 0 in case of success, 1 in case of failure
266 */
267int
268xmlListInsert(xmlListPtr l, void *data)
269{
270 xmlLinkPtr lkPlace, lkNew;
271
272 if (l == NULL)
273 return(1);
274 lkPlace = xmlListLowerSearch(l, data);
275 /* Add the new link */
276 lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink));
277 if (lkNew == NULL)
278 return (1);
279 lkNew->data = data;
280 lkPlace = lkPlace->prev;
281 lkNew->next = lkPlace->next;
282 (lkPlace->next)->prev = lkNew;
283 lkPlace->next = lkNew;
284 lkNew->prev = lkPlace;
285 return 0;
286}
287
288/**
289 * xmlListAppend:

Callers 4

xmlC14NProcessAttrsAxisFunction · 0.85
xmlListCopyFunction · 0.85

Calls 1

xmlListLowerSearchFunction · 0.85

Tested by

no test coverage detected