diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-01-15 14:19:33 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-01-15 14:19:33 +0100 |
| commit | 7dce30ca733f6b310f997c4515e486718b273d44 (patch) | |
| tree | 97f6d7e8776accecd2e50a5df73c1237a0a1dabe /src/checker/checker.h | |
| parent | f061613650f5e7c5e260a4d9a1ca1b1d80ca2f2c (diff) | |
| download | push_swap-7dce30ca733f6b310f997c4515e486718b273d44.tar.gz push_swap-7dce30ca733f6b310f997c4515e486718b273d44.tar.bz2 push_swap-7dce30ca733f6b310f997c4515e486718b273d44.zip | |
WIP: Checker base
Diffstat (limited to 'src/checker/checker.h')
| -rw-r--r-- | src/checker/checker.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/checker/checker.h b/src/checker/checker.h new file mode 100644 index 0000000..1fbb46f --- /dev/null +++ b/src/checker/checker.h @@ -0,0 +1,38 @@ +#ifndef CHECKER_H +# define CHECKER_H + +# include <unistd.h> +# include "common.h" +# include "libft.h" + +typedef enum +{ + STATUS_SUCCESS, + STATUS_FAILURE, + STATUS_ERROR +} t_status; + +typedef enum +{ + ACTION_SA, + ACTION_SB, + ACTION_SS, + ACTION_PA, + ACTION_PB, + ACTION_RA, + ACTION_RB, + ACTION_RR, + ACTION_RRA, + ACTION_RRB, + ACTION_RRR, + ACTION_ERROR, + ACTION_EOF +} t_action; + +t_status check(t_stack *a, t_stack *b); +t_action read_action(void); +t_action str_action(char *s); +void exec_action(t_action action, t_stack *a, t_stack *b); +t_bool stack_sorted(t_stack *stack); + +#endif |
