le_doublyLinkedList.h
Go to the documentation of this file.
8 * A doubly linked list is a data structure consisting of a group of nodes linked together linearly.17 * To create and initialize a linked list the user must create a le_dls_List_t typed list and assign43 * requirement for nodes is that it must contain a @c le_dls_Link_t link member. The link member must164 * All linked list function calls are re-entrant and thread safe themselves, but if the nodes and/or166 * exclusion of access. If you're accessing the same list from multiple threads, you @e must use a187 //--------------------------------------------------------------------------------------------------189 * This link object must be included in each user node. The node's link object is used to add the190 * node to a list. A node may have multiple link objects which would allow the node to be part of196 //--------------------------------------------------------------------------------------------------205 //--------------------------------------------------------------------------------------------------212 //--------------------------------------------------------------------------------------------------220 //--------------------------------------------------------------------------------------------------222 * When a list is created it must be initialized by assigning this macro to the list before the list225 //--------------------------------------------------------------------------------------------------229 //--------------------------------------------------------------------------------------------------231 * When a link is created it must be initialized by assigning this macro to the link before it can234 //--------------------------------------------------------------------------------------------------238 //--------------------------------------------------------------------------------------------------242 //--------------------------------------------------------------------------------------------------250 //--------------------------------------------------------------------------------------------------254 //--------------------------------------------------------------------------------------------------262 //--------------------------------------------------------------------------------------------------267 //--------------------------------------------------------------------------------------------------276 //--------------------------------------------------------------------------------------------------281 //--------------------------------------------------------------------------------------------------290 //--------------------------------------------------------------------------------------------------298 //--------------------------------------------------------------------------------------------------305 //--------------------------------------------------------------------------------------------------313 //--------------------------------------------------------------------------------------------------320 //--------------------------------------------------------------------------------------------------325 //--------------------------------------------------------------------------------------------------333 //--------------------------------------------------------------------------------------------------341 //--------------------------------------------------------------------------------------------------348 //--------------------------------------------------------------------------------------------------356 //--------------------------------------------------------------------------------------------------363 //--------------------------------------------------------------------------------------------------370 //--------------------------------------------------------------------------------------------------372 (375 //--------------------------------------------------------------------------------------------------381 //--------------------------------------------------------------------------------------------------383 * Returns the link next to currentLinkPtr (i.e., the link beside currentLinkPtr that is closer to the392 //--------------------------------------------------------------------------------------------------400 //--------------------------------------------------------------------------------------------------403 * ensure that currentLinkPtr is in the list otherwise the behaviour of this function is undefined.410 //--------------------------------------------------------------------------------------------------418 //--------------------------------------------------------------------------------------------------423 //--------------------------------------------------------------------------------------------------432 //--------------------------------------------------------------------------------------------------440 //--------------------------------------------------------------------------------------------------448 //--------------------------------------------------------------------------------------------------456 //--------------------------------------------------------------------------------------------------458 (467 //--------------------------------------------------------------------------------------------------475 //--------------------------------------------------------------------------------------------------477 (486 //--------------------------------------------------------------------------------------------------493 //--------------------------------------------------------------------------------------------------500 //--------------------------------------------------------------------------------------------------508 //--------------------------------------------------------------------------------------------------514 //--------------------------------------------------------------------------------------------------518 //--------------------------------------------------------------------------------------------------void le_dls_AddAfter(le_dls_List_t *listPtr, le_dls_Link_t *currentLinkPtr, le_dls_Link_t *newLinkPtr)le_dls_Link_t * le_dls_PeekTail(const le_dls_List_t *listPtr)static bool le_dls_IsHead(const le_dls_List_t *listPtr, const le_dls_Link_t *linkPtr)Definition: le_doublyLinkedList.h:458Definition: le_doublyLinkedList.h:197le_dls_Link_t * le_dls_PeekPrev(const le_dls_List_t *listPtr, const le_dls_Link_t *currentLinkPtr)struct le_dls_Link * nextPtrNext link pointer.Definition: le_doublyLinkedList.h:199bool le_dls_IsListCorrupted(const le_dls_List_t *listPtr)void le_dls_AddBefore(le_dls_List_t *listPtr, le_dls_Link_t *currentLinkPtr, le_dls_Link_t *newLinkPtr)void le_dls_Queue(le_dls_List_t *listPtr, le_dls_Link_t *newLinkPtr)struct le_dls_Link * prevPtrPrevious link pointer.Definition: le_doublyLinkedList.h:200le_dls_Link_t * le_dls_PopTail(le_dls_List_t *listPtr)Definition: le_doublyLinkedList.h:213le_dls_Link_t * le_dls_Pop(le_dls_List_t *listPtr)void le_dls_Stack(le_dls_List_t *listPtr, le_dls_Link_t *newLinkPtr)le_dls_Link_t * headLinkPtrLink to list head.Definition: le_doublyLinkedList.h:215bool le_dls_IsInList(const le_dls_List_t *listPtr, const le_dls_Link_t *linkPtr)size_t le_dls_NumLinks(const le_dls_List_t *listPtr)void le_dls_Swap(le_dls_List_t *listPtr, le_dls_Link_t *linkPtr, le_dls_Link_t *otherLinkPtr)le_dls_Link_t * le_dls_Peek(const le_dls_List_t *listPtr)static bool le_dls_IsEmpty(const le_dls_List_t *listPtr)Definition: le_doublyLinkedList.h:372le_dls_Link_t * le_dls_PeekNext(const le_dls_List_t *listPtr, const le_dls_Link_t *currentLinkPtr)static bool le_dls_IsTail(const le_dls_List_t *listPtr, const le_dls_Link_t *linkPtr)Definition: le_doublyLinkedList.h:477void le_dls_Remove(le_dls_List_t *listPtr, le_dls_Link_t *linkToRemovePtr)