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


3.2.14 dll_insert_head

Create and insert a node at the head of a doubly linked list.

Synopsis

     #include <linklist/linklist.h>
     
     
     
int dll_insert_head( 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

This routine creates a node, inserts the passed data pointer in it, and attaches the node to the head of the list.

Returns

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