-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_push.c
More file actions
38 lines (33 loc) · 1.27 KB
/
Copy pathft_push.c
File metadata and controls
38 lines (33 loc) · 1.27 KB
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
38
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_push.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dpenas-u <dpenas-u@student.42madrid> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/12 09:33:11 by dpenas-u #+# #+# */
/* Updated: 2022/04/12 13:37:19 by dpenas-u ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include "ft_push_swap.h"
void ft_pushb(t_list **lst1, t_list **lst2)
{
t_list *aux;
if (!(*lst1))
return ;
aux = *lst1;
*lst1 = (*lst1)->next;
ft_lstadd_front(lst2, aux);
ft_putendl_fd("pb", 1);
}
void ft_pusha(t_list **lst1, t_list **lst2)
{
t_list *aux;
if (!(*lst2))
return ;
aux = *lst2;
*lst2 = (*lst2)->next;
ft_lstadd_front(lst1, aux);
ft_putendl_fd("pa", 1);
}