|
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_peek (const stack *s, void *out_element_data) |
| Attempts to peek 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. The stack memory is not modified. 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 peek 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. The stack memory is not modified.
| s | A pointer to the stack 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 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. |