Next: sll_next, Previous: sll_join, Up: Singly Linked Lists
Create a new singly linked list.
#include <linklist/linklist.h>SLinkList sll_new(int (*cmp)(const void *,const void *));
int (*cmp)(const void *,const void *)
- a comparison function for use in searches of the linked list, may be
SLL_NULL_CMP
for unordered lists
This routine creates a new list structure. If the list is to have some intrinsic order, a function defining that order should be passed. The comparison routine is called with two node data pointers as the arguments. It must return ‘-1’, ‘0’, or ‘1’ if, respectively, the first argument is less than, equal to, or greater than the second.
It returns a pointer to a new linked list, or NULL
if it can't
allocate it