-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_dlstclear.c
30 lines (26 loc) · 1.13 KB
/
ft_dlstclear.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_dlstclear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kakiba <kotto555555@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/10 15:20:14 by kakiba #+# #+# */
/* Updated: 2022/12/10 15:30:34 by kakiba ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
//if there isnt del, its just do free
void ft_dlstclear(t_dlist **lst, void (*del)(void*))
{
t_dlist *ndptr;
if (lst == NULL)
return ;
while (*lst)
{
ndptr = (*lst)-> next;
ft_dlstdelone(*lst, del);
*lst = ndptr;
}
lst = NULL;
}