Queue

A queue implementation. More...

Data Structures

struct  Queue
struct  Queue

Functions

Queuequeue_create (void)
 Create a new queue.
void queue_destroy (Queue *q)
 Destroy a queue.
void queue_add (Queue *q, void *item)
 Add an element to a queue.
void * queue_remove (Queue *q)
 Remove an element from a queue.
void queue_remove_all (Queue *q, void *item)
 Remove all instances of a given element from a queue.
int queue_size (Queue *q)
 Get the size of a queue.
int queue_is_empty (Queue *q)
 Check if the queue is empty.

Detailed Description

A queue implementation.

A queue implementation.


Function Documentation

void queue_add Queue q,
void *  item
 

Add an element to a queue.

Add an element to a queue.

Parameters:
q the queue to add an element to
item the item to add to the queue

Queue* queue_create void   ) 
 

Create a new queue.

Create a queue.

Returns:
the newly created queue.

void queue_destroy Queue q  ) 
 

Destroy a queue.

Destroys a queue, freeing memory.

Parameters:
q the queue to destroy

int queue_is_empty Queue q  ) 
 

Check if the queue is empty.

Check if the queue is empty.

Parameters:
q the queue to check
Returns:
nonzero if the queue is empty, 0 otherwise

void* queue_remove Queue q  ) 
 

Remove an element from a queue.

Remove an element from the front of a queue.

Parameters:
q the queue to remove the element from
Returns:
the element which was removed

void queue_remove_all Queue q,
void *  item
 

Remove all instances of a given element from a queue.

Remove all instances of a given element from a queue.

Parameters:
q the queue to remove the elements from
item the element to remove all instances of

int queue_size Queue q  ) 
 

Get the size of a queue.

Get the number of elements in the queue.

Parameters:
q the queue to get the size of
Returns:
the size of the queue


Generated on Fri Sep 21 12:57:06 2007 for libwireless by  doxygen 1.4.6