libft/ft_lstdel.c

24 lines
1.1 KiB
C
Raw Normal View History

2020-11-20 12:31:29 +00:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstdel.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbrochar <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/11/30 21:34:50 by gbrochar #+# #+# */
/* Updated: 2024/10/25 14:32:43 by gbrochar ### ########.fr */
2020-11-20 12:31:29 +00:00
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstdel(t_list **alst, void (*del)(void *, size_t))
{
if (*alst)
2020-11-20 12:31:29 +00:00
{
ft_lstdel(&(*alst)->next, del);
del((*alst)->content, (*alst)->content_size);
ft_memdel((void **)alst);
2020-11-20 12:31:29 +00:00
}
}