1.2.12.4.8 SRV_QUEUE_Remove_Element Function

C

void SRV_QUEUE_Remove_Element(
    SRV_QUEUE *queue, 
    SRV_QUEUE_ELEMENT *element
);

Summary

Removes the given element from a queue.

Description

This function removes the given element from a queue.

Precondition

The queue must have been initialized previously with function SRV_QUEUE_Init.

Parameters

ParamDescription
queuePointer to the queue from which the element must be removed
elementElement to be removed

Returns

None.

Example

#define NUM_MAX_NODES    750
typedef struct _node_info_tag
{
    struct _node_info_tag *prev;
    struct _node_info_tag *next;
    uint8_t macAddress[8]
} NODE_INFO;

static SRV_QUEUE nodeQueue;
static NODE_INFO nodeInfo;

SRV_QUEUE_Init(&nodeQueue, NUM_MAX_NODES, SRV_QUEUE_TYPE_SINGLE);
memset(nodeInfo.macAddress, 0xFF, 8);
SRV_QUEUE_Append(&nodeQueue, (SRV_QUEUE_ELEMENT *)&nodeInfo);
SRV_QUEUE_Remove_Element(&nodeQueue, (SRV_QUEUE_ELEMENT *)&nodeInfo);

Remarks

None.