-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstack_utils2.c
38 lines (34 loc) · 1.2 KB
/
stack_utils2.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* stack_utils2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bgerda <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/24 13:36:19 by bgerda #+# #+# */
/* Updated: 2020/02/24 13:37:16 by bgerda ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void delete_stack(t_stack **stack)
{
t_node *tmp;
t_node *next;
tmp = (*stack)->head;
next = NULL;
while (tmp)
{
next = tmp->next;
free(tmp);
tmp = next;
}
free((*stack)->prop);
free(*stack);
(*stack) = NULL;
}
int checkflag(char *str)
{
if (!ft_strcmp("-v", str))
return (1);
return (0);
}