le_singlyLinkedList.h
Go to the documentation of this file.
8 * A singly linked list is a data structure consisting of a group of nodes linked together linearly.44 * requirement for nodes is that it must contain a le_sls_Link_t link member. The link member must98 * simply manages the links in the nodes. The node must first be removed from all lists before its153 * All linked list function calls are re-entrant and thread safe themselves, but if the nodes and/or154 * list object are shared by multiple threads, then explicit steps must be taken to maintain mutual155 * exclusion of access. If you're accessing the same list from multiple threads, you @e must use a176 //--------------------------------------------------------------------------------------------------178 * This link object must be included in each user node. The node's link object is used to add the179 * node to a list. A node may have multiple link objects which would allow the node to be part of185 //--------------------------------------------------------------------------------------------------193 //--------------------------------------------------------------------------------------------------200 //--------------------------------------------------------------------------------------------------208 //--------------------------------------------------------------------------------------------------214 //--------------------------------------------------------------------------------------------------218 //--------------------------------------------------------------------------------------------------223 //--------------------------------------------------------------------------------------------------226 //--------------------------------------------------------------------------------------------------231 //--------------------------------------------------------------------------------------------------235 //--------------------------------------------------------------------------------------------------237 * When a link is created it must be initialized by assigning this macro to the link before it can240 //--------------------------------------------------------------------------------------------------244 //--------------------------------------------------------------------------------------------------248 //--------------------------------------------------------------------------------------------------256 //--------------------------------------------------------------------------------------------------260 //--------------------------------------------------------------------------------------------------268 //--------------------------------------------------------------------------------------------------271 * Ensure that currentLinkPtr is in the list (or NULL) otherwise the behaviour of this function is274 //--------------------------------------------------------------------------------------------------283 //--------------------------------------------------------------------------------------------------285 * Removes the link found after currentLinkPtr. The user must ensure that currentLinkPtr is in the292 //--------------------------------------------------------------------------------------------------301 //--------------------------------------------------------------------------------------------------309 //--------------------------------------------------------------------------------------------------316 //--------------------------------------------------------------------------------------------------324 //--------------------------------------------------------------------------------------------------331 //------------------------------------------------------------------------------------------------------------339 //------------------------------------------------------------------------------------------------------------346 //--------------------------------------------------------------------------------------------------348 * Returns the link next to currentLinkPtr (i.e., the link beside currentLinkPtr that's closer to the357 //--------------------------------------------------------------------------------------------------365 //--------------------------------------------------------------------------------------------------372 //--------------------------------------------------------------------------------------------------374 (377 //--------------------------------------------------------------------------------------------------383 //--------------------------------------------------------------------------------------------------387 //--------------------------------------------------------------------------------------------------394 //--------------------------------------------------------------------------------------------------402 //--------------------------------------------------------------------------------------------------410 //--------------------------------------------------------------------------------------------------418 //--------------------------------------------------------------------------------------------------420 (429 //--------------------------------------------------------------------------------------------------437 //--------------------------------------------------------------------------------------------------439 (448 //--------------------------------------------------------------------------------------------------455 //--------------------------------------------------------------------------------------------------462 //--------------------------------------------------------------------------------------------------470 //--------------------------------------------------------------------------------------------------476 //--------------------------------------------------------------------------------------------------480 //--------------------------------------------------------------------------------------------------size_t le_sls_NumLinks(const le_sls_List_t *listPtr)bool(* le_sls_LessThanFunc_t)(le_sls_Link_t *a, le_sls_Link_t *b)Definition: le_singlyLinkedList.h:215struct le_sls_Link * nextPtrNext link pointer.Definition: le_singlyLinkedList.h:188Definition: le_singlyLinkedList.h:186LE_DECLARE_INLINE bool le_sls_IsTail(const le_sls_List_t *listPtr, const le_sls_Link_t *linkPtr)Definition: le_singlyLinkedList.h:439le_sls_Link_t * le_sls_PeekNext(const le_sls_List_t *listPtr, const le_sls_Link_t *currentLinkPtr)le_sls_Link_t * le_sls_PeekTail(const le_sls_List_t *listPtr)LE_DECLARE_INLINE bool le_sls_IsHead(const le_sls_List_t *listPtr, const le_sls_Link_t *linkPtr)Definition: le_singlyLinkedList.h:420le_sls_Link_t * le_sls_Peek(const le_sls_List_t *listPtr)void le_sls_Stack(le_sls_List_t *listPtr, le_sls_Link_t *newLinkPtr)void le_sls_Queue(le_sls_List_t *listPtr, le_sls_Link_t *newLinkPtr)void le_sls_Sort(le_sls_List_t *listPtr, le_sls_LessThanFunc_t comparatorPtr)bool le_sls_IsListCorrupted(const le_sls_List_t *listPtr)bool le_sls_IsInList(const le_sls_List_t *listPtr, const le_sls_Link_t *linkPtr)LE_DECLARE_INLINE bool le_sls_IsEmpty(const le_sls_List_t *listPtr)Definition: le_singlyLinkedList.h:374Definition: le_singlyLinkedList.h:201le_sls_Link_t * le_sls_Pop(le_sls_List_t *listPtr)le_sls_Link_t * tailLinkPtrTail link pointer.Definition: le_singlyLinkedList.h:203void le_sls_AddAfter(le_sls_List_t *listPtr, le_sls_Link_t *currentLinkPtr, le_sls_Link_t *newLinkPtr)le_sls_Link_t * le_sls_RemoveAfter(le_sls_List_t *listPtr, le_sls_Link_t *currentLinkPtr)