aboutsummaryrefslogtreecommitdiff
path: root/src/checker/checker.h
blob: 1fbb46f9546a49bf517b419957de980981e6f3f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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