Go to the source code of this file.
Data Structures | |
struct | le_sls_Link_t |
struct | le_sls_List_t |
Macros | |
#define | LE_SLS_LIST_INIT (le_sls_List_t){NULL} |
#define | LE_SLS_LINK_INIT (le_sls_Link_t){NULL} |
Functions | |
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_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) |
le_sls_Link_t * | le_sls_Pop (le_sls_List_t *listPtr) |
le_sls_Link_t * | le_sls_Peek (const le_sls_List_t *listPtr) |
le_sls_Link_t * | le_sls_PeekNext (const le_sls_List_t *listPtr, const le_sls_Link_t *currentLinkPtr) |
static bool | le_sls_IsEmpty (const le_sls_List_t *listPtr) |
bool | le_sls_IsInList (const le_sls_List_t *listPtr, const le_sls_Link_t *linkPtr) |
size_t | le_sls_NumLinks (const le_sls_List_t *listPtr) |
bool | le_sls_IsListCorrupted (const le_sls_List_t *listPtr) |
Legato Singly Linked List API include file.
Copyright (C) Sierra Wireless, Inc. 2014. All rights reserved. Use of this work is subject to license.
#define LE_SLS_LINK_INIT (le_sls_Link_t){NULL} |
When a link is created, it must be initialized by assigning this macro to the link before it can be used.
#define LE_SLS_LIST_INIT (le_sls_List_t){NULL} |
When a list is created, it must be initialized by assigning this macro to the list before the list can be used.
void le_sls_AddAfter | ( | le_sls_List_t * | listPtr, |
le_sls_Link_t * | currentLinkPtr, | ||
le_sls_Link_t * | newLinkPtr | ||
) |
Adds a link after currentLinkPtr. Ensure that currentLinkPtr is in the list otherwise the behaviour of this function is undefined.
[in] | listPtr | List to add to. |
[in] | currentLinkPtr | New link will be inserted after this link. |
[in] | newLinkPtr | New link to add. |
|
inlinestatic |
Checks if a list is empty.
[in] | listPtr | The list. |
bool le_sls_IsInList | ( | const le_sls_List_t * | listPtr, |
const le_sls_Link_t * | linkPtr | ||
) |
Checks if a link is in the list.
[in] | listPtr | List to check. |
[in] | linkPtr | Check if this link is in the list. |
bool le_sls_IsListCorrupted | ( | const le_sls_List_t * | listPtr | ) |
Checks if the list is corrupted.
[in] | listPtr | List to check. |
size_t le_sls_NumLinks | ( | const le_sls_List_t * | listPtr | ) |
Returns the number of links in a list.
[in] | listPtr | List to count. |
le_sls_Link_t* le_sls_Peek | ( | const le_sls_List_t * | listPtr | ) |
Returns the link at the head of the list without removing it from the list.
[in] | listPtr | The list. |
le_sls_Link_t* le_sls_PeekNext | ( | const le_sls_List_t * | listPtr, |
const le_sls_Link_t * | currentLinkPtr | ||
) |
Returns the link next to currentLinkPtr (i.e., the link beside currentLinkPtr that's closer to the tail) without removing it from the list. Ensure currentLinkPtr is in the list otherwise the behaviour of this function is undefined.
[in] | listPtr | List containing currentLinkPtr. |
[in] | currentLinkPtr | Get the link that is relative to this link. |
le_sls_Link_t* le_sls_Pop | ( | le_sls_List_t * | listPtr | ) |
Removes and returns the link at the head of the list.
[in] | listPtr | List to remove from. |
void le_sls_Queue | ( | le_sls_List_t * | listPtr, |
le_sls_Link_t * | newLinkPtr | ||
) |
Adds a link to the tail of the list.
[in] | listPtr | List to add to. |
[in] | newLinkPtr | New link to add. |
le_sls_Link_t* le_sls_RemoveAfter | ( | le_sls_List_t * | listPtr, |
le_sls_Link_t * | currentLinkPtr | ||
) |
Removes the link found after currentLinkPtr. The user must ensure that currentLinkPtr is in the list otherwise the behaviour of this function is undefined.
[in] | listPtr | The list to remove from. |
[in] | currentLinkPtr | The link after this one will be removed from the list. |
void le_sls_Stack | ( | le_sls_List_t * | listPtr, |
le_sls_Link_t * | newLinkPtr | ||
) |
Adds a link at the head of the list.
[in] | listPtr | List to add to. |
[in] | newLinkPtr | New link to add. |