/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_lstclear.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: tosuman +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/06/24 16:47:41 by tosuman #+# #+# */ /* Updated: 2023/06/24 17:06:04 by tosuman ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" #include void ft_lstclear(t_list **lst, void (*del)(void *)) { t_list *tmp; if (!lst || !del) return ; tmp = *lst; while (tmp) { *lst = tmp->next; ft_lstdelone(tmp, del); tmp = *lst; } }