aboutsummaryrefslogtreecommitdiff
path: root/src/common/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/common.h')
-rw-r--r--src/common/common.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/common/common.h b/src/common/common.h
new file mode 100644
index 0000000..4225d87
--- /dev/null
+++ b/src/common/common.h
@@ -0,0 +1,43 @@
+#ifndef STACK_H
+# define STACK_H
+
+#include <stdlib.h>
+#include "libft.h"
+
+typedef struct
+{
+ int *elements;
+ int top;
+} t_stack;
+
+/*
+** stack.c
+*/
+
+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);
+
+/*
+** action.c
+*/
+
+void swap_a(t_stack *a);
+void swap_b(t_stack *b);
+void swap_both(t_stack *a, t_stack *b);
+void push_a(t_stack *a, t_stack *b);
+void push_b(t_stack *b, t_stack *a);
+void rotate_a(t_stack *a);
+void rotate_b(t_stack *b);
+void rotate_both(t_stack *a, t_stack *b);
+void reverse_rotate_a(t_stack *a);
+void reverse_rotate_b(t_stack *b);
+void reverse_rotate_both(t_stack *a, t_stack *b);
+
+#endif