void rdesc_stack_reset(struct rdesc_stack **stack)
Clears the stack and resets capacity to initial size.
Definition stack.c:102
size_t rdesc_stack_len(const struct rdesc_stack *stack)
Returns the current number of elements in the stack.
Definition stack.c:164
void * rdesc_stack_at(struct rdesc_stack *stack, size_t index)
Returns pointer to the element at the specified index.
Definition stack.c:111
void * rdesc_stack_multipop(struct rdesc_stack **stack, size_t count)
Pops multiple elements from the stack, and returns pointer to the element that was at the bottom of t...
Definition stack.c:136
void * rdesc_stack_push(struct rdesc_stack **stack, void *element)
Pushes a single element onto the stack.
Definition stack.c:131
void * rdesc_stack_multipush(struct rdesc_stack **stack, void *elements, size_t count)
Pushes multiple elements onto the stack.
Definition stack.c:116
void * rdesc_stack_pop(struct rdesc_stack **stack)
Removes and returns the top element from the stack.
Definition stack.c:159
void rdesc_stack_init(struct rdesc_stack **stack, size_t element_size)
Initializes a new stack with the specified element size.
Definition stack.c:85
void * rdesc_stack_top(struct rdesc_stack *stack)
Returns the top element without removing it.
Definition stack.c:154
void rdesc_stack_destroy(struct rdesc_stack *stack)
Frees all memory allocated by the stack.
Definition stack.c:97
Default implementation of the stack.
Definition stack.c:36
size_t element_size
Definition stack.c:39
char elements[]
Definition stack.c:40