Go to the source code of this file.
Data Structures | |
struct | le_dls_Link_t |
struct | le_dls_List_t |
Macros | |
#define | LE_DLS_LIST_INIT (le_dls_List_t){NULL} |
#define | LE_DLS_LINK_INIT (le_dls_Link_t){NULL, NULL} |
Legato Doubly Linked List API include file.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
#define LE_DLS_LINK_INIT (le_dls_Link_t){NULL, NULL} |
When a link is created it must be initialized by assigning this macro to the link before it can be used.
#define LE_DLS_LIST_INIT (le_dls_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_dls_AddAfter | ( | le_dls_List_t * | listPtr, |
le_dls_Link_t * | currentLinkPtr, | ||
le_dls_Link_t * | newLinkPtr | ||
) |
Adds a link after currentLinkPtr. User must 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. |
void le_dls_AddBefore | ( | le_dls_List_t * | listPtr, |
le_dls_Link_t * | currentLinkPtr, | ||
le_dls_Link_t * | newLinkPtr | ||
) |
Adds a link after currentLinkPtr. User must 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 before this link. |
[in] | newLinkPtr | New link to add. |
|
inlinestatic |
Checks if a list is empty.
[in] | listPtr | The list. |
bool le_dls_IsInList | ( | const le_dls_List_t * | listPtr, |
const le_dls_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_dls_IsListCorrupted | ( | const le_dls_List_t * | listPtr | ) |
Checks if the list is corrupted.
[in] | listPtr | List to check. |
size_t le_dls_NumLinks | ( | const le_dls_List_t * | listPtr | ) |
Returns the number of links in a list.
[in] | listPtr | List to count. |
le_dls_Link_t* le_dls_Peek | ( | const le_dls_List_t * | listPtr | ) |
Returns the link at the head of the list without removing it from the list.
[in] | listPtr | The list. |
le_dls_Link_t* le_dls_PeekNext | ( | const le_dls_List_t * | listPtr, |
const le_dls_Link_t * | currentLinkPtr | ||
) |
Returns the link next to currentLinkPtr (i.e., the link beside currentLinkPtr that is closer to the tail) without removing it from the list. User must ensure that 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_dls_Link_t* le_dls_PeekPrev | ( | const le_dls_List_t * | listPtr, |
const le_dls_Link_t * | currentLinkPtr | ||
) |
Returns the link previous to currentLinkPtr without removing it from the list. User must ensure that 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_dls_Link_t* le_dls_PeekTail | ( | const le_dls_List_t * | listPtr | ) |
Returns the link at the tail of the list without removing it from the list.
[in] | listPtr | The list. |
le_dls_Link_t* le_dls_Pop | ( | le_dls_List_t * | listPtr | ) |
Removes and returns the link at the head of the list.
[in] | listPtr | List to remove from. |
le_dls_Link_t* le_dls_PopTail | ( | le_dls_List_t * | listPtr | ) |
Removes and returns the link at the tail of the list.
[in] | listPtr | List to remove from. |
void le_dls_Queue | ( | le_dls_List_t * | listPtr, |
le_dls_Link_t * | newLinkPtr | ||
) |
Adds a link to the tail of the list.
[in] | listPtr | List to add to. |
[in] | newLinkPtr | New link to add. |
void le_dls_Remove | ( | le_dls_List_t * | listPtr, |
le_dls_Link_t * | linkToRemovePtr | ||
) |
Removes the specified link from the list. Ensure the link is in the list otherwise the behaviour of this function is undefined.
[in] | listPtr | List to remove from. |
[in] | linkToRemovePtr | Link to remove. |
void le_dls_Stack | ( | le_dls_List_t * | listPtr, |
le_dls_Link_t * | newLinkPtr | ||
) |
Adds a link at the head of the list.
[in] | listPtr | List to add to. |
[in] | newLinkPtr | New link to add. |
void le_dls_Swap | ( | le_dls_List_t * | listPtr, |
le_dls_Link_t * | linkPtr, | ||
le_dls_Link_t * | otherLinkPtr | ||
) |
Swaps the position of two links in the list. User must ensure that both links are in the list otherwise the behaviour of this function is undefined.
[in] | listPtr | List containing the links to swap. |
[in] | linkPtr | One of the two link pointers to swap. |
[in] | otherLinkPtr | Other link pointer to swap. |