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


3.1.26 sll_prev_node

Get a handle to the node previous to a given node in a list.

Synopsis

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

Parameters

SLinkList ull
the list which contains the node
SLLNode unode
the following node

Description

Search a singly linked list starting at the list head and determine the node previous to the passed node. This is a very expensive operation! Before using this, think about using a doubly linked list!

Returns

It returns NULL if there is none, else a handle to the node.