Queue data structure.
More...
Go to the source code of this file.
|
|
typedef struct Queue | queue_t |
| |
|
typedef struct Link | link_t |
| |
◆ dequeue()
Removes the first element of a queue, and returns it.
- Parameters
-
- Returns
- The data element at the head of the queue.
◆ enqueue()
| void enqueue |
( |
queue_t * |
queue, |
|
|
void * |
data |
|
) |
| |
Pushes data to the end of the queue.
- Parameters
-
| queue | A queue. |
| data | The data to enqueue. |
◆ list_size()
Gives the length of a queue.
- Parameters
-
- Returns
- The length of a queue.
◆ queue_destroy()
| void queue_destroy |
( |
queue_t * |
queue | ) |
|
Deallocates a queue.
- Parameters
-
| queue | The queue to deallocate. |
◆ queue_new()
Allocates space for a queue and returns an empty queue Creates a new queue data structure.
- Returns
- A pointer to a new, empty queue.