/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* checker.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/18 10:16:12 by cacharle #+# #+# */ /* Updated: 2020/01/19 09:09:29 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ #include #ifndef CHECKER_H # define CHECKER_H # include # include "common.h" # include "libft.h" # define ACTION_ID_BUF_SIZE 4 typedef enum { FLAG_ARG_A, FLAG_ARG_B, FLAG_ARG_A_B, FLAG_ARG_B_A } t_flag_arg; typedef struct { const char *id; t_flag_arg args; union { void (*arg_1)(t_stack *); void (*arg_2)(t_stack *, t_stack *); } func; } t_action; t_status check(t_stack *a, t_stack *b); t_status read_action(t_stack *a, t_stack *b); t_status exec_action(char action_id[ACTION_ID_BUF_SIZE], t_stack *a, t_stack *b); t_bool stack_sorted(t_stack *stack); #endif