-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstdel.c
executable file
·29 lines (26 loc) · 1.09 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: ioleksiu <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/27 15:15:44 by ioleksiu #+# #+# */
/* Updated: 2016/12/27 20:28:06 by ioleksiu ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstdel(t_list **alst, void (*del)(void *, size_t))
{
t_list *a;
t_list *b;
a = *alst;
while (a)
{
b = a->next;
del(a->content, a->content_size);
free(a);
a = b;
}
*alst = 0;
}