aboutsummaryrefslogtreecommitdiff
path: root/src/position_stack.h
diff options
context:
space:
mode:
authorHampus <hampus@hampusmat.com>2021-12-14 00:01:35 +0100
committerHampus <hampus@hampusmat.com>2021-12-14 00:01:35 +0100
commit88d8be06f3e5411db6faa59db12210b6079f7d21 (patch)
tree8e05fca5d76cb8734fc30e50297471ca72cdaa20 /src/position_stack.h
parentaf93edd8433634d82e855e9c9bcbca249a476977 (diff)
refactor: restructure project
Diffstat (limited to 'src/position_stack.h')
-rw-r--r--src/position_stack.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/position_stack.h b/src/position_stack.h
new file mode 100644
index 0000000..fe93e8c
--- /dev/null
+++ b/src/position_stack.h
@@ -0,0 +1,28 @@
+#ifndef POSITION_STACK_H
+#define POSITION_STACK_H
+
+#define STACK_ERR_OVERFLOW 0xFFF01
+#define STACK_ERR_UNDERFLOW 0xFFF02
+
+struct Position
+{
+ int x;
+ int y;
+};
+
+struct PositionStack
+{
+ int max_size;
+ int top;
+ struct Position *items;
+};
+
+struct PositionStack *create_pos_stack(int capacity);
+
+void pos_stack_push(struct PositionStack *stack_pt, struct Position pos);
+
+struct Position pos_stack_peek(struct PositionStack *stack_pt);
+
+struct Position pos_stack_pop(struct PositionStack *stack_pt);
+
+#endif \ No newline at end of file