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

Remove all matching elements from a queue.

static inline void IotDeQueue_RemoveAllMatches( const IotDeQueue_t * const pQueue,
bool ( * isMatch )( const IotLink_t * const pOperationLink, void * pCompare ),
void * pMatch,
void ( * freeElement )( void * pData ),
size_t linkOffset )
Parameters
[in]pQueueThe queue 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 queue 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 queue 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.