t_stack * stack_copy(const t_stack *stack)
Copies a stack and all it contents.
void * stack_pop(t_stack *stack)
Removed and returns the item most recently added to this stack.
void stack_delete(t_stack *stack)
Deletes the stack and frees memory taken by its contents.
size_t stack_size(const t_stack *stack)
Returns the number of items in this stack.
void * stack_peek(const t_stack *stack)
Returns the item most recently added to this stack, without removing it.
A full representation of a data type, used to achieve polymorphism in the implementation of data stru...
void stack_push(t_stack *stack, const void *data)
Copy the item and add it to the stack.
t_array t_stack
A last-in-first-out stack of generic items.
t_stack * stack_new(const t_type *type)
Initializes an empty stack.