Next: sll_prev_node, Previous: sll_node_put_data, Up: Singly Linked Lists
Retrieve the data in the node preceding a given node in a list.
#include <linklist/linklist.h>void *sll_prev( SLinkList ull, SLLNode unode );
SLinkList ull
- the list which contains the node
SLLNode unode
- the following node
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!
It returns NULL
if there is none, else a pointer to the previous
node's data.