mirror of
https://github.com/Ladebeze66/libft.git
synced 2025-12-13 04:36:55 +01:00
26 lines
1.1 KiB
C
Executable File
26 lines
1.1 KiB
C
Executable File
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_lstclear.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/02/23 18:19:42 by fgras-ca #+# #+# */
|
|
/* Updated: 2023/02/23 18:22:17 by fgras-ca ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
void ft_lstclear(t_list **lst, void (*del)(void*))
|
|
{
|
|
t_list *temp;
|
|
|
|
while (*lst && lst)
|
|
{
|
|
temp = (*lst)->next;
|
|
ft_lstdelone(*lst, (*del));
|
|
*lst = temp;
|
|
}
|
|
}
|