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

Function xmlListCreate

ThirdParty/libxml2/vtklibxml2/list.c:187–214  ·  view source on GitHub ↗

* xmlListCreate: * @deallocator: an optional deallocator function * @compare: an optional comparison function * * Create a new list * * Returns the new list or NULL in case of error */

Source from the content-addressed store, hash-verified

185 * Returns the new list or NULL in case of error
186 */
187xmlListPtr
188xmlListCreate(xmlListDeallocator deallocator, xmlListDataCompare compare)
189{
190 xmlListPtr l;
191 if (NULL == (l = (xmlListPtr )xmlMalloc( sizeof(xmlList))))
192 return (NULL);
193 /* Initialize the list to NULL */
194 memset(l, 0, sizeof(xmlList));
195
196 /* Add the sentinel */
197 if (NULL ==(l->sentinel = (xmlLinkPtr )xmlMalloc(sizeof(xmlLink)))) {
198 xmlFree(l);
199 return (NULL);
200 }
201 l->sentinel->next = l->sentinel;
202 l->sentinel->prev = l->sentinel;
203 l->sentinel->data = NULL;
204
205 /* If there is a link deallocator, use it */
206 if (deallocator != NULL)
207 l->linkDeallocator = deallocator;
208 /* If there is a link comparator, use it */
209 if (compare != NULL)
210 l->linkCompare = compare;
211 else /* Use our own */
212 l->linkCompare = xmlLinkCompare;
213 return l;
214}
215
216/**
217 * xmlListSearch:

Callers 6

xmlC14NProcessAttrsAxisFunction · 0.85
xmlAddRefFunction · 0.85
xmlNewTextWriterFunction · 0.85
xmlListDupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected