25 lines
1 KiB
C
25 lines
1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_lstclear.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/10/04 16:31:06 by mcolonna #+# #+# */
|
|
/* Updated: 2023/10/05 11:40:24 by mcolonna ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
void ft_lstclear(t_list **lst, void (*del)(void *))
|
|
{
|
|
t_list *next;
|
|
|
|
while (*lst)
|
|
{
|
|
next = (*lst)->next;
|
|
ft_lstdelone(*lst, del);
|
|
*lst = next;
|
|
}
|
|
}
|