-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstclear.c
32 lines (28 loc) · 1.19 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
27
28
29
30
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: iw90 <iw90@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/15 15:17:21 by inwagner #+# #+# */
/* Updated: 2022/10/02 11:56:33 by iw90 ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
void ft_lstclear(t_list **lst, void (*del)(void *))
{
t_list *aux;
while (*lst)
{
aux = (*lst)->next;
ft_lstdelone(*lst, del);
*lst = aux;
}
*lst = 0;
}
/*
Deleta e libera a memória do node e de todos depois dele, o ponteiro para a lista deve se tornar nulo.
Retorna nada.
*/