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


3.1.25 sll_prev

Retrieve the data in the node preceding a given node in a list.

Synopsis

     #include <linklist/linklist.h>
     
     
     
void *sll_prev( 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 pointer to the previous node's data.