tgrekov-fdf
HIVE fdf May 2024
Loading...
Searching...
No Matches
ft_lstclear_bonus.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_lstclear_bonus.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2023/10/28 01:38:22 by tgrekov #+# #+# */
9
/* Updated: 2023/11/20 19:21:31 by tgrekov ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
20
#include "
libft.h
"
21
31
void
ft_lstclear
(
t_list
**lst,
void
(*del)(
void
*))
32
{
33
t_list
*next;
34
35
if
(!lst)
36
return ;
37
while
(*lst)
38
{
39
next = (*lst)->
next
;
40
ft_lstdelone
(*lst, del);
41
*lst = next;
42
}
43
}
ft_lstclear
void ft_lstclear(t_list **lst, void(*del)(void *))
Delete every node in a list along with it's content.
Definition
ft_lstclear_bonus.c:31
ft_lstdelone
void ft_lstdelone(t_list *lst, void(*del)(void *))
Delete a node and it's content.
Definition
ft_lstdelone_bonus.c:29
libft.h
s_list
Linked list node.
Definition
libft.h:44
s_list::next
struct s_list * next
Pointer to the next node.
Definition
libft.h:46
deps
libft
ft_lstclear_bonus.c