data_structures
|
Go to the source code of this file.
Typedefs | |
typedef struct s_list | t_queue |
Represents a first-in-first-out (FIFO) queue of generic items. More... | |
Functions | |
void | queue_enqueue (t_queue *queue, const void *data) |
Copies the item and adds the copy to the queue. More... | |
void * | queue_dequeue (t_queue *queue) |
Removes and returns the item on this queue that was least recently added. More... | |
void * | queue_peek (const t_queue *queue) |
Returns the item in this queue that was least recently added. More... | |
void | queue_delete (t_queue *queue) |
Deletes the queue and frees all memory taken by its contents, or does nothing if the argument is NULL . More... | |
size_t | queue_size (const t_queue *queue) |
Returns the number of items in this queue. More... | |
t_queue * | queue_new (const t_type *type) |
Allocates memory and initializes an empty queue. More... | |
t_queue * | queue_copy (const t_queue *queue) |
Copies a queue and all it contents. More... | |
Copies a queue and all it contents.
Definition at line 16 of file queue_copy.c.
void queue_delete | ( | t_queue * | queue | ) |
Deletes the queue and frees all memory taken by its contents, or does nothing if the argument is NULL
.
Definition at line 16 of file queue_delete.c.
void* queue_dequeue | ( | t_queue * | queue | ) |
Removes and returns the item on this queue that was least recently added.
NULL
if the queue is empty. Definition at line 16 of file queue_dequeue.c.
void queue_enqueue | ( | t_queue * | queue, |
const void * | data | ||
) |
Copies the item and adds the copy to the queue.
data | The item to add |
Definition at line 16 of file queue_enqueue.c.
Allocates memory and initializes an empty queue.
the | type of items that this queue will hold |
Definition at line 16 of file queue_new.c.
void* queue_peek | ( | const t_queue * | queue | ) |
Returns the item in this queue that was least recently added.
The item is kepts on the queue.
NULL
if the queue is empty. Definition at line 16 of file queue_peek.c.
size_t queue_size | ( | const t_queue * | queue | ) |
Returns the number of items in this queue.
Definition at line 16 of file queue_size.c.