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 //--------------------------------------------------------------------------------------------------238 //--------------------------------------------------------------------------------------------------241 //--------------------------------------------------------------------------------------------------246 //--------------------------------------------------------------------------------------------------250 //--------------------------------------------------------------------------------------------------252 * When a link is created it must be initialized by assigning this macro to the link before it can255 //--------------------------------------------------------------------------------------------------259 //--------------------------------------------------------------------------------------------------263 //--------------------------------------------------------------------------------------------------271 //--------------------------------------------------------------------------------------------------275 //--------------------------------------------------------------------------------------------------283 //--------------------------------------------------------------------------------------------------288 //--------------------------------------------------------------------------------------------------297 //--------------------------------------------------------------------------------------------------302 //--------------------------------------------------------------------------------------------------311 //--------------------------------------------------------------------------------------------------319 //--------------------------------------------------------------------------------------------------326 //--------------------------------------------------------------------------------------------------334 //--------------------------------------------------------------------------------------------------341 //--------------------------------------------------------------------------------------------------346 //--------------------------------------------------------------------------------------------------354 //--------------------------------------------------------------------------------------------------362 //--------------------------------------------------------------------------------------------------369 //--------------------------------------------------------------------------------------------------377 //--------------------------------------------------------------------------------------------------384 //--------------------------------------------------------------------------------------------------391 //--------------------------------------------------------------------------------------------------393 (396 //--------------------------------------------------------------------------------------------------402 //--------------------------------------------------------------------------------------------------404 * Returns the link next to currentLinkPtr (i.e., the link beside currentLinkPtr that is closer to the413 //--------------------------------------------------------------------------------------------------421 //--------------------------------------------------------------------------------------------------424 * ensure that currentLinkPtr is in the list otherwise the behaviour of this function is undefined.431 //--------------------------------------------------------------------------------------------------439 //--------------------------------------------------------------------------------------------------444 //--------------------------------------------------------------------------------------------------453 //--------------------------------------------------------------------------------------------------457 //--------------------------------------------------------------------------------------------------465 //--------------------------------------------------------------------------------------------------473 //--------------------------------------------------------------------------------------------------481 //--------------------------------------------------------------------------------------------------489 //--------------------------------------------------------------------------------------------------491 (500 //--------------------------------------------------------------------------------------------------508 //--------------------------------------------------------------------------------------------------510 (519 //--------------------------------------------------------------------------------------------------526 //--------------------------------------------------------------------------------------------------533 //--------------------------------------------------------------------------------------------------541 //--------------------------------------------------------------------------------------------------547 //--------------------------------------------------------------------------------------------------551 //--------------------------------------------------------------------------------------------------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:393void 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:491Definition: 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:510