This file contains global type definitions which are used throughout the entire engine and applicatio...
unsigned int u32
Unsigned 32-bit integer.
Definition: defines.h:25
_Bool b8
8-bit boolean type
Definition: defines.h:58
signed int i32
Signed 32-bit integer.
Definition: defines.h:39
struct ring_queue ring_queue
Represents a ring queue of a particular size. Does not resize dynamically. Naturally,...
b8 ring_queue_create(u32 stride, u32 capacity, void *memory, ring_queue *out_queue)
Creates a new ring queue of the given capacity and stride.
b8 ring_queue_peek(const ring_queue *queue, void *out_value)
Attempts to retrieve, but not remove, the next value in the queue, if not empty.
b8 ring_queue_enqueue(ring_queue *queue, void *value)
Adds value to queue, if space is available.
b8 ring_queue_dequeue(ring_queue *queue, void *out_value)
Attempts to retrieve the next value from the provided queue.
void ring_queue_destroy(ring_queue *queue)
Destroys the given queue. If memory was not passed in during creation, it is freed here.
Represents a ring queue of a particular size. Does not resize dynamically. Naturally,...
Definition: ring_queue.h:9
u32 capacity
The total number of elements available.
Definition: ring_queue.h:15
b8 owns_memory
Indicates if the queue owns its memory block.
Definition: ring_queue.h:19
i32 tail
The index of the tail of the list.
Definition: ring_queue.h:23
u32 length
The current number of elements contained.
Definition: ring_queue.h:11
i32 head
The index of the head of the list.
Definition: ring_queue.h:21
u32 stride
The size of each element in bytes.
Definition: ring_queue.h:13
void * block
The block of memory to hold the data.
Definition: ring_queue.h:17