-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstdel.c
executable file
·26 lines (24 loc) · 1.1 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstdel.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dcherend <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/03/30 16:00:24 by dcherend #+# #+# */
/* Updated: 2018/03/31 16:54:23 by dcherend ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstdel(t_list **alst, void (*del)(void *, size_t))
{
if (alst && *alst && del)
{
while (*alst)
{
del((*alst)->content, (*alst)->content_size);
free(*alst);
(*alst) = (*alst)->next;
}
}
}