2024-03-10 14:19:56 +01:00
|
|
|
#ifndef _KIK_ZAD1_STACK_H
|
|
|
|
#define _KIK_ZAD1_STACK_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
typedef struct Stack Stack;
|
|
|
|
|
|
|
|
Stack *stack_new(size_t size, size_t element_size);
|
|
|
|
|
|
|
|
void stack_free(Stack *stack);
|
|
|
|
|
2024-03-11 14:17:35 +01:00
|
|
|
// The caller must free the return value after use.
|
2024-03-10 14:19:56 +01:00
|
|
|
void *stack_pop(Stack *stack);
|
|
|
|
|
|
|
|
bool stack_push(Stack *stack, void *value);
|
|
|
|
|
|
|
|
#endif // _KIK_ZAD1_STACK_H
|