minishell
ft_lstclear.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_lstclear.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: kfujita <kfujita@student.42tokyo.jp> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2022/04/20 00:45:54 by kfujita #+# #+# */
9
/* Updated: 2022/04/25 22:57:19 by kfujita ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include <stddef.h>
14
#include "
ft_lst.h
"
15
16
void
ft_lstclear
(
t_list
**lst,
void
(*del)(
void
*))
17
{
18
t_list
*p_next;
19
20
if
(lst == NULL || *lst == NULL || del == NULL)
21
return ;
22
while
(*lst != NULL)
23
{
24
p_next = (*lst)->
next
;
25
ft_lstdelone
(*lst, del);
26
*lst = p_next;
27
}
28
}
ft_lst.h
ft_lstdelone
void ft_lstdelone(t_list *lst, void(*del)(void *))
Definition:
ft_lstdelone.c:16
ft_lstclear
void ft_lstclear(t_list **lst, void(*del)(void *))
Definition:
ft_lstclear.c:16
t_list
Definition:
ft_lst.h:18
t_list::next
struct s_list * next
Definition:
ft_lst.h:20
libft
ft_lst
ft_lstclear.c
Generated by
1.9.1