-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.c
56 lines (51 loc) · 1.47 KB
/
init.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* init.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fulloa-s <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/05/18 15:05:00 by gneri #+# #+# */
/* Updated: 2021/05/20 08:40:46 by fulloa-s ### ########.fr */
/* */
/* ************************************************************************** */
#include "checker.h"
void ft_initcmd(t_stack *stacks)
{
t_num *head_a;
t_num *head_b;
head_a = stacks->stack_a;
head_b = stacks->stack_b;
while (head_a)
{
head_a->cmd = NULL;
head_a = head_a->next;
}
while (head_b)
{
head_b->cmd = NULL;
head_b = head_b->next;
}
}
void ft_initflag(t_stack *stacks)
{
t_num *tmp;
tmp = stacks->stack_a;
while (tmp)
{
tmp->count = 0;
tmp->flag = 1;
tmp->sub_c = '0';
tmp->move = NULL;
tmp = tmp->next;
}
tmp = stacks->clone;
while (tmp)
{
tmp->count = 0;
tmp->flag = 1;
tmp->sub_c = '0';
tmp->move = NULL;
tmp = tmp->next;
}
}