The requirements are described in doc/help/elektra-data-structures.md.
More...
The requirements are described in doc/help/elektra-data-structures.md.
The Vstack structure.
A stack implementation with dynamical memory allocation. The space gets doubled if full and reduced by half if used only a quarter of it, but not less than minSize.
int elektraVstackClear |
( |
Vstack * |
stack | ) |
|
Clears the stack in a fast fashion.
Resets the stackpointer to the base and does not reallocate memory. The next reallocation happens at Pop.
- Return values
-
Vstack* elektraVstackInit |
( |
size_t |
minSize | ) |
|
Allocates vstack with size specified by parameter minSize and sets the stack pointer.
- Parameters
-
minSize | the minimum size of the stack |
- Return values
-
a | Vstack pointer |
NULL | error |
int elektraVstackIsEmpty |
( |
const Vstack * |
stack | ) |
|
Checks if the stack is empty.
- Return values
-
1 | on empty |
0 | on non empty |
-1 | on error |
void* elektraVstackPop |
( |
Vstack * |
stack | ) |
|
Pops an element from the Vstack and resizes the stack if needed.
- Return values
-
int elektraVstackPush |
( |
Vstack * |
stack, |
|
|
void * |
data |
|
) |
| |
Pushes an element in the Vstack and resizes the stack if needed.
- Parameters
-
- Return values
-