debut ecritures fonctions clean et error

This commit is contained in:
hugogogo
2021-06-10 14:20:38 +02:00
parent 8d3fb563dd
commit 64363aeb18
9 changed files with 87 additions and 22 deletions

View File

@@ -0,0 +1,32 @@
#include "pushswap.h"
void is_valid(int ac, char **av)
{
if (ac < 2)
ps_error(1);
(void)av;
}
t_stack *init_stack(int ac, char **av)
{
(void)ac;
(void)av;
t_stack *start;
if (!(start = ft_calloc(1, sizeof(t_stack))))
ps_clean(start, 2);
return (start);
}
int main(int ac, char **av)
{
t_stack *stack;
//t_list *result;
is_valid(ac, av); // check if usage and list are correct
stack = init_stack(ac, av);
// result = sort_algo(stack);
return(0);
}