-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstdel.c
executable file
·28 lines (25 loc) · 1.13 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstdel.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: achambon <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/25 15:21:58 by achambon #+# #+# */
/* Updated: 2017/01/06 12:35:38 by achambon ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstdel(t_list **alst, void (*del)(void *, size_t))
{
t_list *list;
if (!alst || !del)
return ;
while (*alst)
{
list = (*alst)->next;
(*del)((*alst)->content, (*alst)->content_size);
ft_memdel((void*)alst);
*alst = list;
}
}