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 must167 * All linked list function calls are re-entrant and thread safe themselves, but if the nodes and/or169 * exclusion of access. If you're accessing the same list from multiple threads, you @e must use a190 //--------------------------------------------------------------------------------------------------192 * This link object must be included in each user node. The node's link object is used to add the193 * node to a list. A node may have multiple link objects which would allow the node to be part of199 //--------------------------------------------------------------------------------------------------208 //--------------------------------------------------------------------------------------------------215 //--------------------------------------------------------------------------------------------------223 //--------------------------------------------------------------------------------------------------229 //--------------------------------------------------------------------------------------------------233 //--------------------------------------------------------------------------------------------------235 * When a list is created it must be initialized by assigning this macro to the list before the list238 //--------------------------------------------------------------------------------------------------242 //--------------------------------------------------------------------------------------------------244 * When a link is created it must be initialized by assigning this macro to the link before it can247 //--------------------------------------------------------------------------------------------------251 //--------------------------------------------------------------------------------------------------255 //--------------------------------------------------------------------------------------------------263 //--------------------------------------------------------------------------------------------------267 //--------------------------------------------------------------------------------------------------275 //--------------------------------------------------------------------------------------------------280 //--------------------------------------------------------------------------------------------------289 //--------------------------------------------------------------------------------------------------294 //--------------------------------------------------------------------------------------------------303 //--------------------------------------------------------------------------------------------------311 //--------------------------------------------------------------------------------------------------318 //--------------------------------------------------------------------------------------------------326 //--------------------------------------------------------------------------------------------------333 //--------------------------------------------------------------------------------------------------338 //--------------------------------------------------------------------------------------------------346 //--------------------------------------------------------------------------------------------------354 //--------------------------------------------------------------------------------------------------361 //--------------------------------------------------------------------------------------------------369 //--------------------------------------------------------------------------------------------------376 //--------------------------------------------------------------------------------------------------383 //--------------------------------------------------------------------------------------------------385 (388 //--------------------------------------------------------------------------------------------------394 //--------------------------------------------------------------------------------------------------396 * Returns the link next to currentLinkPtr (i.e., the link beside currentLinkPtr that is closer to the405 //--------------------------------------------------------------------------------------------------413 //--------------------------------------------------------------------------------------------------416 * ensure that currentLinkPtr is in the list otherwise the behaviour of this function is undefined.423 //--------------------------------------------------------------------------------------------------431 //--------------------------------------------------------------------------------------------------436 //--------------------------------------------------------------------------------------------------445 //--------------------------------------------------------------------------------------------------449 //--------------------------------------------------------------------------------------------------457 //--------------------------------------------------------------------------------------------------465 //--------------------------------------------------------------------------------------------------473 //--------------------------------------------------------------------------------------------------481 //--------------------------------------------------------------------------------------------------483 (492 //--------------------------------------------------------------------------------------------------500 //--------------------------------------------------------------------------------------------------502 (511 //--------------------------------------------------------------------------------------------------518 //--------------------------------------------------------------------------------------------------525 //--------------------------------------------------------------------------------------------------533 //--------------------------------------------------------------------------------------------------539 //--------------------------------------------------------------------------------------------------543 //--------------------------------------------------------------------------------------------------le_dls_Link_t * le_dls_PeekPrev(const le_dls_List_t *listPtr, const le_dls_Link_t *currentLinkPtr)le_dls_Link_t * le_dls_PeekTail(const le_dls_List_t *listPtr)LE_DECLARE_INLINE bool le_dls_IsEmpty(const le_dls_List_t *listPtr)Definition: le_doublyLinkedList.h:385void 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)bool(* le_dls_LessThanFunc_t)(le_dls_Link_t *a, le_dls_Link_t *b)Definition: le_doublyLinkedList.h:230bool le_dls_IsListCorrupted(const le_dls_List_t *listPtr)le_dls_Link_t * headLinkPtrLink to list head.Definition: le_doublyLinkedList.h:218void le_dls_AddAfter(le_dls_List_t *listPtr, le_dls_Link_t *currentLinkPtr, le_dls_Link_t *newLinkPtr)void le_dls_Remove(le_dls_List_t *listPtr, le_dls_Link_t *linkToRemovePtr)le_dls_Link_t * le_dls_PeekNext(const le_dls_List_t *listPtr, const le_dls_Link_t *currentLinkPtr)le_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)size_t le_dls_NumLinks(const le_dls_List_t *listPtr)struct le_dls_Link * nextPtrNext link pointer.Definition: le_doublyLinkedList.h:202void le_dls_Swap(le_dls_List_t *listPtr, le_dls_Link_t *linkPtr, le_dls_Link_t *otherLinkPtr)le_dls_Link_t * le_dls_PopTail(le_dls_List_t *listPtr)Definition: le_doublyLinkedList.h:200LE_DECLARE_INLINE bool le_dls_IsHead(const le_dls_List_t *listPtr, const le_dls_Link_t *linkPtr)Definition: le_doublyLinkedList.h:483Definition: le_doublyLinkedList.h:216struct le_dls_Link * prevPtrPrevious link pointer.Definition: le_doublyLinkedList.h:203void le_dls_Sort(le_dls_List_t *listPtr, le_dls_LessThanFunc_t comparatorPtr)le_dls_Link_t * le_dls_Peek(const le_dls_List_t *listPtr)bool le_dls_IsInList(const le_dls_List_t *listPtr, const le_dls_Link_t *linkPtr)LE_DECLARE_INLINE bool le_dls_IsTail(const le_dls_List_t *listPtr, const le_dls_Link_t *linkPtr)Definition: le_doublyLinkedList.h:502