From f061613650f5e7c5e260a4d9a1ca1b1d80ca2f2c Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 14 Jan 2020 18:50:02 +0100 Subject: Added checker base --- src/common/action.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/common/action.h | 19 ------------------ src/common/common.h | 43 ++++++++++++++++++++++++++++++++++++++++ src/common/stack.c | 2 +- src/common/stack.h | 23 ---------------------- 5 files changed, 100 insertions(+), 43 deletions(-) delete mode 100644 src/common/action.h create mode 100644 src/common/common.h delete mode 100644 src/common/stack.h (limited to 'src/common') diff --git a/src/common/action.c b/src/common/action.c index e69de29..bfbe436 100644 --- a/src/common/action.c +++ b/src/common/action.c @@ -0,0 +1,56 @@ +#include "common.h" + +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) +{ + +} diff --git a/src/common/action.h b/src/common/action.h deleted file mode 100644 index d458c49..0000000 --- a/src/common/action.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef ACTION_H -# define ACTION_H - -# include "stack.h" - -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 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 +#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 diff --git a/src/common/stack.c b/src/common/stack.c index cbd0986..693fb85 100644 --- a/src/common/stack.c +++ b/src/common/stack.c @@ -1,4 +1,4 @@ -#include "stack.h" +#include "common.h" t_stack *stack_new(int size) { diff --git a/src/common/stack.h b/src/common/stack.h deleted file mode 100644 index a85a333..0000000 --- a/src/common/stack.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef STACK_H -# define STACK_H - -#include -#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 -- cgit