rra fonctionne

This commit is contained in:
hugogogo
2021-06-15 17:02:15 +02:00
parent dc99227f94
commit 9842a20f6e
14 changed files with 58 additions and 12 deletions

View File

@@ -13,19 +13,33 @@ void ps_error(int err)
ps_usage();
if (err == 2)
ft_printf("error\n");
exit(0);
}
void ps_stop(t_stack *stack_a, t_stack *stack_b, t_list *solution, int err)
void ps_stop(t_stack *stack, t_list *lst, int err)
{
if (stack_a)
ft_lstclear((t_list **)&stack_a, NULL);
if (stack_b)
ft_lstclear((t_list **)&stack_b, NULL);
if (solution)
t_stack **a;
t_stack **b;
t_list *solution;
(void)stack;
(void)a;
(void)b;
(void)solution;
(void)lst;
if (stack)
ft_lstclear((t_list **)&stack, NULL);
if (lst)
{
a = lst->content;
b = lst->next->content;
solution = lst->next->next;
ft_lstclear((t_list **)a, NULL);
ft_lstclear((t_list **)b, NULL);
ft_lstclear(&solution, free);
}
if (err < 0)
return ;
else if (err > 0)
ps_error(err);
exit(0);
}