-
Notifications
You must be signed in to change notification settings - Fork 2
/
ft_lstdel.c
31 lines (28 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
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstdel.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rlambert <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/07 11:38:22 by rlambert #+# #+# */
/* Updated: 2015/01/02 16:23:03 by rlambert ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include "libft.h"
void ft_lstdel(t_list **alst, void (*del)(void*, size_t))
{
t_list *tmp;
t_list *lst;
if (alst == NULL)
return ;
lst = *alst;
while (lst != NULL)
{
tmp = lst->next;
ft_lstdelone(&lst, del);
lst = tmp;
}
*alst = NULL;
}