lazysphere/lib/stack.h

23 lines
462 B
C
Raw Normal View History

2023-05-04 20:10:37 +00:00
#ifndef STACK_H
#define STACK_H
2023-05-06 04:39:44 +00:00
#include "def.h"
2023-05-02 04:37:30 +00:00
#include <stddef.h>
struct Stack {
size_t size;
size_t capacity;
void* data;
};
void stack_init(struct Stack* stack, size_t size);
void stack_push(struct Stack* stack, void* data, size_t len);
void* stack_pop(struct Stack* stack, size_t len);
void stack_free(struct Stack* stack);
2023-05-04 20:10:37 +00:00
void stack_push_int(struct Stack* stack, int value);
bool stack_pop_int(struct Stack* stack, int* value);
2023-05-02 04:37:30 +00:00
2023-05-04 20:10:37 +00:00
#endif