adding prototype in push_swap.h and norming some files

This commit is contained in:
Maoake Teriierooiterai
2025-12-10 16:30:26 +01:00
parent 977a4a4b1a
commit b6c1dc73a8
4 changed files with 36 additions and 27 deletions

View File

@@ -24,9 +24,28 @@ t_tab *allocate_tab(int range_max, int nb)
return (tab);
}
void link_tab(t_tab *previous, t_tab *new)
t_tab *get_tabs(t_stack *first)
{
previous->next = new;
t_tab *tmp;
t_tab *first_tab;
int len_stack;
int scan_nb_in_tab;
len_stack = stack_len(first);
first_tab = first_tab(first);
if (!first_tab)
return (NULL);
scan_nb_in_tab = tab->nb_in;
tmp = first_tab;
while (scan_nb_in_tab < len_stack)
{
tmp->next = get_next_tab(first, tmp);
if (!(tmp->next))
return (free_tab(first_tab));
tmp = tmp->next;
scan_nb_in_tab += tmp->nb_in;
}
return (first_tab);
}
t_tab *first_tab(t_stack *first)