-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstdelone.c
26 lines (23 loc) · 1.13 KB
/
ft_lstdelone.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_lstdelone.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yochered <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/10/29 10:34:51 by yochered #+# #+# */
/* Updated: 2018/10/29 10:34:52 by yochered ### ########.fr */
/* */
/* ************************************************************************** */
#include <libft.h>
#include <stdlib.h>
void ft_lstdelone(t_list **alst, void (*del)(void *, size_t))
{
t_list *node;
if (!alst || !del)
return ;
node = *alst;
del(node->content, node->content_size);
free(node);
*alst = NULL;
}