Next: , Previous: dll_head_node, Up: Doubly Linked Lists


3.2.13 dll_insert

Create and insert a node into a doubly linked list.

Synopsis

     #include <linklist/linklist.h>
     
     
     
int dll_insert( DLinkList ull, void *data );

Parameters

DLinkList ull
a handle to the list into which to insert the node
void *data
a pointer to the new node's data

Description

dll_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 dll_new.

Returns

It returns zero if the insert was successful, non-zero if it was unable to create the new node.