-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstclear.c
26 lines (23 loc) · 1.05 KB
/
ft_lstclear.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gemartin <gemartin@student.42barc...> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/26 21:20:53 by gemartin #+# #+# */
/* Updated: 2022/01/27 00:56:54 by gemartin ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstclear(t_list **lst, void (*del)(void*))
{
t_list *temp;
while (*lst)
{
temp = (*lst)-> next;
ft_lstdelone(*lst, del);
*lst = temp;
}
*lst = 0;
}