aboutsummaryrefslogtreecommitdiff
path: root/src/common/stack.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/stack.h')
-rw-r--r--src/common/stack.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/common/stack.h b/src/common/stack.h
new file mode 100644
index 0000000..a85a333
--- /dev/null
+++ b/src/common/stack.h
@@ -0,0 +1,23 @@
+#ifndef STACK_H
+# define STACK_H
+
+#include <stdlib.h>
+#include "libft.h"
+
+typedef struct
+{
+ int *elements;
+ int top;
+} t_stack;
+
+t_stack *stack_new(int size);
+void stack_destroy(t_stack *stack);
+void stack_push(t_stack *stack, int n);
+void stack_pop(t_stack *stack);
+int stack_peek(t_stack *stack);
+void stack_swap(t_stack *stack);
+void stack_push_to(t_stack *from, t_stack *to);
+void stack_rotate(t_stack *stack);
+void stack_reverse_rotate(t_stack *stack);
+
+#endif