mirror of
https://github.com/DavidGailleton/42-Push_Swap.git
synced 2026-01-27 00:41:57 +00:00
rename stack_functions folder to stack_utils + add stack add and stack remove functions
This commit is contained in:
23
stack_utils/stack_remove.c
Normal file
23
stack_utils/stack_remove.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* stack_remove.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/12/08 16:05:27 by dgaillet #+# #+# */
|
||||
/* Updated: 2025/12/08 16:15:28 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);
|
||||
}
|
||||
Reference in New Issue
Block a user