minishell
ft_lstclear.c File Reference
#include <stddef.h>
#include "ft_lst.h"
Include dependency graph for ft_lstclear.c:

Go to the source code of this file.

Functions

void ft_lstclear (t_list **lst, void(*del)(void *))
 

Function Documentation

◆ ft_lstclear()

void ft_lstclear ( t_list **  lst,
void(*)(void *)  del 
)

Definition at line 16 of file ft_lstclear.c.

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 }
void ft_lstdelone(t_list *lst, void(*del)(void *))
Definition: ft_lstdelone.c:16
Definition: ft_lst.h:18
struct s_list * next
Definition: ft_lst.h:20
Here is the call graph for this function:
Here is the caller graph for this function: