CBuild wiki
Stack datatype implementation. This implements same overall
datastructure as dynamic array but with simplified API to only allow
push, pop and top (just read top
element without poping it) operations. It works over structures with
specific “form”, where T is a generic type:
License: GPL-3.0-or-later. Push a new element on top of
a stack.
cbuild_stack_t*
stack Stack object.*typeof(stack->data)
elem New element.Pop element from top of a stack.
cbuild_stack_t*
stack Stack object.*typeof(stack->data)
Popped element.
Get element from top of a stack.
cbuild_stack_t*
stack Stack object.*typeof(stack->data)
Element on top of a stack.
Resize dynamic array.
cbuild_stack_t*
stack Stack object.size_t new_size Resize stack If new_size equal 0
default growth strategy will be used.Free stack.
This should be used only if you want to free underlying memory, if
you just want to clear stack and reuse it, setting ptr to
0 would be much faster.
cbuild_stack_t*
stack Stack object.