Next: sll_insert_head, Previous: sll_head_node, Up: Singly Linked Lists
Create and insert a node into a singly linked list.
#include <linklist/linklist.h>int sll_insert( SLinkList ull, void *data );
SLinkList ull
- a handle to the list into which to insert the node
void *data
- a pointer to the new node's data
sll_insert
creates a node, stores the passed data pointer in
it, and inserts the node in the list in the collating order
determined by the comparison function with which the list was
initialized by sll_new
.
It returns zero if the insert was successful, non-zero if it was unable to create the new node