
#ifndef PUSH_SWAP_H
# define PUSH_SWAP_H
# include "libft.h"
# include <unistd.h>	// read(), write(), sleep()
# include <stdlib.h>	// malloc(), free(), exit(), atoi()


typedef struct		s_stack
{
	int				n;
	int				limit;
	struct s_stack	*next;
}					t_stack;

/*
** luke's algo
*/
int			bubble_sort(t_stack **a, t_stack **b, t_list *solution);

/*
** pushswap.c
*/
int			check_flag(int *ac, char ***av);
void		is_valid(int ac, char **av);
t_stack		*init_stack(int ac, char **av);
t_list		*launch_algo(t_stack **a, t_stack **b, int i);

/*
**	stop.c
*/
void		print_test(t_list *lst, char *s);
void		ps_usage(void);
void		ps_error(int i);
void		ps_stop(t_stack *stack, t_list *lst, int i);

/*
** algo.c
*/
void		hugo_sort(t_stack **a, t_stack **b, t_list *lst);

/*
** print.c
*/
void		fill_solution(t_list *lst, char *s);
void		print_result(t_list *lst, int i);

/*
** swap
*/
t_list		*sa(t_stack **a, t_list **lst);
t_list		*sb(t_stack **b, t_list **lst);
t_list		*ss(t_stack **a, t_stack **b, t_list **lst);

/*
** push
*/
t_list		*pa(t_stack **dst, t_stack **src, t_list **lst);
t_list		*pb(t_stack **dst, t_stack **src, t_list **lst);

/*
** rotate
*/
t_list		*ra(t_stack **stack, t_list **lst);
t_list		*rb(t_stack **stack, t_list **lst);
t_list		*rr(t_stack **a, t_stack **b, t_list **lst);

/*
** reverse rotate
*/
t_list		*rra(t_stack **stack, t_list **lst);
t_list		*rrb(t_stack **stack, t_list **lst);
t_list		*rrr(t_stack **a, t_stack **b, t_list **lst);

#endif
