-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstdel.c
28 lines (25 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstdel.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ggladkov <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/04/20 19:42:08 by ggladkov #+# #+# */
/* Updated: 2017/04/20 19:46:56 by ggladkov ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstdel(t_list **alst, void (*del)(void *, size_t))
{
t_list *current;
t_list *that_one;
current = *alst;
while (current != NULL)
{
that_one = current->next;
del(current, current->content_size);
current = that_one;
}
*alst = NULL;
}