Kohi Game Engine
|
A simple stack container. Elements may be pushed on or popped off of the stack only. More...
#include "defines.h"
Go to the source code of this file.
Data Structures | |
struct | stack |
A simple stack container. Elements may be pushed on or popped off of the stack only. More... | |
Typedefs | |
typedef struct stack | stack |
A simple stack container. Elements may be pushed on or popped off of the stack only. More... | |
Functions | |
KAPI b8 | stack_create (stack *out_stack, u32 element_size) |
Creates a new stack. More... | |
KAPI void | stack_destroy (stack *s) |
Destroys the given stack. More... | |
KAPI b8 | stack_push (stack *s, void *element_data) |
Pushes an element (a copy of the element data) onto the stack. More... | |
KAPI b8 | stack_pop (stack *s, void *out_element_data) |
Attempts to pop an element (writing out a copy of the element data on success) from the stack. If the stack is empty, nothing is done and false is returned. More... | |
A simple stack container. Elements may be pushed on or popped off of the stack only.
A simple stack container. Elements may be pushed on or popped off of the stack only.
Creates a new stack.
out_stack | A pointer to hold the newly-created stack. |
element_size | The size of each element in the stack. |
Destroys the given stack.
s | A pointer to the stack to be destroyed. |
Attempts to pop an element (writing out a copy of the element data on success) from the stack. If the stack is empty, nothing is done and false is returned.
s | A pointer to the stack to pop from. |
element_data | A pointer to write the element data to. Required. |