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


3.1.8 sll_destroy_node

Remove a node from a singly linked list and destroy it.

Synopsis

     #include <linklist/linklist.h>
     
     
     
void *sll_destroy_node( SLinkList ull, SLLNode unode );

Parameters

SLinkList ull
the list from which to remove the node
SLLNode unode
the node to remove

Description

This routine removes the passed node from the specified list and deallocates the memory associated with it. The user must destroy the data referenced by the node's data pointer.

Returns

It returns the node's data pointer if the node is not NULL, NULL otherwise.