-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack_push.c
More file actions
37 lines (32 loc) · 1.2 KB
/
stack_push.c
File metadata and controls
37 lines (32 loc) · 1.2 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* stack_push.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yaqliu <yaqliu@student.42barcelona.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/02/08 22:43:37 by yaqliu #+# #+# */
/* Updated: 2026/02/12 14:27:31 by yaqliu ### ########.fr */
/* */
/* ************************************************************************** */
#include "header.h"
void push(t_stack **dst, t_stack **src)
{
t_stack *node;
if (!src || !(*src))
return ;
node = *src;
*src = (*src)->next;
node->next = *dst;
*dst = node;
}
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(b, a);
write(1, "pb\n", 3);
}