2018-05-16 20:00:41 +00:00
|
|
|
#ifndef STACK_H
|
|
|
|
#define STACK_H
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
unsigned char* data;
|
|
|
|
unsigned int capacity;
|
|
|
|
unsigned int size;
|
|
|
|
unsigned int element_size;
|
|
|
|
} Stack;
|
|
|
|
|
2018-05-26 18:17:42 +00:00
|
|
|
void init_stack(Stack* stack, unsigned int element_size, unsigned int capacity);
|
|
|
|
void* stack_top(Stack* stack);
|
|
|
|
void* stack_replace(Stack* stack, const void* element);
|
|
|
|
void* stack_push(Stack* stack, const void* element);
|
|
|
|
void stack_pop(Stack* stack);
|
2018-05-16 20:00:41 +00:00
|
|
|
|
|
|
|
#endif // STACK_H
|