Projet de l'école 42 : Libft
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.1 KiB

3 years ago
/* ************************************************************************** */
/* */
/* ::: :::::::: */
3 years ago
/* ft_lstclear.c :+: :+: :+: */
3 years ago
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/22 14:53:04 by narnaud #+# #+# */
3 years ago
/* Updated: 2022/03/24 11:31:05 by narnaud ### ########.fr */
3 years ago
/* */
/* ************************************************************************** */
#include "../libft.h"
3 years ago
void ft_slst_clear(t_slist **lst, void (*del)(void *))
3 years ago
{
3 years ago
t_slist *next_cell;
3 years ago
if (!del)
return ;
while (lst && *lst)
{
next_cell = (*lst)->next;
3 years ago
ft_slst_delone(*lst, del);
3 years ago
*lst = next_cell;
}
}