-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush.c
37 lines (32 loc) · 1.21 KB
/
push.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: amtadevo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/22 16:55:56 by amtadevo #+# #+# */
/* Updated: 2022/11/22 16:55:58 by amtadevo ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void push(t_stack **src, t_stack **dest)
{
t_stack *tmp;
if (*src == NULL)
return ;
tmp = *src;
*src = (*src)->next;
tmp->next = NULL;
ft_lstadd_front(dest, tmp);
}
void pa(t_stack **a, t_stack **b)
{
push(a, b);
write(1, "pa\n", 3);
}
void pb(t_stack **a, t_stack **b)
{
push(a, b);
write(1, "pb\n", 3);
}