15 lines
305 B
C
15 lines
305 B
C
#pragma once
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
// uint64_t only
|
|
struct stack {
|
|
size_t sp, size;
|
|
uint64_t *data;
|
|
};
|
|
|
|
int stack_init(struct stack *st, size_t size);
|
|
void stack_free(struct stack *st);
|
|
int stack_push(struct stack *st, uint64_t w);
|
|
int stack_pop(struct stack *st, uint64_t *w);
|