-
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.15 KB
/
ft_lstclear.c
File metadata and controls
30 lines (27 loc) · 1.15 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: metaskin <metaskin@student.42istanbul.c +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/01/12 23:19:37 by metaskin #+# #+# */
/* Updated: 2026/01/19 14:55:38 by metaskin ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstclear(t_list **lst, void (*del)(void *))
{
t_list *temp;
t_list *current;
if (lst == NULL || del == NULL)
return ;
current = *lst;
while (current)
{
temp = (*current).next;
ft_lstdelone(current, del);
current = temp;
}
*lst = NULL;
}