-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstdel.c
29 lines (26 loc) · 1.14 KB
/
ft_lstdel.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstdel.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: srheede <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/31 13:44:37 by srheede #+# #+# */
/* Updated: 2018/05/31 15:51:34 by srheede ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstdel(t_list **alst, void (*del)(void *, size_t))
{
t_list *list;
t_list *list_next;
list = *alst;
while (list)
{
list_next = list->next;
del(list->content, list->content_size);
free(list);
list = list_next;
}
*alst = NULL;
}