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 must185 //--------------------------------------------------------------------------------------------------187 * This link object must be included in each user node. The node's link object is used to add the188 * node to a list. A node may have multiple link objects which would allow the node to be part of194 //--------------------------------------------------------------------------------------------------203 //--------------------------------------------------------------------------------------------------210 //--------------------------------------------------------------------------------------------------218 //--------------------------------------------------------------------------------------------------220 * When a list is created it must be initialized by assigning this macro to the list before the list223 //--------------------------------------------------------------------------------------------------227 //--------------------------------------------------------------------------------------------------229 * When a link is created it must be initialized by assigning this macro to the link before it can232 //--------------------------------------------------------------------------------------------------236 //--------------------------------------------------------------------------------------------------240 //--------------------------------------------------------------------------------------------------248 //--------------------------------------------------------------------------------------------------252 //--------------------------------------------------------------------------------------------------260 //--------------------------------------------------------------------------------------------------265 //--------------------------------------------------------------------------------------------------274 //--------------------------------------------------------------------------------------------------279 //--------------------------------------------------------------------------------------------------288 //--------------------------------------------------------------------------------------------------296 //--------------------------------------------------------------------------------------------------303 //--------------------------------------------------------------------------------------------------311 //--------------------------------------------------------------------------------------------------318 //--------------------------------------------------------------------------------------------------323 //--------------------------------------------------------------------------------------------------331 //--------------------------------------------------------------------------------------------------339 //--------------------------------------------------------------------------------------------------346 //--------------------------------------------------------------------------------------------------354 //--------------------------------------------------------------------------------------------------361 //--------------------------------------------------------------------------------------------------368 //--------------------------------------------------------------------------------------------------370 (373 //--------------------------------------------------------------------------------------------------379 //--------------------------------------------------------------------------------------------------381 * Returns the link next to currentLinkPtr (i.e., the link beside currentLinkPtr that is closer to the390 //--------------------------------------------------------------------------------------------------398 //--------------------------------------------------------------------------------------------------401 * ensure that currentLinkPtr is in the list otherwise the behaviour of this function is undefined.408 //--------------------------------------------------------------------------------------------------416 //--------------------------------------------------------------------------------------------------421 //--------------------------------------------------------------------------------------------------430 //--------------------------------------------------------------------------------------------------438 //--------------------------------------------------------------------------------------------------446 //--------------------------------------------------------------------------------------------------454 //--------------------------------------------------------------------------------------------------456 (465 //--------------------------------------------------------------------------------------------------473 //--------------------------------------------------------------------------------------------------475 (484 //--------------------------------------------------------------------------------------------------491 //--------------------------------------------------------------------------------------------------498 //--------------------------------------------------------------------------------------------------506 //--------------------------------------------------------------------------------------------------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:456Definition: le_doublyLinkedList.h:195le_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:197bool 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:198le_dls_Link_t * le_dls_PopTail(le_dls_List_t *listPtr)Definition: le_doublyLinkedList.h:211le_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:213bool 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:370le_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:475void le_dls_Remove(le_dls_List_t *listPtr, le_dls_Link_t *linkToRemovePtr)