rename stack_functions folder to stack_utils + add stack add and stack remove functions

This commit is contained in:
David Gailleton
2025-12-08 16:16:23 +01:00
parent 804050576b
commit 8e1bbe674c
7 changed files with 77 additions and 0 deletions

33
stack_utils/push.c Normal file
View File

@@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mteriier <mteriier@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/12/08 15:09:40 by mteriier #+# #+# */
/* Updated: 2025/12/08 15:35:23 by mteriier ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void pa(t_stacks *stacks)
{
t_stack a;
if (!stacks || !stacks->b)
return ;
a = stack->a;
a->value = stacks->b->value;
}
void pb(t_stacks *stacks)
{
t_stack b;
if (!stacks || !stacks->a)
return ;
b = stacks->b;
b->value = stacks->a->value;
}