-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstdelone.c
27 lines (24 loc) · 1.14 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
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstdelone.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mwilliam <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/03 12:16:54 by mwilliam #+# #+# */
/* Updated: 2016/12/07 15:31:14 by mwilliam ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** Takes a link's pointer address and frees the memory of the content using del
*/
void ft_lstdelone(t_list **alst, void (*del)(void *, size_t))
{
if (*alst && del)
{
del((*alst)->content, (*alst)->content_size);
free(*alst);
*alst = NULL;
}
}