Kohi Game Engine
|
A simple queue container. Elements are popped off the queue in the same order they were pushed to it. More...
#include "defines.h"
Go to the source code of this file.
Data Structures | |
struct | queue |
A simple queue container. Elements are popped off the queue in the same order they were pushed to it. More... | |
Typedefs | |
typedef struct queue | queue |
A simple queue container. Elements are popped off the queue in the same order they were pushed to it. More... | |
Functions | |
KAPI b8 | queue_create (queue *out_queue, u32 element_size) |
Creates a new queue. More... | |
KAPI void | queue_destroy (queue *s) |
Destroys the given queue. More... | |
KAPI b8 | queue_push (queue *s, void *element_data) |
Pushes an element (a copy of the element data) into the back of the queue. More... | |
KAPI b8 | queue_peek (const queue *s, void *out_element_data) |
Attempts to peek an element (writing out a copy of the element data on success) from the queue. If the queue is empty, nothing is done and false is returned. The queue memory is not modified. More... | |
KAPI b8 | queue_pop (queue *s, void *out_element_data) |
Attempts to pop an element (writing out a copy of the element data on success) from the front of the queue. If the queue is empty, nothing is done and false is returned. More... | |
A simple queue container. Elements are popped off the queue in the same order they were pushed to it.
A simple queue container. Elements are popped off the queue in the same order they were pushed to it.
Creates a new queue.
out_queue | A pointer to hold the newly-created queue. |
element_size | The size of each element in the queue. |
Destroys the given queue.
s | A pointer to the queue to be destroyed. |
Attempts to peek an element (writing out a copy of the element data on success) from the queue. If the queue is empty, nothing is done and false is returned. The queue memory is not modified.
s | A pointer to the queue to peek from. |
element_data | A pointer to write the element data to. Required. |
Attempts to pop an element (writing out a copy of the element data on success) from the front of the queue. If the queue is empty, nothing is done and false is returned.
s | A pointer to the queue to pop from. |
element_data | A pointer to write the element data to. Required. |