Next: , Previous: sll_delete, Up: Singly Linked Lists


3.1.3 sll_udelete

Delete a singly linked list.

Synopsis

     #include <linklist/linklist.h>
     
     
     
void sll_udelete( SLinkList ull, void (*ufree)(void *,void *), void *udata );

Parameters

SLinkList ull
the linked list to be deleted
void (*ufree)(void *,void *)
a function called at each link to delete user data. it may be SLL_NULL_DELETE
void *udata
a pointer to data to be passed to the action routine

Description

sll_udelete traverses a linked list, calling a user-supplied function at each node in the list, then deleting the node. Finally it deletes the list header. This routine differs from sll_delete in that it can pass along a pointer provided by the calling routine to the action routine, allowing arbitrary data to be available to the action routine.