-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstdel.c
More file actions
executable file
·25 lines (23 loc) · 1.12 KB
/
ft_lstdel.c
File metadata and controls
executable file
·25 lines (23 loc) · 1.12 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstdel.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jspring <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/05/11 14:08:28 by jspring #+# #+# */
/* Updated: 2016/05/12 07:59:04 by jspring ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstdel(t_list **alst, void (*del)(void *, size_t))
{
if (alst != NULL)
{
if ((*alst)->next != NULL)
ft_lstdel(&(*alst)->next, del);
del((*alst)->content, (*alst)->content_size);
free(*alst);
*alst = NULL;
}
}