AWS IoT Device SDK C: Linear Containers
Linked lists and Queues
Return to main page ↑
IotListDouble_RemoveAllMatches

Remove all matching elements from a doubly-linked list.

static inline void IotListDouble_RemoveAllMatches( const IotListDouble_t * const pList,
bool ( *isMatch )( const IotLink_t * const pOperationLink, void * pCompare ),
void * pMatch,
void ( *freeElement )( void * pData ),
size_t linkOffset )
Parameters
[in]pListThe doubly-linked list to search.
[in]isMatchFunction to determine if an element matches. Pass NULL to search using the address pMatch, i.e. element == pMatch.
[in]pMatchIf isMatch is NULL, each element in the list is compared to this address to find a match. Otherwise, it is passed as the second argument to isMatch.
[in]freeElementA function to free memory used by each removed list element. Optional; pass NULL to ignore.
[in]linkOffsetOffset in bytes of a link member in its container, used to calculate the pointer to pass to freeElement. This value should be calculated with the C offsetof macro. This parameter is ignored if freeElement is NULL or its value is 0.