-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstclear.c
More file actions
30 lines (27 loc) · 1.13 KB
/
ft_lstclear.c
File metadata and controls
30 lines (27 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstclear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: miissa <missa@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/16 08:26:53 by miissa #+# #+# */
/* Updated: 2025/11/16 08:26:53 by miissa ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstclear(t_list **lst, void (*del)(void*))
{
t_list *temp;
t_list *to_delete;
if (!lst || !del)
return ;
temp = *lst;
while (temp)
{
to_delete = temp;
ft_lstdelone(to_delete, del);
temp = temp->next;
}
*lst = NULL;
}