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 //--------------------------------------------------------------------------------------------------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 //--------------------------------------------------------------------------------------------------263 * Ensure that currentLinkPtr is in the list (or NULL) otherwise the behaviour of this function is266 //--------------------------------------------------------------------------------------------------275 //--------------------------------------------------------------------------------------------------277 * Removes the link found after currentLinkPtr. The user must ensure that currentLinkPtr is in the284 //--------------------------------------------------------------------------------------------------293 //--------------------------------------------------------------------------------------------------301 //--------------------------------------------------------------------------------------------------308 //--------------------------------------------------------------------------------------------------316 //--------------------------------------------------------------------------------------------------323 //------------------------------------------------------------------------------------------------------------331 //------------------------------------------------------------------------------------------------------------338 //--------------------------------------------------------------------------------------------------340 * Returns the link next to currentLinkPtr (i.e., the link beside currentLinkPtr that's closer to the349 //--------------------------------------------------------------------------------------------------357 //--------------------------------------------------------------------------------------------------364 //--------------------------------------------------------------------------------------------------366 (369 //--------------------------------------------------------------------------------------------------375 //--------------------------------------------------------------------------------------------------379 //--------------------------------------------------------------------------------------------------386 //--------------------------------------------------------------------------------------------------394 //--------------------------------------------------------------------------------------------------402 //--------------------------------------------------------------------------------------------------410 //--------------------------------------------------------------------------------------------------412 (421 //--------------------------------------------------------------------------------------------------429 //--------------------------------------------------------------------------------------------------431 (440 //--------------------------------------------------------------------------------------------------447 //--------------------------------------------------------------------------------------------------454 //--------------------------------------------------------------------------------------------------462 //--------------------------------------------------------------------------------------------------468 //--------------------------------------------------------------------------------------------------472 //--------------------------------------------------------------------------------------------------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:431le_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:412le_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:366Definition: 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)