Stack (Last-In-First-Out). More...
Functions | |
kzsError | kzcStackCreate (const struct KzcMemoryManager *memoryManager, struct KzcStack **out_stack) |
Creates a new initially empty stack. More... | |
kzsError | kzcStackDelete (struct KzcStack *stack) |
Frees the memory allocated for the stack. More... | |
kzsError | kzcStackPush (struct KzcStack *stack, void *element) |
Pushes the specified element to the stack. More... | |
kzsError | kzcStackPop (struct KzcStack *stack, void **out_element) |
Pops the last element from the stack. More... | |
kzsError | kzcStackPeek (const struct KzcStack *stack, void **out_element) |
Gets the last element from the stack without removing it. More... | |
kzUint | kzcStackGetSize (const struct KzcStack *stack) |
Returns the number of elements in the stack. More... | |
kzBool | kzcStackIsEmpty (const struct KzcStack *stack) |
Checks if the stack is empty or not. More... | |
kzsError | kzcStackClear (struct KzcStack *stack) |
Clears the stack by removing all items from it. More... | |
Stack (Last-In-First-Out).
Copyright 2008-2020 by Rightware. All rights reserved.
kzsError kzcStackCreate | ( | const struct KzcMemoryManager * | memoryManager, |
struct KzcStack ** | out_stack | ||
) |
Creates a new initially empty stack.
Pushes the specified element to the stack.
Pops the last element from the stack.
Returns error if the stack is empty.
Gets the last element from the stack without removing it.
Returns error if the stack is empty.
Returns the number of elements in the stack.