mise en place des fichiers
This commit is contained in:
28
srcs/stop.c
Normal file
28
srcs/stop.c
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
#include "pushswap.h"
|
||||
|
||||
void ps_usage(void)
|
||||
{
|
||||
ft_printf("usage\n");
|
||||
}
|
||||
|
||||
void ps_error(int err)
|
||||
{
|
||||
if (err == 1)
|
||||
ps_usage();
|
||||
if (err == 2)
|
||||
ft_printf("error\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void stop(t_stack *stack_a, t_stack *stack_b, t_list *solution, int err)
|
||||
{
|
||||
if (stack_a)
|
||||
ft_lstclear((t_list)&stack_a, NULL);
|
||||
if (stack_b)
|
||||
ft_lstclear((t_list)&stack_b, NULL);
|
||||
if (solution)
|
||||
ft_lstclear(&solution, free);
|
||||
ps_error(err);
|
||||
exit(0);
|
||||
}
|
||||
Reference in New Issue
Block a user