libft
Functions
ft_lstdel.c File Reference
#include "libft.h"
#include <stdlib.h>
+ Include dependency graph for ft_lstdel.c:

Go to the source code of this file.

Functions

void ft_lstdel (t_list **alst, void(*del)(void *, size_t))
 Deletes all links in a list. More...
 

Function Documentation

◆ ft_lstdel()

void ft_lstdel ( t_list **  alst,
void(*)(void *, size_t)  del 
)

Deletes all links in a list.

Takes as a parameter the address of a pointer to a link and frees the memory of this link and every successors of that link using the functions del and free. Finally the pointer to the link that was just freed must be set to NULL (quite similar to the function memdel).

Parameters
alstThe address of a pointer to the first link of a list that needs to be freed.
delThe address of a function to apply to each link of a list.

Definition at line 29 of file ft_lstdel.c.