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

Function xmlListPushFront

ThirdParty/libxml2/vtklibxml2/list.c:530–548  ·  view source on GitHub ↗

* xmlListPushFront: * @l: a list * @data: new data * * add the new data at the beginning of the list * * Returns 1 if successful, 0 otherwise */

Source from the content-addressed store, hash-verified

528 * Returns 1 if successful, 0 otherwise
529 */
530int
531xmlListPushFront(xmlListPtr l, void *data)
532{
533 xmlLinkPtr lkPlace, lkNew;
534
535 if (l == NULL)
536 return(0);
537 lkPlace = l->sentinel;
538 /* Add the new link */
539 lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink));
540 if (lkNew == NULL)
541 return (0);
542 lkNew->data = data;
543 lkNew->next = lkPlace->next;
544 (lkPlace->next)->prev = lkNew;
545 lkPlace->next = lkNew;
546 lkNew->prev = lkPlace;
547 return 1;
548}
549
550/**
551 * xmlListPushBack:

Callers 10

xmlTextWriterStartPIFunction · 0.85
xmlTextWriterStartCDATAFunction · 0.85
xmlTextWriterStartDTDFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected