starting the bonus and modify the name folder headers -> includes

This commit is contained in:
Maoake Teriierooiterai
2026-01-13 09:40:15 +01:00
parent 696f1ca2d5
commit 7d2fed6e76
18 changed files with 333 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* stack_remove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/12/08 16:05:27 by dgaillet #+# #+# */
/* Updated: 2025/12/12 11:39:02 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
#include <stdlib.h>
void stack_clear_all(t_stack *stack, t_stack *first)
{
if (!stack)
return ;
if (stack->next != first)
stack_clear_all(stack->next, first);
free(stack);
}
void free_all(t_stacks *stacks)
{
if (stacks->a)
stack_clear_all(stacks->a, stacks->a);
if (stacks->b)
stack_clear_all(stacks->b, stacks->b);
free(stacks);
}