debut ecritures fonctions clean et error
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user